Uncrustify code style
This commit is contained in:
parent
b605e9b43f
commit
ca2e82a459
@ -74,7 +74,7 @@
|
||||
#ifndef WATCHDOG_CONF_TIMER_TOP
|
||||
#define WATCHDOG_CONF_TIMER_TOP 0xFFFFF
|
||||
#endif
|
||||
/** @} */
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name RF configuration.
|
||||
@ -88,9 +88,9 @@
|
||||
* or larger guard time.
|
||||
*/
|
||||
#ifndef RF_CONF_FAST_RADIO_STARTUP
|
||||
# define RF_FAST_RADIO_STARTUP (MAC_CONF_WITH_TSCH)
|
||||
#define RF_FAST_RADIO_STARTUP (MAC_CONF_WITH_TSCH)
|
||||
#else
|
||||
# define RF_FAST_RADIO_STARTUP RF_CONF_FAST_RADIO_STARTUP
|
||||
#define RF_FAST_RADIO_STARTUP RF_CONF_FAST_RADIO_STARTUP
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -102,7 +102,7 @@
|
||||
#endif
|
||||
|
||||
#if (RF_CONF_TXPOWER_HIGH_PA) && !(SUPPORTS_HIGH_PA)
|
||||
# error "Device does not support High PA"
|
||||
#error "Device does not support High PA"
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -120,36 +120,36 @@
|
||||
*/
|
||||
#ifdef RF_CONF_MODE
|
||||
/* Sanity check a valid configuration is provided. */
|
||||
# if !(RF_CONF_MODE & RF_MODE_BM)
|
||||
# error "Invalid RF_CONF_MODE provided"
|
||||
# endif
|
||||
#if !(RF_CONF_MODE & RF_MODE_BM)
|
||||
#error "Invalid RF_CONF_MODE provided"
|
||||
#endif
|
||||
|
||||
# define RF_MODE RF_CONF_MODE
|
||||
#define RF_MODE RF_CONF_MODE
|
||||
#endif /* RF_CONF_MODE */
|
||||
|
||||
/* Number of RX buffers. */
|
||||
#ifdef RF_CONF_RX_BUF_CNT
|
||||
# define RF_RX_BUF_CNT RF_CONF_RX_BUF_CNT
|
||||
#define RF_RX_BUF_CNT RF_CONF_RX_BUF_CNT
|
||||
#else
|
||||
# define RF_RX_BUF_CNT 4
|
||||
#define RF_RX_BUF_CNT 4
|
||||
#endif
|
||||
|
||||
/* Size of each RX buffer in bytes. */
|
||||
#ifdef RF_CONF_RX_BUF_SIZE
|
||||
# define RF_RX_BUF_SIZE RF_CONF_RX_BUF_SIZE
|
||||
#define RF_RX_BUF_SIZE RF_CONF_RX_BUF_SIZE
|
||||
#else
|
||||
# define RF_RX_BUF_SIZE 144
|
||||
#define RF_RX_BUF_SIZE 144
|
||||
#endif
|
||||
|
||||
/* Enable/disable BLE beacon. */
|
||||
#ifdef RF_CONF_BLE_BEACON_ENABLE
|
||||
# define RF_BLE_BEACON_ENABLE RF_CONF_BLE_BEACON_ENABLE
|
||||
#define RF_BLE_BEACON_ENABLE RF_CONF_BLE_BEACON_ENABLE
|
||||
#else
|
||||
# define RF_BLE_BEACON_ENABLE 0
|
||||
#define RF_BLE_BEACON_ENABLE 0
|
||||
#endif
|
||||
|
||||
#if (RF_BLE_BEACON_ENABLE) && !(SUPPORTS_BLE_BEACON)
|
||||
# error "Device does not support BLE for BLE beacon"
|
||||
#error "Device does not support BLE for BLE beacon"
|
||||
#endif
|
||||
|
||||
/*----- CC13xx Device Line --------------------------------------------------*/
|
||||
@ -157,65 +157,65 @@
|
||||
#if defined(DEVICE_LINE_CC13XX)
|
||||
|
||||
/* Default to Prop-mode for CC13xx devices if not configured. */
|
||||
# ifndef RF_MODE
|
||||
# define RF_MODE RF_MODE_SUB_1_GHZ
|
||||
# endif
|
||||
#ifndef RF_MODE
|
||||
#define RF_MODE RF_MODE_SUB_1_GHZ
|
||||
#endif
|
||||
|
||||
/*----- CC13xx Prop-mode ----------------------------------------------------*/
|
||||
# if (RF_MODE == RF_MODE_SUB_1_GHZ) && (SUPPORTS_PROP_MODE)
|
||||
#if (RF_MODE == RF_MODE_SUB_1_GHZ) && (SUPPORTS_PROP_MODE)
|
||||
|
||||
/* Netstack configuration. */
|
||||
# define NETSTACK_CONF_RADIO prop_mode_driver
|
||||
#define NETSTACK_CONF_RADIO prop_mode_driver
|
||||
|
||||
/* CSMA configuration. */
|
||||
# define CSMA_CONF_ACK_WAIT_TIME (RTIMER_SECOND / 300)
|
||||
# define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME (RTIMER_SECOND / 1000)
|
||||
# define CSMA_CONF_SEND_SOFT_ACK 1
|
||||
#define CSMA_CONF_ACK_WAIT_TIME (RTIMER_SECOND / 300)
|
||||
#define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME (RTIMER_SECOND / 1000)
|
||||
#define CSMA_CONF_SEND_SOFT_ACK 1
|
||||
|
||||
/*----- CC13xx IEEE-mode ----------------------------------------------------*/
|
||||
# elif (RF_MODE == RF_MODE_2_4_GHZ) && (SUPPORTS_IEEE_MODE)
|
||||
#elif (RF_MODE == RF_MODE_2_4_GHZ) && (SUPPORTS_IEEE_MODE)
|
||||
|
||||
/* Netstack configuration. */
|
||||
# define NETSTACK_CONF_RADIO ieee_mode_driver
|
||||
#define NETSTACK_CONF_RADIO ieee_mode_driver
|
||||
|
||||
/* CSMA configuration. */
|
||||
# define CSMA_CONF_SEND_SOFT_ACK 0
|
||||
#define CSMA_CONF_SEND_SOFT_ACK 0
|
||||
|
||||
# else
|
||||
#else
|
||||
/*----- CC13xx Unsupported Mode ---------------------------------------------*/
|
||||
# error "Invalid RF mode configuration of CC13xx device"
|
||||
# endif /* CC13xx RF Mode configuration */
|
||||
#error "Invalid RF mode configuration of CC13xx device"
|
||||
#endif /* CC13xx RF Mode configuration */
|
||||
|
||||
/*----- CC26xx Device Line --------------------------------------------------*/
|
||||
/* CC26xx only supports IEEE mode */
|
||||
#elif defined(DEVICE_LINE_CC26XX)
|
||||
|
||||
/* Default to IEEE-mode for CC26xx devices if not configured */
|
||||
# ifndef RF_MODE
|
||||
# define RF_MODE RF_MODE_2_4_GHZ
|
||||
# endif
|
||||
#ifndef RF_MODE
|
||||
#define RF_MODE RF_MODE_2_4_GHZ
|
||||
#endif
|
||||
|
||||
/*----- CC26xx IEEE-mode ----------------------------------------------------*/
|
||||
# if (RF_MODE == RF_MODE_2_4_GHZ) && (SUPPORTS_IEEE_MODE)
|
||||
#if (RF_MODE == RF_MODE_2_4_GHZ) && (SUPPORTS_IEEE_MODE)
|
||||
|
||||
/* Netstack configuration */
|
||||
# define NETSTACK_CONF_RADIO ieee_mode_driver
|
||||
#define NETSTACK_CONF_RADIO ieee_mode_driver
|
||||
|
||||
/* CSMA configuration */
|
||||
# define CSMA_CONF_SEND_SOFT_ACK 0
|
||||
#define CSMA_CONF_SEND_SOFT_ACK 0
|
||||
|
||||
/* Frequncy band configuration */
|
||||
# undef DOT_15_4G_FREQ_BAND_ID
|
||||
# define DOT_15_4G_CONF_FREQ_BAND_ID DOT_15_4G_FREQ_BAND_2450
|
||||
#undef DOT_15_4G_FREQ_BAND_ID
|
||||
#define DOT_15_4G_CONF_FREQ_BAND_ID DOT_15_4G_FREQ_BAND_2450
|
||||
|
||||
# else
|
||||
#else
|
||||
/*----- CC26xx Unsupported Mode ---------------------------------------------*/
|
||||
# error "IEEE-mode only supported by CC26xx devices"
|
||||
# endif /* CC26xx RF Mode configuration */
|
||||
#error "IEEE-mode only supported by CC26xx devices"
|
||||
#endif /* CC26xx RF Mode configuration */
|
||||
|
||||
/*----- Unsupported device line ---------------------------------------------*/
|
||||
#else
|
||||
# error "Unsupported Device Line defined"
|
||||
#error "Unsupported Device Line defined"
|
||||
#endif /* Unsupported device line */
|
||||
|
||||
/** @} */
|
||||
|
@ -43,9 +43,9 @@
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X0_CC26X0)
|
||||
# include <cm3/cm3-def.h>
|
||||
#include <cm3/cm3-def.h>
|
||||
#elif (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2)
|
||||
# include <cm4/cm4-def.h>
|
||||
#include <cm4/cm4-def.h>
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stddef.h>
|
||||
@ -71,7 +71,7 @@
|
||||
#define USEC_TO_RAT(X) ((X) * 4)
|
||||
|
||||
#if (RTIMER_SECOND % 256) || (RAT_SECOND % 256)
|
||||
# error RAT_TO_RTIMER macro must be fixed!
|
||||
#error RAT_TO_RTIMER macro must be fixed!
|
||||
#endif
|
||||
|
||||
/* The PHY header (preamble + SFD, 4+1 bytes) duration is equivalent to 10 symbols */
|
||||
@ -116,9 +116,9 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Path to CMSIS header */
|
||||
#if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X0_CC26X0)
|
||||
# define CMSIS_CONF_HEADER_PATH "cc13x0-cc26x0-cm3.h"
|
||||
#define CMSIS_CONF_HEADER_PATH "cc13x0-cc26x0-cm3.h"
|
||||
#elif (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2)
|
||||
# define CMSIS_CONF_HEADER_PATH "cc13x2-cc26x2-cm4.h"
|
||||
#define CMSIS_CONF_HEADER_PATH "cc13x2-cc26x2-cm4.h"
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Path to headers with implementation of mutexes and memory barriers */
|
||||
|
@ -51,13 +51,13 @@
|
||||
* @{
|
||||
*/
|
||||
#if CCFG_CONF_JTAG_INTERFACE_DISABLE
|
||||
# define SET_CCFG_CCFG_TI_OPTIONS_TI_FA_ENABLE 0x00
|
||||
# define SET_CCFG_CCFG_TAP_DAP_0_CPU_DAP_ENABLE 0x00
|
||||
# define SET_CCFG_CCFG_TAP_DAP_0_PRCM_TAP_ENABLE 0x00
|
||||
# define SET_CCFG_CCFG_TAP_DAP_0_TEST_TAP_ENABLE 0x00
|
||||
# define SET_CCFG_CCFG_TAP_DAP_1_PBIST2_TAP_ENABLE 0x00
|
||||
# define SET_CCFG_CCFG_TAP_DAP_1_PBIST1_TAP_ENABLE 0x00
|
||||
# define SET_CCFG_CCFG_TAP_DAP_1_WUC_TAP_ENABLE 0x00
|
||||
#define SET_CCFG_CCFG_TI_OPTIONS_TI_FA_ENABLE 0x00
|
||||
#define SET_CCFG_CCFG_TAP_DAP_0_CPU_DAP_ENABLE 0x00
|
||||
#define SET_CCFG_CCFG_TAP_DAP_0_PRCM_TAP_ENABLE 0x00
|
||||
#define SET_CCFG_CCFG_TAP_DAP_0_TEST_TAP_ENABLE 0x00
|
||||
#define SET_CCFG_CCFG_TAP_DAP_1_PBIST2_TAP_ENABLE 0x00
|
||||
#define SET_CCFG_CCFG_TAP_DAP_1_PBIST1_TAP_ENABLE 0x00
|
||||
#define SET_CCFG_CCFG_TAP_DAP_1_WUC_TAP_ENABLE 0x00
|
||||
#endif
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -69,7 +69,7 @@
|
||||
* @{
|
||||
*/
|
||||
#if defined(DEVICE_LINE_CC13XX) && (RF_CONF_TXPOWER_BOOST_MODE)
|
||||
# define CCFG_FORCE_VDDR_HH 1
|
||||
#define CCFG_FORCE_VDDR_HH 1
|
||||
#endif
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -86,12 +86,12 @@
|
||||
#endif
|
||||
|
||||
#if CCFG_CONF_ROM_BOOTLOADER_ENABLE
|
||||
# define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
|
||||
# define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
|
||||
# if defined(CCFG_CONF_BL_PIN_NUMBER)
|
||||
# define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER CCFG_CONF_BL_PIN_NUMBER
|
||||
# endif
|
||||
# define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
|
||||
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
|
||||
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
|
||||
#if defined(CCFG_CONF_BL_PIN_NUMBER)
|
||||
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER CCFG_CONF_BL_PIN_NUMBER
|
||||
#endif
|
||||
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
|
||||
#endif
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -175,7 +175,6 @@ gpio_int_cb(PIN_Handle handle, PIN_Id pin_id)
|
||||
/* Notify the GPIO HAL driver */
|
||||
gpio_hal_event_handler(gpio_hal_pin_to_mask(pin_id));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
gpio_hal_arch_init(void)
|
||||
|
@ -73,8 +73,7 @@ static void rtimer_clock_stub(uintptr_t unused) { (void)unused; /* do nothing */
|
||||
static void
|
||||
rtimer_isr_hook(void)
|
||||
{
|
||||
if(AONRTCEventGet(RTIMER_RTC_CH))
|
||||
{
|
||||
if(AONRTCEventGet(RTIMER_RTC_CH)) {
|
||||
AONRTCEventClear(RTIMER_RTC_CH);
|
||||
AONRTCChannelDisable(RTIMER_RTC_CH);
|
||||
|
||||
@ -84,12 +83,9 @@ rtimer_isr_hook(void)
|
||||
* HWI Dispatch clears the interrupt. If HWI wasn't triggered, clear
|
||||
* the interrupt manually.
|
||||
*/
|
||||
if(AONRTCEventGet(HWIP_RTC_CH))
|
||||
{
|
||||
if(AONRTCEventGet(HWIP_RTC_CH)) {
|
||||
hwi_dispatch_fxn();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
IntPendClear(INT_AON_RTC_COMB);
|
||||
}
|
||||
}
|
||||
@ -121,9 +117,8 @@ rtimer_arch_init(void)
|
||||
ClockP_destruct(&clk_object);
|
||||
|
||||
/* Try to access the RAM vector table. */
|
||||
ramvec_table = (isr_fxn_t*)HWREG(NVIC_VTABLE);
|
||||
if(!ramvec_table)
|
||||
{
|
||||
ramvec_table = (isr_fxn_t *)HWREG(NVIC_VTABLE);
|
||||
if(!ramvec_table) {
|
||||
/*
|
||||
* Unable to find the RAM vector table is a serious fault.
|
||||
* Spin-lock forever.
|
||||
@ -136,8 +131,7 @@ rtimer_arch_init(void)
|
||||
* in the RAM vector table. Fetch and store it.
|
||||
*/
|
||||
hwi_dispatch_fxn = (hwi_dispatch_fxn_t)ramvec_table[INT_AON_RTC_COMB];
|
||||
if(!hwi_dispatch_fxn)
|
||||
{
|
||||
if(!hwi_dispatch_fxn) {
|
||||
/*
|
||||
* Unable to find the HWI dispatch ISR in the RAM vector table is
|
||||
* a serious fault. Spin-lock forever.
|
||||
|
@ -87,25 +87,25 @@ extern unsigned long _stack_end;
|
||||
//
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".resetVecs"))) __attribute__ ((used))
|
||||
static void (* const resetVectors[16])(void) =
|
||||
static void(*const resetVectors[16]) (void) =
|
||||
{
|
||||
(void (*)(void))((uint32_t)&_stack_end),
|
||||
// The initial stack pointer
|
||||
resetISR, // The reset handler
|
||||
nmiISR, // The NMI handler
|
||||
faultISR, // The hard fault handler
|
||||
defaultHandler, // The MPU fault handler
|
||||
busFaultHandler, // The bus fault handler
|
||||
defaultHandler, // The usage fault handler
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
defaultHandler, // SVCall handler
|
||||
defaultHandler, // Debug monitor handler
|
||||
0, // Reserved
|
||||
defaultHandler, // The PendSV handler
|
||||
defaultHandler // The SysTick handler
|
||||
/* The initial stack pointer */
|
||||
resetISR, /* The reset handler */
|
||||
nmiISR, /* The NMI handler */
|
||||
faultISR, /* The hard fault handler */
|
||||
defaultHandler, /* The MPU fault handler */
|
||||
busFaultHandler, /* The bus fault handler */
|
||||
defaultHandler, /* The usage fault handler */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
0, /* Reserved */
|
||||
defaultHandler, /* SVCall handler */
|
||||
defaultHandler, /* Debug monitor handler */
|
||||
0, /* Reserved */
|
||||
defaultHandler, /* The PendSV handler */
|
||||
defaultHandler /* The SysTick handler */
|
||||
};
|
||||
//*****************************************************************************
|
||||
//
|
||||
@ -155,7 +155,7 @@ void localProgramStart(void)
|
||||
uint32_t count;
|
||||
uint32_t i;
|
||||
|
||||
#if defined (__ARM_ARCH_7EM__) && defined(__VFP_FP__) && !defined(__SOFTFP__)
|
||||
#if defined(__ARM_ARCH_7EM__) && defined(__VFP_FP__) && !defined(__SOFTFP__)
|
||||
volatile uint32_t *pui32Cpacr = (uint32_t *)0xE000ED88;
|
||||
|
||||
/* Enable Coprocessor Access Control (CPAC) */
|
||||
@ -233,8 +233,7 @@ static void
|
||||
nmiISR(void)
|
||||
{
|
||||
/* Enter an infinite loop. */
|
||||
while(1)
|
||||
{
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,8 +295,7 @@ busFaultHandler(void)
|
||||
{
|
||||
x__ = 0;
|
||||
/* Enter an infinite loop. */
|
||||
while(1)
|
||||
{
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,8 +310,7 @@ static void
|
||||
defaultHandler(void)
|
||||
{
|
||||
/* Enter an infinite loop. */
|
||||
while(1)
|
||||
{
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,7 @@
|
||||
#error "startup_cc13xx_cc26xx_iar.c: Unsupported compiler!"
|
||||
#endif
|
||||
|
||||
|
||||
// We need intrinsic functions for IAR (if used in source code)
|
||||
/* We need intrinsic functions for IAR (if used in source code) */
|
||||
#include <intrinsics.h>
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
#include DeviceFamily_constructPath(inc/hw_types.h)
|
||||
@ -58,48 +57,48 @@ static void faultISR( void );
|
||||
static void intDefaultHandler( void );
|
||||
extern int main( void );
|
||||
|
||||
extern void MPUFaultIntHandler( void );
|
||||
extern void BusFaultIntHandler( void );
|
||||
extern void UsageFaultIntHandler( void );
|
||||
extern void SVCallIntHandler( void );
|
||||
extern void DebugMonIntHandler( void );
|
||||
extern void PendSVIntHandler( void );
|
||||
extern void SysTickIntHandler( void );
|
||||
extern void GPIOIntHandler( void );
|
||||
extern void I2CIntHandler( void );
|
||||
extern void RFCCPE1IntHandler( void );
|
||||
extern void AONRTCIntHandler( void );
|
||||
extern void UART0IntHandler( void );
|
||||
extern void AUXSWEvent0IntHandler( void );
|
||||
extern void SSI0IntHandler( void );
|
||||
extern void SSI1IntHandler( void );
|
||||
extern void RFCCPE0IntHandler( void );
|
||||
extern void RFCHardwareIntHandler( void );
|
||||
extern void RFCCmdAckIntHandler( void );
|
||||
extern void I2SIntHandler( void );
|
||||
extern void AUXSWEvent1IntHandler( void );
|
||||
extern void WatchdogIntHandler( void );
|
||||
extern void Timer0AIntHandler( void );
|
||||
extern void Timer0BIntHandler( void );
|
||||
extern void Timer1AIntHandler( void );
|
||||
extern void Timer1BIntHandler( void );
|
||||
extern void Timer2AIntHandler( void );
|
||||
extern void Timer2BIntHandler( void );
|
||||
extern void Timer3AIntHandler( void );
|
||||
extern void Timer3BIntHandler( void );
|
||||
extern void CryptoIntHandler( void );
|
||||
extern void uDMAIntHandler( void );
|
||||
extern void uDMAErrIntHandler( void );
|
||||
extern void FlashIntHandler( void );
|
||||
extern void SWEvent0IntHandler( void );
|
||||
extern void AUXCombEventIntHandler( void );
|
||||
extern void AONProgIntHandler( void );
|
||||
extern void DynProgIntHandler( void );
|
||||
extern void AUXCompAIntHandler( void );
|
||||
extern void AUXADCIntHandler( void );
|
||||
extern void TRNGIntHandler( void );
|
||||
extern void MPUFaultIntHandler(void);
|
||||
extern void BusFaultIntHandler(void);
|
||||
extern void UsageFaultIntHandler(void);
|
||||
extern void SVCallIntHandler(void);
|
||||
extern void DebugMonIntHandler(void);
|
||||
extern void PendSVIntHandler(void);
|
||||
extern void SysTickIntHandler(void);
|
||||
extern void GPIOIntHandler(void);
|
||||
extern void I2CIntHandler(void);
|
||||
extern void RFCCPE1IntHandler(void);
|
||||
extern void AONRTCIntHandler(void);
|
||||
extern void UART0IntHandler(void);
|
||||
extern void AUXSWEvent0IntHandler(void);
|
||||
extern void SSI0IntHandler(void);
|
||||
extern void SSI1IntHandler(void);
|
||||
extern void RFCCPE0IntHandler(void);
|
||||
extern void RFCHardwareIntHandler(void);
|
||||
extern void RFCCmdAckIntHandler(void);
|
||||
extern void I2SIntHandler(void);
|
||||
extern void AUXSWEvent1IntHandler(void);
|
||||
extern void WatchdogIntHandler(void);
|
||||
extern void Timer0AIntHandler(void);
|
||||
extern void Timer0BIntHandler(void);
|
||||
extern void Timer1AIntHandler(void);
|
||||
extern void Timer1BIntHandler(void);
|
||||
extern void Timer2AIntHandler(void);
|
||||
extern void Timer2BIntHandler(void);
|
||||
extern void Timer3AIntHandler(void);
|
||||
extern void Timer3BIntHandler(void);
|
||||
extern void CryptoIntHandler(void);
|
||||
extern void uDMAIntHandler(void);
|
||||
extern void uDMAErrIntHandler(void);
|
||||
extern void FlashIntHandler(void);
|
||||
extern void SWEvent0IntHandler(void);
|
||||
extern void AUXCombEventIntHandler(void);
|
||||
extern void AONProgIntHandler(void);
|
||||
extern void DynProgIntHandler(void);
|
||||
extern void AUXCompAIntHandler(void);
|
||||
extern void AUXADCIntHandler(void);
|
||||
extern void TRNGIntHandler(void);
|
||||
|
||||
// Default interrupt handlers
|
||||
/* Default interrupt handlers */
|
||||
#pragma weak MPUFaultIntHandler = intDefaultHandler
|
||||
#pragma weak BusFaultIntHandler = intDefaultHandler
|
||||
#pragma weak UsageFaultIntHandler = intDefaultHandler
|
||||
|
@ -51,7 +51,7 @@
|
||||
*/
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
#if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X0_CC26X0)
|
||||
# include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintextCC26xx.c>
|
||||
#include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintextCC26xx.c>
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
@ -82,7 +82,7 @@ trng_rand(uint8_t *entropy_buf, size_t entropy_len, uint32_t timeout_us)
|
||||
|
||||
TRNG_close(trng_handle);
|
||||
|
||||
return (result == TRNG_STATUS_SUCCESS);
|
||||
return result == TRNG_STATUS_SUCCESS;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
|
@ -58,7 +58,7 @@
|
||||
#define netstack_cmd_rx rf_cmd_ieee_rx
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#else
|
||||
# error "Unsupported RF_MODE"
|
||||
#error "Unsupported RF_MODE"
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* BLE RF settings */
|
||||
@ -84,7 +84,7 @@
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#else
|
||||
# error "Unsupported DeviceFamily_PARENT for BLE settings"
|
||||
#error "Unsupported DeviceFamily_PARENT for BLE settings"
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* NETSTACK_SETTINGS_H_ */
|
||||
|
@ -123,15 +123,15 @@ static ble_beacond_t ble_beacond;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Configuration for TX power table */
|
||||
#ifdef BLE_MODE_CONF_TX_POWER_TABLE
|
||||
# define TX_POWER_TABLE BLE_MODE_CONF_TX_POWER_TABLE
|
||||
#define TX_POWER_TABLE BLE_MODE_CONF_TX_POWER_TABLE
|
||||
#else
|
||||
# define TX_POWER_TABLE rf_ble_tx_power_table
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table
|
||||
#endif
|
||||
|
||||
#ifdef BLE_MODE_CONF_TX_POWER_TABLE_SIZE
|
||||
# define TX_POWER_TABLE_SIZE BLE_MODE_CONF_TX_POWER_TABLE_SIZE
|
||||
#define TX_POWER_TABLE_SIZE BLE_MODE_CONF_TX_POWER_TABLE_SIZE
|
||||
#else
|
||||
# define TX_POWER_TABLE_SIZE RF_BLE_TX_POWER_TABLE_SIZE
|
||||
#define TX_POWER_TABLE_SIZE RF_BLE_TX_POWER_TABLE_SIZE
|
||||
#endif
|
||||
|
||||
/* TX power table convenience macros */
|
||||
|
@ -71,9 +71,9 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Default band selection to band 4 - 863MHz */
|
||||
#ifdef DOT_15_4G_CONF_FREQ_BAND_ID
|
||||
# define DOT_15_4G_FREQ_BAND_ID DOT_15_4G_CONF_FREQ_BAND_ID
|
||||
#define DOT_15_4G_FREQ_BAND_ID DOT_15_4G_CONF_FREQ_BAND_ID
|
||||
#else
|
||||
# define DOT_15_4G_FREQ_BAND_ID DOT_15_4G_FREQ_BAND_863
|
||||
#define DOT_15_4G_FREQ_BAND_ID DOT_15_4G_FREQ_BAND_863
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
@ -84,67 +84,67 @@
|
||||
* DOT_15_4G_CHAN0_FREQ is specified here in KHz
|
||||
*/
|
||||
#if (DOT_15_4G_FREQ_BAND_ID == DOT_15_4G_FREQ_BAND_470)
|
||||
# define DOT_15_4G_CHAN_MIN 0
|
||||
# define DOT_15_4G_CHAN_MAX 198
|
||||
# define DOT_15_4G_FREQ_SPACING 200
|
||||
# define DOT_15_4G_CHAN0_FREQ 470200
|
||||
#define DOT_15_4G_CHAN_MIN 0
|
||||
#define DOT_15_4G_CHAN_MAX 198
|
||||
#define DOT_15_4G_FREQ_SPACING 200
|
||||
#define DOT_15_4G_CHAN0_FREQ 470200
|
||||
|
||||
# define PROP_MODE_CONF_CENTER_FREQ 0x01EA
|
||||
# define PROP_MODE_CONF_LO_DIVIDER 0x0A
|
||||
#define PROP_MODE_CONF_CENTER_FREQ 0x01EA
|
||||
#define PROP_MODE_CONF_LO_DIVIDER 0x0A
|
||||
|
||||
#elif (DOT_15_4G_FREQ_BAND_ID == DOT_15_4G_FREQ_BAND_780)
|
||||
# define DOT_15_4G_CHAN_MIN 0
|
||||
# define DOT_15_4G_CHAN_MAX 38
|
||||
# define DOT_15_4G_FREQ_SPACING 200
|
||||
# define DOT_15_4G_CHAN0_FREQ 779200
|
||||
#define DOT_15_4G_CHAN_MIN 0
|
||||
#define DOT_15_4G_CHAN_MAX 38
|
||||
#define DOT_15_4G_FREQ_SPACING 200
|
||||
#define DOT_15_4G_CHAN0_FREQ 779200
|
||||
|
||||
# define PROP_MODE_CONF_CENTER_FREQ 0x030F
|
||||
# define PROP_MODE_CONF_LO_DIVIDER 0x06
|
||||
#define PROP_MODE_CONF_CENTER_FREQ 0x030F
|
||||
#define PROP_MODE_CONF_LO_DIVIDER 0x06
|
||||
|
||||
#elif (DOT_15_4G_FREQ_BAND_ID == DOT_15_4G_FREQ_BAND_863)
|
||||
# define DOT_15_4G_CHAN_MIN 0
|
||||
# define DOT_15_4G_CHAN_MAX 33
|
||||
# define DOT_15_4G_FREQ_SPACING 200
|
||||
# define DOT_15_4G_CHAN0_FREQ 863125
|
||||
#define DOT_15_4G_CHAN_MIN 0
|
||||
#define DOT_15_4G_CHAN_MAX 33
|
||||
#define DOT_15_4G_FREQ_SPACING 200
|
||||
#define DOT_15_4G_CHAN0_FREQ 863125
|
||||
|
||||
# define PROP_MODE_CONF_CENTER_FREQ 0x0362
|
||||
# define PROP_MODE_CONF_LO_DIVIDER 0x05
|
||||
#define PROP_MODE_CONF_CENTER_FREQ 0x0362
|
||||
#define PROP_MODE_CONF_LO_DIVIDER 0x05
|
||||
|
||||
#elif (DOT_15_4G_FREQ_BAND_ID == DOT_15_4G_FREQ_BAND_915)
|
||||
# define DOT_15_4G_CHAN_MIN 0
|
||||
# define DOT_15_4G_CHAN_MAX 128
|
||||
# define DOT_15_4G_FREQ_SPACING 200
|
||||
# define DOT_15_4G_CHAN0_FREQ 902200
|
||||
#define DOT_15_4G_CHAN_MIN 0
|
||||
#define DOT_15_4G_CHAN_MAX 128
|
||||
#define DOT_15_4G_FREQ_SPACING 200
|
||||
#define DOT_15_4G_CHAN0_FREQ 902200
|
||||
|
||||
# define PROP_MODE_CONF_CENTER_FREQ 0x0393
|
||||
# define PROP_MODE_CONF_LO_DIVIDER 0x05
|
||||
#define PROP_MODE_CONF_CENTER_FREQ 0x0393
|
||||
#define PROP_MODE_CONF_LO_DIVIDER 0x05
|
||||
|
||||
#elif (DOT_15_4G_FREQ_BAND_ID == DOT_15_4G_FREQ_BAND_920)
|
||||
# define DOT_15_4G_CHAN_MIN 0
|
||||
# define DOT_15_4G_CHAN_MAX 37
|
||||
# define DOT_15_4G_FREQ_SPACING 200
|
||||
# define DOT_15_4G_CHAN0_FREQ 920600
|
||||
#define DOT_15_4G_CHAN_MIN 0
|
||||
#define DOT_15_4G_CHAN_MAX 37
|
||||
#define DOT_15_4G_FREQ_SPACING 200
|
||||
#define DOT_15_4G_CHAN0_FREQ 920600
|
||||
|
||||
# define PROP_MODE_CONF_CENTER_FREQ 0x039C
|
||||
# define PROP_MODE_CONF_LO_DIVIDER 0x05
|
||||
#define PROP_MODE_CONF_CENTER_FREQ 0x039C
|
||||
#define PROP_MODE_CONF_LO_DIVIDER 0x05
|
||||
|
||||
#elif (DOT_15_4G_FREQ_BAND_ID == DOT_15_4G_FREQ_BAND_950)
|
||||
# define DOT_15_4G_CHAN_MIN 0
|
||||
# define DOT_15_4G_CHAN_MAX 32
|
||||
# define DOT_15_4G_FREQ_SPACING 200
|
||||
# define DOT_15_4G_CHAN0_FREQ 951000
|
||||
#define DOT_15_4G_CHAN_MIN 0
|
||||
#define DOT_15_4G_CHAN_MAX 32
|
||||
#define DOT_15_4G_FREQ_SPACING 200
|
||||
#define DOT_15_4G_CHAN0_FREQ 951000
|
||||
|
||||
# define PROP_MODE_CONF_CENTER_FREQ 0x03BA
|
||||
# define PROP_MODE_CONF_LO_DIVIDER 0x05
|
||||
#define PROP_MODE_CONF_CENTER_FREQ 0x03BA
|
||||
#define PROP_MODE_CONF_LO_DIVIDER 0x05
|
||||
|
||||
#elif (DOT_15_4G_FREQ_BAND_ID == DOT_15_4G_FREQ_BAND_2450)
|
||||
# define DOT_15_4G_CHAN_MIN 11
|
||||
# define DOT_15_4G_CHAN_MAX 26
|
||||
# define DOT_15_4G_FREQ_SPACING 5000
|
||||
# define DOT_15_4G_CHAN0_FREQ 2405000
|
||||
#define DOT_15_4G_CHAN_MIN 11
|
||||
#define DOT_15_4G_CHAN_MAX 26
|
||||
#define DOT_15_4G_FREQ_SPACING 5000
|
||||
#define DOT_15_4G_CHAN0_FREQ 2405000
|
||||
|
||||
#else
|
||||
# error "The selected IEEE 802.15.4g frequency band is not supported"
|
||||
#error "The selected IEEE 802.15.4g frequency band is not supported"
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static inline uint32_t
|
||||
@ -153,7 +153,7 @@ dot_15_4g_freq(const uint16_t chan)
|
||||
const uint32_t chan0 = DOT_15_4G_CHAN0_FREQ;
|
||||
const uint32_t spacing = DOT_15_4G_FREQ_SPACING;
|
||||
const uint32_t chan_min = DOT_15_4G_CHAN_MIN;
|
||||
return (chan0 + spacing * ((uint32_t)chan - chan_min));
|
||||
return chan0 + spacing * ((uint32_t)chan - chan_min);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static inline bool
|
||||
@ -161,8 +161,8 @@ dot_15_4g_chan_in_range(const uint16_t chan)
|
||||
{
|
||||
const uint16_t chan_min = DOT_15_4G_CHAN_MIN;
|
||||
const uint16_t chan_max = DOT_15_4G_CHAN_MAX;
|
||||
return ((chan >= chan_min) &&
|
||||
(chan <= chan_max));
|
||||
return (chan >= chan_min) &&
|
||||
(chan <= chan_max);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define DOT_15_4G_DEFAULT_CHAN IEEE802154_DEFAULT_CHANNEL
|
||||
|
@ -80,7 +80,7 @@
|
||||
#include <stdbool.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if 1
|
||||
# define PRINTF(...) printf(__VA_ARGS__)
|
||||
#define PRINTF(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
# define PRINTF(...)
|
||||
#endif
|
||||
@ -89,23 +89,23 @@
|
||||
|
||||
/* Configuration to enable/disable auto ACKs in IEEE mode */
|
||||
#ifdef IEEE_MODE_CONF_AUTOACK
|
||||
# define IEEE_MODE_AUTOACK IEEE_MODE_CONF_AUTOACK
|
||||
#define IEEE_MODE_AUTOACK IEEE_MODE_CONF_AUTOACK
|
||||
#else
|
||||
# define IEEE_MODE_AUTOACK 1
|
||||
#define IEEE_MODE_AUTOACK 1
|
||||
#endif /* IEEE_MODE_CONF_AUTOACK */
|
||||
|
||||
/* Configuration to enable/disable frame filtering in IEEE mode */
|
||||
#ifdef IEEE_MODE_CONF_PROMISCOUS
|
||||
# define IEEE_MODE_PROMISCOUS IEEE_MODE_CONF_PROMISCOUS
|
||||
#define IEEE_MODE_PROMISCOUS IEEE_MODE_CONF_PROMISCOUS
|
||||
#else
|
||||
# define IEEE_MODE_PROMISCOUS 0
|
||||
#define IEEE_MODE_PROMISCOUS 0
|
||||
#endif /* IEEE_MODE_CONF_PROMISCOUS */
|
||||
|
||||
/* Configuration to set the RSSI threshold */
|
||||
#ifdef IEEE_MODE_CONF_RSSI_THRESHOLD
|
||||
# define IEEE_MODE_RSSI_THRESHOLD IEEE_MODE_CONF_RSSI_THRESHOLD
|
||||
#define IEEE_MODE_RSSI_THRESHOLD IEEE_MODE_CONF_RSSI_THRESHOLD
|
||||
#else
|
||||
# define IEEE_MODE_RSSI_THRESHOLD 0xA6
|
||||
#define IEEE_MODE_RSSI_THRESHOLD 0xA6
|
||||
#endif /* IEEE_MODE_CONF_RSSI_THRESHOLD */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table convenience macros */
|
||||
@ -206,7 +206,11 @@ static cmd_mod_filt_t cmd_mod_filt;
|
||||
#define cmd_rx (*(volatile rfc_CMD_IEEE_RX_t*) &rf_cmd_ieee_rx)
|
||||
#define cmd_rx_ack (*(volatile rfc_CMD_IEEE_RX_ACK_t*)&rf_cmd_ieee_rx_ack)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static inline bool rx_is_active(void) { return cmd_rx.status == ACTIVE; }
|
||||
static inline bool
|
||||
rx_is_active(void)
|
||||
{
|
||||
return cmd_rx.status == ACTIVE;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Forward declarations of local functions */
|
||||
static void check_rat_overflow(void);
|
||||
@ -515,7 +519,7 @@ read(void *buf, unsigned short buf_len)
|
||||
const rtimer_clock_t t0 = RTIMER_NOW();
|
||||
/* Only wait if the Radio timer is accessing the entry */
|
||||
while((data_entry->status == DATA_ENTRY_BUSY) &&
|
||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + TIMEOUT_DATA_ENTRY_BUSY));
|
||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + TIMEOUT_DATA_ENTRY_BUSY)) ;
|
||||
|
||||
if(data_entry->status != DATA_ENTRY_FINISHED) {
|
||||
/* No available data */
|
||||
@ -602,7 +606,7 @@ cca_request(cmd_cca_req_t *cmd_cca_req)
|
||||
|
||||
const rtimer_clock_t t0 = RTIMER_NOW();
|
||||
while((cmd_rx.status != ACTIVE) &&
|
||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + TIMEOUT_ENTER_RX_WAIT));
|
||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + TIMEOUT_ENTER_RX_WAIT)) ;
|
||||
|
||||
RF_Stat stat = RF_StatRadioInactiveError;
|
||||
if(rx_is_active()) {
|
||||
@ -630,7 +634,7 @@ channel_clear(void)
|
||||
}
|
||||
|
||||
/* Channel is clear if CCA state is IDLE */
|
||||
return (cmd_cca_req.ccaInfo.ccaState == CCA_STATE_IDLE);
|
||||
return cmd_cca_req.ccaInfo.ccaState == CCA_STATE_IDLE;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
@ -653,7 +657,7 @@ receiving_packet(void)
|
||||
}
|
||||
|
||||
/* We are receiving a packet if a CCA sync has been seen, i.e. ccaSync is busy (1) */
|
||||
return (cmd_cca_req.ccaInfo.ccaSync == CCA_STATE_BUSY);
|
||||
return cmd_cca_req.ccaInfo.ccaSync == CCA_STATE_BUSY;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
@ -840,7 +844,6 @@ set_value(radio_param_t param, radio_value_t value)
|
||||
return (on() == RF_RESULT_OK)
|
||||
? RADIO_RESULT_OK
|
||||
: RADIO_RESULT_ERROR;
|
||||
|
||||
} else if(value == RADIO_POWER_MODE_OFF) {
|
||||
off();
|
||||
return RADIO_RESULT_OK;
|
||||
|
@ -85,15 +85,15 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Data whitener. 1: Whitener, 0: No whitener */
|
||||
#ifdef PROP_MODE_CONF_DW
|
||||
# define PROP_MODE_DW PROP_MODE_CONF_DW
|
||||
#define PROP_MODE_DW PROP_MODE_CONF_DW
|
||||
#else
|
||||
# define PROP_MODE_DW 0
|
||||
#define PROP_MODE_DW 0
|
||||
#endif
|
||||
|
||||
#ifdef PROP_MODE_CONF_USE_CRC16
|
||||
# define PROP_MODE_USE_CRC16 PROP_MODE_CONF_USE_CRC16
|
||||
#define PROP_MODE_USE_CRC16 PROP_MODE_CONF_USE_CRC16
|
||||
#else
|
||||
# define PROP_MODE_USE_CRC16 0
|
||||
#define PROP_MODE_USE_CRC16 0
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Used for checking result of CCA_REQ command */
|
||||
@ -105,9 +105,9 @@
|
||||
#define RF_GET_CCA_INFO_ERROR 0xFF
|
||||
|
||||
#ifdef PROP_MODE_CONF_RSSI_THRESHOLD
|
||||
# define PROP_MODE_RSSI_THRESHOLD PROP_MODE_CONF_RSSI_THRESHOLD
|
||||
#define PROP_MODE_RSSI_THRESHOLD PROP_MODE_CONF_RSSI_THRESHOLD
|
||||
#else
|
||||
# define PROP_MODE_RSSI_THRESHOLD 0xA6
|
||||
#define PROP_MODE_RSSI_THRESHOLD 0xA6
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Defines and variables related to the .15.4g PHY HDR */
|
||||
@ -120,18 +120,18 @@
|
||||
|
||||
#if PROP_MODE_USE_CRC16
|
||||
/* CRC16 */
|
||||
# define DOT_4G_PHR_CRC_BIT DOT_4G_PHR_CRC16
|
||||
# define CRC_LEN 2
|
||||
#define DOT_4G_PHR_CRC_BIT DOT_4G_PHR_CRC16
|
||||
#define CRC_LEN 2
|
||||
#else
|
||||
/* CRC32 */
|
||||
# define DOT_4G_PHR_CRC_BIT 0
|
||||
# define CRC_LEN 4
|
||||
#define DOT_4G_PHR_CRC_BIT 0
|
||||
#define CRC_LEN 4
|
||||
#endif /* PROP_MODE_USE_CRC16 */
|
||||
|
||||
#if PROP_MODE_DW
|
||||
# define DOT_4G_PHR_DW_BIT DOT_4G_PHR_DW
|
||||
#define DOT_4G_PHR_DW_BIT DOT_4G_PHR_DW
|
||||
#else
|
||||
#define DOT_4G_PHR_DW_BIT 0
|
||||
#define DOT_4G_PHR_DW_BIT 0
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* How long to wait for the RF to enter RX in rf_cmd_ieee_rx */
|
||||
@ -197,8 +197,16 @@ static prop_radio_t prop_radio;
|
||||
#define cmd_tx (*(volatile rfc_CMD_PROP_TX_ADV_t *) &rf_cmd_prop_tx_adv)
|
||||
#define cmd_rx (*(volatile rfc_CMD_PROP_RX_ADV_t *) &rf_cmd_prop_rx_adv)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static inline bool tx_is_active(void) { return cmd_tx.status == ACTIVE; }
|
||||
static inline bool rx_is_active(void) { return cmd_rx.status == ACTIVE; }
|
||||
static inline bool
|
||||
tx_is_active(void)
|
||||
{
|
||||
return cmd_tx.status == ACTIVE;
|
||||
}
|
||||
static inline bool
|
||||
rx_is_active(void)
|
||||
{
|
||||
return cmd_rx.status == ACTIVE;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int on(void);
|
||||
static int off(void);
|
||||
@ -232,7 +240,7 @@ get_rssi(void)
|
||||
|
||||
const rtimer_clock_t t0 = RTIMER_NOW();
|
||||
while((cmd_rx.status != ACTIVE) &&
|
||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + TIMEOUT_ENTER_RX_WAIT));
|
||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + TIMEOUT_ENTER_RX_WAIT)) ;
|
||||
|
||||
int8_t rssi = RF_GET_RSSI_ERROR_VAL;
|
||||
if(rx_is_active()) {
|
||||
@ -377,7 +385,7 @@ read(void *buf, unsigned short buf_len)
|
||||
const rtimer_clock_t t0 = RTIMER_NOW();
|
||||
/* Only wait if the Radio is accessing the entry */
|
||||
while((data_entry->status == DATA_ENTRY_BUSY) &&
|
||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + TIMEOUT_DATA_ENTRY_BUSY));
|
||||
RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + TIMEOUT_DATA_ENTRY_BUSY)) ;
|
||||
|
||||
if(data_entry->status != DATA_ENTRY_FINISHED) {
|
||||
/* No available data */
|
||||
@ -466,7 +474,7 @@ channel_clear(void)
|
||||
const uint8_t cca_state = cca_request();
|
||||
|
||||
/* Channel is clear if CCA state is IDLE */
|
||||
return (cca_state == CCA_STATE_IDLE);
|
||||
return cca_state == CCA_STATE_IDLE;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
@ -478,7 +486,7 @@ receiving_packet(void)
|
||||
|
||||
const uint8_t cca_state = cca_request();
|
||||
|
||||
return (cca_state == CCA_STATE_BUSY);
|
||||
return cca_state == CCA_STATE_BUSY;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
@ -617,7 +625,6 @@ set_value(radio_param_t param, radio_value_t value)
|
||||
return (on() == RF_RESULT_OK)
|
||||
? RADIO_RESULT_OK
|
||||
: RADIO_RESULT_ERROR;
|
||||
|
||||
} else if(value == RADIO_POWER_MODE_OFF) {
|
||||
off();
|
||||
return RADIO_RESULT_OK;
|
||||
|
@ -64,9 +64,9 @@
|
||||
#include <string.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if 1
|
||||
# define PRINTF(...) printf(__VA_ARGS__)
|
||||
#define PRINTF(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
# define PRINTF(...)
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define CMD_FS_RETRIES 3
|
||||
@ -276,7 +276,6 @@ netstack_sched_fs(void)
|
||||
|
||||
synth_error = (EVENTS_CMD_DONE(events))
|
||||
&& (CMD_STATUS(netstack_cmd_fs) == ERROR_SYNTH_PROG);
|
||||
|
||||
} while(synth_error && (num_tries++ < CMD_FS_RETRIES));
|
||||
|
||||
cmd_rx_restore(rx_key);
|
||||
|
Loading…
Reference in New Issue
Block a user