altos-avr: Store TM tick and state in log, get logging on/off working
[fw/altos] / src-avr / ao_storage.c
index 69183514d89325ec7dd7fab582a2b665bc84c242..be2d3a03074658bfc0197d17456a70fc83a12ccf 100644 (file)
@@ -153,8 +153,13 @@ ao_storage_zapall(void) __reentrant
        ao_cmd_white();
        if (!ao_match_word("DoIt"))
                return;
+       if (ao_log_running) {
+               printf("Log is running, cannot erase\n");
+               return;
+       }
        for (pos = 0; pos < ao_storage_config; pos += ao_storage_block)
                ao_storage_erase(pos);
+       ao_log_restart();
 }
 
 void