[PR] Add MQTT/Serial toggle using the boot button #12

Merged
wessel merged 3 commits from 2-imu-reader/esp32-IMU into 2-imu-reader/master 2025-11-05 12:22:41 +01:00
Showing only changes of commit 267092332e - Show all commits

View File

@@ -310,12 +310,12 @@ void app_main(void)
if (mqtt_toggle && !toggle_completed && !wifi_initialized) {
wifi_init();
mqtt_app_start();
ESP_LOGI("BOOT", "Boot button pressed: starting in MQTT mode");
ESP_LOGI("BOOT", "Boot button pressed: starting MQTT mode");
toggle_completed = true;
} else if (!mqtt_toggle && !toggle_completed && wifi_initialized) {
mqtt_app_stop();
wifi_deinit();
ESP_LOGI("BOOT", "Boot button not pressed: starting in serial-only mode");
ESP_LOGI("BOOT", "Boot button not pressed: starting serial-only mode");
toggle_completed = true;
}
mpu6886_read_accel(&mpu, &accel);