mirror of
https://github.com/markqvist/OpenModem.git
synced 2025-08-14 01:16:12 -04:00
Transmit queue and buffers
This commit is contained in:
parent
8e836c629c
commit
532e440a3d
5 changed files with 22 additions and 19 deletions
|
@ -40,7 +40,7 @@ inline static uint8_t sinSample(uint16_t i) {
|
|||
#define CPU_FREQ F_CPU
|
||||
|
||||
|
||||
#define BITRATE 1200
|
||||
#define BITRATE 2400
|
||||
|
||||
#if BITRATE == 300
|
||||
#define CONFIG_ADC_SAMPLERATE 9600UL
|
||||
|
|
|
@ -14,6 +14,4 @@ void bluetooth_init(void);
|
|||
bool bluetooth_enabled(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// CMD/DATA sequence: 0x2b2b2b0d
|
||||
#endif
|
|
@ -2,6 +2,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
extern volatile uint8_t queue_height;
|
||||
|
||||
void serial_init(Serial *serial) {
|
||||
memset(serial, 0, sizeof(*serial));
|
||||
memset(serialBuf, 0, sizeof(serialBuf));
|
||||
|
@ -47,8 +49,19 @@ char uart0_getchar_nowait(void) {
|
|||
ISR(USART0_RX_vect) {
|
||||
if (serial_available(0)) {
|
||||
LED_COM_ON();
|
||||
char c = uart0_getchar_nowait();
|
||||
fifo_push(&serialFIFO, c);
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue