#pragma once #include /** * Configures the next-photo button GPIO (CONFIG_FRAME_NEXT_BUTTON_GPIO, * active-low with internal pull-up) and arms it as a deep-sleep wakeup * source. Call once, early in app_main(), before the device might enter * deep sleep. * * A no-op if CONFIG_FRAME_NEXT_BUTTON_GPIO is negative (button disabled). */ void next_button_init(void); typedef enum { NEXT_BUTTON_NOT_PRESSED, /** A short press -- advancing a photo is low-stakes and should feel * immediate, so this fires the moment the button releases (or right * away for a wake-triggered press, once it's confirmed not a hold). */ NEXT_BUTTON_SHORT_PRESS, /** Held past the configured hold duration (see * wifi_provisioning.h's frame_config_get_hold_duration_ms) -- * triggers a frame-wide action instead (see * server/app/global_actions.py, frame_client.h's FETCH_GLOBAL_NEXT). * Fires immediately at the threshold, without waiting for release -- * same convention as combo_button.c's factory-reset tier. */ NEXT_BUTTON_HOLD, } next_button_result_t; /** * Checks the next-photo button and, if it's pressed at all (either what * caused this wake, per the latched wakeup-status register, or held * through a debounced power-on check), blocks polling its level until * either it's released (NEXT_BUTTON_SHORT_PRESS) or the hold duration * elapses (NEXT_BUTTON_HOLD, returned immediately, not waiting for * release). Evaluated once per wake. */ next_button_result_t next_button_check(void);