@@ -257,40 +257,27 @@ class HomeScreen : public UIScreen {
257257 } else if (_page == HomePage::GPS) {
258258 LocationProvider* nmea = sensors.getLocationProvider ();
259259 int y = 18 ;
260- display.setCursor (0 , y);
261- display.print (_task->getGPSState () ? " gps on" : " gps off" );
260+ display.drawTextLeftAlign (0 , y, _task->getGPSState () ? " gps on" : " gps off" );
262261 if (nmea == NULL ) {
263262 y = y + 12 ;
264- display.setCursor (0 , y);
265- display.print (" Can't access GPS" );
263+ display.drawTextLeftAlign (0 , y, " Can't access GPS" );
266264 } else {
267265 char buf[50 ];
268266 strcpy (buf, nmea->isValid ()?" fix" :" no fix" );
269- display.setCursor (
270- display.width ()-display.getTextWidth (buf)-1 , y);
271- display.print (buf);
267+ display.drawTextRightAlign (display.width ()-1 , y, buf);
272268 y = y + 12 ;
273- display.setCursor (0 ,y);
274- display.print (" sat" );
269+ display.drawTextLeftAlign (0 , y, " sat" );
275270 sprintf (buf, " %d" , nmea->satellitesCount ());
276- display.setCursor (
277- display.width ()-display.getTextWidth (buf)-1 , y);
278- display.print (buf);
271+ display.drawTextRightAlign (display.width ()-1 , y, buf);
279272 y = y + 12 ;
280- display.setCursor (0 ,y);
281- display.print (" pos" );
273+ display.drawTextLeftAlign (0 , y, " pos" );
282274 sprintf (buf, " %.4f %.4f" ,
283275 nmea->getLatitude ()/1000000 ., nmea->getLongitude ()/1000000 .);
284- display.setCursor (
285- display.width ()-display.getTextWidth (buf)-1 , y);
286- display.print (buf);
276+ display.drawTextRightAlign (display.width ()-1 , y, buf);
287277 y = y + 12 ;
288- display.setCursor (0 ,y);
289- display.print (" alt" );
278+ display.drawTextLeftAlign (0 , y, " alt" );
290279 sprintf (buf, " %.2f" , nmea->getAltitude ()/1000 .);
291- display.setCursor (
292- display.width ()-display.getTextWidth (buf)-1 , y);
293- display.print (buf);
280+ display.drawTextRightAlign (display.width ()-1 , y, buf);
294281 y = y + 12 ;
295282 }
296283#endif
0 commit comments