Skip to content

Commit c144ee3

Browse files
authored
Merge pull request #8 from CodyTolene/ct/2-fix-crash-on-backout
[Issue #2] Resolve crash on backing out from the camera scene.
2 parents 97136b2 + 119ccf7 commit c144ee3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src-fap/camera-suite.c

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "camera-suite.h"
2+
#include <stdlib.h>
23

34
bool camera_suite_custom_event_callback(void* context, uint32_t event) {
45
furi_assert(context);
@@ -106,6 +107,14 @@ void camera_suite_app_free(CameraSuite* app) {
106107
view_dispatcher_free(app->view_dispatcher);
107108
furi_record_close(RECORD_GUI);
108109

110+
// Free remaining resources
111+
camera_suite_view_start_free(app->camera_suite_view_start);
112+
camera_suite_view_style_1_free(app->camera_suite_view_style_1);
113+
camera_suite_view_style_2_free(app->camera_suite_view_style_2);
114+
camera_suite_view_guide_free(app->camera_suite_view_guide);
115+
button_menu_free(app->button_menu);
116+
variable_item_list_free(app->variable_item_list);
117+
109118
app->gui = NULL;
110119
app->notification = NULL;
111120

src-fap/views/camera_suite_view_style_1.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static bool camera_suite_view_style_1_input(InputEvent* event, void* context) {
111111
switch(event->key) {
112112
case InputKeyBack:
113113
// Stop the camera stream.
114-
data[0] = 'S';
114+
data[0] = 's';
115115
// Go back to the main menu.
116116
with_view_model(
117117
instance->view,
@@ -208,6 +208,11 @@ static void camera_suite_view_style_1_enter(void* context) {
208208
// Assign the current instance to the global variable
209209
current_instance = instance;
210210

211+
uint8_t data[1];
212+
data[0] = 'S'; // Uppercase `S` to start the camera
213+
// Send `data` to the ESP32-CAM
214+
furi_hal_uart_tx(FuriHalUartIdUSART1, data, 1);
215+
211216
with_view_model(
212217
instance->view,
213218
UartDumpModel * model,

0 commit comments

Comments
 (0)