Skip to content

Commit

Permalink
No leading zero on hours.
Browse files Browse the repository at this point in the history
  • Loading branch information
bigjosh committed Mar 8, 2018
1 parent 8512aac commit 6837da8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
12 changes: 11 additions & 1 deletion software/AS7/TSL/TSL.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.

}

Expand All @@ -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++ ) {

Expand Down Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions software/AS7/TSL/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions software/AS7/TSL/lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 6837da8

Please sign in to comment.