From f8e866c65ccd0db26b0ad4f809ddcb30055fd857 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Wed, 31 Jan 2018 18:27:35 -0800 Subject: [PATCH] [code-style] disable formatting in code blocks --- examples/platforms/cc2538/cc2538-reg.h | 4 +++ examples/platforms/cc2538/radio.c | 28 +++++++-------- examples/platforms/cc2538/rom-utility.h | 6 +++- examples/platforms/cc2538/startup-gcc.c | 20 +++++++---- examples/platforms/cc2538/uart.c | 1 + examples/platforms/cc2650/cc2650_ccfg.c | 4 +++ examples/platforms/cc2650/radio.c | 12 +++++++ examples/platforms/cc2652/cc2652_ccfg.c | 4 +++ examples/platforms/cc2652/radio.c | 12 +++++++ .../platforms/da15000/custom_config_qspi.h | 4 +++ examples/platforms/da15000/platform.c | 2 ++ examples/platforms/da15000/radio.c | 2 ++ examples/platforms/da15000/uart.c | 2 ++ examples/platforms/efr32/flash.c | 2 ++ examples/platforms/efr32/radio.c | 18 +++++----- examples/platforms/efr32/startup-gcc.c | 4 +++ examples/platforms/kw41z/radio.c | 36 ++++++++++--------- examples/platforms/nrf52840/alarm.c | 6 ++-- examples/platforms/nrf52840/platform-fem.h | 4 ++- examples/platforms/nrf52840/radio.c | 4 +++ 20 files changed, 125 insertions(+), 50 deletions(-) diff --git a/examples/platforms/cc2538/cc2538-reg.h b/examples/platforms/cc2538/cc2538-reg.h index 960bb2722..3e36bebc7 100644 --- a/examples/platforms/cc2538/cc2538-reg.h +++ b/examples/platforms/cc2538/cc2538-reg.h @@ -37,6 +37,8 @@ #include +// clang-format off + #define HWREG(x) (*((volatile uint32_t *)(x))) #define NVIC_ST_CTRL 0xE000E010 // SysTick Control and Status @@ -218,4 +220,6 @@ #define FLASH_CTRL_FCTL 0x400D3008 // Flash control #define FLASH_CTRL_DIECFG0 0x400D3014 // Flash information +// clang-format on + #endif diff --git a/examples/platforms/cc2538/radio.c b/examples/platforms/cc2538/radio.c index b2f745b83..7500b6e7e 100644 --- a/examples/platforms/cc2538/radio.c +++ b/examples/platforms/cc2538/radio.c @@ -75,20 +75,20 @@ typedef struct TxPowerTable // The transmit power table, the values are from SmartRF Studio 2.4.0 static const TxPowerTable sTxPowerTable[] = { - { 7, 0xFF }, - { 5, 0xED }, - { 3, 0xD5 }, - { 1, 0xC5 }, - { 0, 0xB6 }, - { -1, 0xB0 }, - { -3, 0xA1 }, - { -5, 0x91 }, - { -7, 0x88 }, - { -9, 0x72 }, - { -11, 0x62 }, - { -13, 0x58 }, - { -15, 0x42 }, - { -24, 0x00 }, + { 7, 0xFF }, // + { 5, 0xED }, // + { 3, 0xD5 }, // + { 1, 0xC5 }, // + { 0, 0xB6 }, // + { -1, 0xB0 }, // + { -3, 0xA1 }, // + { -5, 0x91 }, // + { -7, 0x88 }, // + { -9, 0x72 }, // + { -11, 0x62 }, // + { -13, 0x58 }, // + { -15, 0x42 }, // + { -24, 0x00 }, // }; static otRadioFrame sTransmitFrame; diff --git a/examples/platforms/cc2538/rom-utility.h b/examples/platforms/cc2538/rom-utility.h index 05982367d..45fc67a92 100644 --- a/examples/platforms/cc2538/rom-utility.h +++ b/examples/platforms/cc2538/rom-utility.h @@ -56,7 +56,9 @@ typedef struct FPTR_MEMMOVE_T memmove; } ROM_API_T; -#define P_ROM_API ((ROM_API_T*) ROM_API_TABLE_ADDR) +// clang-format off + +#define P_ROM_API ((ROM_API_T*)ROM_API_TABLE_ADDR) #define ROM_Crc32(a,b) P_ROM_API->Crc32(a,b) #define ROM_GetFlashSize() P_ROM_API->GetFlashSize() @@ -69,4 +71,6 @@ typedef struct #define ROM_Memcmp(a,b,c) P_ROM_API->memcmp(a,b,c) #define ROM_Memmove(a,b,c) P_ROM_API->memmove(a,b,c) +// clang-format on + #endif // ROM_UTILITY_H_ diff --git a/examples/platforms/cc2538/startup-gcc.c b/examples/platforms/cc2538/startup-gcc.c index 67f280597..3f1fc174e 100644 --- a/examples/platforms/cc2538/startup-gcc.c +++ b/examples/platforms/cc2538/startup-gcc.c @@ -45,9 +45,13 @@ extern uint8_t _init_array; extern uint8_t _einit_array; __extension__ typedef int __guard __attribute__((mode(__DI__))); + int __cxa_guard_acquire(__guard *g) { return !*(char *)(g); } + void __cxa_guard_release(__guard *g) { *(char *)g = 1; } + void __cxa_guard_abort(__guard *g) { (void)g; } + void __cxa_pure_virtual(void) { while (1); } void IntDefaultHandler(void); @@ -135,15 +139,19 @@ void IntDefaultHandler(void) while (1); } -#define FLASH_CCA_BOOTLDR_CFG_DISABLE 0xEFFFFFFF ///< Disable backdoor function -#define FLASH_CCA_BOOTLDR_CFG_ENABLE 0xF0FFFFFF ///< Enable backdoor function -#define FLASH_CCA_BOOTLDR_CFG_ACTIVE_HIGH 0x08000000 ///< Selected pin on pad A active high -#define FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_M 0x07000000 ///< Selected pin on pad A mask -#define FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_S 24 ///< Selected pin on pad A shift -#define FLASH_CCA_IMAGE_VALID 0x00000000 ///< Indicates valid image in flash +// clang-format off + +#define FLASH_CCA_BOOTLDR_CFG_DISABLE 0xEFFFFFFF ///< Disable backdoor function +#define FLASH_CCA_BOOTLDR_CFG_ENABLE 0xF0FFFFFF ///< Enable backdoor function +#define FLASH_CCA_BOOTLDR_CFG_ACTIVE_HIGH 0x08000000 ///< Selected pin on pad A active high +#define FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_M 0x07000000 ///< Selected pin on pad A mask +#define FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_S 24 ///< Selected pin on pad A shift +#define FLASH_CCA_IMAGE_VALID 0x00000000 ///< Indicates valid image in flash #define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN 3 ///< Select Button on SmartRF06 Eval Board +// clang-format on + typedef struct { uint32_t ui32BootldrCfg; diff --git a/examples/platforms/cc2538/uart.c b/examples/platforms/cc2538/uart.c index 2979bb6a6..776b40ca1 100644 --- a/examples/platforms/cc2538/uart.c +++ b/examples/platforms/cc2538/uart.c @@ -297,6 +297,7 @@ void cc2538DebugUartInit(void) b = (((kPlatformClock * 8) / kBaudRate) + 1) / 2; a = b / 64; b = b % 64; + HWREG(UART1_BASE + UART_O_IBRD) = a; HWREG(UART1_BASE + UART_O_FBRD) = b; HWREG(UART1_BASE + UART_O_LCRH) = UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE; diff --git a/examples/platforms/cc2650/cc2650_ccfg.c b/examples/platforms/cc2650/cc2650_ccfg.c index e81fa474f..1470ba6ff 100644 --- a/examples/platforms/cc2650/cc2650_ccfg.c +++ b/examples/platforms/cc2650/cc2650_ccfg.c @@ -30,6 +30,8 @@ * Configure the Customer Configuration Area. */ +// clang-format off + // enable bootloader backdoor #define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 // Enable ROM boot loader @@ -46,3 +48,5 @@ * Include the default ccfg struct and configuration code. */ #include + +// clang-format on diff --git a/examples/platforms/cc2650/radio.c b/examples/platforms/cc2650/radio.c index b093da69c..c8a5a9e45 100644 --- a/examples/platforms/cc2650/radio.c +++ b/examples/platforms/cc2650/radio.c @@ -95,6 +95,7 @@ static uint32_t sRatOffset = 0; /* * Radio command structures that run on the CM0. */ +// clang-format off static volatile __attribute__((aligned(4))) rfc_CMD_SYNC_START_RAT_t sStartRatCmd; static volatile __attribute__((aligned(4))) rfc_CMD_RADIO_SETUP_t sRadioSetupCmd; @@ -115,6 +116,7 @@ static volatile __attribute__((aligned(4))) rfc_CMD_IEEE_RX_ACK_t sTransm static volatile __attribute__((aligned(4))) ext_src_match_data_t sSrcMatchExtData; static volatile __attribute__((aligned(4))) short_src_match_data_t sSrcMatchShortData; +// clang-format on /* * Structure containing radio statistics. @@ -176,6 +178,7 @@ static void rfCoreInitBufs(void) */ static void rfCoreInitReceiveParams(void) { + // clang-format off static const rfc_CMD_IEEE_RX_t cReceiveCmd = { .commandNo = CMD_IEEE_RX, @@ -241,6 +244,7 @@ static void rfCoreInitReceiveParams(void) }, .endTime = 0u, }; + // clang-format on sReceiveCmd = cReceiveCmd; sReceiveCmd.pRxQ = &sRxDataQueue; @@ -524,6 +528,7 @@ static uint8_t rfCoreFindEmptyExtSrcMatchIdx(void) */ static uint_fast8_t rfCoreSendTransmitCmd(uint8_t *aPsdu, uint8_t aLen) { + // clang-format off static const rfc_CMD_IEEE_CSMA_t cCsmacaBackoffCmd = { .commandNo = CMD_IEEE_CSMA, @@ -585,6 +590,7 @@ static uint_fast8_t rfCoreSendTransmitCmd(uint8_t *aPsdu, uint8_t aLen) /* number of RAT ticks to wait before claiming we haven't received an ack */ .endTime = ((IEEE802154_MAC_ACK_WAIT_DURATION * CC2650_RAT_TICKS_PER_SEC) / IEEE802154_SYMBOLS_PER_SEC), }; + // clang-format on /* reset retry count */ sTransmitRetryCount = 0; @@ -634,6 +640,7 @@ static uint_fast8_t rfCoreSendReceiveCmd(void) static uint_fast8_t rfCoreSendEdScanCmd(uint8_t aChannel, uint16_t aDurration) { + // clang-format off static const rfc_CMD_IEEE_ED_SCAN_t cEdScanCmd = { .commandNo = CMD_IEEE_ED_SCAN, @@ -660,6 +667,7 @@ static uint_fast8_t rfCoreSendEdScanCmd(uint8_t aChannel, uint16_t aDurration) .pastTrig = 1, }, }; + // clang-format on sEdScanCmd = cEdScanCmd; sEdScanCmd.channel = aChannel; @@ -876,6 +884,7 @@ static uint_fast16_t rfCoreSendEnableCmd(void) bool interruptsWereDisabled; uint_fast16_t ret; + // clang-format off static const rfc_CMD_SYNC_START_RAT_t cStartRatCmd = { .commandNo = CMD_SYNC_START_RAT, @@ -899,6 +908,7 @@ static uint_fast16_t rfCoreSendEnableCmd(void) }, .mode = 1, // IEEE 802.15.4 mode }; + // clang-format on /* turn on the clock line to the radio core */ HWREGBITW(AON_RTC_BASE + AON_RTC_O_CTL, AON_RTC_CTL_RTC_UPD_EN_BITN) = 1; @@ -949,6 +959,7 @@ static uint_fast16_t rfCoreSendDisableCmd(void) bool interruptsWereDisabled; uint_fast16_t ret; + // clang-format off static const rfc_CMD_FS_POWERDOWN_t cFsPowerdownCmd = { .commandNo = CMD_FS_POWERDOWN, @@ -971,6 +982,7 @@ static uint_fast16_t rfCoreSendDisableCmd(void) .rule = COND_NEVER, }, }; + // clang-format on HWREGBITW(AON_RTC_BASE + AON_RTC_O_CTL, AON_RTC_CTL_RTC_UPD_EN_BITN) = 1; diff --git a/examples/platforms/cc2652/cc2652_ccfg.c b/examples/platforms/cc2652/cc2652_ccfg.c index 2f558f2bf..aea2c046a 100644 --- a/examples/platforms/cc2652/cc2652_ccfg.c +++ b/examples/platforms/cc2652/cc2652_ccfg.c @@ -30,6 +30,8 @@ * Configure the Customer Configuration Area. */ +// clang-format off + // enable bootloader backdoor #define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 // Enable ROM boot loader @@ -44,3 +46,5 @@ * Include the default ccfg struct and configuration code. */ #include + +// clang-format on diff --git a/examples/platforms/cc2652/radio.c b/examples/platforms/cc2652/radio.c index b9a15e630..62f1e07dc 100644 --- a/examples/platforms/cc2652/radio.c +++ b/examples/platforms/cc2652/radio.c @@ -99,6 +99,7 @@ static uint32_t sRatOffset = 0; /* * Radio command structures that run on the CM0. */ +// clang-format off static volatile __attribute__((aligned(4))) rfc_CMD_SYNC_START_RAT_t sStartRatCmd; static volatile __attribute__((aligned(4))) rfc_CMD_RADIO_SETUP_t sRadioSetupCmd; @@ -119,6 +120,7 @@ static volatile __attribute__((aligned(4))) rfc_CMD_IEEE_RX_ACK_t sTransm static volatile __attribute__((aligned(4))) ext_src_match_data_t sSrcMatchExtData; static volatile __attribute__((aligned(4))) short_src_match_data_t sSrcMatchShortData; +// clang-format on /* * Structure containing radio statistics. @@ -202,6 +204,7 @@ static void rfCoreInitBufs(void) */ static void rfCoreInitReceiveParams(void) { + // clang-format off static const rfc_CMD_IEEE_RX_t cReceiveCmd = { .commandNo = CMD_IEEE_RX, @@ -267,6 +270,7 @@ static void rfCoreInitReceiveParams(void) }, .endTime = 0u, }; + // clang-format on sReceiveCmd = cReceiveCmd; sReceiveCmd.pRxQ = &sRxDataQueue; @@ -550,6 +554,7 @@ static uint8_t rfCoreFindEmptyExtSrcMatchIdx(void) */ static uint_fast8_t rfCoreSendTransmitCmd(uint8_t *aPsdu, uint8_t aLen) { + // clang-format off static const rfc_CMD_IEEE_CSMA_t cCsmacaBackoffCmd = { .commandNo = CMD_IEEE_CSMA, @@ -611,6 +616,7 @@ static uint_fast8_t rfCoreSendTransmitCmd(uint8_t *aPsdu, uint8_t aLen) /* number of RAT ticks to wait before claiming we haven't received an ack */ .endTime = ((IEEE802154_MAC_ACK_WAIT_DURATION * CC2652_RAT_TICKS_PER_SEC) / IEEE802154_SYMBOLS_PER_SEC), }; + // clang-format on /* reset retry count */ sTransmitRetryCount = 0; @@ -660,6 +666,7 @@ static uint_fast8_t rfCoreSendReceiveCmd(void) static uint_fast8_t rfCoreSendEdScanCmd(uint8_t aChannel, uint16_t aDurration) { + // clang-format off static const rfc_CMD_IEEE_ED_SCAN_t cEdScanCmd = { .commandNo = CMD_IEEE_ED_SCAN, @@ -686,6 +693,7 @@ static uint_fast8_t rfCoreSendEdScanCmd(uint8_t aChannel, uint16_t aDurration) .pastTrig = 1, }, }; + // clang-format on sEdScanCmd = cEdScanCmd; sEdScanCmd.channel = aChannel; @@ -883,6 +891,7 @@ static uint_fast16_t rfCoreSendEnableCmd(void) bool interruptsWereDisabled; uint_fast16_t ret; + // clang-format off static const rfc_CMD_SYNC_START_RAT_t cStartRatCmd = { .commandNo = CMD_SYNC_START_RAT, @@ -906,6 +915,7 @@ static uint_fast16_t rfCoreSendEnableCmd(void) }, .mode = 1, // IEEE 802.15.4 mode }; + // clang-format on /* turn on the clock line to the radio core */ HWREGBITW(AON_RTC_BASE + AON_RTC_O_CTL, AON_RTC_CTL_RTC_UPD_EN_BITN) = 1; @@ -956,6 +966,7 @@ static uint_fast16_t rfCoreSendDisableCmd(void) bool interruptsWereDisabled; uint_fast16_t ret; + // clang-format off static const rfc_CMD_FS_POWERDOWN_t cFsPowerdownCmd = { .commandNo = CMD_FS_POWERDOWN, @@ -978,6 +989,7 @@ static uint_fast16_t rfCoreSendDisableCmd(void) .rule = COND_NEVER, }, }; + // clang-format on HWREGBITW(AON_RTC_BASE + AON_RTC_O_CTL, AON_RTC_CTL_RTC_UPD_EN_BITN) = 1; diff --git a/examples/platforms/da15000/custom_config_qspi.h b/examples/platforms/da15000/custom_config_qspi.h index 614e92ddb..cd4b93f35 100755 --- a/examples/platforms/da15000/custom_config_qspi.h +++ b/examples/platforms/da15000/custom_config_qspi.h @@ -36,6 +36,8 @@ #include "bsp_definitions.h" +// clang-format off + #define dg_configBLACK_ORCA_IC_REV BLACK_ORCA_IC_REV_B #define dg_configBLACK_ORCA_IC_STEP BLACK_ORCA_IC_STEP_B @@ -118,4 +120,6 @@ /* Include bsp default values */ #include "bsp_defaults.h" +// clang-format on + #endif /* CUSTOM_CONFIG_QSPI_H_ */ diff --git a/examples/platforms/da15000/platform.c b/examples/platforms/da15000/platform.c index ca67125db..1520819ba 100644 --- a/examples/platforms/da15000/platform.c +++ b/examples/platforms/da15000/platform.c @@ -48,11 +48,13 @@ static bool sBlink = false; static int sMsCounterInit; static int sMsCounter; +// clang-format off #define ALIVE_LED_PERIOD (50000) #define ALIVE_LED_DUTY (500) #define LEADER_BLINK_TIME (200) #define ROUTER_BLINK_TIME (500) #define CHILD_BLINK_TIME (2000) +// clang-format on static otInstance *sInstance = NULL; diff --git a/examples/platforms/da15000/radio.c b/examples/platforms/da15000/radio.c index baf61f8ad..fe8e59817 100644 --- a/examples/platforms/da15000/radio.c +++ b/examples/platforms/da15000/radio.c @@ -46,12 +46,14 @@ #include "hw_rf.h" #include "internal.h" +// clang-format off #define FACTORY_TEST_TIMESTAMP (0x7F8EA08) // Register holds a timestamp of facotry test of a chip #define FACTORY_TESTER_ID (0x7F8EA0C) // Register holds test machine ID used for factory test #define RADIO_DEFAULT_CHANNEL (11) #define RADIO_EUI64_TABLE_SIZE (8) #define RADIO_FRAMES_BUFFER_SIZE (32) +// clang-format on enum { diff --git a/examples/platforms/da15000/uart.c b/examples/platforms/da15000/uart.c index a3e40f11e..7e0b066bb 100644 --- a/examples/platforms/da15000/uart.c +++ b/examples/platforms/da15000/uart.c @@ -56,6 +56,7 @@ static void UartSignalRead(void *p, uint16_t transferred) otError otPlatUartEnable(void) { + // clang-format off uart_config_ex uart_init = { .baud_rate = HW_UART_BAUDRATE_115200, @@ -70,6 +71,7 @@ otError otPlatUartEnable(void) .tx_dma_channel = HW_DMA_CHANNEL_3, .rx_dma_channel = HW_DMA_CHANNEL_2, }; + // clang-format on hw_uart_init_ex(HW_UART2, &uart_init); diff --git a/examples/platforms/efr32/flash.c b/examples/platforms/efr32/flash.c index 49c5c74a9..bd5a0263a 100644 --- a/examples/platforms/efr32/flash.c +++ b/examples/platforms/efr32/flash.c @@ -39,9 +39,11 @@ #include "em_msc.h" +// clang-format off #define FLASH_DATA_USED_PAGES 10 #define FLASH_DATA_END_ADDR (FLASH_BASE + FLASH_SIZE) #define FLASH_DATA_START_ADDR (FLASH_DATA_END_ADDR - (FLASH_PAGE_SIZE * FLASH_DATA_USED_PAGES)) +// clang-format on static inline uint32_t mapAddress(uint32_t aAddress) { diff --git a/examples/platforms/efr32/radio.c b/examples/platforms/efr32/radio.c index 0f977165f..d008cf962 100644 --- a/examples/platforms/efr32/radio.c +++ b/examples/platforms/efr32/radio.c @@ -166,15 +166,15 @@ void efr32RadioInit(void) assert(status == RAIL_STATUS_NO_ERROR); status = RAIL_ConfigEvents(sRailHandle, RAIL_EVENTS_ALL, - RAIL_EVENT_RX_ACK_TIMEOUT | - RAIL_EVENT_TX_PACKET_SENT | - RAIL_EVENT_RX_PACKET_RECEIVED | - RAIL_EVENT_TX_CHANNEL_BUSY | - RAIL_EVENT_TX_ABORTED | - RAIL_EVENT_TX_BLOCKED | - RAIL_EVENT_TX_UNDERFLOW | - RAIL_EVENT_IEEE802154_DATA_REQUEST_COMMAND | - RAIL_EVENT_CAL_NEEDED + RAIL_EVENT_RX_ACK_TIMEOUT | // + RAIL_EVENT_TX_PACKET_SENT | // + RAIL_EVENT_RX_PACKET_RECEIVED | // + RAIL_EVENT_TX_CHANNEL_BUSY | // + RAIL_EVENT_TX_ABORTED | // + RAIL_EVENT_TX_BLOCKED | // + RAIL_EVENT_TX_UNDERFLOW | // + RAIL_EVENT_IEEE802154_DATA_REQUEST_COMMAND | // + RAIL_EVENT_CAL_NEEDED // ); assert(status == RAIL_STATUS_NO_ERROR); diff --git a/examples/platforms/efr32/startup-gcc.c b/examples/platforms/efr32/startup-gcc.c index dc6073b56..5e1664043 100644 --- a/examples/platforms/efr32/startup-gcc.c +++ b/examples/platforms/efr32/startup-gcc.c @@ -32,7 +32,11 @@ */ __extension__ typedef int __guard __attribute__((mode(__DI__))); + int __cxa_guard_acquire(__guard *g) { return !*(char *)(g); } + void __cxa_guard_release(__guard *g) { *(char *)g = 1; } + void __cxa_guard_abort(__guard *g) { (void)g; } + void __cxa_pure_virtual(void) { while (1); } diff --git a/examples/platforms/kw41z/radio.c b/examples/platforms/kw41z/radio.c index dae95f03d..d87a0f675 100644 --- a/examples/platforms/kw41z/radio.c +++ b/examples/platforms/kw41z/radio.c @@ -43,6 +43,7 @@ #include #include +// clang-format off #define DOUBLE_BUFFERING (1) #define DEFAULT_CHANNEL (11) #define DEFAULT_CCA_MODE (XCVR_CCA_MODE1_c) @@ -62,6 +63,7 @@ ZLL_IRQSTS_TMR2MSK_MASK | \ ZLL_IRQSTS_TMR3MSK_MASK | \ ZLL_IRQSTS_TMR4MSK_MASK ) +// clang-format on typedef enum xcvr_state_tag { @@ -871,19 +873,19 @@ void kw41zRadioInit(void) XCVR_Init(ZIGBEE_MODE, DR_500KBPS); /* Disable all timers, enable AUTOACK and CCA before TX, mask all interrupts */ - ZLL->PHY_CTRL = ZLL_PHY_CTRL_CCATYPE(DEFAULT_CCA_MODE) | - ZLL_PHY_CTRL_CCABFRTX_MASK | - ZLL_PHY_CTRL_TSM_MSK_MASK | - ZLL_PHY_CTRL_WAKE_MSK_MASK | - ZLL_PHY_CTRL_CRC_MSK_MASK | - ZLL_PHY_CTRL_PLL_UNLOCK_MSK_MASK | - ZLL_PHY_CTRL_FILTERFAIL_MSK_MASK | - ZLL_PHY_CTRL_RX_WMRK_MSK_MASK | - ZLL_PHY_CTRL_CCAMSK_MASK | - ZLL_PHY_CTRL_RXMSK_MASK | - ZLL_PHY_CTRL_TXMSK_MASK | - ZLL_PHY_CTRL_SEQMSK_MASK | - ZLL_PHY_CTRL_AUTOACK_MASK | + ZLL->PHY_CTRL = ZLL_PHY_CTRL_CCATYPE(DEFAULT_CCA_MODE) | // + ZLL_PHY_CTRL_CCABFRTX_MASK | // + ZLL_PHY_CTRL_TSM_MSK_MASK | // + ZLL_PHY_CTRL_WAKE_MSK_MASK | // + ZLL_PHY_CTRL_CRC_MSK_MASK | // + ZLL_PHY_CTRL_PLL_UNLOCK_MSK_MASK | // + ZLL_PHY_CTRL_FILTERFAIL_MSK_MASK | // + ZLL_PHY_CTRL_RX_WMRK_MSK_MASK | // + ZLL_PHY_CTRL_CCAMSK_MASK | // + ZLL_PHY_CTRL_RXMSK_MASK | // + ZLL_PHY_CTRL_TXMSK_MASK | // + ZLL_PHY_CTRL_SEQMSK_MASK | // + ZLL_PHY_CTRL_AUTOACK_MASK | // ZLL_PHY_CTRL_TRCV_MSK_MASK; /* Clear all IRQ flags and disable all timer interrupts */ @@ -892,10 +894,10 @@ void kw41zRadioInit(void) /* Frame Filtering FRM_VER[7:6] = b11. Accept FrameVersion 0 and 1 packets, reject all others */ ZLL->RX_FRAME_FILTER &= ~ZLL_RX_FRAME_FILTER_FRM_VER_FILTER_MASK; - ZLL->RX_FRAME_FILTER = ZLL_RX_FRAME_FILTER_FRM_VER_FILTER(3) | - ZLL_RX_FRAME_FILTER_CMD_FT_MASK | - ZLL_RX_FRAME_FILTER_DATA_FT_MASK | - ZLL_RX_FRAME_FILTER_ACK_FT_MASK | + ZLL->RX_FRAME_FILTER = ZLL_RX_FRAME_FILTER_FRM_VER_FILTER(3) | // + ZLL_RX_FRAME_FILTER_CMD_FT_MASK | // + ZLL_RX_FRAME_FILTER_DATA_FT_MASK | // + ZLL_RX_FRAME_FILTER_ACK_FT_MASK | // ZLL_RX_FRAME_FILTER_BEACON_FT_MASK; /* Set prescaller to obtain 1 symbol (16us) timebase */ diff --git a/examples/platforms/nrf52840/alarm.c b/examples/platforms/nrf52840/alarm.c index 20d639365..61e066971 100644 --- a/examples/platforms/nrf52840/alarm.c +++ b/examples/platforms/nrf52840/alarm.c @@ -56,6 +56,7 @@ #include #include +// clang-format off #define RTC_FREQUENCY 32768ULL #define US_PER_MS 1000ULL @@ -64,6 +65,7 @@ #define MS_PER_S 1000UL #define MS_PER_OVERFLOW (512UL * MS_PER_S) ///< Time that has passed between overflow events. On full RTC speed, it occurs every 512 s. +// clang-format on typedef enum { @@ -88,8 +90,8 @@ typedef struct static volatile uint64_t sTimeOffset = 0; ///< Time offset to keep track of current time (in millisecond). static AlarmData sTimerData[kNumTimers]; ///< Data of the timers. -static const AlarmChannelData sChannelData[kNumTimers] = -{ +static const AlarmChannelData sChannelData[kNumTimers] = // +{ // [kMsTimer] = { .mChannelNumber = 0, .mCompareEventMask = RTC_EVTEN_COMPARE0_Msk, diff --git a/examples/platforms/nrf52840/platform-fem.h b/examples/platforms/nrf52840/platform-fem.h index 78c9dff0b..7d54a4b64 100644 --- a/examples/platforms/nrf52840/platform-fem.h +++ b/examples/platforms/nrf52840/platform-fem.h @@ -37,6 +37,7 @@ #include +// clang-format off #define PLATFORM_FEM_DEFAULT_PA_PIN 26 /**< Default Power Amplifier pin. */ #define PLATFORM_FEM_DEFAULT_LNA_PIN 27 /**< Default Low Noise Amplifier pin. */ @@ -46,6 +47,8 @@ #define PLATFORM_FEM_DEFAULT_RADIO_DISABLED_PPI_GROUP 5 /**< Default PPI channel group used to disable radio disabled PPI. */ #define PLATFORM_FEM_DEFAULT_GPIOTE_CHANNEL 7 /**< Default GPIOTE channel for FEM control. */ +// clang-format on + #define PLATFORM_FEM_DEFAULT_CONFIG \ ((PlatformFemConfigParams) { \ .mPaCfg = { \ @@ -65,7 +68,6 @@ .mGpioteChId = PLATFORM_FEM_DEFAULT_GPIOTE_CHANNEL, \ }) - /** * @brief Configuration parameters for the PA and LNA. */ diff --git a/examples/platforms/nrf52840/radio.c b/examples/platforms/nrf52840/radio.c index 8463fa875..178088e0b 100644 --- a/examples/platforms/nrf52840/radio.c +++ b/examples/platforms/nrf52840/radio.c @@ -58,11 +58,15 @@ #include #include +// clang-format off + #define SHORT_ADDRESS_SIZE 2 #define EXTENDED_ADDRESS_SIZE 8 #define PENDING_BIT 0x10 #define US_PER_MS 1000ULL +// clang-format on + enum { NRF52840_RECEIVE_SENSITIVITY = -100, // dBm