mirror of
https://github.com/markqvist/MicroModemGP
synced 2026-08-12 17:40:37 -04:00
Updated readme
This commit is contained in:
parent
9fcfa4de63
commit
5fd79a3e82
3 changed files with 16 additions and 105 deletions
|
|
@ -4,7 +4,7 @@
|
|||
#include "device.h"
|
||||
#include "KISS.h"
|
||||
|
||||
static uint8_t serialBuffer[LLP_MAX_FRAME_LENGTH]; // Buffer for holding incoming serial data
|
||||
static uint8_t serialBuffer[LLP_MAX_DATA_SIZE]; // Buffer for holding incoming serial data
|
||||
LLPCtx *llpCtx;
|
||||
Afsk *channel;
|
||||
Serial *serial;
|
||||
|
|
@ -103,7 +103,7 @@ void kiss_serialCallback(uint8_t sbyte) {
|
|||
timeout_ticks = timer_clock();
|
||||
IN_FRAME = true;
|
||||
serialBuffer[frame_len++] = sbyte;
|
||||
if (frame_len >= LLP_MAX_FRAME_LENGTH) kiss_checkTimeout(true);
|
||||
if (frame_len >= LLP_MAX_DATA_SIZE) kiss_checkTimeout(true);
|
||||
#else
|
||||
if (IN_FRAME && sbyte == FEND && command == CMD_DATA) {
|
||||
IN_FRAME = false;
|
||||
|
|
@ -112,7 +112,7 @@ void kiss_serialCallback(uint8_t sbyte) {
|
|||
IN_FRAME = true;
|
||||
command = CMD_UNKNOWN;
|
||||
frame_len = 0;
|
||||
} else if (IN_FRAME && frame_len < LLP_MAX_FRAME_LENGTH) {
|
||||
} else if (IN_FRAME && frame_len < LLP_MAX_DATA_SIZE) {
|
||||
// Have a look at the command byte first
|
||||
if (frame_len == 0 && command == CMD_UNKNOWN) {
|
||||
// MicroModem supports only one HDLC port, so we
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
#define LLP_INTERLEAVE_SIZE 12
|
||||
#define LLP_MIN_FRAME_LENGTH LLP_INTERLEAVE_SIZE
|
||||
#define LLP_MAX_FRAME_LENGTH 65 * LLP_INTERLEAVE_SIZE
|
||||
#define LLP_MAX_FRAME_LENGTH 67 * LLP_INTERLEAVE_SIZE
|
||||
#define LLP_HEADER_SIZE 10
|
||||
#define LLP_CHECKSUM_SIZE 2
|
||||
#define LLP_MAX_DATA_SIZE LLP_MAX_FRAME_LENGTH - LLP_HEADER_SIZE - LLP_CHECKSUM_SIZE // TODO: this is not right
|
||||
#define LLP_MAX_DATA_SIZE LLP_MAX_FRAME_LENGTH - LLP_HEADER_SIZE - LLP_CHECKSUM_SIZE
|
||||
#define LLP_DATA_BLOCK_SIZE ((LLP_INTERLEAVE_SIZE/3)*2)
|
||||
|
||||
#define LLP_CRC_SIZE 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue