comparison Discovery/Src/settings.c @ 807:9e2ebfc72e8c

Zusammenf?hren
author heinrichsweikamp
date Sat, 26 Aug 2023 13:37:06 +0200
parents ee3c0029ed34 dd7ce655db26
children 40e951cfa443
comparison
equal deleted inserted replaced
806:ee3c0029ed34 807:9e2ebfc72e8c
335 .ext_sensor_map[6] = SENSOR_NONE, 335 .ext_sensor_map[6] = SENSOR_NONE,
336 .ext_sensor_map[7] = SENSOR_NONE, 336 .ext_sensor_map[7] = SENSOR_NONE,
337 .buttonLockActive = 0, 337 .buttonLockActive = 0,
338 .compassDeclinationDeg = 0, 338 .compassDeclinationDeg = 0,
339 .delaySetpointLow = false, 339 .delaySetpointLow = false,
340 .timerDurationS = 180,
340 }; 341 };
341 342
342 /* Private function prototypes -----------------------------------------------*/ 343 /* Private function prototypes -----------------------------------------------*/
343 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to); 344 uint8_t checkValue(uint8_t value,uint8_t from, uint8_t to);
344 345
542 pSettings->compassDeclinationDeg = pStandard->compassDeclinationDeg; 543 pSettings->compassDeclinationDeg = pStandard->compassDeclinationDeg;
543 pSettings->delaySetpointLow = pStandard->delaySetpointLow; 544 pSettings->delaySetpointLow = pStandard->delaySetpointLow;
544 // Disable auto setpoint to avoid a configuration warning being triggered by the new auto setpoint validation 545 // Disable auto setpoint to avoid a configuration warning being triggered by the new auto setpoint validation
545 // This ensures that users don't lose setpoint information if it is not in the right spot for the new configuration 546 // This ensures that users don't lose setpoint information if it is not in the right spot for the new configuration
546 pSettings->autoSetpoint = false; 547 pSettings->autoSetpoint = false;
548
549 pSettings->timerDurationS = pStandard->timerDurationS;
550
547 // no break; 551 // no break;
548 case 0xFFFF0026: 552 case 0xFFFF0026:
549 pSettings->ext_sensor_map[0] = pSettings->ext_sensor_map_Obsolete[0]; 553 pSettings->ext_sensor_map[0] = pSettings->ext_sensor_map_Obsolete[0];
550 pSettings->ext_sensor_map[1] = pSettings->ext_sensor_map_Obsolete[1]; 554 pSettings->ext_sensor_map[1] = pSettings->ext_sensor_map_Obsolete[1];
551 pSettings->ext_sensor_map[2] = pSettings->ext_sensor_map_Obsolete[2]; 555 pSettings->ext_sensor_map[2] = pSettings->ext_sensor_map_Obsolete[2];
552 pSettings->ext_sensor_map[3] = pSettings->ext_sensor_map_Obsolete[3]; 556 pSettings->ext_sensor_map[3] = pSettings->ext_sensor_map_Obsolete[3];
553 pSettings->ext_sensor_map[4] = pSettings->ext_sensor_map_Obsolete[4]; 557 pSettings->ext_sensor_map[4] = pSettings->ext_sensor_map_Obsolete[4];
554 pSettings->ext_sensor_map[5] = SENSOR_NONE; 558 pSettings->ext_sensor_map[5] = SENSOR_NONE;
555 pSettings->ext_sensor_map[6] = SENSOR_NONE; 559 pSettings->ext_sensor_map[6] = SENSOR_NONE;
556 pSettings->ext_sensor_map[7] = SENSOR_NONE; 560 pSettings->ext_sensor_map[7] = SENSOR_NONE;
557 // no break; 561
562 // no break;
558 default: 563 default:
559 pSettings->header = pStandard->header; 564 pSettings->header = pStandard->header;
560 break; // no break before!! 565 break; // no break before!!
561 } 566 }
562 } 567 }
1615 Settings.compassDeclinationDeg = 99; 1620 Settings.compassDeclinationDeg = 99;
1616 1621
1617 corrections++; 1622 corrections++;
1618 } else if (Settings.compassDeclinationDeg < -99) { 1623 } else if (Settings.compassDeclinationDeg < -99) {
1619 Settings.compassDeclinationDeg = -99; 1624 Settings.compassDeclinationDeg = -99;
1625
1626 corrections++;
1627 }
1628
1629 if (Settings.timerDurationS > 599) {
1630 Settings.timerDurationS = 599;
1631
1632 corrections++;
1633 } else if (Settings.timerDurationS < 1) {
1634 Settings.timerDurationS = 1;
1620 1635
1621 corrections++; 1636 corrections++;
1622 } 1637 }
1623 1638
1624 if(corrections) 1639 if(corrections)