diff options
Diffstat (limited to 'mpm/lib/spi')
-rw-r--r-- | mpm/lib/spi/mock_spi.h | 10 | ||||
-rw-r--r-- | mpm/lib/spi/spi_lock.cpp | 2 | ||||
-rw-r--r-- | mpm/lib/spi/spi_lock.h | 25 |
3 files changed, 1 insertions, 36 deletions
diff --git a/mpm/lib/spi/mock_spi.h b/mpm/lib/spi/mock_spi.h deleted file mode 100644 index c289faa16..000000000 --- a/mpm/lib/spi/mock_spi.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include <uhd/types/serial.hpp> - -class mock_spi : public virtual uhd::spi_iface -{ -public: - typedef boost::shared_ptr<spi> sptr; - static sptr make(const std::string &device); -}; diff --git a/mpm/lib/spi/spi_lock.cpp b/mpm/lib/spi/spi_lock.cpp index 5077053e7..b37daa738 100644 --- a/mpm/lib/spi/spi_lock.cpp +++ b/mpm/lib/spi/spi_lock.cpp @@ -1,4 +1,4 @@ -#include "spi_lock.h" +#include "mpm/spi/spi_lock.hpp" spi_lock::spi_lock(uint8_t spidev_index) : spidev_index(spidev_index) diff --git a/mpm/lib/spi/spi_lock.h b/mpm/lib/spi/spi_lock.h deleted file mode 100644 index 9ad4e20fe..000000000 --- a/mpm/lib/spi/spi_lock.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include <boost/noncopyable.hpp> -#include <mutex> -#include <memory> - -class spi_lock : public boost::noncopyable -{ -public: - using sptr = std::shared_ptr<spi_lock>; - static sptr make(uint8_t spidev_index); - - spi_lock(uint8_t spidev_index); - - uint8_t get_spidev() const; - -private: - const uint8_t spidev_index; - - // BasicLockable implementation for lock_guard - mutable std::mutex spi_mutex; - friend class std::lock_guard<spi_lock>; - void lock(); - void unlock(); -}; |