BH1749: Fix inconsistences inside string init constructor

Signed-off-by: Adelin Dobre <adelin.dobre@rinftech.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Adelin Dobre 2018-11-08 17:18:16 +02:00 committed by Mihai Tudor Panu
parent 3044bc6b49
commit a106345527

View File

@ -54,7 +54,7 @@ BH1749::BH1749(int bus, int addr) : m_bh1749(bh1749_init(bus, addr))
BH1749::BH1749(std::string initStr) : mraaIo(initStr)
{
mraa_io_descriptor* descs = mraaIo.getMraaDescriptors();
std::vector<std::strings> upmTokens;
std::vector<std::string> upmTokens;
m_bh1749 = (bh1749_context)malloc(sizeof(struct _bh1749_context));
if(!m_bh1749)
@ -82,7 +82,7 @@ BH1749::BH1749(std::string initStr) : mraaIo(initStr)
}
}
if(bh1749_check_who_am_i(dev) != UPM_SUCCESS)
if(bh1749_check_who_am_i(m_bh1749) != UPM_SUCCESS)
throw std::runtime_error(std::string(__FUNCTION__)
+ ": bh1749_init() failed");