Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Legacy) develop_FW-866 OpenRadio interface #504

Open
wants to merge 48 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6ffee84
Initial commit of code compiling and working and synching but not ful…
minarady1 Mar 10, 2020
92a27e9
wrote radio_set_modulation and radio_local_bootstrap
minarady1 Mar 11, 2020
9035323
some updates
minarady1 Mar 12, 2020
9999fe1
open radio working :)
minarady1 Mar 12, 2020
ff29667
some updates, mainly trying to debug
minarady1 Mar 13, 2020
eebd083
updates
minarady1 Mar 13, 2020
133dc1c
radio at86rf files
minarady1 Mar 13, 2020
984444a
Integrating cc2538rf into the open radio interface
minarady1 Mar 19, 2020
9273ca3
using openradio in openwsn
minarady1 Mar 20, 2020
a6468d7
open radio interface finally working and integrated into openwsn
minarady1 Mar 23, 2020
1669b80
full radio set added to openradio
minarady1 Mar 26, 2020
999f50f
Complete open radio interface for openmote-b tested with 7 modulations.
minarady1 Mar 30, 2020
917665d
Restoring default configuration
minarady1 Mar 30, 2020
64006b5
restoring default config
minarady1 Mar 30, 2020
0de94cb
resorting default configurations and removing unnecessary code used f…
minarady1 Mar 30, 2020
185038e
restoring bsp_radio_tx default code
minarady1 Mar 30, 2020
ecc3bd2
restoring sniffer code
minarady1 Mar 30, 2020
56ed0cf
restoring sniffer code
minarady1 Mar 30, 2020
480f1dc
restoring sniffer code
minarady1 Mar 30, 2020
9226da2
restoring bsp_radio_rx code
minarady1 Mar 30, 2020
6dda3e9
A project for demonstrating the open radio interface on openmote-b:
minarady1 Mar 30, 2020
39a1bdc
Merge branch 'develop_FW-866' of https://github.com/minarady1/openwsn…
minarady1 Mar 30, 2020
f0d59e5
openradio interface cleaning in progress
minarady1 Apr 15, 2020
6bae185
modivided slot 40 for FSK and added slot 41 for ofdm1 mcs3
minarady1 Apr 16, 2020
75b7eb1
introduced slot_template instead of slot duration
minarady1 Apr 16, 2020
d2b9c40
cleaneing openradio interface + adding comments + using slot template…
minarady1 Apr 16, 2020
0166d42
comments+cleaning
minarady1 Apr 16, 2020
aa7237b
Merge branch 'develop' into develop_FW-866
minarady1 Apr 16, 2020
2464d80
minor fixes
minarady1 Apr 16, 2020
f23a799
macpong
minarady1 Apr 16, 2020
4882b35
Merge branch 'develop_FW-866' of https://github.com/minarady1/openwsn…
minarady1 Apr 16, 2020
c9f560e
changing slot templates to struct variables instead of #def constants
minarady1 Apr 17, 2020
e5fdab3
slot_duration struct update
minarady1 Apr 17, 2020
4e484f2
adding few helper functions to handle slot info
minarady1 Apr 17, 2020
74ca322
quick update
minarady1 Apr 17, 2020
48f3080
fixed dynamic slot selection + code formatting
minarady1 Apr 21, 2020
6ecca16
Final fixes to the dynamic slot selection at runtime. This feature no…
minarady1 Apr 22, 2020
49d565f
cleaning up code for bsp, projacts, MAC, IAR project files and .gitig…
minarady1 Apr 23, 2020
a506320
Updated radio drivers for python board + at86rf231 board to be compli…
minarady1 Apr 23, 2020
6a8f446
restoring defaults
minarady1 Apr 23, 2020
5e6ca11
FW-866 fixed slot template timing references as per PR comments
minarady1 Apr 24, 2020
ba85ad8
FW-866 merged board_setSlotType (slotType) and slot_board_vars_t boar…
minarady1 Apr 24, 2020
c861218
FW-866 fixing indentation, variable names for openradio + adjusting 2…
minarady1 Apr 24, 2020
5110952
FW-866 restoring tx/rx common project
minarady1 Apr 24, 2020
5538db7
increased testbed bootload timeout
minarady1 May 6, 2020
1a1926b
fw-866
minarady1 Jul 1, 2020
cdf2911
fw-866
minarady1 Aug 5, 2020
e5b34b3
fw-866
minarady1 Aug 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ settings
/projects/telosb/01bsp_uart/path.txt
/projects/telosb/03oos_macpong/path.txt
/projects/telosb/02drv_opentimers/path.txt
/projects/openmote-b/01bsp_openradio_rx/log.txt
/projects/openmote-b/01bsp_radio_tx/asm.s
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b-subghz/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@

#define NUMSENSORS 7


//====== Antenna options ====
#define BSP_ANTENNA_BASE GPIO_D_BASE
#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz
#define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_3 //!< PD3 -- subghz
#define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_3 //!< PD3 -- subghz
//#define DAGROOT

//=========================== typedef ========================================
Expand All @@ -128,7 +129,6 @@ static const uint8_t rreg_uriquery[] = "h=ucb";
static const uint8_t infoBoardname[] = "openmote-b-subghz";
static const uint8_t infouCName[] = "CC2538";
static const uint8_t infoRadioName[] = "CC2538 SoC";

minarady1 marked this conversation as resolved.
Show resolved Hide resolved
//=========================== prototypes ======================================

//=========================== public ==========================================
Expand Down
15 changes: 14 additions & 1 deletion bsp/boards/openmote-b/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ si70x = localEnv.SConscript(
exports = {'env': env},
)

cc2538rf = localEnv.SConscript(
os.path.join('#','bsp','chips','cc2538rf','SConscript'),
variant_dir = 'cc2538rf',
exports = {'env': env},
)
rf215 = localEnv.SConscript(
os.path.join('#','bsp','chips','at86rf215','SConscript'),
variant_dir = 'rf215',
exports = {'env': env},
)

source = \
[file for file in Glob('*.c') if file.name.find('iar')==-1] + \
Glob('source/*.c')
Expand All @@ -19,10 +30,12 @@ localEnv.Append(
os.path.join('#','bsp','boards','openmote-b'),
os.path.join('#','bsp','boards','openmote-b','headers'),
os.path.join('#','bsp','boards','openmote-b','source'),
os.path.join('#','bsp','chips','cc2538rf'),
os.path.join('#','bsp','chips','si70x'),
os.path.join('#','bsp','chips','at86rf215'),
],
)

board = localEnv.Object(source=source) + si70x
board = localEnv.Object(source=source) + si70x + rf215 + cc2538rf

Return('board')
204 changes: 125 additions & 79 deletions bsp/boards/openmote-b/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <source/sys_ctrl.h>

#include "board.h"
#include "board_info.h"
#include "debugpins.h"
#include "i2c.h"
#include "leds.h"
Expand All @@ -28,16 +29,11 @@
#include "uart.h"
#include "cryptoengine.h"

//=========================== variables =======================================
//=========================== defines =======================================

#define BSP_BUTTON_BASE ( GPIO_C_BASE )
#define BSP_BUTTON_USER ( GPIO_PIN_3 )
#define BSP_BUTTON_BASE ( GPIO_D_BASE )
#define BSP_BUTTON_USER ( GPIO_PIN_5 )

#ifdef REVA1 //Rev.A1 uses SF23 cc2538 which start at diffferent location
#define CC2538_FLASH_ADDRESS ( 0x0023F800 )
#else
#define CC2538_FLASH_ADDRESS ( 0x0027F800 )
#endif
//=========================== prototypes ======================================

void board_timer_init(void);
Expand All @@ -47,17 +43,18 @@ bool board_timer_expired(uint32_t future);
static void clock_init(void);
static void gpio_init(void);
static void button_init(void);
static void antenna_init(void);

static void antenna_init(void);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are 2 antennas, why these functions?!?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not really sure. My understanding is the they define which radio chip uses the 24ghz antenna

Copy link

@dbarthel-ol dbarthel-ol Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, there are two antennas on the OpenMoteB. One antenna is 2.4 GHz only, the other one is 868 MHz only. And there are 3 radios in total, two at 2.4 GHz and one at 868 MHz. On the OpenMoteB schematic, I see U8 (bottom right), which looks like an RF switch. It switches the 2.4 GHz antenna between the cc2538 2.4 GHz radio port and the at86rf215 2.4 GHz radio port. PD3 and PD4 of the cc2538 look like the control signals of this RF switch. The functions discussed here activate these PD3 and PD4 signals. (see lines 104-111 of this file, and lines 75-76 of board_info.h)

void antenna_cc2538(void);
void antenna_at86rf215(void);

static void SysCtrlDeepSleepSetting(void);
static void SysCtrlSleepSetting(void);
static void SysCtrlRunSetting(void);
static void SysCtrlWakeupSetting(void);

static void GPIO_C_Handler(void);

bool user_button_initialized;
//=========================== variables ============================================
slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES-1];

//=========================== main ============================================

Expand All @@ -70,27 +67,45 @@ int main(void) {
//=========================== public ==========================================

void board_init(void) {
user_button_initialized = FALSE;

gpio_init();
clock_init();
antenna_init();
board_timer_init();
leds_init();
debugpins_init();
button_init();
sctimer_init();
uart_init();
radio_init();
i2c_init();
sensors_init();
cryptoengine_init();

gpio_init();
clock_init();
antenna_init();
board_timer_init();
leds_init();
debugpins_init();
button_init();
sctimer_init();
uart_init();
radio_init();
i2c_init();
board_init_slot_vars();
// sensors_init();
cryptoengine_init();
}

void antenna_init(void) {
//use cc2538 2.4ghz radio
GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, BSP_ANTENNA_CC2538_24GHZ);
GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, 0);
/* Configure GPIO as output */
GPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ);
GPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ);

#ifdef ATMEL_24GHZ
// atmel is using 2.4ghz, connect antenna to atrf215
antenna_at86rf215();
#else
// atmel is not using 2.4ghz, connect antenna to cc2538
antenna_cc2538();
#endif
}

void antenna_cc2538(void) {
GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, 0);
GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, BSP_ANTENNA_AT215_24GHZ);
}

void antenna_at86rf215(void) {
GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, 0);
GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, BSP_ANTENNA_CC2538_24GHZ);
}

/**
Expand All @@ -106,10 +121,10 @@ void board_sleep(void) {
* The timer is divided by 32, whichs gives a 1 microsecond ticks
*/
void board_timer_init(void) {
// Configure the timer
/* Configure the timer */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments are always //

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did my best fixing those now., I see this style used many board definitions

TimerConfigure(GPTIMER2_BASE, GPTIMER_CFG_PERIODIC_UP);
// Enable the timer

/* Enable the timer */
TimerEnable(GPTIMER2_BASE, GPTIMER_BOTH);
}

Expand All @@ -119,9 +134,10 @@ void board_timer_init(void) {
*/
uint32_t board_timer_get(void) {
uint32_t current;


/* Get the current timer value */
current = TimerValueGet(GPTIMER2_BASE, GPTIMER_A) >> 5;

return current;
}

Expand All @@ -133,17 +149,81 @@ bool board_timer_expired(uint32_t future) {
uint32_t current;
int32_t remaining;

/* Get current time */
minarady1 marked this conversation as resolved.
Show resolved Hide resolved
current = TimerValueGet(GPTIMER2_BASE, GPTIMER_A) >> 5;

/* Calculate remaining time */
remaining = (int32_t) (future - current);


/* Return if timer has expired */
if (remaining > 0) {
return false;
} else {
return true;
}
}

//==== bootstrapping slot info lookup table
void board_init_slot_vars(void){
//10ms slot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't care about anything than 3 settings, and 40ms timeslots.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the 10ms and 20ms are used in other board, should I definitely remove them? @changtengfei @TimothyClaeys

slot_board_vars [SLOT_10ms].PORT_SLOTDURATION = 10 ; // ms
slot_board_vars [SLOT_10ms].PORT_TsSlotDuration = 328 ; // counter counts one extra count, see datasheet
slot_board_vars [SLOT_10ms].PORT_maxTxDataPrepare = 10 ; // 305us (measured 82us)
slot_board_vars [SLOT_10ms].PORT_maxRxAckPrepare = 10 ; // 305us (measured 83us)
slot_board_vars [SLOT_10ms].PORT_maxRxDataPrepare = 4 ; // 122us (measured 22us)
slot_board_vars [SLOT_10ms].PORT_maxTxAckPrepare = 10 ; // 122us (measured 94us)
#ifdef L2_SECURITY_ACTIVE
slot_board_vars [SLOT_10ms].PORT_delayTx = 14 ; // 366us (measured xxxus)
#else
slot_board_vars [SLOT_10ms].PORT_delayTx = 12 ; // 366us (measured xxxus)
#endif
slot_board_vars [SLOT_10ms].PORT_delayRx = 0 ; // 0us (can not measure)

// 20ms slot
slot_board_vars [SLOT_20ms_24GHZ].PORT_SLOTDURATION = 20 ; // ms
slot_board_vars [SLOT_20ms_24GHZ].PORT_TsSlotDuration = 1310 ; // 20ms
slot_board_vars [SLOT_20ms_24GHZ].PORT_maxTxDataPrepare = 110 ; // 3355us (not measured)
slot_board_vars [SLOT_20ms_24GHZ].PORT_maxRxAckPrepare = 20 ; // 610us (not measured)
slot_board_vars [SLOT_20ms_24GHZ].PORT_maxRxDataPrepare = 33 ; // 1000us (not measured)
slot_board_vars [SLOT_20ms_24GHZ].PORT_maxTxAckPrepare = 50 ; // 1525us (not measured)
slot_board_vars [SLOT_20ms_24GHZ].PORT_delayTx = 18 ; // 549us (not measured)
slot_board_vars [SLOT_20ms_24GHZ].PORT_delayRx = 0 ; // 0us (can not measure)

//40ms slot for 24ghz cc2538
slot_board_vars [SLOT_40ms_24GHZ].PORT_SLOTDURATION = 40 ; // ms
slot_board_vars [SLOT_40ms_24GHZ].PORT_TsSlotDuration = 1310 ; // 40ms
slot_board_vars [SLOT_40ms_24GHZ].PORT_maxTxDataPrepare = 10 ; // 305us
slot_board_vars [SLOT_40ms_24GHZ].PORT_maxRxAckPrepare = 10 ; // 305us
slot_board_vars [SLOT_40ms_24GHZ].PORT_maxRxDataPrepare = 4 ; // 122us
slot_board_vars [SLOT_40ms_24GHZ].PORT_maxTxAckPrepare = 10 ; // 305us
#ifdef L2_SECURITY_ACTIVE = ;
slot_board_vars [SLOT_40ms_24GHZ].PORT_delayTx = 14 ; // 366us (measured xxxus)
#else = ;
slot_board_vars [SLOT_40ms_24GHZ].PORT_delayTx = 12 ; // 366us (measured xxxus)
#endif = ;
slot_board_vars [SLOT_40ms_24GHZ].PORT_delayRx = 0 ; // 0us (can not measure)

//40ms slot for FSK
slot_board_vars [SLOT_40ms_FSK_SUBGHZ].PORT_SLOTDURATION = 40 ; // ms
slot_board_vars [SLOT_40ms_FSK_SUBGHZ].PORT_TsSlotDuration = 1310 ; // 40ms
slot_board_vars [SLOT_40ms_FSK_SUBGHZ].PORT_maxTxDataPrepare = 50 ; // 1525 us (based on measurement)
slot_board_vars [SLOT_40ms_FSK_SUBGHZ].PORT_maxRxAckPrepare = 10 ; // 305µs (based on measurement)
slot_board_vars [SLOT_40ms_FSK_SUBGHZ].PORT_maxRxDataPrepare = 10 ; // 305µs (based on measurement)
slot_board_vars [SLOT_40ms_FSK_SUBGHZ].PORT_maxTxAckPrepare = 33 ; // 1000µs (based on measurement)
slot_board_vars [SLOT_40ms_FSK_SUBGHZ].PORT_delayTx = 66 ; // 2000µs (based on measurement)
slot_board_vars [SLOT_40ms_FSK_SUBGHZ].PORT_delayRx = 16 ; // 488µs. This parameter is usually set to 0, however for Atmel on openmote-b, it takes at least 1ms for the transmission to occure because of spi delay (or other implementation specific overhead), so reciver is expected to wait a little more before turning on the radio.

//40ms slot for OFDM1 MCS0-3
slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].PORT_SLOTDURATION = 40 ; // ms
slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].PORT_TsSlotDuration = 1310 ; // 40ms
slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].PORT_maxTxDataPrepare = 50 ; //1525us (based on measurement)
slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].PORT_maxRxAckPrepare = 10 ; //305us (based on measurement)
slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].PORT_maxRxDataPrepare = 10 ; //305us (based on measurement)
slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].PORT_maxTxAckPrepare = 33 ; //1000us (based on measurement)
slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].PORT_delayTx = 41 ; //1251us (based on measurement)
slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].PORT_delayRx = 16 ; // 488µs. This parameter is usually set to 0, however for Atmel on openmote-b, it takes at least 1ms for the transmission to occure because of spi delay (or other implementation specific overhead), so reciver is expected to wait a little more before turning on the radio.
}

/**
* Resets the board
*/
Expand All @@ -154,17 +234,11 @@ void board_reset(void) {
//=========================== private =========================================

static void gpio_init(void) {
/* Set GPIOs as output */
GPIOPinTypeGPIOOutput(GPIO_A_BASE, 0xFF);
GPIOPinTypeGPIOOutput(GPIO_B_BASE, 0xFF);
GPIOPinTypeGPIOOutput(GPIO_C_BASE, 0xFF);
GPIOPinTypeGPIOOutput(GPIO_D_BASE, 0xFF);

/* Initialize GPIOs to low */
GPIOPinWrite(GPIO_A_BASE, 0xFF, 0x00);
GPIOPinWrite(GPIO_B_BASE, 0xFF, 0x00);
GPIOPinWrite(GPIO_C_BASE, 0xFF, 0x00);
GPIOPinWrite(GPIO_D_BASE, 0xFF, 0x00);
/* Configure all GPIO as input */
GPIOPinTypeGPIOInput(GPIO_A_BASE, 0xFF);
GPIOPinTypeGPIOInput(GPIO_B_BASE, 0xFF);
GPIOPinTypeGPIOInput(GPIO_C_BASE, 0xFF);
GPIOPinTypeGPIOInput(GPIO_D_BASE, 0xFF);
}

static void clock_init(void) {
Expand All @@ -183,9 +257,9 @@ static void clock_init(void) {
/* Set the system clock to 32 MHz */
SysCtrlClockSet(true, false, SYS_CTRL_SYSDIV_32MHZ);

/* Set the IO clock to operate at 16 MHz */
/* Set the IO clock to operate at 32 MHz */
/* This way peripherals can run while the system clock is gated */
SysCtrlIOClockSet(SYS_CTRL_SYSDIV_16MHZ);
SysCtrlIOClockSet(SYS_CTRL_SYSDIV_32MHZ);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you make this change?

Copy link
Contributor Author

@minarady1 minarady1 Apr 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just replaced the board.c file with the one from the subghz project by Jonathan since I knew it was working.


/* Wait until the selected clock configuration is stable */
while (!((HWREG(SYS_CTRL_CLOCK_STA)) & (SYS_CTRL_CLOCK_STA_XOSC_STB)));
Expand All @@ -206,25 +280,16 @@ static void clock_init(void) {
* Configures the user button as input source
*/
static void button_init(void) {
volatile uint32_t i;

/* Delay to avoid pin floating problems */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

for (i = 0xFFFF; i != 0; i--);

GPIOPinIntDisable(BSP_BUTTON_BASE, BSP_BUTTON_USER);
GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER);

/* The button is an input GPIO on falling edge */
GPIOPinTypeGPIOInput(BSP_BUTTON_BASE, BSP_BUTTON_USER);
GPIOIntTypeSet(BSP_BUTTON_BASE, BSP_BUTTON_USER, GPIO_FALLING_EDGE);

/* Register the interrupt */
GPIOPortIntRegister(BSP_BUTTON_BASE, GPIO_C_Handler);
/* Enable wake-up capability */
GPIOIntWakeupEnable(GPIO_IWE_PORT_D);

/* Clear and enable the interrupt */
GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER);
GPIOPinIntEnable(BSP_BUTTON_BASE, BSP_BUTTON_USER);
user_button_initialized = TRUE;
}

static void SysCtrlRunSetting(void) {
Expand Down Expand Up @@ -303,22 +368,3 @@ static void SysCtrlWakeupSetting(void) {
}

//=========================== interrupt handlers ==============================

/**
* GPIO_C interrupt handler. User button is GPIO_C_3
* Erases a Flash sector to trigger the bootloader backdoor
*/
static void GPIO_C_Handler(void) {
if (!user_button_initialized) return;
/* Disable the interrupts */
IntMasterDisable();
leds_all_off();

/* Eras the CCA flash page */
FlashMainPageErase(CC2538_FLASH_ADDRESS);

leds_circular_shift();

/* Reset the board */
SysCtrlReset();
}
Loading