added comments

interrupts
polymurph 4 years ago
parent 43a61d02b7
commit 0f28a8480f

@ -4,6 +4,8 @@
#include "pin.hpp" #include "pin.hpp"
#include "spi.hpp" #include "spi.hpp"
// spi channel has a hardware spi object and a pin object for the chipselect.
template <typename DerivedPin, template <typename DerivedPin,
typename DerivedSPI> typename DerivedSPI>
struct SPICH struct SPICH
@ -19,11 +21,14 @@ struct SPICH
uint8_t read_write_u8(const uint8_t& data) uint8_t read_write_u8(const uint8_t& data)
{ {
uint8_t temp; uint8_t temp;
// spiHwCH.takeMutex();
chipSelect.write(false); chipSelect.write(false);
temp = spiHwCH.trx_u8(data); temp = spiHwCH.trx_u8(data);
chipSelect.write(true); chipSelect.write(true);
// spiHwCH.releaseMutex();
return temp; return temp;
} }
@ -57,7 +62,7 @@ struct SPICH
chipSelect.write(true); chipSelect.write(true);
} }
private: private:
// hardware resources // hardware resources

Loading…
Cancel
Save