Mercurial > public > ostc4
comparison Discovery/Inc/logbook.h @ 461:b3f684cea9c0
Merged in Ideenmodellierer/ostc4/minor_improvments (pull request #41)
Minor improvments
author | heinrichsweikamp <bitbucket@heinrichsweikamp.com> |
---|---|
date | Mon, 30 Mar 2020 13:16:11 +0000 |
parents | 5dd996ed8611 |
children | 73da921869d9 |
comparison
equal
deleted
inserted
replaced
441:9a9e4908ce2e | 461:b3f684cea9c0 |
---|---|
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]; |
207 SLogbookHeaderOSTC3 * logbook_build_ostc3header(SLogbookHeader* pLogbookHeader); | 209 SLogbookHeaderOSTC3 * logbook_build_ostc3header(SLogbookHeader* pLogbookHeader); |
208 SLogbookHeaderOSTC3compact * logbook_build_ostc3header_compact(SLogbookHeader* pHead); | 210 SLogbookHeaderOSTC3compact * logbook_build_ostc3header_compact(SLogbookHeader* pHead); |
209 | 211 |
210 uint8_t logbook_getNumberOfHeaders(void); | 212 uint8_t logbook_getNumberOfHeaders(void); |
211 uint8_t logbook_getHeader(uint8_t StepBackwards,SLogbookHeader* pLogbookHeader); | 213 uint8_t logbook_getHeader(uint8_t StepBackwards,SLogbookHeader* pLogbookHeader); |
212 uint16_t logbook_readSampleData(uint8_t StepBackwards, uint16_t length,uint16_t* depth, uint8_t* gasid, int16_t* temperature, uint16_t* ppo2, uint16_t* setpoint, uint16_t* sensor1, uint16_t* sensor2, uint16_t* sensor3, uint16_t* cns, uint8_t* bailout, uint16_t* decostopDepth); | 214 uint16_t logbook_readSampleData(uint8_t StepBackwards, uint16_t length,uint16_t* depth, uint8_t* gasid, int16_t* temperature, uint16_t* ppo2, |
215 uint16_t* setpoint, uint16_t* sensor1, uint16_t* sensor2, uint16_t* sensor3, uint16_t* cns, uint8_t* bailout, | |
216 uint16_t* decostopDepth, uint16_t* tank); | |
213 void logbook_test(void); | 217 void logbook_test(void); |
214 void logbook_InitAndWrite(const SDiveState* pStateReal); | 218 void logbook_InitAndWrite(const SDiveState* pStateReal); |
215 void logbook_recover_brokenlog(uint8_t headerId); | 219 void logbook_recover_brokenlog(uint8_t headerId); |
216 | 220 |
217 uint16_t logbook_lastDive_diveNumber(void); | 221 uint16_t logbook_lastDive_diveNumber(void); |
222 uint16_t logbook_fillDummySampleBuffer(SLogbookHeader* pHeader); | |
223 void logbook_readDummySamples(uint8_t* pTarget, uint16_t length); | |
218 | 224 |
219 #endif /* LOGBOOK_H */ | 225 #endif /* LOGBOOK_H */ |