Fix repeater/fav timer things

This commit is contained in:
Willy-JL
2023-12-14 00:52:51 +00:00
parent 36c46fd626
commit dfcc1beed4
5 changed files with 10 additions and 26 deletions

View File

@@ -130,15 +130,6 @@ void subghz_scene_read_raw_on_enter(void* context) {
if(subghz->fav_timeout) {
scene_manager_handle_custom_event(
subghz->scene_manager, SubGhzCustomEventViewReadRAWSendStart);
// with_view_model(
// subghz->subghz_read_raw->view,
// SubGhzReadRAWModel * model,
// {
// scene_manager_handle_custom_event(
// subghz->scene_manager, SubGhzCustomEventViewReadRAWSendStart);
// model->status = SubGhzReadRAWStatusTXRepeat;
// },
// true);
}
}

View File

@@ -112,7 +112,6 @@ void subghz_scene_receiver_callback(SubGhzCustomEvent event, void* context) {
void repeater_stop_callback(void* context) {
SubGhz* subghz = context;
furi_timer_stop(subghz->fav_timer);
scene_manager_handle_custom_event(subghz->scene_manager, SubGhzCustomEventViewRepeaterStop);
}
@@ -265,7 +264,8 @@ void subghz_scene_receiver_on_enter(void* context) {
SubGhzSpeakerStateShutdown);
//Set up a timer for the repeater (recycled favorites timeout TX timer!).
subghz->fav_timer = furi_timer_alloc(repeater_stop_callback, FuriTimerTypePeriodic, subghz);
if(!subghz->timer)
subghz->timer = furi_timer_alloc(repeater_stop_callback, FuriTimerTypeOnce, subghz);
//Remember if the repeater was loaded, and do cleanups we need.
subghz->repeater = subghz->last_settings->repeater_state;
@@ -386,7 +386,7 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
((subghz->repeater & SubGhzRepeaterStateOnShort) != 0) ?
1 * tmpTe :
repeatnormal * tmpTe;
furi_timer_start(subghz->fav_timer, repeat_time);
furi_timer_start(subghz->timer, repeat_time);
}
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateTX);
break;

View File

@@ -70,19 +70,12 @@ void subghz_scene_transmitter_on_enter(void* context) {
// Auto send and exit with favorites
if(subghz->fav_timeout) {
// subghz_custom_btn_set(0);
furi_check(!subghz->timer, "SubGhz fav timer exists");
subghz->timer = furi_timer_alloc(fav_timer_callback, FuriTimerTypeOnce, subghz);
scene_manager_handle_custom_event(
subghz->scene_manager, SubGhzCustomEventViewTransmitterSendStart);
// with_view_model(
// subghz->subghz_transmitter->view,
// SubGhzViewTransmitterModel * model,
// { model->show_button = false; },
// true);
subghz->fav_timer = furi_timer_alloc(fav_timer_callback, FuriTimerTypeOnce, subghz);
furi_timer_start(
subghz->fav_timer,
xtreme_settings.favorite_timeout * furi_kernel_get_tick_frequency());
// subghz->state_notifications = SubGhzNotificationStateTx;
subghz->timer, xtreme_settings.favorite_timeout * furi_kernel_get_tick_frequency());
}
}

View File

@@ -429,9 +429,9 @@ int32_t subghz_app(char* p) {
view_dispatcher_run(subghz->view_dispatcher);
if(subghz->fav_timer) {
furi_timer_stop(subghz->fav_timer);
furi_timer_free(subghz->fav_timer);
if(subghz->timer) {
furi_timer_stop(subghz->timer);
furi_timer_free(subghz->timer);
}
furi_hal_power_suppress_charge_exit();

View File

@@ -103,7 +103,7 @@ struct SubGhz {
SubGhzLoadTypeFile load_type_file;
bool fav_timeout;
FuriTimer* fav_timer;
FuriTimer* timer;
void* rpc_ctx;
};