Dukweeno / Duckuino

Simple DuckyScript to Arduino C converter.
https://dukweeno.github.io/Duckuino/
MIT License
353 stars 117 forks source link

Compile error with Digispark #113

Open mbenitog opened 2 years ago

mbenitog commented 2 years ago

Are you using the live version that could be found here ?

What type of issue is it ?

I'm using a Digispark board and I encountered a type issue when compiling:

cannot convert 'const __FlashStringHelper*' to 'fstr_t*' for argument '1' to 'void printText(fstr_t*)'

It seems that the function printText() expects a wrong type of argument fstr_t

void printText(fstr_t *txt) {
  DigiKeyboard.print(txt);
  DigiKeyboard.update();
}

If fstr_t is replaced by __FlashStringHelper the code compiles and works fine. The function was introduced in this commit (line 255)

Fixed function:

void printText(__FlashStringHelper *txt) {
  DigiKeyboard.print(txt);
  DigiKeyboard.update();
}

I don't know If this is the correct solution to the problem and it would be great if it could be reviewed. Thanks in advance!

lowlevl commented 2 years ago

Hello @mbenitog,

Thanks for your report and sorry for the delay, so the problem is that it does not compile on Digispark.. Unfortunately I don't have any Digispark board, neither do I have a development environment for this.

From what I see on the web, the __FlashStringHelper is an alias to fstr_t which in this case should work. What core are you using for you board ?