From 131fe546b03e22cf5bce1d7dad7ae47328d8baf5 Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Wed, 9 May 2012 17:57:51 +0000 Subject: [PATCH] made some parameters like plasma frame delays configurable --- Doxyfile | 2 +- animations/config.in | 15 ++++++++--- animations/fpmath_patterns.c | 48 ++++++++++++++++++++++-------------- profiles/borg-16 | 16 +++++++++--- profiles/borg-andre | 14 +++++++++-- 5 files changed, 67 insertions(+), 28 deletions(-) diff --git a/Doxyfile b/Doxyfile index 5919947..c69f0c9 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer # a quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "Firmware for the AVR based Borg devices of LABOR e.V." +PROJECT_BRIEF = "Firmware for the AVR based Borg devices of \"Das LABOR e.V.\"" # With the PROJECT_LOGO tag one can specify an logo or icon that is # included in the documentation. The maximum height of the logo should not diff --git a/animations/config.in b/animations/config.in index 106a3bd..b4dead8 100644 --- a/animations/config.in +++ b/animations/config.in @@ -55,10 +55,19 @@ comment "Animations" dep_bool "Out of Spec Logo" ANIMATION_LOGO_OOS $ANIMATION_BMSCROLLER dep_bool "Fairydust" ANIMATION_FAIRYDUST $ANIMATION_BMSCROLLER endmenu + + mainmenu_option next_comment + comment "Fixed-point math patterns" + bool "Double Buffering" FP_DOUBLE_BUFFERING 1 + + bool "Plasma" ANIMATION_PLASMA $ANIMATION_FIXEDPOINT + int "Additional Frame Delay (in ms) For Plasma" FP_PLASMA_DELAY 1 + + bool "Psychedelic" ANIMATION_PSYCHEDELIC $ANIMATION_FIXEDPOINT + int "Additional Frame Delay (in ms) For Psychedelic" FP_PSYCHO_DELAY 15 + endmenu - bool "Plasma" ANIMATION_PLASMA - bool "Psychedelic" ANIMATION_PSYCHEDELIC - bool "Black Hole" ANIMATION_BLACKHOLE + bool "Black Hole" ANIMATION_BLACKHOLE comment "Special Animations" bool "Test Animations" ANIMATION_TESTS diff --git a/animations/fpmath_patterns.c b/animations/fpmath_patterns.c index be2cad0..1ad535d 100644 --- a/animations/fpmath_patterns.c +++ b/animations/fpmath_patterns.c @@ -18,20 +18,22 @@ #include "fpmath_patterns.h" -/** - * Double buffering helps in reducing the effect of visibly redrawing every - * frame. With this option turned on, a frame is rendered into an off-screen - * buffer first and then copied to the actual frame buffer in one piece. - * However, given the borg's graphics architecture, half painted frames may - * still occur, but they are barely noticeable with this option enabled. - * - * Turn this off (#undef DOUBLE_BUFFERING) if you prefer speed over beauty. - */ -#define DOUBLE_BUFFERING +#ifdef DOXYGEN + /** + * Double buffering helps in reducing the effect of visibly redrawing every + * frame. With this option turned on, a frame is rendered into an off-screen + * buffer first and then copied to the actual frame buffer in one piece. + * However, given the borg's graphics architecture, half painted frames may + * still occur, but they are barely noticeable with this option enabled. + * + * Turn this off if you prefer speed over beauty. + */ + #define FP_DOUBLE_BUFFERING +#endif DOXYGEN -#ifdef LOW_PRECISION - #undef LOW_PRECISION +#ifdef FP_LOW_PRECISION + #undef FP_LOW_PRECISION #endif #if NUM_COLS <= 16 && NUM_ROWS <= 16 @@ -49,10 +51,10 @@ * ability to store every interim result as Q23.8. Most operations like * square root, sine, cosine, multiplication etc. utilize 32 bit types. */ - #define LOW_PRECISION + #define FP_LOW_PRECISION #endif -#ifdef LOW_PRECISION +#ifdef FP_LOW_PRECISION /** This is the type we expect ordinary integers to be. */ typedef int16_t ordinary_int_t; /** This is the type which we use for fixed-point values. */ @@ -328,7 +330,7 @@ typedef unsigned char (*fpmath_pattern_func_t)(unsigned char const x, fixp_t const t, void *const r); -#ifdef DOUBLE_BUFFERING +#ifdef FP_DOUBLE_BUFFERING # define BUFFER pixmap_buffer #else # define BUFFER pixmap @@ -351,7 +353,7 @@ static void fixPattern(fixp_t const t_start, fpmath_pattern_func_t fpPattern, void *r) { -#ifdef DOUBLE_BUFFERING +#ifdef FP_DOUBLE_BUFFERING // double buffering to reduce half painted pictures unsigned char pixmap_buffer[NUMPLANE][NUM_ROWS][LINEBYTES]; #endif @@ -376,7 +378,7 @@ static void fixPattern(fixp_t const t_start, } } -#ifdef DOUBLE_BUFFERING +#ifdef FP_DOUBLE_BUFFERING memcpy(pixmap, pixmap_buffer, sizeof(pixmap)); #endif @@ -471,7 +473,11 @@ void plasma(void) #ifndef __AVR__ fixPattern(0, fixScaleUp(75), 0.1 * FIX, 80, fixAnimPlasma, &r); #else - fixPattern(0, fixScaleUp(60), 0.1 * FIX, 1, fixAnimPlasma, &r); + #ifndef FP_PSYCHO_DELAY + #define FP_PSYCHO_DELAY 1 + #endif + fixPattern(0, fixScaleUp(60), 0.1 * FIX, + FP_PSYCHO_DELAY, fixAnimPlasma, &r); #endif /* __AVR__ */ } @@ -535,7 +541,11 @@ void psychedelic(void) #ifndef __AVR__ fixPattern(0, fixScaleUp(75), 0.1 * FIX, 80, fixAnimPsychedelic, &r); #else - fixPattern(0, fixScaleUp(60), 0.1 * FIX, 15, fixAnimPsychedelic, &r); + #ifndef FP_PLASMA_DELAY + #define FP_PLASMA_DELAY 15 + #endif + fixPattern(0, fixScaleUp(60), 0.1 * FIX, FP_PLASMA_DELAY, + fixAnimPsychedelic, &r); #endif /* __AVR__ */ } diff --git a/profiles/borg-16 b/profiles/borg-16 index b39be00..59c956f 100644 --- a/profiles/borg-16 +++ b/profiles/borg-16 @@ -41,6 +41,7 @@ SCROLLTEXT_BUFFER_SIZE=128 SCROLL_X_SPEED=20 SCROLL_Y_SPEED=20 SCROLLTEXT_TEXT="