mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2025-02-17 05:48:33 +00:00
Fix very old and funny subghz bugs
Fixed Frequency Ananyzer issues Fixed read mode issues Fixed re-inits in HAL
This commit is contained in:
parent
87a023c75d
commit
ab669b26da
5 changed files with 18 additions and 4 deletions
|
@ -103,5 +103,8 @@ typedef enum {
|
|||
SubGhzCustomEventViewTransmitterSendStop,
|
||||
SubGhzCustomEventViewTransmitterError,
|
||||
|
||||
SubGhzCustomEventViewFreqAnalOkShort,
|
||||
SubGhzCustomEventViewFreqAnalOkLong,
|
||||
|
||||
SubGhzCustomEventByteInputDone,
|
||||
} SubGhzCustomEvent;
|
||||
|
|
|
@ -54,7 +54,7 @@ bool subghz_scene_frequency_analyzer_on_event(void* context, SceneManagerEvent e
|
|||
} else if(event.event == SubGhzCustomEventSceneAnalyzerUnlock) {
|
||||
notification_message(subghz->notifications, &sequence_reset_rgb);
|
||||
return true;
|
||||
} else if(event.event == SubGhzCustomEventViewReceiverOK) {
|
||||
} else if(event.event == SubGhzCustomEventViewFreqAnalOkShort) {
|
||||
notification_message(subghz->notifications, &sequence_saved);
|
||||
uint32_t frequency =
|
||||
subghz_frequency_analyzer_get_frequency_to_save(subghz->subghz_frequency_analyzer);
|
||||
|
@ -64,11 +64,12 @@ bool subghz_scene_frequency_analyzer_on_event(void* context, SceneManagerEvent e
|
|||
}
|
||||
|
||||
return true;
|
||||
} else if(event.event == SubGhzCustomEventViewReceiverUnlock) {
|
||||
} else if(event.event == SubGhzCustomEventViewFreqAnalOkLong) {
|
||||
// Don't need to save, we already saved on short event
|
||||
#ifdef FURI_DEBUG
|
||||
FURI_LOG_W(TAG, "Goto next scene!");
|
||||
#endif
|
||||
//scene_manager_set_scene_state(subghz->scene_manager, SubGhzSceneStart, 10);
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReceiver);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -125,6 +125,11 @@ uint8_t subghz_history_get_type_protocol(SubGhzHistory* instance, uint16_t idx)
|
|||
const char* subghz_history_get_protocol_name(SubGhzHistory* instance, uint16_t idx) {
|
||||
furi_assert(instance);
|
||||
SubGhzHistoryItem* item = SubGhzHistoryItemArray_get(instance->history->data, idx);
|
||||
if(!item || !item->flipper_string) {
|
||||
FURI_LOG_E(TAG, "Missing Item");
|
||||
furi_string_reset(instance->tmp_string);
|
||||
return furi_string_get_cstr(instance->tmp_string);
|
||||
}
|
||||
flipper_format_rewind(item->flipper_string);
|
||||
if(!flipper_format_read_string(item->flipper_string, "Protocol", instance->tmp_string)) {
|
||||
FURI_LOG_E(TAG, "Missing Protocol");
|
||||
|
|
|
@ -372,7 +372,7 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
|
|||
#endif
|
||||
|
||||
if(updated) {
|
||||
instance->callback(SubGhzCustomEventViewReceiverOK, instance->context);
|
||||
instance->callback(SubGhzCustomEventViewFreqAnalOkShort, instance->context);
|
||||
}
|
||||
|
||||
// First device receive short, then when user release button we get long
|
||||
|
@ -385,7 +385,7 @@ bool subghz_frequency_analyzer_input(InputEvent* event, void* context) {
|
|||
subghz_frequency_analyzer_worker_stop(instance->worker);
|
||||
}
|
||||
|
||||
instance->callback(SubGhzCustomEventViewReceiverUnlock, instance->context);
|
||||
instance->callback(SubGhzCustomEventViewFreqAnalOkLong, instance->context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,11 @@ void furi_hal_subghz_select_radio_type(SubGhzRadioType state) {
|
|||
}
|
||||
|
||||
bool furi_hal_subghz_init_radio_type(SubGhzRadioType state) {
|
||||
if(state == SubGhzRadioInternal && furi_hal_subghz.cc1101_g0_pin == &gpio_cc1101_g0) {
|
||||
return true;
|
||||
} else if(state == SubGhzRadioExternal && furi_hal_subghz.cc1101_g0_pin == &gpio_cc1101_g0_ext) {
|
||||
return true;
|
||||
}
|
||||
furi_hal_spi_bus_handle_deinit(furi_hal_subghz.spi_bus_handle);
|
||||
|
||||
if(state == SubGhzRadioInternal) {
|
||||
|
|
Loading…
Add table
Reference in a new issue