mcci-catena / Catena-Arduino-Platform

Arduino platform library for MCCI Catena IoT Systems
MIT License
12 stars 11 forks source link

Catena_Mx25v8035f.h doesn't compile on all platforms #244

Open terrillmoore opened 4 years ago

terrillmoore commented 4 years ago

The header file has a default on the chip select pin:

https://github.com/mcci-catena/Catena-Arduino-Platform/blob/68563243a50a74b7265caa337e23d55d854ba06d/src/Catena_Mx25v8035f.h#L137

But this only makes sense on Catena 46xx platforms.

The right thing to do is not to have a default but have two overloads.

    boolean begin(SPIClass *pSpi);
        boolean begin(SPIclass *pSpi,  uint8_t ChipSelectPin);

Then, on the platforms where we provide a flash, we also define one-argument begin() function; it just calls the two-arg begin() with the right CS pin.

On platforms where the SPI pin is not defined, we can still provide the two-arg begin(), but leave the one-arg begin() undefined.