Mercurial > public > ostc4
annotate Discovery/Src/tMenuCvOption.c @ 1082:1aa45000f92c Icon_Integration tip
Added configuration menu for HUD functions:
The V1 HUD has 4 functions (holes) which may be realized by one or two LEDs. The functions (like ppo2 monitoring or ascent speed) may be configurated by the diver using the HUD menu. The functions which may be selected depend on the HW configuration (e.g. the connected sensors) and the number of LEDs which are needed to realize the function. The previous HUD test implementation may still be activate usind the compile switch ENABLE_HUD_TESTING
| author | Ideenmodellierer |
|---|---|
| date | Sun, 15 Mar 2026 21:40:35 +0100 |
| parents | b4a79464caf7 |
| children |
| rev | line source |
|---|---|
| 999 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Src/tMenuCvOption.c | |
| 5 /// \brief Main Template file for Menu Page System settings | |
| 6 /// \author heinrichs weikamp gmbh | |
| 7 /// \date 24-Apr-2025 | |
| 8 /// | |
| 9 /// \details | |
| 10 /// | |
| 11 /// $Id$ | |
| 12 /////////////////////////////////////////////////////////////////////////////// | |
| 13 /// \par Copyright (c) 2014-2025 Heinrichs Weikamp gmbh | |
| 14 /// | |
| 15 /// This program is free software: you can redistribute it and/or modify | |
| 16 /// it under the terms of the GNU General Public License as published by | |
| 17 /// the Free Software Foundation, either version 3 of the License, or | |
| 18 /// (at your option) any later version. | |
| 19 /// | |
| 20 /// This program is distributed in the hope that it will be useful, | |
| 21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 23 /// GNU General Public License for more details. | |
| 24 /// | |
| 25 /// You should have received a copy of the GNU General Public License | |
| 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 27 ////////////////////////////////////////////////////////////////////////////// | |
| 28 | |
| 29 /* Includes ------------------------------------------------------------------*/ | |
| 30 #include "tMenu.h" | |
| 31 #include "tMenuCvOption.h" | |
| 1071 | 32 #include "tMenuCvOptionText.h" |
| 999 | 33 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() |
| 34 #include "t7.h" | |
| 35 | |
| 36 /* Private function prototypes -----------------------------------------------*/ | |
| 37 | |
| 38 /* Exported functions --------------------------------------------------------*/ | |
| 39 | |
| 1071 | 40 |
| 999 | 41 uint32_t tMCvOption_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext) |
| 42 { | |
| 43 uint8_t textPointer; | |
| 1071 | 44 refreshFunc_t* pRefreshTable; |
| 45 uint8_t activeLines; | |
| 46 uint8_t index = 0; | |
| 999 | 47 textPointer = 0; |
| 1071 | 48 *tab = 450; |
| 999 | 49 *subtext = 0; |
| 50 | |
| 51 resetLineMask(StMOption); | |
| 52 | |
| 1071 | 53 activeLines = tMCvOptText_GetTableItemCnt(); |
| 54 pRefreshTable = tMCvOptText_GetTable(); | |
| 999 | 55 |
| 1071 | 56 for(index = 1; index <= activeLines; index++) |
| 57 { | |
| 58 if((line == 0) || (index == line)) | |
| 59 { | |
| 60 textPointer += pRefreshTable[index - 1](&text[textPointer]); | |
| 61 } | |
| 62 nextline(text,&textPointer); | |
| 63 } | |
| 64 text[textPointer] = 0; | |
| 1032 | 65 |
| 999 | 66 return StMOption; |
| 67 } | |
| 68 void tMCvOption_checkLineStatus(void) | |
| 69 { | |
| 70 uint8_t localLineMask = 0; | |
|
1001
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
71 uint8_t lineMask = getLineMask(StMOption); |
|
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
72 |
| 999 | 73 if(t7_customview_disabled(CVIEW_Timer)) |
| 74 { | |
| 75 localLineMask |= 1 << 2; | |
| 76 } | |
|
1001
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
77 |
| 999 | 78 if(lineMask != localLineMask) |
| 79 { | |
| 80 updateMenu(); | |
| 81 } | |
| 82 } | |
| 83 | |
| 84 /* Private functions ---------------------------------------------------------*/ |
