Closed L1ikhith closed 2 months ago
Can you link to the SPI.cpp file you're referring to?
Is this the BitOrder you're rerring to: https://github.com/rogerclarkmelbourne/Arduino_STM32/blob/master/STM32F1/cores/maple/wirish_constants.h
Can you ellaborate on the erorrs? Are you building the C++ code and getting compile time errors, runtime errors, etc?
Thanks!
Hello @samkristoff thanks for the quick response, here are the links to the files SPI.cpp: https://github.com/stm32duino/Arduino_Core_STM32/blob/main/libraries/SPI/src/SPI.cpp Wiring_constants.h :https://github.com/stm32duino/Arduino_Core_STM32/blob/main/cores/arduino/wiring_constants.h
ERROR screenshot
Hey, can you just cast the bitOrder to unsigned char on line 310 like this:
SPI.setBitOrder((unsigned char)bitOrder);
Thanks @samkristoff for now there is no error
Hello, i was getting errors with one of the SPI functions in LinxWiringDevice. The issue is in LinxWiringDevice. cpp, the bitOrder in SPI.setBitOrder(bitOrder) is defined as unsigned char but in STM32 SPI file it was defined as Enum. Is there a way to make the function variable as Enum instead of unsigned char
REF: SPI.cpp:
`void SPIClass::setBitOrder(BitOrder bitOrder) { _spiSettings.bitOrder = bitOrder;
spi_init(&_spi, _spiSettings.clockFreq, _spiSettings.dataMode, _spiSettings.bitOrder); }`
Wiring_constants.h
enum BitOrder { LSBFIRST = 0, MSBFIRST = 1 };
LinuxWiringDevice.cpp
int LinxWiringDevice::SpiSetBitOrder(unsigned char channel, unsigned char bitOrder) { SPI.setBitOrder(bitOrder); return 0; }