506
+ − 1 ///////////////////////////////////////////////////////////////////////////////
+ − 2 /// -*- coding: UTF-8 -*-
+ − 3 ///
+ − 4 /// \file Discovery/Src/tMenuCustom.c
+ − 5 /// \brief Menu Custom - Provide access to custom view options
+ − 6 /// \author heinrichs weikamp gmbh
+ − 7 /// \date 25-Aug-2020
+ − 8 ///
+ − 9 /// \details
+ − 10 ///
+ − 11 /// $Id$
+ − 12 ///////////////////////////////////////////////////////////////////////////////
+ − 13 /// \par Copyright (c) 2014-2020 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 <stdio.h>
+ − 31 #include <string.h>
+ − 32 #include "tMenu.h"
521
+ − 33 #include "tHome.h"
506
+ − 34 #include "tStructure.h"
+ − 35 #include "tMenuCustom.h"
+ − 36 #include "text_multilanguage.h"
+ − 37 #include "data_central.h"
521
+ − 38 #include "motion.h"
552
+ − 39 #include "gfx_fonts.h"
+ − 40 #include "tInfo.h"
+ − 41 #include "motion.h"
506
+ − 42
+ − 43
+ − 44 /* Exported functions --------------------------------------------------------*/
+ − 45
+ − 46 uint32_t tMCustom_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext)
+ − 47 {
+ − 48 uint8_t textPointer;
+ − 49
+ − 50 textPointer = 0;
+ − 51 *tab = 550;
+ − 52 *subtext = 0;
+ − 53
+ − 54 if((line == 0) || (line == 1))
+ − 55 {
+ − 56 text[textPointer++] = TXT_2BYTE;
+ − 57 text[textPointer++] = TXT2BYTE_Customviews;
+ − 58 }
+ − 59 text[textPointer++] = '\n';
+ − 60 text[textPointer++] = '\r';
+ − 61 text[textPointer] = 0;
+ − 62
+ − 63 if((line == 0) || (line == 2))
+ − 64 {
521
+ − 65 text[textPointer++] = TXT_2BYTE;
+ − 66 text[textPointer++] = TXT2BYTE_ExtraDisplay;
+ − 67 text[textPointer++] = ' ';
+ − 68 text[textPointer++] = ' ';
+ − 69 text[textPointer++] = TXT_2BYTE;
+ − 70
+ − 71 switch(settingsGetPointer()->extraDisplay)
+ − 72 {
+ − 73 /* BigFont */
+ − 74 case EXTRADISPLAY_BIGFONT:
+ − 75 text[textPointer++] = TXT2BYTE_ExtraBigFont;
+ − 76 break;
739
+ − 77 /* Start screen */
+ − 78 case EXTRADISPLAY_BFACTIVE:
+ − 79 text[textPointer++] = TXT2BYTE_ExtraActive;
521
+ − 80 break;
+ − 81 /* none */
+ − 82 case EXTRADISPLAY_none:
+ − 83 text[textPointer++] = TXT2BYTE_ExtraNone;
+ − 84 break;
+ − 85
+ − 86 default:
630
+ − 87 snprintf(&text[textPointer++],4,"%u",settingsGetPointer()->extraDisplay);
521
+ − 88 break;
+ − 89 }
506
+ − 90 }
+ − 91 strcpy(&text[textPointer],"\n\r");
+ − 92 textPointer += 2;
+ − 93
+ − 94 if((line == 0) || (line == 3))
+ − 95 {
+ − 96 text[textPointer++] = TXT_2BYTE;
521
+ − 97 text[textPointer++] = TXT2BYTE_SelectCustomviews;
+ − 98 }
+ − 99 strcpy(&text[textPointer],"\n\r");
+ − 100 textPointer += 2;
+ − 101
+ − 102 if((line == 0) || (line == 4))
+ − 103 {
+ − 104 text[textPointer++] = TXT_2BYTE;
506
+ − 105 text[textPointer++] = TXT2BYTE_SelectBigFont;
+ − 106 }
+ − 107 strcpy(&text[textPointer],"\n\r");
+ − 108 textPointer += 2;
+ − 109
521
+ − 110 #ifdef ENABLE_MOTION_CONTROL
+ − 111 if((line == 0) || (line == 5))
+ − 112 {
+ − 113 /* MotionCtrl */
+ − 114 text[textPointer++] = TXT_2BYTE;
+ − 115 text[textPointer++] = TXT2BYTE_MotionCtrl;
552
+ − 116 }
+ − 117
+ − 118 strcpy(&text[textPointer],"\n\r");
+ − 119 textPointer += 2;
521
+ − 120 #endif
951
+ − 121
+ − 122 #ifdef ENABLE_GPIO_V2
+ − 123 if((line == 0) || (line == 5))
+ − 124 {
+ − 125 /* MotionCtrl */
+ − 126 text[textPointer++] = TXT_2BYTE;
+ − 127 text[textPointer++] = TXT2BYTE_BUZZER;
+ − 128 text[textPointer++] = ' ';
+ − 129 text[textPointer++] = TXT_Warning;
+ − 130 text[textPointer++] = '\t';
+ − 131 if(settingsGetPointer()->warningBuzzer)
+ − 132 text[textPointer++] = '\005';
+ − 133 else
+ − 134 text[textPointer++] = '\006';
+ − 135 }
+ − 136
+ − 137 strcpy(&text[textPointer],"\n\r");
+ − 138 textPointer += 2;
+ − 139 #endif
+ − 140
506
+ − 141 return StMCustom;
+ − 142 }
+ − 143