Make lcdBootProgram[] a member of Arduboy2Core

The lcdBootProgram[] array, containing the commands to initialize
the OLED display, isn't considered to be part of the API.
To enforce this, and to avoid the possibility of conflicts from
other code using the same name, it has been changed from being a
global variable to a protected member of the Arduboy2Core class.
This commit is contained in:
Scott Allen 2020-07-09 20:45:13 -04:00
parent a04edf24c1
commit 30fb448db5
2 changed files with 11 additions and 8 deletions

View File

@ -8,7 +8,15 @@
#include <avr/wdt.h>
const PROGMEM uint8_t lcdBootProgram[] = {
//========================================
//========== class Arduboy2Core ==========
//========================================
Arduboy2Core::Arduboy2Core() { }
// Commands sent to the OLED display to initialize it
const PROGMEM uint8_t Arduboy2Core::lcdBootProgram[] = {
// boot defaults are commented out but left here in case they
// might prove useful for reference
//
@ -72,13 +80,6 @@ const PROGMEM uint8_t lcdBootProgram[] = {
// 0x22, 0x00, PAGE_ADDRESS_END
};
//========================================
//========== class Arduboy2Core ==========
//========================================
Arduboy2Core::Arduboy2Core() { }
void Arduboy2Core::boot()
{
#ifdef ARDUBOY_SET_CPU_8MHZ

View File

@ -845,6 +845,8 @@ class Arduboy2Core : public Arduboy2NoUSB
static void bootOLED();
static void bootPins();
static void bootPowerSaving();
static const PROGMEM uint8_t lcdBootProgram[];
};
#endif