diff --git a/examples/stm32f469_discovery/max31865/main.cpp b/examples/stm32f469_discovery/max31865/main.cpp index 0cd34d20ce..2cb1db51b7 100644 --- a/examples/stm32f469_discovery/max31865/main.cpp +++ b/examples/stm32f469_discovery/max31865/main.cpp @@ -31,7 +31,7 @@ class ThermocoupleThread : public modm::pt::Protothread run() { PT_BEGIN(); - pt100.initialize(); + PT_CALL(pt100.initialize()); while (true) { diff --git a/src/modm/driver/temperature/max31865.hpp b/src/modm/driver/temperature/max31865.hpp index bf8ff1eee0..75a9706df2 100644 --- a/src/modm/driver/temperature/max31865.hpp +++ b/src/modm/driver/temperature/max31865.hpp @@ -196,7 +196,7 @@ class Max31865 : public max31865, Max31865(max31865::Data &data); /// Call this function once before using the device - void + modm::ResumableResult initialize(); /// Read the raw data from the sensor diff --git a/src/modm/driver/temperature/max31865_impl.hpp b/src/modm/driver/temperature/max31865_impl.hpp index 65cfc96686..8f8490c138 100644 --- a/src/modm/driver/temperature/max31865_impl.hpp +++ b/src/modm/driver/temperature/max31865_impl.hpp @@ -21,19 +21,12 @@ namespace modm template Max31865::Max31865(max31865::Data &data) : data(data) { - this->attachConfigurationHandler([]() { - static_assert(std::is_same_v); - SPI2->CR1 &= ~SPI_CR1_SPE; - __DSB(); - SpiMaster::setDataMode(SpiMaster::DataMode::Mode3); - SPI2->CR1 |= SPI_CR1_SPE; - __DSB(); - }); + this->attachConfigurationHandler([]() { SpiMaster::setDataMode(SpiMaster::DataMode::Mode3); }); Cs::setOutput(modm::Gpio::High); } template -void +modm::ResumableResult Max31865::initialize() {