Updated build configs
This commit is contained in:
parent
4085e92c4f
commit
d2dab8c65e
38
Config.h
38
Config.h
@ -27,6 +27,21 @@
|
|||||||
#define MODE_HOST 0x11
|
#define MODE_HOST 0x11
|
||||||
#define MODE_TNC 0x12
|
#define MODE_TNC 0x12
|
||||||
|
|
||||||
|
#define CABLE_STATE_DISCONNECTED 0x00
|
||||||
|
#define CABLE_STATE_CONNECTED 0x01
|
||||||
|
uint8_t cable_state = CABLE_STATE_DISCONNECTED;
|
||||||
|
|
||||||
|
#define BT_STATE_NA 0xff
|
||||||
|
#define BT_STATE_OFF 0x00
|
||||||
|
#define BT_STATE_ON 0x01
|
||||||
|
#define BT_STATE_PAIRING 0x02
|
||||||
|
#define BT_STATE_CONNECTED 0x03
|
||||||
|
uint8_t bt_state = BT_STATE_NA;
|
||||||
|
uint32_t bt_ssp_pin = 0;
|
||||||
|
bool bt_ready = false;
|
||||||
|
bool bt_enabled = false;
|
||||||
|
bool bt_allow_pairing = false;
|
||||||
|
|
||||||
#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
|
||||||
@ -36,21 +51,6 @@
|
|||||||
#elif defined(ESP32)
|
#elif defined(ESP32)
|
||||||
#define PLATFORM PLATFORM_ESP32
|
#define PLATFORM PLATFORM_ESP32
|
||||||
#define MCU_VARIANT MCU_ESP32
|
#define MCU_VARIANT MCU_ESP32
|
||||||
|
|
||||||
#define CABLE_STATE_DISCONNECTED 0x00
|
|
||||||
#define CABLE_STATE_CONNECTED 0x01
|
|
||||||
uint8_t cable_state = CABLE_STATE_DISCONNECTED;
|
|
||||||
|
|
||||||
#define BT_STATE_NA 0xff
|
|
||||||
#define BT_STATE_OFF 0x00
|
|
||||||
#define BT_STATE_ON 0x01
|
|
||||||
#define BT_STATE_PAIRING 0x02
|
|
||||||
#define BT_STATE_CONNECTED 0x03
|
|
||||||
uint8_t bt_state = BT_STATE_NA;
|
|
||||||
uint32_t bt_ssp_pin = 0;
|
|
||||||
bool bt_ready = false;
|
|
||||||
bool bt_enabled = false;
|
|
||||||
bool bt_allow_pairing = false;
|
|
||||||
#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;
|
||||||
|
@ -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();
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user