diff --git a/display_loop.c b/display_loop.c index 0c29831..1b01023 100644 --- a/display_loop.c +++ b/display_loop.c @@ -217,7 +217,7 @@ void display_loop(){ #ifdef SMALLANIMATION_ROWWALK case 36: - rowwalk(10,50); + rowwalk(50,10); break; #endif @@ -231,6 +231,11 @@ void display_loop(){ colbounce(10,25); break; #endif +#ifdef SMALLANIMATION_COLBOUNCE + case 39: + rowbounce(10,25); + break; +#endif #ifdef MENU_SUPPORT case 42: diff --git a/smallani/colbounce.h b/smallani/colbounce.h index 1fd45e2..2f19a3b 100644 --- a/smallani/colbounce.h +++ b/smallani/colbounce.h @@ -1,6 +1,6 @@ -#ifndef COLBOUNCE_H_ -#define COLBOUNCE_H_ +#ifndef ROWBOUNCE_H_ +#define ROWBOUNCE_H_ -void colbounce(uint8_t times,uint8_t speed); +void rowbounce(uint8_t times,uint8_t speed); -#endif /* COLBOUNCE_H_ */ +#endif /* ROWBOUNCE_H_ */ diff --git a/smallani/config.in b/smallani/config.in index d185650..34287d1 100644 --- a/smallani/config.in +++ b/smallani/config.in @@ -1,7 +1,14 @@ mainmenu_option next_comment comment "small Animations" - bool "rowwalk" SMALLANIMATION_ROWWALK - bool "colwalk" SMALLANIMATION_COLWALK - bool "rowbounce" SMALLANIMATION_ROWBOUNCE - bool "colbounce" SMALLANIMATION_COLBOUNCE + bool "rowwalk" SMALLANIMATION_ROWWALK + int "speed of rowwalk in 20ms" SMALLANIMATION_ROWWALK_SPEED "50" + + bool "colwalk" SMALLANIMATION_COLWALK + int "speed of colwalk in 20ms" SMALLANIMATION_COLWALK_SPEED "50" + + bool "rowbounce" SMALLANIMATION_ROWBOUNCE + int "speed of rowbounce in 20ms" SMALLANIMATION_ROWBOUNCE_SPEED "50" + + bool "colbounce" SMALLANIMATION_COLBOUNCE + int "speed of colbounce in 20ms" SMALLANIMATION_COLBOUNCE_SPEED "50" endmenu diff --git a/smallani/rowbounce.c b/smallani/rowbounce.c new file mode 100644 index 0000000..4f49c21 --- /dev/null +++ b/smallani/rowbounce.c @@ -0,0 +1,32 @@ +#include +#include "../config.h" +#include "../pixel.h" +#include "../util.h" +#include "rowbounce.h" + +void rowbounce(uint8_t times,uint8_t speed) +{ + uint8_t i, j,k,h; + + for(k=0;k1;h--){ + for (i=0;i