Task-Driven, powersaving trial written, must test.

This commit is contained in:
2026-01-11 19:02:14 -06:00
parent 27a5e27972
commit 45fa356d66
18 changed files with 550 additions and 198 deletions

View File

@@ -9,17 +9,12 @@
#include "encoder.hpp"
#include "calibration.hpp"
#include "esp_pm.h"
#include "mainEventLoop.hpp"
// Global encoder instances
Encoder* topEnc = new Encoder(ENCODER_PIN_A, ENCODER_PIN_B);
Encoder* bottomEnc = new Encoder(InputEnc_PIN_A, InputEnc_PIN_B);
// Global encoder pointers (used by servo.cpp)
void MainTask(void *pvParameters) {
}
void mainApp() {
esp_err_t ret = nvs_flash_init(); // change to secure init logic soon!!
// 2. If NVS is full or corrupt (common after flashing new code), erase and retry
@@ -37,8 +32,11 @@ void mainApp() {
bottomEnc->init();
servoInit();
xTaskCreate(setupLoop, "Setup", 8192, xTaskGetCurrentTaskHandle(), 5, &setupTaskHandle);
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
setupAndCalibrate();
xTaskCreate(wakeTimer, "wakeTimer", 1024, NULL, 5, &wakeTaskHandle);
mainEventLoop();
// TOMORROW!!!
// statusResolved = false;