You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
in the header file line 290 there is:
inline static void setDataMode(uint8_t dataMode) {
SPCR = (SPCR & ~SPI_MODE_MASK) | dataMode;
}
however the same function is also used in the cpp file, without the core SPCR activity:
I find it quite strange, that there is both an inline and a non-inline function with the same name.
At least on my system windows 10, Arduino 1.8.1 teensyduino 1.4.1 calling setDataMode had no effect at all. I assume without proof it was calling the non-inline version which does not set SPCR.
My proposal would be to remove the non-inline version, and maybe add the hardware().clock_gate line to the inline version if necessary, or make it non-inline.
My personal workaround was to use the transactions stuff, but really without any complaints to the maintainer, it cost me two days to find the reason why my pcb worked with an old arduino version, and failed with a newer one. Thanks to logic tester i finally found that the data mode was set, but the statement had no effect. I know how crappy the job of maintaining something like this is, all the work that went in so far is highly appreciated.
thanks a lot & very nice greetings,
Bernhard Kubicek
The text was updated successfully, but these errors were encountered:
Hi,
in the header file line 290 there is:
inline static void setDataMode(uint8_t dataMode) {
SPCR = (SPCR & ~SPI_MODE_MASK) | dataMode;
}
however the same function is also used in the cpp file, without the core SPCR activity:
void SPIClass::setDataMode(uint8_t dataMode)
{
hardware().clock_gate_register |= hardware().clock_gate_mask;
//uint32_t ctar = port().CTAR0;
}
I find it quite strange, that there is both an inline and a non-inline function with the same name.
At least on my system windows 10, Arduino 1.8.1 teensyduino 1.4.1 calling setDataMode had no effect at all. I assume without proof it was calling the non-inline version which does not set SPCR.
My proposal would be to remove the non-inline version, and maybe add the hardware().clock_gate line to the inline version if necessary, or make it non-inline.
My personal workaround was to use the transactions stuff, but really without any complaints to the maintainer, it cost me two days to find the reason why my pcb worked with an old arduino version, and failed with a newer one. Thanks to logic tester i finally found that the data mode was set, but the statement had no effect. I know how crappy the job of maintaining something like this is, all the work that went in so far is highly appreciated.
thanks a lot & very nice greetings,
Bernhard Kubicek
The text was updated successfully, but these errors were encountered: