Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error compiling on Thinary Every board #497

Open
rickyelqasem opened this issue Oct 6, 2024 · 3 comments
Open

error compiling on Thinary Every board #497

rickyelqasem opened this issue Oct 6, 2024 · 3 comments

Comments

@rickyelqasem
Copy link

get this error with sdfat 2.2.3:

SpiDriver\SdSpiChipSelect.cpp:34:26: error: cannot convert 'bool' to 'PinStatus' for argument '2' to 'void digitalWrite(pin_size_t, PinStatus)'

@greiman
Copy link
Owner

greiman commented Oct 6, 2024

I don't understand why the error is at line 34 of SdSpiChipSelect.cpp

Here is line 34.

Seems like it should be a line 31 or 37 with digitalWrite().

I suspect the Thinary Every board support package need the second argument of digitalWrite() to be either HIGH or LOW.

Try replacing
{ digitalWrite(pin, level); }
with
{ digitalWrite(pin, level ? HIGH : LOW); }

@rickyelqasem
Copy link
Author

Made no difference. But there error is slightly different. Here is the full error;

C:\Users\ricky\Documents\Arduino\libraries\SdFat\src\SpiDriver\SdSpiChipSelect.cpp: In function 'void sdCsWrite(SdCsPin_t, bool)':
C:\Users\ricky\Documents\Arduino\libraries\SdFat\src\SpiDriver\SdSpiChipSelect.cpp:31:68: error: cannot convert 'bool' to 'PinStatus' for argument '2' to 'void digitalWrite(pin_size_t, PinStatus)'
void sdCsWrite(SdCsPin_t pin, bool level) { digitalWrite(pin, level); }

@rickyelqasem
Copy link
Author

Scratch that .. after noticing the last error was on 31, I changed:
void sdCsWrite(SdCsPin_t pin, bool level) { digitalWrite(pin, level ? HIGH : LOW); }
and that worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants