mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-04 20:54:17 -04:00
fw: Set LED colors
- Set LED color to white when firmware has initialized - Set LED color to black when changing state to loading - Set LED color to blue when starting testloadapp - Update mgmt app allowed digest since testloadapp changed
This commit is contained in:
parent
edbcdb111f
commit
15a350da1e
3 changed files with 10 additions and 5 deletions
|
@ -2,6 +2,7 @@
|
|||
#include <monocypher/monocypher-ed25519.h>
|
||||
#include <stdint.h>
|
||||
#include <tkey/debug.h>
|
||||
#include <tkey/led.h>
|
||||
#include <tkey/lib.h>
|
||||
#include <tkey/tk1_mem.h>
|
||||
|
||||
|
@ -161,6 +162,8 @@ int main(void)
|
|||
uint8_t available;
|
||||
uint8_t in = 0;
|
||||
|
||||
led_set(LED_BLUE);
|
||||
|
||||
// Generate a key pair from CDI
|
||||
crypto_ed25519_key_pair(secret_key, pubkey, (uint8_t *)cdi);
|
||||
|
||||
|
|
|
@ -252,6 +252,8 @@ static enum state initial_commands(const struct frame_header *hdr,
|
|||
|
||||
ctx->left = *app_size;
|
||||
|
||||
led_set(LED_BLACK);
|
||||
|
||||
state = FW_STATE_LOADING;
|
||||
break;
|
||||
}
|
||||
|
@ -496,8 +498,6 @@ int main(void)
|
|||
uint8_t cmd[CMDSIZE] = {0};
|
||||
enum state state = FW_STATE_INITIAL;
|
||||
|
||||
led_set(LED_BLUE);
|
||||
|
||||
print_hw_version();
|
||||
|
||||
/*@-mustfreeonly@*/
|
||||
|
@ -515,6 +515,8 @@ int main(void)
|
|||
assert(1 == 2);
|
||||
}
|
||||
|
||||
led_set(LED_WHITE);
|
||||
|
||||
#if defined(SIMULATION)
|
||||
run(&ctx);
|
||||
#endif
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
//
|
||||
// To update this, compute the BLAKE2s digest of the app.bin
|
||||
static const uint8_t allowed_app_digest[32] = {
|
||||
0x7e, 0x6e, 0x12, 0x72, 0x79, 0xcc, 0x3c, 0x6a, 0xf2, 0x67, 0x28,
|
||||
0x7d, 0x72, 0xcf, 0x26, 0x85, 0x61, 0xb0, 0x62, 0x29, 0x2f, 0x56,
|
||||
0x98, 0x7a, 0xf0, 0xb, 0x3e, 0xce, 0x39, 0xde, 0x5e, 0xe3,
|
||||
0xf8, 0x90, 0x34, 0x31, 0xe0, 0xed, 0xab, 0x8b, 0x91, 0xe5, 0x63,
|
||||
0xe6, 0xea, 0x6a, 0x49, 0xe6, 0x53, 0x1e, 0xc7, 0x47, 0xca, 0x2f,
|
||||
0x2b, 0x8f, 0xf3, 0x5e, 0x67, 0x13, 0x0f, 0xfa, 0x93, 0x36,
|
||||
};
|
||||
|
||||
static uint8_t current_app_digest[32];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue