Closed tobbelobb closed 6 years ago
Thanks. I'll do the testing tomorrow and sure enough it compiles, but I might be more comfortable if we went with changing the variable type as then it would match the Arduino digitalWrite implementation.
Ok. Were tests successful?
I seem to recall that I did quickly test it, but the changes should be now in the v2.1.4 release.
Looks good! Closing.
I haven't tested this on hardware, and I'm not an expert on digital I/O, I just noticed a compile warning:
The mentioned type conversion is indeed taking place in my build. See documentation for
portOutputRegister()
.Comparing to Arduino's source code for
digitalWrite()
, it seems like dereferencing the output ofportOutputRegister()
is what we want to do.We could also change types of
mosi_register
,miso_register
, andsck_register
tovolatile uint8_t*
, and do the dereferencing of them inwriteMOSI_H
,writeMOSI_L
,writeSCK_H
,writeSCK_L
, andreadMISO
instead, I guess.