Spindle handling refactoring for improved management and configuration of multiple spindles.

NOTE: this is a relatively large change and may have introduced bugs and/or unintended side-effects. Please report any issues!

Added setting $519 for binding spindle encoder to given spindle in multi spindle configurations.

Added machine readable spindle enumeration report, $SPINDLESH.

Increased default value for setting $398 (number of planner blocs) from 35 to 100 for faster laser engraving.
NOTE: the $398 setting value will not change on an upgrade!
NOTE: STM32F103 builds for the 128K flash variants does not have enough free RAM and will keep 35 as the default value.

Increased allowed number of decimal places from 3 to 5 for $10x stepper step/mm settings. Ref. ioSender issue 346.

Added setting $650 for filing system options. Ref. issue 397.
Currently the following bits are available (depending on the configuration):
0 - Auto mount SD card on startup (1).
1 - Do not add littlefs files when listing the root directory (2).

Added build option for lathe UVW mode.
When enabled UVW words can be used to command relative moves for XYZ without switching to relative mode with G91.
NOTE: This permanently sets lathe mode and disables the $32 mode setting.

There are signature changes to some spindle, ioports enumeration and VFS filing system mount functions.

Added events to allow plugin code to handle tool table data, possibly stored on a SD card.
This commit is contained in:
Terje Io
2023-12-12 09:51:59 +01:00
parent 04a5edcf83
commit 2c58f0de09
34 changed files with 1467 additions and 831 deletions

View File

@@ -92,7 +92,7 @@ static const emap_t target[] = {
{TOOL_ADDR(6), NVS_GROUP_TOOLS, 6},
{TOOL_ADDR(7), NVS_GROUP_TOOLS, 7},
#if N_TOOLS > 8
{TOOL_ADDR(8), NVS_GROUP_TOOLS, 8},
{TOOL_ADDR(8), NVS_GROUP_TOOLS, 8},
{TOOL_ADDR(9), NVS_GROUP_TOOLS, 9},
{TOOL_ADDR(10), NVS_GROUP_TOOLS, 10},
{TOOL_ADDR(11), NVS_GROUP_TOOLS, 11},
@@ -102,7 +102,22 @@ static const emap_t target[] = {
{TOOL_ADDR(15), NVS_GROUP_TOOLS, 15},
#endif
#if N_TOOLS > 16
#error Increase number of tool entries!
{TOOL_ADDR(16), NVS_GROUP_TOOLS, 16},
{TOOL_ADDR(17), NVS_GROUP_TOOLS, 17},
{TOOL_ADDR(18), NVS_GROUP_TOOLS, 18},
{TOOL_ADDR(19), NVS_GROUP_TOOLS, 19},
{TOOL_ADDR(20), NVS_GROUP_TOOLS, 20},
{TOOL_ADDR(21), NVS_GROUP_TOOLS, 21},
{TOOL_ADDR(22), NVS_GROUP_TOOLS, 22},
{TOOL_ADDR(23), NVS_GROUP_TOOLS, 23},
{TOOL_ADDR(24), NVS_GROUP_TOOLS, 24},
{TOOL_ADDR(25), NVS_GROUP_TOOLS, 25},
{TOOL_ADDR(26), NVS_GROUP_TOOLS, 26},
{TOOL_ADDR(27), NVS_GROUP_TOOLS, 27},
{TOOL_ADDR(28), NVS_GROUP_TOOLS, 28},
{TOOL_ADDR(29), NVS_GROUP_TOOLS, 29},
{TOOL_ADDR(30), NVS_GROUP_TOOLS, 30},
{TOOL_ADDR(31), NVS_GROUP_TOOLS, 31},
#endif
#endif
{0, 0, 0} // list termination - do not remove
@@ -360,8 +375,13 @@ void nvs_buffer_sync_physical (void)
settings_dirty.build_info;
} else if(physical_nvs.memcpy_to_flash) {
if(!physical_nvs.memcpy_to_flash(nvsbuffer))
report_message("Settings write failed!", Message_Warning);
uint_fast8_t retries = 4;
do {
if(physical_nvs.memcpy_to_flash(nvsbuffer))
retries = 0;
else if(--retries == 0)
report_message("Settings write failed!", Message_Warning);
} while(retries);
memset(&settings_dirty, 0, sizeof(settings_dirty_t));
}
}
@@ -421,4 +441,3 @@ void nvs_memmap (void)
}
#endif