mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(ci): some digital peripherals support sleep retention attach and detach
This commit is contained in:
@@ -45,6 +45,7 @@ mcpwm_group_t *mcpwm_acquire_group_handle(int group_id)
|
||||
.arg = group,
|
||||
},
|
||||
},
|
||||
.attribute = SLEEP_RETENTION_MODULE_ATTR_ATTACH,
|
||||
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_SYSTEM)
|
||||
};
|
||||
// we only do retention init here. Allocate retention module in the unit initialization
|
||||
@@ -114,6 +115,7 @@ void mcpwm_release_group_handle(mcpwm_group_t *group)
|
||||
#endif
|
||||
#if MCPWM_USE_RETENTION_LINK
|
||||
const periph_retention_module_t module_id = mcpwm_retention_infos[group_id].retention_module;
|
||||
sleep_retention_module_detach(module_id);
|
||||
if (sleep_retention_is_module_created(module_id)) {
|
||||
sleep_retention_module_free(module_id);
|
||||
}
|
||||
@@ -263,6 +265,10 @@ void mcpwm_create_retention_module(mcpwm_group_t *group)
|
||||
if (sleep_retention_module_allocate(module_id) != ESP_OK) {
|
||||
// even though the sleep retention module create failed, MCPWM driver should still work, so just warning here
|
||||
ESP_LOGW(TAG, "create retention module failed, power domain can't turn off");
|
||||
} else {
|
||||
if (sleep_retention_module_attach(module_id) != ESP_OK) {
|
||||
ESP_LOGW(TAG, "attach retention module failed, power domain can't turn off");
|
||||
}
|
||||
}
|
||||
}
|
||||
_lock_release(&s_platform.mutex);
|
||||
|
||||
Reference in New Issue
Block a user