This commit is contained in:
aozhiwei 2024-03-05 14:58:44 +08:00
parent af7a9093a0
commit 4b4462b833

View File

@ -273,22 +273,36 @@ namespace a8
void ClearAttacher(Attacher* attacher)
{
#if 1
while (!list_empty(&attacher->timer_list_)) {
xtimer_list* tmp_timer = list_first_entry(&attacher->timer_list_, struct xtimer_list, attach_entry);
InternalDelete(tmp_timer, false, true);
}
#else
struct list_head* pos = nullptr;
struct list_head* n = nullptr;
list_for_each_safe(pos, n, &attacher->timer_list_) {
xtimer_list* tmp_timer = list_entry(pos, struct xtimer_list, attach_entry);
InternalDelete(tmp_timer, false, true);
}
#endif
}
void DestoryAttacher(Attacher* attacher)
{
#if 1
while (!list_empty(&attacher->timer_list_)) {
xtimer_list* tmp_timer = list_first_entry(&attacher->timer_list_, struct xtimer_list, attach_entry);
InternalDelete(tmp_timer, true, true);
}
#else
struct list_head* pos = nullptr;
struct list_head* n = nullptr;
list_for_each_safe(pos, n, &attacher->timer_list_) {
xtimer_list* tmp_timer = list_entry(pos, struct xtimer_list, attach_entry);
InternalDelete(tmp_timer, true, true);
}
#endif
}
void UpdateTimer()