Skip to content

Commit

Permalink
Bug fix for power meter bug (#61)
Browse files Browse the repository at this point in the history
* WIP: fix for bug

* clean up
  • Loading branch information
leon927 authored and casainho committed Dec 24, 2018
1 parent c7c0402 commit 1d46f08
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/display/KT-LCD3/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2067,18 +2067,16 @@ void lcd_print(uint32_t ui32_number, uint8_t ui8_lcd_field, uint8_t ui8_options)
uint8_t ui8_digit;
uint8_t ui8_counter;

// let's multiply the number by 10 to not show decimal digit
if((ui8_options == 0) && (ui8_lcd_field != ASSIST_LEVEL_FIELD))
// multiply the value by 10 to not show decimal digit if ...
if( (ui8_options == 0) && (ui8_lcd_field != ASSIST_LEVEL_FIELD) && (ui8_lcd_field != BATTERY_POWER_FIELD) )
{
ui32_number *= 10;
}

// first delete the field
for (ui8_counter = 0; ui8_counter < 5; ui8_counter++)
{
if (ui8_lcd_field == ASSIST_LEVEL_FIELD ||
ui8_lcd_field == ODOMETER_FIELD ||
ui8_lcd_field == TEMPERATURE_FIELD)
if (ui8_lcd_field == ASSIST_LEVEL_FIELD || ui8_lcd_field == ODOMETER_FIELD || ui8_lcd_field == TEMPERATURE_FIELD)
{
ui8_lcd_frame_buffer[ui8_lcd_field_offset[ui8_lcd_field] - ui8_counter] &= NUMBERS_MASK;
}
Expand Down

0 comments on commit 1d46f08

Please sign in to comment.