Improved multiplatform support

This commit is contained in:
Mark Qvist 2022-01-14 20:49:50 +01:00
parent 3ca92e892d
commit af01541c17

View File

@ -13,20 +13,24 @@
#define MCU_2560 0x92 #define MCU_2560 0x92
#define MCU_ESP32 0x81 #define MCU_ESP32 0x81
#define BOARD_RNODE 0x31
#define BOARD_HMBRW 0x32
#define BOARD_TBEAM 0x33
#define MODE_HOST 0x11 #define MODE_HOST 0x11
#define MODE_TNC 0x12 #define MODE_TNC 0x12
#if defined(__AVR_ATmega1284P__) #if defined(__AVR_ATmega1284P__)
#define PLATFORM PLATFORM_AVR #define PLATFORM PLATFORM_AVR
#define MCU_VARIANT MCU_1284P #define MCU_VARIANT MCU_1284P
#elif defined(__AVR_ATmega2560__) #elif defined(__AVR_ATmega2560__)
#define PLATFORM PLATFORM_AVR #define PLATFORM PLATFORM_AVR
#define MCU_VARIANT MCU_2560 #define MCU_VARIANT MCU_2560
#elif defined(ESP32) #elif defined(ESP32)
#define PLATFORM PLATFORM_ESP32 #define PLATFORM PLATFORM_ESP32
#define MCU_VARIANT MCU_ESP32 #define MCU_VARIANT MCU_ESP32
#else #else
#error "The firmware cannot be compiled for the selected MCU variant" #error "The firmware cannot be compiled for the selected MCU variant"
#endif #endif
#define MTU 500 #define MTU 500
@ -45,6 +49,8 @@
const int pin_led_rx = 12; const int pin_led_rx = 12;
const int pin_led_tx = 13; const int pin_led_tx = 13;
#define BOARD_MODEL BOARD_RNODE
#define CONFIG_UART_BUFFER_SIZE 6144 #define CONFIG_UART_BUFFER_SIZE 6144
#define CONFIG_QUEUE_SIZE 6144 #define CONFIG_QUEUE_SIZE 6144
#define CONFIG_QUEUE_MAX_LENGTH 250 #define CONFIG_QUEUE_MAX_LENGTH 250
@ -59,6 +65,8 @@
const int pin_led_rx = 12; const int pin_led_rx = 12;
const int pin_led_tx = 13; const int pin_led_tx = 13;
#define BOARD_MODEL BOARD_HMBRW
#define CONFIG_UART_BUFFER_SIZE 2048 #define CONFIG_UART_BUFFER_SIZE 2048
#define CONFIG_QUEUE_SIZE 2048 #define CONFIG_QUEUE_SIZE 2048
#define CONFIG_QUEUE_MAX_LENGTH 80 #define CONFIG_QUEUE_MAX_LENGTH 80
@ -73,7 +81,9 @@
const int pin_led_rx = 2; const int pin_led_rx = 2;
const int pin_led_tx = 4; const int pin_led_tx = 4;
#define CONFIG_UART_BUFFER_SIZE 6144 #define BOARD_MODEL BOARD_TBEAM
#define CONFIG_UART_BUFFER_SIZE 64
#define CONFIG_QUEUE_SIZE 6144 #define CONFIG_QUEUE_SIZE 6144
#define CONFIG_QUEUE_MAX_LENGTH 250 #define CONFIG_QUEUE_MAX_LENGTH 250
@ -85,6 +95,12 @@
#define PIN_GPS_RX 34 #define PIN_GPS_RX 34
#endif #endif
#if BOARD_MODEL == BOARD_TBEAM
#define I2C_SDA 21
#define I2C_SCL 22
#define PMU_IRQ 35
#endif
#define eeprom_addr(a) (a+EEPROM_OFFSET) #define eeprom_addr(a) (a+EEPROM_OFFSET)
// MCU independent configuration parameters // MCU independent configuration parameters
@ -117,8 +133,8 @@
int last_rssi = -292; int last_rssi = -292;
uint8_t last_rssi_raw = 0x00; uint8_t last_rssi_raw = 0x00;
uint8_t last_snr_raw = 0x00; uint8_t last_snr_raw = 0x00;
size_t read_len = 0;
uint8_t seq = 0xFF; uint8_t seq = 0xFF;
uint16_t read_len = 0;
// Incoming packet buffer // Incoming packet buffer
uint8_t pbuf[MTU]; uint8_t pbuf[MTU];