mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-10-01 01:45:38 -04:00
Flash red when ending in unknown stat
Signed-off-by: Daniel Lublin <daniel@lublin.se>
This commit is contained in:
parent
687ee4f8b1
commit
a2bc95f49a
@ -91,6 +91,17 @@ static void compute_cdi(uint8_t digest[32], uint8_t use_uss, uint8_t uss[32])
|
|||||||
wordcpy((void *)cdi, (void *)local_cdi, 8);
|
wordcpy((void *)cdi, (void *)local_cdi, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void forever_redflash()
|
||||||
|
{
|
||||||
|
int led_on = 0;
|
||||||
|
for (;;) {
|
||||||
|
*led = led_on ? LED_RED : 0;
|
||||||
|
for (volatile int i = 0; i < 800000; i++) {
|
||||||
|
}
|
||||||
|
led_on = !led_on;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
enum state {
|
enum state {
|
||||||
FW_STATE_INITIAL,
|
FW_STATE_INITIAL,
|
||||||
FW_STATE_INIT_LOADING,
|
FW_STATE_INIT_LOADING,
|
||||||
@ -163,13 +174,10 @@ int main()
|
|||||||
break; // This is never reached!
|
break; // This is never reached!
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Unknown state!?
|
|
||||||
puts("Unknown firmware state 0x");
|
puts("Unknown firmware state 0x");
|
||||||
puthex(state);
|
puthex(state);
|
||||||
lf();
|
lf();
|
||||||
|
forever_redflash();
|
||||||
asm volatile("forever:;"
|
|
||||||
"j forever;");
|
|
||||||
break; // Not reached
|
break; // Not reached
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user