equal
deleted
inserted
replaced
173 inline void update_refresh_period(hmi_tree_item_t *dsc, uint16_t refresh_period_ms) |
173 inline void update_refresh_period(hmi_tree_item_t *dsc, uint16_t refresh_period_ms) |
174 { |
174 { |
175 while(AtomicCompareExchange(&dsc->wlock, 0, 1)) sched_yield(); |
175 while(AtomicCompareExchange(&dsc->wlock, 0, 1)) sched_yield(); |
176 dsc->refresh_period_ms = refresh_period_ms; |
176 dsc->refresh_period_ms = refresh_period_ms; |
177 if(refresh_period_ms) { |
177 if(refresh_period_ms) { |
|
178 /* TODO : maybe only if was null before for optimization */ |
178 dsc->wstate = buf_new; |
179 dsc->wstate = buf_new; |
179 } else { |
180 } else { |
180 dsc->wstate = buf_free; |
181 dsc->wstate = buf_free; |
181 } |
182 } |
182 AtomicCompareExchange(&dsc->wlock, 1, 0); |
183 AtomicCompareExchange(&dsc->wlock, 1, 0); |