Add GPS altitude support, add channel “reply to” targeting, fix snake wall collisions, fix unread navigation incorrectly returning to home, and fix BLE continuing to advertise after being disabled

This commit is contained in:
Steve Calvário
2026-05-21 17:09:13 +01:00
parent ec2ae31b67
commit 5caf53a496
11 changed files with 216 additions and 97 deletions
+16
View File
@@ -147,6 +147,9 @@ static bool adv_stop_for_interval_change;
* (SerialBLEInterface.cpp:343). */
static bool adv_running;
/* Administrative BLE state */
static bool ble_enabled = true;
/* Runtime BLE passkey */
static uint32_t ble_passkey = CONFIG_ZEPHCORE_BLE_PASSKEY;
@@ -781,6 +784,10 @@ static void adv_slow_work_fn(struct k_work *work)
static void start_adv(void)
{
if (!ble_enabled) {
return;
}
uint16_t interval = fast_adv_active ? BT_ADV_FAST_INTERVAL : BT_ADV_INTERVAL;
struct bt_le_adv_param adv_param = {
@@ -908,6 +915,7 @@ size_t zephcore_ble_send(const uint8_t *data, uint16_t len)
void zephcore_ble_set_enabled(bool enable)
{
ble_enabled = enable;
if (!enable) {
/* Disconnect current connection if any */
if (current_conn) {
@@ -917,6 +925,10 @@ void zephcore_ble_set_enabled(bool enable)
/* Stop advertising */
bt_le_adv_stop();
adv_running = false;
/* No future fast->slow transition needed */
k_work_cancel_delayable(&adv_slow_work);
LOG_INF("BLE disabled");
} else {
/* Re-enable advertising — start fast window */
@@ -926,6 +938,10 @@ void zephcore_ble_set_enabled(bool enable)
LOG_INF("BLE enabled");
}
}
bool zephcore_ble_is_enabled(void)
{
return ble_enabled;
}
bool zephcore_ble_is_active(void)
{