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
20
avr/send.c
20
avr/send.c
|
@ -198,8 +198,24 @@ int main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case 2: {
|
case 2: {
|
||||||
header.type = c;
|
switch (c) {
|
||||||
i++;
|
case 0x01:
|
||||||
|
case 0x02:
|
||||||
|
case 0x04:
|
||||||
|
case 0x08:
|
||||||
|
case 0x0f: {
|
||||||
|
header.type = c;
|
||||||
|
i++;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue