diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 9736cf9d1..856f56de2 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -318,10 +318,13 @@ void menuHandler::positionBaseMenu() static const char *optionsArray[] = {"Back", "GPS Toggle", "Compass"}; static const char *optionsArrayCalibrate[] = {"Back", "GPS Toggle", "Compass", "Compass Calibrate"}; +#if !MESHTASTIC_EXCLUDE_I2C if (accelerometerThread) { optionsArrayPtr = optionsArrayCalibrate; options = 4; - } else { + } else +#endif + { optionsArrayPtr = optionsArray; options = 3; } @@ -334,9 +337,15 @@ void menuHandler::positionBaseMenu() #endif } else if (selected == 2) { menuQueue = compass_point_north_menu; - } else if (selected == 3) { + } +#if !MESHTASTIC_EXCLUDE_I2C + else if (selected == 3) { accelerometerThread->calibrate(30); } +#endif + else { + menuQueue = menu_none; + } }); } diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index 783c08b9f..2b3e89fb3 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -162,7 +162,7 @@ void setupModules() #endif // Example: Put your module here // new ReplyModule(); -#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER +#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER && !MESHTASTIC_EXCLUDE_I2C if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();