Updated build configs

This commit is contained in:
Mark Qvist 2022-10-30 18:58:12 +01:00
parent 4085e92c4f
commit d2dab8c65e
3 changed files with 32 additions and 25 deletions

View File

@ -27,16 +27,6 @@
#define MODE_HOST 0x11 #define MODE_HOST 0x11
#define MODE_TNC 0x12 #define MODE_TNC 0x12
#if defined(__AVR_ATmega1284P__)
#define PLATFORM PLATFORM_AVR
#define MCU_VARIANT MCU_1284P
#elif defined(__AVR_ATmega2560__)
#define PLATFORM PLATFORM_AVR
#define MCU_VARIANT MCU_2560
#elif defined(ESP32)
#define PLATFORM PLATFORM_ESP32
#define MCU_VARIANT MCU_ESP32
#define CABLE_STATE_DISCONNECTED 0x00 #define CABLE_STATE_DISCONNECTED 0x00
#define CABLE_STATE_CONNECTED 0x01 #define CABLE_STATE_CONNECTED 0x01
uint8_t cable_state = CABLE_STATE_DISCONNECTED; uint8_t cable_state = CABLE_STATE_DISCONNECTED;
@ -51,6 +41,16 @@
bool bt_ready = false; bool bt_ready = false;
bool bt_enabled = false; bool bt_enabled = false;
bool bt_allow_pairing = false; bool bt_allow_pairing = false;
#if defined(__AVR_ATmega1284P__)
#define PLATFORM PLATFORM_AVR
#define MCU_VARIANT MCU_1284P
#elif defined(__AVR_ATmega2560__)
#define PLATFORM PLATFORM_AVR
#define MCU_VARIANT MCU_2560
#elif defined(ESP32)
#define PLATFORM PLATFORM_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
@ -60,7 +60,7 @@
#define HEADER_L 1 #define HEADER_L 1
#define MIN_L 1 #define MIN_L 1
#define CMD_L 4 #define CMD_L 10
// MCU dependent configuration parameters // MCU dependent configuration parameters
@ -115,19 +115,23 @@
const int pin_dio = 39; const int pin_dio = 39;
const int pin_led_rx = 14; const int pin_led_rx = 14;
const int pin_led_tx = 32; const int pin_led_tx = 32;
#define HAS_BLUETOOTH true
#elif BOARD_MODEL == BOARD_TBEAM #elif BOARD_MODEL == BOARD_TBEAM
const int pin_cs = 18; const int pin_cs = 18;
const int pin_reset = 23; const int pin_reset = 23;
const int pin_dio = 26; const int pin_dio = 26;
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 HAS_DISPLAY true
#define HAS_PMU true #define HAS_PMU true
#define HAS_BLUETOOTH true
#elif BOARD_MODEL == BOARD_HUZZAH32 #elif BOARD_MODEL == BOARD_HUZZAH32
const int pin_cs = 4; const int pin_cs = 4;
const int pin_reset = 36; const int pin_reset = 36;
const int pin_dio = 39; const int pin_dio = 39;
const int pin_led_rx = 14; const int pin_led_rx = 14;
const int pin_led_tx = 32; const int pin_led_tx = 32;
#define HAS_BLUETOOTH true
#elif BOARD_MODEL == BOARD_LORA32_V2_0 #elif BOARD_MODEL == BOARD_LORA32_V2_0
const int pin_cs = 18; const int pin_cs = 18;
const int pin_reset = 12; const int pin_reset = 12;
@ -166,6 +170,8 @@
const int pin_led_rx = 25; const int pin_led_rx = 25;
const int pin_led_tx = 25; const int pin_led_tx = 25;
#endif #endif
#define HAS_DISPLAY true
#define HAS_BLUETOOTH true
#elif BOARD_MODEL == BOARD_RNODE_NG_20 #elif BOARD_MODEL == BOARD_RNODE_NG_20
const int pin_cs = 18; const int pin_cs = 18;
const int pin_reset = 12; const int pin_reset = 12;

View File

@ -660,13 +660,14 @@ void serialCallback(uint8_t sbyte) {
} }
cbuf[frame_len++] = sbyte; cbuf[frame_len++] = sbyte;
} }
#if HAS_DISPLAY
if (frame_len == 9) { if (frame_len == 9) {
uint8_t line = cbuf[0]; uint8_t line = cbuf[0];
if (line > 63) line = 63; if (line > 63) line = 63;
int fb_o = line*8; int fb_o = line*8;
memcpy(fb+fb_o, cbuf+1, 8); memcpy(fb+fb_o, cbuf+1, 8);
} }
#endif
} else if (command == CMD_FB_READ) { } else if (command == CMD_FB_READ) {
if (sbyte != 0x00) { if (sbyte != 0x00) {
kiss_indicate_fb(); kiss_indicate_fb();

View File

@ -603,7 +603,7 @@ void kiss_indicate_fbstate() {
serial_write(0x00); serial_write(0x00);
} }
#else #else
serial_write(0xFF) serial_write(0xFF);
#endif #endif
serial_write(FEND); serial_write(FEND);
} }
@ -619,7 +619,7 @@ void kiss_indicate_fb() {
serial_write(byte); serial_write(byte);
} }
#else #else
serial_write(0xFF) serial_write(0xFF);
#endif #endif
serial_write(FEND); serial_write(FEND);
} }