Added Bluetooth driver

This commit is contained in:
Mark Qvist 2022-10-30 13:51:36 +01:00
parent 5193a2fe13
commit b6a26b3226
3 changed files with 129 additions and 5 deletions

View file

@ -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;