diff --git a/include/sta/MS5607.hpp b/include/sta/MS5607.hpp index e2c935a..8f8cf3e 100644 --- a/include/sta/MS5607.hpp +++ b/include/sta/MS5607.hpp @@ -1,9 +1,9 @@ #ifndef STA_SENSORS_MS5607_HPP #define STA_SENSORS_MS5607_HPP -#include +#include #include -#include +#include namespace sta { // Class to represent a MS5607 pressure sensor which is used with SPI @@ -18,7 +18,7 @@ namespace sta { _4096 = 4 }; - MS5607(SpiDevice* device, OsrLevel osr=OsrLevel::_1024); + MS5607(STM32SPIDevice* device, OsrLevel osr=OsrLevel::_1024); // Request Calculation of uncompensated pressure // Takes a few ms -> Call, then do sth. else, then get Pressure with function @@ -65,7 +65,7 @@ namespace sta { bool presRead; // STA internal object for SPi abstraction - SpiDevice* device_; + STM32SPIDevice* device_; OsrLevel osr_; // 6 Different constants; Includes Offsets, references etc. @@ -120,4 +120,4 @@ namespace sta { } -#endif // ifndef STA_SENSORS_MS5607_HPP \ No newline at end of file +#endif // ifndef STA_SENSORS_MS5607_HPP diff --git a/src/MS5607.cpp b/src/MS5607.cpp index d9fd72c..9919b97 100644 --- a/src/MS5607.cpp +++ b/src/MS5607.cpp @@ -4,7 +4,7 @@ namespace sta { // Forward declaration uint16_t uint_8BufferTouint16_t(uint8_t* buffer); - MS5607::MS5607(SpiDevice* device, OsrLevel level) { + MS5607::MS5607(STM32SPIDevice* device, OsrLevel level) { this->device_ = device; this->osr_ = level; this->lastPresVal = -1; @@ -161,7 +161,7 @@ namespace sta { this->device_->beginTransmission(); this->device_->transfer(MS5607::Operations::RESET); this->device_->endTransmission(); - delayUs(MS5607::RESET_DELAY); + delayMs(MS5607::RESET_DELAY*0.001); } // Read all constants from the PROM @@ -220,4 +220,4 @@ namespace sta { uint16_t uint_8BufferTouint16_t(uint8_t* buffer) { return (buffer[0] << 8) | buffer[1]; } -} \ No newline at end of file +}