- Ignore soft limits of max <= min.
- Fixed problem with restarting program in imperial units mode.
- Handle GCode with infinite or very long loops correctly.
+ - Fixed Huanyang spindle restart after stop.
## v0.3.23
- Fix for modbus read operation.
#include "huanyang.h"
#include "config.h"
#include "modbus.h"
+#include "estop.h"
#include <string.h>
#include <math.h>
static bool _shutdown() {
- if (!hy.shutdown) return false;
+ if (!hy.shutdown && !estop_triggered()) return false;
modbus_deinit();
if (hy.deinit_cb) hy.deinit_cb();
return true;
switch (hy.state) {
case 0: { // Update direction
hy_ctrl_state_t state = HUANYANG_STOP;
- if (!hy.shutdown) {
+ if (!hy.shutdown && !estop_triggered()) {
if (0 < hy.speed)
state = (hy_ctrl_state_t)(HUANYANG_RUN | HUANYANG_FORWARD);
else if (hy.speed < 0)
float huanyang_get() {return hy.actual_freq / hy.max_freq;}
-
-
-void huanyang_stop() {
- huanyang_set(0);
- hy.shutdown = true;
-}
+void huanyang_stop() {huanyang_set(0);}
float get_hy_freq() {return hy.actual_freq;}
#include "modbus.h"
#include "rtc.h"
#include "config.h"
+#include "estop.h"
#include "pgmspace.h"
#include <string.h>
break;
case REG_FREQ_ACTECH_READ:
- if (vfd.shutdown) vfd.state = REG_DISCONNECT_WRITE;
+ if (vfd.shutdown || estop_triggered()) vfd.state = REG_DISCONNECT_WRITE;
else if (vfd.changed) {
// Update frequency and state
static void _modbus_cb(bool ok, uint16_t addr, uint16_t value) {
// Handle error
if (!ok) {
- if (vfd.shutdown) _disconnected();
+ if (vfd.shutdown || estop_triggered()) _disconnected();
else _connect();
return;
}