-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: beagle: beagleconnect_freedom: Fix formatting
- Fix formatting in board_antenna.c by using the standard config in Zephyr. - Reduce diff with cc1352p1_launchxl/board_antenna.c as much as possible Signed-off-by: Ayush Singh <[email protected]>
- Loading branch information
Showing
1 changed file
with
13 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
/* | ||
* Copyright (c) 2021 Florin Stancu | ||
* Copyright (c) 2021 Jason Kridner, BeagleBoard.org Foundation | ||
* Copyright (c) 2024 Ayush Singh <[email protected]> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* | ||
|
@@ -33,14 +33,13 @@ static int board_antenna_init(const struct device *dev); | |
static void board_cc13xx_rf_callback(RF_Handle client, RF_GlobalEvent events, void *arg); | ||
|
||
const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = { | ||
.hwiPriority = INT_PRI_LEVEL7, | ||
.swiPriority = 0, | ||
.hwiPriority = INT_PRI_LEVEL7, | ||
.swiPriority = 0, | ||
.xoscHfAlwaysNeeded = true, | ||
/* RF driver callback for custom antenna switching */ | ||
.globalCallback = board_cc13xx_rf_callback, | ||
/* Subscribe to events */ | ||
.globalEventMask = (RF_GlobalEventRadioSetup | | ||
RF_GlobalEventRadioPowerDown), | ||
.globalEventMask = (RF_GlobalEventRadioSetup | RF_GlobalEventRadioPowerDown), | ||
}; | ||
|
||
PINCTRL_DT_INST_DEFINE(0); | ||
|
@@ -49,7 +48,7 @@ DEVICE_DT_INST_DEFINE(0, board_antenna_init, NULL, NULL, NULL, POST_KERNEL, | |
|
||
static const struct pinctrl_dev_config *ant_pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0); | ||
static const struct gpio_dt_spec ant_gpios[] = { | ||
DT_FOREACH_PROP_ELEM_SEP(DT_NODELABEL(antenna_mux0), gpios, GPIO_DT_SPEC_GET_BY_IDX, (,))}; | ||
DT_FOREACH_PROP_ELEM_SEP(DT_NODELABEL(antenna_mux0), gpios, GPIO_DT_SPEC_GET_BY_IDX, (, ))}; | ||
|
||
/** | ||
* Antenna switch GPIO init routine. | ||
|
@@ -73,7 +72,7 @@ static int board_antenna_init(const struct device *dev) | |
*/ | ||
static void board_cc13xx_rf_callback(RF_Handle client, RF_GlobalEvent events, void *arg) | ||
{ | ||
bool sub1GHz = false; | ||
bool sub1GHz = false; | ||
uint8_t loDivider = 0; | ||
int i; | ||
|
||
|
@@ -84,28 +83,23 @@ static void board_cc13xx_rf_callback(RF_Handle client, RF_GlobalEvent events, vo | |
|
||
if (events & RF_GlobalEventRadioSetup) { | ||
/* Decode the current PA configuration. */ | ||
RF_TxPowerTable_PAType paType = (RF_TxPowerTable_PAType) | ||
RF_getTxPower(client).paType; | ||
RF_TxPowerTable_PAType paType = | ||
(RF_TxPowerTable_PAType)RF_getTxPower(client).paType; | ||
/* Decode the generic argument as a setup command. */ | ||
RF_RadioSetup *setupCommand = (RF_RadioSetup *)arg; | ||
|
||
switch (setupCommand->common.commandNo) { | ||
case (CMD_RADIO_SETUP): | ||
case (CMD_BLE5_RADIO_SETUP): | ||
case CMD_RADIO_SETUP: | ||
case CMD_BLE5_RADIO_SETUP: | ||
loDivider = RF_LODIVIDER_MASK & setupCommand->common.loDivider; | ||
/* Sub-1GHz front-end. */ | ||
if (loDivider != 0) | ||
sub1GHz = true; | ||
break; | ||
case (CMD_PROP_RADIO_DIV_SETUP): | ||
case CMD_PROP_RADIO_DIV_SETUP: | ||
loDivider = RF_LODIVIDER_MASK & setupCommand->prop_div.loDivider; | ||
/* Sub-1GHz front-end. */ | ||
if (loDivider != 0) | ||
sub1GHz = true; | ||
break; | ||
default: | ||
break; | ||
} | ||
sub1GHz = (loDivider != 0); | ||
|
||
if (sub1GHz) { | ||
if (paType == RF_TxPowerTable_HighPA) { | ||
|