void wl_input_reset_random_key(void) { struct wl_input_event ev; while (gpio_peek_event(&ev) && ev.key_event.keycode == WL_INPUT_KEY_RANDOM) { gpio_get_event(&ev); if (ev.key_event.value) { CTP_flush(); // flush and reset the CTP } } }
void wl_input_wait(struct wl_input_event *ev, int sleep) { /* wl_input_wait() is called from the wikilib mainloop and we will * get here regularily when the system has no other duty. Hence, * the only thing we want to do here is go to sleep - the interrupt * sources are set up and will bring us back to life at some point */ while (1) { if (serial_get_event(ev)) { break; } if (touchscreen_get_event(ev)) { break; } if (gpio_get_event(ev)) { if (ev->key_event.value) { CTP_flush(); // flush and reset the CTP } break; } /* no power saving return */ if (!sleep) { ev->type = -1; break; } /* the timers needed for profiling don't work with suspend enabled */ #if !PROFILER_ON Temperature_control(); suspend(TIMEOUT_VALUE); #endif Temperature_control(); } }