Skip to content

Commit

Permalink
Suppress charging to improve RF performances.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jan 19, 2023
1 parent 736421d commit 2bf380d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ ProtoViewApp* protoview_app_alloc() {
void protoview_app_free(ProtoViewApp *app) {
furi_assert(app);

// Put CC1101 on sleep.
// Put CC1101 on sleep, this also restores charging.
radio_sleep(app);

// View related.
Expand Down
10 changes: 5 additions & 5 deletions app_subghz.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ void radio_begin(ProtoViewApp* app) {
furi_hal_subghz_reset();
furi_hal_subghz_idle();

/* Power circuits are noisy. Suppressing the charge while we use
* ProtoView will improve the RF performances. */
furi_hal_power_suppress_charge_enter();

/* The CC1101 preset can be either one of the standard presets, if
* the modulation "custom" field is NULL, or a custom preset we
* defined in custom_presets.h. */
Expand Down Expand Up @@ -105,7 +109,7 @@ void radio_sleep(ProtoViewApp* app) {
}
furi_hal_subghz_sleep();
app->txrx->txrx_state = TxRxStateSleep;

furi_hal_power_suppress_charge_exit();
}

/* =============================== Transmission ============================= */
Expand All @@ -117,8 +121,6 @@ void radio_tx_signal(ProtoViewApp *app, FuriHalSubGhzAsyncTxCallback data_feeder
TxRxState oldstate = app->txrx->txrx_state;

if (oldstate == TxRxStateRx) radio_rx_end(app);
// furi_hal_power_suppress_charge_enter();

radio_begin(app);

furi_hal_subghz_idle();
Expand All @@ -132,8 +134,6 @@ void radio_tx_signal(ProtoViewApp *app, FuriHalSubGhzAsyncTxCallback data_feeder
furi_hal_subghz_stop_async_tx();
furi_hal_subghz_idle();

// furi_hal_power_suppress_charge_exit();

radio_begin(app);
if (oldstate == TxRxStateRx) radio_rx(app);
}
Expand Down

0 comments on commit 2bf380d

Please sign in to comment.