Browse Source

i don't like this ethersex-menuconfig - no time left to fix rowbounce :/

feature/2015
asklepios 14 years ago
parent
commit
e5e41ceddd
  1. 7
      display_loop.c
  2. 8
      smallani/colbounce.h
  3. 7
      smallani/config.in
  4. 32
      smallani/rowbounce.c
  5. 6
      smallani/rowbounce.h

7
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:

8
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_ */

7
smallani/config.in

@ -1,7 +1,14 @@
mainmenu_option next_comment
comment "small Animations"
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

32
smallani/rowbounce.c

@ -0,0 +1,32 @@
#include <inttypes.h>
#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;k<times;k++){
clear_screen(0);
for (h=0;h<NUM_ROWS;h++){
for (i=0;i<NUM_COLS;i++){
for (j=0;j<NUM_ROWS;j++){
setpixel( (pixel){i,j},(h==i) ? 1:0);
}
}
wait(speed*10);
}
for (h=NUM_ROW-1;h>1;h--){
for (i=0;i<NUM_COLS;i++){
for (j=0;j<NUM_ROWS;j++){
setpixel( (pixel){i,j},((h-1)==i) ? 1:0);
}
}
wait(speed*10);
}
}
}

6
smallani/rowbounce.h

@ -0,0 +1,6 @@
#ifndef COLBOUNCE_H_
#define COLBOUNCE_H_
void colbounce(uint8_t times,uint8_t speed);
#endif /* COLBOUNCE_H_ */
Loading…
Cancel
Save