mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-18 21:53:59 +00:00
Add power off command to I2cDev_PPmod class (#3152)
This commit is contained in:
@@ -242,4 +242,12 @@ std::vector<uint8_t> I2cDev_PPmod::downloadStandaloneApp(uint32_t index, size_t
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool I2cDev_PPmod::send_poweroff_command() {
|
||||
if (isLocked()) return false; // device is busy
|
||||
Command cmd = Command::COMMAND_POWER_OFF;
|
||||
uint8_t tmp = 0; // result of the ack. 0 = no, 1 = ok
|
||||
i2c_read((uint8_t*)&cmd, 2, &tmp, 1);
|
||||
return (tmp == 1);
|
||||
}
|
||||
|
||||
} // namespace i2cdev
|
||||
|
||||
Reference in New Issue
Block a user