forked from flipperdevices/flipperzero-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/lfrfid_hid_37_bit
* dev: IR: increase raw timings amount (flipperdevices#1388) Change # to ! for the inverted text example (flipperdevices#1395) [FL-2633] Move files from /int to /ext on SD mount flipperdevices#1384 [FL-2554] Embedded arm-none-eabi toolchain (flipperdevices#1351)
- Loading branch information
Showing
29 changed files
with
878 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
* text=auto eol=lf | ||
*.bat eol=crlf | ||
*.ps1 eol=crlf | ||
*.cmd eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,7 @@ dist | |
build/ | ||
|
||
# Toolchain | ||
toolchain*/ | ||
/toolchain | ||
|
||
# openocd output file | ||
openocd.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,4 +206,4 @@ int32_t about_settings_app(void* p) { | |
furi_record_close("gui"); | ||
|
||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
App( | ||
appid="storage_move_to_sd", | ||
name="StorageMoveToSd", | ||
apptype=FlipperAppType.SYSTEM, | ||
entry_point="storage_move_to_sd_app", | ||
requires=["gui","storage"], | ||
provides=["storage_move_to_sd_start"], | ||
stack_size=2 * 1024, | ||
order=30, | ||
) | ||
|
||
App( | ||
appid="storage_move_to_sd_start", | ||
apptype=FlipperAppType.STARTUP, | ||
entry_point="storage_move_to_sd_start", | ||
requires=["storage"], | ||
order=120, | ||
) | ||
|
30 changes: 30 additions & 0 deletions
30
applications/storage_move_to_sd/scenes/storage_move_to_sd_scene.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "storage_move_to_sd_scene.h" | ||
|
||
// Generate scene on_enter handlers array | ||
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter, | ||
void (*const storage_move_to_sd_on_enter_handlers[])(void*) = { | ||
#include "storage_move_to_sd_scene_config.h" | ||
}; | ||
#undef ADD_SCENE | ||
|
||
// Generate scene on_event handlers array | ||
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event, | ||
bool (*const storage_move_to_sd_on_event_handlers[])(void* context, SceneManagerEvent event) = { | ||
#include "storage_move_to_sd_scene_config.h" | ||
}; | ||
#undef ADD_SCENE | ||
|
||
// Generate scene on_exit handlers array | ||
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit, | ||
void (*const storage_move_to_sd_on_exit_handlers[])(void* context) = { | ||
#include "storage_move_to_sd_scene_config.h" | ||
}; | ||
#undef ADD_SCENE | ||
|
||
// Initialize scene handlers configuration structure | ||
const SceneManagerHandlers storage_move_to_sd_scene_handlers = { | ||
.on_enter_handlers = storage_move_to_sd_on_enter_handlers, | ||
.on_event_handlers = storage_move_to_sd_on_event_handlers, | ||
.on_exit_handlers = storage_move_to_sd_on_exit_handlers, | ||
.scene_num = StorageMoveToSdSceneNum, | ||
}; |
29 changes: 29 additions & 0 deletions
29
applications/storage_move_to_sd/scenes/storage_move_to_sd_scene.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include <gui/scene_manager.h> | ||
|
||
// Generate scene id and total number | ||
#define ADD_SCENE(prefix, name, id) StorageMoveToSd##id, | ||
typedef enum { | ||
#include "storage_move_to_sd_scene_config.h" | ||
StorageMoveToSdSceneNum, | ||
} StorageMoveToSdScene; | ||
#undef ADD_SCENE | ||
|
||
extern const SceneManagerHandlers storage_move_to_sd_scene_handlers; | ||
|
||
// Generate scene on_enter handlers declaration | ||
#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*); | ||
#include "storage_move_to_sd_scene_config.h" | ||
#undef ADD_SCENE | ||
|
||
// Generate scene on_event handlers declaration | ||
#define ADD_SCENE(prefix, name, id) \ | ||
bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event); | ||
#include "storage_move_to_sd_scene_config.h" | ||
#undef ADD_SCENE | ||
|
||
// Generate scene on_exit handlers declaration | ||
#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context); | ||
#include "storage_move_to_sd_scene_config.h" | ||
#undef ADD_SCENE |
2 changes: 2 additions & 0 deletions
2
applications/storage_move_to_sd/scenes/storage_move_to_sd_scene_config.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ADD_SCENE(storage_move_to_sd, confirm, Confirm) | ||
ADD_SCENE(storage_move_to_sd, progress, Progress) |
70 changes: 70 additions & 0 deletions
70
applications/storage_move_to_sd/scenes/storage_move_to_sd_scene_confirm.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include "../storage_move_to_sd.h" | ||
#include "gui/canvas.h" | ||
#include "gui/modules/widget_elements/widget_element_i.h" | ||
#include "storage/storage.h" | ||
|
||
static void storage_move_to_sd_scene_confirm_widget_callback( | ||
GuiButtonType result, | ||
InputType type, | ||
void* context) { | ||
StorageMoveToSd* app = context; | ||
furi_assert(app); | ||
if(type == InputTypeShort) { | ||
if(result == GuiButtonTypeRight) { | ||
view_dispatcher_send_custom_event(app->view_dispatcher, MoveToSdCustomEventConfirm); | ||
} else if(result == GuiButtonTypeLeft) { | ||
view_dispatcher_send_custom_event(app->view_dispatcher, MoveToSdCustomEventExit); | ||
} | ||
} | ||
} | ||
|
||
void storage_move_to_sd_scene_confirm_on_enter(void* context) { | ||
StorageMoveToSd* app = context; | ||
|
||
widget_add_button_element( | ||
app->widget, | ||
GuiButtonTypeLeft, | ||
"Cancel", | ||
storage_move_to_sd_scene_confirm_widget_callback, | ||
app); | ||
widget_add_button_element( | ||
app->widget, | ||
GuiButtonTypeRight, | ||
"Confirm", | ||
storage_move_to_sd_scene_confirm_widget_callback, | ||
app); | ||
|
||
widget_add_string_element( | ||
app->widget, 64, 10, AlignCenter, AlignCenter, FontPrimary, "SD card inserted"); | ||
widget_add_string_multiline_element( | ||
app->widget, | ||
64, | ||
32, | ||
AlignCenter, | ||
AlignCenter, | ||
FontSecondary, | ||
"Move data from\ninternal storage to SD card?"); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, StorageMoveToSdViewWidget); | ||
} | ||
|
||
bool storage_move_to_sd_scene_confirm_on_event(void* context, SceneManagerEvent event) { | ||
StorageMoveToSd* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
if(event.event == MoveToSdCustomEventConfirm) { | ||
scene_manager_next_scene(app->scene_manager, StorageMoveToSdProgress); | ||
consumed = true; | ||
} else if(event.event == MoveToSdCustomEventExit) { | ||
view_dispatcher_stop(app->view_dispatcher); | ||
} | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void storage_move_to_sd_scene_confirm_on_exit(void* context) { | ||
StorageMoveToSd* app = context; | ||
widget_reset(app->widget); | ||
} |
Oops, something went wrong.