From b435b522174bfcb285dc649c249e74cc3bb2ebd8 Mon Sep 17 00:00:00 2001 From: Stefan Kinzel Date: Thu, 14 Aug 2014 23:46:45 +0200 Subject: [PATCH] some bugfixes for the DNA-animation --- src/animations/dna.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/animations/dna.c b/src/animations/dna.c index 22ab6b9..af8e21f 100644 --- a/src/animations/dna.c +++ b/src/animations/dna.c @@ -77,12 +77,14 @@ void dna(){ uint8_t top_color = 3; uint8_t bottom_color = 2; - uint32_t c = 10000; + uint32_t c = 600; uint8_t sinpos = 0; uint8_t direction = 1; + clear_screen(0); + while(c--){ top = mid - sintab[sinpos]; bottom = mid + sintab[sinpos]; @@ -98,7 +100,7 @@ void dna(){ } if(draw_line == 0){ - if(top <= 1){ + if(top <= 0){ direction = 1; } if(bottom >= NUM_ROWS-1){ @@ -116,9 +118,8 @@ void dna(){ bottom_color = tmp_color; } + wait(50); move(); - - wait(40); } @@ -130,8 +131,8 @@ void dna(){ void move(){ unsigned char plane, row, byte; - for(plane=0; plane<=NUMPLANE; plane++){ - for(row=NUM_COLS;row>0; row--){ + for(plane=0; plane> 1; if(byte < LINEBYTES-1){