From e5e41ceddda2da5709a2ccbe54366fc84b1a325a Mon Sep 17 00:00:00 2001 From: asklepios Date: Fri, 13 May 2011 14:54:06 +0000 Subject: [PATCH] i don't like this ethersex-menuconfig - no time left to fix rowbounce :/ --- display_loop.c | 7 ++++++- smallani/colbounce.h | 8 ++++---- smallani/config.in | 15 +++++++++++---- smallani/rowbounce.c | 32 ++++++++++++++++++++++++++++++++ smallani/rowbounce.h | 6 ++++++ 5 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 smallani/rowbounce.c create mode 100644 smallani/rowbounce.h 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