Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | /*Panels variables*/ |
2 | //Will come from APM telem port |
||
3 | |||
4 | static float osd_vbat_A = 0; // Battery A voltage in milivolt |
||
5 | //static float osd_curr_A = 0; // Battery A current |
||
6 | static uint16_t osd_battery_remaining_A = 0; // 0 to 100 <=> 0 to 1000 |
||
7 | static uint8_t osd_battery_pic_A = 0xb4; // picture to show battery remaining |
||
8 | //static float osd_vbat_B = 0; // voltage in milivolt |
||
9 | //static float osd_curr_B = 0; // Battery B current |
||
10 | //static uint16_t osd_battery_remaining_B = 0; // 0 to 100 <=> 0 to 1000 |
||
11 | //static uint8_t osd_battery_pic_B = 0xb4; // picture to show battery remaining |
||
12 | |||
13 | static uint16_t osd_mode = 0; // Navigation mode from RC AC2 = CH5, APM = CH8 |
||
14 | static uint8_t osd_nav_mode = 0; // Navigation mode from RC AC2 = CH5, APM = CH8 |
||
15 | |||
16 | static float osd_lat = 0; // latidude |
||
17 | static float osd_lon = 0; // longitude |
||
18 | static uint8_t osd_satellites_visible = 0; // number of satelites |
||
19 | static uint8_t osd_fix_type = 0; // GPS lock 0-1=no fix, 2=2D, 3=3D |
||
20 | |||
21 | static uint8_t osd_got_home = 0; // tels if got home position or not |
||
22 | static float osd_home_lat = 0; // home latidude |
||
23 | static float osd_home_lon = 0; // home longitude |
||
24 | static float osd_home_alt = 0; |
||
25 | static long osd_home_distance = 0; // distance from home |
||
26 | static uint8_t osd_home_direction; // Arrow direction pointing to home (1-16 to CW loop) |
||
27 | |||
28 | static int8_t osd_pitch = 0; // pitch form DCM |
||
29 | static int8_t osd_roll = 0; // roll form DCM |
||
30 | static int8_t osd_yaw = 0; // relative heading form DCM |
||
31 | static float osd_heading = 0; // ground course heading from GPS |
||
32 | static float osd_alt = 0; // altitude |
||
33 | static float osd_groundspeed = 0; // ground speed |
||
34 | static uint16_t osd_throttle = 0; // throtle |
||
35 | |||
36 | //MAVLink session control |
||
37 | static boolean mavbeat = 0; |
||
38 | static float lastMAVBeat = 0; |
||
39 | static boolean waitingMAVBeats = 1; |
||
40 | static uint8_t apm_mav_type; |
||
41 | static uint8_t apm_mav_system; |
||
42 | static uint8_t apm_mav_component; |
||
43 | static boolean enable_mav_request = 0; |
||
44 | |||
45 | // Panel BIT registers |
||
46 | byte panA_REG = 0b00000000; |
||
47 | byte panB_REG = 0b00000000; |
||
48 | byte panC_REG = 0b00000000; |
||
49 | |||
50 | byte modeScreen = 0; //NTSC:0, PAL:1 |
||
51 | |||
52 | byte SerCMD1 = 0; |
||
53 | byte SerCMD2 = 0; |
||
54 | |||
55 | |||
56 | int tempvar; // Temporary variable used on many places around the OSD |
||
57 | |||
58 | // First 8 panels and their X,Y coordinate holders |
||
59 | byte panCenter_XY[2]; // = { 13,7,0 }; |
||
60 | byte panPitch_XY[2]; // = { 11,1 }; |
||
61 | byte panRoll_XY[2]; // = { 23,7 }; |
||
62 | byte panBatt_A_XY[2]; // = { 23,1 }; |
||
63 | //byte panBatt_B_XY[2]; // = { 23,3 }; |
||
64 | byte panGPSats_XY[2]; // = { 2,12 }; |
||
65 | byte panGPL_XY[2]; // = { 2,11 }; |
||
66 | byte panGPS_XY[2]; // = { 2,13 }; |
||
67 | |||
68 | // Second 8 set of panels and their X,Y coordinate holders |
||
69 | byte panRose_XY[2]; // = { 16,13 }; |
||
70 | byte panHeading_XY[2]; // = { 16,12 }; |
||
71 | byte panMavBeat_XY[2]; // = { 2,10 }; |
||
72 | byte panHomeDir_XY[2]; // = { 0,0 }; |
||
73 | byte panHomeDis_XY[2]; // = { 0,0 }; |
||
74 | byte panWPDir_XY[2]; // = { 0,0 }; |
||
75 | byte panWPDis_XY[2]; // = { 0,0 }; |
||
76 | //byte panRSSI_XY[2] = { 0,0 }; |
||
77 | |||
78 | // Third set of panels and their X,Y coordinate holders |
||
79 | //byte panCur_A_XY[2]; // = { 23,1 }; |
||
80 | //byte panCur_B_XY[2]; // = { 23,3 }; |
||
81 | byte panAlt_XY[2]; // = { 0,0 }; |
||
82 | byte panVel_XY[2]; // = { 0,0 }; |
||
83 | byte panThr_XY[2]; // = { 0,0 }; |
||
84 | byte panFMod_XY[2]; // = { 0,0 }; |
||
85 | byte panHorizon_XY[2]; // = {8,centercalc} |
||
86 | //byte panXXX_XY[2] = { 0,0 }; |
||
87 | |||
88 |