Browse Source

borg_hw_lolshield: framerate can be adjusted in the menu, now

feature/2015
Christian Kroll 11 years ago
parent
commit
43dac0a8c6
  1. 1
      profiles/LoL-Shield_Leonardo
  2. 1
      profiles/LoL-Shield_Mega2560
  3. 1
      profiles/LoL-Shield_Uno-Duemilanove-Diavolino
  4. 14
      src/borg_hw/borg_hw_lolshield.c
  5. 3
      src/borg_hw/config_lolshield.in

1
profiles/LoL-Shield_Leonardo

@ -21,6 +21,7 @@ BORG_HW=HW_LOLSHIELD
#
USER_TIMER0_FOR_WAIT=1
BRIGHTNESS=127
FRAMERATE=80
#
# Features

1
profiles/LoL-Shield_Mega2560

@ -21,6 +21,7 @@ BORG_HW=HW_LOLSHIELD
#
USER_TIMER0_FOR_WAIT=1
BRIGHTNESS=127
FRAMERATE=80
#
# Features

1
profiles/LoL-Shield_Uno-Duemilanove-Diavolino

@ -21,6 +21,7 @@ BORG_HW=HW_LOLSHIELD
#
USER_TIMER0_FOR_WAIT=1
BRIGHTNESS=127
FRAMERATE=80
#
# Features

14
src/borg_hw/borg_hw_lolshield.c

@ -47,11 +47,19 @@
// buffer which holds the currently shown frame
unsigned char pixmap[NUMPLANE][NUM_ROWS][LINEBYTES];
/* adjust frame rate at the menuconfig, this is just a fallback */
#ifndef FRAMERATE
# define FRAMERATE 80
#elif FRAMERATE < 1
# error FRAMERATE must be greater than 0
#endif
// Number of ticks of the prescaled timer per cycle per frame, based on the
// CPU clock speed and the desired frame rate.
#define FRAMERATE 80UL
#define TICKS (F_CPU + 6 * (FRAMERATE << SLOWSCALERSHIFT)) / (12 * (FRAMERATE << SLOWSCALERSHIFT))
#define CUTOFF(scaler) ((128 * 12 - 6) * FRAMERATE * scaler)
#define TICKS (F_CPU + 6ul * (FRAMERATE << SLOWSCALERSHIFT)) / \
(12ul * (FRAMERATE << SLOWSCALERSHIFT))
#define CUTOFF(scaler) ((128ul * 12 - 6) * FRAMERATE * scaler##ul)
#if defined (__AVR_ATmega8__) || \
defined (__AVR_ATmega48__) || \

3
src/borg_hw/config_lolshield.in

@ -3,6 +3,7 @@ comment "lolshield setup"
define_int USER_TIMER0_FOR_WAIT 1
uint "Brightness (0-127)" BRIGHTNESS 127
uint "Brightness (0-127)" BRIGHTNESS 127
uint "Framerate (default 80)" FRAMERATE 80
endmenu

Loading…
Cancel
Save