1
1
#include "../findmy_i.h"
2
2
3
- void findmy_scene_main_callback (FindMyMainEvent event , void * context ) {
3
+ void findmy_scene_main_callback (FindMyMainEvent event , void * context )
4
+ {
4
5
furi_assert (context );
5
- FindMy * app = context ;
6
+ FindMy * app = context ;
6
7
view_dispatcher_send_custom_event (app -> view_dispatcher , event );
7
8
}
8
9
9
- void findmy_scene_main_on_enter (void * context ) {
10
- FindMy * app = context ;
10
+ void findmy_scene_main_on_enter (void * context )
11
+ {
12
+ FindMy * app = context ;
11
13
12
14
findmy_main_set_callback (app -> findmy_main , findmy_scene_main_callback , app );
13
-
14
15
view_dispatcher_switch_to_view (app -> view_dispatcher , FindMyViewMain );
15
16
}
16
17
17
- bool findmy_scene_main_on_event (void * context , SceneManagerEvent event ) {
18
- FindMy * app = context ;
18
+ bool findmy_scene_main_on_event (void * context , SceneManagerEvent event )
19
+ {
20
+ FindMy * app = context ;
19
21
bool consumed = false;
20
22
21
- if (event .type == SceneManagerEventTypeCustom ) {
23
+ if (event .type == SceneManagerEventTypeCustom )
24
+ {
22
25
consumed = true;
23
- switch (event .event ) {
26
+ switch (event .event )
27
+ {
24
28
case FindMyMainEventToggle :
25
29
findmy_toggle_beacon (app );
26
30
break ;
27
31
case FindMyMainEventBackground :
28
32
app -> state .beacon_active = true;
29
33
findmy_state_save (& app -> state );
30
- if (!furi_hal_bt_extra_beacon_is_active ()) {
34
+ if (!furi_hal_bt_extra_beacon_is_active ())
35
+ {
31
36
furi_check (furi_hal_bt_extra_beacon_start ());
32
37
}
33
38
view_dispatcher_stop (app -> view_dispatcher );
@@ -44,7 +49,8 @@ bool findmy_scene_main_on_event(void* context, SceneManagerEvent event) {
44
49
case FindMyMainEventQuit :
45
50
app -> state .beacon_active = false;
46
51
findmy_state_save (& app -> state );
47
- if (furi_hal_bt_extra_beacon_is_active ()) {
52
+ if (furi_hal_bt_extra_beacon_is_active ())
53
+ {
48
54
furi_check (furi_hal_bt_extra_beacon_stop ());
49
55
}
50
56
break ;
@@ -57,7 +63,8 @@ bool findmy_scene_main_on_event(void* context, SceneManagerEvent event) {
57
63
return consumed ;
58
64
}
59
65
60
- void findmy_scene_main_on_exit (void * context ) {
61
- FindMy * app = context ;
66
+ void findmy_scene_main_on_exit (void * context )
67
+ {
68
+ FindMy * app = context ;
62
69
UNUSED (app );
63
70
}
0 commit comments