mirror of
https://github.com/markqvist/MicroModemGP
synced 2026-08-12 17:40:37 -04:00
Housekeeping
This commit is contained in:
parent
207898041c
commit
22a2b2ea6f
28 changed files with 16 additions and 44 deletions
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
LICENSE
Normal file → Executable file
0
LICENSE
Normal file → Executable file
4
Makefile
Normal file → Executable file
4
Makefile
Normal file → Executable file
|
|
@ -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
|
||||
|
|
|
|||
0
README.md
Normal file → Executable file
0
README.md
Normal file → Executable file
0
config.h
Normal file → Executable file
0
config.h
Normal file → Executable file
0
device.h
Normal file → Executable file
0
device.h
Normal file → Executable file
4
hardware/AFSK.c
Normal file → Executable file
4
hardware/AFSK.c
Normal file → Executable file
|
|
@ -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;
|
||||
|
|
|
|||
11
hardware/AFSK.h
Normal file → Executable file
11
hardware/AFSK.h
Normal file → Executable file
|
|
@ -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
|
||||
|
|
|
|||
0
hardware/Serial.c
Normal file → Executable file
0
hardware/Serial.c
Normal file → Executable file
0
hardware/Serial.h
Normal file → Executable file
0
hardware/Serial.h
Normal file → Executable file
0
images/.keepdir
Normal file → Executable file
0
images/.keepdir
Normal file → Executable file
0
main.c
Normal file → Executable file
0
main.c
Normal file → Executable file
0
precompiled/MicroModemGP-3v-direct.hex
Normal file → Executable file
0
precompiled/MicroModemGP-3v-direct.hex
Normal file → Executable file
0
precompiled/MicroModemGP-3v-kiss.hex
Normal file → Executable file
0
precompiled/MicroModemGP-3v-kiss.hex
Normal file → Executable file
0
precompiled/MicroModemGP-5v-direct.hex
Normal file → Executable file
0
precompiled/MicroModemGP-5v-direct.hex
Normal file → Executable file
0
precompiled/MicroModemGP-5v-kiss.hex
Normal file → Executable file
0
precompiled/MicroModemGP-5v-kiss.hex
Normal file → Executable file
0
protocol/AX25.c
Normal file → Executable file
0
protocol/AX25.c
Normal file → Executable file
35
protocol/AX25.h
Normal file → Executable file
35
protocol/AX25.h
Normal file → Executable file
|
|
@ -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);
|
||||
|
|
|
|||
0
protocol/HDLC.h
Normal file → Executable file
0
protocol/HDLC.h
Normal file → Executable file
6
protocol/KISS.c
Normal file → Executable file
6
protocol/KISS.c
Normal file → Executable file
|
|
@ -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) {
|
||||
|
|
|
|||
0
protocol/KISS.h
Normal file → Executable file
0
protocol/KISS.h
Normal file → Executable file
0
protocol/LLP.c
Normal file → Executable file
0
protocol/LLP.c
Normal file → Executable file
0
protocol/LLP.h
Normal file → Executable file
0
protocol/LLP.h
Normal file → Executable file
0
util/CRC-CCIT.c
Normal file → Executable file
0
util/CRC-CCIT.c
Normal file → Executable file
0
util/CRC-CCIT.h
Normal file → Executable file
0
util/CRC-CCIT.h
Normal file → Executable file
0
util/FIFO.h
Normal file → Executable file
0
util/FIFO.h
Normal file → Executable file
0
util/constants.h
Normal file → Executable file
0
util/constants.h
Normal file → Executable file
0
util/time.h
Normal file → Executable file
0
util/time.h
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue