stabil ueber 2 Minuten

This commit is contained in:
Tristan Krause 2019-04-01 16:08:32 +02:00
parent c278274ed0
commit 84fe8b72eb
8 changed files with 31057 additions and 26 deletions

Binary file not shown.

View file

@ -186,7 +186,7 @@
:100B90000E94180241E063E371E084E291E00C946A
:100BA0001802EE0FFF1F0024001C0BBE0790F691E9
:080BB000E02D0994F894FFCF39
:100BB800626F617264696E666F2E680030383A3110
:100BC800363A3531004170722020312032303139C7
:100BB800626F617264696E666F2E680031353A3211
:100BC800393A3032004170722020312032303139C8
:020BD80000001B
:00000001FF

View file

@ -97,14 +97,21 @@ uint16_t USART::readInt()
void USART::readBlock(uint8_t* ptr, uint8_t offset)
{
ptr += offset;
uint8_t crc;
uint8_t crc = 0x7F;
do
{
crc = 0;
uint8_t len = readByte();
if(len > MAX_BLOCK_SIZE)
if(len == 0x80) // out of sync, war bereits stoppbyte
{
writeByte(MSG_FAIL);
continue;
}
else if(len > MAX_BLOCK_SIZE)
len = 0;
crc = 0;
for(uint8_t k = 0; k <= len; k++) // len + 1 Durchgänge (+ crc)
{
uint8_t next = readByte();