1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 09:45:21 +03:00

Trims to Offsets re-implemented (still untested)

FrSky flash saving
This commit is contained in:
bsongis 2012-03-27 17:56:43 +00:00
parent ee1bd73788
commit 2acfb7df3d
15 changed files with 854 additions and 1773 deletions

View file

@ -870,6 +870,32 @@ void displayGpsTime()
lcd_outdezNAtt(12*FW-1, TIME_LINE, frskyHubData.sec, att, 2);
lcd_status_line();
}
void displayGpsCoord(uint8_t y, char direction, int16_t bp, int16_t ap)
{
if (!direction) direction = '-';
lcd_outdezAtt(10*FW, y, bp / 100, LEFT); // ddd before '.'
lcd_putc(lcd_lastPos, y, '@');
uint8_t mn = bp % 100;
if (g_eeGeneral.gpsFormat == 0) {
lcd_putc(lcd_lastPos+FWNUM, y, direction);
lcd_outdezNAtt(lcd_lastPos+FW+FW+1, y, mn, LEFT|LEADING0, 2); // mm before '.'
lcd_vline(lcd_lastPos, y, 2);
uint16_t ss = ap * 6;
lcd_outdezAtt(lcd_lastPos+3, y, ss / 1000, LEFT); // ''
lcd_plot(lcd_lastPos, y+FH-2, 0); // small decimal point
lcd_outdezAtt(lcd_lastPos+2, y, ss % 1000, LEFT); // ''
lcd_vline(lcd_lastPos, y, 2);
lcd_vline(lcd_lastPos+2, y, 2);
}
else {
lcd_outdezNAtt(lcd_lastPos+FW, y, mn, LEFT|LEADING0, 2); // mm before '.'
lcd_plot(lcd_lastPos, y+FH-2, 0); // small decimal point
lcd_outdezNAtt(lcd_lastPos+2, y, ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
lcd_putc(lcd_lastPos+1, y, direction);
}
}
#endif
uint8_t getTelemCustomField(uint8_t line, uint8_t col)
@ -1033,49 +1059,12 @@ void menuProcFrsky(uint8_t event)
else if (s_frsky_view == e_frsky_after_flight) {
// Latitude
#define LAT_LINE (1*FH+1)
lcd_putsLeft( LAT_LINE, STR_LATITUDE);
lcd_outdezAtt(10*FW, LAT_LINE, frskyHubData.gpsLatitude_bp / 100, LEFT); // ddd before '.'
lcd_putc(lcd_lastPos, LAT_LINE, '@');
uint8_t mn = frskyHubData.gpsLatitude_bp % 100;
if (g_eeGeneral.gpsFormat==1) {
lcd_outdezNAtt(lcd_lastPos+FW, LAT_LINE, mn, LEFT|LEADING0, 2); // mm before '.'
lcd_plot(lcd_lastPos, LAT_LINE+FH-2, 0); // small decimal point
lcd_outdezNAtt(lcd_lastPos+2, LAT_LINE, frskyHubData.gpsLatitude_ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
lcd_putc(lcd_lastPos+1, LAT_LINE, frskyHubData.gpsLatitudeNS ? frskyHubData.gpsLatitudeNS : '-');
} else {
lcd_putc(lcd_lastPos+FW, LAT_LINE, frskyHubData.gpsLatitudeNS ? frskyHubData.gpsLatitudeNS : '-');
lcd_outdezNAtt(lcd_lastPos+FW+FW, LAT_LINE, mn, LEFT|LEADING0, 2); // mm before '.'
lcd_plot(lcd_lastPos, LAT_LINE, 0); // small decimal point
uint16_t ss=frskyHubData.gpsLatitude_ap*6;
lcd_outdezAtt(lcd_lastPos+2, LAT_LINE, ss / 1000, LEFT); // ''
lcd_plot(lcd_lastPos, LAT_LINE+FH-2, 0); // small decimal point
lcd_outdezAtt(lcd_lastPos+2, LAT_LINE, ss % 1000, LEFT); // ''
lcd_plot(lcd_lastPos, LAT_LINE, 0); // small decimal point
lcd_plot(lcd_lastPos+2, LAT_LINE, 0); // small decimal point
}
lcd_putsLeft(LAT_LINE, STR_LATITUDE);
displayGpsCoord(LAT_LINE, frskyHubData.gpsLatitudeNS, frskyHubData.gpsLatitude_bp, frskyHubData.gpsLatitude_ap);
// Longitude
#define LONG_LINE (2*FH+2)
lcd_putsLeft(LONG_LINE, STR_LONGITUDE);
lcd_outdezAtt(10*FW, LONG_LINE, frskyHubData.gpsLongitude_bp / 100, LEFT); // ddd before '.'
lcd_putc(lcd_lastPos, LONG_LINE, '@');
mn = frskyHubData.gpsLongitude_bp % 100;
if (g_eeGeneral.gpsFormat==1) {
lcd_outdezNAtt(lcd_lastPos+FW, LONG_LINE, mn, LEFT|LEADING0, 2); // mm before '.'
lcd_plot(lcd_lastPos, LONG_LINE+FH-2, 0); // small decimal point
lcd_outdezNAtt(lcd_lastPos+2, LONG_LINE, frskyHubData.gpsLongitude_ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
lcd_putc(lcd_lastPos+1, LONG_LINE, frskyHubData.gpsLongitudeEW ? frskyHubData.gpsLongitudeEW : '-');
} else {
lcd_putc(lcd_lastPos+FW, LONG_LINE, frskyHubData.gpsLongitudeEW ? frskyHubData.gpsLongitudeEW : '-');
lcd_outdezNAtt(lcd_lastPos+FW+FW, LONG_LINE, mn, LEFT|LEADING0, 2); // mm before '.'
lcd_plot(lcd_lastPos, LONG_LINE, 0); // small decimal point
uint16_t ss=frskyHubData.gpsLongitude_ap*6;
lcd_outdezAtt(lcd_lastPos+2, LONG_LINE, ss / 1000, LEFT); // ''
lcd_plot(lcd_lastPos, LONG_LINE+FH-2, 0); // small decimal point
lcd_outdezAtt(lcd_lastPos+2, LONG_LINE, ss % 1000, LEFT); // ''
lcd_plot(lcd_lastPos, LONG_LINE, 0); // small decimal point
lcd_plot(lcd_lastPos+2, LONG_LINE, 0); // small decimal point
}
displayGpsCoord(LONG_LINE, frskyHubData.gpsLongitudeEW, frskyHubData.gpsLongitude_bp, frskyHubData.gpsLongitude_ap);
// Rssi
#define RSSI_LINE (3*FH+3)
lcd_putsLeft(RSSI_LINE, STR_MINRSSI);