From 335b8a9366b4104e6a1ea9cf6ff2ac1916b9a906 Mon Sep 17 00:00:00 2001 From: Michael Baisch Date: Fri, 21 Jan 2022 10:27:13 +0100 Subject: [PATCH 1/6] Add ability to read and write 64bit (long long) values from and to eeprom --- src/gpx/gpx.c | 90 +++++++++++++++++++++++++++++++++++++--- src/gpx/gpx.h | 2 + src/pymodule/gpxmodule.c | 34 ++++++++++++++- src/shared/eeprominfo.h | 2 +- 4 files changed, 120 insertions(+), 8 deletions(-) diff --git a/src/gpx/gpx.c b/src/gpx/gpx.c index 2e8a22a..5b141af 100644 --- a/src/gpx/gpx.c +++ b/src/gpx/gpx.c @@ -484,6 +484,40 @@ static uint32_t read_32(Gpx *gpx) return le32toh(u.i); } +static void write_64(Gpx *gpx, uint64_t value) +{ + union { + uint64_t i; + unsigned char b[8]; + } u; + u.i = htole64(value); + *gpx->buffer.ptr++ = u.b[0]; + *gpx->buffer.ptr++ = u.b[1]; + *gpx->buffer.ptr++ = u.b[2]; + *gpx->buffer.ptr++ = u.b[3]; + *gpx->buffer.ptr++ = u.b[4]; + *gpx->buffer.ptr++ = u.b[5]; + *gpx->buffer.ptr++ = u.b[6]; + *gpx->buffer.ptr++ = u.b[7]; +} + +static uint64_t read_64(Gpx *gpx) +{ + union { + uint64_t i; + unsigned char b[8]; + } u; + u.b[0] = *gpx->buffer.ptr++; + u.b[1] = *gpx->buffer.ptr++; + u.b[2] = *gpx->buffer.ptr++; + u.b[3] = *gpx->buffer.ptr++; + u.b[4] = *gpx->buffer.ptr++; + u.b[5] = *gpx->buffer.ptr++; + u.b[6] = *gpx->buffer.ptr++; + u.b[7] = *gpx->buffer.ptr++; + return le64toh(u.i); +} + static void write_fixed_16(Gpx *gpx, float value) { unsigned char b = (unsigned char)value; @@ -2647,6 +2681,24 @@ int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long *value) return SUCCESS; } +int write_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long value) +{ + int rval; + gpx->buffer.ptr = sio->response.eeprom.buffer; + write_64(gpx, value); + CALL( write_eeprom(gpx, address, sio->response.eeprom.buffer, 8) ); + return SUCCESS; +} + +int read_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long *value) +{ + int rval; + CALL( read_eeprom(gpx, address, 8) ); + gpx->buffer.ptr = sio->response.eeprom.buffer; + *value = read_64(gpx); + return SUCCESS; +} + int write_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float value) { int rval; @@ -2856,10 +2908,23 @@ static int read_eeprom_name(Gpx *gpx, char *name) unsigned long ul; CALL( read_eeprom_32(gpx, gpx->sio, pem->address, &ul) ); if(pem->et == et_long) { - gcodeResult(gpx, "EEPROM value %s @ 0x%x is %d %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); + gcodeResult(gpx, "EEPROM value %s @ 0x%x is %ld %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); + } + else { + gcodeResult(gpx, "EEPROM value %s @ 0x%x is %lu %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); + } + break; + } + + case et_long_long: + case et_ulong_long: { + unsigned long ull; + CALL( read_eeprom_64(gpx, gpx->sio, pem->address, &ull) ); + if(pem->et == et_long_long) { + gcodeResult(gpx, "EEPROM value %s @ 0x%x is %lld %s (0x%llx)\n", pem->id, pem->address, ull, unit, ull); } else { - gcodeResult(gpx, "EEPROM value %s @ 0x%x is %u %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); + gcodeResult(gpx, "EEPROM value %s @ 0x%x is %llu %s (0x%llx)\n", pem->id, pem->address, ull, unit, ull); } break; } @@ -2888,7 +2953,7 @@ static int read_eeprom_name(Gpx *gpx, char *name) } // write an eeprom value via a defined mapping -static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned long hex, float value) +static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned long long hex, float value) { int rval = SUCCESS; @@ -2907,7 +2972,7 @@ static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned } if(value != 0.0) - hex = (unsigned long)value; + hex = (unsigned long long)value; } @@ -2946,8 +3011,19 @@ static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned case et_long: case et_ulong: - CALL( write_eeprom_32(gpx, gpx->sio, pem->address, hex) ); - gcodeResult(gpx, "EEPROM wrote 32-bits, %lu to address 0x%x\n", hex, pem->address); + if(hex > 2147483648) { + gcodeResult(gpx, "(line %u) Error: parameter out of range for eeprom setting %s\n", gpx->lineNumber, pem->id); + return ERROR; + } + unsigned long ul = (unsigned long)hex; + CALL( write_eeprom_32(gpx, gpx->sio, pem->address, ul) ); + gcodeResult(gpx, "EEPROM wrote 32-bits, %lu to address 0x%x\n", ul, pem->address); + break; + + case et_long_long: + case et_ulong_long: + CALL( write_eeprom_64(gpx, gpx->sio, pem->address, hex) ); + gcodeResult(gpx, "EEPROM wrote 64-bits, %lu to address 0x%x\n", hex, pem->address); break; case et_float: @@ -3288,6 +3364,8 @@ EepromType eepromTypeFromTypeName(char *type_name) case 'H': return et_ushort; case 'i': return et_long; case 'I': return et_ulong; + case 'L': return et_long_long; + case 'K': return et_ulong_long; case 'f': return et_fixed; case 's': return et_string; } diff --git a/src/gpx/gpx.h b/src/gpx/gpx.h index c1a40d3..726da78 100644 --- a/src/gpx/gpx.h +++ b/src/gpx/gpx.h @@ -661,6 +661,8 @@ typedef long speed_t; int read_eeprom_fixed_16(Gpx *gpx, Sio *sio, unsigned address, float *value); int write_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long value); int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long *value); + int write_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long value); + int read_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long *value); int write_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float value); int read_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float *value); diff --git a/src/pymodule/gpxmodule.c b/src/pymodule/gpxmodule.c index 1754656..4e4b6d8 100644 --- a/src/pymodule/gpxmodule.c +++ b/src/pymodule/gpxmodule.c @@ -704,6 +704,7 @@ static PyObject *py_read_eeprom(PyObject *self, PyObject *args) unsigned char b; unsigned short us; unsigned long ul; + unsigned long long ull; float n; switch (pem->et) { case et_boolean: @@ -733,6 +734,12 @@ static PyObject *py_read_eeprom(PyObject *self, PyObject *args) return Py_BuildValue(pem->et == et_long ? "l" : "k", ul); break; + case et_long_long: + case et_ulong_long: + if (read_eeprom_64(&gpx, gpx.sio, pem->address, &ull) == SUCCESS) + return Py_BuildValue(pem->et == et_long_long ? "L" : "K", ull); + break; + case et_float: if (read_eeprom_float(&gpx, gpx.sio, pem->address, &n) == SUCCESS) return Py_BuildValue("f", n); @@ -795,6 +802,7 @@ static PyObject *py_write_eeprom(PyObject *self, PyObject *args) unsigned char b = 0; unsigned short us = 0; unsigned long ul = 0; + unsigned long ull = 0; float n = 0.0; char *s = NULL; int f = 0; @@ -859,7 +867,7 @@ static PyObject *py_write_eeprom(PyObject *self, PyObject *args) value = PyNumber_Long(value); if (value == NULL) return NULL; - f = PyArg_Parse(value, "L", &ul); + f = PyArg_Parse(value, "k", &ul); Py_DECREF(value); if (!f) return NULL; @@ -867,6 +875,30 @@ static PyObject *py_write_eeprom(PyObject *self, PyObject *args) gcodeResult(&gpx, "write_eeprom_32(%lu) to address %u", ul, pem->address); break; + case et_long_long: + value = PyNumber_Long(value); + if (value == NULL) + return NULL; + f = PyArg_Parse(value, "L", &ull); + Py_DECREF(value); + if (!f) + return NULL; + rval = write_eeprom_64(&gpx, gpx.sio, pem->address, ull); + gcodeResult(&gpx, "write_eeprom_64(%lu) to address %u", ull, pem->address); + break; + + case et_ulong_long: + value = PyNumber_Long(value); + if (value == NULL) + return NULL; + f = PyArg_Parse(value, "K", &ull); + Py_DECREF(value); + if (!f) + return NULL; + rval = write_eeprom_64(&gpx, gpx.sio, pem->address, ull); + gcodeResult(&gpx, "write_eeprom_64(%lu) to address %u", ull, pem->address); + break; + case et_float: value = PyNumber_Float(value); if (value == NULL) diff --git a/src/shared/eeprominfo.h b/src/shared/eeprominfo.h index 5f433da..5d96be7 100644 --- a/src/shared/eeprominfo.h +++ b/src/shared/eeprominfo.h @@ -29,7 +29,7 @@ #ifndef __eeprominfo_h__ #define __eeprominfo_h__ -typedef enum { et_null, et_bitfield, et_boolean, et_byte, et_ushort, et_long, et_ulong, et_fixed, et_float, et_string } EepromType; +typedef enum { et_null, et_bitfield, et_boolean, et_byte, et_ushort, et_long, et_ulong, et_long_long, et_ulong_long, et_fixed, et_float, et_string } EepromType; typedef struct tEepromMapping { const char *id; From 9fe00512c6259b838d80ccdd2014840a7b585614 Mon Sep 17 00:00:00 2001 From: Michael Baisch Date: Sat, 22 Jan 2022 10:17:19 +0100 Subject: [PATCH 2/6] Add sailfish v4.7 eeprom map --- src/gpx/tests/eepromtest.gcode | 2 +- src/gpx/tests/eepromtest_sailfish_4_7.gcode | 44 ++++++ src/shared/sailfish_4_7.h | 155 ++++++++++++++++++++ src/shared/std_eeprommaps.h | 2 + 4 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 src/gpx/tests/eepromtest_sailfish_4_7.gcode create mode 100644 src/shared/sailfish_4_7.h diff --git a/src/gpx/tests/eepromtest.gcode b/src/gpx/tests/eepromtest.gcode index f070e71..9fca709 100644 --- a/src/gpx/tests/eepromtest.gcode +++ b/src/gpx/tests/eepromtest.gcode @@ -1,4 +1,4 @@ -(@loadmap) +(@load_eeprom_map) (@eread LED_CUSTOM_COLOR_R) (@eread LED_CUSTOM_COLOR_G) (@eread LED_CUSTOM_COLOR_B) diff --git a/src/gpx/tests/eepromtest_sailfish_4_7.gcode b/src/gpx/tests/eepromtest_sailfish_4_7.gcode new file mode 100644 index 0000000..332c02a --- /dev/null +++ b/src/gpx/tests/eepromtest_sailfish_4_7.gcode @@ -0,0 +1,44 @@ +(@load_eeprom_map) +(@eread ACCELERATION_ACTIVE) +(@eread MAX_ACCELERATION_EXTRUDER_MOVE) +(@eread MAX_SPEED_CHANGE_X) +(@eread MAX_SPEED_CHANGE_Y) +(@eread MAX_SPEED_CHANGE_Z) +(@eread MAX_SPEED_CHANGE_A) +(@eread MAX_SPEED_CHANGE_B) +(@eread MAX_ACCELERATION_AXIS_X) +(@eread MAX_ACCELERATION_AXIS_Y) +(@eread MAX_ACCELERATION_AXIS_Z) +(@eread MAX_ACCELERATION_AXIS_A) +(@eread MAX_ACCELERATION_AXIS_B) +(@eread EXTRUDER_DEPRIME_ON_TRAVEL) +(@eread PREHEAT_PREHEAT_RIGHT_TEMP) +(@eread PREHEAT_PREHEAT_PLATFORM_TEMP) +(@eread PREHEAT_PREHEAT_LEFT_TEMP) +(@eread JKN_ADVANCE_K2) +(@eread JKN_ADVANCE_K) +(@eread EXTRUDER_DEPRIME_STEPS_A) +(@eread EXTRUDER_DEPRIME_STEPS_B) +(@eread SLOWDOWN_FLAG) +(@eread MACHINE_NAME) +(@eread PSTOP_ENABLE) +(@eread DITTO_PRINT_ENABLED) +(@eread SD_USE_CRC) +(@eread CLEAR_FOR_ESTOP) +(@eread AXIS_HOME_POSITIONS_STEPS_X) +(@eread AXIS_HOME_POSITIONS_STEPS_Y) +(@eread AXIS_HOME_POSITIONS_STEPS_Z) +(@eread AXIS_HOME_POSITIONS_STEPS_A) +(@eread AXIS_HOME_POSITIONS_STEPS_B) +(@eread AXIS_STEPS_PER_MM_X) +(@eread AXIS_STEPS_PER_MM_Y) +(@eread AXIS_STEPS_PER_MM_Z) +(@eread AXIS_STEPS_PER_MM_A) +(@eread AXIS_STEPS_PER_MM_B) +(@eread ENDSTOP_INVERSION) +(@eread TOOL_COUNT) +(@eread AXIS_INVERSION) +(@eread TOOLHEAD_OFFSET_SYSTEM) +(@eread TOOLHEAD_OFFSET_SETTINGS_X) +(@eread TOOLHEAD_OFFSET_SETTINGS_Y) +(@eread EXTRUDER_HOLD) diff --git a/src/shared/sailfish_4_7.h b/src/shared/sailfish_4_7.h new file mode 100644 index 0000000..8a6957a --- /dev/null +++ b/src/shared/sailfish_4_7.h @@ -0,0 +1,155 @@ +EepromMapping eeprom_map_sailfish_4_7[] = { +{ "ACCELERATION_ACTIVE", "Acceleration active", "", 0x126, et_boolean, 0, 0, 1, + "Check or set to 1 to use acceleration. Uncheck or set to 0 for no acceleration. Note that you must turn acceleration on to print safely at speeds over 50mm/s." }, +{ "MAX_ACCELERATION_EXTRUDER_MOVE", "Max acceleration extruder move", "mm/s²", 0x14B, et_ulong, 0, 0, 0, + "" }, +{ "MAX_SPEED_CHANGE_X", "Max speed change x", "mm/s * 10", 0x192, et_long, 0, 0, 0, + "" }, +{ "MAX_SPEED_CHANGE_Y", "Max speed change y", "mm/s * 10", 0x196, et_long, 0, 0, 0, + "" }, +{ "MAX_SPEED_CHANGE_Z", "Max speed change z", "mm/s * 10", 0x19A, et_long, 0, 0, 0, + "" }, +{ "MAX_SPEED_CHANGE_A", "Max speed change a", "mm/s * 10", 0x19E, et_long, 0, 0, 0, + "" }, +{ "MAX_SPEED_CHANGE_B", "Max speed change b", "mm/s * 10", 0x1A2, et_long, 0, 0, 0, + "" }, +{ "MAX_ACCELERATION_AXIS_X", "Max acceleration axis x", "mm/s²", 0x13B, et_ulong, 0, 0, 0, + "" }, +{ "MAX_ACCELERATION_AXIS_Y", "Max acceleration axis y", "mm/s²", 0x13F, et_ulong, 0, 0, 0, + "" }, +{ "MAX_ACCELERATION_AXIS_Z", "Max acceleration axis z", "mm/s²", 0x143, et_ulong, 0, 0, 0, + "" }, +{ "MAX_ACCELERATION_AXIS_A", "Max acceleration axis a", "mm/s²", 0x147, et_ulong, 0, 0, 0, + "" }, +{ "MAX_ACCELERATION_AXIS_B", "Max acceleration axis b", "mm/s²", 0x1A6, et_ulong, 0, 0, 0, + "" }, +/*{ "MAX_ACCELERATION_NORMAL_MOVE", "Max acceleration normal move", "mm/s²", 0x14B, et_ushort, 0, 0, 0, + "" },*/ +{ "EXTRUDER_DEPRIME_ON_TRAVEL", "Extruder deprime on travel", "", 0x1EE, et_boolean, 0, 0, 1, + "When set, the firmware will deprime the extruder on detected travel moves as well as on pauses, planned or otherwise. When not set, the firmware will only deprime the extruder on pauses, planned or otherwise. Unplanned pauses occur when the acceleration planner falls behind and the printer waits briefly for another segment to print." }, +/*{ "ALEVEL_MAX_ZPROBE_HITS", "Alevel max zprobe hits", "", 0xf64, et_byte, 0, 0, 200, + "Trigger a pause if the auto-leveling probe registers too many hits during a print. Set to the value 0 to allow an unlimited number of hits without pausing; otherwise, set to a value in the range 1 to 200." }, +{ "T0_COOLING_SETPOINT_C", "T0 cooling setpoint c", "C", 0x11b, et_byte, 0, 0, 300, + "" }, +{ "T0_COOLING_ENABLE", "T0 cooling enable", "", 0x11a, et_boolean, 0, 0, 1, + "" }, +{ "T0_EXTRUDER_P_TERM", "T0 extruder p term", "", 0x10a, et_fixed, 0, 0, 100, + "" }, +{ "T0_EXTRUDER_I_TERM", "T0 extruder i term", "", 0x10c, et_fixed, 0, 0, 1, + "" }, +{ "T0_EXTRUDER_D_TERM", "T0 extruder d term", "", 0x10e, et_fixed, 0, 0, 100, + "" }, +{ "HBP_P_TERM", "Heatbed p term", "", 0x110, et_fixed, 0, 0, 100, + "" }, +{ "HBP_I_TERM", "T0 extruder i term", "", 0x112, et_fixed, 0, 0, 1, + "" }, +{ "HBP_D_TERM", "T0 extruder d term", "", 0x114, et_fixed, 0, 0, 100, + "" },*/ +{ "PREHEAT_PREHEAT_RIGHT_TEMP", "Preheat preheat right temp (TOOL0)", "C", 0x80, et_byte, 0, 0, 255, + "" }, +{ "PREHEAT_PREHEAT_PLATFORM_TEMP", "Preheat preheat platform temp", "C", 0x82, et_byte, 0, 0, 130, + "" }, +{ "PREHEAT_PREHEAT_LEFT_TEMP", "Preheat preheat left temp (TOOL1)", "C", 0x81, et_byte, 0, 0, 255, + "" }, +{ "JKN_ADVANCE_K2", "Jkn advance k2", "factor * 100000", 0x15F, et_ulong, 0, 0, 0, + "" }, +{ "JKN_ADVANCE_K", "Jkn advance k", "factor * 100000", 0x167, et_ulong, 0, 0, 0, + "" }, +{ "EXTRUDER_DEPRIME_STEPS_A", "Extruder deprime steps a", "steps", 0x185, et_ulong, 0, 0, 0, + "" }, +{ "EXTRUDER_DEPRIME_STEPS_B", "Extruder deprime steps b", "steps", 0x1AA, et_ulong, 0, 0, 0, + "" }, +{ "SLOWDOWN_FLAG", "Slowdown flag", "", 0x189, et_boolean, 0, 0, 1, + "Check or set to 1 to enable automatic print slowdown when the queue of planned segments is running low. Uncheck or set to 0 to disable automatic slowdown." }, +/*{ "COOLING_FAN_DUTY_CYCLE", "Cooling fan duty cycle", "", 0xf63, et_byte, 0, 0, 100, + "Set a blower strength (duty cycle) to use for the print cooling fan when it is activated by the print commands. Select a value between 0% (off) and 100% (on full). For example, if your fan is too strong, you may want to set this value to 50 so that the fan operates at 50% strength. If set this value to 0, then the cooling fan will not activate at all when the print commands request it to." },*/ +{ "MACHINE_NAME", "Machine name", "", 0x20, et_string, 16, 0, 0, + "" }, +/*{ "ALEVEL_MAX_ZDELTA", "Alevel max zdelta", "steps", 0xf66, et_long, 0, 0, 0, + "The maximum vertical difference between any two probed leveling points may not exceed this value. Default value is 50 steps (0.5 mm)." },*/ +{ "PSTOP_ENABLE", "Pstop enable", "", 0x1EC, et_boolean, 0, 0, 1, + "Check or set to 1 to enable the optional Pause Stop hardware. Set to zero or uncheck to disable. The bot should be power cycled after changing this field." }, +{ "DITTO_PRINT_ENABLED", "Ditto print enabled", "", 0x1DC, et_boolean, 0, 0, 1, + "Check or set to 1 to enable ditto printing. Uncheck or set to zero to disable ditto printing." }, +{ "SD_USE_CRC", "Sd use crc", "", 0x1EB, et_boolean, 0, 0, 1, + "Check or set to 1 to enable SD card error checkin. Uncheck or set to 0 to disable." }, +{ "CLEAR_FOR_ESTOP", "Clear for estop", "", 0x1EF, et_boolean, 0, 0, 1, + "Check or set to 1 to instruct the printer to clear the build away from the extruder before stopping. Uncheck or set to zero to immediately stop the printer (e.g., perform an Emergency Stop)." }, +/*{ "AXIS_HOME_DIRECTION", "Axis home direction", "", 0xc, et_bitfield, 0, 0, 0, + "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is homing in the wrong direction, toggle the bit for that axis" }, +{ "LED_LED_HEAT", "Led led heat", "", 0x142, et_byte, 0, 1, 0, + "" }, +{ "LED_BASIC_COLOR", "Led basic color", "", 0x140, et_byte, 0, 0, 10, + "" }, +{ "LED_CUSTOM_COLOR_R", "Led custom color r", "RGB", 0x144, et_byte, 0, 0, 0, + "" }, +{ "LED_CUSTOM_COLOR_G", "Led custom color g", "RGB", 0x145, et_byte, 0, 0, 0, + "" }, +{ "LED_CUSTOM_COLOR_B", "Led custom color b", "RGB", 0x146, et_byte, 0, 0, 0, + "" },*/ +{ "AXIS_HOME_POSITIONS_STEPS_X", "Axis home positions steps x", "steps", 0x60, et_long, 0, 0, 0, + "" }, +{ "AXIS_HOME_POSITIONS_STEPS_Y", "Axis home positions steps y", "steps", 0x64, et_long, 0, 0, 0, + "" }, +{ "AXIS_HOME_POSITIONS_STEPS_Z", "Axis home positions steps z", "steps", 0x68, et_long, 0, 0, 0, + "" }, +{ "AXIS_HOME_POSITIONS_STEPS_A", "Axis home positions steps a", "steps", 0x6C, et_long, 0, 0, 0, + "" }, +{ "AXIS_HOME_POSITIONS_STEPS_B", "Axis home positions steps b", "steps", 0x70, et_long, 0, 0, 0, + "" }, +{ "AXIS_STEPS_PER_MM_X", "Axis steps per mm x", "10,000,000,000 * steps/mm", 0x8b, et_long_long, 0, 0, 0, + "" }, +{ "AXIS_STEPS_PER_MM_Y", "Axis steps per mm y", "10,000,000,000 * steps/mm", 0x93, et_long_long, 0, 0, 0, + "" }, +{ "AXIS_STEPS_PER_MM_Z", "Axis steps per mm z", "10,000,000,000 * steps/mm", 0x9b, et_long_long, 0, 0, 0, + "" }, +{ "AXIS_STEPS_PER_MM_A", "Axis steps per mm a", "10,000,000,000 * steps/mm", 0xa3, et_long_long, 0, 0, 0, + "" }, +{ "AXIS_STEPS_PER_MM_B", "Axis steps per mm b", "10,000,000,000 * steps/mm", 0xab, et_long_long, 0, 0, 0, + "" }, +{ "OVERRIDE_GCODE_TEMP", "Override gcode temp", "", 0xc5, et_boolean, 0, 0, 1, + "Check or set to 1 to override non-zero gcode temperature settings with the pre-heat temperature settings. Uncheck or set to zero to honor temperature settings in the gcode." }, +{ "ENDSTOP_INVERSION", "Endstop inversion", "", 0x3, et_bitfield, 0, 0, 0, + "" }, +{ "TOOL_COUNT", "Tool count", "", 0x1AE, et_byte, 0, 1, 2, + "" }, +/*{ "T1_COOLING_SETPOINT_C", "T1 cooling setpoint c", "C", 0x137, et_byte, 0, 0, 300, + "" }, +{ "T1_COOLING_ENABLE", "T1 cooling enable", "", 0x136, et_boolean, 0, 0, 1, + "" }, +{ "T1_EXTRUDER_P_TERM", "T1 extruder p term", "", 0x126, et_fixed, 0, 0, 100, + "" }, +{ "T1_EXTRUDER_I_TERM", "T1 extruder i term", "", 0x128, et_fixed, 0, 0, 1, + "" }, +{ "T1_EXTRUDER_D_TERM", "T1 extruder d term", "", 0x12a, et_fixed, 0, 0, 100, + "" }, +{ "BUZZ_SOUND_ON", "Buzz sound on", "", 0x14a, et_boolean, 0, 0, 1, + "Check or set to 1 to play bot sounds. Uncheck or set to 0 for no sounds." }, +{ "HEAT_DURING_PAUSE", "Heat during pause", "", 0xffe, et_boolean, 0, 0, 1, + "Check or set to 1 to leave heaters enabled for up to 30 minutes while the bot is pasued. Uncheck or set to zero to disable the heaters upon entering a paused state." },*/ +{ "AXIS_INVERSION", "Axis inversion", "", 0x2, et_bitfield, 0, 0, 0, + "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is moving in the wrong direction, toggle the bit for that axis" }, +/*{ "DIGI_POT_SETTINGS_0", "Digi pot settings 0", "scale(1-118)", 0x6, et_byte, 0, 0, 0, + "" }, +{ "DIGI_POT_SETTINGS_1", "Digi pot settings 0", "scale(1-118)", 0x7, et_byte, 0, 0, 0, + "" }, +{ "DIGI_POT_SETTINGS_2", "Digi pot settings 0", "scale(1-118)", 0x8, et_byte, 0, 0, 0, + "" }, +{ "DIGI_POT_SETTINGS_3", "Digi pot settings 0", "scale(1-118)", 0x9, et_byte, 0, 0, 0, + "" }, +{ "DIGI_POT_SETTINGS_4", "Digi pot settings 0", "scale(1-118)", 0xa, et_byte, 0, 0, 0, + "" }, +{ "HBP_PRESENT", "Hbp present", "", 0x4c, et_boolean, 0, 0, 1, + "Check or set to 1 if this machine has a heated build platform; otherwise, uncheck or set to 0 if it does not. The bot should be power cycled after changing this field." },*/ +{ "TOOLHEAD_OFFSET_SYSTEM", "Toolhead offset system", "", 0x1EA, et_boolean, 0, 0, 1, + "Check to use the NEW dualstrusion system. Uncheck to use the old (RepG 39 and earlier) dualstrusion system. The bot should be power cycled after changing this field." }, +{ "TOOLHEAD_OFFSET_SETTINGS_X", "Toolhead offset settings x", "steps", 0x1B0, et_long, 0, -2000, 20000, + "" }, +{ "TOOLHEAD_OFFSET_SETTINGS_Y", "Toolhead offset settings y", "steps", 0x1B4, et_long, 0, -2000, 20000, + "" }, +{ "EXTRUDER_HOLD", "Extruder hold", "", 0x1E9, et_boolean, 0, 0, 1, + "Check or set to 1 to enable the Extruder Hold feature. Uncheck or set to 0 to disable." }, +}; + +// Offsets from https://www.thingiverse.com/thing:32084/files 'sailfish_makerware_eeprom_maps' +// Not used: EEPROM_SIZE, VERSION_LOW, VERSION_HIGH, ESTOP_CONFIGURATION, EXTRUDE_DURATION, EXTRUDE_MMS, MOOD_LIGHT_SCRIPT, MOOD_LIGHT_CUSTOM_RED, MOOD_LIGHT_CUSTOM_GREEN, MOOD_LIGHT_CUSTOM_BLUE, JOG_MODE_SETTINGS, BUZZER_REPEATS, FILAMENT_LIFETIME_A, FILAMENT_TRIP_A, ABP_COPIES, UNUSED1, PROFILE_BASE, ACCEL_MAX_EXTRUDER_RETRACT, UNUSED2, UNUSED3, UNUSED4, UNUSED5, UNUSED6, UNUSED7, LCD_TYPE, ENDSTOPS_USED, HOMING_FEED_RATE_X, HOMING_FEED_RATE_Y, HOMING_FEED_RATE_Z, UNUSED8, UNUSED9, UNUSED10, UNUSED11, AXIS_LENGTHS, FILAMENT_LIFETIME_B, FILAMENT_TRIP_B, VID_PID_INFO, ENDSTOP_Z_MIN diff --git a/src/shared/std_eeprommaps.h b/src/shared/std_eeprommaps.h index 9a4a099..65f2b46 100644 --- a/src/shared/std_eeprommaps.h +++ b/src/shared/std_eeprommaps.h @@ -31,9 +31,11 @@ #include "eeprominfo.h" #include "sailfish_7_7.h" +#include "sailfish_4_7.h" EepromMap eepromMaps[] = { { 707, 708, 0x80, eeprom_map_sailfish_7_7, (sizeof(eeprom_map_sailfish_7_7) / sizeof(EepromMapping)) }, + { 407, 408, 0x80, eeprom_map_sailfish_4_7, (sizeof(eeprom_map_sailfish_4_7) / sizeof(EepromMapping)) }, }; #define eepromMapCount (sizeof(eepromMaps) / sizeof(EepromMap)) From 103056e01f53c5d1dc5b6da96893b89824459119 Mon Sep 17 00:00:00 2001 From: Michael Baisch Date: Mon, 24 Jan 2022 12:38:29 +0100 Subject: [PATCH 3/6] Use specific number of bits for short, long, and long long variables when working with eeprom --- src/gpx/gpx.c | 29 ++++++++++++++--------------- src/gpx/gpx.h | 13 +++++++------ src/pymodule/gpxmodule.c | 14 ++++++++------ 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/gpx/gpx.c b/src/gpx/gpx.c index 5b141af..136e1d3 100644 --- a/src/gpx/gpx.c +++ b/src/gpx/gpx.c @@ -34,7 +34,6 @@ #include #include #include -#include #include @@ -2627,7 +2626,7 @@ int read_eeprom_8(Gpx *gpx, Sio *sio, unsigned address, unsigned char *value) return SUCCESS; } -int write_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short value) +int write_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, uint16_t value) { int rval; gpx->buffer.ptr = sio->response.eeprom.buffer; @@ -2636,7 +2635,7 @@ int write_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short value) return SUCCESS; } -int read_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short *value) +int read_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, uint16_t *value) { int rval; CALL( read_eeprom(gpx, address, 2) ); @@ -2663,7 +2662,7 @@ int read_eeprom_fixed_16(Gpx *gpx, Sio *sio, unsigned address, float *value) return SUCCESS; } -int write_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long value) +int write_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, uint32_t value) { int rval; gpx->buffer.ptr = sio->response.eeprom.buffer; @@ -2672,7 +2671,7 @@ int write_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long value) return SUCCESS; } -int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long *value) +int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, uint32_t *value) { int rval; CALL( read_eeprom(gpx, address, 4) ); @@ -2681,7 +2680,7 @@ int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long *value) return SUCCESS; } -int write_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long value) +int write_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, uint64_t value) { int rval; gpx->buffer.ptr = sio->response.eeprom.buffer; @@ -2690,7 +2689,7 @@ int write_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long val return SUCCESS; } -int read_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long *value) +int read_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, uint64_t *value) { int rval; CALL( read_eeprom(gpx, address, 8) ); @@ -2890,7 +2889,7 @@ static int read_eeprom_name(Gpx *gpx, char *name) } case et_ushort: { - unsigned short us; + uint16_t us; CALL( read_eeprom_16(gpx, gpx->sio, pem->address, &us) ); gcodeResult(gpx, "EEPROM value %s @ 0x%x is %u %s (0x%x)\n", pem->id, pem->address, us, unit, us); break; @@ -2905,7 +2904,7 @@ static int read_eeprom_name(Gpx *gpx, char *name) case et_long: case et_ulong: { - unsigned long ul; + uint32_t ul; CALL( read_eeprom_32(gpx, gpx->sio, pem->address, &ul) ); if(pem->et == et_long) { gcodeResult(gpx, "EEPROM value %s @ 0x%x is %ld %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); @@ -2918,7 +2917,7 @@ static int read_eeprom_name(Gpx *gpx, char *name) case et_long_long: case et_ulong_long: { - unsigned long ull; + uint64_t ull; CALL( read_eeprom_64(gpx, gpx->sio, pem->address, &ull) ); if(pem->et == et_long_long) { gcodeResult(gpx, "EEPROM value %s @ 0x%x is %lld %s (0x%llx)\n", pem->id, pem->address, ull, unit, ull); @@ -2953,7 +2952,7 @@ static int read_eeprom_name(Gpx *gpx, char *name) } // write an eeprom value via a defined mapping -static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned long long hex, float value) +static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, uint64_t hex, double value) { int rval = SUCCESS; @@ -2972,7 +2971,7 @@ static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned } if(value != 0.0) - hex = (unsigned long long)value; + hex = (uint64_t)(int64_t)value; } @@ -2995,7 +2994,7 @@ static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned gcodeResult(gpx, "(line %u) Error: parameter out of range for eeprom setting %s\n", gpx->lineNumber, pem->id); return ERROR; } - unsigned short us = (unsigned short)hex; + uint16_t us = (uint16_t)hex; CALL( write_eeprom_16(gpx, gpx->sio, pem->address, us) ); gcodeResult(gpx, "EEPROM wrote 16-bits, %u to address 0x%x\n", us, pem->address); break; @@ -3015,7 +3014,7 @@ static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned gcodeResult(gpx, "(line %u) Error: parameter out of range for eeprom setting %s\n", gpx->lineNumber, pem->id); return ERROR; } - unsigned long ul = (unsigned long)hex; + uint32_t ul = (uint32_t)hex; CALL( write_eeprom_32(gpx, gpx->sio, pem->address, ul) ); gcodeResult(gpx, "EEPROM wrote 32-bits, %lu to address 0x%x\n", ul, pem->address); break; @@ -3023,7 +3022,7 @@ static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned case et_long_long: case et_ulong_long: CALL( write_eeprom_64(gpx, gpx->sio, pem->address, hex) ); - gcodeResult(gpx, "EEPROM wrote 64-bits, %lu to address 0x%x\n", hex, pem->address); + gcodeResult(gpx, "EEPROM wrote 64-bits, %llu to address 0x%x\n", hex, pem->address); break; case et_float: diff --git a/src/gpx/gpx.h b/src/gpx/gpx.h index 726da78..54cfc79 100644 --- a/src/gpx/gpx.h +++ b/src/gpx/gpx.h @@ -36,6 +36,7 @@ extern "C" { #include #include #include "vector.h" +#include #include "config.h" #if defined(SERIAL_SUPPORT) @@ -655,14 +656,14 @@ typedef long speed_t; int write_eeprom(Gpx *gpx, unsigned address, char *data, unsigned length); int write_eeprom_8(Gpx *gpx, Sio *sio, unsigned address, unsigned char value); int read_eeprom_8(Gpx *gpx, Sio *sio, unsigned address, unsigned char *value); - int write_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short value); - int read_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short *value); + int write_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, uint16_t value); + int read_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, uint16_t *value); int write_eeprom_fixed_16(Gpx *gpx, Sio *sio, unsigned address, float value); int read_eeprom_fixed_16(Gpx *gpx, Sio *sio, unsigned address, float *value); - int write_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long value); - int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long *value); - int write_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long value); - int read_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, unsigned long long *value); + int write_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, uint32_t value); + int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, uint32_t *value); + int write_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, uint64_t value); + int read_eeprom_64(Gpx *gpx, Sio *sio, unsigned address, uint64_t *value); int write_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float value); int read_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float *value); diff --git a/src/pymodule/gpxmodule.c b/src/pymodule/gpxmodule.c index 4e4b6d8..7864a79 100644 --- a/src/pymodule/gpxmodule.c +++ b/src/pymodule/gpxmodule.c @@ -5,6 +5,7 @@ #include #include #include +#include #if !defined(_WIN32) && !defined(_WIN64) #include @@ -702,10 +703,11 @@ static PyObject *py_read_eeprom(PyObject *self, PyObject *args) } unsigned char b; - unsigned short us; - unsigned long ul; - unsigned long long ull; + uint16_t us; + uint32_t ul; + uint64_t ull; float n; + switch (pem->et) { case et_boolean: if (read_eeprom_8(&gpx, gpx.sio, pem->address, &b) == SUCCESS) @@ -800,9 +802,9 @@ static PyObject *py_write_eeprom(PyObject *self, PyObject *args) int rval = SUCCESS; int len = 0; unsigned char b = 0; - unsigned short us = 0; - unsigned long ul = 0; - unsigned long ull = 0; + uint16_t us = 0; + uint32_t ul = 0; + uint64_t ull = 0; float n = 0.0; char *s = NULL; int f = 0; From 0ae0d777e1d8be945f02def7a1e62b3f78c7935e Mon Sep 17 00:00:00 2001 From: Michael Baisch Date: Mon, 24 Jan 2022 12:39:49 +0100 Subject: [PATCH 4/6] Add ability to write negative numbers to eeprom --- src/gpx/gpx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpx/gpx.c b/src/gpx/gpx.c index 136e1d3..ff18f4c 100644 --- a/src/gpx/gpx.c +++ b/src/gpx/gpx.c @@ -3010,7 +3010,7 @@ static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, uint64_t case et_long: case et_ulong: - if(hex > 2147483648) { + if(value > 0 && hex > 2147483648) { gcodeResult(gpx, "(line %u) Error: parameter out of range for eeprom setting %s\n", gpx->lineNumber, pem->id); return ERROR; } @@ -3498,7 +3498,7 @@ static int parse_macro(Gpx *gpx, const char* macro, char *p) while(*p && (isalnum(*p) || *p == '_')) p++; if(*p) *p++ = 0; } - else if(isdigit(*p)) { + else if(isdigit(*p) || *p == '-') { char *t = p; while(*p && !isspace(*p)) p++; if(*(p - 1) == 'm') { From e8200128fc312fe91a511cc7719031e5ca1169f2 Mon Sep 17 00:00:00 2001 From: Michael Baisch Date: Mon, 24 Jan 2022 12:51:08 +0100 Subject: [PATCH 5/6] Add 'unitScaleFactor' to eeprom map --- src/gpx/gpx.c | 14 +-- src/pymodule/gpxmodule.c | 70 +++++++-------- src/shared/eeprominfo.h | 1 + src/shared/sailfish_4_7.h | 174 +++++++++++++++++++------------------- src/shared/sailfish_7_7.h | 164 +++++++++++++++++------------------ 5 files changed, 209 insertions(+), 214 deletions(-) diff --git a/src/gpx/gpx.c b/src/gpx/gpx.c index ff18f4c..6b69c5c 100644 --- a/src/gpx/gpx.c +++ b/src/gpx/gpx.c @@ -2906,12 +2906,14 @@ static int read_eeprom_name(Gpx *gpx, char *name) case et_ulong: { uint32_t ul; CALL( read_eeprom_32(gpx, gpx->sio, pem->address, &ul) ); + double result; if(pem->et == et_long) { - gcodeResult(gpx, "EEPROM value %s @ 0x%x is %ld %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); + result = (int32_t) ul / pem->unitScaleFactor; } else { - gcodeResult(gpx, "EEPROM value %s @ 0x%x is %lu %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); + result = ul / pem->unitScaleFactor; } + gcodeResult(gpx, "EEPROM value %s @ 0x%x is %g %s (0x%lx)\n", pem->id, pem->address, result, unit, ul); break; } @@ -2919,12 +2921,14 @@ static int read_eeprom_name(Gpx *gpx, char *name) case et_ulong_long: { uint64_t ull; CALL( read_eeprom_64(gpx, gpx->sio, pem->address, &ull) ); + double result; if(pem->et == et_long_long) { - gcodeResult(gpx, "EEPROM value %s @ 0x%x is %lld %s (0x%llx)\n", pem->id, pem->address, ull, unit, ull); + result = (int64_t) ull / pem->unitScaleFactor; } else { - gcodeResult(gpx, "EEPROM value %s @ 0x%x is %llu %s (0x%llx)\n", pem->id, pem->address, ull, unit, ull); + result = ull / pem->unitScaleFactor; } + gcodeResult(gpx, "EEPROM value %s @ 0x%x is %g %s (0x%llx)\n", pem->id, pem->address, result, unit, ull); break; } @@ -2971,7 +2975,7 @@ static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, uint64_t } if(value != 0.0) - hex = (uint64_t)(int64_t)value; + hex = (uint64_t)(int64_t) (value * pem->unitScaleFactor); } diff --git a/src/pymodule/gpxmodule.c b/src/pymodule/gpxmodule.c index 7864a79..32d1716 100644 --- a/src/pymodule/gpxmodule.c +++ b/src/pymodule/gpxmodule.c @@ -732,14 +732,26 @@ static PyObject *py_read_eeprom(PyObject *self, PyObject *args) case et_long: case et_ulong: - if (read_eeprom_32(&gpx, gpx.sio, pem->address, &ul) == SUCCESS) - return Py_BuildValue(pem->et == et_long ? "l" : "k", ul); + if (read_eeprom_32(&gpx, gpx.sio, pem->address, &ul) == SUCCESS) { + if(pem->et == et_long) { + return Py_BuildValue("f", (int32_t) ul / pem->unitScaleFactor); + } + else { + return Py_BuildValue("f", ul / pem->unitScaleFactor); + } + } break; case et_long_long: case et_ulong_long: - if (read_eeprom_64(&gpx, gpx.sio, pem->address, &ull) == SUCCESS) - return Py_BuildValue(pem->et == et_long_long ? "L" : "K", ull); + if (read_eeprom_64(&gpx, gpx.sio, pem->address, &ull) == SUCCESS) { + if(pem->et == et_long_long) { + return Py_BuildValue("f", (int64_t) ull / pem->unitScaleFactor); + } + else { + return Py_BuildValue("f", ull / pem->unitScaleFactor); + } + } break; case et_float: @@ -808,6 +820,19 @@ static PyObject *py_write_eeprom(PyObject *self, PyObject *args) float n = 0.0; char *s = NULL; int f = 0; + + if(pem->et != et_string) { + PyObject *valueNum = PyNumber_Float(value); + if (valueNum == NULL) + return NULL; + double valueD = 0; + f = PyArg_Parse(valueNum, "d", &valueD); + Py_DECREF(valueNum); + if (!f) + return NULL; + ull = (uint64_t)(int64_t) (valueD * pem->unitScaleFactor); + } + switch (pem->et) { case et_boolean: if (!PyArg_Parse(value, "B", &b)) @@ -854,49 +879,14 @@ static PyObject *py_write_eeprom(PyObject *self, PyObject *args) break; case et_long: - value = PyNumber_Long(value); - if (value == NULL) - return NULL; - f = PyArg_Parse(value, "l", &ul); - Py_DECREF(value); - if (!f) - return NULL; - rval = write_eeprom_32(&gpx, gpx.sio, pem->address, ul); - gcodeResult(&gpx, "write_eeprom_32(%lu) to address %u", ul, pem->address); - break; - case et_ulong: - value = PyNumber_Long(value); - if (value == NULL) - return NULL; - f = PyArg_Parse(value, "k", &ul); - Py_DECREF(value); - if (!f) - return NULL; + ul = (uint32_t)ull; rval = write_eeprom_32(&gpx, gpx.sio, pem->address, ul); gcodeResult(&gpx, "write_eeprom_32(%lu) to address %u", ul, pem->address); break; case et_long_long: - value = PyNumber_Long(value); - if (value == NULL) - return NULL; - f = PyArg_Parse(value, "L", &ull); - Py_DECREF(value); - if (!f) - return NULL; - rval = write_eeprom_64(&gpx, gpx.sio, pem->address, ull); - gcodeResult(&gpx, "write_eeprom_64(%lu) to address %u", ull, pem->address); - break; - case et_ulong_long: - value = PyNumber_Long(value); - if (value == NULL) - return NULL; - f = PyArg_Parse(value, "K", &ull); - Py_DECREF(value); - if (!f) - return NULL; rval = write_eeprom_64(&gpx, gpx.sio, pem->address, ull); gcodeResult(&gpx, "write_eeprom_64(%lu) to address %u", ull, pem->address); break; diff --git a/src/shared/eeprominfo.h b/src/shared/eeprominfo.h index 5d96be7..0c8de0e 100644 --- a/src/shared/eeprominfo.h +++ b/src/shared/eeprominfo.h @@ -41,6 +41,7 @@ typedef struct tEepromMapping { int minValue; int maxValue; const char *tooltip; + double unitScaleFactor; } EepromMapping; typedef struct tEepromMap { diff --git a/src/shared/sailfish_4_7.h b/src/shared/sailfish_4_7.h index 8a6957a..d49ab4a 100644 --- a/src/shared/sailfish_4_7.h +++ b/src/shared/sailfish_4_7.h @@ -1,154 +1,154 @@ EepromMapping eeprom_map_sailfish_4_7[] = { { "ACCELERATION_ACTIVE", "Acceleration active", "", 0x126, et_boolean, 0, 0, 1, - "Check or set to 1 to use acceleration. Uncheck or set to 0 for no acceleration. Note that you must turn acceleration on to print safely at speeds over 50mm/s." }, + "Check or set to 1 to use acceleration. Uncheck or set to 0 for no acceleration. Note that you must turn acceleration on to print safely at speeds over 50mm/s.", 1.0 }, { "MAX_ACCELERATION_EXTRUDER_MOVE", "Max acceleration extruder move", "mm/s²", 0x14B, et_ulong, 0, 0, 0, - "" }, -{ "MAX_SPEED_CHANGE_X", "Max speed change x", "mm/s * 10", 0x192, et_long, 0, 0, 0, - "" }, -{ "MAX_SPEED_CHANGE_Y", "Max speed change y", "mm/s * 10", 0x196, et_long, 0, 0, 0, - "" }, -{ "MAX_SPEED_CHANGE_Z", "Max speed change z", "mm/s * 10", 0x19A, et_long, 0, 0, 0, - "" }, -{ "MAX_SPEED_CHANGE_A", "Max speed change a", "mm/s * 10", 0x19E, et_long, 0, 0, 0, - "" }, -{ "MAX_SPEED_CHANGE_B", "Max speed change b", "mm/s * 10", 0x1A2, et_long, 0, 0, 0, - "" }, + "", 1.0 }, +{ "MAX_SPEED_CHANGE_X", "Max speed change x", "mm/s", 0x192, et_long, 0, 0, 0, + "", 10.0 }, +{ "MAX_SPEED_CHANGE_Y", "Max speed change y", "mm/s", 0x196, et_long, 0, 0, 0, + "", 10.0 }, +{ "MAX_SPEED_CHANGE_Z", "Max speed change z", "mm/s", 0x19A, et_long, 0, 0, 0, + "", 10.0 }, +{ "MAX_SPEED_CHANGE_A", "Max speed change a", "mm/s", 0x19E, et_long, 0, 0, 0, + "", 10.0 }, +{ "MAX_SPEED_CHANGE_B", "Max speed change b", "mm/s", 0x1A2, et_long, 0, 0, 0, + "", 10.0 }, { "MAX_ACCELERATION_AXIS_X", "Max acceleration axis x", "mm/s²", 0x13B, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_Y", "Max acceleration axis y", "mm/s²", 0x13F, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_Z", "Max acceleration axis z", "mm/s²", 0x143, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_A", "Max acceleration axis a", "mm/s²", 0x147, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_B", "Max acceleration axis b", "mm/s²", 0x1A6, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, /*{ "MAX_ACCELERATION_NORMAL_MOVE", "Max acceleration normal move", "mm/s²", 0x14B, et_ushort, 0, 0, 0, - "" },*/ + "", 1.0 },*/ { "EXTRUDER_DEPRIME_ON_TRAVEL", "Extruder deprime on travel", "", 0x1EE, et_boolean, 0, 0, 1, - "When set, the firmware will deprime the extruder on detected travel moves as well as on pauses, planned or otherwise. When not set, the firmware will only deprime the extruder on pauses, planned or otherwise. Unplanned pauses occur when the acceleration planner falls behind and the printer waits briefly for another segment to print." }, + "When set, the firmware will deprime the extruder on detected travel moves as well as on pauses, planned or otherwise. When not set, the firmware will only deprime the extruder on pauses, planned or otherwise. Unplanned pauses occur when the acceleration planner falls behind and the printer waits briefly for another segment to print.", 1.0 }, /*{ "ALEVEL_MAX_ZPROBE_HITS", "Alevel max zprobe hits", "", 0xf64, et_byte, 0, 0, 200, - "Trigger a pause if the auto-leveling probe registers too many hits during a print. Set to the value 0 to allow an unlimited number of hits without pausing; otherwise, set to a value in the range 1 to 200." }, + "Trigger a pause if the auto-leveling probe registers too many hits during a print. Set to the value 0 to allow an unlimited number of hits without pausing; otherwise, set to a value in the range 1 to 200.", 1.0 }, { "T0_COOLING_SETPOINT_C", "T0 cooling setpoint c", "C", 0x11b, et_byte, 0, 0, 300, - "" }, + "", 1.0 }, { "T0_COOLING_ENABLE", "T0 cooling enable", "", 0x11a, et_boolean, 0, 0, 1, - "" }, + "", 1.0 }, { "T0_EXTRUDER_P_TERM", "T0 extruder p term", "", 0x10a, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "T0_EXTRUDER_I_TERM", "T0 extruder i term", "", 0x10c, et_fixed, 0, 0, 1, - "" }, + "", 1.0 }, { "T0_EXTRUDER_D_TERM", "T0 extruder d term", "", 0x10e, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "HBP_P_TERM", "Heatbed p term", "", 0x110, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "HBP_I_TERM", "T0 extruder i term", "", 0x112, et_fixed, 0, 0, 1, - "" }, + "", 1.0 }, { "HBP_D_TERM", "T0 extruder d term", "", 0x114, et_fixed, 0, 0, 100, - "" },*/ + "", 1.0 },*/ { "PREHEAT_PREHEAT_RIGHT_TEMP", "Preheat preheat right temp (TOOL0)", "C", 0x80, et_byte, 0, 0, 255, - "" }, + "", 1.0 }, { "PREHEAT_PREHEAT_PLATFORM_TEMP", "Preheat preheat platform temp", "C", 0x82, et_byte, 0, 0, 130, - "" }, + "", 1.0 }, { "PREHEAT_PREHEAT_LEFT_TEMP", "Preheat preheat left temp (TOOL1)", "C", 0x81, et_byte, 0, 0, 255, - "" }, -{ "JKN_ADVANCE_K2", "Jkn advance k2", "factor * 100000", 0x15F, et_ulong, 0, 0, 0, - "" }, -{ "JKN_ADVANCE_K", "Jkn advance k", "factor * 100000", 0x167, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, +{ "JKN_ADVANCE_K2", "Jkn advance k2", "factor", 0x15F, et_ulong, 0, 0, 0, + "", 100000.0 }, +{ "JKN_ADVANCE_K", "Jkn advance k", "factor", 0x167, et_ulong, 0, 0, 0, + "", 100000.0 }, { "EXTRUDER_DEPRIME_STEPS_A", "Extruder deprime steps a", "steps", 0x185, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "EXTRUDER_DEPRIME_STEPS_B", "Extruder deprime steps b", "steps", 0x1AA, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "SLOWDOWN_FLAG", "Slowdown flag", "", 0x189, et_boolean, 0, 0, 1, - "Check or set to 1 to enable automatic print slowdown when the queue of planned segments is running low. Uncheck or set to 0 to disable automatic slowdown." }, + "Check or set to 1 to enable automatic print slowdown when the queue of planned segments is running low. Uncheck or set to 0 to disable automatic slowdown.", 1.0 }, /*{ "COOLING_FAN_DUTY_CYCLE", "Cooling fan duty cycle", "", 0xf63, et_byte, 0, 0, 100, - "Set a blower strength (duty cycle) to use for the print cooling fan when it is activated by the print commands. Select a value between 0% (off) and 100% (on full). For example, if your fan is too strong, you may want to set this value to 50 so that the fan operates at 50% strength. If set this value to 0, then the cooling fan will not activate at all when the print commands request it to." },*/ + "Set a blower strength (duty cycle) to use for the print cooling fan when it is activated by the print commands. Select a value between 0% (off) and 100% (on full). For example, if your fan is too strong, you may want to set this value to 50 so that the fan operates at 50% strength. If set this value to 0, then the cooling fan will not activate at all when the print commands request it to.", 1.0 },*/ { "MACHINE_NAME", "Machine name", "", 0x20, et_string, 16, 0, 0, - "" }, + "", 1.0 }, /*{ "ALEVEL_MAX_ZDELTA", "Alevel max zdelta", "steps", 0xf66, et_long, 0, 0, 0, - "The maximum vertical difference between any two probed leveling points may not exceed this value. Default value is 50 steps (0.5 mm)." },*/ + "The maximum vertical difference between any two probed leveling points may not exceed this value. Default value is 50 steps (0.5 mm).", 1.0 },*/ { "PSTOP_ENABLE", "Pstop enable", "", 0x1EC, et_boolean, 0, 0, 1, - "Check or set to 1 to enable the optional Pause Stop hardware. Set to zero or uncheck to disable. The bot should be power cycled after changing this field." }, + "Check or set to 1 to enable the optional Pause Stop hardware. Set to zero or uncheck to disable. The bot should be power cycled after changing this field.", 1.0 }, { "DITTO_PRINT_ENABLED", "Ditto print enabled", "", 0x1DC, et_boolean, 0, 0, 1, - "Check or set to 1 to enable ditto printing. Uncheck or set to zero to disable ditto printing." }, + "Check or set to 1 to enable ditto printing. Uncheck or set to zero to disable ditto printing.", 1.0 }, { "SD_USE_CRC", "Sd use crc", "", 0x1EB, et_boolean, 0, 0, 1, - "Check or set to 1 to enable SD card error checkin. Uncheck or set to 0 to disable." }, + "Check or set to 1 to enable SD card error checkin. Uncheck or set to 0 to disable.", 1.0 }, { "CLEAR_FOR_ESTOP", "Clear for estop", "", 0x1EF, et_boolean, 0, 0, 1, - "Check or set to 1 to instruct the printer to clear the build away from the extruder before stopping. Uncheck or set to zero to immediately stop the printer (e.g., perform an Emergency Stop)." }, + "Check or set to 1 to instruct the printer to clear the build away from the extruder before stopping. Uncheck or set to zero to immediately stop the printer (e.g., perform an Emergency Stop).", 1.0 }, /*{ "AXIS_HOME_DIRECTION", "Axis home direction", "", 0xc, et_bitfield, 0, 0, 0, - "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is homing in the wrong direction, toggle the bit for that axis" }, + "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is homing in the wrong direction, toggle the bit for that axis", 1.0 }, { "LED_LED_HEAT", "Led led heat", "", 0x142, et_byte, 0, 1, 0, - "" }, + "", 1.0 }, { "LED_BASIC_COLOR", "Led basic color", "", 0x140, et_byte, 0, 0, 10, - "" }, + "", 1.0 }, { "LED_CUSTOM_COLOR_R", "Led custom color r", "RGB", 0x144, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "LED_CUSTOM_COLOR_G", "Led custom color g", "RGB", 0x145, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "LED_CUSTOM_COLOR_B", "Led custom color b", "RGB", 0x146, et_byte, 0, 0, 0, - "" },*/ + "", 1.0 },*/ { "AXIS_HOME_POSITIONS_STEPS_X", "Axis home positions steps x", "steps", 0x60, et_long, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_Y", "Axis home positions steps y", "steps", 0x64, et_long, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_Z", "Axis home positions steps z", "steps", 0x68, et_long, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_A", "Axis home positions steps a", "steps", 0x6C, et_long, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_B", "Axis home positions steps b", "steps", 0x70, et_long, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_X", "Axis steps per mm x", "10,000,000,000 * steps/mm", 0x8b, et_long_long, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_Y", "Axis steps per mm y", "10,000,000,000 * steps/mm", 0x93, et_long_long, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_Z", "Axis steps per mm z", "10,000,000,000 * steps/mm", 0x9b, et_long_long, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_A", "Axis steps per mm a", "10,000,000,000 * steps/mm", 0xa3, et_long_long, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_B", "Axis steps per mm b", "10,000,000,000 * steps/mm", 0xab, et_long_long, 0, 0, 0, - "" }, + "", 1.0 }, +{ "AXIS_STEPS_PER_MM_X", "Axis steps per mm x", "steps/mm", 0x8b, et_long_long, 0, 0, 0, + "", 10000000000.0 }, +{ "AXIS_STEPS_PER_MM_Y", "Axis steps per mm y", "steps/mm", 0x93, et_long_long, 0, 0, 0, + "", 10000000000.0 }, +{ "AXIS_STEPS_PER_MM_Z", "Axis steps per mm z", "steps/mm", 0x9b, et_long_long, 0, 0, 0, + "", 10000000000.0 }, +{ "AXIS_STEPS_PER_MM_A", "Axis steps per mm a", "steps/mm", 0xa3, et_long_long, 0, 0, 0, + "", 10000000000.0 }, +{ "AXIS_STEPS_PER_MM_B", "Axis steps per mm b", "steps/mm", 0xab, et_long_long, 0, 0, 0, + "", 10000000000.0 }, { "OVERRIDE_GCODE_TEMP", "Override gcode temp", "", 0xc5, et_boolean, 0, 0, 1, - "Check or set to 1 to override non-zero gcode temperature settings with the pre-heat temperature settings. Uncheck or set to zero to honor temperature settings in the gcode." }, + "Check or set to 1 to override non-zero gcode temperature settings with the pre-heat temperature settings. Uncheck or set to zero to honor temperature settings in the gcode.", 1.0 }, { "ENDSTOP_INVERSION", "Endstop inversion", "", 0x3, et_bitfield, 0, 0, 0, - "" }, + "", 1.0 }, { "TOOL_COUNT", "Tool count", "", 0x1AE, et_byte, 0, 1, 2, - "" }, + "", 1.0 }, /*{ "T1_COOLING_SETPOINT_C", "T1 cooling setpoint c", "C", 0x137, et_byte, 0, 0, 300, - "" }, + "", 1.0 }, { "T1_COOLING_ENABLE", "T1 cooling enable", "", 0x136, et_boolean, 0, 0, 1, - "" }, + "", 1.0 }, { "T1_EXTRUDER_P_TERM", "T1 extruder p term", "", 0x126, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "T1_EXTRUDER_I_TERM", "T1 extruder i term", "", 0x128, et_fixed, 0, 0, 1, - "" }, + "", 1.0 }, { "T1_EXTRUDER_D_TERM", "T1 extruder d term", "", 0x12a, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "BUZZ_SOUND_ON", "Buzz sound on", "", 0x14a, et_boolean, 0, 0, 1, - "Check or set to 1 to play bot sounds. Uncheck or set to 0 for no sounds." }, + "Check or set to 1 to play bot sounds. Uncheck or set to 0 for no sounds.", 1.0 }, { "HEAT_DURING_PAUSE", "Heat during pause", "", 0xffe, et_boolean, 0, 0, 1, - "Check or set to 1 to leave heaters enabled for up to 30 minutes while the bot is pasued. Uncheck or set to zero to disable the heaters upon entering a paused state." },*/ + "Check or set to 1 to leave heaters enabled for up to 30 minutes while the bot is pasued. Uncheck or set to zero to disable the heaters upon entering a paused state.", 1.0 },*/ { "AXIS_INVERSION", "Axis inversion", "", 0x2, et_bitfield, 0, 0, 0, - "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is moving in the wrong direction, toggle the bit for that axis" }, + "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is moving in the wrong direction, toggle the bit for that axis", 1.0 }, /*{ "DIGI_POT_SETTINGS_0", "Digi pot settings 0", "scale(1-118)", 0x6, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "DIGI_POT_SETTINGS_1", "Digi pot settings 0", "scale(1-118)", 0x7, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "DIGI_POT_SETTINGS_2", "Digi pot settings 0", "scale(1-118)", 0x8, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "DIGI_POT_SETTINGS_3", "Digi pot settings 0", "scale(1-118)", 0x9, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "DIGI_POT_SETTINGS_4", "Digi pot settings 0", "scale(1-118)", 0xa, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "HBP_PRESENT", "Hbp present", "", 0x4c, et_boolean, 0, 0, 1, - "Check or set to 1 if this machine has a heated build platform; otherwise, uncheck or set to 0 if it does not. The bot should be power cycled after changing this field." },*/ + "Check or set to 1 if this machine has a heated build platform; otherwise, uncheck or set to 0 if it does not. The bot should be power cycled after changing this field.", 1.0 },*/ { "TOOLHEAD_OFFSET_SYSTEM", "Toolhead offset system", "", 0x1EA, et_boolean, 0, 0, 1, - "Check to use the NEW dualstrusion system. Uncheck to use the old (RepG 39 and earlier) dualstrusion system. The bot should be power cycled after changing this field." }, + "Check to use the NEW dualstrusion system. Uncheck to use the old (RepG 39 and earlier) dualstrusion system. The bot should be power cycled after changing this field.", 1.0 }, { "TOOLHEAD_OFFSET_SETTINGS_X", "Toolhead offset settings x", "steps", 0x1B0, et_long, 0, -2000, 20000, - "" }, + "", 1.0 }, { "TOOLHEAD_OFFSET_SETTINGS_Y", "Toolhead offset settings y", "steps", 0x1B4, et_long, 0, -2000, 20000, - "" }, + "", 1.0 }, { "EXTRUDER_HOLD", "Extruder hold", "", 0x1E9, et_boolean, 0, 0, 1, - "Check or set to 1 to enable the Extruder Hold feature. Uncheck or set to 0 to disable." }, + "Check or set to 1 to enable the Extruder Hold feature. Uncheck or set to 0 to disable.", 1.0 }, }; // Offsets from https://www.thingiverse.com/thing:32084/files 'sailfish_makerware_eeprom_maps' diff --git a/src/shared/sailfish_7_7.h b/src/shared/sailfish_7_7.h index b1c66fc..f509871 100644 --- a/src/shared/sailfish_7_7.h +++ b/src/shared/sailfish_7_7.h @@ -1,152 +1,152 @@ EepromMapping eeprom_map_sailfish_7_7[] = { { "ACCELERATION_ACTIVE", "Acceleration active", "", 0x16e, et_boolean, 0, 0, 1, - "Check or set to 1 to use acceleration. Uncheck or set to 0 for no acceleration. Note that you must turn acceleration on to print safely at speeds over 50mm/s." }, + "Check or set to 1 to use acceleration. Uncheck or set to 0 for no acceleration. Note that you must turn acceleration on to print safely at speeds over 50mm/s.", 1.0 }, { "MAX_ACCELERATION_EXTRUDER_MOVE", "Max acceleration extruder move", "mm/s²", 0x186, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_SPEED_CHANGE_X", "Max speed change x", "mm/s", 0x17c, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_SPEED_CHANGE_Y", "Max speed change y", "mm/s", 0x17e, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_SPEED_CHANGE_Z", "Max speed change z", "mm/s", 0x180, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_SPEED_CHANGE_A", "Max speed change a", "mm/s", 0x182, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_SPEED_CHANGE_B", "Max speed change b", "mm/s", 0x184, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_X", "Max acceleration axis x", "mm/s²", 0x172, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_Y", "Max acceleration axis y", "mm/s²", 0x174, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_Z", "Max acceleration axis z", "mm/s²", 0x176, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_A", "Max acceleration axis a", "mm/s²", 0x178, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_AXIS_B", "Max acceleration axis b", "mm/s²", 0x17a, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "MAX_ACCELERATION_NORMAL_MOVE", "Max acceleration normal move", "mm/s²", 0x170, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "EXTRUDER_DEPRIME_ON_TRAVEL", "Extruder deprime on travel", "", 0x20b, et_boolean, 0, 0, 1, - "When set, the firmware will deprime the extruder on detected travel moves as well as on pauses, planned or otherwise. When not set, the firmware will only deprime the extruder on pauses, planned or otherwise. Unplanned pauses occur when the acceleration planner falls behind and the printer waits briefly for another segment to print." }, + "When set, the firmware will deprime the extruder on detected travel moves as well as on pauses, planned or otherwise. When not set, the firmware will only deprime the extruder on pauses, planned or otherwise. Unplanned pauses occur when the acceleration planner falls behind and the printer waits briefly for another segment to print.", 1.0 }, { "ALEVEL_MAX_ZPROBE_HITS", "Alevel max zprobe hits", "", 0xf64, et_byte, 0, 0, 200, - "Trigger a pause if the auto-leveling probe registers too many hits during a print. Set to the value 0 to allow an unlimited number of hits without pausing; otherwise, set to a value in the range 1 to 200." }, + "Trigger a pause if the auto-leveling probe registers too many hits during a print. Set to the value 0 to allow an unlimited number of hits without pausing; otherwise, set to a value in the range 1 to 200.", 1.0 }, { "T0_COOLING_SETPOINT_C", "T0 cooling setpoint c", "C", 0x11b, et_byte, 0, 0, 300, - "" }, + "", 1.0 }, { "T0_COOLING_ENABLE", "T0 cooling enable", "", 0x11a, et_boolean, 0, 0, 1, - "" }, + "", 1.0 }, { "T0_EXTRUDER_P_TERM", "T0 extruder p term", "", 0x10a, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "T0_EXTRUDER_I_TERM", "T0 extruder i term", "", 0x10c, et_fixed, 0, 0, 1, - "" }, + "", 1.0 }, { "T0_EXTRUDER_D_TERM", "T0 extruder d term", "", 0x10e, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "HBP_P_TERM", "Heatbed p term", "", 0x110, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "HBP_I_TERM", "T0 extruder i term", "", 0x112, et_fixed, 0, 0, 1, - "" }, + "", 1.0 }, { "HBP_D_TERM", "T0 extruder d term", "", 0x114, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "PREHEAT_PREHEAT_RIGHT_TEMP", "Preheat preheat right temp", "C", 0x158, et_ushort, 0, 0, 280, - "" }, + "", 1.0 }, { "PREHEAT_PREHEAT_PLATFORM_TEMP", "Preheat preheat platform temp", "C", 0x15c, et_ushort, 0, 0, 130, - "" }, + "", 1.0 }, { "PREHEAT_PREHEAT_LEFT_TEMP", "Preheat preheat left temp", "C", 0x15a, et_ushort, 0, 0, 280, - "" }, -{ "JKN_ADVANCE_K2", "Jkn advance k2", "factor * 100000", 0x1dc, et_ulong, 0, 0, 0, - "" }, -{ "JKN_ADVANCE_K", "Jkn advance k", "factor * 100000", 0x1d8, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, +{ "JKN_ADVANCE_K2", "Jkn advance k2", "factor", 0x1dc, et_ulong, 0, 0, 0, + "", 100000.0 }, +{ "JKN_ADVANCE_K", "Jkn advance k", "factor", 0x1d8, et_ulong, 0, 0, 0, + "", 100000.0 }, { "EXTRUDER_DEPRIME_STEPS_A", "Extruder deprime steps a", "steps", 0x1e0, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "EXTRUDER_DEPRIME_STEPS_B", "Extruder deprime steps b", "steps", 0x1e2, et_ushort, 0, 0, 0, - "" }, + "", 1.0 }, { "SLOWDOWN_FLAG", "Slowdown flag", "", 0x1e4, et_boolean, 0, 0, 1, - "Check or set to 1 to enable automatic print slowdown when the queue of planned segments is running low. Uncheck or set to 0 to disable automatic slowdown." }, + "Check or set to 1 to enable automatic print slowdown when the queue of planned segments is running low. Uncheck or set to 0 to disable automatic slowdown.", 1.0 }, { "COOLING_FAN_DUTY_CYCLE", "Cooling fan duty cycle", "", 0xf63, et_byte, 0, 0, 100, - "Set a blower strength (duty cycle) to use for the print cooling fan when it is activated by the print commands. Select a value between 0% (off) and 100% (on full). For example, if your fan is too strong, you may want to set this value to 50 so that the fan operates at 50% strength. If set this value to 0, then the cooling fan will not activate at all when the print commands request it to." }, + "Set a blower strength (duty cycle) to use for the print cooling fan when it is activated by the print commands. Select a value between 0% (off) and 100% (on full). For example, if your fan is too strong, you may want to set this value to 50 so that the fan operates at 50% strength. If set this value to 0, then the cooling fan will not activate at all when the print commands request it to.", 1.0 }, { "MACHINE_NAME", "Machine name", "", 0x22, et_string, 16, 0, 0, - "" }, + "", 1.0 }, { "ALEVEL_MAX_ZDELTA", "Alevel max zdelta", "steps", 0xf66, et_long, 0, 0, 0, - "The maximum vertical difference between any two probed leveling points may not exceed this value. Default value is 50 steps (0.5 mm)." }, + "The maximum vertical difference between any two probed leveling points may not exceed this value. Default value is 50 steps (0.5 mm).", 1.0 }, { "PSTOP_ENABLE", "Pstop enable", "", 0xf90, et_boolean, 0, 0, 1, - "Check or set to 1 to enable the optional Pause Stop hardware. Set to zero or uncheck to disable. The bot should be power cycled after changing this field." }, + "Check or set to 1 to enable the optional Pause Stop hardware. Set to zero or uncheck to disable. The bot should be power cycled after changing this field.", 1.0 }, { "DITTO_PRINT_ENABLED", "Ditto print enabled", "", 0xfff, et_boolean, 0, 0, 1, - "Check or set to 1 to enable ditto printing. Uncheck or set to zero to disable ditto printing." }, + "Check or set to 1 to enable ditto printing. Uncheck or set to zero to disable ditto printing.", 1.0 }, { "SD_USE_CRC", "Sd use crc", "", 0xf91, et_boolean, 0, 0, 1, - "Check or set to 1 to enable SD card error checkin. Uncheck or set to 0 to disable." }, + "Check or set to 1 to enable SD card error checkin. Uncheck or set to 0 to disable.", 1.0 }, { "CLEAR_FOR_ESTOP", "Clear for estop", "", 0xf8e, et_boolean, 0, 0, 1, - "Check or set to 1 to instruct the printer to clear the build away from the extruder before stopping. Uncheck or set to zero to immediately stop the printer (e.g., perform an Emergency Stop)." }, + "Check or set to 1 to instruct the printer to clear the build away from the extruder before stopping. Uncheck or set to zero to immediately stop the printer (e.g., perform an Emergency Stop).", 1.0 }, { "AXIS_HOME_DIRECTION", "Axis home direction", "", 0xc, et_bitfield, 0, 0, 0, - "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is homing in the wrong direction, toggle the bit for that axis" }, + "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is homing in the wrong direction, toggle the bit for that axis", 1.0 }, { "LED_LED_HEAT", "Led led heat", "", 0x142, et_byte, 0, 1, 0, - "" }, + "", 1.0 }, { "LED_BASIC_COLOR", "Led basic color", "", 0x140, et_byte, 0, 0, 10, - "" }, + "", 1.0 }, { "LED_CUSTOM_COLOR_R", "Led custom color r", "RGB", 0x144, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "LED_CUSTOM_COLOR_G", "Led custom color g", "RGB", 0x145, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "LED_CUSTOM_COLOR_B", "Led custom color b", "RGB", 0x146, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_X", "Axis home positions steps x", "steps", 0xe, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_Y", "Axis home positions steps y", "steps", 0x12, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_Z", "Axis home positions steps z", "steps", 0x16, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_A", "Axis home positions steps a", "steps", 0x1a, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, { "AXIS_HOME_POSITIONS_STEPS_B", "Axis home positions steps b", "steps", 0x1e, et_ulong, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_X", "Axis steps per mm x", "1,000,000 * steps/mm", 0x1a4, et_ulong, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_Y", "Axis steps per mm y", "1,000,000 * steps/mm", 0x1a8, et_ulong, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_Z", "Axis steps per mm z", "1,000,000 * steps/mm", 0x1ac, et_ulong, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_A", "Axis steps per mm a", "1,000,000 * steps/mm", 0x1b0, et_ulong, 0, 0, 0, - "" }, -{ "AXIS_STEPS_PER_MM_B", "Axis steps per mm b", "1,000,000 * steps/mm", 0x1b4, et_ulong, 0, 0, 0, - "" }, + "", 1.0 }, +{ "AXIS_STEPS_PER_MM_X", "Axis steps per mm x", "steps/mm", 0x1a4, et_ulong, 0, 0, 0, + "", 1000000.0 }, +{ "AXIS_STEPS_PER_MM_Y", "Axis steps per mm y", "steps/mm", 0x1a8, et_ulong, 0, 0, 0, + "", 1000000.0 }, +{ "AXIS_STEPS_PER_MM_Z", "Axis steps per mm z", "steps/mm", 0x1ac, et_ulong, 0, 0, 0, + "", 1000000.0 }, +{ "AXIS_STEPS_PER_MM_A", "Axis steps per mm a", "steps/mm", 0x1b0, et_ulong, 0, 0, 0, + "", 1000000.0 }, +{ "AXIS_STEPS_PER_MM_B", "Axis steps per mm b", "steps/mm", 0x1b4, et_ulong, 0, 0, 0, + "", 1000000.0 }, { "OVERRIDE_GCODE_TEMP", "Override gcode temp", "", 0xffd, et_boolean, 0, 0, 1, - "Check or set to 1 to override non-zero gcode temperature settings with the pre-heat temperature settings. Uncheck or set to zero to honor temperature settings in the gcode." }, + "Check or set to 1 to override non-zero gcode temperature settings with the pre-heat temperature settings. Uncheck or set to zero to honor temperature settings in the gcode.", 1.0 }, { "ENDSTOP_INVERSION", "Endstop inversion", "", 0x4, et_bitfield, 0, 0, 0, - "" }, + "", 1.0 }, { "TOOL_COUNT", "Tool count", "", 0x42, et_byte, 0, 1, 2, - "" }, + "", 1.0 }, { "T1_COOLING_SETPOINT_C", "T1 cooling setpoint c", "C", 0x137, et_byte, 0, 0, 300, - "" }, + "", 1.0 }, { "T1_COOLING_ENABLE", "T1 cooling enable", "", 0x136, et_boolean, 0, 0, 1, - "" }, + "", 1.0 }, { "T1_EXTRUDER_P_TERM", "T1 extruder p term", "", 0x126, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "T1_EXTRUDER_I_TERM", "T1 extruder i term", "", 0x128, et_fixed, 0, 0, 1, - "" }, + "", 1.0 }, { "T1_EXTRUDER_D_TERM", "T1 extruder d term", "", 0x12a, et_fixed, 0, 0, 100, - "" }, + "", 1.0 }, { "BUZZ_SOUND_ON", "Buzz sound on", "", 0x14a, et_boolean, 0, 0, 1, - "Check or set to 1 to play bot sounds. Uncheck or set to 0 for no sounds." }, + "Check or set to 1 to play bot sounds. Uncheck or set to 0 for no sounds.", 1.0 }, { "HEAT_DURING_PAUSE", "Heat during pause", "", 0xffe, et_boolean, 0, 0, 1, - "Check or set to 1 to leave heaters enabled for up to 30 minutes while the bot is pasued. Uncheck or set to zero to disable the heaters upon entering a paused state." }, + "Check or set to 1 to leave heaters enabled for up to 30 minutes while the bot is pasued. Uncheck or set to zero to disable the heaters upon entering a paused state.", 1.0 }, { "AXIS_INVERSION", "Axis inversion", "", 0x2, et_bitfield, 0, 0, 0, - "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is moving in the wrong direction, toggle the bit for that axis" }, + "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is moving in the wrong direction, toggle the bit for that axis", 1.0 }, { "DIGI_POT_SETTINGS_0", "Digi pot settings 0", "scale(1-118)", 0x6, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "DIGI_POT_SETTINGS_1", "Digi pot settings 0", "scale(1-118)", 0x7, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "DIGI_POT_SETTINGS_2", "Digi pot settings 0", "scale(1-118)", 0x8, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "DIGI_POT_SETTINGS_3", "Digi pot settings 0", "scale(1-118)", 0x9, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "DIGI_POT_SETTINGS_4", "Digi pot settings 0", "scale(1-118)", 0xa, et_byte, 0, 0, 0, - "" }, + "", 1.0 }, { "HBP_PRESENT", "Hbp present", "", 0x4c, et_boolean, 0, 0, 1, - "Check or set to 1 if this machine has a heated build platform; otherwise, uncheck or set to 0 if it does not. The bot should be power cycled after changing this field." }, + "Check or set to 1 if this machine has a heated build platform; otherwise, uncheck or set to 0 if it does not. The bot should be power cycled after changing this field.", 1.0 }, { "TOOLHEAD_OFFSET_SYSTEM", "Toolhead offset system", "", 0xf93, et_boolean, 0, 0, 1, - "Check to use the NEW dualstrusion system. Uncheck to use the old (RepG 39 and earlier) dualstrusion system. The bot should be power cycled after changing this field." }, + "Check to use the NEW dualstrusion system. Uncheck to use the old (RepG 39 and earlier) dualstrusion system. The bot should be power cycled after changing this field.", 1.0 }, { "TOOLHEAD_OFFSET_SETTINGS_X", "Toolhead offset settings x", "steps", 0x162, et_long, 0, -2000, 20000, - "" }, + "", 1.0 }, { "TOOLHEAD_OFFSET_SETTINGS_Y", "Toolhead offset settings y", "steps", 0x166, et_long, 0, -2000, 20000, - "" }, + "", 1.0 }, { "EXTRUDER_HOLD", "Extruder hold", "", 0xf92, et_boolean, 0, 0, 1, - "Check or set to 1 to enable the Extruder Hold feature. Uncheck or set to 0 to disable." }, + "Check or set to 1 to enable the Extruder Hold feature. Uncheck or set to 0 to disable.", 1.0 }, }; From 9f8aa1636e42e66be2edf57aedb6f515884b6c08 Mon Sep 17 00:00:00 2001 From: Michael Baisch Date: Wed, 26 Jan 2022 13:43:45 +0100 Subject: [PATCH 6/6] Add two eeprom entries and a note about missing entries to sailfish v4.7 eeprom map --- src/gpx/tests/eepromtest_sailfish_4_7.gcode | 2 ++ src/shared/sailfish_4_7.h | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/gpx/tests/eepromtest_sailfish_4_7.gcode b/src/gpx/tests/eepromtest_sailfish_4_7.gcode index 332c02a..ef675aa 100644 --- a/src/gpx/tests/eepromtest_sailfish_4_7.gcode +++ b/src/gpx/tests/eepromtest_sailfish_4_7.gcode @@ -12,6 +12,7 @@ (@eread MAX_ACCELERATION_AXIS_A) (@eread MAX_ACCELERATION_AXIS_B) (@eread EXTRUDER_DEPRIME_ON_TRAVEL) +(@eread ALEVEL_MAX_ZPROBE_HITS) (@eread PREHEAT_PREHEAT_RIGHT_TEMP) (@eread PREHEAT_PREHEAT_PLATFORM_TEMP) (@eread PREHEAT_PREHEAT_LEFT_TEMP) @@ -21,6 +22,7 @@ (@eread EXTRUDER_DEPRIME_STEPS_B) (@eread SLOWDOWN_FLAG) (@eread MACHINE_NAME) +(@eread ALEVEL_MAX_ZDELTA) (@eread PSTOP_ENABLE) (@eread DITTO_PRINT_ENABLED) (@eread SD_USE_CRC) diff --git a/src/shared/sailfish_4_7.h b/src/shared/sailfish_4_7.h index d49ab4a..e298e2c 100644 --- a/src/shared/sailfish_4_7.h +++ b/src/shared/sailfish_4_7.h @@ -27,9 +27,9 @@ EepromMapping eeprom_map_sailfish_4_7[] = { "", 1.0 },*/ { "EXTRUDER_DEPRIME_ON_TRAVEL", "Extruder deprime on travel", "", 0x1EE, et_boolean, 0, 0, 1, "When set, the firmware will deprime the extruder on detected travel moves as well as on pauses, planned or otherwise. When not set, the firmware will only deprime the extruder on pauses, planned or otherwise. Unplanned pauses occur when the acceleration planner falls behind and the printer waits briefly for another segment to print.", 1.0 }, -/*{ "ALEVEL_MAX_ZPROBE_HITS", "Alevel max zprobe hits", "", 0xf64, et_byte, 0, 0, 200, +{ "ALEVEL_MAX_ZPROBE_HITS", "Alevel max zprobe hits", "", 0x1F0, et_byte, 0, 0, 200, "Trigger a pause if the auto-leveling probe registers too many hits during a print. Set to the value 0 to allow an unlimited number of hits without pausing; otherwise, set to a value in the range 1 to 200.", 1.0 }, -{ "T0_COOLING_SETPOINT_C", "T0 cooling setpoint c", "C", 0x11b, et_byte, 0, 0, 300, +/*{ "T0_COOLING_SETPOINT_C", "T0 cooling setpoint c", "C", 0x11b, et_byte, 0, 0, 300, "", 1.0 }, { "T0_COOLING_ENABLE", "T0 cooling enable", "", 0x11a, et_boolean, 0, 0, 1, "", 1.0 }, @@ -65,8 +65,8 @@ EepromMapping eeprom_map_sailfish_4_7[] = { "Set a blower strength (duty cycle) to use for the print cooling fan when it is activated by the print commands. Select a value between 0% (off) and 100% (on full). For example, if your fan is too strong, you may want to set this value to 50 so that the fan operates at 50% strength. If set this value to 0, then the cooling fan will not activate at all when the print commands request it to.", 1.0 },*/ { "MACHINE_NAME", "Machine name", "", 0x20, et_string, 16, 0, 0, "", 1.0 }, -/*{ "ALEVEL_MAX_ZDELTA", "Alevel max zdelta", "steps", 0xf66, et_long, 0, 0, 0, - "The maximum vertical difference between any two probed leveling points may not exceed this value. Default value is 50 steps (0.5 mm).", 1.0 },*/ +{ "ALEVEL_MAX_ZDELTA", "Alevel max zdelta", "steps", 0x1F2, et_long, 0, 0, 0, + "The maximum vertical difference between any two probed leveling points may not exceed this value. Default value is 50 steps (0.5 mm).", 1.0 }, { "PSTOP_ENABLE", "Pstop enable", "", 0x1EC, et_boolean, 0, 0, 1, "Check or set to 1 to enable the optional Pause Stop hardware. Set to zero or uncheck to disable. The bot should be power cycled after changing this field.", 1.0 }, { "DITTO_PRINT_ENABLED", "Ditto print enabled", "", 0x1DC, et_boolean, 0, 0, 1, @@ -152,4 +152,13 @@ EepromMapping eeprom_map_sailfish_4_7[] = { }; // Offsets from https://www.thingiverse.com/thing:32084/files 'sailfish_makerware_eeprom_maps' +// or https://github.com/jetty840/Sailfish-G3Firmware/blob/master/firmware/src/Motherboard/EepromMap.hh + +// Everything tool/extruder related can't be easily mapped here: +// The extruder controller is a separate board with its own eeprom. +// Its eeprom map is here: https://github.com/jetty840/Sailfish-G3Firmware/blob/master/firmware/src/Extruder/EepromMap.hh +// One needs to use the HOST_CMD_TOOL_QUERY command to read from it, see: +// https://github.com/jetty840/ReplicatorG/blob/master/src/replicatorg/drivers/gen3/Sanguino3GDriver.java#L2075 +// https://github.com/jetty840/Sailfish-G3Firmware/blob/master/firmware/src/Motherboard/Host.cc#L446 + // Not used: EEPROM_SIZE, VERSION_LOW, VERSION_HIGH, ESTOP_CONFIGURATION, EXTRUDE_DURATION, EXTRUDE_MMS, MOOD_LIGHT_SCRIPT, MOOD_LIGHT_CUSTOM_RED, MOOD_LIGHT_CUSTOM_GREEN, MOOD_LIGHT_CUSTOM_BLUE, JOG_MODE_SETTINGS, BUZZER_REPEATS, FILAMENT_LIFETIME_A, FILAMENT_TRIP_A, ABP_COPIES, UNUSED1, PROFILE_BASE, ACCEL_MAX_EXTRUDER_RETRACT, UNUSED2, UNUSED3, UNUSED4, UNUSED5, UNUSED6, UNUSED7, LCD_TYPE, ENDSTOPS_USED, HOMING_FEED_RATE_X, HOMING_FEED_RATE_Y, HOMING_FEED_RATE_Z, UNUSED8, UNUSED9, UNUSED10, UNUSED11, AXIS_LENGTHS, FILAMENT_LIFETIME_B, FILAMENT_TRIP_B, VID_PID_INFO, ENDSTOP_Z_MIN