mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-07-30 01:48:35 -04:00
Added ESP32 BLE Serial support
This commit is contained in:
parent
d742166a12
commit
75816b4fe0
2 changed files with 77 additions and 18 deletions
|
@ -224,6 +224,9 @@ inline void kiss_write_packet() {
|
|||
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
|
||||
packet_ready = false;
|
||||
#endif
|
||||
#if MCU_VARIANT == MCU_ESP32 && HAS_BLE
|
||||
bt_flush();
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void getPacketData(uint16_t len) {
|
||||
|
@ -1378,17 +1381,26 @@ void button_event(uint8_t event, unsigned long duration) {
|
|||
bt_enable_pairing();
|
||||
} else if (duration > 4000) {
|
||||
#if HAS_CONSOLE
|
||||
#if HAS_BLUETOOTH || HAS_BLE
|
||||
bt_stop();
|
||||
#endif
|
||||
console_active = true;
|
||||
console_start();
|
||||
#endif
|
||||
} else if (duration > 2000) {
|
||||
sleep_now();
|
||||
#if HAS_SLEEP
|
||||
sleep_now();
|
||||
#endif
|
||||
} else {
|
||||
if (bt_state == BT_STATE_OFF) {
|
||||
bt_start();
|
||||
} else {
|
||||
bt_stop();
|
||||
}
|
||||
#if HAS_BLUETOOTH || HAS_BLE
|
||||
if (bt_state == BT_STATE_OFF) {
|
||||
bt_start();
|
||||
bt_conf_save(true);
|
||||
} else {
|
||||
bt_stop();
|
||||
bt_conf_save(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue