From 7acc4a8cd87c6038f280e8741cabfb8cfeed1b15 Mon Sep 17 00:00:00 2001 From: asklepios Date: Fri, 13 May 2011 13:16:26 +0000 Subject: [PATCH] weiter animationen - nen paar sonderzeichen entfernt --- Makefile | 2 +- display_loop.c | 12 ++++++++++-- rules.mk | 2 -- smallani/Makefile | 8 ++++++++ smallani/colbounce.c | 32 ++++++++++++++++++++++++++++++++ smallani/colbounce.h | 6 ++++++ smallani/config.in | 2 ++ 7 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 smallani/colbounce.c create mode 100644 smallani/colbounce.h diff --git a/Makefile b/Makefile index c06b9a2..dbe7f21 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,8 @@ include defaults.mk .subdirs: autoconf.h @ echo "checking in which subdirs to build" @ $(RM) -f $@ - @ echo "SUBDIRS += smallani" >> $@ @ echo "SUBDIRS += animations" >> $@ + @ echo "SUBDIRS += smallani" >> $@ @ (for subdir in `grep -e "^#define .*_SUPPORT" autoconf.h \ | sed -e "s/^#define //" -e "s/_SUPPORT.*//" \ | tr "[A-Z]\\n" "[a-z] " `; do \ diff --git a/display_loop.c b/display_loop.c index 33d3d66..0c29831 100644 --- a/display_loop.c +++ b/display_loop.c @@ -25,10 +25,13 @@ #include "menu/menu.h" #include "pixel.h" #ifdef SMALLANIMATION_ROWWALK -#include "smallani/rowwalk.h" +# include "smallani/rowwalk.h" #endif #ifdef SMALLANIMATION_COLWALK -#include "smallani/colwalk.h" +# include "smallani/colwalk.h" +#endif +#ifdef SMALLANIMATION_COLBOUNCE +# include "smallani/colbounce.h" #endif #ifdef JOYSTICK_SUPPORT @@ -223,6 +226,11 @@ void display_loop(){ colwalk(10,50); break; #endif +#ifdef SMALLANIMATION_COLBOUNCE + case 38: + colbounce(10,25); + break; +#endif #ifdef MENU_SUPPORT case 42: diff --git a/rules.mk b/rules.mk index cbe88c1..3e86663 100644 --- a/rules.mk +++ b/rules.mk @@ -19,7 +19,6 @@ OBJECTS += $(patsubst %.S,obj_avr/%.o,${ASRC}) objects_avr: $(OBJECTS) @ echo "writing object ineventory" @ echo $(OBJECTS) > obj_avr/.objects - ############################################################################## # rules for buildung simulator objects @@ -49,6 +48,5 @@ clean: clean-common all: make -C $(TOPDIR) all - include $(TOPDIR)/depend.mk diff --git a/smallani/Makefile b/smallani/Makefile index e362615..a7f5c00 100644 --- a/smallani/Makefile +++ b/smallani/Makefile @@ -10,5 +10,13 @@ ifeq ($(SMALLANIMATION_COLWALK),y) SRC += colwalk.c endif +ifeq ($(SMALLANIMATION_ROWBOUNCE),y) + SRC += rowbounce.c +endif + +ifeq ($(SMALLANIMATION_COLBOUNCE),y) + SRC += colbounce.c +endif + include $(TOPDIR)/rules.mk diff --git a/smallani/colbounce.c b/smallani/colbounce.c new file mode 100644 index 0000000..4e0d9da --- /dev/null +++ b/smallani/colbounce.c @@ -0,0 +1,32 @@ +#include +#include "../config.h" +#include "../pixel.h" +#include "../util.h" +#include "colbounce.h" + +void colbounce(uint8_t times,uint8_t speed) +{ + uint8_t i, j,k,h; + + for(k=0;k0;h--){ + for (i=0;i