diff --git a/TFT/src/User/API/Printing.c b/TFT/src/User/API/Printing.c index 0a33247bc2..1e5ca80900 100644 --- a/TFT/src/User/API/Printing.c +++ b/TFT/src/User/API/Printing.c @@ -233,7 +233,7 @@ uint8_t updatePrintProgress(void) case PROG_RRF: case PROG_SLICER: - break; // progress percentage already updated by the slicer of RRF direct percentage report ("fraction_printed") + break; // progress percentage already updated by the slicer or RRF direct percentage report ("fraction_printed") case PROG_TIME: infoPrinting.progress = ((float)infoPrinting.elapsedTime / (infoPrinting.elapsedTime + infoPrinting.remainingTime)) * 100; diff --git a/TFT/src/User/API/Settings.h b/TFT/src/User/API/Settings.h index e5f54fdd6c..24c2a36681 100644 --- a/TFT/src/User/API/Settings.h +++ b/TFT/src/User/API/Settings.h @@ -18,7 +18,7 @@ extern "C" { #define FONT_FLASH_SIGN 20210522 // (YYYYMMDD) change if fonts require updating #define CONFIG_FLASH_SIGN 20220518 // (YYYYMMDD) change if any keyword(s) in config.ini is added or removed -#define LANGUAGE_FLASH_SIGN 20230209 // (YYYYMMDD) change if any keyword(s) in language pack is added or removed +#define LANGUAGE_FLASH_SIGN 20230520 // (YYYYMMDD) change if any keyword(s) in language pack is added or removed #define ICON_FLASH_SIGN 20220712 // (YYYYMMDD) change if any icon(s) is added or removed #define FONT_CHECK_SIGN (FONT_FLASH_SIGN + WORD_UNICODE_ADDR + FLASH_SIGN_ADDR) diff --git a/TFT/src/User/API/parseACK.c b/TFT/src/User/API/parseACK.c index bd14c7a815..eed10f0fec 100644 --- a/TFT/src/User/API/parseACK.c +++ b/TFT/src/User/API/parseACK.c @@ -882,6 +882,12 @@ void parseACK(void) if (ack_continue_seen("Z: ")) levelingSetProbedPoint(x, y, ack_value()); // save probed Z value } + // parse G30 coordinate unreachable message + else if (ack_seen("Z Probe Past Bed")) + { + levelingSetProbedPoint(-1, -1, 0); // cancel waiting for coordinates + BUZZER_PLAY(SOUND_ERROR); + } #if DELTA_PROBE_TYPE != 0 // parse and store Delta calibration settings else if (ack_seen("Calibration OK")) diff --git a/TFT/src/User/Menu/LevelCorner.c b/TFT/src/User/Menu/LevelCorner.c index 6a9188268a..12fe5881f8 100644 --- a/TFT/src/User/Menu/LevelCorner.c +++ b/TFT/src/User/Menu/LevelCorner.c @@ -37,7 +37,7 @@ void refreshValue(MENUITEMS * levelItems, uint8_t index) menuDrawIconText(&levelItems->items[valIconIndex[index]], valIconIndex[index]); } -void checkRefreshValue(MENUITEMS * levelItems) +bool checkRefreshValue(MENUITEMS * levelItems) { LEVELING_POINT levelingPoint = levelingGetProbedPoint(); @@ -47,7 +47,11 @@ void checkRefreshValue(MENUITEMS * levelItems) refreshValue(levelItems, levelingPoint); levelingResetProbedPoint(); // reset to check for new updates + + return true; } + + return false; } // show M48 on icon @@ -169,7 +173,7 @@ void menuLevelCorner(void) levelingProbePoint(i); // following loop needed to guarantee the value for each point beeing probed is updated at least one time on the menu - TASK_LOOP_WHILE(isNotEmptyCmdQueue(), checkRefreshValue(&levelCornerItems)) + TASK_LOOP_WHILE(!checkRefreshValue(&levelCornerItems)) } break; diff --git a/TFT/src/User/Menu/MeshEditor.c b/TFT/src/User/Menu/MeshEditor.c index eb08da2320..9c58e28f69 100644 --- a/TFT/src/User/Menu/MeshEditor.c +++ b/TFT/src/User/Menu/MeshEditor.c @@ -8,16 +8,9 @@ #define MESH_MAX_RETRIEVE_ATTEMPTS 20 // maximum number of attempts to retrieve the data format from Marlin FW #define MESH_LINE_EDGE_DISTANCE 4 +#define MESH_EEPROM_ROW (meshData->rowsNum - 1) - meshData->row // data structures -typedef struct -{ - const uint8_t colsToSkip; - const uint8_t rowsToSkip; - const bool rowsInverted; - const char * const echoMsg; -} MESH_DATA_FORMAT; - typedef enum { ME_DATA_IDLE = 0, @@ -240,12 +233,18 @@ const char * const meshKeyString[ME_KEY_NUM] = { "\u02C5", // DOWN }; -const MESH_DATA_FORMAT meshDataFormat[] = { - // columns to skip, rows to skip, rows inverted, bed leveling data type - { 1, 4, true, "Mesh Bed Level data:"}, // MBL - { 0, 2, false, "Bed Topography Report for CSV:"}, // UBL - { 1, 2, true, "Bilinear Leveling Grid:"}, // ABL Bilinear - { 0, 1, true, "Bed Level Correction Matrix:"}, // ABL Linear or 3-Point +const struct +{ + const uint8_t colsToSkip; + const uint8_t rowsToSkip; + const bool rowsInverted; + const char *const echoMsg; +} meshDataFormat[] = { +/* columns to skip, rows to skip, rows inverted, bed leveling data type */ + { 1 , 4 , true , "Mesh Bed Level data:" }, // MBL + { 0 , 2 , false , "Bed Topography Report for CSV:"}, // UBL + { 1 , 2 , true , "Bilinear Leveling Grid:" }, // ABL Bilinear + { 0 , 1 , true , "Bed Level Correction Matrix:" }, // ABL Linear or 3-Point }; const char * meshErrorMsg[] = {"Invalid mesh"}; // list of possible error responses to "M420 V1 T1" command @@ -400,21 +399,13 @@ static inline void meshUpdateIndex(const MESH_KEY_VALUES key_num) meshData->index = meshData->row * meshData->colsNum + meshData->col; } -uint16_t meshGetJ(void) -{ - // J index (independent by data format) to be used by G42 (mesh tuner menu) and M421 (meshSetValue() function). - // Bed's top left point -> J = max row index - // Bed's bottom left point -> J = 0 - return (meshData->rowsNum - 1) - meshData->row; -} - bool meshSetValue(const float value) { if (meshData->curData[meshData->index] != value) // if mesh value is changed { meshData->curData[meshData->index] = value; // set new mesh value - mustStoreCmd("M421 I%d J%d Z%.3f\n", meshData->col, meshGetJ(), value); // send new mesh value + mustStoreCmd("M421 I%d J%d Z%.3f\n", meshData->col, MESH_EEPROM_ROW, value); // send new mesh value return true; } @@ -424,18 +415,14 @@ bool meshSetValue(const float value) static inline void meshUpdateValueMinMax(void) { - float value; - meshData->valueMin = meshData->valueMax = meshData->curData[0]; // init initial min/max values for (uint16_t i = 0; i < meshData->dataSize; i++) { - value = meshData->curData[i]; - - if (value < meshData->valueMin) - meshData->valueMin = value; - else if (value > meshData->valueMax) - meshData->valueMax = value; + if (meshData->curData[i] < meshData->valueMin) + meshData->valueMin = meshData->curData[i]; + else if (meshData->curData[i] > meshData->valueMax) + meshData->valueMax = meshData->curData[i]; } meshData->valueDelta = meshData->valueMax - meshData->valueMin; @@ -727,7 +714,7 @@ void meshUpdateData(char * dataRow) if (meshData->status == ME_DATA_EMPTY) // if data grid is empty, parse the data row and set the data grid columns number { - count = meshParseDataRow(dataRow, &(meshData->oriData[0]), MESH_GRID_MAX_POINTS_X); + count = meshParseDataRow(dataRow, meshData->oriData, MESH_GRID_MAX_POINTS_X); if (count > 0) // if number of columns in the parsed data row is at least 1, set the data grid columns number { @@ -830,7 +817,7 @@ void menuMeshEditor(void) probeHeightHome(); // home, disable ABL and raise nozzle // call mesh tuner menu and set current mesh value, if changed - meshSetValue(menuMeshTuner(meshData->col, meshGetJ(), meshData->curData[curIndex])); + meshSetValue(menuMeshTuner(meshData->col, MESH_EEPROM_ROW, meshData->curData[curIndex])); meshDrawMenu(); break;