cabi is a command line program written in C. Its purpose is to read
a PNG file containing a bitmap image and convert it to C/C++ code
suitable for use with the drawCompressed() function.
cabi was published by the Team A.R.G. organization. This organization
has been dissolved and its presence on the internet has been removed,
thus public access to cabi from them is no longer available.
A copy of the relevant cabi files has been added under the extras
directory to maintain a method of creating drawCompressed() compatible
bitmaps.
Macro defines for system EEPROM access that were not intended to be
part of the API have been made into protected constexpr variables of
the Arduboy2Base class.
Issue reported by @MrBlinky
For drawBitmap(), drawSlowXYBitmap() and drawCompressed() the initial
check for the bitmap being entirely off screen would sometimes consider
a bitmap to be partially on screen when it is only one pixel above or
to the left of the screen. This would result in unnecessarily doing the
work to draw the bitmap when none of it would be visible.
Includes some suggestions and guidance by @Pharap
API:
- Rename non-API function swap() to swapInt16()
- Make swapInt16(), drawCircleHelper(), fillCircleHelper() and
struct BitStreamReader protected members of Arduboy2Base
- Add #define ARDUBOY_UNIT_NAME_BUFFER_SIZE for the size of a buffer
to hold a Unit Name
- Move the position of the PROGMEM keyword for lcdBootProgram[]
for consistency
Documentation:
- Remove absolute values referring to a Unit Name
- More details relating to the use of the Unit Name
- More details relating to the font and text functions
- Other minor documentation changes and spelling corrections
Problem:
The overloading of `Print::write` was previously causing the other
overloads of `write` to be hidden.
For more information on this behaviour, see the following
StackOverflow question:
https://stackoverflow.com/questions/1628768
Solution:
The solution uses a `using`-declaration to bring the `Print::write`
overloads into `Arduboy2`'s scope.
For more information on this usage of a `using`-declaration, see the
following cppreference page:
https://en.cppreference.com/w/cpp/language/using_declaration#In_class_definition
The new compiler in Arduino IDE 1.8.6/1.8.7 has an optimization glitch
where it fails to see the difference between a data structure in RAM
and in PROGMEM when the data is the same and optimizes one out.
drawPixel() is unable to fetch the correct pixel mask from the
bitshift_left array in PROGMEM causing junk to be drawn.
The bitshift_left[] array has now been optimised out and drawPixel()
will function properly. The optimization uses the same number of cycles
and saves 6 bytes.
drawPixel() has also been made static so the Arduboy object pointer is
no longer needlesly passed on to drawPixel() saving more bytes.
The call to generateRandomSeed() in initRandomSeed() was missing
parentheses.
Added keyword for generateRandomSeed.
Minor code changes, and documentation changes and additions.
Flag SYS_FLAG_SHOW_LOGO_LEDS added to EEPROM_SYS_FLAGS.
The boot logo functions check the flag and leave the RGB LED off if
the flag isn't set.
Added functions writeShowBootLogoLEDsFlag() and
readShowBootLogoLEDsFlag() for writing and reading the
SYS_FLAG_SHOW_LOGO_LEDS flag.
Example sketch SetSystemEEPROM modified to allow setting the
SYS_FLAG_SHOW_LOGO_LEDS flag.
Flag SYS_FLAG_SHOW_LOGO added to EEPROM_SYS_FLAGS. The boot logo
functions check the flag and bypass the logo sequence if the flag
isn't set.
Added functions writeShowBootLogoFlag() and readShowBootLogoFlag()
for writing and reading the SYS_FLAG_SHOW_LOGO flag.
Renamed example sketch SetNameAndID to SetSystemEEPROM and added
the ability to set the SYS_FLAG_SHOW_LOGO flag, plus menus to reset
the system and user EEPROM areas.
The SpritesB class has functions identical to those in Sprites.
When used in place of Sprites it will usually reduce code size (at the
expense of slower execution speed). Code size reduction is accomplished
by factoring all draw modes into the same loop.
Modifications made to the Sprites class to create this class made by
@dxxb (Delio Brignoli).
Creation of the SpritesB class and documentation by
@MLXXXp (Scott Allen).
Also, bootLogoSpritesBSelfMasked() and bootLogoSpritesBOverwrite()
alternative boot logo functions added by @MLXXXp.
Macro ARDUBOY_NO_USB will provide a substitute main() which will cause
the compiler to leave out the USB code. The macro also adds a check
for the DOWN button being pressed and, if so, will call the new
exitToBootloader() function.
New function exitToBootloader() will invoke the bootloader in command
mode, similar to pressing reset.
- setRGBled() has been rewritten to directly control the hardware
instead of using the Arduino analogWrite() function.
- Added a two parameter version of setRGBled() that sets the brightness
of one LED without affecting the others.
- Added function freeRGBled() for freeing the PWM control of the LEDs
so they can be used digitally.
- Added example sketch RGBled.
New function waitNoButtons() replaces the code at the end of begin()
that waits for all buttons to be released. This is to make it easier
to add back this functionality when using boot() in place of begin().