Rev 1484 | Rev 1512 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1484 | Rev 1500 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include "jetimenu.h" |
1 | #include "jetimenu.h" |
2 | #include "libfc.h" |
2 | #include "libfc.h" |
3 | #include "printf_P.h" |
3 | #include "printf_P.h" |
4 | #include "main.h" |
4 | #include "main.h" |
5 | #include "spi.h" |
5 | #include "spi.h" |
- | 6 | #include "capacity.h" |
|
Line 6... | Line 7... | ||
6 | 7 | ||
7 | #define JETIBOX_KEY_RIGHT 0x1F |
8 | #define JETIBOX_KEY_RIGHT 0x1F |
8 | #define JETIBOX_KEY_UP 0x2F |
9 | #define JETIBOX_KEY_UP 0x2F |
9 | #define JETIBOX_KEY_DOWN 0x4F |
10 | #define JETIBOX_KEY_DOWN 0x4F |
Line 16... | Line 17... | ||
16 | 17 | ||
17 | // ----------------------------------------------------------- |
18 | // ----------------------------------------------------------- |
18 | // the menu functions |
19 | // the menu functions |
19 | // ----------------------------------------------------------- |
20 | // ----------------------------------------------------------- |
20 | #define JETI_MENU_FCINFO 0 |
21 | #define JETI_MENU_FCINFO 0 |
21 | void mf0(uint8_t key) |
22 | void mfc0(uint8_t key) |
22 | { |
23 | { |
23 | JetiBox_printfxy(0,0,"+ Flight-Ctrl + "); |
24 | JetiBox_printfxy(0,0,"+ Flight-Ctrl + "); |
24 | JetiBox_printfxy(0,1,"HW:%d.%d SW:%d.%d%c",PlatinenVersion/10,PlatinenVersion%10,VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a'); |
25 | JetiBox_printfxy(0,1,"HW:%d.%d SW:%d.%d%c",PlatinenVersion/10,PlatinenVersion%10,VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a'); |
25 | } |
26 | } |
26 | #define JETI_MENU_VOLT_RC 1 |
27 | #define JETI_MENU_VOLT_RC 1 |
27 | void mf1(uint8_t key) |
28 | void mfc1(uint8_t key) |
28 | { |
29 | { |
29 | JetiBox_printfxy(0,0,"Volt RC-Level"); |
30 | JetiBox_printfxy(0,0,"Volt RC-Level"); |
30 | JetiBox_printfxy(0,1,"%2i.%1iV %03i",UBat/10, UBat%10, SenderOkay); |
31 | JetiBox_printfxy(0,1,"%2i.%1iV %03i",UBat/10, UBat%10, SenderOkay); |
31 | } |
32 | } |
32 | #define JETI_MENU_HEIGHT 2 |
33 | #define JETI_MENU_HEIGHT 2 |
33 | void mf2(uint8_t key) |
34 | void mfc2(uint8_t key) |
34 | { |
35 | { |
35 | JetiBox_printfxy(0,0,"Height Vario"); |
36 | JetiBox_printfxy(0,0,"Height Vario"); |
36 | if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
37 | if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
37 | { |
38 | { |
Line 41... | Line 42... | ||
41 | { |
42 | { |
42 | JetiBox_printfxy(0,1,"no press. sensor"); |
43 | JetiBox_printfxy(0,1,"no press. sensor"); |
43 | } |
44 | } |
44 | } |
45 | } |
45 | #define JETI_MENU_ATTITUDE 3 |
46 | #define JETI_MENU_ATTITUDE 3 |
46 | void mf3(uint8_t key) |
47 | void mfc3(uint8_t key) |
47 | { |
48 | { |
48 | JetiBox_printfxy(0,0,"Nick Roll Yaw"); |
49 | JetiBox_printfxy(0,0,"Nick Roll Yaw"); |
49 | JetiBox_printfxy(0,1,"%4i %4i %4i", (int16_t)(IntegralNick/1024), (int16_t)(IntegralRoll/1024), (int16_t)(ErsatzKompass / GIER_GRAD_FAKTOR)); |
50 | JetiBox_printfxy(0,1,"%4i %4i %4i", (int16_t)(IntegralNick/1024), (int16_t)(IntegralRoll/1024), (int16_t)(ErsatzKompass / GIER_GRAD_FAKTOR)); |
50 | } |
51 | } |
- | 52 | #define JETI_MENU_AKKU 4 |
|
- | 53 | void mfc4(uint8_t key) |
|
- | 54 | { //0123456789ABCDEF |
|
- | 55 | JetiBox_printfxy(0,0,"U[V] I[A] C[mAh]"); |
|
- | 56 | JetiBox_printfxy(0,1,"%2i.%1i %2i.%1i %6i",UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10, Capacity.UsedCapacity); |
|
- | 57 | } |
|
- | 58 | ||
- | 59 | ||
51 | #define JETI_MENU_NCINFO 4 |
60 | #define JETI_MENU_NCINFO 4 |
52 | void mf4(uint8_t key) |
61 | void mnc1(uint8_t key) |
53 | { |
62 | { |
54 | JetiBox_printfxy(0,0," + Navi-Ctrl + "); |
63 | JetiBox_printfxy(1,0,"+ Navi-Ctrl +"); |
55 | if(NaviDataOkay) |
64 | if(NaviDataOkay) |
56 | { |
65 | { |
57 | JetiBox_printfxy(0,1,"HW:%d.%d SW:%d.%d%c",NC_Version.Hardware/10,NC_Version.Hardware%10,NC_Version.Major, NC_Version.Minor, NC_Version.Patch+'a'); |
66 | JetiBox_printfxy(0,1,"HW:%d.%d SW:%d.%d%c",NC_Version.Hardware/10,NC_Version.Hardware%10,NC_Version.Major, NC_Version.Minor, NC_Version.Patch+'a'); |
58 | } |
67 | } |
59 | else |
68 | else |
60 | { |
69 | { |
61 | JetiBox_printfxy(0,1," Not found! "); |
70 | JetiBox_printfxy(0,1," Not found! "); |
62 | } |
71 | } |
63 | } |
72 | } |
64 | #define JETI_MENU_GPSINFO 5 |
73 | #define JETI_MENU_GPSINFO 5 |
65 | void mf5(uint8_t key) |
74 | void mnc2(uint8_t key) |
66 | { |
75 | { |
67 | JetiBox_printfxy(0,0,"Sat:%02d", GPSInfo.NumOfSats); |
76 | JetiBox_printfxy(0,0,"Sat:%02d", GPSInfo.NumOfSats); |
68 | switch (GPSInfo.SatFix) |
77 | switch (GPSInfo.SatFix) |
69 | { |
78 | { |
70 | case SATFIX_NONE: |
79 | case SATFIX_NONE: |
Line 101... | Line 110... | ||
101 | } MENU_ENTRY; |
110 | } MENU_ENTRY; |
Line 102... | Line 111... | ||
102 | 111 | ||
103 | 112 | ||
104 | // the menu navigation structure |
113 | // the menu navigation structure |
105 | /* |
114 | /* |
106 | 0 ----------------------------- 4 |
115 | 0 ----------------------------- 5 |
Line 107... | Line 116... | ||
107 | | | |
116 | | | |
Line 108... | Line 117... | ||
108 | 3 - 1 - 2 - 3 - 1 5 |
117 | 4 - 1 - 2 - 3 - 4 - 1 6 |
109 | 118 | ||
110 | */ |
119 | */ |
111 | 120 | ||
112 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
121 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
113 | { // l r u d pHandler |
122 | { // l r u d pHandler |
114 | {0, 4, 0, 1, &mf0 }, // 0 |
123 | {0, 5, 0, 1, &mfc0 }, // 0 |
115 | {3, 2, 0, 1, &mf1 }, // 1 |
124 | {4, 2, 0, 1, &mfc1 }, // 1 |
- | 125 | {1, 3, 0, 2, &mfc2 }, // 2 |
|
116 | {1, 3, 0, 2, &mf2 }, // 2 |
126 | {2, 4, 0, 3, &mfc3 }, // 3 |
Line 117... | Line 127... | ||
117 | {2, 1, 0, 3, &mf3 }, // 3 |
127 | {3, 1, 0, 4, &mfc4 }, // 4 |
118 | {0, 4, 4, 5, &mf4 }, // 4 |
128 | {0, 5, 5, 6, &mnc1 }, // 5 |