minor tweaks

This commit is contained in:
Robin Müller 2021-06-15 16:53:41 +02:00
parent baf65a113c
commit 457afca582
No known key found for this signature in database
GPG Key ID: 9C287E88FED11DF3
2 changed files with 7 additions and 7 deletions

View File

@ -38,7 +38,7 @@ ReturnValue_t I2cComIF::initializeInterface(CookieIF* cookie) {
i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress);
if(i2cDeviceMapIter == i2cDeviceMap.end()) {
size_t maxReplyLen = i2cCookie->getMaxReplyLen();
I2cInstance_t i2cInstance = {std::vector<uint8_t>(maxReplyLen), 0};
I2cInstance i2cInstance = {std::vector<uint8_t>(maxReplyLen), 0};
auto statusPair = i2cDeviceMap.emplace(i2cAddress, i2cInstance);
if (not statusPair.second) {
sif::error << "I2cComIF::initializeInterface: Failed to insert device with address " <<

View File

@ -9,10 +9,10 @@
#include <vector>
/**
* @brief This is the communication interface for i2c devices connected
* to a system running a linux OS.
* @brief This is the communication interface for I2C devices connected
* to a system running a Linux OS.
*
* @note The xilinx linux kernel does not support to read more than 255 bytes at once.
* @note The Xilinx Linux kernel might not support to read more than 255 bytes at once.
*
* @author J. Meier
*/
@ -33,12 +33,12 @@ public:
private:
typedef struct I2cInstance {
struct I2cInstance {
std::vector<uint8_t> replyBuffer;
size_t replyLen;
} I2cInstance_t;
};
using I2cDeviceMap = std::unordered_map<address_t, I2cInstance_t>;
using I2cDeviceMap = std::unordered_map<address_t, I2cInstance>;
using I2cDeviceMapIter = I2cDeviceMap::iterator;
/* In this map all i2c devices will be registered with their address and