Lines Matching refs:bcs
62 lws_button_state_t *bcs;
94 LWS_PLAT_TIMER_START(each->bcs->timer);
107 lws_button_state_t *bcs = LWS_PLAT_TIMER_CB_GET_OPAQUE(th);
108 const lws_button_controller_t *bc = bcs->controller;
109 lws_button_each_t *each = (lws_button_each_t *)&bcs[1];
156 each[n].mon_timer_comp = bcs->mon_timer_count;
158 if (!bcs->mon_refcount++) {
161 LWS_PLAT_TIMER_START(bcs->timer_mon);
204 lws_button_state_t *bcs = LWS_PLAT_TIMER_CB_GET_OPAQUE(th);
205 lws_button_each_t *each = (lws_button_each_t *)&bcs[1];
206 const lws_button_controller_t *bc = bcs->controller;
213 bcs->mon_timer_count++;
225 comp_age_ms = (bcs->mon_timer_count - each[n].mon_timer_comp) *
255 each[n].mon_timer_comp = bcs->mon_timer_count;
303 each[n].mon_timer_comp = bcs->mon_timer_count;
323 each[n].mon_timer_comp = bcs->mon_timer_count;
350 each[n].mon_timer_comp = bcs->mon_timer_count;
367 each[n].mon_timer_comp = bcs->mon_timer_count;
377 if (!(--bcs->mon_refcount)) {
379 LWS_PLAT_TIMER_STOP(bcs->timer_mon);
388 lws_smd_msg_printf(bcs->ctx, LWSSMDCL_INTERACTION,
401 lws_button_state_t *bcs = lws_zalloc(sizeof(lws_button_state_t) +
404 lws_button_each_t *each = (lws_button_each_t *)&bcs[1];
407 if (!bcs)
410 bcs->controller = controller;
411 bcs->ctx = ctx;
414 each[n].bcs = bcs;
418 bcs->timer = LWS_PLAT_TIMER_CREATE("bcst",
419 1, 0, bcs, (TimerCallbackFunction_t)lws_button_bh);
420 if (!bcs->timer)
423 bcs->timer_mon = LWS_PLAT_TIMER_CREATE("bcmon", LWS_BUTTON_MON_TIMER_MS, 1, bcs,
425 if (!bcs->timer_mon)
429 return bcs;
433 lws_button_controller_destroy(struct lws_button_state *bcs)
436 lws_button_enable(bcs, 0, 0);
439 LWS_PLAT_TIMER_DELETE(&bcs->timer);
440 LWS_PLAT_TIMER_DELETE(&bcs->timer_mon);
443 lws_free(bcs);
447 lws_button_get_bit(struct lws_button_state *bcs, const char *name)
449 const lws_button_controller_t *bc = bcs->controller;
460 lws_button_enable(lws_button_state_t *bcs,
463 lws_button_idx_t u = (bcs->enable_bitmap & (~_reset)) | _set;
464 const lws_button_controller_t *bc = bcs->controller;
466 lws_button_each_t *each = (lws_button_each_t *)&bcs[1];
470 for (n = 0; n < bcs->controller->count_buttons; n++) {
471 if (!(bcs->enable_bitmap & (1 << n)) && (u & (1 << n))) {
490 if ((bcs->enable_bitmap & (1 << n)) && !(u & (1 << n)))
496 bcs->enable_bitmap = u;