mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
SubGhz: remove direct reading
This commit is contained in:
@@ -42,7 +42,7 @@ bool subghz_scene_rpc_on_event(void* context, SceneManagerEvent event) {
|
||||
view_dispatcher_stop(subghz->view_dispatcher);
|
||||
} else if(event.event == SubGhzCustomEventSceneRpcButtonPress) {
|
||||
bool result = false;
|
||||
if((subghz->txrx->txrx_state == SubGhzTxRxStateSleep) &&
|
||||
if((subghz_txrx_get_state(subghz) == SubGhzTxRxStateSleep) &&
|
||||
(state == SubGhzRpcStateLoaded)) {
|
||||
result = subghz_tx_start(subghz, subghz->txrx->fff_data);
|
||||
if(result) subghz_blink_start(subghz);
|
||||
@@ -56,10 +56,9 @@ bool subghz_scene_rpc_on_event(void* context, SceneManagerEvent event) {
|
||||
rpc_system_app_confirm(subghz->rpc_ctx, RpcAppEventButtonPress, result);
|
||||
} else if(event.event == SubGhzCustomEventSceneRpcButtonRelease) {
|
||||
bool result = false;
|
||||
if(subghz->txrx->txrx_state == SubGhzTxRxStateTx) {
|
||||
if(subghz_txrx_get_state(subghz) == SubGhzTxRxStateTx) {
|
||||
subghz_txrx_stop(subghz);
|
||||
subghz_blink_stop(subghz);
|
||||
subghz_tx_stop(subghz);
|
||||
subghz_sleep(subghz);
|
||||
result = true;
|
||||
}
|
||||
rpc_system_app_confirm(subghz->rpc_ctx, RpcAppEventButtonRelease, result);
|
||||
@@ -97,9 +96,8 @@ bool subghz_scene_rpc_on_event(void* context, SceneManagerEvent event) {
|
||||
void subghz_scene_rpc_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
if(subghz->txrx->txrx_state == SubGhzTxRxStateTx) {
|
||||
subghz_tx_stop(subghz);
|
||||
subghz_sleep(subghz);
|
||||
if(subghz_txrx_get_state(subghz) == SubGhzTxRxStateTx) {
|
||||
subghz_txrx_stop(subghz);
|
||||
subghz_blink_stop(subghz);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user