mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-20 04:54:45 -07:00
Merge branch 'ofwdev' into 420
This commit is contained in:
@@ -46,18 +46,34 @@ bool subghz_scene_more_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
|
|
||||||
if(event.type == SceneManagerEventTypeCustom) {
|
if(event.type == SceneManagerEventTypeCustom) {
|
||||||
if(event.event == SubmenuIndexDelete) {
|
if(event.event == SubmenuIndexDelete) {
|
||||||
|
if(subghz_file_available(subghz)) {
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerNoSet);
|
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerNoSet);
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
subghz->scene_manager, SubGhzSceneMoreRAW, SubmenuIndexDelete);
|
subghz->scene_manager, SubGhzSceneMoreRAW, SubmenuIndexDelete);
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneDeleteRAW);
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneDeleteRAW);
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
if(!scene_manager_search_and_switch_to_previous_scene(
|
||||||
|
subghz->scene_manager, SubGhzSceneStart)) {
|
||||||
|
scene_manager_stop(subghz->scene_manager);
|
||||||
|
view_dispatcher_stop(subghz->view_dispatcher);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if(event.event == SubmenuIndexEdit) {
|
} else if(event.event == SubmenuIndexEdit) {
|
||||||
|
if(subghz_file_available(subghz)) {
|
||||||
furi_string_reset(subghz->file_path_tmp);
|
furi_string_reset(subghz->file_path_tmp);
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
subghz->scene_manager, SubGhzSceneMoreRAW, SubmenuIndexEdit);
|
subghz->scene_manager, SubGhzSceneMoreRAW, SubmenuIndexEdit);
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveName);
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveName);
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
if(!scene_manager_search_and_switch_to_previous_scene(
|
||||||
|
subghz->scene_manager, SubGhzSceneStart)) {
|
||||||
|
scene_manager_stop(subghz->scene_manager);
|
||||||
|
view_dispatcher_stop(subghz->view_dispatcher);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if(event.event == SubmenuIndexDecode) {
|
} else if(event.event == SubmenuIndexDecode) {
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
subghz->scene_manager, SubGhzSceneMoreRAW, SubmenuIndexDecode);
|
subghz->scene_manager, SubGhzSceneMoreRAW, SubmenuIndexDecode);
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SubGhzCustomEventViewReadRAWMore:
|
case SubGhzCustomEventViewReadRAWMore:
|
||||||
|
if(subghz_file_available(subghz)) {
|
||||||
if(subghz_scene_read_raw_update_filename(subghz)) {
|
if(subghz_scene_read_raw_update_filename(subghz)) {
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerSet);
|
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerSet);
|
||||||
@@ -220,11 +221,18 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
} else {
|
} else {
|
||||||
furi_crash("SubGhz: RAW file name update error.");
|
furi_crash("SubGhz: RAW file name update error.");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if(!scene_manager_search_and_switch_to_previous_scene(
|
||||||
|
subghz->scene_manager, SubGhzSceneStart)) {
|
||||||
|
scene_manager_stop(subghz->scene_manager);
|
||||||
|
view_dispatcher_stop(subghz->view_dispatcher);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SubGhzCustomEventViewReadRAWSendStart:
|
case SubGhzCustomEventViewReadRAWSendStart:
|
||||||
|
|
||||||
if(subghz_scene_read_raw_update_filename(subghz)) {
|
if(subghz_file_available(subghz) && subghz_scene_read_raw_update_filename(subghz)) {
|
||||||
//start send
|
//start send
|
||||||
subghz->state_notifications = SubGhzNotificationStateIDLE;
|
subghz->state_notifications = SubGhzNotificationStateIDLE;
|
||||||
if(subghz->txrx->txrx_state == SubGhzTxRxStateRx) {
|
if(subghz->txrx->txrx_state == SubGhzTxRxStateRx) {
|
||||||
@@ -251,6 +259,12 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
subghz->state_notifications = SubGhzNotificationStateTx;
|
subghz->state_notifications = SubGhzNotificationStateTx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if(!scene_manager_search_and_switch_to_previous_scene(
|
||||||
|
subghz->scene_manager, SubGhzSceneStart)) {
|
||||||
|
scene_manager_stop(subghz->scene_manager);
|
||||||
|
view_dispatcher_stop(subghz->view_dispatcher);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
@@ -366,11 +380,17 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SubGhzCustomEventViewReadRAWSave:
|
case SubGhzCustomEventViewReadRAWSave:
|
||||||
if(subghz_scene_read_raw_update_filename(subghz)) {
|
if(subghz_file_available(subghz) && subghz_scene_read_raw_update_filename(subghz)) {
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerSetRAW);
|
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerSetRAW);
|
||||||
subghz->txrx->rx_key_state = SubGhzRxKeyStateBack;
|
subghz->txrx->rx_key_state = SubGhzRxKeyStateBack;
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveName);
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveName);
|
||||||
|
} else {
|
||||||
|
if(!scene_manager_search_and_switch_to_previous_scene(
|
||||||
|
subghz->scene_manager, SubGhzSceneStart)) {
|
||||||
|
scene_manager_stop(subghz->scene_manager);
|
||||||
|
view_dispatcher_stop(subghz->view_dispatcher);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -497,6 +497,23 @@ bool subghz_rename_file(SubGhz* subghz) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool subghz_file_available(SubGhz* subghz) {
|
||||||
|
furi_assert(subghz);
|
||||||
|
bool ret = true;
|
||||||
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||||
|
|
||||||
|
FS_Error fs_result =
|
||||||
|
storage_common_stat(storage, furi_string_get_cstr(subghz->file_path), NULL);
|
||||||
|
|
||||||
|
if(fs_result != FSE_OK) {
|
||||||
|
dialog_message_show_storage_error(subghz->dialogs, "File not available\n file/directory");
|
||||||
|
ret = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
furi_record_close(RECORD_STORAGE);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
bool subghz_delete_file(SubGhz* subghz) {
|
bool subghz_delete_file(SubGhz* subghz) {
|
||||||
furi_assert(subghz);
|
furi_assert(subghz);
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ bool subghz_save_protocol_to_file(
|
|||||||
const char* dev_file_name);
|
const char* dev_file_name);
|
||||||
bool subghz_load_protocol_from_file(SubGhz* subghz);
|
bool subghz_load_protocol_from_file(SubGhz* subghz);
|
||||||
bool subghz_rename_file(SubGhz* subghz);
|
bool subghz_rename_file(SubGhz* subghz);
|
||||||
|
bool subghz_file_available(SubGhz* subghz);
|
||||||
bool subghz_delete_file(SubGhz* subghz);
|
bool subghz_delete_file(SubGhz* subghz);
|
||||||
void subghz_file_name_clear(SubGhz* subghz);
|
void subghz_file_name_clear(SubGhz* subghz);
|
||||||
bool subghz_path_is_file(FuriString* path);
|
bool subghz_path_is_file(FuriString* path);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Key Combos
|
# Key Combos
|
||||||
|
|
||||||
There are times when your flipper feels blue and don't respond to your commands.
|
There are times when your flipper feels blue and doesn't respond to your commands.
|
||||||
In that case you may find this guide useful.
|
In that case, you may find this guide useful.
|
||||||
|
|
||||||
|
|
||||||
## Basic Combos
|
## Basic Combos
|
||||||
@@ -9,7 +9,7 @@ In that case you may find this guide useful.
|
|||||||
|
|
||||||
### Hardware Reset
|
### Hardware Reset
|
||||||
|
|
||||||
- Press `LEFT` and `BACK` and hold for couple seconds
|
- Press `LEFT` and `BACK` and hold for a couple of seconds
|
||||||
- Release `LEFT` and `BACK`
|
- Release `LEFT` and `BACK`
|
||||||
|
|
||||||
This combo performs hardware reset by pulling MCU reset line down.
|
This combo performs hardware reset by pulling MCU reset line down.
|
||||||
@@ -29,7 +29,7 @@ There is 1 case when it's not working:
|
|||||||
- If you have not disconnected USB, then disconnect USB and repeat previous step
|
- If you have not disconnected USB, then disconnect USB and repeat previous step
|
||||||
- Release `BACK` key
|
- Release `BACK` key
|
||||||
|
|
||||||
This combo performs reset by switching SYS power line off and then on.
|
This combo performs a reset by switching SYS power line off and then on.
|
||||||
Main components involved: Keys -> DD6(bq25896, charger)
|
Main components involved: Keys -> DD6(bq25896, charger)
|
||||||
|
|
||||||
There is 1 case when it's not working:
|
There is 1 case when it's not working:
|
||||||
@@ -60,13 +60,13 @@ There is 1 case when it's not working:
|
|||||||
|
|
||||||
### Hardware Reset + Software DFU
|
### Hardware Reset + Software DFU
|
||||||
|
|
||||||
- Press `LEFT` and `BACK` and hold for couple seconds
|
- Press `LEFT` and `BACK` and hold for a couple of seconds
|
||||||
- Release `BACK`
|
- Release `BACK`
|
||||||
- Device will enter DFU with indication (Blue LED + DFU Screen)
|
- Device will enter DFU with indication (Blue LED + DFU Screen)
|
||||||
- Release `LEFT`
|
- Release `LEFT`
|
||||||
|
|
||||||
This combo performs hardware reset by pulling MCU reset line down.
|
This combo performs hardware reset by pulling MCU reset line down.
|
||||||
Then `LEFT` key indicates to boot-loader that DFU mode requested.
|
Then `LEFT` key indicates to boot-loader that DFU mode is requested.
|
||||||
|
|
||||||
There are 2 cases when it's not working:
|
There are 2 cases when it's not working:
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ There are 2 cases when it's not working:
|
|||||||
|
|
||||||
### Hardware Reset + Hardware DFU
|
### Hardware Reset + Hardware DFU
|
||||||
|
|
||||||
- Press `LEFT` and `BACK` and `OK` and hold for couple seconds
|
- Press `LEFT` and `BACK` and `OK` and hold for a couple of seconds
|
||||||
- Release `BACK` and `LEFT`
|
- Release `BACK` and `LEFT`
|
||||||
- Device will enter DFU without indication
|
- Device will enter DFU without indication
|
||||||
|
|
||||||
@@ -127,8 +127,8 @@ There are 2 cases when it's not working:
|
|||||||
|
|
||||||
If none of the described methods were useful:
|
If none of the described methods were useful:
|
||||||
|
|
||||||
- Ensure battery charged
|
- Ensure the battery charged
|
||||||
- Disconnect battery and connect again (Requires disassembly)
|
- Disconnect the battery and connect again (Requires disassembly)
|
||||||
- Try to Flash device with ST-Link or other programmer that support SWD
|
- Try to Flash device with ST-Link or other programmer that supports SWD
|
||||||
|
|
||||||
If you still here and your device is not working: it's not software issue.
|
If you still here and your device is not working: it's not a software issue.
|
||||||
|
|||||||
Reference in New Issue
Block a user