diff --git a/software/AS7/TSL/TSL.c b/software/AS7/TSL/TSL.c index 4f8f696..ccaa162 100644 --- a/software/AS7/TSL/TSL.c +++ b/software/AS7/TSL/TSL.c @@ -225,8 +225,13 @@ inline void showNowH( uint8_t h ) { t = h/10; digitShow( 4 , h - (t*10) ); - digitShow( 5 , t ); + if (t) { + digitShow( 5 , t ); + } + + // We do not need to explicitly blank the tens digit since we + // always clear it on day increment and it only monotonically increments. } @@ -239,6 +244,7 @@ void run() { showNowD( d ); + digitBlank( 5 ); // Clear the residual leading '2' from the hours-tens digit. for( uint8_t h=0; h<24; h++ ) { @@ -473,6 +479,10 @@ int main(void) } */ + // Clear out whatever was left from the countdown so we can assume all + // all blank digits in run() + + clearLCD(); run(); uint8_t count=0; diff --git a/software/AS7/TSL/lcd.c b/software/AS7/TSL/lcd.c index ae75737..f9ab9cb 100644 --- a/software/AS7/TSL/lcd.c +++ b/software/AS7/TSL/lcd.c @@ -318,6 +318,16 @@ void digitOff( uint8_t d, uint8_t n ) { } } +// Blank out the specified digit + +void digitBlank( uint8_t d ) { + + for(uint8_t seg = 0 ; seg < 7; seg++ ) { // Walk though the 7 segments in the digit + + lcd_clear_pixel( digitmap[d][seg].com , digitmap[d][seg].seg ); + } +} + // Display the decimal digit n (0-9) at position d (0-11 where 0 is leftmost) dark if onFlag, light if not diff --git a/software/AS7/TSL/lcd.h b/software/AS7/TSL/lcd.h index 0bcc145..a8dbebe 100644 --- a/software/AS7/TSL/lcd.h +++ b/software/AS7/TSL/lcd.h @@ -48,6 +48,10 @@ void digitOn( uint8_t d, uint8_t n ); void digitOff( uint8_t d, uint8_t n ); +// Blank out the specified digit + +void digitBlank( uint8_t d ); + // Set or clear segments to show digit void digitShow( uint8_t d, uint8_t n );