Mercurial > public > ostc4
diff Discovery/Src/tMenuEditSystem.c @ 660:f4b553da620a
Add option to reset bluetooth name
author | heinrichsweikamp |
---|---|
date | Sun, 08 Aug 2021 09:36:23 +0200 |
parents | 0fc1b47d2482 |
children | 87bee7cc77b3 |
line wrap: on
line diff
--- 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) {