Reimplement the initial wait

master
LEdoian 5 years ago
parent dc0ff5562c
commit d1b7415563

@ -19,8 +19,8 @@
#define DELAY 4000000 // This is bad -- it's a value that was found to be OK
#define STM32F1 1 // Needed for libopencm3
enum {FORWARD, BACKWARD} direction;
bool running = false;
volatile enum {FORWARD, BACKWARD} direction;
volatile bool running = false;
void setup (void) { // All the blackbox code
@ -79,6 +79,9 @@ int main (void) {
char state = 0;
int i;
// Initial wait
while (!running) ;
while (true) {
for (i=0 ; i<DELAY ; i++) {
__asm ("nop");

Loading…
Cancel
Save