Mercurial > public > ostc4
changeset 660:f4b553da620a
Add option to reset bluetooth name
author | heinrichsweikamp |
---|---|
date | Sun, 08 Aug 2021 09:36:23 +0200 |
parents | 0a915a789873 |
children | 87bee7cc77b3 |
files | Discovery/Inc/tStructure.h Discovery/Inc/text_multilanguage.h Discovery/Src/t7.c Discovery/Src/tMenuEditSystem.c Discovery/Src/text_multilanguage.c ostc4pack/create_full_update_bin.sh |
diffstat | 6 files changed, 40 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/Discovery/Inc/tStructure.h Wed Apr 28 09:47:25 2021 +0200 +++ b/Discovery/Inc/tStructure.h Sun Aug 08 09:36:23 2021 +0200 @@ -310,7 +310,8 @@ #define StMSYS5_RebootMainCPU _MB(2,8,5,9,0) #define StMSYS5_ScreenTest _MB(2,8,5,10,0) #define StMSYS5_SetFactoryBC _MB(2,8,5,11,0) -#define StMSYS5_SetSampleIndx _MB(2,8,5,12,0) +#define StMSYS5_ResetBluetooth _MB(2,8,5,12,0) +#define StMSYS5_SetSampleIndx _MB(2,8,5,13,0) /* PAGE 9 */
--- a/Discovery/Inc/text_multilanguage.h Wed Apr 28 09:47:25 2021 +0200 +++ b/Discovery/Inc/text_multilanguage.h Sun Aug 08 09:36:23 2021 +0200 @@ -308,6 +308,7 @@ TXT2BYTE_Maintenance, TXT2BYTE_SetBatteryCharge, TXT2BYTE_SetFactoryDefaults, + TXT2BYTE_ResetBluetooth, TXT2BYTE_SetSampleIndex, TXT2BYTE_Reboot, TXT2BYTE_ButtonLeft,
--- a/Discovery/Src/t7.c Wed Apr 28 09:47:25 2021 +0200 +++ b/Discovery/Src/t7.c Sun Aug 08 09:36:23 2021 +0200 @@ -35,6 +35,7 @@ #include "gfx_fonts.h" #include "logbook_miniLive.h" #include "math.h" +#include "tComm.h" #include "tHome.h" #include "simulation.h" #include "timer.h" @@ -743,8 +744,11 @@ } else */ - if(DataEX_was_power_on()) + if(DataEX_was_power_on()) { GFX_write_string_color(&FontT42,&t7surfaceR,"cold start",4,CLUT_WarningRed); + // Reset the bluetooth interface after a cold start + tComm_Set_Bluetooth_Name(1); + } /* time and date */ translateDate(stateUsed->lifeData.dateBinaryFormat, &Sdate); @@ -1610,7 +1614,8 @@ uint8_t t7_change_customview(uint8_t action) { uint8_t *pViews; - uint8_t *pStartView,*pCurView, *pLastView; + uint8_t *pStartView,*pLastView; + uint8_t *pCurView = NULL; _Bool cv_disabled = 0; if(stateUsed->mode == MODE_DIVE)
--- a/Discovery/Src/tMenuEditSystem.c Wed Apr 28 09:47:25 2021 +0200 +++ b/Discovery/Src/tMenuEditSystem.c Sun Aug 08 09:36:23 2021 +0200 @@ -34,6 +34,7 @@ #include "gfx_fonts.h" #include "ostc.h" #include "settings.h" // for getLicence() +#include "tComm.h" #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() #include "tMenu.h" #include "tMenuEdit.h" @@ -86,6 +87,7 @@ uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +uint8_t OnAction_ResetBluetooth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); #ifdef ENABLE_ANALYSE_SAMPLES uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); @@ -1073,11 +1075,16 @@ text[2] = 0; write_field_button(StMSYS5_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); + text[0] = TXT_2BYTE; + text[1] = TXT2BYTE_ResetBluetooth; + text[2] = 0; + write_field_button(StMSYS5_ResetBluetooth, 30, 800, ME_Y_LINE3, &FontT48, text); + #ifdef ENABLE_ANALYSE_SAMPLES text[0] = TXT_2BYTE; text[1] = TXT2BYTE_SetSampleIndex; text[2] = 0; - write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text); + write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE4, &FontT48, text); #endif @@ -1095,6 +1102,7 @@ setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); + setEvent(StMSYS5_ResetBluetooth, (uint32_t)OnAction_ResetBluetooth); #ifdef ENABLE_ANALYSE_SAMPLES setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); #endif @@ -1104,6 +1112,7 @@ { setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); + setEvent(StMSYS5_ResetBluetooth, (uint32_t)OnAction_ResetBluetooth); #ifdef ENABLE_ANALYSE_SAMPLES setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); #endif @@ -1224,6 +1233,13 @@ return EXIT_TO_MENU; } +uint8_t OnAction_ResetBluetooth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + tComm_Set_Bluetooth_Name(1); + + return EXIT_TO_MENU; +} + #ifdef ENABLE_ANALYSE_SAMPLES uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) {
--- a/Discovery/Src/text_multilanguage.c Wed Apr 28 09:47:25 2021 +0200 +++ b/Discovery/Src/text_multilanguage.c Sun Aug 08 09:36:23 2021 +0200 @@ -632,6 +632,13 @@ static uint8_t text_ES_SetFactoryDefaults[] = "Restablecer ajustes de fábrica"; // Menu SYS2 sub +static uint8_t text_EN_ResetBluetooth[] = "Reset bluetooth interface"; +static uint8_t text_DE_ResetBluetooth[] = "Bluetooth interface zurüchsetzen"; +static uint8_t text_FR_ResetBluetooth[] = ""; +static uint8_t text_IT_ResetBluetooth[] = ""; +static uint8_t text_ES_ResetBluetooth[] = ""; + +// Menu SYS2 sub static uint8_t text_EN_SetSampleIndex[] = "Analyse log memory"; static uint8_t text_DE_SetSampleIndex[] = "Prüfe Logbuchspeicher"; static uint8_t text_FR_SetSampleIndex[] = "Maintain log memory"; @@ -1928,6 +1935,7 @@ {(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}}, {(uint8_t)TXT2BYTE_SetFactoryDefaults,{text_EN_SetFactoryDefaults, text_DE_SetFactoryDefaults, text_FR_SetFactoryDefaults, text_IT_SetFactoryDefaults, text_ES_SetFactoryDefaults}}, + {(uint8_t)TXT2BYTE_ResetBluetooth, {text_EN_ResetBluetooth, text_DE_ResetBluetooth, text_FR_ResetBluetooth, text_IT_ResetBluetooth, text_ES_ResetBluetooth}}, {(uint8_t)TXT2BYTE_SetSampleIndex, {text_EN_SetSampleIndex, text_DE_SetSampleIndex, text_FR_SetSampleIndex, text_IT_SetSampleIndex, text_ES_SetSampleIndex}}, {(uint8_t)TXT2BYTE_Reboot, {text_EN_Reboot, text_DE_Reboot, text_FR_Reboot, text_IT_Reboot, text_ES_Reboot}},
--- a/ostc4pack/create_full_update_bin.sh Wed Apr 28 09:47:25 2021 +0200 +++ b/ostc4pack/create_full_update_bin.sh Sun Aug 08 09:36:23 2021 +0200 @@ -5,15 +5,15 @@ # # the build products are here -BUILD_PATH="$HOME/OSTC4workspace" +BUILD_PATH="$HOME/ac6_workspace" # Debug or Release build -BUILD_TYPE="Release" +BUILD_TYPE="Debug" # build project names -CPU1_DISCOVERY="CPU1-Discovery" -CPU1_FONTPACK="CPU1-FontPack" -CPU2_RTE="CPU2-RTE" +CPU1_DISCOVERY="ostc4_discovery" +CPU1_FONTPACK="ostc4_fontpack" +CPU2_RTE="ostc4_rte" # # End of path and file name settings