Building Monochron clocks is FUN!
Some time ago I downloaded the Monochron pong clock code.
However, I ran into some code in ratt.c that I just don't understand.
Below is a snippet from ratt.c:
Code: Select all
step();
if (displaymode == SHOW_TIME) {
if (! inverted && alarming && (time_s & 0x1)) {
inverted = 1;
initdisplay(inverted);
}
else if ((inverted && ! alarming) ||
(alarming && inverted && !(time_s & 0x1))) {
inverted = 0;
initdisplay(0);
} else {
PORTB |= _BV(5);
draw(inverted);
PORTB &= ~_BV(5);
}
}
- What will happen when PORTB bit 5 is set or cleared?
- Both draw() and initdisplay() interact with the LCD. So, is there a reason why the initdisplay() function is not enclosed with the same PORTB bit 5 code? Should it be there?
- What may/will happen when the PORTB bit 5 code is removed? Is it essential for a proper functioning pong clock?
Thx to anyone providing me a clue or (even better!) an answer.
Kind regards,
Toine