Update misc.c

This commit is contained in:
rehius 2023-05-26 22:45:24 +00:00 committed by GitHub
parent e98219c475
commit ef474b7f20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

6
misc.c
View file

@ -84,8 +84,12 @@ void halt_with_error(uint32_t err, uint32_t bits)
{ {
bool is_long = err & (1 << (bits - i - 1)); bool is_long = err & (1 << (bits - i - 1));
sleep_ms(is_long ? LONG_PAUSE_TIME : SHORT_PAUSE_TIME); sleep_ms(is_long ? LONG_PAUSE_TIME : SHORT_PAUSE_TIME);
bool success = bits == 1 && is_long == 0;
if (success)
put_pixel(PIX_whi);
else
put_pixel(PIX_yel); put_pixel(PIX_yel);
sleep_ms(is_long ? LONG_TIME : SHORT_TIME); sleep_ms(is_long ? LONG_TIME : success ? SHORT_TIME * 2 : SHORT_TIME);
put_pixel(0); put_pixel(0);
if (i != bits - 1 || j != CODE_REPEATS - 1) if (i != bits - 1 || j != CODE_REPEATS - 1)
sleep_ms(is_long ? LONG_PAUSE_TIME : SHORT_PAUSE_TIME); sleep_ms(is_long ? LONG_PAUSE_TIME : SHORT_PAUSE_TIME);