Closed TomWS1 closed 4 years ago
Must be fixed by the framework of the board.
The simple solution was to typedef __FlashStringHelper
as char
and define F()
macro which does not modify the string. But then the RAM consumption is high.
Not quite as simple as that as all functions that attempt to overload with _FlashStringHelper then fail as duplicate overloads. I suppose one way around it is to implement FlashStringHelper so that it beningly returns a char*
@TomWS1 Arduino.h
of megatinycore 2.0.5 does redefine F()
with type char
:
#undef F
#define F(str) (str)
String.h
has a different definition with type __FlashStringHelper
.
So basically the framework has a problem with different behavior of a macro. That problem must be solved on framework site.
Step 1: Describe your environment
Step 2: Describe the problem
The compiler throws errors when compiling for a board using ATtiny804 device and the megaTinyCore. The issue is that the boards package redefines __FlashStringHelper as char due to the fact that there is no helper function required to access program memory as data with this series of processors.
This can be fixed with the 'hack' of renaming __FlashStringHelper in MFRC522.h and MFRC522.cpp to MEM_REF_HELPER and adding to MFRC522.h:
if defined(__AVR_ATtinyx04__)
define MEM_REF_HELPER char
else
define MEM_REF_HELPER __FlashStringHelper
endif
Affected file(s) or example(s):
Steps to reproduce:
Select Board "ATtiny1614/1604/...", Chip: ATtiny804
Compile any code using the MFRC522 library
Observed Results:
Expected Results:
Relevant Code:
errors.txt
src.zip