diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index 91f4590..3fa3a16 --- a/Makefile +++ b/Makefile @@ -167,8 +167,8 @@ REMOVE = rm -f COPY = cp HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex -ELFSIZE = $(SIZE) -C $(TARGET).elf - +# ELFSIZE = $(SIZE) -C $(TARGET).elf +ELFSIZE = $(SIZE) --mcu=$(MCU) -C $(TARGET).elf # Define Messages diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/config.h b/config.h old mode 100644 new mode 100755 diff --git a/device.h b/device.h old mode 100644 new mode 100755 diff --git a/hardware/AFSK.c b/hardware/AFSK.c old mode 100644 new mode 100755 index fdad26d..9fc5c97 --- a/hardware/AFSK.c +++ b/hardware/AFSK.c @@ -405,7 +405,7 @@ void AFSK_adc_isr(Afsk *afsk, int8_t currentSample) { // Window // // Every time we detect a signal transition, we adjust - // where this window is positioned little. How much we + // where this window is positioned a little. How much we // adjust it is defined by PHASE_INC. If our current phase // phase counter value is less than half of PHASE_MAX (ie, // the window size) when a signal transition is detected, @@ -440,7 +440,7 @@ void AFSK_adc_isr(Afsk *afsk, int8_t currentSample) { afsk->actualBits <<= 1; // We determine the actual bit value by reading - // the last 3 sampled bits. If there is three or + // the last 3 sampled bits. If there is two or // more 1's, we will assume that the transmitter // sent us a one, otherwise we assume a zero uint8_t bits = afsk->sampledBits & 0x07; diff --git a/hardware/AFSK.h b/hardware/AFSK.h old mode 100644 new mode 100755 index 45e5643..5ec1457 --- a/hardware/AFSK.h +++ b/hardware/AFSK.h @@ -42,7 +42,7 @@ inline static uint8_t sinSample(uint16_t i) { #define CONFIG_AFSK_RX_BUFLEN 64 #define CONFIG_AFSK_TX_BUFLEN 64 #define CONFIG_AFSK_RXTIMEOUT 0 -#define CONFIG_AFSK_PREAMBLE_LEN 150UL +#define CONFIG_AFSK_PREAMBLE_LEN 350UL #define CONFIG_AFSK_TRAILER_LEN 25UL #define BIT_STUFF_LEN 5 @@ -52,11 +52,16 @@ inline static uint8_t sinSample(uint16_t i) { #define SAMPLESPERBIT (SAMPLERATE / BITRATE) #define PHASE_INC 1 // Nudge by an eigth of a sample each adjustment -#if BITRATE == 960 +#if BITRATE == 300 + #define FILTER_CUTOFF 600 + #define MARK_FREQ 1600 + #define SPACE_FREQ 1800 + #define PHASE_BITS 10 // How much to increment phase counter each sample +#elif BITRATE == 960 #define FILTER_CUTOFF 600 #define MARK_FREQ 960 #define SPACE_FREQ 1600 - #define PHASE_BITS 10 // How much to increment phase counter each sample + #define PHASE_BITS 10 #elif BITRATE == 1200 #define FILTER_CUTOFF 600 #define MARK_FREQ 1200 diff --git a/hardware/Serial.c b/hardware/Serial.c old mode 100644 new mode 100755 diff --git a/hardware/Serial.h b/hardware/Serial.h old mode 100644 new mode 100755 diff --git a/images/.keepdir b/images/.keepdir old mode 100644 new mode 100755 diff --git a/main.c b/main.c old mode 100644 new mode 100755 diff --git a/precompiled/MicroModemGP-3v-direct.hex b/precompiled/MicroModemGP-3v-direct.hex old mode 100644 new mode 100755 diff --git a/precompiled/MicroModemGP-3v-kiss.hex b/precompiled/MicroModemGP-3v-kiss.hex old mode 100644 new mode 100755 diff --git a/precompiled/MicroModemGP-5v-direct.hex b/precompiled/MicroModemGP-5v-direct.hex old mode 100644 new mode 100755 diff --git a/precompiled/MicroModemGP-5v-kiss.hex b/precompiled/MicroModemGP-5v-kiss.hex old mode 100644 new mode 100755 diff --git a/protocol/AX25.c b/protocol/AX25.c old mode 100644 new mode 100755 diff --git a/protocol/AX25.h b/protocol/AX25.h old mode 100644 new mode 100755 index 0314bdb..f7d222f --- a/protocol/AX25.h +++ b/protocol/AX25.h @@ -20,13 +20,7 @@ struct AX25Ctx; // Forward declarations struct AX25Msg; -#if SERIAL_PROTOCOL == PROTOCOL_KISS - typedef void (*ax25_callback_t)(struct AX25Ctx *ctx); -#endif - -#if SERIAL_PROTOCOL == PROTOCOL_SIMPLE_SERIAL - typedef void (*ax25_callback_t)(struct AX25Msg *msg); -#endif +typedef void (*ax25_callback_t)(struct AX25Ctx *ctx); typedef struct AX25Ctx { uint8_t buf[AX25_MAX_FRAME_LEN]; @@ -39,33 +33,6 @@ typedef struct AX25Ctx { bool escape; } AX25Ctx; -#if SERIAL_PROTOCOL == PROTOCOL_SIMPLE_SERIAL - #define AX25_CALL(str, id) {.call = (str), .ssid = (id) } - #define AX25_MAX_RPT 8 - #define AX25_REPEATED(msg, n) ((msg)->rpt_flags & BV(n)) - - typedef struct AX25Call { - char call[6]; - uint8_t ssid; - } AX25Call; - - typedef struct AX25Msg { - AX25Call src; - AX25Call dst; - AX25Call rpt_list[AX25_MAX_RPT]; - uint8_t rpt_count; - uint8_t rpt_flags; - uint16_t ctrl; - uint8_t pid; - const uint8_t *info; - size_t len; - } AX25Msg; - - void ax25_sendVia(AX25Ctx *ctx, const AX25Call *path, size_t path_len, const void *_buf, size_t len); - #define ax25_send(ctx, dst, src, buf, len) ax25_sendVia(ctx, ({static AX25Call __path[]={dst, src}; __path;}), 2, buf, len) - -#endif - void ax25_poll(AX25Ctx *ctx); void ax25_sendRaw(AX25Ctx *ctx, void *_buf, size_t len); void ax25_init(AX25Ctx *ctx, FILE *channel, ax25_callback_t hook); diff --git a/protocol/HDLC.h b/protocol/HDLC.h old mode 100644 new mode 100755 diff --git a/protocol/KISS.c b/protocol/KISS.c old mode 100644 new mode 100755 index 39c41d5..76c6eb1 --- a/protocol/KISS.c +++ b/protocol/KISS.c @@ -27,12 +27,12 @@ void kiss_init(LLPCtx *ctx, Afsk *afsk, Serial *ser) { } void kiss_messageCallback(LLPCtx *ctx) { - if (SERIAL_FRAMING == SERIAL_FRAMING_DIRECT) { + #if (SERIAL_FRAMING == SERIAL_FRAMING_DIRECT) for (unsigned i = 0; i < ctx->frame_len; i++) { uint8_t b = ctx->buf[i]; fputc(b, &serial->uart0); } - } else { + #else fputc(FEND, &serial->uart0); fputc(0x00, &serial->uart0); for (unsigned i = 0; i < ctx->frame_len; i++) { @@ -48,7 +48,7 @@ void kiss_messageCallback(LLPCtx *ctx) { } } fputc(FEND, &serial->uart0); - } + #endif } void kiss_csma(LLPCtx *ctx, uint8_t *buf, size_t len) { diff --git a/protocol/KISS.h b/protocol/KISS.h old mode 100644 new mode 100755 diff --git a/protocol/LLP.c b/protocol/LLP.c old mode 100644 new mode 100755 diff --git a/protocol/LLP.h b/protocol/LLP.h old mode 100644 new mode 100755 diff --git a/util/CRC-CCIT.c b/util/CRC-CCIT.c old mode 100644 new mode 100755 diff --git a/util/CRC-CCIT.h b/util/CRC-CCIT.h old mode 100644 new mode 100755 diff --git a/util/FIFO.h b/util/FIFO.h old mode 100644 new mode 100755 diff --git a/util/constants.h b/util/constants.h old mode 100644 new mode 100755 diff --git a/util/time.h b/util/time.h old mode 100644 new mode 100755