Skip to content

Commit e266cf0

Browse files
author
Дмитрий Митченков
committed
fix: max output power incorrect reading (#9)
1 parent 0cf740a commit e266cf0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/IP2366.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void IP2366::setMaxOutputPower(Vbus1OutputPower power, uint8_t * errorCode)
191191
IP2366::Vbus1OutputPower IP2366::getMaxOutputPower(uint8_t * errorCode)
192192
{
193193
if (errorCode != nullptr) *errorCode = 0; // reset error code
194-
return static_cast<Vbus1OutputPower>((readRegister(IP2366_REG_SYS_CTL12, errorCode) >> 5) & 0x03);
194+
return static_cast<Vbus1OutputPower>((readRegister(IP2366_REG_SYS_CTL12, errorCode) >> 5) & 0x07);
195195
}
196196

197197
// SELECT_PDO

src/IP2368.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ void IP2368::setMaxOutputPower(Vbus1OutputPower power, uint8_t * errorCode)
442442
IP2368::Vbus1OutputPower IP2368::getMaxOutputPower(uint8_t * errorCode)
443443
{
444444
if (errorCode != nullptr) *errorCode = 0; // reset error code
445-
return static_cast<Vbus1OutputPower>((readRegister(IP2368_REG_SYS_CTL12, errorCode) >> 5) & 0x03);
445+
return static_cast<Vbus1OutputPower>((readRegister(IP2368_REG_SYS_CTL12, errorCode) >> 5) & 0x07);
446446
}
447447

448448
// SYS_CTL10

0 commit comments

Comments
 (0)