comparison Common/Inc/data_central.h @ 805:dd7ce655db26

Adds a simple countdown timer, available as a custom view in surface and dive mode. This can be used to time safety stops, or to prebreathe a CCR (or to boil your breakfast eggs if you are so inclined). The duration of the timer is configurable from 1 second to 9:59 minutes in the System menu. The timer is started by switching to the custom view, and remaining on it until a 10 second delay has elapsed. Once the timer has started the custom view can be changed and the timer will continue running in the background. After the timer has run out 'Finished' will be shown for 10 seconds in the timer custom view, and then automatic switching of custom views (if configured) resumes. In surface mode the dive computer will not go to sleep while the timer is running, and a mini timer will be shown when the timer custom view is not showing. (mikeller)
author heinrichsweikamp
date Mon, 21 Aug 2023 17:20:07 +0200
parents 1e3c12d772eb
children 2a8af51ab04d
comparison
equal deleted inserted replaced
804:391b3d420a39 805:dd7ce655db26
358 CHARGER_running, 358 CHARGER_running,
359 CHARGER_complete, 359 CHARGER_complete,
360 CHARGER_lostConnection 360 CHARGER_lostConnection
361 }; 361 };
362 362
363 typedef enum {
364 TIMER_STATE_OFF = 0,
365 TIMER_STATE_PRESTART,
366 TIMER_STATE_RUNNING,
367 TIMER_STATE_WAIT_FINISHED,
368 TIMER_STATE_FINISHED,
369 } timerState_e;
370
363 typedef struct 371 typedef struct
364 { 372 {
365 SDiveSettings diveSettings; 373 SDiveSettings diveSettings;
366 SLifeData lifeData; 374 SLifeData lifeData;
367 SVpm vpm; 375 SVpm vpm;
388 uint8_t decoMissed_at_the_end_of_dive; 396 uint8_t decoMissed_at_the_end_of_dive;
389 397
390 uint8_t sensorErrorsRTE; 398 uint8_t sensorErrorsRTE;
391 399
392 uint8_t lastKnownBatteryPercentage; 400 uint8_t lastKnownBatteryPercentage;
401
402 timerState_e timerState;
403 int timerStartedS;
393 } SDiveState; 404 } SDiveState;
394 405
395 406
396 typedef struct{ 407 typedef struct{
397 uint8_t bit0:1; 408 uint8_t bit0:1;
510 521
511 bool isCompassCalibrated(void); 522 bool isCompassCalibrated(void);
512 void setCompassHeading(uint16_t heading); 523 void setCompassHeading(uint16_t heading);
513 524
514 const SDecoinfo *getDecoInfo(void); 525 const SDecoinfo *getDecoInfo(void);
526
527 void disableTimer(void);
515 #endif // DATA_CENTRAL_H 528 #endif // DATA_CENTRAL_H