From bce9cf415ca9f066e3085ff92308d425281f3961 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Thu, 11 Aug 2022 08:45:12 +0200 Subject: [PATCH] Remove PROGMEM temporarily - make registers actually work on AVR This needs some investigation if it is really possible to push the Registers into PROGMEM. I think it should be possible, but the compiler is currently not collaborating. It is not critical though as we have lots of free RAM at the moment (I can't believe I wrote this on an AVR project :) ) --- src/registers.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/registers.cpp b/src/registers.cpp index b5395e6..e898bea 100644 --- a/src/registers.cpp +++ b/src/registers.cpp @@ -88,7 +88,20 @@ struct RegisterRec { // compiles to: // sts , r24 // ret -static const RegisterRec registers[] PROGMEM = { +// +// @@TODO at the moment we are having problems compiling this array statically into PROGMEM. +// In this project that's really not an issue since we have half of the RAM empty: +// Data: 1531 bytes (59.8% Full) +// But it would be nice to fix that in the future - might be hard to push the compiler to such a construct +static const RegisterRec registers[] /*PROGMEM*/ = { + // 0x00 + // RegisterRec([]()->uint16_t { return PROJECT_VERSION_MAJOR; }, 1), + // // 0x01 + // RegisterRec([]()->uint16_t { return PROJECT_VERSION_MINOR; }, 1), + // // 0x02 + // RegisterRec([]()->uint16_t { return PROJECT_VERSION_REV; }, 2), + // // 0x03 + // RegisterRec([]()->uint16_t { return PROJECT_BUILD_NUMBER; }, 2), // 0x00 RegisterRec(false, &project_major), // 0x01