mirror of
https://github.com/eclipse/upm.git
synced 2025-07-26 21:51:16 +03:00
Fix some issues for string based constructors
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:

committed by
Mihai Tudor Panu

parent
8f11061de3
commit
2975bae075
@ -87,7 +87,7 @@ ADIS16448::ADIS16448(std::string initStr) : mraaIo(initStr)
|
||||
}
|
||||
|
||||
// Configure I/O
|
||||
//Initialize RST pin
|
||||
// Initialize RST pin
|
||||
if(!descs->gpios)
|
||||
{
|
||||
throw std::invalid_argument(std::string(__FUNCTION__) +
|
||||
@ -124,10 +124,10 @@ ADIS16448::ADIS16448(std::string initStr) : mraaIo(initStr)
|
||||
std::string::size_type sz;
|
||||
|
||||
for (std::string tok : upmTokens) {
|
||||
if(tok.substr(0,9) == "regWrite:") {
|
||||
uint8_t regAddr = std::stoi(tok.substr(9),&sz,0);
|
||||
if(tok.substr(0, 9) == "regWrite:") {
|
||||
uint8_t regAddr = std::stoi(tok.substr(9), &sz, 0);
|
||||
tok = tok.substr(9);
|
||||
uint16_t regData = std::stoi(tok.substr(sz+1),nullptr,0);
|
||||
uint16_t regData = std::stoi(tok.substr(sz+1), nullptr, 0);
|
||||
regWrite(regAddr, regData);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user