This commit is contained in:
2020-06-29 20:01:55 +02:00
parent 75e9d63341
commit 285ef30439
10 changed files with 154 additions and 65 deletions

View File

@ -1992,6 +1992,10 @@ void *start_timer(void *arg) {
int stopStateMachine() {
LOG(logINFORED, ("Stopping State Machine\n"));
// if scan active, stop scan
if (sharedMemory_getScanStatus()) {
sharedMemory_setScanStop(1);
}
#ifdef VIRTUAL
if (!isControlServer) {
virtual_stop = 1;
@ -2019,20 +2023,19 @@ int stopStateMachine() {
}
enum runStatus getRunStatus() {
LOG(logDEBUG1, ("Getting status\n"));
#ifdef VIRTUAL
if (!isControlServer) {
virtual_status = sharedMemory_getStatus();
}
if (virtual_status == 0) {
LOG(logINFOBLUE, ("Status: IDLE\n"));
return IDLE;
} else {
if (sharedMemory_getScanStatus() || sharedMemory_getStatus()) {
LOG(logINFOBLUE, ("Status: RUNNING\n"));
return RUNNING;
}
LOG(logINFOBLUE, ("Status: IDLE\n"));
return IDLE;
#endif
LOG(logDEBUG1, ("Getting status\n"));
if (sharedMemory_getScanStatus()) {
LOG(logINFOBLUE, ("Status: Scan RUNNING\n"));
return RUNNING;
}
uint32_t retval = bus_r(STATUS_REG);
LOG(logINFO, ("Status Register: %08x\n", retval));