2400 baud optimisations

This commit is contained in:
Mark Qvist 2019-01-29 21:58:35 +01:00
parent 532e440a3d
commit 07b589fe3f
6 changed files with 55 additions and 35 deletions

View file

@ -601,8 +601,11 @@ void AFSK_adc_isr(Afsk *afsk, int8_t currentSample) {
}
uint8_t timed_functions_timer = 0;
inline void timed_functions(void) {
if (_clock % CLOCK_TICKS_PER_10_MS == 0) {
timed_functions_timer++;
if (timed_functions_timer >= CLOCK_TICKS_PER_10_MS) {
timed_functions_timer = 0;
sd_scheduler();
}
}

View file

@ -40,7 +40,7 @@ inline static uint8_t sinSample(uint16_t i) {
#define CPU_FREQ F_CPU
#define BITRATE 2400
#define BITRATE 1200
#if BITRATE == 300
#define CONFIG_ADC_SAMPLERATE 9600UL
@ -69,7 +69,7 @@ inline static uint8_t sinSample(uint16_t i) {
#define CONFIG_AFSK_PREAMBLE_LEN 150UL
#define CONFIG_AFSK_TRAILER_LEN 10UL
#elif BITRATE == 2400
#define CONFIG_AFSK_PREAMBLE_LEN 200UL
#define CONFIG_AFSK_PREAMBLE_LEN 230UL
#define CONFIG_AFSK_TRAILER_LEN 25UL
#endif

View file

@ -52,15 +52,6 @@ ISR(USART0_RX_vect) {
if (!fifo_isfull(&serialFIFO)) {
char c = uart0_getchar_nowait();
fifo_push(&serialFIFO, c);
} else {
// TODO: Remove this
printf("SERIAL FIFO OVERRUN\r\n");
printf("QH: %d", queue_height);
while(true) {
LED_TX_ON();
LED_RX_ON();
LED_COM_ON();
}
}
}
}

View file

@ -79,10 +79,38 @@ void usrio_4_off(void) {
}
void usrio_1_toggle(void) {
if (usrio_1()) {
usrio_1_off();
if (!bluetooth_enabled()) {
if (usrio_1()) {
usrio_1_off();
} else {
usrio_1_on();
}
}
}
void usrio_2_toggle(void) {
if (!bluetooth_enabled()) {
if (usrio_2()) {
usrio_2_off();
} else {
usrio_2_on();
}
}
}
void usrio_3_toggle(void) {
if (usrio_3()) {
usrio_3_off();
} else {
usrio_1_on();
usrio_3_on();
}
}
void usrio_4_toggle(void) {
if (usrio_4()) {
usrio_4_off();
} else {
usrio_4_on();
}
}