Mercurial > public > ostc4
annotate Discovery/Inc/configuration.h @ 471:73da921869d9 fix-bat-2
bugfix: implement battery charge percentage in dive header
This commit is (much) less trivial than the related 919e5cb51c92.
First, rename the CCRmode attribute (corresponding to byte Ox59) of
the SLogbookHeaderOSTC3. This byte (according to the hwOS interface
document) does not contain any CCR related value, but it contains
"battery information". Already since 2017, this byte is used from
libdivecomputer to interface the charge percentage. So, its
renamed from CCRmode to batteryCharge, to reflect its true purpose.
Now, simply add a batteryCharge attribute to the SLogbookHeader
(and see below why that is possible, without breaking things).
The remaining changes are trivial to implement battery charge
percentage in dive header.
Caveat: do not get confused by the exact role of the individual
logbook header types. SLogbookHeaderOSTC3 is the formal type of
the logbook format that the OSTC4 produces. This format is
supposed to identical to the format, as is used in hwOS for the
series of small OSTCs. Only some values of attributes are different.
For example, the OSTC4 supports VPM, so byte 0x79 (deco model used
for this dive) also has a value for VPM. But the SLogbookHeader
type, despite its name and structure, is *not* a true logbook
header, as it includes attributes that are not available in the
SLogbookHeaderOSTC3 formal header type.
Signed-off-by: Jan Mulder <jan@jlmulder.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Wed, 22 Apr 2020 13:08:57 +0200 |
parents | aa1d71875e25 |
children | 4ce932235578 |
rev | line source |
---|---|
446
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
1 /////////////////////////////////////////////////////////////////////////////// |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
2 /// -*- coding: UTF-8 -*- |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
3 /// |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
4 /// \file Discovery/Inc/configuration.h |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
5 /// \brief Header file for variant specific firmware adaptations at compile time |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
6 /// \author heinrichs weikamp gmbh |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
7 /// \date 29-February-2020 |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
8 /// |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
9 /// $Id$ |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
10 /////////////////////////////////////////////////////////////////////////////// |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
11 /// \par Copyright (c) 2014-2020 Heinrichs Weikamp gmbh |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
12 /// |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
13 /// This program is free software: you can redistribute it and/or modify |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
14 /// it under the terms of the GNU General Public License as published by |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
15 /// the Free Software Foundation, either version 3 of the License, or |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
16 /// (at your option) any later version. |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
17 /// |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
18 /// This program is distributed in the hope that it will be useful, |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
21 /// GNU General Public License for more details. |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
22 /// |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
23 /// You should have received a copy of the GNU General Public License |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
24 /// along with this program. If not, see <http://www.gnu.org/licenses/>. |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
25 ////////////////////////////////////////////////////////////////////////////// |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
26 |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
27 |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
28 #ifndef CONFIGURATION_HEADER |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
29 #define CONFIGURATION_HEADER |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
30 |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
31 /* Enable this to make the simulator write a logbook entry */ |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
32 /* #define SIM_WRITES_LOGBOOK 1 */ |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
33 |
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
34 /* Enable this for support of optical bottle pressure interface */ |
450 | 35 /* #define ENABLE_BOTTLE_SENSOR */ |
36 | |
37 /* Enable this to show voltage in parallel to charge state */ | |
38 /* #define ALWAYS_SHOW_VOLTAGE */ | |
39 | |
40 /* Enable this to skip coplete scan of dive log during startup */ | |
41 /* #define TRUST_LOG_CONSISTENCY */ | |
42 | |
464
05c5c3d10902
Added compile switch to handle additional data during raw header request:
ideenmodellierer
parents:
450
diff
changeset
|
43 /* Enable this to transfer additional data list last dive ID and last sample index during raw data requests */ |
05c5c3d10902
Added compile switch to handle additional data during raw header request:
ideenmodellierer
parents:
450
diff
changeset
|
44 /* define SEND_DATA_DETAILS */ |
05c5c3d10902
Added compile switch to handle additional data during raw header request:
ideenmodellierer
parents:
450
diff
changeset
|
45 |
468
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
464
diff
changeset
|
46 /* Enable to activate a menu item in reset menu which provide sample ring analysis / repair functionality */ |
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
464
diff
changeset
|
47 /* #define ENABLE_ANALYSE_SAMPLES */ |
aa1d71875e25
Moved and deactivated analyse sample buffer switch:
ideenmodellierer
parents:
464
diff
changeset
|
48 |
446
f1257a32f2d4
Introduced configuration header for variant managment:
ideenmodellierer
parents:
diff
changeset
|
49 #endif |