Mercurial > public > ostc4
comparison Discovery/Src/logbook.c @ 483:90d1f793dcf2 FixLayout_Header_LogView
Development option only read bottledata:
If the header divisor is set (in my case because of switching between development and main versions) the samples need to be read considering the bottle values, too. Divelogs written by a SW not supporting bottle pressure have the divisor set to 0 => no impact to main SW
Bugfix header memory layout:
The batterygaugeregisters were not used and will be reused for other information. To keep the OSTC3 format up and running the datafield is not filled with "0x00"
| author | ideenmodellierer |
|---|---|
| date | Tue, 26 May 2020 21:12:02 +0200 |
| parents | 73da921869d9 |
| children | b33a8c1c72e5 |
comparison
equal
deleted
inserted
replaced
| 482:230aed360da0 | 483:90d1f793dcf2 |
|---|---|
| 899 else | 899 else |
| 900 { | 900 { |
| 901 divisor.cns--; | 901 divisor.cns--; |
| 902 } | 902 } |
| 903 | 903 |
| 904 #ifdef ENABLE_BOTTLE_SENSOR | |
| 905 if(smallHeader.tankDivisor) | 904 if(smallHeader.tankDivisor) |
| 906 { | 905 { |
| 907 if(divisor.tank == 0) | 906 if(divisor.tank == 0) |
| 908 { | 907 { |
| 909 divisor.tank = smallHeader.tankDivisor - 1; | 908 divisor.tank = smallHeader.tankDivisor - 1; |
| 918 else | 917 else |
| 919 { | 918 { |
| 920 divisor.tank--; | 919 divisor.tank--; |
| 921 } | 920 } |
| 922 } | 921 } |
| 923 #endif | |
| 924 | 922 |
| 925 if (length != 0) | 923 if (length != 0) |
| 926 return 0; | 924 return 0; |
| 927 | 925 |
| 928 return bytesRead; | 926 return bytesRead; |
| 1616 | 1614 |
| 1617 memcpy(headerOSTC3.hwHudBattery_mV, &pHead->hwHudBattery_mV, 2); | 1615 memcpy(headerOSTC3.hwHudBattery_mV, &pHead->hwHudBattery_mV, 2); |
| 1618 | 1616 |
| 1619 headerOSTC3.hwHudLastStatus = pHead->hwHudLastStatus; | 1617 headerOSTC3.hwHudLastStatus = pHead->hwHudLastStatus; |
| 1620 | 1618 |
| 1621 memcpy(headerOSTC3.batteryGaugeRegisters,&pHead->batteryGaugeRegisters, 6); | 1619 memset(headerOSTC3.batteryGaugeRegisters, 0x00, 6); /* The battery registers are not evaluated => Set to zero */ |
| 1622 | |
| 1623 | 1620 |
| 1624 memcpy(headerOSTC3.diveHeaderEnd, &pHead->diveHeaderEnd, 2); | 1621 memcpy(headerOSTC3.diveHeaderEnd, &pHead->diveHeaderEnd, 2); |
| 1625 } | 1622 } |
| 1626 else | 1623 else |
| 1627 { | 1624 { |
