#pragma once #include /** * Configures the back-photo button GPIO (CONFIG_FRAME_BACK_BUTTON_GPIO, * active-low with internal pull-up) and arms it as a deep-sleep wakeup * source, same as next_button_init(). Call once, early in app_main(), * before the device might enter deep sleep. * * A no-op if CONFIG_FRAME_BACK_BUTTON_GPIO is negative (button disabled). */ void back_button_init(void); typedef enum { BACK_BUTTON_NOT_PRESSED, /** A short press -- same immediate-response reasoning as the * next-photo button. */ BACK_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_BACK). * Fires immediately at the threshold, without waiting for release. */ BACK_BUTTON_HOLD, } back_button_result_t; /** * Checks the back-photo button and, if it's pressed at all, blocks * polling its level until either it's released (BACK_BUTTON_SHORT_PRESS) * or the hold duration elapses (BACK_BUTTON_HOLD) -- same pattern as * next_button_check(). Evaluated once per wake. */ back_button_result_t back_button_check(void);