Subversion Repositories Projects

Rev

Rev 758 | Rev 762 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 758 Rev 761
Line 119... Line 119...
119
                                    write_ndigit_number_s_10th(23, top_line, naviData.Altimeter / 3, 3, 0); // BARO
119
                    write_ndigit_number_s_10th(23, top_line, naviData.Altimeter / 3, 3, 0); // BARO
120
                                }
120
                }
121
                        }
121
            }
122
                }
122
        }
Line -... Line 123...
-
 
123
 
123
 
124
 
124
 
125
        // seccond line
Line 125... Line 126...
125
                // seccond line
126
        draw_compass(11, top_line + 1, naviData.CompassHeading);
126
                draw_compass(11, top_line + 1, naviData.CompassHeading);
127
 
Line 130... Line 131...
130
                //write_char_xy(21, top_line + 1, arrowdir[heading_conv(heading_home)]);
131
        // finer resolution, 0xa0 is first character and we add the index 0 <= index < 16
131
                // finer resolution, 0xa0 is first character and we add the index 0 <= index < 16
132
        write_char_xy(21, top_line + 1, 0xa0 + heading_fine_conv(heading_home));
Line 132... Line 133...
132
                write_char_xy(21, top_line + 1, 0xa0 + heading_fine_conv(heading_home));
133
 
133
 
134
        if (COSD_FLAGS_CONFIG & COSD_FLAG_FEET) {
134
                if (COSD_FLAGS_CONFIG & COSD_FLAG_FEET) {
135
            // feet
135
                        // feet
136
            write_ndigit_number_u(23, top_line + 1, naviData.HomePositionDeviation.Distance / 10 * 32 / 10, 4, 0);
136
                        write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10 * 32 / 10, 3, 0);
137
        } else {
137
                }  else {
138
            write_ndigit_number_u(23, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 4, 0);
Line 138... Line 139...
138
                        write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 3, 0);
139
        }
139
                }
140
 
140
       
141
        // center
Line 164... Line 165...
164
                                draw_artificial_horizon(top_line + 2, horizon_bottom, naviData.AngleNick, naviData.AngleRoll);
165
                }
165
                                }                              
166
            }
166
                    }
167
            // motors are on, assume we were/are flying
167
                    // motors are on, assume we were/are flying
168
            COSD_FLAGS_RUNTIME |= COSD_WASFLYING;
168
                    COSD_FLAGS_RUNTIME |= COSD_WASFLYING;
169
        } else {
-
 
170
            if ((old_MKFlags & FLAG_MOTOR_RUN)) { // motors just stopped
-
 
171
                clear(); // clear whole screen in case there is horizon stuff left
-
 
172
                // update flags to paint display again if needed
-
 
173
                COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN;
-
 
174
            }
169
                } else {
175
            // stats
170
                    // stats
176
            if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) {
171
                    if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) {
177
                uint8_t line = 3;
172
                                uint8_t line = 3;
178
                write_ascii_string_pgm(1, line, (const char *)(pgm_read_word(&(stats_item_pointers[0])))); // max Altitude
173
                        write_ascii_string_pgm(1, line, (const char *) (pgm_read_word(&(stats_item_pointers[0])))); // max Altitude
179
                write_ascii_string_pgm(1, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[1])))); // max Speed
174
                        write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[1])))); // max Speed
180
                write_ascii_string_pgm(1, ++line, (const char *)(pgm_read_word(&(stats_item_pointers[2])))); // max Distance
Line 175... Line 181...
175
                        write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[2])))); // max Distance
181
 
176
                       
182
                if (COSD_FLAGS_CONFIG & COSD_FLAG_FEET) {
177
                                if (COSD_FLAGS_CONFIG & COSD_FLAG_FEET) {
183
                    write_ndigit_number_s(16, line - 2, max_Altimeter * 32 / 10, 4, 0);
178
                                        write_ndigit_number_s(16, line, max_Altimeter * 32 / 10, 4, 0);
184
                    write_char_xy(20, line - 2, 0x7E); // small feet ft
179
                                write_char_xy(20, line - 2, 0x7E); // small feet ft
185
                    write_ndigit_number_u(17, line - 1, (uint16_t)(((uint32_t)max_GroundSpeed * (uint32_t)279) / (uint32_t)12500), 3, 0);
180
                                        write_ndigit_number_u(17, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 279) / (uint32_t) 12500), 3, 0);
186
                    write_char_xy(20, line - 1, 0x7D); // mp/h
181
                                        write_char_xy(20, line - 1, 0x7D); // mp/h
187
                    write_ndigit_number_u(17, line - 0, max_Distance / 10 * 32 / 10, 3, 0);
182
                                        write_ndigit_number_u(17, line, max_Distance / 10 * 32 / 10, 3, 0);
188
                    write_char_xy(20, line - 0, 0x7E); // small feet ft
183
                                        write_char_xy(20, line - 0, 0x7E); // small feet ft                                                                     
189
                } else {
184
                                } else {
190
                    write_ndigit_number_s(16, line - 2, max_Altimeter, 4, 0);
185
                                write_ndigit_number_s(16, line, max_Altimeter, 4, 0);
191
                    write_char_xy(20, line - 2, 204); // small meters m
186
                                        write_char_xy(20, line - 2, 204); // small meters m 
192
                    write_ndigit_number_u(17, line - 1, (uint16_t)(((uint32_t)max_GroundSpeed * (uint32_t)9) / (uint32_t)250), 3, 0);
187
                                        write_ndigit_number_u(17, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0);
193
                    write_char_xy(20, line - 1, 203); // km/h
188
                                        write_char_xy(20, line - 1, 203); // km/h
194
                    write_ndigit_number_u(17, line - 0, max_Distance / 10, 3, 0);
189
                                        write_ndigit_number_u(17, line, max_Distance / 10, 3, 0);
195
                    write_char_xy(20, line - 0, 204); // small meters m
Line 190... Line 196...
190
                                        write_char_xy(20, line - 0, 204); // small meters m
196
                }
191
                                }
197