comparison Discovery/Inc/logbook.h @ 458:5dd996ed8611 minor_improvments

Added ppO2 to dummy profile data: PPO2 calculation based on the first gas has been added to the dummy profile to enable drawing of the graph at log page four As this increased the number of parameters to be passed to the sub functions, the complete dive header is passed as reference instead of single members to increase the code maintanability
author ideenmodellierer
date Sat, 28 Mar 2020 21:41:47 +0100
parents 928a14568689
children 73da921869d9
comparison
equal deleted inserted replaced
457:4bd01f48c285 458:5dd996ed8611
27 #ifndef LOGBOOK_H 27 #ifndef LOGBOOK_H
28 #define LOGBOOK_H 28 #define LOGBOOK_H
29 29
30 #include "data_central.h" 30 #include "data_central.h"
31 #include "settings.h" 31 #include "settings.h"
32
33 #define NUM_GAS (5) /* number of selectable gases */
32 34
33 typedef struct 35 typedef struct
34 { 36 {
35 uint8_t setpoint_cbar; 37 uint8_t setpoint_cbar;
36 uint8_t depth_meter; 38 uint8_t depth_meter;
63 uint8_t diveTimeSeconds; 65 uint8_t diveTimeSeconds;
64 uint8_t samplingRate; 66 uint8_t samplingRate;
65 int16_t minTemp; 67 int16_t minTemp;
66 uint16_t surfacePressure_mbar; 68 uint16_t surfacePressure_mbar;
67 uint16_t desaturationTime; 69 uint16_t desaturationTime;
68 SGasListLog gasordil[5]; 70 SGasListLog gasordil[NUM_GAS];
69 uint8_t firmwareVersionLow; 71 uint8_t firmwareVersionLow;
70 uint8_t firmwareVersionHigh; 72 uint8_t firmwareVersionHigh;
71 uint16_t batteryVoltage; 73 uint16_t batteryVoltage;
72 uint16_t cnsAtBeginning; 74 uint16_t cnsAtBeginning;
73 uint8_t gfAtBeginning; 75 uint8_t gfAtBeginning;
74 uint8_t gfAtEnd; 76 uint8_t gfAtEnd;
75 uint16_t personalDiveCount; 77 uint16_t personalDiveCount;
76 SSetpointLog setpoint[5]; 78 SSetpointLog setpoint[NUM_GAS];
77 uint16_t maxCNS; 79 uint16_t maxCNS;
78 uint16_t averageDepth_mbar; 80 uint16_t averageDepth_mbar;
79 uint16_t total_diveTime_seconds; 81 uint16_t total_diveTime_seconds;
80 uint8_t salinity; 82 uint8_t salinity;
81 uint8_t gfLow_or_Vpm_conservatism; 83 uint8_t gfLow_or_Vpm_conservatism;
112 uint8_t diveTimeMinutes[2]; 114 uint8_t diveTimeMinutes[2];
113 uint8_t diveTimeSeconds; 115 uint8_t diveTimeSeconds;
114 uint8_t minTemp[2]; 116 uint8_t minTemp[2];
115 uint8_t surfacePressure_mbar[2]; 117 uint8_t surfacePressure_mbar[2];
116 uint8_t desaturationTime[2]; 118 uint8_t desaturationTime[2];
117 uint8_t gasordil[5*4]; 119 uint8_t gasordil[NUM_GAS*4];
118 uint8_t firmwareVersionLow; 120 uint8_t firmwareVersionLow;
119 uint8_t firmwareVersionHigh; 121 uint8_t firmwareVersionHigh;
120 uint8_t batteryVoltage[2]; 122 uint8_t batteryVoltage[2];
121 uint8_t samplingRate; 123 uint8_t samplingRate;
122 uint8_t cnsAtBeginning[2]; 124 uint8_t cnsAtBeginning[2];
215 void logbook_test(void); 217 void logbook_test(void);
216 void logbook_InitAndWrite(const SDiveState* pStateReal); 218 void logbook_InitAndWrite(const SDiveState* pStateReal);
217 void logbook_recover_brokenlog(uint8_t headerId); 219 void logbook_recover_brokenlog(uint8_t headerId);
218 220
219 uint16_t logbook_lastDive_diveNumber(void); 221 uint16_t logbook_lastDive_diveNumber(void);
220 uint16_t logbook_fillDummySampleBuffer(uint16_t diveMinutes, uint8_t diveSeconds, uint16_t maxDepth, uint8_t lastDecostop_m, int16_t minTemp); 222 uint16_t logbook_fillDummySampleBuffer(SLogbookHeader* pHeader);
221 void logbook_readDummySamples(uint8_t* pTarget, uint16_t length); 223 void logbook_readDummySamples(uint8_t* pTarget, uint16_t length);
222 224
223 #endif /* LOGBOOK_H */ 225 #endif /* LOGBOOK_H */