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

FW-866. OpenRadio Implementation for OpenMote-B #516

Open
wants to merge 39 commits into
base: develop
Choose a base branch
from

Conversation

minarady1
Copy link
Contributor

No description provided.

@changtengfei changtengfei changed the title develop_FW-866_PR2 FW-866. OpenRadio Implementation for OpenMote-B Aug 7, 2020
@minarady1
Copy link
Contributor Author

minarady1 commented Aug 7, 2020

To test this PR, just select each combination of timeslot template and radio setting in ieee154_init function.
This is an example of using the default setting:

    /* select the desired slot template to use, default is SLOT_20ms_24GHZ
       currently, the following slot template/radio setting combinations are supported:

        SLOT_20ms_24GHZ              , RADIOSETTING_24GHZ --> Default
        SLOT_40ms_24GHZ              , RADIOSETTING_24GHZ
        SLOT_40ms_FSK_SUBGHZ         , RADIOSETTING_FSK_OPTION1_FEC
        SLOT_40ms_OFDM1MCS0_3_SUBGHZ , RADIOSETTING_OFDM_OPTION_1_MCS0
        SLOT_40ms_OFDM1MCS0_3_SUBGHZ , RADIOSETTING_OFDM_OPTION_1_MCS1
        SLOT_40ms_OFDM1MCS0_3_SUBGHZ , RADIOSETTING_OFDM_OPTION_1_MCS2
        SLOT_40ms_OFDM1MCS0_3_SUBGHZ , RADIOSETTING_OFDM_OPTION_1_MCS3
    */
    ieee154e_select_slot_template (SLOT_20ms_24GHZ);
    ieee154e_vars.slotDuration      = slotTemplate.slotDuration;

    //set the radio setting to use, default is RADIOSETTING_24GHZ
    radio_setConfig (SLOT_20ms_24GHZ); 
    

If you use the 40ms time slot template, make sure to have a frame size less than 50 (41 works) just to make sure that timeouts are still respected for upper layers.


//==== bootstrapping slot info lookup table
void board_init_slot_vars(void){

Copy link
Member

Choose a reason for hiding this comment

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

Initialize the slot_board_vars variable here, i.e. using the memset(&slot_board_vars[0], 0, sizeof(slot_board_vars));

Need to check the value of sizeof(slot_board_vars).

@@ -193,6 +193,10 @@ void radio_reset(void) {
radio_vars.state = RADIOSTATE_STOPPED;
Copy link
Member

Choose a reason for hiding this comment

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

The same changes on board.c and board_info.h should apply on nRF52840 port.


// available slot templates
typedef enum{
SLOT_10ms,
Copy link
Member

Choose a reason for hiding this comment

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

what's the modulation corresponding to SLOT_10ms

//==== bootstrapping slot info lookup table
void board_init_slot_vars(void){
//10ms slot
slot_board_vars [SLOT_10ms].slotDuration = 328 ; // 10ms
Copy link
Member

Choose a reason for hiding this comment

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

rename SLOT_10ms to SLOT_10ms_24GHZ and the following lines

GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, BSP_ANTENNA_CC2538_24GHZ);
GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, 0);
void antenna_cc2538(void) {
GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, 0);
Copy link
Member

Choose a reason for hiding this comment

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

4 space for indentation everywhere

@@ -140,7 +140,7 @@ void leds_circular_shift(void) {
// incrementally turn LED on
for (i=0;i<10;i++) {
bspLedSet(BSP_LED_1);
for (delay=0xffff;delay>0;delay--);
for (delay=0xffff;delay>0;delay--)
Copy link
Member

@changtengfei changtengfei Aug 7, 2020

Choose a reason for hiding this comment

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

Please reverse this change.

dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_getReceivedFrame = radio_getReceivedFrame_at86rf215;
dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_isr = radio_isr_at86rf215;

//RADIOSETTING_OFDM_OPTION_1_MCS3
Copy link
Member

Choose a reason for hiding this comment

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

4 space indentation

//RADIOSETTING_OFDM_OPTION_1_MCS3
dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_reset = radio_reset_at86rf215;
dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_init = radio_init_at86rf215;
dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_setConfig = radio_setConfig_at86rf215;
Copy link
Member

Choose a reason for hiding this comment

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

align the "equal"

#include "board.h"
#include "cc2538rf.h"

#include "spi.h"
Copy link
Member

Choose a reason for hiding this comment

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

This header file is not required here


#ifdef SPI_IN_INTERRUPT_MODE
void spi_setCb(spi_cbt cb) {
spi_vars.spi_cb = cb;
Copy link
Member

Choose a reason for hiding this comment

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

indentation


// lower CS signal to have slave listening
if (spi_vars.isFirst==SPI_FIRST) {
GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS, 0);
Copy link
Member

Choose a reason for hiding this comment

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

indentation here, please check the whole file.

@@ -55,15 +55,6 @@ SECTIONS
_ebss = .;
} > SRAM

.heap (COPY):
Copy link
Member

Choose a reason for hiding this comment

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

Will those lines create issues? if not, please don't make changes

@@ -149,7 +155,7 @@ void board_init(void)
void rf_interface_init(void)
{
pinmux_t pinmux;
/* Configure the RF233 SPI Interface */
//Configure the RF233 SPI Interface
Copy link
Member

Choose a reason for hiding this comment

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

indentation

@@ -8,6 +8,7 @@ at most MAX_NUM_TIMERS timers.
*/

#include "opendefs.h"
#include "board.h"
Copy link
Member

@changtengfei changtengfei Aug 7, 2020

Choose a reason for hiding this comment

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

this line is not required.

}
Py_DECREF(result);

}
Copy link
Member

Choose a reason for hiding this comment

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

not aligned.


// Setter/Getter function for slot_board_vars
slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type){
selected_slot_type = slot_type;
Copy link
Member

Choose a reason for hiding this comment

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

4 spaces for indentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants