Skip to content

Commit

Permalink
Updates for interrupted transmission
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lee committed Jan 4, 2024
1 parent 215b772 commit 6be3d60
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
10 changes: 10 additions & 0 deletions scenes/meal_pager_scene_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ bool meal_pager_scene_menu_on_event(void* context, SceneManagerEvent event) {
app->scene_manager, Meal_PagerSceneMenu, SubmenuIndexSettings);
scene_manager_next_scene(app->scene_manager, Meal_PagerSceneSettings);
return true;
} else if (event.event == Meal_PagerCustomEventViewTransmitterSendStop) {
app->state_notifications = SubGhzNotificationStateIDLE;
subghz_txrx_stop(app->subghz->txrx);
FURI_LOG_D(TAG, "Stop Event from Menu");
return true;
}
} else if(event.type == SceneManagerEventTypeTick) {
if(app->state_notifications == SubGhzNotificationStateTx) {
notification_message(app->notification, &sequence_blink_magenta_10);
}
return true;
}
return false;
}
Expand Down
15 changes: 9 additions & 6 deletions scenes/meal_pager_scene_transmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ void meal_pager_scene_transmit_on_enter(void* context) {
FURI_LOG_D(TAG, "Generated tmp.sub");
//meal_pager_blink_start_subghz(app);
FURI_LOG_D(TAG, "Start Transmitting");
subghz_send(app);

if (!app->stop_transmit) {
subghz_send(app);
}
dolphin_deed(DolphinDeedSubGhzSend);
//FURI_LOG_D(TAG, "Finished Transmitting");
//meal_pager_blink_stop(app);
Expand All @@ -54,10 +55,9 @@ bool meal_pager_scene_transmit_on_event(void* context, SceneManagerEvent event)
case Meal_PagerCustomEventTransmitDown:
break;
case Meal_PagerCustomEventTransmitBack:
notification_message(app->notification, &sequence_reset_red);
notification_message(app->notification, &sequence_reset_green);
notification_message(app->notification, &sequence_reset_blue);
app->stop_transmit = true;
app->state_notifications = SubGhzNotificationStateIDLE;
meal_pager_blink_stop(app);
if(!scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, Meal_PagerSceneMenu)) {
scene_manager_stop(app->scene_manager);
Expand All @@ -75,7 +75,10 @@ bool meal_pager_scene_transmit_on_event(void* context, SceneManagerEvent event)
}
} else if(event.type == SceneManagerEventTypeTick) {
if(app->state_notifications == SubGhzNotificationStateTx) {
notification_message(app->notification, &sequence_blink_magenta_10);
app->state_notifications = SubGhzNotificationStateIDLE;
subghz_txrx_stop(app->subghz->txrx);
meal_pager_blink_stop(app);
//notification_message(app->notification, &sequence_blink_magenta_10);
}
return true;
}
Expand Down
5 changes: 3 additions & 2 deletions views/meal_pager_transmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ void meal_pager_transmit_draw(Canvas* canvas, Meal_PagerTransmitModel* model) {
snprintf(pagerText, 20, "Pager: %lu", model->pager);
canvas_draw_str_aligned(canvas, 0, 10, AlignLeft, AlignTop, pager_type_text_long[model->pager_type]);
canvas_set_font(canvas, FontSecondary);
canvas_draw_str_aligned(canvas, 0, 22, AlignLeft, AlignTop, stationText);
canvas_draw_str_aligned(canvas, 0, 32, AlignLeft, AlignTop, pagerText);
canvas_draw_str_aligned(canvas, 0, 22, AlignLeft, AlignTop, "Generating Data");
canvas_draw_str_aligned(canvas, 0, 32, AlignLeft, AlignTop, stationText);
canvas_draw_str_aligned(canvas, 0, 42, AlignLeft, AlignTop, pagerText);
}

static void meal_pager_transmit_model_init(Meal_PagerTransmitModel* const model) {
Expand Down

0 comments on commit 6be3d60

Please sign in to comment.