@@ -52,7 +52,11 @@ static PCD8544 lcd; //for Nokia Display
5252
5353#if (DISPLAY_TYPE & DISPLAY_TYPE_16X2_LCD_4BIT)
5454#include " LiquidCrystalDogm.h" // for 4bit (e.g. EA-DOGM) Display
55+ #if HARDWARE_REV < 20
5556static LiquidCrystal lcd (13 , 12 , 11 , 10 , 9 , 8 ); // for 4bit (e.g. EA-DOGM) Display
57+ #else
58+ static LiquidCrystal lcd (6 ,PH2, 16 , 17 ,7 ,37 ); // for 4bit (e.g. EA-DOGM) Display
59+ #endif
5660#endif
5761
5862#if (DISPLAY_TYPE & DISPLAY_TYPE_16X2_SERIAL)
@@ -119,7 +123,11 @@ static void prepare_important_info(int duration_secs)
119123#endif
120124
121125 lcd.clear ();
126+ #if (DISPLAY_TYPE & DISPLAY_TYPE_NOKIA)
122127 lcd.setCursor (0 , 2 );
128+ #elif (DISPLAY_TYPE & DISPLAY_TYPE_16X2)
129+ lcd.setCursor (0 , 0 );
130+ #endif
123131}
124132#endif
125133
@@ -274,7 +282,7 @@ static void display_16x2_setup()
274282 lcd.init ();
275283#endif
276284
277- #if (DISPLAY_TYPE & DISPLAY_TYPE_16X2 )
285+ #if (DISPLAY_TYPE & DISPLAY_TYPE_16X2_SERIAL )
278286 // Online editor for custom chars (5x8 pixels):
279287 // http://www.quinapalus.com/hd44780udg.html
280288 lcd.createChar (0x01 , serial_break_symbol);
@@ -346,7 +354,7 @@ static void display_16x2_view_main()
346354 lcd.setCursor (0 ,0 );
347355 if (spd<10 )
348356 {lcd.print (MY_F (" " ));}
349- lcd.print (round ( spd) ,0 );
357+ lcd.print (spd,0 );
350358 lcd.print (MY_F (" km/h " ));
351359
352360 double power_display = power;
@@ -367,15 +375,25 @@ static void display_16x2_view_main()
367375
368376 // Break status
369377 if (brake_stat==0 )
378+ #if DISPAY_TYPE==DISPLAY_TYPE_16X2_SERIAL
370379 lcd.write (0x01 );
380+ #else
381+ lcd.print (MY_F (" B" ));
382+ #endif
371383 else if (current_profile) // second profile active?
384+ #if DISPAY_TYPE==DISPLAY_TYPE_16X2_SERIAL
372385 lcd.write (0x03 );
386+ #else
387+ lcd.print (MY_F (" 2" ));
388+ #endif
373389 else
374390 lcd.print (MY_F (" " ));
375391
376392 lcd.setCursor (0 ,1 );
377393 // Custom battery symbol
394+ #if DISPAY_TYPE==DISPLAY_TYPE_16X2_SERIAL
378395 lcd.write (0x02 );
396+ #endif
379397 lcd.print (battery_percent_fromcapacity);
380398 // Note: two extra spaces to clear chars when the capacity gets lower
381399 lcd.print (MY_F (" % " ));
@@ -1365,4 +1383,4 @@ void display_debug(HardwareSerial* localSerial)
13651383 #endif
13661384
13671385#endif
1368- }
1386+ }
0 commit comments