Merge pull request #22 from xunker/optimize-led-blink-on-error

Use `gpio_read` to toggle led state, saves 24 bytes of flash.
This commit is contained in:
Eric Helgeson 2021-06-01 11:52:04 -05:00 committed by GitHub
commit 2cdbd10dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -535,9 +535,7 @@ void onFalseInit(void)
LOG_FILE.sync(); LOG_FILE.sync();
while(true) { while(true) {
for(int i = 0; i < 3; i++) { for(int i = 0; i < 3; i++) {
gpio_write(LED, high); gpio_write(LED, !gpio_read(LED));
delay(250);
gpio_write(LED, low);
delay(250); delay(250);
} }
delay(3000); delay(3000);
@ -551,9 +549,7 @@ void noSDCardFound(void)
{ {
while(true) { while(true) {
for(int i = 0; i < 5; i++) { for(int i = 0; i < 5; i++) {
gpio_write(LED, high); gpio_write(LED, !gpio_read(LED));
delay(250);
gpio_write(LED, low);
delay(250); delay(250);
} }
delay(3000); delay(3000);