From d17075f7bedf6265e79d8311c3e7ae0dab087c8e Mon Sep 17 00:00:00 2001 From: Scott Allen Date: Thu, 30 Jun 2016 19:59:56 -0400 Subject: [PATCH] Make screen buffer static & frame vars protected --- src/Arduboy2.cpp | 2 ++ src/Arduboy2.h | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Arduboy2.cpp b/src/Arduboy2.cpp index 04d26cc..6b763c0 100644 --- a/src/Arduboy2.cpp +++ b/src/Arduboy2.cpp @@ -6,6 +6,8 @@ //========== class Arduboy2Base ========== //======================================== +uint8_t Arduboy2Base::sBuffer[(HEIGHT*WIDTH)/8]; + Arduboy2Base::Arduboy2Base() { // frame management diff --git a/src/Arduboy2.h b/src/Arduboy2.h index 2972bbd..d495497 100644 --- a/src/Arduboy2.h +++ b/src/Arduboy2.h @@ -211,14 +211,6 @@ public: */ int cpuLoad(); - uint8_t frameRate; - uint16_t frameCount; - uint8_t eachFrameMillis; - long lastFrameStart; - long nextFrameStart; - bool post_render; - uint8_t lastFrameDurationMs; - /// useful for getting raw approximate voltage values uint16_t rawADC(uint8_t adc_bits); @@ -227,7 +219,16 @@ protected: void sysCtrlSound(uint8_t buttons, uint8_t led, uint8_t eeVal); // Screen buffer - uint8_t sBuffer[(HEIGHT*WIDTH)/8]; + static uint8_t sBuffer[(HEIGHT*WIDTH)/8]; + + // For frame funcions + uint8_t frameRate; + uint16_t frameCount; + uint8_t eachFrameMillis; + long lastFrameStart; + long nextFrameStart; + bool post_render; + uint8_t lastFrameDurationMs; };