Add function to unregister a module from LPM

This commit is contained in:
George Oikonomou 2015-05-01 16:38:07 +01:00
parent 0e92b508b3
commit b3ac3ac0c1
2 changed files with 15 additions and 0 deletions

View file

@ -390,6 +390,12 @@ lpm_register_module(lpm_registered_module_t *module)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void
lpm_unregister_module(lpm_registered_module_t *module)
{
list_remove(modules_list, module);
}
/*---------------------------------------------------------------------------*/
void
lpm_init() lpm_init()
{ {
list_init(modules_list); list_init(modules_list);

View file

@ -153,6 +153,15 @@ void lpm_shutdown(uint32_t wakeup_pin, uint32_t io_pull, uint32_t wake_on);
*/ */
void lpm_register_module(lpm_registered_module_t *module); void lpm_register_module(lpm_registered_module_t *module);
/**
* \brief Unregister a module from LPM notifications.
* \param module A pointer to the data structure with the module definition
*
* When a previously registered module is no longer interested in LPM
* notifications, this function can be used to unregister it.
*/
void lpm_unregister_module(lpm_registered_module_t *module);
/** /**
* \brief Initialise the low-power mode management module * \brief Initialise the low-power mode management module
*/ */