mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 01:41:12 +03:00
Fix some issues for string based constructors
Signed-off-by: Adelin Dobre <adelin.dobre@rinftech.com>
This commit is contained in:

committed by
Stefan Andritoiu

parent
5a42e44c86
commit
b13cef3ebb
@ -104,15 +104,15 @@ BMPX8X::BMPX8X(std::string initStr) : mraaIo(initStr)
|
||||
}
|
||||
|
||||
std::string::size_type sz;
|
||||
for(std::string tok:upmTokens) {
|
||||
if(tok.substr(0,16) == "setOversampling:") {
|
||||
BMPX8X_OSS_T oss = (BMPX8X_OSS_T)std::stoi(tok.substr(16),nullptr,0);
|
||||
for(std::string tok : upmTokens) {
|
||||
if(tok.substr(0, 16) == "setOversampling:") {
|
||||
BMPX8X_OSS_T oss = (BMPX8X_OSS_T)std::stoi(tok.substr(16), nullptr, 0);
|
||||
setOversampling(oss);
|
||||
}
|
||||
if(tok.substr(0,9) == "writeReg:") {
|
||||
uint8_t reg = std::stoi(tok.substr(9),&sz,0);
|
||||
if(tok.substr(0, 9) == "writeReg:") {
|
||||
uint8_t reg = std::stoi(tok.substr(9), &sz, 0);
|
||||
tok = tok.substr(9);
|
||||
uint8_t val = std::stoi(tok.substr(sz+1),nullptr,0);
|
||||
uint8_t val = std::stoi(tok.substr(sz+1), nullptr, 0);
|
||||
writeReg(reg, val);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user