Subversion Repositories Projects

Rev

Rev 1593 | Rev 1866 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1593 Rev 1773
Line 71... Line 71...
71
/**
71
/**
72
 * draw a compass rose at <x>/<y> for <heading>
72
 * draw a compass rose at <x>/<y> for <heading>
73
 */
73
 */
74
void draw_compass(uint8_t x, uint8_t y, uint16_t heading) {
74
void draw_compass(uint8_t x, uint8_t y, uint16_t heading) {
75
    //char* rose = "---N---O---S---W---N---O---S---W---N---O---S---W";
75
    //char* rose = "---N---O---S---W---N---O---S---W---N---O---S---W";
76
    static char rose[] PROGMEM = {216, 215, 216, 211, 216, 215, 216, 213, 216, 215, 216, 212,
76
    static const char rose[] PROGMEM = {216, 215, 216, 211, 216, 215, 216, 213, 216, 215, 216, 212,
77
        216, 215, 216, 214, 216, 215, 216, 211, 216, 215, 216, 213,
77
        216, 215, 216, 214, 216, 215, 216, 211, 216, 215, 216, 213,
78
        216, 215, 216, 212, 216, 215, 216, 214, 216, 215, 216, 211,
78
        216, 215, 216, 212, 216, 215, 216, 214, 216, 215, 216, 211,
79
        216, 215, 216, 213, 216, 215, 216, 212, 216, 215, 216, 214};
79
        216, 215, 216, 213, 216, 215, 216, 212, 216, 215, 216, 214};
80
    // the center is char 19 (north), we add the current heading in 8th
80
    // the center is char 19 (north), we add the current heading in 8th
81
    // which would be 22.5 degrees, but float would bloat up the code
81
    // which would be 22.5 degrees, but float would bloat up the code
Line 137... Line 137...
137
        if (chr < 0x74) chr = 0x74;
137
        if (chr < 0x74) chr = 0x74;
138
    }
138
    }
139
    write_char_xy(x, y, chr);
139
    write_char_xy(x, y, chr);
140
}
140
}
141
 
141
 
-
 
142
 
142
// big vario arrays 
143
// big vario array 
143
const char vario_00[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xff};
144
const char vario_pnt[15][5] PROGMEM = {
144
const char vario_01[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xc0};
145
        {0x00, 0x00, 0xc2, 0xff, 0xff},
145
const char vario_02[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xc1};
146
        {0x00, 0x00, 0xc2, 0xff, 0xc0},
146
const char vario_03[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0x00};
147
        {0x00, 0x00, 0xc2, 0xff, 0xc1},
147
const char vario_04[5] PROGMEM = {0x00, 0x00, 0xc2, 0xc0, 0x00};
148
        {0x00, 0x00, 0xc2, 0xff, 0x00},
148
const char vario_05[5] PROGMEM = {0x00, 0x00, 0xc2, 0xc1, 0x00};
149
        {0x00, 0x00, 0xc2, 0xc0, 0x00},
149
const char vario_06[5] PROGMEM = {0x00, 0x00, 0xc2, 0x00, 0x00};
150
        {0x00, 0x00, 0xc2, 0xc1, 0x00},
150
const char vario_07[5] PROGMEM = {0x00, 0x00, 0xbb, 0x00, 0x00};
151
        {0x00, 0x00, 0xc2, 0x00, 0x00},
151
const char vario_08[5] PROGMEM = {0x00, 0x00, 0xc3, 0x00, 0x00};
152
        {0x00, 0x00, 0xbb, 0x00, 0x00},
152
const char vario_09[5] PROGMEM = {0x00, 0xc4, 0xc3, 0x00, 0x00};
153
        {0x00, 0x00, 0xc3, 0x00, 0x00},
153
const char vario_10[5] PROGMEM = {0x00, 0xc5, 0xc3, 0x00, 0x00};
154
        {0x00, 0xc4, 0xc3, 0x00, 0x00},
154
const char vario_11[5] PROGMEM = {0x00, 0xff, 0xc3, 0x00, 0x00};
155
        {0x00, 0xc5, 0xc3, 0x00, 0x00},
155
const char vario_12[5] PROGMEM = {0xc4, 0xff, 0xc3, 0x00, 0x00};
156
        {0x00, 0xff, 0xc3, 0x00, 0x00},
156
const char vario_13[5] PROGMEM = {0xc5, 0xff, 0xc3, 0x00, 0x00};
157
        {0xc4, 0xff, 0xc3, 0x00, 0x00},
157
const char vario_14[5] PROGMEM = {0xff, 0xff, 0xc3, 0x00, 0x00};
158
        {0xc5, 0xff, 0xc3, 0x00, 0x00},
158
const char* vario_pnt[15] PROGMEM = {vario_00, vario_01, vario_02, vario_03, vario_04,
-
 
159
    vario_05, vario_06, vario_07, vario_08,
159
        {0xff, 0xff, 0xc3, 0x00, 0x00}
160
    vario_09, vario_10, vario_11, vario_12,
-
 
161
    vario_13, vario_14};
160
};
162
 
161
 
163
/**
162
/**
164
 * draw a bigger vario with middle at <x>/<y> acording to <variometer>
163
 * draw a bigger vario with middle at <x>/<y> acording to <variometer>
165
 */
164
 */
166
void draw_big_variometer(uint8_t x, uint8_t y, int16_t variometer) {
165
void draw_big_variometer(uint8_t x, uint8_t y, int16_t variometer) {
167
    int16_t index = 7 + variometer;
166
    int16_t index = 7 + variometer;
168
    if (index > 14) index = 14;
167
    if (index > 14) index = 14;
169
    else if (index < 0) index = 0;
168
    else if (index < 0) index = 0;
170
 
169
 
171
    write_string_pgm_down(x, y - 2, (const char *)(pgm_read_word(&(vario_pnt[index]))), 5);
170
    write_string_pgm_down(x, y - 2, vario_pnt[index], 5);
172
}
171
}
173
 
172
 
174
 
173
 
175
/* ##########################################################################
174
/* ##########################################################################
176
 * NEW artificial horizon     By AGRESSiVA --=-- COPTERTRONiC
175
 * NEW artificial horizon     By AGRESSiVA --=-- COPTERTRONiC