Skip to content

Commit

Permalink
kiss sanity checking
Browse files Browse the repository at this point in the history
  • Loading branch information
sq8vps committed Oct 3, 2023
1 parent da31c81 commit 061508c
Show file tree
Hide file tree
Showing 6 changed files with 418 additions and 1,706 deletions.
587 changes: 396 additions & 191 deletions .cproject

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Core/Src/digipeater.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ void DigiStoreDeDupe(uint8_t *buf, uint16_t size)
while((buf[i] & 1) == 0) //look for path end bit (skip path)
{
i++;
if(i == size)
return;
}
i++;

Expand Down
20 changes: 20 additions & 0 deletions Core/Src/kiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,26 @@ void KissParse(Uart *port, uint8_t data)
}
}

uint16_t pathEnd = 0;

//find path end bit (C-bit)
for(uint16_t i = 0; i < port->kissBufferHead; i++)
{
if((port->kissBuffer[i + 1] & 1) != 0)
{
pathEnd = i + 1;
break;
}
}

//C-bit must lay on a 7 byte boundary (every path element is 7 bytes long)
if(pathEnd % 7)
{
port->kissBufferHead = 0;
return;
}


__disable_irq();
port->kissProcessingOngoing = 1;
port->kissTempBufferHead = 0;
Expand Down
Loading

0 comments on commit 061508c

Please sign in to comment.