From 3165296ba95ef69ce56bd935597a4d7a1f94f70c Mon Sep 17 00:00:00 2001 From: boscs Date: Tue, 8 Feb 2022 18:20:36 +0100 Subject: [PATCH 1/2] Update FastCRC_tables.h progmem is not supported by compiler made for something else than arduino. as it is often define as a macro, I remove it using a macro if it is not defined --- src/FastCRC_tables.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FastCRC_tables.h b/src/FastCRC_tables.h index b37f7be..bfc2ea9 100644 --- a/src/FastCRC_tables.h +++ b/src/FastCRC_tables.h @@ -40,7 +40,10 @@ #endif #endif #endif - +#ifndef PROGMEM +// usefull if you're trying to test the lib in a non arduino env (in cppyy on x64 for exemple) +#define PROGMEM +#endif const uint8_t crc_table_crc7[256] PROGMEM = { 0x00, 0x12, 0x24, 0x36, 0x48, 0x5a, 0x6c, 0x7e, 0x90, 0x82, 0xb4, 0xa6, 0xd8, 0xca, 0xfc, 0xee, From 72e2ee7bfe0b16fd23a5404571852067dffe57fa Mon Sep 17 00:00:00 2001 From: boscs Date: Tue, 8 Feb 2022 18:24:14 +0100 Subject: [PATCH 2/2] limit the effect of previous commit to this file --- src/FastCRC_tables.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/FastCRC_tables.h b/src/FastCRC_tables.h index bfc2ea9..4febab0 100644 --- a/src/FastCRC_tables.h +++ b/src/FastCRC_tables.h @@ -43,6 +43,7 @@ #ifndef PROGMEM // usefull if you're trying to test the lib in a non arduino env (in cppyy on x64 for exemple) #define PROGMEM +#define PROGMEM_MOCK_ACTIVE #endif const uint8_t crc_table_crc7[256] PROGMEM = { 0x00, 0x12, 0x24, 0x36, 0x48, 0x5a, 0x6c, 0x7e, @@ -1586,4 +1587,10 @@ const uint32_t crc_table_cksum_big[1024] PROGMEM = { 0x105ee293, 0xa7c48f4f, 0xc976f82f, 0x7eec95f3, 0x151217ef, 0xa2887a33, 0xcc3a0d53, 0x7ba0608f }; + +#ifdef PROGMEM_MOCK_ACTIVE +// limit the effect of the progmem mock to this file +#undef PROGMEM +#undef PROGMEM_MOCK_ACTIVE +#endif #endif