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 *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;
}
});
}

View File

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