comparison Discovery/Src/tMenuSetpoint.c @ 816:c4ee952b9425

Fix a bug that disables arbitrary menu lines in dive mode if lines are disabled / inactive in surface mode. (mikeller)
author heinrichsweikamp
date Sun, 10 Sep 2023 11:46:45 +0200
parents 4c41d9a18c7f
children
comparison
equal deleted inserted replaced
815:ce8f71217f45 816:c4ee952b9425
53 *tab = 130; 53 *tab = 130;
54 *subtext = 0; 54 *subtext = 0;
55 55
56 if((actual_menu_content == MENU_SURFACE) || (stateUsed->diveSettings.diveMode != DIVEMODE_PSCR)) /* do not show setpoints in PSCR mode */ 56 if((actual_menu_content == MENU_SURFACE) || (stateUsed->diveSettings.diveMode != DIVEMODE_PSCR)) /* do not show setpoints in PSCR mode */
57 { 57 {
58 if (settings->autoSetpoint) { 58 if (settings->autoSetpoint) {
59 disableLine(StMSP_Blank); 59 disableLine(StMSP_Blank);
60 } 60 } else {
61 else { 61 enableLine(StMSP_Blank);
62 enableLine(StMSP_Blank);
63 } 62 }
63
64 for(int spId=1;spId<=NUM_GASES;spId++) 64 for(int spId=1;spId<=NUM_GASES;spId++)
65 { 65 {
66 if (settings->autoSetpoint) { 66 if (settings->autoSetpoint) {
67 disableLine(StMSP_Blank);
68 if (spId == 5) { 67 if (spId == 5) {
69 if (actual_menu_content == MENU_SURFACE) { 68 if (actual_menu_content == MENU_SURFACE) {
70 textPointer += snprintf(&text[textPointer], 40, "\020%c%c\016\016%c%c\017 %c%c\002%c\n\r", TXT_2BYTE, TXT2BYTE_SetpointShort, TXT_2BYTE, TXT2BYTE_SetpointLow, TXT_2BYTE, TXT2BYTE_SetpointDelayed, settings->delaySetpointLow ? '\005' : '\006'); 69 textPointer += snprintf(&text[textPointer], 40, "\020%c%c\016\016%c%c\017 %c%c\002%c\n\r", TXT_2BYTE, TXT2BYTE_SetpointShort, TXT_2BYTE, TXT2BYTE_SetpointLow, TXT_2BYTE, TXT2BYTE_SetpointDelayed, settings->delaySetpointLow ? '\005' : '\006');
71 } else { 70 } else {
72 textPointer += snprintf(&text[textPointer], 40, "\020%c%c %c%c\n\r", TXT_2BYTE, TXT2BYTE_Custom, TXT_2BYTE, TXT2BYTE_Setpoint); 71 textPointer += snprintf(&text[textPointer], 40, "\020%c%c %c%c\n\r", TXT_2BYTE, TXT2BYTE_Custom, TXT_2BYTE, TXT2BYTE_Setpoint);