Simplify MODESEL value determination

This commit is contained in:
George Oikonomou 2016-06-26 01:02:10 +01:00
parent 9839b91be5
commit dc1f9fe010

View File

@ -371,27 +371,18 @@ uint8_t
rf_core_set_modesel() rf_core_set_modesel()
{ {
uint8_t rv = RF_CORE_CMD_ERROR; uint8_t rv = RF_CORE_CMD_ERROR;
ChipType_t chip_type = ti_lib_chipinfo_get_chip_type();
if(ti_lib_chipinfo_chip_family_is_cc26xx()) { if(chip_type == CHIP_TYPE_CC2650) {
if(ti_lib_chipinfo_supports_ble() == true &&
ti_lib_chipinfo_supports_ieee_802_15_4() == true) {
/* CC2650 */
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE5; HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE5;
rv = RF_CORE_CMD_OK; rv = RF_CORE_CMD_OK;
} else if(ti_lib_chipinfo_supports_ble() == false && } else if(chip_type == CHIP_TYPE_CC2630) {
ti_lib_chipinfo_supports_ieee_802_15_4() == true) {
/* CC2630 */
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE2; HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE2;
rv = RF_CORE_CMD_OK; rv = RF_CORE_CMD_OK;
} } else if(chip_type == CHIP_TYPE_CC1310) {
} else if(ti_lib_chipinfo_chip_family_is_cc13xx()) {
if(ti_lib_chipinfo_supports_ble() == false &&
ti_lib_chipinfo_supports_ieee_802_15_4() == false) {
/* CC1310 */
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE3; HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE3;
rv = RF_CORE_CMD_OK; rv = RF_CORE_CMD_OK;
} }
}
return rv; return rv;
} }