another silly error

This commit is contained in:
Gareth Coleman 2024-04-21 08:59:40 +01:00
parent fb7a878d94
commit cf65661c7c
2 changed files with 37 additions and 51 deletions

View File

@ -32,56 +32,42 @@ class AmbientLightingThread : public concurrency::OSThread
disable();
return;
}
#endif
#if defined(HAS_NCP5623) || defined(UNPHONE) || defined(RGBLED_RED)
if (!moduleConfig.ambient_lighting.led_state) {
LOG_DEBUG("AmbientLightingThread disabling due to moduleConfig.ambient_lighting.led_state OFF\n");
disable();
return;
}
LOG_DEBUG("AmbientLightingThread initializing\n");
#ifdef HAS_NCP5623
if (_type == ScanI2C::NCP5623) {
rgb.begin();
setLighting();
}
#endif
#ifdef UNPHONE
if (!moduleConfig.ambient_lighting.led_state) {
LOG_DEBUG("AmbientLightingThread disabling due to moduleConfig.ambient_lighting.led_state OFF\n");
disable();
return;
}
LOG_DEBUG("AmbientLightingThread initializing\n");
setLighting();
#endif
#ifdef RGBLED_RED
if (!moduleConfig.ambient_lighting.led_state) {
LOG_DEBUG("AmbientLightingThread disabling due to moduleConfig.ambient_lighting.led_state OFF\n");
disable();
return;
}
LOG_DEBUG("AmbientLightingThread initializing\n");
pinMode(RGBLED_RED, OUTPUT);
pinMode(RGBLED_GREEN, OUTPUT);
pinMode(RGBLED_BLUE, OUTPUT);
#endif
setLighting();
#endif
#ifdef HAS_NCP5623
}
#endif
}
protected:
int32_t runOnce() override
{
#if defined(HAS_NCP5623) || defined(UNPHONE) || defined(RGBLED_RED)
#ifdef HAS_NCP5623
if (_type == ScanI2C::NCP5623 && moduleConfig.ambient_lighting.led_state) {
#endif
setLighting();
return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification
#ifdef HAS_NCP5623
}
#endif
#ifdef UNPHONE
setLighting();
return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification
#endif
#ifdef RGBLED_RED
setLighting();
return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification
#endif
return disable();
}

View File

@ -151,7 +151,6 @@ int32_t ExternalNotificationModule::runOnce()
colorState = 1;
}
}
}
#endif
#ifdef T_WATCH_S3
@ -181,6 +180,7 @@ int32_t ExternalNotificationModule::runOnce()
return EXT_NOTIFICATION_DEFAULT_THREAD_MS;
}
}
bool ExternalNotificationModule::wantPacket(const meshtastic_MeshPacket *p)
{