determined at compile time, so no extra code is added. Previously the
frame rate was totally erratic across CPU speeds.
Default frame rate is 80Hz, which is very close to the previous value of
81.7Hz on 16MHz 328 chips.
Compress the column and row into a single byte.
Fix up some of the problems with the lowercase characters, though they're not
enabled by default.
Trims FontTest by 458 bytes of text and 116 bytes of data.
* If DOUBLE_BUFFER is commented out, don't bother to use extra pointer for
the display buffer.
* There's no need to wait for a buffer flip when starting up. It's fine to
display the first (blank) frame indefinitely.
* Don't bother using delay() while waiting for flips. All it does is bloat
the code.
equivalent, formula. Interestingly, this doesn't change the compiled code
size--perhaps the compiler is smarter than I thought. At least it's easier
to understand now.
This has the nice side effect of greatly simplifying the ISR code
(especially for the Mega).
Rework the timer setup so the prescaler information used by SetBrightness()
is determined based on the CPU frequency. A few points:
* The prescaler setup in Init() was ~completely ignored before, because it
was overwritten on the first interrupt with info from SetBrightness(),
based on {fast,slow}Prescaler.
* This has almost no effect on a 16MHz part (i.e. virtually all Arduinos) at
full brightness, because it sets {fast,slow}Prescaler to the same values
as before.
* The library now compiles again for the ATmega8 (Arduino NG), but I have no
way to test it.
This patch reduces the code size and improves the CPU performance of
Charliplexing.cpp by:
* removing zeroed data in videoPage
* precalculating information for LedSign::Set()
* removing unneeded register writes in TIMER2_OVF_vect()
* using a roving pointer to access the display buffer rather than recalculating the array index each time
* eliminating the extra blank interval (1/8 display cycles)
* eliminating an extra display “cycle” (which could also display garbage)
Also fixed several bugs in LedSign::SetBrightness(), which caused weird
grayscale gradiations and reduced brightness by not using a 100% duty cycle
for the maximum setting.