From acd84305c636be92714c742911132b43224b4c3f Mon Sep 17 00:00:00 2001 From: Hans-Gert Dahmen Date: Fri, 28 Oct 2011 21:52:17 +0000 Subject: [PATCH] fixed a lot of config options --- animations/borg_time.c | 6 ------ animations/config.in | 26 ++++++++++++++++++++++---- config.h | 37 ++++++++++++++----------------------- display_loop.c | 9 +++++++-- profiles/borg-16 | 2 +- profiles/borg-ls | 10 +++++++++- scrolltext/Makefile | 2 +- scrolltext/config.in | 8 ++++---- scrolltext/scrolltext.h | 4 ++++ scrolltext/scrolltext3.c | 17 ++++++++++++++--- 10 files changed, 76 insertions(+), 45 deletions(-) diff --git a/animations/borg_time.c b/animations/borg_time.c index 006f083..200a690 100644 --- a/animations/borg_time.c +++ b/animations/borg_time.c @@ -13,12 +13,6 @@ #include "../util.h" #include "../scrolltext/scrolltext.h" -//address of the time master -#define TIME_MASTER_ADDR 0x00 - -//update timeout in ms -#define TIME_UPDATE_TIMEOUT 100 - //hackhack extern can_addr myaddr; diff --git a/animations/config.in b/animations/config.in index 477cdcc..2cbac59 100644 --- a/animations/config.in +++ b/animations/config.in @@ -3,10 +3,24 @@ comment "Animations" dep_bool "Scrolltext" ANIMATION_SCROLLTEXT $SCROLLTEXT_SUPPORT bool "Spirale" ANIMATION_SPIRALE bool "Joern1" ANIMATION_JOERN1 - dep_bool "Snake" ANIMATION_SNAKE $RANDOM_SUPPORT + + dep_bool_menu "Snake" ANIMATION_SNAKE $RANDOM_SUPPORT + int "Snake delay" SNAKE_DELAY 100 + endmenu + bool "Schachbrett" ANIMATION_SCHACHBRETT - dep_bool "Feuer" ANIMATION_FEUER $RANDOM_SUPPORT - dep_bool "Matrix" ANIMATION_MATRIX $RANDOM_SUPPORT + + dep_bool_menu "Feuer" ANIMATION_FEUER $RANDOM_SUPPORT + int "FEUER_S" FEUER_S 30 + int "FEUER_N" FEUER_N 5 + int "FEUER_DIV" FEUER_DIV 44 + int "FEUER_DELAY" FEUER_DELAY 50 + endmenu + + dep_bool_menu "Matrix" ANIMATION_MATRIX $RANDOM_SUPPORT + int "Number of streamers" STREAMER_NUM 30 + endmenu + dep_bool "Random Bright" ANIMATION_RANDOM_BRIGHT $RANDOM_SUPPORT dep_bool "Stonefly" ANIMATION_STONEFLY $GAME_TETRIS_CORE dep_bool "Flying Dots" ANIMATION_FLYINGDOTS $RANDOM_SUPPORT @@ -14,7 +28,11 @@ comment "Animations" dep_bool "Breakout Demo" ANIMATION_BREAKOUT $GAME_BREAKOUT bool "Martin Herweg" ANIMATION_MHERWEG $RANDOM_SUPPORT dep_bool "Langton Ant" ANIMATION_LTN_ANT $RANDOM_SUPPORT - dep_bool "Time Display" ANIMATION_TIME $SCROLLTEXT_SUPPORT $LAP_TIME_EXTENSION + + dep_bool_menu "Time Display" ANIMATION_TIME $SCROLLTEXT_SUPPORT $LAP_TIME_EXTENSION + hex "Time master address (hex)" TIME_MASTER_ADDR 0x00 + int "Request timeout (ms)" TIME_UPDATE_TIMEOUT 23 + endmenu dep_bool_menu "Bitmap Scroller" ANIMATION_BMSCROLLER y $RANDOM_SUPPORT dep_bool "LABOR Logo" ANIMATION_LABORLOGO $ANIMATION_BMSCROLLER diff --git a/config.h b/config.h index e078f87..31b754b 100644 --- a/config.h +++ b/config.h @@ -3,36 +3,27 @@ #include "autoconf.h" -#define STREAMER_NUM 30 - -#define FEUER_N 5 -#define FEUER_S 30 -#define FEUER_DIV 44 -#define FEUER_DELAY 50 - -#define SNAKE_DELAY 100 - #ifdef CAN_SUPPORT - #define BORG_CAN -// spi.[ch] defines +// spi.[ch] defines +//spi port default config #if SPI_PORTIDX == 0 -#define SPI_PORT PORTA -#define SPI_DDR DDRA -#define SPI_PIN PINA + #define SPI_PORT PORTA + #define SPI_DDR DDRA + #define SPI_PIN PINA #elif SPI_PORTIDX == 1 -#define SPI_PORT PORTB -#define SPI_DDR DDRB -#define SPI_PIN PINB + #define SPI_PORT PORTB + #define SPI_DDR DDRB + #define SPI_PIN PINB #elif SPI_PORTIDX == 2 -#define SPI_PORT PORTC -#define SPI_DDR DDRC -#define SPI_PIN PINC + #define SPI_PORT PORTC + #define SPI_DDR DDRC + #define SPI_PIN PINC #elif SPI_PORTIDX == 3 -#define SPI_PORT PORTD -#define SPI_DDR DDRD -#define SPI_PIN PIND + #define SPI_PORT PORTD + #define SPI_DDR DDRD + #define SPI_PIN PIND #endif // can.[ch] defines diff --git a/display_loop.c b/display_loop.c index eba21cb..bce7053 100644 --- a/display_loop.c +++ b/display_loop.c @@ -84,10 +84,15 @@ void display_loop(){ #endif #endif #ifdef ANIMATION_TIME - time_anim(); +#ifndef ANIMATION_SCROLLTEXT + case 1: #endif -#ifdef ANIMATION_TIME || ANIMATION_SCROLLTEXT + time_anim(); break; +#else ANIMATION +#ifdef ANIMATION_SCROLLTEXT + break; +#endif #endif #ifdef ANIMATION_SPIRALE diff --git a/profiles/borg-16 b/profiles/borg-16 index 05eea37..95eb032 100644 --- a/profiles/borg-16 +++ b/profiles/borg-16 @@ -35,7 +35,7 @@ PIN_DATA=7 # RANDOM_SUPPORT=y SCROLLTEXT_SUPPORT=y -SCROLLTEXT_FONT=font_arial8 +SCROLLTEXT_FONT=FONT_ARIAL8 SCROLLTEXT_BUFFER_SIZE=128 SCROLL_X_SPEED=20 SCROLL_Y_SPEED=20 diff --git a/profiles/borg-ls b/profiles/borg-ls index 012b463..e09a1bf 100644 --- a/profiles/borg-ls +++ b/profiles/borg-ls @@ -31,7 +31,7 @@ PIN_LINE_EN=5 RANDOM_SUPPORT=y LAP_TIME_EXTENSION=y SCROLLTEXT_SUPPORT=y -SCROLLTEXT_FONT=font_arial8 +SCROLLTEXT_FONT=font_uni53 SCROLLTEXT_BUFFER_SIZE=128 SCROLL_X_SPEED=10 SCROLL_Y_SPEED=30 @@ -67,9 +67,15 @@ ANIMATION_SCROLLTEXT=y ANIMATION_SPIRALE=y ANIMATION_JOERN1=y ANIMATION_SNAKE=y +SNAKE_DELAY=50 ANIMATION_SCHACHBRETT=y ANIMATION_FEUER=y +FEUER_S=30 +FEUER_N=5 +FEUER_DIV=47 +FEUER_DELAY=30 ANIMATION_MATRIX=y +STREAMER_NUM=100 ANIMATION_RANDOM_BRIGHT=y # ANIMATION_STONEFLY is not set # ANIMATION_FLYINGDOTS is not set @@ -78,6 +84,8 @@ ANIMATION_GAMEOFLIFE=y # ANIMATION_MHERWEG is not set # ANIMATION_LTN_ANT is not set ANIMATION_TIME=y +TIME_MASTER_ADDR=00 +TIME_UPDATE_TIMEOUT=100 # ANIMATION_BMSCROLLER is not set # ANIMATION_LABORLOGO is not set # ANIMATION_AMPHIBIAN is not set diff --git a/scrolltext/Makefile b/scrolltext/Makefile index ecba0c9..3c9c740 100644 --- a/scrolltext/Makefile +++ b/scrolltext/Makefile @@ -5,6 +5,6 @@ include $(TOPDIR)/defaults.mk SRC = scrolltext3.c -SRC += $(SCROLLTEXT_FONT).c +SRC += $(shell echo $(SCROLLTEXT_FONT) | tr A-Z a-z).c include $(TOPDIR)/rules.mk diff --git a/scrolltext/config.in b/scrolltext/config.in index 39c5a01..ced0d87 100644 --- a/scrolltext/config.in +++ b/scrolltext/config.in @@ -1,11 +1,11 @@ -dep_bool_menu "Scrolltext Support" SCROLLTEXT_SUPPORT y +dep_bool_menu "Scrolltext Support" SCROLLTEXT_SUPPORT y if [ "$SCROLLTEXT_SUPPORT" = "y" ]; then choice 'Scrolltext Font' \ - "Arial_8 font_arial8 \ - Small_6 font_small6 \ - Uni_53 font_uni53" \ + "Arial_8 FONT_ARIAL8 \ + Small_6 FONT_SMALL6 \ + Uni_53 FONT_UNI53" \ 'Arial_8' SCROLLTEXT_FONT int "Scrolltest buffer size" SCROLLTEXT_BUFFER_SIZE 128 diff --git a/scrolltext/scrolltext.h b/scrolltext/scrolltext.h index 9f73d05..2c5f574 100644 --- a/scrolltext/scrolltext.h +++ b/scrolltext/scrolltext.h @@ -1,6 +1,10 @@ #ifndef SCROLLTEXT_H_ #define SCROLLTEXT_H_ +#define FONT_ARIAL8 1 +#define FONT_SMALL6 2 +#define FONT_UNI53 3 + void scrolltext(char *str); #endif /* SCROLLTEXT_H_ */ diff --git a/scrolltext/scrolltext3.c b/scrolltext/scrolltext3.c index 3ca4c41..3c36e7e 100644 --- a/scrolltext/scrolltext3.c +++ b/scrolltext/scrolltext3.c @@ -11,8 +11,19 @@ #include "../pixel.h" #include "../util.h" #include "font_arial8.h" -// #include "font_small6.h" -// #include "font_uni53.h" +#if SCROLLTEXT_FONT == FONT_ARIAL8 + #include "font_arial8.h" + #define FONT_NAME font_arial8 +#elif SCROLLTEXT_FONT == FONT_SMALL6 + #include "font_small6.h" + #define FONT_NAME font_small6 +#elif SCROLLTEXT_FONT == FONT_UNI53 + #include "font_uni53.h" + #define FONT_NAME font_uni53 +#else + #include "font_arial8.h" + #define FONT_NAME font_arial8 +#endif #ifdef __CYGWIN__ #define strtok_r(a, b, c) strtok((a), (b)) @@ -511,7 +522,7 @@ void scrolltext(char *str) { char tmp_str[SCROLLTEXT_BUFFER_SIZE]; int ljmp_retval; - fonts[0] = SCROLLTEXT_FONT; + fonts[0] = FONT_NAME; unsigned char auto_pixmap[NUM_ROWS][LINEBYTES]; text_pixmap = &auto_pixmap;