mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-11-28 02:30:30 -05:00
Added Bluetooth driver
This commit is contained in:
parent
5193a2fe13
commit
b6a26b3226
3 changed files with 129 additions and 5 deletions
|
|
@ -102,7 +102,7 @@ void setup() {
|
|||
validateStatus();
|
||||
|
||||
#if HAS_BLUETOOTH
|
||||
bt_ready = bt_init();
|
||||
bt_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -674,6 +674,16 @@ void serialCallback(uint8_t sbyte) {
|
|||
if (sbyte != 0x00) {
|
||||
kiss_indicate_fb();
|
||||
}
|
||||
} else if (command == CMD_BT_CTRL) {
|
||||
#if HAS_BLUETOOTH
|
||||
if (sbyte == 0x00) {
|
||||
bt_disable();
|
||||
} else if (sbyte == 0x01) {
|
||||
bt_enable();
|
||||
} else if (sbyte == 0x02) {
|
||||
bt_enable_pairing();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -849,6 +859,10 @@ void loop() {
|
|||
#if HAS_PMU
|
||||
if (pmu_ready) update_pmu();
|
||||
#endif
|
||||
|
||||
#if HAS_BLUETOOTH
|
||||
if (bt_ready) update_bt();
|
||||
#endif
|
||||
}
|
||||
|
||||
volatile bool serial_polling = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue