X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=firmware%2Fs88w-r.c;fp=firmware%2Fs88w-r.c;h=730ac10f3a5337ba2ec31e51ef79a3e8fbac27b6;hb=29cac5c3cc29a5728563fdfdae9d096b862ead56;hp=dbd1ef175d9a7ea95279dc5bccfe85fe12c557f5;hpb=238cd5e5bd9c6fa86ae85f5eb7a8ce00158f2f7c;p=model-railway-devices.git diff --git a/firmware/s88w-r.c b/firmware/s88w-r.c index dbd1ef1..730ac10 100644 --- a/firmware/s88w-r.c +++ b/firmware/s88w-r.c @@ -44,7 +44,8 @@ volatile uint8_t rx_buf[7]; volatile uint8_t rx_fill = 0xFF; volatile uint8_t input[128] = { 0 }; volatile uint8_t latch[128] = { 0 }; -uint8_t log_pos = 0; +uint8_t log_row = 0; +uint8_t log_col = 0; int main() { @@ -147,7 +148,6 @@ void receive(uint8_t c) lcd_gotoxy(19-offset-nibbles, 0); for(i=0; i<=nibbles; ++i) lcd_write(rx_buf[3+i]); - log_pos |= 0x80; } } rx_fill = 0xFF; @@ -160,13 +160,17 @@ void receive(uint8_t c) rx_fill = 0xFF; } - lcd_gotoxy(log_pos%20, 1+log_pos/20); + lcd_gotoxy(log_col, 1+log_row); lcd_write(c); - ++log_pos; - if(log_pos>=60) - log_pos = 0; - if(log_pos%20==0) - lcd_gotoxy(log_pos%20, 1+log_pos/20); + ++log_col; + if(log_col>=20) + { + log_col = 0; + ++log_row; + if(log_row>=3) + log_row = 0; + lcd_gotoxy(log_col, 1+log_row); + } lcd_write(255); }