fix MESHTASTIC_EXCLUDE_I2C compile errors

This commit is contained in:
mverch67 2025-07-17 12:40:02 +02:00
parent cd170fb011
commit 5033fd1f9f
2 changed files with 12 additions and 3 deletions

View File

@ -318,10 +318,13 @@ void menuHandler::positionBaseMenu()
static const char *optionsArray[] = {"Back", "GPS Toggle", "Compass"}; static const char *optionsArray[] = {"Back", "GPS Toggle", "Compass"};
static const char *optionsArrayCalibrate[] = {"Back", "GPS Toggle", "Compass", "Compass Calibrate"}; static const char *optionsArrayCalibrate[] = {"Back", "GPS Toggle", "Compass", "Compass Calibrate"};
#if !MESHTASTIC_EXCLUDE_I2C
if (accelerometerThread) { if (accelerometerThread) {
optionsArrayPtr = optionsArrayCalibrate; optionsArrayPtr = optionsArrayCalibrate;
options = 4; options = 4;
} else { } else
#endif
{
optionsArrayPtr = optionsArray; optionsArrayPtr = optionsArray;
options = 3; options = 3;
} }
@ -334,9 +337,15 @@ void menuHandler::positionBaseMenu()
#endif #endif
} else if (selected == 2) { } else if (selected == 2) {
menuQueue = compass_point_north_menu; menuQueue = compass_point_north_menu;
} else if (selected == 3) { }
#if !MESHTASTIC_EXCLUDE_I2C
else if (selected == 3) {
accelerometerThread->calibrate(30); accelerometerThread->calibrate(30);
} }
#endif
else {
menuQueue = menu_none;
}
}); });
} }

View File

@ -162,7 +162,7 @@ void setupModules()
#endif #endif
// Example: Put your module here // Example: Put your module here
// new ReplyModule(); // 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) { if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1(); rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();