-
Notifications
You must be signed in to change notification settings - Fork 241
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
FW-877 Heterogeneous radio settings in the Mesh #508
base: develop
Are you sure you want to change the base?
Changes from 53 commits
6ffee84
92a27e9
9035323
9999fe1
ff29667
eebd083
133dc1c
984444a
9273ca3
a6468d7
1669b80
999f50f
917665d
64006b5
0de94cb
185038e
ecc3bd2
56ed0cf
480f1dc
9226da2
6dda3e9
39a1bdc
f0d59e5
6bae185
75b7eb1
d2b9c40
0166d42
aa7237b
2464d80
f23a799
4882b35
c9f560e
e5fdab3
4e484f2
74ca322
48f3080
6ecca16
49d565f
a506320
6a8f446
5e6ca11
ba85ad8
c861218
5110952
5538db7
0883865
72b22ef
3367bd5
465368e
4abc73e
a6b96db
df696f7
4e89839
03c3689
fb079ab
6110eeb
a5ffc10
9228205
d3ff4c9
079f0a5
6c88226
882c01c
35fcc2b
6b8a157
94c0007
18307b8
149056a
3416093
4e57791
2cc1c38
a531cab
2103354
0aa22f4
4265dab
ac84804
26f4633
a4ada63
2886182
f452684
a0d112e
dc4322a
fe1e99a
969f3d7
35293f6
a32486c
7253599
76bd1a9
9db91b7
6799ad1
766fad7
a6ae140
4350c12
5f7cfbd
01d6ad8
cd8e553
925e8b8
e468bef
61a96db
23ad631
8d3d678
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,10 @@ | |
#include "nvic.h" | ||
#include "debugpins.h" | ||
|
||
//=========================== variable ======================================== | ||
//=========================== variables ======================================= | ||
|
||
slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; | ||
slotType_t selected_slot_type; | ||
|
||
//=========================== private ========================================= | ||
|
||
|
@@ -25,6 +28,8 @@ void GPIO_Config_ALL_AIN(void); | |
// configure the hard fault exception | ||
void board_enableHardFaultExceptionHandler(void); | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only one empty line space between codes, please remove the two empty lines here. |
||
|
||
//=========================== main ============================================ | ||
|
||
extern int mote_main(void); | ||
|
@@ -96,6 +101,35 @@ void board_init(void){ | |
debugpins_init(); | ||
//enable nvic for the radio | ||
NVIC_radio(); | ||
board_init_slot_vars(); | ||
} | ||
|
||
|
||
//==== bootstrapping slot info lookup table | ||
void board_init_slot_vars(void){ | ||
|
||
// 20ms slot | ||
slot_board_vars [SLOT_20ms_24GHZ].slotDuration = 655 ; // ms | ||
slot_board_vars [SLOT_20ms_24GHZ].maxTxDataPrepare = 110 ; // 3355us (not measured) | ||
slot_board_vars [SLOT_20ms_24GHZ].maxRxAckPrepare = 20 ; // 610us (not measured) | ||
slot_board_vars [SLOT_20ms_24GHZ].maxRxDataPrepare = 33 ; // 1000us (not measured) | ||
slot_board_vars [SLOT_20ms_24GHZ].maxTxAckPrepare = 50 ; // 1525us (not measured) | ||
slot_board_vars [SLOT_20ms_24GHZ].delayTx = 18 ; // 549us (not measured) | ||
slot_board_vars [SLOT_20ms_24GHZ].delayRx = 0 ; // 0us (can not measure) | ||
} | ||
|
||
// To get the current slotDuration at any time | ||
// used during initialization by sixtop to fire the first sixtop EB | ||
uint16_t board_getSlotDuration (void) | ||
{ | ||
return slot_board_vars [selected_slot_type].slotDuration; | ||
} | ||
|
||
// Setter/Getter function for slot_board_vars | ||
slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) | ||
{ | ||
selected_slot_type = slot_type; | ||
return slot_board_vars [selected_slot_type]; | ||
} | ||
|
||
void board_sleep(void) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,11 @@ | |
#define BSP_BUTTON_BASE ( GPIO_D_BASE ) | ||
#define BSP_BUTTON_USER ( GPIO_PIN_5 ) | ||
|
||
//=========================== variables ============================================ | ||
slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add one empty line above |
||
slotType_t selected_slot_type; | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove one line here |
||
//=========================== prototypes ====================================== | ||
|
||
void board_timer_init(void); | ||
|
@@ -73,11 +78,50 @@ void board_init(void) { | |
uart_init(); | ||
radio_init(); | ||
i2c_init(); | ||
|
||
board_init_slot_vars(); | ||
// sensors_init(); | ||
cryptoengine_init(); | ||
} | ||
|
||
//==== bootstrapping slot info lookup table | ||
void board_init_slot_vars(void){ | ||
//10ms slot | ||
slot_board_vars [SLOT_10ms].slotDuration = 328 ; // 10ms | ||
slot_board_vars [SLOT_10ms].maxTxDataPrepare = 10 ; // 305us (measured 82us) | ||
slot_board_vars [SLOT_10ms].maxRxAckPrepare = 10 ; // 305us (measured 83us) | ||
slot_board_vars [SLOT_10ms].maxRxDataPrepare = 4 ; // 122us (measured 22us) | ||
slot_board_vars [SLOT_10ms].maxTxAckPrepare = 10 ; // 122us (measured 94us) | ||
#ifdef L2_SECURITY_ACTIVE | ||
slot_board_vars [SLOT_10ms].delayTx = 14 ; // 366us (measured xxxus) | ||
#else | ||
slot_board_vars [SLOT_10ms].delayTx = 12 ; // 366us (measured xxxus) | ||
#endif | ||
slot_board_vars [SLOT_10ms].delayRx = 0 ; // 0us (can not measure) | ||
|
||
// 20ms slot | ||
slot_board_vars [SLOT_20ms_24GHZ].slotDuration = 655 ; // 20ms | ||
slot_board_vars [SLOT_20ms_24GHZ].maxTxDataPrepare = 15 ; // 457us (based on measurement) | ||
slot_board_vars [SLOT_20ms_24GHZ].maxRxAckPrepare = 10 ; // 305us (based on measurement) | ||
slot_board_vars [SLOT_20ms_24GHZ].maxRxDataPrepare = 10 ; // 305us (based on measurement) | ||
slot_board_vars [SLOT_20ms_24GHZ].maxTxAckPrepare = 15 ; // 457us (based on measurement) | ||
slot_board_vars [SLOT_20ms_24GHZ].delayTx = 13 ; // 396us (based on measurement) | ||
slot_board_vars [SLOT_20ms_24GHZ].delayRx = 0 ; // 0us (can not measure) | ||
} | ||
|
||
// To get the current slotDuration at any time | ||
// used during initialization by sixtop to fire the first sixtop EB | ||
uint16_t board_getSlotDuration (void) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you put this { at the end of previous line? Just try to be consistent. |
||
return slot_board_vars [selected_slot_type].slotDuration; | ||
} | ||
|
||
// Setter/Getter function for slot_board_vars | ||
slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
selected_slot_type = slot_type; | ||
return slot_board_vars [selected_slot_type]; | ||
} | ||
|
||
void antenna_init(void) { | ||
/* Configure GPIO as output */ | ||
GPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the additional empty lines here