You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explain how powering down devices and peripherals works in libhal. Specifically, power down APIs should be:
voidclass::power_down();
But this may be too limiting as there maybe other options for powering down the devices such as deep sleep, complete shutdown, low power mode, etc.
An important specification is that all APIs that are not powering down the device, MUST perform the work of bringing the device into a power state where the API can work successfully. This prevents the viral pattern of:
if (driver.is_powered_down()) {
driver.power_on();
}
driver.use_api();
The issue with this pattern is that it spreads EVERYWHERE and will have to be placed before every driver api usage, when possible.
The text was updated successfully, but these errors were encountered:
Explain how powering down devices and peripherals works in libhal. Specifically, power down APIs should be:
But this may be too limiting as there maybe other options for powering down the devices such as deep sleep, complete shutdown, low power mode, etc.
An important specification is that all APIs that are not powering down the device, MUST perform the work of bringing the device into a power state where the API can work successfully. This prevents the viral pattern of:
The issue with this pattern is that it spreads EVERYWHERE and will have to be placed before every driver api usage, when possible.
The text was updated successfully, but these errors were encountered: