Added {dw:n} as a way to examine the dwell timer down counter. Useful for testing

This commit is contained in:
Alden Hart
2017-02-06 08:59:13 -05:00
parent 85450a0b92
commit edf2b845b5
5 changed files with 13 additions and 8 deletions
+1
View File
@@ -669,6 +669,7 @@ const cfgItem_t cfgArray[] = {
{ "", "er", _f0, 0, tx_print_nul, rpt_er, set_nul, (float *)&cs.null, 0 }, // get bogus exception report for testing
{ "", "qf", _f0, 0, tx_print_nul, get_nul, cm_run_qf, (float *)&cs.null, 0 }, // SET to invoke queue flush
{ "", "rx", _f0, 0, tx_print_int, get_rx, set_nul, (float *)&cs.null, 0 }, // get RX buffer bytes or packets
{ "", "dw", _f0, 0, tx_print_int, st_get_dw, set_nul, (float *)&cs.null, 0 }, // get dwell time remaining
{ "", "msg", _f0, 0, tx_print_str, get_nul, set_noop, (float *)&cs.null, 0 }, // no operation on messages
{ "", "alarm",_f0,0, tx_print_nul, cm_alrm, cm_alrm, (float *)&cs.null, 0 }, // trigger alarm
{ "", "panic",_f0,0, tx_print_nul, cm_pnic, cm_pnic, (float *)&cs.null, 0 }, // trigger panic
+2 -2
View File
@@ -73,7 +73,7 @@
<InterfaceName>SWD</InterfaceName>
</ToolOptions>
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
<ToolNumber>J41800036434</ToolNumber>
<ToolNumber>J41800030015</ToolNumber>
<ToolName>Atmel-ICE</ToolName>
</com_atmel_avrdbg_tool_atmelice>
<UseGdb>True</UseGdb>
@@ -100,7 +100,7 @@
<HWProgramCounterSampling>True</HWProgramCounterSampling>
</PercepioTrace>
<preserveEEPROM>true</preserveEEPROM>
<avrtoolserialnumber>J41800036434</avrtoolserialnumber>
<avrtoolserialnumber>J41800030015</avrtoolserialnumber>
<avrdeviceexpectedsignature>0x284E0A60</avrdeviceexpectedsignature>
<avrtoolinterfaceclock>10000000</avrtoolinterfaceclock>
<custom>
-5
View File
@@ -399,11 +399,8 @@ stat_t sp_set_spdp(nvObj_t *nv) {
stat_t sp_get_spph(nvObj_t *nv) { return(get_int(nv, spindle.pause_enable)); }
stat_t sp_set_spph(nvObj_t *nv) { return(set_int(nv, (uint8_t &)spindle.pause_enable, 0, 1)); }
stat_t sp_get_spde(nvObj_t *nv) { return(get_float(nv, spindle.spinup_delay)); }
stat_t sp_set_spde(nvObj_t *nv) { return(set_float_range(nv, spindle.spinup_delay, 0, SPINDLE_DWELL_MAX)); }
//stat_t sp_get_spdn(nvObj_t *nv) { return(get_float(nv, spindle.spindown_delay)); }
//stat_t sp_set_spdn(nvObj_t *nv) { return(set_float_range(nv, spindle.spindown_delay, 0, SPINDLE_DWELL_MAX)); }
stat_t sp_get_spsn(nvObj_t *nv) { return(get_float(nv, spindle.speed_min)); }
stat_t sp_set_spsn(nvObj_t *nv) { return(set_float_range(nv, spindle.speed_min, SPINDLE_SPEED_MIN, SPINDLE_SPEED_MAX)); }
@@ -435,7 +432,6 @@ const char fmt_spep[] = "[spep] spindle enable polarity%5d [0=active_low,1=activ
const char fmt_spdp[] = "[spdp] spindle direction polarity%2d [0=CW_low,1=CW_high]\n";
const char fmt_spph[] = "[spph] spindle pause on hold%7d [0=no,1=pause_on_hold]\n";
const char fmt_spde[] = "[spde] spindle spinup delay%10.1f seconds\n";
//const char fmt_spdn[] = "[spdn] spindle spindown delay%8.1f seconds\n";
const char fmt_spsn[] = "[spsn] spindle speed min%14.2f rpm\n";
const char fmt_spsm[] = "[spsm] spindle speed max%14.2f rpm\n";
const char fmt_spoe[] = "[spoe] spindle speed override ena%2d [0=disable,1=enable]\n";
@@ -448,7 +444,6 @@ void sp_print_spep(nvObj_t *nv) { text_print(nv, fmt_spep);} // TYPE_INT
void sp_print_spdp(nvObj_t *nv) { text_print(nv, fmt_spdp);} // TYPE_INT
void sp_print_spph(nvObj_t *nv) { text_print(nv, fmt_spph);} // TYPE_INT
void sp_print_spde(nvObj_t *nv) { text_print(nv, fmt_spde);} // TYPE_FLOAT
//void sp_print_spdn(nvObj_t *nv) { text_print(nv, fmt_spdn);} // TYPE_FLOAT
void sp_print_spsn(nvObj_t *nv) { text_print(nv, fmt_spsn);} // TYPE_FLOAT
void sp_print_spsm(nvObj_t *nv) { text_print(nv, fmt_spsm);} // TYPE_FLOAT
void sp_print_spoe(nvObj_t *nv) { text_print(nv, fmt_spoe);} // TYPE INT
+9 -1
View File
@@ -607,7 +607,7 @@ static void _load_move()
// We now use SysTick events to handle dwells
SysTickTimer.registerEvent(&dwell_systick_event);
// handle synchronous commands
// handle synchronous commands
} else if (st_pre.block_type == BLOCK_TYPE_COMMAND) {
mp_runtime_command(st_pre.bf);
@@ -973,6 +973,7 @@ stat_t st_get_pwr(nvObj_t *nv)
* st_set_md() - disable motor power
* st_set_me() - enable motor power
* st_set_md() - disable motor power
* st_get_dw() - get remaining dwell time
*
* Calling me or md with NULL will enable or disable all motors
* Setting a value of 0 will enable or disable all motors
@@ -1017,6 +1018,13 @@ stat_t st_set_md(nvObj_t *nv)
return (STAT_OK);
}
stat_t st_get_dw(nvObj_t *nv)
{
nv->value = st_run.dwell_ticks_downcount;
nv->valuetype = TYPE_INT;
return (STAT_OK);
}
/***********************************************************************************
* TEXT MODE SUPPORT
* Functions to print variables from the cfgArray table
+1
View File
@@ -601,6 +601,7 @@ stat_t st_get_mt(nvObj_t *nv);
stat_t st_set_mt(nvObj_t *nv);
stat_t st_set_md(nvObj_t *nv);
stat_t st_set_me(nvObj_t *nv);
stat_t st_get_dw(nvObj_t *nv);
#ifdef __TEXT_MODE