Skip to content

Commit

Permalink
Fix zbus breaking change in latest Zephyr.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakkra committed Oct 1, 2023
1 parent 9b9f7a6 commit 2ac7450
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/src/zsw_periodic_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ int zsw_periodic_chan_add_obs(const struct zbus_channel *chan, const struct zbus

int zsw_periodic_chan_rm_obs(const struct zbus_channel *chan, const struct zbus_observer *obs)
{
//struct k_work_delayable *work = NULL;
struct k_work_delayable *work = NULL;
int ret = zbus_chan_rm_obs(chan, obs, K_MSEC(100));
//if (ret == 0 && sys_slist_is_empty(chan->runtime_observers)) {
// work = (struct k_work_delayable *)zbus_chan_user_data(chan);
// __ASSERT(k_work_delayable_is_pending(work), "Periodic slow work is not pending");
// ret = k_work_cancel_delayable(work);
//}
if (ret == 0 && sys_slist_is_empty(&chan->data->observers)) {
work = (struct k_work_delayable *)zbus_chan_user_data(chan);
__ASSERT(k_work_delayable_is_pending(work), "Periodic slow work is not pending");
ret = k_work_cancel_delayable(work);
}
return ret;
}

Expand Down

0 comments on commit 2ac7450

Please sign in to comment.