borg_hw_lolshield: framerate can be adjusted in the menu, now
This commit is contained in:
parent
e97eeecc0a
commit
43dac0a8c6
|
@ -21,6 +21,7 @@ BORG_HW=HW_LOLSHIELD
|
|||
#
|
||||
USER_TIMER0_FOR_WAIT=1
|
||||
BRIGHTNESS=127
|
||||
FRAMERATE=80
|
||||
|
||||
#
|
||||
# Features
|
||||
|
|
|
@ -21,6 +21,7 @@ BORG_HW=HW_LOLSHIELD
|
|||
#
|
||||
USER_TIMER0_FOR_WAIT=1
|
||||
BRIGHTNESS=127
|
||||
FRAMERATE=80
|
||||
|
||||
#
|
||||
# Features
|
||||
|
|
|
@ -21,6 +21,7 @@ BORG_HW=HW_LOLSHIELD
|
|||
#
|
||||
USER_TIMER0_FOR_WAIT=1
|
||||
BRIGHTNESS=127
|
||||
FRAMERATE=80
|
||||
|
||||
#
|
||||
# Features
|
||||
|
|
|
@ -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__) || \
|
||||
|
|
|
@ -4,5 +4,6 @@ comment "lolshield setup"
|
|||
define_int USER_TIMER0_FOR_WAIT 1
|
||||
|
||||
uint "Brightness (0-127)" BRIGHTNESS 127
|
||||
uint "Framerate (default 80)" FRAMERATE 80
|
||||
|
||||
endmenu
|
||||
|
|
Loading…
Reference in New Issue