// ST4Pulse stub for native testing // Replaces the real ST4Pulse which uses esp_timer callbacks and FreeRTOS tasks #include "ST4Pulse.h" ST4Pulse* ST4Pulse::instance_ = nullptr; ST4Pulse::ST4Pulse() : timer_(nullptr), pulseDoneSem_(nullptr), mutex_(nullptr), pulseTaskHandle_(nullptr), activeAxis_(nullptr), activeTracker_(nullptr), active_(false), shutdown_(false) {} ST4Pulse::~ST4Pulse() { instance_ = nullptr; } void ST4Pulse::begin() { instance_ = this; } bool ST4Pulse::pulse(ST4Axis& axis, ST4Tracker& tracker, ST4Direction dir, double slewRate, uint32_t ms) { if (dir == ST4Direction::STOP || ms == 0) return false; active_ = true; activeAxis_ = &axis; activeTracker_ = &tracker; axis.move(dir); tracker.start(slewRate); // Stub: immediately complete the pulse axis.stop(); tracker.stop(); active_ = false; return true; } bool ST4Pulse::isActive() const { return active_; } void ST4Pulse::cancel() { if (activeAxis_) activeAxis_->stop(); if (activeTracker_) activeTracker_->stop(); active_ = false; activeAxis_ = nullptr; activeTracker_ = nullptr; } void ST4Pulse::cancelLocked() { cancel(); } void ST4Pulse::timerCallback(void*) {} void ST4Pulse::pulseTaskFunc(void*) {}