Skip to content

Commit

Permalink
treewide: use ifndef guards for config.h variables
Browse files Browse the repository at this point in the history
  • Loading branch information
fjmolinas committed Aug 31, 2020
1 parent 3f7cfa4 commit 0410244
Show file tree
Hide file tree
Showing 69 changed files with 251 additions and 230 deletions.
3 changes: 1 addition & 2 deletions bsp/boards/iot-lab_A8-M3/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void board_init(void){
//enable nvic for the radio
NVIC_radio();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED
cryptoengine_init();
#endif
}
Expand Down Expand Up @@ -160,4 +160,3 @@ void board_enableHardFaultExceptionHandler(void){
// bit3. unaligned access traps
SCB->CCR = 0x00000210;
}

2 changes: 1 addition & 1 deletion bsp/boards/iot-lab_A8-M3/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED

#include <stdint.h>
#include <string.h>
Expand Down
3 changes: 1 addition & 2 deletions bsp/boards/iot-lab_M3/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void board_init(void)
//enable nvic for the radio
NVIC_radio();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED
cryptoengine_init();
#endif
}
Expand Down Expand Up @@ -123,4 +123,3 @@ void board_enableHardFaultExceptionHandler(void){
// bit3. unaligned access traps
SCB->CCR = 0x00000210;
}

2 changes: 1 addition & 1 deletion bsp/boards/iot-lab_M3/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED

#include <stdint.h>
#include <string.h>
Expand Down
3 changes: 1 addition & 2 deletions bsp/boards/nrf52840/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void board_init(void) {

i2c_init();

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED
sensors_init();
#endif
}
Expand Down Expand Up @@ -135,4 +135,3 @@ static void button_init(void)
}

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

4 changes: 2 additions & 2 deletions bsp/boards/nrf52840/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "config.h"

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED

#include "adc_sensor.h"
#include "sensors.h"
Expand Down Expand Up @@ -94,4 +94,4 @@ callbackConvert_cbt sensors_getCallbackConvert(uint8_t sensorType) {

//=========================== private =========================================

#endif /* BOARD_SENSORS_ENABLED */
#endif /* BOARD_SENSORS_ENABLED */
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b-24ghz/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ void board_init(void) {
radio_init();
i2c_init();

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED
sensors_init();
#endif

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED
cryptoengine_init();
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion bsp/boards/openmote-b-24ghz/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef OPENWSN_IEEE802154E_SECURITY_C
#if OPENWSN_IEEE802154E_SECURITY_C
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
Expand Down
2 changes: 1 addition & 1 deletion bsp/boards/openmote-b-24ghz/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED

#include <stdint.h>

Expand Down
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b-24ghz/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "config.h"

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED

#include "adc_sensor.h"
#include "board.h"
Expand Down Expand Up @@ -100,4 +100,4 @@ callbackReset_cbt sensors_getCallbackReset(void) {
return &si70x_reset;

}
#endif /* BOARD_SENSORS_ENABLED */
#endif /* BOARD_SENSORS_ENABLED */
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b-subghz/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ void board_init(void) {
radio_init();
i2c_init();

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED
sensors_init();
#endif

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED
cryptoengine_init();
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion bsp/boards/openmote-b-subghz/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef OPENWSN_IEEE802154E_SECURITY_C
#if OPENWSN_IEEE802154E_SECURITY_C
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
Expand Down
2 changes: 1 addition & 1 deletion bsp/boards/openmote-b-subghz/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED

#include <stdint.h>

Expand Down
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b-subghz/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "config.h"

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED

#include "adc_sensor.h"
#include "board.h"
Expand Down Expand Up @@ -95,4 +95,4 @@ callbackConvert_cbt sensors_getCallbackConvert(uint8_t sensorType) {

//=========================== private =========================================

#endif /* BOARD_SENSORS_ENABLED */
#endif /* BOARD_SENSORS_ENABLED */
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ void board_init(void) {
radio_init();
i2c_init();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED
cryptoengine_init();
#endif

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED
sensors_init();
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion bsp/boards/openmote-b/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef OPENWSN_IEEE802154E_SECURITY_C
#if OPENWSN_IEEE802154E_SECURITY_C
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
Expand Down
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED

#include <stdint.h>

Expand Down Expand Up @@ -162,4 +162,4 @@ static owerror_t load_key(uint8_t key[16], uint8_t* /* out */ key_location) {
return E_SUCCESS;
}

#endif /* BOARD_CRYPTOENGINE_ENABLED */
#endif /* BOARD_CRYPTOENGINE_ENABLED */
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "config.h"

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED

#include "adc_sensor.h"
#include "board.h"
Expand Down Expand Up @@ -95,4 +95,4 @@ callbackConvert_cbt sensors_getCallbackConvert(uint8_t sensorType) {

//=========================== private =========================================

#endif /* BOARD_SENSORS_ENABLED */
#endif /* BOARD_SENSORS_ENABLED */
4 changes: 2 additions & 2 deletions bsp/boards/openmote-cc2538/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ void board_init(void) {

i2c_init();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED
cryptoengine_init();
#endif


#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED
sensors_init();
#endif

Expand Down
2 changes: 1 addition & 1 deletion bsp/boards/openmote-cc2538/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef OPENWSN_IEEE802154E_SECURITY_C
#if OPENWSN_IEEE802154E_SECURITY_C
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
Expand Down
4 changes: 2 additions & 2 deletions bsp/boards/openmote-cc2538/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED

#include <stdint.h>

Expand Down Expand Up @@ -162,4 +162,4 @@ static owerror_t load_key(uint8_t key[16], uint8_t* /* out */ key_location) {
return E_SUCCESS;
}

#endif /* BOARD_CRYPTOENGINE_ENABLED */
#endif /* BOARD_CRYPTOENGINE_ENABLED */
4 changes: 2 additions & 2 deletions bsp/boards/openmote-cc2538/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "config.h"

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED

#include "adc_sensor.h"
#include "board.h"
Expand Down Expand Up @@ -124,4 +124,4 @@ callbackConvert_cbt sensors_getCallbackConvert(uint8_t sensorType) {

//=========================== private =========================================

#endif /* BOARD_SENSORS_ENABLED */
#endif /* BOARD_SENSORS_ENABLED */
2 changes: 1 addition & 1 deletion bsp/boards/silabs-ezr32wg/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef OPENWSN_IEEE802154E_SECURITY_C
#if OPENWSN_IEEE802154E_SECURITY_C
#define PORT_delayTx 7 // 366us (measured xxxus)
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
Expand Down
4 changes: 2 additions & 2 deletions bsp/boards/silabs-ezr32wg/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "config.h"

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED

#include "board.h"
#include "sensors.h"
Expand Down Expand Up @@ -123,4 +123,4 @@ callbackConvert_cbt sensors_getCallbackConvert(uint8_t sensorType) {

//=========================== private =========================================

#endif /* BOARD_SENSORS_ENABLED */
#endif /* BOARD_SENSORS_ENABLED */
5 changes: 2 additions & 3 deletions bsp/boards/telosb/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ void board_init(void) {
radio_init();
sctimer_init();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED
cryptoengine_init();
#endif

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED
sensors_init();
#endif

Expand Down Expand Up @@ -143,4 +143,3 @@ ISR(TIMERB1) {
// TIMERB0_VECTOR

// NMI_VECTOR

3 changes: 1 addition & 2 deletions bsp/boards/telosb/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)
#if BOARD_CRYPTOENGINE_ENABLED

#include "opendefs.h"
#include "board.h"
Expand Down Expand Up @@ -363,4 +363,3 @@ static void reverse(uint8_t *start, uint8_t len) {
}

#endif /* BOARD_CRYPTOENGINE_ENABLED */

4 changes: 2 additions & 2 deletions bsp/boards/telosb/sensors.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "config.h"

#if defined(BOARD_SENSORS_ENABLED)
#if BOARD_SENSORS_ENABLED

#include "board.h"
#include "sensors.h"
Expand Down Expand Up @@ -90,4 +90,4 @@ callbackConvert_cbt sensors_getCallbackConvert(uint8_t sensorType) {

//=========================== private =========================================

#endif /* BOARD_SENSORS_ENABLED */
#endif /* BOARD_SENSORS_ENABLED */
8 changes: 4 additions & 4 deletions drivers/common/crypto/ccms.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//=========================== prototypes ======================================

#ifndef BOARD_CRYPTOENGINE_ENABLED
#if !BOARD_CRYPTOENGINE_ENABLED

static owerror_t aes_cbc_mac(uint8_t *a,
uint8_t len_a,
Expand Down Expand Up @@ -56,7 +56,7 @@ owerror_t aes128_ccms_enc(uint8_t *a,
uint8_t key[16],
uint8_t len_mac) {

#ifdef BOARD_CRYPTOENGINE_ENABLED
#if BOARD_CRYPTOENGINE_ENABLED
return cryptoengine_aes_ccms_enc(a, len_a, m, len_m, nonce, l, key, len_mac);
#else
uint8_t mac[CBC_MAX_MAC_SIZE];
Expand Down Expand Up @@ -87,7 +87,7 @@ owerror_t aes128_ccms_dec(uint8_t *a,
uint8_t key[16],
uint8_t len_mac) {

#ifdef BOARD_CRYPTOENGINE_ENABLED
#if BOARD_CRYPTOENGINE_ENABLED
return cryptoengine_aes_ccms_dec(a, len_a, m, len_m, nonce, l, key, len_mac);
#else
uint8_t mac[CBC_MAX_MAC_SIZE];
Expand All @@ -113,7 +113,7 @@ owerror_t aes128_ccms_dec(uint8_t *a,
}

//=========================== private =========================================
#ifndef BOARD_CRYPTOENGINE_ENABLED
#if !BOARD_CRYPTOENGINE_ENABLED

/**
\brief CBC-MAC generation specific to CCM*.
Expand Down
Loading

0 comments on commit 0410244

Please sign in to comment.