Nanostack Border Router is a generic mbed border router implementation that provides the 6LoWPAN ND or Thread border router initialization logic.
drivers/rf_wrapper.cpp@108:0c14bd1d3334, 2019-11-27 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Nov 27 10:02:22 2019 +0000
- Revision:
- 108:0c14bd1d3334
- Parent:
- 89:2f7ae1d76d7a
Fix conflicting declarations of main() (#197)
Update the main() to be compatible with the declaration from
platform/mbed_toolchain.h that adds the MBED_USED attribute.
Without the attribute the main() symbol is not emitted with the
GCC toolchain using "-Wl,--wrap,main" and "-flto" flags.
.
Commit copied from https://github.com/ARMmbed/nanostack-border-router
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:85f4174a8e29 | 1 | /* |
mbed_official | 0:85f4174a8e29 | 2 | * Copyright (c) 2016 ARM Limited. All rights reserved. |
mbed_official | 0:85f4174a8e29 | 3 | */ |
mbed_official | 0:85f4174a8e29 | 4 | |
mbed_official | 0:85f4174a8e29 | 5 | #include "rf_wrapper.h" |
mbed_official | 0:85f4174a8e29 | 6 | |
mbed_official | 0:85f4174a8e29 | 7 | // Must be defined for next preprocessor tests to work |
mbed_official | 0:85f4174a8e29 | 8 | #define ATMEL 0 |
mbed_official | 0:85f4174a8e29 | 9 | #define MCR20 1 |
mbed_official | 0:85f4174a8e29 | 10 | #define NCS36510 2 |
mbed_official | 89:2f7ae1d76d7a | 11 | #define SPIRIT1 3 |
mbed_official | 89:2f7ae1d76d7a | 12 | #define S2LP 4 |
mbed_official | 0:85f4174a8e29 | 13 | |
mbed_official | 0:85f4174a8e29 | 14 | #if MBED_CONF_APP_RADIO_TYPE == ATMEL |
mbed_official | 0:85f4174a8e29 | 15 | #include "NanostackRfPhyAtmel.h" |
mbed_official | 0:85f4174a8e29 | 16 | NanostackRfPhyAtmel rf_phy(ATMEL_SPI_MOSI, ATMEL_SPI_MISO, ATMEL_SPI_SCLK, ATMEL_SPI_CS, |
mbed_official | 0:85f4174a8e29 | 17 | ATMEL_SPI_RST, ATMEL_SPI_SLP, ATMEL_SPI_IRQ, ATMEL_I2C_SDA, ATMEL_I2C_SCL); |
mbed_official | 0:85f4174a8e29 | 18 | #elif MBED_CONF_APP_RADIO_TYPE == MCR20 |
mbed_official | 0:85f4174a8e29 | 19 | #include "NanostackRfPhyMcr20a.h" |
mbed_official | 0:85f4174a8e29 | 20 | NanostackRfPhyMcr20a rf_phy(MCR20A_SPI_MOSI, MCR20A_SPI_MISO, MCR20A_SPI_SCLK, MCR20A_SPI_CS, MCR20A_SPI_RST, MCR20A_SPI_IRQ); |
mbed_official | 0:85f4174a8e29 | 21 | #elif MBED_CONF_APP_RADIO_TYPE == SPIRIT1 |
mbed_official | 0:85f4174a8e29 | 22 | #include "NanostackRfPhySpirit1.h" |
mbed_official | 0:85f4174a8e29 | 23 | NanostackRfPhySpirit1 rf_phy(SPIRIT1_SPI_MOSI, SPIRIT1_SPI_MISO, SPIRIT1_SPI_SCLK, |
mbed_official | 89:2f7ae1d76d7a | 24 | SPIRIT1_DEV_IRQ, SPIRIT1_DEV_CS, SPIRIT1_DEV_SDN, SPIRIT1_BRD_LED); |
mbed_official | 89:2f7ae1d76d7a | 25 | #elif MBED_CONF_APP_RADIO_TYPE == S2LP |
mbed_official | 89:2f7ae1d76d7a | 26 | #include "NanostackRfPhys2lp.h" |
mbed_official | 89:2f7ae1d76d7a | 27 | NanostackRfPhys2lp rf_phy(S2LP_SPI_SDI, S2LP_SPI_SDO, S2LP_SPI_SCLK, S2LP_SPI_CS, S2LP_SPI_SDN, |
mbed_official | 89:2f7ae1d76d7a | 28 | #ifdef TEST_GPIOS_ENABLED |
mbed_official | 89:2f7ae1d76d7a | 29 | S2LP_SPI_TEST1, S2LP_SPI_TEST2, S2LP_SPI_TEST3, S2LP_SPI_TEST4, S2LP_SPI_TEST5, |
mbed_official | 89:2f7ae1d76d7a | 30 | #endif //TEST_GPIOS_ENABLED |
mbed_official | 89:2f7ae1d76d7a | 31 | S2LP_SPI_GPIO0, S2LP_SPI_GPIO1, S2LP_SPI_GPIO2, S2LP_SPI_GPIO3); |
mbed_official | 0:85f4174a8e29 | 32 | #endif //MBED_CONF_APP_RADIO_TYPE |
mbed_official | 0:85f4174a8e29 | 33 | |
mbed_official | 0:85f4174a8e29 | 34 | extern "C" int8_t rf_device_register() |
mbed_official | 0:85f4174a8e29 | 35 | { |
mbed_official | 0:85f4174a8e29 | 36 | return rf_phy.rf_register(); |
mbed_official | 0:85f4174a8e29 | 37 | } |
mbed_official | 0:85f4174a8e29 | 38 | |
mbed_official | 0:85f4174a8e29 | 39 | extern "C" void rf_read_mac_address(uint8_t *mac) |
mbed_official | 0:85f4174a8e29 | 40 | { |
mbed_official | 0:85f4174a8e29 | 41 | rf_phy.get_mac_address(mac); |
mbed_official | 0:85f4174a8e29 | 42 | } |