running flag
This commit is contained in:
parent
e3213c49d7
commit
a86c093b33
1 changed files with 10 additions and 3 deletions
13
main.cpp
13
main.cpp
|
@ -18,9 +18,10 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
|
||||||
bool withUI { false };
|
bool withUI { false };
|
||||||
uint32_t event { 0 };
|
uint32_t event { 0 };
|
||||||
std::atomic_bool terminate { false };
|
std::atomic_bool terminate { false };
|
||||||
|
std::atomic_bool *running { nullptr };
|
||||||
|
|
||||||
void loadbin(bus *const b, uint16_t base, const char *const file)
|
void loadbin(bus *const b, uint16_t base, const char *const file)
|
||||||
{
|
{
|
||||||
|
@ -225,6 +226,8 @@ int main(int argc, char *argv[])
|
||||||
setBootLoader(b);
|
setBootLoader(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
running = cnsl->get_running_flag();
|
||||||
|
|
||||||
tty *tty_ = new tty(cnsl);
|
tty *tty_ = new tty(cnsl);
|
||||||
|
|
||||||
b->add_tty(tty_);
|
b->add_tty(tty_);
|
||||||
|
@ -254,6 +257,8 @@ int main(int argc, char *argv[])
|
||||||
const unsigned long start = get_ms();
|
const unsigned long start = get_ms();
|
||||||
unsigned long interval_start = start;
|
unsigned long interval_start = start;
|
||||||
|
|
||||||
|
*running = true;
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
c->step();
|
c->step();
|
||||||
|
|
||||||
|
@ -310,6 +315,8 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*running = false;
|
||||||
|
|
||||||
terminate = true;
|
terminate = true;
|
||||||
|
|
||||||
delete b;
|
delete b;
|
||||||
|
|
Loading…
Add table
Reference in a new issue