comparison Discovery/Src/base.c @ 1037:2af07aa38531 GasConsumption

Merge with external development branches: Some features have been prepared for integration: Profiles, DMA UART on Firmware part, Bluetooth discovery and messges logging for development phase. All these new function are deactivated by compile switch and may be activated using the configuration.h for testing purpose.
author Ideenmodellierer
date Mon, 15 Sep 2025 21:12:44 +0200
parents 3d9552e4997c 5865f0aeb438
children 7efc8baa3ffa
comparison
equal deleted inserted replaced
1029:e938901f6386 1037:2af07aa38531
235 #include "tDebug.h" 235 #include "tDebug.h"
236 #include "motion.h" 236 #include "motion.h"
237 #include "t7.h" 237 #include "t7.h"
238 #include "t3.h" 238 #include "t3.h"
239 #include "tMenuEditSetpoint.h" 239 #include "tMenuEditSetpoint.h"
240 #include "cv_heartbeat.h"
241 #include "tInfoLogger.h"
240 242
241 #ifdef DEMOMODE 243 #ifdef DEMOMODE
242 #include "demo.h" 244 #include "demo.h"
243 static void TIM_DEMO_init(void); 245 static void TIM_DEMO_init(void);
244 #endif 246 #endif
245 247
248 #ifdef ENABLE_USART_RADIO
249 #include "demo.h"
250 #endif
246 251
247 //#include "lodepng.h" 252 //#include "lodepng.h"
248 //#include <stdlib.h> // for malloc and free 253 //#include <stdlib.h> // for malloc and free
249 254
250 /** @addtogroup OSTC 4 255 /** @addtogroup OSTC 4
499 #endif 504 #endif
500 if( bootToBootloader ) 505 if( bootToBootloader )
501 resetToFirmwareUpdate(); 506 resetToFirmwareUpdate();
502 507
503 tCCR_control(); 508 tCCR_control();
509
504 if( tComm_control() )// will stop while loop if tComm Mode started until exit from UART 510 if( tComm_control() )// will stop while loop if tComm Mode started until exit from UART
505 { 511 {
506 createDiveSettings(); 512 createDiveSettings();
507 updateMenu(); 513 updateMenu();
508 ext_flash_write_settings(EF_SETTINGS,0); 514 ext_flash_write_settings(EF_SETTINGS,0);
524 } 530 }
525 else 531 else
526 { 532 {
527 TriggerButtonAction(); 533 TriggerButtonAction();
528 } 534 }
535 #ifdef ENABLE_PULSE_SENSOR_BT
536 cv_heartbeat_HandleData();
537 #endif
538
539 #ifdef ENABLE_USART_RADIO
540 demo_HandleData();
541 #endif
529 if(DoHousekeeping) 542 if(DoHousekeeping)
530 { 543 {
531 DoHousekeeping = housekeepingFrame(); 544 DoHousekeeping = housekeepingFrame();
532 } 545 }
533 if(DoDisplayRefresh) /* set every 100ms by timer interrupt */ 546 if(DoDisplayRefresh) /* set every 100ms by timer interrupt */
534 { 547 {
548 #ifdef ENABLE_PULSE_SENSOR_BT
549 cv_heartbeat_Control();
550 #endif
535 DoDisplayRefresh = 0; 551 DoDisplayRefresh = 0;
536 552
537 updateSetpointStateUsed(); 553 updateSetpointStateUsed();
538 if(stateUsed == stateSimGetPointer()) 554 if(stateUsed == stateSimGetPointer())
539 { 555 {
725 741
726 static void RefreshDisplay() 742 static void RefreshDisplay()
727 { 743 {
728 SStateList status; 744 SStateList status;
729 get_globalStateList(&status); 745 get_globalStateList(&status);
746
747 #ifdef ENABLE_LOGGER_WINDOW
748 if((status.base != 0) && (get_globalState() != StILOGGER) && (InfoLogger_isUpdated()))
749 {
750 openInfo_Logger();
751 get_globalStateList(&status);
752 }
753 #endif
754
730 switch(status.base) 755 switch(status.base)
731 { 756 {
732 case BaseHome: 757 case BaseHome:
733 tHome_refresh(); 758 tHome_refresh();
734 tM_check_content(); 759 tM_check_content();
916 case InfoPageLogShow: sendActionToInfoLogShow(action); 941 case InfoPageLogShow: sendActionToInfoLogShow(action);
917 break; 942 break;
918 case InfoPageSensor: sendActionToInfoSensor(action); 943 case InfoPageSensor: sendActionToInfoSensor(action);
919 break; 944 break;
920 case InfoPagePreDive: sendActionToInfoPreDive(action); 945 case InfoPagePreDive: sendActionToInfoPreDive(action);
946 break;
947 case InfoPageLogger: exitInfo();
921 break; 948 break;
922 default: sendActionToInfo(action); 949 default: sendActionToInfo(action);
923 break; 950 break;
924 } 951 }
925 break; 952 break;