# HG changeset patch # User heinrichsweikamp # Date 1691229128 -7200 # Node ID 25103f5c7e29163caa7a3686093384ae42f96854 # Parent 92ac192e98d5c15bbc34f7c4f05e7613c200c98d Avoid a configuration warning after the firmware upgrade by disabling automatic setpoint switching. This makes sure the user's automatic setpoint configuration is not overwritten by the validity checks if the settings are not in the correct spots for the new configuration. Users will have to manually re-create the automatic setpoint switching configuration in the new format; Add a checkbox to 'SPdeco' in the menu - this will make it obvious to users that this setpoint can be disabled. (mikeller) diff -r 92ac192e98d5 -r 25103f5c7e29 Discovery/Src/settings.c --- a/Discovery/Src/settings.c Wed Aug 02 08:41:03 2023 +0200 +++ b/Discovery/Src/settings.c Sat Aug 05 11:52:08 2023 +0200 @@ -538,6 +538,9 @@ case 0xFFFF0025: pSettings->compassDeclinationDeg = pStandard->compassDeclinationDeg; pSettings->delaySetpointLow = pStandard->delaySetpointLow; + // Disable auto setpoint to avoid a configuration warning being triggered by the new auto setpoint validation + // This ensures that users don't lose setpoint information if it is not in the right spot for the new configuration + pSettings->autoSetpoint = false; // no break; default: diff -r 92ac192e98d5 -r 25103f5c7e29 Discovery/Src/tMenuSetpoint.c --- a/Discovery/Src/tMenuSetpoint.c Wed Aug 02 08:41:03 2023 +0200 +++ b/Discovery/Src/tMenuSetpoint.c Sat Aug 05 11:52:08 2023 +0200 @@ -77,17 +77,19 @@ depthUp = pSetpointLine[spId].depth_meter; first = pSetpointLine[spId].note.ub.first; + char colour; if (settings->autoSetpoint && spId == SETPOINT_INDEX_AUTO_DECO && !pSetpointLine[spId].note.ub.active) { - strcpy(&text[textPointer++],"\031"); + colour = '\031'; } else { - strcpy(&text[textPointer++],"\020"); + colour = '\020'; } uint8_t setpointBar = setpoint_cbar / 100; - textPointer += snprintf(&text[textPointer], 4, "%c%c", TXT_2BYTE, TXT2BYTE_SetpointShort); + textPointer += snprintf(&text[textPointer], 4, "%c%c%c", colour, TXT_2BYTE, TXT2BYTE_SetpointShort); textPointer += printSetpointName(&text[textPointer], spId, settings, true); - text[textPointer++] = '\t'; + + text[textPointer++] = '\t'; if (first == 0 || actual_menu_content != MENU_SURFACE) { strcpy(&text[textPointer++],"\177"); @@ -95,13 +97,15 @@ textPointer += snprintf(&text[textPointer], 40, "* %u.%02u\016\016 bar\017\034 \016\016 \017", setpointBar, setpoint_cbar - (100 * setpointBar)); if (!settings->autoSetpoint || spId < SETPOINT_INDEX_AUTO_DECO) { - char color = '\031'; - if(depthUp) - color = '\020'; + if (depthUp) { + colour = '\020'; + } else { + colour = '\031'; + } - textPointer += snprintf(&text[textPointer], 40, "%c%3u\016\016 %c%c\017\035\n\r", color, unit_depth_integer(depthUp), unit_depth_char1(), unit_depth_char2()); + textPointer += snprintf(&text[textPointer], 40, "%c%3u\016\016 \035%c%c\017\n\r", colour, unit_depth_integer(depthUp), unit_depth_char1(), unit_depth_char2()); } else { - textPointer += snprintf(&text[textPointer], 3, "\n\r"); + textPointer += snprintf(&text[textPointer], 14, " %c\016\016 \035%c%c\017\n\r", pSetpointLine[spId].note.ub.active ? '\005' : '\006', TXT_2BYTE, TXT2BYTE_Enabled); } } }