RP2040 constructor rework#19
Conversation
|
Yeehaw! It worked the first time! |
|
@Intubun #elif defined(ARDUINO_ARCH_RP2040)
mySPI->end();
mySPI->begin();
#else // generic hardware SPI
mySPI = &SPI;
mySPI->end();
mySPI->begin();
#endifI think this must be replaced by #else // generic hardware SPI
mySPI->end();
mySPI->begin();
#endifmySPI is already set in the constructor and would be overwritten in case of non-RP2040 Should work for RP2040 too. |
|
Oh.. Forgot one there... Well another commit is necessary... |
|
In the derived classes in the mcp_dac.h you use many times the conditional construct. class MCP4801 : public MCP_DAC
{
public:
#if defined(ARDUINO_ARCH_RP2040)
MCP4801(uint8_t dataOut = 255, uint8_t clock = 255, SPIClassRP2040 *inSPI = &SPI);
#else
MCP4801(uint8_t dataOut = 255, uint8_t clock = 255, SPIClass *inSPI = &SPI);
#endif
};technically this is OK, but in the mcp_dac.cpp you do it with one #if RP2040 in a big block. |
|
No further remarks, thanks! |
|
Your requested changes are done... |
|
Great work, |
Issue #18
Should work right out of the box...
Validated with MCP4822 and RPi Pico