Add ledstrip to task manager
This commit is contained in:
@ -32,9 +32,6 @@ using namespace std::chrono_literals;
|
||||
#include "udpcloud.h"
|
||||
#endif
|
||||
#include "wifi_bobbycar.h"
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
#include "ledstrip.h"
|
||||
#endif
|
||||
#include "modes/defaultmode.h"
|
||||
#include "displays/statusdisplay.h"
|
||||
#include "displays/lockscreen.h"
|
||||
@ -58,9 +55,6 @@ std::optional<espchrono::millis_clock::time_point> lastDisplayRedraw;
|
||||
std::optional<espchrono::millis_clock::time_point> lastCloudCollect;
|
||||
std::optional<espchrono::millis_clock::time_point> lastCloudSend;
|
||||
#endif
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
std::optional<espchrono::millis_clock::time_point> lastLedstripUpdate;
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" void app_main()
|
||||
@ -109,11 +103,6 @@ extern "C" void app_main()
|
||||
task.setup();
|
||||
}
|
||||
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
bootLabel.redraw("LED strip");
|
||||
initLedStrip();
|
||||
#endif
|
||||
|
||||
for (Controller &controller : controllers)
|
||||
controller.command.buzzer = {};
|
||||
|
||||
@ -232,14 +221,6 @@ extern "C" void app_main()
|
||||
bms::update();
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
if (!lastLedstripUpdate || now - *lastLedstripUpdate >= 1000ms / 60)
|
||||
{
|
||||
updateLedStrip();
|
||||
|
||||
lastLedstripUpdate = now;
|
||||
}
|
||||
#endif
|
||||
#ifdef FEATURE_DNS_NS
|
||||
handle_dns_announce();
|
||||
#endif
|
||||
|
@ -57,6 +57,9 @@
|
||||
#ifdef FEATURE_WEBSERVER
|
||||
#include "webserver.h"
|
||||
#endif
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
#include "ledstrip.h"
|
||||
#endif
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
@ -96,7 +99,7 @@ espcpputils::SchedulerTask schedulerTasksArr[] {
|
||||
espcpputils::SchedulerTask { "bluetooth", bluetooth_init, bluetooth_update, 100ms },
|
||||
#endif
|
||||
#ifdef FEATURE_CAN
|
||||
espcpputils::SchedulerTask { "can", can::initCan, can::parseCanInput, 50ms },
|
||||
espcpputils::SchedulerTask { "can", can::initCan, can::parseCanInput, 10ms },
|
||||
#endif
|
||||
espcpputils::SchedulerTask { "debuginput", initDebugInput, handleDebugInput, 50ms },
|
||||
#ifdef FEATURE_SERIAL
|
||||
@ -111,6 +114,9 @@ espcpputils::SchedulerTask schedulerTasksArr[] {
|
||||
#ifdef FEATURE_WEBSERVER
|
||||
espcpputils::SchedulerTask { "webserver", initWebserver, handleWebserver, 100ms },
|
||||
#endif
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
espcpputils::SchedulerTask { "ledstrip", initLedStrip, updateLedStrip, 30ms },
|
||||
#endif
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
Reference in New Issue
Block a user