changeset 138:cc9c18075e00 FlipDisplay

Removed no longer supported scooter code
author Ideenmodellierer
date Sat, 23 Feb 2019 21:10:51 +0100
parents 9eda5a75c5fd
children decb0461302a
files Common/Inc/data_central.h Common/Inc/settings.h Discovery/Inc/bonexConnect.h Discovery/Inc/bonex_mini.h Discovery/Inc/data_exchange_main.h Discovery/Inc/tHome.h Discovery/Inc/tMenuEditHardware.h Discovery/Inc/tStructure.h Discovery/Inc/text_multilanguage.h Discovery/Src/base.c Discovery/Src/bonexConnect.c Discovery/Src/bonex_mini.c Discovery/Src/data_central.c Discovery/Src/data_exchange_main.c Discovery/Src/settings.c Discovery/Src/simulation.c Discovery/Src/t3.c Discovery/Src/t5_gauge.c Discovery/Src/t6_apnea.c Discovery/Src/t7.c Discovery/Src/t9.c Discovery/Src/tComm.c Discovery/Src/tHome.c Discovery/Src/tMenuEdit.c Discovery/Src/tMenuEditHardware.c Discovery/Src/tMenuEditSystem.c Discovery/Src/tMenuHardware.c Discovery/Src/tMenuSystem.c Discovery/Src/text_multilanguage.c
diffstat 29 files changed, 6 insertions(+), 4654 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/data_central.h	Tue Feb 19 21:48:32 2019 +0100
+++ b/Common/Inc/data_central.h	Sat Feb 23 21:10:51 2019 +0100
@@ -218,18 +218,6 @@
 	uint16_t	bottle_bar_age_MilliSeconds[2 * NUM_GASES + 1];
 	uint16_t	apnea_total_counter;
 
-	uint8_t		scooterSpeed;
-	uint8_t		scooterType;
-	uint16_t	scooterWattstunden;
-	uint16_t	scooterDrehzahl;
-	uint8_t		scooterRestkapazitaet;
-	uint8_t		scooterAmpere;
-	uint16_t	scooterTemperature;
-	uint16_t	scooterAgeInMilliSeconds;
-	float			scooterSpannung;
-	uint8_t		scooterRestkapazitaetWhBased;
-	uint8_t		scooterRestkapazitaetVoltageBased;
-
 	/* control of DataEX_copy_to_LifeData()
 	 */
 	uint8_t boolResetAverageDepth;
@@ -476,6 +464,4 @@
 
 _Bool is_ambient_pressure_close_to_surface(SLifeData *lifeData);
 
-uint8_t stateUsed_scooterRemainingBattCapacity(void);
-
 #endif // DATA_CENTRAL_H
--- a/Common/Inc/settings.h	Tue Feb 19 21:48:32 2019 +0100
+++ b/Common/Inc/settings.h	Sat Feb 23 21:10:51 2019 +0100
@@ -66,9 +66,6 @@
 #define DDMMYY 1
 #define YYMMDD 2
 
-#define LICENCEBONEX 0xFE
-
-
 /*	2015 Jan 30, hw, deco and travel added for MenuEditGas
 	* can be used for buehlmann, vpm, etc. later but be carefull
 	*	with current implemenation */
--- a/Discovery/Inc/bonexConnect.h	Tue Feb 19 21:48:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-/// -*- coding: UTF-8 -*-
-///
-/// \file   Discovery/Inc/bonexConnect.h
-/// \brief  connect to bluetooth LTE of BonexInfoSystem
-/// \author heinrichs weikamp gmbh
-/// \date   29-Sept-2015
-///
-/// $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 BONEX_CONNECT_H
-#define BONEX_CONNECT_H
-
-#include "stm32f4xx_hal.h"
-
-enum
-{
-	BC_DISCONNECTED 	= 0,
-	BC_SEARCHING 			= 1,
-	BC_CONNECTED 			= 2,
-};
-
-enum
-{
-	BONEX_OK = 0,		//= HAL_OK
-	BONEX_BUS_ERROR 	= (uint8_t)HAL_ERROR,
-	BONEX_BUS_BUSY 		= (uint8_t)HAL_BUSY,
-	BONEX_BUS_TIMEOUT = (uint8_t)HAL_TIMEOUT,
-	BONEX_NOTFOUND,
-	BONEX_TYPEMISMATCH,
-	BONEX_TIMEOUT,
-	BONEX_BUSY,
-	BONEX_NOCONNECT,
-};
-
-void bonexControl(void);
-void bC_setConnectRequest(void);
-uint8_t bC_getName(char *name);
-uint8_t bC_getStatus(void);
-uint8_t bC_getData(float *watt, float *temperature, uint16_t *drehzahl, uint8_t *residualcapacity);
-
-#endif // BONEX_CONNECT_H
--- a/Discovery/Inc/bonex_mini.h	Tue Feb 19 21:48:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-/// -*- coding: UTF-8 -*-
-///
-/// \file   Discovery/Inc/bonex_mini.h
-/// \brief  voltage to battery percentage
-/// \author heinrichs weikamp gmbh
-/// \date   26-March-2017
-///
-/// $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/>.
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BONEX_MINI_H
-#define BONEX_MINI_H
-
-#include "stdio.h"
-#include "stm32f4xx_hal.h"
-
-
-void BONEX_calc_new_ResidualCapacity(uint8_t * residualC, uint32_t voltage_mV, int32_t current_mA, uint8_t scooterType);
-uint8_t BONEX_mini_ResidualCapacityVoltageBased(float voltage_V, uint16_t ageInMilliSecondsSinceLast);
-
-#endif // BONEX_MINI_H
--- a/Discovery/Inc/data_exchange_main.h	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Inc/data_exchange_main.h	Sat Feb 23 21:10:51 2019 +0100
@@ -48,8 +48,7 @@
 uint32_t DataEX_lost_connection_count(void);
 void DataEX_control_connection_while_asking_for_sleep(void);
 uint8_t DataEX_check_RTE_version__needs_update(void);
-uint8_t DataEX_scooterFoundAndValidLicence(void);
-uint8_t DataEX_scooterDataFound(void);
+
 
 SDataReceiveFromMaster * dataOutGetPointer(void);
 
--- a/Discovery/Inc/tHome.h	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Inc/tHome.h	Sat Feb 23 21:10:51 2019 +0100
@@ -67,7 +67,6 @@
 		CVIEW_EADTime,
 		CVIEW_Gaslist,
 		CVIEW_sensors_mV,
-		CVIEW_Scooter,
 		CVIEW_Hello,
 		CVIEW_CompassDebug,
 		CVIEW_SummaryOfLeftCorner,
@@ -133,7 +132,6 @@
 
 float t3_basics_lines_depth_and_divetime(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode);
 void t3_basics_battery_low_customview_extra(GFX_DrawCfgWindow* tXc1);
-void t3_basics_battery_scooter_customview_extra(GFX_DrawCfgWindow* tXc1);
 void t3_basics_show_customview_warnings(GFX_DrawCfgWindow* tXc1);
 void t3_basics_refresh_customview(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode);
 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode);
--- a/Discovery/Inc/tMenuEditHardware.h	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Inc/tMenuEditHardware.h	Sat Feb 23 21:10:51 2019 +0100
@@ -39,6 +39,5 @@
 void refresh_O2Sensors(void);
 void refresh_CompassEdit(void);
 void refresh_ButtonValuesFromPIC(void);
-//void refresh_ScooterControl(void);
 
 #endif /* TMENU_EDIT_HARDWARE_H */
--- a/Discovery/Inc/tStructure.h	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Inc/tStructure.h	Sat Feb 23 21:10:51 2019 +0100
@@ -256,10 +256,6 @@
 #define StMHARD5_ButtonBalance2	_MB(2,7,5,3,0)
 #define StMHARD5_ButtonBalance3	_MB(2,7,5,4,0)
 
-#define StMHARD6_ScooterDrag		_MB(2,7,6,1,0)
-#define StMHARD6_ScooterLoad		_MB(2,7,6,2,0)
-#define StMHARD6_ScooterBatt		_MB(2,7,6,3,0)
-
 //#define StMHARD6_UpdateCPU2_No	_MB(2,7,6,1,0)
 //#define StMHARD6_UpdateCPU2_Yes	_MB(2,7,6,2,0)
 //#define StMHARD6_UpdateCPU2_Now	_MB(2,7,6,3,0)
--- a/Discovery/Inc/text_multilanguage.h	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Inc/text_multilanguage.h	Sat Feb 23 21:10:51 2019 +0100
@@ -260,10 +260,6 @@
 		TXT2BYTE_Friday,
 		TXT2BYTE_Saturday,
 		/* */
-		TXT2BYTE_ScooterRestkapazitaet,
-		TXT2BYTE_ScooterTemperature,
-		TXT2BYTE_ScooterSpeed,
-		/* */
 		TXT2BYTE_Layout,
 		TXT2BYTE_Units,
 		TXT2BYTE_Units_metric,
@@ -291,23 +287,8 @@
 		TXT2BYTE_DecoDataLost,
 		TXT2BYTE_Info,
 		TXT2BYTE_Korrekturwerte,
-		TXT2BYTE_ScooterMonitor,
 		TXT2BYTE_SetBearing,
 		TXT2BYTE_ResetBearing,
-		TXT2BYTE_ScooterSetup,
-		TXT2BYTE_ScooterDrag,
-		TXT2BYTE_ScooterLoad,
-		TXT2BYTE_ScooterD0Apnoe,
-		TXT2BYTE_ScooterD1Scuba,
-		TXT2BYTE_ScooterD2Tech,
-		TXT2BYTE_ScooterD3Heavy,
-		TXT2BYTE_ScooterL0None,
-		TXT2BYTE_ScooterL1Small,
-		TXT2BYTE_ScooterL2Stages,
-		TXT2BYTE_ScooterL3Full,
-		TXT2BYTE_ScooterL4Towing,
-		TXT2BYTE_ScooterBattTyp,
-		TXT2BYTE_ScooterVolt,
 		TXT2BYTE_Sensor,
 		TXT2BYTE_Maintenance,
 		TXT2BYTE_SetBatteryCharge,
--- a/Discovery/Src/base.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/base.c	Sat Feb 23 21:10:51 2019 +0100
@@ -230,7 +230,6 @@
 #include "timer.h"
 #include "logbook_miniLive.h"
 #include "test_vpm.h"
-//#include "bonexConnect.h"
 #include "tDebug.h"
 
 #ifdef DEMOMODE
@@ -402,15 +401,6 @@
     //  settingsGetPointer()->showDebugInfo = 1;
 
     /*
-    if(settingsGetPointer()->scooterControl)
-    {
-         settingsGetPointer()->bluetoothActive = 1;
-         MX_Bluetooth_PowerOn();
-         if(settingsGetPointer()->scooterDeviceAddress[0] != 0)
-            bC_setConnectRequest();
-    }
-    */
-    /*
     if( (hardwareDataGetPointer()->primarySerial == 20+18)
      || (hardwareDataGetPointer()->primarySerial == 20+25)
      || (hardwareDataGetPointer()->primarySerial == 20+27))
@@ -501,18 +491,6 @@
             ext_flash_write_settings();
         }
         deco_loop();
-        /*
-        bonexControl();
-        if(bC_getStatus() == BC_DISCONNECTED)
-        {
-            if(tComm_control())			// will stop while loop if tComm Mode started until exit from UART
-            {
-                createDiveSettings();
-                updateMenu();
-                ext_flash_write_settings();
-            }
-        }
-        */
 
 #ifdef DEBUG_RUNTIME
         translateTime(stateUsed->lifeData.timeBinaryFormat, &Stime);
--- a/Discovery/Src/bonexConnect.c	Tue Feb 19 21:48:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,460 +0,0 @@
-/**
-  ******************************************************************************
-	* @copyright	heinrichs weikamp gmbh
-  * @file    		bonexConnect.c
-  * @author  		heinrichs weikamp gmbh
-	* @date    		29-Sept-2015
-  * @version 		0.2
-  * @since	 		01-Okt-2015
-  * @brief   		connect to bluetooth LTE of BonexInfoSystem
-	* @bug
-	* @warning
-  @verbatim
-  ==============================================================================
-	
-	BLE:
-	first of all:
-	AT+LEROLE=1 // set BLE role of the device to Central
-	it is invisible and does not accept incoming BLE connections
-	
-	then:
-	AT+LESCAN
-	AT+LENAME=<bdaddr> request remote device name over BLE
-	ATD <brad>,TIO Initiate Bluetooth Link (for outgoing connections)
-	
-
-	==============================================================================
-  @endverbatim
-  ******************************************************************************
-  * @attention
-  *
-  * <h2><center>&copy; COPYRIGHT(c) 2015 heinrichs weikamp</center></h2>
-  *
-  ******************************************************************************
-  */
-
-#include "bonexConnect.h"
-
-#ifndef BONEXBLUETOOTH
-void bonexControl(void)
-{
-	return;
-}
-void bC_setConnectRequest(void)
-{
-	return;
-}
-uint8_t bC_getStatus(void)
-{
-	return BC_DISCONNECTED;
-}
-uint8_t bC_getName(char *name)
-{
-	*name = 0;
-	return 0;
-}
-uint8_t bC_getData(float *watt, float *temperature, uint16_t *drehzahl, uint8_t *residualcapacity)
-{
-	*watt = 0;
-	*temperature = 0;
-	*drehzahl = 0;
-	*residualcapacity = 0;
-	
-	return BC_DISCONNECTED;
-}
-
-#else
-
-
-/* Includes ------------------------------------------------------------------*/
-#include "settings.h"
-#include "ostc.h"
-#include "string.h"
-#include "data_central.h"
-
-
-
-	union tempFloat16{
-		uint16_t u16;
-		uint8_t u8[2];
-	} temp;
-
-/* Private function prototypes -----------------------------------------------*/
-void bC_connect(void);
-uint8_t bC_connect_sub_Search(void);
-uint8_t bC_connect_sub_Connect(void);
-void bC_call(void);
-void bC_evaluateData(void);
-
-
-/* Private variables with external access ------------------------------------*/
-uint8_t status = 0;
-uint8_t searchrequest = 0;
-char nameOfScooter[20]; 
-uint8_t dataBuffer[9];
-uint8_t StartListeningToUARTscooter = 1;
-
-float scooterWattstunden = 0;
-float scooterTemperature = 0;
-uint8_t	scooterRestkapazitaet = 0;
-uint16_t	scooterDrehzahl = 0;
-
-/* Exported functions --------------------------------------------------------*/
-
-uint8_t bC_evaluateData(void)
-{
-	for
-	pStateReal->lifeData.wireless_data[i].data[j]
-
-}
-
-
-uint8_t bC_getData(float *watt, float *temperature, uint16_t *drehzahl, uint8_t *residualcapacity)
-{
-	if(watt)
-		*watt = scooterWattstunden;
-	if(temperature)
-		*temperature = scooterTemperature;
-	if(drehzahl)
-		*drehzahl = scooterDrehzahl;
-	if(residualcapacity)
-		*residualcapacity = scooterRestkapazitaet;
-	return status;
-}
-
-uint8_t bC_getStatus(void)
-{
-	return status;
-}
-
-
-void bC_setConnectRequest(void)
-{
-	searchrequest = 1;
-}
-
-
-uint8_t bC_getName(char *name)
-{
-	if(status != BC_CONNECTED)
-		*name = 0;
-	
-	strncpy(name,nameOfScooter,20);
-	name[19] = 0;
-	return strlen(name);
-}
-
-/*
-void bonexControl(void)
-{
-	static uint32_t time = 0;
-
-	if(settingsGetPointer()->scooterControl == 0)
-	{
-		status = BC_DISCONNECTED;
-		time = 0;
-		return;
-	}
-	
-	if(settingsGetPointer()->bluetoothActive == 0)
-	{
-		status = BC_DISCONNECTED;
-		time = 0;
-		return;
-	}
-
-	if(searchrequest)
-	{
-		searchrequest = 0;
-		// maybe we have to disconnect first?
-		bC_connect();
-		StartListeningToUARTscooter = 1;
-		time = 0;
-		return;
-	}
-
-	if(status != BC_CONNECTED)
-	{
-		time = 0;
-		return;
-	}
-
-	if(UartReady == SET)
-	{
-		UartReady = RESET;
-		StartListeningToUARTscooter = 1;
-		bC_evaluateData();
-		return;
-	}
-
-	if(time_elapsed_ms(time, HAL_GetTick()) < 1000)
-	{
-		return;
-	}
-*/
-// test	
-/*
-const char request[4] = {0xA3, 5, 0, 0xA6};
-HAL_UART_Transmit(&UartHandle, (uint8_t*)request, 4, 1000);
-time = HAL_GetTick();
-return;
-*/	
-	if((UartReady == RESET) && StartListeningToUARTscooter)
-	{
-		bC_call();
-		time = HAL_GetTick();
-	}
-}
-
-
-/* Private functions ---------------------------------------------------------*/
-
-void BONEX_to_16bit(uint16_t *dataOutUint16, int16_t *dataOutInt16, uint8_t *dataIn)
-{
-	union tempU16{
-		int16_t i16;
-		uint16_t u16;
-		uint8_t u8[2];
-	} temp;
-	
-	temp.u8[0] = dataIn[0];
-	temp.u8[1] = dataIn[1];
-	
-	if(dataOutUint16)
-		*dataOutUint16 = temp.u16;
-	
-	if(dataOutInt16)
-		*dataOutInt16 = temp.i16;
-}
-
-void bC_evaluateData(void)
-{
-	uint8_t crc = dataBuffer[0];
-	for(int i=1;i<=8;i++)
-		crc ^= dataBuffer[i];
-	
-	if(crc != 0)
-		return;
-
-	uint16_t watt;
-	int16_t temperatureL;
-
-	BONEX_to_16bit(&watt,0, &dataBuffer[1]);	
-	BONEX_to_16bit(0,&temperatureL, &dataBuffer[4]);	
-	BONEX_to_16bit(&scooterDrehzahl,0, &dataBuffer[6]);	
-	
-//	scooterWattstunden = ((float)(dataBuffer[3]))/100;
-//	scooterWattstunden += watt;
-	scooterWattstunden = watt; // neu ohne milliWattSekunden hw 160113
-	scooterRestkapazitaet = dataBuffer[3];
-	scooterTemperature = ((float)(temperatureL))/10;
-
-/*
-	aTxBuffer[0] = uartSendNext;												// 0							UINT8_T
-	BONEX_16to8(&aTxBuffer[1],&WattStunden); 						// 1+2 LSB first	UINT16_T
-	alt: aTxBuffer[3] = (uint8_t)(milliWattSekunden/36000);// 3						UINT8_T
-	neu: aTxBuffer[3] = (uint8_t)(RestKapazitaet);			// 3							UINT8_T
-	BONEX_16to8(&aTxBuffer[4],&TemperaturLStufe);				// 4+5 LSB first 	INT16_T
-	BONEX_16to8(&aTxBuffer[6],&DrehzahlNeu); 						// 6+7 LSB first 	UINT16_T
-	crc																																		UINT8_T
-*/
-}
-
-void bC_call(void)
-{
-	const char request[4] = {0xA3, 1, 0, 0xA2};
-	uint8_t answer = BONEX_OK;
-
-	answer = HAL_UART_Transmit(&UartHandle, (uint8_t*)request, 4, 1000);
-	if(answer != HAL_OK)
-		return;
-
-	StartListeningToUARTscooter = 0;
-	answer = HAL_UART_Receive_IT(&UartHandle, dataBuffer, 9);
-}
-
-
-void bC_connect(void)
-{
-	status = BC_SEARCHING;
-	uint8_t answer = BONEX_OK;
-	
-	answer = BONEX_OK;
-	if(settingsGetPointer()->scooterDeviceAddress[0] == 0)
-	{
-		answer = bC_connect_sub_Search();
-	}
-	
-	if(answer == BONEX_OK)
-	{
-		answer = bC_connect_sub_Connect();
-	}
-	
-	if(answer == BONEX_OK)
-		status = BC_CONNECTED;
-	else
-		status = BC_DISCONNECTED;
-}
-
-
-uint8_t bC_connect_sub_Search(void)
-{
-	uint8_t answer = BONEX_OK;
-	char buffer[256];
-	uint8_t bufferPtr = 0;
-	uint8_t length;
-	uint32_t time;
-	char *startOfBONEXString;
-	char *startOfRemoteDeviceAddress;
-	uint8_t okayNotSend;
-
-	
-	strncpy(buffer,"AT+BINQ\r",256);
-	length = 	strlen(buffer);
-	answer = HAL_UART_Transmit(&UartHandle, (uint8_t*)buffer, length, 1000);
-	time = HAL_GetTick();
-	bufferPtr = 0;
-	okayNotSend = 6;
-	while((time_elapsed_ms(time, HAL_GetTick()) < 20000) && (bufferPtr < 255) && (okayNotSend))
-	{
-		answer = HAL_UART_Receive(&UartHandle, (uint8_t*)&buffer[bufferPtr], 1, 1000);
-		if(answer == HAL_OK)
-		{
-			switch(okayNotSend)
-			{
-				case 1:
-					if(buffer[bufferPtr] == '\n')
-					{
-						okayNotSend = 0;
-						break;
-					}
-				case 2:
-					if(buffer[bufferPtr] == '\r')
-					{
-						okayNotSend = 1;
-						break;
-					}
-				case 3:
-					if(buffer[bufferPtr] == 'K')
-					{
-						okayNotSend = 2;
-						break;
-					}
-				case 4:
-					if(buffer[bufferPtr] == 'O')
-					{
-						okayNotSend = 3;
-						break;
-					}
-				case 5:
-					if(buffer[bufferPtr] == '\n')
-					{
-						okayNotSend = 4;
-						break;
-					}
-				case 6:
-					if(buffer[bufferPtr] == '\r')
-					{
-						okayNotSend = 5;
-						break;
-					}
-				default:
-					okayNotSend = 6;
-					break;
-			}
-			bufferPtr++;
-		}
-	}
-
-	buffer[bufferPtr] = 0; // just for safety of search routines
-	length = bufferPtr;
-	
-	if(length < 1)
-		return BONEX_NOTFOUND;
-	
-	startOfBONEXString = strstr(buffer,"BONEX");
-	
-	if(!startOfBONEXString)
-		return BONEX_NOTFOUND;
-	
-	
-	// copy to scooterDeviceAddress
-	startOfRemoteDeviceAddress = startOfBONEXString - 1;
-	while(startOfRemoteDeviceAddress >= buffer)
-	{
-		if(*startOfRemoteDeviceAddress == '\r')
-			break;
-		startOfRemoteDeviceAddress--;
-	}
-/*
-	startOfBONEXString = 0; // for strrchr
-	
-	startOfRemoteDeviceAddress = strrchr(buffer, '\r');
-*/	
-	// first in list?
-	if(!startOfRemoteDeviceAddress)
-		startOfRemoteDeviceAddress = buffer;
-	else
-	{
-		startOfRemoteDeviceAddress += 1;
-		if(*startOfRemoteDeviceAddress == '\n')
-			startOfRemoteDeviceAddress += 1;
-	}
-	strncpy(settingsGetPointer()->scooterDeviceAddress, startOfRemoteDeviceAddress, 12);
-
-	for(int i=0;i<19;i++)
-	{
-		if((startOfBONEXString[i] == 0) || (startOfBONEXString[i] == '\r'))
-		{
-			settingsGetPointer()->scooterDeviceName[i] = 0;
-			break;
-		}
-		else
-			settingsGetPointer()->scooterDeviceName[i] = startOfBONEXString[i];
-	}
-	return BONEX_OK;
-}
-
-
-uint8_t bC_connect_sub_Connect(void)
-{
-	uint8_t answer = BONEX_OK;
-	char buffer2[256];
-	uint8_t bufferPtr = 0;
-	uint8_t length;
-	uint32_t time;
-
-	strncpy(buffer2,"ATD ",256);
-	length = strlen(buffer2);
-	strncpy(&buffer2[length], settingsGetPointer()->scooterDeviceAddress, 12);
-	length += 12;
-	buffer2[length++] = '\r';
-	buffer2[length++] = 0;
-	answer = HAL_UART_Transmit(&UartHandle, (uint8_t*)buffer2, length, 1000);
-
-	time = HAL_GetTick();
-	bufferPtr = 0;
-	while((time_elapsed_ms(time, HAL_GetTick()) < 5000) && (bufferPtr < 255))
-	{
-		answer = HAL_UART_Receive(&UartHandle, (uint8_t*)&buffer2[bufferPtr], 1, 1000);
-		if(answer == HAL_OK)
-			bufferPtr++;
-	}
-
-	if(bufferPtr < 7)
-		return BONEX_NOTFOUND;
-
-	if(strstr(buffer2,"CONNECT"))
-	{
-		strncpy(nameOfScooter, settingsGetPointer()->scooterDeviceName, 19);
-		nameOfScooter[19] = 0;
-		return BONEX_OK;
-	}
-	else
-		return BONEX_NOCONNECT;
-}
-
-#endif // BONEXBLUETOOTH
-
-
-/************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/
--- a/Discovery/Src/bonex_mini.c	Tue Feb 19 21:48:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,347 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-/// -*- coding: UTF-8 -*-
-///
-/// \file   Discovery/Src/bonex_mini.c
-/// \brief  voltage to battery percentage based on bonex.c for BIS PCB
-/// \author Heinrichs Weikamp gmbh
-/// \date   26-March-2017
-///
-/// \details
-///
-/// $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/>.
-//////////////////////////////////////////////////////////////////////////////
-/*
-  ==============================================================================
-              ##### CAN data #####
-  ==============================================================================
-  [..] 	is stored static in BONEX_CAN_Config
-                see example CAN_Networking for STM32303C_EVAL
-
-  */
-
-/* Includes ------------------------------------------------------------------*/
-#include "bonex_mini.h"
-
-/* Private variables ---------------------------------------------------------*/
-
-enum
-{
-    TYPE_ECOS = 0,
-    TYPE_RS = 1,
-    TYPE_MAX
-};
-
-const uint16_t 	loadVoltageInverted[TYPE_MAX][21] =
-{
-    {	// ECOS
-        0
-    },
-    {	// RS
-        38000,	// 0% >= index *5 ist Ergebnis Kapazit�t
-        38875,	// 5%
-        39750,	// 10%
-        40625,
-        41500,
-        42050,
-        42600,
-        43150,
-        43700,
-        44250,
-        44800,
-        45350,
-        45900,
-        46450,
-        47000,	// 70%
-        47550,	// 75%
-        48100,
-        48450,	// 85%
-        48800,
-        49150,
-        49500,	//100% , index = 20
-    }
-};
-
-
-uint8_t BONEX_mini_ResidualCapacityVoltageBased(float voltage_V, uint16_t ageInMilliSecondsSinceLast)
-{
-    static uint8_t capacityStorage = 0;
-    static uint32_t voltage_mV_storage_32bit = 0;
-    static uint16_t storageCounter = 0;
-
-    uint16_t voltage_mV = (uint16_t)(1000 * voltage_V);
-
-    uint8_t calcNow = 0;
-
-    if(ageInMilliSecondsSinceLast < 2000)
-    {
-        voltage_mV_storage_32bit += voltage_mV;
-        storageCounter++;
-    }
-    else
-    {
-        storageCounter = 0;
-        voltage_mV_storage_32bit = 0;
-    }
-
-
-    if(storageCounter >= 600)
-    {
-        voltage_mV_storage_32bit /= storageCounter;
-        voltage_mV = (uint16_t)voltage_mV_storage_32bit;
-        storageCounter = 1;
-        voltage_mV_storage_32bit = voltage_mV;
-        calcNow = 1;
-    }
-    else if(storageCounter == 1) // value immediately but not called after 600 counter ;-)
-    {
-        voltage_mV = (uint16_t)voltage_mV_storage_32bit;
-        calcNow = 1;
-    }
-
-    if(calcNow)
-    {
-        for(int i = 20; i>=0; i--)
-        {
-            if(voltage_mV >= loadVoltageInverted[1][i])
-            {
-                capacityStorage = i*5;
-                break;
-            }
-        }
-    }
-
-    return capacityStorage;
-}
-
-/*
-
-uint8_t BONEX_mini_ResidualCapacityVoltageBased(float voltage_V, uint16_t ageInMilliSecondsSinceLast)
-{
-    static uint8_t capacityStorage = 0;
-    static uint16_t voltage_mV_storage[5] = {0,0,0,0,0}; // number six is used directly from voltage_mV
-
-    uint32_t voltage_mV = (uint32_t)(1000 * voltage_V);
-
-
-    // if necessary reset container and return actual voltage_V as capacity
-    if(ageInMilliSecondsSinceLast > 2000)
-    {
-        capacityStorage = 0;
-        for(int i = 0; i<5; i++)
-        {
-            voltage_mV_storage[i] = 0;
-        }
-    }
-
-    // find storage container or, if full, use it as number six and recalc voltage_mV based on those six values
-    int ptr = -1;
-    do
-    {
-        ptr++;
-    } while ((ptr < 5) && voltage_mV_storage[ptr] != 0);
-
-    if(ptr ==	5)
-    {
-        for(int i = 0; i<5; i++)
-        {
-            voltage_mV += voltage_mV_storage[i];
-            voltage_mV_storage[i] = 0;
-        }
-        voltage_mV += 3;
-        voltage_mV /= 6;
-        capacityStorage = 0;
-    }
-    else
-    {
-        voltage_mV_storage[ptr] = voltage_mV;
-    }
-
-        // calc result if update necessary
-    if(capacityStorage == 0)
-    {
-        for(int i = 20; i>=0; i--)
-        {
-            if(voltage_mV >= loadVoltageInverted[1][i])
-            {
-                capacityStorage = i*5;
-                break;
-            }
-        }
-    }
-    return capacityStorage;
-}
-
-#define ECOS_VMAX 290
-#define ECOS_VMIN 195
-#define ECOS_STEP 5
-
-#define RS_VMAX 500
-#define RS_VMIN 360
-#define RS_STEP 5
-
-#define ECOS_LENGTH (((ECOS_VMAX - ECOS_VMIN) / ECOS_STEP) + 1)
-#define RS_LENGTH 	(((RS_VMAX - RS_VMIN) / RS_STEP) + 1)
-#define MAX_LENGTH (ECOS_LENGTH>RS_LENGTH? ECOS_LENGTH:RS_LENGTH)
-
-
-typedef struct
-{
-    uint8_t load[3];
-} load;
-
-
-const int32_t 	currentMaxLoad[TYPE_MAX] 			= {  17000,14000};
-const int32_t 	currentPartialLoad[TYPE_MAX] 	= {   1000, 1000};
-const uint16_t 	voltageCharged[TYPE_MAX] 			= {    280,  480};
-const uint16_t 	voltageMax[TYPE_MAX] 					= { ECOS_VMAX, RS_VMAX};
-const uint16_t 	voltageMin[TYPE_MAX] 					= { ECOS_VMIN, RS_VMIN};
-const uint8_t 	voltageSteps[TYPE_MAX] 				= { ECOS_STEP, RS_STEP};
-const uint8_t 	length[TYPE_MAX] 							= { ECOS_LENGTH, RS_LENGTH};
-
-
-
-
-
-const uint8_t 	loadVoltage[TYPE_MAX][MAX_LENGTH][3] =
-{
-    {
-    // ECOS
-    //  no,teil,voll
-        {  0,  5,  0}, // voltageMin 19.5
-        {  0,  5,  0}, // voltageMin +  0.5V
-        {  0,  5,  0}, // 20.5
-        {  5,  5,  5}, // 21
-        {  5,  5,  5}, // 21.5
-        {  5, 10, 10}, // 22
-        {  5, 10, 15}, // 22.5
-        { 10, 15, 30}, // 23
-        { 20, 30, 45}, // 23.5
-        { 30, 40, 60}, // 24
-        { 40, 50, 65}, // 24.5
-        { 50, 60, 75}, // 25
-        { 60, 70, 80}, // 25.5
-        { 70, 80, 85}, // 26
-        { 80, 90, 85}, // 26.5
-        { 85, 90, 90}, // 27
-        { 90, 95, 90}, // 27.5
-        { 95, 95, 95}, // 28
-        {100,100,100}, // 28.5
-        {100,100,100}, // voltageMax 29
-    },
-    {
-    // RS
-    //  no,teil,voll
-        {  0,  0,  0}, // voltageMin 36 V
-        {  2,  0,  2}, // voltageMin +  0.5V
-        {  5,  0,  5}, // 37
-        {  5,  2,  5}, //
-        {  5,  5,  5}, // 38
-        {  5,  5, 10}, //
-        {  5,  5, 15}, // 39
-        {  7,  7, 17}, //
-        { 10, 10, 20}, // 40
-        { 15, 12, 27}, //
-        { 20, 15, 35}, // 41
-        { 27, 22, 42}, //
-        { 35, 30, 50}, // 42
-        { 42, 37, 55}, //
-        { 50, 45, 60}, // 43
-        { 55, 50, 67}, //
-        { 60, 55, 75}, // 44
-        { 67, 57, 80}, //
-        { 75, 60, 85}, // 45
-        { 77, 65, 87}, //
-        { 80, 70, 90}, // 46
-        { 85, 75, 90}, //
-        { 90, 80, 90}, // 47
-        { 92, 85, 92}, //
-        { 95, 90, 95}, // 48
-        { 95, 92, 97}, //
-        { 95, 95,100}, // 49
-        { 97, 97,100}, //
-        {100,100,100} // 50
-    }
-};
-
-
-void BONEX_calc_new_ResidualCapacity(uint8_t *residualC, uint32_t voltage_mV, int32_t current_mA, uint8_t scooterType) // as in BIS
-{
-    uint8_t actualLoad = 0;
-    uint8_t remainder = 0;
-    uint32_t voltagePointer = 0;
-
-    if(voltage_mV == 0)
-        return;
-
-    if(scooterType >= TYPE_MAX)
-        return;
-
-    if(voltage_mV < (voltageMin[scooterType] * 100))
-    {
-        *residualC = 0;
-        return;
-    }
-    else
-    if(voltage_mV >= (voltageMax[scooterType] * 100))
-    {
-        *residualC = 100;
-        return;
-    }
-    else // check if charged and reset residualC for further calculation
-    if(voltage_mV >= (voltageCharged[scooterType] * 100))
-    {
-        *residualC = 100;
-        return;
-    }
-
-    // define the line we are working
-    if(current_mA >= currentMaxLoad[scooterType])
-        actualLoad = 2;
-    else
-    if(current_mA >= currentPartialLoad[scooterType])
-        actualLoad = 1;
-    else
-        actualLoad = 0;
-
-    voltagePointer = (voltage_mV - ((uint32_t)(voltageMin[scooterType])) * 100) / (voltageSteps[scooterType] * 100);
-
-    // should be checked with if(... >= voltageMax) but for safety
-    if(voltagePointer >= length[scooterType])
-    {
-        *residualC = 100;
-        return;
-    }
-
-    if(loadVoltage[scooterType][voltagePointer][actualLoad] < *residualC)
-        *residualC = loadVoltage[scooterType][voltagePointer][actualLoad];
-    else if(loadVoltage[scooterType][voltagePointer][actualLoad] >= (*residualC + 20))
-        *residualC = loadVoltage[scooterType][voltagePointer][actualLoad];
-
-    // steps of 5
-    remainder = (*residualC)%5;
-    if(remainder)
-        *residualC += (5 - remainder);
-
-    // safety
-    if(*residualC > 100)
-        *residualC = 100;
-
-    return;
-}
-*/
-
--- a/Discovery/Src/data_central.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/data_central.c	Sat Feb 23 21:10:51 2019 +0100
@@ -964,21 +964,3 @@
 	else
 		return false;
 }
-
-uint8_t stateUsed_scooterRemainingBattCapacity(void)
-{
-	const uint8_t useCapacityValue = 1; // 2 is the new one, 1 = scooterRestkapazitaetWhBased is the official used
-	
-	switch(useCapacityValue)
-	{
-		case 0:
-		default:
-			return stateUsed->lifeData.scooterRestkapazitaet;
-
-		case 1:
-			return stateUsed->lifeData.scooterRestkapazitaetWhBased;
-			
-		case 2:
-			return stateUsed->lifeData.scooterRestkapazitaetVoltageBased;
-	}		
-}
--- a/Discovery/Src/data_exchange_main.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/data_exchange_main.c	Sat Feb 23 21:10:51 2019 +0100
@@ -71,14 +71,12 @@
 #include "timer.h"
 #include "buehlmann.h"
 #include "externLogbookFlash.h"
-#include "bonex_mini.h" // for voltage to battery percentage
 
 
 /* Expoted variables --------------------------------------------------------*/
 uint8_t	wasPowerOn = 0;
 confirmbit8_Type requestNecessary = { .uw = 0 };
 uint8_t wasUpdateNotPowerOn = 0;
-uint8_t scooterFoundThisPowerOnCylce = 0;
 
 /* Private variables with external access ------------------------------------*/
 
@@ -196,18 +194,6 @@
 	dataOut.footer.checkCode[1] = 0xF3;
 	dataOut.footer.checkCode[2] = 0xF2;
 	dataOut.footer.checkCode[3] = 0xF1;
-
-
-	pStateReal->lifeData.scooterType							= 0xFF;
-	pStateReal->lifeData.scooterWattstunden 			= 0;
-	pStateReal->lifeData.scooterRestkapazitaet 		= 0;
-	pStateReal->lifeData.scooterDrehzahl 					= 0;
-	pStateReal->lifeData.scooterSpannung					= 0;
-	pStateReal->lifeData.scooterTemperature 			= 0;
-	pStateReal->lifeData.scooterAmpere				 		= 0;
-	pStateReal->lifeData.scooterRestkapazitaetWhBased	= 0;
-	pStateReal->lifeData.scooterRestkapazitaetVoltageBased	= 0;
-	pStateReal->lifeData.scooterAgeInMilliSeconds = 0;
 	
 	systick_last = HAL_GetTick() - 100;
 }
@@ -1245,86 +1231,7 @@
 		}
 	}
 */
-	// new: Bonex
-	float scooterSpeedFloat;
-	int32_t scooterRemainingBattCapacity;
 	
-	for(int i=0;i<4;i++)
-	{
-		if((wirelessData[i][0]))// && (wirelessData[i][2]) && (wirelessData[i][2] < 60000))
-		{
-			pStateReal->lifeData.scooterType							= (pStateReal->lifeData.wireless_data[i].data[0] >> 4) & 0x07;
-			pStateReal->lifeData.scooterWattstunden 				= ((uint16_t)((((uint16_t)(pStateReal->lifeData.wireless_data[i].data[0] & 0x0F) << 8) | (pStateReal->lifeData.wireless_data[i].data[1]))));
-//			pStateReal->lifeData.scooterWattstunden 		=  pStateReal->lifeData.wireless_data[i].data[0] & 0x0F;
-//			pStateReal->lifeData.scooterWattstunden			*= 256;
-//			pStateReal->lifeData.scooterWattstunden 		+=  pStateReal->lifeData.wireless_data[i].data[1];
-			pStateReal->lifeData.scooterRestkapazitaet 		= pStateReal->lifeData.wireless_data[i].data[2];
-			pStateReal->lifeData.scooterDrehzahl 					= ((uint16_t)( (int16_t)((pStateReal->lifeData.wireless_data[i].data[4] << 8) | (pStateReal->lifeData.wireless_data[i].data[3]))));
-			pStateReal->lifeData.scooterSpannung					= ((float)(pStateReal->lifeData.wireless_data[i].data[5])) / 5.0f;
-			pStateReal->lifeData.scooterTemperature 			= ((uint16_t)( (int16_t)((pStateReal->lifeData.wireless_data[i].data[7] << 8) | (pStateReal->lifeData.wireless_data[i].data[6]))));
-			pStateReal->lifeData.scooterAmpere				 		= pStateReal->lifeData.wireless_data[i].data[9] >> 1;
-			pStateReal->lifeData.scooterAgeInMilliSeconds = pStateReal->lifeData.wireless_data[i].ageInMilliSeconds;
-
-			if(pStateReal->lifeData.scooterWattstunden > 0)
-				scooterRemainingBattCapacity = settingsGetPointer()->scooterBattSize / pStateReal->lifeData.scooterWattstunden;
-			else
-			scooterRemainingBattCapacity = 100;
-			
-			
-			if(scooterRemainingBattCapacity < 0)
-				scooterRemainingBattCapacity = 0;
-			if(scooterRemainingBattCapacity > 100)
-				scooterRemainingBattCapacity = 100;
-			pStateReal->lifeData.scooterRestkapazitaetWhBased = scooterRemainingBattCapacity;
-
-//			BONEX_calc_new_ResidualCapacity(&pStateReal->lifeData.scooterRestkapazitaetVoltageBased, (uint32_t)(1000 * pStateReal->lifeData.scooterSpannung),1000,1);
-			pStateReal->lifeData.scooterRestkapazitaetVoltageBased = BONEX_mini_ResidualCapacityVoltageBased(pStateReal->lifeData.scooterSpannung, pStateReal->lifeData.scooterAgeInMilliSeconds);	
-
-			scooterSpeedFloat = (float)pStateReal->lifeData.scooterDrehzahl;
-			scooterSpeedFloat /= (37.0f / 1.1f); // 3700 rpm = 110 m/min
-			switch(settingsGetPointer()->scooterDrag)
-			{
-				case 1:
-					scooterSpeedFloat *= 0.95f;
-					break;
-				case 2:
-					scooterSpeedFloat *= 0.85f;
-					break;
-				case 3:
-					scooterSpeedFloat *= 0.75f;
-					break;
-				default:
-					break;
-			}
-			switch(settingsGetPointer()->scooterLoad)
-			{
-				case 1:
-					scooterSpeedFloat *= 0.90f;
-					break;
-				case 2:
-					scooterSpeedFloat *= 0.80f;
-					break;
-				case 3:
-					scooterSpeedFloat *= 0.70f;
-					break;
-				case 4:
-					scooterSpeedFloat *= 0.60f;
-					break;
-				default:
-					break;
-			}
-			if(scooterSpeedFloat < 0)
-				pStateReal->lifeData.scooterSpeed = 0;
-			else
-			if(scooterSpeedFloat > 255)
-				pStateReal->lifeData.scooterSpeed = 255;
-			else
-				pStateReal->lifeData.scooterSpeed = (uint16_t)scooterSpeedFloat;
-			
-			if(!scooterFoundThisPowerOnCylce && (pStateReal->lifeData.scooterAgeInMilliSeconds > 0))
-				scooterFoundThisPowerOnCylce = 1;
-		}
-	}
  
 	/* PIC data
  	 */
@@ -1369,22 +1276,6 @@
 }
 
 
-uint8_t DataEX_scooterDataFound(void)
-{
-	return scooterFoundThisPowerOnCylce;
-}
-
-
-uint8_t DataEX_scooterFoundAndValidLicence(void)
-{
-	if(getLicence() != LICENCEBONEX)
-		return 0;
-	else
-		return scooterFoundThisPowerOnCylce;
-//return 0xFF;
-//return LICENCEBONEX;
-}
-
 	/* Private functions ---------------------------------------------------------*/
 
 /* Check if there is an empty frame providec by RTE (all 0) or even no data provided by RTE (all 0xFF)
--- a/Discovery/Src/settings.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/settings.c	Sat Feb 23 21:10:51 2019 +0100
@@ -55,7 +55,7 @@
 {
     .versionFirst   = 1,
     .versionSecond 	= 4,
-    .versionThird   = 4,
+    .versionThird   = 5,
     .versionBeta    = 1,
 
     /* 4 bytes with trailing 0 */
@@ -1133,20 +1133,6 @@
 /*	uint32_t updateSettingsAllowedFromHeader;
  */
 
-/*	uint8_t scooterControl;
- */
-    if(Settings.scooterControl > 1)
-    {
-        Settings.scooterControl = 1;
-        corrections++;
-    }
-
-/*	char scooterDeviceAddress[12];
- */
-
-/*	char scooterDeviceName[19];
-*/
-
 /*	uint8_t ppo2sensors_deactivated;
  */
     if(Settings.ppo2sensors_deactivated > (1+2+4))
@@ -1327,39 +1313,6 @@
         corrections++;
     }
 
-/*	uint8_t scooterDrag;
- */
-    if(Settings.scooterDrag > 3)
-    {
-        Settings.scooterDrag = 3;
-        corrections++;
-    }
-
-/*	uint8_t scooterLoad;
- */
-    if(Settings.scooterLoad > 4)
-    {
-        Settings.scooterLoad = 4;
-        corrections++;
-    }
-
-/*	uint8_t scooterNumberOfBatteries;
- */
-    if(Settings.scooterNumberOfBatteries > 3)
-    {
-        Settings.scooterNumberOfBatteries = 3;
-        corrections++;
-    }
-
-/*	uint16_t scooterBattSize;
- */
-    if((Settings.scooterBattSize < 300) ||
-         (Settings.scooterBattSize > 5000))
-    {
-        Settings.scooterBattSize = 700;
-        corrections++;
-    }
-
 
 /*	uint8_t lastKnownBatteryPercentage;
  */
@@ -2568,8 +2521,6 @@
 
 uint8_t getLicence(void)
 {
-    //return 0xFF;
-    //return LICENCEBONEX;
     return hardwareDataGetPointer()->primaryLicence;
 }
 
--- a/Discovery/Src/simulation.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/simulation.c	Sat Feb 23 21:10:51 2019 +0100
@@ -148,21 +148,6 @@
     else if(pDiveState->lifeData.depth_meter <= (float)(decom_get_actual_deco_stop(pDiveState) + 0.001))
       sim_reduce_deco_time_one_second(pDiveState);
 
-    if(getLicence() == LICENCEBONEX)
-    {
-        pDiveState->lifeData.scooterType = stateRealGetPointer()->lifeData.scooterType;
-        pDiveState->lifeData.scooterTemperature = stateRealGetPointer()->lifeData.scooterTemperature;
-        pDiveState->lifeData.scooterAgeInMilliSeconds = stateRealGetPointer()->lifeData.scooterAgeInMilliSeconds;
-        pDiveState->lifeData.scooterDrehzahl = stateRealGetPointer()->lifeData.scooterDrehzahl;
-        pDiveState->lifeData.scooterRestkapazitaet = stateRealGetPointer()->lifeData.scooterRestkapazitaet;
-        pDiveState->lifeData.scooterWattstunden = stateRealGetPointer()->lifeData.scooterWattstunden;
-        pDiveState->lifeData.scooterAmpere = stateRealGetPointer()->lifeData.scooterAmpere;
-        pDiveState->lifeData.scooterSpannung = stateRealGetPointer()->lifeData.scooterSpannung;
-        pDiveState->lifeData.scooterSpeed = stateRealGetPointer()->lifeData.scooterSpeed;
-        pDiveState->lifeData.scooterRestkapazitaetWhBased = stateRealGetPointer()->lifeData.scooterRestkapazitaetWhBased;
-        pDiveState->lifeData.scooterRestkapazitaetVoltageBased = stateRealGetPointer()->lifeData.scooterRestkapazitaetVoltageBased;
-    }
-
     pDiveState->lifeData.ppO2Sensor_bar[0] = stateRealGetPointer()->lifeData.ppO2Sensor_bar[0];
     pDiveState->lifeData.ppO2Sensor_bar[1] = stateRealGetPointer()->lifeData.ppO2Sensor_bar[1];
     pDiveState->lifeData.ppO2Sensor_bar[2] = stateRealGetPointer()->lifeData.ppO2Sensor_bar[2];
--- a/Discovery/Src/t3.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/t3.c	Sat Feb 23 21:10:51 2019 +0100
@@ -76,19 +76,6 @@
     CVIEW_T3_END
 };
 
-const uint8_t t3_customviewsScooter[] =
-{
-    CVIEW_Scooter,
-    CVIEW_Compass,
-
-    CVIEW_T3_Decostop,
-    CVIEW_T3_MaxDepth,
-    CVIEW_T3_StopWatch,
-    CVIEW_T3_TTS,
-    CVIEW_T3_ppO2andGas,
-
-    CVIEW_T3_END
-};
 
 const uint8_t *t3_customviews = t3_customviewsStandard;
 
@@ -106,11 +93,6 @@
 	SSettings* pSettings;
 	pSettings = settingsGetPointer();
 
-    if(getLicence() == LICENCEBONEX)
-    {
-        t3_customviews = t3_customviewsScooter;
-    }
-
     t3_selection_customview = t3_customviews[0];
 
     t3screen.FBStartAdress = 0;
@@ -524,45 +506,6 @@
 }
 
 
-void t3_basics_battery_scooter_customview_extra(GFX_DrawCfgWindow* tXc1)
-{
-    char TextC1[256];
-
-    TextC1[0] = '\001';
-    TextC1[1] = '\f';
-    TextC1[2] = '\032';
-    TextC1[3] = '3';
-    TextC1[4] = '1';
-    TextC1[5] = '1';
-    TextC1[6] = '1';
-    TextC1[7] = '1';
-    TextC1[8] = '1';
-    TextC1[9] = '1';
-    TextC1[10] = '1';
-    TextC1[11] = '1';
-    TextC1[12] = '1';
-    TextC1[13] = '1';
-    TextC1[14] = '0';
-    TextC1[15] = 0;
-
-    for(int i=1;i<=10;i++)
-    {
-        if(	stateUsed_scooterRemainingBattCapacity()  > (9 * i))
-            TextC1[i+3] += 1;
-    }
-
-    if(stateUsed_scooterRemainingBattCapacity() < 10)
-        TextC1[2] = '\025';
-
-    if(!warning_count_high_time)
-        TextC1[4] = '2';
-
-    if(stateUsed->lifeData.scooterAgeInMilliSeconds > 1500)
-        TextC1[2] = '\031';
-
-    GFX_write_string(&Batt24,tXc1,TextC1,0);
-}
-
 
 void t3_refresh_customview(float depth)
 {
@@ -683,7 +626,6 @@
 
     // CVIEW_T3_ppO2andGas
     uint8_t oxygen_percentage = 0;
-    float scooterSpeed;
 
     // CVIEW_T3_Temperature
     float temperatureThisCall;
@@ -714,21 +656,6 @@
 
     switch(tX_selection_customview)
     {
-    case CVIEW_Scooter:
-        snprintf(text,TEXTSIZE,"\032\fScooter");
-        GFX_write_string(&FontT42,tXc1,text,0);
-
-        t3_basics_battery_scooter_customview_extra(tXc1);
-
-        scooterSpeed = stateUsed->lifeData.scooterDrehzahl * 80 / 3300;
-
-        snprintf(text,100,"\030\003%.1f",scooterSpeed);
-        if(stateUsed->lifeData.scooterAgeInMilliSeconds > 1500)
-            text[0] = '\031';
-        GFX_write_string(&FontT105,tXc1,text,0);
-        break;
-
-
     case CVIEW_T3_ApnoeSurfaceInfo:
         snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
         GFX_write_string(&FontT42,tXc1,text,0);
--- a/Discovery/Src/t5_gauge.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/t5_gauge.c	Sat Feb 23 21:10:51 2019 +0100
@@ -78,14 +78,6 @@
     CVIEW_T3_END
 };
 
-const uint8_t t5_customviewsScooter[] =
-{
-    CVIEW_Scooter,
-    CVIEW_Compass,
-    CVIEW_T3_MaxDepth,
-    CVIEW_T3_StopWatch,
-    CVIEW_T3_END
-};
 
 const uint8_t *t5_customviews = t5_customviewsStandard;
 
--- a/Discovery/Src/t6_apnea.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/t6_apnea.c	Sat Feb 23 21:10:51 2019 +0100
@@ -308,45 +308,6 @@
 }
 
 
-void t6_battery_scooter_customview_extra(void)
-{
-    char TextC1[256];
-
-    TextC1[0] = '\001';
-    TextC1[1] = '\f';
-    TextC1[2] = '\032';
-    TextC1[3] = '3';
-    TextC1[4] = '1';
-    TextC1[5] = '1';
-    TextC1[6] = '1';
-    TextC1[7] = '1';
-    TextC1[8] = '1';
-    TextC1[9] = '1';
-    TextC1[10] = '1';
-    TextC1[11] = '1';
-    TextC1[12] = '1';
-    TextC1[13] = '1';
-    TextC1[14] = '0';
-    TextC1[15] = 0;
-
-    for(int i=1;i<=10;i++)
-    {
-        if(	stateUsed_scooterRemainingBattCapacity()  > (9 * i))
-            TextC1[i+3] += 1;
-    }
-
-    if(stateUsed_scooterRemainingBattCapacity() < 10)
-        TextC1[2] = '\025';
-
-    if(!warning_count_high_time)
-        TextC1[4] = '2';
-
-    if(stateUsed->lifeData.scooterAgeInMilliSeconds > 1500)
-        TextC1[2] = '\031';
-
-    GFX_write_string(&Batt24,&t6c1,TextC1,0);
-}
-
 
 void t6_change_customview(void)
 {
--- a/Discovery/Src/t7.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/t7.c	Sat Feb 23 21:10:51 2019 +0100
@@ -29,7 +29,6 @@
 /* Includes ------------------------------------------------------------------*/
 #include "t7.h"
 
-//#include "bonexConnect.h"
 #include "data_exchange_main.h"
 #include "decom.h"
 #include "gfx_fonts.h"
@@ -53,7 +52,6 @@
 
 void t7_tissues(const SDiveState * pState);
 void t7_compass(uint16_t ActualHeading, uint16_t UserSetHeading);
-void t7_scooter(void);
 void t7_SummaryOfLeftCorner(void);
 void t7_debug(void);
 
@@ -144,36 +142,6 @@
     CVIEW_END
 };
 
-const uint8_t customviewsDiveScooter[] =
-{
-    CVIEW_Scooter,
-    CVIEW_sensors,
-    CVIEW_Compass,
-    CVIEW_Decolist,
-    CVIEW_Tissues,
-    CVIEW_Profile,
-    CVIEW_Gaslist,
-    CVIEW_sensors_mV,
-    CVIEW_EADTime,
-    CVIEW_SummaryOfLeftCorner,
-    CVIEW_noneOrDebug,
-    CVIEW_END,
-    CVIEW_END
-};
-
-const uint8_t customviewsSurfaceScooter[] =
-{
-//  CVIEW_CompassDebug,
-    CVIEW_Scooter,
-    CVIEW_Hello,
-    CVIEW_sensors,
-    CVIEW_Compass,
-    CVIEW_Tissues,
-    CVIEW_sensors_mV,
-    CVIEW_END,
-    CVIEW_END
-};
-
 const uint8_t *customviewsDive		= customviewsDiveStandard;
 const uint8_t *customviewsSurface	= customviewsSurfaceStandard;
 
@@ -203,13 +171,6 @@
 	SSettings* pSettings;
 	pSettings = settingsGetPointer();
 
-
-    if(getLicence() == LICENCEBONEX)
-    {
-        customviewsDive     = customviewsDiveScooter;
-        customviewsSurface	= customviewsSurfaceScooter;
-    }
-
     selection_custom_field = 1;
     selection_customview = customviewsSurface[0];
 
@@ -632,13 +593,6 @@
             releaseFrame(22,t7screen.FBStartAdress);
             return;
         }
-        else if(DataEX_scooterFoundAndValidLicence()) // new for t9 hw 160711
-        {
-            settingsGetPointer()->design = 9;
-            releaseAllFramesExcept(22,t7screen.FBStartAdress);
-            releaseFrame(22,t7screen.FBStartAdress);
-            return;
-        }
         else
         {
             t7_refresh_divemode();
@@ -757,18 +711,6 @@
     text[3] = 0;
     write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen);
 
-/*
-    // scooter connected?
-    if(bC_getData(0,0,0,0) == BC_CONNECTED)
-    {
-        text[0] = '\f';
-        text[1] = '\002';
-        memcpy(&text[2],&settingsGetPointer()->scooterDeviceName,19);
-        text[21] = 0;
-        GFX_write_string_color(&FontT24,&t7r1,text,0,CLUT_NiceGreen);
-    }
-*/
-
     /* was power on reset */
 //.....
 /* removed hw 160802 in V1.1.1
@@ -1587,11 +1529,6 @@
             }
         } while(cv_disabled);
     }
-
-
-//	if((*pViews == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
-//		pViews++;
-
     selection_customview = *pViews;
 }
 
@@ -1624,11 +1561,6 @@
 	SSettings* pSettings;
 	pSettings = settingsGetPointer();
 
-
-    if((selection_customview == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
-        t7_change_customview();
-    if((selection_customview == CVIEW_Scooter) && (!DataEX_scooterFoundAndValidLicence() && (stateRealGetPointer()->mode == MODE_DIVE)))
-        t7_change_customview();
     if((selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
         t7_change_customview();
     if((selection_customview == CVIEW_sensors_mV) &&(stateUsed->diveSettings.ccrOption == 0))
@@ -1744,12 +1676,6 @@
         }
         break;
 
-    case CVIEW_Scooter:
-        snprintf(text,100,"\032\f\001Scooter");
-        GFX_write_string(&FontT42,&t7cH,text,0);
-        t7_scooter();
-        break;
-
     case CVIEW_Gaslist:
         // a lot of code taken from tMenuGas.c
         // header
@@ -3205,305 +3131,6 @@
 }
 
 
-void t7_scooter(void)
-{
-    float scooterTemperatureLocal;
-    uint16_t scooterSpeedLocal;
-//	uint16_t scooterDrehzhl;
-    uint8_t scooterResidualCapacity;
-//	float scooterVoltage;
-//	uint8_t scooterCurrent;
-    //uint16_t scooterWattHours;
-//	uint16_t bkpX0, bkpX1;
-    uint16_t ageInMilliSeconds;
-
-    uint8_t textSize;
-
-    scooterTemperatureLocal = unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f);
-    scooterSpeedLocal = unit_speed_integer(stateUsed->lifeData.scooterSpeed);
-    scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
-
-//	scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
-//	scooterVoltage = stateUsed->lifeData.scooterSpannung;
-//	scooterCurrent = stateUsed->lifeData.scooterAmpere;
-//	scooterWattHours = stateUsed->lifeData.scooterWattstunden;
-
-    ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
-    if(!ageInMilliSeconds)
-        ageInMilliSeconds = 9999;
-
-    char text[256+60];
-    uint8_t textpointer = 0;
-
-    t7cY0free.WindowLineSpacing = 28 + 48 + 14;
-    t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing;
-    t7cY0free.WindowNumberOfTextLines = 3;
-
-    // header
-//	text[textpointer++] = '\032';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterRestkapazitaet;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterTemperature;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterSpeed;
-    text[textpointer++] = 0;
-    GFX_write_string(&FontT24, &t7cY0free, text, 1);
-
-/*
-    snprintf(text,60,
-                "\032"
-                "%0u" "\016\016 Wh used\017"
-                ,stateUsed->lifeData.scooterWattstunden);
-*/
-
-    GFX_write_string(&FontT24, &t7cY0free, text, 1);
-
-/*
-    snprintf(text,60,
-                "\030"
-                "\n\r"
-                "\n\r"
-                "%0u" "\022\016\016 rpm\017\030"
-                ,stateUsed->lifeData.scooterDrehzahl);
-    GFX_write_string(&FontT24, &t7cY0free, text, 1);
-*/
-    // data
-    t7cY0free.WindowY0 -= 52;
-    if(settingsGetPointer()->nonMetricalSystem == 0)
-    {
-        textSize = snprintf(text,60,
-            "\030"
-            "%0u" "\022\016\016 %%\017\030"
-            "\n\r"
-            "%0.0f\140" "\022\016\016 C\017\030"
-            "\n\r"
-            "%u"  "\022\016\016 m/min\017\030"
-            ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal);
-    }
-    else
-    {
-        textSize = snprintf(text,60,
-            "\030"
-            "%0u" "\022\016\016 %%\017\030"
-            "\n\r"
-            "%0.0f\140" "\022\016\016 Fht\017\030"
-            "\n\r"
-            "%u"  "\022\016\016 ft/min\017\030"
-            ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal);
-    }
-    // connection active
-    if(ageInMilliSeconds > 1500)
-    {
-        for(int i=0; i < textSize -2; i++)
-        {
-            if(text[i] == '\030')
-                text[i] = '\031';
-        }
-    }
-    // write data
-    GFX_write_string(&FontT42, &t7cY0free, text, 1);
-
-    // age stamp
-    if(ageInMilliSeconds < 9999)
-    {
-        t7cY0free.WindowY0 -= 30;
-        snprintf(text,60,
-            "\021\001%u"
-            ,ageInMilliSeconds);
-        GFX_write_string(&FontT24, &t7cY0free, text, 0);
-    }
-}
-
-
-void t7_scooter_May2016_01(void)
-{
-    float scooterTemperature;
-    uint16_t scooterDrehzhl;
-    uint8_t scooterResidualCapacity;
-    float scooterSpeed;
-    float scooterVoltage;
-    uint8_t scooterCurrent;
-//	uint16_t scooterWattHours;
-    uint16_t bkpX0, bkpX1;
-
-    uint16_t ageInMilliSeconds;
-    uint8_t textSize;
-// old	scooterStatus = bC_getData(0,&scooterTemperature,&scooterDrehzhl,&scooterResidualCapacity);
-
-    scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
-    scooterTemperature = ((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f;
-    scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
-
-    scooterVoltage = stateUsed->lifeData.scooterSpannung;
-    scooterCurrent = stateUsed->lifeData.scooterAmpere;
-//	scooterWattHours = stateUsed->lifeData.scooterWattstunden;
-
-    ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
-
-    scooterSpeed = scooterDrehzhl * 80 / 3300;
-
-    char text[256+60];
-
-    t7cY0free.WindowLineSpacing = (28 + 48 + 14)/2;
-    t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 5 * t7cY0free.WindowLineSpacing;
-    t7cY0free.WindowNumberOfTextLines = 6;
-
-    t7cY0free.WindowY0 -= 7;
-
-    bkpX0 = t7cY0free.WindowX0;
-    bkpX1 = t7cY0free.WindowX1;
-    t7cY0free.WindowX0 = 430;
-
-    textSize = snprintf(text,120,
-        "\022\016\016"
-        "%%"
-        "\n\r"
-        "celsius"
-        "\n\r"
-        "rpm"
-        "\n\r"
-        "m/min"
-        "\n\r"
-        "Ampere"
-        "\n\r"
-        "Volt"
-//		"\n\r"
-//		"Wh"
-            );
-    GFX_write_string(&FontT42, &t7cY0free, text, 1);
-
-    t7cY0free.WindowX0 = bkpX0;
-    t7cY0free.WindowX1 = 420;
-
-    textSize = snprintf(text,120,
-        "\030"
-        "\002"
-        "%0u"
-        "\n\r"
-        "\002"
-        "%0.0f"
-        "\n\r"
-        "\002"
-        "%0u"
-        "\n\r"
-        "\002"
-        "%0.0f"
-        "\n\r"
-        "\002"
-        "%0u"
-        "\n\r"
-        "\002"
-        "%0.1f"
-//		"\n\r"
-//		"%0u"  "\022\016\016 Wh\017\030"
-        ,scooterResidualCapacity,scooterTemperature,scooterDrehzhl,scooterSpeed
-        ,scooterCurrent,scooterVoltage);//,scooterWattHours);
-
-    if((ageInMilliSeconds > 1500) || (stateUsed->lifeData.scooterType == 0xFF))
-    {
-        for(int i=0; i < textSize -2; i++)
-        {
-            if(text[i] == '\030')
-                text[i] = '\031';
-        }
-    }
-    GFX_write_string(&FontT42, &t7cY0free, text, 1);
-
-    t7cY0free.WindowX0 = bkpX0;
-    t7cY0free.WindowX1 = bkpX1;
-
-    t7cY0free.WindowY0 -= 30;
-    snprintf(text,60,
-        "\021\001%u"
-        ,ageInMilliSeconds);
-    GFX_write_string(&FontT24, &t7cY0free, text, 0);
-
-}
-
-void t7_scooter_alt(void)
-{
-    float scooterTemperature;
-    uint16_t scooterDrehzhl;
-    uint8_t scooterStatus;
-    uint8_t scooterResidualCapacity;
-    float scooterSpeed;
-    uint16_t ageInMilliSeconds;
-    uint8_t textSize;
-// old	scooterStatus = bC_getData(0,&scooterTemperature,&scooterDrehzhl,&scooterResidualCapacity);
-
-    scooterStatus = 2;//BC_CONNECTED;
-    scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
-    scooterTemperature = ((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f;
-    scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
-    ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
-    if(!ageInMilliSeconds)
-        ageInMilliSeconds = 9999;
-
-    scooterSpeed = scooterDrehzhl * 80 / 3300;
-
-    char text[256+60];
-    uint8_t textpointer = 0;
-
-    //float percent_N2;
-    //float percent_He;
-    //float partial_pressure_N2;
-    //float partial_pressure_He;
-
-    t7cY0free.WindowLineSpacing = 28 + 48 + 14;
-    t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing;
-    t7cY0free.WindowNumberOfTextLines = 3;
-
-    text[textpointer++] = '\032';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterRestkapazitaet;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterTemperature;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterSpeed;
-    text[textpointer++] = 0;
-
-    GFX_write_string(&FontT24, &t7cY0free, text, 1);
-
-    if(scooterStatus == 2)//BC_CONNECTED)
-    {
-        t7cY0free.WindowY0 -= 52;
-        textSize = snprintf(text,60,
-            "\030"
-            "%0u" "\022\016\016 %%\017\030"
-            "\n\r"
-            "%0.0f\140" "\022\016\016 celsius\017\030"
-            "\n\r"
-            "%0.0f"  "\022\016\016 m/min\017\030"
-            ,scooterResidualCapacity,scooterTemperature,scooterSpeed);
-
-        if(ageInMilliSeconds > 1500)
-        {
-            for(int i=0; i < textSize -2; i++)
-            {
-                if(text[i] == '\030')
-                    text[i] = '\031';
-            }
-        }
-//		snprintf(text,60,"\031%0.2f\n\r%0.2f\n\r%u",scooterWatt,scooterTemperature,scooterDrehzhl);
-        GFX_write_string(&FontT42, &t7cY0free, text, 1);
-
-        t7cY0free.WindowY0 -= 30;
-        snprintf(text,60,
-            "\021\001%u"
-            ,ageInMilliSeconds);
-        GFX_write_string(&FontT24, &t7cY0free, text, 0);
-
-    }
-}
 
 
 /*
--- a/Discovery/Src/t9.c	Tue Feb 19 21:48:32 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2508 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-/// -*- coding: UTF-8 -*-
-///
-/// \file   Discovery/Src/t9.c
-/// \brief  Template for screen with 4+1+4 screen layout with plugin
-/// \author Heinrichs Weikamp gmbh
-/// \date   23-April-2014
-///
-/// \details
-/// Bonex t9 -> sp�ter auch andere Pro Anzeigen
-/// Nur Tauchmodus, sonst Umschaltung t7
-/// frames used 26 for compass laufband und 23 f�r t9screen
-///
-/// $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/>.
-//////////////////////////////////////////////////////////////////////////////
-
-/* Includes ------------------------------------------------------------------*/
-#include "t9.h"
-
-#include "data_exchange_main.h"
-#include "decom.h"
-#include "gfx_fonts.h"
-#include "logbook_miniLive.h"
-#include "math.h"
-#include "tHome.h"
-#include "simulation.h"
-#include "timer.h"
-#include "unit.h"
-
-/* Private function prototypes -----------------------------------------------*/
-
-void t9_refresh_divemode(void);
-void t9_refresh_divemode_userselected_left_lower_corner(void);
-void t9_refresh_customview(void);
-
-void t9_draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide);
-
-void t9_tissues(const SDiveState * pState);
-void t9_compass(uint16_t ActualHeading, uint16_t UserSetHeading);
-void t9_scooter(void);
-void t9_debug(void);
-void t9_SummaryOfLeftCorner(void);
-
-void t9_miniLiveLogProfile(void);
-void t9_colorscheme_mod(char *text);
-
-uint8_t t9_test_customview_warnings(void);
-void t9_show_customview_warnings(void);
-
-void t9_show_customview_warnings_surface_mode(void);
-
-uint8_t t9_customtextPrepare(char * text);
-
-/* Importend function prototypes ---------------------------------------------*/
-extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
-
-/* Exported variables --------------------------------------------------------*/
-
-/* Private variables ---------------------------------------------------------*/
-float t9_depthLastCall[9] = { 0,0,0,0,0,0,0,0,0};
-uint8_t idt9_depthLastCall = 0;
-float t9_temperatureLastCall[3] = { 0,0,0};
-uint8_t idt9_temperatureLastCall = 0;
-
-GFX_DrawCfgScreen	t9screen;
-GFX_DrawCfgScreen	t9screenCompass;
-
-/* left 3 fields
- * right 3 fields
- * centered one field on top of customview, one below
- * customview header + customview + warning
- */
-GFX_DrawCfgWindow	t9l1, t9l2, t9l3, t9l4;
-GFX_DrawCfgWindow	t9r1, t9r2, t9r3, t9r4;
-GFX_DrawCfgWindow	t9c1, t9batt, t9c2, t9charge;
-GFX_DrawCfgWindow	t9cH, t9cC, t9cW, t9cY0free;
-GFX_DrawCfgWindow	t9pCompass;
-GFX_DrawCfgWindow	t9surfaceL, t9surfaceR;
-
-uint8_t t9_selection_custom_field = 0;
-uint8_t t9_selection_customview = 1;
-
-typedef struct{
-    uint32_t pointer;
-    uint32_t x0;
-    uint32_t y0;
-    uint32_t width;
-    uint32_t height;
-} S9Background;
-
-S9Background t9_background =
-{
-    .pointer = 0,
-};
-
-/* Private types -------------------------------------------------------------*/
-const uint8_t t9_customviewsDiveStandard[] =
-{
-    CVIEW_sensors,
-    CVIEW_Compass,
-    CVIEW_Decolist,
-    CVIEW_Tissues,
-    CVIEW_Profile,
-    CVIEW_Gaslist,
-    CVIEW_sensors_mV,
-    CVIEW_EADTime,
-//  CVIEW_SummaryOfLeftCorner, da hier der scooter drin ist
-    CVIEW_noneOrDebug,
-    CVIEW_END,
-    CVIEW_END
-};
-
-const uint8_t t9_customviewsDiveScooter[] =
-{
-    CVIEW_Scooter,
-    CVIEW_sensors,
-    CVIEW_Compass,
-    CVIEW_Decolist,
-    CVIEW_Tissues,
-    CVIEW_Profile,
-    CVIEW_Gaslist,
-    CVIEW_sensors_mV,
-    CVIEW_EADTime,
-    CVIEW_SummaryOfLeftCorner,
-    CVIEW_noneOrDebug,
-    CVIEW_END,
-    CVIEW_END
-};
-
-
-const uint8_t *t9_customviewsDive		= t9_customviewsDiveStandard;
-
-#define TEXTSIZE 16
-/* offset includes line: 2 = line +1
- * box (line) is 300 px
- * inside is 296 px
- * left of box are 249 px ( 0..248)
- * right of box are 249 px (551 .. 799)
- */
-
-#define CUSTOMBOX_LINE_LEFT (250)
-#define CUSTOMBOX_LINE_RIGHT (549)
-#define CUSTOMBOX_INSIDE_OFFSET (2)
-#define CUSTOMBOX_OUTSIDE_OFFSET (2)
-#define CUSTOMBOX_SPACE_INSIDE (CUSTOMBOX_LINE_RIGHT + 1 - (CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + CUSTOMBOX_INSIDE_OFFSET))
-
-
-/* Exported functions --------------------------------------------------------*/
-
-void t9_init(void)
-{
-    if(getLicence() == LICENCEBONEX)
-    {
-        t9_customviewsDive			= t9_customviewsDiveScooter;
-    }
-
-    t9_selection_custom_field = 0; // 0 is the new scooter temperature
-    t9_selection_customview = t9_customviewsDive[0];
-
-    t9screen.FBStartAdress = 0;
-    t9screen.ImageHeight = 480;
-    t9screen.ImageWidth = 800;
-    t9screen.LayerIndex = 1;
-
-    t9screenCompass.FBStartAdress = 0;
-    t9screenCompass.ImageHeight = 240;
-    t9screenCompass.ImageWidth = 1600;
-    t9screenCompass.LayerIndex = 0;
-
-    t9l1.Image = &t9screen;
-    t9l1.WindowNumberOfTextLines = 2;
-    t9l1.WindowLineSpacing = 5; // Abstand von Y0
-    t9l1.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster
-    t9l1.WindowX0 = 0;
-    t9l1.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET;
-    t9l1.WindowY1 = 479;
-    t9l1.WindowY0 = t9l1.WindowY1 - 119;
-
-    t9l2.Image = &t9screen;
-    t9l2.WindowNumberOfTextLines = 2;
-    t9l2.WindowLineSpacing = 5; // Abstand von Y0
-    t9l2.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster
-    t9l2.WindowX0 = 0;
-    t9l2.WindowX1 = t9l1.WindowX1;
-    t9l2.WindowY1 = t9l1.WindowY0 - 4;
-    t9l2.WindowY0 = t9l2.WindowY1 - 119;
-
-    t9l3.Image = &t9screen;
-    t9l3.WindowNumberOfTextLines = 2;
-    t9l3.WindowLineSpacing = 5; // Abstand von Y0
-    t9l3.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster
-    t9l3.WindowX0 = 0;
-    t9l3.WindowX1 = t9l1.WindowX1;
-    t9l3.WindowY1 = t9l2.WindowY0 - 4;
-    t9l3.WindowY0 = t9l3.WindowY1 - 119;
-
-    t9l4.Image = &t9screen;
-    t9l4.WindowNumberOfTextLines = 2;
-    t9l4.WindowLineSpacing = 50; // Abstand von Y0
-    t9l4.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster
-    t9l4.WindowX0 = 0;
-    t9l4.WindowX1 = t9l1.WindowX1;
-    t9l4.WindowY1 = t9l3.WindowY0 - 4;
-    t9l4.WindowY0 = 0;
-
-    t9r1.Image = &t9screen;
-    t9r1.WindowNumberOfTextLines = 2;
-    t9r1.WindowLineSpacing = t9l1.WindowLineSpacing;
-    t9r1.WindowTab = 100;
-    t9r1.WindowX0 = 550;
-    t9r1.WindowX1 = 799;
-    t9r1.WindowY0 = t9l1.WindowY0;
-    t9r1.WindowY1 = 479;
-
-    t9r2.Image = &t9screen;
-    t9r2.WindowNumberOfTextLines = 2;
-    t9r2.WindowLineSpacing = t9l2.WindowLineSpacing;
-    t9r2.WindowTab = 100;
-    t9r2.WindowX0 = 550;
-    t9r2.WindowX1 = 799;
-    t9r2.WindowY0 = t9l2.WindowY0;
-    t9r2.WindowY1 = t9l2.WindowY1;
-
-    t9r3.Image = &t9screen;
-    t9r3.WindowNumberOfTextLines = 2;
-    t9r3.WindowLineSpacing = t9l3.WindowLineSpacing;
-    t9r3.WindowTab = 100;
-    t9r3.WindowX0 = 550;
-    t9r3.WindowX1 = 799;
-    t9r3.WindowY0 = t9l3.WindowY0;
-    t9r3.WindowY1 = t9l3.WindowY1;
-
-    t9r4.Image = &t9screen;
-    t9r4.WindowNumberOfTextLines = 2;
-    t9r4.WindowLineSpacing = t9l4.WindowLineSpacing;
-    t9r4.WindowTab = 100;
-    t9r4.WindowX0 = 550;
-    t9r4.WindowX1 = 799;
-    t9r4.WindowY0 = t9l4.WindowY0;
-    t9r4.WindowY1 = t9l4.WindowY1;
-
-
-/*
-    t9r3.Image = &t9screen;
-    t9r3.WindowNumberOfTextLines = 2;
-    t9r3.WindowLineSpacing = 0;//t9l3.WindowLineSpacing;
-    t9r3.WindowTab = 100;
-    t9r3.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET;
-    t9r3.WindowX1 = 799;
-    t9r3.WindowY0 = t9l3.WindowY0;
-    t9r3.WindowY1 = t9l3.WindowY1;
-*/
-    t9cC.Image = &t9screen;
-    t9cC.WindowNumberOfTextLines = 3;
-    t9cC.WindowLineSpacing = 95; // Abstand von Y0
-    t9cC.WindowTab = 100;
-    t9cC.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    t9cC.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
-    t9cC.WindowY0 = 90;
-    t9cC.WindowY1 = 434 - 95;
-
-    t9cH.Image = &t9screen;
-    t9cH.WindowNumberOfTextLines = 1;
-    t9cH.WindowLineSpacing = 95; // Abstand von Y0
-    t9cH.WindowTab = 100;
-    t9cH.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    t9cH.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
-    t9cH.WindowY0 = 434 - 94;
-    t9cH.WindowY1 = 434;
-
-    t9cW.Image = &t9screen;
-    t9cW.WindowNumberOfTextLines = 3;
-    t9cW.WindowLineSpacing = 95; // Abstand von Y0
-    t9cW.WindowTab = 100;
-    t9cW.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    t9cW.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
-    t9cW.WindowY0 = 90;
-    t9cW.WindowY1 = 434 - 95;
-
-    t9cY0free.Image = &t9screen;
-    t9cY0free.WindowNumberOfTextLines = 1;
-    t9cY0free.WindowLineSpacing = 95;
-    t9cY0free.WindowTab = 100;
-    t9cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    t9cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
-    t9cY0free.WindowY0 = 90;
-    t9cY0free.WindowY1 = 434 - 95;
-
-    t9batt.Image = &t9screen;
-    t9batt.WindowNumberOfTextLines = 1;
-    t9batt.WindowLineSpacing = 10;
-    t9batt.WindowTab = 100;
-    t9batt.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
-    t9batt.WindowX0 = t9batt.WindowX1 - (52+52);
-    t9batt.WindowY1 = 479;
-    t9batt.WindowY0 = t9batt.WindowY1 - 25;
-
-    t9charge.Image = &t9screen;
-    t9charge.WindowNumberOfTextLines = 1;
-    t9charge.WindowLineSpacing = 10;
-    t9charge.WindowTab = 100;
-    t9charge.WindowX1 = t9batt.WindowX1 - 18;
-    t9charge.WindowX0 = t9charge.WindowX1 - 14;
-    t9charge.WindowY1 = 479;
-    t9charge.WindowY0 = t9batt.WindowY1 - 25;
-
-    t9c1.Image = &t9screen;
-    t9c1.WindowNumberOfTextLines = 1;
-    t9c1.WindowLineSpacing = 10;
-    t9c1.WindowTab = 100;
-    t9c1.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    t9c1.WindowX1 = t9batt.WindowX0 - 18;
-    t9c1.WindowY0 = 435;
-    t9c1.WindowY1 = 479;
-
-    t9c2.Image = &t9screen;
-    t9c2.WindowNumberOfTextLines = 1;
-    t9c2.WindowLineSpacing = 0; // Abstand von Y0
-    t9c2.WindowTab = 100;
-    t9c2.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    t9c2.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
-    t9c2.WindowY0 = 0;
-    t9c2.WindowY1 = 69;
-
-    t9pCompass.Image = &t9screenCompass;
-    t9pCompass.WindowNumberOfTextLines = 1;
-    t9pCompass.WindowLineSpacing = 100; // Abstand von Y0
-    t9pCompass.WindowTab = 100;
-    t9pCompass.WindowX0 = 0;
-    t9pCompass.WindowX1 = 1600-1;
-    t9pCompass.WindowY0 = 0;
-    t9pCompass.WindowY1 = 100-1;
-
-    init_t9_compass();
-}
-
-uint8_t t9_test_customview_warnings(void)
-{
-    uint8_t count = 0;
-
-    count = 0;
-    count += stateUsed->warnings.decoMissed;
-    count += stateUsed->warnings.ppO2Low;
-    count += stateUsed->warnings.ppO2High;
-    //count += stateUsed->warnings.lowBattery;
-    count += stateUsed->warnings.sensorLinkLost;
-    count += stateUsed->warnings.fallback;
-    return count;
-}
-
-void t9_refresh(void)
-{
-    static uint8_t last_mode = MODE_SURFACE;
-
-    SStateList status;
-    get_globalStateList(&status);
-
-    if(stateUsed->mode != MODE_DIVE)
-    {
-        last_mode = MODE_SURFACE;
-        settingsGetPointer()->design = 7;
-        if(t9screen.FBStartAdress)
-        {
-            releaseFrame(23,t9screen.FBStartAdress);
-            t9screen.FBStartAdress = 0;
-        }
-        return;
-    }
-
-    if(status.base != BaseHome)
-        return;
-
-    t9screen.FBStartAdress = getFrame(23);
-    t9_background.pointer = 0;
-
-    if(stateUsed->mode == MODE_DIVE)
-    {
-        if(last_mode != MODE_DIVE)
-        {
-            last_mode = MODE_DIVE;
-            /* lower left corner primary */
-//			t9_selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
-            t9_selection_custom_field = 0;
-            /* custom view primary OR debug if automatic return is off */
-            if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo))
-                t9_selection_customview = CVIEW_noneOrDebug;
-            else
-                t9_selection_customview = settingsGetPointer()->tX_customViewPrimary;
-        }
-
-        if(status.page == PageSurface)
-            set_globalState(StD);
-
-        t9_refresh_divemode();
-    }
-
-    if(t9_background.pointer)
-    {
-        GFX_SetFrameTop(t9screen.FBStartAdress);
-        GFX_SetFrameBottom(t9_background.pointer,t9_background.x0 , t9_background.y0, t9_background.width, t9_background.height);
-    }
-    else
-        GFX_SetFramesTopBottom(t9screen.FBStartAdress, NULL,480);
-
-    releaseAllFramesExcept(23,t9screen.FBStartAdress);
-}
-
-
-void original_t9_refresh(void)
-{
-    static uint8_t last_mode = MODE_SURFACE;
-
-//	uint32_t oldScreen;//, oldPlugin;
-    SStateList status;
-    get_globalStateList(&status);
-
-
-    if(stateUsed->mode == MODE_DIVE)
-    {
-        if(last_mode != MODE_DIVE)
-        {
-            last_mode = MODE_DIVE;
-            /* lower left corner primary */
-            t9_selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
-            /* custom view primary OR debug if automatic return is off */
-            if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo))
-                t9_selection_customview = CVIEW_noneOrDebug;
-            else
-                t9_selection_customview = settingsGetPointer()->tX_customViewPrimary;
-        }
-        if(status.page == PageSurface)
-            set_globalState(StD);
-
-        t9_refresh_divemode();
-    }
-    else
-    {
-        if(last_mode != MODE_SURFACE)
-        {
-            last_mode = MODE_SURFACE;
-// CHANGE HERE
-        }
-        if(status.page == PageDive)
-            set_globalState(StS);
-    }
-
-    if(status.base == BaseHome)
-    {
-        if(t9_background.pointer)
-        {
-            GFX_SetFrameTop(t9screen.FBStartAdress);
-            GFX_SetFrameBottom(t9_background.pointer,t9_background.x0 , t9_background.y0, t9_background.width, t9_background.height);
-        }
-        else
-            GFX_SetFramesTopBottom(t9screen.FBStartAdress, NULL,480);
-    }
-
-    releaseAllFramesExcept(23,t9screen.FBStartAdress);
-}
-
-/* Private functions ---------------------------------------------------------*/
-
-
-void t9_show_customview_warnings(void)
-{
-    char text[256];
-    uint8_t textpointer, lineFree;
-
-    text[0] = '\025';
-    text[1] = '\f';
-    text[2] = '\001';
-    text[3] = TXT_Warning;
-    text[4] = 0;
-    GFX_write_string(&FontT42,&t9cH,text,0);
-
-    textpointer = 0;
-    lineFree = 5;
-
-    if(lineFree && stateUsed->warnings.decoMissed)
-    {
-        text[textpointer++] = TXT_2BYTE;
-        text[textpointer++] = TXT2BYTE_WarnDecoMissed;
-        text[textpointer++] = '\n';
-        text[textpointer++] = '\r';
-        text[textpointer] = 0;
-        lineFree--;
-    }
-
-    if(lineFree && stateUsed->warnings.fallback)
-    {
-        text[textpointer++] = TXT_2BYTE;
-        text[textpointer++] = TXT2BYTE_WarnFallback;
-        text[textpointer++] = '\n';
-        text[textpointer++] = '\r';
-        text[textpointer] = 0;
-        lineFree--;
-    }
-
-    if(lineFree && stateUsed->warnings.ppO2Low)
-    {
-        text[textpointer++] = TXT_2BYTE;
-        text[textpointer++] = TXT2BYTE_WarnPPO2Low;
-        text[textpointer++] = '\n';
-        text[textpointer++] = '\r';
-        text[textpointer] = 0;
-        lineFree--;
-    }
-
-    if(lineFree && stateUsed->warnings.ppO2High)
-    {
-        text[textpointer++] = TXT_2BYTE;
-        text[textpointer++] = TXT2BYTE_WarnPPO2High;
-        text[textpointer++] = '\n';
-        text[textpointer++] = '\r';
-        text[textpointer] = 0;
-        lineFree--;
-    }
-
-    if(lineFree && stateUsed->warnings.sensorLinkLost)
-    {
-        text[textpointer++] = TXT_2BYTE;
-        text[textpointer++] = TXT2BYTE_WarnSensorLinkLost;
-        text[textpointer++] = '\n';
-        text[textpointer++] = '\r';
-        text[textpointer] = 0;
-        lineFree--;
-    }
-/*
-    if(lineFree && stateUsed->warnings.lowBattery)
-    {
-        text[textpointer++] = TXT_2BYTE;
-        text[textpointer++] = TXT2BYTE_WarnBatteryLow;
-        text[textpointer++] = '\n';
-        text[textpointer++] = '\r';
-        text[textpointer] = 0;
-        lineFree--;
-    }
-*/
-    GFX_write_string(&FontT48,&t9cW,text,1);
-}
-
-
-void t9_set_customview_to_primary(void)
-{
-    if(stateUsed->mode == MODE_DIVE)
-            t9_selection_customview = settingsGetPointer()->tX_customViewPrimary;
-}
-
-
-void t9_change_customview(void)
-{
-    const uint8_t *pViews;
-
-    if(stateUsed->mode == MODE_DIVE)
-    {
-        pViews = t9_customviewsDive;
-        while((*pViews != CVIEW_END) && (*pViews != t9_selection_customview))
-        	{pViews++;}
-
-		if(*pViews < CVIEW_END)
-			pViews++;
-		else
-		{
-			if(stateUsed->mode == MODE_DIVE)
-				pViews = t9_customviewsDive;
-		}
-		 t9_selection_customview = *pViews;
-    }
-    else
-    {
-    	t9_selection_customview = 0;
-    }
-//	if((*pViews == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
-//		pViews++;
-
-
-}
-
-
-uint8_t t9_get_length_of_customtext(void)
-{
-    uint8_t i = 0;
-    settingsGetPointer()->customtext[60-1] = 0;
-    while(settingsGetPointer()->customtext[i] > 0)
-        i++;
-    return i;
-}
-
-
-void t9_refresh_customview(void)
-{
-    if((t9_selection_customview == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
-        t9_change_customview();
-    if((t9_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
-        t9_change_customview();
-    if((t9_selection_customview == CVIEW_sensors_mV) &&(stateUsed->diveSettings.ccrOption == 0))
-        t9_change_customview();
-    if((t9_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
-        t9_change_customview();
-
-    char text[256];
-    uint16_t textpointer = 0;
-    int16_t start;
-//	int16_t shiftWindowY0;
-    RTC_DateTypeDef Sdate;
-    RTC_TimeTypeDef Stime;
-    float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; // CVIEW_Gaslist
-    const SGasLine * pGasLine; // CVIEW_Gaslist
-    uint8_t oxygen, helium; // CVIEW_Gaslist
-    float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime
-
-    switch(t9_selection_customview)
-    {
-    case CVIEW_noneOrDebug:
-        if(settingsGetPointer()->showDebugInfo)
-        {
-            // header
-            strcpy(text,"\032\f\001Debug");
-            GFX_write_string(&FontT42,&t9cH,text,0);
-            // content
-            t9_debug();
-        }
-    break;
-    case CVIEW_SummaryOfLeftCorner:
-        snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Summary);
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        // content
-        t9_SummaryOfLeftCorner();
-    break;
-    case CVIEW_Scooter:
-        snprintf(text,100,"\032\f\001Scooter");
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        t9_scooter();
-    break;
-    case CVIEW_Gaslist:
-        // a lot of code taken from tMenuGas.c
-        // header
-        snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Gaslist);
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        // content
-        textpointer = 0;
-        t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
-        t9cY0free.WindowLineSpacing = 48+9;
-        t9cY0free.WindowNumberOfTextLines = 5; // NUM_GASES == 5
-        t9cY0free.WindowTab = 420;
-
-        pGasLine = settingsGetPointer()->gas;
-        if(actualLeftMaxDepth(stateUsed))
-            fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100;
-        else
-            fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100;
-        fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100;
-        for(int gasId=1;gasId<=NUM_GASES;gasId++)
-        {
-            textpointer = 0;
-            fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100;
-            if(pGasLine[gasId].note.ub.active == 0)
-                strcpy(&text[textpointer++],"\021");
-            else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow))
-                strcpy(&text[textpointer++],"\025");
-            else
-                strcpy(&text[textpointer++],"\030");
-
-            text[textpointer++] = ' ';
-            oxygen = pGasLine[gasId].oxygen_percentage;
-            helium = pGasLine[gasId].helium_percentage;
-            textpointer += write_gas(&text[textpointer], oxygen, helium);
-            // Wechseltiefe
-            if(pGasLine[gasId].depth_meter)
-            {
-
-            }
-            GFX_write_string(&FontT42, &t9cY0free, text, gasId);
-        }
-    break;
-    case CVIEW_EADTime:
-        snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Info );
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        textpointer = 0;
-
-        t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
-        t9cY0free.WindowLineSpacing = 48;
-        t9cY0free.WindowNumberOfTextLines = 6;
-
-    // time
-        snprintf(text,100,"\032\001%c%c",TXT_2BYTE,TXT2BYTE_Clock );
-        GFX_write_string(&FontT42, &t9cY0free, text, 1);
-
-        translateDate(stateRealGetPointer()->lifeData.dateBinaryFormat, &Sdate);
-        translateTime(stateRealGetPointer()->lifeData.timeBinaryFormat, &Stime);
-        if(Stime.Seconds % 2)
-            textpointer += snprintf(&text[textpointer],100,"\030\001%02d:%02d",Stime.Hours,Stime.Minutes);
-        else
-            textpointer += snprintf(&text[textpointer],100,"\030\001%02d\031:\030%02d",Stime.Hours,Stime.Minutes);
-        GFX_write_string(&FontT42, &t9cY0free, text, 2);
-
-        // EAD / END
-        // The equivalent air depth can be calculated for depths in metres as follows:
-        // EAD = (Depth + 10) � Fraction of N2 / 0.79 - 10   (wikipedia)
-        // The equivalent narcotic depth can be calculated for depths in metres as follows:
-        // END = (Depth + 10) � (1 - Fraction of helium) - 10  (wikipedia)
-        decom_get_inert_gases((float)stateUsed->lifeData.pressure_ambient_bar,&(stateUsed->lifeData.actualGas),&fraction_nitrogen,&fraction_helium);
-        depth = stateUsed->lifeData.pressure_ambient_bar;
-        surface = stateUsed->lifeData.pressure_surface_bar;
-        ead = 10.f * ((depth * fraction_nitrogen/0.79f) - surface);
-        end = 10.0f * ((depth * (1.f - fraction_helium)) - surface);
-        if(ead < 0)
-            ead = 0;
-        if(end < 0)
-            end = 0;
-
-        snprintf(text,100,"\032\001EAD");
-        GFX_write_string(&FontT42, &t9cY0free, text, 3);
-        snprintf(text,100,"\030\001%01.1fm", ead);
-        GFX_write_string(&FontT42, &t9cY0free, text, 4);
-
-        snprintf(text,100,"\032\001END");
-        GFX_write_string(&FontT42, &t9cY0free, text, 5);
-        snprintf(text,100,"\030\001%01.1fm", end);
-        GFX_write_string(&FontT42, &t9cY0free, text, 6);
-    break;
-    case CVIEW_Profile:
-        snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Profile);
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        textpointer = 0;
-        t9_miniLiveLogProfile();
-    break;
-    case CVIEW_Tissues:
-        snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Tissues);
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        textpointer = 0;
-        t9_tissues(stateUsed);
-    break;
-    case CVIEW_sensors:
-        snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2monitor);
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        textpointer = 0;
-        text[textpointer++] = '\030'; // main color
-        for(int i=0;i<3;i++)
-        {
-            if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i))
-            {
-                text[textpointer++] = '\031'; // labelcolor
-                text[textpointer++] = '\001';
-                text[textpointer++] = '-';
-                text[textpointer++] = '\n';
-                text[textpointer++] = '\r';
-                text[textpointer++] = '\030'; // main color
-                text[textpointer] = 0;
-            }
-            else
-            {
-                if(stateUsed->warnings.sensorOutOfBounds[i])
-                    text[textpointer++] = '\025'; // Warning Red
-                textpointer += snprintf(&text[textpointer],100,"\001%01.2f\n\r\030",stateUsed->lifeData.ppO2Sensor_bar[i]);
-            }
-        }
-        t9cC.WindowLineSpacing = 95;
-        t9cC.WindowNumberOfTextLines = 3;
-        text[textpointer] = 0;
-        GFX_write_string(&FontT105,&t9cC,text,1);
-    break;
-    case CVIEW_sensors_mV:
-        snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2voltage);
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        textpointer = 0;
-        text[textpointer++] = '\030';
-        for(int i=0;i<3;i++)
-        {
-            if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i))
-            {
-                text[textpointer++] = '\031';
-                text[textpointer++] = '\001';
-                text[textpointer++] = '-';
-                text[textpointer++] = '\n';
-                text[textpointer++] = '\r';
-                text[textpointer++] = '\030';
-                text[textpointer] = 0;
-            }
-            else
-            {
-                if(stateUsed->warnings.sensorOutOfBounds[i])
-                    text[textpointer++] = '\025';
-                textpointer += snprintf(&text[textpointer],100,"\001%01.1f mV\n\r\030",(stateUsed->lifeData.sensorVoltage_mV[i]));
-            }
-        }
-        t9cC.WindowLineSpacing = 95;
-        t9cC.WindowNumberOfTextLines = 3;
-        text[textpointer] = 0;
-        GFX_write_string(&FontT48,&t9cC,text,1);
-    break;
-    case CVIEW_Compass:
-    default:
-        snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE, TXT2BYTE_Compass);
-        GFX_write_string(&FontT42,&t9cH,text,0);
-        t9_compass((uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading);
-        t9cY0free.WindowY0 = 230;
-        t9cY0free.WindowX0 += 15;
-        snprintf(text,100,"\030\001%03i`",(uint16_t)stateUsed->lifeData.compass_heading);
-        GFX_write_string(&FontT54,&t9cY0free,text,0);
-        t9cY0free.WindowX0 -= 15;
-    break;
-    case CVIEW_Decolist:
-        snprintf(text,100,"\032\f\001%c%c", TXT_2BYTE, TXT2BYTE_Decolist);
-        GFX_write_string(&FontT42,&t9cH,text,0);
-
-        const SDecoinfo * pDecoinfo;
-        uint8_t depthNext, depthLast, depthSecond, depthInc;
-
-        if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
-            pDecoinfo = &stateUsed->decolistBuehlmann;
-        else
-            pDecoinfo = &stateUsed->decolistVPM;
-
-        depthLast 		= (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10);
-        depthSecond 	= (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10);
-        depthInc 			= (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10);
-
-        for(start=DECOINFO_STRUCT_MAX_STOPS-1; start>0; start--)
-            if(pDecoinfo->output_stop_length_seconds[start]) break;
-        start -= 6;
-        if(start < 0) start = 0;
-
-        textpointer = 0;
-        for(int i=start;i<6+start;i++)
-        {
-            if(i == 0)
-                depthNext = depthLast;
-            else
-                depthNext = depthSecond + (( i - 1 )* depthInc);
-
-            if(pDecoinfo->output_stop_length_seconds[i])
-                textpointer += snprintf(&text[textpointer],20,"\030\034   %2u\016\016m\017%3i'\n\r",depthNext, (pDecoinfo->output_stop_length_seconds[i]+59)/60);
-            else
-                textpointer += snprintf(&text[textpointer],20,"\031\034   %2u\016\016m\017\n\r",depthNext);
-            if(textpointer > 200) break;
-        }
-        t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
-        t9cY0free.WindowLineSpacing = 48;
-        t9cY0free.WindowNumberOfTextLines = 6;
-        GFX_write_string(&FontT42, &t9cY0free, text, 1);
-    break;
-    }
-}
-
-/* DIVE MODE
- */
-void t9_refresh_divemode(void)
-{
-    char TextL1[TEXTSIZE];
-    char TextL2[TEXTSIZE];
-
-    char TextR1[TEXTSIZE];
-    char TextR2[TEXTSIZE];
-    char TextR3[TEXTSIZE];
-
-    char TextC1[2*TEXTSIZE];
-    char TextC2[TEXTSIZE];
-    uint8_t textPointer;
-
-    point_t start, stop;
-    uint8_t color;
-    int textlength;
-
-    uint16_t 	nextstopLengthSeconds = 0;
-    uint8_t 	nextstopDepthMeter = 0;
-    uint8_t oxygen_percentage = 0;
-    SDivetime Divetime = {0,0,0, 0};
-    SDivetime SafetyStopTime = {0,0,0,0};
-    SDivetime TimeoutTime = {0,0,0,0};
-    uint8_t  customview_warnings = 0;
-    const SDecoinfo * pDecoinfo;
-
-    Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time;
-    Divetime.Minutes = Divetime.Total / 60;
-    Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 );
-
-    SafetyStopTime.Total = timer_Safetystop_GetCountDown();
-    SafetyStopTime.Minutes = SafetyStopTime.Total / 60;
-    SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60);
-
-    TimeoutTime.Total = settingsGetPointer()->timeoutDiveReachedZeroDepth - stateUsed->lifeData.counterSecondsShallowDepth;
-    if(TimeoutTime.Total > settingsGetPointer()->timeoutDiveReachedZeroDepth)
-    {
-        TimeoutTime.Total = 0;
-    }
-    TimeoutTime.Minutes = TimeoutTime.Total / 60;
-    TimeoutTime.Seconds = TimeoutTime.Total - (TimeoutTime.Minutes * 60);
-
-    if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
-        pDecoinfo = &stateUsed->decolistBuehlmann;
-    else
-        pDecoinfo = &stateUsed->decolistVPM;
-
-    if(pDecoinfo->output_time_to_surface_seconds)
-    {
-        tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds);
-    }
-    else
-    {
-        nextstopDepthMeter = 0;
-        nextstopLengthSeconds = 0;
-    }
-
-    /* depth */
-    float depth = 0;
-    float depthThisCall = unit_depth_float(stateUsed->lifeData.depth_meter);
-    if(is_stateUsedSetToSim())
-    {
-        depth = (depthThisCall + t9_depthLastCall[0] + t9_depthLastCall[1] + t9_depthLastCall[2] + t9_depthLastCall[3] + t9_depthLastCall[4] + t9_depthLastCall[5] + t9_depthLastCall[6] + t9_depthLastCall[7] + t9_depthLastCall[8]) / 10.0f;
-
-        idt9_depthLastCall++;
-        if(idt9_depthLastCall >= 9)
-            idt9_depthLastCall = 0;
-        t9_depthLastCall[idt9_depthLastCall] = depthThisCall;
-    }
-    else
-    {
-        depth = (depthThisCall + t9_depthLastCall[0] + t9_depthLastCall[1] + t9_depthLastCall[2]) / 4.0f;
-
-        idt9_depthLastCall++;
-        if(idt9_depthLastCall >= 3)
-            idt9_depthLastCall = 0;
-        t9_depthLastCall[idt9_depthLastCall] = depthThisCall;
-    }
-
-    if(depth <= 0.3f)
-        depth = 0;
-
-    snprintf(TextL1,TEXTSIZE,"\032\f%c",TXT_Depth);
-    GFX_write_string(&FontT24,&t9l2,TextL1,0);
-
-    if( depth < 100)
-        snprintf(TextL1,TEXTSIZE,"\020%01.1f",depth);
-    else
-        snprintf(TextL1,TEXTSIZE,"\020%01.0f",depth);
-
-    t9_colorscheme_mod(TextL1);
-    GFX_write_string(&FontT105,&t9l2,TextL1,1);
-
-    /* max depth */
-    snprintf(TextL2,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
-    GFX_write_string(&FontT24,&t9l3,TextL2,0);
-
-    if(unit_depth_float(stateUsed->lifeData.max_depth_meter) < 100)
-        snprintf(TextL2,TEXTSIZE,"\020%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
-    else
-        snprintf(TextL2,TEXTSIZE,"\020%01.0f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
-
-    t9_colorscheme_mod(TextL2);
-    GFX_write_string(&FontT105,&t9l3,TextL2,1);
-
-    /* ascentrate graph */
-    if(stateUsed->lifeData.ascent_rate_meter_per_min > 0)
-    {
-        start.y = t9l1.WindowY0 - 1;
-        for(int i = 0; i<4;i++)
-        {
-            start.y += 5*6;
-            stop.y = start.y;
-            start.x = CUSTOMBOX_LINE_LEFT - 1;
-            stop.x = start.x - 17;
-            GFX_draw_line(&t9screen, start, stop, 0);
-//			start.x = CUSTOMBOX_LINE_RIGHT + 2; old right too
-//			stop.x = start.x + 17;
-//			GFX_draw_line(&t9screen, start, stop, 0);
-        }
-        // new thick bar design Sept. 2015
-        start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 3 - 5;
-        stop.x = start.x;
-        start.y = t9l1.WindowY0 - 1;
-        stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 6);
-        stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9
-        if(stop.y >= 470)
-            stop.y = 470;
-        start.y += 7; // starte etwas weiter oben
-        if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10)
-            color = CLUT_EverythingOkayGreen;
-        else
-        if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15)
-            color = CLUT_WarningYellow;
-        else
-            color = CLUT_WarningRed;
-
-        GFX_draw_thick_line(12,&t9screen, start, stop, color);
-    }
-    snprintf(TextL2,TEXTSIZE,"\f%.1f m/min",stateUsed->lifeData.ascent_rate_meter_per_min);
-
-    /* divetime */
-    if(stateUsed->lifeData.counterSecondsShallowDepth)
-    {
-        snprintf(TextR1,TEXTSIZE,"\f\002\136 %u:%02u",TimeoutTime.Minutes, TimeoutTime.Seconds);
-        GFX_write_string(&FontT24,&t9r2,TextR1,0);
-    }
-    else
-    {
-        snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime);
-        GFX_write_string(&FontT24,&t9r2,TextR1,0);
-    }
-
-    if(Divetime.Minutes < 1000)
-        snprintf(TextR1,TEXTSIZE,"\020\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds);
-    else
-        snprintf(TextR1,TEXTSIZE,"\020\016\002%u'",Divetime.Minutes);
-    t9_colorscheme_mod(TextR1);
-    GFX_write_string(&FontT105,&t9r2,TextR1,1);
-
-    /* next deco stop */
-    if(nextstopDepthMeter)
-    {
-        snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop);
-        GFX_write_string(&FontT24,&t9r3,TextR2,0);
-        textlength = snprintf(TextR2,TEXTSIZE,"\020\002%um %u'",nextstopDepthMeter,(nextstopLengthSeconds+59)/60);
-        t9_colorscheme_mod(TextR2);
-        if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
-            TextR2[0] = '\021';
-        if(textlength <= 8)
-            GFX_write_string(&FontT105,&t9r3,TextR2,1);
-        else
-            GFX_write_string(&FontT54,&t9r3,TextR2,1);
-    }
-    else
-    if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit()))
-    {
-        snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2);
-        GFX_write_string(&FontT24,&t9r3,TextR2,0);
-        snprintf(TextR2,TEXTSIZE,"\020\016\002%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds);
-        t9_colorscheme_mod(TextR2);
-        GFX_write_string(&FontT105,&t9r3,TextR2,1);
-    }
-
-    /* tts - option 1
-     * ndl - option 2
-     * empty - option 3 */
-    if(pDecoinfo->output_time_to_surface_seconds)
-    {
-        snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS);
-        GFX_write_string(&FontT24,&t9r4,TextR3,0);
-        if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60)
-            snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 60);
-        else
-            snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_time_to_surface_seconds / 3600);
-        t9_colorscheme_mod(TextR3);
-        if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
-            TextR2[0] = '\021';
-        GFX_write_string(&FontT105,&t9r4,TextR3,0);
-    }
-    else
-    if(pDecoinfo->output_ndl_seconds)
-    {
-        snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_Nullzeit);
-        GFX_write_string(&FontT24,&t9r4,TextR3,0);
-        if(pDecoinfo->output_ndl_seconds < 1000 * 60)
-            snprintf(TextR3,TEXTSIZE,"\020\002%i'",pDecoinfo->output_ndl_seconds/60);
-        else
-            snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_ndl_seconds/3600);
-        t9_colorscheme_mod(TextR3);
-        if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
-            TextR2[0] = '\021';
-        GFX_write_string(&FontT105,&t9r4,TextR3,0);
-    }
-
-    uint16_t scooterSpeedLocal;
-    uint8_t scooterResidualCapacity;
-
-    scooterSpeedLocal = unit_speed_integer(stateUsed->lifeData.scooterSpeed);
-    scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
-
-    /* scooter global for both */
-    uint16_t ageInMilliSeconds;
-    ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
-    if(!ageInMilliSeconds)
-        ageInMilliSeconds = 9999;
-
-    /* scooter battery */
-    snprintf(TextR1,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE, TXT2BYTE_ScooterRestkapazitaet);
-    GFX_write_string(&FontT24,&t9r1,TextR1,0);
-    snprintf(TextR3,TEXTSIZE,"\020\002%u\016\016%%\017",scooterResidualCapacity);
-    if(ageInMilliSeconds > 1500)
-    {
-        for(int i=0; i < TEXTSIZE -2; i++)
-        {
-            if(TextR3[i] == '\020')
-                TextR3[i] = '\031';
-        }
-    }
-    else
-        t9_colorscheme_mod(TextR3);
-    GFX_write_string(&FontT105,&t9r1,TextR3,1);
-
-    /*  scooter speed */
-    textlength = snprintf(TextR3,TEXTSIZE-7,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_ScooterSpeed);
-    if(settingsGetPointer()->nonMetricalSystem == 0)
-    {
-        snprintf(&TextR3[textlength],8," m/min");
-    }
-    else
-    {
-        snprintf(&TextR3[textlength],8," ft/min");
-    }
-    GFX_write_string(&FontT24,&t9l1,TextR3,0);
-    snprintf(TextR3,TEXTSIZE,"\020%u",scooterSpeedLocal);
-    if(ageInMilliSeconds > 1500)
-    {
-        for(int i=0; i < TEXTSIZE -2; i++)
-        {
-            if(TextR3[i] == '\020')
-                TextR3[i] = '\031';
-        }
-    }
-    else
-        t9_colorscheme_mod(TextR3);
-    GFX_write_string(&FontT105,&t9l1,TextR3,1);
-
-
-
-    /* Menu Selection (and gas mix) */
-    if(get_globalState() == StDMGAS)
-    {
-        textPointer = 0;
-        TextR1[textPointer++] = '\a';
-//		TextR1[textPointer++] = '\f';
-        TextR1[textPointer++] = '\001';
-        TextR1[textPointer++] = ' ';
-        textPointer += tHome_gas_writer(stateUsed->diveSettings.gas[actualBetterGasId()].oxygen_percentage,stateUsed->diveSettings.gas[actualBetterGasId()].helium_percentage,&TextR1[textPointer]);
-        TextR1[textPointer++] = '?';
-        TextR1[textPointer++] = ' ';
-        TextR1[textPointer++] = 0;
-        GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
-    }
-    else
-    if(get_globalState() == StDMSPT)
-    {
-        textPointer = 0;
-        TextR1[textPointer++] = '\a';
-        TextR1[textPointer++] = '\001';
-        TextR1[textPointer++] = ' ';
-        textPointer += snprintf(&TextR1[textPointer],5,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100);
-        TextR1[textPointer++] = '?';
-        TextR1[textPointer++] = ' ';
-        TextR1[textPointer++] = 0;
-        GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
-    }
-    else
-    if(get_globalState() == StDMENU)
-    {
-        snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveMenuQ);
-        GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
-    }
-    else
-    if(get_globalState() == StDSIM1)
-    {
-        snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ);
-        GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
-    }
-    else
-    if(get_globalState() == StDSIM2)
-    {
-        snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-1m ");
-        GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
-        snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
-        GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
-
-    }
-    else
-    if(get_globalState() == StDSIM3)
-    {
-        snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+1m ");
-        GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
-        snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
-        GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
-    }
-    else
-    if(get_globalState() == StDSIM4)
-    {
-        snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+5' ");
-        GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
-        snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
-        GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
-    }
-    else
-    {
-        /* gas mix */
-        oxygen_percentage = 100;
-        oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage;
-        oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage;
-
-        textPointer = 0;
-        TextC2[textPointer++] = '\020';
-        if(stateUsed->warnings.betterGas && warning_count_high_time)
-        {
-            TextC2[textPointer++] = '\a';
-        }
-        else
-        {
-            float fPpO2limitHigh, fPpO2now;
-
-            if(actualLeftMaxDepth(stateUsed))
-                fPpO2limitHigh = settingsGetPointer()->ppO2_max_deco;
-            else
-                fPpO2limitHigh = settingsGetPointer()->ppO2_max_std;
-
-            fPpO2now = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * oxygen_percentage;
-
-            if((fPpO2now > fPpO2limitHigh) || (fPpO2now < (float)(settingsGetPointer()->ppO2_min)))
-                TextC2[textPointer++] = '\025';
-        }
-        TextC2[textPointer++] = '\002';
-        textPointer += tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&TextC2[textPointer]);
-
-        if(stateUsed->warnings.betterGas && warning_count_high_time)
-        {
-            if(TextC2[0] == '\020')
-            {
-                TextC2[0] = '\004'; // NOP
-            }
-            GFX_write_string_color(&FontT48,&t9c2,TextC2,0,CLUT_WarningYellow);
-        }
-        else
-        {
-            t9_colorscheme_mod(TextC2);
-            GFX_write_string(&FontT48,&t9c2,TextC2,0); // T54 has only numbers
-        }
-
-        if(stateUsed->diveSettings.ccrOption)
-        {
-            if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR)
-            {
-                snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
-                if(stateUsed->warnings.betterSetpoint && warning_count_high_time && (stateUsed->diveSettings.diveMode == DIVEMODE_CCR))
-                {
-                    TextC2[0] = '\a'; // inverse instead of color \020
-                    GFX_write_string_color(&FontT48,&t9c2,TextC2,0,CLUT_WarningYellow);
-                }
-                else
-                {
-                    t9_colorscheme_mod(TextC2);
-                    GFX_write_string(&FontT48,&t9c2,TextC2,0);
-                }
-            }
-        }
-        else if(settingsGetPointer()->alwaysShowPPO2)
-        {
-            snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
-            t9_colorscheme_mod(TextC2);
-            GFX_write_string(&FontT48,&t9c2,TextC2,0);
-        }
-    }
-
-    /* algorithm, ccr, bailout and battery */
-    /* and permanent warnings (CNS) */
-
-    if((stateUsed->warnings.cnsHigh) && display_count_high_time)
-    {
-        TextC2[0] = '\f';
-        TextC2[1] = TXT_2BYTE;
-        TextC2[2] = TXT2BYTE_WarnCnsHigh;
-        TextC2[3] = 0;
-        GFX_write_string_color(&FontT48,&t9c1,TextC2,0,CLUT_WarningRed);
-    }
-    else
-    {
-        if(stateUsed->warnings.aGf)
-        {
-            GFX_write_string_color(&FontT48,&t9c1,"\f" "aGF",0,CLUT_WarningYellow);
-        }
-        else if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
-        {
-            GFX_write_string(&FontT48,&t9c1,"\027\f" "GF",0);
-        }
-        else
-        {
-            GFX_write_string(&FontT48,&t9c1,"\027\f" "VPM",0);
-        }
-
-        if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR)
-            GFX_write_string(&FontT24,&t9c1,"\027\f\002" "CCR",0);
-        //		GFX_write_string(&FontT24,&t9c1,"\f\177\177\x80" "CCR",0);
-        else
-        if(stateUsed->diveSettings.ccrOption)
-            GFX_write_string(&FontT24,&t9c1,"\f\002\024" "Bailout",0);
-        //		GFX_write_string(&FontT24,&t9c1,"\f\177\177\x80\024" "Bailout",0);
-    }
-    TextC1[0] = '\020';
-    TextC1[1] = '3';
-    TextC1[2] = '1';
-    TextC1[3] = '1';
-    TextC1[4] = '1';
-    TextC1[5] = '1';
-    TextC1[6] = '1';
-    TextC1[7] = '1';
-    TextC1[8] = '1';
-    TextC1[9] = '1';
-    TextC1[10] = '1';
-    TextC1[11] = '1';
-    TextC1[12] = '0';
-    TextC1[13] = 0;
-
-    for(int i=1;i<=10;i++)
-    {
-        if(	stateUsed->lifeData.battery_charge > (9 * i))
-            TextC1[i+1] += 1;
-    }
-
-    if(stateUsed->warnings.lowBattery)
-    {
-        TextC1[0] = '\025';
-        if(warning_count_high_time)
-        {
-            for(int i=2;i<=11;i++)
-                TextC1[i] = '1';
-        }
-        else
-        {
-            TextC1[2] = '2';
-        }
-        GFX_write_string(&Batt24,&t9batt,TextC1,0);
-
-        if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140))
-        {
-            snprintf(TextC1,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge);
-            if(warning_count_high_time)
-                TextC1[0] = '\a';
-            GFX_write_string(&FontT24,&t9batt,TextC1,0);
-        }
-    }
-    else
-    {
-        t9_colorscheme_mod(TextC1);
-        GFX_write_string(&Batt24,&t9batt,TextC1,0);
-
-        if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140))
-        {
-            snprintf(TextC1,16,"\020\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge);
-            t9_colorscheme_mod(TextC1);
-            GFX_write_string(&FontT24,&t9batt,TextC1,0);
-        }
-    }
-
-    /* customizable left lower corner */
-    t9_refresh_divemode_userselected_left_lower_corner();
-
-
-    /* customview - option 1
-     * warning - option 2 */
-    if(stateUsed->warnings.numWarnings)
-        customview_warnings = t9_test_customview_warnings();
-
-    t9_background.pointer = NULL;
-    if(customview_warnings && warning_count_high_time)
-        t9_show_customview_warnings();
-    else
-        t9_refresh_customview();
-
-
-    /* the frame */
-    t9_draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines);
-}
-
-
-void t9_set_field_to_primary(void)
-{
-    if(stateUsed->mode == MODE_DIVE)
-            t9_selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
-}
-
-
-void t9_change_field(void)
-{
-    const uint8_t minVal = 0;
-    const uint8_t maxVal = 7;
-
-    t9_selection_custom_field++;
-    if(t9_selection_custom_field > maxVal)
-    t9_selection_custom_field = minVal;
-}
-
-
-void t9_refresh_divemode_userselected_left_lower_corner(void)
-{
-    // zero is scooter temperature :-)
-
-    char  headerText[10];
-    char  text[TEXTSIZE];
-    uint8_t textpointer = 0;
-    _Bool tinyHeaderFont = 0;
-    uint8_t line = 0;
-
-    SDivetime Stopwatch = {0,0,0,0};
-    float fAverageDepth, fAverageDepthAbsolute;
-    const SDecoinfo * pDecoinfoStandard;
-    const SDecoinfo * pDecoinfoFuture;
-    float fCNS;
-
-    float temperatureThisCall;
-    float temperature;
-
-    float scooterTemperatureLocal;
-    uint16_t ageInMilliSeconds;
-
-    if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
-    {
-        pDecoinfoStandard = &stateUsed->decolistBuehlmann;
-        pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann;
-    }
-    else
-    {
-        pDecoinfoStandard = &stateUsed->decolistVPM;
-        pDecoinfoFuture = &stateUsed->decolistFutureVPM;
-    }
-
-    Stopwatch.Total = timer_Stopwatch_GetTime();
-    Stopwatch.Minutes = Stopwatch.Total / 60;
-    Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 );
-    fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter();
-    fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter;
-
-    headerText[0] = '\032';
-    headerText[1] = '\f';
-
-    switch(t9_selection_custom_field)
-    {
-    /* scooter temp. */
-    case 0:
-        scooterTemperatureLocal = unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f);
-        headerText[2] = TXT_2BYTE;
-        headerText[3] = TXT2BYTE_ScooterTemperature;
-        textpointer = snprintf(text,TEXTSIZE,"\020\016%01.1f \140",scooterTemperatureLocal); // "\016\016%01.1f `" + C or F
-        if(settingsGetPointer()->nonMetricalSystem == 0)
-            text[textpointer++] = 'C';
-        else
-            text[textpointer++] = 'F';
-        text[textpointer++] = 0;
-        tinyHeaderFont = 0;
-        // connection active
-        ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
-        if(!ageInMilliSeconds)
-            ageInMilliSeconds = 9999;
-        if(ageInMilliSeconds > 1500)
-        {
-            for(int i=0; i < TEXTSIZE -2; i++)
-            {
-                if(text[i] == '\020')
-                    text[i] = '\031';
-            }
-        }
-        break;
-
-    /* Temperature */
-    case 1:
-    default:
-        // mean value
-        temperatureThisCall = unit_temperature_float(stateUsed->lifeData.temperature_celsius);
-        temperature = (temperatureThisCall + t9_temperatureLastCall[0] + t9_temperatureLastCall[1] + t9_temperatureLastCall[2]) / 4.0f;
-        idt9_temperatureLastCall++;
-        if(idt9_temperatureLastCall >= 3)
-            idt9_temperatureLastCall = 0;
-        t9_temperatureLastCall[idt9_temperatureLastCall] = temperatureThisCall;
-        // output
-        headerText[2] = TXT_Temperature;
-        textpointer = snprintf(text,TEXTSIZE,"\020\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F
-        if(settingsGetPointer()->nonMetricalSystem == 0)
-            text[textpointer++] = 'C';
-        else
-            text[textpointer++] = 'F';
-        text[textpointer++] = 0;
-        tinyHeaderFont = 0;
-        break;
-
-    /* Average Depth */
-    case 2:
-        headerText[2] = TXT_AvgDepth;
-        snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute);
-        break;
-
-    /* ppO2 */
-    case 3:
-        headerText[2] = TXT_ppO2;
-        snprintf(text,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
-        break;
-
-    /* Stop Uhr */
-    case 4:
-        headerText[2] = TXT_Stopwatch;
-        snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.1f",Stopwatch.Minutes, Stopwatch.Seconds,fAverageDepth);
-        tinyHeaderFont = 1;
-        line = 1;
-        break;
-
-    /* Ceiling */
-    case 5:
-        headerText[2] = TXT_Ceiling;
-        if(pDecoinfoStandard->output_ceiling_meter <= 99.9f)
-            snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
-        else
-            snprintf(text,TEXTSIZE,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter);
-        break;
-
-    /* Future TTS */
-    case 6:
-        headerText[2] = TXT_FutureTTS;
-        snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, pDecoinfoFuture->output_time_to_surface_seconds / 60);
-        tinyHeaderFont = 1;
-        line = 1;
-        break;
-
-    /* CNS */
-    case 7:
-        headerText[2] = TXT_CNS;
-        fCNS = stateUsed->lifeData .cns;
-        if(fCNS > 999)
-            fCNS = 999;
-        snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",fCNS);
-        break;
-
-    /* scooter voltage*/
-    case 77: // used as 7: alternative for Bonex
-        headerText[2] = TXT_2BYTE;
-        headerText[3] = TXT2BYTE_ScooterVolt;
-        if(stateUsed->lifeData.scooterSpannung < 99)
-        {
-            snprintf(text,TEXTSIZE,"\020\016%01.2f",stateUsed->lifeData.scooterSpannung);
-            ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
-            if(!ageInMilliSeconds)
-                ageInMilliSeconds = 9999;
-            if(ageInMilliSeconds > 1500)
-            {
-                for(int i=0; i < TEXTSIZE -2; i++)
-                {
-                    if(text[i] == '\020')
-                        text[i] = '\031';
-                }
-            }
-        }
-        else
-        {
-            text[0] = 0;
-        }
-        break;
-
-    }
-    if(headerText[2] == TXT_2BYTE)
-        headerText[4] = 0;
-    else
-        headerText[3] = 0;
-
-    if(!tinyHeaderFont)
-        GFX_write_string(&FontT24,&t9l4,headerText,0);
-
-    t9_colorscheme_mod(text);
-    GFX_write_string(&FontT105,&t9l4,text,line);
-}
-
-/* Private functions ---------------------------------------------------------*/
-
-uint8_t t9_customtextPrepare(char * text)
-{
-    uint8_t i, j, textptr, lineCount;
-    char nextChar;
-
-    textptr = 0;
-    lineCount = 0;
-
-    text[textptr++] = TXT_MINIMAL;
-
-    j = 0;
-    i = 0;
-    do
-    {
-        j += i;
-        i = 0;
-        do
-        {
-            nextChar = settingsGetPointer()->customtext[i+j];
-            i++;
-            if((!nextChar) || (nextChar =='\n')  || (nextChar =='\r'))
-                break;
-            text[textptr++] = nextChar;
-        } while (i < 12);
-
-        if(!nextChar)
-            break;
-
-        if(lineCount < 3)
-        {
-            text[textptr++] = '\n';
-            text[textptr++] = '\r';
-        }
-        lineCount++;
-        for(uint8_t k=0;k<2;k++)
-        {
-            nextChar = settingsGetPointer()->customtext[i+j+k];
-            if((nextChar =='\n')  || (nextChar =='\r'))
-                i++;
-            else
-                break;
-        }
-
-    } while (lineCount < 4);
-
-    text[textptr] = 0;
-    return lineCount;
-}
-
-/* could be extended to search for \020 inside
- */
-void t9_colorscheme_mod(char *text)
-{
-    if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard())
-    {
-        text[0] = '\027';
-    }
-}
-
-void t9_draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide)
-{
-    point_t LeftLow, WidthHeight;
-    point_t start, stop;
-
-    // plugin box
-    LeftLow.x = CUSTOMBOX_LINE_LEFT;
-    WidthHeight.x = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_LINE_LEFT;
-    LeftLow.y = 60;
-    WidthHeight.y = 440 - LeftLow.y;
-    GFX_draw_box(&t9screen, LeftLow, WidthHeight, 1, colorBox);
-
-    if(PluginBoxHeader)
-    {
-            // plugin box - header
-            start.x = CUSTOMBOX_LINE_LEFT;
-            stop.x = CUSTOMBOX_LINE_RIGHT;
-            stop.y = start.y = 440 - 60;
-            GFX_draw_line(&t9screen, start, stop, colorBox);
-    }
-
-    if(LinesOnTheSides)
-    {
-        // aufteilung links
-        start.x = 0;
-        stop.x = CUSTOMBOX_LINE_LEFT;
-        stop.y = start.y = t9l1.WindowY0 - 1;
-        GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
-        stop.y = start.y = t9l2.WindowY0 -1;
-        GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
-        stop.y = start.y = t9l3.WindowY0 -1;
-        GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
-
-        // aufteilung rechts
-        start.x = CUSTOMBOX_LINE_RIGHT;
-        stop.x = 799;
-        stop.y = start.y = t9l1.WindowY0 - 1;
-        GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
-        stop.y = start.y = t9l2.WindowY0 - 1;
-        GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
-        stop.y = start.y = t9l3.WindowY0 - 1;
-        GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
-    }
-}
-
-
-/* Compass like TCOS shellfish
- * input is 0 to 359
- * 2 px / 1 degree
- * Range is 148 degree with CUSTOMBOX_SPACE_INSIDE = 296
- * one side is 74 degree (less than 90 degree)
- * internal 360 + 180 degree of freedom
- * use positive values only, shift by 360 below 90 mid position
- */
-
-
-point_t t9_compass_circle(uint8_t id, uint16_t degree)
-{
-    float fCos, fSin;
-    const float piMult =  ((2 * 3.14159) / 360);
-//	const int radius[4] = {95,105,115,60};
-    const int radius[4] = {95,105,115,100};
-    const point_t offset = {.x = 400, .y = 250};
-
-    static point_t r[4][360] = { 0 };
-
-    if(r[0][0].y == 0)
-    {
-        for(int i=0;i<360;i++)
-        {
-            fCos = cos(i * piMult);
-            fSin = sin(i * piMult);
-            for(int j=0;j<4;j++)
-            {
-                r[j][i].x = offset.x + (int)(fSin * radius[j]);
-                r[j][i].y = offset.y + (int)(fCos * radius[j]);
-            }
-        }
-    }
-    if(id > 3) id = 0;
-    if(degree > 359) degree = 0;
-    return r[id][degree];
-}
-
-/* range should be 0 to 30 bar if 300 meter with 100% of nitrogen or helium
- * T24 is 28 high
-*/
-void t9_tissues(const SDiveState * pState)
-{
-    point_t start, change, stop;
-    float value;
-    uint16_t front, cns100pixel;
-    char text[256];
-    uint8_t textpointer = 0;
-    uint8_t color;
-
-    float percent_N2;
-    float percent_He;
-    float partial_pressure_N2;
-    float partial_pressure_He;
-
-
-    /* N2 */
-    t9cY0free.WindowLineSpacing = 28 + 48 + 14;
-    t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
-    t9cY0free.WindowNumberOfTextLines = 3;
-
-    text[textpointer++] = '\030';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_Nitrogen;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_Helium;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_CNS;
-    text[textpointer++] = 0;
-
-    GFX_write_string(&FontT24, &t9cY0free, text, 1);
-
-    start.y = t9cH.WindowY0 - 5;
-    start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    stop.x = start.x + CUSTOMBOX_SPACE_INSIDE;
-
-    for(int i=0;i<16;i++)
-    {
-        stop.y = start.y;
-        change.y = start.y;
-
-        value = pState->lifeData.tissue_nitrogen_bar[i] - 0.7512f;
-        value *= 80;//20
-
-        if(value < 0)
-            front = 0;
-        else if(value > CUSTOMBOX_SPACE_INSIDE)
-            front = CUSTOMBOX_SPACE_INSIDE;
-        else
-                front = (uint16_t)value;
-
-        change.x = start.x + front;
-        if(change.x != start.x)
-            GFX_draw_thick_line(1,&t9screen, start, change, CLUT_Font030);
-        if(change.x != stop.x)
-            GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
-
-        start.y -= 3;
-    }
-
-    /* He */
-    start.y -= 28 + 14;
-    for(int i=0;i<16;i++)
-    {
-        stop.y = start.y;
-        change.y = start.y;
-
-        value = pState->lifeData.tissue_helium_bar[i];
-        value *= 80;//20
-
-        if(value < 0)
-            front = 0;
-        else if(value > CUSTOMBOX_SPACE_INSIDE)
-            front = CUSTOMBOX_SPACE_INSIDE;
-        else
-                front = (uint16_t)value;
-
-        change.x = start.x + front;
-        if(change.x != start.x)
-            GFX_draw_thick_line(1,&t9screen, start, change, CLUT_Font030);
-        if(change.x != stop.x)
-            GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
-
-        start.y -= 3;
-    }
-
-    /* CNS == Oxygen */
-    start.y -= 28 + 14;
-
-    cns100pixel = (8 * CUSTOMBOX_SPACE_INSIDE) / 10;
-    value = pState->lifeData.cns;
-    value *= cns100pixel;
-    value /= 100;
-
-    if(value < 0)
-        front = 0;
-    else if(value > CUSTOMBOX_SPACE_INSIDE)
-        front = CUSTOMBOX_SPACE_INSIDE;
-    else
-            front = (uint16_t)value;
-
-    if(pState->lifeData.cns < 95)
-        color = CLUT_Font030;
-    else if(pState->lifeData.cns < 100)
-        color =  CLUT_WarningYellow;
-    else
-        color = CLUT_WarningRed;
-
-    for(int i=0;i<16;i++)
-    {
-        stop.y = start.y;
-        change.y = start.y;
-
-        change.x = start.x + front;
-        if(change.x != start.x)
-            GFX_draw_thick_line(1,&t9screen, start, change, color);
-        if(change.x != stop.x)
-            GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
-
-        start.y -= 3;
-    }
-
-    /* where is the onload/offload limit for N2 and He */
-    decom_get_inert_gases(pState->lifeData.pressure_ambient_bar, &pState->lifeData.actualGas, &percent_N2, &percent_He);
-    partial_pressure_N2 =  (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_N2;
-    partial_pressure_He = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_He;
-
-    // Nitrogen vertical bar
-    start.y = t9cH.WindowY0 + 1 - 5;
-    stop.y = start.y - (3 * 15) - 1;
-    if((percent_N2 > 0) && (partial_pressure_N2 > 0.8f))//(0.8f + 0.5f)))
-    {
-        value = partial_pressure_N2;
-        value *= 80;//20
-
-        if(value < 0)
-            front = 3;
-        else if(value + 5 > CUSTOMBOX_SPACE_INSIDE)
-            front = CUSTOMBOX_SPACE_INSIDE - 3;
-        else
-                front = (uint16_t)value;
-    }
-    else
-    {
-        front = 1;
-    }
-    start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front;
-    stop.x = start.x;
-    GFX_draw_thick_line(2,&t9screen, start, stop, CLUT_EverythingOkayGreen);
-
-
-    // Helium vertical bar
-    start.y = t9cH.WindowY0 + 1 - 5 - 3*16 - 28 - 14;
-    stop.y = start.y - (3 * 15) - 1;
-    if((percent_He > 0) && (partial_pressure_He > 0.01f)) // 0.5f
-    {
-
-        value = partial_pressure_He;
-        value *= 80;//20
-
-        if(value < 0)
-            front = 3;
-        else if(value + 5 > CUSTOMBOX_SPACE_INSIDE)
-            front = CUSTOMBOX_SPACE_INSIDE - 3;
-        else
-                front = (uint16_t)value;
-    }
-    else
-    {
-        front = 1;
-    }
-
-    start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front;
-    stop.x = start.x;
-    GFX_draw_thick_line(2,&t9screen, start, stop, CLUT_EverythingOkayGreen);
-
-    // Oxygen vertical bar
-    start.y = t9cH.WindowY0 + 1 - 5 - 6*16 - 2*28 - 2*14;
-    stop.y = start.y - (3 * 15) - 1;
-
-    start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + cns100pixel;
-    stop.x = start.x;
-    GFX_draw_thick_line(2, &t9screen, start, stop, CLUT_WarningRed);
-}
-
-
-void t9_debug(void)
-{
-    char text[256+50];
-    uint8_t textpointer = 0;
-
-    t9cY0free.WindowLineSpacing = 28 + 48 + 14;
-    t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
-    t9cY0free.WindowNumberOfTextLines = 3;
-
-    textpointer += snprintf(&text[textpointer],50,"Ambient [bar]\n\r");
-    textpointer += snprintf(&text[textpointer],50,"Surface [bar] + salt\n\r");
-//	textpointer += snprintf(&text[textpointer],50,"Difference [mbar]\n\r");
-    textpointer += snprintf(&text[textpointer],50,"ShallowCounter [s]\n\r");
-    GFX_write_string(&FontT24, &t9cY0free, text, 1);
-
-    t9cY0free.WindowY0 -= 52;
-//  snprintf(text,60,"%0.2f\n\r%0.2f       %u%%\n\r%0.0f",stateUsed->lifeData.pressure_ambient_bar, stateUsed->lifeData.pressure_surface_bar, settingsGetPointer()->salinity, 1000 * (stateUsed->lifeData.pressure_ambient_bar-stateUsed->lifeData.pressure_surface_bar));
-    snprintf(text,60,
-        "%0.2f\n\r"
-        "%0.2f       %u%%\n\r"
-        "%u"
-        ,stateUsed->lifeData.pressure_ambient_bar
-        ,stateUsed->lifeData.pressure_surface_bar
-        ,settingsGetPointer()->salinity
-        ,stateUsed->lifeData.counterSecondsShallowDepth);
-    GFX_write_string(&FontT42, &t9cY0free, text, 1);
-}
-
-
-void t9_SummaryOfLeftCorner(void)
-{
-    char text[256+60];
-    uint8_t textpointer = 0;
-
-    const SDecoinfo * pDecoinfoStandard;
-    const SDecoinfo * pDecoinfoFuture;
-    float fCNS;
-
-    if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
-    {
-        pDecoinfoStandard = &stateUsed->decolistBuehlmann;
-        pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann;
-    }
-    else
-    {
-        pDecoinfoStandard = &stateUsed->decolistVPM;
-        pDecoinfoFuture = &stateUsed->decolistFutureVPM;
-    }
-
-    fCNS = stateUsed->lifeData .cns;
-    if(fCNS > 999)
-        fCNS = 999;
-
-    t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
-    t9cY0free.WindowLineSpacing = 48;
-    t9cY0free.WindowNumberOfTextLines = 6;
-    t9cY0free.WindowTab = 420;
-
-    // header
-    textpointer = 0;
-    text[textpointer++] = '\032';
-    text[textpointer++] = '\016';
-    text[textpointer++] = '\016';
-    text[textpointer++] = TXT_ppO2;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_Ceiling;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_ActualGradient;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_CNS;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_FutureTTS;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterTemperature;
-    text[textpointer++] = '\017';
-    text[textpointer++] = 0;
-    t9cY0free.WindowX0 += 10;
-    t9cY0free.WindowY0 += 10;
-    GFX_write_string(&FontT24, &t9cY0free, text, 1);
-    t9cY0free.WindowX0 -= 10;
-    t9cY0free.WindowY0 -= 10;
-
-    textpointer = 0;
-    text[textpointer++] = '\t';
-    textpointer += snprintf(&text[textpointer],10,"\020%01.2f",	stateUsed->lifeData.ppO2);
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
-    if(pDecoinfoStandard->output_ceiling_meter <= 99.9f)
-        textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
-    else
-        textpointer += snprintf(&text[textpointer],10,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter);
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
-    textpointer += snprintf(&text[textpointer],10,"\020%.0f",		100 * pDecoinfoStandard->output_relative_gradient);
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
-    textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS);
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
-    textpointer += snprintf(&text[textpointer],10,"\020%i'",		pDecoinfoFuture->output_time_to_surface_seconds / 60);
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
-    textpointer += snprintf(&text[textpointer],15,"\020\016%01.0f \140",unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f)); // "\016\016%01.1f `" + C or F
-    if(settingsGetPointer()->nonMetricalSystem == 0)
-        text[textpointer++] = 'C';
-    else
-        text[textpointer++] = 'F';
-    text[textpointer++] = 0;
-    text[textpointer++] = 0;
-    GFX_write_string(&FontT42, &t9cY0free, text, 1);
-}
-
-
-void t9_scooter(void)
-{
-    float scooterTemperatureLocal;
-    uint16_t scooterSpeedLocal;
-//	uint16_t scooterDrehzhl;
-    uint8_t scooterResidualCapacity;
-//	float scooterVoltage;
-//	uint8_t scooterCurrent;
-    //uint16_t scooterWattHours;
-//	uint16_t bkpX0, bkpX1;
-
-    uint16_t ageInMilliSeconds;
-    uint8_t textSize;
-
-    scooterTemperatureLocal = unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f);
-    scooterSpeedLocal = unit_speed_integer(stateUsed->lifeData.scooterSpeed);
-    scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
-
-//	scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
-//	scooterVoltage = stateUsed->lifeData.scooterSpannung;
-//	scooterCurrent = stateUsed->lifeData.scooterAmpere;
-//	scooterWattHours = stateUsed->lifeData.scooterWattstunden;
-
-    ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
-    if(!ageInMilliSeconds)
-        ageInMilliSeconds = 9999;
-
-    char text[256+60];
-    uint8_t textpointer = 0;
-
-    t9cY0free.WindowLineSpacing = 28 + 48 + 14;
-    t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
-    t9cY0free.WindowNumberOfTextLines = 3;
-
-    // header
-    text[textpointer++] = '\032';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterRestkapazitaet;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterTemperature;
-    text[textpointer++] = '\n';
-    text[textpointer++] = '\r';
-    text[textpointer++] = TXT_2BYTE;
-    text[textpointer++] = TXT2BYTE_ScooterSpeed;
-    text[textpointer++] = 0;
-    GFX_write_string(&FontT24, &t9cY0free, text, 1);
-
-/*
-snprintf(text,60,
-            "\032"
-            "%0u" "\016\016 Wh used\017"
-            ,stateUsed->lifeData.scooterWattstunden);
-*/
-if(ageInMilliSeconds > 1500)
-    text[0] = '\031';
-GFX_write_string(&FontT24, &t9cY0free, text, 1);
-
-/*
-snprintf(text,60,
-            "\030"
-            "\n\r"
-            "\n\r"
-            "%0u" "\022\016\016 rpm\017\030"
-            ,stateUsed->lifeData.scooterDrehzahl);
-GFX_write_string(&FontT24, &t9cY0free, text, 1);
-*/
-    // data
-    t9cY0free.WindowY0 -= 52;
-    if(settingsGetPointer()->nonMetricalSystem == 0)
-    {
-        textSize = snprintf(text,60,
-            "\030"
-            "%0u" "\022\016\016 %%\017\030"
-            "\n\r"
-            "%0.0f\140" "\022\016\016 C\017\030"
-            "\n\r"
-            "%u"  "\022\016\016 m/min\017\030"
-            ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal);
-    }
-    else
-    {
-        textSize = snprintf(text,60,
-            "\030"
-            "%0u" "\022\016\016 %%\017\030"
-            "\n\r"
-            "%0.0f\140" "\022\016\016 Fht\017\030"
-            "\n\r"
-            "%u"  "\022\016\016 ft/min\017\030"
-            ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal);
-    }
-    // connection active
-    if(ageInMilliSeconds > 1500)
-    {
-        for(int i=0; i < textSize -2; i++)
-        {
-            if(text[i] == '\030')
-                text[i] = '\031';
-        }
-    }
-    // write data
-    GFX_write_string(&FontT42, &t9cY0free, text, 1);
-
-    // age stamp
-    if(ageInMilliSeconds < 9999)
-    {
-        t9cY0free.WindowY0 -= 30;
-        snprintf(text,60,
-            "\021\001%u"
-            ,ageInMilliSeconds);
-        GFX_write_string(&FontT24, &t9cY0free, text, 0);
-    }
-}
-
-
-void t9_scooter_May2016_01(void)
-{
-    float scooterTemperature;
-    uint16_t scooterDrehzhl;
-    uint8_t scooterResidualCapacity;
-    float scooterSpeed;
-    float scooterVoltage;
-    uint8_t scooterCurrent;
-//	uint16_t scooterWattHours;
-    uint16_t bkpX0, bkpX1;
-
-    uint16_t ageInMilliSeconds;
-    uint8_t textSize;
-// old	scooterStatus = bC_getData(0,&scooterTemperature,&scooterDrehzhl,&scooterResidualCapacity);
-
-    scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
-    scooterTemperature = ((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f;
-    scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
-
-    scooterVoltage = stateUsed->lifeData.scooterSpannung;
-    scooterCurrent = stateUsed->lifeData.scooterAmpere;
-//	scooterWattHours = stateUsed->lifeData.scooterWattstunden;
-
-    ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
-    if(!ageInMilliSeconds)
-        ageInMilliSeconds = 9999;
-
-    scooterSpeed = scooterDrehzhl * 80 / 3300;
-
-    char text[256+60];
-
-    t9cY0free.WindowLineSpacing = (28 + 48 + 14)/2;
-    t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 5 * t9cY0free.WindowLineSpacing;
-    t9cY0free.WindowNumberOfTextLines = 6;
-
-    t9cY0free.WindowY0 -= 7;
-
-    bkpX0 = t9cY0free.WindowX0;
-    bkpX1 = t9cY0free.WindowX1;
-    t9cY0free.WindowX0 = 430;
-
-    textSize = snprintf(text,120,
-        "\022\016\016"
-        "%%"
-        "\n\r"
-        "celsius"
-        "\n\r"
-        "rpm"
-        "\n\r"
-        "m/min"
-        "\n\r"
-        "Ampere"
-        "\n\r"
-        "Volt"
-//		"\n\r"
-//		"Wh"
-            );
-    GFX_write_string(&FontT42, &t9cY0free, text, 1);
-
-    t9cY0free.WindowX0 = bkpX0;
-    t9cY0free.WindowX1 = 420;
-
-    textSize = snprintf(text,120,
-        "\030"
-        "\002"
-        "%0u"
-        "\n\r"
-        "\002"
-        "%0.0f"
-        "\n\r"
-        "\002"
-        "%0u"
-        "\n\r"
-        "\002"
-        "%0.0f"
-        "\n\r"
-        "\002"
-        "%0u"
-        "\n\r"
-        "\002"
-        "%0.1f"
-//		"\n\r"
-//		"%0u"  "\022\016\016 Wh\017\030"
-        ,scooterResidualCapacity,scooterTemperature,scooterDrehzhl,scooterSpeed
-        ,scooterCurrent,scooterVoltage);//,scooterWattHours);
-
-    if((ageInMilliSeconds > 1500) || (stateUsed->lifeData.scooterType == 0xFF))
-    {
-        for(int i=0; i < textSize -2; i++)
-        {
-            if(text[i] == '\030')
-                text[i] = '\031';
-        }
-    }
-    GFX_write_string(&FontT42, &t9cY0free, text, 1);
-
-    t9cY0free.WindowX0 = bkpX0;
-    t9cY0free.WindowX1 = bkpX1;
-
-    t9cY0free.WindowY0 -= 30;
-    snprintf(text,60,
-        "\021\001%u"
-        ,ageInMilliSeconds);
-    GFX_write_string(&FontT24, &t9cY0free, text, 0);
-
-}
-
-
-void t9_compass(uint16_t ActualHeading, uint16_t UserSetHeading)
-{
-    uint16_t LeftBorderHeading, LineHeading;
-    uint32_t offsetPicture;
-    point_t start, stop, center;
-    static int32_t LastHeading = 0;
-    int32_t newHeading = 0;
-    int32_t diff = 0;
-    int32_t diff2 = 0;
-
-    int32_t diffAbs = 0;
-    int32_t diffAbs2 = 0;
-
-    newHeading = ActualHeading;
-
-    diff = newHeading - LastHeading;
-
-    if(newHeading < LastHeading)
-        diff2 = newHeading + 360 - LastHeading;
-    else
-        diff2 = newHeading - 360 - LastHeading;
-
-    diffAbs = diff;
-    if(diffAbs < 0)
-        diffAbs *= -1;
-
-    diffAbs2 = diff2;
-    if(diffAbs2 < 0)
-        diffAbs2 *= -1;
-
-
-    if(diffAbs <= diffAbs2)
-        newHeading = LastHeading + (diff / 2);
-    else
-        newHeading = LastHeading + (diff2 / 2);
-
-    if(newHeading < 0)
-        newHeading += 360;
-    else
-    if(newHeading >= 360)
-        newHeading -= 360;
-
-    LastHeading = newHeading;
-    ActualHeading = newHeading;
-
-    if (ActualHeading < 90)
-        ActualHeading += 360;
-
-    LeftBorderHeading = 2 * (ActualHeading - (CUSTOMBOX_SPACE_INSIDE/4));
-
-    offsetPicture = LeftBorderHeading * t9screenCompass.ImageHeight * 2;
-
-    t9_background.pointer = t9screenCompass.FBStartAdress+offsetPicture;
-    t9_background.x0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    t9_background.y0 = 65;
-    t9_background.width = CUSTOMBOX_SPACE_INSIDE;
-    t9_background.height = t9screenCompass.ImageHeight;
-
-    start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + (CUSTOMBOX_SPACE_INSIDE/2);
-    stop.x = start.x;
-    start.y = 65;
-    stop.y =  start.y + 55;
-    GFX_draw_line(&t9screen, start, stop, CLUT_Font030);
-
-
-    center.x = start.x;
-    center.y = 300;
-
-    stop.x = center.x + 44;
-    stop.y = center.y + 24;
-
-
-    while(ActualHeading > 359) ActualHeading -= 360;
-    LineHeading = 360 - ActualHeading;
-    GFX_draw_thick_line(9,&t9screen, t9_compass_circle(0,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font030); // North
-    LineHeading += 90;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(9,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031); // Maintick
-    LineHeading += 90;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(9,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-    LineHeading += 90;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(9,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-
-    LineHeading = 360 - ActualHeading;
-    LineHeading += 45;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(5,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
-    LineHeading += 90;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(5,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-    LineHeading += 90;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(5,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-    LineHeading += 90;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(5,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-
-    LineHeading = 360 - ActualHeading;
-    LineHeading += 22;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
-    LineHeading += 45;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-    LineHeading += 45;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-    LineHeading += 45;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-    LineHeading += 45;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
-    LineHeading += 45;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-    LineHeading += 45;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-    LineHeading += 45;
-    if(LineHeading > 359) LineHeading -= 360;
-    GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_Font031);
-
-    if(UserSetHeading)
-    {
-        LineHeading = UserSetHeading + 360 - ActualHeading;
-        if(LineHeading > 359) LineHeading -= 360;
-        GFX_draw_thick_line(9,&t9screen, t9_compass_circle(3,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_CompassUserHeadingTick);
-
-        // R�ckpeilung, User Back Heading
-        LineHeading = UserSetHeading + 360 + 180 - ActualHeading;
-        if(LineHeading > 359) LineHeading -= 360;
-        if(LineHeading > 359) LineHeading -= 360;
-        GFX_draw_thick_line(9,&t9screen, t9_compass_circle(3,LineHeading),  t9_compass_circle(2,LineHeading), CLUT_CompassUserBackHeadingTick);
-    }
-
-    center.x = start.x;
-    center.y = 250;
-    GFX_draw_circle(&t9screen, center, 116, CLUT_Font030);
-    GFX_draw_circle(&t9screen, center, 118, CLUT_Font030);
-    GFX_draw_circle(&t9screen, center, 117, CLUT_Font030);
-}
-
-
-void init_t9_compass(void)
-{
-    t9screenCompass.FBStartAdress = getFrame(26);
-
-    char text[256];
-    uint8_t textpointer = 0;
-
-    text[textpointer++] = '\030';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 76; // 90 - 14
-    text[textpointer++] = '\016';
-    text[textpointer++] = '\016';
-    text[textpointer++] = 'N';
-    text[textpointer++] = 'E'; // 96 + 28 = 124 total
-    text[textpointer++] = '\017';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 64; // 90 - 14 - 12
-    text[textpointer++] = 'E'; // 124 + 74 + 23 = 221 total
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 66; // 90 - 11 - 13
-    text[textpointer++] = '\016';
-    text[textpointer++] = '\016';
-    text[textpointer++] = 'S';
-    text[textpointer++] = 'E';
-    text[textpointer++] = '\017';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 68; // 90 - 12 - 10
-    text[textpointer++] = 'S';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 64; // 90 - 10 - 16
-    text[textpointer++] = '\016';
-    text[textpointer++] = '\016';
-    text[textpointer++] = 'S';
-    text[textpointer++] = 'W';
-    text[textpointer++] = '\017';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 56; // 90 - 16 - 18
-    text[textpointer++] = 'W';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 54; // 90 - 18 - 18
-    text[textpointer++] = '\016';
-    text[textpointer++] = '\016';
-    text[textpointer++] = 'N';
-    text[textpointer++] = 'W';
-    text[textpointer++] = '\017';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 59; // 90 - 17 - 14
-    text[textpointer++] = 'N';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 63; // 90 - 13 - 14
-    text[textpointer++] = '\016';
-    text[textpointer++] = '\016';
-    text[textpointer++] = 'N';
-    text[textpointer++] = 'E';
-    text[textpointer++] = '\017';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 64; // 90 - 14 - 12
-    text[textpointer++] = 'E';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 66; // 90 - 11 - 13
-    text[textpointer++] = '\016';
-    text[textpointer++] = '\016';
-    text[textpointer++] = 'S';
-    text[textpointer++] = 'E';
-    text[textpointer++] = '\017';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 68; // 90 - 12 - 10
-    text[textpointer++] = 'S';
-    text[textpointer++] = '\177';
-    text[textpointer++] = '\177';
-    text[textpointer++] = 64; // 90 - 10 - 16
-    text[textpointer++] = '\016';
-    text[textpointer++] = '\016';
-    text[textpointer++] = 'S';
-    text[textpointer++] = 'W';
-    text[textpointer++] = '\017';
-    text[textpointer++] = 0; // end
-
-    GFX_write_string(&FontT42,&t9pCompass,text,1);
-
-    releaseAllFramesExcept(26,t9screenCompass.FBStartAdress);
-}
-
-
-void t9_miniLiveLogProfile(void)
-{
-    SWindowGimpStyle wintemp;
-    wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
-    wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE;
-    wintemp.top = 480 - t9l1.WindowY0;
-    wintemp.bottom = wintemp. top + 200;
-
-    uint16_t max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 10);
-
-    GFX_graph_print(&t9screen, &wintemp, 0,1,0, max_depth, getMiniLiveLogbookPointerToData(), getMiniLiveLogbookActualDataLength(), CLUT_Font030, NULL);
-}
-
--- a/Discovery/Src/tComm.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/tComm.c	Sat Feb 23 21:10:51 2019 +0100
@@ -340,7 +340,6 @@
 
     char aTxBufferEscapeSequence[50] = "+++";
     // limit is 19 chars, with 7 chars shown in BLE advertising mode
-    //char aTxBufferName[50] = "AT+BNAME=BONEX-HW%4a\r";
     //________________________123456789012345678901
     char aTxBufferName[50] = "AT+BNAME=OSTC4-12345\r";
     char answerOkay[6] = "\r\nOKr\n";
@@ -908,10 +907,7 @@
         aTxBuffer[count++] = 0x00; // hardware descriptor HIGH byte
         aTxBuffer[count++] = 0x3B; // hardware descriptor LOW byte // 0x3B is OSTC4 //  0x1A is OTSC3
         aTxBuffer[count++] = 0x00; // feature descriptor HIGH byte
-        if(getLicence() == LICENCEBONEX)
-            aTxBuffer[count++] = 0x01; // feature descriptor LOW byte
-        else
-            aTxBuffer[count++] = 0x00; // feature descriptor LOW byte
+        aTxBuffer[count++] = 0x00; // feature descriptor LOW byte
         aTxBuffer[count++] = 0x43; // model id
         aTxBuffer[count++] = prompt4D4C(receiveStartByteUart);
         break;
--- a/Discovery/Src/tHome.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/tHome.c	Sat Feb 23 21:10:51 2019 +0100
@@ -92,14 +92,12 @@
     t4_init(); // game
     t5_init(); // gauge
     t6_init(); // apnea
-    t9_init(); // bonex
 }
 
 
 void tHome_init_compass(void)
 {
     init_t7_compass();
-    init_t9_compass();
 }
 
 
@@ -142,9 +140,6 @@
     if(pSettings->design == 7)
         t7_refresh();
     else
-    if(pSettings->design == 9)
-        t9_refresh();
-    else
     {
         pSettings->design = 7;
         t7_refresh();
@@ -349,8 +344,6 @@
     tHome_tick_count_field = 0;
     if(settingsGetPointer()->design == 7)
         t7_change_field();
-    if(settingsGetPointer()->design == 9)
-        t9_change_field();
 }
 
 
@@ -360,9 +353,6 @@
     if(settingsGetPointer()->design == 7)
         t7_change_customview();
     else
-    if(settingsGetPointer()->design == 9)
-        t9_change_customview();
-    else
     if(settingsGetPointer()->design == 3)
         t3_change_customview();
     else
--- a/Discovery/Src/tMenuEdit.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/tMenuEdit.c	Sat Feb 23 21:10:51 2019 +0100
@@ -250,16 +250,6 @@
         GFX_SetFrameTop(tMEscreen.FBStartAdress);
         releaseFrame(9,rememberPage);
     }
-/*
-    else if(get_globalState() == (StMHARD6_ScooterDrag & MaskFieldDigit))
-    {
-        uint32_t rememberPage = tMEscreen.FBStartAdress;
-        tMEscreen.FBStartAdress = getFrame(9);
-        refresh_ScooterControl();
-        GFX_SetFrameTop(tMEscreen.FBStartAdress);
-        releaseFrame(9,rememberPage);
-    }
-*/
     else if(get_globalState() == (StMSYS3_Units & MaskFieldDigit))
     {
         uint32_t rememberPage = tMEscreen.FBStartAdress;
--- a/Discovery/Src/tMenuEditHardware.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/tMenuEditHardware.c	Sat Feb 23 21:10:51 2019 +0100
@@ -29,7 +29,6 @@
 /* Includes ------------------------------------------------------------------*/
 #include "tMenuEditHardware.h"
 
-//#include "bonex4.h"
 #include "externCPU2bootloader.h"
 #include "gfx_fonts.h"
 #include "ostc.h"
@@ -48,7 +47,6 @@
 void openEdit_Brightness(void);
 //void openEdit_Luftintegration(void);
 void openEdit_ButtonSens(void);
-void openEdit_ScooterControl(void);
 void openEdit_FlipDisplay(void);
 
 /* Announced function prototypes -----------------------------------------------*/
@@ -62,11 +60,7 @@
 uint8_t OnAction_O2_Fallback	(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 uint8_t OnAction_Button			(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 uint8_t OnAction_ButtonBalance	(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
-uint8_t OnAction_ScooterDrag	(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
-uint8_t OnAction_ScooterLoad	(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
-uint8_t OnAction_ScooterBatt    (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 // nicht notwending uint8_t OnAction_Bluetooth				(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
-// nicht notwending uint8_t OnAction_ScooterControl		(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 
 /* Exported functions --------------------------------------------------------*/
 
@@ -94,14 +88,7 @@
         openEdit_ButtonSens();
     break;
     case 6:
-    	if(getLicence() == LICENCEBONEX)
-    	{
-    		openEdit_ScooterControl();
-    	}
-    	else
-    	{
-    		openEdit_FlipDisplay();
-    	}
+    	openEdit_FlipDisplay();
     break;
     }
 }
@@ -152,277 +139,6 @@
     exitEditWithUpdate();
     exitMenuEdit_to_Home();
 }
-/*
-void refresh_ScooterControl(void)
-{
-    char text[256];
-
-    text[0] = '\001';
-    text[1] = TXT_2BYTE;
-    text[2] = TXT2BYTE_ScooterSetup;
-    text[3] = 0;
-    write_topline(text);
-
-    // drag
-    text[0] = TXT_2BYTE;
-    text[1] = TXT2BYTE_ScooterDrag;
-    text[2] = 0;
-    write_label_var(  30, 180, ME_Y_LINE1, &FontT48, text);
-    // load
-    text[0] = TXT_2BYTE;
-    text[1] = TXT2BYTE_ScooterLoad;
-    text[2] = 0;
-    write_label_var(  30, 180, ME_Y_LINE2, &FontT48, text);
-    // batt type
-    text[0] = TXT_2BYTE;
-    text[1] = TXT2BYTE_ScooterBattTyp;
-    text[2] = 0;
-    write_label_var(  30, 180, ME_Y_LINE3, &FontT48, text);
-
-    // drag
-    text[0] = TXT_2BYTE;
-    text[1] = 0;
-    text[2] = 0;
-    switch(settingsGetPointer()->scooterDrag)
-    {
-        case 0:
-            text[1] = TXT2BYTE_ScooterD0Apnoe;
-            break;
-        case 1:
-            text[1] = TXT2BYTE_ScooterD1Scuba;
-            break;
-        case 2:
-            text[1] = TXT2BYTE_ScooterD2Tech;
-            break;
-        case 3:
-            text[1] = TXT2BYTE_ScooterD3Heavy;
-            break;
-        default:
-            snprintf(&text[4],3,"%02u",settingsGetPointer()->scooterDrag);
-        break;
-    }
-    write_label_var( 200, 700, ME_Y_LINE1, &FontT48, text);
-
-    // load
-    text[0] = TXT_2BYTE;
-    text[1] = 0;
-    text[2] = 0;
-    switch(settingsGetPointer()->scooterLoad)
-    {
-        case 0:
-            text[1] = TXT2BYTE_ScooterL0None;
-            break;
-        case 1:
-            text[1] = TXT2BYTE_ScooterL1Small;
-            break;
-        case 2:
-            text[1] = TXT2BYTE_ScooterL2Stages;
-            break;
-        case 3:
-            text[1] = TXT2BYTE_ScooterL3Full;
-            break;
-        case 4:
-            text[1] = TXT2BYTE_ScooterL4Towing;
-            break;
-        default:
-            snprintf(&text[4],3,"%02u",settingsGetPointer()->scooterLoad);
-        break;
-    }
-    write_label_var( 200, 700, ME_Y_LINE2, &FontT48, text);
-
-    //batt type
-
-//	txtptr = 0;
-//	txtptr += bo4GetBatteryName(text,settingsGetPointer()->scooterBattType);
-//	txtptr += snprintf(&text[txtptr],10," (%0.1f V)",bo4GetBatteryVoltage(settingsGetPointer()->scooterBattType));
-//	write_label_var( 200, 700, ME_Y_LINE3, &FontT48, text);
-}
-*/
-
-void getButtonText_ScooterControl(char *text, uint8_t * pointer)
-{
-
-    if((pointer != &settingsGetPointer()->scooterLoad) && (pointer != &settingsGetPointer()->scooterDrag))
-            return;
-
-    text[0] = TXT_2BYTE;
-    text[1] = 0;
-    text[2] = 0;
-
-    // drag
-    if(pointer == &settingsGetPointer()->scooterDrag)
-    {
-        switch(settingsGetPointer()->scooterDrag)
-        {
-        case 0:
-            text[1] = TXT2BYTE_ScooterD0Apnoe;
-            break;
-        case 1:
-            text[1] = TXT2BYTE_ScooterD1Scuba;
-            break;
-        case 2:
-            text[1] = TXT2BYTE_ScooterD2Tech;
-            break;
-        case 3:
-            text[1] = TXT2BYTE_ScooterD3Heavy;
-            break;
-        default:
-            snprintf(&text[4],3,"%02u",settingsGetPointer()->scooterDrag);
-            break;
-        }
-    }
-    else	// load
-    if(pointer == &settingsGetPointer()->scooterLoad)
-    {
-
-        switch(settingsGetPointer()->scooterLoad)
-        {
-            case 0:
-                text[1] = TXT2BYTE_ScooterL0None;
-                break;
-            case 1:
-                text[1] = TXT2BYTE_ScooterL1Small;
-                break;
-            case 2:
-                text[1] = TXT2BYTE_ScooterL2Stages;
-                break;
-            case 3:
-                text[1] = TXT2BYTE_ScooterL3Full;
-                break;
-            case 4:
-                text[1] = TXT2BYTE_ScooterL4Towing;
-                break;
-            default:
-                snprintf(&text[4],3,"%02u",settingsGetPointer()->scooterLoad);
-            break;
-        }
-    }
-}
-
-
-void openEdit_ScooterControl(void)
-{
-    char text[256];
-    uint16_t battWh;
-
-    text[0] = '\001';
-    text[1] = TXT_2BYTE;
-    text[2] = TXT2BYTE_ScooterSetup;
-    text[3] = 0;
-    write_topline(text);
-
-    // drag
-    text[0] = TXT_2BYTE;
-    text[1] = TXT2BYTE_ScooterDrag;
-    text[2] = 0;
-    write_label_var(  30, 180, ME_Y_LINE1, &FontT48, text);
-    // load
-    text[0] = TXT_2BYTE;
-    text[1] = TXT2BYTE_ScooterLoad;
-    text[2] = 0;
-    write_label_var(  30, 180, ME_Y_LINE2, &FontT48, text);
-    // batt type
-    text[0] = TXT_2BYTE;
-    text[1] = TXT2BYTE_ScooterBattTyp;
-    text[2] = 0;
-    write_label_var(  30, 180, ME_Y_LINE3, &FontT48, text);
-
-    getButtonText_ScooterControl(text,&settingsGetPointer()->scooterDrag);
-    write_field_button(StMHARD6_ScooterDrag,	200, 770, ME_Y_LINE1,  &FontT48, text);
-
-    getButtonText_ScooterControl(text,&settingsGetPointer()->scooterLoad);
-    write_field_button(StMHARD6_ScooterLoad,	200, 770, ME_Y_LINE2,  &FontT48, text);
-
-    battWh = settingsGetPointer()->scooterBattSize;
-    write_field_udigit(StMHARD6_ScooterBatt, 	200, 770, ME_Y_LINE3,	&FontT48, "####\016\016 Wh\017", battWh, 0, 0, 0);
-
-    setEvent(StMHARD6_ScooterDrag,		(uint32_t)OnAction_ScooterDrag);
-    setEvent(StMHARD6_ScooterLoad,		(uint32_t)OnAction_ScooterLoad);
-    setEvent(StMHARD6_ScooterBatt,		(uint32_t)OnAction_ScooterBatt);
-
-    write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
-}
-
-
-uint8_t OnAction_ScooterDrag(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
-{
-    char text[256];
-
-    settingsGetPointer()->scooterDrag = settingsGetPointer()->scooterDrag + 1;
-    if(settingsGetPointer()->scooterDrag > 3)
-        settingsGetPointer()->scooterDrag = 0;
-
-    getButtonText_ScooterControl(text,&settingsGetPointer()->scooterDrag);
-    tMenuEdit_newButtonText(editId, text);
-
-    return UPDATE_DIVESETTINGS;
-}
-
-
-uint8_t OnAction_ScooterLoad(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
-{
-    char text[256];
-
-    settingsGetPointer()->scooterLoad = settingsGetPointer()->scooterLoad + 1;
-    if(settingsGetPointer()->scooterLoad > 4)
-        settingsGetPointer()->scooterLoad = 0;
-
-    getButtonText_ScooterControl(text,&settingsGetPointer()->scooterLoad);
-    tMenuEdit_newButtonText(editId, text);
-
-    return UPDATE_DIVESETTINGS;
-}
-
-
-uint8_t OnAction_ScooterBatt(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
-{
-    uint8_t digitContentNew;
-    uint32_t newWh;
-
-    if(action == ACTION_BUTTON_ENTER)
-    {
-        return digitContent;
-    }
-    if(action == ACTION_BUTTON_ENTER_FINAL)
-    {
-        evaluateNewString(editId, &newWh, 0, 0, 0);
-
-        if(newWh < 300)
-            newWh = 300;
-        if(newWh > 5000)
-            newWh = 5000;
-
-        tMenuEdit_newInput(editId, newWh, 0, 0, 0);
-        settingsGetPointer()->scooterBattSize = newWh;
-        return UPDATE_DIVESETTINGS;
-    }
-    if(action == ACTION_BUTTON_NEXT)
-    {
-        digitContentNew = digitContent + 1;
-        if(digitNumber == 0)
-        {
-            if(digitContentNew > '5')
-                digitContentNew = '0';
-        }
-        else if(digitContentNew > '9')
-            digitContentNew = '0';
-        return digitContentNew;
-    }
-    if(action == ACTION_BUTTON_BACK)
-    {
-        digitContentNew = digitContent - 1;
-        if(digitNumber == 0)
-        {
-            if(digitContentNew < '0')
-                digitContentNew = '5';
-        }
-        else if(digitContentNew < '0')
-            digitContentNew = '9';
-        return digitContentNew;
-    }
-    return UNSPECIFIC_RETURN;
-}
-
 
 void refresh_CompassEdit(void)
 {
--- a/Discovery/Src/tMenuEditSystem.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/tMenuEditSystem.c	Sat Feb 23 21:10:51 2019 +0100
@@ -29,7 +29,7 @@
 /* Includes ------------------------------------------------------------------*/
 #include "tMenuEditSystem.h"
 
-#include "data_exchange_main.h" // for DataEX_scooterDataFound()
+#include "data_exchange_main.h"
 #include "externLogbookFlash.h"
 #include "gfx_fonts.h"
 #include "ostc.h"
@@ -768,10 +768,6 @@
     text[3] = ' ';
     switch(settingsGetPointer()->tX_customViewPrimary)
     {
-    case CVIEW_Scooter:
-        text[4] = TXT_2BYTE;
-        text[5] = TXT2BYTE_ScooterMonitor;
-        break;
     case CVIEW_sensors:
         text[4] = TXT_2BYTE;
         text[5] = TXT2BYTE_O2monitor;
@@ -937,9 +933,6 @@
     uint8_t newValue;
     switch(settingsGetPointer()->tX_customViewPrimary)
     {
-    case CVIEW_Scooter:
-        newValue = CVIEW_sensors;
-        break;
     case CVIEW_sensors:
         newValue = CVIEW_sensors_mV;
         break;
@@ -969,10 +962,7 @@
         break;
     case CVIEW_noneOrDebug:
     default:
-        if(getLicence() == LICENCEBONEX)
-            newValue = CVIEW_Scooter;
-        else
-            newValue = CVIEW_sensors;
+         newValue = CVIEW_sensors;
         break;
     }
     settingsGetPointer()->tX_customViewPrimary = newValue;
@@ -1411,13 +1401,6 @@
         snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage);
         write_label_var(  30, 800, ME_Y_LINE4, &FontT42, text);
 
-
-        if(DataEX_scooterDataFound())
-        {
-            snprintf(&text[0],30,"Ext: %01.1fV @ %01.1f \140C",stateUsed->lifeData.scooterSpannung, stateUsed->lifeData.scooterTemperature / 10.0f);
-            write_label_var(  30, 800, ME_Y_LINE5, &FontT42, text);
-        }
-
         snprintf(&text[0],30,"Code: %X",getLicence());
         write_label_var(  30, 800, ME_Y_LINE6, &FontT42, text);
         break;
--- a/Discovery/Src/tMenuHardware.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/tMenuHardware.c	Sat Feb 23 21:10:51 2019 +0100
@@ -29,7 +29,6 @@
 /* Includes ------------------------------------------------------------------*/
 #include "tMenu.h"
 #include "tMenuHardware.h"
-//#include "bonex4.h"
 
 //#define NEXTLINE(text, textPointer) 	{text[(textPointer)++] = '\n'; text[textPointer++] = '\r'; text[textPointer] = 0;}
 //	NEXTLINE(text,textPointer);
@@ -164,19 +163,6 @@
 
     if((line == 0) || (line == 6))
     {
-    	if(getLicence() == LICENCEBONEX)
-    	{
-			text[textPointer++] = TXT_2BYTE;
-			text[textPointer++] = TXT2BYTE_ScooterSetup;
-			text[textPointer++] = '\t';
-
-	//		textPointer += snprintf(&text[textPointer],25,"D%i  L%i  ",settingsGetPointer()->scooterDrag, settingsGetPointer()->scooterLoad);
-			textPointer += snprintf(&text[textPointer],25,"D%i  L%i  %i\016\016 Wh\017",settingsGetPointer()->scooterDrag, settingsGetPointer()->scooterLoad, settingsGetPointer()->scooterBattSize);
-	//		textPointer += bo4GetBatteryName(&text[textPointer], settingsGetPointer()->scooterBattType);
-			nextline(text,&textPointer);
-    	}
-    	else
-    	{
             text[textPointer++] = TXT_2BYTE;
             text[textPointer++] = TXT2BYTE_FLIPDISPLAY;
             text[textPointer++] = '\t';
@@ -186,7 +172,6 @@
                 text[textPointer++] = '\006';
             text[textPointer] = 0;
             nextline(text,&textPointer);
-    	}
     }
 
     return StMHARD;
--- a/Discovery/Src/tMenuSystem.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/tMenuSystem.c	Sat Feb 23 21:10:51 2019 +0100
@@ -274,9 +274,6 @@
 
     switch(customViewId)
     {
-    case CVIEW_Scooter:
-        text = TXT2BYTE_ScooterMonitor;
-        break;
     case CVIEW_sensors:
         text = TXT2BYTE_O2monitor;
         break;
--- a/Discovery/Src/text_multilanguage.c	Tue Feb 19 21:48:32 2019 +0100
+++ b/Discovery/Src/text_multilanguage.c	Sat Feb 23 21:10:51 2019 +0100
@@ -1079,13 +1079,6 @@
 static uint8_t text_IT_Warning[] = "Pericolo";
 static uint8_t text_ES_Warning[] = "Peligro";
 
-// Customview Header (Bonex Computer)
-static uint8_t text_EN_ScooterMonitor[] = "bonex";
-static uint8_t text_DE_ScooterMonitor[] = "";
-static uint8_t text_FR_ScooterMonitor[] = "";
-static uint8_t text_IT_ScooterMonitor[] = "Bonex DPV";
-static uint8_t text_ES_ScooterMonitor[] = "bonex";
-
 // Menu SYS2 sub Information
 static uint8_t text_EN_Usage_Battery[] = "Battery life";
 static uint8_t text_DE_Usage_Battery[] = "Batterie-Nutzung";
@@ -1199,125 +1192,6 @@
 static uint8_t text_IT_Saturday[] = "Sabato";
 static uint8_t text_ES_Saturday[] = "Sábado";
 
-// Dive Mode und Customview Content (Bonex Computer)
-static uint8_t text_EN_ScooterRestkapazitaet[] = "Battery Capacity";
-static uint8_t text_DE_ScooterRestkapazitaet[] = "Batterie Kapazität";
-static uint8_t text_FR_ScooterRestkapazitaet[] = "Charge Batterie";     // Ok for "...  = 35%"
-static uint8_t text_IT_ScooterRestkapazitaet[] = "Carica Batteria";
-static uint8_t text_ES_ScooterRestkapazitaet[] = "Capacidad carga";
-
-// Dive Mode und Customview Content (Bonex Computer)
-static uint8_t text_EN_ScooterTemperature[] = "Motor Temp.";
-static uint8_t text_DE_ScooterTemperature[] = "";
-static uint8_t text_FR_ScooterTemperature[] = "Temp. moteur"; // "Température moteur";
-static uint8_t text_IT_ScooterTemperature[] = "Temp. Motore";
-static uint8_t text_ES_ScooterTemperature[] = "Temp. del motor";
-
-// Dive Mode und Customview Content (Bonex Computer)
-static uint8_t text_EN_ScooterSpeed[] = "Speed";
-static uint8_t text_DE_ScooterSpeed[] = "Geschwindigkeit";
-static uint8_t text_FR_ScooterSpeed[] = "Vitesse";
-static uint8_t text_IT_ScooterSpeed[] = "Velocita";
-static uint8_t text_ES_ScooterSpeed[] = "Velocidad";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterSetup[] = "Bonex Setup";
-static uint8_t text_DE_ScooterSetup[] = "";
-static uint8_t text_FR_ScooterSetup[] = "Config. Bonex"; // "Configuration Bonex";
-static uint8_t text_IT_ScooterSetup[] = "Settaggio DPV";
-static uint8_t text_ES_ScooterSetup[] = "Configuración Bonex";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterDrag[] = "Drag";
-static uint8_t text_DE_ScooterDrag[] = "";
-static uint8_t text_FR_ScooterDrag[] = "";// "Traction";  // ?? No!! The traction force ? inhibition hw
-static uint8_t text_IT_ScooterDrag[] = "Spinta";
-static uint8_t text_ES_ScooterDrag[] = "Arrastre";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterLoad[] = "Load";
-static uint8_t text_DE_ScooterLoad[] = "";
-static uint8_t text_FR_ScooterLoad[] = ""; // "Charge";    // ?? Kg
-static uint8_t text_IT_ScooterLoad[] = "Caricamento";
-static uint8_t text_ES_ScooterLoad[] = "Carga";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterVolt[] = "Voltage";
-static uint8_t text_DE_ScooterVolt[] = "Spannung";
-static uint8_t text_FR_ScooterVolt[] = "";
-static uint8_t text_IT_ScooterVolt[] = "Voltaggio";
-static uint8_t text_ES_ScooterVolt[] = "Voltaje";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterD0Apnoe[] = "Apnea";
-static uint8_t text_DE_ScooterD0Apnoe[] = "Apnoe";
-static uint8_t text_FR_ScooterD0Apnoe[] = "Apnée";
-static uint8_t text_IT_ScooterD0Apnoe[] = "Apnea";
-static uint8_t text_ES_ScooterD0Apnoe[] = "Apnea";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterD1Scuba[] = "Scuba";
-static uint8_t text_DE_ScooterD1Scuba[] = "";
-static uint8_t text_FR_ScooterD1Scuba[] = "Plongée";
-static uint8_t text_IT_ScooterD1Scuba[] = "Immersione";
-static uint8_t text_ES_ScooterD1Scuba[] = "Buceo";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterD2Tech[] = "Tech";
-static uint8_t text_DE_ScooterD2Tech[] = "";
-static uint8_t text_FR_ScooterD2Tech[] = ""; // Technique
-static uint8_t text_IT_ScooterD2Tech[] = "Immersione tecnica";
-static uint8_t text_ES_ScooterD2Tech[] = "Técnico";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterD3Heavy[] = "Heavy Tech";
-static uint8_t text_DE_ScooterD3Heavy[] = "";
-static uint8_t text_FR_ScooterD3Heavy[] = "";// Technique engagée
-static uint8_t text_IT_ScooterD3Heavy[] = "Immersione profonda";
-static uint8_t text_ES_ScooterD3Heavy[] = "Técnico intenso";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterL0None[] = "none gear";
-static uint8_t text_DE_ScooterL0None[] = "";
-static uint8_t text_FR_ScooterL0None[] = "sans";
-static uint8_t text_IT_ScooterL0None[] = "in Folle";
-static uint8_t text_ES_ScooterL0None[] = "Punto muerto";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterL1Small[] = "Monotank / small double";
-static uint8_t text_DE_ScooterL1Small[] = "";
-static uint8_t text_FR_ScooterL1Small[] = "Mono / petit bi";
-static uint8_t text_IT_ScooterL1Small[] = "Mono / Bibo";
-static uint8_t text_ES_ScooterL1Small[] = "Monobotella / Bibotella";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterL2Stages[] = "Rebreather & Stages";
-static uint8_t text_DE_ScooterL2Stages[] = "";
-static uint8_t text_FR_ScooterL2Stages[] = "Recycleur";
-static uint8_t text_IT_ScooterL2Stages[] = "Rebreather & Stage";
-static uint8_t text_ES_ScooterL2Stages[] = "Rebreather y estapa";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterL3Full[] = "Multistage & Backup";
-static uint8_t text_DE_ScooterL3Full[] = "";
-static uint8_t text_FR_ScooterL3Full[] = "Multi-blocs & backup";
-static uint8_t text_IT_ScooterL3Full[] = "Immersione multigas";
-static uint8_t text_ES_ScooterL3Full[] = "Multi etapa";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterL4Towing[] = "Towing";
-static uint8_t text_DE_ScooterL4Towing[] = "";
-static uint8_t text_FR_ScooterL4Towing[] = "Remorquage";
-static uint8_t text_IT_ScooterL4Towing[] = "Traino";
-static uint8_t text_ES_ScooterL4Towing[] = "Remolque";
-
-// Menu SYS1 (Bonex Computer)
-static uint8_t text_EN_ScooterBattTyp[] = "Accu";
-static uint8_t text_DE_ScooterBattTyp[] = "";
-static uint8_t text_FR_ScooterBattTyp[] = "";
-static uint8_t text_IT_ScooterBattTyp[] = "";
-static uint8_t text_ES_ScooterBattTyp[] = "";
-
 // Menu SYS1 sub (Sensors)
 static uint8_t text_EN_HUDBattery[] = "HUD battery";
 static uint8_t text_DE_HUDBattery[] = "HUD-Batterie";
@@ -1838,9 +1712,6 @@
     {(uint8_t)TXT2BYTE_Thursday,		{text_EN_Thursday, text_DE_Thursday, text_FR_Thursday, text_IT_Thursday, text_ES_Thursday}},
     {(uint8_t)TXT2BYTE_Friday,			{text_EN_Friday, text_DE_Friday, text_FR_Friday, text_IT_Friday, text_ES_Friday}},
     {(uint8_t)TXT2BYTE_Saturday,		{text_EN_Saturday, text_DE_Saturday, text_FR_Saturday, text_IT_Saturday, text_ES_Saturday}},
-    {(uint8_t)TXT2BYTE_ScooterRestkapazitaet,{text_EN_ScooterRestkapazitaet, text_DE_ScooterRestkapazitaet, text_FR_ScooterRestkapazitaet, text_IT_ScooterRestkapazitaet, text_ES_ScooterRestkapazitaet}},
-    {(uint8_t)TXT2BYTE_ScooterTemperature,{text_EN_ScooterTemperature, text_DE_ScooterTemperature, text_FR_ScooterTemperature, text_IT_ScooterTemperature, text_ES_ScooterTemperature}},
-    {(uint8_t)TXT2BYTE_ScooterSpeed,	{text_EN_ScooterSpeed, text_DE_ScooterSpeed, text_FR_ScooterSpeed, text_IT_ScooterSpeed, text_ES_ScooterSpeed}},
     {(uint8_t)TXT2BYTE_Layout,			{text_EN_Design, text_DE_Design, text_FR_Design, text_IT_Design, text_ES_Design}},
     {(uint8_t)TXT2BYTE_Units,			{text_EN_Units, text_DE_Units, text_FR_Units, text_IT_Units, text_ES_Units}},
     {(uint8_t)TXT2BYTE_Units_metric,	{text_EN_Design_t7_metric, text_DE_Design_t7_metric, text_FR_Design_t7_metric, text_IT_Design_t7_metric, text_ES_Design_t7_metric}},
@@ -1865,23 +1736,8 @@
     {(uint8_t)TXT2BYTE_DecoDataLost,	{text_EN_DecoDataLost, text_DE_DecoDataLost, text_FR_DecoDataLost, text_IT_DecoDataLost, text_ES_DecoDataLost}},
     {(uint8_t)TXT2BYTE_Info,			{text_EN_Info, text_DE_Info, text_FR_Info, text_IT_Info, text_ES_Info}},
     {(uint8_t)TXT2BYTE_Korrekturwerte,  {text_EN_Korrekturwerte, text_DE_Korrekturwerte, text_FR_Korrekturwerte, text_IT_Korrekturwerte, text_ES_Korrekturwerte}},
-    {(uint8_t)TXT2BYTE_ScooterMonitor,  {text_EN_ScooterMonitor, text_DE_ScooterMonitor, text_FR_ScooterMonitor, text_IT_ScooterMonitor, text_ES_ScooterMonitor}},
     {(uint8_t)TXT2BYTE_SetBearing,		{text_EN_SetBearing, text_DE_SetBearing, text_FR_SetBearing, text_IT_SetBearing, text_ES_SetBearing}},
     {(uint8_t)TXT2BYTE_ResetBearing,	{text_EN_ResetBearing, text_DE_ResetBearing, text_FR_ResetBearing, text_IT_ResetBearing, text_ES_ResetBearing}},
-    {(uint8_t)TXT2BYTE_ScooterSetup,	{text_EN_ScooterSetup, text_DE_ScooterSetup, text_FR_ScooterSetup, text_IT_ScooterSetup, text_ES_ScooterSetup}},
-    {(uint8_t)TXT2BYTE_ScooterDrag,		{text_EN_ScooterDrag, text_DE_ScooterDrag, text_FR_ScooterDrag, text_IT_ScooterDrag, text_ES_ScooterDrag}},
-    {(uint8_t)TXT2BYTE_ScooterLoad,		{text_EN_ScooterLoad, text_DE_ScooterLoad, text_FR_ScooterLoad, text_IT_ScooterLoad, text_ES_ScooterLoad}},
-    {(uint8_t)TXT2BYTE_ScooterD0Apnoe,  {text_EN_ScooterD0Apnoe, text_DE_ScooterD0Apnoe, text_FR_ScooterD0Apnoe, text_IT_ScooterD0Apnoe, text_ES_ScooterD0Apnoe}},
-    {(uint8_t)TXT2BYTE_ScooterD1Scuba,  {text_EN_ScooterD1Scuba, text_DE_ScooterD1Scuba, text_FR_ScooterD1Scuba, text_IT_ScooterD1Scuba, text_ES_ScooterD1Scuba}},
-    {(uint8_t)TXT2BYTE_ScooterD2Tech,	{text_EN_ScooterD2Tech, text_DE_ScooterD2Tech, text_FR_ScooterD2Tech, text_IT_ScooterD2Tech, text_ES_ScooterD2Tech}},
-    {(uint8_t)TXT2BYTE_ScooterD3Heavy,  {text_EN_ScooterD3Heavy, text_DE_ScooterD3Heavy, text_FR_ScooterD3Heavy, text_IT_ScooterD3Heavy, text_ES_ScooterD3Heavy}},
-    {(uint8_t)TXT2BYTE_ScooterL0None,	{text_EN_ScooterL0None, text_DE_ScooterL0None, text_FR_ScooterL0None, text_IT_ScooterL0None, text_ES_ScooterL0None}},
-    {(uint8_t)TXT2BYTE_ScooterL1Small,  {text_EN_ScooterL1Small, text_DE_ScooterL1Small, text_FR_ScooterL1Small, text_IT_ScooterL1Small, text_ES_ScooterL1Small}},
-    {(uint8_t)TXT2BYTE_ScooterL2Stages, {text_EN_ScooterL2Stages, text_DE_ScooterL2Stages, text_FR_ScooterL2Stages, text_IT_ScooterL2Stages, text_ES_ScooterL2Stages}},
-    {(uint8_t)TXT2BYTE_ScooterL3Full,	{text_EN_ScooterL3Full, text_DE_ScooterL3Full, text_FR_ScooterL3Full, text_IT_ScooterL3Full, text_ES_ScooterL3Full}},
-    {(uint8_t)TXT2BYTE_ScooterL4Towing, {text_EN_ScooterL4Towing, text_DE_ScooterL4Towing, text_FR_ScooterL4Towing, text_IT_ScooterL4Towing, text_ES_ScooterL4Towing}},
-    {(uint8_t)TXT2BYTE_ScooterBattTyp,  {text_EN_ScooterBattTyp, text_DE_ScooterBattTyp, text_FR_ScooterBattTyp, text_IT_ScooterBattTyp, text_ES_ScooterBattTyp}},
-    {(uint8_t)TXT2BYTE_ScooterVolt,		{text_EN_ScooterVolt, text_DE_ScooterVolt, text_FR_ScooterVolt, text_IT_ScooterVolt, text_ES_ScooterVolt}},
     {(uint8_t)TXT2BYTE_Sensor,			{text_EN_SensorList, text_DE_SensorList, text_FR_SensorList, text_IT_SensorList, text_ES_SensorList}},
     {(uint8_t)TXT2BYTE_Maintenance,		{text_EN_Maintenance, text_DE_Maintenance, text_FR_Maintenance, text_IT_Maintenance, text_ES_Maintenance}},
     {(uint8_t)TXT2BYTE_SetBatteryCharge,{text_EN_SetBatteryCharge, text_DE_SetBatteryCharge, text_FR_SetBatteryCharge, text_IT_SetBatteryCharge, text_ES_SetBatteryCharge}},