diff --git a/main/pages/capture_entropy.c b/main/pages/capture_entropy.c index add9bd1..9f423c7 100644 --- a/main/pages/capture_entropy.c +++ b/main/pages/capture_entropy.c @@ -14,6 +14,7 @@ #include "../components/video/video.h" #include "../ui/dialog.h" +#include "../ui/input_helpers.h" #include "../ui/theme_widgets.h" #include "../utils/memory_utils.h" #include "../utils/secure_mem.h" @@ -83,6 +84,15 @@ static void low_entropy_prompt_cb(bool retry, void *user_data) { // If retry (Yes), do nothing - user stays on camera page } +static void back_btn_cb(lv_event_t *e) { + (void)e; + if (closing) + return; + closing = true; + if (return_callback) + return_callback(); +} + static uint8_t *allocate_buffer(size_t size) { // PPA writes directly into these buffers, so they must be cache-line aligned. size_t aligned = (size + CONFIG_CACHE_L2_CACHE_LINE_SIZE - 1) & @@ -337,6 +347,8 @@ void capture_entropy_page_create(lv_obj_t *parent, void (*return_cb)(void)) { lv_obj_set_style_text_color(instruction, highlight_color(), 0); lv_obj_align(instruction, LV_ALIGN_BOTTOM_MID, 0, -theme_default_padding()); + ui_create_back_button(capture_screen, back_btn_cb); + if (!camera_init()) { ESP_LOGE(TAG, "Failed to initialize camera"); return;