mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 06:53:37 +00:00
interrupt safe USB send function
This commit is contained in:
parent
5137457545
commit
c05d248f83
13 changed files with 38 additions and 73 deletions
|
|
@ -59,6 +59,12 @@ uint16_t Protocol::DecodeBuffer(uint8_t *buf, uint16_t len, PacketInfo *info) {
|
|||
return data - buf;
|
||||
}
|
||||
|
||||
if(length > sizeof(PacketInfo) * 2) {
|
||||
// larger than twice the maximum expected packet size, probably an error, ignore
|
||||
info->type = PacketType::None;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* The complete frame has been received, check checksum */
|
||||
auto type = (PacketType) data[3];
|
||||
uint32_t crc = *(uint32_t*) &data[length - 4];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue