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

View File

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