🪡 Makes control loop frequency const value
This commit is contained in:
+2
-1
@@ -4,12 +4,13 @@ DRAM_ATTR Spot spot;
|
|||||||
|
|
||||||
void IRAM_ATTR SpotControlLoopEntry(void*) {
|
void IRAM_ATTR SpotControlLoopEntry(void*) {
|
||||||
TickType_t xLastWakeTime = xTaskGetTickCount();
|
TickType_t xLastWakeTime = xTaskGetTickCount();
|
||||||
|
const TickType_t xFrequency = 10 / portTICK_PERIOD_MS;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
spot.readSensors();
|
spot.readSensors();
|
||||||
spot.planMotion();
|
spot.planMotion();
|
||||||
spot.updateActuators();
|
spot.updateActuators();
|
||||||
spot.emitTelemetry();
|
spot.emitTelemetry();
|
||||||
vTaskDelayUntil(&xLastWakeTime, 10 / portTICK_PERIOD_MS);
|
vTaskDelayUntil(&xLastWakeTime, xFrequency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user