From a2959a3506bf7701422b486d94c059bc5731ebd7 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Fri, 18 Sep 2015 14:30:25 +0200 Subject: [PATCH] Simpler, though not necessary better. --- extdrv/cc1101.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extdrv/cc1101.c b/extdrv/cc1101.c index 36d269a..8a54365 100644 --- a/extdrv/cc1101.c +++ b/extdrv/cc1101.c @@ -159,12 +159,11 @@ void cc1101_enter_rx_mode(void) static uint8_t cc1101_enter_tx_mode(void) { uint8_t status = (cc1101_read_status() & CC1101_STATE_MASK); - if (status != CC1101_STATE_TX) { - if ((status != CC1101_STATE_FSTON) && (status != CC1101_STATE_RX)) { + if (status > CC1101_STATE_FSTON) { cc1101_send_cmd(CC1101_CMD(state_idle)); - } - cc1101_send_cmd(CC1101_CMD(state_tx)); } + cc1101_send_cmd(CC1101_CMD(state_tx)); + /* Wait until chip is in Tx state */ do { status = (cc1101_read_status() & CC1101_STATE_MASK); -- 2.43.0