proj: switching to Linux
This commit is contained in:
+16
-21
@@ -591,7 +591,10 @@ void MovementTask() {
|
||||
|
||||
StepperMotor stepper(stepperCfg, stepperDriver, initSens);
|
||||
|
||||
WatchMotor watch(stepper, motorSleep);
|
||||
WatchMotor watch(stepper, [](uint8_t newPos) {
|
||||
pictoIllumQue.enqueue(std::make_unique<PictoIllumCommand>(newPos));
|
||||
responseQueue.enqueue(std::make_unique<WatchIndex>(ResponseType::StepAt, newPos));
|
||||
});
|
||||
|
||||
ESP_LOGI("Stepper", "Find Home");
|
||||
stepper.findRef();
|
||||
@@ -627,23 +630,15 @@ void MovementTask() {
|
||||
continue;
|
||||
}
|
||||
|
||||
int jumps = newPos - watch.getIndex();
|
||||
if (jumps <= 0) {
|
||||
jumps += 6;
|
||||
}
|
||||
jumps = jumps + (activeState.minJumps % 6) * 6;
|
||||
if (jumps < activeState.minJumps) {
|
||||
jumps += 6;
|
||||
}
|
||||
Syslog::logv(Syslog::Severity::Notice,
|
||||
"Running Stepper by %i steps with prof=%i a=%.2f w=%.2f",
|
||||
jumps, activeState.profile, activeState.accel, activeState.speed);
|
||||
"Running Stepper by min%i steps with prof=%i a=%.2f w=%.2f",
|
||||
activeState.minJumps, activeState.profile, activeState.accel, activeState.speed);
|
||||
pictoIllumQue.enqueue(std::make_unique<PictoIllumCommand>(0));
|
||||
responseQueue.enqueue(std::make_unique<WatchIndex>(ResponseType::StartMoving, 0));
|
||||
watch.moveTo(newPos, activeState.profile);
|
||||
|
||||
pictoIllumQue.enqueue(std::make_unique<PictoIllumCommand>(newPos));
|
||||
responseQueue.enqueue(std::make_unique<WatchIndex>(ResponseType::StepAt, newPos));
|
||||
auto &as = activeState;
|
||||
watch.moveTo(newPos, as.profile, as.minJumps, as.accel, as.speed);
|
||||
// pictoIllumQue.enqueue(std::make_unique<PictoIllumCommand>(newPos));
|
||||
// responseQueue.enqueue(std::make_unique<WatchIndex>(ResponseType::StepAt, newPos));
|
||||
}
|
||||
} else if (cmd->type == MoveType::Demo) {
|
||||
ESP_LOGI(TAG, "Running Demo");
|
||||
@@ -652,7 +647,7 @@ void MovementTask() {
|
||||
fos::Task::delayMs(1000);
|
||||
int steps[3]{4, 2, 0};
|
||||
for (size_t j = 0; j < 3; j++) {
|
||||
watch.moveTo(steps[j], i);
|
||||
watch.moveTo(steps[j], i, 1, 1, 1);
|
||||
fos::Task::delayMs(1000);
|
||||
}
|
||||
}
|
||||
@@ -735,11 +730,11 @@ bool onCheckSpitTypeVeto(bool knownType, bool createdByClient) {
|
||||
}
|
||||
|
||||
bool onCheckSpitObjectVeto(bool knownType) {
|
||||
return true; // Bypass veto
|
||||
return true; // Bypass veto
|
||||
if (!knownType) { // Don't allow objects of unregistered SPITTypes
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -988,8 +983,8 @@ void app_main(void) {
|
||||
// ToDo send
|
||||
Syslog::logv(Syslog::Severity::Notice, "Health state");
|
||||
// ESP_LOGI(TAG, "Min heap size: %" PRIu32 " / FreeHeap %" PRIu32 "\n",
|
||||
ESP_LOGI(TAG, "Min heap size: %u / FreeHeap %lu",
|
||||
heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT),
|
||||
esp_get_free_heap_size());
|
||||
// ESP_LOGI(TAG, "Min heap size: %u / FreeHeap %lu",
|
||||
// heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT),
|
||||
// esp_get_free_heap_size());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
// Component header
|
||||
#include "Task.hpp"
|
||||
#include "PwmExpanderPca9685.hpp"
|
||||
#include "StepperDrv8833.hpp"
|
||||
#include "stepperDrv.hpp"
|
||||
#include "stepperMotor.hpp"
|
||||
#include "cliWrapper.hpp"
|
||||
#include "udpSockets.hpp"
|
||||
|
||||
Reference in New Issue
Block a user