083.19 fixed displays during jogging

This commit is contained in:
Alden Hart
2015-05-07 13:15:56 -04:00
parent 16bde0ff01
commit 7e35eab2e5
4 changed files with 51 additions and 65 deletions
+22 -35
View File
@@ -75,7 +75,6 @@ static stat_t _dispatch_command(void);
static stat_t _dispatch_control(void);
static void _dispatch_kernel(void);
static stat_t _controller_state(void); // manage controller state transitions
static stat_t _check_for_phat_city_time(void);
/***********************************************************************************
**** CODE *************************************************************************
@@ -159,33 +158,33 @@ static void _controller_HSM()
//----- planner hierarchy for gcode and cycles ---------------------------------------//
DISPATCH(cm_feedhold_sequencing_callback());// feedhold state machine runner
DISPATCH(mp_plan_buffer()); // attempt to plan unplanned moves (conditionally)
DISPATCH(cm_arc_callback()); // arc generation runs as a cycle above lines
DISPATCH(cm_homing_cycle_callback()); // homing cycle operation (G28.2)
DISPATCH(cm_probing_cycle_callback()); // probing cycle operation (G38.2)
DISPATCH(cm_jogging_cycle_callback()); // jog cycle operation
DISPATCH(cm_deferred_write_callback()); // persist G10 changes when not in machining cycle
//----- command readers and parsers --------------------------------------------------//
DISPATCH(_sync_to_planner()); // ensure there is at least one free buffer in planning queue
DISPATCH(_sync_to_tx_buffer()); // sync with TX buffer (pseudo-blocking)
#ifdef __AVR
DISPATCH(set_baud_callback()); // perform baud rate update (must be after TX sync)
#endif
DISPATCH(_dispatch_command()); // read and execute next command
//---- phat city idle tasks ---------------------------------------------------------//
DISPATCH(_check_for_phat_city_time()); // stop here if it's not phat city time!
DISPATCH(st_motor_power_callback()); // stepper motor power sequencing
#ifdef __AVR
DISPATCH(switch_debounce_callback()); // debounce switches
DISPATCH(switch_debounce_callback()); // debounce switches
#endif
DISPATCH(sr_status_report_callback()); // conditionally send status report
DISPATCH(qr_queue_report_callback()); // conditionally send queue report
DISPATCH(rx_report_callback()); // conditionally send rx report
DISPATCH(cm_feedhold_sequencing_callback());// feedhold state machine runner
DISPATCH(mp_plan_buffer()); // attempt to plan unplanned moves (conditionally)
DISPATCH(cm_arc_callback()); // arc generation runs as a cycle above lines
DISPATCH(cm_homing_cycle_callback()); // homing cycle operation (G28.2)
DISPATCH(cm_probing_cycle_callback()); // probing cycle operation (G38.2)
DISPATCH(cm_jogging_cycle_callback()); // jog cycle operation
DISPATCH(st_motor_power_callback()); // stepper motor power sequencing
DISPATCH(cm_deferred_write_callback()); // persist G10 changes when not in machining cycle
//----- command readers and parsers --------------------------------------------------//
DISPATCH(_sync_to_planner()); // ensure there is at least one free buffer in planning queue
DISPATCH(_sync_to_tx_buffer()); // sync with TX buffer (pseudo-blocking)
#ifdef __AVR
DISPATCH(set_baud_callback()); // perform baud rate update (must be after TX sync)
#endif
DISPATCH(_dispatch_command()); // read and execute next command
//---- phat city idle tasks ---------------------------------------------------------//
// DISPATCH(_check_for_phat_city_time()); // stop here if it's not phat city time!
}
/*
@@ -320,18 +319,6 @@ static stat_t _controller_state()
return (STAT_OK);
}
/*
* _check_for_phat_city_time() - see if there are cycles available for low priority tasks
*/
static stat_t _check_for_phat_city_time(void) {
if (mp_is_it_phat_city_time()) {
return STAT_OK;
}
return STAT_EAGAIN;
}
/*
* _led_indicator() - blink an LED to show it we are normal, alarmed, or shut down
*/
+24 -29
View File
@@ -36,12 +36,6 @@
#include "util.h"
#include "xio.h"
using namespace Motate;
//OutputPin<kDebug1_PinNumber> sr_debug_pin1;
//OutputPin<kDebug2_PinNumber> sr_debug_pin2;
//OutputPin<kDebug3_PinNumber> sr_debug_pin3;
OutputPin<-1> sr_debug_pin3;
/**** Allocation ****/
srSingleton_t sr;
@@ -298,14 +292,16 @@ stat_t sr_status_report_callback() // called by controller dispatcher
return (STAT_NOOP);
#endif
if (sr.status_report_verbosity == SR_OFF) return (STAT_NOOP);
if (sr.status_report_request == SR_OFF) return (STAT_NOOP);
if (SysTickTimer_getValue() < sr.status_report_systick) return (STAT_NOOP);
sr_debug_pin3 = 1;
if (sr.status_report_verbosity == SR_OFF) {
return (STAT_NOOP);
}
if (sr.status_report_request == SR_OFF) {
return (STAT_NOOP);
}
if (SysTickTimer_getValue() < sr.status_report_systick) {
return (STAT_NOOP);
}
if (!mp_is_it_phat_city_time()) {
sr_debug_pin3 = 0;
return (STAT_NOOP);
}
@@ -314,14 +310,11 @@ stat_t sr_status_report_callback() // called by controller dispatcher
} else {
if (_populate_filtered_status_report() == false) { // no new data
sr.status_report_request = SR_OFF; // disable reports until requested again
sr_debug_pin3 = 0;
return (STAT_OK);
}
}
sr.status_report_request = SR_OFF;
nv_print_list(STAT_OK, TEXT_INLINE_PAIRS, JSON_OBJECT_FORMAT);
sr_debug_pin3 = 0;
return (STAT_OK);
}
@@ -330,12 +323,8 @@ stat_t sr_status_report_callback() // called by controller dispatcher
*/
stat_t sr_run_text_status_report()
{
sr_debug_pin3 = 1;
_populate_unfiltered_status_report();
nv_print_list(STAT_OK, TEXT_MULTILINE_FORMATTED, JSON_RESPONSE_FORMAT);
sr_debug_pin3 = 0;
return (STAT_OK);
}
@@ -531,15 +520,18 @@ stat_t qr_queue_report_callback() // called by controller dispatcher
return (STAT_NOOP);
#endif
if (qr.queue_report_verbosity == QR_OFF) { return (STAT_NOOP);}
if (qr.queue_report_requested == false) { return (STAT_NOOP);}
if (!mp_is_it_phat_city_time()) { return (STAT_NOOP);}
if (qr.queue_report_verbosity == QR_OFF) {
return (STAT_NOOP);
}
if (qr.queue_report_requested == false) {
return (STAT_NOOP);
}
if (!mp_is_it_phat_city_time()) {
return (STAT_NOOP);
}
qr.queue_report_requested = false;
sr_debug_pin3 = 1;
if (cs.comm_mode == TEXT_MODE) {
if (qr.queue_report_verbosity == QR_SINGLE) {
fprintf(stderr, "qr:%d\n", qr.buffers_available);
@@ -562,8 +554,6 @@ stat_t qr_queue_report_callback() // called by controller dispatcher
}
}
qr_init_queue_report();
sr_debug_pin3 = 0;
return (STAT_OK);
}
@@ -584,7 +574,12 @@ void rx_request_rx_report(void) {
* rx_report_callback() - send rx report if one has been requested
*/
stat_t rx_report_callback(void) {
if (!rx.rx_report_requested) { return (STAT_NOOP); }
if (!rx.rx_report_requested) {
return (STAT_NOOP);
}
if (!mp_is_it_phat_city_time()) {
return (STAT_NOOP);
}
rx.rx_report_requested = false;
fprintf(stderr, "{\"rx\":%d}\n", rx.space_available);
+4
View File
@@ -517,6 +517,10 @@ void st_deenergize_motors()
*/
stat_t st_motor_power_callback() // called by controller
{
if (!mp_is_it_phat_city_time()) {
return (STAT_NOOP);
}
bool have_actually_stopped = false;
if ((!st_runtime_isbusy()) && (st_pre.buffer_state != PREP_BUFFER_OWNED_BY_LOADER)) { // if there are no moves to load...
have_actually_stopped = true;
+1 -1
View File
@@ -38,7 +38,7 @@
/****** REVISIONS ******/
#ifndef TINYG_FIRMWARE_BUILD
#define TINYG_FIRMWARE_BUILD 083.18 // changes to jogging function to agree with OMC production
#define TINYG_FIRMWARE_BUILD 083.19 // fixed displays during jogging
#endif
#define TINYG_FIRMWARE_VERSION 0.98 // firmware major version