Mercurial > public > ostc4
comparison 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 |
comparison
equal
deleted
inserted
replaced
659:0a915a789873 | 660:f4b553da620a |
---|---|
32 #include "data_exchange_main.h" | 32 #include "data_exchange_main.h" |
33 #include "externLogbookFlash.h" | 33 #include "externLogbookFlash.h" |
34 #include "gfx_fonts.h" | 34 #include "gfx_fonts.h" |
35 #include "ostc.h" | 35 #include "ostc.h" |
36 #include "settings.h" // for getLicence() | 36 #include "settings.h" // for getLicence() |
37 #include "tComm.h" | |
37 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() | 38 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() |
38 #include "tMenu.h" | 39 #include "tMenu.h" |
39 #include "tMenuEdit.h" | 40 #include "tMenuEdit.h" |
40 #include "tMenuSystem.h" | 41 #include "tMenuSystem.h" |
41 #include "tMenuEditCustom.h" | 42 #include "tMenuEditCustom.h" |
84 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 85 uint8_t OnAction_ResetLogbook (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
85 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 86 uint8_t OnAction_RebootMainCPU (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
86 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 87 uint8_t OnAction_Nothing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
87 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 88 uint8_t OnAction_LogbookOffset(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
88 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 89 uint8_t OnAction_SetFactoryDefaults(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
90 uint8_t OnAction_ResetBluetooth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
89 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 91 uint8_t OnAction_SetBatteryCharge(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
90 #ifdef ENABLE_ANALYSE_SAMPLES | 92 #ifdef ENABLE_ANALYSE_SAMPLES |
91 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 93 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
92 #endif | 94 #endif |
93 #ifdef SCREENTEST | 95 #ifdef SCREENTEST |
1071 text[0] = TXT_2BYTE; | 1073 text[0] = TXT_2BYTE; |
1072 text[1] = TXT2BYTE_SetFactoryDefaults; | 1074 text[1] = TXT2BYTE_SetFactoryDefaults; |
1073 text[2] = 0; | 1075 text[2] = 0; |
1074 write_field_button(StMSYS5_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); | 1076 write_field_button(StMSYS5_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); |
1075 | 1077 |
1078 text[0] = TXT_2BYTE; | |
1079 text[1] = TXT2BYTE_ResetBluetooth; | |
1080 text[2] = 0; | |
1081 write_field_button(StMSYS5_ResetBluetooth, 30, 800, ME_Y_LINE3, &FontT48, text); | |
1082 | |
1076 #ifdef ENABLE_ANALYSE_SAMPLES | 1083 #ifdef ENABLE_ANALYSE_SAMPLES |
1077 text[0] = TXT_2BYTE; | 1084 text[0] = TXT_2BYTE; |
1078 text[1] = TXT2BYTE_SetSampleIndex; | 1085 text[1] = TXT2BYTE_SetSampleIndex; |
1079 text[2] = 0; | 1086 text[2] = 0; |
1080 write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text); | 1087 write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE4, &FontT48, text); |
1081 #endif | 1088 #endif |
1082 | 1089 |
1083 | 1090 |
1084 if(stateRealGetPointer()->lifeData.battery_charge == 0) | 1091 if(stateRealGetPointer()->lifeData.battery_charge == 0) |
1085 { | 1092 { |
1093 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text); | 1100 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text); |
1094 #endif | 1101 #endif |
1095 | 1102 |
1096 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); | 1103 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
1097 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | 1104 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); |
1105 setEvent(StMSYS5_ResetBluetooth, (uint32_t)OnAction_ResetBluetooth); | |
1098 #ifdef ENABLE_ANALYSE_SAMPLES | 1106 #ifdef ENABLE_ANALYSE_SAMPLES |
1099 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); | 1107 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
1100 #endif | 1108 #endif |
1101 setEvent(StMSYS5_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); | 1109 setEvent(StMSYS5_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); |
1102 } | 1110 } |
1103 else | 1111 else |
1104 { | 1112 { |
1105 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); | 1113 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); |
1106 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); | 1114 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); |
1115 setEvent(StMSYS5_ResetBluetooth, (uint32_t)OnAction_ResetBluetooth); | |
1107 #ifdef ENABLE_ANALYSE_SAMPLES | 1116 #ifdef ENABLE_ANALYSE_SAMPLES |
1108 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); | 1117 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); |
1109 #endif | 1118 #endif |
1110 } | 1119 } |
1111 // write_field_button(StMSYS5_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); | 1120 // write_field_button(StMSYS5_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); |
1222 { | 1231 { |
1223 settingsWriteFactoryDefaults(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance); | 1232 settingsWriteFactoryDefaults(settingsGetPointer()->ButtonResponsiveness[3], settingsGetPointer()->buttonBalance); |
1224 return EXIT_TO_MENU; | 1233 return EXIT_TO_MENU; |
1225 } | 1234 } |
1226 | 1235 |
1236 uint8_t OnAction_ResetBluetooth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
1237 { | |
1238 tComm_Set_Bluetooth_Name(1); | |
1239 | |
1240 return EXIT_TO_MENU; | |
1241 } | |
1242 | |
1227 #ifdef ENABLE_ANALYSE_SAMPLES | 1243 #ifdef ENABLE_ANALYSE_SAMPLES |
1228 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | 1244 uint8_t OnAction_RecoverSampleIdx(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
1229 { | 1245 { |
1230 char text[32]; | 1246 char text[32]; |
1231 uint8_t openSec; | 1247 uint8_t openSec; |