Skip to content

Commit

Permalink
Merge pull request #30 from boscs/master
Browse files Browse the repository at this point in the history
Mocking PROGMEM on non Arduino platforms
  • Loading branch information
FrankBoesing authored Feb 8, 2022
2 parents e677d48 + 72e2ee7 commit 3278a7f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/FastCRC_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@
#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
#define PROGMEM_MOCK_ACTIVE
#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,
Expand Down Expand Up @@ -1583,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

0 comments on commit 3278a7f

Please sign in to comment.