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