driver: counter: rpi_pico_timer: fix counter cancel
alarm setting function checks channel callback and it returns -EBUSY if callback is registered. but alarm cancel function doesn't clear callback function. this prevents from alarm setting after alarm cancel Signed-off-by: Minho Jin <kilejin@gmail.com>
This commit is contained in:
parent
82644a31c2
commit
a1614e8c95
|
@ -106,6 +106,11 @@ static int counter_rpi_pico_timer_set_alarm(const struct device *dev, uint8_t id
|
|||
|
||||
static int counter_rpi_pico_timer_cancel_alarm(const struct device *dev, uint8_t id)
|
||||
{
|
||||
struct counter_rpi_pico_timer_data *data = dev->data;
|
||||
struct counter_rpi_pico_timer_ch_data *chdata = &data->ch_data[id];
|
||||
|
||||
chdata->callback = NULL;
|
||||
chdata->user_data = NULL;
|
||||
hardware_alarm_cancel(id);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue