diff --git a/I2CPort.cpp b/I2CPort.cpp index 6f366a1..03b4b9d 100644 --- a/I2CPort.cpp +++ b/I2CPort.cpp @@ -23,22 +23,40 @@ #include "I2CPort.h" CI2CPort::CI2CPort(uint8_t n) : +m_n(n), m_ok(false) { } bool CI2CPort::init() { - return false; + switch (m_n) { + case 1U: + break; + case 2U: + break; + case 3U: + break; + default: + return m_ok; + } + + return m_ok; } uint8_t CI2CPort::writeCommand(const uint8_t* data, uint8_t length) { + if (!m_ok) + return 6U; + return 6U; } uint8_t CI2CPort::writeData(const uint8_t* data, uint8_t length) { + if (!m_ok) + return 6U; + return 6U; } diff --git a/I2CPort.h b/I2CPort.h index 01cb7d8..7ab5cfe 100644 --- a/I2CPort.h +++ b/I2CPort.h @@ -37,7 +37,8 @@ public: uint8_t writeData(const uint8_t* data, uint8_t length); private: - bool m_ok; + uint8_t m_n; + bool m_ok; }; #endif diff --git a/STM32F4XX_Lib b/STM32F4XX_Lib index bcd346f..18aeb6e 160000 --- a/STM32F4XX_Lib +++ b/STM32F4XX_Lib @@ -1 +1 @@ -Subproject commit bcd346f53036ed0eab6643d662a410861655afe2 +Subproject commit 18aeb6ea3a236088fc9f376077c651098e3a495e diff --git a/STM32F7XX_Lib b/STM32F7XX_Lib index 2d5f423..6241f7c 160000 --- a/STM32F7XX_Lib +++ b/STM32F7XX_Lib @@ -1 +1 @@ -Subproject commit 2d5f4236fa5e9828beadbc72473293f25b3ad65e +Subproject commit 6241f7c05eeb6cf1ecd16ca0274bf310efee853f