Mercurial > public > ostc4
comparison Discovery/Src/base.c @ 416:bcf447646e07
Merged in Ideenmodellierer/ostc4/Improment_NVM (pull request #37)
Improment NVM
| author | heinrichsweikamp <bitbucket@heinrichsweikamp.com> |
|---|---|
| date | Wed, 15 Jan 2020 10:53:15 +0000 |
| parents | b3ab85121e4d |
| children | b67327177159 |
comparison
equal
deleted
inserted
replaced
| 403:6f30f2011667 | 416:bcf447646e07 |
|---|---|
| 349 RTC_TimeTypeDef Stime; | 349 RTC_TimeTypeDef Stime; |
| 350 uint8_t measurementindex = 0; | 350 uint8_t measurementindex = 0; |
| 351 uint8_t lastsecond = 0xFF; | 351 uint8_t lastsecond = 0xFF; |
| 352 #endif | 352 #endif |
| 353 | 353 |
| 354 SStateList status; | |
| 354 detectionState_t pitchstate; | 355 detectionState_t pitchstate; |
| 355 set_globalState( StBoot0 ); | 356 set_globalState( StBoot0 ); |
| 356 LastButtonPressed = 0; | 357 LastButtonPressed = 0; |
| 357 | 358 |
| 358 HAL_Init(); | 359 HAL_Init(); |
| 475 { | 476 { |
| 476 createDiveSettings(); | 477 createDiveSettings(); |
| 477 updateMenu(); | 478 updateMenu(); |
| 478 ext_flash_write_settings(); | 479 ext_flash_write_settings(); |
| 479 } | 480 } |
| 481 | |
| 482 /* check if tasks depending on global state are pending */ | |
| 483 get_globalStateList(&status); | |
| 484 if(status.base == BaseHome) | |
| 485 { | |
| 486 tMenuEdit_writeSettingsToFlash(); // takes 900 ms!! | |
| 487 } | |
| 488 | |
| 489 DataEX_merge_devicedata(); /* data is exchanged at startup and every 10 minutes => check if something changed */ | |
| 490 | |
| 480 deco_loop(); | 491 deco_loop(); |
| 481 TriggerButtonAction(); | 492 TriggerButtonAction(); |
| 482 if(DoDisplayRefresh) /* set every 100ms by timer interrupt */ | 493 if(DoDisplayRefresh) /* set every 100ms by timer interrupt */ |
| 483 { | 494 { |
| 484 DoDisplayRefresh = 0; | 495 DoDisplayRefresh = 0; |
| 622 updateMiniLiveLogbook(1); | 633 updateMiniLiveLogbook(1); |
| 623 timer_UpdateSecond(1); | 634 timer_UpdateSecond(1); |
| 624 base_tempLightLevel = TIM_BACKLIGHT_adjust(); | 635 base_tempLightLevel = TIM_BACKLIGHT_adjust(); |
| 625 tCCR_tick(); | 636 tCCR_tick(); |
| 626 tHome_tick(); | 637 tHome_tick(); |
| 627 if(status.base == BaseHome) | |
| 628 tMenuEdit_writeSettingsToFlash(); // takes 900 ms!! | |
| 629 break; | 638 break; |
| 630 case BaseStop: | 639 case BaseStop: |
| 631 DateEx_copy_to_dataOut(); | 640 DateEx_copy_to_dataOut(); |
| 632 DataEX_call(); | 641 DataEX_call(); |
| 633 DataEX_control_connection_while_asking_for_sleep(); | 642 DataEX_control_connection_while_asking_for_sleep(); |
| 1669 CALC_INVALID | 1678 CALC_INVALID |
| 1670 } CALC_WHAT; | 1679 } CALC_WHAT; |
| 1671 | 1680 |
| 1672 static CALC_WHAT what = CALC_INVALID; | 1681 static CALC_WHAT what = CALC_INVALID; |
| 1673 static int counter = 0; | 1682 static int counter = 0; |
| 1674 if((stateUsed->mode != MODE_DIVE) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) || (decoLock != DECO_CALC_ready )) | 1683 if((stateUsed->mode != MODE_DIVE) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) || (stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) || (decoLock != DECO_CALC_ready )) |
| 1675 return; | 1684 return; |
| 1676 | 1685 |
| 1677 decoLock = DECO_CALC_running; | 1686 decoLock = DECO_CALC_running; |
| 1678 | 1687 |
| 1679 if(stateDeco.diveSettings.deco_type.ub.standard == GF_MODE) | 1688 if(stateDeco.diveSettings.deco_type.ub.standard == GF_MODE) |
