view Discovery/Inc/gfx_colors.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 5f11787b4f42
children 998529b3e142
line wrap: on
line source

///////////////////////////////////////////////////////////////////////////////
/// -*- coding: UTF-8 -*-
///
/// \file   Discovery/Inc/gfx_colors.h
/// \brief  Header file of gfx_ccolors.h with all color RGBs defined
/// \author heinrichs weikamp gmbh
/// \date   02-May-2014
///
/// $Id$
///////////////////////////////////////////////////////////////////////////////
/// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
///
///     This program is free software: you can redistribute it and/or modify
///     it under the terms of the GNU General Public License as published by
///     the Free Software Foundation, either version 3 of the License, or
///     (at your option) any later version.
///
///     This program is distributed in the hope that it will be useful,
///     but WITHOUT ANY WARRANTY; without even the implied warranty of
///     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
///     GNU General Public License for more details.
///
///     You should have received a copy of the GNU General Public License
///     along with this program.  If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////////////

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef GFX_COLORS_H
#define GFX_COLORS_H

/* Includes ------------------------------------------------------------------*/

#include "stdint.h"

/* Exported types ------------------------------------------------------------*/

typedef enum
{
	CLUT_Font020 = 0,
	CLUT_Font021,
	CLUT_Font022,
	CLUT_Font023,
	CLUT_WarningYellow,
	CLUT_WarningRed,
	CLUT_NiceGreen,
	CLUT_Font027, // DIVE Main
	CLUT_Font030, // Plugin Box Main
	CLUT_Font031, // Plugin Box Grey
	CLUT_Font032, // DIVE_LabelColor
	CLUT_DIVE_FieldSeperatorLines,
	CLUT_DIVE_pluginbox,
	CLUT_NiceBlue,
	CLUT_DIVE_SPARE22,
	CLUT_DiveMainLabel,
	CLUT_pluginboxSurface,
	CLUT_MenuLineUnselected,
	CLUT_MenuLineUnselectedSeperator,
	CLUT_MenuLineSelected,
	CLUT_MenuEditLineSelected,
	CLUT_MenuLineSelectedSides,
	CLUT_MenuLineSelectedSeperator,
	CLUT_MenuTopBackground,
	CLUT_Group0,
	CLUT_MenuEditCursor,
	CLUT_MenuEditInfo,
	CLUT_MenuEditActive,
	CLUT_MenuEditButtonColor1,
	CLUT_MenuEditFieldRegular,
	CLUT_MenuEditFieldSelected,
	CLUT_MenuEditField0,
	CLUT_MenuEditField1,
	CLUT_MenuEditField2,
	CLUT_MenuEditField3,
	CLUT_MenuEditField4,
	CLUT_MenuEditField5,
	CLUT_MenuEditField6,
	CLUT_MenuEditField7,
	CLUT_MenuEditField8,
	CLUT_MenuEditField9,
	CLUT_MenuEditDigit,
	CLUT_MenuPageGasOC,
	CLUT_MenuPageGasCC,
	CLUT_MenuPageGasSP,
	CLUT_MenuPageXtra,
	CLUT_MenuPageDeco,
	CLUT_MenuPageDecoParameter,
	CLUT_MenuPageHardware,
	CLUT_MenuPageSystem,
	CLUT_MenuPageDivePlanner,
	CLUT_MenuPage9,
	CLUT_MenuPage10,
	CLUT_ButtonSymbols,
	CLUT_InfoSurface,
	CLUT_InfoDive,
	CLUT_InfoCompass,
	CLUT_InfoCursor,
	CLUT_InfoInActive,
	CLUT_InfoActive,
	CLUT_InfoButtonColor1,
	CLUT_InfoFieldRegular,
	CLUT_InfoFieldSelected,
	CLUT_InfoField0,
	CLUT_InfoField1,
	CLUT_InfoField2,
	CLUT_InfoField3,
	CLUT_InfoField4,
	CLUT_InfoField5,
	CLUT_InfoField6,
	CLUT_InfoField7,
	CLUT_InfoField8,
	CLUT_InfoField9,
	CLUT_InfoPageLogbook,
	CLUT_LogbookGrid,
	CLUT_LogbookText,
	CLUT_LogbookTemperature,
	CLUT_GasSensor0,
	CLUT_GasSensor1,
	CLUT_GasSensor2,
	CLUT_GasSensor3,
	CLUT_GasSensor4,
	CLUT_GasSensor5,
	CLUT_GasSensor6,
	CLUT_GasSensor7,
	CLUT_GasSensor8,
	CLUT_GasSensor9,
	CLUT_GasSensor10,
	CLUT_GasSensor11,
	CLUT_GasSensor12,
	CLUT_GasSensor13,
	CLUT_GasSensor14,
	CLUT_GasSensor15,
	CLUT_CompassUserBackHeadingTick,
	CLUT_CompassSubTick,
	CLUT_CompassNorthTick,
	CLUT_CompassUserHeadingTick,
	CLUT_EverythingOkayGreen,
	CLUT_ButtonSurfaceScreen,
	CLUT_BatteryStandard,
	CLUT_BatteryCharging,
	CLUT_BatteryProblem,
	CLUT_Colorscheme0,
	CLUT_Colorscheme0x1,
	CLUT_Colorscheme0x2,
	CLUT_Colorscheme0x3,
	CLUT_Colorscheme0x4,
	CLUT_Colorscheme0x5,
	CLUT_Colorscheme0x6,
	CLUT_Colorscheme0x7,
	CLUT_Colorscheme1,
	CLUT_Colorscheme1x1,
	CLUT_Colorscheme1x2,
	CLUT_Colorscheme1x3,
	CLUT_Colorscheme1x4,
	CLUT_Colorscheme1x5,
	CLUT_Colorscheme1x6,
	CLUT_Colorscheme1x7,
	CLUT_Colorscheme2,
	CLUT_Colorscheme2x1,
	CLUT_Colorscheme2x2,
	CLUT_Colorscheme2x3,
	CLUT_Colorscheme2x4,
	CLUT_Colorscheme2x5,
	CLUT_Colorscheme2x6,
	CLUT_Colorscheme2x7,
	CLUT_Colorscheme3,
	CLUT_Colorscheme3x1,
	CLUT_Colorscheme3x2,
	CLUT_Colorscheme3x3,
	CLUT_Colorscheme3x4,
	CLUT_Colorscheme3x5,
	CLUT_Colorscheme3x6,
	CLUT_Colorscheme3x7,
	CLUT_END
} SCLUT_Content;


/* Exported variables --------------------------------------------------------*/

extern uint32_t ColorLUT[];

#endif /* GFX_COLORS_H */