@@ -1170,6 +1170,24 @@ void displayRoverFail(uint16_t displayTime)
11701170 }
11711171}
11721172
1173+ void displayAccelFail (uint16_t displayTime)
1174+ {
1175+ if (online.display == true )
1176+ {
1177+ oled.clear (PAGE);
1178+
1179+ uint8_t fontHeight = 15 ;
1180+ uint8_t yPos = LCDHEIGHT / 2 - fontHeight;
1181+
1182+ printTextCenter (" Accel" , yPos, 1 , 1 , false ); // text, y, font type, kerning, inverted
1183+ printTextCenter (" Failed" , yPos + fontHeight, 1 , 1 , false ); // text, y, font type, kerning, inverted
1184+
1185+ oled.display ();
1186+
1187+ delay (displayTime);
1188+ }
1189+ }
1190+
11731191// When user enters serial config menu the display will freeze so show splash while config happens
11741192void displaySerialConfig ()
11751193{
@@ -1458,22 +1476,29 @@ void paintBubbleLevel()
14581476{
14591477 if (online.display == true )
14601478 {
1461- forceDisplayUpdate = true ; // Update the display as quickly as possible
1479+ if (online.accelerometer == true )
1480+ {
1481+ forceDisplayUpdate = true ; // Update the display as quickly as possible
14621482
1463- getAngles ();
1483+ getAngles ();
14641484
1465- // Draw dot in middle
1466- oled.pixel (LCDWIDTH / 2 , LCDHEIGHT / 2 );
1467- oled.pixel (LCDWIDTH / 2 + 1 , LCDHEIGHT / 2 );
1468- oled.pixel (LCDWIDTH / 2 , LCDHEIGHT / 2 + 1 );
1469- oled.pixel (LCDWIDTH / 2 + 1 , LCDHEIGHT / 2 + 1 );
1485+ // Draw dot in middle
1486+ oled.pixel (LCDWIDTH / 2 , LCDHEIGHT / 2 );
1487+ oled.pixel (LCDWIDTH / 2 + 1 , LCDHEIGHT / 2 );
1488+ oled.pixel (LCDWIDTH / 2 , LCDHEIGHT / 2 + 1 );
1489+ oled.pixel (LCDWIDTH / 2 + 1 , LCDHEIGHT / 2 + 1 );
14701490
1471- // Draw circle relative to dot
1472- const int radiusLarge = 10 ;
1473- const int radiusSmall = 4 ;
1491+ // Draw circle relative to dot
1492+ const int radiusLarge = 10 ;
1493+ const int radiusSmall = 4 ;
14741494
1475- oled.circle (LCDWIDTH / 2 - averagedPitch, LCDHEIGHT / 2 + averagedRoll, radiusLarge);
1476- oled.circle (LCDWIDTH / 2 - averagedPitch, LCDHEIGHT / 2 + averagedRoll, radiusSmall);
1495+ oled.circle (LCDWIDTH / 2 - averagedPitch, LCDHEIGHT / 2 + averagedRoll, radiusLarge);
1496+ oled.circle (LCDWIDTH / 2 - averagedPitch, LCDHEIGHT / 2 + averagedRoll, radiusSmall);
1497+ }
1498+ else
1499+ {
1500+ displayAccelFail (0 );
1501+ }
14771502 }
14781503}
14791504
0 commit comments