comparison Discovery/Src/settings.c @ 111:38785aa95837 FlipDisplay

Added new nvm parameter"FlipDisplay" indicating the screen orientation
author Ideenmodellierer
date Tue, 01 Jan 2019 21:03:10 +0100
parents 2b3f8ed4a0b8
children 3834b6272ee5
comparison
equal deleted inserted replaced
110:cc8e24374b83 111:38785aa95837
53 53
54 const SFirmwareData firmware_FirmwareData __attribute__( (section(".firmware_firmware_data")) ) = 54 const SFirmwareData firmware_FirmwareData __attribute__( (section(".firmware_firmware_data")) ) =
55 { 55 {
56 .versionFirst = 1, 56 .versionFirst = 1,
57 .versionSecond = 4, 57 .versionSecond = 4,
58 .versionThird = 0, 58 .versionThird = 3,
59 .versionBeta = 0, 59 .versionBeta = 0,
60 60
61 /* 4 bytes with trailing 0 */ 61 /* 4 bytes with trailing 0 */
62 .signature = "mh", 62 .signature = "mh",
63 63
80 80
81 /* always adjust check_and_correct_settings() accordingly 81 /* always adjust check_and_correct_settings() accordingly
82 * There might even be entries with fixed values that have no range 82 * There might even be entries with fixed values that have no range
83 */ 83 */
84 const SSettings SettingsStandard = { 84 const SSettings SettingsStandard = {
85 .header = 0xFFFF0017, 85 .header = 0xFFFF0018,
86 .warning_blink_dsec = 8 * 2, 86 .warning_blink_dsec = 8 * 2,
87 .lastDiveLogId = 0, 87 .lastDiveLogId = 0,
88 .logFlashNextSampleStartAddress = 0, 88 .logFlashNextSampleStartAddress = 0,
89 89
90 .gas[0].oxygen_percentage = 21, 90 .gas[0].oxygen_percentage = 21,
303 .GF_model = 0, 303 .GF_model = 0,
304 .FactoryButtonBase = 90, 304 .FactoryButtonBase = 90,
305 .FactoryButtonBalance[0] = 3, 305 .FactoryButtonBalance[0] = 3,
306 .FactoryButtonBalance[1] = 3, 306 .FactoryButtonBalance[1] = 3,
307 .FactoryButtonBalance[2] = 3, 307 .FactoryButtonBalance[2] = 3,
308 .FlipDisplay = 0,
308 }; 309 };
309 310
310 /* Private function prototypes -----------------------------------------------*/ 311 /* Private function prototypes -----------------------------------------------*/
311 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to); 312 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to);
312 313
440 pSettings->FactoryButtonBase = pStandard->FactoryButtonBase; 441 pSettings->FactoryButtonBase = pStandard->FactoryButtonBase;
441 pSettings->FactoryButtonBalance[0] = pStandard->FactoryButtonBalance[0]; 442 pSettings->FactoryButtonBalance[0] = pStandard->FactoryButtonBalance[0];
442 pSettings->FactoryButtonBalance[1] = pStandard->FactoryButtonBalance[1]; 443 pSettings->FactoryButtonBalance[1] = pStandard->FactoryButtonBalance[1];
443 pSettings->FactoryButtonBalance[2] = pStandard->FactoryButtonBalance[2]; 444 pSettings->FactoryButtonBalance[2] = pStandard->FactoryButtonBalance[2];
444 // no break 445 // no break
446 case 0xFFFF0017:
447 pSettings->FlipDisplay = 0;
448 // no break
445 default: 449 default:
446 pSettings->header = pStandard->header; 450 pSettings->header = pStandard->header;
447 break; // no break before!! 451 break; // no break before!!
448 } 452 }
449 } 453 }
1379 { 1383 {
1380 Settings.GF_model = BUEHLMANN_OSTC4; 1384 Settings.GF_model = BUEHLMANN_OSTC4;
1381 corrections++; 1385 corrections++;
1382 } 1386 }
1383 1387
1388 if(Settings.FlipDisplay > 1) /* only boolean values allowed */
1389 {
1390 Settings.FlipDisplay = 0;
1391 corrections++;
1392 }
1384 1393
1385 if(corrections > 255) 1394 if(corrections > 255)
1386 return 255; 1395 return 255;
1387 else 1396 else
1388 return (uint8_t)corrections; 1397 return (uint8_t)corrections;