SdFat icon indicating copy to clipboard operation
SdFat copied to clipboard

error compiling on Thinary Every board

Open rickyelqasem opened this issue 1 year ago • 3 comments

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)'

rickyelqasem avatar Oct 06 '24 15:10 rickyelqasem

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); }

greiman avatar Oct 06 '24 18:10 greiman

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 avatar Oct 07 '24 06:10 rickyelqasem

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.

rickyelqasem avatar Oct 07 '24 07:10 rickyelqasem