Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2136 | - | 1 | /***************************************************************************** |
2 | * Copyright (C) 2008 Thomas Kaiser, thomas@ft-fanpage.de * |
||
3 | * Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net * |
||
4 | * Copyright (C) 2012 Christian "Cebra" Brandtner, brandtner@brandtner.net * |
||
5 | * Copyright (C) 2012 Harald Bongartz * |
||
6 | * * |
||
7 | * This program is free software; you can redistribute it and/or modify * |
||
8 | * it under the terms of the GNU General Public License as published by * |
||
9 | * the Free Software Foundation; either version 2 of the License. * |
||
10 | * * |
||
11 | * This program is distributed in the hope that it will be useful, * |
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
14 | * GNU General Public License for more details. * |
||
15 | * * |
||
16 | * You should have received a copy of the GNU General Public License * |
||
17 | * along with this program; if not, write to the * |
||
18 | * Free Software Foundation, Inc., * |
||
19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||
20 | * * |
||
21 | * * |
||
22 | * Credits to: * |
||
23 | * Holger Buss & Ingo Busker from mikrokopter.de for the MK project + SVN * |
||
24 | * http://www.mikrokopter.de * |
||
25 | * Gregor "killagreg" Stobrawa for his version of the MK code * |
||
26 | * Thomas Kaiser "thkais" for the original project. See * |
||
27 | * http://www.ft-fanpage.de/mikrokopter/ * |
||
28 | * http://forum.mikrokopter.de/topic-4061-1.html * |
||
29 | * Claas Anders "CaScAdE" Rathje for providing the font and his C-OSD code * |
||
30 | * http://www.mylifesucks.de/oss/c-osd/ * |
||
31 | * Harald Bongartz "HaraldB" for providing his Ideas and Code for usibility* |
||
32 | *****************************************************************************/ |
||
33 | |||
34 | //############################################################################ |
||
35 | //# HISTORY mkparameters.h |
||
36 | //# |
||
37 | //# 27.03.2014 OG |
||
38 | //# etliche neue Funktionen / Strukturen |
||
39 | //# |
||
40 | //# 23.02.2014 OG |
||
41 | //# - chg: MK_Parameters_Menu() umbenannt zu MK_Parameters() |
||
42 | //# |
||
43 | //# 12.02.2014 OG - NEU |
||
44 | //############################################################################ |
||
45 | |||
46 | #ifndef _MKPARAMETERS_H |
||
47 | #define _MKPARAMETERS_H |
||
48 | |||
49 | |||
50 | // fuer cmd-Parameter der Edit-Funktionen |
||
51 | #define MKPARAM_EDIT 1 // Wert bearbeiten |
||
52 | #define MKPARAM_SHORTVALUE 2 // erzeugt einen 3-Zeichen String der den Wert darstellt (z.B. "Dis"); Ergebnis in strValueBuffer |
||
53 | #define MKPARAM_LONGVALUE 3 // erzeugt einen String der den Wert in langer Form darstellt (z.B. "Disabled"); Ergebnis in strValueBuffer |
||
54 | |||
55 | |||
56 | #define MKPARAM_STRBUFFER_LEN 20 |
||
57 | |||
58 | |||
59 | //-------------------------------------------- |
||
60 | // paramEditItem_t |
||
61 | // deklariert die Edit-Daten einer paramID |
||
62 | //-------------------------------------------- |
||
63 | typedef struct |
||
64 | { |
||
65 | unsigned char paramID; // paramID aus paramset.h |
||
66 | void (*editfunc)(unsigned char paramID, uint8_t cmd); // Edit-Funktion (z.B. editGeneric()); cmd = CMD_EDIT oder CMD_SHORTVALUE |
||
67 | const char *format; // Parameter: String (PROGMEM) (vorallem fuer editGeneric() ) |
||
68 | unsigned char min; // Parameter: min (P1) |
||
69 | unsigned char max; // Parameter: max (P2) |
||
70 | const char *title_de; // Text in PROGMEM - Menuetext und Beschreibung im Edit-Screen |
||
71 | const char *title_en; // Text in PROGMEM |
||
72 | } paramEditItem_t; |
||
73 | |||
74 | |||
75 | |||
76 | extern paramEditItem_t paramEditItem; // RAM Buffer: fuer ein Element von paramEditDef |
||
77 | extern char paramEditFormat[MKPARAM_STRBUFFER_LEN]; // RAM Buffer: fuer 'str' von paramEdit (Format; editGeneric) |
||
78 | extern char mkparam_strValueBuffer[MKPARAM_STRBUFFER_LEN]; // Anzeige eines Values als Klartext; Kurz (fuer das Menue) oder Lang (in der Edit-Funktion) |
||
79 | |||
80 | |||
81 | //--------------------------- |
||
82 | // exportierte Funktionen |
||
83 | //--------------------------- |
||
84 | unsigned char find_paramEditItem( unsigned char paramID ); |
||
85 | void editGeneric( unsigned char paramID, uint8_t cmd ); |
||
86 | void editBitmask( unsigned char paramID, uint8_t cmd ); |
||
87 | void editDisableDeclCalc( unsigned char paramID, uint8_t cmd ); |
||
88 | void editCompassOffset( unsigned char paramID, uint8_t cmd ); |
||
89 | void editACCZLandingPulse( unsigned char paramID, uint8_t cmd ); |
||
90 | void editNA( unsigned char paramID, uint8_t cmd ); |
||
91 | |||
92 | uint8_t MK_Parameters( uint8_t setting, char *settingname ); |
||
93 | |||
94 | |||
95 | #endif // _MKPARAMETERS_H |