forked from Mirrors/usk
Update misc.c
This commit is contained in:
parent
e98219c475
commit
ef474b7f20
1 changed files with 6 additions and 2 deletions
6
misc.c
6
misc.c
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue