From 19cf3d92d998d4ca7d5af9d3572025e16a696584 Mon Sep 17 00:00:00 2001 From: simonmicro Date: Tue, 10 Jan 2023 04:28:49 +0100 Subject: [PATCH 1/3] Fix for #344 --- src/hal/environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hal/environment.cpp b/src/hal/environment.cpp index 29282553b..3f7798af1 100644 --- a/src/hal/environment.cpp +++ b/src/hal/environment.cpp @@ -99,7 +99,7 @@ void OswHal::Environment::setupStepStatistics() { if(!this->accelSensor) throw std::runtime_error("No acceleration provider!"); Preferences prefs; - bool res = prefs.begin(PREFS_STEPS, true); + bool res = prefs.begin(PREFS_STEPS, false); // Open in RW mode, to allow creation as needed assert(res); if(prefs.getBytes(PREFS_STEPS_STATS, &this->_stepsCache, sizeof(this->_stepsCache)) != sizeof(this->_stepsCache)) { // Uoh, the steps history is not initialized -> fill it with zero and do it now! From 360e9d182cb60345913eaa1fb2d684bb4b9bafb3 Mon Sep 17 00:00:00 2001 From: zwim <36999612+zwim@users.noreply.github.com> Date: Mon, 1 Apr 2024 09:36:30 +0200 Subject: [PATCH 2/3] Make OSW fit for Arduino_GFX v1.4.6 bump Arduino_GFX to v1.4.6 --- emulator/include/Arduino_GFX.h | 4 +++- include/Arduino_Canvas_Graphics2D.h | 2 +- lib/Arduino_GFX | 2 +- src/hal/display.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/emulator/include/Arduino_GFX.h b/emulator/include/Arduino_GFX.h index c6a4c995e..f8516b66a 100644 --- a/emulator/include/Arduino_GFX.h +++ b/emulator/include/Arduino_GFX.h @@ -3,4 +3,6 @@ class Graphics2DPrint; typedef Graphics2DPrint Arduino_GFX; -#include "Arduino_G.h" \ No newline at end of file +#define GFX_NOT_DEFINED (-1) + +#include "Arduino_G.h" diff --git a/include/Arduino_Canvas_Graphics2D.h b/include/Arduino_Canvas_Graphics2D.h index 71ddad2fc..6af1f571f 100644 --- a/include/Arduino_Canvas_Graphics2D.h +++ b/include/Arduino_Canvas_Graphics2D.h @@ -22,7 +22,7 @@ class Arduino_Canvas_Graphics2D : public Graphics2DPrint { * we have copy-pasted this utility together... */ - void begin(int32_t speed = 0); + void begin(int32_t speed = GFX_NOT_DEFINED); void writePixelPreclipped(int16_t x, int16_t y, uint16_t color); void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); diff --git a/lib/Arduino_GFX b/lib/Arduino_GFX index 4aaf9074d..5a203a367 160000 --- a/lib/Arduino_GFX +++ b/lib/Arduino_GFX @@ -1 +1 @@ -Subproject commit 4aaf9074d5db1055c67f2d91bde1f4f113f7e5b6 +Subproject commit 5a203a36778e1929fd86d4f2542edada9dfbd793 diff --git a/src/hal/display.cpp b/src/hal/display.cpp index b5cabe95a..4d26cb6ee 100644 --- a/src/hal/display.cpp +++ b/src/hal/display.cpp @@ -70,7 +70,7 @@ void OswHal::setupDisplay() { if(!this->canvas) this->canvas = new Arduino_Canvas_Graphics2D(DISP_W, DISP_H, tft); - this->canvas->begin(0); + this->canvas->begin(); // use default speed and default SPI mode this->displayOn(); } From ff43d71bfab87b9e383804bd2322105e97162ec7 Mon Sep 17 00:00:00 2001 From: simonmicro Date: Sat, 6 Apr 2024 11:03:44 +0200 Subject: [PATCH 3/3] Added comment for the define Signed-off-by: simonmicro --- emulator/include/Arduino_GFX.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emulator/include/Arduino_GFX.h b/emulator/include/Arduino_GFX.h index f8516b66a..a53ff0173 100644 --- a/emulator/include/Arduino_GFX.h +++ b/emulator/include/Arduino_GFX.h @@ -3,6 +3,7 @@ class Graphics2DPrint; typedef Graphics2DPrint Arduino_GFX; -#define GFX_NOT_DEFINED (-1) +// in accordance to Arduino_DataBus.h also provide this define +#define GFX_NOT_DEFINED -1 #include "Arduino_G.h"