/* NOT USED void mp_unget_write_buffer() { mb.w = mb.w->pv; // queued --> write mb.w->buffer_state = MP_BUFFER_EMPTY; // not loading anymore mb.buffers_available++; } */ void mp_queue_write_buffer(const uint8_t move_type) { mb.q->move_type = move_type; mb.q->move_state = MOVE_STATE_NEW; mb.q->buffer_state = MP_BUFFER_QUEUED; mb.q = mb.q->nx; // advance the queued buffer pointer st_request_exec_move(); // request a move exec if not busy rpt_request_queue_report(+1); // add to the "added buffers" count }
void mp_commit_write_buffer(const uint8_t move_type) { mb.q->move_type = move_type; mb.q->move_state = MOVE_NEW; mb.q->buffer_state = MP_BUFFER_QUEUED; mb.q = mb.q->nx; // advance the queued buffer pointer qr_request_queue_report(+1); // request a QR and add to the "added buffers" count st_request_exec_move(); // requests an exec if the runtime is not busy // NB: BEWARE! the exec may result in the planner buffer being // processed immediately and then freed - invalidating the contents }
/* * mp_end_hold() - end a feedhold */ stat_t mp_end_hold() { if (cm.hold_state == FEEDHOLD_END_HOLD) { cm.hold_state = FEEDHOLD_OFF; mpBuf_t *bf; if ((bf = mp_get_run_buffer()) == NULL) { // NULL means nothing's running cm_set_motion_state(MOTION_STOP); return (STAT_NOOP); } cm.motion_state = MOTION_RUN; st_request_exec_move(); // restart the steppers } return (STAT_OK); }