Skip to content

Commit 3a0182d

Browse files
committed
Add delay command support
1 parent c89f4b7 commit 3a0182d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ static void command_loop(void)
132132
case S_CMD_NOP:
133133
sendbyte_blocking(S_ACK);
134134
break;
135+
case S_CMD_O_DELAY:
136+
{
137+
uint32_t delay;
138+
readbytes_blocking(&delay, 3);
139+
sleep_us(delay);
140+
sendbyte_blocking(S_ACK);
141+
break;
142+
}
135143
case S_CMD_Q_IFACE:
136144
sendbyte_blocking(S_ACK);
137145
sendbyte_blocking(0x01);
@@ -153,6 +161,7 @@ static void command_loop(void)
153161
{
154162
static const uint32_t cmdmap[8] = {
155163
(1 << S_CMD_NOP) |
164+
(1 << S_CMD_O_DELAY) |
156165
(1 << S_CMD_Q_IFACE) |
157166
(1 << S_CMD_Q_RDNMAXLEN) |
158167
(1 << S_CMD_Q_WRNMAXLEN) |

0 commit comments

Comments
 (0)