void stepper_shutdown(void) { uint8_t i; struct stepper *s; foreach_oid(i, s, command_config_stepper) { s->first = NULL; stepper_stop(s); }
/* * Stop printing */ int unicorn_stop(bool blocking) { channel_tag fan = NULL; if (blocking) { printf("unicorn_stop: blocking\n"); } else { printf("unicorn_stop: non-blocking\n"); } /* If paused, pause thread off */ if (!blocking) { if (hPause_printing) { Pause_on(hPause_printing); } } printf("stepper_stop\n"); stepper_stop(blocking); printf("ok\n"); fan = fan_lookup_by_name("fan_ext"); if (fan) { fan_set_level(fan, 0); fan_disable(fan); } fan = fan_lookup_by_name("fan_ext2"); if (fan) { fan_set_level(fan, 0); fan_disable(fan); } printf("gcode_stop\n"); gcode_stop(); printf("ok\n"); //if (!blocking) { /* Clean up all fifo data */ stepper_clean_up_fifo(); //} printf("plan_stop\n"); plan_stop(); printf("ok\n"); printf("heater_stop\n"); heater_stop(); printf("ok\n"); if (!blocking) { if (unicorn_get_mode() == FW_MODE_REMOTE) { if (hPause_printing) { Pause_off(hPause_printing); } } } printf("unicorn stop ok!\n"); return 0; }
void stepper_move_steps(struct stepper *s, uint32_t steps){ stepper_start(s); while(s->fires_this_move < steps); stepper_stop(s); }