Mercurial > public > ostc4
diff 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 |
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditSetpoint.c Tue Mar 26 22:23:26 2019 +0000 +++ b/Discovery/Src/tMenuEditSetpoint.c Wed Mar 27 15:12:26 2019 +0100 @@ -47,13 +47,10 @@ /* Private function prototypes -----------------------------------------------*/ -void openEdit_DiveSetpointSelect(uint8_t line); -void openEdit_DiveSetpointSelect_Subroutine(uint8_t line); /* Announced function prototypes -----------------------------------------------*/ uint8_t OnAction_SP_Setpoint (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_SP_Depth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t On (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); //uint8_t OnAction_SP_First (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); //uint8_t OnAction_SP_Active (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); //uint8_t OnAction_SP_DM_Select (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); @@ -290,7 +287,7 @@ if(action == ACTION_BUTTON_BACK) { digitContentNew = digitContent - 1; - if((blockNumber == 0) && (digitContentNew > '1')) + if((blockNumber == 0) && (digitContentNew < '0')) digitContentNew = '1'; if(digitContentNew < '0') digitContentNew = '9';