11 #include <avr/interrupt.h>
12 #include <avr/pgmspace.h>
16 #include <util/delay.h>
23 #include "animation_codes.h"
26 #include "anim_snake.h"
66 {0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
67 {0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
68 {0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
69 {0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
70 {0x0000, 0x0000, 0x0000, 0x0000, 0x0000}
157 ((1<<anim_cnt0)|(1<<anim_cnt1));
158 i_phase = i_phase>>anim_cnt0;
179 uint8_t i_framebuffer_cnt = 0;
190 while( i_framebuffer_cnt < 25 )
192 i_tmp = pgm_read_word(
p_anime );
212 while( i_framebuffer_cnt < 25)
241 i_phase = i_phase << anim_cnt0;
302 #ifdef PORTA // If on HW exist this port -> set whole port to Hi-Z
306 #ifdef PORTB // If on HW exist this port -> set whole port to Hi-Z
310 #ifdef PORTC // If on HW exist this port -> set whole port to Hi-Z
314 #ifdef PORTD // If on HW exist this port -> set whole port to Hi-Z
318 #ifdef PORTE // If on HW exist this port -> set whole port to Hi-Z
322 #ifdef PORTF // If on HW exist this port -> set whole port to Hi-Z
326 #ifdef PORTG // If on HW exist this port -> set whole port to Hi-Z
330 #ifdef PORTH // If on HW exist this port -> set whole port to Hi-Z
334 #ifdef PORTI // If on HW exist this port -> set whole port to Hi-Z
341 io_set_1( KBRD_RD0_PORT, KBRD_RD0_pin );
343 io_set_1( KBRD_RD1_PORT, KBRD_RD1_pin );
345 io_set_1( KBRD_RD2_PORT, KBRD_RD2_pin );
347 io_set_1( KBRD_RD3_PORT, KBRD_RD3_pin );
349 io_set_1( KBRD_RD4_PORT, KBRD_RD4_pin );
351 io_set_1( KBRD_RD5_PORT, KBRD_RD5_pin );
374 TCCR2 = (0<<COM21)|(0<<COM20)|\
375 (1<<WGM21)|(0<<WGM20)|\
376 (1<<CS22) |(0<<CS21) |(1<<CS20);
400 if( (( i_tmp & 0x8000 ) != 0) &&
406 uint8_t cmd_number = (i_tmp & 0x7F00)>>8;
407 uint8_t cmd_value = (i_tmp & 0x00FF);
423 for(uint8_t i_wall = 4 ; i_wall <5 ; i_wall--)
425 for(uint8_t i_column = 4 ; i_column <5 ; i_column--)
436 *p_framebuffer_cnt = 25;
460 if(*p_framebuffer_cnt < 5 )
465 *p_framebuffer_cnt = 5;
467 else if(*p_framebuffer_cnt < 10)
472 *p_framebuffer_cnt = 10;
474 else if(*p_framebuffer_cnt < 15)
479 *p_framebuffer_cnt = 15;
481 else if(*p_framebuffer_cnt < 20)
486 *p_framebuffer_cnt = 20;
493 *p_framebuffer_cnt = 25;
498 if(*p_framebuffer_cnt < 5)
502 *p_framebuffer_cnt = 5;
504 else if(*p_framebuffer_cnt < 10)
508 *p_framebuffer_cnt = 10;
510 else if(*p_framebuffer_cnt < 15)
514 *p_framebuffer_cnt = 15;
516 else if(*p_framebuffer_cnt < 20 )
520 *p_framebuffer_cnt = 20;
526 *p_framebuffer_cnt = 25;
530 if(*p_framebuffer_cnt < 5 )
535 *p_framebuffer_cnt = 5;
537 else if(*p_framebuffer_cnt < 10)
542 *p_framebuffer_cnt = 10;
544 else if(*p_framebuffer_cnt < 15)
549 *p_framebuffer_cnt = 15;
551 else if(*p_framebuffer_cnt < 20)
556 *p_framebuffer_cnt = 20;
563 *p_framebuffer_cnt = 25;
584 *p_framebuffer_cnt = 25;
608 switch(*p_framebuffer_cnt)
637 (*p_framebuffer_cnt)++;