Add more validation to serial read state machine
This commit is contained in:
parent
e8cfe8e77a
commit
445c52cdf4
1 changed files with 18 additions and 2 deletions
16
avr/send.c
16
avr/send.c
|
@ -198,12 +198,28 @@ int main() {
|
|||
}
|
||||
|
||||
case 2: {
|
||||
switch (c) {
|
||||
case 0x01:
|
||||
case 0x02:
|
||||
case 0x04:
|
||||
case 0x08:
|
||||
case 0x0f: {
|
||||
header.type = c;
|
||||
i++;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
i = 0;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 3: {
|
||||
header.compression = c;
|
||||
i++;
|
||||
|
|
Loading…
Add table
Reference in a new issue