fix: remove sema for bt operation

This commit is contained in:
Wlad Meixner 2022-09-30 11:41:56 +02:00
parent 2726e1fc3d
commit 9f2ae4c30f

View File

@ -139,12 +139,12 @@ void motorTask(void *pvParameter) {
// NOTE: maybe adjust speed here
m->stepper->startMove(diff);
xSemaphoreTake(bin_sem, portMAX_DELAY);
// xSemaphoreTake(bin_sem, portMAX_DELAY);
if (runningMotors == 0) {
digitalWrite(M_ENABLE_PIN, LOW);
}
runningMotors++;
xSemaphoreGive(bin_sem);
// xSemaphoreGive(bin_sem);
while (true) {
// motor control loop - send pulse and return how long to wait until next pulse
@ -161,12 +161,12 @@ void motorTask(void *pvParameter) {
}
}
m->updateCurrentPosition(ongoingStepTarget);
xSemaphoreTake(bin_sem, portMAX_DELAY);
// xSemaphoreTake(bin_sem, portMAX_DELAY);
runningMotors--;
if (runningMotors == 0) {
digitalWrite(M_ENABLE_PIN, HIGH);
}
xSemaphoreGive(bin_sem);
// xSemaphoreGive(bin_sem);
}
vTaskDelay(noActionIdleTime);