From: Nathael Pajani Date: Fri, 18 Sep 2015 12:30:25 +0000 (+0200) Subject: Simpler, though not necessary better. X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=a2959a3506bf7701422b486d94c059bc5731ebd7;p=soft%2Flpc122x%2Fcore Simpler, though not necessary better. --- 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);