comparison Discovery/Src/tMenuEditSetpoint.c @ 213:d539ed9aa5b8 edit-fix

Bugfix, trivial: do not visit 9 on first digit for setpoint When editing a setpoint, and hitting the "-" button, the digit sequence was 1, 0, 9, 1, ... So, one could enter a setpoint of 9.5 bar (that is later automatically clamped between 0.5 and 1.6). This simply looks strange, so fix it. Now, hitting "+" and "-" behave symmetrical. At the same time, kick out some unused code. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Wed, 27 Mar 2019 15:12:26 +0100
parents 255eedad4155
children ba229a012ac7
comparison
equal deleted inserted replaced
212:c878a08dcf86 213:d539ed9aa5b8
45 /* Private variables ---------------------------------------------------------*/ 45 /* Private variables ---------------------------------------------------------*/
46 SEditSetpointPage editSetpointPage; 46 SEditSetpointPage editSetpointPage;
47 47
48 /* Private function prototypes -----------------------------------------------*/ 48 /* Private function prototypes -----------------------------------------------*/
49 49
50 void openEdit_DiveSetpointSelect(uint8_t line);
51 void openEdit_DiveSetpointSelect_Subroutine(uint8_t line);
52 50
53 /* Announced function prototypes -----------------------------------------------*/ 51 /* Announced function prototypes -----------------------------------------------*/
54 uint8_t OnAction_SP_Setpoint (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 52 uint8_t OnAction_SP_Setpoint (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
55 uint8_t OnAction_SP_Depth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 53 uint8_t OnAction_SP_Depth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
56 uint8_t On (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
57 //uint8_t OnAction_SP_First (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 54 //uint8_t OnAction_SP_First (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
58 //uint8_t OnAction_SP_Active (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 55 //uint8_t OnAction_SP_Active (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
59 //uint8_t OnAction_SP_DM_Select (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 56 //uint8_t OnAction_SP_DM_Select (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
60 uint8_t OnAction_SP_DM_Sensor1 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 57 uint8_t OnAction_SP_DM_Sensor1 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
61 uint8_t OnAction_SP_DM_Sensor2 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 58 uint8_t OnAction_SP_DM_Sensor2 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
288 } 285 }
289 286
290 if(action == ACTION_BUTTON_BACK) 287 if(action == ACTION_BUTTON_BACK)
291 { 288 {
292 digitContentNew = digitContent - 1; 289 digitContentNew = digitContent - 1;
293 if((blockNumber == 0) && (digitContentNew > '1')) 290 if((blockNumber == 0) && (digitContentNew < '0'))
294 digitContentNew = '1'; 291 digitContentNew = '1';
295 if(digitContentNew < '0') 292 if(digitContentNew < '0')
296 digitContentNew = '9'; 293 digitContentNew = '9';
297 return digitContentNew; 294 return digitContentNew;
298 } 295 }