mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 17:19:29 +00:00
Charge sleep bug (#3177)
This commit is contained in:
@@ -551,6 +551,15 @@ bool I2cDev_MAX17055::setModelCfg(const uint8_t _Model_ID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool I2cDev_MAX17055::setHibCFG(const uint16_t _Config) {
|
bool I2cDev_MAX17055::setHibCFG(const uint16_t _Config) {
|
||||||
|
uint16_t config1_reg = read_register(0x1D);
|
||||||
|
|
||||||
|
// (SHDN: 0x80) and (COMMSH: 0x40) Otherwise it will go into sleep mode after 45 seconds.
|
||||||
|
config1_reg &= ~(0x0080 | 0x0040);
|
||||||
|
|
||||||
|
if (!write_register(0x1D, config1_reg)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return write_register(0xBA, _Config);
|
return write_register(0xBA, _Config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user