mirror of
https://github.com/synthetos/g2.git
synced 2026-09-22 03:08:42 +08:00
Don't accept input before controller is ready, adjust init alert timing
This commit is contained in:
@@ -263,7 +263,7 @@ static void _controller_HSM()
|
||||
|
||||
static stat_t _dispatch_control()
|
||||
{
|
||||
if (cs.controller_state != CONTROLLER_PAUSED) {
|
||||
if (cs.controller_state == CONTROLLER_READY) {
|
||||
devflags_t flags = DEV_IS_CTRL;
|
||||
if ((cs.bufp = xio_readline(flags, cs.linelen)) != NULL) {
|
||||
_dispatch_kernel(flags);
|
||||
@@ -274,11 +274,7 @@ static stat_t _dispatch_control()
|
||||
|
||||
static stat_t _dispatch_command()
|
||||
{
|
||||
// #ifdef ENABLE_INTERLOCK_AND_ESTOP
|
||||
// if (cs.controller_state != CONTROLLER_PAUSED && cm1.estop_state == 0) {
|
||||
// #else
|
||||
if (cs.controller_state != CONTROLLER_PAUSED) {
|
||||
// #endif
|
||||
if (cs.controller_state == CONTROLLER_READY) {
|
||||
devflags_t flags = DEV_IS_BOTH | DEV_IS_MUTED; // expressly state we'll handle muted devices
|
||||
if ((!mp_planner_is_full(mp)) && (cs.bufp = xio_readline(flags, cs.linelen)) != NULL) {
|
||||
_dispatch_kernel(flags);
|
||||
@@ -422,9 +418,12 @@ static stat_t _controller_state()
|
||||
_connection_timeout.set(10);
|
||||
}
|
||||
#else
|
||||
_connection_timeout.set(10);
|
||||
_connection_timeout.set(1);
|
||||
#endif
|
||||
} else if ((cs.controller_state == CONTROLLER_STARTUP) && (_connection_timeout.isPast())) { // first time through after reset
|
||||
}
|
||||
|
||||
// first time through after reset
|
||||
if ((cs.controller_state == CONTROLLER_STARTUP) && (!_connection_timeout.isSet() || _connection_timeout.isPast())) {
|
||||
if (MARLIN_COMM_MODE != js.json_mode) { // MARLIN_COMM_MODE is always defined, just not always used
|
||||
_reset_comms_mode();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user