Allow SPItransfer to be overridden by subclasses

This allows API clients to provide 'smarter' versions of Module that can do things like add thread safety so that multiple devices (and service threads) can share the same SPI bus. i.e. a subclass would lock some sort of mutex.

This is used in the Radiolib Fork for Meshtastic to share an SPI bus with SD Card and TFT Display but we want to move back to upstream and not maintain our own fork.
pull/534/head
Thomas Göttgens 2022-06-10 12:28:32 +02:00 zatwierdzone przez GitHub
rodzic 34a0d77998
commit 08989ff6fa
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -190,7 +190,7 @@ class Module {
\param numBytes Number of bytes to transfer.
*/
void SPItransfer(uint8_t cmd, uint8_t reg, uint8_t* dataOut, uint8_t* dataIn, uint8_t numBytes);
virtual void SPItransfer(uint8_t cmd, uint8_t reg, uint8_t* dataOut, uint8_t* dataIn, uint8_t numBytes);
// pin number access methods