mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-07 22:22:29 -04:00
fw: Introduce an explicit state machine - changes protocol!
We introduce an explicit state machine (see README). With the new states we: - combine setting size and USS to a single command. - start the device app immediatiely when having receceived the last data chunk and returning the digest. - Loop forever and wait for the stick to be removed if we end up in unknown state. Signed-off-by: Michael Cardell Widerkrantz <mc@tillitis.se>
This commit is contained in:
parent
2fa1ffb8e7
commit
c80dc53027
5 changed files with 243 additions and 191 deletions
|
@ -71,12 +71,7 @@ void fwreply(struct frame_header hdr, enum fwcmd rspcode, uint8_t *buf)
|
|||
nbytes = 32;
|
||||
break;
|
||||
|
||||
case FW_RSP_LOAD_USS:
|
||||
len = LEN_4;
|
||||
nbytes = 4;
|
||||
break;
|
||||
|
||||
case FW_RSP_LOAD_APP_SIZE:
|
||||
case FW_RSP_LOAD_APP:
|
||||
len = LEN_4;
|
||||
nbytes = 4;
|
||||
break;
|
||||
|
@ -86,12 +81,7 @@ void fwreply(struct frame_header hdr, enum fwcmd rspcode, uint8_t *buf)
|
|||
nbytes = 4;
|
||||
break;
|
||||
|
||||
case FW_RSP_RUN_APP:
|
||||
len = LEN_4;
|
||||
nbytes = 4;
|
||||
break;
|
||||
|
||||
case FW_RSP_GET_APP_DIGEST:
|
||||
case FW_RSP_LOAD_APP_DATA_READY:
|
||||
len = LEN_128;
|
||||
nbytes = 128;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue