mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-21 22:52:46 +08:00
feat(lv_hal_indev): add missing lv_indev_delete() (#2854)
* feat(lv_hal_indev): Add missing lv_indev_delete() * feat(lv_hal_indev): Add missing lv_indev_delete() (fix formatting)
This commit is contained in:
@@ -127,6 +127,23 @@ void lv_indev_drv_update(lv_indev_t * indev, lv_indev_drv_t * new_drv)
|
||||
indev->proc.reset_query = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the provided input device. Make sure not to use the provided input device afterwards anymore.
|
||||
* @param indev pointer to delete
|
||||
*/
|
||||
void lv_indev_delete(lv_indev_t * indev)
|
||||
{
|
||||
LV_ASSERT_NULL(indev);
|
||||
LV_ASSERT_NULL(indev->driver);
|
||||
LV_ASSERT_NULL(indev->driver->read_timer);
|
||||
/*Clean up the read timer first*/
|
||||
lv_timer_del(indev->driver->read_timer);
|
||||
/*Remove the input device from the list*/
|
||||
_lv_ll_remove(&LV_GC_ROOT(_lv_indev_ll), indev);
|
||||
/*Free the memory of the input device*/
|
||||
lv_mem_free(indev);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next input device.
|
||||
* @param indev pointer to the current input device. NULL to initialize.
|
||||
|
||||
@@ -207,6 +207,12 @@ lv_indev_t * lv_indev_drv_register(struct _lv_indev_drv_t * driver);
|
||||
*/
|
||||
void lv_indev_drv_update(lv_indev_t * indev, struct _lv_indev_drv_t * new_drv);
|
||||
|
||||
/**
|
||||
* Remove the provided input device. Make sure not to use the provided input device afterwards anymore.
|
||||
* @param indev pointer to delete
|
||||
*/
|
||||
void lv_indev_delete(lv_indev_t * indev);
|
||||
|
||||
/**
|
||||
* Get the next input device.
|
||||
* @param indev pointer to the current input device. NULL to initialize.
|
||||
|
||||
Reference in New Issue
Block a user