make it exitable

This commit is contained in:
olebeck 2022-06-09 10:34:35 +02:00
parent 7c8fa4048c
commit 41e8e91aa7
1 changed files with 15 additions and 7 deletions

View File

@ -31,8 +31,7 @@ void display() {
*p++ = on ? '#' : ' ';
*p++ = on ? '#' : ' ';
}
*p = '\n';
p++;
*p++ = '\n';
}
write(1, clear_screen, sizeof(clear_screen)-1);
write(1, buf, sizeof(buf));
@ -70,6 +69,12 @@ int main(void) {
PocketInit();
#endif
#ifdef LOOP
uint8_t loop = 1;
#else
uint8_t loop = 0;
#endif
do {
// read all frames
uint8_t* p = _binary_badapple_bin_start;
@ -94,12 +99,15 @@ int main(void) {
px += count;
}
display();
#ifdef __POCKETSTATION__
if(PAD_STATUS & PAD_BUTTON) {
loop = 0;
break;
}
#endif
}
#ifdef LOOP
} while(1);
#else
} while(0);
#endif
} while(loop);
#ifdef __POCKETSTATION__
PocketExit();