Lines Matching refs:bcs
62 lws_button_state_t *bcs;
95 LWS_PLAT_TIMER_START(each->bcs->timer);
110 lws_button_state_t *bcs = LWS_PLAT_TIMER_CB_GET_OPAQUE(th);
111 lws_button_each_t *each = (lws_button_each_t *)&bcs[1];
112 const lws_button_controller_t *bc = bcs->controller;
159 each[n].mon_timer_comp = bcs->mon_timer_count;
161 if (!bcs->mon_refcount++) {
163 LWS_PLAT_TIMER_START(bcs->timer_mon);
206 lws_button_state_t *bcs = LWS_PLAT_TIMER_CB_GET_OPAQUE(th);
207 lws_button_each_t *each = (lws_button_each_t *)&bcs[1];
208 const lws_button_controller_t *bc = bcs->controller;
215 bcs->mon_timer_count++;
229 comp_age_ms = (bcs->mon_timer_count - each->mon_timer_comp) *
259 each->mon_timer_comp = bcs->mon_timer_count;
272 each->mon_timer_repeat = bcs->mon_timer_count;
311 each->mon_timer_comp = bcs->mon_timer_count;
334 each->mon_timer_comp = bcs->mon_timer_count;
362 each->mon_timer_comp = bcs->mon_timer_count;
387 each->mon_timer_comp = bcs->mon_timer_count;
394 (bcs->mon_timer_count - each->mon_timer_repeat) *
396 each->mon_timer_repeat = bcs->mon_timer_count;
407 if (!(--bcs->mon_refcount)) {
409 LWS_PLAT_TIMER_STOP(bcs->timer_mon);
418 lws_smd_msg_printf(bcs->ctx, LWSSMDCL_INTERACTION,
434 lws_button_state_t *bcs = lws_zalloc(sizeof(lws_button_state_t) +
437 lws_button_each_t *each = (lws_button_each_t *)&bcs[1];
440 if (!bcs)
443 bcs->controller = controller;
444 bcs->ctx = ctx;
447 each[n].bcs = bcs;
451 bcs->timer = LWS_PLAT_TIMER_CREATE("bcst",
452 1, 0, bcs, (TimerCallbackFunction_t)lws_button_bh);
453 if (!bcs->timer)
457 bcs->timer_mon = LWS_PLAT_TIMER_CREATE("bcmon", LWS_BUTTON_MON_TIMER_MS,
458 1, bcs, (TimerCallbackFunction_t)
460 if (!bcs->timer_mon)
464 return bcs;
468 lws_button_controller_destroy(struct lws_button_state *bcs)
471 lws_button_enable(bcs, 0, 0);
474 LWS_PLAT_TIMER_DELETE(bcs->timer);
475 LWS_PLAT_TIMER_DELETE(bcs->timer_mon);
478 lws_free(bcs);
482 lws_button_get_bit(struct lws_button_state *bcs, const char *name)
484 const lws_button_controller_t *bc = bcs->controller;
495 lws_button_enable(lws_button_state_t *bcs,
498 lws_button_idx_t u = (bcs->enable_bitmap & (~_reset)) | _set;
499 const lws_button_controller_t *bc = bcs->controller;
501 lws_button_each_t *each = (lws_button_each_t *)&bcs[1];
505 for (n = 0; n < bcs->controller->count_buttons; n++) {
506 if (!(bcs->enable_bitmap & (1 << n)) && (u & (1 << n))) {
525 if ((bcs->enable_bitmap & (1 << n)) && !(u & (1 << n)))
531 bcs->enable_bitmap = u;