Skip to content

Instantly share code, notes, and snippets.

@jia200x
Last active June 12, 2018 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jia200x/5d9d2b61c036814efb957a4e3c367ff4 to your computer and use it in GitHub Desktop.
Save jia200x/5d9d2b61c036814efb957a4e3c367ff4 to your computer and use it in GitHub Desktop.
RIOT uncrustify diff
This file has been truncated, but you can view the full file.
diff --git a/boards/acd52832/include/gpio_params.h b/boards/acd52832/include/gpio_params.h
index 8acaa54bc..05991afbe 100644
--- a/boards/acd52832/include/gpio_params.h
+++ b/boards/acd52832/include/gpio_params.h
@@ -30,7 +30,7 @@ extern "C" {
/**
* @brief LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 1",
@@ -38,7 +38,7 @@ static const saul_gpio_params_t saul_gpio_params[] =
.mode = GPIO_OUT,
.flags = (SAUL_GPIO_INVERTED | SAUL_GPIO_INIT_CLEAR),
},
- {
+ {
.name = "Button 1",
.pin = BTN0_PIN,
.mode = BTN0_MODE,
diff --git a/boards/airfy-beacon/include/board.h b/boards/airfy-beacon/include/board.h
index 0fe264521..bb8ae6b79 100644
--- a/boards/airfy-beacon/include/board.h
+++ b/boards/airfy-beacon/include/board.h
@@ -24,7 +24,7 @@
#include "cpu.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/airfy-beacon/include/periph_conf.h b/boards/airfy-beacon/include/periph_conf.h
index f2bbd5ea4..2f29f481d 100644
--- a/boards/airfy-beacon/include/periph_conf.h
+++ b/boards/airfy-beacon/include/periph_conf.h
@@ -23,7 +23,7 @@
#include "periph_cpu.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/arduino-zero/include/gpio_params.h b/boards/arduino-zero/include/gpio_params.h
index b6f056ec0..380f46419 100644
--- a/boards/arduino-zero/include/gpio_params.h
+++ b/boards/arduino-zero/include/gpio_params.h
@@ -31,7 +31,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(orange)",
diff --git a/boards/arduino-zero/include/periph_conf.h b/boards/arduino-zero/include/periph_conf.h
index af474ea8e..3fddf9191 100644
--- a/boards/arduino-zero/include/periph_conf.h
+++ b/boards/arduino-zero/include/periph_conf.h
@@ -150,17 +150,17 @@ static const uart_conf_t uart_config[] = {
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{TCC0, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 8), GPIO_MUX_E, 0 },
- { GPIO_PIN(PA, 9), GPIO_MUX_E, 1 },
- }},
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 8), GPIO_MUX_E, 0 },
+ { GPIO_PIN(PA, 9), GPIO_MUX_E, 1 },
+ }},
#endif
#if PWM_1_EN
{TCC1, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 6), GPIO_MUX_E, 0 },
- { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
- }},
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 6), GPIO_MUX_E, 0 },
+ { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
+ }},
#endif
};
diff --git a/boards/avsextrem/board_init.c b/boards/avsextrem/board_init.c
index a6c6f7939..fb154f4c3 100644
--- a/boards/avsextrem/board_init.c
+++ b/boards/avsextrem/board_init.c
@@ -188,7 +188,7 @@ void bl_init_ports(void)
PINSEL3 &= ~(BIT12 | BIT13 | BIT18 | BIT19);
//SD
- FIO0DIR &= ~(BIT19 | BIT20 | BIT21 | BIT22) ; //0.19 0.20 0.21 0.22 as input
+ FIO0DIR &= ~(BIT19 | BIT20 | BIT21 | BIT22); //0.19 0.20 0.21 0.22 as input
PINMODE1 |= (BIT7) | (BIT9) | (BIT11) | (BIT13); // no resistors
FIO2DIR &= ~(BIT11 + BIT12 + BIT13); //2.11 2.12 2.13 as input
PINMODE4 |= (BIT23) | (BIT25) | (BIT27); // no resistors
diff --git a/boards/b-l072z-lrwan1/include/gpio_params.h b/boards/b-l072z-lrwan1/include/gpio_params.h
index baa05f694..a2e3b39bd 100644
--- a/boards/b-l072z-lrwan1/include/gpio_params.h
+++ b/boards/b-l072z-lrwan1/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
#ifdef AUTO_INIT_LED0
{
diff --git a/boards/b-l475e-iot01a/include/gpio_params.h b/boards/b-l475e-iot01a/include/gpio_params.h
index 792138ac4..f074f54f3 100644
--- a/boards/b-l475e-iot01a/include/gpio_params.h
+++ b/boards/b-l475e-iot01a/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
#ifdef AUTO_INIT_LED0
/* The LED pin is also used for SPI, so we enable it
diff --git a/boards/bluepill/include/gpio_params.h b/boards/bluepill/include/gpio_params.h
index a198c68c4..b70991c3a 100644
--- a/boards/bluepill/include/gpio_params.h
+++ b/boards/bluepill/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED",
diff --git a/boards/bluepill/include/periph_conf.h b/boards/bluepill/include/periph_conf.h
index 322263cc6..1823b8930 100644
--- a/boards/bluepill/include/periph_conf.h
+++ b/boards/bluepill/include/periph_conf.h
@@ -63,17 +63,17 @@ extern "C" {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { .dev = 0, .pin = GPIO_PIN(PORT_A, 0), .chan = 0 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_A, 1), .chan = 1 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_A, 2), .chan = 2 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_A, 3), .chan = 3 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_A, 4), .chan = 4 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_A, 5), .chan = 5 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_A, 6), .chan = 6 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_A, 7), .chan = 7 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_B, 0), .chan = 8 }, \
- { .dev = 0, .pin = GPIO_PIN(PORT_B, 1), .chan = 9 }, \
+#define ADC_CONFIG { \
+ { .dev = 0, .pin = GPIO_PIN(PORT_A, 0), .chan = 0 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_A, 1), .chan = 1 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_A, 2), .chan = 2 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_A, 3), .chan = 3 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_A, 4), .chan = 4 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_A, 5), .chan = 5 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_A, 6), .chan = 6 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_A, 7), .chan = 7 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_B, 0), .chan = 8 }, \
+ { .dev = 0, .pin = GPIO_PIN(PORT_B, 1), .chan = 9 }, \
}
#define ADC_NUMOF 10
diff --git a/boards/cc2650-launchpad/include/periph_conf.h b/boards/cc2650-launchpad/include/periph_conf.h
index d3c682fb2..3613a0485 100644
--- a/boards/cc2650-launchpad/include/periph_conf.h
+++ b/boards/cc2650-launchpad/include/periph_conf.h
@@ -28,53 +28,53 @@ extern "C" {
#endif
/**
-* @name Clock configuration
-* @{
-*/
+ * @name Clock configuration
+ * @{
+ */
/* the main clock is fixed to 48MHZ */
#define CLOCK_CORECLOCK (48000000U)
/** @} */
/**
-* @name Timer configuration
-*
-* General purpose timers (GPT[0-3]) are configured consecutively and in order
-* (without gaps) starting from GPT0, i.e. if multiple timers are enabled.
-*
-* @{
-*/
+ * @name Timer configuration
+ *
+ * General purpose timers (GPT[0-3]) are configured consecutively and in order
+ * (without gaps) starting from GPT0, i.e. if multiple timers are enabled.
+ *
+ * @{
+ */
static const timer_conf_t timer_config[] = {
- {
- .cfg = GPT_CFG_16T,
- .chn = 2,
- },
- {
- .cfg = GPT_CFG_32T,
- .chn = 1,
- },
- {
- .cfg = GPT_CFG_16T,
- .chn = 2,
- },
- {
- .cfg = GPT_CFG_32T,
- .chn = 1,
- }
+ {
+ .cfg = GPT_CFG_16T,
+ .chn = 2,
+ },
+ {
+ .cfg = GPT_CFG_32T,
+ .chn = 1,
+ },
+ {
+ .cfg = GPT_CFG_16T,
+ .chn = 2,
+ },
+ {
+ .cfg = GPT_CFG_32T,
+ .chn = 1,
+ }
};
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
/** @} */
/**
-* @name UART configuration
-*
-* The used CC26x0 CPU only supports a single UART device, so all we need to
-* configure are the RX and TX pins.
-*
-* Optionally we can enable hardware flow control, by setting UART_HW_FLOW_CTRL
-* to 1 and defining pins for UART_CTS_PIN and UART_RTS_PIN.
-* @{
-*/
+ * @name UART configuration
+ *
+ * The used CC26x0 CPU only supports a single UART device, so all we need to
+ * configure are the RX and TX pins.
+ *
+ * Optionally we can enable hardware flow control, by setting UART_HW_FLOW_CTRL
+ * to 1 and defining pins for UART_CTS_PIN and UART_RTS_PIN.
+ * @{
+ */
#define UART_NUMOF (1)
#define UART_RX_PIN (2)
#define UART_TX_PIN (3)
diff --git a/boards/chronos/drivers/display_chars.c b/boards/chronos/drivers/display_chars.c
index 7d0be455f..f84ff1ecf 100644
--- a/boards/chronos/drivers/display_chars.c
+++ b/boards/chronos/drivers/display_chars.c
@@ -66,7 +66,7 @@ const uint8_t lcd_font[] = {
SEG_B + SEG_C, /* Displays "1" */
SEG_A + SEG_B + SEG_D + SEG_E + SEG_G, /* Displays "2" */
SEG_A + SEG_B + SEG_C + SEG_D + SEG_G, /* Displays "3" */
- SEG_B + SEG_C + SEG_F + SEG_G, /* Displays "4" */
+ SEG_B + SEG_C + SEG_F + SEG_G, /* Displays "4" */
SEG_A + SEG_C + SEG_D + SEG_F + SEG_G, /* Displays "5" */
SEG_A + SEG_C + SEG_D + SEG_E + SEG_F + SEG_G, /* Displays "6" */
SEG_A + SEG_B + SEG_C, /* Displays "7" */
@@ -80,30 +80,30 @@ const uint8_t lcd_font[] = {
SEG_A + SEG_B + SEG_E + SEG_G, /* Displays "?" */
0, /* Displays " " (@) */
SEG_A + SEG_B + SEG_C + SEG_E + SEG_F + SEG_G, /* Displays "A" */
- SEG_C + SEG_D + SEG_E + SEG_F + SEG_G, /* Displays "b" */
- SEG_D + SEG_E + SEG_G, /* Displays "c" */
- SEG_B + SEG_C + SEG_D + SEG_E + SEG_G, /* Displays "d" */
+ SEG_C + SEG_D + SEG_E + SEG_F + SEG_G, /* Displays "b" */
+ SEG_D + SEG_E + SEG_G, /* Displays "c" */
+ SEG_B + SEG_C + SEG_D + SEG_E + SEG_G, /* Displays "d" */
SEG_A + SEG_D + SEG_E + SEG_F + SEG_G, /* Displays "E" */
SEG_A + SEG_E + SEG_F + SEG_G, /* Displays "f" */
SEG_A + SEG_B + SEG_C + SEG_D + SEG_F + SEG_G, /* Displays "g" same as 9 */
SEG_C + SEG_E + SEG_F + SEG_G, /* Displays "h" */
- SEG_E, /* Displays "i" */
+ SEG_E, /* Displays "i" */
SEG_A + SEG_B + SEG_C + SEG_D, /* Displays "J" */
- SEG_D + SEG_F + SEG_G, /* Displays "k" */
- SEG_D + SEG_E + SEG_F, /* Displays "L" */
+ SEG_D + SEG_F + SEG_G, /* Displays "k" */
+ SEG_D + SEG_E + SEG_F, /* Displays "L" */
SEG_A + SEG_B + SEG_C + SEG_E + SEG_F, /* Displays "M" */
- SEG_C + SEG_E + SEG_G, /* Displays "n" */
- SEG_C + SEG_D + SEG_E + SEG_G, /* Displays "o" */
+ SEG_C + SEG_E + SEG_G, /* Displays "n" */
+ SEG_C + SEG_D + SEG_E + SEG_G, /* Displays "o" */
SEG_A + SEG_B + SEG_E + SEG_F + SEG_G, /* Displays "P" */
SEG_A + SEG_B + SEG_C + SEG_F + SEG_G, /* Displays "q" */
- SEG_E + SEG_G, /* Displays "r" */
+ SEG_E + SEG_G, /* Displays "r" */
SEG_A + SEG_C + SEG_D + SEG_F + SEG_G, /* Displays "S" same as 5 */
- SEG_D + SEG_E + SEG_F + SEG_G, /* Displays "t" */
- SEG_C + SEG_D + SEG_E, /* Displays "u" */
- SEG_C + SEG_D + SEG_E, /* Displays "v" same as u */
- SEG_B + SEG_C + SEG_D + SEG_E + SEG_F + SEG_G, /* Displays "W" */
- SEG_B + SEG_C + SEG_E + SEG_F + SEG_G, /* Displays "X" as H */
- SEG_B + SEG_C + SEG_D + SEG_F + SEG_G, /* Displays "Y" */
+ SEG_D + SEG_E + SEG_F + SEG_G, /* Displays "t" */
+ SEG_C + SEG_D + SEG_E, /* Displays "u" */
+ SEG_C + SEG_D + SEG_E, /* Displays "v" same as u */
+ SEG_B + SEG_C + SEG_D + SEG_E + SEG_F + SEG_G, /* Displays "W" */
+ SEG_B + SEG_C + SEG_E + SEG_F + SEG_G, /* Displays "X" as H */
+ SEG_B + SEG_C + SEG_D + SEG_F + SEG_G, /* Displays "Y" */
SEG_A + SEG_B + SEG_D + SEG_E + SEG_G, /* Displays "Z" same as 2 */
};
diff --git a/boards/common/arduino-atmega/include/gpio_params.h b/boards/common/arduino-atmega/include/gpio_params.h
index 1cf28a85f..c73978711 100644
--- a/boards/common/arduino-atmega/include/gpio_params.h
+++ b/boards/common/arduino-atmega/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED",
diff --git a/boards/common/arduino-due/include/gpio_params.h b/boards/common/arduino-due/include/gpio_params.h
index 79273cb9f..31464a94d 100644
--- a/boards/common/arduino-due/include/gpio_params.h
+++ b/boards/common/arduino-due/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED",
diff --git a/boards/common/arduino-due/include/periph_conf.h b/boards/common/arduino-due/include/periph_conf.h
index 2c94b12a3..886a8f81c 100644
--- a/boards/common/arduino-due/include/periph_conf.h
+++ b/boards/common/arduino-due/include/periph_conf.h
@@ -1,4 +1,4 @@
- /*
+/*
* Copyright (C) 2014-2015,2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
@@ -111,9 +111,9 @@ static const uart_conf_t uart_config[] = {
/** @} */
/**
-* @name SPI configuration
-* @{
-*/
+ * @name SPI configuration
+ * @{
+ */
static const spi_conf_t spi_config[] = {
{
.dev = SPI0,
diff --git a/boards/common/arduino-due/include/sdcard_spi_params.h b/boards/common/arduino-due/include/sdcard_spi_params.h
index 608a4726d..0d92ffaf0 100644
--- a/boards/common/arduino-due/include/sdcard_spi_params.h
+++ b/boards/common/arduino-due/include/sdcard_spi_params.h
@@ -58,7 +58,7 @@ extern "C" {
/**
* @brief sdcard_spi configuration
*/
-static const sdcard_spi_params_t sdcard_spi_params[] = {
+static const sdcard_spi_params_t sdcard_spi_params[] = {
{
.spi_dev = SDCARD_SPI_PARAM_SPI,
.cs = SDCARD_SPI_PARAM_CS,
diff --git a/boards/common/arduino-due/include/w5100_params.h b/boards/common/arduino-due/include/w5100_params.h
index 032291900..e6e724dc9 100644
--- a/boards/common/arduino-due/include/w5100_params.h
+++ b/boards/common/arduino-due/include/w5100_params.h
@@ -46,7 +46,7 @@ extern "C" {
/**
* @brief W5100 configuration instance
*/
-static const w5100_params_t w5100_params[] = {
+static const w5100_params_t w5100_params[] = {
{
.spi = W5100_PARAM_SPI,
.clk = W5100_PARAM_SPI_CLK,
diff --git a/boards/common/arduino-mkr/include/gpio_params.h b/boards/common/arduino-mkr/include/gpio_params.h
index df0e4c9af..6cd39ce1f 100644
--- a/boards/common/arduino-mkr/include/gpio_params.h
+++ b/boards/common/arduino-mkr/include/gpio_params.h
@@ -31,7 +31,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(Green)",
diff --git a/boards/common/arduino-mkr/include/periph_conf.h b/boards/common/arduino-mkr/include/periph_conf.h
index f439b1f1b..ba2b194bf 100644
--- a/boards/common/arduino-mkr/include/periph_conf.h
+++ b/boards/common/arduino-mkr/include/periph_conf.h
@@ -134,10 +134,10 @@ static const uart_conf_t uart_config[] = {
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{TCC0, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 10), GPIO_MUX_F, 2 }, /* ~2 */
- { GPIO_PIN(PA, 11), GPIO_MUX_F, 3 }, /* ~3 */
- }}
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 10), GPIO_MUX_F, 2 }, /* ~2 */
+ { GPIO_PIN(PA, 11), GPIO_MUX_F, 3 }, /* ~3 */
+ }}
#endif
};
diff --git a/boards/common/iotlab/include/gpio_params.h b/boards/common/iotlab/include/gpio_params.h
index ade0ac25b..fb9ee24e5 100644
--- a/boards/common/iotlab/include/gpio_params.h
+++ b/boards/common/iotlab/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(red)",
diff --git a/boards/common/iotlab/include/periph_conf_common.h b/boards/common/iotlab/include/periph_conf_common.h
index b69ee112f..cdc708f02 100644
--- a/boards/common/iotlab/include/periph_conf_common.h
+++ b/boards/common/iotlab/include/periph_conf_common.h
@@ -37,13 +37,13 @@ extern "C" {
/* give the target core clock (HCLK) frequency [in Hz],
* maximum: 72MHz */
#define CLOCK_CORECLOCK (72000000U)
- /* 0: no external high speed crystal available
- * else: actual crystal frequency [in Hz] */
+/* 0: no external high speed crystal available
+ * else: actual crystal frequency [in Hz] */
#define CLOCK_HSE (16000000U)
- /* 0: no external low speed crystal available,
- * 1: external crystal available (always 32.768kHz) */
+/* 0: no external low speed crystal available,
+ * 1: external crystal available (always 32.768kHz) */
#define CLOCK_LSE (1)
- /* peripheral clock setup */
+/* peripheral clock setup */
#define CLOCK_AHB_DIV RCC_CFGR_HPRE_DIV1
#define CLOCK_AHB (CLOCK_CORECLOCK / 1)
#define CLOCK_APB1_DIV RCC_CFGR_PPRE1_DIV2 /* max 36MHz */
@@ -51,19 +51,19 @@ extern "C" {
#define CLOCK_APB2_DIV RCC_CFGR_PPRE2_DIV1 /* max 72MHz */
#define CLOCK_APB2 (CLOCK_CORECLOCK / 1)
- /* PLL factors */
+/* PLL factors */
#define CLOCK_PLL_PREDIV (2)
#define CLOCK_PLL_MUL (9)
- /** @} */
+/** @} */
/**
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A,3), 0, 3 }, \
- { GPIO_UNDEF , 0, 16 }, \
- { GPIO_UNDEF , 0, 17 } }
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A,3), 0, 3 }, \
+ { GPIO_UNDEF, 0, 16 }, \
+ { GPIO_UNDEF, 0, 17 } }
#define ADC_NUMOF (3)
/** @} */
@@ -141,7 +141,7 @@ static const uart_conf_t uart_config[] = {
/**
* @name I2C configuration
- * @{
+ * @{
*/
#define I2C_NUMOF (1U)
#define I2C_0_EN 1
diff --git a/boards/common/msb-430/board_init.c b/boards/common/msb-430/board_init.c
index 6be78cf94..1479c38cc 100644
--- a/boards/common/msb-430/board_init.c
+++ b/boards/common/msb-430/board_init.c
@@ -136,7 +136,7 @@ void msp430_init_dco(void)
unsigned int i;
BCSCTL1 = 0xa4; /* ACLK is devided by 4. RSEL=6 no division for MCLK
- and SSMCLK. XT2 is off. */
+ and SSMCLK. XT2 is off. */
/* Init FLL to desired frequency using the 32762Hz crystal */
#if MSP430_HAS_DCOR
diff --git a/boards/common/nrf52xxxdk/include/gpio_params.h b/boards/common/nrf52xxxdk/include/gpio_params.h
index 3ef2cca26..81a416280 100644
--- a/boards/common/nrf52xxxdk/include/gpio_params.h
+++ b/boards/common/nrf52xxxdk/include/gpio_params.h
@@ -30,7 +30,7 @@ extern "C" {
/**
* @brief LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 1",
diff --git a/boards/common/nucleo144/include/gpio_params.h b/boards/common/nucleo144/include/gpio_params.h
index a688f97db..6425a3754 100644
--- a/boards/common/nucleo144/include/gpio_params.h
+++ b/boards/common/nucleo144/include/gpio_params.h
@@ -30,7 +30,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD1(green)",
diff --git a/boards/common/nucleo32/include/gpio_params.h b/boards/common/nucleo32/include/gpio_params.h
index 49c91566f..171d5b5e3 100644
--- a/boards/common/nucleo32/include/gpio_params.h
+++ b/boards/common/nucleo32/include/gpio_params.h
@@ -32,7 +32,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD3(green)",
diff --git a/boards/common/nucleo64/include/gpio_params.h b/boards/common/nucleo64/include/gpio_params.h
index 5e87d6676..86b08a0fa 100644
--- a/boards/common/nucleo64/include/gpio_params.h
+++ b/boards/common/nucleo64/include/gpio_params.h
@@ -30,7 +30,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
#ifdef AUTO_INIT_LED0
{
diff --git a/boards/common/remote/include/board_common.h b/boards/common/remote/include/board_common.h
index acb1d8a6f..86232758b 100644
--- a/boards/common/remote/include/board_common.h
+++ b/boards/common/remote/include/board_common.h
@@ -28,38 +28,38 @@
#include "periph/spi.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
* @name Macros for controlling the on-board RGB LEDs
* @{
*/
-#define LED_ALL_OFF LED0_OFF; \
- LED1_OFF; \
- LED2_OFF
+#define LED_ALL_OFF LED0_OFF; \
+ LED1_OFF; \
+ LED2_OFF
/* Output is color white */
-#define LED_ALL_ON LED0_ON; \
- LED1_ON; \
- LED2_ON
+#define LED_ALL_ON LED0_ON; \
+ LED1_ON; \
+ LED2_ON
/* Yellow */
-#define LED3_ON LED2_OFF; \
- LED0_ON; \
- LED1_ON
-#define LED3_OFF LED1_OFF; \
- LED0_OFF
+#define LED3_ON LED2_OFF; \
+ LED0_ON; \
+ LED1_ON
+#define LED3_OFF LED1_OFF; \
+ LED0_OFF
#define LED3_TOGGLE LED1_TOGGLE; \
- LED0_TOGGLE
+ LED0_TOGGLE
/* Purple */
-#define LED4_ON LED1_OFF; \
- LED2_ON; \
- LED0_ON
-#define LED4_OFF LED2_OFF; \
- LED0_OFF
-#define LED4_TOGGLE LED2_TOGGLE; \
- LED0_TOGGLE
+#define LED4_ON LED1_OFF; \
+ LED2_ON; \
+ LED0_ON
+#define LED4_OFF LED2_OFF; \
+ LED0_OFF
+#define LED4_TOGGLE LED2_TOGGLE; \
+ LED0_TOGGLE
/** @} */
/**
diff --git a/boards/common/remote/include/fancy_leds.h b/boards/common/remote/include/fancy_leds.h
index 0470b8128..cda15b005 100644
--- a/boards/common/remote/include/fancy_leds.h
+++ b/boards/common/remote/include/fancy_leds.h
@@ -23,7 +23,7 @@
#include "board_common.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
@@ -31,32 +31,32 @@
* @{
*/
/* Take LED_COLOR as argument, i.e LED0 */
-#define LED_FADE(led) \
- volatile int i; \
- int k, j; \
- LED_FADE_EXPAND(led)
+#define LED_FADE(led) \
+ volatile int i; \
+ int k, j; \
+ LED_FADE_EXPAND(led)
-#define LED_FADE_EXPAND(led) \
- for(k = 0; k < 800; ++k) { \
- j = k > 400 ? 800 - k : k; \
- led##_ON; \
- for(i = 0; i < j; ++i) { \
- __asm__("nop"); \
- } \
- led##_OFF; \
- for(i = 0; i < 400 - j; ++i) { \
- __asm__("nop"); \
- } \
- }
+#define LED_FADE_EXPAND(led) \
+ for(k = 0; k < 800; ++k) { \
+ j = k > 400 ? 800 - k : k; \
+ led ## _ON; \
+ for(i = 0; i < j; ++i) { \
+ __asm__ ("nop"); \
+ } \
+ led ## _OFF; \
+ for(i = 0; i < 400 - j; ++i) { \
+ __asm__ ("nop"); \
+ } \
+ }
-#define LED_RAINBOW() \
- volatile int i; \
- int k,j; \
- LED_FADE_EXPAND(LED3); \
- LED_FADE_EXPAND(LED0); \
- LED_FADE_EXPAND(LED4); \
- LED_FADE_EXPAND(LED2); \
- LED_FADE_EXPAND(LED1);
+#define LED_RAINBOW() \
+ volatile int i; \
+ int k,j; \
+ LED_FADE_EXPAND(LED3); \
+ LED_FADE_EXPAND(LED0); \
+ LED_FADE_EXPAND(LED4); \
+ LED_FADE_EXPAND(LED2); \
+ LED_FADE_EXPAND(LED1);
/** @} */
#ifdef __cplusplus
diff --git a/boards/common/remote/include/periph_common.h b/boards/common/remote/include/periph_common.h
index 856556728..0dd24dc79 100644
--- a/boards/common/remote/include/periph_common.h
+++ b/boards/common/remote/include/periph_common.h
@@ -24,7 +24,7 @@
#include "periph_cpu.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/common/wsn430/board_init.c b/boards/common/wsn430/board_init.c
index 521e248f2..b6a4561ab 100644
--- a/boards/common/wsn430/board_init.c
+++ b/boards/common/wsn430/board_init.c
@@ -7,18 +7,18 @@
* directory for more details.
*/
- /**
- * @ingroup boards_common_wsn430
- * @{
- *
- * @file
- * @brief Board initialization for WSN430
- *
- * @author Milan Babel <babel@inf.fu-berlin.de>
- * @author Hauke Petersen <hauke.petersen@fu-berlin.de>
- *
- * @}
- */
+/**
+ * @ingroup boards_common_wsn430
+ * @{
+ *
+ * @file
+ * @brief Board initialization for WSN430
+ *
+ * @author Milan Babel <babel@inf.fu-berlin.de>
+ * @author Hauke Petersen <hauke.petersen@fu-berlin.de>
+ *
+ * @}
+ */
#include "cpu.h"
#include "irq.h"
diff --git a/boards/feather-m0/include/gpio_params.h b/boards/feather-m0/include/gpio_params.h
index 993846348..26a65757c 100644
--- a/boards/feather-m0/include/gpio_params.h
+++ b/boards/feather-m0/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(Red)",
diff --git a/boards/feather-m0/include/periph_conf.h b/boards/feather-m0/include/periph_conf.h
index 81353f743..e0e0659fe 100644
--- a/boards/feather-m0/include/periph_conf.h
+++ b/boards/feather-m0/include/periph_conf.h
@@ -133,17 +133,17 @@ static const uart_conf_t uart_config[] = {
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{TCC0, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_UNDEF, (gpio_mux_t)0, 0 },
- { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 }, /* ~9 */
- }},
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_UNDEF, (gpio_mux_t)0, 0 },
+ { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 }, /* ~9 */
+ }},
#endif
#if PWM_1_EN
{TCC2, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 16), GPIO_MUX_E, 0 }, /* ~11 */
- { GPIO_UNDEF, (gpio_mux_t)0, 1 },
- }},
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 16), GPIO_MUX_E, 0 }, /* ~11 */
+ { GPIO_UNDEF, (gpio_mux_t)0, 1 },
+ }},
#endif
};
diff --git a/boards/feather-m0/include/sdcard_spi_params.h b/boards/feather-m0/include/sdcard_spi_params.h
index 9d057fdca..69faa36da 100644
--- a/boards/feather-m0/include/sdcard_spi_params.h
+++ b/boards/feather-m0/include/sdcard_spi_params.h
@@ -33,7 +33,7 @@ extern "C" {
/**
* @brief sdcard_spi configuration
*/
-static const sdcard_spi_params_t sdcard_spi_params[] = {
+static const sdcard_spi_params_t sdcard_spi_params[] = {
{
.spi_dev = SPI_DEV(0),
.cs = GPIO_PIN(PA, 8),
diff --git a/boards/fox/include/periph_conf.h b/boards/fox/include/periph_conf.h
index b3e120db2..2d9ba17bb 100644
--- a/boards/fox/include/periph_conf.h
+++ b/boards/fox/include/periph_conf.h
@@ -178,7 +178,7 @@ static const spi_conf_t spi_config[] = {
/**
* @name I2C configuration
- * @{
+ * @{
*/
#define I2C_NUMOF (1U)
#define I2C_0_EN 1
diff --git a/boards/frdm-k22f/include/adc_params.h b/boards/frdm-k22f/include/adc_params.h
index 3a6157a1d..0419b5a76 100644
--- a/boards/frdm-k22f/include/adc_params.h
+++ b/boards/frdm-k22f/include/adc_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief ADC configuration
*/
-static const saul_adc_params_t saul_adc_params[] =
+static const saul_adc_params_t saul_adc_params[] =
{
{
.name = "ADC0_DP",
diff --git a/boards/frdm-k22f/include/gpio_params.h b/boards/frdm-k22f/include/gpio_params.h
index 65481c1f4..f6de4cf74 100644
--- a/boards/frdm-k22f/include/gpio_params.h
+++ b/boards/frdm-k22f/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(red)",
diff --git a/boards/frdm-k22f/include/periph_conf.h b/boards/frdm-k22f/include/periph_conf.h
index d028cb307..547c04de5 100644
--- a/boards/frdm-k22f/include/periph_conf.h
+++ b/boards/frdm-k22f/include/periph_conf.h
@@ -69,22 +69,22 @@ static const clock_config_t clock_config = {
* @{
*/
#define PIT_NUMOF (2U)
-#define PIT_CONFIG { \
- { \
- .prescaler_ch = 0, \
- .count_ch = 1, \
- }, \
- { \
- .prescaler_ch = 2, \
- .count_ch = 3, \
- }, \
+#define PIT_CONFIG { \
+ { \
+ .prescaler_ch = 0, \
+ .count_ch = 1, \
+ }, \
+ { \
+ .prescaler_ch = 2, \
+ .count_ch = 3, \
+ }, \
}
#define LPTMR_NUMOF (1U)
#define LPTMR_CONFIG { \
- { \
- .dev = LPTMR0, \
- .irqn = LPTMR0_IRQn, \
- } \
+ { \
+ .dev = LPTMR0, \
+ .irqn = LPTMR0_IRQn, \
+ } \
}
#define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
@@ -95,9 +95,9 @@ static const clock_config_t clock_config = {
/** @} */
/**
-* @name UART configuration
-* @{
-*/
+ * @name UART configuration
+ * @{
+ */
static const uart_conf_t uart_config[] = {
{
.dev = UART1,
@@ -125,10 +125,10 @@ static const uart_conf_t uart_config[] = {
*/
static const adc_conf_t adc_config[] = {
/* dev, pin, channel */
- { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 0 }, /* ADC0_DP0 */
- { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 19 }, /* ADC0_DM0 */
- { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 0 }, /* ADC1_DP0 */
- { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 19 }, /* ADC1_DM0 */
+ { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 0 }, /* ADC0_DP0 */
+ { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 19 }, /* ADC0_DM0 */
+ { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 0 }, /* ADC1_DP0 */
+ { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 19 }, /* ADC1_DM0 */
{ .dev = ADC0, .pin = GPIO_PIN(PORT_B, 0), .chan = 8 }, /* PTB0 (Arduino A0) */
{ .dev = ADC0, .pin = GPIO_PIN(PORT_B, 1), .chan = 9 }, /* PTB1 (Arduino A1) */
{ .dev = ADC0, .pin = GPIO_PIN(PORT_C, 1), .chan = 15 }, /* PTC1 (Arduino A2) */
@@ -174,8 +174,8 @@ static const pwm_conf_t pwm_config[] = {
* Auto-generated by:
* cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c
*
-* @{
-*/
+ * @{
+ */
static const uint32_t spi_clk_config[] = {
(
SPI_CTAR_PBR(0) | SPI_CTAR_BR(8) | /* -> 93750Hz */
@@ -232,9 +232,9 @@ static const spi_conf_t spi_config[] = {
/**
-* @name I2C configuration
-* @{
-*/
+ * @name I2C configuration
+ * @{
+ */
#define I2C_NUMOF (1U)
#define I2C_0_EN 1
/* Low (10 kHz): MUL = 2, SCL divider = 1536, total: 3072 */
@@ -266,9 +266,9 @@ static const spi_conf_t spi_config[] = {
/** @} */
/**
-* @name RTT and RTC configuration
-* @{
-*/
+ * @name RTT and RTC configuration
+ * @{
+ */
#define RTT_NUMOF (1U)
#define RTC_NUMOF (1U)
#define RTT_DEV RTC
diff --git a/boards/frdm-k64f/include/periph_conf.h b/boards/frdm-k64f/include/periph_conf.h
index 1f36c6427..8d64ae9c0 100644
--- a/boards/frdm-k64f/include/periph_conf.h
+++ b/boards/frdm-k64f/include/periph_conf.h
@@ -70,16 +70,16 @@ static const clock_config_t clock_config = {
* @{
*/
#define PIT_NUMOF (2U)
-#define PIT_CONFIG { \
- { \
- .prescaler_ch = 0, \
- .count_ch = 1, \
- }, \
- { \
- .prescaler_ch = 2, \
- .count_ch = 3, \
- }, \
- }
+#define PIT_CONFIG { \
+ { \
+ .prescaler_ch = 0, \
+ .count_ch = 1, \
+ }, \
+ { \
+ .prescaler_ch = 2, \
+ .count_ch = 3, \
+ }, \
+}
#define LPTMR_NUMOF (0U)
#define LPTMR_CONFIG {}
#define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
@@ -91,9 +91,9 @@ static const clock_config_t clock_config = {
/** @} */
/**
-* @name UART configuration
-* @{
-*/
+ * @name UART configuration
+ * @{
+ */
static const uart_conf_t uart_config[] = {
{
.dev = UART0,
@@ -168,8 +168,8 @@ static const pwm_conf_t pwm_config[] = {
* Auto-generated by:
* cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c
*
-* @{
-*/
+ * @{
+ */
static const uint32_t spi_clk_config[] = {
(
SPI_CTAR_PBR(2) | SPI_CTAR_BR(6) | /* -> 93750Hz */
@@ -226,9 +226,9 @@ static const spi_conf_t spi_config[] = {
/**
-* @name I2C configuration
-* @{
-*/
+ * @name I2C configuration
+ * @{
+ */
#define I2C_NUMOF (1U)
#define I2C_0_EN 1
/* Low (10 kHz): MUL = 4, SCL divider = 1536, total: 6144 */
@@ -260,9 +260,9 @@ static const spi_conf_t spi_config[] = {
/** @} */
/**
-* @name RTT and RTC configuration
-* @{
-*/
+ * @name RTT and RTC configuration
+ * @{
+ */
#define RTT_NUMOF (1U)
#define RTC_NUMOF (1U)
#define RTT_DEV RTC
diff --git a/boards/frdm-kw41z/include/adc_params.h b/boards/frdm-kw41z/include/adc_params.h
index 0c4a109e2..1ba903a16 100644
--- a/boards/frdm-kw41z/include/adc_params.h
+++ b/boards/frdm-kw41z/include/adc_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief ADC configuration
*/
-static const saul_adc_params_t saul_adc_params[] =
+static const saul_adc_params_t saul_adc_params[] =
{
{
.name = "coretemp",
diff --git a/boards/frdm-kw41z/include/gpio_params.h b/boards/frdm-kw41z/include/gpio_params.h
index b5c717cd6..abc6abfa1 100644
--- a/boards/frdm-kw41z/include/gpio_params.h
+++ b/boards/frdm-kw41z/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
/* These LEDs are marked on the board silkscreen with "LED3" for the red LED,
* and "LED4" for the RGB LED, hence the names for the SAUL actuators don't
diff --git a/boards/frdm-kw41z/include/periph_conf.h b/boards/frdm-kw41z/include/periph_conf.h
index 05feabb1c..5aad97275 100644
--- a/boards/frdm-kw41z/include/periph_conf.h
+++ b/boards/frdm-kw41z/include/periph_conf.h
@@ -77,19 +77,19 @@ static const clock_config_t clock_config = {
* @{
*/
#define PIT_NUMOF (1U)
-#define PIT_CONFIG { \
- { \
- .prescaler_ch = 0, \
- .count_ch = 1, \
- }, \
- }
+#define PIT_CONFIG { \
+ { \
+ .prescaler_ch = 0, \
+ .count_ch = 1, \
+ }, \
+}
#define LPTMR_NUMOF (1U)
-#define LPTMR_CONFIG { \
- { \
- .dev = LPTMR0, \
+#define LPTMR_CONFIG { \
+ { \
+ .dev = LPTMR0, \
.irqn = LPTMR0_IRQn, \
- } \
- }
+ } \
+}
#define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
#define PIT_BASECLOCK (CLOCK_BUSCLOCK)
#define LPTMR_ISR_0 isr_lptmr0
@@ -159,8 +159,8 @@ static const adc_conf_t adc_config[] = {
* Auto-generated by:
* cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c
*
-* @{
-*/
+ * @{
+ */
static const uint32_t spi_clk_config[] = {
(
SPI_CTAR_PBR(2) | SPI_CTAR_BR(5) | /* -> 100000Hz */
@@ -231,9 +231,9 @@ static const spi_conf_t spi_config[] = {
/**
-* @name I2C configuration
-* @{
-*/
+ * @name I2C configuration
+ * @{
+ */
/* This CPU has I2C0 clocked by the bus clock and I2C1 clocked by the system
* clock. This causes trouble with the current implementation in kinetis
* which only supports one set of frequency dividers at a time */
@@ -287,9 +287,9 @@ static const spi_conf_t spi_config[] = {
/** @} */
/**
-* @name RTT and RTC configuration
-* @{
-*/
+ * @name RTT and RTC configuration
+ * @{
+ */
#define RTT_NUMOF (1U)
#define RTC_NUMOF (1U)
#define RTT_DEV RTC
diff --git a/boards/ikea-tradfri/include/gpio_params.h b/boards/ikea-tradfri/include/gpio_params.h
index 6d0748615..71ac15a02 100644
--- a/boards/ikea-tradfri/include/gpio_params.h
+++ b/boards/ikea-tradfri/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
diff --git a/boards/limifrog-v1/include/board.h b/boards/limifrog-v1/include/board.h
index e1a1dd272..cb4234db0 100644
--- a/boards/limifrog-v1/include/board.h
+++ b/boards/limifrog-v1/include/board.h
@@ -42,16 +42,16 @@ extern "C" {
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
- /** @} */
+/** @} */
- /**
- * @name xtimer configuration
- * @{
- */
+/**
+ * @name xtimer configuration
+ * @{
+ */
#define XTIMER_WIDTH (16U)
- /** @} */
+/** @} */
- /**
+/**
* @name Define the interface to the LIS3MDL 3-axis magnetometer
* @{
*/
diff --git a/boards/limifrog-v1/include/periph_conf.h b/boards/limifrog-v1/include/periph_conf.h
index d7e36ce08..643ce3187 100644
--- a/boards/limifrog-v1/include/periph_conf.h
+++ b/boards/limifrog-v1/include/periph_conf.h
@@ -153,7 +153,7 @@ static const spi_conf_t spi_config[] = {
/**
* @name I2C configuration
- * @{
+ * @{
*/
#define I2C_0_EN 1
#define I2C_1_EN 1
diff --git a/boards/maple-mini/include/gpio_params.h b/boards/maple-mini/include/gpio_params.h
index 716a6c17c..8a7926090 100644
--- a/boards/maple-mini/include/gpio_params.h
+++ b/boards/maple-mini/include/gpio_params.h
@@ -30,7 +30,7 @@ extern "C" {
/**
* @brief Button/LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED",
diff --git a/boards/mbed_lpc1768/include/gpio_params.h b/boards/mbed_lpc1768/include/gpio_params.h
index 8f12cc7f5..4c5520050 100644
--- a/boards/mbed_lpc1768/include/gpio_params.h
+++ b/boards/mbed_lpc1768/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
diff --git a/boards/mbed_lpc1768/system.c b/boards/mbed_lpc1768/system.c
index dcfdf3d13..b239de1af 100644
--- a/boards/mbed_lpc1768/system.c
+++ b/boards/mbed_lpc1768/system.c
@@ -1,27 +1,27 @@
/**************************************************************************//**
- * @file
- * @brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File
- * for the NXP LPC17xx Device Series
- * @version V1.09
- * @date 09. November 2013
- *
- * @note Integrated, adopted, and renamed for RIOT by Oliver Hahm.
- *
- * Copyright (C) 2009 ARM Limited. All rights reserved.
- * Copyright (C) 2013 Oliver Hahm <oliver.hahm@inria.fr>
- *
- * @par
- * ARM Limited (ARM) is supplying this software for use with Cortex-M
- * processor based microcontrollers. This file can be freely distributed
- * within development tools that are supporting such ARM based processors.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
- * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
- * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
- *
- ******************************************************************************/
+* @file
+* @brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File
+* for the NXP LPC17xx Device Series
+* @version V1.09
+* @date 09. November 2013
+*
+* @note Integrated, adopted, and renamed for RIOT by Oliver Hahm.
+*
+* Copyright (C) 2009 ARM Limited. All rights reserved.
+* Copyright (C) 2013 Oliver Hahm <oliver.hahm@inria.fr>
+*
+* @par
+* ARM Limited (ARM) is supplying this software for use with Cortex-M
+* processor based microcontrollers. This file can be freely distributed
+* within development tools that are supporting such ARM based processors.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
+* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
+* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
+* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
+*
+******************************************************************************/
#include "vendor/LPC17xx.h"
diff --git a/boards/mega-xplained/include/adc_params.h b/boards/mega-xplained/include/adc_params.h
index eede5f45c..7c800f31d 100644
--- a/boards/mega-xplained/include/adc_params.h
+++ b/boards/mega-xplained/include/adc_params.h
@@ -31,7 +31,7 @@ extern "C" {
/**
* @brief ADC configuration
*/
-static const saul_adc_params_t saul_adc_params[] =
+static const saul_adc_params_t saul_adc_params[] =
{
{
.name = "NTC thermistor",
diff --git a/boards/mega-xplained/include/gpio_params.h b/boards/mega-xplained/include/gpio_params.h
index a0fc7fe3e..af4a73f4a 100644
--- a/boards/mega-xplained/include/gpio_params.h
+++ b/boards/mega-xplained/include/gpio_params.h
@@ -31,7 +31,7 @@ extern "C" {
/**
* @brief GPIO configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "Button 0",
diff --git a/boards/msbiot/include/gpio_params.h b/boards/msbiot/include/gpio_params.h
index 6694f7cd2..fc4ea6a25 100644
--- a/boards/msbiot/include/gpio_params.h
+++ b/boards/msbiot/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "red LED",
diff --git a/boards/msbiot/include/periph_conf.h b/boards/msbiot/include/periph_conf.h
index 52629ab8d..20354ef28 100644
--- a/boards/msbiot/include/periph_conf.h
+++ b/boards/msbiot/include/periph_conf.h
@@ -110,9 +110,9 @@ static const pwm_conf_t pwm_config[] = {
* PIN, device (ADCx), channel
* @{
*/
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_B, 0), 0, 8}, \
- {GPIO_PIN(PORT_B, 1), 0, 9} \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_B, 0), 0, 8}, \
+ {GPIO_PIN(PORT_B, 1), 0, 9} \
}
#define ADC_NUMOF (2)
diff --git a/boards/mulle/board.c b/boards/mulle/board.c
index b4f548557..98cc20aeb 100644
--- a/boards/mulle/board.c
+++ b/boards/mulle/board.c
@@ -36,10 +36,10 @@
static nvram_t mulle_nvram_dev;
nvram_t *mulle_nvram = &mulle_nvram_dev;
static nvram_spi_params_t nvram_spi_params = {
- .spi = MULLE_NVRAM_SPI_DEV,
- .clk = MULLE_NVRAM_SPI_CLK,
- .cs = MULLE_NVRAM_SPI_CS,
- .address_count = MULLE_NVRAM_SPI_ADDRESS_COUNT,
+ .spi = MULLE_NVRAM_SPI_DEV,
+ .clk = MULLE_NVRAM_SPI_CLK,
+ .cs = MULLE_NVRAM_SPI_CS,
+ .address_count = MULLE_NVRAM_SPI_ADDRESS_COUNT,
};
static devfs_t mulle_nvram_devfs = {
@@ -134,7 +134,7 @@ static int mulle_nvram_init(void)
{
union {
uint32_t u32;
- uint8_t u8[sizeof(uint32_t)];
+ uint8_t u8[sizeof(uint32_t)];
} rec;
rec.u32 = 0;
@@ -150,7 +150,7 @@ static int mulle_nvram_init(void)
int i;
union {
uint64_t u64;
- uint8_t u8[sizeof(uint64_t)];
+ uint8_t u8[sizeof(uint64_t)];
} zero;
zero.u64 = 0;
for (i = 0; i < MULLE_NVRAM_CAPACITY; i += sizeof(zero)) {
@@ -174,7 +174,7 @@ static void increase_boot_count(void)
{
union {
uint32_t u32;
- uint8_t u8[sizeof(uint32_t)];
+ uint8_t u8[sizeof(uint32_t)];
} rec;
rec.u32 = 0;
if (mulle_nvram->read(mulle_nvram, &rec.u8[0], MULLE_NVRAM_BOOT_COUNT, sizeof(rec.u32)) != sizeof(rec.u32)) {
diff --git a/boards/mulle/include/adc_params.h b/boards/mulle/include/adc_params.h
index 36f6842cc..f2041f838 100644
--- a/boards/mulle/include/adc_params.h
+++ b/boards/mulle/include/adc_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief ADC configuration
*/
-static const saul_adc_params_t saul_adc_params[] =
+static const saul_adc_params_t saul_adc_params[] =
{
{
.name = "k60temp",
diff --git a/boards/mulle/include/gpio_params.h b/boards/mulle/include/gpio_params.h
index 182e5a68b..159921600 100644
--- a/boards/mulle/include/gpio_params.h
+++ b/boards/mulle/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief LED configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(red)",
diff --git a/boards/mulle/include/periph_conf.h b/boards/mulle/include/periph_conf.h
index 67b98614f..e20475e71 100644
--- a/boards/mulle/include/periph_conf.h
+++ b/boards/mulle/include/periph_conf.h
@@ -92,23 +92,23 @@ static const clock_config_t clock_config = {
* @{
*/
#define PIT_NUMOF (2U)
-#define PIT_CONFIG { \
- { \
- .prescaler_ch = 0, \
- .count_ch = 1, \
- }, \
- { \
- .prescaler_ch = 2, \
- .count_ch = 3, \
- }, \
- }
+#define PIT_CONFIG { \
+ { \
+ .prescaler_ch = 0, \
+ .count_ch = 1, \
+ }, \
+ { \
+ .prescaler_ch = 2, \
+ .count_ch = 3, \
+ }, \
+}
#define LPTMR_NUMOF (1U)
-#define LPTMR_CONFIG { \
- { \
- .dev = LPTMR0, \
+#define LPTMR_CONFIG { \
+ { \
+ .dev = LPTMR0, \
.irqn = LPTMR0_IRQn, \
- } \
- }
+ } \
+}
#define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
#define PIT_BASECLOCK (CLOCK_BUSCLOCK)
@@ -173,7 +173,7 @@ static const adc_conf_t adc_config[] = {
[ 4] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 23 },
/* internal: VREF module output level */
[ 5] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 18 },
- /* on board connection to Mulle Vbat/2 on PGA1_DP pin */
+ /* on board connection to Mulle Vbat/2 on PGA1_DP pin */
[ 6] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 0 },
/* on board connection to Mulle Vchr/2 on PGA1_DM pin */
[ 7] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 19 },
diff --git a/boards/nucleo-f030r8/include/periph_conf.h b/boards/nucleo-f030r8/include/periph_conf.h
index 5042dbca8..ccfb73e4d 100644
--- a/boards/nucleo-f030r8/include/periph_conf.h
+++ b/boards/nucleo-f030r8/include/periph_conf.h
@@ -39,23 +39,23 @@ extern "C" {
/* give the target core clock (HCLK) frequency [in Hz],
* maximum: 48MHz */
#define CLOCK_CORECLOCK (48000000U)
- /* 0: no external high speed crystal available
- * else: actual crystal frequency [in Hz] */
+/* 0: no external high speed crystal available
+ * else: actual crystal frequency [in Hz] */
#define CLOCK_HSE (8000000U)
- /* 0: no external low speed crystal available,
- * 1: external crystal available (always 32.768kHz) */
+/* 0: no external low speed crystal available,
+ * 1: external crystal available (always 32.768kHz) */
#define CLOCK_LSE (1)
- /* peripheral clock setup */
+/* peripheral clock setup */
#define CLOCK_AHB_DIV RCC_CFGR_HPRE_DIV1
#define CLOCK_AHB (CLOCK_CORECLOCK / 1)
#define CLOCK_APB1_DIV RCC_CFGR_PPRE_DIV1 /* max 48MHz */
#define CLOCK_APB1 (CLOCK_CORECLOCK / 1)
#define CLOCK_APB2 (CLOCK_APB1)
- /* PLL factors */
+/* PLL factors */
#define CLOCK_PLL_PREDIV (1)
#define CLOCK_PLL_MUL (6)
- /** @} */
+/** @} */
/**
* @name Timer configuration
@@ -143,13 +143,13 @@ static const pwm_conf_t pwm_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 }, \
- { GPIO_PIN(PORT_A, 1), 1 }, \
- { GPIO_PIN(PORT_A, 4), 4 }, \
- { GPIO_PIN(PORT_B, 0), 8 }, \
- { GPIO_PIN(PORT_C, 1), 11 },\
- { GPIO_PIN(PORT_C, 0), 10 } \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, \
+ { GPIO_PIN(PORT_A, 1), 1 }, \
+ { GPIO_PIN(PORT_A, 4), 4 }, \
+ { GPIO_PIN(PORT_B, 0), 8 }, \
+ { GPIO_PIN(PORT_C, 1), 11 }, \
+ { GPIO_PIN(PORT_C, 0), 10 } \
}
#define ADC_NUMOF (6)
diff --git a/boards/nucleo-f031k6/include/periph_conf.h b/boards/nucleo-f031k6/include/periph_conf.h
index 5779589ae..1c00ccdfc 100644
--- a/boards/nucleo-f031k6/include/periph_conf.h
+++ b/boards/nucleo-f031k6/include/periph_conf.h
@@ -192,12 +192,12 @@ static const spi_conf_t spi_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 }, \
- { GPIO_PIN(PORT_A, 1), 1 }, \
- { GPIO_PIN(PORT_A, 3), 3 }, \
- { GPIO_PIN(PORT_A, 4), 4 }, \
- { GPIO_PIN(PORT_A, 7), 7 } \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, \
+ { GPIO_PIN(PORT_A, 1), 1 }, \
+ { GPIO_PIN(PORT_A, 3), 3 }, \
+ { GPIO_PIN(PORT_A, 4), 4 }, \
+ { GPIO_PIN(PORT_A, 7), 7 } \
}
#define ADC_NUMOF (5)
diff --git a/boards/nucleo-f042k6/include/periph_conf.h b/boards/nucleo-f042k6/include/periph_conf.h
index 98c04c461..c42b2a5b1 100644
--- a/boards/nucleo-f042k6/include/periph_conf.h
+++ b/boards/nucleo-f042k6/include/periph_conf.h
@@ -203,12 +203,12 @@ static const spi_conf_t spi_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 }, \
- { GPIO_PIN(PORT_A, 1), 1 }, \
- { GPIO_PIN(PORT_A, 3), 3 }, \
- { GPIO_PIN(PORT_A, 4), 4 }, \
- { GPIO_PIN(PORT_A, 7), 7 } \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, \
+ { GPIO_PIN(PORT_A, 1), 1 }, \
+ { GPIO_PIN(PORT_A, 3), 3 }, \
+ { GPIO_PIN(PORT_A, 4), 4 }, \
+ { GPIO_PIN(PORT_A, 7), 7 } \
}
#define ADC_NUMOF (5)
diff --git a/boards/nucleo-f070rb/include/periph_conf.h b/boards/nucleo-f070rb/include/periph_conf.h
index 7dd6a6850..3908b9969 100644
--- a/boards/nucleo-f070rb/include/periph_conf.h
+++ b/boards/nucleo-f070rb/include/periph_conf.h
@@ -39,23 +39,23 @@ extern "C" {
/* give the target core clock (HCLK) frequency [in Hz],
* maximum: 48MHz */
#define CLOCK_CORECLOCK (48000000U)
- /* 0: no external high speed crystal available
- * else: actual crystal frequency [in Hz] */
+/* 0: no external high speed crystal available
+ * else: actual crystal frequency [in Hz] */
#define CLOCK_HSE (8000000U)
- /* 0: no external low speed crystal available,
- * 1: external crystal available (always 32.768kHz) */
+/* 0: no external low speed crystal available,
+ * 1: external crystal available (always 32.768kHz) */
#define CLOCK_LSE (1)
- /* peripheral clock setup */
+/* peripheral clock setup */
#define CLOCK_AHB_DIV RCC_CFGR_HPRE_DIV1
#define CLOCK_AHB (CLOCK_CORECLOCK / 1)
#define CLOCK_APB1_DIV RCC_CFGR_PPRE_DIV1 /* max 48MHz */
#define CLOCK_APB1 (CLOCK_CORECLOCK / 1)
#define CLOCK_APB2 (CLOCK_APB1)
- /* PLL factors */
+/* PLL factors */
#define CLOCK_PLL_PREDIV (1)
#define CLOCK_PLL_MUL (6)
- /** @} */
+/** @} */
/**
* @name Timer configuration
@@ -155,13 +155,13 @@ static const pwm_conf_t pwm_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 },\
- { GPIO_PIN(PORT_A, 1), 1 },\
- { GPIO_PIN(PORT_A, 4), 4 },\
- { GPIO_PIN(PORT_B, 0), 8 },\
- { GPIO_PIN(PORT_C, 1), 11 },\
- { GPIO_PIN(PORT_C, 0), 10 } \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, \
+ { GPIO_PIN(PORT_A, 1), 1 }, \
+ { GPIO_PIN(PORT_A, 4), 4 }, \
+ { GPIO_PIN(PORT_B, 0), 8 }, \
+ { GPIO_PIN(PORT_C, 1), 11 }, \
+ { GPIO_PIN(PORT_C, 0), 10 } \
}
#define ADC_NUMOF (6)
diff --git a/boards/nucleo-f072rb/include/periph_conf.h b/boards/nucleo-f072rb/include/periph_conf.h
index 7f1a91623..a84c74477 100644
--- a/boards/nucleo-f072rb/include/periph_conf.h
+++ b/boards/nucleo-f072rb/include/periph_conf.h
@@ -38,23 +38,23 @@ extern "C" {
/* give the target core clock (HCLK) frequency [in Hz],
* maximum: 48MHz */
#define CLOCK_CORECLOCK (48000000U)
- /* 0: no external high speed crystal available
- * else: actual crystal frequency [in Hz] */
+/* 0: no external high speed crystal available
+ * else: actual crystal frequency [in Hz] */
#define CLOCK_HSE (8000000U)
- /* 0: no external low speed crystal available,
- * 1: external crystal available (always 32.768kHz) */
+/* 0: no external low speed crystal available,
+ * 1: external crystal available (always 32.768kHz) */
#define CLOCK_LSE (1)
- /* peripheral clock setup */
+/* peripheral clock setup */
#define CLOCK_AHB_DIV RCC_CFGR_HPRE_DIV1
#define CLOCK_AHB (CLOCK_CORECLOCK / 1)
#define CLOCK_APB1_DIV RCC_CFGR_PPRE_DIV1 /* max 48MHz */
#define CLOCK_APB1 (CLOCK_CORECLOCK / 1)
#define CLOCK_APB2 (CLOCK_APB1)
- /* PLL factors */
+/* PLL factors */
#define CLOCK_PLL_PREDIV (1)
#define CLOCK_PLL_MUL (6)
- /** @} */
+/** @} */
/**
* @name Timer configuration
@@ -127,9 +127,9 @@ static const pwm_conf_t pwm_config[] = {
{
.dev = TIM2,
.rcc_mask = RCC_APB1ENR_TIM2EN,
- .chan = { { .pin = GPIO_PIN(PORT_B, 3) /* D3 */, .cc_chan = 1 },
+ .chan = { { .pin = GPIO_PIN(PORT_B, 3) /* D3 */, .cc_chan = 1 },
{ .pin = GPIO_PIN(PORT_B, 10) /* D6 */, .cc_chan = 2 },
- { .pin = GPIO_PIN(PORT_B, 11) , .cc_chan = 3 },
+ { .pin = GPIO_PIN(PORT_B, 11), .cc_chan = 3 },
{ .pin = GPIO_UNDEF, .cc_chan = 0 } },
.af = GPIO_AF2,
.bus = APB1
@@ -203,13 +203,13 @@ static const spi_conf_t spi_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 }, \
- { GPIO_PIN(PORT_A, 1), 1 }, \
- { GPIO_PIN(PORT_A, 4), 4 }, \
- { GPIO_PIN(PORT_B, 0), 8 }, \
- { GPIO_PIN(PORT_C, 1), 11 },\
- { GPIO_PIN(PORT_C, 0), 10 } \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, \
+ { GPIO_PIN(PORT_A, 1), 1 }, \
+ { GPIO_PIN(PORT_A, 4), 4 }, \
+ { GPIO_PIN(PORT_B, 0), 8 }, \
+ { GPIO_PIN(PORT_C, 1), 11 }, \
+ { GPIO_PIN(PORT_C, 0), 10 } \
}
#define ADC_NUMOF (6)
diff --git a/boards/nucleo-f091rc/include/periph_conf.h b/boards/nucleo-f091rc/include/periph_conf.h
index a448ff143..f2d16d8c8 100644
--- a/boards/nucleo-f091rc/include/periph_conf.h
+++ b/boards/nucleo-f091rc/include/periph_conf.h
@@ -168,9 +168,9 @@ static const pwm_conf_t pwm_config[] = {
{
.dev = TIM2,
.rcc_mask = RCC_APB1ENR_TIM2EN,
- .chan = { { .pin = GPIO_PIN(PORT_B, 3) /* D3 */, .cc_chan = 1 },
+ .chan = { { .pin = GPIO_PIN(PORT_B, 3) /* D3 */, .cc_chan = 1 },
{ .pin = GPIO_PIN(PORT_B, 10) /* D6 */, .cc_chan = 2 },
- { .pin = GPIO_PIN(PORT_B, 11) , .cc_chan = 3 },
+ { .pin = GPIO_PIN(PORT_B, 11), .cc_chan = 3 },
{ .pin = GPIO_UNDEF, .cc_chan = 0 } },
.af = GPIO_AF2,
.bus = APB1
@@ -206,13 +206,13 @@ static const pwm_conf_t pwm_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 },\
- { GPIO_PIN(PORT_A, 1), 1 },\
- { GPIO_PIN(PORT_A, 4), 4 },\
- { GPIO_PIN(PORT_B, 0), 8 },\
- { GPIO_PIN(PORT_C, 1), 11 },\
- { GPIO_PIN(PORT_C, 0), 10 } \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, \
+ { GPIO_PIN(PORT_A, 1), 1 }, \
+ { GPIO_PIN(PORT_A, 4), 4 }, \
+ { GPIO_PIN(PORT_B, 0), 8 }, \
+ { GPIO_PIN(PORT_C, 1), 11 }, \
+ { GPIO_PIN(PORT_C, 0), 10 } \
}
#define ADC_NUMOF (6)
diff --git a/boards/nucleo-f207zg/include/periph_conf.h b/boards/nucleo-f207zg/include/periph_conf.h
index 2af6f16da..e86ba551d 100644
--- a/boards/nucleo-f207zg/include/periph_conf.h
+++ b/boards/nucleo-f207zg/include/periph_conf.h
@@ -265,9 +265,9 @@ static const spi_conf_t spi_config[] = {
* PIN, device (ADCx), channel
* @{
*/
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 3), 0, 3}, \
- {GPIO_PIN(PORT_C, 0), 1, 0} \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 3), 0, 3}, \
+ {GPIO_PIN(PORT_C, 0), 1, 0} \
}
#define ADC_NUMOF (2)
/** @} */
diff --git a/boards/nucleo-f401re/include/periph_conf.h b/boards/nucleo-f401re/include/periph_conf.h
index 3069ee9e3..5dfe25a15 100644
--- a/boards/nucleo-f401re/include/periph_conf.h
+++ b/boards/nucleo-f401re/include/periph_conf.h
@@ -144,8 +144,8 @@ static const pwm_conf_t pwm_config[] = {
{
.dev = TIM2,
.rcc_mask = RCC_APB1ENR_TIM2EN,
- .chan = { { .pin = GPIO_PIN(PORT_A, 15) , .cc_chan = 0 },
- { .pin = GPIO_PIN(PORT_B, 3) /* D3 */, .cc_chan = 1 },
+ .chan = { { .pin = GPIO_PIN(PORT_A, 15), .cc_chan = 0 },
+ { .pin = GPIO_PIN(PORT_B, 3) /* D3 */, .cc_chan = 1 },
{ .pin = GPIO_PIN(PORT_B, 10) /* D6 */, .cc_chan = 2 },
{ .pin = GPIO_UNDEF, .cc_chan = 0 } },
.af = GPIO_AF1,
@@ -289,13 +289,13 @@ static const spi_conf_t spi_config[] = {
* @{
*/
#define ADC_NUMOF (6U)
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 0), 0, 0}, \
- {GPIO_PIN(PORT_A, 1), 0, 1}, \
- {GPIO_PIN(PORT_A, 4), 0, 4}, \
- {GPIO_PIN(PORT_B, 0), 0, 8}, \
- {GPIO_PIN(PORT_C, 1), 0, 11}, \
- {GPIO_PIN(PORT_C, 0), 0, 10}, \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 0), 0, 0}, \
+ {GPIO_PIN(PORT_A, 1), 0, 1}, \
+ {GPIO_PIN(PORT_A, 4), 0, 4}, \
+ {GPIO_PIN(PORT_B, 0), 0, 8}, \
+ {GPIO_PIN(PORT_C, 1), 0, 11}, \
+ {GPIO_PIN(PORT_C, 0), 0, 10}, \
}
/** @} */
diff --git a/boards/nucleo-f410rb/include/periph_conf.h b/boards/nucleo-f410rb/include/periph_conf.h
index bc67feb4c..90f48cd40 100644
--- a/boards/nucleo-f410rb/include/periph_conf.h
+++ b/boards/nucleo-f410rb/include/periph_conf.h
@@ -201,13 +201,13 @@ static const spi_conf_t spi_config[] = {
* @{
*/
#define ADC_NUMOF (6U)
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 0), 0, 0}, \
- {GPIO_PIN(PORT_A, 1), 0, 1}, \
- {GPIO_PIN(PORT_A, 4), 0, 4}, \
- {GPIO_PIN(PORT_B, 0), 0, 8}, \
- {GPIO_PIN(PORT_C, 1), 0, 11}, \
- {GPIO_PIN(PORT_C, 0), 0, 10}, \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 0), 0, 0}, \
+ {GPIO_PIN(PORT_A, 1), 0, 1}, \
+ {GPIO_PIN(PORT_A, 4), 0, 4}, \
+ {GPIO_PIN(PORT_B, 0), 0, 8}, \
+ {GPIO_PIN(PORT_C, 1), 0, 11}, \
+ {GPIO_PIN(PORT_C, 0), 0, 10}, \
}
/** @} */
diff --git a/boards/nucleo-f411re/include/periph_conf.h b/boards/nucleo-f411re/include/periph_conf.h
index 60e7fa08a..346c9573e 100644
--- a/boards/nucleo-f411re/include/periph_conf.h
+++ b/boards/nucleo-f411re/include/periph_conf.h
@@ -146,8 +146,8 @@ static const pwm_conf_t pwm_config[] = {
{
.dev = TIM2,
.rcc_mask = RCC_APB1ENR_TIM2EN,
- .chan = { { .pin = GPIO_PIN(PORT_A, 15) , .cc_chan = 0 },
- { .pin = GPIO_PIN(PORT_B, 3) /* D3 */, .cc_chan = 1 },
+ .chan = { { .pin = GPIO_PIN(PORT_A, 15), .cc_chan = 0 },
+ { .pin = GPIO_PIN(PORT_B, 3) /* D3 */, .cc_chan = 1 },
{ .pin = GPIO_PIN(PORT_B, 10) /* D6 */, .cc_chan = 2 },
{ .pin = GPIO_UNDEF, .cc_chan = 0 } },
.af = GPIO_AF1,
@@ -247,13 +247,13 @@ static const spi_conf_t spi_config[] = {
* @{
*/
#define ADC_NUMOF (6U)
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 0), 0, 0}, \
- {GPIO_PIN(PORT_A, 1), 0, 1}, \
- {GPIO_PIN(PORT_A, 4), 0, 4}, \
- {GPIO_PIN(PORT_B, 0), 0, 8}, \
- {GPIO_PIN(PORT_C, 1), 0, 11}, \
- {GPIO_PIN(PORT_C, 0), 0, 10}, \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 0), 0, 0}, \
+ {GPIO_PIN(PORT_A, 1), 0, 1}, \
+ {GPIO_PIN(PORT_A, 4), 0, 4}, \
+ {GPIO_PIN(PORT_B, 0), 0, 8}, \
+ {GPIO_PIN(PORT_C, 1), 0, 11}, \
+ {GPIO_PIN(PORT_C, 0), 0, 10}, \
}
/** @} */
diff --git a/boards/nucleo-f412zg/include/periph_conf.h b/boards/nucleo-f412zg/include/periph_conf.h
index 631b18c7d..4c9576b30 100644
--- a/boards/nucleo-f412zg/include/periph_conf.h
+++ b/boards/nucleo-f412zg/include/periph_conf.h
@@ -258,13 +258,13 @@ static const spi_conf_t spi_config[] = {
* @{
*/
#define ADC_NUMOF (6U)
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 3), 0, 3}, \
- {GPIO_PIN(PORT_C, 0), 0, 10}, \
- {GPIO_PIN(PORT_C, 3), 0, 13}, \
- {GPIO_PIN(PORT_C, 1), 0, 11}, \
- {GPIO_PIN(PORT_C, 4), 0, 14}, \
- {GPIO_PIN(PORT_C, 5), 0, 15}, \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 3), 0, 3}, \
+ {GPIO_PIN(PORT_C, 0), 0, 10}, \
+ {GPIO_PIN(PORT_C, 3), 0, 13}, \
+ {GPIO_PIN(PORT_C, 1), 0, 11}, \
+ {GPIO_PIN(PORT_C, 4), 0, 14}, \
+ {GPIO_PIN(PORT_C, 5), 0, 15}, \
}
/** @} */
diff --git a/boards/nucleo-f413zh/include/periph_conf.h b/boards/nucleo-f413zh/include/periph_conf.h
index 1f34609f1..fbcc9fbe2 100644
--- a/boards/nucleo-f413zh/include/periph_conf.h
+++ b/boards/nucleo-f413zh/include/periph_conf.h
@@ -287,13 +287,13 @@ static const spi_conf_t spi_config[] = {
* @{
*/
#define ADC_NUMOF (6U)
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 3), 0, 3}, \
- {GPIO_PIN(PORT_C, 0), 0, 10}, \
- {GPIO_PIN(PORT_C, 3), 0, 13}, \
- {GPIO_PIN(PORT_C, 1), 0, 11}, \
- {GPIO_PIN(PORT_C, 4), 0, 14}, \
- {GPIO_PIN(PORT_C, 5), 0, 15}, \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 3), 0, 3}, \
+ {GPIO_PIN(PORT_C, 0), 0, 10}, \
+ {GPIO_PIN(PORT_C, 3), 0, 13}, \
+ {GPIO_PIN(PORT_C, 1), 0, 11}, \
+ {GPIO_PIN(PORT_C, 4), 0, 14}, \
+ {GPIO_PIN(PORT_C, 5), 0, 15}, \
}
/** @} */
diff --git a/boards/nucleo-f429zi/include/periph_conf.h b/boards/nucleo-f429zi/include/periph_conf.h
index 0305335b2..fa73a6ef7 100644
--- a/boards/nucleo-f429zi/include/periph_conf.h
+++ b/boards/nucleo-f429zi/include/periph_conf.h
@@ -245,13 +245,13 @@ static const spi_conf_t spi_config[] = {
* @{
*/
#define ADC_NUMOF (6U)
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 3), 2, 3}, \
- {GPIO_PIN(PORT_C, 0), 2, 10}, \
- {GPIO_PIN(PORT_C, 3), 2, 13}, \
- {GPIO_PIN(PORT_F, 3), 2, 9}, \
- {GPIO_PIN(PORT_F, 5), 2, 15}, \
- {GPIO_PIN(PORT_F, 10), 2, 8}, \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 3), 2, 3}, \
+ {GPIO_PIN(PORT_C, 0), 2, 10}, \
+ {GPIO_PIN(PORT_C, 3), 2, 13}, \
+ {GPIO_PIN(PORT_F, 3), 2, 9}, \
+ {GPIO_PIN(PORT_F, 5), 2, 15}, \
+ {GPIO_PIN(PORT_F, 10), 2, 8}, \
}
/** @} */
diff --git a/boards/nucleo-f446re/include/periph_conf.h b/boards/nucleo-f446re/include/periph_conf.h
index 64e6bf9cd..89d877d2d 100644
--- a/boards/nucleo-f446re/include/periph_conf.h
+++ b/boards/nucleo-f446re/include/periph_conf.h
@@ -309,13 +309,13 @@ static const spi_conf_t spi_config[] = {
* @{
*/
#define ADC_NUMOF (6U)
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 0), 0, 0}, \
- {GPIO_PIN(PORT_A, 1), 0, 1}, \
- {GPIO_PIN(PORT_A, 4), 0, 4}, \
- {GPIO_PIN(PORT_B, 0), 0, 8}, \
- {GPIO_PIN(PORT_C, 1), 0, 11}, \
- {GPIO_PIN(PORT_C, 0), 0, 10}, \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 0), 0, 0}, \
+ {GPIO_PIN(PORT_A, 1), 0, 1}, \
+ {GPIO_PIN(PORT_A, 4), 0, 4}, \
+ {GPIO_PIN(PORT_B, 0), 0, 8}, \
+ {GPIO_PIN(PORT_C, 1), 0, 11}, \
+ {GPIO_PIN(PORT_C, 0), 0, 10}, \
}
/** @} */
diff --git a/boards/nucleo-l031k6/include/periph_conf.h b/boards/nucleo-l031k6/include/periph_conf.h
index 58063a5f6..63244e5af 100644
--- a/boards/nucleo-l031k6/include/periph_conf.h
+++ b/boards/nucleo-l031k6/include/periph_conf.h
@@ -155,14 +155,14 @@ static const spi_conf_t spi_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 }, /* Pin A0 */ \
- { GPIO_PIN(PORT_A, 1), 1 }, /* Pin A1 */ \
- { GPIO_PIN(PORT_A, 3), 3 }, /* Pin A2 */ \
- { GPIO_PIN(PORT_A, 4), 4 }, /* Pin A3 */ \
- { GPIO_PIN(PORT_A, 5), 5 }, /* Pin A4 */ \
- { GPIO_PIN(PORT_A, 6), 6 }, /* Pin A5 */ \
- { GPIO_PIN(PORT_A, 7), 7 }, /* Pin A6 */ \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, /* Pin A0 */ \
+ { GPIO_PIN(PORT_A, 1), 1 }, /* Pin A1 */ \
+ { GPIO_PIN(PORT_A, 3), 3 }, /* Pin A2 */ \
+ { GPIO_PIN(PORT_A, 4), 4 }, /* Pin A3 */ \
+ { GPIO_PIN(PORT_A, 5), 5 }, /* Pin A4 */ \
+ { GPIO_PIN(PORT_A, 6), 6 }, /* Pin A5 */ \
+ { GPIO_PIN(PORT_A, 7), 7 }, /* Pin A6 */ \
}
#define ADC_NUMOF (7U)
/** @} */
diff --git a/boards/nucleo-l073rz/include/periph_conf.h b/boards/nucleo-l073rz/include/periph_conf.h
index 607cf821b..ea4529957 100644
--- a/boards/nucleo-l073rz/include/periph_conf.h
+++ b/boards/nucleo-l073rz/include/periph_conf.h
@@ -126,7 +126,7 @@ static const pwm_conf_t pwm_config[] = {
.rcc_mask = RCC_APB1ENR_TIM3EN,
.chan = { { .pin = GPIO_PIN(PORT_B, 4) /* D5 */, .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_C, 7) /* D9 */, .cc_chan = 1 },
- { .pin = GPIO_PIN(PORT_C, 8) , .cc_chan = 2 },
+ { .pin = GPIO_PIN(PORT_C, 8), .cc_chan = 2 },
{ .pin = GPIO_UNDEF, .cc_chan = 0 } },
.af = GPIO_AF2,
.bus = APB1
@@ -180,13 +180,13 @@ static const spi_conf_t spi_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 }, \
- { GPIO_PIN(PORT_A, 1), 1 }, \
- { GPIO_PIN(PORT_A, 4), 4 }, \
- { GPIO_PIN(PORT_B, 0), 8 }, \
- { GPIO_PIN(PORT_C, 1), 11 },\
- { GPIO_PIN(PORT_C, 0), 10 } \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, \
+ { GPIO_PIN(PORT_A, 1), 1 }, \
+ { GPIO_PIN(PORT_A, 4), 4 }, \
+ { GPIO_PIN(PORT_B, 0), 8 }, \
+ { GPIO_PIN(PORT_C, 1), 11 }, \
+ { GPIO_PIN(PORT_C, 0), 10 } \
}
#define ADC_NUMOF (6U)
diff --git a/boards/nucleo-l152re/include/periph_conf.h b/boards/nucleo-l152re/include/periph_conf.h
index 458899298..594d84de1 100644
--- a/boards/nucleo-l152re/include/periph_conf.h
+++ b/boards/nucleo-l152re/include/periph_conf.h
@@ -204,7 +204,7 @@ static const spi_conf_t spi_config[] = {
/**
* @name I2C configuration
- * @{
+ * @{
*/
#define I2C_0_EN 1
#define I2C_1_EN 1
@@ -233,13 +233,13 @@ static const i2c_conf_t i2c_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_A, 0), 0 }, \
- { GPIO_PIN(PORT_A, 1), 1 }, \
- { GPIO_PIN(PORT_A, 4), 4 }, \
- { GPIO_PIN(PORT_B, 0), 8 }, \
- { GPIO_PIN(PORT_C, 1), 11 }, \
- { GPIO_PIN(PORT_C, 0), 10 }, \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_A, 0), 0 }, \
+ { GPIO_PIN(PORT_A, 1), 1 }, \
+ { GPIO_PIN(PORT_A, 4), 4 }, \
+ { GPIO_PIN(PORT_B, 0), 8 }, \
+ { GPIO_PIN(PORT_C, 1), 11 }, \
+ { GPIO_PIN(PORT_C, 0), 10 }, \
}
#define ADC_NUMOF (6U)
diff --git a/boards/nz32-sc151/include/board.h b/boards/nz32-sc151/include/board.h
index 8691cff45..039605fa3 100644
--- a/boards/nz32-sc151/include/board.h
+++ b/boards/nz32-sc151/include/board.h
@@ -41,7 +41,7 @@ extern "C" {
#define LED0_ON (GPIOB->BSRR = LED0_MASK)
#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
- /** @} */
+/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
diff --git a/boards/nz32-sc151/include/gpio_params.h b/boards/nz32-sc151/include/gpio_params.h
index 2d5f53b62..70e8055b8 100644
--- a/boards/nz32-sc151/include/gpio_params.h
+++ b/boards/nz32-sc151/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED (PB2)",
diff --git a/boards/nz32-sc151/include/periph_conf.h b/boards/nz32-sc151/include/periph_conf.h
index 800a543aa..15f6a84e1 100644
--- a/boards/nz32-sc151/include/periph_conf.h
+++ b/boards/nz32-sc151/include/periph_conf.h
@@ -194,7 +194,7 @@ static const spi_conf_t spi_config[] = {
/**
* @name I2C configuration
- * @{
+ * @{
*/
#define I2C_NUMOF (1)
#define I2C_0_EN 1
@@ -223,14 +223,14 @@ static const i2c_conf_t i2c_config[] = {
* @name ADC configuration
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_C, 0), 10 }, \
- { GPIO_PIN(PORT_C, 1), 11 }, \
- { GPIO_PIN(PORT_C, 2), 12 }, \
- /* ADC Temperature channel */ \
- { GPIO_UNDEF, 16 }, \
- /* ADC VREF channel */ \
- { GPIO_UNDEF, 17 }, \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_C, 0), 10 }, \
+ { GPIO_PIN(PORT_C, 1), 11 }, \
+ { GPIO_PIN(PORT_C, 2), 12 }, \
+ /* ADC Temperature channel */ \
+ { GPIO_UNDEF, 16 }, \
+ /* ADC VREF channel */ \
+ { GPIO_UNDEF, 17 }, \
}
#define ADC_NUMOF (5)
diff --git a/boards/nz32-sc151/include/sx127x_params.h b/boards/nz32-sc151/include/sx127x_params.h
index 2e4a9543f..a4fce11fe 100644
--- a/boards/nz32-sc151/include/sx127x_params.h
+++ b/boards/nz32-sc151/include/sx127x_params.h
@@ -14,7 +14,7 @@
* @brief sx127x configuration for nz32-sc15 using modtronix inAir9
* LoRa module
* @author Francisco Molina <francisco.molina@inria.cl>
-*/
+ */
#ifndef SX127X_PARAMS_H
#define SX127X_PARAMS_H
diff --git a/boards/openmote-cc2538/include/board.h b/boards/openmote-cc2538/include/board.h
index 1cc00d6fb..06fecb5f2 100644
--- a/boards/openmote-cc2538/include/board.h
+++ b/boards/openmote-cc2538/include/board.h
@@ -25,7 +25,7 @@
#include "periph/gpio.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/openmote-cc2538/include/periph_conf.h b/boards/openmote-cc2538/include/periph_conf.h
index c63c52c12..1986f76a9 100644
--- a/boards/openmote-cc2538/include/periph_conf.h
+++ b/boards/openmote-cc2538/include/periph_conf.h
@@ -24,7 +24,7 @@
#include "periph_cpu.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/pba-d-01-kw2x/include/periph_conf.h b/boards/pba-d-01-kw2x/include/periph_conf.h
index bfb467923..81f19936a 100644
--- a/boards/pba-d-01-kw2x/include/periph_conf.h
+++ b/boards/pba-d-01-kw2x/include/periph_conf.h
@@ -71,16 +71,16 @@ static const clock_config_t clock_config = {
* @{
*/
#define PIT_NUMOF (2U)
-#define PIT_CONFIG { \
- { \
- .prescaler_ch = 0, \
- .count_ch = 1, \
- }, \
- { \
- .prescaler_ch = 2, \
- .count_ch = 3, \
- }, \
- }
+#define PIT_CONFIG { \
+ { \
+ .prescaler_ch = 0, \
+ .count_ch = 1, \
+ }, \
+ { \
+ .prescaler_ch = 2, \
+ .count_ch = 3, \
+ }, \
+}
#define LPTMR_NUMOF (0U)
#define LPTMR_CONFIG {}
#define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
@@ -290,9 +290,9 @@ static const spi_conf_t spi_config[] = {
/** @} */
/**
-* @name RTT and RTC configuration
-* @{
-*/
+ * @name RTT and RTC configuration
+ * @{
+ */
#define RTT_NUMOF (1U)
#define RTC_NUMOF (1U)
#define RTT_DEV RTC
diff --git a/boards/pic32-clicker/include/periph_conf.h b/boards/pic32-clicker/include/periph_conf.h
index d59e07a09..83b94c550 100644
--- a/boards/pic32-clicker/include/periph_conf.h
+++ b/boards/pic32-clicker/include/periph_conf.h
@@ -46,14 +46,14 @@ extern "C" {
/** @} */
/**
- * @name UART Definitions
- * There are 4 UARTS available on this CPU.
- * We route debug via UART3 on this board,
- * this is the UART connected to the MikroBUS
- *
- * Note Microchip number the UARTS 1->4
- * @{
- */
+ * @name UART Definitions
+ * There are 4 UARTS available on this CPU.
+ * We route debug via UART3 on this board,
+ * this is the UART connected to the MikroBUS
+ *
+ * Note Microchip number the UARTS 1->4
+ * @{
+ */
#define UART_NUMOF (4)
#define DEBUG_VIA_UART (3)
#define DEBUG_UART_BAUD (9600)
diff --git a/boards/pic32-clicker/pic32_config_settings.c b/boards/pic32-clicker/pic32_config_settings.c
index 0edbe4e0e..225d326f1 100644
--- a/boards/pic32-clicker/pic32_config_settings.c
+++ b/boards/pic32-clicker/pic32_config_settings.c
@@ -24,12 +24,12 @@
*/
volatile uint32_t _DEVCFG3 __attribute__((used, section(".devcfg3"))) =
0x0 /* unused bits must be 0 */
- | (_DEVCFG3_USERID_MASK & 0xFFFF << _DEVCFG3_USERID_POSITION)
- | (_DEVCFG3_FSRSSEL_MASK & 7 << _DEVCFG3_FSRSSEL_POSITION)
- | (_DEVCFG3_PMDL1WAY_MASK & 1 << _DEVCFG3_PMDL1WAY_POSITION)
- | (_DEVCFG3_IOL1WAY_MASK & 1 << _DEVCFG3_IOL1WAY_POSITION)
- | (_DEVCFG3_FUSBIDIO_MASK & 0 << _DEVCFG3_FUSBIDIO_POSITION)
- | (_DEVCFG3_FVBUSONIO_MASK & 1 << _DEVCFG3_FVBUSONIO_POSITION);
+ | (_DEVCFG3_USERID_MASK & 0xFFFF << _DEVCFG3_USERID_POSITION)
+ | (_DEVCFG3_FSRSSEL_MASK & 7 << _DEVCFG3_FSRSSEL_POSITION)
+ | (_DEVCFG3_PMDL1WAY_MASK & 1 << _DEVCFG3_PMDL1WAY_POSITION)
+ | (_DEVCFG3_IOL1WAY_MASK & 1 << _DEVCFG3_IOL1WAY_POSITION)
+ | (_DEVCFG3_FUSBIDIO_MASK & 0 << _DEVCFG3_FUSBIDIO_POSITION)
+ | (_DEVCFG3_FVBUSONIO_MASK & 1 << _DEVCFG3_FVBUSONIO_POSITION);
@@ -51,11 +51,11 @@ volatile uint32_t _DEVCFG3 __attribute__((used, section(".devcfg3"))) =
volatile uint32_t _DEVCFG2 __attribute__ ((used, section(".devcfg2"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG2_FPLLIDIV_MASK | 1 << _DEVCFG2_FPLLIDIV_POSITION)
- & (~_DEVCFG2_FPLLMUL_MASK | 7 << _DEVCFG2_FPLLMUL_POSITION)
- & (~_DEVCFG2_UPLLIDIV_MASK | 7 << _DEVCFG2_UPLLIDIV_POSITION)
- & (~_DEVCFG2_UPLLEN_MASK | 0 << _DEVCFG2_UPLLEN_POSITION)
- & (~_DEVCFG2_FPLLODIV_MASK | 0 << _DEVCFG2_FPLLODIV_POSITION);
+ & (~_DEVCFG2_FPLLIDIV_MASK | 1 << _DEVCFG2_FPLLIDIV_POSITION)
+ & (~_DEVCFG2_FPLLMUL_MASK | 7 << _DEVCFG2_FPLLMUL_POSITION)
+ & (~_DEVCFG2_UPLLIDIV_MASK | 7 << _DEVCFG2_UPLLIDIV_POSITION)
+ & (~_DEVCFG2_UPLLEN_MASK | 0 << _DEVCFG2_UPLLEN_POSITION)
+ & (~_DEVCFG2_FPLLODIV_MASK | 0 << _DEVCFG2_FPLLODIV_POSITION);
/*
* DEVCFG1 @ 0x1FC02FF8
@@ -74,17 +74,17 @@ volatile uint32_t _DEVCFG2 __attribute__ ((used, section(".devcfg2"))) =
volatile uint32_t _DEVCFG1 __attribute__ ((used, section(".devcfg1"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG1_FNOSC_MASK | 3 << _DEVCFG1_FNOSC_POSITION)
- & (~_DEVCFG1_FSOSCEN_MASK | 1 << _DEVCFG1_FSOSCEN_POSITION)
- & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
- & (~_DEVCFG1_POSCMOD_MASK | 1 << _DEVCFG1_POSCMOD_POSITION)
- & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
- & (~_DEVCFG1_FPBDIV_MASK | 0 << _DEVCFG1_FPBDIV_POSITION)
- & (~_DEVCFG1_FCKSM_MASK | 3 << _DEVCFG1_FCKSM_POSITION)
- & (~_DEVCFG1_WDTPS_MASK | 1 << _DEVCFG1_WDTPS_POSITION)
- & (~_DEVCFG1_WINDIS_MASK | 0 << _DEVCFG1_WINDIS_POSITION)
- & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
- & (~_DEVCFG1_FWDTWINSZ_MASK | 3 << _DEVCFG1_FWDTWINSZ_POSITION);
+ & (~_DEVCFG1_FNOSC_MASK | 3 << _DEVCFG1_FNOSC_POSITION)
+ & (~_DEVCFG1_FSOSCEN_MASK | 1 << _DEVCFG1_FSOSCEN_POSITION)
+ & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
+ & (~_DEVCFG1_POSCMOD_MASK | 1 << _DEVCFG1_POSCMOD_POSITION)
+ & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
+ & (~_DEVCFG1_FPBDIV_MASK | 0 << _DEVCFG1_FPBDIV_POSITION)
+ & (~_DEVCFG1_FCKSM_MASK | 3 << _DEVCFG1_FCKSM_POSITION)
+ & (~_DEVCFG1_WDTPS_MASK | 1 << _DEVCFG1_WDTPS_POSITION)
+ & (~_DEVCFG1_WINDIS_MASK | 0 << _DEVCFG1_WINDIS_POSITION)
+ & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
+ & (~_DEVCFG1_FWDTWINSZ_MASK | 3 << _DEVCFG1_FWDTWINSZ_POSITION);
/*
@@ -100,12 +100,12 @@ volatile uint32_t _DEVCFG1 __attribute__ ((used, section(".devcfg1"))) =
volatile uint32_t _DEVCFG0 __attribute__ ((used, section(".devcfg0"))) =
0x7fffffff /* unused bits must be 1 except MSB which is 0 for some odd reason */
- & (~_DEVCFG0_DEBUG_MASK | 3 << _DEVCFG0_DEBUG_POSITION)
- & (~_DEVCFG0_JTAGEN_MASK | 1 << _DEVCFG0_JTAGEN_POSITION)
- & (~_DEVCFG0_ICESEL_MASK | 3 << _DEVCFG0_ICESEL_POSITION)
- & (~_DEVCFG0_PWP_MASK | 0xff << _DEVCFG0_PWP_POSITION)
- & (~_DEVCFG0_BWP_MASK | 1 << _DEVCFG0_BWP_POSITION)
- & (~_DEVCFG0_CP_MASK | 1 << _DEVCFG0_CP_POSITION);
+ & (~_DEVCFG0_DEBUG_MASK | 3 << _DEVCFG0_DEBUG_POSITION)
+ & (~_DEVCFG0_JTAGEN_MASK | 1 << _DEVCFG0_JTAGEN_POSITION)
+ & (~_DEVCFG0_ICESEL_MASK | 3 << _DEVCFG0_ICESEL_POSITION)
+ & (~_DEVCFG0_PWP_MASK | 0xff << _DEVCFG0_PWP_POSITION)
+ & (~_DEVCFG0_BWP_MASK | 1 << _DEVCFG0_BWP_POSITION)
+ & (~_DEVCFG0_CP_MASK | 1 << _DEVCFG0_CP_POSITION);
/*
* Without a reference to this function from elsewhere LD throws the whole
diff --git a/boards/pic32-wifire/include/periph_conf.h b/boards/pic32-wifire/include/periph_conf.h
index e1ae1fdfd..8e39ccfa2 100644
--- a/boards/pic32-wifire/include/periph_conf.h
+++ b/boards/pic32-wifire/include/periph_conf.h
@@ -43,14 +43,14 @@ extern "C" {
/** @} */
/**
- * @name UART Definitions
- * There are 6 UARTS available on this CPU.
- * We route debug via UART4 on this board,
- * this is the UART connected to the FTDI USB <-> UART device.
- *
- * Note Microchip number the UARTS 1->4.
- * @{
- */
+ * @name UART Definitions
+ * There are 6 UARTS available on this CPU.
+ * We route debug via UART4 on this board,
+ * this is the UART connected to the FTDI USB <-> UART device.
+ *
+ * Note Microchip number the UARTS 1->4.
+ * @{
+ */
#define UART_NUMOF (6)
#define DEBUG_VIA_UART (4)
#define DEBUG_UART_BAUD (9600)
diff --git a/boards/pic32-wifire/pic32_config_settings.c b/boards/pic32-wifire/pic32_config_settings.c
index f45d18a44..38aa27774 100644
--- a/boards/pic32-wifire/pic32_config_settings.c
+++ b/boards/pic32-wifire/pic32_config_settings.c
@@ -46,43 +46,43 @@
*/
volatile uint32_t DEVCFG3_LA __attribute__((used, section(".devcfg3_la"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG3_USERID_MASK | 0xFFFF << _DEVCFG3_USERID_POSITION)
- & (~_DEVCFG3_FMIIEN_MASK | 0 << _DEVCFG3_FMIIEN_POSITION)
- & (~_DEVCFG3_FETHIO_MASK | 1 << _DEVCFG3_FETHIO_POSITION)
- & (~_DEVCFG3_PGL1WAY_MASK | 0 << _DEVCFG3_PGL1WAY_POSITION)
- & (~_DEVCFG3_PMDL1WAY_MASK | 0 << _DEVCFG3_PMDL1WAY_POSITION)
- & (~_DEVCFG3_IOL1WAY_MASK | 0 << _DEVCFG3_IOL1WAY_POSITION)
- & (~_DEVCFG3_FUSBIDIO_MASK | 0 << _DEVCFG3_FUSBIDIO_POSITION);
+ & (~_DEVCFG3_USERID_MASK | 0xFFFF << _DEVCFG3_USERID_POSITION)
+ & (~_DEVCFG3_FMIIEN_MASK | 0 << _DEVCFG3_FMIIEN_POSITION)
+ & (~_DEVCFG3_FETHIO_MASK | 1 << _DEVCFG3_FETHIO_POSITION)
+ & (~_DEVCFG3_PGL1WAY_MASK | 0 << _DEVCFG3_PGL1WAY_POSITION)
+ & (~_DEVCFG3_PMDL1WAY_MASK | 0 << _DEVCFG3_PMDL1WAY_POSITION)
+ & (~_DEVCFG3_IOL1WAY_MASK | 0 << _DEVCFG3_IOL1WAY_POSITION)
+ & (~_DEVCFG3_FUSBIDIO_MASK | 0 << _DEVCFG3_FUSBIDIO_POSITION);
volatile uint32_t ADEVCFG3_LA __attribute__((used, section(".adevcfg3_la"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG3_USERID_MASK | 0xFFFF << _DEVCFG3_USERID_POSITION)
- & (~_DEVCFG3_FMIIEN_MASK | 0 << _DEVCFG3_FMIIEN_POSITION)
- & (~_DEVCFG3_FETHIO_MASK | 1 << _DEVCFG3_FETHIO_POSITION)
- & (~_DEVCFG3_PGL1WAY_MASK | 0 << _DEVCFG3_PGL1WAY_POSITION)
- & (~_DEVCFG3_PMDL1WAY_MASK | 0 << _DEVCFG3_PMDL1WAY_POSITION)
- & (~_DEVCFG3_IOL1WAY_MASK | 0 << _DEVCFG3_IOL1WAY_POSITION)
- & (~_DEVCFG3_FUSBIDIO_MASK | 0 << _DEVCFG3_FUSBIDIO_POSITION);
+ & (~_DEVCFG3_USERID_MASK | 0xFFFF << _DEVCFG3_USERID_POSITION)
+ & (~_DEVCFG3_FMIIEN_MASK | 0 << _DEVCFG3_FMIIEN_POSITION)
+ & (~_DEVCFG3_FETHIO_MASK | 1 << _DEVCFG3_FETHIO_POSITION)
+ & (~_DEVCFG3_PGL1WAY_MASK | 0 << _DEVCFG3_PGL1WAY_POSITION)
+ & (~_DEVCFG3_PMDL1WAY_MASK | 0 << _DEVCFG3_PMDL1WAY_POSITION)
+ & (~_DEVCFG3_IOL1WAY_MASK | 0 << _DEVCFG3_IOL1WAY_POSITION)
+ & (~_DEVCFG3_FUSBIDIO_MASK | 0 << _DEVCFG3_FUSBIDIO_POSITION);
volatile uint32_t DEVCFG3_B1 __attribute__((used, section(".devcfg3_b1"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG3_USERID_MASK | 0xFFFF << _DEVCFG3_USERID_POSITION)
- & (~_DEVCFG3_FMIIEN_MASK | 0 << _DEVCFG3_FMIIEN_POSITION)
- & (~_DEVCFG3_FETHIO_MASK | 1 << _DEVCFG3_FETHIO_POSITION)
- & (~_DEVCFG3_PGL1WAY_MASK | 0 << _DEVCFG3_PGL1WAY_POSITION)
- & (~_DEVCFG3_PMDL1WAY_MASK | 0 << _DEVCFG3_PMDL1WAY_POSITION)
- & (~_DEVCFG3_IOL1WAY_MASK | 0 << _DEVCFG3_IOL1WAY_POSITION)
- & (~_DEVCFG3_FUSBIDIO_MASK | 0 << _DEVCFG3_FUSBIDIO_POSITION);
+ & (~_DEVCFG3_USERID_MASK | 0xFFFF << _DEVCFG3_USERID_POSITION)
+ & (~_DEVCFG3_FMIIEN_MASK | 0 << _DEVCFG3_FMIIEN_POSITION)
+ & (~_DEVCFG3_FETHIO_MASK | 1 << _DEVCFG3_FETHIO_POSITION)
+ & (~_DEVCFG3_PGL1WAY_MASK | 0 << _DEVCFG3_PGL1WAY_POSITION)
+ & (~_DEVCFG3_PMDL1WAY_MASK | 0 << _DEVCFG3_PMDL1WAY_POSITION)
+ & (~_DEVCFG3_IOL1WAY_MASK | 0 << _DEVCFG3_IOL1WAY_POSITION)
+ & (~_DEVCFG3_FUSBIDIO_MASK | 0 << _DEVCFG3_FUSBIDIO_POSITION);
volatile uint32_t ADEVCFG3_B1 __attribute__((used, section(".adevcfg3_b1"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG3_USERID_MASK | 0xFFFF << _DEVCFG3_USERID_POSITION)
- & (~_DEVCFG3_FMIIEN_MASK | 0 << _DEVCFG3_FMIIEN_POSITION)
- & (~_DEVCFG3_FETHIO_MASK | 1 << _DEVCFG3_FETHIO_POSITION)
- & (~_DEVCFG3_PGL1WAY_MASK | 0 << _DEVCFG3_PGL1WAY_POSITION)
- & (~_DEVCFG3_PMDL1WAY_MASK | 0 << _DEVCFG3_PMDL1WAY_POSITION)
- & (~_DEVCFG3_IOL1WAY_MASK | 0 << _DEVCFG3_IOL1WAY_POSITION)
- & (~_DEVCFG3_FUSBIDIO_MASK | 0 << _DEVCFG3_FUSBIDIO_POSITION);
+ & (~_DEVCFG3_USERID_MASK | 0xFFFF << _DEVCFG3_USERID_POSITION)
+ & (~_DEVCFG3_FMIIEN_MASK | 0 << _DEVCFG3_FMIIEN_POSITION)
+ & (~_DEVCFG3_FETHIO_MASK | 1 << _DEVCFG3_FETHIO_POSITION)
+ & (~_DEVCFG3_PGL1WAY_MASK | 0 << _DEVCFG3_PGL1WAY_POSITION)
+ & (~_DEVCFG3_PMDL1WAY_MASK | 0 << _DEVCFG3_PMDL1WAY_POSITION)
+ & (~_DEVCFG3_IOL1WAY_MASK | 0 << _DEVCFG3_IOL1WAY_POSITION)
+ & (~_DEVCFG3_FUSBIDIO_MASK | 0 << _DEVCFG3_FUSBIDIO_POSITION);
/*
* Not needed by default:
* volatile uint32_t DEVCFG3_B2 __attribute__((used,section(".devcfg3_b2")))
@@ -112,39 +112,39 @@ volatile uint32_t ADEVCFG3_B1 __attribute__((used, section(".adevcfg3_b1"))) =
volatile uint32_t DEVCFG2_LA __attribute__ ((used, section(".devcfg2_la"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG2_FPLLIDIV_MASK | 2 << _DEVCFG2_FPLLIDIV_POSITION)
- & (~_DEVCFG2_FPLLRNG_MASK | 0x1 << _DEVCFG2_FPLLRNG_POSITION)
- & (~_DEVCFG2_FPLLICLK_MASK | 0x0 << _DEVCFG2_FPLLICLK_POSITION)
- & (~_DEVCFG2_FPLLMULT_MASK | 49 << _DEVCFG2_FPLLMULT_POSITION)
- & (~_DEVCFG2_FPLLODIV_MASK | 1 << _DEVCFG2_FPLLODIV_POSITION)
- & (~_DEVCFG2_UPLLFSEL_MASK | 0x1 << _DEVCFG2_UPLLFSEL_POSITION);
+ & (~_DEVCFG2_FPLLIDIV_MASK | 2 << _DEVCFG2_FPLLIDIV_POSITION)
+ & (~_DEVCFG2_FPLLRNG_MASK | 0x1 << _DEVCFG2_FPLLRNG_POSITION)
+ & (~_DEVCFG2_FPLLICLK_MASK | 0x0 << _DEVCFG2_FPLLICLK_POSITION)
+ & (~_DEVCFG2_FPLLMULT_MASK | 49 << _DEVCFG2_FPLLMULT_POSITION)
+ & (~_DEVCFG2_FPLLODIV_MASK | 1 << _DEVCFG2_FPLLODIV_POSITION)
+ & (~_DEVCFG2_UPLLFSEL_MASK | 0x1 << _DEVCFG2_UPLLFSEL_POSITION);
volatile uint32_t ADEVCFG2_LA __attribute__ ((used, section(".adevcfg2_la"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG2_FPLLIDIV_MASK | 2 << _DEVCFG2_FPLLIDIV_POSITION)
- & (~_DEVCFG2_FPLLRNG_MASK | 0x1 << _DEVCFG2_FPLLRNG_POSITION)
- & (~_DEVCFG2_FPLLICLK_MASK | 0x0 << _DEVCFG2_FPLLICLK_POSITION)
- & (~_DEVCFG2_FPLLMULT_MASK | 49 << _DEVCFG2_FPLLMULT_POSITION)
- & (~_DEVCFG2_FPLLODIV_MASK | 1 << _DEVCFG2_FPLLODIV_POSITION)
- & (~_DEVCFG2_UPLLFSEL_MASK | 0x1 << _DEVCFG2_UPLLFSEL_POSITION);
+ & (~_DEVCFG2_FPLLIDIV_MASK | 2 << _DEVCFG2_FPLLIDIV_POSITION)
+ & (~_DEVCFG2_FPLLRNG_MASK | 0x1 << _DEVCFG2_FPLLRNG_POSITION)
+ & (~_DEVCFG2_FPLLICLK_MASK | 0x0 << _DEVCFG2_FPLLICLK_POSITION)
+ & (~_DEVCFG2_FPLLMULT_MASK | 49 << _DEVCFG2_FPLLMULT_POSITION)
+ & (~_DEVCFG2_FPLLODIV_MASK | 1 << _DEVCFG2_FPLLODIV_POSITION)
+ & (~_DEVCFG2_UPLLFSEL_MASK | 0x1 << _DEVCFG2_UPLLFSEL_POSITION);
volatile uint32_t DEVCFG2_B1 __attribute__ ((used, section(".devcfg2_b1"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG2_FPLLIDIV_MASK | 2 << _DEVCFG2_FPLLIDIV_POSITION)
- & (~_DEVCFG2_FPLLRNG_MASK | 0x1 << _DEVCFG2_FPLLRNG_POSITION)
- & (~_DEVCFG2_FPLLICLK_MASK | 0x0 << _DEVCFG2_FPLLICLK_POSITION)
- & (~_DEVCFG2_FPLLMULT_MASK | 49 << _DEVCFG2_FPLLMULT_POSITION)
- & (~_DEVCFG2_FPLLODIV_MASK | 1 << _DEVCFG2_FPLLODIV_POSITION)
- & (~_DEVCFG2_UPLLFSEL_MASK | 0x1 << _DEVCFG2_UPLLFSEL_POSITION);
+ & (~_DEVCFG2_FPLLIDIV_MASK | 2 << _DEVCFG2_FPLLIDIV_POSITION)
+ & (~_DEVCFG2_FPLLRNG_MASK | 0x1 << _DEVCFG2_FPLLRNG_POSITION)
+ & (~_DEVCFG2_FPLLICLK_MASK | 0x0 << _DEVCFG2_FPLLICLK_POSITION)
+ & (~_DEVCFG2_FPLLMULT_MASK | 49 << _DEVCFG2_FPLLMULT_POSITION)
+ & (~_DEVCFG2_FPLLODIV_MASK | 1 << _DEVCFG2_FPLLODIV_POSITION)
+ & (~_DEVCFG2_UPLLFSEL_MASK | 0x1 << _DEVCFG2_UPLLFSEL_POSITION);
volatile uint32_t ADEVCFG2_B1 __attribute__ ((used, section(".adevcfg2_b1"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG2_FPLLIDIV_MASK | 2 << _DEVCFG2_FPLLIDIV_POSITION)
- & (~_DEVCFG2_FPLLRNG_MASK | 0x1 << _DEVCFG2_FPLLRNG_POSITION)
- & (~_DEVCFG2_FPLLICLK_MASK | 0x0 << _DEVCFG2_FPLLICLK_POSITION)
- & (~_DEVCFG2_FPLLMULT_MASK | 49 << _DEVCFG2_FPLLMULT_POSITION)
- & (~_DEVCFG2_FPLLODIV_MASK | 1 << _DEVCFG2_FPLLODIV_POSITION)
- & (~_DEVCFG2_UPLLFSEL_MASK | 0x1 << _DEVCFG2_UPLLFSEL_POSITION);
+ & (~_DEVCFG2_FPLLIDIV_MASK | 2 << _DEVCFG2_FPLLIDIV_POSITION)
+ & (~_DEVCFG2_FPLLRNG_MASK | 0x1 << _DEVCFG2_FPLLRNG_POSITION)
+ & (~_DEVCFG2_FPLLICLK_MASK | 0x0 << _DEVCFG2_FPLLICLK_POSITION)
+ & (~_DEVCFG2_FPLLMULT_MASK | 49 << _DEVCFG2_FPLLMULT_POSITION)
+ & (~_DEVCFG2_FPLLODIV_MASK | 1 << _DEVCFG2_FPLLODIV_POSITION)
+ & (~_DEVCFG2_UPLLFSEL_MASK | 0x1 << _DEVCFG2_UPLLFSEL_POSITION);
/* Not needed by default: */
/* uint32_t DEVCFG2_B2 __attribute__ ((section(".devcfg2_b2"))) = DEVCFG2_LA; */
/* uint32_t ADEVCFG2_B2 __attribute__ ((section(".adevcfg2_b2"))) = DEVCFG2_LA; */
@@ -176,71 +176,71 @@ volatile uint32_t ADEVCFG2_B1 __attribute__ ((used, section(".adevcfg2_b1"))) =
volatile uint32_t DEVCFG1_LA __attribute__ ((used, section(".devcfg1_la"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG1_FNOSC_MASK | 0x1 << _DEVCFG1_FNOSC_POSITION)
- & (~_DEVCFG1_DMTINTV_MASK | 0x7 << _DEVCFG1_DMTINTV_POSITION)
- & (~_DEVCFG1_FSOSCEN_MASK | 0 << _DEVCFG1_FSOSCEN_POSITION)
- & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
- & (~_DEVCFG1_POSCMOD_MASK | 0x0 << _DEVCFG1_POSCMOD_POSITION)
- & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
- & (~_DEVCFG1_FCKSM_MASK | 0x0 << _DEVCFG1_FCKSM_POSITION)
- & (~_DEVCFG1_WDTPS_MASK | 0x14 << _DEVCFG1_WDTPS_POSITION)
- & (~_DEVCFG1_WDTSPGM_MASK | 1 << _DEVCFG1_WDTSPGM_POSITION)
- & (~_DEVCFG1_WINDIS_MASK | 1 << _DEVCFG1_WINDIS_POSITION)
- & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
- & (~_DEVCFG1_FWDTWINSZ_MASK | 0x3 << _DEVCFG1_FWDTWINSZ_POSITION)
- & (~_DEVCFG1_DMTCNT_MASK | 0x0 << _DEVCFG1_DMTCNT_POSITION)
- & (~_DEVCFG1_FDMTEN_MASK | 0 << _DEVCFG1_FDMTEN_POSITION);
+ & (~_DEVCFG1_FNOSC_MASK | 0x1 << _DEVCFG1_FNOSC_POSITION)
+ & (~_DEVCFG1_DMTINTV_MASK | 0x7 << _DEVCFG1_DMTINTV_POSITION)
+ & (~_DEVCFG1_FSOSCEN_MASK | 0 << _DEVCFG1_FSOSCEN_POSITION)
+ & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
+ & (~_DEVCFG1_POSCMOD_MASK | 0x0 << _DEVCFG1_POSCMOD_POSITION)
+ & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
+ & (~_DEVCFG1_FCKSM_MASK | 0x0 << _DEVCFG1_FCKSM_POSITION)
+ & (~_DEVCFG1_WDTPS_MASK | 0x14 << _DEVCFG1_WDTPS_POSITION)
+ & (~_DEVCFG1_WDTSPGM_MASK | 1 << _DEVCFG1_WDTSPGM_POSITION)
+ & (~_DEVCFG1_WINDIS_MASK | 1 << _DEVCFG1_WINDIS_POSITION)
+ & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
+ & (~_DEVCFG1_FWDTWINSZ_MASK | 0x3 << _DEVCFG1_FWDTWINSZ_POSITION)
+ & (~_DEVCFG1_DMTCNT_MASK | 0x0 << _DEVCFG1_DMTCNT_POSITION)
+ & (~_DEVCFG1_FDMTEN_MASK | 0 << _DEVCFG1_FDMTEN_POSITION);
volatile uint32_t ADEVCFG1_LA __attribute__ ((used, section(".adevcfg1_la"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG1_FNOSC_MASK | 0x1 << _DEVCFG1_FNOSC_POSITION)
- & (~_DEVCFG1_DMTINTV_MASK | 0x7 << _DEVCFG1_DMTINTV_POSITION)
- & (~_DEVCFG1_FSOSCEN_MASK | 0 << _DEVCFG1_FSOSCEN_POSITION)
- & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
- & (~_DEVCFG1_POSCMOD_MASK | 0x0 << _DEVCFG1_POSCMOD_POSITION)
- & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
- & (~_DEVCFG1_FCKSM_MASK | 0x0 << _DEVCFG1_FCKSM_POSITION)
- & (~_DEVCFG1_WDTPS_MASK | 0x14 << _DEVCFG1_WDTPS_POSITION)
- & (~_DEVCFG1_WDTSPGM_MASK | 1 << _DEVCFG1_WDTSPGM_POSITION)
- & (~_DEVCFG1_WINDIS_MASK | 1 << _DEVCFG1_WINDIS_POSITION)
- & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
- & (~_DEVCFG1_FWDTWINSZ_MASK | 0x3 << _DEVCFG1_FWDTWINSZ_POSITION)
- & (~_DEVCFG1_DMTCNT_MASK | 0x0 << _DEVCFG1_DMTCNT_POSITION)
- & (~_DEVCFG1_FDMTEN_MASK | 0 << _DEVCFG1_FDMTEN_POSITION);
+ & (~_DEVCFG1_FNOSC_MASK | 0x1 << _DEVCFG1_FNOSC_POSITION)
+ & (~_DEVCFG1_DMTINTV_MASK | 0x7 << _DEVCFG1_DMTINTV_POSITION)
+ & (~_DEVCFG1_FSOSCEN_MASK | 0 << _DEVCFG1_FSOSCEN_POSITION)
+ & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
+ & (~_DEVCFG1_POSCMOD_MASK | 0x0 << _DEVCFG1_POSCMOD_POSITION)
+ & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
+ & (~_DEVCFG1_FCKSM_MASK | 0x0 << _DEVCFG1_FCKSM_POSITION)
+ & (~_DEVCFG1_WDTPS_MASK | 0x14 << _DEVCFG1_WDTPS_POSITION)
+ & (~_DEVCFG1_WDTSPGM_MASK | 1 << _DEVCFG1_WDTSPGM_POSITION)
+ & (~_DEVCFG1_WINDIS_MASK | 1 << _DEVCFG1_WINDIS_POSITION)
+ & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
+ & (~_DEVCFG1_FWDTWINSZ_MASK | 0x3 << _DEVCFG1_FWDTWINSZ_POSITION)
+ & (~_DEVCFG1_DMTCNT_MASK | 0x0 << _DEVCFG1_DMTCNT_POSITION)
+ & (~_DEVCFG1_FDMTEN_MASK | 0 << _DEVCFG1_FDMTEN_POSITION);
volatile uint32_t DEVCFG1_B1 __attribute__ ((used, section(".devcfg1_b1"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG1_FNOSC_MASK | 0x1 << _DEVCFG1_FNOSC_POSITION)
- & (~_DEVCFG1_DMTINTV_MASK | 0x7 << _DEVCFG1_DMTINTV_POSITION)
- & (~_DEVCFG1_FSOSCEN_MASK | 0 << _DEVCFG1_FSOSCEN_POSITION)
- & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
- & (~_DEVCFG1_POSCMOD_MASK | 0x0 << _DEVCFG1_POSCMOD_POSITION)
- & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
- & (~_DEVCFG1_FCKSM_MASK | 0x0 << _DEVCFG1_FCKSM_POSITION)
- & (~_DEVCFG1_WDTPS_MASK | 0x14 << _DEVCFG1_WDTPS_POSITION)
- & (~_DEVCFG1_WDTSPGM_MASK | 1 << _DEVCFG1_WDTSPGM_POSITION)
- & (~_DEVCFG1_WINDIS_MASK | 1 << _DEVCFG1_WINDIS_POSITION)
- & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
- & (~_DEVCFG1_FWDTWINSZ_MASK | 0x3 << _DEVCFG1_FWDTWINSZ_POSITION)
- & (~_DEVCFG1_DMTCNT_MASK | 0x0 << _DEVCFG1_DMTCNT_POSITION)
- & (~_DEVCFG1_FDMTEN_MASK | 0 << _DEVCFG1_FDMTEN_POSITION);
+ & (~_DEVCFG1_FNOSC_MASK | 0x1 << _DEVCFG1_FNOSC_POSITION)
+ & (~_DEVCFG1_DMTINTV_MASK | 0x7 << _DEVCFG1_DMTINTV_POSITION)
+ & (~_DEVCFG1_FSOSCEN_MASK | 0 << _DEVCFG1_FSOSCEN_POSITION)
+ & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
+ & (~_DEVCFG1_POSCMOD_MASK | 0x0 << _DEVCFG1_POSCMOD_POSITION)
+ & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
+ & (~_DEVCFG1_FCKSM_MASK | 0x0 << _DEVCFG1_FCKSM_POSITION)
+ & (~_DEVCFG1_WDTPS_MASK | 0x14 << _DEVCFG1_WDTPS_POSITION)
+ & (~_DEVCFG1_WDTSPGM_MASK | 1 << _DEVCFG1_WDTSPGM_POSITION)
+ & (~_DEVCFG1_WINDIS_MASK | 1 << _DEVCFG1_WINDIS_POSITION)
+ & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
+ & (~_DEVCFG1_FWDTWINSZ_MASK | 0x3 << _DEVCFG1_FWDTWINSZ_POSITION)
+ & (~_DEVCFG1_DMTCNT_MASK | 0x0 << _DEVCFG1_DMTCNT_POSITION)
+ & (~_DEVCFG1_FDMTEN_MASK | 0 << _DEVCFG1_FDMTEN_POSITION);
volatile uint32_t ADEVCFG1_B1 __attribute__ ((used, section(".adevcfg1_b1"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG1_FNOSC_MASK | 0x1 << _DEVCFG1_FNOSC_POSITION)
- & (~_DEVCFG1_DMTINTV_MASK | 0x7 << _DEVCFG1_DMTINTV_POSITION)
- & (~_DEVCFG1_FSOSCEN_MASK | 0 << _DEVCFG1_FSOSCEN_POSITION)
- & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
- & (~_DEVCFG1_POSCMOD_MASK | 0x0 << _DEVCFG1_POSCMOD_POSITION)
- & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
- & (~_DEVCFG1_FCKSM_MASK | 0x0 << _DEVCFG1_FCKSM_POSITION)
- & (~_DEVCFG1_WDTPS_MASK | 0x14 << _DEVCFG1_WDTPS_POSITION)
- & (~_DEVCFG1_WDTSPGM_MASK | 1 << _DEVCFG1_WDTSPGM_POSITION)
- & (~_DEVCFG1_WINDIS_MASK | 1 << _DEVCFG1_WINDIS_POSITION)
- & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
- & (~_DEVCFG1_FWDTWINSZ_MASK | 0x3 << _DEVCFG1_FWDTWINSZ_POSITION)
- & (~_DEVCFG1_DMTCNT_MASK | 0x0 << _DEVCFG1_DMTCNT_POSITION)
- & (~_DEVCFG1_FDMTEN_MASK | 0 << _DEVCFG1_FDMTEN_POSITION);
+ & (~_DEVCFG1_FNOSC_MASK | 0x1 << _DEVCFG1_FNOSC_POSITION)
+ & (~_DEVCFG1_DMTINTV_MASK | 0x7 << _DEVCFG1_DMTINTV_POSITION)
+ & (~_DEVCFG1_FSOSCEN_MASK | 0 << _DEVCFG1_FSOSCEN_POSITION)
+ & (~_DEVCFG1_IESO_MASK | 1 << _DEVCFG1_IESO_POSITION)
+ & (~_DEVCFG1_POSCMOD_MASK | 0x0 << _DEVCFG1_POSCMOD_POSITION)
+ & (~_DEVCFG1_OSCIOFNC_MASK | 1 << _DEVCFG1_OSCIOFNC_POSITION)
+ & (~_DEVCFG1_FCKSM_MASK | 0x0 << _DEVCFG1_FCKSM_POSITION)
+ & (~_DEVCFG1_WDTPS_MASK | 0x14 << _DEVCFG1_WDTPS_POSITION)
+ & (~_DEVCFG1_WDTSPGM_MASK | 1 << _DEVCFG1_WDTSPGM_POSITION)
+ & (~_DEVCFG1_WINDIS_MASK | 1 << _DEVCFG1_WINDIS_POSITION)
+ & (~_DEVCFG1_FWDTEN_MASK | 0 << _DEVCFG1_FWDTEN_POSITION)
+ & (~_DEVCFG1_FWDTWINSZ_MASK | 0x3 << _DEVCFG1_FWDTWINSZ_POSITION)
+ & (~_DEVCFG1_DMTCNT_MASK | 0x0 << _DEVCFG1_DMTCNT_POSITION)
+ & (~_DEVCFG1_FDMTEN_MASK | 0 << _DEVCFG1_FDMTEN_POSITION);
/* Not needed by default: */
/* uint32_t DEVCFG1_B2 __attribute__ ((section(".devcfg1_b2"))) = DEVCFG1_LA; */
@@ -272,71 +272,71 @@ volatile uint32_t ADEVCFG1_B1 __attribute__ ((used, section(".adevcfg1_b1"))) =
volatile uint32_t DEVCFG0_LA __attribute__ ((used, section(".devcfg0_la"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG0_DEBUG_MASK | 0x3 << _DEVCFG0_DEBUG_POSITION)
- & (~_DEVCFG0_JTAGEN_MASK | 0x1 << _DEVCFG0_JTAGEN_POSITION)
- & (~_DEVCFG0_ICESEL_MASK | 0x2 << _DEVCFG0_ICESEL_POSITION)
- & (~_DEVCFG0_TRCEN_MASK | 0x1 << _DEVCFG0_TRCEN_POSITION)
- & (~_DEVCFG0_BOOTISA_MASK | 0x1 << _DEVCFG0_BOOTISA_POSITION)
- & (~_DEVCFG0_FECCCON_MASK | 0x3 << _DEVCFG0_FECCCON_POSITION)
- & (~_DEVCFG0_FSLEEP_MASK | 0x1 << _DEVCFG0_FSLEEP_POSITION)
- & (~_DEVCFG0_DBGPER_MASK | 0x7 << _DEVCFG0_DBGPER_POSITION)
- & (~_DEVCFG0_SMCLR_MASK | 0x1 << _DEVCFG0_SMCLR_POSITION)
- & (~_DEVCFG0_SOSCGAIN_MASK | 0x2 << _DEVCFG0_SOSCGAIN_POSITION)
- & (~_DEVCFG0_SOSCBOOST_MASK | 0x1 << _DEVCFG0_SOSCBOOST_POSITION)
- & (~_DEVCFG0_POSCGAIN_MASK | 0x2 << _DEVCFG0_POSCGAIN_POSITION)
- & (~_DEVCFG0_POSCBOOST_MASK | 0x1 << _DEVCFG0_POSCBOOST_POSITION)
- & (~_DEVCFG0_EJTAGBEN_MASK | 0x1 << _DEVCFG0_EJTAGBEN_POSITION);
+ & (~_DEVCFG0_DEBUG_MASK | 0x3 << _DEVCFG0_DEBUG_POSITION)
+ & (~_DEVCFG0_JTAGEN_MASK | 0x1 << _DEVCFG0_JTAGEN_POSITION)
+ & (~_DEVCFG0_ICESEL_MASK | 0x2 << _DEVCFG0_ICESEL_POSITION)
+ & (~_DEVCFG0_TRCEN_MASK | 0x1 << _DEVCFG0_TRCEN_POSITION)
+ & (~_DEVCFG0_BOOTISA_MASK | 0x1 << _DEVCFG0_BOOTISA_POSITION)
+ & (~_DEVCFG0_FECCCON_MASK | 0x3 << _DEVCFG0_FECCCON_POSITION)
+ & (~_DEVCFG0_FSLEEP_MASK | 0x1 << _DEVCFG0_FSLEEP_POSITION)
+ & (~_DEVCFG0_DBGPER_MASK | 0x7 << _DEVCFG0_DBGPER_POSITION)
+ & (~_DEVCFG0_SMCLR_MASK | 0x1 << _DEVCFG0_SMCLR_POSITION)
+ & (~_DEVCFG0_SOSCGAIN_MASK | 0x2 << _DEVCFG0_SOSCGAIN_POSITION)
+ & (~_DEVCFG0_SOSCBOOST_MASK | 0x1 << _DEVCFG0_SOSCBOOST_POSITION)
+ & (~_DEVCFG0_POSCGAIN_MASK | 0x2 << _DEVCFG0_POSCGAIN_POSITION)
+ & (~_DEVCFG0_POSCBOOST_MASK | 0x1 << _DEVCFG0_POSCBOOST_POSITION)
+ & (~_DEVCFG0_EJTAGBEN_MASK | 0x1 << _DEVCFG0_EJTAGBEN_POSITION);
volatile uint32_t ADEVCFG0_LA __attribute__ ((used, section(".adevcfg0_la"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG0_DEBUG_MASK | 0x3 << _DEVCFG0_DEBUG_POSITION)
- & (~_DEVCFG0_JTAGEN_MASK | 0x1 << _DEVCFG0_JTAGEN_POSITION)
- & (~_DEVCFG0_ICESEL_MASK | 0x2 << _DEVCFG0_ICESEL_POSITION)
- & (~_DEVCFG0_TRCEN_MASK | 0x1 << _DEVCFG0_TRCEN_POSITION)
- & (~_DEVCFG0_BOOTISA_MASK | 0x1 << _DEVCFG0_BOOTISA_POSITION)
- & (~_DEVCFG0_FECCCON_MASK | 0x3 << _DEVCFG0_FECCCON_POSITION)
- & (~_DEVCFG0_FSLEEP_MASK | 0x1 << _DEVCFG0_FSLEEP_POSITION)
- & (~_DEVCFG0_DBGPER_MASK | 0x7 << _DEVCFG0_DBGPER_POSITION)
- & (~_DEVCFG0_SMCLR_MASK | 0x1 << _DEVCFG0_SMCLR_POSITION)
- & (~_DEVCFG0_SOSCGAIN_MASK | 0x2 << _DEVCFG0_SOSCGAIN_POSITION)
- & (~_DEVCFG0_SOSCBOOST_MASK | 0x1 << _DEVCFG0_SOSCBOOST_POSITION)
- & (~_DEVCFG0_POSCGAIN_MASK | 0x2 << _DEVCFG0_POSCGAIN_POSITION)
- & (~_DEVCFG0_POSCBOOST_MASK | 0x1 << _DEVCFG0_POSCBOOST_POSITION)
- & (~_DEVCFG0_EJTAGBEN_MASK | 0x1 << _DEVCFG0_EJTAGBEN_POSITION);
+ & (~_DEVCFG0_DEBUG_MASK | 0x3 << _DEVCFG0_DEBUG_POSITION)
+ & (~_DEVCFG0_JTAGEN_MASK | 0x1 << _DEVCFG0_JTAGEN_POSITION)
+ & (~_DEVCFG0_ICESEL_MASK | 0x2 << _DEVCFG0_ICESEL_POSITION)
+ & (~_DEVCFG0_TRCEN_MASK | 0x1 << _DEVCFG0_TRCEN_POSITION)
+ & (~_DEVCFG0_BOOTISA_MASK | 0x1 << _DEVCFG0_BOOTISA_POSITION)
+ & (~_DEVCFG0_FECCCON_MASK | 0x3 << _DEVCFG0_FECCCON_POSITION)
+ & (~_DEVCFG0_FSLEEP_MASK | 0x1 << _DEVCFG0_FSLEEP_POSITION)
+ & (~_DEVCFG0_DBGPER_MASK | 0x7 << _DEVCFG0_DBGPER_POSITION)
+ & (~_DEVCFG0_SMCLR_MASK | 0x1 << _DEVCFG0_SMCLR_POSITION)
+ & (~_DEVCFG0_SOSCGAIN_MASK | 0x2 << _DEVCFG0_SOSCGAIN_POSITION)
+ & (~_DEVCFG0_SOSCBOOST_MASK | 0x1 << _DEVCFG0_SOSCBOOST_POSITION)
+ & (~_DEVCFG0_POSCGAIN_MASK | 0x2 << _DEVCFG0_POSCGAIN_POSITION)
+ & (~_DEVCFG0_POSCBOOST_MASK | 0x1 << _DEVCFG0_POSCBOOST_POSITION)
+ & (~_DEVCFG0_EJTAGBEN_MASK | 0x1 << _DEVCFG0_EJTAGBEN_POSITION);
volatile uint32_t DEVCFG0_B1 __attribute__ ((used, section(".devcfg0_b1"))) =
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG0_DEBUG_MASK | 0x3 << _DEVCFG0_DEBUG_POSITION)
- & (~_DEVCFG0_JTAGEN_MASK | 0x1 << _DEVCFG0_JTAGEN_POSITION)
- & (~_DEVCFG0_ICESEL_MASK | 0x2 << _DEVCFG0_ICESEL_POSITION)
- & (~_DEVCFG0_TRCEN_MASK | 0x1 << _DEVCFG0_TRCEN_POSITION)
- & (~_DEVCFG0_BOOTISA_MASK | 0x1 << _DEVCFG0_BOOTISA_POSITION)
- & (~_DEVCFG0_FECCCON_MASK | 0x3 << _DEVCFG0_FECCCON_POSITION)
- & (~_DEVCFG0_FSLEEP_MASK | 0x1 << _DEVCFG0_FSLEEP_POSITION)
- & (~_DEVCFG0_DBGPER_MASK | 0x7 << _DEVCFG0_DBGPER_POSITION)
- & (~_DEVCFG0_SMCLR_MASK | 0x1 << _DEVCFG0_SMCLR_POSITION)
- & (~_DEVCFG0_SOSCGAIN_MASK | 0x2 << _DEVCFG0_SOSCGAIN_POSITION)
- & (~_DEVCFG0_SOSCBOOST_MASK | 0x1 << _DEVCFG0_SOSCBOOST_POSITION)
- & (~_DEVCFG0_POSCGAIN_MASK | 0x2 << _DEVCFG0_POSCGAIN_POSITION)
- & (~_DEVCFG0_POSCBOOST_MASK | 0x1 << _DEVCFG0_POSCBOOST_POSITION)
- & (~_DEVCFG0_EJTAGBEN_MASK | 0x1 << _DEVCFG0_EJTAGBEN_POSITION);
+ & (~_DEVCFG0_DEBUG_MASK | 0x3 << _DEVCFG0_DEBUG_POSITION)
+ & (~_DEVCFG0_JTAGEN_MASK | 0x1 << _DEVCFG0_JTAGEN_POSITION)
+ & (~_DEVCFG0_ICESEL_MASK | 0x2 << _DEVCFG0_ICESEL_POSITION)
+ & (~_DEVCFG0_TRCEN_MASK | 0x1 << _DEVCFG0_TRCEN_POSITION)
+ & (~_DEVCFG0_BOOTISA_MASK | 0x1 << _DEVCFG0_BOOTISA_POSITION)
+ & (~_DEVCFG0_FECCCON_MASK | 0x3 << _DEVCFG0_FECCCON_POSITION)
+ & (~_DEVCFG0_FSLEEP_MASK | 0x1 << _DEVCFG0_FSLEEP_POSITION)
+ & (~_DEVCFG0_DBGPER_MASK | 0x7 << _DEVCFG0_DBGPER_POSITION)
+ & (~_DEVCFG0_SMCLR_MASK | 0x1 << _DEVCFG0_SMCLR_POSITION)
+ & (~_DEVCFG0_SOSCGAIN_MASK | 0x2 << _DEVCFG0_SOSCGAIN_POSITION)
+ & (~_DEVCFG0_SOSCBOOST_MASK | 0x1 << _DEVCFG0_SOSCBOOST_POSITION)
+ & (~_DEVCFG0_POSCGAIN_MASK | 0x2 << _DEVCFG0_POSCGAIN_POSITION)
+ & (~_DEVCFG0_POSCBOOST_MASK | 0x1 << _DEVCFG0_POSCBOOST_POSITION)
+ & (~_DEVCFG0_EJTAGBEN_MASK | 0x1 << _DEVCFG0_EJTAGBEN_POSITION);
volatile uint32_t ADEVCFG0_B1 __attribute__ ((used, section(".adevcfg0_b1")))=
0xffffffff /* unused bits must be 1 */
- & (~_DEVCFG0_DEBUG_MASK | 0x3 << _DEVCFG0_DEBUG_POSITION)
- & (~_DEVCFG0_JTAGEN_MASK | 0x1 << _DEVCFG0_JTAGEN_POSITION)
- & (~_DEVCFG0_ICESEL_MASK | 0x2 << _DEVCFG0_ICESEL_POSITION)
- & (~_DEVCFG0_TRCEN_MASK | 0x1 << _DEVCFG0_TRCEN_POSITION)
- & (~_DEVCFG0_BOOTISA_MASK | 0x1 << _DEVCFG0_BOOTISA_POSITION)
- & (~_DEVCFG0_FECCCON_MASK | 0x3 << _DEVCFG0_FECCCON_POSITION)
- & (~_DEVCFG0_FSLEEP_MASK | 0x1 << _DEVCFG0_FSLEEP_POSITION)
- & (~_DEVCFG0_DBGPER_MASK | 0x7 << _DEVCFG0_DBGPER_POSITION)
- & (~_DEVCFG0_SMCLR_MASK | 0x1 << _DEVCFG0_SMCLR_POSITION)
- & (~_DEVCFG0_SOSCGAIN_MASK | 0x2 << _DEVCFG0_SOSCGAIN_POSITION)
- & (~_DEVCFG0_SOSCBOOST_MASK | 0x1 << _DEVCFG0_SOSCBOOST_POSITION)
- & (~_DEVCFG0_POSCGAIN_MASK | 0x2 << _DEVCFG0_POSCGAIN_POSITION)
- & (~_DEVCFG0_POSCBOOST_MASK | 0x1 << _DEVCFG0_POSCBOOST_POSITION)
- & (~_DEVCFG0_EJTAGBEN_MASK | 0x1 << _DEVCFG0_EJTAGBEN_POSITION);
+ & (~_DEVCFG0_DEBUG_MASK | 0x3 << _DEVCFG0_DEBUG_POSITION)
+ & (~_DEVCFG0_JTAGEN_MASK | 0x1 << _DEVCFG0_JTAGEN_POSITION)
+ & (~_DEVCFG0_ICESEL_MASK | 0x2 << _DEVCFG0_ICESEL_POSITION)
+ & (~_DEVCFG0_TRCEN_MASK | 0x1 << _DEVCFG0_TRCEN_POSITION)
+ & (~_DEVCFG0_BOOTISA_MASK | 0x1 << _DEVCFG0_BOOTISA_POSITION)
+ & (~_DEVCFG0_FECCCON_MASK | 0x3 << _DEVCFG0_FECCCON_POSITION)
+ & (~_DEVCFG0_FSLEEP_MASK | 0x1 << _DEVCFG0_FSLEEP_POSITION)
+ & (~_DEVCFG0_DBGPER_MASK | 0x7 << _DEVCFG0_DBGPER_POSITION)
+ & (~_DEVCFG0_SMCLR_MASK | 0x1 << _DEVCFG0_SMCLR_POSITION)
+ & (~_DEVCFG0_SOSCGAIN_MASK | 0x2 << _DEVCFG0_SOSCGAIN_POSITION)
+ & (~_DEVCFG0_SOSCBOOST_MASK | 0x1 << _DEVCFG0_SOSCBOOST_POSITION)
+ & (~_DEVCFG0_POSCGAIN_MASK | 0x2 << _DEVCFG0_POSCGAIN_POSITION)
+ & (~_DEVCFG0_POSCBOOST_MASK | 0x1 << _DEVCFG0_POSCBOOST_POSITION)
+ & (~_DEVCFG0_EJTAGBEN_MASK | 0x1 << _DEVCFG0_EJTAGBEN_POSITION);
/*
* uint32_t DEVCFG0_B2 __attribute__ ((section(".devcfg0_b2")))
@@ -379,9 +379,9 @@ volatile uint32_t ADEVCP0_B1 __attribute__ ((used, section(".adevcp0_b1"))) =
*/
volatile uint32_t SEQ_LA[4] __attribute__ ((used, section(".seq_la"))) =
- { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
volatile uint32_t SEQ_B1[4] __attribute__ ((used, section(".seq_b1"))) =
- { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
/*
* Not needed by default:
* uint32_t SEQ_B2[4] __attribute__ ((section(".seq_b2"))) =
diff --git a/boards/remote-pa/include/adc_params.h b/boards/remote-pa/include/adc_params.h
index 48def875b..129a07ad6 100644
--- a/boards/remote-pa/include/adc_params.h
+++ b/boards/remote-pa/include/adc_params.h
@@ -31,7 +31,7 @@ extern "C" {
/**
* @brief ADC configuration
*/
-static const saul_adc_params_t saul_adc_params[] =
+static const saul_adc_params_t saul_adc_params[] =
{
{
.name = "ADC2",
diff --git a/boards/remote-pa/include/board.h b/boards/remote-pa/include/board.h
index 0b3300ac2..395b2a428 100644
--- a/boards/remote-pa/include/board.h
+++ b/boards/remote-pa/include/board.h
@@ -28,7 +28,7 @@
#include "board_common.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/remote-pa/include/gpio_params.h b/boards/remote-pa/include/gpio_params.h
index 1effe5c9d..809506b47 100644
--- a/boards/remote-pa/include/gpio_params.h
+++ b/boards/remote-pa/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(red)",
diff --git a/boards/remote-pa/include/periph_conf.h b/boards/remote-pa/include/periph_conf.h
index e3a15a19e..c813e1fe3 100644
--- a/boards/remote-pa/include/periph_conf.h
+++ b/boards/remote-pa/include/periph_conf.h
@@ -25,7 +25,7 @@
#include "periph_common.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/remote-reva/include/adc_params.h b/boards/remote-reva/include/adc_params.h
index 6b27477ac..bd3a8a7c5 100644
--- a/boards/remote-reva/include/adc_params.h
+++ b/boards/remote-reva/include/adc_params.h
@@ -31,7 +31,7 @@ extern "C" {
/**
* @brief ADC configuration
*/
-static const saul_adc_params_t saul_adc_params[] =
+static const saul_adc_params_t saul_adc_params[] =
{
{
.name = "ADC1",
diff --git a/boards/remote-reva/include/board.h b/boards/remote-reva/include/board.h
index ad6ea0b7d..26e26af24 100644
--- a/boards/remote-reva/include/board.h
+++ b/boards/remote-reva/include/board.h
@@ -28,7 +28,7 @@
#include "board_common.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/remote-reva/include/gpio_params.h b/boards/remote-reva/include/gpio_params.h
index 850033b56..6b988b2da 100644
--- a/boards/remote-reva/include/gpio_params.h
+++ b/boards/remote-reva/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(red)",
diff --git a/boards/remote-reva/include/periph_conf.h b/boards/remote-reva/include/periph_conf.h
index cd1b6e024..3eb1ac8e4 100644
--- a/boards/remote-reva/include/periph_conf.h
+++ b/boards/remote-reva/include/periph_conf.h
@@ -25,7 +25,7 @@
#include "periph_common.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/remote-revb/include/adc_params.h b/boards/remote-revb/include/adc_params.h
index 28a46a3f5..73360b356 100644
--- a/boards/remote-revb/include/adc_params.h
+++ b/boards/remote-revb/include/adc_params.h
@@ -31,7 +31,7 @@ extern "C" {
/**
* @brief ADC configuration
*/
-static const saul_adc_params_t saul_adc_params[] =
+static const saul_adc_params_t saul_adc_params[] =
{
{
.name = "ADC1",
diff --git a/boards/remote-revb/include/board.h b/boards/remote-revb/include/board.h
index 31605708f..1032e7031 100644
--- a/boards/remote-revb/include/board.h
+++ b/boards/remote-revb/include/board.h
@@ -28,7 +28,7 @@
#include "board_common.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/remote-revb/include/gpio_params.h b/boards/remote-revb/include/gpio_params.h
index 50294c035..3fc41aebf 100644
--- a/boards/remote-revb/include/gpio_params.h
+++ b/boards/remote-revb/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(red)",
diff --git a/boards/remote-revb/include/periph_conf.h b/boards/remote-revb/include/periph_conf.h
index b5eb53a38..27c88f13c 100644
--- a/boards/remote-revb/include/periph_conf.h
+++ b/boards/remote-revb/include/periph_conf.h
@@ -28,7 +28,7 @@
#include "periph_common.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/samd21-xpro/include/gpio_params.h b/boards/samd21-xpro/include/gpio_params.h
index c23fae9b7..90e1e3d35 100644
--- a/boards/samd21-xpro/include/gpio_params.h
+++ b/boards/samd21-xpro/include/gpio_params.h
@@ -32,7 +32,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(orange)",
diff --git a/boards/samd21-xpro/include/periph_conf.h b/boards/samd21-xpro/include/periph_conf.h
index 1f6e96664..e4cabe49c 100644
--- a/boards/samd21-xpro/include/periph_conf.h
+++ b/boards/samd21-xpro/include/periph_conf.h
@@ -168,24 +168,24 @@ static const uart_conf_t uart_config[] = {
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{TCC2, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 12), GPIO_MUX_E, 0 },
- { GPIO_PIN(PA, 13), GPIO_MUX_E, 1 },
- }},
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 12), GPIO_MUX_E, 0 },
+ { GPIO_PIN(PA, 13), GPIO_MUX_E, 1 },
+ }},
#endif
#if PWM_1_EN
{TC4, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PB, 12), GPIO_MUX_E, 0 },
- { GPIO_PIN(PB, 13), GPIO_MUX_E, 1 },
- }}
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PB, 12), GPIO_MUX_E, 0 },
+ { GPIO_PIN(PB, 13), GPIO_MUX_E, 1 },
+ }}
#endif
#if PWM_2_EN
{TC6, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PB, 02), GPIO_MUX_E, 0 },
- { GPIO_PIN(PB, 03), GPIO_MUX_E, 1 },
- }}
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PB, 02), GPIO_MUX_E, 0 },
+ { GPIO_PIN(PB, 03), GPIO_MUX_E, 1 },
+ }}
#endif
};
@@ -306,8 +306,8 @@ static const adc_conf_chan_t adc_channels[] = {
{GPIO_PIN(PA, 11), ADC_INPUTCTRL_MUXPOS_PIN19}, /* EXT2, pin 4 */
{GPIO_PIN(PA, 2), ADC_INPUTCTRL_MUXPOS_PIN0}, /* EXT3, pin 3 */
{GPIO_PIN(PA, 3), ADC_INPUTCTRL_MUXPOS_PIN1} /* EXT3, pin 4. This is
- disconnected by default. PA3 is connected to USB_ID.
- Move PA03 SELECT jumper to EXT3 to connect. */
+ disconnected by default. PA3 is connected to USB_ID.
+ Move PA03 SELECT jumper to EXT3 to connect. */
};
#define ADC_0_CHANNELS (6U)
diff --git a/boards/samr21-xpro/include/gpio_params.h b/boards/samr21-xpro/include/gpio_params.h
index e1a36f35c..571e10071 100644
--- a/boards/samr21-xpro/include/gpio_params.h
+++ b/boards/samr21-xpro/include/gpio_params.h
@@ -32,7 +32,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(orange)",
diff --git a/boards/samr21-xpro/include/periph_conf.h b/boards/samr21-xpro/include/periph_conf.h
index 140c50ff7..567e5e679 100644
--- a/boards/samr21-xpro/include/periph_conf.h
+++ b/boards/samr21-xpro/include/periph_conf.h
@@ -72,7 +72,7 @@ extern "C" {
/* generate the actual used core clock frequency */
#define CLOCK_CORECLOCK (((CLOCK_PLL_MUL + 1) * 1000000U) / CLOCK_PLL_DIV)
#elif CLOCK_USE_XOSC32_DFLL
- /* Settings for 32 kHz external oscillator and 48 MHz DFLL */
+/* Settings for 32 kHz external oscillator and 48 MHz DFLL */
#define CLOCK_CORECLOCK (48000000U)
#define CLOCK_XOSC32K (32768UL)
#define CLOCK_8MHZ (1)
@@ -155,19 +155,19 @@ static const uart_conf_t uart_config[] = {
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{TCC1, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 6), GPIO_MUX_E, 0 },
- { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
- { GPIO_UNDEF, (gpio_mux_t)0, 2 }
- }},
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 6), GPIO_MUX_E, 0 },
+ { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
+ { GPIO_UNDEF, (gpio_mux_t)0, 2 }
+ }},
#endif
#if PWM_1_EN
{TCC0, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 16), GPIO_MUX_F, 0 },
- { GPIO_PIN(PA, 18), GPIO_MUX_F, 2 },
- { GPIO_PIN(PA, 19), GPIO_MUX_F, 3 }
- }}
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 16), GPIO_MUX_F, 0 },
+ { GPIO_PIN(PA, 18), GPIO_MUX_F, 2 },
+ { GPIO_PIN(PA, 19), GPIO_MUX_F, 3 }
+ }}
#endif
};
diff --git a/boards/seeeduino_arch-pro/include/gpio_params.h b/boards/seeeduino_arch-pro/include/gpio_params.h
index d599c7203..cea6e42cb 100644
--- a/boards/seeeduino_arch-pro/include/gpio_params.h
+++ b/boards/seeeduino_arch-pro/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
diff --git a/boards/seeeduino_arch-pro/system.c b/boards/seeeduino_arch-pro/system.c
index 38363cb68..f32bc29d8 100644
--- a/boards/seeeduino_arch-pro/system.c
+++ b/boards/seeeduino_arch-pro/system.c
@@ -1,27 +1,27 @@
/**************************************************************************//**
- * @file
- * @brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File
- * for the NXP LPC17xx Device Series
- * @version V1.09
- * @date 09. November 2013
- *
- * @note Integrated, adopted, and renamed for RIOT by Oliver Hahm.
- *
- * Copyright (C) 2009 ARM Limited. All rights reserved.
- * Copyright (C) 2013 Oliver Hahm <oliver.hahm@inria.fr>
- *
- * @par
- * ARM Limited (ARM) is supplying this software for use with Cortex-M
- * processor based microcontrollers. This file can be freely distributed
- * within development tools that are supporting such ARM based processors.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
- * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
- * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
- *
- ******************************************************************************/
+* @file
+* @brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File
+* for the NXP LPC17xx Device Series
+* @version V1.09
+* @date 09. November 2013
+*
+* @note Integrated, adopted, and renamed for RIOT by Oliver Hahm.
+*
+* Copyright (C) 2009 ARM Limited. All rights reserved.
+* Copyright (C) 2013 Oliver Hahm <oliver.hahm@inria.fr>
+*
+* @par
+* ARM Limited (ARM) is supplying this software for use with Cortex-M
+* processor based microcontrollers. This file can be freely distributed
+* within development tools that are supporting such ARM based processors.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
+* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
+* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
+* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
+*
+******************************************************************************/
#include "vendor/LPC17xx.h"
diff --git a/boards/slstk3401a/include/gpio_params.h b/boards/slstk3401a/include/gpio_params.h
index 460b44b94..c16dbe8d2 100644
--- a/boards/slstk3401a/include/gpio_params.h
+++ b/boards/slstk3401a/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
diff --git a/boards/sltb001a/include/gpio_params.h b/boards/sltb001a/include/gpio_params.h
index fde408fbe..67807dddb 100644
--- a/boards/sltb001a/include/gpio_params.h
+++ b/boards/sltb001a/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
diff --git a/boards/slwstk6000b/include/gpio_params.h b/boards/slwstk6000b/include/gpio_params.h
index a95f2eae2..83c37511f 100644
--- a/boards/slwstk6000b/include/gpio_params.h
+++ b/boards/slwstk6000b/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
diff --git a/boards/sodaq-autonomo/include/gpio_params.h b/boards/sodaq-autonomo/include/gpio_params.h
index 13edfc09c..d1b0a8873 100644
--- a/boards/sodaq-autonomo/include/gpio_params.h
+++ b/boards/sodaq-autonomo/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED(green)",
diff --git a/boards/sodaq-autonomo/include/periph_conf.h b/boards/sodaq-autonomo/include/periph_conf.h
index 965580936..ed3b4d640 100644
--- a/boards/sodaq-autonomo/include/periph_conf.h
+++ b/boards/sodaq-autonomo/include/periph_conf.h
@@ -168,19 +168,19 @@ static const uart_conf_t uart_config[] = {
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{TCC1, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 6), GPIO_MUX_E, 0 },
- { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
- { GPIO_UNDEF, (gpio_mux_t)0, 2 }
- }},
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 6), GPIO_MUX_E, 0 },
+ { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
+ { GPIO_UNDEF, (gpio_mux_t)0, 2 }
+ }},
#endif
#if PWM_1_EN
{TCC0, {
- /* GPIO pin, MUX value, TCC channel */
- { GPIO_PIN(PA, 16), GPIO_MUX_F, 0 },
- { GPIO_PIN(PA, 18), GPIO_MUX_F, 2 },
- { GPIO_PIN(PA, 19), GPIO_MUX_F, 3 }
- }}
+ /* GPIO pin, MUX value, TCC channel */
+ { GPIO_PIN(PA, 16), GPIO_MUX_F, 0 },
+ { GPIO_PIN(PA, 18), GPIO_MUX_F, 2 },
+ { GPIO_PIN(PA, 19), GPIO_MUX_F, 3 }
+ }}
#endif
};
diff --git a/boards/sodaq-explorer/include/gpio_params.h b/boards/sodaq-explorer/include/gpio_params.h
index ccf5a573d..13859da74 100644
--- a/boards/sodaq-explorer/include/gpio_params.h
+++ b/boards/sodaq-explorer/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED",
diff --git a/boards/spark-core/include/board.h b/boards/spark-core/include/board.h
index 92378ce8c..7c39dd8f5 100644
--- a/boards/spark-core/include/board.h
+++ b/boards/spark-core/include/board.h
@@ -27,7 +27,7 @@
#include "periph_conf.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/boards/stk3600/include/gpio_params.h b/boards/stk3600/include/gpio_params.h
index b6013e992..554b37dc3 100644
--- a/boards/stk3600/include/gpio_params.h
+++ b/boards/stk3600/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
diff --git a/boards/stk3700/include/gpio_params.h b/boards/stk3700/include/gpio_params.h
index c577e417b..36a48c2de 100644
--- a/boards/stk3700/include/gpio_params.h
+++ b/boards/stk3700/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
diff --git a/boards/stm32f0discovery/include/gpio_params.h b/boards/stm32f0discovery/include/gpio_params.h
index 4000d384b..6d37c5f73 100644
--- a/boards/stm32f0discovery/include/gpio_params.h
+++ b/boards/stm32f0discovery/include/gpio_params.h
@@ -32,7 +32,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD3",
diff --git a/boards/stm32f0discovery/include/periph_conf.h b/boards/stm32f0discovery/include/periph_conf.h
index d38267889..aead4bb9b 100644
--- a/boards/stm32f0discovery/include/periph_conf.h
+++ b/boards/stm32f0discovery/include/periph_conf.h
@@ -112,13 +112,13 @@ static const uart_conf_t uart_config[] = {
* [ pin, channel ]
* @{
*/
-#define ADC_CONFIG { \
- { GPIO_PIN(PORT_C, 0), 10 },\
- { GPIO_PIN(PORT_C, 1), 11 },\
- { GPIO_PIN(PORT_C, 2), 12 },\
- { GPIO_PIN(PORT_C, 3), 13 },\
- { GPIO_PIN(PORT_C, 4), 14 },\
- { GPIO_PIN(PORT_C, 5), 15 } \
+#define ADC_CONFIG { \
+ { GPIO_PIN(PORT_C, 0), 10 }, \
+ { GPIO_PIN(PORT_C, 1), 11 }, \
+ { GPIO_PIN(PORT_C, 2), 12 }, \
+ { GPIO_PIN(PORT_C, 3), 13 }, \
+ { GPIO_PIN(PORT_C, 4), 14 }, \
+ { GPIO_PIN(PORT_C, 5), 15 } \
}
#define ADC_NUMOF (6)
diff --git a/boards/stm32f3discovery/include/gpio_params.h b/boards/stm32f3discovery/include/gpio_params.h
index 72d1296ff..5417164b4 100644
--- a/boards/stm32f3discovery/include/gpio_params.h
+++ b/boards/stm32f3discovery/include/gpio_params.h
@@ -30,7 +30,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD3",
diff --git a/boards/stm32f4discovery/include/gpio_params.h b/boards/stm32f4discovery/include/gpio_params.h
index 54149f2ec..e6b102606 100644
--- a/boards/stm32f4discovery/include/gpio_params.h
+++ b/boards/stm32f4discovery/include/gpio_params.h
@@ -32,7 +32,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD3",
diff --git a/boards/stm32f4discovery/include/periph_conf.h b/boards/stm32f4discovery/include/periph_conf.h
index 9bc1f93e2..497db1f53 100644
--- a/boards/stm32f4discovery/include/periph_conf.h
+++ b/boards/stm32f4discovery/include/periph_conf.h
@@ -134,11 +134,11 @@ static const uart_conf_t uart_config[] = {
* PIN, device (ADCx), channel
* @{
*/
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 1), 0, 1}, \
- {GPIO_PIN(PORT_A, 4), 0, 4}, \
- {GPIO_PIN(PORT_C, 1), 1, 11}, \
- {GPIO_PIN(PORT_C, 2), 1, 12} \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 1), 0, 1}, \
+ {GPIO_PIN(PORT_A, 4), 0, 4}, \
+ {GPIO_PIN(PORT_C, 1), 1, 11}, \
+ {GPIO_PIN(PORT_C, 2), 1, 12} \
}
#define ADC_NUMOF (4)
diff --git a/boards/stm32f769i-disco/include/gpio_params.h b/boards/stm32f769i-disco/include/gpio_params.h
index 169f83ad0..8b283f555 100644
--- a/boards/stm32f769i-disco/include/gpio_params.h
+++ b/boards/stm32f769i-disco/include/gpio_params.h
@@ -30,7 +30,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD1",
diff --git a/boards/teensy31/include/periph_conf.h b/boards/teensy31/include/periph_conf.h
index c9024e04d..68cafdd3f 100644
--- a/boards/teensy31/include/periph_conf.h
+++ b/boards/teensy31/include/periph_conf.h
@@ -76,19 +76,19 @@ static const clock_config_t clock_config = {
* @{
*/
#define PIT_NUMOF (2U)
-#define PIT_CONFIG { \
- { \
- .prescaler_ch = 0, \
- .count_ch = 1, \
- }, \
- { \
- .prescaler_ch = 2, \
- .count_ch = 3, \
- }, \
- }
+#define PIT_CONFIG { \
+ { \
+ .prescaler_ch = 0, \
+ .count_ch = 1, \
+ }, \
+ { \
+ .prescaler_ch = 2, \
+ .count_ch = 3, \
+ }, \
+}
#define LPTMR_NUMOF (0U)
#define LPTMR_CONFIG { \
- }
+}
#define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
#define PIT_BASECLOCK (CLOCK_BUSCLOCK)
diff --git a/boards/telosb/board.c b/boards/telosb/board.c
index cb699cbde..bbde738a5 100644
--- a/boards/telosb/board.c
+++ b/boards/telosb/board.c
@@ -67,7 +67,7 @@ void msp430_init_dco(void)
BCSCTL1 |= DIVA1 + DIVA0; /* ACLK = LFXT1CLK/8 */
for (i = 0xFFFF; i > 0; i--) { /* Delay for XTAL to settle */
- __asm__("nop");
+ __asm__ ("nop");
}
CCTL2 = CCIS0 + CM0 + CAP; /* Define CCR2, CAP, ACLK */
diff --git a/boards/ublox-c030-u201/include/gpio_params.h b/boards/ublox-c030-u201/include/gpio_params.h
index 659cccc68..62d80394b 100644
--- a/boards/ublox-c030-u201/include/gpio_params.h
+++ b/boards/ublox-c030-u201/include/gpio_params.h
@@ -29,7 +29,7 @@ extern "C" {
/**
* @brief GPIO pin configuration
*/
-static const saul_gpio_params_t saul_gpio_params[] =
+static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD1(red)",
diff --git a/boards/ublox-c030-u201/include/periph_conf.h b/boards/ublox-c030-u201/include/periph_conf.h
index 3eae6dffe..56cdb2983 100644
--- a/boards/ublox-c030-u201/include/periph_conf.h
+++ b/boards/ublox-c030-u201/include/periph_conf.h
@@ -252,13 +252,13 @@ static const spi_conf_t spi_config[] = {
* @{
*/
#define ADC_NUMOF (6U)
-#define ADC_CONFIG { \
- {GPIO_PIN(PORT_A, 3), 0, 3}, \
- {GPIO_PIN(PORT_C, 0), 0, 10}, \
- {GPIO_PIN(PORT_C, 3), 0, 4}, \
- {GPIO_PIN(PORT_A, 4), 0, 14}, \
- {GPIO_PIN(PORT_B, 7), 0, 7}, \
- {GPIO_PIN(PORT_B, 6), 0, 6}, \
+#define ADC_CONFIG { \
+ {GPIO_PIN(PORT_A, 3), 0, 3}, \
+ {GPIO_PIN(PORT_C, 0), 0, 10}, \
+ {GPIO_PIN(PORT_C, 3), 0, 4}, \
+ {GPIO_PIN(PORT_A, 4), 0, 14}, \
+ {GPIO_PIN(PORT_B, 7), 0, 7}, \
+ {GPIO_PIN(PORT_B, 6), 0, 6}, \
}
/** @} */
diff --git a/boards/waspmote-pro/include/board.h b/boards/waspmote-pro/include/board.h
index 98a07e4ca..3e1786f95 100644
--- a/boards/waspmote-pro/include/board.h
+++ b/boards/waspmote-pro/include/board.h
@@ -30,9 +30,9 @@ extern "C" {
#endif
/**
-* @brief As the CPU is too slow to handle 115200 baud, we set the default
-* baudrate to 9600 for this board
-*/
+ * @brief As the CPU is too slow to handle 115200 baud, we set the default
+ * baudrate to 9600 for this board
+ */
#define UART_STDIO_BAUDRATE (9600U)
/**
@@ -126,23 +126,23 @@ extern "C" {
*/
#define SET_MUX_GPS MUX_PW_ENABLE_PORT; MUX_PW_ON; \
- MUX0_ENABLE_PORT; MUX1_ENABLE_PORT; \
- MUX0_OFF; MUX1_ON
+ MUX0_ENABLE_PORT; MUX1_ENABLE_PORT; \
+ MUX0_OFF; MUX1_ON
#define SET_MUX_SOCKET1 MUX_PW_ENABLE_PORT; MUX_PW_ON; \
- MUX0_ENABLE_PORT; MUX1_ENABLE_PORT; \
- MUX0_ON; MUX1_ON
+ MUX0_ENABLE_PORT; MUX1_ENABLE_PORT; \
+ MUX0_ON; MUX1_ON
#define SET_MUX_AUX1_MODULE MUX_PW_ENABLE_PORT; MUX_PW_ON; \
- MUX0_ENABLE_PORT; MUX1_ENABLE_PORT; \
- MUX0_ON; MUX1_OFF
+ MUX0_ENABLE_PORT; MUX1_ENABLE_PORT; \
+ MUX0_ON; MUX1_OFF
#define SET_MUX_AUX2_MODULE MUX_PW_ENABLE_PORT; MUX_PW_ON; \
- MUX0_ENABLE_PORT; MUX1_ENABLE_PORT; \
- MUX0_OFF; MUX1_OFF
+ MUX0_ENABLE_PORT; MUX1_ENABLE_PORT; \
+ MUX0_OFF; MUX1_OFF
#define SET_MUX_USB_MODULE MUX_PW_ENABLE_PORT; MUX_PW_ON; \
- MUX_USB_XBEE_ENABLE_PORT; \
- MUX_USB_XBEE_OFF
+ MUX_USB_XBEE_ENABLE_PORT; \
+ MUX_USB_XBEE_OFF
#define SET_MUX_SOCKET0 MUX_PW_ENABLE_PORT; MUX_PW_ON; \
- MUX_USB_XBEE_ENABLE_PORT; \
- MUX_USB_XBEE_ON
+ MUX_USB_XBEE_ENABLE_PORT; \
+ MUX_USB_XBEE_ON
/** @} */
/**
diff --git a/boards/waspmote-pro/include/waspmote_pinmap.h b/boards/waspmote-pro/include/waspmote_pinmap.h
index bee1b0eb1..c3b484da7 100644
--- a/boards/waspmote-pro/include/waspmote_pinmap.h
+++ b/boards/waspmote-pro/include/waspmote_pinmap.h
@@ -33,57 +33,57 @@ extern "C" {
/*
* DESCRIPTION WASP API PIN PORT PIN
*/
-#define USB_XBEE_RX GPIO_PIN(PORT_E, 0)
-#define USB_XBEE_TX GPIO_PIN(PORT_E, 1)
-#define DIGITAL1 GPIO_PIN(PORT_E, 3)
-#define DIGITAL0 GPIO_PIN(PORT_E, 4)
-#define DIGITAL7 GPIO_PIN(PORT_C, 4)
-#define DIGITAL8 GPIO_PIN(PORT_C, 5)
-#define DIGITAL6 GPIO_PIN(PORT_C, 6)
-#define DIGITAL5 GPIO_PIN(PORT_C, 7)
-#define DIGITAL2 GPIO_PIN(PORT_A, 2)
-#define DIGITAL4 GPIO_PIN(PORT_A, 3)
-#define DIGITAL3 GPIO_PIN(PORT_A, 4)
-#define MUX_USB_XBEE GPIO_PIN(PORT_D, 5)
-#define LED0 GPIO_PIN(PORT_F, 4)
-#define LED1 GPIO_PIN(PORT_C, 1)
-#define ANA0 GPIO_PIN(PORT_F, 1)
-#define ANA1 GPIO_PIN(PORT_F, 2)
-#define ANA2 GPIO_PIN(PORT_F, 3)
-#define ANA3 GPIO_PIN(PORT_F, 4)
-#define ANA4 GPIO_PIN(PORT_F, 5)
-#define ANA5 GPIO_PIN(PORT_F, 6)
-#define ANA6 GPIO_PIN(PORT_F, 7)
-#define BAT_MONITOR GPIO_PIN(PORT_F, 0)
-#define XBEE_PW GPIO_PIN(PORT_A, 1)
-#define MUX_PW GPIO_PIN(PORT_D, 7)
-#define SENS_PW_5V GPIO_PIN(PORT_E, 5)
-#define BAT_MONITOR_PW GPIO_PIN(PORT_A, 6)
-#define SENS_PW_3V3 GPIO_PIN(PORT_E, 2)
-#define MEM_PW GPIO_PIN(PORT_A, 5)
-#define SD_PRESENT GPIO_PIN(PORT_C, 0)
-#define SD_SS GPIO_PIN(PORT_B, 0)
-#define SD_SCK GPIO_PIN(PORT_B, 1)
-#define SD_MOSI GPIO_PIN(PORT_B, 2)
-#define SD_MISO GPIO_PIN(PORT_B, 3)
-#define HIB_PIN GPIO_PIN(PORT_B, 4)
-#define SOCKET0_SS GPIO_PIN(PORT_B, 5)
-#define GPS_PW GPIO_PIN(PORT_A, 0)
-#define MUX_0 GPIO_PIN(PORT_B, 6)
-#define MUX_1 GPIO_PIN(PORT_B, 7)
-#define RDY_ACC GPIO_PIN(PORT_E, 6)
-#define RST_RTC GPIO_PIN(PORT_E, 7)
-#define I2C_SCL GPIO_PIN(PORT_D, 0)
-#define I2C_SDA GPIO_PIN(PORT_D, 1)
-#define GPRS_PW GPIO_PIN(PORT_C, 3)
-#define MUX_RX GPIO_PIN(PORT_D, 2)
-#define MUX_TX GPIO_PIN(PORT_D, 3)
-#define XBEE_MON GPIO_PIN(PORT_A, 7)
-#define GPRS_PIN GPIO_PIN(PORT_C, 2)
-#define XBEE_SLEEP GPIO_PIN(PORT_D, 4)
+#define USB_XBEE_RX GPIO_PIN(PORT_E, 0)
+#define USB_XBEE_TX GPIO_PIN(PORT_E, 1)
+#define DIGITAL1 GPIO_PIN(PORT_E, 3)
+#define DIGITAL0 GPIO_PIN(PORT_E, 4)
+#define DIGITAL7 GPIO_PIN(PORT_C, 4)
+#define DIGITAL8 GPIO_PIN(PORT_C, 5)
+#define DIGITAL6 GPIO_PIN(PORT_C, 6)
+#define DIGITAL5 GPIO_PIN(PORT_C, 7)
+#define DIGITAL2 GPIO_PIN(PORT_A, 2)
+#define DIGITAL4 GPIO_PIN(PORT_A, 3)
+#define DIGITAL3 GPIO_PIN(PORT_A, 4)
+#define MUX_USB_XBEE GPIO_PIN(PORT_D, 5)
+#define LED0 GPIO_PIN(PORT_F, 4)
+#define LED1 GPIO_PIN(PORT_C, 1)
+#define ANA0 GPIO_PIN(PORT_F, 1)
+#define ANA1 GPIO_PIN(PORT_F, 2)
+#define ANA2 GPIO_PIN(PORT_F, 3)
+#define ANA3 GPIO_PIN(PORT_F, 4)
+#define ANA4 GPIO_PIN(PORT_F, 5)
+#define ANA5 GPIO_PIN(PORT_F, 6)
+#define ANA6 GPIO_PIN(PORT_F, 7)
+#define BAT_MONITOR GPIO_PIN(PORT_F, 0)
+#define XBEE_PW GPIO_PIN(PORT_A, 1)
+#define MUX_PW GPIO_PIN(PORT_D, 7)
+#define SENS_PW_5V GPIO_PIN(PORT_E, 5)
+#define BAT_MONITOR_PW GPIO_PIN(PORT_A, 6)
+#define SENS_PW_3V3 GPIO_PIN(PORT_E, 2)
+#define MEM_PW GPIO_PIN(PORT_A, 5)
+#define SD_PRESENT GPIO_PIN(PORT_C, 0)
+#define SD_SS GPIO_PIN(PORT_B, 0)
+#define SD_SCK GPIO_PIN(PORT_B, 1)
+#define SD_MOSI GPIO_PIN(PORT_B, 2)
+#define SD_MISO GPIO_PIN(PORT_B, 3)
+#define HIB_PIN GPIO_PIN(PORT_B, 4)
+#define SOCKET0_SS GPIO_PIN(PORT_B, 5)
+#define GPS_PW GPIO_PIN(PORT_A, 0)
+#define MUX_0 GPIO_PIN(PORT_B, 6)
+#define MUX_1 GPIO_PIN(PORT_B, 7)
+#define RDY_ACC GPIO_PIN(PORT_E, 6)
+#define RST_RTC GPIO_PIN(PORT_E, 7)
+#define I2C_SCL GPIO_PIN(PORT_D, 0)
+#define I2C_SDA GPIO_PIN(PORT_D, 1)
+#define GPRS_PW GPIO_PIN(PORT_C, 3)
+#define MUX_RX GPIO_PIN(PORT_D, 2)
+#define MUX_TX GPIO_PIN(PORT_D, 3)
+#define XBEE_MON GPIO_PIN(PORT_A, 7)
+#define GPRS_PIN GPIO_PIN(PORT_C, 2)
+#define XBEE_SLEEP GPIO_PIN(PORT_D, 4)
#define RTC_PW GPIO_PIN(PORT_G, 2)
-#define RTC_SLEEP GPIO_PIN(PORT_G, 1)
-#define LOW_BAT_MON GPIO_PIN(PORT_G, 0)
+#define RTC_SLEEP GPIO_PIN(PORT_G, 1)
+#define LOW_BAT_MON GPIO_PIN(PORT_G, 0)
/** @} */
#ifdef __cplusplus
diff --git a/boards/z1/include/board.h b/boards/z1/include/board.h
index 17ad92692..26162d38c 100644
--- a/boards/z1/include/board.h
+++ b/boards/z1/include/board.h
@@ -15,12 +15,12 @@
* @ingroup boards
* @brief Support for the Zolertia Z1 board.
*
-<h2>Components</h2>
-\li MSP430F2617
-\li CC2420
+ <h2>Components</h2>
+ \li MSP430F2617
+ \li CC2420
-* @{
-*
+ * @{
+ *
* @file
* @brief Zolertia Z1 board configuration
*
diff --git a/boards/z1/include/periph_conf.h b/boards/z1/include/periph_conf.h
index ad0cb8f9f..f3ecbfaa1 100644
--- a/boards/z1/include/periph_conf.h
+++ b/boards/z1/include/periph_conf.h
@@ -67,7 +67,7 @@ extern "C" {
#define UART_TX_ISR (USCIAB0TX_VECTOR)
/** @} */
- /**
+/**
* @name SPI configuration
* @{
*/
diff --git a/cpu/arm7_common/VIC.c b/cpu/arm7_common/VIC.c
index 53f7bcf12..1bc5d535f 100644
--- a/cpu/arm7_common/VIC.c
+++ b/cpu/arm7_common/VIC.c
@@ -14,20 +14,20 @@
static inline unsigned __get_cpsr(void)
{
unsigned long retval;
- __asm__ volatile(" mrs %0, cpsr" : "=r"(retval) : /* no inputs */);
+ __asm__ volatile (" mrs %0, cpsr" : "=r" (retval) : /* no inputs */);
return retval;
}
int irq_is_in(void)
{
int retval;
- __asm__ volatile(" mrs %0, cpsr" : "=r"(retval) : /* no inputs */);
+ __asm__ volatile (" mrs %0, cpsr" : "=r" (retval) : /* no inputs */);
return (retval & INTMode) == 18;
}
static inline void __set_cpsr(unsigned val)
{
- __asm__ volatile(" msr cpsr, %0" : /* no outputs */ : "r"(val));
+ __asm__ volatile (" msr cpsr, %0" : /* no outputs */ : "r" (val));
}
unsigned irq_disable(void)
diff --git a/cpu/arm7_common/arm_cpu.c b/cpu/arm7_common/arm_cpu.c
index 1041e7c62..23c907833 100644
--- a/cpu/arm7_common/arm_cpu.c
+++ b/cpu/arm7_common/arm_cpu.c
@@ -25,7 +25,7 @@
void thread_yield_higher(void)
{
- __asm__("svc 0\n");
+ __asm__ ("svc 0\n");
}
/*----------------------------------------------------------------------------
@@ -50,7 +50,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
*stk = (unsigned int)((unsigned int)stack_start + stack_size) - 4;
/* build base stack */
- for (i = REGISTER_CNT; i > 0 ; i--) {
+ for (i = REGISTER_CNT; i > 0; i--) {
stk--;
*stk = i;
}
@@ -72,7 +72,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
void thread_print_stack(void)
{
register void *stack = 0;
- __asm__("mov %0, sp" : "=r"(stack));
+ __asm__ ("mov %0, sp" : "=r" (stack));
register unsigned int *s = (unsigned int *)stack;
printf("task: %X SP: %X\n", (unsigned int) sched_active_thread, (unsigned int) stack);
diff --git a/cpu/arm7_common/bootloader.c b/cpu/arm7_common/bootloader.c
index 558203462..f2995229f 100644
--- a/cpu/arm7_common/bootloader.c
+++ b/cpu/arm7_common/bootloader.c
@@ -66,18 +66,18 @@ void abtorigin(const char *vector, unsigned long *lnk_ptr1)
{
register unsigned long *lnk_ptr2;
register unsigned long *sp;
- register unsigned int cpsr, spsr;
+ register unsigned int cpsr, spsr;
- __asm__ __volatile__("mrs %0, cpsr" : "=r"(cpsr)); // copy current mode
- __asm__ __volatile__("mrs %0, spsr" : "=r"(spsr)); // copy dabt generating mode
- __asm__ __volatile__("msr cpsr_c, %0" :: "r"(spsr)); // switch to dabt generating mode
- __asm__ __volatile__("mov %0, lr" : "=r"(lnk_ptr2)); // copy lr
- __asm__ __volatile__("mov %0, sp" : "=r"(sp)); // copy sp
- __asm__ __volatile__("msr cpsr_c, %0" :: "r"(cpsr)); // switch back to abt mode
+ __asm__ __volatile__ ("mrs %0, cpsr" : "=r" (cpsr)); // copy current mode
+ __asm__ __volatile__ ("mrs %0, spsr" : "=r" (spsr)); // copy dabt generating mode
+ __asm__ __volatile__ ("msr cpsr_c, %0" : : "r" (spsr)); // switch to dabt generating mode
+ __asm__ __volatile__ ("mov %0, lr" : "=r" (lnk_ptr2)); // copy lr
+ __asm__ __volatile__ ("mov %0, sp" : "=r" (sp)); // copy sp
+ __asm__ __volatile__ ("msr cpsr_c, %0" : : "r" (cpsr)); // switch back to abt mode
printf("#!%s abort at %p (0x%08lX) originating from %p (0x%08lX) in mode 0x%X\n",
vector, (void *)lnk_ptr1, *(lnk_ptr1), (void *)lnk_ptr2, *(lnk_ptr2), spsr
- );
+ );
exit(1);
}
@@ -87,7 +87,7 @@ void UNDEF_Routine(void)
/* cppcheck-suppress variableScope
* (reason: used within __asm__ which cppcheck doesn't pick up) */
register unsigned long *lnk_ptr;
- __asm__ __volatile__("sub %0, lr, #8" : "=r"(lnk_ptr)); // get aborting instruction
+ __asm__ __volatile__ ("sub %0, lr, #8" : "=r" (lnk_ptr)); // get aborting instruction
if (arm_abortflag == 0) {
arm_abortflag = 1; // remember state (if printing should fail again)
@@ -102,7 +102,7 @@ void PABT_Routine(void)
/* cppcheck-suppress variableScope
* (reason: used within __asm__ which cppcheck doesn't pick up) */
register unsigned long *lnk_ptr;
- __asm__ __volatile__("sub %0, lr, #8" : "=r"(lnk_ptr)); // get aborting instruction
+ __asm__ __volatile__ ("sub %0, lr, #8" : "=r" (lnk_ptr)); // get aborting instruction
if (arm_abortflag == 0) {
arm_abortflag = 1; // remember state (if printing should fail again)
@@ -117,7 +117,7 @@ void DABT_Routine(void)
/* cppcheck-suppress variableScope
* (reason: used within __asm__ which cppcheck doesn't pick up) */
register unsigned long *lnk_ptr;
- __asm__ __volatile__("sub %0, lr, #8" : "=r"(lnk_ptr)); // get aborting instruction
+ __asm__ __volatile__ ("sub %0, lr, #8" : "=r" (lnk_ptr)); // get aborting instruction
if (arm_abortflag == 0) {
arm_abortflag = 1; // remember state (if printing should fail again)
diff --git a/cpu/arm7_common/include/arm_cpu.h b/cpu/arm7_common/include/arm_cpu.h
index c0051411f..cf043ea59 100644
--- a/cpu/arm7_common/include/arm_cpu.h
+++ b/cpu/arm7_common/include/arm_cpu.h
@@ -14,7 +14,7 @@
#include "arm7_common.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
#define NEW_TASK_CPSR 0x1F
diff --git a/cpu/atmega1281/startup.c b/cpu/atmega1281/startup.c
index c6521055e..cad312eaf 100644
--- a/cpu/atmega1281/startup.c
+++ b/cpu/atmega1281/startup.c
@@ -49,12 +49,12 @@ void init8_ovr(void) __attribute__((naked)) __attribute__((section(".init8")));
void init7_ovr(void)
{
- __asm__("call reset_handler");
+ __asm__ ("call reset_handler");
}
void init8_ovr(void)
{
- __asm__("jmp exit");
+ __asm__ ("jmp exit");
}
/**
* @brief This function is the entry point after a system reset
diff --git a/cpu/atmega1284p/startup.c b/cpu/atmega1284p/startup.c
index 7c4d8a56d..fc6422cdf 100644
--- a/cpu/atmega1284p/startup.c
+++ b/cpu/atmega1284p/startup.c
@@ -51,12 +51,12 @@ void init8_ovr(void) __attribute__((naked)) __attribute__((section(".init8")));
void init7_ovr(void)
{
- __asm__("call reset_handler");
+ __asm__ ("call reset_handler");
}
void init8_ovr(void)
{
- __asm__("jmp exit");
+ __asm__ ("jmp exit");
}
/**
* @brief This function is the entry point after a system reset
diff --git a/cpu/atmega2560/startup.c b/cpu/atmega2560/startup.c
index b53d18f2d..8ac12b7c3 100644
--- a/cpu/atmega2560/startup.c
+++ b/cpu/atmega2560/startup.c
@@ -49,12 +49,12 @@ void init8_ovr(void) __attribute__((section(".init8")));
__attribute__((used,naked)) void init7_ovr(void)
{
- __asm__("call reset_handler");
+ __asm__ ("call reset_handler");
}
__attribute__((used,naked)) void init8_ovr(void)
{
- __asm__("jmp exit");
+ __asm__ ("jmp exit");
}
/**
diff --git a/cpu/atmega256rfr2/cpu.c b/cpu/atmega256rfr2/cpu.c
index fa3b7d4e3..d48fb2325 100644
--- a/cpu/atmega256rfr2/cpu.c
+++ b/cpu/atmega256rfr2/cpu.c
@@ -29,23 +29,23 @@
#include "debug.h"
/*
-* Since this MCU does not feature a software reset, the watchdog timer
-* is being used. It will be set to the shortest time and then force a
-* reset. Therefore the MCUSR register needs to be resetted as fast as
-* possible. In this case in the bootloader already. In order to regain
-* information about the reset cause, the MCUSR is copied to r2 beforehand.
-* When a software reset was triggered, r3 will contain 0xAA. In order to
-* prevent changes to the values from the .init section, r2 and r3 are saved
-* in the .init0 section
-*/
+ * Since this MCU does not feature a software reset, the watchdog timer
+ * is being used. It will be set to the shortest time and then force a
+ * reset. Therefore the MCUSR register needs to be resetted as fast as
+ * possible. In this case in the bootloader already. In order to regain
+ * information about the reset cause, the MCUSR is copied to r2 beforehand.
+ * When a software reset was triggered, r3 will contain 0xAA. In order to
+ * prevent changes to the values from the .init section, r2 and r3 are saved
+ * in the .init0 section
+ */
uint8_t mcusr_mirror __attribute__((section(".noinit")));
uint8_t soft_rst __attribute__((section(".noinit")));
void get_mcusr(void) __attribute__((naked)) __attribute__((section(".init0")));
void get_mcusr(void)
{
/* save the reset flags passed from the bootloader */
- __asm__ __volatile__("mov %0, r2\n" : "=r" (mcusr_mirror) :);
- __asm__ __volatile__("mov %0, r3\n" : "=r" (soft_rst) :);
+ __asm__ __volatile__ ("mov %0, r2\n" : "=r" (mcusr_mirror) :);
+ __asm__ __volatile__ ("mov %0, r3\n" : "=r" (soft_rst) :);
}
void _reset_cause(void)
@@ -118,7 +118,7 @@ ISR(BADISR_vect){
"STOP Execution.\n"));
printf("IRQ_STATUS %#02x\nIRQ_STATUS1 %#02x\n",
- (unsigned int)IRQ_STATUS, (unsigned int)IRQ_STATUS1 );
+ (unsigned int)IRQ_STATUS, (unsigned int)IRQ_STATUS1 );
printf("SCIRQS %#02x\nBATMON %#02x\n", (unsigned int)SCIRQS, (unsigned int)BATMON );
diff --git a/cpu/atmega256rfr2/periph/cpuid.c b/cpu/atmega256rfr2/periph/cpuid.c
index 2fa936bea..bfaa99029 100644
--- a/cpu/atmega256rfr2/periph/cpuid.c
+++ b/cpu/atmega256rfr2/periph/cpuid.c
@@ -44,23 +44,23 @@
*/
void cpuid_get(void *id)
{
- uint8_t signature_0 = boot_signature_byte_get(0x00);
- uint8_t signature_1 = boot_signature_byte_get(0x02);
- uint8_t signature_2 = boot_signature_byte_get(0x04);
+ uint8_t signature_0 = boot_signature_byte_get(0x00);
+ uint8_t signature_1 = boot_signature_byte_get(0x02);
+ uint8_t signature_2 = boot_signature_byte_get(0x04);
- uint8_t usr_sign_0 = boot_signature_byte_get(0x0100);
- uint8_t usr_sign_1 = boot_signature_byte_get(0x0102);
+ uint8_t usr_sign_0 = boot_signature_byte_get(0x0100);
+ uint8_t usr_sign_1 = boot_signature_byte_get(0x0102);
uint8_t addr[CPUID_LEN] = {
- signature_0, /* 0x1E Atmel manufacturer ID */
- signature_1, /* 0xA8 Part Number high byte */
- signature_2, /* 0x02 Part Number low byte */
- MAN_ID_0, /* 0x1F Atmel JEDEC manufacturer ID */
- PART_NUM, /* 0x94 PART_NUM Identification */
- VERSION_NUM, /* 0x02 VERSION_NUM Identification */
+ signature_0, /* 0x1E Atmel manufacturer ID */
+ signature_1, /* 0xA8 Part Number high byte */
+ signature_2, /* 0x02 Part Number low byte */
+ MAN_ID_0, /* 0x1F Atmel JEDEC manufacturer ID */
+ PART_NUM, /* 0x94 PART_NUM Identification */
+ VERSION_NUM, /* 0x02 VERSION_NUM Identification */
/* last two bytes can be set to flash page 1. for differentiation of different boards */
- usr_sign_0, /* user signature 0 */
- usr_sign_1, /* user signature 1 */
+ usr_sign_0, /* user signature 0 */
+ usr_sign_1, /* user signature 1 */
};
#if defined(ENABLE_DEBUG)
@@ -72,5 +72,5 @@ void cpuid_get(void *id)
DEBUG("\n" );
#endif
- memcpy( id , addr, CPUID_LEN);
+ memcpy( id, addr, CPUID_LEN);
}
diff --git a/cpu/atmega328p/startup.c b/cpu/atmega328p/startup.c
index 4601dcc43..397c94bbf 100644
--- a/cpu/atmega328p/startup.c
+++ b/cpu/atmega328p/startup.c
@@ -49,12 +49,12 @@ void init8_ovr(void) __attribute__((naked)) __attribute__((section(".init8")));
void init7_ovr(void)
{
- __asm__("call reset_handler");
+ __asm__ ("call reset_handler");
}
void init8_ovr(void)
{
- __asm__("jmp exit");
+ __asm__ ("jmp exit");
}
/**
* @brief This function is the entry point after a system reset
diff --git a/cpu/atmega_common/avr-libc-extra/errno.h b/cpu/atmega_common/avr-libc-extra/errno.h
index a8b21f75b..5cf111e61 100644
--- a/cpu/atmega_common/avr-libc-extra/errno.h
+++ b/cpu/atmega_common/avr-libc-extra/errno.h
@@ -4,29 +4,29 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
+ * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
+ * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
- * Neither the name of the copyright holders nor the names of
+ * Neither the name of the copyright holders nor the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE. */
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE. */
#ifndef ERRNO_H
#define ERRNO_H
diff --git a/cpu/atmega_common/avr-libc-extra/time.h b/cpu/atmega_common/avr-libc-extra/time.h
index c287fac2e..bf1c9c888 100644
--- a/cpu/atmega_common/avr-libc-extra/time.h
+++ b/cpu/atmega_common/avr-libc-extra/time.h
@@ -96,7 +96,7 @@
Along with the usual smattering of utility functions, such as is_leap_year(), this library includes
a set of functions related the sun and moon, as well as sidereal time functions.
-*/
+ */
#ifndef TIME_H
#define TIME_H
@@ -108,415 +108,415 @@
extern "C" {
#endif
- /** \ingroup avr_time */
- /* @{ */
+/** \ingroup avr_time */
+/* @{ */
+
+/**
+ The time function returns the systems current time stamp.
+ If timer is not a null pointer, the return value is also assigned to the object it points to.
+ */
+time_t time(time_t *timer);
+
+/**
+ The difftime function returns the difference between two binary time stamps,
+ time1 - time0.
+ */
+int32_t difftime(time_t time1, time_t time0);
+
+
+/**
+ The tm structure contains a representation of time 'broken down' into components of the
+ Gregorian calendar.
+
+ The normal ranges of the elements are..
+
+ \code
+ tm_sec seconds after the minute - [ 0 to 59 ]
+ tm_min minutes after the hour - [ 0 to 59 ]
+ tm_hour hours since midnight - [ 0 to 23 ]
+ tm_mday day of the month - [ 1 to 31 ]
+ tm_wday days since Sunday - [ 0 to 6 ]
+ tm_mon months since January - [ 0 to 11 ]
+ tm_year years since 1900
+ tm_yday days since January 1 - [ 0 to 365 ]
+ tm_isdst Daylight Saving Time flag *
+
+ \endcode
+
+ * The value of tm_isdst is zero if Daylight Saving Time is not in effect, and is negative if
+ the information is not available.
+
+ When Daylight Saving Time is in effect, the value represents the number of
+ seconds the clock is advanced.
+
+ See the set_dst() function for more information about Daylight Saving.
+
+ */
+struct tm {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_wday;
+ int tm_mon;
+ int tm_year;
+ int tm_yday;
+ int tm_isdst;
+};
+
+
+/* We have to provide clock_t / CLOCKS_PER_SEC so that libstdc++-v3 can
+ be built. We define CLOCKS_PER_SEC via a symbol _CLOCKS_PER_SEC_
+ so that the user can provide the value on the link line, which should
+ result in little or no run-time overhead compared with a constant. */
+typedef unsigned long clock_t;
+extern char *_CLOCKS_PER_SEC_;
+#define CLOCKS_PER_SEC ((clock_t) _CLOCKS_PER_SEC_)
+extern clock_t clock(void);
+
+/**
+ This function 'compiles' the elements of a broken-down time structure, returning a binary time stamp.
+ The elements of timeptr are interpreted as representing Local Time.
+
+ The original values of the tm_wday and tm_yday elements of the structure are ignored,
+ and the original values of the other elements are not restricted to the ranges stated for struct tm.
+
+ On successful completion, the values of all elements of timeptr are set to the appropriate range.
+ */
+time_t mktime(struct tm * timeptr);
+
+/**
+ This function 'compiles' the elements of a broken-down time structure, returning a binary time stamp.
+ The elements of timeptr are interpreted as representing UTC.
+
+ The original values of the tm_wday and tm_yday elements of the structure are ignored,
+ and the original values of the other elements are not restricted to the ranges stated for struct tm.
+
+ Unlike mktime(), this function DOES NOT modify the elements of timeptr.
+ */
+time_t mk_gmtime(const struct tm * timeptr);
+
+/**
+ The gmtime function converts the time stamp pointed to by timer into broken-down time,
+ expressed as UTC.
+ */
+struct tm *gmtime(const time_t * timer);
+
+/**
+ Re entrant version of gmtime().
+ */
+void gmtime_r(const time_t * timer, struct tm * timeptr);
+
+/**
+ The localtime function converts the time stamp pointed to by timer into broken-down time,
+ expressed as Local time.
+ */
+struct tm *localtime(const time_t * timer);
+
+/**
+ Re entrant version of localtime().
+ */
+void localtime_r(const time_t * timer, struct tm * timeptr);
+
+/**
+ The asctime function converts the broken-down time of timeptr, into an ascii string in the form
+
+ Sun Mar 23 01:03:52 2013
+ */
+char *asctime(const struct tm * timeptr);
+
+/**
+ Re entrant version of asctime().
+ */
+void asctime_r(const struct tm * timeptr, char *buf);
+
+/**
+ The ctime function is equivalent to asctime(localtime(timer))
+ */
+char *ctime(const time_t * timer);
+
+/**
+ Re entrant version of ctime().
+ */
+void ctime_r(const time_t * timer, char *buf);
+
+/**
+ The isotime function constructs an ascii string in the form
+ \code2013-03-23 01:03:52\endcode
+ */
+char *isotime(const struct tm * tmptr);
+
+/**
+ Re entrant version of isotime()
+ */
+void isotime_r(const struct tm *, char *);
+
+/**
+ A complete description of strftime() is beyond the pale of this document.
+ Refer to ISO/IEC document 9899 for details.
+
+ All conversions are made using the 'C Locale', ignoring the E or O modifiers. Due to the lack of
+ a time zone 'name', the 'Z' conversion is also ignored.
+ */
+size_t strftime(char *s, size_t maxsize, const char *format, const struct tm * timeptr);
+
+/**
+ Specify the Daylight Saving function.
+
+ The Daylight Saving function should examine its parameters to determine whether
+ Daylight Saving is in effect, and return a value appropriate for tm_isdst.
+
+ Working examples for the USA and the EU are available..
+
+ \code #include <util/eu_dst.h>\endcode
+ for the European Union, and
+ \code #include <util/usa_dst.h>\endcode
+ for the United States
+
+ If a Daylight Saving function is not specified, the system will ignore Daylight Saving.
+ */
+void set_dst(int (*)(const time_t *, int32_t *));
- /**
- The time function returns the systems current time stamp.
- If timer is not a null pointer, the return value is also assigned to the object it points to.
- */
- time_t time(time_t *timer);
+/**
+ Set the 'time zone'. The parameter is given in seconds East of the Prime Meridian.
+ Example for New York City:
+ \code set_zone(-5 * ONE_HOUR);\endcode
- /**
- The difftime function returns the difference between two binary time stamps,
- time1 - time0.
- */
- int32_t difftime(time_t time1, time_t time0);
+ If the time zone is not set, the time system will operate in UTC only.
+ */
+void set_zone(int32_t);
+/**
+ Initialize the system time. Examples are...
- /**
- The tm structure contains a representation of time 'broken down' into components of the
- Gregorian calendar.
+ From a Clock / Calendar type RTC:
+ \code
+ struct tm rtc_time;
- The normal ranges of the elements are..
+ read_rtc(&rtc_time);
+ rtc_time.tm_isdst = 0;
+ set_system_time( mktime(&rtc_time) );
+ \endcode
+ From a Network Time Protocol time stamp:
\code
- tm_sec seconds after the minute - [ 0 to 59 ]
- tm_min minutes after the hour - [ 0 to 59 ]
- tm_hour hours since midnight - [ 0 to 23 ]
- tm_mday day of the month - [ 1 to 31 ]
- tm_wday days since Sunday - [ 0 to 6 ]
- tm_mon months since January - [ 0 to 11 ]
- tm_year years since 1900
- tm_yday days since January 1 - [ 0 to 365 ]
- tm_isdst Daylight Saving Time flag *
+ set_system_time(ntp_timestamp - NTP_OFFSET);
+ \endcode
+ From a UNIX time stamp:
+ \code
+ set_system_time(unix_timestamp - UNIX_OFFSET);
\endcode
- *The value of tm_isdst is zero if Daylight Saving Time is not in effect, and is negative if
- the information is not available.
-
- When Daylight Saving Time is in effect, the value represents the number of
- seconds the clock is advanced.
-
- See the set_dst() function for more information about Daylight Saving.
-
- */
- struct tm {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_wday;
- int tm_mon;
- int tm_year;
- int tm_yday;
- int tm_isdst;
- };
-
-
- /* We have to provide clock_t / CLOCKS_PER_SEC so that libstdc++-v3 can
- be built. We define CLOCKS_PER_SEC via a symbol _CLOCKS_PER_SEC_
- so that the user can provide the value on the link line, which should
- result in little or no run-time overhead compared with a constant. */
- typedef unsigned long clock_t;
- extern char *_CLOCKS_PER_SEC_;
-#define CLOCKS_PER_SEC ((clock_t) _CLOCKS_PER_SEC_)
- extern clock_t clock(void);
-
- /**
- This function 'compiles' the elements of a broken-down time structure, returning a binary time stamp.
- The elements of timeptr are interpreted as representing Local Time.
-
- The original values of the tm_wday and tm_yday elements of the structure are ignored,
- and the original values of the other elements are not restricted to the ranges stated for struct tm.
-
- On successful completion, the values of all elements of timeptr are set to the appropriate range.
- */
- time_t mktime(struct tm * timeptr);
-
- /**
- This function 'compiles' the elements of a broken-down time structure, returning a binary time stamp.
- The elements of timeptr are interpreted as representing UTC.
-
- The original values of the tm_wday and tm_yday elements of the structure are ignored,
- and the original values of the other elements are not restricted to the ranges stated for struct tm.
-
- Unlike mktime(), this function DOES NOT modify the elements of timeptr.
- */
- time_t mk_gmtime(const struct tm * timeptr);
-
- /**
- The gmtime function converts the time stamp pointed to by timer into broken-down time,
- expressed as UTC.
- */
- struct tm *gmtime(const time_t * timer);
-
- /**
- Re entrant version of gmtime().
- */
- void gmtime_r(const time_t * timer, struct tm * timeptr);
-
- /**
- The localtime function converts the time stamp pointed to by timer into broken-down time,
- expressed as Local time.
- */
- struct tm *localtime(const time_t * timer);
-
- /**
- Re entrant version of localtime().
- */
- void localtime_r(const time_t * timer, struct tm * timeptr);
-
- /**
- The asctime function converts the broken-down time of timeptr, into an ascii string in the form
-
- Sun Mar 23 01:03:52 2013
- */
- char *asctime(const struct tm * timeptr);
-
- /**
- Re entrant version of asctime().
- */
- void asctime_r(const struct tm * timeptr, char *buf);
-
- /**
- The ctime function is equivalent to asctime(localtime(timer))
- */
- char *ctime(const time_t * timer);
-
- /**
- Re entrant version of ctime().
- */
- void ctime_r(const time_t * timer, char *buf);
-
- /**
- The isotime function constructs an ascii string in the form
- \code2013-03-23 01:03:52\endcode
- */
- char *isotime(const struct tm * tmptr);
-
- /**
- Re entrant version of isotime()
- */
- void isotime_r(const struct tm *, char *);
-
- /**
- A complete description of strftime() is beyond the pale of this document.
- Refer to ISO/IEC document 9899 for details.
-
- All conversions are made using the 'C Locale', ignoring the E or O modifiers. Due to the lack of
- a time zone 'name', the 'Z' conversion is also ignored.
- */
- size_t strftime(char *s, size_t maxsize, const char *format, const struct tm * timeptr);
-
- /**
- Specify the Daylight Saving function.
-
- The Daylight Saving function should examine its parameters to determine whether
- Daylight Saving is in effect, and return a value appropriate for tm_isdst.
-
- Working examples for the USA and the EU are available..
-
- \code #include <util/eu_dst.h>\endcode
- for the European Union, and
- \code #include <util/usa_dst.h>\endcode
- for the United States
-
- If a Daylight Saving function is not specified, the system will ignore Daylight Saving.
- */
- void set_dst(int (*) (const time_t *, int32_t *));
-
- /**
- Set the 'time zone'. The parameter is given in seconds East of the Prime Meridian.
- Example for New York City:
- \code set_zone(-5 * ONE_HOUR);\endcode
-
- If the time zone is not set, the time system will operate in UTC only.
- */
- void set_zone(int32_t);
-
- /**
- Initialize the system time. Examples are...
-
- From a Clock / Calendar type RTC:
- \code
- struct tm rtc_time;
-
- read_rtc(&rtc_time);
- rtc_time.tm_isdst = 0;
- set_system_time( mktime(&rtc_time) );
- \endcode
-
- From a Network Time Protocol time stamp:
- \code
- set_system_time(ntp_timestamp - NTP_OFFSET);
- \endcode
-
- From a UNIX time stamp:
- \code
- set_system_time(unix_timestamp - UNIX_OFFSET);
- \endcode
-
- */
- void set_system_time(time_t timestamp);
-
- /**
- Maintain the system time by calling this function at a rate of 1 Hertz.
-
- It is anticipated that this function will typically be called from within an
- Interrupt Service Routine, (though that is not required). It therefore includes code which
- makes it simple to use from within a 'Naked' ISR, avoiding the cost of saving and restoring
- all the cpu registers.
-
- Such an ISR may resemble the following example...
- \code
- ISR(RTC_OVF_vect, ISR_NAKED)
- {
- system_tick();
- reti();
- }
- \endcode
- */
- void system_tick(void);
-
- /**
- Enumerated labels for the days of the week.
- */
- enum _WEEK_DAYS_ {
- SUNDAY,
- MONDAY,
- TUESDAY,
- WEDNESDAY,
- THURSDAY,
- FRIDAY,
- SATURDAY
- };
-
- /**
- Enumerated labels for the months.
- */
- enum _MONTHS_ {
- JANUARY,
- FEBRUARY,
- MARCH,
- APRIL,
- MAY,
- JUNE,
- JULY,
- AUGUST,
- SEPTEMBER,
- OCTOBER,
- NOVEMBER,
- DECEMBER
- };
-
- /**
- Return 1 if year is a leap year, zero if it is not.
- */
- uint8_t is_leap_year(int16_t year);
-
- /**
- Return the length of month, given the year and month, where month is in the range 1 to 12.
- */
- uint8_t month_length(int16_t year, uint8_t month);
-
- /**
- Return the calendar week of year, where week 1 is considered to begin on the
- day of week specified by 'start'. The returned value may range from zero to 52.
- */
- uint8_t week_of_year(const struct tm * timeptr, uint8_t start);
-
- /**
- Return the calendar week of month, where the first week is considered to begin on the
- day of week specified by 'start'. The returned value may range from zero to 5.
- */
- uint8_t week_of_month(const struct tm * timeptr, uint8_t start);
-
- /**
- Structure which represents a date as a year, week number of that year, and day of week.
- See http://en.wikipedia.org/wiki/ISO_week_date for more information.
- */
- struct week_date{
- int year;
- int week;
- int day;
- };
-
- /**
- Return a week_date structure with the ISO_8601 week based date corresponding to the given
- year and day of year. See http://en.wikipedia.org/wiki/ISO_week_date for more
- information.
- */
- struct week_date * iso_week_date( int year, int yday);
-
- /**
- Re-entrant version of iso-week_date.
- */
- void iso_week_date_r( int year, int yday, struct week_date *);
-
- /**
- Convert a Y2K time stamp into a FAT file system time stamp.
- */
- uint32_t fatfs_time(const struct tm * timeptr);
-
- /** One hour, expressed in seconds */
+ */
+void set_system_time(time_t timestamp);
+
+/**
+ Maintain the system time by calling this function at a rate of 1 Hertz.
+
+ It is anticipated that this function will typically be called from within an
+ Interrupt Service Routine, (though that is not required). It therefore includes code which
+ makes it simple to use from within a 'Naked' ISR, avoiding the cost of saving and restoring
+ all the cpu registers.
+
+ Such an ISR may resemble the following example...
+ \code
+ ISR(RTC_OVF_vect, ISR_NAKED)
+ {
+ system_tick();
+ reti();
+ }
+ \endcode
+ */
+void system_tick(void);
+
+/**
+ Enumerated labels for the days of the week.
+ */
+enum _WEEK_DAYS_ {
+ SUNDAY,
+ MONDAY,
+ TUESDAY,
+ WEDNESDAY,
+ THURSDAY,
+ FRIDAY,
+ SATURDAY
+};
+
+/**
+ Enumerated labels for the months.
+ */
+enum _MONTHS_ {
+ JANUARY,
+ FEBRUARY,
+ MARCH,
+ APRIL,
+ MAY,
+ JUNE,
+ JULY,
+ AUGUST,
+ SEPTEMBER,
+ OCTOBER,
+ NOVEMBER,
+ DECEMBER
+};
+
+/**
+ Return 1 if year is a leap year, zero if it is not.
+ */
+uint8_t is_leap_year(int16_t year);
+
+/**
+ Return the length of month, given the year and month, where month is in the range 1 to 12.
+ */
+uint8_t month_length(int16_t year, uint8_t month);
+
+/**
+ Return the calendar week of year, where week 1 is considered to begin on the
+ day of week specified by 'start'. The returned value may range from zero to 52.
+ */
+uint8_t week_of_year(const struct tm * timeptr, uint8_t start);
+
+/**
+ Return the calendar week of month, where the first week is considered to begin on the
+ day of week specified by 'start'. The returned value may range from zero to 5.
+ */
+uint8_t week_of_month(const struct tm * timeptr, uint8_t start);
+
+/**
+ Structure which represents a date as a year, week number of that year, and day of week.
+ See http://en.wikipedia.org/wiki/ISO_week_date for more information.
+ */
+struct week_date {
+ int year;
+ int week;
+ int day;
+};
+
+/**
+ Return a week_date structure with the ISO_8601 week based date corresponding to the given
+ year and day of year. See http://en.wikipedia.org/wiki/ISO_week_date for more
+ information.
+ */
+struct week_date * iso_week_date( int year, int yday);
+
+/**
+ Re-entrant version of iso-week_date.
+ */
+void iso_week_date_r( int year, int yday, struct week_date *);
+
+/**
+ Convert a Y2K time stamp into a FAT file system time stamp.
+ */
+uint32_t fatfs_time(const struct tm * timeptr);
+
+/** One hour, expressed in seconds */
#define ONE_HOUR 3600
- /** Angular degree, expressed in arc seconds */
+/** Angular degree, expressed in arc seconds */
#define ONE_DEGREE 3600
- /** One day, expressed in seconds */
+/** One day, expressed in seconds */
#define ONE_DAY 86400
- /** Difference between the Y2K and the UNIX epochs, in seconds. To convert a Y2K
- timestamp to UNIX...
- \code
- long unix;
- time_t y2k;
+/** Difference between the Y2K and the UNIX epochs, in seconds. To convert a Y2K
+ timestamp to UNIX...
+ \code
+ long unix;
+ time_t y2k;
- y2k = time(NULL);
- unix = y2k + UNIX_OFFSET;
- \endcode
- */
+ y2k = time(NULL);
+ unix = y2k + UNIX_OFFSET;
+ \endcode
+ */
#define UNIX_OFFSET 946684800
- /** Difference between the Y2K and the NTP epochs, in seconds. To convert a Y2K
- timestamp to NTP...
- \code
- unsigned long ntp;
- time_t y2k;
+/** Difference between the Y2K and the NTP epochs, in seconds. To convert a Y2K
+ timestamp to NTP...
+ \code
+ unsigned long ntp;
+ time_t y2k;
- y2k = time(NULL);
- ntp = y2k + NTP_OFFSET;
- \endcode
- */
+ y2k = time(NULL);
+ ntp = y2k + NTP_OFFSET;
+ \endcode
+ */
#define NTP_OFFSET 3155673600
- /*
- * ===================================================================
- * Ephemera
- */
-
- /**
- Set the geographic coordinates of the 'observer', for use with several of the
- following functions. Parameters are passed as seconds of North Latitude, and seconds
- of East Longitude.
-
- For New York City...
- \code set_position( 40.7142 * ONE_DEGREE, -74.0064 * ONE_DEGREE); \endcode
- */
- void set_position(int32_t latitude, int32_t longitude);
-
- /**
- Computes the difference between apparent solar time and mean solar time.
- The returned value is in seconds.
- */
- int16_t equation_of_time(const time_t * timer);
-
- /**
- Computes the amount of time the sun is above the horizon, at the location of the observer.
-
- NOTE: At observer locations inside a polar circle, this value can be zero during the winter,
- and can exceed ONE_DAY during the summer.
-
- The returned value is in seconds.
- */
- int32_t daylight_seconds(const time_t * timer);
-
- /**
- Computes the time of solar noon, at the location of the observer.
- */
- time_t solar_noon(const time_t * timer);
-
- /**
- Return the time of sunrise, at the location of the observer. See the note about daylight_seconds().
- */
- time_t sun_rise(const time_t * timer);
-
- /**
- Return the time of sunset, at the location of the observer. See the note about daylight_seconds().
- */
- time_t sun_set(const time_t * timer);
-
- /** Returns the declination of the sun in radians. */
- double solar_declination(const time_t * timer);
-
- /**
- Returns an approximation to the phase of the moon.
- The sign of the returned value indicates a waning or waxing phase.
- The magnitude of the returned value indicates the percentage illumination.
- */
- int8_t moon_phase(const time_t * timer);
-
- /**
- Returns Greenwich Mean Sidereal Time, as seconds into the sidereal day.
- The returned value will range from 0 through 86399 seconds.
- */
- unsigned long gm_sidereal(const time_t * timer);
-
- /**
- Returns Local Mean Sidereal Time, as seconds into the sidereal day.
- The returned value will range from 0 through 86399 seconds.
- */
- unsigned long lm_sidereal(const time_t * timer);
-
- struct timespec {
- time_t tv_sec;
- long tv_nsec;
- };
-
- /* @} */
+/*
+ * ===================================================================
+ * Ephemera
+ */
+
+/**
+ Set the geographic coordinates of the 'observer', for use with several of the
+ following functions. Parameters are passed as seconds of North Latitude, and seconds
+ of East Longitude.
+
+ For New York City...
+ \code set_position( 40.7142 * ONE_DEGREE, -74.0064 * ONE_DEGREE); \endcode
+ */
+void set_position(int32_t latitude, int32_t longitude);
+
+/**
+ Computes the difference between apparent solar time and mean solar time.
+ The returned value is in seconds.
+ */
+int16_t equation_of_time(const time_t * timer);
+
+/**
+ Computes the amount of time the sun is above the horizon, at the location of the observer.
+
+ NOTE: At observer locations inside a polar circle, this value can be zero during the winter,
+ and can exceed ONE_DAY during the summer.
+
+ The returned value is in seconds.
+ */
+int32_t daylight_seconds(const time_t * timer);
+
+/**
+ Computes the time of solar noon, at the location of the observer.
+ */
+time_t solar_noon(const time_t * timer);
+
+/**
+ Return the time of sunrise, at the location of the observer. See the note about daylight_seconds().
+ */
+time_t sun_rise(const time_t * timer);
+
+/**
+ Return the time of sunset, at the location of the observer. See the note about daylight_seconds().
+ */
+time_t sun_set(const time_t * timer);
+
+/** Returns the declination of the sun in radians. */
+double solar_declination(const time_t * timer);
+
+/**
+ Returns an approximation to the phase of the moon.
+ The sign of the returned value indicates a waning or waxing phase.
+ The magnitude of the returned value indicates the percentage illumination.
+ */
+int8_t moon_phase(const time_t * timer);
+
+/**
+ Returns Greenwich Mean Sidereal Time, as seconds into the sidereal day.
+ The returned value will range from 0 through 86399 seconds.
+ */
+unsigned long gm_sidereal(const time_t * timer);
+
+/**
+ Returns Local Mean Sidereal Time, as seconds into the sidereal day.
+ The returned value will range from 0 through 86399 seconds.
+ */
+unsigned long lm_sidereal(const time_t * timer);
+
+struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+};
+
+/* @} */
/* /endcond */
@@ -527,5 +527,5 @@ extern "C" {
#endif /* TIME_H */
/**
-\endcond
-*/
+ \endcond
+ */
diff --git a/cpu/atmega_common/avr-libc-extra/unistd.h b/cpu/atmega_common/avr-libc-extra/unistd.h
index 39049c605..f8a0eba31 100644
--- a/cpu/atmega_common/avr-libc-extra/unistd.h
+++ b/cpu/atmega_common/avr-libc-extra/unistd.h
@@ -34,9 +34,9 @@ extern "C" {
int access(const char *, int);
unsigned alarm(unsigned);
int chdir(const char *);
-int chown(const char *, uid_t, gid_t);
+int chown(const char *, uid_t, gid_t);
int close(int);
-size_t confstr(int, char *, size_t);
+size_t confstr(int, char *, size_t);
int dup(int);
int dup2(int, int);
void _exit(int);
@@ -48,60 +48,60 @@ int execve(const char *, char *const [], char *const []);
int execvp(const char *, char *const []);
int faccessat(int, const char *, int, int);
int fchdir(int);
-int fchown(int, uid_t, gid_t);
-int fchownat(int, const char *, uid_t, gid_t, int);
+int fchown(int, uid_t, gid_t);
+int fchownat(int, const char *, uid_t, gid_t, int);
int fexecve(int, char *const [], char *const []);
pid_t fork(void);
long fpathconf(int, int);
-int ftruncate(int, off_t);
+int ftruncate(int, off_t);
char *getcwd(char *, size_t);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
-int getgroups(int, gid_t []);
-int gethostname(char *, size_t);
+int getgroups(int, gid_t []);
+int gethostname(char *, size_t);
char *getlogin(void);
-int getlogin_r(char *, size_t);
+int getlogin_r(char *, size_t);
int getopt(int, char * const [], const char *);
-pid_t getpgid(pid_t);
+pid_t getpgid(pid_t);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
-pid_t getsid(pid_t);
+pid_t getsid(pid_t);
uid_t getuid(void);
int isatty(int);
-int lchown(const char *, uid_t, gid_t);
+int lchown(const char *, uid_t, gid_t);
int link(const char *, const char *);
int linkat(int, const char *, int, const char *, int);
-off_t lseek(int, off_t, int);
+off_t lseek(int, off_t, int);
long pathconf(const char *, int);
int pause(void);
int pipe(int [2]);
-ssize_t pread(int, void *, size_t, off_t);
-ssize_t pwrite(int, const void *, size_t, off_t);
-ssize_t read(int, void *, size_t);
-ssize_t readlink(const char *restrict, char *restrict, size_t);
-ssize_t readlinkat(int, const char *restrict, char *restrict, size_t);
+ssize_t pread(int, void *, size_t, off_t);
+ssize_t pwrite(int, const void *, size_t, off_t);
+ssize_t read(int, void *, size_t);
+ssize_t readlink(const char *restrict, char *restrict, size_t);
+ssize_t readlinkat(int, const char *restrict, char *restrict, size_t);
int rmdir(const char *);
-int setegid(gid_t);
-int seteuid(uid_t);
-int setgid(gid_t);
-int setpgid(pid_t, pid_t);
+int setegid(gid_t);
+int seteuid(uid_t);
+int setgid(gid_t);
+int setpgid(pid_t, pid_t);
pid_t setsid(void);
-int setuid(uid_t);
+int setuid(uid_t);
unsigned sleep(unsigned);
int symlink(const char *, const char *);
int symlinkat(const char *, int, const char *);
long sysconf(int);
pid_t tcgetpgrp(int);
-int tcsetpgrp(int, pid_t);
-int truncate(const char *, off_t);
+int tcsetpgrp(int, pid_t);
+int truncate(const char *, off_t);
char *ttyname(int);
-int ttyname_r(int, char *, size_t);
+int ttyname_r(int, char *, size_t);
int unlink(const char *);
int unlinkat(int, const char *, int);
-int usleep(useconds_t);
-ssize_t write(int, const void *, size_t);
+int usleep(useconds_t);
+ssize_t write(int, const void *, size_t);
#ifdef __cplusplus
}
diff --git a/cpu/atmega_common/include/atmega_regs_common.h b/cpu/atmega_common/include/atmega_regs_common.h
index 3080dee62..d25077152 100644
--- a/cpu/atmega_common/include/atmega_regs_common.h
+++ b/cpu/atmega_common/include/atmega_regs_common.h
@@ -40,25 +40,25 @@ extern "C" {
* @brief Timer register map
*/
typedef struct {
- REG8 CRA; /**< control A */
- REG8 CRB; /**< control B */
- REG8 CRC; /**< control C */
- REG8 reserved; /**< reserved */
- REG16 CNT; /**< counter */
- REG16 ICR; /**< input capture */
- REG16 OCR[3]; /**< output compare */
+ REG8 CRA; /**< control A */
+ REG8 CRB; /**< control B */
+ REG8 CRC; /**< control C */
+ REG8 reserved; /**< reserved */
+ REG16 CNT; /**< counter */
+ REG16 ICR; /**< input capture */
+ REG16 OCR[3]; /**< output compare */
} mega_timer_t;
/**
* @brief UART register map
*/
typedef struct {
- REG8 CSRA; /**< control and status register A */
- REG8 CSRB; /**< control and status register B */
- REG8 CSRC; /**< control and status register C */
- REG8 reserved; /**< reserved */
- REG16 BRR; /**< baud rate register */
- REG8 DR; /**< data register */
+ REG8 CSRA; /**< control and status register A */
+ REG8 CSRB; /**< control and status register B */
+ REG8 CSRC; /**< control and status register C */
+ REG8 reserved; /**< reserved */
+ REG16 BRR; /**< baud rate register */
+ REG8 DR; /**< data register */
} mega_uart_t;
/**
diff --git a/cpu/atmega_common/include/cpu.h b/cpu/atmega_common/include/cpu.h
index 8cb114772..2da52e17c 100644
--- a/cpu/atmega_common/include/cpu.h
+++ b/cpu/atmega_common/include/cpu.h
@@ -81,13 +81,13 @@ __attribute__((always_inline)) static inline void cpu_print_last_instruction(voi
uint8_t lo;
uint16_t ptr;
- __asm__ volatile( "in __tmp_reg__, __SP_H__ \n\t"
- "mov %0, __tmp_reg__ \n\t"
- : "=g"(hi) );
+ __asm__ volatile ( "in __tmp_reg__, __SP_H__ \n\t"
+ "mov %0, __tmp_reg__ \n\t"
+ : "=g" (hi) );
- __asm__ volatile( "in __tmp_reg__, __SP_L__ \n\t"
- "mov %0, __tmp_reg__ \n\t"
- : "=g"(lo) );
+ __asm__ volatile ( "in __tmp_reg__, __SP_L__ \n\t"
+ "mov %0, __tmp_reg__ \n\t"
+ : "=g" (lo) );
ptr = hi<<8 | lo;
printf("Stack Pointer: 0x%04x\n", ptr);
}
diff --git a/cpu/atmega_common/include/sys/stat.h b/cpu/atmega_common/include/sys/stat.h
index 1099df247..716812bc6 100644
--- a/cpu/atmega_common/include/sys/stat.h
+++ b/cpu/atmega_common/include/sys/stat.h
@@ -90,19 +90,19 @@ struct stat {
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
/* These function prototypes are required by the standard */
-int chmod(const char *, mode_t);
-int fchmod(int, mode_t);
-int fchmodat(int, const char *, mode_t, int);
+int chmod(const char *, mode_t);
+int fchmod(int, mode_t);
+int fchmodat(int, const char *, mode_t, int);
int fstat(int, struct stat *);
int fstatat(int, const char *restrict, struct stat *restrict, int);
int futimens(int, const struct timespec [2]);
int lstat(const char *restrict, struct stat *restrict);
-int mkdir(const char *, mode_t);
-int mkdirat(int, const char *, mode_t);
-int mkfifo(const char *, mode_t);
-int mkfifoat(int, const char *, mode_t);
-int mknod(const char *, mode_t, dev_t);
-int mknodat(int, const char *, mode_t, dev_t);
+int mkdir(const char *, mode_t);
+int mkdirat(int, const char *, mode_t);
+int mkfifo(const char *, mode_t);
+int mkfifoat(int, const char *, mode_t);
+int mknod(const char *, mode_t, dev_t);
+int mknodat(int, const char *, mode_t, dev_t);
int stat(const char *restrict, struct stat *restrict);
mode_t umask(mode_t);
int utimensat(int, const char *, const struct timespec [2], int);
diff --git a/cpu/atmega_common/include/sys/time.h b/cpu/atmega_common/include/sys/time.h
index 2dfa8b99b..d5ad16440 100644
--- a/cpu/atmega_common/include/sys/time.h
+++ b/cpu/atmega_common/include/sys/time.h
@@ -21,8 +21,8 @@ extern "C" {
*
*/
struct timeval {
- time_t tv_sec; /**< seconds */
- suseconds_t tv_usec; /**< microseconds */
+ time_t tv_sec; /**< seconds */
+ suseconds_t tv_usec; /**< microseconds */
};
#ifdef __cplusplus
diff --git a/cpu/atmega_common/irq_arch.c b/cpu/atmega_common/irq_arch.c
index da16ec384..0c6a2f086 100644
--- a/cpu/atmega_common/irq_arch.c
+++ b/cpu/atmega_common/irq_arch.c
@@ -37,22 +37,22 @@ volatile uint8_t __in_isr = 0;
__attribute__((always_inline)) static inline uint8_t __get_interrupt_state(void)
{
uint8_t sreg;
- __asm__ volatile( "in __tmp_reg__, __SREG__ \n\t"
- "mov %0, __tmp_reg__ \n\t"
- : "=g"(sreg) );
+ __asm__ volatile ( "in __tmp_reg__, __SREG__ \n\t"
+ "mov %0, __tmp_reg__ \n\t"
+ : "=g" (sreg) );
return sreg & (1 << 7);
}
__attribute__((always_inline)) inline void __set_interrupt_state(uint8_t state)
{
- __asm__ volatile( "mov r15,%0 \n\t"
- "in r16, __SREG__ \n\t"
- "cbr r16,7 \n\t"
- "or r15,r16 \n\t"
- "out __SREG__, r15 \n\t"
- :
- : "g"(state)
- : "r15", "r16");
+ __asm__ volatile ( "mov r15,%0 \n\t"
+ "in r16, __SREG__ \n\t"
+ "cbr r16,7 \n\t"
+ "or r15,r16 \n\t"
+ "out __SREG__, r15 \n\t"
+ :
+ : "g" (state)
+ : "r15", "r16");
}
/**
diff --git a/cpu/atmega_common/periph/gpio.c b/cpu/atmega_common/periph/gpio.c
index 5e0bced64..432a62a39 100644
--- a/cpu/atmega_common/periph/gpio.c
+++ b/cpu/atmega_common/periph/gpio.c
@@ -136,16 +136,16 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
if ((_port_num(pin) == PORT_D && pin_num > 3)
#if defined (PORTE)
- || (_port_num(pin) == PORT_E && pin_num < 4)
- || (_port_num(pin) != PORT_D && _port_num(pin) != PORT_E)
+ || (_port_num(pin) == PORT_E && pin_num < 4)
+ || (_port_num(pin) != PORT_D && _port_num(pin) != PORT_E)
#elif defined(CPU_ATMEGA328P)
- || (pin_num < 2) || (_port_num(pin) != PORT_D)
+ || (pin_num < 2) || (_port_num(pin) != PORT_D)
#elif defined(CPU_ATMEGA1284P)
- || (_port_num(pin) == PORT_B && pin_num != 2)
- || (_port_num(pin) == PORT_D && pin_num < 2)
- || (_port_num(pin) != PORT_D && _port_num(pin) != PORT_D)
+ || (_port_num(pin) == PORT_B && pin_num != 2)
+ || (_port_num(pin) == PORT_D && pin_num < 2)
+ || (_port_num(pin) != PORT_D && _port_num(pin) != PORT_D)
#endif
- || ((mode != GPIO_IN) && (mode != GPIO_IN_PU))) {
+ || ((mode != GPIO_IN) && (mode != GPIO_IN_PU))) {
return -1;
}
diff --git a/cpu/atmega_common/periph/pm.c b/cpu/atmega_common/periph/pm.c
index 609d2ce4b..b0a482ba6 100644
--- a/cpu/atmega_common/periph/pm.c
+++ b/cpu/atmega_common/periph/pm.c
@@ -36,7 +36,7 @@ void pm_reboot(void)
/* Softreset recognition feature, "r3" will be read out in .init0
* to be able to distinguish WDT reset and WDT software reset
*/
- __asm__ __volatile__("mov r3, %0\n" :: "r" (0xAA));
+ __asm__ __volatile__ ("mov r3, %0\n" : : "r" (0xAA));
#endif /* CPU_ATMEGA256RFR2 */
/*
diff --git a/cpu/atmega_common/thread_arch.c b/cpu/atmega_common/thread_arch.c
index d76995e4e..12f1c4d08 100644
--- a/cpu/atmega_common/thread_arch.c
+++ b/cpu/atmega_common/thread_arch.c
@@ -69,7 +69,7 @@ static void __enter_thread_mode(void);
* if task_func returns sched_task_exit gets popped into the PC
*/
char *thread_stack_init(thread_task_func_t task_func, void *arg,
- void *stack_start, int stack_size)
+ void *stack_start, int stack_size)
{
uint16_t tmp_adress;
uint8_t *stk;
@@ -140,7 +140,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg,
int i;
- for (i = 2; i <= 23 ; i++) {
+ for (i = 2; i <= 23; i++) {
stk--;
*stk = (uint8_t) 0;
}
@@ -178,7 +178,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg,
*/
void thread_stack_print(void)
{
- uint8_t found_marker = 1;
+ uint8_t found_marker = 1;
uint8_t *sp = (uint8_t *)sched_active_thread->sp;
uint16_t size = 0;
@@ -215,7 +215,7 @@ void NORETURN __enter_thread_mode(void)
{
irq_enable();
__context_restore();
- __asm__ volatile("ret");
+ __asm__ volatile ("ret");
UNREACHABLE();
}
@@ -225,7 +225,7 @@ void thread_yield_higher(void) {
__context_save();
sched_run();
__context_restore();
- __asm__ volatile("ret");
+ __asm__ volatile ("ret");
} else {
sched_context_switch_request = 1;
}
@@ -238,12 +238,12 @@ void thread_yield_isr(void) {
__exit_isr();
- __asm__ volatile("reti");
+ __asm__ volatile ("reti");
}
__attribute__((always_inline)) static inline void __context_save(void)
{
- __asm__ volatile(
+ __asm__ volatile (
"push __tmp_reg__ \n\t"
"in __tmp_reg__, __SREG__ \n\t"
"cli \n\t"
@@ -294,13 +294,13 @@ __attribute__((always_inline)) static inline void __context_save(void)
"st x+, __tmp_reg__ \n\t"
"in __tmp_reg__, __SP_H__ \n\t"
"st x+, __tmp_reg__ \n\t"
- );
+ );
}
__attribute__((always_inline)) static inline void __context_restore(void)
{
- __asm__ volatile(
+ __asm__ volatile (
"lds r26, sched_active_thread \n\t"
"lds r27, sched_active_thread + 1 \n\t"
"ld r28, x+ \n\t"
@@ -349,5 +349,5 @@ __attribute__((always_inline)) static inline void __context_restore(void)
"pop __tmp_reg__ \n\t"
"out __SREG__, __tmp_reg__ \n\t"
"pop __tmp_reg__ \n\t"
- );
+ );
}
diff --git a/cpu/cc2538/include/cc2538.h b/cpu/cc2538/include/cc2538.h
index bca9ff737..dc71202e7 100644
--- a/cpu/cc2538/include/cc2538.h
+++ b/cpu/cc2538/include/cc2538.h
@@ -39,10 +39,10 @@ typedef enum IRQn
MemoryManagement_IRQn = -12, /**< 4 Cortex-M3 Memory Management Interrupt */
BusFault_IRQn = -11, /**< 5 Cortex-M3 Bus Fault Interrupt */
UsageFault_IRQn = -10, /**< 6 Cortex-M3 Usage Fault Interrupt */
- SVCall_IRQn = - 5, /**< 11 Cortex-M3 SV Call Interrupt */
- DebugMonitor_IRQn = - 4, /**< 12 Cortex-M3 Debug Monitor Interrupt */
- PendSV_IRQn = - 2, /**< 14 Cortex-M3 Pend SV Interrupt */
- SysTick_IRQn = - 1, /**< 15 Cortex-M3 System Tick Interrupt */
+ SVCall_IRQn = -5, /**< 11 Cortex-M3 SV Call Interrupt */
+ DebugMonitor_IRQn = -4, /**< 12 Cortex-M3 Debug Monitor Interrupt */
+ PendSV_IRQn = -2, /**< 14 Cortex-M3 Pend SV Interrupt */
+ SysTick_IRQn = -1, /**< 15 Cortex-M3 System Tick Interrupt */
/****** CC2538 specific Interrupt Numbers *********************************/
GPIO_PORT_A_IRQn = 0, /**< GPIO port A */
@@ -124,8 +124,8 @@ void SysTick_Handler(void); /**< SysTick handler */
typedef volatile uint32_t cc2538_reg_t; /**< Least-significant 32 bits of the IEEE address */
/** @addtogroup cpu_specific_Peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define FLASH_BASE 0x00200000 /**< FLASH base address */
#define SRAM_BASE 0x20000000 /**< SRAM base address */
diff --git a/cpu/cc2538/include/cc2538_gpio.h b/cpu/cc2538/include/cc2538_gpio.h
index c9cbfefaa..08b362b3d 100644
--- a/cpu/cc2538/include/cc2538_gpio.h
+++ b/cpu/cc2538/include/cc2538_gpio.h
@@ -54,7 +54,7 @@ enum {
* @param[in] n Number of the bit to set high in the mask.
*
* @return A bit mask in which bit n is high.
-*/
+ */
#define PIN_MASK(n) ( 1 << (n) )
/**
@@ -63,7 +63,7 @@ enum {
* @param[in] gpio_num GPIO number (0-31)
*
* @return Corresponding GPIO port number (0-3)
-*/
+ */
#define GPIO_NUM_TO_PORT_NUM(gpio_num) ( (gpio_num) >> GPIO_PORT_SHIFT )
/**
@@ -72,7 +72,7 @@ enum {
* @param[in] gpio_num GPIO number (0-31)
*
* @return Corresponding GPIO port bit number (0-7)
-*/
+ */
#define GPIO_BIT_NUM(gpio_num) ( (gpio_num) & GPIO_BIT_MASK )
/**
@@ -82,7 +82,7 @@ enum {
* @param[in] bit_num GPIO bit number (0-7)
*
* @return Corresponding GPIO number (0-31)
-*/
+ */
#define GPIO_PXX_TO_NUM(port_num, bit_num) ( ((port_num) << GPIO_PORT_SHIFT) | (bit_num) )
/**
@@ -91,35 +91,35 @@ enum {
* @param[in] gpio_num GPIO number (0-31)
*
* @return Corresponding GPIO port instance
-*/
+ */
#define GPIO_NUM_TO_DEV(gpio_num) ( GPIO_A + GPIO_NUM_TO_PORT_NUM(gpio_num) )
/**
* @brief Enable hardware (peripheral) control for a given GPIO pin number
*
* @param[in] gpio_num GPIO number (0-31)
-*/
+ */
#define gpio_hardware_control(gpio_num) ( GPIO_NUM_TO_DEV(gpio_num)->AFSEL |= PIN_MASK(GPIO_BIT_NUM(gpio_num)) )
/**
* @brief Enable software control for a given GPIO pin number
*
* @param[in] gpio_num GPIO number (0-31)
-*/
+ */
#define gpio_software_control(gpio_num) ( GPIO_NUM_TO_DEV(gpio_num)->AFSEL &= ~PIN_MASK(GPIO_BIT_NUM(gpio_num)) )
/**
* @brief Configure the given GPIO as an output
*
* @param[in] gpio_num GPIO number (0-31)
-*/
+ */
#define gpio_dir_output(gpio_num) ( GPIO_NUM_TO_DEV(gpio_num)->DIR |= PIN_MASK(GPIO_BIT_NUM(gpio_num)) )
/**
* @brief Configure the given GPIO as an input
*
* @param[in] gpio_num GPIO number (0-31)
-*/
+ */
#define gpio_dir_input(gpio_num) ( GPIO_NUM_TO_DEV(gpio_num)->DIR &= ~PIN_MASK(GPIO_BIT_NUM(gpio_num)) )
/**
@@ -133,7 +133,7 @@ enum {
* @brief Set a specific GPIO output pin low
*
* @param[in] gpio_num GPIO number (0-31)
-*/
+ */
#define cc2538_gpio_clear(gpio_num) ( GPIO_NUM_TO_DEV(gpio_num)->DATA &= ~PIN_MASK(GPIO_BIT_NUM(gpio_num)) )
/**
@@ -237,80 +237,80 @@ typedef struct {
/**
* @brief IOC port component registers
*/
- typedef struct {
- cc2538_reg_t SEL[32]; /**< select special function for output pin*/
- cc2538_reg_t OVER[32]; /**< override pin mode, enable alternate mode */
- cc2538_reg_t PINS[21]; /**< select input pin for special functions */
- } cc2538_ioc_t;
-
- /**
- * @name Peripheral Signal Select Values (for IOC_Pxx_SEL registers)
- * @{
- */
- typedef enum {
- UART0_TXD = 0, /**< UART0 TXD */
- UART1_RTS, /**< UART1 RTS */
- UART1_TXD, /**< UART1 TXD */
- SSI0_TXD, /**< SSI0 TXD */
- SSI0_CLK_OUT, /**< SSI0 CLKOUT */
- SSI0_FSS_OUT, /**< SSI0 FSSOUT */
- SSI0_TX_SER, /**< SSI0 STXSER EN */
- SSI1_TXD, /**< SSI1 TXD */
- SSI1_CLK_OUT, /**< SSI1 CLKOUT */
- SSI1_FSS_OUT, /**< SSI1 FSSOUT */
- SSI1_TX_SER, /**< SSI1 STXSER EN */
- I2C_SDA_OUT, /**< I2C CMSSDA */
- I2C_SCL_OUT, /**< I2C CMSSCL */
- GPT0_ICP1, /**< GPT0 ICP1 */
- GPT0_ICP2, /**< GPT0 ICP2 */
- GPT1_ICP1, /**< GPT1 ICP1 */
- GPT1_ICP2, /**< GPT1 ICP2 */
- GPT2_ICP1, /**< GPT2 ICP1 */
- GPT2_ICP2, /**< GPT2 ICP2 */
- GPT3_ICP1, /**< GPT3 ICP1 */
- GPT3_ICP2 , /**< GPT3 ICP2 */
- } cc2538_ioc_sel_t;
- /** @} */
-
- /**
- * @name Pin select for periphical functions
- * @{
- */
- typedef enum {
- UART0_RXD = 0, /**< UART0 RXD */
- UART1_CTS, /**< UART1 CTS */
- UART1_RXD, /**< UART1 RXD */
- SSI0_CLK, /**< SSI0 CLK */
- SSI0_RXD, /**< SSI0 RXD */
- SSI0_FSS_IN, /**< SSI0 FSS IN */
- SSI0_CLK_IN, /**< SSI0 CLK IN */
- SSI1_CLK, /**< SSI1 CLK */
- SSI1_RXD, /**< SSI1 RXD */
- SSI1_FSS_IN, /**< SSI1 FSS IN */
- SSI1_CLK_IN, /**< SSI1 CLK IN */
- I2C_SDA_IN, /**< I2C SDA IN */
- I2C_SCL_IN, /**< I2C SCL IN */
- GPT0_OCP1, /**< GPT0 OCP1 */
- GPT0_OCP2, /**< GPT0 OCP2 */
- GPT1_OCP1, /**< GPT1 OCP1 */
- GPT1_OCP2, /**< GPT1 OCP2 */
- GPT2_OCP1, /**< GPT2 OCP1 */
- GPT2_OCP2, /**< GPT2 OCP2 */
- GPT3_OCP1, /**< GPT3 OCP1 */
- GPT3_OCP2, /**< GPT3 OCP2 */
- } cc2538_ioc_pin_t;
- /** @} */
-
- /**
- * @brief Values to override pin configuration
- */
- typedef enum {
- OVERRIDE_DISABLE = 0x0,
- OVERRIDE_ANALOG = 0x1,
- OVERRIDE_PULLDOWN = 0x2,
- OVERRIDE_PULLUP = 0x4,
- OVERRIDE_ENABLE = 0x8,
- } cc2538_ioc_over_t;
+typedef struct {
+ cc2538_reg_t SEL[32]; /**< select special function for output pin*/
+ cc2538_reg_t OVER[32]; /**< override pin mode, enable alternate mode */
+ cc2538_reg_t PINS[21]; /**< select input pin for special functions */
+} cc2538_ioc_t;
+
+/**
+ * @name Peripheral Signal Select Values (for IOC_Pxx_SEL registers)
+ * @{
+ */
+typedef enum {
+ UART0_TXD = 0, /**< UART0 TXD */
+ UART1_RTS, /**< UART1 RTS */
+ UART1_TXD, /**< UART1 TXD */
+ SSI0_TXD, /**< SSI0 TXD */
+ SSI0_CLK_OUT, /**< SSI0 CLKOUT */
+ SSI0_FSS_OUT, /**< SSI0 FSSOUT */
+ SSI0_TX_SER, /**< SSI0 STXSER EN */
+ SSI1_TXD, /**< SSI1 TXD */
+ SSI1_CLK_OUT, /**< SSI1 CLKOUT */
+ SSI1_FSS_OUT, /**< SSI1 FSSOUT */
+ SSI1_TX_SER, /**< SSI1 STXSER EN */
+ I2C_SDA_OUT, /**< I2C CMSSDA */
+ I2C_SCL_OUT, /**< I2C CMSSCL */
+ GPT0_ICP1, /**< GPT0 ICP1 */
+ GPT0_ICP2, /**< GPT0 ICP2 */
+ GPT1_ICP1, /**< GPT1 ICP1 */
+ GPT1_ICP2, /**< GPT1 ICP2 */
+ GPT2_ICP1, /**< GPT2 ICP1 */
+ GPT2_ICP2, /**< GPT2 ICP2 */
+ GPT3_ICP1, /**< GPT3 ICP1 */
+ GPT3_ICP2, /**< GPT3 ICP2 */
+} cc2538_ioc_sel_t;
+/** @} */
+
+/**
+ * @name Pin select for periphical functions
+ * @{
+ */
+typedef enum {
+ UART0_RXD = 0, /**< UART0 RXD */
+ UART1_CTS, /**< UART1 CTS */
+ UART1_RXD, /**< UART1 RXD */
+ SSI0_CLK, /**< SSI0 CLK */
+ SSI0_RXD, /**< SSI0 RXD */
+ SSI0_FSS_IN, /**< SSI0 FSS IN */
+ SSI0_CLK_IN, /**< SSI0 CLK IN */
+ SSI1_CLK, /**< SSI1 CLK */
+ SSI1_RXD, /**< SSI1 RXD */
+ SSI1_FSS_IN, /**< SSI1 FSS IN */
+ SSI1_CLK_IN, /**< SSI1 CLK IN */
+ I2C_SDA_IN, /**< I2C SDA IN */
+ I2C_SCL_IN, /**< I2C SCL IN */
+ GPT0_OCP1, /**< GPT0 OCP1 */
+ GPT0_OCP2, /**< GPT0 OCP2 */
+ GPT1_OCP1, /**< GPT1 OCP1 */
+ GPT1_OCP2, /**< GPT1 OCP2 */
+ GPT2_OCP1, /**< GPT2 OCP1 */
+ GPT2_OCP2, /**< GPT2 OCP2 */
+ GPT3_OCP1, /**< GPT3 OCP1 */
+ GPT3_OCP2, /**< GPT3 OCP2 */
+} cc2538_ioc_pin_t;
+/** @} */
+
+/**
+ * @brief Values to override pin configuration
+ */
+typedef enum {
+ OVERRIDE_DISABLE = 0x0,
+ OVERRIDE_ANALOG = 0x1,
+ OVERRIDE_PULLDOWN = 0x2,
+ OVERRIDE_PULLUP = 0x4,
+ OVERRIDE_ENABLE = 0x8,
+} cc2538_ioc_over_t;
/**
* @name Values for IOC_PXX_OVER
diff --git a/cpu/cc2538/include/cc2538_rf.h b/cpu/cc2538/include/cc2538_rf.h
index f623fdc55..3374473f3 100644
--- a/cpu/cc2538/include/cc2538_rf.h
+++ b/cpu/cc2538/include/cc2538_rf.h
@@ -73,9 +73,9 @@ extern "C" {
#define RFCORE_ASSERT(expr) (void)( (expr) || RFCORE_ASSERT_failure(#expr, __FUNCTION__, __LINE__) )
#if DEVELHELP
-#define RFCORE_WAIT_UNTIL(expr) while (!(expr)) { \
- DEBUG("RFCORE_WAIT_UNTIL(%s) at line %u in %s()\n", #expr, __LINE__, __FUNCTION__); \
- thread_yield(); \
+#define RFCORE_WAIT_UNTIL(expr) while (!(expr)) { \
+ DEBUG("RFCORE_WAIT_UNTIL(%s) at line %u in %s()\n", #expr, __LINE__, __FUNCTION__); \
+ thread_yield(); \
}
#else
#define RFCORE_WAIT_UNTIL(expr) while (!(expr)) thread_yield()
@@ -83,7 +83,7 @@ extern "C" {
#define RFCORE_FLUSH_RECEIVE_FIFO() rfcore_strobe(ISFLUSHRX)
-#define ABS_DIFF(x, y) ( ((x) < (y))? ((y) - (x)) : ((x) - (y)) )
+#define ABS_DIFF(x, y) ( ((x) < (y)) ? ((y) - (x)) : ((x) - (y)) )
#define BOOLEAN(x) ( (x) != 0 )
#define NOT(x) ( (x) == 0 )
#define GET_BYTE(buffer, index) ( (unsigned char*)(buffer) )[index]
@@ -109,9 +109,9 @@ enum {
NLOCK = BIT(0),
};
- /*
- * @brief RFCORE_XREG_FRMCTRL0 bits
- */
+/*
+ * @brief RFCORE_XREG_FRMCTRL0 bits
+ */
enum {
ENERGY_SCAN = BIT(4),
AUTOACK = BIT(5),
diff --git a/cpu/cc2538/include/cc2538_rfcore.h b/cpu/cc2538/include/cc2538_rfcore.h
index de547315d..4b523df9d 100644
--- a/cpu/cc2538/include/cc2538_rfcore.h
+++ b/cpu/cc2538/include/cc2538_rfcore.h
@@ -60,7 +60,7 @@ typedef struct {
struct {
cc2538_reg_t FRAME_FILTER_EN : 1;
cc2538_reg_t PAN_COORDINATOR : 1;
- cc2538_reg_t MAX_FRAME_VERSION: 2;
+ cc2538_reg_t MAX_FRAME_VERSION : 2;
cc2538_reg_t RESERVED : 28;
} XREG_FRMFILT0bits;
};
diff --git a/cpu/cc2538/include/cc2538_sys_ctrl.h b/cpu/cc2538/include/cc2538_sys_ctrl.h
index a7b16d97f..2da57f340 100644
--- a/cpu/cc2538/include/cc2538_sys_ctrl.h
+++ b/cpu/cc2538/include/cc2538_sys_ctrl.h
@@ -151,10 +151,10 @@ typedef struct {
/**
* @brief Compute the current system clock frequency based on the SYS_CTRL register states
*/
-#define sys_clock_freq() ((uint32_t)\
- (SYS_CTRL->cc2538_sys_ctrl_clk_ctrl.CLOCK_CTRLbits.OSC ? \
- RCOSC16M_FREQ : XOSC32M_FREQ) >> \
- SYS_CTRL->cc2538_sys_ctrl_clk_ctrl.CLOCK_CTRLbits.SYS_DIV)
+#define sys_clock_freq() ((uint32_t) \
+ (SYS_CTRL->cc2538_sys_ctrl_clk_ctrl.CLOCK_CTRLbits.OSC ? \
+ RCOSC16M_FREQ : XOSC32M_FREQ) >> \
+ SYS_CTRL->cc2538_sys_ctrl_clk_ctrl.CLOCK_CTRLbits.SYS_DIV)
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/cpu/cc2538/periph/adc.c b/cpu/cc2538/periph/adc.c
index ac3fe0490..9b2a60dc5 100644
--- a/cpu/cc2538/periph/adc.c
+++ b/cpu/cc2538/periph/adc.c
@@ -6,7 +6,7 @@
* directory for more details.
*/
- /**
+/**
* @ingroup cpu_cc2538
* @ingroup drivers_periph_adc
* @{
@@ -18,7 +18,7 @@
*
* @author Sebastian Meiling <s@mlng.net>
* @}
- */
+ */
#include "board.h"
#include "cpu.h"
@@ -91,7 +91,7 @@ int adc_sample(adc_t line, adc_res_t res)
adca->ADCCON3 = reg | res | SOC_ADC_ADCCON_REF |
(adc_config[line] & GPIO_PIN_MASK);
- DEBUG("ADCCON1: %"PRIu32" ADCCON2: %"PRIu32" ADCCON3: %"PRIu32"\n",
+ DEBUG("ADCCON1: %" PRIu32 " ADCCON2: %" PRIu32 " ADCCON3: %" PRIu32 "\n",
adca->cc2538_adc_adccon1.ADCCON1, adca->ADCCON2, adca->ADCCON3);
/* Poll/wait until end of conversion */
@@ -104,7 +104,7 @@ int adc_sample(adc_t line, adc_res_t res)
sample |= (adca->ADCH & SOC_ADC_ADCH_MASK) << 8;
/* sample right shifted depending on resolution */
sample = sample >> rshift;
- DEBUG("adc_sample: raw value %"PRIi16"\n", sample);
+ DEBUG("adc_sample: raw value %" PRIi16 "\n", sample);
/* FIXME: currently RIOT ADC allows values >0 only */
if (sample < 0) {
sample = 0;
diff --git a/cpu/cc2538/periph/gpio.c b/cpu/cc2538/periph/gpio.c
index 83a33c86c..6bbfc4630 100644
--- a/cpu/cc2538/periph/gpio.c
+++ b/cpu/cc2538/periph/gpio.c
@@ -100,7 +100,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
return -1;
}
- DEBUG("GPIO %"PRIu32", PORT: %u, PIN: %u\n", (uint32_t)pin, _port_num(pin), _pin_num(pin));
+ DEBUG("GPIO %" PRIu32 ", PORT: %u, PIN: %u\n", (uint32_t)pin, _port_num(pin), _pin_num(pin));
/* disable any alternate function and any eventual interrupts */
gpio(pin)->IE &= ~_pin_mask(pin);
diff --git a/cpu/cc2538/periph/i2c.c b/cpu/cc2538/periph/i2c.c
index 98e7ceb0f..5a412f8eb 100644
--- a/cpu/cc2538/periph/i2c.c
+++ b/cpu/cc2538/periph/i2c.c
@@ -85,10 +85,10 @@ static uint32_t speed_hz;
static uint32_t scl_delay;
#define bus_quiet() ( cc2538_gpio_read(I2C_0_SCL_PIN) && cc2538_gpio_read(I2C_0_SDA_PIN) )
-#define WARN_IF(cond) \
- if (cond) { \
- DEBUG("%s at %s:%u\n", #cond, RIOT_FILE_NOPATH, __LINE__); \
- }
+#define WARN_IF(cond) \
+ if (cond) { \
+ DEBUG("%s at %s:%u\n", #cond, RIOT_FILE_NOPATH, __LINE__); \
+ }
void cc2538_i2c_init_master(uint32_t speed_hz);
@@ -384,7 +384,7 @@ static int i2c_read_bytes_dumb(uint8_t address, uint8_t *data, int length)
stat = i2c_ctrl_blocking(ACK | START | RUN);
if (stat & ARBLST) {
- break;
+ break;
}
else if (stat & ANY_ERROR) {
i2cm_ctrl_write(STOP);
@@ -398,7 +398,7 @@ static int i2c_read_bytes_dumb(uint8_t address, uint8_t *data, int length)
stat = i2c_ctrl_blocking((n < length - 1) ? (ACK | RUN) : (STOP | RUN));
if (stat & ARBLST) {
- break;
+ break;
}
else if (stat & ANY_ERROR) {
i2cm_ctrl_write(STOP);
@@ -530,7 +530,7 @@ int i2c_write_bytes(i2c_t dev, uint8_t address, const void *data, int length)
WARN_IF(I2CM_STAT & ERROR);
if (I2CM_STAT & ARBLST) {
- break;
+ break;
}
else if (I2CM_STAT & ANY_ERROR) {
i2cm_ctrl_write(STOP);
@@ -540,10 +540,10 @@ int i2c_write_bytes(i2c_t dev, uint8_t address, const void *data, int length)
flags = RUN;
}
- if (n < length) {
- DEBUG("%s(%u, %p, %u): %u/%u bytes delivered.\n",
- __FUNCTION__, address, (void *)my_data, length, n, length);
- }
+ if (n < length) {
+ DEBUG("%s(%u, %p, %u): %u/%u bytes delivered.\n",
+ __FUNCTION__, address, (void *)my_data, length, n, length);
+ }
return n;
}
@@ -580,7 +580,7 @@ int i2c_write_regs(i2c_t dev, uint8_t address, uint8_t reg, const void *data, in
I2CM_SA = address << 1;
I2CM_DR = reg;
- uint_fast8_t flags = (length > 0)? (START | RUN) : (STOP | START | RUN);
+ uint_fast8_t flags = (length > 0) ? (START | RUN) : (STOP | START | RUN);
stat = i2c_ctrl_blocking(flags);
if (stat & ARBLST) {
@@ -609,7 +609,7 @@ int i2c_write_regs(i2c_t dev, uint8_t address, uint8_t reg, const void *data, in
WARN_IF(I2CM_STAT & ERROR);
if (I2CM_STAT & ARBLST) {
- break;
+ break;
}
else if (I2CM_STAT & ANY_ERROR) {
i2cm_ctrl_write(STOP);
@@ -628,7 +628,7 @@ int i2c_write_regs(i2c_t dev, uint8_t address, uint8_t reg, const void *data, in
length,
n,
length
- );
+ );
}
return n;
diff --git a/cpu/cc2538/periph/spi.c b/cpu/cc2538/periph/spi.c
index af1b08a25..27a832fbc 100644
--- a/cpu/cc2538/periph/spi.c
+++ b/cpu/cc2538/periph/spi.c
@@ -164,11 +164,11 @@ void spi_transfer_bytes(spi_t bus, spi_cs_t cs, bool cont,
for (size_t i = 0; i < len; i++) {
while (!(dev(bus)->SR & SSI_SR_TNF)) {}
dev(bus)->DR = out_buf[i];
- while (!(dev(bus)->SR & SSI_SR_RNE)){}
+ while (!(dev(bus)->SR & SSI_SR_RNE)) {}
in_buf[i] = dev(bus)->DR;
}
- /* wait until no more busy */
- while ((dev(bus)->SR & SSI_SR_BSY)) {}
+ /* wait until no more busy */
+ while ((dev(bus)->SR & SSI_SR_BSY)) {}
}
if ((!cont) && (cs != SPI_CS_UNDEF)) {
diff --git a/cpu/cc2538/periph/timer.c b/cpu/cc2538/periph/timer.c
index f4c7e4207..049063a7e 100644
--- a/cpu/cc2538/periph/timer.c
+++ b/cpu/cc2538/periph/timer.c
@@ -124,7 +124,7 @@ int timer_init(tim_t tim, unsigned long freq, timer_cb_t cb, void *arg)
uint32_t chan_mode = TnCMIE | GPTIMER_PERIODIC_MODE;
if (timer_config[tim].cfg == GPTMCFG_32_BIT_TIMER) {
/* Count up in periodic mode */
- chan_mode |= TnCDIR ;
+ chan_mode |= TnCDIR;
if (timer_config[tim].chn > 1) {
DEBUG("Invalid timer_config. Multiple channels are available only in 16-bit mode.");
@@ -258,31 +258,47 @@ void timer_start(tim_t tim)
*/
static void irq_handler(tim_t tim, int channel)
{
- DEBUG("%s(%u,%d)\n", __FUNCTION__, tim, channel);
- assert(tim < TIMER_NUMOF);
- assert(channel < (int)timer_config[tim].chn);
-
- uint32_t mis;
- /* Latch the active interrupt flags */
- mis = dev(tim)->MIS & chn_isr_cfg[channel].mask;
- /* Clear the latched interrupt flags */
- dev(tim)->ICR = mis;
-
- if (mis & chn_isr_cfg[channel].flag) {
- /* Disable further match interrupts for this timer/channel */
- dev(tim)->cc2538_gptimer_imr.IMR &= ~chn_isr_cfg[channel].flag;
- /* Invoke the callback function */
- isr_ctx[tim].cb(isr_ctx[tim].arg, channel);
- }
+ DEBUG("%s(%u,%d)\n", __FUNCTION__, tim, channel);
+ assert(tim < TIMER_NUMOF);
+ assert(channel < (int)timer_config[tim].chn);
+
+ uint32_t mis;
+ /* Latch the active interrupt flags */
+ mis = dev(tim)->MIS & chn_isr_cfg[channel].mask;
+ /* Clear the latched interrupt flags */
+ dev(tim)->ICR = mis;
+
+ if (mis & chn_isr_cfg[channel].flag) {
+ /* Disable further match interrupts for this timer/channel */
+ dev(tim)->cc2538_gptimer_imr.IMR &= ~chn_isr_cfg[channel].flag;
+ /* Invoke the callback function */
+ isr_ctx[tim].cb(isr_ctx[tim].arg, channel);
+ }
cortexm_isr_end();
}
-void isr_timer0_chan0(void) {irq_handler(0, 0);}
-void isr_timer0_chan1(void) {irq_handler(0, 1);}
-void isr_timer1_chan0(void) {irq_handler(1, 0);}
-void isr_timer1_chan1(void) {irq_handler(1, 1);}
-void isr_timer2_chan0(void) {irq_handler(2, 0);}
-void isr_timer2_chan1(void) {irq_handler(2, 1);}
-void isr_timer3_chan0(void) {irq_handler(3, 0);}
-void isr_timer3_chan1(void) {irq_handler(3, 1);}
+void isr_timer0_chan0(void) {
+ irq_handler(0, 0);
+}
+void isr_timer0_chan1(void) {
+ irq_handler(0, 1);
+}
+void isr_timer1_chan0(void) {
+ irq_handler(1, 0);
+}
+void isr_timer1_chan1(void) {
+ irq_handler(1, 1);
+}
+void isr_timer2_chan0(void) {
+ irq_handler(2, 0);
+}
+void isr_timer2_chan1(void) {
+ irq_handler(2, 1);
+}
+void isr_timer3_chan0(void) {
+ irq_handler(3, 0);
+}
+void isr_timer3_chan1(void) {
+ irq_handler(3, 1);
+}
diff --git a/cpu/cc2538/radio/cc2538_rf_getset.c b/cpu/cc2538/radio/cc2538_rf_getset.c
index 658e02a09..34f1a64ff 100644
--- a/cpu/cc2538/radio/cc2538_rf_getset.c
+++ b/cpu/cc2538/radio/cc2538_rf_getset.c
@@ -177,7 +177,7 @@ void cc2538_set_chan(unsigned int chan)
}
DEBUG("%i (range %i-%i)\n", chan, IEEE802154_CHANNEL_MIN,
- IEEE802154_CHANNEL_MAX);
+ IEEE802154_CHANNEL_MAX);
cc2538_set_freq(IEEE802154_CHAN2FREQ(chan));
}
diff --git a/cpu/cc2538/radio/cc2538_rf_internal.c b/cpu/cc2538/radio/cc2538_rf_internal.c
index 0fbeb9cca..06246db2c 100644
--- a/cpu/cc2538/radio/cc2538_rf_internal.c
+++ b/cpu/cc2538/radio/cc2538_rf_internal.c
@@ -67,7 +67,7 @@ void isr_rfcorerxtx(void)
RFCORE_SFR_RFIRQF0 = 0;
RFCORE_SFR_RFIRQF1 = 0;
- _irq_handler();
+ _irq_handler();
cortexm_isr_end();
}
diff --git a/cpu/cc26x0/include/cc26x0.h b/cpu/cc26x0/include/cc26x0.h
index 8f3f13b92..a56931339 100644
--- a/cpu/cc26x0/include/cc26x0.h
+++ b/cpu/cc26x0/include/cc26x0.h
@@ -41,10 +41,10 @@ typedef enum IRQn
MemoryManagement_IRQn = -12, /**< 4 Cortex-M3 Memory Management Interrupt */
BusFault_IRQn = -11, /**< 5 Cortex-M3 Bus Fault Interrupt */
UsageFault_IRQn = -10, /**< 6 Cortex-M3 Usage Fault Interrupt */
- SVCall_IRQn = - 5, /**< 11 Cortex-M3 SV Call Interrupt */
- DebugMonitor_IRQn = - 4, /**< 12 Cortex-M3 Debug Monitor Interrupt */
- PendSV_IRQn = - 2, /**< 14 Cortex-M3 Pend SV Interrupt */
- SysTick_IRQn = - 1, /**< 15 Cortex-M3 System Tick Interrupt */
+ SVCall_IRQn = -5, /**< 11 Cortex-M3 SV Call Interrupt */
+ DebugMonitor_IRQn = -4, /**< 12 Cortex-M3 Debug Monitor Interrupt */
+ PendSV_IRQn = -2, /**< 14 Cortex-M3 Pend SV Interrupt */
+ SysTick_IRQn = -1, /**< 15 Cortex-M3 System Tick Interrupt */
/****** CC26x0 specific Interrupt Numbers *********************************/
EDGE_DETECT_IRQN = 0, /**< 16 AON edge detect */
@@ -103,8 +103,8 @@ typedef enum IRQn
/*@}*/
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define FLASH_BASE 0x00000000 /**< FLASH base address */
/*@}*/
diff --git a/cpu/cc26x0/include/cc26x0_aux.h b/cpu/cc26x0/include/cc26x0_aux.h
index ee4483d9a..ad382a730 100644
--- a/cpu/cc26x0/include/cc26x0_aux.h
+++ b/cpu/cc26x0/include/cc26x0_aux.h
@@ -39,8 +39,8 @@ typedef struct {
} aux_aiodio_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AUX_AIODIO0_BASE 0x400C1000 /**< AUX_AIODIO0 base address */
#define AUX_AIODIO1_BASE 0x400C2000 /**< AUX_AIODIO1 base address */
/** @} */
@@ -66,8 +66,8 @@ typedef struct {
} aux_tdc_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AUX_TDC_BASE 0x400C4000 /**< AUX_TDC base address */
/** @} */
@@ -98,8 +98,8 @@ typedef struct {
} aux_evtcl_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AUX_EVCTL_BASE 0x400C5000 /**< AUX_EVCTL base address */
/** @} */
@@ -147,8 +147,8 @@ typedef struct {
/** @} */
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AUX_WUC_BASE 0x400C6000 /**< AUX_WUC base address */
/** @} */
@@ -168,8 +168,8 @@ typedef struct {
} aux_timer_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AUX_TIMER_BASE 0x400C7000 /**< AUX_WUC base address */
/** @} */
@@ -192,8 +192,8 @@ typedef struct {
} aux_smph_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AUX_SMPH_BASE 0x400C8000 /**< AUX_WUC base address */
/* @} */
@@ -213,8 +213,8 @@ typedef struct {
} aux_anaif_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AUX_ANAIF_BASE 0x400C9000 /**< AUX_WUC base address */
/** @} */
@@ -239,8 +239,8 @@ typedef struct {
} adi_4_aux_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define ADI_4_AUX_BASE 0x400CB000 /**< AUX_WUC base address */
/** @} */
diff --git a/cpu/cc26x0/include/cc26x0_i2c.h b/cpu/cc26x0/include/cc26x0_i2c.h
index 2dc2e466d..98d64f9a4 100644
--- a/cpu/cc26x0/include/cc26x0_i2c.h
+++ b/cpu/cc26x0/include/cc26x0_i2c.h
@@ -56,8 +56,8 @@ typedef struct {
} i2c_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define I2C_BASE (PERIPH_BASE + 0x2000) /**< I2C base address */
/** @} */
diff --git a/cpu/cc26x0/include/cc26x0_prcm.h b/cpu/cc26x0/include/cc26x0_prcm.h
index 8912089e0..671ee1990 100644
--- a/cpu/cc26x0/include/cc26x0_prcm.h
+++ b/cpu/cc26x0/include/cc26x0_prcm.h
@@ -81,8 +81,8 @@ typedef struct {
/** @} */
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define DDI0_OSC_BASE 0x400CA000 /**< DDI0_OSC base address */
/*@}*/
@@ -99,8 +99,8 @@ typedef struct {
} aon_sysctl_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AON_SYSCTL_BASE 0x40090000 /**< AON_SYSCTL base address */
/*@}*/
@@ -195,8 +195,8 @@ typedef struct {
/** @} */
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define AON_WUC_BASE 0x40091000 /**< AON_WUC base address */
/*@}*/
@@ -306,8 +306,8 @@ typedef struct {
/** @} */
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define PRCM_BASE 0x40082000 /**< PRCM base address */
/*@}*/
diff --git a/cpu/cc26x0/include/cc26x0_vims.h b/cpu/cc26x0/include/cc26x0_vims.h
index 905a4bdd1..9ddab239f 100644
--- a/cpu/cc26x0/include/cc26x0_vims.h
+++ b/cpu/cc26x0/include/cc26x0_vims.h
@@ -172,8 +172,8 @@ typedef struct {
} flash_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define FLASH_BASEADDR 0x40030000 /**< base address of FLASH memory */
/*@}*/
@@ -189,8 +189,8 @@ typedef struct {
} vims_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define VIMS_BASE 0x40034000 /**< base address of VIMS memory */
/*@}*/
diff --git a/cpu/cc26x0/include/cc26x0_wdt.h b/cpu/cc26x0/include/cc26x0_wdt.h
index 3ff931785..dc97aba1d 100644
--- a/cpu/cc26x0/include/cc26x0_wdt.h
+++ b/cpu/cc26x0/include/cc26x0_wdt.h
@@ -40,8 +40,8 @@ typedef struct {
} wdt_regs_t;
/** @ingroup cpu_specific_peripheral_memory_map
- * @{
- */
+ * @{
+ */
#define WDT_BASE 0x40080000 /**< WDT base address */
/*@}*/
diff --git a/cpu/cc26x0/include/periph_cpu.h b/cpu/cc26x0/include/periph_cpu.h
index 05ac958f6..aef1b6b51 100644
--- a/cpu/cc26x0/include/periph_cpu.h
+++ b/cpu/cc26x0/include/periph_cpu.h
@@ -72,8 +72,8 @@ typedef enum {
* (without gaps) starting from GPT0, i.e. if multiple timers are enabled.
*/
typedef struct {
- uint8_t cfg; /**< timer config [16,32 Bit] */
- uint8_t chn; /**< number of channels [1,2] */
+ uint8_t cfg; /**< timer config [16,32 Bit] */
+ uint8_t chn; /**< number of channels [1,2] */
} timer_conf_t;
#endif /* ifndef DOXYGEN */
diff --git a/cpu/cc26x0/periph/gpio.c b/cpu/cc26x0/periph/gpio.c
index 7ca909059..6bf76993b 100644
--- a/cpu/cc26x0/periph/gpio.c
+++ b/cpu/cc26x0/periph/gpio.c
@@ -38,10 +38,10 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
/* enable GPIO clock */
PRCM->PDCTL0 |= PDCTL0_PERIPH_ON;
- while(!(PRCM->PDSTAT0 & PDSTAT0_PERIPH_ON)) ;
+ while(!(PRCM->PDSTAT0 & PDSTAT0_PERIPH_ON));
PRCM->GPIOCLKGR |= 1;
PRCM->CLKLOADCTL |= CLKLOADCTL_LOAD;
- while (!(PRCM->CLKLOADCTL & CLKLOADCTL_LOADDONE)) ;
+ while (!(PRCM->CLKLOADCTL & CLKLOADCTL_LOADDONE));
/* configure the GPIO mode */
IOC->CFG[pin] = mode;
@@ -52,7 +52,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
}
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
- gpio_cb_t cb, void *arg)
+ gpio_cb_t cb, void *arg)
{
int init = gpio_init(pin, mode);
if (init != 0)
diff --git a/cpu/cc26x0/periph/timer.c b/cpu/cc26x0/periph/timer.c
index dcd3c5f2f..d900e6d87 100644
--- a/cpu/cc26x0/periph/timer.c
+++ b/cpu/cc26x0/periph/timer.c
@@ -260,11 +260,27 @@ static void irq_handler(tim_t tim, int channel)
cortexm_isr_end();
}
-void isr_timer0_chan0(void) {irq_handler(0, 0);}
-void isr_timer0_chan1(void) {irq_handler(0, 1);}
-void isr_timer1_chan0(void) {irq_handler(1, 0);}
-void isr_timer1_chan1(void) {irq_handler(1, 1);}
-void isr_timer2_chan0(void) {irq_handler(2, 0);}
-void isr_timer2_chan1(void) {irq_handler(2, 1);}
-void isr_timer3_chan0(void) {irq_handler(3, 0);}
-void isr_timer3_chan1(void) {irq_handler(3, 1);}
+void isr_timer0_chan0(void) {
+ irq_handler(0, 0);
+}
+void isr_timer0_chan1(void) {
+ irq_handler(0, 1);
+}
+void isr_timer1_chan0(void) {
+ irq_handler(1, 0);
+}
+void isr_timer1_chan1(void) {
+ irq_handler(1, 1);
+}
+void isr_timer2_chan0(void) {
+ irq_handler(2, 0);
+}
+void isr_timer2_chan1(void) {
+ irq_handler(2, 1);
+}
+void isr_timer3_chan0(void) {
+ irq_handler(3, 0);
+}
+void isr_timer3_chan1(void) {
+ irq_handler(3, 1);
+}
diff --git a/cpu/cc26x0/periph/uart.c b/cpu/cc26x0/periph/uart.c
index ce35df71f..5f9167075 100644
--- a/cpu/cc26x0/periph/uart.c
+++ b/cpu/cc26x0/periph/uart.c
@@ -53,7 +53,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
/* enable clocks: serial power domain and UART */
PRCM->PDCTL0SERIAL = 1;
- while (!(PRCM->PDSTAT0 & PDSTAT0_SERIAL_ON)) ;
+ while (!(PRCM->PDSTAT0 & PDSTAT0_SERIAL_ON));
uart_poweron(uart);
/* disable and reset the UART */
diff --git a/cpu/cc430/cc430-adc.c b/cpu/cc430/cc430-adc.c
index f1a55a7f4..050cb157c 100644
--- a/cpu/cc430/cc430-adc.c
+++ b/cpu/cc430/cc430-adc.c
@@ -54,14 +54,14 @@
#include "xtimer.h"
uint16_t adc12_result;
-uint8_t adc12_data_ready;
+uint8_t adc12_data_ready;
/************************************************************************************************
- * @fn adc12_single_conversion
- * @brief Init ADC12. Do single conversion. Turn off ADC12.
- * @param none
- * @return none
- ************************************************************************************************/
+* @fn adc12_single_conversion
+* @brief Init ADC12. Do single conversion. Turn off ADC12.
+* @param none
+* @return none
+************************************************************************************************/
uint16_t adc12_single_conversion(uint16_t ref, uint16_t sht, uint16_t channel)
{
/* Initialize the shared reference module */
@@ -105,11 +105,11 @@ uint16_t adc12_single_conversion(uint16_t ref, uint16_t sht, uint16_t channel)
}
/*************************************************************************************************
- * @fn ADC12ISR
- * @brief Store ADC12 conversion result. Set flag to indicate data ready.
- * @param none
- * @return none
- *************************************************************************************************/
+* @fn ADC12ISR
+* @brief Store ADC12 conversion result. Set flag to indicate data ready.
+* @param none
+* @return none
+*************************************************************************************************/
interrupt(ADC12_VECTOR) __attribute__((naked)) adc_isr(void)
{
__enter_isr();
diff --git a/cpu/cc430/include/cc430-adc.h b/cpu/cc430/include/cc430-adc.h
index ac25b830a..8f7898654 100644
--- a/cpu/cc430/include/cc430-adc.h
+++ b/cpu/cc430/include/cc430-adc.h
@@ -43,7 +43,7 @@ extern "C" {
extern uint16_t adc12_single_conversion(uint16_t ref, uint16_t sht, uint16_t channel);
extern uint16_t adc12_result;
-extern uint8_t adc12_data_ready;
+extern uint8_t adc12_data_ready;
#ifdef __cplusplus
}
diff --git a/cpu/cc430/include/cc430_regs.h b/cpu/cc430/include/cc430_regs.h
index 0bcf2bd7a..b4b37decf 100644
--- a/cpu/cc430/include/cc430_regs.h
+++ b/cpu/cc430/include/cc430_regs.h
@@ -41,13 +41,13 @@ extern "C" {
* @brief Timer module registers
*/
typedef struct {
- REG16 CTL; /**< timer control */
- REG16 CCTL[7]; /**< capture compare channel control */
- REG16 R; /**< current counter value */
- REG16 CCR[7]; /**< capture compare channel values */
- REG16 reserved[7]; /**< reserved */
- REG16 IV; /**< interrupt vector */
- REG16 EX0; /**< expansion 0 */
+ REG16 CTL; /**< timer control */
+ REG16 CCTL[7]; /**< capture compare channel control */
+ REG16 R; /**< current counter value */
+ REG16 CCR[7]; /**< capture compare channel values */
+ REG16 reserved[7]; /**< reserved */
+ REG16 IV; /**< interrupt vector */
+ REG16 EX0; /**< expansion 0 */
} msp_timer_t;
/**
diff --git a/cpu/cc430/periph/rtc.c b/cpu/cc430/periph/rtc.c
index 5337c4bf5..1f406b5d0 100644
--- a/cpu/cc430/periph/rtc.c
+++ b/cpu/cc430/periph/rtc.c
@@ -66,14 +66,14 @@ int rtc_set_time(struct tm *localt)
}
/*---------------------------------------------------------------------------
-time_t rtc_time(void) {
+ time_t rtc_time(void) {
time_t sec;
struct tm t;
rtc_get_localtime(&t);
sec = mktime(&t);
return sec;
-}
-*/
+ }
+ */
int rtc_get_time(struct tm *localt)
{
@@ -160,14 +160,14 @@ int rtc_set_alarm(struct tm *localt, rtc_alarm_cb_t cb, void *arg)
int rtc_get_alarm(struct tm *localt)
{
- if (localt != NULL) {
+ if (localt != NULL) {
localt->tm_sec = -1;
localt->tm_min = RTCAMIN;
localt->tm_hour = RTCAHOUR;
localt->tm_mday = -1;
localt->tm_wday = RTCADOW;
localt->tm_yday = -1;
- localt->tm_mon = - 1;
+ localt->tm_mon = -1;
localt->tm_year = -1;
localt->tm_isdst = -1; /* not available */
diff --git a/cpu/cortexm_common/cortexm_init.c b/cpu/cortexm_common/cortexm_init.c
index 8beebaea2..c884d04b6 100644
--- a/cpu/cortexm_common/cortexm_init.c
+++ b/cpu/cortexm_common/cortexm_init.c
@@ -40,7 +40,7 @@ void cortexm_init(void)
#endif
/* configure the vector table location to internal flash */
-#if defined(CPU_ARCH_CORTEX_M3) || defined(CPU_ARCH_CORTEX_M4) || \
+#if defined(CPU_ARCH_CORTEX_M3) || defined(CPU_ARCH_CORTEX_M4) || \
defined(CPU_ARCH_CORTEX_M4F) || defined(CPU_ARCH_CORTEX_M7) || \
(defined(CPU_ARCH_CORTEX_M0PLUS) && (__VTOR_PRESENT == 1))
SCB->VTOR = (uint32_t)&_isr_vectors;
diff --git a/cpu/cortexm_common/include/bit.h b/cpu/cortexm_common/include/bit.h
index a4c34ac7d..84feb43b9 100644
--- a/cpu/cortexm_common/include/bit.h
+++ b/cpu/cortexm_common/include/bit.h
@@ -62,7 +62,7 @@ extern "C" {
static inline volatile void *bitband_addr(volatile void *ptr, uintptr_t bit)
{
return (volatile void *)((((uintptr_t)ptr) & 0xF0000000ul) + 0x2000000ul +
- ((((uintptr_t)ptr) & 0xFFFFFul) << 5) + (bit << 2));
+ ((((uintptr_t)ptr) & 0xFFFFFul) << 5) + (bit << 2));
}
/**
diff --git a/cpu/cortexm_common/include/cpu.h b/cpu/cortexm_common/include/cpu.h
index 48e355ea2..6d77c8c8c 100644
--- a/cpu/cortexm_common/include/cpu.h
+++ b/cpu/cortexm_common/include/cpu.h
@@ -74,7 +74,7 @@ void cortexm_init(void);
static inline void cpu_print_last_instruction(void)
{
uint32_t *lr_ptr;
- __asm__ __volatile__("mov %0, lr" : "=r"(lr_ptr));
+ __asm__ __volatile__ ("mov %0, lr" : "=r" (lr_ptr));
printf("%p\n", (void*) lr_ptr);
}
diff --git a/cpu/cortexm_common/include/mpu.h b/cpu/cortexm_common/include/mpu.h
index b93f22d49..ddf1dc7f3 100644
--- a/cpu/cortexm_common/include/mpu.h
+++ b/cpu/cortexm_common/include/mpu.h
@@ -111,12 +111,12 @@ static inline uint32_t MPU_ATTR(
uint32_t size)
{
return
- (xn << 28) |
- (ap << 24) |
- (tex << 19) |
- (s << 18) |
- (c << 17) |
- (b << 16) |
+ (xn << 28) |
+ (ap << 24) |
+ (tex << 19) |
+ (s << 18) |
+ (c << 17) |
+ (b << 16) |
(size << 1);
}
diff --git a/cpu/cortexm_common/panic.c b/cpu/cortexm_common/panic.c
index af158b3de..52b3034f3 100644
--- a/cpu/cortexm_common/panic.c
+++ b/cpu/cortexm_common/panic.c
@@ -40,6 +40,6 @@ void panic_arch(void)
#ifdef DEVELHELP
print_ipsr();
/* The bkpt instruction will signal to the debugger to break here. */
- __asm__("bkpt #0");
+ __asm__ ("bkpt #0");
#endif
}
diff --git a/cpu/cortexm_common/thread_arch.c b/cpu/cortexm_common/thread_arch.c
index 7523e45a4..0065e9615 100644
--- a/cpu/cortexm_common/thread_arch.c
+++ b/cpu/cortexm_common/thread_arch.c
@@ -124,9 +124,9 @@ extern uint32_t _sstack;
#define EXCEPT_RET_TASK_MODE (0xfffffffd)
char *thread_stack_init(thread_task_func_t task_func,
- void *arg,
- void *stack_start,
- int stack_size)
+ void *arg,
+ void *stack_start,
+ int stack_size)
{
uint32_t *stk;
stk = (uint32_t *)((uintptr_t)stack_start + stack_size);
@@ -151,17 +151,17 @@ char *thread_stack_init(thread_task_func_t task_func,
#if defined(CPU_ARCH_CORTEX_M4F) || (CPU_ARCH_CORTEX_M7)
/* TODO: fix FPU handling for Cortex-M4f */
/*
- stk--;
- *stk = (unsigned int) 0;
- */
+ stk--;
+ * stk = (unsigned int) 0;
+ */
/* S0 - S15 */
/*
- for (int i = 15; i >= 0; i--) {
+ for (int i = 15; i >= 0; i--) {
stk--;
- *stk = i;
- }
- */
+ * stk = i;
+ }
+ */
#endif
/* ****************************** */
@@ -280,12 +280,12 @@ void *thread_isr_stack_start(void)
__attribute__((naked)) void NORETURN cpu_switch_context_exit(void)
{
__asm__ volatile (
- "bl irq_enable \n" /* enable IRQs to make the SVC
- * interrupt is reachable */
- "svc #1 \n" /* trigger the SVC interrupt */
- "unreachable%=: \n" /* this loop is unreachable */
- "b unreachable%= \n" /* loop indefinitely */
- :::);
+ "bl irq_enable \n" /* enable IRQs to make the SVC
+ * interrupt is reachable */
+ "svc #1 \n" /* trigger the SVC interrupt */
+ "unreachable%=: \n" /* this loop is unreachable */
+ "b unreachable%= \n" /* loop indefinitely */
+ :::);
}
void thread_yield_higher(void)
@@ -297,81 +297,81 @@ void thread_yield_higher(void)
void __attribute__((naked)) __attribute__((used)) isr_pendsv(void) {
__asm__ volatile (
- /* PendSV handler entry point */
- /* save context by pushing unsaved registers to the stack */
- /* {r0-r3,r12,LR,PC,xPSR} are saved automatically on exception entry */
- ".thumb_func \n"
- "mrs r0, psp \n" /* get stack pointer from user mode */
+ /* PendSV handler entry point */
+ /* save context by pushing unsaved registers to the stack */
+ /* {r0-r3,r12,LR,PC,xPSR} are saved automatically on exception entry */
+ ".thumb_func \n"
+ "mrs r0, psp \n" /* get stack pointer from user mode */
#if defined(CPU_ARCH_CORTEX_M0) || defined(CPU_ARCH_CORTEX_M0PLUS)
- "mov r12, sp \n" /* remember the exception SP */
- "mov sp, r0 \n" /* set user mode SP as active SP */
- /* we can not push high registers directly, so we move R11-R8 into
- * R4-R0, as these are already saved */
- "mov r0, r8 \n" /* move R11-R8 into R3-R0 */
- "mov r1, r9 \n"
- "mov r2, r10 \n"
- "mov r3, r11 \n"
- "push {r0-r7} \n" /* now push them onto the stack */
- "mov r0, lr \n" /* next we save the link register */
- "push {r0} \n"
- "mov r0, sp \n" /* switch back to the exception SP */
- "mov sp, r12 \n"
+ "mov r12, sp \n" /* remember the exception SP */
+ "mov sp, r0 \n" /* set user mode SP as active SP */
+ /* we can not push high registers directly, so we move R11-R8 into
+ * R4-R0, as these are already saved */
+ "mov r0, r8 \n" /* move R11-R8 into R3-R0 */
+ "mov r1, r9 \n"
+ "mov r2, r10 \n"
+ "mov r3, r11 \n"
+ "push {r0-r7} \n" /* now push them onto the stack */
+ "mov r0, lr \n" /* next we save the link register */
+ "push {r0} \n"
+ "mov r0, sp \n" /* switch back to the exception SP */
+ "mov sp, r12 \n"
#else
- "stmdb r0!,{r4-r11} \n" /* save regs */
- "stmdb r0!,{lr} \n" /* exception return value */
+ "stmdb r0!,{r4-r11} \n" /* save regs */
+ "stmdb r0!,{lr} \n" /* exception return value */
#if defined(CPU_ARCH_CORTEX_M4F) || defined(CPU_ARCH_CORTEX_M7)
/* "vstmdb sp!, {s16-s31} \n" */ /* TODO save FPU registers */
#endif
#endif
- "ldr r1, =sched_active_thread \n" /* load address of current tcb */
- "ldr r1, [r1] \n" /* dereference pdc */
- "str r0, [r1] \n" /* write r0 to pdc->sp */
- "bl isr_svc \n" /* continue with svc */
- );
+ "ldr r1, =sched_active_thread \n" /* load address of current tcb */
+ "ldr r1, [r1] \n" /* dereference pdc */
+ "str r0, [r1] \n" /* write r0 to pdc->sp */
+ "bl isr_svc \n" /* continue with svc */
+ );
}
void __attribute__((naked)) __attribute__((used)) isr_svc(void) {
__asm__ volatile (
- /* SVC handler entry point */
- /* PendSV will continue here as well (via jump) */
- ".thumb_func \n"
- /* perform scheduling */
- "bl sched_run \n"
- /* restore context and return from exception */
- ".thumb_func \n"
- "context_restore: \n"
+ /* SVC handler entry point */
+ /* PendSV will continue here as well (via jump) */
+ ".thumb_func \n"
+ /* perform scheduling */
+ "bl sched_run \n"
+ /* restore context and return from exception */
+ ".thumb_func \n"
+ "context_restore: \n"
#if defined(CPU_ARCH_CORTEX_M0) || defined(CPU_ARCH_CORTEX_M0PLUS)
- "mov lr, sp \n" /* save MSR stack pointer for later */
- "ldr r0, =sched_active_thread \n" /* load address of current TCB */
- "ldr r0, [r0] \n" /* dereference TCB */
- "ldr r0, [r0] \n" /* load tcb-sp to R0 */
- "mov sp, r0 \n" /* make user mode SP active SP */
- "pop {r0} \n" /* restore LR from stack */
- "mov r12, r0 \n" /* remember LR by parking it in R12 */
- "pop {r0-r7} \n" /* get R11-R8 and R7-R4 from stack */
- "mov r8, r0 \n" /* move R11-R8 to correct registers */
- "mov r9, r1 \n"
- "mov r10, r2 \n"
- "mov r11, r3 \n"
- /* restore the application mode stack pointer PSP */
- "mov r0, sp \n" /* restore the user mode SP */
- "msr psp, r0 \n" /* for this write it to the PSP reg */
- "mov sp, lr \n" /* and get the parked MSR SP back */
- /* return from exception mode to application mode */
- "bx r12 \n" /* return from exception mode */
+ "mov lr, sp \n" /* save MSR stack pointer for later */
+ "ldr r0, =sched_active_thread \n" /* load address of current TCB */
+ "ldr r0, [r0] \n" /* dereference TCB */
+ "ldr r0, [r0] \n" /* load tcb-sp to R0 */
+ "mov sp, r0 \n" /* make user mode SP active SP */
+ "pop {r0} \n" /* restore LR from stack */
+ "mov r12, r0 \n" /* remember LR by parking it in R12 */
+ "pop {r0-r7} \n" /* get R11-R8 and R7-R4 from stack */
+ "mov r8, r0 \n" /* move R11-R8 to correct registers */
+ "mov r9, r1 \n"
+ "mov r10, r2 \n"
+ "mov r11, r3 \n"
+ /* restore the application mode stack pointer PSP */
+ "mov r0, sp \n" /* restore the user mode SP */
+ "msr psp, r0 \n" /* for this write it to the PSP reg */
+ "mov sp, lr \n" /* and get the parked MSR SP back */
+ /* return from exception mode to application mode */
+ "bx r12 \n" /* return from exception mode */
#else
- "ldr r0, =sched_active_thread \n" /* load address of current TCB */
- "ldr r0, [r0] \n" /* dereference TCB */
- "ldr r1, [r0] \n" /* load tcb->sp to register 1 */
- "ldmia r1!, {r0} \n" /* restore exception return value */
+ "ldr r0, =sched_active_thread \n" /* load address of current TCB */
+ "ldr r0, [r0] \n" /* dereference TCB */
+ "ldr r1, [r0] \n" /* load tcb->sp to register 1 */
+ "ldmia r1!, {r0} \n" /* restore exception return value */
#if defined(CPU_ARCH_CORTEX_M4F) || defined(CPU_ARCH_CORTEX_M7)
/* "pop {s16-s31} \n" */ /* TODO load FPU registers */
#endif
- "ldmia r1!, {r4-r11} \n" /* restore other registers */
- "msr psp, r1 \n" /* restore user mode SP to PSP reg */
- "bx r0 \n" /* load exception return value to PC,
- * causes end of exception*/
+ "ldmia r1!, {r4-r11} \n" /* restore other registers */
+ "msr psp, r1 \n" /* restore user mode SP to PSP reg */
+ "bx r0 \n" /* load exception return value to PC,
+ * causes end of exception*/
#endif
- /* {r0-r3,r12,LR,PC,xPSR} are restored automatically on exception return */
- );
+ /* {r0-r3,r12,LR,PC,xPSR} are restored automatically on exception return */
+ );
}
diff --git a/cpu/cortexm_common/vectors_cortexm.c b/cpu/cortexm_common/vectors_cortexm.c
index 3cab67df2..203ea377c 100644
--- a/cpu/cortexm_common/vectors_cortexm.c
+++ b/cpu/cortexm_common/vectors_cortexm.c
@@ -105,7 +105,7 @@ void reset_handler_default(void)
0, /* MPU region 0 */
(uintptr_t)&_sstack + 31, /* Base Address (rounded up) */
MPU_ATTR(1, AP_RO_RO, 0, 1, 0, 1, MPU_SIZE_32B) /* Attributes and Size */
- );
+ );
mpu_enable();
}
@@ -193,11 +193,11 @@ __attribute__((naked)) void hard_fault_default(void)
#endif
"mov r3, sp \n" /* r4_to_r11_stack parameter */
"bl hard_fault_handler \n" /* hard_fault_handler(r0) */
- :
- : [sram] "r" (&_sram + HARDFAULT_HANDLER_REQUIRED_STACK_SPACE),
- [eram] "r" (&_eram),
- [estack] "r" (&_estack)
- : "r0","r4","r5","r6","r8","r9","r10","r11","lr"
+ :
+ : [sram] "r" (&_sram + HARDFAULT_HANDLER_REQUIRED_STACK_SPACE),
+ [eram] "r" (&_eram),
+ [estack] "r" (&_estack)
+ : "r0","r4","r5","r6","r8","r9","r10","r11","lr"
);
}
@@ -243,13 +243,13 @@ __attribute__((used)) void hard_fault_handler(uint32_t* sp, uint32_t corrupted,
puts("Stack pointer corrupted, reset to top of stack");
}
else {
- uint32_t r0 = sp[0];
- uint32_t r1 = sp[1];
- uint32_t r2 = sp[2];
- uint32_t r3 = sp[3];
+ uint32_t r0 = sp[0];
+ uint32_t r1 = sp[1];
+ uint32_t r2 = sp[2];
+ uint32_t r3 = sp[3];
uint32_t r12 = sp[4];
- uint32_t lr = sp[5]; /* Link register. */
- pc = sp[6]; /* Program counter. */
+ uint32_t lr = sp[5]; /* Link register. */
+ pc = sp[6]; /* Program counter. */
uint32_t psr = sp[7]; /* Program status register. */
/* Reconstruct original stack pointer before fault occurred */
@@ -322,8 +322,8 @@ __attribute__((used)) void hard_fault_handler(uint32_t* sp, uint32_t corrupted,
"ldr r0, [r0, #0]\n"
:
: [sp] "r" (sp),
- [orig_sp] "r" (orig_sp),
- [extra_stack] "r" (r4_to_r11_stack)
+ [orig_sp] "r" (orig_sp),
+ [extra_stack] "r" (r4_to_r11_stack)
: "r0","r1","r2","r3","r12"
);
}
@@ -393,7 +393,7 @@ ISR_VECTOR(0) const cortexm_base_t cortex_vector_base = {
/* additional vectors used by M3, M4(F), and M7 */
#if defined(CPU_ARCH_CORTEX_M3) || defined(CPU_ARCH_CORTEX_M4) || \
- defined(CPU_ARCH_CORTEX_M4F) || defined(CPU_ARCH_CORTEX_M7)
+ defined(CPU_ARCH_CORTEX_M4F) || defined(CPU_ARCH_CORTEX_M7)
/* [-12] memory manage exception */
[ 3] = mem_manage_default,
/* [-11] bus fault exception */
diff --git a/cpu/efm32/families/efm32gg/system.c b/cpu/efm32/families/efm32gg/system.c
index 54883cf81..1ed77bdf7 100644
--- a/cpu/efm32/families/efm32gg/system.c
+++ b/cpu/efm32/families/efm32gg/system.c
@@ -86,8 +86,8 @@ static uint32_t SystemLFXOClock = EFM32_LFXO_FREQ;
/* Inline function to get the chip's Production Revision. */
__STATIC_INLINE uint8_t GetProdRev(void)
{
- return (uint8_t)((DEVINFO->PART & _DEVINFO_PART_PROD_REV_MASK)
- >> _DEVINFO_PART_PROD_REV_SHIFT);
+ return (uint8_t)((DEVINFO->PART & _DEVINFO_PART_PROD_REV_MASK)
+ >> _DEVINFO_PART_PROD_REV_SHIFT);
}
/*******************************************************************************
@@ -126,16 +126,16 @@ uint32_t SystemCoreClock = 14000000UL;
******************************************************************************/
uint32_t SystemCoreClockGet(void)
{
- uint32_t ret;
+ uint32_t ret;
- ret = SystemHFClockGet();
- ret >>= (CMU->HFCORECLKDIV & _CMU_HFCORECLKDIV_HFCORECLKDIV_MASK)
- >> _CMU_HFCORECLKDIV_HFCORECLKDIV_SHIFT;
+ ret = SystemHFClockGet();
+ ret >>= (CMU->HFCORECLKDIV & _CMU_HFCORECLKDIV_HFCORECLKDIV_MASK)
+ >> _CMU_HFCORECLKDIV_HFCORECLKDIV_SHIFT;
- /* Keep CMSIS variable up-to-date just in case */
- SystemCoreClock = ret;
+ /* Keep CMSIS variable up-to-date just in case */
+ SystemCoreClock = ret;
- return ret;
+ return ret;
}
/***************************************************************************//**
@@ -151,9 +151,9 @@ uint32_t SystemCoreClockGet(void)
uint32_t SystemMaxCoreClockGet(void)
{
#if (EFM32_HFRCO_MAX_FREQ > EFM32_HFXO_FREQ)
- return EFM32_HFRCO_MAX_FREQ;
+ return EFM32_HFRCO_MAX_FREQ;
#else
- return EFM32_HFXO_FREQ;
+ return EFM32_HFXO_FREQ;
#endif
}
@@ -169,77 +169,77 @@ uint32_t SystemMaxCoreClockGet(void)
******************************************************************************/
uint32_t SystemHFClockGet(void)
{
- uint32_t ret;
+ uint32_t ret;
- switch (CMU->STATUS & (CMU_STATUS_HFRCOSEL | CMU_STATUS_HFXOSEL
- | CMU_STATUS_LFRCOSEL | CMU_STATUS_LFXOSEL)) {
- case CMU_STATUS_LFXOSEL:
+ switch (CMU->STATUS & (CMU_STATUS_HFRCOSEL | CMU_STATUS_HFXOSEL
+ | CMU_STATUS_LFRCOSEL | CMU_STATUS_LFXOSEL)) {
+ case CMU_STATUS_LFXOSEL:
#if (EFM32_LFXO_FREQ > 0)
- ret = SystemLFXOClock;
+ ret = SystemLFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
+ break;
- case CMU_STATUS_LFRCOSEL:
- ret = EFM32_LFRCO_FREQ;
- break;
+ case CMU_STATUS_LFRCOSEL:
+ ret = EFM32_LFRCO_FREQ;
+ break;
- case CMU_STATUS_HFXOSEL:
+ case CMU_STATUS_HFXOSEL:
#if (EFM32_HFXO_FREQ > 0)
- ret = SystemHFXOClock;
+ ret = SystemHFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
-
- default: /* CMU_STATUS_HFRCOSEL */
- switch (CMU->HFRCOCTRL & _CMU_HFRCOCTRL_BAND_MASK) {
- case CMU_HFRCOCTRL_BAND_28MHZ:
- ret = 28000000U;
- break;
-
- case CMU_HFRCOCTRL_BAND_21MHZ:
- ret = 21000000U;
- break;
-
- case CMU_HFRCOCTRL_BAND_14MHZ:
- ret = 14000000U;
- break;
-
- case CMU_HFRCOCTRL_BAND_11MHZ:
- ret = 11000000U;
- break;
-
- case CMU_HFRCOCTRL_BAND_7MHZ:
- if ( GetProdRev() >= 19U ) {
- ret = 6600000U;
- } else {
- ret = 7000000U;
- }
- break;
-
- case CMU_HFRCOCTRL_BAND_1MHZ:
- if ( GetProdRev() >= 19U ) {
- ret = 1200000U;
- } else {
- ret = 1000000U;
- }
- break;
-
- default:
- ret = 0;
- break;
- }
- break;
- }
-
- return ret / (1U + ((CMU->CTRL & _CMU_CTRL_HFCLKDIV_MASK)
- >> _CMU_CTRL_HFCLKDIV_SHIFT));
+ break;
+
+ default: /* CMU_STATUS_HFRCOSEL */
+ switch (CMU->HFRCOCTRL & _CMU_HFRCOCTRL_BAND_MASK) {
+ case CMU_HFRCOCTRL_BAND_28MHZ:
+ ret = 28000000U;
+ break;
+
+ case CMU_HFRCOCTRL_BAND_21MHZ:
+ ret = 21000000U;
+ break;
+
+ case CMU_HFRCOCTRL_BAND_14MHZ:
+ ret = 14000000U;
+ break;
+
+ case CMU_HFRCOCTRL_BAND_11MHZ:
+ ret = 11000000U;
+ break;
+
+ case CMU_HFRCOCTRL_BAND_7MHZ:
+ if ( GetProdRev() >= 19U ) {
+ ret = 6600000U;
+ } else {
+ ret = 7000000U;
+ }
+ break;
+
+ case CMU_HFRCOCTRL_BAND_1MHZ:
+ if ( GetProdRev() >= 19U ) {
+ ret = 1200000U;
+ } else {
+ ret = 1000000U;
+ }
+ break;
+
+ default:
+ ret = 0;
+ break;
+ }
+ break;
+ }
+
+ return ret / (1U + ((CMU->CTRL & _CMU_CTRL_HFCLKDIV_MASK)
+ >> _CMU_CTRL_HFCLKDIV_SHIFT));
}
/**************************************************************************//**
@@ -254,11 +254,11 @@ uint32_t SystemHFClockGet(void)
*****************************************************************************/
uint32_t SystemHFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_HFXO_FREQ > 0)
- return SystemHFXOClock;
+ return SystemHFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -279,17 +279,17 @@ uint32_t SystemHFXOClockGet(void)
*****************************************************************************/
void SystemHFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_HFXO_FREQ > 0)
- SystemHFXOClock = freq;
+ SystemHFXOClock = freq;
- /* Update core clock frequency if HFXO is used to clock core */
- if ((CMU->STATUS & CMU_STATUS_HFXOSEL) != 0U) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ /* Update core clock frequency if HFXO is used to clock core */
+ if ((CMU->STATUS & CMU_STATUS_HFXOSEL) != 0U) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
@@ -321,10 +321,10 @@ void SystemInit(void)
*****************************************************************************/
uint32_t SystemLFRCOClockGet(void)
{
- /* Currently we assume that this frequency is properly tuned during */
- /* manufacturing and is not changed after reset. If future requirements */
- /* for re-tuning by user, we can add support for that. */
- return EFM32_LFRCO_FREQ;
+ /* Currently we assume that this frequency is properly tuned during */
+ /* manufacturing and is not changed after reset. If future requirements */
+ /* for re-tuning by user, we can add support for that. */
+ return EFM32_LFRCO_FREQ;
}
/**************************************************************************//**
@@ -339,8 +339,8 @@ uint32_t SystemLFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemULFRCOClockGet(void)
{
- /* The ULFRCO frequency is not tuned, and can be very inaccurate */
- return EFM32_ULFRCO_FREQ;
+ /* The ULFRCO frequency is not tuned, and can be very inaccurate */
+ return EFM32_ULFRCO_FREQ;
}
/**************************************************************************//**
@@ -355,11 +355,11 @@ uint32_t SystemULFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemLFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_LFXO_FREQ > 0)
- return SystemLFXOClock;
+ return SystemLFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -380,16 +380,16 @@ uint32_t SystemLFXOClockGet(void)
*****************************************************************************/
void SystemLFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_LFXO_FREQ > 0)
- SystemLFXOClock = freq;
+ SystemLFXOClock = freq;
- /* Update core clock frequency if LFXO is used to clock core */
- if ((CMU->STATUS & CMU_STATUS_LFXOSEL) != 0U) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ /* Update core clock frequency if LFXO is used to clock core */
+ if ((CMU->STATUS & CMU_STATUS_LFXOSEL) != 0U) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
diff --git a/cpu/efm32/families/efm32lg/system.c b/cpu/efm32/families/efm32lg/system.c
index b6b5ff511..3cc19b556 100644
--- a/cpu/efm32/families/efm32lg/system.c
+++ b/cpu/efm32/families/efm32lg/system.c
@@ -86,8 +86,8 @@ static uint32_t SystemLFXOClock = EFM32_LFXO_FREQ;
/* Inline function to get the chip's Production Revision. */
__STATIC_INLINE uint8_t GetProdRev(void)
{
- return (uint8_t)((DEVINFO->PART & _DEVINFO_PART_PROD_REV_MASK)
- >> _DEVINFO_PART_PROD_REV_SHIFT);
+ return (uint8_t)((DEVINFO->PART & _DEVINFO_PART_PROD_REV_MASK)
+ >> _DEVINFO_PART_PROD_REV_SHIFT);
}
/*******************************************************************************
@@ -126,16 +126,16 @@ uint32_t SystemCoreClock = 14000000UL;
******************************************************************************/
uint32_t SystemCoreClockGet(void)
{
- uint32_t ret;
+ uint32_t ret;
- ret = SystemHFClockGet();
- ret >>= (CMU->HFCORECLKDIV & _CMU_HFCORECLKDIV_HFCORECLKDIV_MASK)
- >> _CMU_HFCORECLKDIV_HFCORECLKDIV_SHIFT;
+ ret = SystemHFClockGet();
+ ret >>= (CMU->HFCORECLKDIV & _CMU_HFCORECLKDIV_HFCORECLKDIV_MASK)
+ >> _CMU_HFCORECLKDIV_HFCORECLKDIV_SHIFT;
- /* Keep CMSIS variable up-to-date just in case */
- SystemCoreClock = ret;
+ /* Keep CMSIS variable up-to-date just in case */
+ SystemCoreClock = ret;
- return ret;
+ return ret;
}
/***************************************************************************//**
@@ -151,9 +151,9 @@ uint32_t SystemCoreClockGet(void)
uint32_t SystemMaxCoreClockGet(void)
{
#if (EFM32_HFRCO_MAX_FREQ > EFM32_HFXO_FREQ)
- return EFM32_HFRCO_MAX_FREQ;
+ return EFM32_HFRCO_MAX_FREQ;
#else
- return EFM32_HFXO_FREQ;
+ return EFM32_HFXO_FREQ;
#endif
}
@@ -169,77 +169,77 @@ uint32_t SystemMaxCoreClockGet(void)
******************************************************************************/
uint32_t SystemHFClockGet(void)
{
- uint32_t ret;
+ uint32_t ret;
- switch (CMU->STATUS & (CMU_STATUS_HFRCOSEL | CMU_STATUS_HFXOSEL
- | CMU_STATUS_LFRCOSEL | CMU_STATUS_LFXOSEL)) {
- case CMU_STATUS_LFXOSEL:
+ switch (CMU->STATUS & (CMU_STATUS_HFRCOSEL | CMU_STATUS_HFXOSEL
+ | CMU_STATUS_LFRCOSEL | CMU_STATUS_LFXOSEL)) {
+ case CMU_STATUS_LFXOSEL:
#if (EFM32_LFXO_FREQ > 0)
- ret = SystemLFXOClock;
+ ret = SystemLFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
+ break;
- case CMU_STATUS_LFRCOSEL:
- ret = EFM32_LFRCO_FREQ;
- break;
+ case CMU_STATUS_LFRCOSEL:
+ ret = EFM32_LFRCO_FREQ;
+ break;
- case CMU_STATUS_HFXOSEL:
+ case CMU_STATUS_HFXOSEL:
#if (EFM32_HFXO_FREQ > 0)
- ret = SystemHFXOClock;
+ ret = SystemHFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
-
- default: /* CMU_STATUS_HFRCOSEL */
- switch (CMU->HFRCOCTRL & _CMU_HFRCOCTRL_BAND_MASK) {
- case CMU_HFRCOCTRL_BAND_28MHZ:
- ret = 28000000U;
- break;
-
- case CMU_HFRCOCTRL_BAND_21MHZ:
- ret = 21000000U;
- break;
-
- case CMU_HFRCOCTRL_BAND_14MHZ:
- ret = 14000000U;
- break;
-
- case CMU_HFRCOCTRL_BAND_11MHZ:
- ret = 11000000U;
- break;
-
- case CMU_HFRCOCTRL_BAND_7MHZ:
- if ( GetProdRev() >= 19U ) {
- ret = 6600000U;
- } else {
- ret = 7000000U;
- }
- break;
-
- case CMU_HFRCOCTRL_BAND_1MHZ:
- if ( GetProdRev() >= 19U ) {
- ret = 1200000U;
- } else {
- ret = 1000000U;
- }
- break;
-
- default:
- ret = 0;
- break;
- }
- break;
- }
-
- return ret / (1U + ((CMU->CTRL & _CMU_CTRL_HFCLKDIV_MASK)
- >> _CMU_CTRL_HFCLKDIV_SHIFT));
+ break;
+
+ default: /* CMU_STATUS_HFRCOSEL */
+ switch (CMU->HFRCOCTRL & _CMU_HFRCOCTRL_BAND_MASK) {
+ case CMU_HFRCOCTRL_BAND_28MHZ:
+ ret = 28000000U;
+ break;
+
+ case CMU_HFRCOCTRL_BAND_21MHZ:
+ ret = 21000000U;
+ break;
+
+ case CMU_HFRCOCTRL_BAND_14MHZ:
+ ret = 14000000U;
+ break;
+
+ case CMU_HFRCOCTRL_BAND_11MHZ:
+ ret = 11000000U;
+ break;
+
+ case CMU_HFRCOCTRL_BAND_7MHZ:
+ if ( GetProdRev() >= 19U ) {
+ ret = 6600000U;
+ } else {
+ ret = 7000000U;
+ }
+ break;
+
+ case CMU_HFRCOCTRL_BAND_1MHZ:
+ if ( GetProdRev() >= 19U ) {
+ ret = 1200000U;
+ } else {
+ ret = 1000000U;
+ }
+ break;
+
+ default:
+ ret = 0;
+ break;
+ }
+ break;
+ }
+
+ return ret / (1U + ((CMU->CTRL & _CMU_CTRL_HFCLKDIV_MASK)
+ >> _CMU_CTRL_HFCLKDIV_SHIFT));
}
/**************************************************************************//**
@@ -254,11 +254,11 @@ uint32_t SystemHFClockGet(void)
*****************************************************************************/
uint32_t SystemHFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_HFXO_FREQ > 0)
- return SystemHFXOClock;
+ return SystemHFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -279,17 +279,17 @@ uint32_t SystemHFXOClockGet(void)
*****************************************************************************/
void SystemHFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_HFXO_FREQ > 0)
- SystemHFXOClock = freq;
+ SystemHFXOClock = freq;
- /* Update core clock frequency if HFXO is used to clock core */
- if ((CMU->STATUS & CMU_STATUS_HFXOSEL) != 0U) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ /* Update core clock frequency if HFXO is used to clock core */
+ if ((CMU->STATUS & CMU_STATUS_HFXOSEL) != 0U) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
@@ -321,10 +321,10 @@ void SystemInit(void)
*****************************************************************************/
uint32_t SystemLFRCOClockGet(void)
{
- /* Currently we assume that this frequency is properly tuned during */
- /* manufacturing and is not changed after reset. If future requirements */
- /* for re-tuning by user, we can add support for that. */
- return EFM32_LFRCO_FREQ;
+ /* Currently we assume that this frequency is properly tuned during */
+ /* manufacturing and is not changed after reset. If future requirements */
+ /* for re-tuning by user, we can add support for that. */
+ return EFM32_LFRCO_FREQ;
}
/**************************************************************************//**
@@ -339,8 +339,8 @@ uint32_t SystemLFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemULFRCOClockGet(void)
{
- /* The ULFRCO frequency is not tuned, and can be very inaccurate */
- return EFM32_ULFRCO_FREQ;
+ /* The ULFRCO frequency is not tuned, and can be very inaccurate */
+ return EFM32_ULFRCO_FREQ;
}
/**************************************************************************//**
@@ -355,11 +355,11 @@ uint32_t SystemULFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemLFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_LFXO_FREQ > 0)
- return SystemLFXOClock;
+ return SystemLFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -380,16 +380,16 @@ uint32_t SystemLFXOClockGet(void)
*****************************************************************************/
void SystemLFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_LFXO_FREQ > 0)
- SystemLFXOClock = freq;
+ SystemLFXOClock = freq;
- /* Update core clock frequency if LFXO is used to clock core */
- if ((CMU->STATUS & CMU_STATUS_LFXOSEL) != 0U) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ /* Update core clock frequency if LFXO is used to clock core */
+ if ((CMU->STATUS & CMU_STATUS_LFXOSEL) != 0U) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
diff --git a/cpu/efm32/families/efm32pg1b/system.c b/cpu/efm32/families/efm32pg1b/system.c
index f0fbaa04e..1cfd82f8a 100644
--- a/cpu/efm32/families/efm32pg1b/system.c
+++ b/cpu/efm32/families/efm32pg1b/system.c
@@ -137,18 +137,18 @@ uint32_t SystemHfrcoFreq = EFM32_HFRCO_STARTUP_FREQ;
******************************************************************************/
uint32_t SystemCoreClockGet(void)
{
- uint32_t ret;
- uint32_t presc;
+ uint32_t ret;
+ uint32_t presc;
- ret = SystemHFClockGet();
- presc = (CMU->HFCOREPRESC & _CMU_HFCOREPRESC_PRESC_MASK)
- >> _CMU_HFCOREPRESC_PRESC_SHIFT;
- ret /= presc + 1U;
+ ret = SystemHFClockGet();
+ presc = (CMU->HFCOREPRESC & _CMU_HFCOREPRESC_PRESC_MASK)
+ >> _CMU_HFCOREPRESC_PRESC_SHIFT;
+ ret /= presc + 1U;
- /* Keep CMSIS system clock variable up-to-date */
- SystemCoreClock = ret;
+ /* Keep CMSIS system clock variable up-to-date */
+ SystemCoreClock = ret;
- return ret;
+ return ret;
}
/***************************************************************************//**
@@ -164,9 +164,9 @@ uint32_t SystemCoreClockGet(void)
uint32_t SystemMaxCoreClockGet(void)
{
#if (EFM32_HFRCO_MAX_FREQ > EFM32_HFXO_FREQ)
- return EFM32_HFRCO_MAX_FREQ;
+ return EFM32_HFRCO_MAX_FREQ;
#else
- return EFM32_HFXO_FREQ;
+ return EFM32_HFXO_FREQ;
#endif
}
@@ -182,40 +182,40 @@ uint32_t SystemMaxCoreClockGet(void)
******************************************************************************/
uint32_t SystemHFClockGet(void)
{
- uint32_t ret;
+ uint32_t ret;
- switch (CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK) {
- case CMU_HFCLKSTATUS_SELECTED_LFXO:
+ switch (CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK) {
+ case CMU_HFCLKSTATUS_SELECTED_LFXO:
#if (EFM32_LFXO_FREQ > 0)
- ret = SystemLFXOClock;
+ ret = SystemLFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
+ break;
- case CMU_HFCLKSTATUS_SELECTED_LFRCO:
- ret = EFM32_LFRCO_FREQ;
- break;
+ case CMU_HFCLKSTATUS_SELECTED_LFRCO:
+ ret = EFM32_LFRCO_FREQ;
+ break;
- case CMU_HFCLKSTATUS_SELECTED_HFXO:
+ case CMU_HFCLKSTATUS_SELECTED_HFXO:
#if (EFM32_HFXO_FREQ > 0)
- ret = SystemHFXOClock;
+ ret = SystemHFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
+ break;
- default: /* CMU_HFCLKSTATUS_SELECTED_HFRCO */
- ret = SystemHfrcoFreq;
- break;
- }
+ default: /* CMU_HFCLKSTATUS_SELECTED_HFRCO */
+ ret = SystemHfrcoFreq;
+ break;
+ }
- return ret / (1U + ((CMU->HFPRESC & _CMU_HFPRESC_PRESC_MASK)
- >> _CMU_HFPRESC_PRESC_SHIFT));
+ return ret / (1U + ((CMU->HFPRESC & _CMU_HFPRESC_PRESC_MASK)
+ >> _CMU_HFPRESC_PRESC_SHIFT));
}
/**************************************************************************//**
@@ -230,11 +230,11 @@ uint32_t SystemHFClockGet(void)
*****************************************************************************/
uint32_t SystemHFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_HFXO_FREQ > 0)
- return SystemHFXOClock;
+ return SystemHFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -255,18 +255,18 @@ uint32_t SystemHFXOClockGet(void)
*****************************************************************************/
void SystemHFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_HFXO_FREQ > 0)
- SystemHFXOClock = freq;
-
- /* Update core clock frequency if HFXO is used to clock core */
- if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
- == CMU_HFCLKSTATUS_SELECTED_HFXO) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ SystemHFXOClock = freq;
+
+ /* Update core clock frequency if HFXO is used to clock core */
+ if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
+ == CMU_HFCLKSTATUS_SELECTED_HFXO) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
@@ -285,9 +285,9 @@ void SystemHFXOClockSet(uint32_t freq)
void SystemInit(void)
{
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
- /* Set floating point coprosessor access mode. */
- SCB->CPACR |= ((3UL << 10 * 2) /* set CP10 Full Access */
- | (3UL << 11 * 2)); /* set CP11 Full Access */
+ /* Set floating point coprosessor access mode. */
+ SCB->CPACR |= ((3UL << 10 * 2) /* set CP10 Full Access */
+ | (3UL << 11 * 2)); /* set CP11 Full Access */
#endif
}
@@ -303,10 +303,10 @@ void SystemInit(void)
*****************************************************************************/
uint32_t SystemLFRCOClockGet(void)
{
- /* Currently we assume that this frequency is properly tuned during */
- /* manufacturing and is not changed after reset. If future requirements */
- /* for re-tuning by user, we can add support for that. */
- return EFM32_LFRCO_FREQ;
+ /* Currently we assume that this frequency is properly tuned during */
+ /* manufacturing and is not changed after reset. If future requirements */
+ /* for re-tuning by user, we can add support for that. */
+ return EFM32_LFRCO_FREQ;
}
/**************************************************************************//**
@@ -321,8 +321,8 @@ uint32_t SystemLFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemULFRCOClockGet(void)
{
- /* The ULFRCO frequency is not tuned, and can be very inaccurate */
- return EFM32_ULFRCO_FREQ;
+ /* The ULFRCO frequency is not tuned, and can be very inaccurate */
+ return EFM32_ULFRCO_FREQ;
}
/**************************************************************************//**
@@ -337,11 +337,11 @@ uint32_t SystemULFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemLFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_LFXO_FREQ > 0)
- return SystemLFXOClock;
+ return SystemLFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -362,17 +362,17 @@ uint32_t SystemLFXOClockGet(void)
*****************************************************************************/
void SystemLFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFM32_LFXO_FREQ > 0)
- SystemLFXOClock = freq;
-
- /* Update core clock frequency if LFXO is used to clock core */
- if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
- == CMU_HFCLKSTATUS_SELECTED_LFXO) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ SystemLFXOClock = freq;
+
+ /* Update core clock frequency if LFXO is used to clock core */
+ if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
+ == CMU_HFCLKSTATUS_SELECTED_LFXO) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
diff --git a/cpu/efm32/families/efr32mg12p/system.c b/cpu/efm32/families/efr32mg12p/system.c
index 3d9448a3d..2a94c6a8e 100644
--- a/cpu/efm32/families/efr32mg12p/system.c
+++ b/cpu/efm32/families/efr32mg12p/system.c
@@ -137,18 +137,18 @@ uint32_t SystemHfrcoFreq = EFR32_HFRCO_STARTUP_FREQ;
******************************************************************************/
uint32_t SystemCoreClockGet(void)
{
- uint32_t ret;
- uint32_t presc;
+ uint32_t ret;
+ uint32_t presc;
- ret = SystemHFClockGet();
- presc = (CMU->HFCOREPRESC & _CMU_HFCOREPRESC_PRESC_MASK)
- >> _CMU_HFCOREPRESC_PRESC_SHIFT;
- ret /= presc + 1U;
+ ret = SystemHFClockGet();
+ presc = (CMU->HFCOREPRESC & _CMU_HFCOREPRESC_PRESC_MASK)
+ >> _CMU_HFCOREPRESC_PRESC_SHIFT;
+ ret /= presc + 1U;
- /* Keep CMSIS system clock variable up-to-date */
- SystemCoreClock = ret;
+ /* Keep CMSIS system clock variable up-to-date */
+ SystemCoreClock = ret;
- return ret;
+ return ret;
}
/***************************************************************************//**
@@ -164,9 +164,9 @@ uint32_t SystemCoreClockGet(void)
uint32_t SystemMaxCoreClockGet(void)
{
#if (EFR32_HFRCO_MAX_FREQ > EFR32_HFXO_FREQ)
- return EFR32_HFRCO_MAX_FREQ;
+ return EFR32_HFRCO_MAX_FREQ;
#else
- return EFR32_HFXO_FREQ;
+ return EFR32_HFXO_FREQ;
#endif
}
@@ -182,40 +182,40 @@ uint32_t SystemMaxCoreClockGet(void)
******************************************************************************/
uint32_t SystemHFClockGet(void)
{
- uint32_t ret;
+ uint32_t ret;
- switch (CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK) {
- case CMU_HFCLKSTATUS_SELECTED_LFXO:
+ switch (CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK) {
+ case CMU_HFCLKSTATUS_SELECTED_LFXO:
#if (EFR32_LFXO_FREQ > 0)
- ret = SystemLFXOClock;
+ ret = SystemLFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
+ break;
- case CMU_HFCLKSTATUS_SELECTED_LFRCO:
- ret = EFR32_LFRCO_FREQ;
- break;
+ case CMU_HFCLKSTATUS_SELECTED_LFRCO:
+ ret = EFR32_LFRCO_FREQ;
+ break;
- case CMU_HFCLKSTATUS_SELECTED_HFXO:
+ case CMU_HFCLKSTATUS_SELECTED_HFXO:
#if (EFR32_HFXO_FREQ > 0)
- ret = SystemHFXOClock;
+ ret = SystemHFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
+ break;
- default: /* CMU_HFCLKSTATUS_SELECTED_HFRCO */
- ret = SystemHfrcoFreq;
- break;
- }
+ default: /* CMU_HFCLKSTATUS_SELECTED_HFRCO */
+ ret = SystemHfrcoFreq;
+ break;
+ }
- return ret / (1U + ((CMU->HFPRESC & _CMU_HFPRESC_PRESC_MASK)
- >> _CMU_HFPRESC_PRESC_SHIFT));
+ return ret / (1U + ((CMU->HFPRESC & _CMU_HFPRESC_PRESC_MASK)
+ >> _CMU_HFPRESC_PRESC_SHIFT));
}
/**************************************************************************//**
@@ -230,11 +230,11 @@ uint32_t SystemHFClockGet(void)
*****************************************************************************/
uint32_t SystemHFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFR32_HFXO_FREQ > 0)
- return SystemHFXOClock;
+ return SystemHFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -255,18 +255,18 @@ uint32_t SystemHFXOClockGet(void)
*****************************************************************************/
void SystemHFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFR32_HFXO_FREQ > 0)
- SystemHFXOClock = freq;
-
- /* Update core clock frequency if HFXO is used to clock core */
- if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
- == CMU_HFCLKSTATUS_SELECTED_HFXO) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ SystemHFXOClock = freq;
+
+ /* Update core clock frequency if HFXO is used to clock core */
+ if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
+ == CMU_HFCLKSTATUS_SELECTED_HFXO) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
@@ -285,9 +285,9 @@ void SystemHFXOClockSet(uint32_t freq)
void SystemInit(void)
{
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
- /* Set floating point coprosessor access mode. */
- SCB->CPACR |= ((3UL << 10 * 2) /* set CP10 Full Access */
- | (3UL << 11 * 2)); /* set CP11 Full Access */
+ /* Set floating point coprosessor access mode. */
+ SCB->CPACR |= ((3UL << 10 * 2) /* set CP10 Full Access */
+ | (3UL << 11 * 2)); /* set CP11 Full Access */
#endif
}
@@ -303,10 +303,10 @@ void SystemInit(void)
*****************************************************************************/
uint32_t SystemLFRCOClockGet(void)
{
- /* Currently we assume that this frequency is properly tuned during */
- /* manufacturing and is not changed after reset. If future requirements */
- /* for re-tuning by user, we can add support for that. */
- return EFR32_LFRCO_FREQ;
+ /* Currently we assume that this frequency is properly tuned during */
+ /* manufacturing and is not changed after reset. If future requirements */
+ /* for re-tuning by user, we can add support for that. */
+ return EFR32_LFRCO_FREQ;
}
/**************************************************************************//**
@@ -321,8 +321,8 @@ uint32_t SystemLFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemULFRCOClockGet(void)
{
- /* The ULFRCO frequency is not tuned, and can be very inaccurate */
- return EFR32_ULFRCO_FREQ;
+ /* The ULFRCO frequency is not tuned, and can be very inaccurate */
+ return EFR32_ULFRCO_FREQ;
}
/**************************************************************************//**
@@ -337,11 +337,11 @@ uint32_t SystemULFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemLFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFR32_LFXO_FREQ > 0)
- return SystemLFXOClock;
+ return SystemLFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -362,17 +362,17 @@ uint32_t SystemLFXOClockGet(void)
*****************************************************************************/
void SystemLFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFR32_LFXO_FREQ > 0)
- SystemLFXOClock = freq;
-
- /* Update core clock frequency if LFXO is used to clock core */
- if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
- == CMU_HFCLKSTATUS_SELECTED_LFXO) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ SystemLFXOClock = freq;
+
+ /* Update core clock frequency if LFXO is used to clock core */
+ if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
+ == CMU_HFCLKSTATUS_SELECTED_LFXO) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
diff --git a/cpu/efm32/families/efr32mg1p/system.c b/cpu/efm32/families/efr32mg1p/system.c
index 7198e7bad..a44c90e23 100644
--- a/cpu/efm32/families/efr32mg1p/system.c
+++ b/cpu/efm32/families/efr32mg1p/system.c
@@ -137,18 +137,18 @@ uint32_t SystemHfrcoFreq = EFR32_HFRCO_STARTUP_FREQ;
******************************************************************************/
uint32_t SystemCoreClockGet(void)
{
- uint32_t ret;
- uint32_t presc;
+ uint32_t ret;
+ uint32_t presc;
- ret = SystemHFClockGet();
- presc = (CMU->HFCOREPRESC & _CMU_HFCOREPRESC_PRESC_MASK)
- >> _CMU_HFCOREPRESC_PRESC_SHIFT;
- ret /= presc + 1U;
+ ret = SystemHFClockGet();
+ presc = (CMU->HFCOREPRESC & _CMU_HFCOREPRESC_PRESC_MASK)
+ >> _CMU_HFCOREPRESC_PRESC_SHIFT;
+ ret /= presc + 1U;
- /* Keep CMSIS system clock variable up-to-date */
- SystemCoreClock = ret;
+ /* Keep CMSIS system clock variable up-to-date */
+ SystemCoreClock = ret;
- return ret;
+ return ret;
}
/***************************************************************************//**
@@ -164,9 +164,9 @@ uint32_t SystemCoreClockGet(void)
uint32_t SystemMaxCoreClockGet(void)
{
#if (EFR32_HFRCO_MAX_FREQ > EFR32_HFXO_FREQ)
- return EFR32_HFRCO_MAX_FREQ;
+ return EFR32_HFRCO_MAX_FREQ;
#else
- return EFR32_HFXO_FREQ;
+ return EFR32_HFXO_FREQ;
#endif
}
@@ -182,40 +182,40 @@ uint32_t SystemMaxCoreClockGet(void)
******************************************************************************/
uint32_t SystemHFClockGet(void)
{
- uint32_t ret;
+ uint32_t ret;
- switch (CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK) {
- case CMU_HFCLKSTATUS_SELECTED_LFXO:
+ switch (CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK) {
+ case CMU_HFCLKSTATUS_SELECTED_LFXO:
#if (EFR32_LFXO_FREQ > 0)
- ret = SystemLFXOClock;
+ ret = SystemLFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
+ break;
- case CMU_HFCLKSTATUS_SELECTED_LFRCO:
- ret = EFR32_LFRCO_FREQ;
- break;
+ case CMU_HFCLKSTATUS_SELECTED_LFRCO:
+ ret = EFR32_LFRCO_FREQ;
+ break;
- case CMU_HFCLKSTATUS_SELECTED_HFXO:
+ case CMU_HFCLKSTATUS_SELECTED_HFXO:
#if (EFR32_HFXO_FREQ > 0)
- ret = SystemHFXOClock;
+ ret = SystemHFXOClock;
#else
- /* We should not get here, since core should not be clocked. May */
- /* be caused by a misconfiguration though. */
- ret = 0;
+ /* We should not get here, since core should not be clocked. May */
+ /* be caused by a misconfiguration though. */
+ ret = 0;
#endif
- break;
+ break;
- default: /* CMU_HFCLKSTATUS_SELECTED_HFRCO */
- ret = SystemHfrcoFreq;
- break;
- }
+ default: /* CMU_HFCLKSTATUS_SELECTED_HFRCO */
+ ret = SystemHfrcoFreq;
+ break;
+ }
- return ret / (1U + ((CMU->HFPRESC & _CMU_HFPRESC_PRESC_MASK)
- >> _CMU_HFPRESC_PRESC_SHIFT));
+ return ret / (1U + ((CMU->HFPRESC & _CMU_HFPRESC_PRESC_MASK)
+ >> _CMU_HFPRESC_PRESC_SHIFT));
}
/**************************************************************************//**
@@ -230,11 +230,11 @@ uint32_t SystemHFClockGet(void)
*****************************************************************************/
uint32_t SystemHFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFR32_HFXO_FREQ > 0)
- return SystemHFXOClock;
+ return SystemHFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -255,18 +255,18 @@ uint32_t SystemHFXOClockGet(void)
*****************************************************************************/
void SystemHFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFR32_HFXO_FREQ > 0)
- SystemHFXOClock = freq;
-
- /* Update core clock frequency if HFXO is used to clock core */
- if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
- == CMU_HFCLKSTATUS_SELECTED_HFXO) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ SystemHFXOClock = freq;
+
+ /* Update core clock frequency if HFXO is used to clock core */
+ if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
+ == CMU_HFCLKSTATUS_SELECTED_HFXO) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
@@ -285,21 +285,21 @@ void SystemHFXOClockSet(uint32_t freq)
void SystemInit(void)
{
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
- /* Set floating point coprosessor access mode. */
- SCB->CPACR |= ((3UL << 10 * 2) /* set CP10 Full Access */
- | (3UL << 11 * 2)); /* set CP11 Full Access */
+ /* Set floating point coprosessor access mode. */
+ SCB->CPACR |= ((3UL << 10 * 2) /* set CP10 Full Access */
+ | (3UL << 11 * 2)); /* set CP11 Full Access */
#endif
- /****************************
- * Fix for errata DCDC_E206
- * Enable bypass switch as errata workaround. The bypass current limit will be
- * disabled again in CHIP_Init() to avoid added current consumption. */
+ /****************************
+ * Fix for errata DCDC_E206
+ * Enable bypass switch as errata workaround. The bypass current limit will be
+ * disabled again in CHIP_Init() to avoid added current consumption. */
- EMU->DCDCCLIMCTRL |= 1U << _EMU_DCDCCLIMCTRL_BYPLIMEN_SHIFT;
- EMU->DCDCCTRL = (EMU->DCDCCTRL & ~_EMU_DCDCCTRL_DCDCMODE_MASK)
- | EMU_DCDCCTRL_DCDCMODE_BYPASS;
- *(volatile uint32_t *)(0x400E3074) &= ~(0x1UL << 0);
- *(volatile uint32_t *)(0x400E3060) &= ~(0x1UL << 28);
+ EMU->DCDCCLIMCTRL |= 1U << _EMU_DCDCCLIMCTRL_BYPLIMEN_SHIFT;
+ EMU->DCDCCTRL = (EMU->DCDCCTRL & ~_EMU_DCDCCTRL_DCDCMODE_MASK)
+ | EMU_DCDCCTRL_DCDCMODE_BYPASS;
+ *(volatile uint32_t *)(0x400E3074) &= ~(0x1UL << 0);
+ *(volatile uint32_t *)(0x400E3060) &= ~(0x1UL << 28);
}
/**************************************************************************//**
@@ -314,10 +314,10 @@ void SystemInit(void)
*****************************************************************************/
uint32_t SystemLFRCOClockGet(void)
{
- /* Currently we assume that this frequency is properly tuned during */
- /* manufacturing and is not changed after reset. If future requirements */
- /* for re-tuning by user, we can add support for that. */
- return EFR32_LFRCO_FREQ;
+ /* Currently we assume that this frequency is properly tuned during */
+ /* manufacturing and is not changed after reset. If future requirements */
+ /* for re-tuning by user, we can add support for that. */
+ return EFR32_LFRCO_FREQ;
}
/**************************************************************************//**
@@ -332,8 +332,8 @@ uint32_t SystemLFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemULFRCOClockGet(void)
{
- /* The ULFRCO frequency is not tuned, and can be very inaccurate */
- return EFR32_ULFRCO_FREQ;
+ /* The ULFRCO frequency is not tuned, and can be very inaccurate */
+ return EFR32_ULFRCO_FREQ;
}
/**************************************************************************//**
@@ -348,11 +348,11 @@ uint32_t SystemULFRCOClockGet(void)
*****************************************************************************/
uint32_t SystemLFXOClockGet(void)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFR32_LFXO_FREQ > 0)
- return SystemLFXOClock;
+ return SystemLFXOClock;
#else
- return 0;
+ return 0;
#endif
}
@@ -373,17 +373,17 @@ uint32_t SystemLFXOClockGet(void)
*****************************************************************************/
void SystemLFXOClockSet(uint32_t freq)
{
- /* External crystal oscillator present? */
+ /* External crystal oscillator present? */
#if (EFR32_LFXO_FREQ > 0)
- SystemLFXOClock = freq;
-
- /* Update core clock frequency if LFXO is used to clock core */
- if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
- == CMU_HFCLKSTATUS_SELECTED_LFXO) {
- /* The function will update the global variable */
- (void)SystemCoreClockGet();
- }
+ SystemLFXOClock = freq;
+
+ /* Update core clock frequency if LFXO is used to clock core */
+ if ((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK)
+ == CMU_HFCLKSTATUS_SELECTED_LFXO) {
+ /* The function will update the global variable */
+ (void)SystemCoreClockGet();
+ }
#else
- (void)freq; /* Unused parameter */
+ (void)freq; /* Unused parameter */
#endif
}
diff --git a/cpu/efm32/periph/uart.c b/cpu/efm32/periph/uart.c
index adaadf214..f3440ddb6 100644
--- a/cpu/efm32/periph/uart.c
+++ b/cpu/efm32/periph/uart.c
@@ -62,67 +62,68 @@ int uart_init(uart_t dev, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
#if LOW_POWER_ENABLED && defined(LEUART_COUNT) && LEUART_COUNT > 0
if (_is_usart(dev)) {
#endif
- USART_TypeDef *uart = (USART_TypeDef *) uart_config[dev].dev;
+ USART_TypeDef *uart = (USART_TypeDef *) uart_config[dev].dev;
- /* enable clocks */
- CMU_ClockEnable(cmuClock_HFPER, true);
- CMU_ClockEnable(uart_config[dev].cmu, true);
+ /* enable clocks */
+ CMU_ClockEnable(cmuClock_HFPER, true);
+ CMU_ClockEnable(uart_config[dev].cmu, true);
- /* reset and initialize peripheral */
- USART_InitAsync_TypeDef init = USART_INITASYNC_DEFAULT;
+ /* reset and initialize peripheral */
+ USART_InitAsync_TypeDef init = USART_INITASYNC_DEFAULT;
- init.enable = usartDisable;
- init.baudrate = baudrate;
+ init.enable = usartDisable;
+ init.baudrate = baudrate;
- USART_InitAsync(uart, &init);
+ USART_InitAsync(uart, &init);
- /* configure pin functions */
+ /* configure pin functions */
#ifdef _SILICON_LABS_32B_SERIES_0
- uart->ROUTE = (uart_config[dev].loc |
- USART_ROUTE_RXPEN |
- USART_ROUTE_TXPEN);
+ uart->ROUTE = (uart_config[dev].loc |
+ USART_ROUTE_RXPEN |
+ USART_ROUTE_TXPEN);
#else
- uart->ROUTELOC0 = uart_config[dev].loc;
- uart->ROUTEPEN = USART_ROUTEPEN_RXPEN | USART_ROUTEPEN_TXPEN;
+ uart->ROUTELOC0 = uart_config[dev].loc;
+ uart->ROUTEPEN = USART_ROUTEPEN_RXPEN | USART_ROUTEPEN_TXPEN;
#endif
- /* enable receive interrupt */
- USART_IntEnable(uart, USART_IEN_RXDATAV);
+ /* enable receive interrupt */
+ USART_IntEnable(uart, USART_IEN_RXDATAV);
- /* enable peripheral */
- USART_Enable(uart, usartEnable);
+ /* enable peripheral */
+ USART_Enable(uart, usartEnable);
#if LOW_POWER_ENABLED && defined(LEUART_COUNT) && LEUART_COUNT > 0
- } else {
- LEUART_TypeDef *leuart = (LEUART_TypeDef *) uart_config[dev].dev;
+}
+else {
+ LEUART_TypeDef *leuart = (LEUART_TypeDef *) uart_config[dev].dev;
- /* enable clocks */
- CMU_ClockEnable(cmuClock_CORELE, true);
- CMU_ClockEnable(uart_config[dev].cmu, true);
+ /* enable clocks */
+ CMU_ClockEnable(cmuClock_CORELE, true);
+ CMU_ClockEnable(uart_config[dev].cmu, true);
- /* reset and initialize peripheral */
- LEUART_Init_TypeDef init = LEUART_INIT_DEFAULT;
+ /* reset and initialize peripheral */
+ LEUART_Init_TypeDef init = LEUART_INIT_DEFAULT;
- init.enable = leuartDisable;
- init.baudrate = baudrate;
+ init.enable = leuartDisable;
+ init.baudrate = baudrate;
- LEUART_Init(leuart, &init);
+ LEUART_Init(leuart, &init);
- /* configure pin functions */
+ /* configure pin functions */
#ifdef _SILICON_LABS_32B_SERIES_0
- leuart->ROUTE = (uart_config[dev].loc |
- LEUART_ROUTE_RXPEN |
- LEUART_ROUTE_TXPEN);
+ leuart->ROUTE = (uart_config[dev].loc |
+ LEUART_ROUTE_RXPEN |
+ LEUART_ROUTE_TXPEN);
#else
- leuart->ROUTELOC0 = uart_config[dev].loc;
- leuart->ROUTEPEN = LEUART_ROUTEPEN_RXPEN | LEUART_ROUTEPEN_TXPEN;
+ leuart->ROUTELOC0 = uart_config[dev].loc;
+ leuart->ROUTEPEN = LEUART_ROUTEPEN_RXPEN | LEUART_ROUTEPEN_TXPEN;
#endif
- /* enable receive interrupt */
- LEUART_IntEnable(leuart, LEUART_IEN_RXDATAV);
+ /* enable receive interrupt */
+ LEUART_IntEnable(leuart, LEUART_IEN_RXDATAV);
- /* enable peripheral */
- LEUART_Enable(leuart, leuartEnable);
- }
+ /* enable peripheral */
+ LEUART_Enable(leuart, leuartEnable);
+}
#endif
/* enable the interrupt */
@@ -137,15 +138,16 @@ void uart_write(uart_t dev, const uint8_t *data, size_t len)
#if LOW_POWER_ENABLED && defined(LEUART_COUNT) && LEUART_COUNT > 0
if (_is_usart(dev)) {
#endif
- while (len--) {
- USART_Tx(uart_config[dev].dev, *(data++));
- }
+ while (len--) {
+ USART_Tx(uart_config[dev].dev, *(data++));
+ }
#if LOW_POWER_ENABLED && defined(LEUART_COUNT) && LEUART_COUNT > 0
- } else {
- while (len--) {
- LEUART_Tx(uart_config[dev].dev, *(data++));
- }
+}
+else {
+ while (len--) {
+ LEUART_Tx(uart_config[dev].dev, *(data++));
}
+}
#endif
}
@@ -164,15 +166,16 @@ static void rx_irq(uart_t dev)
#if LOW_POWER_ENABLED && defined(LEUART_COUNT) && LEUART_COUNT > 0
if (_is_usart(dev)) {
#endif
- if (USART_IntGet(uart_config[dev].dev) & USART_IF_RXDATAV) {
- isr_ctx[dev].rx_cb(isr_ctx[dev].arg, USART_RxDataGet(uart_config[dev].dev));
- }
+ if (USART_IntGet(uart_config[dev].dev) & USART_IF_RXDATAV) {
+ isr_ctx[dev].rx_cb(isr_ctx[dev].arg, USART_RxDataGet(uart_config[dev].dev));
+ }
#if LOW_POWER_ENABLED && defined(LEUART_COUNT) && LEUART_COUNT > 0
- } else {
- if (LEUART_IntGet(uart_config[dev].dev) & LEUART_IF_RXDATAV) {
- isr_ctx[dev].rx_cb(isr_ctx[dev].arg, LEUART_RxDataGet(uart_config[dev].dev));
- }
+}
+else {
+ if (LEUART_IntGet(uart_config[dev].dev) & LEUART_IF_RXDATAV) {
+ isr_ctx[dev].rx_cb(isr_ctx[dev].arg, LEUART_RxDataGet(uart_config[dev].dev));
}
+}
#endif
cortexm_isr_end();
}
diff --git a/cpu/ezr32wg/periph/gpio.c b/cpu/ezr32wg/periph/gpio.c
index 2cabdb85f..26ac1a14c 100644
--- a/cpu/ezr32wg/periph/gpio.c
+++ b/cpu/ezr32wg/periph/gpio.c
@@ -81,7 +81,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
}
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
- gpio_cb_t cb, void *arg)
+ gpio_cb_t cb, void *arg)
{
uint32_t pin_pos = _pin_pos(pin);
diff --git a/cpu/ezr32wg/vectors.c b/cpu/ezr32wg/vectors.c
index a795b2ddf..d19a70130 100644
--- a/cpu/ezr32wg/vectors.c
+++ b/cpu/ezr32wg/vectors.c
@@ -24,7 +24,7 @@
/* define a local dummy handler as it needs to be in the same compilation unit
* as the alias definition */
void dummy_handler(void) {
- __asm__("b dummy_handler_default");
+ __asm__ ("b dummy_handler_default");
}
/* Silicon Labs specific interrupt vector */
diff --git a/cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c b/cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c
index 1d98e9017..3117e71d2 100644
--- a/cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c
+++ b/cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c
@@ -129,7 +129,7 @@ static long find_closest_baudrate_scalers(const uint32_t module_clock, const lon
* @return Less than 0 on error.
*/
static long find_closest_delay_scalers(const uint32_t module_clock, const long target_freq,
- uint8_t *closest_prescaler, uint8_t *closest_scaler)
+ uint8_t *closest_prescaler, uint8_t *closest_scaler)
{
uint8_t i;
uint8_t k;
@@ -190,7 +190,7 @@ int main(int argc, char **argv)
}
printf("\nCalculating SPI clock scalers for a module clock of: %iHz\n\n",
- (int)modclk);
+ (int)modclk);
puts("static const uint32_t spi_clk_config[] = {");
diff --git a/cpu/kinetis/include/cpu_conf_kinetis_k.h b/cpu/kinetis/include/cpu_conf_kinetis_k.h
index 58de7ee11..091e46dd9 100644
--- a/cpu/kinetis/include/cpu_conf_kinetis_k.h
+++ b/cpu/kinetis/include/cpu_conf_kinetis_k.h
@@ -38,48 +38,48 @@
defined(CPU_MODEL_MK22FN1M0VMD12)
#include "vendor/MK22F12.h"
#elif defined(CPU_MODEL_MK22FN128VDC10) || \
- defined(CPU_MODEL_MK22FN128VLH10) || \
- defined(CPU_MODEL_MK22FN128VLL10) || \
+ defined(CPU_MODEL_MK22FN128VLH10) || \
+ defined(CPU_MODEL_MK22FN128VLL10) || \
defined(CPU_MODEL_MK22FN128VMP10)
#include "vendor/MK22F12810.h"
#elif defined(CPU_MODEL_MK22FN128CAH12) || \
- defined(CPU_MODEL_MK22FN256CAH12) || \
- defined(CPU_MODEL_MK22FN256VDC12) || \
- defined(CPU_MODEL_MK22FN256VLH12) || \
- defined(CPU_MODEL_MK22FN256VLL12) || \
+ defined(CPU_MODEL_MK22FN256CAH12) || \
+ defined(CPU_MODEL_MK22FN256VDC12) || \
+ defined(CPU_MODEL_MK22FN256VLH12) || \
+ defined(CPU_MODEL_MK22FN256VLL12) || \
defined(CPU_MODEL_MK22FN256VMP12)
#include "vendor/MK22F25612.h"
#elif defined(CPU_MODEL_MK22FN512CAP12) || \
- defined(CPU_MODEL_MK22FN512VDC12) || \
- defined(CPU_MODEL_MK22FN512VFX12) || \
- defined(CPU_MODEL_MK22FN512VLH12) || \
- defined(CPU_MODEL_MK22FN512VLL12) || \
+ defined(CPU_MODEL_MK22FN512VDC12) || \
+ defined(CPU_MODEL_MK22FN512VFX12) || \
+ defined(CPU_MODEL_MK22FN512VLH12) || \
+ defined(CPU_MODEL_MK22FN512VLL12) || \
defined(CPU_MODEL_MK22FN512VMP12)
#include "vendor/MK22F51212.h"
#elif defined(CPU_MODEL_MK22FN1M0AVLH12) || \
- defined(CPU_MODEL_MK22FN1M0AVLK12) || \
- defined(CPU_MODEL_MK22FN1M0AVLL12) || \
- defined(CPU_MODEL_MK22FN1M0AVLQ12) || \
- defined(CPU_MODEL_MK22FN1M0AVMC12) || \
- defined(CPU_MODEL_MK22FN1M0AVMD12) || \
- defined(CPU_MODEL_MK22FX512AVLH12) || \
- defined(CPU_MODEL_MK22FX512AVLK12) || \
- defined(CPU_MODEL_MK22FX512AVLL12) || \
- defined(CPU_MODEL_MK22FX512AVLQ12) || \
- defined(CPU_MODEL_MK22FX512AVMC12) || \
+ defined(CPU_MODEL_MK22FN1M0AVLK12) || \
+ defined(CPU_MODEL_MK22FN1M0AVLL12) || \
+ defined(CPU_MODEL_MK22FN1M0AVLQ12) || \
+ defined(CPU_MODEL_MK22FN1M0AVMC12) || \
+ defined(CPU_MODEL_MK22FN1M0AVMD12) || \
+ defined(CPU_MODEL_MK22FX512AVLH12) || \
+ defined(CPU_MODEL_MK22FX512AVLK12) || \
+ defined(CPU_MODEL_MK22FX512AVLL12) || \
+ defined(CPU_MODEL_MK22FX512AVLQ12) || \
+ defined(CPU_MODEL_MK22FX512AVMC12) || \
defined(CPU_MODEL_MK22FX512AVMD12)
#include "vendor/MK22FA12.h"
#endif
#elif (KINETIS_SUBFAMILY == 0)
-#if defined(CPU_MODEL_MK20DX64VLH7) || \
+#if defined(CPU_MODEL_MK20DX64VLH7) || \
defined(CPU_MODEL_MK20DX128VLH7) || \
defined(CPU_MODEL_MK20DX256VLH7) || \
- defined(CPU_MODEL_MK20DX64VLK7) || \
+ defined(CPU_MODEL_MK20DX64VLK7) || \
defined(CPU_MODEL_MK20DX128VLK7) || \
defined(CPU_MODEL_MK20DX256VLK7) || \
defined(CPU_MODEL_MK20DX128VLL7) || \
defined(CPU_MODEL_MK20DX256VLL7) || \
- defined(CPU_MODEL_MK20DX64VMB7) || \
+ defined(CPU_MODEL_MK20DX64VMB7) || \
defined(CPU_MODEL_MK20DX128VMB7) || \
defined(CPU_MODEL_MK20DX256VMB7) || \
defined(CPU_MODEL_MK20DX128VML7) || \
diff --git a/cpu/kinetis/include/cpu_conf_kinetis_w.h b/cpu/kinetis/include/cpu_conf_kinetis_w.h
index b7fd5b216..dbaf2276b 100644
--- a/cpu/kinetis/include/cpu_conf_kinetis_w.h
+++ b/cpu/kinetis/include/cpu_conf_kinetis_w.h
@@ -67,11 +67,11 @@
defined(CPU_MODEL_MKW21Z512VHT4)
#include "vendor/MKW21Z4.h"
#elif defined(CPU_MODEL_MKW31Z256VHT4) || \
- defined(CPU_MODEL_MKW31Z512CAT4) || \
+ defined(CPU_MODEL_MKW31Z512CAT4) || \
defined(CPU_MODEL_MKW31Z512VHT4)
#include "vendor/MKW31Z4.h"
#elif defined(CPU_MODEL_MKW41Z256VHT4) || \
- defined(CPU_MODEL_MKW41Z512CAT4) || \
+ defined(CPU_MODEL_MKW41Z512CAT4) || \
defined(CPU_MODEL_MKW41Z512VHT4)
#include "vendor/MKW41Z4.h"
#endif
diff --git a/cpu/kinetis/periph/gpio.c b/cpu/kinetis/periph/gpio.c
index ec0155dfd..f151b3032 100644
--- a/cpu/kinetis/periph/gpio.c
+++ b/cpu/kinetis/periph/gpio.c
@@ -233,8 +233,8 @@ void gpio_init_port(gpio_t pin, uint32_t pcr)
clk_en(pin);
/* if the given interrupt was previously configured as interrupt source, we
- * need to free its interrupt context. We to this only after we
- * re-configured the pin in case an event is happening just in between... */
+ * need to free its interrupt context. We to this only after we
+ * re-configured the pin in case an event is happening just in between... */
uint32_t isr_state = port(pin)->PCR[pin_num(pin)];
/* set new PCR value */
port(pin)->PCR[pin_num(pin)] = pcr;
diff --git a/cpu/kinetis/periph/i2c.c b/cpu/kinetis/periph/i2c.c
index 4afc994f5..a13156d25 100644
--- a/cpu/kinetis/periph/i2c.c
+++ b/cpu/kinetis/periph/i2c.c
@@ -100,22 +100,22 @@ int i2c_init_master(i2c_t dev, i2c_speed_t speed)
switch (speed) {
case I2C_SPEED_LOW:
baudrate_flags |= I2C_F_MULT(KINETIS_I2C_F_MULT_LOW) |
- I2C_F_ICR(KINETIS_I2C_F_ICR_LOW);
+ I2C_F_ICR(KINETIS_I2C_F_ICR_LOW);
break;
case I2C_SPEED_NORMAL:
baudrate_flags |= I2C_F_MULT(KINETIS_I2C_F_MULT_NORMAL) |
- I2C_F_ICR(KINETIS_I2C_F_ICR_NORMAL);
+ I2C_F_ICR(KINETIS_I2C_F_ICR_NORMAL);
break;
case I2C_SPEED_FAST:
baudrate_flags |= I2C_F_MULT(KINETIS_I2C_F_MULT_FAST) |
- I2C_F_ICR(KINETIS_I2C_F_ICR_FAST);
+ I2C_F_ICR(KINETIS_I2C_F_ICR_FAST);
break;
case I2C_SPEED_FAST_PLUS:
baudrate_flags |= I2C_F_MULT(KINETIS_I2C_F_MULT_FAST_PLUS) |
- I2C_F_ICR(KINETIS_I2C_F_ICR_FAST_PLUS);
+ I2C_F_ICR(KINETIS_I2C_F_ICR_FAST_PLUS);
break;
default:
diff --git a/cpu/kinetis/periph/spi.c b/cpu/kinetis/periph/spi.c
index 34ba38853..c7359cf28 100644
--- a/cpu/kinetis/periph/spi.c
+++ b/cpu/kinetis/periph/spi.c
@@ -109,7 +109,7 @@ void spi_init_pins(spi_t bus)
{
gpio_init_port(spi_config[bus].pin_miso, spi_config[bus].pcr);
gpio_init_port(spi_config[bus].pin_mosi, spi_config[bus].pcr);
- gpio_init_port(spi_config[bus].pin_clk , spi_config[bus].pcr);
+ gpio_init_port(spi_config[bus].pin_clk, spi_config[bus].pcr);
}
int spi_init_cs(spi_t bus, spi_cs_t cs)
diff --git a/cpu/kinetis/periph/timer.c b/cpu/kinetis/periph/timer.c
index b2ad14cdb..33d1822fd 100644
--- a/cpu/kinetis/periph/timer.c
+++ b/cpu/kinetis/periph/timer.c
@@ -395,7 +395,7 @@ static inline int32_t _lptmr_compute_prescaler(uint32_t freq) {
/* Frequency out of range */
return -1;
}
- while (freq < LPTMR_BASE_FREQ){
+ while (freq < LPTMR_BASE_FREQ) {
++prescale;
freq <<= 1;
}
diff --git a/cpu/kinetis/periph/uart.c b/cpu/kinetis/periph/uart.c
index 230b4a67b..87e889ed4 100644
--- a/cpu/kinetis/periph/uart.c
+++ b/cpu/kinetis/periph/uart.c
@@ -208,8 +208,8 @@ static inline void uart_init_uart(uart_t uart, uint32_t baudrate)
* TXFIFOSIZE == 0 means size = 1 (i.e. only one byte, no hardware FIFO) */
if ((dev->PFIFO & UART_PFIFO_TXFIFOSIZE_MASK) != 0) {
uint8_t txfifo_size =
- (2 << ((dev->PFIFO & UART_PFIFO_TXFIFOSIZE_MASK) >>
- UART_PFIFO_TXFIFOSIZE_SHIFT));
+ (2 << ((dev->PFIFO & UART_PFIFO_TXFIFOSIZE_MASK) >>
+ UART_PFIFO_TXFIFOSIZE_SHIFT));
dev->TWFIFO = UART_TWFIFO_TXWATER(txfifo_size - 1);
}
else {
@@ -321,13 +321,13 @@ static inline void uart_init_lpuart(uart_t uart, uint32_t baudrate)
#ifdef SIM_SOPT2_LPUART0SRC
if (dev == LPUART0) {
SIM->SOPT2 = (SIM->SOPT2 & ~SIM_SOPT2_LPUART0SRC_MASK) |
- SIM_SOPT2_LPUART0SRC(LPUART_0_SRC);
+ SIM_SOPT2_LPUART0SRC(LPUART_0_SRC);
}
#endif
#ifdef SIM_SOPT2_LPUART1SRC
if (dev == LPUART1) {
SIM->SOPT2 = (SIM->SOPT2 & ~SIM_SOPT2_LPUART1SRC_MASK) |
- SIM_SOPT2_LPUART1SRC(LPUART_1_SRC);
+ SIM_SOPT2_LPUART1SRC(LPUART_1_SRC);
}
#endif
diff --git a/cpu/lm4f120/cpu.c b/cpu/lm4f120/cpu.c
index ba65f4c96..55335f752 100644
--- a/cpu/lm4f120/cpu.c
+++ b/cpu/lm4f120/cpu.c
@@ -49,7 +49,7 @@ void setup_fpu(void)
void cpu_clock_init(int clk)
{
setup_fpu();
- switch(clk){
+ switch(clk) {
case CLK80:
ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
break;
diff --git a/cpu/lm4f120/include/periph_cpu.h b/cpu/lm4f120/include/periph_cpu.h
index 7cbbd7638..77681569a 100644
--- a/cpu/lm4f120/include/periph_cpu.h
+++ b/cpu/lm4f120/include/periph_cpu.h
@@ -60,8 +60,8 @@ typedef enum {
*/
#define HAVE_GPIO_DIR_T
typedef enum {
- GPIO_DIR_IN = GPIO_DIR_MODE_IN, /**< configure pin as input */
- GPIO_DIR_OUT = GPIO_DIR_MODE_OUT /**< configure pin as output */
+ GPIO_DIR_IN = GPIO_DIR_MODE_IN, /**< configure pin as input */
+ GPIO_DIR_OUT = GPIO_DIR_MODE_OUT /**< configure pin as output */
} gpio_dir_t;
/** @} */
@@ -83,12 +83,12 @@ typedef enum {
* @brief Available ports on the LM4F120
*/
enum {
- PORT_A = 0, /**< port A */
- PORT_B = 1, /**< port B */
- PORT_C = 2, /**< port C */
- PORT_D = 3, /**< port D */
- PORT_E = 4, /**< port E */
- PORT_F = 5, /**< port F */
+ PORT_A = 0, /**< port A */
+ PORT_B = 1, /**< port B */
+ PORT_C = 2, /**< port C */
+ PORT_D = 3, /**< port D */
+ PORT_E = 4, /**< port E */
+ PORT_F = 5, /**< port F */
};
/**
diff --git a/cpu/lm4f120/periph/gpio.c b/cpu/lm4f120/periph/gpio.c
index 0cb0bbd90..a022381ce 100644
--- a/cpu/lm4f120/periph/gpio.c
+++ b/cpu/lm4f120/periph/gpio.c
@@ -124,13 +124,13 @@ static void _isr_gpio(uint32_t port_num){
uint8_t i;
for (i=0; i<8; i++, isr>>=1) {
- if ((isr & 0x1) == 0){
+ if ((isr & 0x1) == 0) {
continue;
}
ROM_GPIOPinIntClear(port_addr, 1 << i);
- if (gpio_config[port_num][i].cb){
+ if (gpio_config[port_num][i].cb) {
gpio_config[port_num][i].cb(gpio_config[port_num][i].arg);
}
}
diff --git a/cpu/lm4f120/periph/timer.c b/cpu/lm4f120/periph/timer.c
index 97da40450..6c4cd1cc3 100644
--- a/cpu/lm4f120/periph/timer.c
+++ b/cpu/lm4f120/periph/timer.c
@@ -71,7 +71,7 @@ static inline unsigned int _llvalue_to_scaled_value(unsigned long long corrected
int timer_init(tim_t dev, unsigned long freq, timer_cb_t cb, void *arg)
{
- if (dev >= TIMER_NUMOF){
+ if (dev >= TIMER_NUMOF) {
return -1;
}
@@ -86,23 +86,23 @@ int timer_init(tim_t dev, unsigned long freq, timer_cb_t cb, void *arg)
unsigned int timer_max_val;
unsigned int timer_intbit = TIMER_TIMA_TIMEOUT | TIMER_TIMA_MATCH;
- switch(dev){
+ switch(dev) {
#if TIMER_0_EN
- case TIMER_0:
- sysctl_timer = SYSCTL_PERIPH_WTIMER0;
- timer_base = WTIMER0_BASE;
- timer_max_val = TIMER_0_MAX_VALUE;
- break;
+ case TIMER_0:
+ sysctl_timer = SYSCTL_PERIPH_WTIMER0;
+ timer_base = WTIMER0_BASE;
+ timer_max_val = TIMER_0_MAX_VALUE;
+ break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- sysctl_timer = SYSCTL_PERIPH_WTIMER1;
- timer_base = WTIMER1_BASE;
- timer_max_val = TIMER_1_MAX_VALUE;
- break;
+ case TIMER_1:
+ sysctl_timer = SYSCTL_PERIPH_WTIMER1;
+ timer_base = WTIMER1_BASE;
+ timer_max_val = TIMER_1_MAX_VALUE;
+ break;
#endif
- default:
- return -1; /* unreachable */
+ default:
+ return -1; /* unreachable */
}
@@ -133,30 +133,30 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value)
unsigned int timer_side = TIMER_A;
unsigned long long scaledv;
- if (dev >= TIMER_NUMOF){
+ if (dev >= TIMER_NUMOF) {
return -1;
}
- switch(dev){
+ switch(dev) {
#if TIMER_0_EN
- case TIMER_0:
- timer_base = WTIMER0_BASE;
- break;
+ case TIMER_0:
+ timer_base = WTIMER0_BASE;
+ break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- timer_base = WTIMER1_BASE;
- break;
+ case TIMER_1:
+ timer_base = WTIMER1_BASE;
+ break;
#endif
- default:
- return -1; /* unreachable */
- break;
+ default:
+ return -1; /* unreachable */
+ break;
}
ROM_TimerDisable(timer_base, timer_side);
scaledv = _scaled_to_ll_value(value, config[dev].divisor);
- if (scaledv>>32){
+ if (scaledv>>32) {
ROM_TimerPrescaleMatchSet(timer_base, timer_side, scaledv >> 32);
}
else {
@@ -176,24 +176,24 @@ int timer_clear(tim_t dev, int channel)
unsigned int timer_intbit = TIMER_TIMA_TIMEOUT;
unsigned int timer_base;
- if (dev >= TIMER_NUMOF){
+ if (dev >= TIMER_NUMOF) {
return -1;
}
- switch(dev){
+ switch(dev) {
#if TIMER_0_EN
- case TIMER_0:
- timer_base = WTIMER0_BASE;
- break;
+ case TIMER_0:
+ timer_base = WTIMER0_BASE;
+ break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- timer_base = WTIMER1_BASE;
- break;
+ case TIMER_1:
+ timer_base = WTIMER1_BASE;
+ break;
#endif
- default:
- return -1; /* unreachable */
- break;
+ default:
+ return -1; /* unreachable */
+ break;
}
ROM_TimerIntClear(timer_base, timer_intbit);
@@ -209,31 +209,31 @@ unsigned int timer_read(tim_t dev)
unsigned long long total;
unsigned int scaled_value;
- if (dev >= TIMER_NUMOF){
+ if (dev >= TIMER_NUMOF) {
return -1;
}
- switch(dev){
+ switch(dev) {
#if TIMER_0_EN
- case TIMER_0:
- timer_base = WTIMER0_BASE;
- break;
+ case TIMER_0:
+ timer_base = WTIMER0_BASE;
+ break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- timer_base = WTIMER1_BASE;
- break;
+ case TIMER_1:
+ timer_base = WTIMER1_BASE;
+ break;
#endif
- default:
- return -1; /* unreachable */
- break;
+ default:
+ return -1; /* unreachable */
+ break;
}
/* handle overflow happening between the 2 register reads */
do {
- high_bits = ((unsigned long long)PRIV_TimerPrescaleSnapshotGet(timer_base, timer_side)) << 32;
- low_bits = (unsigned long long)ROM_TimerValueGet(timer_base, timer_side);
- high_bits_dup = ((unsigned long long)PRIV_TimerPrescaleSnapshotGet(timer_base, timer_side)) << 32;
+ high_bits = ((unsigned long long)PRIV_TimerPrescaleSnapshotGet(timer_base, timer_side)) << 32;
+ low_bits = (unsigned long long)ROM_TimerValueGet(timer_base, timer_side);
+ high_bits_dup = ((unsigned long long)PRIV_TimerPrescaleSnapshotGet(timer_base, timer_side)) << 32;
} while (high_bits != high_bits_dup);
total = high_bits + low_bits;
@@ -249,23 +249,23 @@ void timer_start(tim_t dev)
unsigned int timer_base;
unsigned int timer_side = TIMER_A;
- if (dev >= TIMER_NUMOF){
- return ;
+ if (dev >= TIMER_NUMOF) {
+ return;
}
- switch(dev){
+ switch(dev) {
#if TIMER_0_EN
- case TIMER_0:
- timer_base = WTIMER0_BASE;
- break;
+ case TIMER_0:
+ timer_base = WTIMER0_BASE;
+ break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- timer_base = WTIMER1_BASE;
- break;
+ case TIMER_1:
+ timer_base = WTIMER1_BASE;
+ break;
#endif
- default:
- return; /* unreachable */
+ default:
+ return; /* unreachable */
}
ROM_TimerEnable(timer_base, timer_side);
@@ -276,23 +276,23 @@ void timer_stop(tim_t dev)
unsigned int timer_base;
unsigned int timer_side = TIMER_A;
- if (dev >= TIMER_NUMOF){
+ if (dev >= TIMER_NUMOF) {
return;
}
- switch(dev){
+ switch(dev) {
#if TIMER_0_EN
- case TIMER_0:
- timer_base = WTIMER0_BASE;
- break;
+ case TIMER_0:
+ timer_base = WTIMER0_BASE;
+ break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- timer_base = WTIMER1_BASE;
- break;
+ case TIMER_1:
+ timer_base = WTIMER1_BASE;
+ break;
#endif
- default:
- return; /* unreachable */
+ default:
+ return; /* unreachable */
}
ROM_TimerDisable(timer_base, timer_side);
@@ -302,23 +302,23 @@ static inline void _irq_enable(tim_t dev)
{
unsigned int timer_intbase;
- if (dev >= TIMER_NUMOF){
+ if (dev >= TIMER_NUMOF) {
return;
}
- switch(dev){
+ switch(dev) {
#if TIMER_0_EN
- case TIMER_0:
- timer_intbase = INT_WTIMER0A;
- break;
+ case TIMER_0:
+ timer_intbase = INT_WTIMER0A;
+ break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- timer_intbase = INT_WTIMER1A;
- break;
+ case TIMER_1:
+ timer_intbase = INT_WTIMER1A;
+ break;
#endif
- default:
- return; /* unreachable */
+ default:
+ return; /* unreachable */
}
ROM_IntPrioritySet(timer_intbase, 32);
diff --git a/cpu/lm4f120/periph/uart.c b/cpu/lm4f120/periph/uart.c
index 550a47cb2..10fabf1c6 100644
--- a/cpu/lm4f120/periph/uart.c
+++ b/cpu/lm4f120/periph/uart.c
@@ -41,12 +41,12 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
/* Check the arguments */
assert(uart == 0);
/* Check to make sure the UART peripheral is present */
- if(!ROM_SysCtlPeripheralPresent(SYSCTL_PERIPH_UART0)){
+ if(!ROM_SysCtlPeripheralPresent(SYSCTL_PERIPH_UART0)) {
return UART_NODEV;
}
int res = init_base(uart, baudrate);
- if(res != UART_OK){
+ if(res != UART_OK) {
return res;
}
@@ -55,7 +55,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
config[uart].arg = arg;
/* ulBase = g_ulUARTBase[uart]; */
- switch (uart){
+ switch (uart) {
#if UART_0_EN
case UART_0:
ROM_UARTTxIntModeSet(UART0_BASE, UART_TXINT_MODE_EOT);
@@ -80,7 +80,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
static int init_base(uart_t uart, uint32_t baudrate)
{
- switch(uart){
+ switch(uart) {
#if UART_0_EN
case UART_0:
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
@@ -91,8 +91,8 @@ static int init_base(uart_t uart, uint32_t baudrate)
ROM_UARTDisable(UART0_BASE);
ROM_UARTConfigSetExpClk(UART0_BASE,ROM_SysCtlClockGet(), baudrate,
- (UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE |
- UART_CONFIG_WLEN_8));
+ (UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE |
+ UART_CONFIG_WLEN_8));
ROM_UARTEnable(UART0_BASE);
@@ -100,7 +100,7 @@ static int init_base(uart_t uart, uint32_t baudrate)
#endif
default:
return UART_NODEV;
- }
+ }
return UART_OK;
}
diff --git a/cpu/lpc1768/periph/cpuid.c b/cpu/lpc1768/periph/cpuid.c
index 0ab0cf8de..ddfd452c0 100644
--- a/cpu/lpc1768/periph/cpuid.c
+++ b/cpu/lpc1768/periph/cpuid.c
@@ -36,7 +36,7 @@ void cpuid_get(void *id)
/* Define pointer to function type */
void (*iap)(uint32_t[], uint32_t[]);
/* Set the function pointer */
- iap = (void (*)(uint32_t[], uint32_t[])) IAP_ADDRESS;
+ iap = (void (*)(uint32_t[], uint32_t[]))IAP_ADDRESS;
/* Read UUID */
iap(&command, result);
diff --git a/cpu/lpc1768/periph/uart.c b/cpu/lpc1768/periph/uart.c
index 8897b2619..e9bf35249 100644
--- a/cpu/lpc1768/periph/uart.c
+++ b/cpu/lpc1768/periph/uart.c
@@ -45,20 +45,20 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
switch (uart) {
#if UART_0_EN
case UART_0:
- /* configure and enable global device interrupts */
- NVIC_SetPriority(UART_0_IRQ, UART_IRQ_PRIO);
- NVIC_EnableIRQ(UART_0_IRQ);
- /* enable RX interrupt */
- UART_0_DEV->IER |= (1 << 0);
+ /* configure and enable global device interrupts */
+ NVIC_SetPriority(UART_0_IRQ, UART_IRQ_PRIO);
+ NVIC_EnableIRQ(UART_0_IRQ);
+ /* enable RX interrupt */
+ UART_0_DEV->IER |= (1 << 0);
break;
#endif
#if UART_1_EN
case UART_1:
- /* configure and enable global device interrupts */
- NVIC_SetPriority(UART_1_IRQ, UART_IRQ_PRIO);
- NVIC_EnableIRQ(UART_1_IRQ);
- /* enable RX interrupt */
- UART_1_DEV->IER |= (1 << 0);
+ /* configure and enable global device interrupts */
+ NVIC_SetPriority(UART_1_IRQ, UART_IRQ_PRIO);
+ NVIC_EnableIRQ(UART_1_IRQ);
+ /* enable RX interrupt */
+ UART_1_DEV->IER |= (1 << 0);
break;
#endif
}
diff --git a/cpu/lpc2387/include/cpu.h b/cpu/lpc2387/include/cpu.h
index 289dc14b1..d7af4a476 100644
--- a/cpu/lpc2387/include/cpu.h
+++ b/cpu/lpc2387/include/cpu.h
@@ -49,7 +49,7 @@ void gpio_init_ports(void);
static inline void cpu_print_last_instruction(void)
{
register uint32_t *lr_ptr;
- __asm__ __volatile__("mov %0, lr" : "=r"(lr_ptr));
+ __asm__ __volatile__ ("mov %0, lr" : "=r" (lr_ptr));
printf("%p\n", (void*) lr_ptr);
}
diff --git a/cpu/lpc2387/lpc23xx-iap.c b/cpu/lpc2387/lpc23xx-iap.c
index 6bd41dce6..b6019f4cd 100644
--- a/cpu/lpc2387/lpc23xx-iap.c
+++ b/cpu/lpc2387/lpc23xx-iap.c
@@ -157,7 +157,7 @@ static uint32_t iap(uint32_t code, uint32_t p1, uint32_t p2, uint32_t p3, uint32
iap_command[3] = p3; /* set 3rd param */
iap_command[4] = p4; /* set 4th param */
- ((void (*)())0x7ffffff1)(iap_command, iap_result); /* IAP entry point */
+ ((void (*)()) 0x7ffffff1)(iap_command, iap_result); /* IAP entry point */
return *iap_result;
}
@@ -184,7 +184,7 @@ static uint32_t iap(uint32_t code, uint32_t p1, uint32_t p2, uint32_t p3, uint32
*****************************************************************************/
uint32_t blank_check_sector(uint32_t tmp_sect1, uint32_t tmp_sect2)
{
- return iap(BLANK_CHECK_SECTOR, tmp_sect1, tmp_sect2, 0 , 0);
+ return iap(BLANK_CHECK_SECTOR, tmp_sect1, tmp_sect2, 0, 0);
}
@@ -241,7 +241,7 @@ uint32_t copy_ram_to_flash(uint32_t tmp_adr_dst, uint32_t tmp_adr_src, uint32_t
*****************************************************************************/
uint32_t prepare_sectors(uint32_t tmp_sect1, uint32_t tmp_sect2)
{
- return iap(PREPARE_SECTOR_FOR_WRITE_OPERATION, tmp_sect1, tmp_sect2, 0 , 0);
+ return iap(PREPARE_SECTOR_FOR_WRITE_OPERATION, tmp_sect1, tmp_sect2, 0, 0);
}
diff --git a/cpu/lpc2387/mci/lpc2387-mci.c b/cpu/lpc2387/mci/lpc2387-mci.c
index 941c67fad..62f71af28 100644
--- a/cpu/lpc2387/mci/lpc2387-mci.c
+++ b/cpu/lpc2387/mci/lpc2387-mci.c
@@ -2,15 +2,15 @@
/* MMCv3/SDv1/SDv2 (in native mode via MCI) control module (C)ChaN, 2010 */
/*-----------------------------------------------------------------------*/
/* This program is opened under license policy of following trems.
-/
-/ Copyright (C) 2010, ChaN, all right reserved.
-/
-/ * This program is a free software and there is NO WARRANTY.
-/ * No restriction on use. You can use, modify and redistribute it for
-/ personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
-/ * Redistributions of source code must retain the above copyright notice.
-/
-/---------------------------------------------------------------------------*/
+ /
+ / Copyright (C) 2010, ChaN, all right reserved.
+ /
+ / * This program is a free software and there is NO WARRANTY.
+ / * No restriction on use. You can use, modify and redistribute it for
+ / personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
+ / * Redistributions of source code must retain the above copyright notice.
+ /
+ /---------------------------------------------------------------------------*/
#include <string.h>
#include "cpu.h"
@@ -29,8 +29,8 @@
#define MCLK_RW 18000000UL /* MCICLK for data transfer (PCLK divided by even number) */
/* This MCI driver assumes that MCLK_RW is CCLK/4 or slower. If block buffer underrun/overrun
-/ occured due to any interrupt by higher priority process or slow external memory, increasing
-/ N_BUF or decreasing MCLK_RW will solve it. */
+ / occured due to any interrupt by higher priority process or slow external memory, increasing
+ / N_BUF or decreasing MCLK_RW will solve it. */
/* ----- Port definitions ----- */
@@ -76,17 +76,17 @@
Module Private Functions
----------------------------------------------------------------------------*/
+ ---------------------------------------------------------------------------*/
static volatile diskio_sta_t Stat = DISKIO_STA_NOINIT; /* Disk status */
static unsigned short CardRCA; /* Assigned RCA */
static unsigned char CardType, /* Card type flag */
- CardInfo[16 + 16 + 4]; /* CSD(16), CID(16), OCR(4) */
+ CardInfo[16 + 16 + 4]; /* CSD(16), CID(16), OCR(4) */
static volatile unsigned char XferStat, /* b3:MCI error, b2:Overrun, b1:Write, b0:Read */
- XferWc, /* Write block counter */
- XferWp, XferRp; /* R/W index of block FIFO */
+ XferWc, /* Write block counter */
+ XferWp, XferRp; /* R/W index of block FIFO */
static unsigned long DmaBuff[N_BUF][128] __attribute__((section(".usbdata"))); /* Block transfer FIFO */
static unsigned long LinkList [N_BUF][4] __attribute__((section(".usbdata"))); /* DMA link list */
@@ -384,7 +384,7 @@ static int send_cmd(unsigned int idx, unsigned long arg, unsigned int rt, unsign
if (idx & 0x80) { /* Send a CMD55 prior to the specified command if it is ACMD class */
if (!send_cmd(CMD55, (unsigned long)CardRCA << 16, 1, buff) /* When CMD55 is faild, */
- || !(buff[0] & 0x00000020)) {
+ || !(buff[0] & 0x00000020)) {
return 0; /* exit with error */
}
}
@@ -480,7 +480,7 @@ static int wait_ready(unsigned short tmr)
uint32_t stoppoll = xtimer_now_usec() + tmr * US_PER_MS;
bool bBreak = false;
- while (xtimer_now_usec() < stoppoll/*Timer[0]*/) {
+ while (xtimer_now_usec() < stoppoll /*Timer[0]*/) {
if (send_cmd(CMD13, (unsigned long) CardRCA << 16, 1, &rc) && ((rc & 0x01E00) == 0x00800)) {
bBreak = true;
break;
@@ -511,7 +511,7 @@ static void bswap_cp(unsigned char *dst, const unsigned long *src)
Public Functions
----------------------------------------------------------------------------*/
+ ---------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------*/
/* Initialize Disk Drive */
@@ -551,7 +551,7 @@ diskio_sta_t mci_initialize(void)
do {
/* Wait while card is busy state (use ACMD41 with HCS bit) */
/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
- if (xtimer_now_usec() > (start + 1000000/* !Timer[0] */)) {
+ if (xtimer_now_usec() > (start + 1000000 /* !Timer[0] */)) {
DEBUG("%s, %d: Timeout #1\n", RIOT_FILE_RELATIVE, __LINE__);
goto di_fail;
}
@@ -577,7 +577,7 @@ diskio_sta_t mci_initialize(void)
DEBUG("%s, %d: %lX\n", RIOT_FILE_RELATIVE, __LINE__, resp[0]);
/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
- if (xtimer_now_usec() > (start + 1000000/* !Timer[0] */)) {
+ if (xtimer_now_usec() > (start + 1000000 /* !Timer[0] */)) {
DEBUG("now: %lu, started at: %lu\n", xtimer_now_usec(), start);
DEBUG("%s, %d: Timeout #2\n", RIOT_FILE_RELATIVE, __LINE__);
goto di_fail;
@@ -647,7 +647,7 @@ diskio_sta_t mci_initialize(void)
if (ty & CT_SDC) { /* Set wide bus mode (for SDCs) */
if (!send_cmd(ACMD6, 2, 1, resp) /* Set bus mode of SDC */
- || (resp[0] & 0xFDF90000)) {
+ || (resp[0] & 0xFDF90000)) {
//printf("MCI ACMD6 fail\n");
goto di_fail;
}
@@ -718,7 +718,7 @@ diskio_result_t mci_read(unsigned char *buff, unsigned long sector, unsigned cha
cmd = (count > 1) ? CMD18 : CMD17; /* Transfer type: Single block or Multiple block */
if (send_cmd(cmd, sector, 1, &resp) /* Start to read */
- && !(resp & 0xC0580000)) {
+ && !(resp & 0xC0580000)) {
unsigned char rp = 0;
do {
@@ -797,7 +797,7 @@ diskio_result_t mci_write(const unsigned char *buff, unsigned long sector, unsig
cmd = (CardType & CT_SDC) ? ACMD23 : CMD23;
if (!send_cmd(cmd, count, 1, &rc) /* Preset number of blocks to write */
- || (rc & 0xC0580000)) {
+ || (rc & 0xC0580000)) {
return DISKIO_RES_ERROR;
}
@@ -805,7 +805,7 @@ diskio_result_t mci_write(const unsigned char *buff, unsigned long sector, unsig
}
if (!send_cmd(cmd, sector, 1, &rc) /* Send a write command */
- || (rc & 0xC0580000)) {
+ || (rc & 0xC0580000)) {
return DISKIO_RES_ERROR;
}
@@ -869,7 +869,7 @@ diskio_result_t mci_write(const unsigned char *buff, unsigned long sector, unsig
diskio_result_t mci_ioctl(
unsigned char ctrl, /* Control code */
void *buff /* Buffer to send/receive data block */
-)
+ )
{
diskio_result_t res;
unsigned char *ptr = (unsigned char *)buff;
@@ -883,14 +883,14 @@ diskio_result_t mci_ioctl(
res = DISKIO_RES_ERROR;
switch(ctrl) {
- case CTRL_SYNC : /* Make sure that all data has been written on the media */
+ case CTRL_SYNC: /* Make sure that all data has been written on the media */
if (wait_ready(500)) { /* Wait for card enters tarn state */
res = DISKIO_RES_OK;
}
break;
- case GET_SECTOR_COUNT : /* Get number of sectors on the disk (unsigned long) */
+ case GET_SECTOR_COUNT: /* Get number of sectors on the disk (unsigned long) */
if ((CardInfo[0] >> 6) == 1) { /* SDC CSD v2.0 */
d = ((unsigned short)CardInfo[8] << 8) + CardInfo[9] + 1;
*(unsigned long *)buff = d << 10;
@@ -904,12 +904,12 @@ diskio_result_t mci_ioctl(
res = DISKIO_RES_OK;
break;
- case GET_SECTOR_SIZE : /* Get sectors on the disk (unsigned short) */
+ case GET_SECTOR_SIZE: /* Get sectors on the disk (unsigned short) */
*(unsigned short *)buff = 512;
res = DISKIO_RES_OK;
break;
- case GET_BLOCK_SIZE : /* Get erase block size in unit of sectors (unsigned long) */
+ case GET_BLOCK_SIZE: /* Get erase block size in unit of sectors (unsigned long) */
if (CardType & CT_SD2) { /* SDC ver 2.00 */
*(unsigned long *)buff = 16UL << (CardInfo[10] >> 4);
}
@@ -925,7 +925,7 @@ diskio_result_t mci_ioctl(
res = DISKIO_RES_OK;
break;
- case CTRL_ERASE_SECTOR : /* Erase a block of sectors */
+ case CTRL_ERASE_SECTOR: /* Erase a block of sectors */
if (!(CardType & CT_SDC) || (!(CardInfo[0] >> 6) && !(CardInfo[10] & 0x40))) {
break; /* Check if sector erase can be applied to the card */
}
@@ -945,7 +945,7 @@ diskio_result_t mci_ioctl(
break;
- case CTRL_POWER :
+ case CTRL_POWER:
switch(ptr[0]) {
case 0: /* Sub control code == 0 (POWER_OFF) */
power_off(); /* Power off */
@@ -957,39 +957,39 @@ diskio_result_t mci_ioctl(
res = DISKIO_RES_OK;
break;
- default :
+ default:
res = DISKIO_RES_PARERR;
}
break;
- case MMC_GET_TYPE : /* Get card type flags (1 byte) */
+ case MMC_GET_TYPE: /* Get card type flags (1 byte) */
*ptr = CardType;
res = DISKIO_RES_OK;
break;
- case MMC_GET_CSD : /* Get CSD (16 bytes) */
+ case MMC_GET_CSD: /* Get CSD (16 bytes) */
memcpy(buff, &CardInfo[0], 16);
res = DISKIO_RES_OK;
break;
- case MMC_GET_CID : /* Get CID (16 bytes) */
+ case MMC_GET_CID: /* Get CID (16 bytes) */
memcpy(buff, &CardInfo[16], 16);
res = DISKIO_RES_OK;
break;
- case MMC_GET_OCR : /* Get OCR (4 bytes) */
+ case MMC_GET_OCR: /* Get OCR (4 bytes) */
memcpy(buff, &CardInfo[32], 4);
res = DISKIO_RES_OK;
break;
- case MMC_GET_SDSTAT : /* Receive SD status as a data block (64 bytes) */
+ case MMC_GET_SDSTAT: /* Receive SD status as a data block (64 bytes) */
if (CardType & CT_SDC) { /* SDC */
if (wait_ready(500)) {
ready_reception(1, 64); /* Ready to receive data blocks */
if (send_cmd(ACMD13, 0, 1, resp) /* Start to read */
- && !(resp[0] & 0xC0580000)) {
+ && !(resp[0] & 0xC0580000)) {
while ((XferWp == 0) && !(XferStat & 0xC)) {}
if (!(XferStat & 0xC)) {
diff --git a/cpu/lpc2387/periph/gpio.c b/cpu/lpc2387/periph/gpio.c
index a36e28fc5..53804e044 100644
--- a/cpu/lpc2387/periph/gpio.c
+++ b/cpu/lpc2387/periph/gpio.c
@@ -94,7 +94,7 @@ int gpio_init_mux(unsigned pin, unsigned mux)
}
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
- gpio_cb_t cb, void *arg)
+ gpio_cb_t cb, void *arg)
{
(void)mode;
@@ -163,14 +163,14 @@ static void _gpio_configure(gpio_t pin, unsigned rising, unsigned falling)
volatile unsigned long *en_clr;
if (!port) {
- en_f = &IO0_INT_EN_F;
- en_r = &IO0_INT_EN_R;
- en_clr = &IO0_INT_CLR;
+ en_f = &IO0_INT_EN_F;
+ en_r = &IO0_INT_EN_R;
+ en_clr = &IO0_INT_CLR;
}
else {
- en_f = &IO2_INT_EN_F;
- en_r = &IO2_INT_EN_R;
- en_clr = &IO2_INT_CLR;
+ en_f = &IO2_INT_EN_F;
+ en_r = &IO2_INT_EN_R;
+ en_clr = &IO2_INT_CLR;
}
/* configure irq */
@@ -208,8 +208,8 @@ void gpio_irq_enable(gpio_t pin)
}
_gpio_configure(pin,
- bf_isset(_gpio_rising, _state_index),
- bf_isset(_gpio_falling, _state_index));
+ bf_isset(_gpio_rising, _state_index),
+ bf_isset(_gpio_falling, _state_index));
}
void gpio_irq_disable(gpio_t dev)
diff --git a/cpu/lpc2387/periph/rtc.c b/cpu/lpc2387/periph/rtc.c
index 8e73b0505..08ce23b89 100644
--- a/cpu/lpc2387/periph/rtc.c
+++ b/cpu/lpc2387/periph/rtc.c
@@ -7,18 +7,18 @@
* directory for more details.
*/
- /**
- * @ingroup cpu_lpc2387
- * @ingroup drivers_periph_rtc
- * @{
- *
- * @file
- * @brief Peripheral UART driver implementation
- *
- * @author Kaspar Schleiser <kaspar@schleiser.de>
- *
- * @}
- */
+/**
+ * @ingroup cpu_lpc2387
+ * @ingroup drivers_periph_rtc
+ * @{
+ *
+ * @file
+ * @brief Peripheral UART driver implementation
+ *
+ * @author Kaspar Schleiser <kaspar@schleiser.de>
+ *
+ * @}
+ */
#include <sys/time.h>
#include <stdint.h>
@@ -63,7 +63,7 @@ void rtc_init(void)
}
DEBUG("%2lu.%2lu.%4lu %2lu:%2lu:%2lu\n",
- RTC_DOM, RTC_MONTH, RTC_YEAR, RTC_HOUR, RTC_MIN, RTC_SEC);
+ RTC_DOM, RTC_MONTH, RTC_YEAR, RTC_HOUR, RTC_MIN, RTC_SEC);
}
/**
diff --git a/cpu/lpc2387/periph/uart.c b/cpu/lpc2387/periph/uart.c
index 59f91e39c..2b218ab72 100644
--- a/cpu/lpc2387/periph/uart.c
+++ b/cpu/lpc2387/periph/uart.c
@@ -84,10 +84,10 @@ void UART0_IRQHandler(void)
switch (U0IIR & UIIR_ID_MASK) {
case UIIR_CTI_INT: /* Character Timeout Indicator */
case UIIR_RDA_INT: /* Receive Data Available */
- do {
- uint8_t c = (uint8_t)U0RBR;
- _rx_cb(_cb_arg, c);
- } while (U0LSR & ULSR_RDR);
+ do {
+ uint8_t c = (uint8_t)U0RBR;
+ _rx_cb(_cb_arg, c);
+ } while (U0LSR & ULSR_RDR);
break;
default:
diff --git a/cpu/mips32r2_common/newlib_syscalls_mips_uhi/syscalls.c b/cpu/mips32r2_common/newlib_syscalls_mips_uhi/syscalls.c
index 4e724bb92..b93d14045 100644
--- a/cpu/mips32r2_common/newlib_syscalls_mips_uhi/syscalls.c
+++ b/cpu/mips32r2_common/newlib_syscalls_mips_uhi/syscalls.c
@@ -7,17 +7,17 @@
*/
/**
- * @ingroup sys_newlib
- * @{
- *
- * @file
- * @brief Newlib system call implementation for use with the mips-mti-elf
- * toolchain newlib incorporating as semi-hosting interface called 'UHI'
- *
- * @author Neil Jones <neil.jones@imgtec.com>
- *
- * @}
- */
+ * @ingroup sys_newlib
+ * @{
+ *
+ * @file
+ * @brief Newlib system call implementation for use with the mips-mti-elf
+ * toolchain newlib incorporating as semi-hosting interface called 'UHI'
+ *
+ * @author Neil Jones <neil.jones@imgtec.com>
+ *
+ * @}
+ */
#include <unistd.h>
#include <reent.h>
@@ -57,13 +57,13 @@ __attribute__((used)) void _fini(void)
}
/**
-* @brief Exit a program without cleaning up files
-*
-* If your system doesn't provide this, it is best to avoid linking with subroutines that
-* require it (exit, system).
-*
-* @param n the exit code, 0 for all OK, >0 for not OK
-*/
+ * @brief Exit a program without cleaning up files
+ *
+ * If your system doesn't provide this, it is best to avoid linking with subroutines that
+ * require it (exit, system).
+ *
+ * @param n the exit code, 0 for all OK, >0 for not OK
+ */
void _exit(int n)
{
@@ -78,14 +78,14 @@ void _exit(int n)
}
/**
-* @brief Allocate memory from the heap.
-*
-* The current heap implementation is very rudimentary, it is only able to allocate
-* memory. But it does not have any means to free memory again
-*
-* @return pointer to the newly allocated memory on success
-* @return pointer set to address `-1` on failure
-*/
+ * @brief Allocate memory from the heap.
+ *
+ * The current heap implementation is very rudimentary, it is only able to allocate
+ * memory. But it does not have any means to free memory again
+ *
+ * @return pointer to the newly allocated memory on success
+ * @return pointer set to address `-1` on failure
+ */
void *_sbrk_r(struct _reent *r, ptrdiff_t incr)
{
@@ -102,20 +102,20 @@ void *_sbrk_r(struct _reent *r, ptrdiff_t incr)
}
/**
-* @brief Get the process-ID of the current thread
-*
-* @return the process ID of the current thread
-*/
+ * @brief Get the process-ID of the current thread
+ *
+ * @return the process ID of the current thread
+ */
pid_t _getpid(void)
{
return sched_active_pid;
}
/**
-* @brief Get the process-ID of the current thread
-*
-* @return the process ID of the current thread
-*/
+ * @brief Get the process-ID of the current thread
+ *
+ * @return the process ID of the current thread
+ */
pid_t _getpid_r(struct _reent *ptr)
{
(void) ptr;
@@ -123,15 +123,15 @@ pid_t _getpid_r(struct _reent *ptr)
}
/**
-* @brief Send a signal to a given thread
-*
-* @param r pointer to reent structure
-* @param pid process ID to kill
-* @param sig signal number to pass to process
-*
-* @return -1 on error
-* @return 0 on sucess
-*/
+ * @brief Send a signal to a given thread
+ *
+ * @param r pointer to reent structure
+ * @param pid process ID to kill
+ * @param sig signal number to pass to process
+ *
+ * @return -1 on error
+ * @return 0 on sucess
+ */
__attribute__ ((weak))
int _kill_r(struct _reent *r, pid_t pid, int sig)
{
@@ -142,18 +142,18 @@ int _kill_r(struct _reent *r, pid_t pid, int sig)
}
/**
-* @brief Open a file
-*
-* This is a wrapper around @c _open
-*
-* @param r pointer to reent structure
-* @param name file name to open
-* @param flags flags, see man 3p open
-* @param mode mode, file creation mode if the file is created when opening
-*
-* @return fd number (>= 0) on success
-* @return -1 on error
-*/
+ * @brief Open a file
+ *
+ * This is a wrapper around @c _open
+ *
+ * @param r pointer to reent structure
+ * @param name file name to open
+ * @param flags flags, see man 3p open
+ * @param mode mode, file creation mode if the file is created when opening
+ *
+ * @return fd number (>= 0) on success
+ * @return -1 on error
+ */
int _open_r(struct _reent *r, const char *name, int flags, int mode)
{
(void)r;
@@ -161,18 +161,18 @@ int _open_r(struct _reent *r, const char *name, int flags, int mode)
}
/**
-* @brief Read bytes from an open file
-*
-* This is a wrapper around @c _read
-*
-* @param[in] r pointer to reent structure
-* @param[in] fd open file descriptor obtained from @c open()
-* @param[out] dest destination buffer
-* @param[in] count maximum number of bytes to read
-*
-* @return number of bytes read on success
-* @return -1 on error,
-*/
+ * @brief Read bytes from an open file
+ *
+ * This is a wrapper around @c _read
+ *
+ * @param[in] r pointer to reent structure
+ * @param[in] fd open file descriptor obtained from @c open()
+ * @param[out] dest destination buffer
+ * @param[in] count maximum number of bytes to read
+ *
+ * @return number of bytes read on success
+ * @return -1 on error,
+ */
_ssize_t _read_r(struct _reent *r, int fd, void *dest, size_t count)
{
(void)r;
@@ -180,18 +180,18 @@ _ssize_t _read_r(struct _reent *r, int fd, void *dest, size_t count)
}
/**
-* @brief Write bytes to an open file
-*
-* This is a wrapper around @c _write
-*
-* @param[in] r pointer to reent structure
-* @param[in] fd open file descriptor obtained from @c open()
-* @param[in] src source data buffer
-* @param[in] count maximum number of bytes to write
-*
-* @return number of bytes written on success
-* @return -1 on error
-*/
+ * @brief Write bytes to an open file
+ *
+ * This is a wrapper around @c _write
+ *
+ * @param[in] r pointer to reent structure
+ * @param[in] fd open file descriptor obtained from @c open()
+ * @param[in] src source data buffer
+ * @param[in] count maximum number of bytes to write
+ *
+ * @return number of bytes written on success
+ * @return -1 on error
+ */
_ssize_t _write_r(struct _reent *r, int fd, const void *src, size_t count)
{
(void)r;
@@ -200,19 +200,19 @@ _ssize_t _write_r(struct _reent *r, int fd, const void *src, size_t count)
}
/**
-* @brief Close an open file
-*
-* This is a wrapper around @c _close
-*
-* If this call returns an error, the fd should still be considered invalid and
-* no further attempt to use it shall be made, not even to retry @c close()
-*
-* @param[in] r pointer to reent structure
-* @param[in] fd open file descriptor obtained from @c open()
-*
-* @return 0 on success
-* @return -1 on error
-*/
+ * @brief Close an open file
+ *
+ * This is a wrapper around @c _close
+ *
+ * If this call returns an error, the fd should still be considered invalid and
+ * no further attempt to use it shall be made, not even to retry @c close()
+ *
+ * @param[in] r pointer to reent structure
+ * @param[in] fd open file descriptor obtained from @c open()
+ *
+ * @return 0 on success
+ * @return -1 on error
+ */
int _close_r(struct _reent *r, int fd)
{
(void)r;
@@ -221,18 +221,18 @@ int _close_r(struct _reent *r, int fd)
}
/**
-* @brief Query or set options on an open file
-*
-* This is a wrapper around @c _fcntl
-*
-* @param[in] r pointer to reent structure
-* @param[in] fd open file descriptor obtained from @c open()
-* @param[in] cmd fcntl command, see man 3p fcntl
-* @param[in] arg argument to fcntl command, see man 3p fcntl
-*
-* @return 0 on success
-* @return -1 on error
-*/
+ * @brief Query or set options on an open file
+ *
+ * This is a wrapper around @c _fcntl
+ *
+ * @param[in] r pointer to reent structure
+ * @param[in] fd open file descriptor obtained from @c open()
+ * @param[in] cmd fcntl command, see man 3p fcntl
+ * @param[in] arg argument to fcntl command, see man 3p fcntl
+ *
+ * @return 0 on success
+ * @return -1 on error
+ */
int _fcntl_r (struct _reent *r, int fd, int cmd, int arg)
{
(void)r;
@@ -241,25 +241,25 @@ int _fcntl_r (struct _reent *r, int fd, int cmd, int arg)
}
/**
-* @brief Seek to position in file
-*
-* This is a wrapper around @c _lseek
-*
-* @p whence determines the function of the seek and should be set to one of
-* the following values:
-*
-* - @c SEEK_SET: Seek to absolute offset @p off
-* - @c SEEK_CUR: Seek to current location + @p off
-* - @c SEEK_END: Seek to end of file + @p off
-*
-* @param[in] r pointer to reent structure
-* @param[in] fd open file descriptor obtained from @c open()
-* @param[in] off seek offset
-* @param[in] whence determines the seek method, see detailed description
-*
-* @return the new seek location in the file on success
-* @return -1 on error
-*/
+ * @brief Seek to position in file
+ *
+ * This is a wrapper around @c _lseek
+ *
+ * @p whence determines the function of the seek and should be set to one of
+ * the following values:
+ *
+ * - @c SEEK_SET: Seek to absolute offset @p off
+ * - @c SEEK_CUR: Seek to current location + @p off
+ * - @c SEEK_END: Seek to end of file + @p off
+ *
+ * @param[in] r pointer to reent structure
+ * @param[in] fd open file descriptor obtained from @c open()
+ * @param[in] off seek offset
+ * @param[in] whence determines the seek method, see detailed description
+ *
+ * @return the new seek location in the file on success
+ * @return -1 on error
+ */
_off_t _lseek_r(struct _reent *r, int fd, _off_t off, int whence)
{
(void)r;
@@ -268,17 +268,17 @@ _off_t _lseek_r(struct _reent *r, int fd, _off_t off, int whence)
}
/**
-* @brief Get status of an open file
-*
-* This is a wrapper around @c _fstat
-*
-* @param[in] r pointer to reent structure
-* @param[in] fd open file descriptor obtained from @c open()
-* @param[out] buf pointer to stat struct to fill
-*
-* @return 0 on success
-* @return -1 on error
-*/
+ * @brief Get status of an open file
+ *
+ * This is a wrapper around @c _fstat
+ *
+ * @param[in] r pointer to reent structure
+ * @param[in] fd open file descriptor obtained from @c open()
+ * @param[out] buf pointer to stat struct to fill
+ *
+ * @return 0 on success
+ * @return -1 on error
+ */
int _fstat_r(struct _reent *r, int fd, struct stat *buf)
{
(void)r;
@@ -287,14 +287,14 @@ int _fstat_r(struct _reent *r, int fd, struct stat *buf)
}
/*
-* @brief Unlink (delete) a file
-*
-* @param[in] r pointer to reent structure
-* @param[in] path path to file to be deleted
-*
-* @return 0 on success
-* @return -1 on error
-*/
+ * @brief Unlink (delete) a file
+ *
+ * @param[in] r pointer to reent structure
+ * @param[in] path path to file to be deleted
+ *
+ * @return 0 on success
+ * @return -1 on error
+ */
int _unlink_r(struct _reent *r, const char *path)
{
(void)r;
@@ -303,15 +303,15 @@ int _unlink_r(struct _reent *r, const char *path)
}
/**
-* @brief Query whether output stream is a terminal
-*
-* @param r pointer to reent structure
-* @param fd descriptor of stream to query
-*
-* @return 0 for none tty
-* @return 1 for tty
-*
-*/
+ * @brief Query whether output stream is a terminal
+ *
+ * @param r pointer to reent structure
+ * @param fd descriptor of stream to query
+ *
+ * @return 0 for none tty
+ * @return 1 for tty
+ *
+ */
int _isatty_r(struct _reent *r, int fd)
{
r->_errno = 0;
@@ -322,15 +322,15 @@ int _isatty_r(struct _reent *r, int fd)
}
/**
-* @brief Send a signal to a thread
-*
-* @param[in] pid the pid to send to
-* @param[in] sig the signal to send
-*
-* @return 0 on success
-* @return -1 on error
-*
-*/
+ * @brief Send a signal to a thread
+ *
+ * @param[in] pid the pid to send to
+ * @param[in] sig the signal to send
+ *
+ * @return 0 on success
+ * @return -1 on error
+ *
+ */
__attribute__ ((weak))
int _kill(pid_t pid, int sig)
{
diff --git a/cpu/mips32r2_common/periph/timer.c b/cpu/mips32r2_common/periph/timer.c
index 16e373f2f..ec6b34dbe 100644
--- a/cpu/mips32r2_common/periph/timer.c
+++ b/cpu/mips32r2_common/periph/timer.c
@@ -6,16 +6,16 @@
* directory for more details.
*/
- /**
- * @ingroup cpu_mips32r2_common
- * @ingroup drivers_periph_timer
- * @{
- *
- * @file
- * @brief Implementation of the low-level timer driver
- *
- * @}
- */
+/**
+ * @ingroup cpu_mips32r2_common
+ * @ingroup drivers_periph_timer
+ * @{
+ *
+ * @file
+ * @brief Implementation of the low-level timer driver
+ *
+ * @}
+ */
#include <mips/cpu.h>
#include <mips/m32c0.h>
diff --git a/cpu/mips32r2_common/thread_arch.c b/cpu/mips32r2_common/thread_arch.c
index 4fae163d8..56b75d2f6 100644
--- a/cpu/mips32r2_common/thread_arch.c
+++ b/cpu/mips32r2_common/thread_arch.c
@@ -61,7 +61,7 @@ static struct fp64ctx *oldfpctx; /* fpu context of last task that executed
*/
char *thread_stack_init(thread_task_func_t task_func, void *arg,
- void *stack_start, int stack_size)
+ void *stack_start, int stack_size)
{
/* make sure it is aligned to 8 bytes this is a requirement of the O32 ABI */
uintptr_t *p = (uintptr_t *)(((long)(stack_start) + stack_size) & ~7);
@@ -334,7 +334,7 @@ _mips_handle_exception(struct gpctx *ctx, int exception)
UNREACHABLE();
}
- break;
+ break;
#ifdef MIPS_HARD_FLOAT
case EXC_CPU:
{
@@ -373,7 +373,7 @@ _mips_handle_exception(struct gpctx *ctx, int exception)
*/
oldfpctx = currentfpctx;
- return;
+ return;
}
#endif
diff --git a/cpu/mips_pic32_common/periph/cpuid.c b/cpu/mips_pic32_common/periph/cpuid.c
index 22842e8e1..6cbf8db31 100644
--- a/cpu/mips_pic32_common/periph/cpuid.c
+++ b/cpu/mips_pic32_common/periph/cpuid.c
@@ -12,7 +12,7 @@
#include "board.h"
#include "periph/cpuid.h"
- void cpuid_get(void *id)
- {
+void cpuid_get(void *id)
+{
memcpy(id, (uint32_t*)&DEVID, CPUID_LEN);
- }
+}
diff --git a/cpu/mips_pic32_common/periph/gpio.c b/cpu/mips_pic32_common/periph/gpio.c
index 396d0d574..908cf71e7 100644
--- a/cpu/mips_pic32_common/periph/gpio.c
+++ b/cpu/mips_pic32_common/periph/gpio.c
@@ -8,16 +8,16 @@
*
*/
- /**
- * @ingroup cpu_mips_pic32_common
- * @ingroup drivers_periph_gpio
- * @{
- *
- * @file
- * @brief Low-level GPIO driver implementation
- *
- * @}
- */
+/**
+ * @ingroup cpu_mips_pic32_common
+ * @ingroup drivers_periph_gpio
+ * @{
+ *
+ * @file
+ * @brief Low-level GPIO driver implementation
+ *
+ * @}
+ */
#include <assert.h>
#include <stdint.h>
@@ -56,7 +56,7 @@ static PIC32_GPIO_T base_address[] = {
.tris = (volatile uint32_t*)&TRISA
},
#else
- {0 , 0, 0},
+ {0, 0, 0},
#endif
#ifdef _PORTB_BASE_ADDRESS
{
@@ -65,7 +65,7 @@ static PIC32_GPIO_T base_address[] = {
.tris = (volatile uint32_t*)&TRISB
},
#else
- {0 , 0, 0},
+ {0, 0, 0},
#endif
#ifdef _PORTC_BASE_ADDRESS
{
@@ -74,7 +74,7 @@ static PIC32_GPIO_T base_address[] = {
.tris = (volatile uint32_t*)&TRISC
},
#else
- {0 , 0, 0},
+ {0, 0, 0},
#endif
#ifdef _PORTD_BASE_ADDRESS
{
@@ -83,7 +83,7 @@ static PIC32_GPIO_T base_address[] = {
.tris = (volatile uint32_t*)&TRISD
},
#else
- {0 , 0, 0},
+ {0, 0, 0},
#endif
#ifdef _PORTE_BASE_ADDRESS
{
@@ -92,7 +92,7 @@ static PIC32_GPIO_T base_address[] = {
.tris = (volatile uint32_t*)&TRISE
},
#else
- {0 , 0, 0},
+ {0, 0, 0},
#endif
#ifdef _PORTF_BASE_ADDRESS
{
@@ -101,7 +101,7 @@ static PIC32_GPIO_T base_address[] = {
.tris = (volatile uint32_t*)&TRISF
},
#else
- {0 , 0, 0},
+ {0, 0, 0},
#endif
#ifdef _PORTG_BASE_ADDRESS
{
@@ -110,14 +110,14 @@ static PIC32_GPIO_T base_address[] = {
.tris = (volatile uint32_t*)&TRISG
},
#else
- {0 , 0, 0},
+ {0, 0, 0},
#endif
};
static inline int check_valid_port(uint8_t port)
{
return port < (sizeof(base_address)/sizeof(base_address[0]))
- && base_address[port].gpio != NULL;
+ && base_address[port].gpio != NULL;
}
int gpio_init(gpio_t pin, gpio_mode_t mode)
diff --git a/cpu/mips_pic32_common/periph/hwrng.c b/cpu/mips_pic32_common/periph/hwrng.c
index 8512b24e0..7dae246b1 100644
--- a/cpu/mips_pic32_common/periph/hwrng.c
+++ b/cpu/mips_pic32_common/periph/hwrng.c
@@ -25,9 +25,9 @@ void hwrng_init(void)
RNGCON = _RNGCON_TRNGEN_MASK;
/*
- * Wait to have at least 64 bits before setting the 64-bit seed
- * of the pseudo random generator.
- */
+ * Wait to have at least 64 bits before setting the 64-bit seed
+ * of the pseudo random generator.
+ */
while (RNGCNT < 64) {}
/* Load seed from the TRNG */
diff --git a/cpu/mips_pic32_common/periph/uart.c b/cpu/mips_pic32_common/periph/uart.c
index db089f47b..576340da5 100644
--- a/cpu/mips_pic32_common/periph/uart.c
+++ b/cpu/mips_pic32_common/periph/uart.c
@@ -8,16 +8,16 @@
*
*/
- /**
- * @ingroup cpu_mips_pic32_common
- * @ingroup drivers_periph_uart
- * @{
- *
- * @file
- * @brief Peripheral UART driver implementation
- *
- * @}
- */
+/**
+ * @ingroup cpu_mips_pic32_common
+ * @ingroup drivers_periph_uart
+ * @{
+ *
+ * @file
+ * @brief Peripheral UART driver implementation
+ *
+ * @}
+ */
#include <assert.h>
#include "periph/uart.h"
#include "board.h"
diff --git a/cpu/msp430_common/cpu.c b/cpu/msp430_common/cpu.c
index af2b83370..8d9d4519d 100644
--- a/cpu/msp430_common/cpu.c
+++ b/cpu/msp430_common/cpu.c
@@ -20,7 +20,7 @@
*/
__attribute__((naked)) void thread_yield_higher(void)
{
- __asm__("push r2"); /* save SR */
+ __asm__ ("push r2"); /* save SR */
__disable_irq();
__save_context();
@@ -69,7 +69,9 @@ NORETURN void cpu_switch_context_exit(void)
* To "fix" this, we put a return in section .fini9 to make main
* behave like a regular function. This enables a common
* thread_stack_init behavior. */
-__attribute__((section (".fini9"))) void __main_epilogue(void) { __asm__("ret"); }
+__attribute__((section (".fini9"))) void __main_epilogue(void) {
+ __asm__ ("ret");
+}
/* ------------------------------------------------------------------------- */
/* Processor specific routine - here for MSP */
diff --git a/cpu/msp430_common/include/cpu.h b/cpu/msp430_common/include/cpu.h
index 529c2183c..1e109eb25 100644
--- a/cpu/msp430_common/include/cpu.h
+++ b/cpu/msp430_common/include/cpu.h
@@ -50,10 +50,10 @@ extern "C" {
*/
static inline void __attribute__((always_inline)) __disable_irq(void)
{
- __asm__ __volatile__("bic %0, r2" : : "i"(GIE));
+ __asm__ __volatile__ ("bic %0, r2" : : "i" (GIE));
/* this NOP is needed to handle a "delay slot" that all MSP430 MCUs
impose silently after messing with the GIE bit, DO NOT REMOVE IT! */
- __asm__ __volatile__("nop");
+ __asm__ __volatile__ ("nop");
}
/**
@@ -61,10 +61,10 @@ static inline void __attribute__((always_inline)) __disable_irq(void)
*/
static inline void __attribute__((always_inline)) __enable_irq(void)
{
- __asm__ __volatile__("bis %0, r2" : : "i"(GIE));
+ __asm__ __volatile__ ("bis %0, r2" : : "i" (GIE));
/* this NOP is needed to handle a "delay slot" that all MSP430 MCUs
impose silently after messing with the GIE bit, DO NOT REMOVE IT! */
- __asm__ __volatile__("nop");
+ __asm__ __volatile__ ("nop");
}
/**
@@ -82,20 +82,20 @@ extern char __isr_stack[ISR_STACKSIZE];
*/
static inline void __attribute__((always_inline)) __save_context(void)
{
- __asm__("push r15");
- __asm__("push r14");
- __asm__("push r13");
- __asm__("push r12");
- __asm__("push r11");
- __asm__("push r10");
- __asm__("push r9");
- __asm__("push r8");
- __asm__("push r7");
- __asm__("push r6");
- __asm__("push r5");
- __asm__("push r4");
-
- __asm__("mov.w r1,%0" : "=r"(sched_active_thread->sp));
+ __asm__ ("push r15");
+ __asm__ ("push r14");
+ __asm__ ("push r13");
+ __asm__ ("push r12");
+ __asm__ ("push r11");
+ __asm__ ("push r10");
+ __asm__ ("push r9");
+ __asm__ ("push r8");
+ __asm__ ("push r7");
+ __asm__ ("push r6");
+ __asm__ ("push r5");
+ __asm__ ("push r4");
+
+ __asm__ ("mov.w r1,%0" : "=r" (sched_active_thread->sp));
}
/**
@@ -103,21 +103,21 @@ static inline void __attribute__((always_inline)) __save_context(void)
*/
static inline void __attribute__((always_inline)) __restore_context(void)
{
- __asm__("mov.w %0,r1" : : "m"(sched_active_thread->sp));
-
- __asm__("pop r4");
- __asm__("pop r5");
- __asm__("pop r6");
- __asm__("pop r7");
- __asm__("pop r8");
- __asm__("pop r9");
- __asm__("pop r10");
- __asm__("pop r11");
- __asm__("pop r12");
- __asm__("pop r13");
- __asm__("pop r14");
- __asm__("pop r15");
- __asm__("reti");
+ __asm__ ("mov.w %0,r1" : : "m" (sched_active_thread->sp));
+
+ __asm__ ("pop r4");
+ __asm__ ("pop r5");
+ __asm__ ("pop r6");
+ __asm__ ("pop r7");
+ __asm__ ("pop r8");
+ __asm__ ("pop r9");
+ __asm__ ("pop r10");
+ __asm__ ("pop r11");
+ __asm__ ("pop r12");
+ __asm__ ("pop r13");
+ __asm__ ("pop r14");
+ __asm__ ("pop r15");
+ __asm__ ("reti");
}
/**
@@ -126,7 +126,7 @@ static inline void __attribute__((always_inline)) __restore_context(void)
static inline void __attribute__((always_inline)) __enter_isr(void)
{
__save_context();
- __asm__("mov.w %0,r1" : : "i"(__isr_stack + ISR_STACKSIZE));
+ __asm__ ("mov.w %0,r1" : : "i" (__isr_stack + ISR_STACKSIZE));
__irq_is_in = 1;
}
diff --git a/cpu/msp430_common/include/msp430_types.h b/cpu/msp430_common/include/msp430_types.h
index a1acec8c8..1b414b0cb 100644
--- a/cpu/msp430_common/include/msp430_types.h
+++ b/cpu/msp430_common/include/msp430_types.h
@@ -56,8 +56,8 @@ typedef unsigned long time_t;
* @todo Remove once msp430 libc supports `struct timespec`
*/
struct timespec {
- time_t tv_sec; /**< seconds */
- long tv_nsec; /**< nanoseconds */
+ time_t tv_sec; /**< seconds */
+ long tv_nsec; /**< nanoseconds */
};
/**
diff --git a/cpu/msp430_common/include/stdatomic.h b/cpu/msp430_common/include/stdatomic.h
index 052fbf0db..d38573eb7 100644
--- a/cpu/msp430_common/include/stdatomic.h
+++ b/cpu/msp430_common/include/stdatomic.h
@@ -192,45 +192,45 @@ atomic_signal_fence(memory_order __order)
* 7.17.6 Atomic integer types.
*/
-typedef _Atomic(_Bool) atomic_bool;
-typedef _Atomic(char) atomic_char;
-typedef _Atomic(signed char) atomic_schar;
-typedef _Atomic(unsigned char) atomic_uchar;
-typedef _Atomic(short) atomic_short;
-typedef _Atomic(unsigned short) atomic_ushort;
-typedef _Atomic(int) atomic_int;
-typedef _Atomic(unsigned int) atomic_uint;
-typedef _Atomic(long) atomic_long;
-typedef _Atomic(unsigned long) atomic_ulong;
-typedef _Atomic(long long) atomic_llong;
-typedef _Atomic(unsigned long long) atomic_ullong;
+typedef _Atomic (_Bool) atomic_bool;
+typedef _Atomic (char) atomic_char;
+typedef _Atomic (signed char) atomic_schar;
+typedef _Atomic (unsigned char) atomic_uchar;
+typedef _Atomic (short) atomic_short;
+typedef _Atomic (unsigned short) atomic_ushort;
+typedef _Atomic (int) atomic_int;
+typedef _Atomic (unsigned int) atomic_uint;
+typedef _Atomic (long) atomic_long;
+typedef _Atomic (unsigned long) atomic_ulong;
+typedef _Atomic (long long) atomic_llong;
+typedef _Atomic (unsigned long long) atomic_ullong;
#if 0
-typedef _Atomic(__char16_t) atomic_char16_t;
-typedef _Atomic(__char32_t) atomic_char32_t;
+typedef _Atomic (__char16_t) atomic_char16_t;
+typedef _Atomic (__char32_t) atomic_char32_t;
#endif
-typedef _Atomic(wchar_t) atomic_wchar_t;
-typedef _Atomic(int_least8_t) atomic_int_least8_t;
-typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
-typedef _Atomic(int_least16_t) atomic_int_least16_t;
-typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
-typedef _Atomic(int_least32_t) atomic_int_least32_t;
-typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
-typedef _Atomic(int_least64_t) atomic_int_least64_t;
-typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
-typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
-typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
-typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
-typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
-typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
-typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
-typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
-typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
-typedef _Atomic(intptr_t) atomic_intptr_t;
-typedef _Atomic(uintptr_t) atomic_uintptr_t;
-typedef _Atomic(size_t) atomic_size_t;
-typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
-typedef _Atomic(intmax_t) atomic_intmax_t;
-typedef _Atomic(uintmax_t) atomic_uintmax_t;
+typedef _Atomic (wchar_t) atomic_wchar_t;
+typedef _Atomic (int_least8_t) atomic_int_least8_t;
+typedef _Atomic (uint_least8_t) atomic_uint_least8_t;
+typedef _Atomic (int_least16_t) atomic_int_least16_t;
+typedef _Atomic (uint_least16_t) atomic_uint_least16_t;
+typedef _Atomic (int_least32_t) atomic_int_least32_t;
+typedef _Atomic (uint_least32_t) atomic_uint_least32_t;
+typedef _Atomic (int_least64_t) atomic_int_least64_t;
+typedef _Atomic (uint_least64_t) atomic_uint_least64_t;
+typedef _Atomic (int_fast8_t) atomic_int_fast8_t;
+typedef _Atomic (uint_fast8_t) atomic_uint_fast8_t;
+typedef _Atomic (int_fast16_t) atomic_int_fast16_t;
+typedef _Atomic (uint_fast16_t) atomic_uint_fast16_t;
+typedef _Atomic (int_fast32_t) atomic_int_fast32_t;
+typedef _Atomic (uint_fast32_t) atomic_uint_fast32_t;
+typedef _Atomic (int_fast64_t) atomic_int_fast64_t;
+typedef _Atomic (uint_fast64_t) atomic_uint_fast64_t;
+typedef _Atomic (intptr_t) atomic_intptr_t;
+typedef _Atomic (uintptr_t) atomic_uintptr_t;
+typedef _Atomic (size_t) atomic_size_t;
+typedef _Atomic (ptrdiff_t) atomic_ptrdiff_t;
+typedef _Atomic (intmax_t) atomic_intmax_t;
+typedef _Atomic (uintmax_t) atomic_uintmax_t;
/*
* 7.17.7 Operations on atomic types.
@@ -241,73 +241,73 @@ typedef _Atomic(uintmax_t) atomic_uintmax_t;
*/
#if defined(__CLANG_ATOMICS)
-#define atomic_compare_exchange_strong_explicit(object, expected, \
- desired, success, failure) \
- __c11_atomic_compare_exchange_strong(object, expected, desired, \
- success, failure)
-#define atomic_compare_exchange_weak_explicit(object, expected, \
- desired, success, failure) \
- __c11_atomic_compare_exchange_weak(object, expected, desired, \
- success, failure)
-#define atomic_exchange_explicit(object, desired, order) \
+#define atomic_compare_exchange_strong_explicit(object, expected, \
+ desired, success, failure) \
+ __c11_atomic_compare_exchange_strong(object, expected, desired, \
+ success, failure)
+#define atomic_compare_exchange_weak_explicit(object, expected, \
+ desired, success, failure) \
+ __c11_atomic_compare_exchange_weak(object, expected, desired, \
+ success, failure)
+#define atomic_exchange_explicit(object, desired, order) \
__c11_atomic_exchange(object, desired, order)
-#define atomic_fetch_add_explicit(object, operand, order) \
+#define atomic_fetch_add_explicit(object, operand, order) \
__c11_atomic_fetch_add(object, operand, order)
-#define atomic_fetch_and_explicit(object, operand, order) \
+#define atomic_fetch_and_explicit(object, operand, order) \
__c11_atomic_fetch_and(object, operand, order)
-#define atomic_fetch_or_explicit(object, operand, order) \
+#define atomic_fetch_or_explicit(object, operand, order) \
__c11_atomic_fetch_or(object, operand, order)
-#define atomic_fetch_sub_explicit(object, operand, order) \
+#define atomic_fetch_sub_explicit(object, operand, order) \
__c11_atomic_fetch_sub(object, operand, order)
-#define atomic_fetch_xor_explicit(object, operand, order) \
+#define atomic_fetch_xor_explicit(object, operand, order) \
__c11_atomic_fetch_xor(object, operand, order)
-#define atomic_load_explicit(object, order) \
+#define atomic_load_explicit(object, order) \
__c11_atomic_load(object, order)
-#define atomic_store_explicit(object, desired, order) \
+#define atomic_store_explicit(object, desired, order) \
__c11_atomic_store(object, desired, order)
#elif defined(__GNUC_ATOMICS)
-#define atomic_compare_exchange_strong_explicit(object, expected, \
- desired, success, failure) \
- __atomic_compare_exchange_n(&(object)->__val, expected, \
- desired, 0, success, failure)
-#define atomic_compare_exchange_weak_explicit(object, expected, \
- desired, success, failure) \
- __atomic_compare_exchange_n(&(object)->__val, expected, \
- desired, 1, success, failure)
-#define atomic_exchange_explicit(object, desired, order) \
+#define atomic_compare_exchange_strong_explicit(object, expected, \
+ desired, success, failure) \
+ __atomic_compare_exchange_n(&(object)->__val, expected, \
+ desired, 0, success, failure)
+#define atomic_compare_exchange_weak_explicit(object, expected, \
+ desired, success, failure) \
+ __atomic_compare_exchange_n(&(object)->__val, expected, \
+ desired, 1, success, failure)
+#define atomic_exchange_explicit(object, desired, order) \
__atomic_exchange_n(&(object)->__val, desired, order)
-#define atomic_fetch_add_explicit(object, operand, order) \
+#define atomic_fetch_add_explicit(object, operand, order) \
__atomic_fetch_add(&(object)->__val, operand, order)
-#define atomic_fetch_and_explicit(object, operand, order) \
+#define atomic_fetch_and_explicit(object, operand, order) \
__atomic_fetch_and(&(object)->__val, operand, order)
-#define atomic_fetch_or_explicit(object, operand, order) \
+#define atomic_fetch_or_explicit(object, operand, order) \
__atomic_fetch_or(&(object)->__val, operand, order)
-#define atomic_fetch_sub_explicit(object, operand, order) \
+#define atomic_fetch_sub_explicit(object, operand, order) \
__atomic_fetch_sub(&(object)->__val, operand, order)
-#define atomic_fetch_xor_explicit(object, operand, order) \
+#define atomic_fetch_xor_explicit(object, operand, order) \
__atomic_fetch_xor(&(object)->__val, operand, order)
-#define atomic_load_explicit(object, order) \
+#define atomic_load_explicit(object, order) \
__atomic_load_n(&(object)->__val, order)
-#define atomic_store_explicit(object, desired, order) \
+#define atomic_store_explicit(object, desired, order) \
__atomic_store_n(&(object)->__val, desired, order)
#else
#define __atomic_apply_stride(object, operand) \
- (((__typeof__((object)->__val))0) + (operand))
-#define atomic_compare_exchange_strong_explicit(object, expected, \
- desired, success, failure) __extension__ ({ \
- __typeof__(expected) __ep = (expected); \
- __typeof__(*__ep) __e = *__ep; \
- (void)(success); (void)(failure); \
- (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val, \
- __e, desired)) == __e); \
-})
-#define atomic_compare_exchange_weak_explicit(object, expected, \
- desired, success, failure) \
- atomic_compare_exchange_strong_explicit(object, expected, \
- desired, success, failure)
+ (((__typeof__((object)->__val)) 0) + (operand))
+#define atomic_compare_exchange_strong_explicit(object, expected, \
+ desired, success, failure) __extension__ ({ \
+ __typeof__(expected)__ep = (expected); \
+ __typeof__(*__ep)__e = *__ep; \
+ (void)(success); (void)(failure); \
+ (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val, \
+ __e, desired)) == __e); \
+ })
+#define atomic_compare_exchange_weak_explicit(object, expected, \
+ desired, success, failure) \
+ atomic_compare_exchange_strong_explicit(object, expected, \
+ desired, success, failure)
#if __has_builtin(__sync_swap)
/* Clang provides a full-barrier atomic exchange - use it if available. */
-#define atomic_exchange_explicit(object, desired, order) \
+#define atomic_exchange_explicit(object, desired, order) \
__sync_swap(&(object)->__val, desired)
#else
/*
@@ -315,31 +315,31 @@ typedef _Atomic(uintmax_t) atomic_uintmax_t;
* practice it is usually a full barrier) so we need an explicit barrier before
* it.
*/
-#define atomic_exchange_explicit(object, desired, order) \
-__extension__ ({ \
- __typeof__(object) __o = (object); \
- __typeof__(desired) __d = (desired); \
- (void)(order); \
- __sync_synchronize(); \
- __sync_lock_test_and_set(&(__o)->__val, __d); \
-})
+#define atomic_exchange_explicit(object, desired, order) \
+ __extension__ ({ \
+ __typeof__(object)__o = (object); \
+ __typeof__(desired)__d = (desired); \
+ (void)(order); \
+ __sync_synchronize(); \
+ __sync_lock_test_and_set(&(__o)->__val, __d); \
+ })
#endif
/* Ignoring the order argument when using __sync builtins */
-#define atomic_fetch_add_explicit(object, operand, order) \
- __sync_fetch_and_add(&(object)->__val, \
- __atomic_apply_stride(object, operand))
-#define atomic_fetch_and_explicit(object, operand, order) \
+#define atomic_fetch_add_explicit(object, operand, order) \
+ __sync_fetch_and_add(&(object)->__val, \
+ __atomic_apply_stride(object, operand))
+#define atomic_fetch_and_explicit(object, operand, order) \
__sync_fetch_and_and(&(object)->__val, operand)
-#define atomic_fetch_or_explicit(object, operand, order) \
+#define atomic_fetch_or_explicit(object, operand, order) \
__sync_fetch_and_or(&(object)->__val, operand)
-#define atomic_fetch_sub_explicit(object, operand, order) \
- __sync_fetch_and_sub(&(object)->__val, \
- __atomic_apply_stride(object, operand))
-#define atomic_fetch_xor_explicit(object, operand, order) \
+#define atomic_fetch_sub_explicit(object, operand, order) \
+ __sync_fetch_and_sub(&(object)->__val, \
+ __atomic_apply_stride(object, operand))
+#define atomic_fetch_xor_explicit(object, operand, order) \
__sync_fetch_and_xor(&(object)->__val, operand)
-#define atomic_load_explicit(object, order) \
+#define atomic_load_explicit(object, order) \
__sync_fetch_and_add(&(object)->__val, 0)
-#define atomic_store_explicit(object, desired, order) \
+#define atomic_store_explicit(object, desired, order) \
((void)atomic_exchange_explicit(object, desired, order))
#endif
@@ -351,27 +351,27 @@ __extension__ ({ \
*/
#ifndef _KERNEL
-#define atomic_compare_exchange_strong(object, expected, desired) \
- atomic_compare_exchange_strong_explicit(object, expected, \
- desired, memory_order_seq_cst, memory_order_seq_cst)
-#define atomic_compare_exchange_weak(object, expected, desired) \
+#define atomic_compare_exchange_strong(object, expected, desired) \
+ atomic_compare_exchange_strong_explicit(object, expected, \
+ desired, memory_order_seq_cst, memory_order_seq_cst)
+#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_weak_explicit(object, expected, \
- desired, memory_order_seq_cst, memory_order_seq_cst)
-#define atomic_exchange(object, desired) \
+ desired, memory_order_seq_cst, memory_order_seq_cst)
+#define atomic_exchange(object, desired) \
atomic_exchange_explicit(object, desired, memory_order_seq_cst)
-#define atomic_fetch_add(object, operand) \
+#define atomic_fetch_add(object, operand) \
atomic_fetch_add_explicit(object, operand, memory_order_seq_cst)
-#define atomic_fetch_and(object, operand) \
+#define atomic_fetch_and(object, operand) \
atomic_fetch_and_explicit(object, operand, memory_order_seq_cst)
-#define atomic_fetch_or(object, operand) \
+#define atomic_fetch_or(object, operand) \
atomic_fetch_or_explicit(object, operand, memory_order_seq_cst)
-#define atomic_fetch_sub(object, operand) \
+#define atomic_fetch_sub(object, operand) \
atomic_fetch_sub_explicit(object, operand, memory_order_seq_cst)
-#define atomic_fetch_xor(object, operand) \
+#define atomic_fetch_xor(object, operand) \
atomic_fetch_xor_explicit(object, operand, memory_order_seq_cst)
-#define atomic_load(object) \
+#define atomic_load(object) \
atomic_load_explicit(object, memory_order_seq_cst)
-#define atomic_store(object, desired) \
+#define atomic_store(object, desired) \
atomic_store_explicit(object, desired, memory_order_seq_cst)
#endif /* !_KERNEL */
@@ -390,7 +390,7 @@ typedef struct {
static __inline _Bool
atomic_flag_test_and_set_explicit(volatile atomic_flag *__object,
- memory_order __order)
+ memory_order __order)
{
return (atomic_exchange_explicit(&__object->__flag, 1, __order));
}
@@ -408,7 +408,7 @@ atomic_flag_test_and_set(volatile atomic_flag *__object)
{
return (atomic_flag_test_and_set_explicit(__object,
- memory_order_seq_cst));
+ memory_order_seq_cst));
}
static __inline void
diff --git a/cpu/msp430_common/include/stdio.h b/cpu/msp430_common/include/stdio.h
index 2a67eb2ac..df92c905b 100644
--- a/cpu/msp430_common/include/stdio.h
+++ b/cpu/msp430_common/include/stdio.h
@@ -31,9 +31,9 @@
extern "C" {
#endif
-#define SEEK_SET 0 /* Seek from beginning of file. */
-#define SEEK_CUR 1 /* Seek from current position. */
-#define SEEK_END 2 /* Seek from end of file. */
+#define SEEK_SET 0 /* Seek from beginning of file. */
+#define SEEK_CUR 1 /* Seek from current position. */
+#define SEEK_END 2 /* Seek from end of file. */
int getchar(void);
diff --git a/cpu/msp430_common/include/sys/cdefs.h b/cpu/msp430_common/include/sys/cdefs.h
index 06ad62ba3..2b3c9e0e5 100644
--- a/cpu/msp430_common/include/sys/cdefs.h
+++ b/cpu/msp430_common/include/sys/cdefs.h
@@ -122,7 +122,7 @@ extern "C" {
#define __GNUCLIKE_BUILTIN_CONSTANT_P 1
#if defined(__INTEL_COMPILER) && defined(__cplusplus) && \
- __INTEL_COMPILER < 800
+ __INTEL_COMPILER < 800
#undef __GNUCLIKE_BUILTIN_CONSTANT_P
#endif
@@ -196,7 +196,7 @@ extern "C" {
#else /* !(__STDC__ || __cplusplus) */
#define __P(protos) () /* traditional C preprocessor */
-#define __CONCAT(x,y) x/**/y
+#define __CONCAT(x,y) x /**/ y
#define __STRING(x) "x"
#if !defined(__CC_SUPPORTS___INLINE)
@@ -324,7 +324,7 @@ extern "C" {
#define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
#define __Static_assert(x, y) ___Static_assert(x, y)
#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] \
- __unused
+ __unused
#else
#define _Static_assert(x, y) struct __hack
#endif
@@ -357,11 +357,11 @@ extern "C" {
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
__has_extension(c_generic_selections)
-#define __generic(expr, t, yes, no) \
+#define __generic(expr, t, yes, no) \
_Generic(expr, t: yes, default: no)
#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
-#define __generic(expr, t, yes, no) \
- __builtin_choose_expr( \
+#define __generic(expr, t, yes, no) \
+ __builtin_choose_expr( \
__builtin_types_compatible_p(__typeof(expr), t), yes, no)
#endif
@@ -489,12 +489,12 @@ extern "C" {
* compatible with member m.
*/
#if __GNUC_PREREQ__(3, 1)
-#define __containerof(x, s, m) ({ \
- const volatile __typeof(((s *)0)->m) *__x = (x); \
- __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\
-})
+#define __containerof(x, s, m) ({ \
+ const volatile __typeof(((s *)0)->m) *__x = (x); \
+ __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m)); \
+ })
#else
-#define __containerof(x, s, m) \
+#define __containerof(x, s, m) \
__DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m))
#endif
@@ -512,14 +512,14 @@ extern "C" {
#define __strftimelike(fmtarg, firstvararg)
#else
#define __printflike(fmtarg, firstvararg) \
- __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
+ __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg, firstvararg) \
- __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
+ __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg)))
#define __strfmonlike(fmtarg, firstvararg) \
- __attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
+ __attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
#define __strftimelike(fmtarg, firstvararg) \
- __attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
+ __attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
#endif
/*
@@ -542,57 +542,57 @@ extern "C" {
#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \
defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define __printf0like(fmtarg, firstvararg) \
- __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
+ __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
#else
#define __printf0like(fmtarg, firstvararg)
#endif
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#ifndef __INTEL_COMPILER
-#define __strong_reference(sym,aliassym) \
+#define __strong_reference(sym,aliassym) \
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
#endif
#ifdef __ELF__
#ifdef __STDC__
#define __weak_reference(sym,alias) \
- __asm__(".weak " #alias); \
- __asm__(".equ " #alias ", " #sym)
-#define __warn_references(sym,msg) \
- __asm__(".section .gnu.warning." #sym); \
- __asm__(".asciz \"" msg "\""); \
- __asm__(".previous")
-#define __sym_compat(sym,impl,verid) \
- __asm__(".symver " #impl ", " #sym "@" #verid)
-#define __sym_default(sym,impl,verid) \
- __asm__(".symver " #impl ", " #sym "@@" #verid)
+ __asm__ (".weak " #alias); \
+ __asm__ (".equ " #alias ", " #sym)
+#define __warn_references(sym,msg) \
+ __asm__ (".section .gnu.warning." #sym); \
+ __asm__ (".asciz \"" msg "\""); \
+ __asm__ (".previous")
+#define __sym_compat(sym,impl,verid) \
+ __asm__ (".symver " #impl ", " #sym "@" #verid)
+#define __sym_default(sym,impl,verid) \
+ __asm__ (".symver " #impl ", " #sym "@@" #verid)
#else
#define __weak_reference(sym,alias) \
- __asm__(".weak alias"); \
- __asm__(".equ alias, sym")
-#define __warn_references(sym,msg) \
- __asm__(".section .gnu.warning.sym"); \
- __asm__(".asciz \"msg\""); \
- __asm__(".previous")
-#define __sym_compat(sym,impl,verid) \
- __asm__(".symver impl, sym@verid")
-#define __sym_default(impl,sym,verid) \
- __asm__(".symver impl, sym@@verid")
+ __asm__ (".weak alias"); \
+ __asm__ (".equ alias, sym")
+#define __warn_references(sym,msg) \
+ __asm__ (".section .gnu.warning.sym"); \
+ __asm__ (".asciz \"msg\""); \
+ __asm__ (".previous")
+#define __sym_compat(sym,impl,verid) \
+ __asm__ (".symver impl, sym@verid")
+#define __sym_default(impl,sym,verid) \
+ __asm__ (".symver impl, sym@@verid")
#endif /* __STDC__ */
#else /* !__ELF__ */
#ifdef __STDC__
-#define __weak_reference(sym,alias) \
- __asm__(".stabs \"_" #alias "\",11,0,0,0"); \
- __asm__(".stabs \"_" #sym "\",1,0,0,0")
-#define __warn_references(sym,msg) \
- __asm__(".stabs \"" msg "\",30,0,0,0"); \
- __asm__(".stabs \"_" #sym "\",1,0,0,0")
+#define __weak_reference(sym,alias) \
+ __asm__ (".stabs \"_" #alias "\",11,0,0,0"); \
+ __asm__ (".stabs \"_" #sym "\",1,0,0,0")
+#define __warn_references(sym,msg) \
+ __asm__ (".stabs \"" msg "\",30,0,0,0"); \
+ __asm__ (".stabs \"_" #sym "\",1,0,0,0")
#else
-#define __weak_reference(sym,alias) \
- __asm__(".stabs \"_/**/alias\",11,0,0,0"); \
- __asm__(".stabs \"_/**/sym\",1,0,0,0")
-#define __warn_references(sym,msg) \
- __asm__(".stabs msg,30,0,0,0"); \
- __asm__(".stabs \"_/**/sym\",1,0,0,0")
+#define __weak_reference(sym,alias) \
+ __asm__ (".stabs \"_/**/alias\",11,0,0,0"); \
+ __asm__ (".stabs \"_/**/sym\",1,0,0,0")
+#define __warn_references(sym,msg) \
+ __asm__ (".stabs msg,30,0,0,0"); \
+ __asm__ (".stabs \"_/**/sym\",1,0,0,0")
#endif /* __STDC__ */
#endif /* __ELF__ */
#endif /* __GNUC__ || __INTEL_COMPILER */
@@ -639,9 +639,9 @@ extern "C" {
#if __has_attribute(__argument_with_type_tag__) && \
__has_attribute(__type_tag_for_datatype__) && !defined(lint)
#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \
- __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx)))
+ __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx)))
#define __datatype_type_tag(kind, type) \
- __attribute__((__type_tag_for_datatype__(kind, type)))
+ __attribute__((__type_tag_for_datatype__(kind, type)))
#else
#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx)
#define __datatype_type_tag(kind, type)
diff --git a/cpu/msp430_common/include/sys/features.h b/cpu/msp430_common/include/sys/features.h
index 19ff7e05e..7c2265ab0 100644
--- a/cpu/msp430_common/include/sys/features.h
+++ b/cpu/msp430_common/include/sys/features.h
@@ -121,10 +121,10 @@ extern "C" {
#define _XOPEN_SOURCE_EXTENDED 1
#endif /* _GNU_SOURCE */
-#if defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \
- (!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE) && \
- !defined(_ISOC99_SOURCE) && !defined(_POSIX_SOURCE) && \
- !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
+#if defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \
+ (!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE) && \
+ !defined(_ISOC99_SOURCE) && !defined(_POSIX_SOURCE) && \
+ !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
#undef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE 1
#endif
@@ -136,9 +136,9 @@ extern "C" {
#define _POSIX_C_SOURCE 200809L
#endif
-#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \
- ((!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE)) || \
- (_XOPEN_SOURCE - 0) >= 500)
+#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+ ((!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE)) || \
+ (_XOPEN_SOURCE - 0) >= 500)
#define _POSIX_SOURCE 1
#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 700
#define _POSIX_C_SOURCE 200809L
@@ -257,10 +257,10 @@ extern "C" {
#endif
#if defined(_ISOC11_SOURCE) || \
- (__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
+ (__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
#define __ISO_C_VISIBLE 2011
#elif defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) >= 200112L || \
- (__STDC_VERSION__ - 0) >= 199901L || defined(__cplusplus)
+ (__STDC_VERSION__ - 0) >= 199901L || defined(__cplusplus)
#define __ISO_C_VISIBLE 1999
#else
#define __ISO_C_VISIBLE 1990
diff --git a/cpu/msp430_common/include/sys/stat.h b/cpu/msp430_common/include/sys/stat.h
index 45843a7be..8976ce5b8 100644
--- a/cpu/msp430_common/include/sys/stat.h
+++ b/cpu/msp430_common/include/sys/stat.h
@@ -99,19 +99,19 @@ struct stat {
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
/* These function prototypes are required by the standard */
-int chmod(const char *, mode_t);
-int fchmod(int, mode_t);
-int fchmodat(int, const char *, mode_t, int);
+int chmod(const char *, mode_t);
+int fchmod(int, mode_t);
+int fchmodat(int, const char *, mode_t, int);
int fstat(int, struct stat *);
int fstatat(int, const char *restrict, struct stat *restrict, int);
int futimens(int, const struct timespec [2]);
int lstat(const char *restrict, struct stat *restrict);
-int mkdir(const char *, mode_t);
-int mkdirat(int, const char *, mode_t);
-int mkfifo(const char *, mode_t);
-int mkfifoat(int, const char *, mode_t);
-int mknod(const char *, mode_t, dev_t);
-int mknodat(int, const char *, mode_t, dev_t);
+int mkdir(const char *, mode_t);
+int mkdirat(int, const char *, mode_t);
+int mkfifo(const char *, mode_t);
+int mkfifoat(int, const char *, mode_t);
+int mknod(const char *, mode_t, dev_t);
+int mknodat(int, const char *, mode_t, dev_t);
int stat(const char *restrict, struct stat *restrict);
mode_t umask(mode_t);
int utimensat(int, const char *, const struct timespec [2], int);
diff --git a/cpu/msp430_common/include/unistd.h b/cpu/msp430_common/include/unistd.h
index 55930fab6..1e4246157 100644
--- a/cpu/msp430_common/include/unistd.h
+++ b/cpu/msp430_common/include/unistd.h
@@ -42,9 +42,9 @@ extern "C" {
int access(const char *, int);
unsigned alarm(unsigned);
int chdir(const char *);
-int chown(const char *, uid_t, gid_t);
+int chown(const char *, uid_t, gid_t);
int close(int);
-size_t confstr(int, char *, size_t);
+size_t confstr(int, char *, size_t);
int dup(int);
int dup2(int, int);
void _exit(int);
@@ -56,60 +56,60 @@ int execve(const char *, char *const [], char *const []);
int execvp(const char *, char *const []);
int faccessat(int, const char *, int, int);
int fchdir(int);
-int fchown(int, uid_t, gid_t);
-int fchownat(int, const char *, uid_t, gid_t, int);
+int fchown(int, uid_t, gid_t);
+int fchownat(int, const char *, uid_t, gid_t, int);
int fexecve(int, char *const [], char *const []);
pid_t fork(void);
long fpathconf(int, int);
-int ftruncate(int, off_t);
+int ftruncate(int, off_t);
char *getcwd(char *, size_t);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
-int getgroups(int, gid_t []);
-int gethostname(char *, size_t);
+int getgroups(int, gid_t []);
+int gethostname(char *, size_t);
char *getlogin(void);
-int getlogin_r(char *, size_t);
+int getlogin_r(char *, size_t);
int getopt(int, char * const [], const char *);
-pid_t getpgid(pid_t);
+pid_t getpgid(pid_t);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
-pid_t getsid(pid_t);
+pid_t getsid(pid_t);
uid_t getuid(void);
int isatty(int);
-int lchown(const char *, uid_t, gid_t);
+int lchown(const char *, uid_t, gid_t);
int link(const char *, const char *);
int linkat(int, const char *, int, const char *, int);
-off_t lseek(int, off_t, int);
+off_t lseek(int, off_t, int);
long pathconf(const char *, int);
int pause(void);
int pipe(int [2]);
-ssize_t pread(int, void *, size_t, off_t);
-ssize_t pwrite(int, const void *, size_t, off_t);
-ssize_t read(int, void *, size_t);
-ssize_t readlink(const char *restrict, char *restrict, size_t);
-ssize_t readlinkat(int, const char *restrict, char *restrict, size_t);
+ssize_t pread(int, void *, size_t, off_t);
+ssize_t pwrite(int, const void *, size_t, off_t);
+ssize_t read(int, void *, size_t);
+ssize_t readlink(const char *restrict, char *restrict, size_t);
+ssize_t readlinkat(int, const char *restrict, char *restrict, size_t);
int rmdir(const char *);
-int setegid(gid_t);
-int seteuid(uid_t);
-int setgid(gid_t);
-int setpgid(pid_t, pid_t);
+int setegid(gid_t);
+int seteuid(uid_t);
+int setgid(gid_t);
+int setpgid(pid_t, pid_t);
pid_t setsid(void);
-int setuid(uid_t);
+int setuid(uid_t);
unsigned sleep(unsigned);
int symlink(const char *, const char *);
int symlinkat(const char *, int, const char *);
long sysconf(int);
pid_t tcgetpgrp(int);
-int tcsetpgrp(int, pid_t);
-int truncate(const char *, off_t);
+int tcsetpgrp(int, pid_t);
+int truncate(const char *, off_t);
char *ttyname(int);
-int ttyname_r(int, char *, size_t);
+int ttyname_r(int, char *, size_t);
int unlink(const char *);
int unlinkat(int, const char *, int);
-int usleep(useconds_t);
-ssize_t write(int, const void *, size_t);
+int usleep(useconds_t);
+ssize_t write(int, const void *, size_t);
#ifdef __cplusplus
}
diff --git a/cpu/msp430_common/irq.c b/cpu/msp430_common/irq.c
index b251f7447..6b06aab7c 100644
--- a/cpu/msp430_common/irq.c
+++ b/cpu/msp430_common/irq.c
@@ -8,7 +8,7 @@
/**
* @ingroup cpu
-* @{
+ * @{
*
* @file
* @brief ISR related functions
@@ -29,7 +29,7 @@ char __isr_stack[ISR_STACKSIZE];
unsigned int irq_disable(void)
{
unsigned int state;
- __asm__("mov.w r2,%0" : "=r"(state));
+ __asm__ ("mov.w r2,%0" : "=r" (state));
state &= GIE;
if (state) {
@@ -42,7 +42,7 @@ unsigned int irq_disable(void)
unsigned int irq_enable(void)
{
unsigned int state;
- __asm__("mov.w r2,%0" : "=r"(state));
+ __asm__ ("mov.w r2,%0" : "=r" (state));
state &= GIE;
if (!state) {
diff --git a/cpu/msp430_common/msp430-main.c b/cpu/msp430_common/msp430-main.c
index aa171b68d..759d91660 100644
--- a/cpu/msp430_common/msp430-main.c
+++ b/cpu/msp430_common/msp430-main.c
@@ -122,7 +122,7 @@ void msp430_cpu_init(void)
}
}
/*---------------------------------------------------------------------------*/
-#define asmv(arg) __asm__ __volatile__(arg)
+#define asmv(arg) __asm__ __volatile__ (arg)
#define STACK_EXTRA 32
@@ -137,11 +137,11 @@ void *sbrk(int incr)
{
char *stack_pointer;
- asmv("mov r1, %0" : "=r"(stack_pointer));
+ asmv("mov r1, %0" : "=r" (stack_pointer));
stack_pointer -= STACK_EXTRA;
if (incr > (stack_pointer - cur_break)) {
- return (void *) - 1; /* ENOMEM */
+ return (void *) -1; /* ENOMEM */
}
void *old_break = cur_break;
@@ -149,7 +149,7 @@ void *sbrk(int incr)
/*
* If the stack was never here then [old_break .. cur_break] should
* be filled with zeros.
- */
+ */
return old_break;
}
/*---------------------------------------------------------------------------*/
@@ -161,8 +161,8 @@ splhigh_(void)
{
/* Clear the GIE (General Interrupt Enable) flag. */
int sr;
- asmv("mov r2, %0" : "=r"(sr));
- asmv("bic %0, r2" : : "i"(GIE));
+ asmv("mov r2, %0" : "=r" (sr));
+ asmv("bic %0, r2" : : "i" (GIE));
asmv("nop");
return sr & GIE; /* Ignore other sr bits. */
}
@@ -175,7 +175,7 @@ splx_(int sr)
{
sr &= GIE;
/* If GIE was set, restore it. */
- asmv("bis %0, r2" : : "r"(sr));
+ asmv("bis %0, r2" : : "r" (sr));
asmv("nop");
}
/*---------------------------------------------------------------------------*/
diff --git a/cpu/msp430fxyz/include/msp430_regs.h b/cpu/msp430fxyz/include/msp430_regs.h
index 5cf0b9590..27fccd75d 100644
--- a/cpu/msp430fxyz/include/msp430_regs.h
+++ b/cpu/msp430fxyz/include/msp430_regs.h
@@ -41,107 +41,107 @@ extern "C" {
* @brief Special function registers
*/
typedef struct {
- REG8 IE1; /**< interrupt enable 1 */
- REG8 IE2; /**< interrupt enable 2 */
- REG8 IFG1; /**< interrupt flag 1 */
- REG8 IFG2; /**< interrupt flag 2 */
- REG8 ME1; /**< module enable 1 */
- REG8 ME2; /**< module enable 2 */
+ REG8 IE1; /**< interrupt enable 1 */
+ REG8 IE2; /**< interrupt enable 2 */
+ REG8 IFG1; /**< interrupt flag 1 */
+ REG8 IFG2; /**< interrupt flag 2 */
+ REG8 ME1; /**< module enable 1 */
+ REG8 ME2; /**< module enable 2 */
} msp_sfr_t;
/**
* @brief Digital I/O Port w/o interrupt functionality (P3-P6)
*/
typedef struct {
- REG8 IN; /**< input data */
- REG8 OD; /**< output data */
- REG8 DIR; /**< pin direction */
- REG8 SEL; /**< alternative function select */
+ REG8 IN; /**< input data */
+ REG8 OD; /**< output data */
+ REG8 DIR; /**< pin direction */
+ REG8 SEL; /**< alternative function select */
} msp_port_t;
/**
* @brief Digital I/O Port with interrupt functionality (P1 & P2)
*/
typedef struct {
- REG8 IN; /**< input data */
- REG8 OD; /**< output data */
- REG8 DIR; /**< pin direction */
- REG8 IFG; /**< interrupt flag */
- REG8 IES; /**< interrupt edge select */
- REG8 IE; /**< interrupt enable */
- REG8 SEL; /**< alternative function select */
+ REG8 IN; /**< input data */
+ REG8 OD; /**< output data */
+ REG8 DIR; /**< pin direction */
+ REG8 IFG; /**< interrupt flag */
+ REG8 IES; /**< interrupt edge select */
+ REG8 IE; /**< interrupt enable */
+ REG8 SEL; /**< alternative function select */
} msp_port_isr_t;
/**
* @brief USART (UART, SPI and I2C) registers
*/
typedef struct {
- REG8 CTL; /**< USART control */
- REG8 TCTL; /**< transmit control */
- REG8 RCTL; /**< receive control */
- REG8 MCTL; /**< modulation control */
- REG8 BR0; /**< baud rate control 0 */
- REG8 BR1; /**< baud rate control 1 */
- REG8 RXBUF; /**< receive buffer */
- REG8 TXBUF; /**< transmit buffer */
+ REG8 CTL; /**< USART control */
+ REG8 TCTL; /**< transmit control */
+ REG8 RCTL; /**< receive control */
+ REG8 MCTL; /**< modulation control */
+ REG8 BR0; /**< baud rate control 0 */
+ REG8 BR1; /**< baud rate control 1 */
+ REG8 RXBUF; /**< receive buffer */
+ REG8 TXBUF; /**< transmit buffer */
} msp_usart_t;
/**
* @brief USCI universal serial control interface registers
*/
typedef struct {
- REG8 ABCTL; /**< auto baud rate control */
- REG8 IRTCTL; /**< IrDA transmit control */
- REG8 IRRCTL; /**< IrDA receive control */
- REG8 ACTL0; /**< A control 0 */
- REG8 ACTL1; /**< A control 1 */
- REG8 ABR0; /**< A baud rate control 0 */
- REG8 ABR1; /**< A baud rate control 1 */
- REG8 AMCTL; /**< A modulation control */
- REG8 ASTAT; /**< A status */
- REG8 ARXBUF; /**< A receive buffer */
- REG8 ATXBUF; /**< A transmit buffer */
- REG8 BCTL0; /**< B control 0 */
- REG8 BCTL1; /**< B control 1 */
- REG8 BBR0; /**< B baud rate 0 */
- REG8 BBR1; /**< B baud rate 1 */
- REG8 BI2CIE; /**< I2C interrupt enable */
- REG8 BSTAT; /**< B status */
- REG8 BRXBUF; /**< B receive buffer */
- REG8 BTXBUF; /**< B transmit buffer */
+ REG8 ABCTL; /**< auto baud rate control */
+ REG8 IRTCTL; /**< IrDA transmit control */
+ REG8 IRRCTL; /**< IrDA receive control */
+ REG8 ACTL0; /**< A control 0 */
+ REG8 ACTL1; /**< A control 1 */
+ REG8 ABR0; /**< A baud rate control 0 */
+ REG8 ABR1; /**< A baud rate control 1 */
+ REG8 AMCTL; /**< A modulation control */
+ REG8 ASTAT; /**< A status */
+ REG8 ARXBUF; /**< A receive buffer */
+ REG8 ATXBUF; /**< A transmit buffer */
+ REG8 BCTL0; /**< B control 0 */
+ REG8 BCTL1; /**< B control 1 */
+ REG8 BBR0; /**< B baud rate 0 */
+ REG8 BBR1; /**< B baud rate 1 */
+ REG8 BI2CIE; /**< I2C interrupt enable */
+ REG8 BSTAT; /**< B status */
+ REG8 BRXBUF; /**< B receive buffer */
+ REG8 BTXBUF; /**< B transmit buffer */
} msp_usci_t;
/**
* @brief USCI SPI specific registers
*/
typedef struct {
- REG8 CTL0; /**< control 0 */
- REG8 CTL1; /**< control 1 */
- REG8 BR0; /**< baud rate 0 */
- REG8 BR1; /**< baud rate 1 */
- REG8 reserved; /**< reserved */
- REG8 STAT; /**< status */
- REG8 RXBUF; /**< receive buffer */
- REG8 TXBUF; /**< transmit buffer */
+ REG8 CTL0; /**< control 0 */
+ REG8 CTL1; /**< control 1 */
+ REG8 BR0; /**< baud rate 0 */
+ REG8 BR1; /**< baud rate 1 */
+ REG8 reserved; /**< reserved */
+ REG8 STAT; /**< status */
+ REG8 RXBUF; /**< receive buffer */
+ REG8 TXBUF; /**< transmit buffer */
} msp_usci_spi_t;
/**
* @brief Timer interrupt status registers
*/
typedef struct {
- REG16 TBIV; /**< TIMER_A interrupt status */
- REG16 reserved[7]; /**< reserved */
- REG16 TAIV; /**< TIMER_B interrupt status */
+ REG16 TBIV; /**< TIMER_A interrupt status */
+ REG16 reserved[7]; /**< reserved */
+ REG16 TAIV; /**< TIMER_B interrupt status */
} msp_timer_ivec_t;
/**
* @brief Timer module registers
*/
typedef struct {
- REG16 CTL; /**< timer control */
- REG16 CCTL[7]; /**< capture compare channel control */
- REG16 R; /**< current counter value */
- REG16 CCR[7]; /**< capture compare channel values */
+ REG16 CTL; /**< timer control */
+ REG16 CCTL[7]; /**< capture compare channel control */
+ REG16 R; /**< current counter value */
+ REG16 CCR[7]; /**< capture compare channel values */
} msp_timer_t;
/**
diff --git a/cpu/msp430fxyz/periph/gpio.c b/cpu/msp430fxyz/periph/gpio.c
index e6682eb95..ecbbe6763 100644
--- a/cpu/msp430fxyz/periph/gpio.c
+++ b/cpu/msp430fxyz/periph/gpio.c
@@ -100,7 +100,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
}
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
- gpio_cb_t cb, void *arg)
+ gpio_cb_t cb, void *arg)
{
msp_port_isr_t *port = _isr_port(pin);
diff --git a/cpu/msp430fxyz/periph/spi.c b/cpu/msp430fxyz/periph/spi.c
index e36831982..06a0b12b4 100644
--- a/cpu/msp430fxyz/periph/spi.c
+++ b/cpu/msp430fxyz/periph/spi.c
@@ -96,7 +96,7 @@ int spi_acquire(spi_t bus, spi_cs_t cs, spi_mode_t mode, spi_clk_t clk)
#else
/* configure mode */
SPI_BASE->CTL0 = (USCI_SPI_CTL0_UCSYNC | USCI_SPI_CTL0_MST|
- USCI_SPI_CTL0_MODE_0 | USCI_SPI_CTL0_MSB | mode);
+ USCI_SPI_CTL0_MODE_0 | USCI_SPI_CTL0_MSB | mode);
/* release from software reset */
SPI_BASE->CTL1 &= ~(USCI_SPI_CTL1_SWRST);
#endif
diff --git a/cpu/msp430fxyz/periph/uart.c b/cpu/msp430fxyz/periph/uart.c
index 6aace0cb4..0dc849691 100644
--- a/cpu/msp430fxyz/periph/uart.c
+++ b/cpu/msp430fxyz/periph/uart.c
@@ -121,7 +121,7 @@ ISR(UART_RX_ISR, isr_uart_0_rx)
char c = UART_BASE->RXBUF;
/* only call callback if there was no receive error */
- if(! (UART_BASE->RCTL & RXERR)) {
+ if(!(UART_BASE->RCTL & RXERR)) {
ctx_rx_cb(ctx_isr_arg, c);
}
diff --git a/cpu/native/can/candev_linux.c b/cpu/native/can/candev_linux.c
index 1bbf888e5..317e91090 100644
--- a/cpu/native/can/candev_linux.c
+++ b/cpu/native/can/candev_linux.c
@@ -71,14 +71,14 @@ static void _callback_can_sigio(int sock, void *arg);
candev_linux_conf_t candev_linux_conf[CAN_DLL_NUMOF] = {
#if CAN_DLL_NUMOF >= 1
- {
+ {
.interface_name = "vcan0",
- },
+ },
#endif
#if CAN_DLL_NUMOF >= 2
- {
+ {
.interface_name = "vcan1",
- }
+ }
#endif
};
@@ -103,20 +103,20 @@ static candev_event_t _can_error_to_can_evt(struct can_frame can_frame_err)
}
else if (can_err_type & CAN_ERR_CRTL) {
switch(can_frame_err.data[1]) {
- case CAN_ERR_CRTL_RX_OVERFLOW:
- can_evt = CANDEV_EVENT_RX_ERROR;
- break;
- case CAN_ERR_CRTL_TX_OVERFLOW:
- can_evt = CANDEV_EVENT_TX_ERROR;
- break;
- case CAN_ERR_CRTL_RX_PASSIVE:
- case CAN_ERR_CRTL_TX_PASSIVE:
- can_evt = CANDEV_EVENT_ERROR_PASSIVE;
- break;
- case CAN_ERR_CRTL_RX_WARNING:
- case CAN_ERR_CRTL_TX_WARNING:
- can_evt = CANDEV_EVENT_ERROR_WARNING;
- break;
+ case CAN_ERR_CRTL_RX_OVERFLOW:
+ can_evt = CANDEV_EVENT_RX_ERROR;
+ break;
+ case CAN_ERR_CRTL_TX_OVERFLOW:
+ can_evt = CANDEV_EVENT_TX_ERROR;
+ break;
+ case CAN_ERR_CRTL_RX_PASSIVE:
+ case CAN_ERR_CRTL_TX_PASSIVE:
+ can_evt = CANDEV_EVENT_ERROR_PASSIVE;
+ break;
+ case CAN_ERR_CRTL_RX_WARNING:
+ case CAN_ERR_CRTL_TX_WARNING:
+ can_evt = CANDEV_EVENT_ERROR_WARNING;
+ break;
}
}
else if (can_err_type & CAN_ERR_BUSOFF) {
@@ -152,7 +152,7 @@ static int _init(candev_t *candev)
candev_linux_t *dev = (candev_linux_t *)candev;
if ((strlen(dev->conf->interface_name) == 0)
- || (strlen(dev->conf->interface_name) > CAN_MAX_SIZE_INTERFACE_NAME)) {
+ || (strlen(dev->conf->interface_name) > CAN_MAX_SIZE_INTERFACE_NAME)) {
real_printf("Error: Invalid can iface, too short or too long \n");
return -1;
}
@@ -297,42 +297,42 @@ static int _set(candev_t *candev, canopt_t opt, void *value, size_t value_len)
int res = 0;
switch (opt) {
- case CANOPT_BITTIMING:
- DEBUG("candev_linux: CANOPT_BITTIMING\n");
+ case CANOPT_BITTIMING:
+ DEBUG("candev_linux: CANOPT_BITTIMING\n");
- if (strncmp(dev->conf->interface_name, "can", strlen("can"))) {
- DEBUG("candev_native: _set: error interface is not real can\n");
- return -EINVAL;
- }
+ if (strncmp(dev->conf->interface_name, "can", strlen("can"))) {
+ DEBUG("candev_native: _set: error interface is not real can\n");
+ return -EINVAL;
+ }
- if (value == NULL) {
- DEBUG("candev_native: _set: error value NULL\n");
- return -EOVERFLOW;
- }
+ if (value == NULL) {
+ DEBUG("candev_native: _set: error value NULL\n");
+ return -EOVERFLOW;
+ }
- if (value_len < sizeof(struct can_bittiming)) {
- DEBUG("candev_native: _set: error size of bittiming\n");
- return -EOVERFLOW;
- }
+ if (value_len < sizeof(struct can_bittiming)) {
+ DEBUG("candev_native: _set: error size of bittiming\n");
+ return -EOVERFLOW;
+ }
- res = _set_bittiming(dev, value);
+ res = _set_bittiming(dev, value);
- break;
- case CANOPT_STATE:
- switch (*((canopt_state_t *)value)) {
- case CANOPT_STATE_SLEEP:
- case CANOPT_STATE_OFF:
- _power_down(candev);
- break;
- default:
- _power_up(candev);
- break;
- }
- break;
- default:
- DEBUG("CAN set, not supported opt\n");
- res = -ENOTSUP;
- break;
+ break;
+ case CANOPT_STATE:
+ switch (*((canopt_state_t *)value)) {
+ case CANOPT_STATE_SLEEP:
+ case CANOPT_STATE_OFF:
+ _power_down(candev);
+ break;
+ default:
+ _power_up(candev);
+ break;
+ }
+ break;
+ default:
+ DEBUG("CAN set, not supported opt\n");
+ res = -ENOTSUP;
+ break;
}
return res;
@@ -344,102 +344,103 @@ static int _get(candev_t *candev, canopt_t opt, void *value, size_t max_len)
int res = 0;
switch (opt) {
- case CANOPT_BITTIMING:
- if (max_len < sizeof(struct can_bittiming)) {
- res = -EOVERFLOW;
- break;
- }
- if (value == NULL) {
- res = -EINVAL;
- break;
- }
- if (can_get_bittiming(dev->conf->interface_name, value) == 0) {
- res = sizeof(struct can_bittiming);
- }
- else {
- res = -ENOTSUP;
- }
- break;
- case CANOPT_BITTIMING_CONST:
- if (max_len < sizeof(struct can_bittiming_const)) {
- res = -EOVERFLOW;
- break;
- }
- if (value == NULL) {
- res = -EINVAL;
- break;
- }
- if (can_get_bittiming_const(dev->conf->interface_name, value) == 0) {
- res = sizeof(struct can_bittiming_const);
- }
- else {
- res = -ENOTSUP;
- }
- break;
- case CANOPT_CLOCK:
- if (max_len < sizeof(uint32_t)) {
- res = -EOVERFLOW;
+ case CANOPT_BITTIMING:
+ if (max_len < sizeof(struct can_bittiming)) {
+ res = -EOVERFLOW;
+ break;
+ }
+ if (value == NULL) {
+ res = -EINVAL;
+ break;
+ }
+ if (can_get_bittiming(dev->conf->interface_name, value) == 0) {
+ res = sizeof(struct can_bittiming);
+ }
+ else {
+ res = -ENOTSUP;
+ }
break;
- }
- if (value == NULL) {
- res = -EINVAL;
+ case CANOPT_BITTIMING_CONST:
+ if (max_len < sizeof(struct can_bittiming_const)) {
+ res = -EOVERFLOW;
+ break;
+ }
+ if (value == NULL) {
+ res = -EINVAL;
+ break;
+ }
+ if (can_get_bittiming_const(dev->conf->interface_name, value) == 0) {
+ res = sizeof(struct can_bittiming_const);
+ }
+ else {
+ res = -ENOTSUP;
+ }
break;
- }
- {
- struct can_clock clock;
- if (can_get_clock(dev->conf->interface_name, &clock) == 0) {
- *((uint32_t *)value) = clock.freq;
- res = sizeof(uint32_t);
- }
- else {
- res = -ENOTSUP;
- }
- }
- break;
- case CANOPT_TEC:
- case CANOPT_REC:
- if (max_len < sizeof(uint16_t)) {
- res = -EOVERFLOW;
+ case CANOPT_CLOCK:
+ if (max_len < sizeof(uint32_t)) {
+ res = -EOVERFLOW;
+ break;
+ }
+ if (value == NULL) {
+ res = -EINVAL;
+ break;
+ }
+ {
+ struct can_clock clock;
+ if (can_get_clock(dev->conf->interface_name, &clock) == 0) {
+ *((uint32_t *)value) = clock.freq;
+ res = sizeof(uint32_t);
+ }
+ else {
+ res = -ENOTSUP;
+ }
+ }
break;
- }
- if (value == NULL) {
- res = -EINVAL;
+ case CANOPT_TEC:
+ case CANOPT_REC:
+ if (max_len < sizeof(uint16_t)) {
+ res = -EOVERFLOW;
+ break;
+ }
+ if (value == NULL) {
+ res = -EINVAL;
+ break;
+ }
+ {
+ struct can_berr_counter bc;
+ if (can_get_berr_counter(dev->conf->interface_name, &bc) == 0) {
+ if (opt == CANOPT_TEC) {
+ *((uint16_t *)value) = bc.txerr;
+ }
+ else {
+ *((uint16_t *)value) = bc.rxerr;
+ }
+ res = sizeof(uint16_t);
+ }
+ else {
+ res = -ENOTSUP;
+ }
+ }
break;
- }
- {
- struct can_berr_counter bc;
- if (can_get_berr_counter(dev->conf->interface_name, &bc) == 0) {
- if (opt == CANOPT_TEC) {
- *((uint16_t *)value) = bc.txerr;
+ case CANOPT_RX_FILTERS: {
+ if (max_len % sizeof(struct can_filter) != 0) {
+ res = -EOVERFLOW;
+ break;
}
- else {
- *((uint16_t *)value) = bc.rxerr;
+ struct can_filter *list = value;
+ size_t i;
+ for (i = 0; (i < CANDEV_LINUX_MAX_FILTERS_RX)
+ && (dev->filters[i].can_id != 0)
+ && (i < (max_len / sizeof(struct can_filter))); i++) {
+ list[i] = dev->filters[i];
}
- res = sizeof(uint16_t);
+ res = i * sizeof(struct can_filter);
+ break;
}
- else {
+ default:
+ DEBUG("CAN get, not supported op\n");
res = -ENOTSUP;
- }
- }
- break;
- case CANOPT_RX_FILTERS: {
- if (max_len % sizeof(struct can_filter) != 0) {
- res = -EOVERFLOW;
break;
- }
- struct can_filter *list = value;
- size_t i;
- for (i = 0; (i < CANDEV_LINUX_MAX_FILTERS_RX)
- && (dev->filters[i].can_id != 0)
- && (i < (max_len / sizeof(struct can_filter))); i++) {
- list[i] = dev->filters[i];
- }
- res = i * sizeof(struct can_filter);
- break; }
- default:
- DEBUG("CAN get, not supported op\n");
- res = -ENOTSUP;
- break;
}
return res;
@@ -456,7 +457,7 @@ static int _set_filter(candev_t *candev, const struct can_filter *filter)
DEBUG("candev_native: _set_filter: candev=%p, filter: f=%x m=%x on sock: %i\n",
(void *)candev, filter->can_id, filter->can_mask, dev->sock
- );
+ );
uint32_t i;
for (i = 0; i < CANDEV_LINUX_MAX_FILTERS_RX; i++) {
if (dev->filters[i].can_id == filter->can_id) {
@@ -501,7 +502,7 @@ static int _remove_filter(candev_t *candev, const struct can_filter *filter)
uint32_t i;
for (i = 0; i < CANDEV_LINUX_MAX_FILTERS_RX; i++) {
if ((dev->filters[i].can_id == filter->can_id )
- && (dev->filters[i].can_mask == (filter->can_mask & CAN_EFF_MASK))) {
+ && (dev->filters[i].can_mask == (filter->can_mask & CAN_EFF_MASK))) {
if (i < CANDEV_LINUX_MAX_FILTERS_RX - 1) {
memmove(&dev->filters[i], &dev->filters[i + 1],
sizeof(dev->filters[i]) * (CANDEV_LINUX_MAX_FILTERS_RX - i - 1));
diff --git a/cpu/native/include/native_internal.h b/cpu/native/include/native_internal.h
index 9016acf15..4cf253637 100644
--- a/cpu/native/include/native_internal.h
+++ b/cpu/native/include/native_internal.h
@@ -118,7 +118,7 @@ extern int (*real_pipe)(int[2]);
/* The ... is a hack to save includes: */
extern int (*real_select)(int nfds, ...);
extern int (*real_setitimer)(int which, const struct itimerval
- *__restrict value, struct itimerval *__restrict ovalue);
+ *__restrict value, struct itimerval *__restrict ovalue);
extern int (*real_setsid)(void);
extern int (*real_setsockopt)(int socket, ...);
extern int (*real_socket)(int domain, int type, int protocol);
diff --git a/cpu/native/include/periph_conf.h b/cpu/native/include/periph_conf.h
index 9481d72dd..bb8249ae4 100644
--- a/cpu/native/include/periph_conf.h
+++ b/cpu/native/include/periph_conf.h
@@ -17,7 +17,7 @@
#define PERIPH_CONF_H
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/cpu/native/irq_cpu.c b/cpu/native/irq_cpu.c
index 6f1093e1b..46f8997c8 100644
--- a/cpu/native/irq_cpu.c
+++ b/cpu/native/irq_cpu.c
@@ -84,7 +84,7 @@ void print_thread_sigmask(ucontext_t *cp)
printf("%s: %s\n",
strsignal(i),
(sigismember(&_native_sig_set, i) ? "blocked" : "unblocked")
- );
+ );
}
if (sigismember(p, i)) {
@@ -131,7 +131,7 @@ void native_print_signals(void)
printf("%s: %s in active thread\n",
strsignal(i),
(sigismember(&_native_sig_set, i) ? "blocked" : "unblocked")
- );
+ );
}
if (sigismember(&p, i)) {
diff --git a/cpu/native/native_cpu.c b/cpu/native/native_cpu.c
index cb9ffbcee..9d2466654 100644
--- a/cpu/native/native_cpu.c
+++ b/cpu/native/native_cpu.c
@@ -132,7 +132,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
err(EXIT_FAILURE, "thread_stack_init: sigemptyset");
}
- makecontext(p, (void (*)(void)) task_func, 1, arg);
+ makecontext(p, (void (*)(void))task_func, 1, arg);
return (char *) p;
}
diff --git a/cpu/native/netdev_tap/netdev_tap.c b/cpu/native/netdev_tap/netdev_tap.c
index e686093a5..f5c5d9401 100644
--- a/cpu/native/netdev_tap/netdev_tap.c
+++ b/cpu/native/netdev_tap/netdev_tap.c
@@ -217,10 +217,10 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
/* repeating `real_read` for small size on tap device results in
* freeze for some reason. Using a large buffer for now. */
/*
- uint8_t buf[4];
- while (real_read(dev->tap_fd, buf, sizeof(buf)) > 0) {
- }
- */
+ uint8_t buf[4];
+ while (real_read(dev->tap_fd, buf, sizeof(buf)) > 0) {
+ }
+ */
static uint8_t buf[ETHERNET_FRAME_LEN];
@@ -384,8 +384,8 @@ static int _init(netdev_t *netdev)
dev->addr[5]++;
#endif
DEBUG("gnrc_tapnet_init(): dev->addr = %02x:%02x:%02x:%02x:%02x:%02x\n",
- dev->addr[0], dev->addr[1], dev->addr[2],
- dev->addr[3], dev->addr[4], dev->addr[5]);
+ dev->addr[0], dev->addr[1], dev->addr[2],
+ dev->addr[3], dev->addr[4], dev->addr[5]);
/* configure signal handler for fds */
native_async_read_setup();
diff --git a/cpu/native/periph/cpuid.c b/cpu/native/periph/cpuid.c
index 8f315f544..4f865f720 100644
--- a/cpu/native/periph/cpuid.c
+++ b/cpu/native/periph/cpuid.c
@@ -33,7 +33,7 @@ void cpuid_get(void *id)
size_t len = CPUID_LEN;
if (sizeof(_native_id) < CPUID_LEN) {
memset(((char*)id) + sizeof(_native_id), 0xff,
- CPUID_LEN - sizeof(_native_id));
+ CPUID_LEN - sizeof(_native_id));
len = sizeof(_native_id);
}
memcpy(id, &(_native_id), len);
diff --git a/cpu/native/periph/gpio.c b/cpu/native/periph/gpio.c
index 8633a4557..59e9e88b7 100644
--- a/cpu/native/periph/gpio.c
+++ b/cpu/native/periph/gpio.c
@@ -20,51 +20,51 @@
#include "periph/gpio.h"
int gpio_init(gpio_t pin, gpio_mode_t mode) {
- (void) pin;
- (void) mode;
+ (void) pin;
+ (void) mode;
- return -1;
+ return -1;
}
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
gpio_cb_t cb, void *arg){
- (void) pin;
- (void) mode;
- (void) flank;
- (void) cb;
- (void) arg;
+ (void) pin;
+ (void) mode;
+ (void) flank;
+ (void) cb;
+ (void) arg;
- return -1;
+ return -1;
}
void gpio_irq_enable(gpio_t pin) {
- (void) pin;
+ (void) pin;
}
void gpio_irq_disable(gpio_t pin) {
- (void) pin;
+ (void) pin;
}
int gpio_read(gpio_t pin) {
- (void) pin;
+ (void) pin;
- return 0;
+ return 0;
}
void gpio_set(gpio_t pin) {
- (void) pin;
+ (void) pin;
}
void gpio_clear(gpio_t pin) {
- (void) pin;
+ (void) pin;
}
void gpio_toggle(gpio_t pin) {
- (void) pin;
+ (void) pin;
}
void gpio_write(gpio_t pin, int value) {
- (void) pin;
- (void) value;
+ (void) pin;
+ (void) value;
}
/** @} */
diff --git a/cpu/native/periph/hwrng.c b/cpu/native/periph/hwrng.c
index 778209e7e..4601f9bc9 100644
--- a/cpu/native/periph/hwrng.c
+++ b/cpu/native/periph/hwrng.c
@@ -36,8 +36,8 @@ static int initialized = 0;
static int dev_random = -1;
/**********************************************************************
- * internal API declaration
- **********************************************************************/
+* internal API declaration
+**********************************************************************/
/**
* seed host random module with @ref _native_rng_seed
@@ -48,8 +48,8 @@ unsigned _native_rng_read_det(uint8_t *buf, unsigned num);
unsigned _native_rng_read_hq(uint8_t *buf, unsigned num);
/**********************************************************************
- * public API implementation
- **********************************************************************/
+* public API implementation
+**********************************************************************/
void hwrng_init(void)
{
@@ -63,7 +63,7 @@ void hwrng_init(void)
break;
default:
err(EXIT_FAILURE, "hwrng_init: _native_rng_mode is in invalid state %i\n",
- _native_rng_mode);
+ _native_rng_mode);
break;
}
@@ -89,14 +89,14 @@ void hwrng_read(void *buf, unsigned int num)
break;
default:
err(EXIT_FAILURE, "hwrng_read: _native_rng_mode is in invalid state %i\n",
- _native_rng_mode);
+ _native_rng_mode);
break;
}
}
/**********************************************************************
- * internal API implementation
- **********************************************************************/
+* internal API implementation
+**********************************************************************/
void _native_rng_init_det(void)
{
diff --git a/cpu/native/periph/qdec.c b/cpu/native/periph/qdec.c
index 618a1a1d7..94c5a059e 100644
--- a/cpu/native/periph/qdec.c
+++ b/cpu/native/periph/qdec.c
@@ -54,7 +54,7 @@
/* QDEC devices */
uint32_t qdecs[QDEC_NUMOF];
/* QDEC values for each device, should be set externally */
-int32_t qdecs_value[QDEC_NUMOF];
+int32_t qdecs_value[QDEC_NUMOF];
int32_t qdec_init(qdec_t qdec, qdec_mode_t mode, qdec_cb_t cb, void *arg)
{
diff --git a/cpu/native/periph/uart.c b/cpu/native/periph/uart.c
index 7b5857170..7b21bc764 100644
--- a/cpu/native/periph/uart.c
+++ b/cpu/native/periph/uart.c
@@ -116,28 +116,28 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
speed_t speed;
switch (baudrate) {
- case 0: speed = B0; break;
- case 50: speed = B50; break;
- case 75: speed = B75; break;
- case 110: speed = B110; break;
- case 134: speed = B134; break;
- case 150: speed = B150; break;
- case 200: speed = B200; break;
- case 300: speed = B300; break;
- case 600: speed = B600; break;
- case 1200: speed = B1200; break;
- case 1800: speed = B1800; break;
- case 2400: speed = B2400; break;
- case 4800: speed = B4800; break;
- case 9600: speed = B9600; break;
- case 19200: speed = B19200; break;
- case 38400: speed = B38400; break;
- case 57600: speed = B57600; break;
- case 115200: speed = B115200; break;
- case 230400: speed = B230400 ; break;
- default:
- return UART_NOBAUD;
- break;
+ case 0: speed = B0; break;
+ case 50: speed = B50; break;
+ case 75: speed = B75; break;
+ case 110: speed = B110; break;
+ case 134: speed = B134; break;
+ case 150: speed = B150; break;
+ case 200: speed = B200; break;
+ case 300: speed = B300; break;
+ case 600: speed = B600; break;
+ case 1200: speed = B1200; break;
+ case 1800: speed = B1800; break;
+ case 2400: speed = B2400; break;
+ case 4800: speed = B4800; break;
+ case 9600: speed = B9600; break;
+ case 19200: speed = B19200; break;
+ case 38400: speed = B38400; break;
+ case 57600: speed = B57600; break;
+ case 115200: speed = B115200; break;
+ case 230400: speed = B230400; break;
+ default:
+ return UART_NOBAUD;
+ break;
}
cfsetospeed(&termios, speed);
diff --git a/cpu/native/socket_zep/socket_zep.c b/cpu/native/socket_zep/socket_zep.c
index 162d55ad0..394d692e3 100644
--- a/cpu/native/socket_zep/socket_zep.c
+++ b/cpu/native/socket_zep/socket_zep.c
@@ -330,7 +330,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value,
{
assert(netdev != NULL);
return netdev_ieee802154_set((netdev_ieee802154_t *)netdev, opt,
- value, value_len);
+ value, value_len);
}
static const netdev_driver_t socket_zep_driver = {
diff --git a/cpu/native/startup.c b/cpu/native/startup.c
index 449f781db..46df9e5bb 100644
--- a/cpu/native/startup.c
+++ b/cpu/native/startup.c
@@ -85,15 +85,15 @@ socket_zep_params_t socket_zep_params[SOCKET_ZEP_MAX];
static const char short_opts[] = ":hi:s:deEoc:"
#ifdef MODULE_MTD_NATIVE
- "m:"
+ "m:"
#endif
#ifdef MODULE_CAN_LINUX
- "n:"
+ "n:"
#endif
#ifdef MODULE_SOCKET_ZEP
- "z:"
+ "z:"
#endif
- "";
+ "";
static const struct option long_opts[] = {
{ "help", no_argument, NULL, 'h' },
@@ -166,7 +166,7 @@ int _native_log_output(_stdiotype_t stdiotype, int output)
char logname[sizeof("/tmp/riot.stderr.") + 20];
snprintf(logname, sizeof(logname), "/tmp/riot.std%s.%d",
- (output == STDOUT_FILENO) ? "out": "err", _native_pid);
+ (output == STDOUT_FILENO) ? "out" : "err", _native_pid);
if ((outfile = real_creat(logname, 0666)) == -1) {
err(EXIT_FAILURE, "_native_log_output: open");
}
@@ -255,43 +255,43 @@ void usage_exit(int status)
real_printf(" help: %s -h\n\n", _progname);
real_printf("\nOptions:\n"
-" -h, --help\n"
-" print this help message\n"
-" -i <id>, --id=<id>\n"
-" specify instance id (set by config module)\n"
-" -s <seed>, --seed=<seed>\n"
-" specify srandom(3) seed (/dev/random is used instead of random(3) if\n"
-" the option is omitted)\n"
-" -d, --daemonize\n"
-" daemonize native instance\n"
-" -e, --stderr-pipe\n"
-" redirect stderr to file\n"
-" -E, --stderr-noredirect\n"
-" do not redirect stderr (i.e. leave sterr unchanged despite\n"
-" daemon/socket io)\n"
-" -o, --stdout-pipe\n"
-" redirect stdout to file (/tmp/riot.stdout.PID) when not attached\n"
-" to socket\n"
-" -c <tty>, --uart-tty=<tty>\n"
-" specify TTY device for UART. This argument can be used multiple\n"
-" times (up to UART_NUMOF)\n"
+ " -h, --help\n"
+ " print this help message\n"
+ " -i <id>, --id=<id>\n"
+ " specify instance id (set by config module)\n"
+ " -s <seed>, --seed=<seed>\n"
+ " specify srandom(3) seed (/dev/random is used instead of random(3) if\n"
+ " the option is omitted)\n"
+ " -d, --daemonize\n"
+ " daemonize native instance\n"
+ " -e, --stderr-pipe\n"
+ " redirect stderr to file\n"
+ " -E, --stderr-noredirect\n"
+ " do not redirect stderr (i.e. leave sterr unchanged despite\n"
+ " daemon/socket io)\n"
+ " -o, --stdout-pipe\n"
+ " redirect stdout to file (/tmp/riot.stdout.PID) when not attached\n"
+ " to socket\n"
+ " -c <tty>, --uart-tty=<tty>\n"
+ " specify TTY device for UART. This argument can be used multiple\n"
+ " times (up to UART_NUMOF)\n"
#if defined(MODULE_SOCKET_ZEP) && (SOCKET_ZEP_MAX > 0)
-" -z [<laddr>:<lport>,]<raddr>:<rport> --zep=[<laddr>:<lport>,]<raddr>:<rport>\n"
-" provide a ZEP interface with local address and port (<laddr>, <lport>)\n"
-" and remote address and port (default local: [::]:17754).\n"
-" Required to be provided SOCKET_ZEP_MAX times\n"
+ " -z [<laddr>:<lport>,]<raddr>:<rport> --zep=[<laddr>:<lport>,]<raddr>:<rport>\n"
+ " provide a ZEP interface with local address and port (<laddr>, <lport>)\n"
+ " and remote address and port (default local: [::]:17754).\n"
+ " Required to be provided SOCKET_ZEP_MAX times\n"
#endif
- );
+ );
#ifdef MODULE_MTD_NATIVE
real_printf(
-" -m <mtd>, --mtd=<mtd>\n"
-" specify the file name of mtd emulated device\n");
+ " -m <mtd>, --mtd=<mtd>\n"
+ " specify the file name of mtd emulated device\n");
#endif
#if defined(MODULE_CAN_LINUX)
real_printf(
-" -n <ifnum>:<ifname>, --can <ifnum>:<ifname>\n"
-" specify CAN interface <ifname> to use for CAN device #<ifnum>\n"
-" max number of CAN device: %d\n", CAN_DLL_NUMOF);
+ " -n <ifnum>:<ifname>, --can <ifnum>:<ifname>\n"
+ " specify CAN interface <ifname> to use for CAN device #<ifnum>\n"
+ " max number of CAN device: %d\n", CAN_DLL_NUMOF);
#endif
real_exit(status);
}
@@ -393,7 +393,7 @@ __attribute__((constructor)) static void startup(int argc, char **argv, char **e
while ((c = getopt_long(argc, argv, short_opts, long_opts, &opt_idx)) >= 0) {
switch (c) {
case 0:
- /* fall through to 'h' */
+ /* fall through to 'h' */
case 'h':
usage_exit(EXIT_SUCCESS);
break;
@@ -433,7 +433,7 @@ __attribute__((constructor)) static void startup(int argc, char **argv, char **e
break;
#endif
#if defined(MODULE_CAN_LINUX)
- case 'n':{
+ case 'n': {
int i;
i = atol(optarg);
if (i >= (int)CAN_DLL_NUMOF) {
@@ -448,8 +448,8 @@ __attribute__((constructor)) static void startup(int argc, char **argv, char **e
optarg++;
strncpy(candev_linux_conf[i].interface_name, optarg,
CAN_MAX_SIZE_INTERFACE_NAME);
- }
- break;
+ }
+ break;
#endif
#ifdef MODULE_SOCKET_ZEP
case 'z':
diff --git a/cpu/native/syscalls.c b/cpu/native/syscalls.c
index 483d4a796..a9a8b75e2 100644
--- a/cpu/native/syscalls.c
+++ b/cpu/native/syscalls.c
@@ -84,7 +84,7 @@ int (*real_pause)(void);
int (*real_pipe)(int[2]);
int (*real_select)(int nfds, ...);
int (*real_setitimer)(int which, const struct itimerval
- *restrict value, struct itimerval *restrict ovalue);
+ *restrict value, struct itimerval *restrict ovalue);
int (*real_setsid)(void);
int (*real_setsockopt)(int socket, ...);
int (*real_socket)(int domain, int type, int protocol);
@@ -119,12 +119,12 @@ void _native_syscall_leave(void)
#endif
_native_in_syscall--;
if (
- (_native_sigpend > 0)
- && (_native_in_isr == 0)
- && (_native_in_syscall == 0)
- && (native_interrupts_enabled == 1)
- && (sched_active_thread != NULL)
- )
+ (_native_sigpend > 0)
+ && (_native_in_isr == 0)
+ && (_native_in_syscall == 0)
+ && (native_interrupts_enabled == 1)
+ && (sched_active_thread != NULL)
+ )
{
_native_in_isr = 1;
_native_cur_ctx = (ucontext_t *)sched_active_thread->sp;
diff --git a/cpu/nrf51/periph/pwm.c b/cpu/nrf51/periph/pwm.c
index 5749dec50..bfaa50fe9 100644
--- a/cpu/nrf51/periph/pwm.c
+++ b/cpu/nrf51/periph/pwm.c
@@ -228,8 +228,8 @@ void pwm_poweroff(pwm_t dev)
if (((NRF_GPIOTE->CONFIG[PWM_GPIOTE_CH] & GPIOTE_CONFIG_OUTINIT_Msk) == 0) &
(PWM_TIMER->CC[1] != PWM_TIMER->CC[0]) &
(PWM_TIMER->CC[0] != 0)) {
- init_data[0] = ((PWM_TIMER->CC[1] << 16) |
- (PWM_TIMER->CC[1] - PWM_TIMER->CC[0]));
+ init_data[0] = ((PWM_TIMER->CC[1] << 16) |
+ (PWM_TIMER->CC[1] - PWM_TIMER->CC[0]));
} else {
init_data[0] = ((PWM_TIMER->CC[1] << 16) | PWM_TIMER->CC[0]);
}
diff --git a/cpu/nrf52/cpu.c b/cpu/nrf52/cpu.c
index e0dfd28c6..94eb8d3ef 100644
--- a/cpu/nrf52/cpu.c
+++ b/cpu/nrf52/cpu.c
@@ -67,7 +67,7 @@ void cpu_init(void)
/* softdevice needs to be enabled from ISR context */
#ifdef SOFTDEVICE_PRESENT
softdevice_handler_init(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, &_ble_evt_buffer,
- BLE_STACK_EVT_MSG_BUF_SIZE, NULL);
+ BLE_STACK_EVT_MSG_BUF_SIZE, NULL);
/* fixup swi0 (used as softdevice PendSV trampoline) */
NVIC_EnableIRQ(SWI0_EGU0_IRQn);
diff --git a/cpu/nrf52/periph/i2c.c b/cpu/nrf52/periph/i2c.c
index a99cd84ba..97b121451 100644
--- a/cpu/nrf52/periph/i2c.c
+++ b/cpu/nrf52/periph/i2c.c
@@ -162,7 +162,7 @@ int i2c_read_regs(i2c_t bus, uint8_t addr, uint8_t reg,
assert((bus < I2C_NUMOF) && data && (len > 0) && (len < 256));
DEBUG("[i2c] read_regs: %i byte(s) from reg 0x%02x at addr 0x%02x\n",
- (int)len, (int)reg, (int)addr);
+ (int)len, (int)reg, (int)addr);
dev(bus)->ADDRESS = addr;
dev(bus)->TXD.PTR = (uint32_t)&reg;
diff --git a/cpu/nrf5x_common/periph/uart.c b/cpu/nrf5x_common/periph/uart.c
index dc2be7a4e..e3dd8e09a 100644
--- a/cpu/nrf5x_common/periph/uart.c
+++ b/cpu/nrf5x_common/periph/uart.c
@@ -58,7 +58,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
uart_config.arg = arg;
#ifdef CPU_FAM_NRF51
- /* power on the UART device */
+ /* power on the UART device */
NRF_UART0->POWER = 1;
#endif
@@ -167,7 +167,7 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
exit this function with the TXRDY flag set, then the interrupted
thread may have not transmitted his data but will still exit the
while loop.
- */
+ */
/* reset ready flag */
NRF_UART0->EVENTS_TXDRDY = 0;
diff --git a/cpu/sam0_common/include/periph_cpu_common.h b/cpu/sam0_common/include/periph_cpu_common.h
index caa954f4c..ee7bedece 100644
--- a/cpu/sam0_common/include/periph_cpu_common.h
+++ b/cpu/sam0_common/include/periph_cpu_common.h
@@ -306,7 +306,7 @@ static inline void sercom_set_gen(void *sercom, uint32_t gclk)
while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) {}
#elif defined(CPU_FAM_SAML21)
GCLK->PCHCTRL[SERCOM0_GCLK_ID_CORE + sercom_id(sercom)].reg =
- (GCLK_PCHCTRL_CHEN | gclk);
+ (GCLK_PCHCTRL_CHEN | gclk);
#endif
}
diff --git a/cpu/sam0_common/periph/adc.c b/cpu/sam0_common/periph/adc.c
index a9ad2127a..e0c20e517 100644
--- a/cpu/sam0_common/periph/adc.c
+++ b/cpu/sam0_common/periph/adc.c
@@ -100,7 +100,7 @@ static int _adc_configure(adc_res_t res)
PM->APBCMASK.reg |= PM_APBCMASK_ADC;
/* GCLK Setup */
GCLK->CLKCTRL.reg = (uint32_t)(GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 |
- (GCLK_CLKCTRL_ID(ADC_GCLK_ID)));
+ (GCLK_CLKCTRL_ID(ADC_GCLK_ID)));
/* Configure CTRLB Register HERE IS THE RESOLUTION SET! */
ADC_0_DEV->CTRLB.reg = ADC_0_PRESCALER | res;
/* Load the fixed device calibration constants */
@@ -108,7 +108,7 @@ static int _adc_configure(adc_res_t res)
ADC_CALIB_BIAS_CAL((*(uint32_t*)ADC_FUSES_BIASCAL_ADDR >>
ADC_FUSES_BIASCAL_Pos)) |
ADC_CALIB_LINEARITY_CAL((*(uint64_t*)ADC_FUSES_LINEARITY_0_ADDR >>
- ADC_FUSES_LINEARITY_0_Pos));
+ ADC_FUSES_LINEARITY_0_Pos));
/* Set Voltage Reference */
ADC_0_DEV->REFCTRL.reg = ADC_0_REF_DEFAULT;
/* Disable all interrupts */
@@ -134,10 +134,10 @@ static int _adc_configure(adc_res_t res)
ADC_INTENCLR_RESRDY;
/* Set default calibration from NVM */
ADC_0_DEV->CALIB.reg =
- ADC_FUSES_BIASCOMP((*(uint32_t*)ADC_FUSES_BIASCOMP_ADDR)) >>
- ADC_CALIB_BIASCOMP_Pos |
- ADC_FUSES_BIASREFBUF((*(uint32_t*)ADC_FUSES_BIASREFBUF_ADDR) >>
- ADC_FUSES_BIASREFBUF_Pos);
+ ADC_FUSES_BIASCOMP((*(uint32_t*)ADC_FUSES_BIASCOMP_ADDR)) >>
+ ADC_CALIB_BIASCOMP_Pos |
+ ADC_FUSES_BIASREFBUF((*(uint32_t*)ADC_FUSES_BIASREFBUF_ADDR) >>
+ ADC_FUSES_BIASREFBUF_Pos);
while (_adc_syncing()) {}
/* Enable bandgap if necessary */
if (ADC_0_REF_DEFAULT == ADC_REFCTRL_REFSEL_INTREF) {
diff --git a/cpu/sam0_common/periph/flashpage.c b/cpu/sam0_common/periph/flashpage.c
index 6c7d9495a..bbf8af85b 100644
--- a/cpu/sam0_common/periph/flashpage.c
+++ b/cpu/sam0_common/periph/flashpage.c
@@ -65,7 +65,7 @@ void flashpage_write_raw(void *target_addr, const void *data, size_t len)
/* ensure 4 byte aligned writes */
assert(!(((unsigned)target_addr % FLASHPAGE_RAW_ALIGNMENT) ||
- ((unsigned)data % FLASHPAGE_RAW_ALIGNMENT)));
+ ((unsigned)data % FLASHPAGE_RAW_ALIGNMENT)));
/* ensure the length doesn't exceed the actual flash size */
assert(((unsigned)target_addr + len) <
diff --git a/cpu/sam0_common/periph/i2c.c b/cpu/sam0_common/periph/i2c.c
index c6fe96d51..441a759f5 100644
--- a/cpu/sam0_common/periph/i2c.c
+++ b/cpu/sam0_common/periph/i2c.c
@@ -126,11 +126,11 @@ int i2c_init_master(i2c_t dev, i2c_speed_t speed)
/* I2C using CLK GEN 0 */
#if CPU_FAM_SAML21
GCLK->PCHCTRL[sercom_gclk_id].reg = (GCLK_PCHCTRL_CHEN |
- GCLK_PCHCTRL_GEN_GCLK0 );
+ GCLK_PCHCTRL_GEN_GCLK0 );
while (GCLK->SYNCBUSY.bit.GENCTRL) {}
GCLK->PCHCTRL[sercom_gclk_id_slow].reg = (GCLK_PCHCTRL_CHEN |
- GCLK_PCHCTRL_GEN_GCLK0 );
+ GCLK_PCHCTRL_GEN_GCLK0 );
while (GCLK->SYNCBUSY.bit.GENCTRL) {}
#else
GCLK->CLKCTRL.reg = (GCLK_CLKCTRL_CLKEN |
diff --git a/cpu/sam0_common/periph/spi.c b/cpu/sam0_common/periph/spi.c
index a3a426bd8..7c6bcb01f 100644
--- a/cpu/sam0_common/periph/spi.c
+++ b/cpu/sam0_common/periph/spi.c
@@ -90,7 +90,7 @@ void spi_init(spi_t bus)
while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) {}
#elif defined(CPU_FAM_SAML21)
GCLK->PCHCTRL[SERCOM0_GCLK_ID_CORE + sercom_id(dev(bus))].reg =
- (GCLK_PCHCTRL_CHEN | GCLK_PCHCTRL_GEN_GCLK0);
+ (GCLK_PCHCTRL_CHEN | GCLK_PCHCTRL_GEN_GCLK0);
#endif
/* enable receiver and configure character size to 8-bit
diff --git a/cpu/sam3/periph/cpuid.c b/cpu/sam3/periph/cpuid.c
index 2217b4367..723b64e93 100644
--- a/cpu/sam3/periph/cpuid.c
+++ b/cpu/sam3/periph/cpuid.c
@@ -36,19 +36,19 @@ void cpuid_get(void *id)
uint32_t cpuid[4]; /* 128 bits sam3 unique indentifier */
/*
- Reading SAM3 Unique Identifier process (P 19.3.3.8):
- - Send the Start Read unique Identifier command (STUI) by writing the Flash Command Register with the
- STUI command.
- - When the Unique Identifier is ready to be read, the FRDY bit in the Flash Programming Status Register
- (EEFC_FSR) falls
- - The Unique Identifier is located in the first 128 bits of the Flash memory mapping. So, at the address
- 0x400000-0x40008F.
- - To stop the Unique Identifier mode, the user needs to send the Stop Read unique Identifier command (SPUI)
- by writing the Flash Command Register with the SPUI command.
- - When the Stop read Unique Identifier command (SPUI) has been performed, the FRDY bit in the Flash
- Programming Status Register (EEFC_FSR) rises. If an interrupt was enabled by setting the FRDY bit in
- EEFC_FMR, the interrupt line of the NVIC is activated.
- */
+ Reading SAM3 Unique Identifier process (P 19.3.3.8):
+ - Send the Start Read unique Identifier command (STUI) by writing the Flash Command Register with the
+ STUI command.
+ - When the Unique Identifier is ready to be read, the FRDY bit in the Flash Programming Status Register
+ (EEFC_FSR) falls
+ - The Unique Identifier is located in the first 128 bits of the Flash memory mapping. So, at the address
+ 0x400000-0x40008F.
+ - To stop the Unique Identifier mode, the user needs to send the Stop Read unique Identifier command (SPUI)
+ by writing the Flash Command Register with the SPUI command.
+ - When the Stop read Unique Identifier command (SPUI) has been performed, the FRDY bit in the Flash
+ Programming Status Register (EEFC_FSR) rises. If an interrupt was enabled by setting the FRDY bit in
+ EEFC_FMR, the interrupt line of the NVIC is activated.
+ */
/* Send STUI */
EFC1->EEFC_FCR = EEFC_FCR_FKEY(EFC_KEY) | EFC_FCMD_STUI;
@@ -63,7 +63,7 @@ void cpuid_get(void *id)
cpuid[3] = *(uint32_t *)(IFLASH1_ADDR + 12);
/* Send SPUI */
- EFC1->EEFC_FCR = EEFC_FCR_FKEY(EFC_KEY) | EFC_FCMD_SPUI ;
+ EFC1->EEFC_FCR = EEFC_FCR_FKEY(EFC_KEY) | EFC_FCMD_SPUI;
/* Wait for FRDY bit rises. */
while (0 == (EFC1->EEFC_FSR & EEFC_FSR_FRDY)) {}
diff --git a/cpu/sam3/periph/gpio.c b/cpu/sam3/periph/gpio.c
index ebe7d73a2..fc71dc67a 100644
--- a/cpu/sam3/periph/gpio.c
+++ b/cpu/sam3/periph/gpio.c
@@ -163,7 +163,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
port->PIO_IDR = (1 << pin_num);
_ctx_clear(port_num, pin_num);
- /* give the PIO module the power over the corresponding pin */
+ /* give the PIO module the power over the corresponding pin */
port->PIO_PER = (1 << pin_num);
/* configure pin direction (in/out) */
@@ -267,7 +267,7 @@ int gpio_read(gpio_t pin)
Pio *port = _port(pin);
int pin_num = _pin_num(pin);
- if (port->PIO_OSR & (1 << pin_num)) {
+ if (port->PIO_OSR & (1 << pin_num)) {
return (port->PIO_ODSR & (1 << pin_num)) ? 1 : 0;
}
else {
diff --git a/cpu/sam3/periph/spi.c b/cpu/sam3/periph/spi.c
index c3ef8f513..ef48c0cfa 100644
--- a/cpu/sam3/periph/spi.c
+++ b/cpu/sam3/periph/spi.c
@@ -1,11 +1,11 @@
/*
-* Copyright (C) 2014 Hamburg University of Applied Sciences
-* 2016-2017 Freie Universität Berlin
+ * Copyright (C) 2014 Hamburg University of Applied Sciences
+ * 2016-2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
-*/
+ */
/**
* @ingroup cpu_sam3
diff --git a/cpu/sam3/periph/timer.c b/cpu/sam3/periph/timer.c
index 1500e4c25..6867f2963 100644
--- a/cpu/sam3/periph/timer.c
+++ b/cpu/sam3/periph/timer.c
@@ -93,7 +93,7 @@ int timer_init(tim_t tim, unsigned long freq, timer_cb_t cb, void *arg)
dev(tim)->TC_BMR = TC_BMR_TC0XC0S_TIOA1;
/* configure and enable channel 0 to use XC0 as input */
dev(tim)->TC_CHANNEL[0].TC_CMR = (TC_CMR_TCCLKS_XC0 |
- TC_CMR_WAVE | TC_CMR_EEVT_XC0);
+ TC_CMR_WAVE | TC_CMR_EEVT_XC0);
dev(tim)->TC_CHANNEL[0].TC_CCR = (TC_CCR_CLKEN | TC_CCR_SWTRG);
/* configure channel 1:
diff --git a/cpu/samd21/cpu.c b/cpu/samd21/cpu.c
index 9590e9fcc..c315bffe7 100644
--- a/cpu/samd21/cpu.c
+++ b/cpu/samd21/cpu.c
@@ -92,21 +92,21 @@ static void clk_init(void)
SYSCTRL->DPLLCTRLB.reg = (SYSCTRL_DPLLCTRLB_REFCLK_GCLK);
SYSCTRL->DPLLCTRLA.reg = (SYSCTRL_DPLLCTRLA_ENABLE);
while(!(SYSCTRL->DPLLSTATUS.reg &
- (SYSCTRL_DPLLSTATUS_CLKRDY | SYSCTRL_DPLLSTATUS_LOCK))) {}
+ (SYSCTRL_DPLLSTATUS_CLKRDY | SYSCTRL_DPLLSTATUS_LOCK))) {}
/* select the PLL as source for clock generator 0 (CPU core clock) */
GCLK->GENDIV.reg = (GCLK_GENDIV_DIV(CLOCK_PLL_DIV) |
- GCLK_GENDIV_ID(0));
+ GCLK_GENDIV_ID(0));
GCLK->GENCTRL.reg = (GCLK_GENCTRL_GENEN |
GCLK_GENCTRL_SRC_FDPLL |
GCLK_GENCTRL_ID(0));
#elif CLOCK_USE_XOSC32_DFLL
/* Use External 32.768KHz Oscillator */
SYSCTRL->XOSC32K.reg = SYSCTRL_XOSC32K_ONDEMAND |
- SYSCTRL_XOSC32K_EN32K |
- SYSCTRL_XOSC32K_XTALEN |
- SYSCTRL_XOSC32K_STARTUP(6) |
- SYSCTRL_XOSC32K_RUNSTDBY;
+ SYSCTRL_XOSC32K_EN32K |
+ SYSCTRL_XOSC32K_XTALEN |
+ SYSCTRL_XOSC32K_STARTUP(6) |
+ SYSCTRL_XOSC32K_RUNSTDBY;
/* Enable with Seperate Call */
SYSCTRL->XOSC32K.bit.ENABLE = 1;
@@ -178,7 +178,7 @@ static void clk_init(void)
}
#else /* do not use PLL, use internal 8MHz oscillator directly */
GCLK->GENDIV.reg = (GCLK_GENDIV_DIV(CLOCK_DIV) |
- GCLK_GENDIV_ID(0));
+ GCLK_GENDIV_ID(0));
GCLK->GENCTRL.reg = (GCLK_GENCTRL_GENEN |
GCLK_GENCTRL_SRC_OSC8M |
GCLK_GENCTRL_ID(0));
@@ -191,8 +191,8 @@ static void clk_init(void)
/* Setup Clock generator 2 with divider 1 (32.768kHz) */
GCLK->GENDIV.reg = (GCLK_GENDIV_ID(2) | GCLK_GENDIV_DIV(0));
GCLK->GENCTRL.reg = (GCLK_GENCTRL_ID(2) | GCLK_GENCTRL_GENEN |
- GCLK_GENCTRL_RUNSTDBY |
- GCLK_GENCTRL_SRC_OSCULP32K);
+ GCLK_GENCTRL_RUNSTDBY |
+ GCLK_GENCTRL_SRC_OSCULP32K);
while (GCLK->STATUS.bit.SYNCBUSY) {}
#endif
diff --git a/cpu/samd21/periph/pm.c b/cpu/samd21/periph/pm.c
index e99babfbf..90d914f72 100644
--- a/cpu/samd21/periph/pm.c
+++ b/cpu/samd21/periph/pm.c
@@ -77,7 +77,7 @@ void pm_set(unsigned mode)
case 3:
/* Sleep mode Idle 0
* Potential Wake Up sources: Synchronous (APB, AHB), asynchronous
- */
+ */
PM->SLEEP.reg = SYSTEM_SLEEPMODE_IDLE_0;
break;
}
diff --git a/cpu/samd21/periph/rtc.c b/cpu/samd21/periph/rtc.c
index d9513a559..a5a16bffd 100644
--- a/cpu/samd21/periph/rtc.c
+++ b/cpu/samd21/periph/rtc.c
@@ -32,8 +32,8 @@ typedef struct {
static rtc_state_t rtc_callback;
/* At 1Hz, RTC goes till 63 years (2^5, see 17.8.22 in datasheet)
-* reference_year is set to 100 (offset) to be in our current time (2000)
-* Thanks to this, the user will be able to set time in 2000's*/
+ * reference_year is set to 100 (offset) to be in our current time (2000)
+ * Thanks to this, the user will be able to set time in 2000's*/
static uint16_t reference_year = 100;
void rtc_init(void)
@@ -45,10 +45,10 @@ void rtc_init(void)
/* RTC uses External 32,768KHz Oscillator (OSC32K isn't accurate enough p1075/1138)*/
SYSCTRL->XOSC32K.reg = SYSCTRL_XOSC32K_ONDEMAND |
- SYSCTRL_XOSC32K_EN32K |
- SYSCTRL_XOSC32K_XTALEN |
- SYSCTRL_XOSC32K_STARTUP(6) |
- SYSCTRL_XOSC32K_ENABLE;
+ SYSCTRL_XOSC32K_EN32K |
+ SYSCTRL_XOSC32K_XTALEN |
+ SYSCTRL_XOSC32K_STARTUP(6) |
+ SYSCTRL_XOSC32K_ENABLE;
/* Setup clock GCLK2 with OSC32K divided by 32 */
GCLK->GENDIV.reg = GCLK_GENDIV_ID(2)|GCLK_GENDIV_DIV(4);
@@ -83,11 +83,11 @@ int rtc_set_time(struct tm *time)
}
else {
rtcMode2->CLOCK.reg = RTC_MODE2_CLOCK_YEAR(time->tm_year - reference_year)
- | RTC_MODE2_CLOCK_MONTH(time->tm_mon + 1)
- | RTC_MODE2_CLOCK_DAY(time->tm_mday)
- | RTC_MODE2_CLOCK_HOUR(time->tm_hour)
- | RTC_MODE2_CLOCK_MINUTE(time->tm_min)
- | RTC_MODE2_CLOCK_SECOND(time->tm_sec);
+ | RTC_MODE2_CLOCK_MONTH(time->tm_mon + 1)
+ | RTC_MODE2_CLOCK_DAY(time->tm_mday)
+ | RTC_MODE2_CLOCK_HOUR(time->tm_hour)
+ | RTC_MODE2_CLOCK_MINUTE(time->tm_min)
+ | RTC_MODE2_CLOCK_SECOND(time->tm_sec);
}
while (rtcMode2->STATUS.bit.SYNCBUSY) {}
return 0;
@@ -118,11 +118,11 @@ int rtc_set_alarm(struct tm *time, rtc_alarm_cb_t cb, void *arg)
}
else {
rtcMode2->Mode2Alarm[0].ALARM.reg = RTC_MODE2_ALARM_YEAR(time->tm_year - reference_year)
- | RTC_MODE2_ALARM_MONTH(time->tm_mon + 1)
- | RTC_MODE2_ALARM_DAY(time->tm_mday)
- | RTC_MODE2_ALARM_HOUR(time->tm_hour)
- | RTC_MODE2_ALARM_MINUTE(time->tm_min)
- | RTC_MODE2_ALARM_SECOND(time->tm_sec);
+ | RTC_MODE2_ALARM_MONTH(time->tm_mon + 1)
+ | RTC_MODE2_ALARM_DAY(time->tm_mday)
+ | RTC_MODE2_ALARM_HOUR(time->tm_hour)
+ | RTC_MODE2_ALARM_MINUTE(time->tm_min)
+ | RTC_MODE2_ALARM_SECOND(time->tm_sec);
rtcMode2->Mode2Alarm[0].MASK.reg = RTC_MODE2_MASK_SEL(6);
}
while (rtcMode2->STATUS.bit.SYNCBUSY) {}
@@ -190,7 +190,7 @@ void isr_rtc(void)
}
if (status & RTC_MODE2_INTFLAG_OVF) {
/* At 1Hz, RTC goes till 63 years (2^5, see 17.8.22 in datasheet)
- * Start RTC again with reference_year 64 years more (Be careful with alarm set) */
+ * Start RTC again with reference_year 64 years more (Be careful with alarm set) */
reference_year += 64;
rtcMode2->INTFLAG.reg = RTC_MODE2_INTFLAG_OVF;
}
diff --git a/cpu/samd21/periph/rtt.c b/cpu/samd21/periph/rtt.c
index f3563b8ab..6af4e8331 100644
--- a/cpu/samd21/periph/rtt.c
+++ b/cpu/samd21/periph/rtt.c
@@ -30,10 +30,10 @@
#endif
typedef struct {
- rtt_cb_t overflow_cb; /**< called from RTT interrupt on overflow */
+ rtt_cb_t overflow_cb; /**< called from RTT interrupt on overflow */
void* overflow_arg; /**< argument passed to overflow callback */
- rtt_cb_t alarm_cb; /**< called from RTT interrupt on alarm */
+ rtt_cb_t alarm_cb; /**< called from RTT interrupt on alarm */
void* alarm_arg; /**< argument passen to alarm callback */
} rtt_state_t;
@@ -65,13 +65,13 @@ void rtt_init(void)
/* RTC uses External 32,768KHz Oscillator because OSC32K isn't accurate
* enough (p1075/1138). Also keep running in standby. */
SYSCTRL->XOSC32K.reg = SYSCTRL_XOSC32K_ONDEMAND |
- SYSCTRL_XOSC32K_EN32K |
- SYSCTRL_XOSC32K_XTALEN |
- SYSCTRL_XOSC32K_STARTUP(6) |
+ SYSCTRL_XOSC32K_EN32K |
+ SYSCTRL_XOSC32K_XTALEN |
+ SYSCTRL_XOSC32K_STARTUP(6) |
#if RTT_RUNSTDBY
- SYSCTRL_XOSC32K_RUNSTDBY |
+ SYSCTRL_XOSC32K_RUNSTDBY |
#endif
- SYSCTRL_XOSC32K_ENABLE;
+ SYSCTRL_XOSC32K_ENABLE;
/* Setup clock GCLK2 with divider 1 */
GCLK->GENDIV.reg = GCLK_GENDIV_ID(2) | GCLK_GENDIV_DIV(1);
diff --git a/cpu/samd21/periph/timer.c b/cpu/samd21/periph/timer.c
index 689d9bc73..69f05a42d 100644
--- a/cpu/samd21/periph/timer.c
+++ b/cpu/samd21/periph/timer.c
@@ -69,54 +69,54 @@ int timer_init(tim_t dev, unsigned long freq, timer_cb_t cb, void *arg)
switch (dev) {
#if TIMER_0_EN
- case TIMER_0:
- if (TIMER_0_DEV.CTRLA.bit.ENABLE) {
- return 0;
- }
- PM->APBCMASK.reg |= PM_APBCMASK_TC3;
- /* reset timer */
- TIMER_0_DEV.CTRLA.bit.SWRST = 1;
- while (TIMER_0_DEV.CTRLA.bit.SWRST) {}
- /* choosing 16 bit mode */
- TIMER_0_DEV.CTRLA.bit.MODE = TC_CTRLA_MODE_COUNT16_Val;
+ case TIMER_0:
+ if (TIMER_0_DEV.CTRLA.bit.ENABLE) {
+ return 0;
+ }
+ PM->APBCMASK.reg |= PM_APBCMASK_TC3;
+ /* reset timer */
+ TIMER_0_DEV.CTRLA.bit.SWRST = 1;
+ while (TIMER_0_DEV.CTRLA.bit.SWRST) {}
+ /* choosing 16 bit mode */
+ TIMER_0_DEV.CTRLA.bit.MODE = TC_CTRLA_MODE_COUNT16_Val;
#if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
- /* PLL/DFLL: sourced by 1MHz and prescaler 1 to reach 1MHz */
- TIMER_0_DEV.CTRLA.bit.PRESCALER = TC_CTRLA_PRESCALER_DIV1_Val;
+ /* PLL/DFLL: sourced by 1MHz and prescaler 1 to reach 1MHz */
+ TIMER_0_DEV.CTRLA.bit.PRESCALER = TC_CTRLA_PRESCALER_DIV1_Val;
#else
- /* sourced by 8MHz with Presc 8 results in 1MHz clk */
- TIMER_0_DEV.CTRLA.bit.PRESCALER = TC_CTRLA_PRESCALER_DIV8_Val;
+ /* sourced by 8MHz with Presc 8 results in 1MHz clk */
+ TIMER_0_DEV.CTRLA.bit.PRESCALER = TC_CTRLA_PRESCALER_DIV8_Val;
#endif
- /* choose normal frequency operation */
- TIMER_0_DEV.CTRLA.bit.WAVEGEN = TC_CTRLA_WAVEGEN_NFRQ_Val;
- break;
+ /* choose normal frequency operation */
+ TIMER_0_DEV.CTRLA.bit.WAVEGEN = TC_CTRLA_WAVEGEN_NFRQ_Val;
+ break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- if (TIMER_1_DEV.CTRLA.bit.ENABLE) {
- return 0;
- }
- PM->APBCMASK.reg |= PM_APBCMASK_TC4;
- /* reset timer */
- TIMER_1_DEV.CTRLA.bit.SWRST = 1;
+ case TIMER_1:
+ if (TIMER_1_DEV.CTRLA.bit.ENABLE) {
+ return 0;
+ }
+ PM->APBCMASK.reg |= PM_APBCMASK_TC4;
+ /* reset timer */
+ TIMER_1_DEV.CTRLA.bit.SWRST = 1;
- while (TIMER_1_DEV.CTRLA.bit.SWRST) {}
+ while (TIMER_1_DEV.CTRLA.bit.SWRST) {}
- TIMER_1_DEV.CTRLA.bit.MODE = TC_CTRLA_MODE_COUNT32_Val;
+ TIMER_1_DEV.CTRLA.bit.MODE = TC_CTRLA_MODE_COUNT32_Val;
#if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
- /* PLL/DFLL: sourced by 1MHz and prescaler 1 to reach 1MHz */
- TIMER_1_DEV.CTRLA.bit.PRESCALER = TC_CTRLA_PRESCALER_DIV1_Val;
+ /* PLL/DFLL: sourced by 1MHz and prescaler 1 to reach 1MHz */
+ TIMER_1_DEV.CTRLA.bit.PRESCALER = TC_CTRLA_PRESCALER_DIV1_Val;
#else
- /* sourced by 8MHz with Presc 8 results in 1Mhz clk */
- TIMER_1_DEV.CTRLA.bit.PRESCALER = TC_CTRLA_PRESCALER_DIV8_Val;
+ /* sourced by 8MHz with Presc 8 results in 1Mhz clk */
+ TIMER_1_DEV.CTRLA.bit.PRESCALER = TC_CTRLA_PRESCALER_DIV8_Val;
#endif
- /* choose normal frequency operation */
- TIMER_1_DEV.CTRLA.bit.WAVEGEN = TC_CTRLA_WAVEGEN_NFRQ_Val;
- break;
+ /* choose normal frequency operation */
+ TIMER_1_DEV.CTRLA.bit.WAVEGEN = TC_CTRLA_WAVEGEN_NFRQ_Val;
+ break;
#endif
- case TIMER_UNDEFINED:
- default:
- return -1;
+ case TIMER_UNDEFINED:
+ default:
+ return -1;
}
/* save callback */
@@ -138,46 +138,46 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value)
/* get timer base register address */
switch (dev) {
#if TIMER_0_EN
- case TIMER_0:
- /* set timeout value */
- switch (channel) {
- case 0:
- TIMER_0_DEV.INTFLAG.reg = TC_INTFLAG_MC0;
- TIMER_0_DEV.CC[0].reg = value;
- TIMER_0_DEV.INTENSET.reg = TC_INTENSET_MC0;
- break;
- case 1:
- TIMER_0_DEV.INTFLAG.reg = TC_INTFLAG_MC1;
- TIMER_0_DEV.CC[1].reg = value;
- TIMER_0_DEV.INTENSET.reg = TC_INTENSET_MC1;
+ case TIMER_0:
+ /* set timeout value */
+ switch (channel) {
+ case 0:
+ TIMER_0_DEV.INTFLAG.reg = TC_INTFLAG_MC0;
+ TIMER_0_DEV.CC[0].reg = value;
+ TIMER_0_DEV.INTENSET.reg = TC_INTENSET_MC0;
+ break;
+ case 1:
+ TIMER_0_DEV.INTFLAG.reg = TC_INTFLAG_MC1;
+ TIMER_0_DEV.CC[1].reg = value;
+ TIMER_0_DEV.INTENSET.reg = TC_INTENSET_MC1;
+ break;
+ default:
+ return -1;
+ }
break;
- default:
- return -1;
- }
- break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- /* set timeout value */
- switch (channel) {
- case 0:
- TIMER_1_DEV.INTFLAG.reg = TC_INTFLAG_MC0;
- TIMER_1_DEV.CC[0].reg = value;
- TIMER_1_DEV.INTENSET.reg = TC_INTENSET_MC0;
- break;
- case 1:
- TIMER_1_DEV.INTFLAG.reg = TC_INTFLAG_MC1;
- TIMER_1_DEV.CC[1].reg = value;
- TIMER_1_DEV.INTENSET.reg = TC_INTENSET_MC1;
+ case TIMER_1:
+ /* set timeout value */
+ switch (channel) {
+ case 0:
+ TIMER_1_DEV.INTFLAG.reg = TC_INTFLAG_MC0;
+ TIMER_1_DEV.CC[0].reg = value;
+ TIMER_1_DEV.INTENSET.reg = TC_INTENSET_MC0;
+ break;
+ case 1:
+ TIMER_1_DEV.INTFLAG.reg = TC_INTFLAG_MC1;
+ TIMER_1_DEV.CC[1].reg = value;
+ TIMER_1_DEV.INTENSET.reg = TC_INTENSET_MC1;
+ break;
+ default:
+ return -1;
+ }
break;
+#endif
+ case TIMER_UNDEFINED:
default:
return -1;
- }
- break;
-#endif
- case TIMER_UNDEFINED:
- default:
- return -1;
}
return 1;
@@ -188,40 +188,40 @@ int timer_clear(tim_t dev, int channel)
/* get timer base register address */
switch (dev) {
#if TIMER_0_EN
- case TIMER_0:
- switch (channel) {
- case 0:
- TIMER_0_DEV.INTFLAG.reg = TC_INTFLAG_MC0;
- TIMER_0_DEV.INTENCLR.reg = TC_INTENCLR_MC0;
- break;
- case 1:
- TIMER_0_DEV.INTFLAG.reg = TC_INTFLAG_MC1;
- TIMER_0_DEV.INTENCLR.reg = TC_INTENCLR_MC1;
+ case TIMER_0:
+ switch (channel) {
+ case 0:
+ TIMER_0_DEV.INTFLAG.reg = TC_INTFLAG_MC0;
+ TIMER_0_DEV.INTENCLR.reg = TC_INTENCLR_MC0;
+ break;
+ case 1:
+ TIMER_0_DEV.INTFLAG.reg = TC_INTFLAG_MC1;
+ TIMER_0_DEV.INTENCLR.reg = TC_INTENCLR_MC1;
+ break;
+ default:
+ return -1;
+ }
break;
- default:
- return -1;
- }
- break;
#endif
#if TIMER_1_EN
- case TIMER_1:
- switch (channel) {
- case 0:
- TIMER_1_DEV.INTFLAG.reg = TC_INTFLAG_MC0;
- TIMER_1_DEV.INTENCLR.reg = TC_INTENCLR_MC0;
- break;
- case 1:
- TIMER_1_DEV.INTFLAG.reg = TC_INTFLAG_MC1;
- TIMER_1_DEV.INTENCLR.reg = TC_INTENCLR_MC1;
+ case TIMER_1:
+ switch (channel) {
+ case 0:
+ TIMER_1_DEV.INTFLAG.reg = TC_INTFLAG_MC0;
+ TIMER_1_DEV.INTENCLR.reg = TC_INTENCLR_MC0;
+ break;
+ case 1:
+ TIMER_1_DEV.INTFLAG.reg = TC_INTFLAG_MC1;
+ TIMER_1_DEV.INTENCLR.reg = TC_INTENCLR_MC1;
+ break;
+ default:
+ return -1;
+ }
break;
+#endif
+ case TIMER_UNDEFINED:
default:
return -1;
- }
- break;
-#endif
- case TIMER_UNDEFINED:
- default:
- return -1;
}
return 1;
@@ -231,21 +231,21 @@ unsigned int timer_read(tim_t dev)
{
switch (dev) {
#if TIMER_0_EN
- case TIMER_0:
- /* request syncronisation */
- TIMER_0_DEV.READREQ.reg = TC_READREQ_RREQ | TC_READREQ_ADDR(0x10);
- while (TIMER_0_DEV.STATUS.bit.SYNCBUSY) {}
- return TIMER_0_DEV.COUNT.reg;
+ case TIMER_0:
+ /* request syncronisation */
+ TIMER_0_DEV.READREQ.reg = TC_READREQ_RREQ | TC_READREQ_ADDR(0x10);
+ while (TIMER_0_DEV.STATUS.bit.SYNCBUSY) {}
+ return TIMER_0_DEV.COUNT.reg;
#endif
#if TIMER_1_EN
- case TIMER_1:
- /* request syncronisation */
- TIMER_1_DEV.READREQ.reg = TC_READREQ_RREQ | TC_READREQ_ADDR(0x10);
- while (TIMER_1_DEV.STATUS.bit.SYNCBUSY) {}
- return TIMER_1_DEV.COUNT.reg;
+ case TIMER_1:
+ /* request syncronisation */
+ TIMER_1_DEV.READREQ.reg = TC_READREQ_RREQ | TC_READREQ_ADDR(0x10);
+ while (TIMER_1_DEV.STATUS.bit.SYNCBUSY) {}
+ return TIMER_1_DEV.COUNT.reg;
#endif
- default:
- return 0;
+ default:
+ return 0;
}
diff --git a/cpu/saml21/cpu.c b/cpu/saml21/cpu.c
index 77afb8948..0ae3959c2 100644
--- a/cpu/saml21/cpu.c
+++ b/cpu/saml21/cpu.c
@@ -52,7 +52,7 @@ void cpu_init(void)
|MCLK_APBAMASK_EIC
|MCLK_APBAMASK_PORT
//|MCLK_APBAMASK_TAL
- ;
+ ;
/* Software reset the GCLK module to ensure it is re-initialized correctly */
GCLK->CTRLA.reg = GCLK_CTRLA_SWRST;
diff --git a/cpu/saml21/periph/rtc.c b/cpu/saml21/periph/rtc.c
index 939c59689..e9e372e2d 100644
--- a/cpu/saml21/periph/rtc.c
+++ b/cpu/saml21/periph/rtc.c
@@ -37,8 +37,8 @@ typedef struct {
static rtc_state_t rtc_callback;
/* At 1Hz, RTC goes till 63 years (2^5, see 17.8.22 in datasheet)
-* reference_year is set to 100 (offset) to be in our current time (2000)
-* Thanks to this, the user will be able to set time in 2000's*/
+ * reference_year is set to 100 (offset) to be in our current time (2000)
+ * Thanks to this, the user will be able to set time in 2000's*/
static uint16_t reference_year = 100;
void rtc_init(void)
@@ -55,9 +55,9 @@ void rtc_init(void)
/* RTC uses External 32,768KHz Oscillator */
OSC32KCTRL->XOSC32K.reg = OSC32KCTRL_XOSC32K_XTALEN
- | OSC32KCTRL_XOSC32K_EN1K
- | OSC32KCTRL_XOSC32K_RUNSTDBY
- | OSC32KCTRL_OSC32K_ENABLE;
+ | OSC32KCTRL_XOSC32K_EN1K
+ | OSC32KCTRL_XOSC32K_RUNSTDBY
+ | OSC32KCTRL_OSC32K_ENABLE;
/* Wait XOSC32K Ready */
while (OSC32KCTRL->STATUS.bit.XOSC32KRDY==0);
@@ -68,8 +68,8 @@ void rtc_init(void)
#endif /* EXTERNAL_OSC32_SOURCE */
#if INTERNAL_OSC32_SOURCE
- uint32_t * pCalibrationArea;
- uint32_t osc32kcal;
+ uint32_t * pCalibrationArea;
+ uint32_t osc32kcal;
/* Read OSC32KCAL, calibration data for OSC32 !!! */
pCalibrationArea = (uint32_t*) NVMCTRL_OTP5;
@@ -77,9 +77,9 @@ void rtc_init(void)
/* RTC use Low Power Internal Oscillator at 1kHz */
OSC32KCTRL->OSC32K.reg = OSC32KCTRL_OSC32K_RUNSTDBY
- | OSC32KCTRL_OSC32K_EN1K
- | OSC32KCTRL_OSC32K_CALIB(osc32kcal)
- | OSC32KCTRL_OSC32K_ENABLE;
+ | OSC32KCTRL_OSC32K_EN1K
+ | OSC32KCTRL_OSC32K_CALIB(osc32kcal)
+ | OSC32KCTRL_OSC32K_ENABLE;
/* Wait OSC32K Ready */
while (OSC32KCTRL->STATUS.bit.OSC32KRDY==0);
@@ -122,19 +122,19 @@ int rtc_set_time(struct tm *time)
else {
while (RTC->MODE2.SYNCBUSY.bit.CLOCK);
RTC->MODE2.CLOCK.reg = RTC_MODE2_CLOCK_YEAR(time->tm_year - reference_year)
- | RTC_MODE2_CLOCK_MONTH(time->tm_mon + 1)
- | RTC_MODE2_CLOCK_DAY(time->tm_mday)
- | RTC_MODE2_CLOCK_HOUR(time->tm_hour)
- | RTC_MODE2_CLOCK_MINUTE(time->tm_min)
- | RTC_MODE2_CLOCK_SECOND(time->tm_sec);
+ | RTC_MODE2_CLOCK_MONTH(time->tm_mon + 1)
+ | RTC_MODE2_CLOCK_DAY(time->tm_mday)
+ | RTC_MODE2_CLOCK_HOUR(time->tm_hour)
+ | RTC_MODE2_CLOCK_MINUTE(time->tm_min)
+ | RTC_MODE2_CLOCK_SECOND(time->tm_sec);
while (RTC->MODE2.SYNCBUSY.bit.CLOCK);
}
- return 0;
+ return 0;
}
int rtc_get_time(struct tm *time)
{
- RTC_MODE2_CLOCK_Type clock;
+ RTC_MODE2_CLOCK_Type clock;
/* Read register in one time */
clock.reg = RTC->MODE2.CLOCK.reg;
@@ -159,11 +159,11 @@ int rtc_set_alarm(struct tm *time, rtc_alarm_cb_t cb, void *arg)
}
else {
RTC->MODE2.Mode2Alarm[0].ALARM.reg = RTC_MODE2_ALARM_YEAR(time->tm_year - reference_year)
- | RTC_MODE2_ALARM_MONTH(time->tm_mon + 1)
- | RTC_MODE2_ALARM_DAY(time->tm_mday)
- | RTC_MODE2_ALARM_HOUR(time->tm_hour)
- | RTC_MODE2_ALARM_MINUTE(time->tm_min)
- | RTC_MODE2_ALARM_SECOND(time->tm_sec);
+ | RTC_MODE2_ALARM_MONTH(time->tm_mon + 1)
+ | RTC_MODE2_ALARM_DAY(time->tm_mday)
+ | RTC_MODE2_ALARM_HOUR(time->tm_hour)
+ | RTC_MODE2_ALARM_MINUTE(time->tm_min)
+ | RTC_MODE2_ALARM_SECOND(time->tm_sec);
RTC->MODE2.Mode2Alarm[0].MASK.reg = RTC_MODE2_MASK_SEL(6);
while (RTC->MODE2.SYNCBUSY.bit.ALARM0);
}
@@ -182,7 +182,7 @@ int rtc_set_alarm(struct tm *time, rtc_alarm_cb_t cb, void *arg)
int rtc_get_alarm(struct tm *time)
{
- RTC_MODE2_ALARM_Type alarm;
+ RTC_MODE2_ALARM_Type alarm;
/* Read alarm register in one time */
alarm.reg = RTC->MODE2.Mode2Alarm[0].ALARM.reg;
@@ -231,7 +231,7 @@ void isr_rtc(void)
/* clear flag */
RTC->MODE2.INTFLAG.reg |= RTC_MODE2_INTFLAG_OVF;
/* At 1Hz, RTC goes till 63 years (2^5, see 17.8.22 in datasheet)
- * Start RTC again with reference_year 64 years more (Be careful with alarm set) */
+ * Start RTC again with reference_year 64 years more (Be careful with alarm set) */
reference_year += 64;
}
cortexm_isr_end();
diff --git a/cpu/saml21/periph/timer.c b/cpu/saml21/periph/timer.c
index 71449637f..a72a7506d 100644
--- a/cpu/saml21/periph/timer.c
+++ b/cpu/saml21/periph/timer.c
@@ -59,22 +59,22 @@ int timer_init(tim_t dev, unsigned long freq, timer_cb_t cb, void *arg)
/* select the timer and enable the timer specific peripheral clocks */
switch (dev) {
#if TIMER_0_EN
- case TIMER_0:
- if (TIMER_0_DEV.CTRLA.bit.ENABLE) {
- return 0;
- }
- MCLK->APBCMASK.reg |= MCLK_APBCMASK_TC0;
- /* reset timer */
- TIMER_0_DEV.CTRLA.bit.SWRST = 1;
- while (TIMER_0_DEV.SYNCBUSY.bit.SWRST) {}
- TIMER_0_DEV.CTRLA.reg |= TC_CTRLA_MODE_COUNT32 | /* choosing 32 bit mode */
- TC_CTRLA_PRESCALER(4) | /* sourced by 4MHz with Presc 4 results in 1MHz*/
- TC_CTRLA_PRESCSYNC_RESYNC; /* initial prescaler resync */
- break;
+ case TIMER_0:
+ if (TIMER_0_DEV.CTRLA.bit.ENABLE) {
+ return 0;
+ }
+ MCLK->APBCMASK.reg |= MCLK_APBCMASK_TC0;
+ /* reset timer */
+ TIMER_0_DEV.CTRLA.bit.SWRST = 1;
+ while (TIMER_0_DEV.SYNCBUSY.bit.SWRST) {}
+ TIMER_0_DEV.CTRLA.reg |= TC_CTRLA_MODE_COUNT32 | /* choosing 32 bit mode */
+ TC_CTRLA_PRESCALER(4) | /* sourced by 4MHz with Presc 4 results in 1MHz*/
+ TC_CTRLA_PRESCSYNC_RESYNC; /* initial prescaler resync */
+ break;
#endif
- case TIMER_UNDEFINED:
- default:
- return -1;
+ case TIMER_UNDEFINED:
+ default:
+ return -1;
}
/* save callback */
@@ -96,27 +96,27 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value)
/* get timer base register address */
switch (dev) {
#if TIMER_0_EN
- case TIMER_0:
- /* set timeout value */
- switch (channel) {
- case 0:
- TIMER_0_DEV.INTFLAG.reg |= TC_INTFLAG_MC0;
- TIMER_0_DEV.CC[0].reg = value;
- TIMER_0_DEV.INTENSET.bit.MC0 = 1;
- break;
- case 1:
- TIMER_0_DEV.INTFLAG.reg |= TC_INTFLAG_MC1;
- TIMER_0_DEV.CC[1].reg = value;
- TIMER_0_DEV.INTENSET.bit.MC1 = 1;
+ case TIMER_0:
+ /* set timeout value */
+ switch (channel) {
+ case 0:
+ TIMER_0_DEV.INTFLAG.reg |= TC_INTFLAG_MC0;
+ TIMER_0_DEV.CC[0].reg = value;
+ TIMER_0_DEV.INTENSET.bit.MC0 = 1;
+ break;
+ case 1:
+ TIMER_0_DEV.INTFLAG.reg |= TC_INTFLAG_MC1;
+ TIMER_0_DEV.CC[1].reg = value;
+ TIMER_0_DEV.INTENSET.bit.MC1 = 1;
+ break;
+ default:
+ return -1;
+ }
break;
+#endif
+ case TIMER_UNDEFINED:
default:
return -1;
- }
- break;
-#endif
- case TIMER_UNDEFINED:
- default:
- return -1;
}
return 1;
@@ -127,24 +127,24 @@ int timer_clear(tim_t dev, int channel)
/* get timer base register address */
switch (dev) {
#if TIMER_0_EN
- case TIMER_0:
- switch (channel) {
- case 0:
- TIMER_0_DEV.INTFLAG.reg |= TC_INTFLAG_MC0;
- TIMER_0_DEV.INTENCLR.bit.MC0 = 1;
- break;
- case 1:
- TIMER_0_DEV.INTFLAG.reg |= TC_INTFLAG_MC1;
- TIMER_0_DEV.INTENCLR.bit.MC1 = 1;
+ case TIMER_0:
+ switch (channel) {
+ case 0:
+ TIMER_0_DEV.INTFLAG.reg |= TC_INTFLAG_MC0;
+ TIMER_0_DEV.INTENCLR.bit.MC0 = 1;
+ break;
+ case 1:
+ TIMER_0_DEV.INTFLAG.reg |= TC_INTFLAG_MC1;
+ TIMER_0_DEV.INTENCLR.bit.MC1 = 1;
+ break;
+ default:
+ return -1;
+ }
break;
+#endif
+ case TIMER_UNDEFINED:
default:
return -1;
- }
- break;
-#endif
- case TIMER_UNDEFINED:
- default:
- return -1;
}
return 1;
@@ -154,14 +154,14 @@ unsigned int timer_read(tim_t dev)
{
switch (dev) {
#if TIMER_0_EN
- case TIMER_0:
- /* request syncronisation */
- TIMER_0_DEV.CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_READSYNC_Val;
- while (TIMER_0_DEV.SYNCBUSY.bit.STATUS) {}
- return TIMER_0_DEV.COUNT.reg;
+ case TIMER_0:
+ /* request syncronisation */
+ TIMER_0_DEV.CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_READSYNC_Val;
+ while (TIMER_0_DEV.SYNCBUSY.bit.STATUS) {}
+ return TIMER_0_DEV.COUNT.reg;
#endif
- default:
- return 0;
+ default:
+ return 0;
}
diff --git a/cpu/stm32_common/cpu_common.c b/cpu/stm32_common/cpu_common.c
index 83f542c60..76920eab4 100644
--- a/cpu/stm32_common/cpu_common.c
+++ b/cpu/stm32_common/cpu_common.c
@@ -82,12 +82,12 @@ void periph_clk_en(bus_t bus, uint32_t mask)
RCC->IOPENR |= mask;
break;
#elif defined(CPU_FAM_STM32L1) || defined(CPU_FAM_STM32F1) \
- || defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3)
+ || defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3)
case AHB:
RCC->AHBENR |= mask;
break;
#elif defined(CPU_FAM_STM32F2) || defined(CPU_FAM_STM32F4) \
- || defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32F7)
+ || defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32F7)
case AHB1:
RCC->AHB1ENR |= mask;
break;
@@ -130,12 +130,12 @@ void periph_clk_dis(bus_t bus, uint32_t mask)
RCC->IOPENR &= ~(mask);
break;
#elif defined(CPU_FAM_STM32L1) || defined(CPU_FAM_STM32F1) \
- || defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3)
+ || defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3)
case AHB:
RCC->AHBENR &= ~(mask);
break;
#elif defined(CPU_FAM_STM32F2) || defined(CPU_FAM_STM32F4) \
- || defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32F7)
+ || defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32F7)
case AHB1:
RCC->AHB1ENR &= ~(mask);
break;
diff --git a/cpu/stm32_common/dist/clk_conf/clk_conf.c b/cpu/stm32_common/dist/clk_conf/clk_conf.c
index 25312632f..b92347adf 100644
--- a/cpu/stm32_common/dist/clk_conf/clk_conf.c
+++ b/cpu/stm32_common/dist/clk_conf/clk_conf.c
@@ -47,8 +47,8 @@ static int is_n_ok(const pll_cfg_t *cfg, unsigned n, unsigned p,
unsigned vco_in, unsigned pll_out)
{
if (n >= cfg->min_n && n <= cfg->max_n &&
- vco_in * n >= cfg->min_vco_output && vco_in * n <= cfg->max_vco_output &&
- vco_in * n / p == pll_out) {
+ vco_in * n >= cfg->min_vco_output && vco_in * n <= cfg->max_vco_output &&
+ vco_in * n / p == pll_out) {
return 1;
}
else {
@@ -128,7 +128,7 @@ static int compute_pll(const pll_cfg_t *cfg, unsigned pll_in,
}
if (*m < cfg->min_m || *m > cfg->max_m ||
- vco_in < cfg->min_vco_input || vco_in > cfg->max_vco_input) {
+ vco_in < cfg->min_vco_input || vco_in > cfg->max_vco_input) {
DEBUG("Invalid M=%u\n", *m);
return -1;
}
@@ -180,7 +180,7 @@ static int compute_pll(const pll_cfg_t *cfg, unsigned pll_in,
static void usage(char **argv)
{
fprintf(stderr, "usage: %s <cpu_model> <coreclock> <hse_freq> <lse> [pll_i2s_src] "
- "[pll_i2s_q_out] [pll_sai_q_out]\n", argv[0]);
+ "[pll_i2s_q_out] [pll_sai_q_out]\n", argv[0]);
}
#define HSI 0
@@ -194,11 +194,11 @@ int main(int argc, char **argv)
}
if (strlen(argv[1]) < 9
- || !isdigit(argv[1][6])
- || !isdigit(argv[1][7])
- || !isdigit(argv[1][8])
- || ((argv[1][5] != 'f') && (argv[1][5] != 'F')
- /* && (argv[1][5] != 'l') && (argv[1][5] != 'L') */)) {
+ || !isdigit(argv[1][6])
+ || !isdigit(argv[1][7])
+ || !isdigit(argv[1][8])
+ || ((argv[1][5] != 'f') && (argv[1][5] != 'F')
+ /* && (argv[1][5] != 'l') && (argv[1][5] != 'L') */)) {
fprintf(stderr, "Invalid model : %s\n", argv[1]);
return 1;
}
@@ -222,13 +222,13 @@ int main(int argc, char **argv)
usage(argv);
fprintf(stderr, "Max values for stm32f%03d:\n", model);
fprintf(stderr, " Max coreclock: %u Hz\n"
- " Max APB1: %u Hz\n"
- " Max APB2: %u Hz\n",
+ " Max APB1: %u Hz\n"
+ " Max APB2: %u Hz\n",
cfg->max_coreclock, cfg->max_apb1, cfg->max_apb2);
fprintf(stderr, "Additional PLLs:\n"
- " PLL I2S: %d\n"
- " PLL SAI: %d\n"
- " Alternate 48MHz source: ",
+ " PLL I2S: %d\n"
+ " PLL SAI: %d\n"
+ " Alternate 48MHz source: ",
cfg->has_pll_i2s, cfg->has_pll_sai);
if (cfg->has_alt_48MHz & ALT_48MHZ_I2S) {
fprintf(stderr, "PLL I2S\n");
@@ -308,51 +308,51 @@ int main(int argc, char **argv)
/* try to match coreclock with P output and 48MHz for Q output (USB) */
switch (compute_pll(&cfg->pll, pll_in, coreclock, clock_48MHz, 0,
&m, &n, &p, &q, &r)) {
- case -1:
- /* no config available */
- fprintf(stderr, "Unable to compute main PLL factors\n");
- return 1;
- case 1:
- /* Q not OK */
- fprintf(stderr, "Need to use an alternate 48MHz src...");
- if (cfg->has_pll_i2s && (cfg->has_alt_48MHz & ALT_48MHZ_I2S) == ALT_48MHZ_I2S) {
- puts("PLL I2S");
- use_alt_48MHz = true;
- if (pll_i2s_q_out != 0 && pll_i2s_q_out != 48000000U) {
- fprintf(stderr, "Invalid PLL I2S Q output freq: %u\n", pll_i2s_q_out);
- return 1;
+ case -1:
+ /* no config available */
+ fprintf(stderr, "Unable to compute main PLL factors\n");
+ return 1;
+ case 1:
+ /* Q not OK */
+ fprintf(stderr, "Need to use an alternate 48MHz src...");
+ if (cfg->has_pll_i2s && (cfg->has_alt_48MHz & ALT_48MHZ_I2S) == ALT_48MHZ_I2S) {
+ puts("PLL I2S");
+ use_alt_48MHz = true;
+ if (pll_i2s_q_out != 0 && pll_i2s_q_out != 48000000U) {
+ fprintf(stderr, "Invalid PLL I2S Q output freq: %u\n", pll_i2s_q_out);
+ return 1;
+ }
+ pll_i2s_q_out = 48000000U;
}
- pll_i2s_q_out = 48000000U;
- }
- else if (cfg->has_pll_sai && (cfg->has_alt_48MHz & ALT_48MHZ_SAI)) {
- fprintf(stderr, "PLL SAI...");
- use_alt_48MHz = true;
- if ((cfg->has_alt_48MHz & ALT_48MHZ_P) &&
+ else if (cfg->has_pll_sai && (cfg->has_alt_48MHz & ALT_48MHZ_SAI)) {
+ fprintf(stderr, "PLL SAI...");
+ use_alt_48MHz = true;
+ if ((cfg->has_alt_48MHz & ALT_48MHZ_P) &&
(pll_sai_p_out == 0 || pll_sai_p_out == 48000000U)) {
- fprintf(stderr, "P\n");
- pll_sai_p_out = 48000000U;
- }
- else if (!(cfg->has_alt_48MHz & ALT_48MHZ_P) &&
- (pll_sai_q_out == 0 || pll_sai_q_out == 48000000U)) {
- fprintf(stderr, "Q\n");
- pll_sai_q_out = 48000000U;
+ fprintf(stderr, "P\n");
+ pll_sai_p_out = 48000000U;
+ }
+ else if (!(cfg->has_alt_48MHz & ALT_48MHZ_P) &&
+ (pll_sai_q_out == 0 || pll_sai_q_out == 48000000U)) {
+ fprintf(stderr, "Q\n");
+ pll_sai_q_out = 48000000U;
+ }
+ else {
+ if (cfg->has_alt_48MHz & ALT_48MHZ_P) {
+ fprintf(stderr, "Invalid PLL SAI P output freq: %u\n", pll_sai_p_out);
+ } else {
+ fprintf(stderr, "Invalid PLL SAI Q output freq: %u\n", pll_sai_q_out);
+ }
+ return 1;
+ }
}
else {
- if (cfg->has_alt_48MHz & ALT_48MHZ_P) {
- fprintf(stderr, "Invalid PLL SAI P output freq: %u\n", pll_sai_p_out);
- } else {
- fprintf(stderr, "Invalid PLL SAI Q output freq: %u\n", pll_sai_q_out);
- }
+ fprintf(stderr, "No other source available\n");
return 1;
}
- }
- else {
- fprintf(stderr, "No other source available\n");
- return 1;
- }
- break;
- default:
- break;
+ break;
+ default:
+ break;
}
/* PLL I2S */
diff --git a/cpu/stm32_common/dist/clk_conf/clk_conf.h b/cpu/stm32_common/dist/clk_conf/clk_conf.h
index 06b37b921..1fd36b8b2 100644
--- a/cpu/stm32_common/dist/clk_conf/clk_conf.h
+++ b/cpu/stm32_common/dist/clk_conf/clk_conf.h
@@ -196,8 +196,8 @@ typedef struct {
#define ALT_48MHZ_P 4
/** @} */
-#define STM32F(x) [STM32F##x] = x
-#define STM32F0(x) [STM32F0##x] = x
+#define STM32F(x) [STM32F ## x] = x
+#define STM32F0(x) [STM32F0 ## x] = x
/** List of supported models */
static const unsigned stm32_model[] = {
@@ -265,43 +265,43 @@ static const unsigned stm32_model[] = {
};
/** STM32F2xx / STM32F401 PLL config */
-#define stm32f2_4_192_pll_cfg { \
- .min_vco_input = 1000000U, \
- .max_vco_input = 2000000U, \
- .min_vco_output = 192000000U, \
- .max_vco_output = 432000000U, \
- .min_n = 50, \
- .max_n = 432, \
- .inc_n = 1, \
- .min_m = 2, \
- .max_m = 63, \
- .inc_m = 1, \
- .min_p = 2, \
- .max_p = 8, \
- .inc_p = 2, \
- .min_q = 2, \
- .max_q = 15, \
- .inc_q = 1, \
+#define stm32f2_4_192_pll_cfg { \
+ .min_vco_input = 1000000U, \
+ .max_vco_input = 2000000U, \
+ .min_vco_output = 192000000U, \
+ .max_vco_output = 432000000U, \
+ .min_n = 50, \
+ .max_n = 432, \
+ .inc_n = 1, \
+ .min_m = 2, \
+ .max_m = 63, \
+ .inc_m = 1, \
+ .min_p = 2, \
+ .max_p = 8, \
+ .inc_p = 2, \
+ .min_q = 2, \
+ .max_q = 15, \
+ .inc_q = 1, \
}
/** STM32F4 (except 401) / STM32F7 PLL config */
-#define stm32f4_7_pll_cfg { \
- .min_vco_input = 1000000U, \
- .max_vco_input = 2000000U, \
- .min_vco_output = 192000000U, \
- .max_vco_output = 432000000U, \
- .min_n = 50, \
- .max_n = 432, \
- .inc_n = 1, \
- .min_m = 2, \
- .max_m = 63, \
- .inc_m = 1, \
- .min_p = 2, \
- .max_p = 8, \
- .inc_p = 2, \
- .min_q = 2, \
- .max_q = 15, \
- .inc_q = 1, \
+#define stm32f4_7_pll_cfg { \
+ .min_vco_input = 1000000U, \
+ .max_vco_input = 2000000U, \
+ .min_vco_output = 192000000U, \
+ .max_vco_output = 432000000U, \
+ .min_n = 50, \
+ .max_n = 432, \
+ .inc_n = 1, \
+ .min_m = 2, \
+ .max_m = 63, \
+ .inc_m = 1, \
+ .min_p = 2, \
+ .max_p = 8, \
+ .inc_p = 2, \
+ .min_q = 2, \
+ .max_q = 15, \
+ .inc_q = 1, \
}
/**
diff --git a/cpu/stm32_common/dist/spi_divtable/spi_divtable.c b/cpu/stm32_common/dist/spi_divtable/spi_divtable.c
index 2086bc870..4c7f5621b 100644
--- a/cpu/stm32_common/dist/spi_divtable/spi_divtable.c
+++ b/cpu/stm32_common/dist/spi_divtable/spi_divtable.c
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
printf("static const uint8_t spi_divtable[2][%i] = {\n", tnum);
- for (int bus = 0; bus < (sizeof(apb) / sizeof(apb[0])); bus ++) {
+ for (int bus = 0; bus < (sizeof(apb) / sizeof(apb[0])); bus++) {
printf(" { /* for APB%i @ %iHz */\n", (bus + 1), apb[bus]);
for (int t = 0; t < tnum; t++) {
int br = find_best(apb[bus], targets[t]);
diff --git a/cpu/stm32_common/include/stmclk.h b/cpu/stm32_common/include/stmclk.h
index cfb0ad649..92ff1985b 100644
--- a/cpu/stm32_common/include/stmclk.h
+++ b/cpu/stm32_common/include/stmclk.h
@@ -17,7 +17,7 @@
* every STM32 CPU
*
* @author Hauke Petersen <hauke.pertersen@fu-berlin.de>
-*/
+ */
#ifndef STMCLK_H
#define STMCLK_H
diff --git a/cpu/stm32_common/periph/dac.c b/cpu/stm32_common/periph/dac.c
index e6545a87d..3a9e447e8 100644
--- a/cpu/stm32_common/periph/dac.c
+++ b/cpu/stm32_common/periph/dac.c
@@ -115,7 +115,7 @@ void dac_poweroff(dac_t line)
if (!(dev(line)->CR & EN_MASK)) {
#if defined(DAC2)
periph_clk_dis(APB1, (dac_config[line].chan > 1) ?
- RCC_APB1ENR_DAC2EN : RCC_APB1ENR_DAC1EN);
+ RCC_APB1ENR_DAC2EN : RCC_APB1ENR_DAC1EN);
#else
periph_clk_dis(APB1, RCC_BIT);
#endif
diff --git a/cpu/stm32_common/periph/dma.c b/cpu/stm32_common/periph/dma.c
index dc971b09b..b8fc65c61 100644
--- a/cpu/stm32_common/periph/dma.c
+++ b/cpu/stm32_common/periph/dma.c
@@ -30,7 +30,7 @@
#endif
#define DMA_STREAM_IT_MASK (DMA_LISR_FEIF0 | DMA_LISR_DMEIF0 | \
- DMA_LISR_TEIF0 | DMA_LISR_HTIF0 | \
+ DMA_LISR_TEIF0 | DMA_LISR_HTIF0 | \
DMA_LISR_TCIF0)
struct dma_ctx {
diff --git a/cpu/stm32_common/periph/flashpage.c b/cpu/stm32_common/periph/flashpage.c
index e4454b181..93e5e22ac 100644
--- a/cpu/stm32_common/periph/flashpage.c
+++ b/cpu/stm32_common/periph/flashpage.c
@@ -77,7 +77,7 @@ static void _erase_page(void *page_addr)
stmclk_enable_hsi();
#endif
- /* unlock the flash module */
+ /* unlock the flash module */
_unlock_flash();
/* make sure no flash operation is ongoing */
@@ -122,7 +122,7 @@ void flashpage_write_raw(void *target_addr, const void *data, size_t len)
/* ensure writes are aligned */
assert(!(((unsigned)target_addr % FLASHPAGE_RAW_ALIGNMENT) ||
- ((unsigned)data % FLASHPAGE_RAW_ALIGNMENT)));
+ ((unsigned)data % FLASHPAGE_RAW_ALIGNMENT)));
/* ensure the length doesn't exceed the actual flash size */
assert(((unsigned)target_addr + len) <
diff --git a/cpu/stm32_common/periph/spi.c b/cpu/stm32_common/periph/spi.c
index 8367ccbf6..4199b67a2 100644
--- a/cpu/stm32_common/periph/spi.c
+++ b/cpu/stm32_common/periph/spi.c
@@ -258,14 +258,14 @@ void spi_transfer_bytes(spi_t bus, spi_cs_t cs, bool cont,
#ifdef MODULE_PERIPH_DMA
if (spi_config[bus].tx_dma != DMA_STREAM_UNDEF
- && spi_config[bus].rx_dma != DMA_STREAM_UNDEF) {
+ && spi_config[bus].rx_dma != DMA_STREAM_UNDEF) {
_transfer_dma(bus, out, in, len);
}
else {
#endif
_transfer_no_dma(bus, out, in, len);
#ifdef MODULE_PERIPH_DMA
- }
+}
#endif
/* release the chip select if not specified differently */
diff --git a/cpu/stm32_common/periph/uart.c b/cpu/stm32_common/periph/uart.c
index 54adaea1d..7657b9401 100644
--- a/cpu/stm32_common/periph/uart.c
+++ b/cpu/stm32_common/periph/uart.c
@@ -120,7 +120,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
static inline void send_byte(uart_t uart, uint8_t byte)
{
-#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32L0) \
+#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32L0) \
|| defined(CPU_FAM_STM32F3) || defined(CPU_FAM_STM32L4) \
|| defined(CPU_FAM_STM32F7)
while (!(dev(uart)->ISR & USART_ISR_TXE)) {}
@@ -133,7 +133,7 @@ static inline void send_byte(uart_t uart, uint8_t byte)
static inline void wait_for_tx_complete(uart_t uart)
{
-#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32L0) \
+#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32L0) \
|| defined(CPU_FAM_STM32F3) || defined(CPU_FAM_STM32L4) \
|| defined(CPU_FAM_STM32F7)
while (!(dev(uart)->ISR & USART_ISR_TC)) {}
@@ -218,7 +218,7 @@ void uart_poweroff(uart_t uart)
static inline void irq_handler(uart_t uart)
{
-#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32L0) \
+#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32L0) \
|| defined(CPU_FAM_STM32F3) || defined(CPU_FAM_STM32L4) \
|| defined(CPU_FAM_STM32F7)
diff --git a/cpu/stm32f0/include/cpu_conf.h b/cpu/stm32f0/include/cpu_conf.h
index 794480ead..f41a65469 100644
--- a/cpu/stm32f0/include/cpu_conf.h
+++ b/cpu/stm32f0/include/cpu_conf.h
@@ -18,7 +18,7 @@
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
-*/
+ */
#ifndef CPU_CONF_H
#define CPU_CONF_H
@@ -77,14 +77,14 @@ extern "C" {
#if defined(CPU_MODEL_STM32F091RC) || defined(CPU_MODEL_STM32F072RB)
#define FLASHPAGE_SIZE (2048U)
#elif defined(CPU_MODEL_STM32F051R8) || defined(CPU_MODEL_STM32F042K6) \
- || defined(CPU_MODEL_STM32F070RB) || defined(CPU_MODEL_STM32F030R8)
+ || defined(CPU_MODEL_STM32F070RB) || defined(CPU_MODEL_STM32F030R8)
#define FLASHPAGE_SIZE (1024U)
#endif
#if defined(CPU_MODEL_STM32F091RC)
#define FLASHPAGE_NUMOF (128U)
#elif defined(CPU_MODEL_STM32F051R8) || defined(CPU_MODEL_STM32F072RB) \
- || defined(CPU_MODEL_STM32F030R8) || defined(CPU_MODEL_STM32F070RB)
+ || defined(CPU_MODEL_STM32F030R8) || defined(CPU_MODEL_STM32F070RB)
#define FLASHPAGE_NUMOF (64U)
#elif defined(CPU_MODEL_STM32F042K6)
#define FLASHPAGE_NUMOF (32U)
diff --git a/cpu/stm32f2/periph/i2c.c b/cpu/stm32f2/periph/i2c.c
index b0952109f..6b8ee304b 100644
--- a/cpu/stm32f2/periph/i2c.c
+++ b/cpu/stm32f2/periph/i2c.c
@@ -595,13 +595,13 @@ void i2c_poweroff(i2c_t dev)
{
switch (dev) {
#if I2C_0_EN
- case I2C_0:
- for (int cnt = 0;
- ((I2C_0_DEV->SR2 & I2C_SR2_BUSY) && (cnt < I2C_MAX_LOOP_CNT));
- cnt++) {}
+ case I2C_0:
+ for (int cnt = 0;
+ ((I2C_0_DEV->SR2 & I2C_SR2_BUSY) && (cnt < I2C_MAX_LOOP_CNT));
+ cnt++) {}
- I2C_0_CLKDIS();
- break;
+ I2C_0_CLKDIS();
+ break;
#endif
}
}
diff --git a/cpu/stm32f4/include/cpu_conf.h b/cpu/stm32f4/include/cpu_conf.h
index 46c65088c..225393829 100644
--- a/cpu/stm32f4/include/cpu_conf.h
+++ b/cpu/stm32f4/include/cpu_conf.h
@@ -35,7 +35,7 @@
#include "vendor/stm32f411xe.h"
#elif defined(CPU_MODEL_STM32F412ZG)
#include "vendor/stm32f412zx.h"
-#elif defined(CPU_MODEL_STM32F413CG) || defined(CPU_MODEL_STM32F413RG) \
+#elif defined(CPU_MODEL_STM32F413CG) || defined(CPU_MODEL_STM32F413RG) \
|| defined(CPU_MODEL_STM32F413MG) || defined(CPU_MODEL_STM32F413VG) \
|| defined(CPU_MODEL_STM32F413ZG) || defined(CPU_MODEL_STM32F413CH) \
|| defined(CPU_MODEL_STM32F413RH) || defined(CPU_MODEL_STM32F413MH) \
@@ -43,7 +43,7 @@
#include "vendor/stm32f413xx.h"
#elif defined(CPU_MODEL_STM32F415RG)
#include "vendor/stm32f415xx.h"
-#elif defined(CPU_MODEL_STM32F423CH) || defined(CPU_MODEL_STM32F423RH) \
+#elif defined(CPU_MODEL_STM32F423CH) || defined(CPU_MODEL_STM32F423RH) \
|| defined(CPU_MODEL_STM32F423MH) || defined(CPU_MODEL_STM32F423VH) \
|| defined(CPU_MODEL_STM32F423ZH)
#include "vendor/stm32f423xx.h"
@@ -75,7 +75,7 @@ extern "C" {
#elif defined(CPU_MODEL_STM32F412ZG) || defined(CPU_MODEL_STM32F446RE) \
|| defined(CPU_MODEL_STM32F446ZE)
#define CPU_IRQ_NUMOF (97U)
-#elif defined(CPU_MODEL_STM32F413CG) || defined(CPU_MODEL_STM32F413RG) \
+#elif defined(CPU_MODEL_STM32F413CG) || defined(CPU_MODEL_STM32F413RG) \
|| defined(CPU_MODEL_STM32F413MG) || defined(CPU_MODEL_STM32F413VG) \
|| defined(CPU_MODEL_STM32F413ZG) || defined(CPU_MODEL_STM32F413CH) \
|| defined(CPU_MODEL_STM32F413RH) || defined(CPU_MODEL_STM32F413MH) \
diff --git a/cpu/stm32f4/include/periph_cpu.h b/cpu/stm32f4/include/periph_cpu.h
index 1969df5a2..09f5a36e3 100644
--- a/cpu/stm32f4/include/periph_cpu.h
+++ b/cpu/stm32f4/include/periph_cpu.h
@@ -48,7 +48,7 @@ enum {
/**
* @brief Available number of ADC devices
*/
-#if defined(CPU_MODEL_STM32F401RE) || defined(CPU_MODEL_STM32F410RB) \
+#if defined(CPU_MODEL_STM32F401RE) || defined(CPU_MODEL_STM32F410RB) \
|| defined(CPU_MODEL_STM32F411RE) || defined(CPU_MODEL_STM32F412ZG) \
|| defined(CPU_MODEL_STM32F413CG) || defined(CPU_MODEL_STM32F413RG) \
|| defined(CPU_MODEL_STM32F413MG) || defined(CPU_MODEL_STM32F413VG) \
@@ -59,7 +59,7 @@ enum {
|| defined(CPU_MODEL_STM32F423MH) || defined(CPU_MODEL_STM32F423VH) \
|| defined(CPU_MODEL_STM32F423ZH)
#define ADC_DEVS (1U)
-#elif defined(CPU_MODEL_STM32F407VG) || defined(CPU_MODEL_STM32F415RG) \
+#elif defined(CPU_MODEL_STM32F407VG) || defined(CPU_MODEL_STM32F415RG) \
|| defined(CPU_MODEL_STM32F429ZI) || defined(CPU_MODEL_STM32F437VG) \
|| defined(CPU_MODEL_STM32F446RE) || defined(CPU_MODEL_STM32F446ZE)
#define ADC_DEVS (3U)
diff --git a/cpu/stm32f4/vectors.c b/cpu/stm32f4/vectors.c
index 3373311da..d77803f54 100644
--- a/cpu/stm32f4/vectors.c
+++ b/cpu/stm32f4/vectors.c
@@ -294,7 +294,7 @@ ISR_VECTOR(1) const isr_t vector_cpu[CPU_IRQ_NUMOF] = {
[92] = isr_quadspi, /* [92] QuadSPI global Interrupt */
[95] = isr_fmpi2c1_ev, /* [95] FMPI2C1 Event Interrupt */
[96] = isr_fmpi2c1_er, /* [96] FMPI2C1 Error Interrupt */
-#elif defined(CPU_MODEL_STM32F413CG) || defined(CPU_MODEL_STM32F413RG) \
+#elif defined(CPU_MODEL_STM32F413CG) || defined(CPU_MODEL_STM32F413RG) \
|| defined(CPU_MODEL_STM32F413MG) || defined(CPU_MODEL_STM32F413VG) \
|| defined(CPU_MODEL_STM32F413ZG) || defined(CPU_MODEL_STM32F413CH) \
|| defined(CPU_MODEL_STM32F413RH) || defined(CPU_MODEL_STM32F413MH) \
@@ -385,7 +385,7 @@ ISR_VECTOR(1) const isr_t vector_cpu[CPU_IRQ_NUMOF] = {
[77] = isr_otg_hs, /* [77] USB OTG HS global interrupt */
[79] = isr_cryp, /* [79] CRYP crypto global interrupt */
[80] = isr_hash_rng, /* [80] Hash and Rng global interrupt */
-#elif defined(CPU_MODEL_STM32F423CH) || defined(CPU_MODEL_STM32F423RH) \
+#elif defined(CPU_MODEL_STM32F423CH) || defined(CPU_MODEL_STM32F423RH) \
|| defined(CPU_MODEL_STM32F423MH) || defined(CPU_MODEL_STM32F423VH) \
|| defined(CPU_MODEL_STM32F423ZH)
[18] = isr_adc, /* [18] ADC1, ADC2 and ADC3 global Interrupts */
diff --git a/cpu/stm32f7/include/cpu_conf.h b/cpu/stm32f7/include/cpu_conf.h
index dfa13ed11..dd03b48ad 100644
--- a/cpu/stm32f7/include/cpu_conf.h
+++ b/cpu/stm32f7/include/cpu_conf.h
@@ -18,7 +18,7 @@
*
* @author Hauke Petersen <hauke.pertersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
-*/
+ */
#ifndef CPU_CONF_H
#define CPU_CONF_H
diff --git a/cpu/stm32l0/include/cpu_conf.h b/cpu/stm32l0/include/cpu_conf.h
index bae780aef..975e21a5c 100644
--- a/cpu/stm32l0/include/cpu_conf.h
+++ b/cpu/stm32l0/include/cpu_conf.h
@@ -18,7 +18,7 @@
*
* @author Hauke Petersen <hauke.pertersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
-*/
+ */
#ifndef CPU_CONF_H
#define CPU_CONF_H
diff --git a/cpu/stm32l1/periph/adc.c b/cpu/stm32l1/periph/adc.c
index eb8518c1e..6dcf64254 100644
--- a/cpu/stm32l1/periph/adc.c
+++ b/cpu/stm32l1/periph/adc.c
@@ -123,7 +123,7 @@ int adc_sample(adc_t line, adc_res_t res)
while (!(ADC1->SR & ADC_SR_EOC)) {}
/* finally read sample and reset the STRT bit in the status register */
sample = (int)ADC1->DR;
- ADC1 -> SR &= ~ADC_SR_STRT;
+ ADC1->SR &= ~ADC_SR_STRT;
/* power off and unlock device again */
done();
diff --git a/cpu/stm32l1/vectors.c b/cpu/stm32l1/vectors.c
index bbc74fbcb..18494590e 100644
--- a/cpu/stm32l1/vectors.c
+++ b/cpu/stm32l1/vectors.c
@@ -142,7 +142,7 @@ ISR_VECTOR(1) const isr_t vector_cpu[CPU_IRQ_NUMOF] = {
isr_aes, /* [55] AES global Interrupt */
isr_comp_acq /* [56] Comparator Channel Acquisition global Interrupt */
#elif defined(CPU_MODEL_STM32L152RE)
- (0UL), /* [45] Reserved */
+ (0UL), /* [45] Reserved */
isr_tim5, /* [46] TIM5 global Interrupt */
isr_spi3, /* [47] SPI3 global Interrupt */
isr_uart4, /* [48] UART4 global Interrupt */
diff --git a/cpu/stm32l4/include/cpu_conf.h b/cpu/stm32l4/include/cpu_conf.h
index dd53dcc74..d89b921d6 100644
--- a/cpu/stm32l4/include/cpu_conf.h
+++ b/cpu/stm32l4/include/cpu_conf.h
@@ -18,7 +18,7 @@
*
* @author Hauke Petersen <hauke.pertersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
-*/
+ */
#ifndef CPU_CONF_H
#define CPU_CONF_H
diff --git a/dist/tools/ethos/ethos.c b/dist/tools/ethos/ethos.c
index 1f45f7308..0ffc078c7 100644
--- a/dist/tools/ethos/ethos.c
+++ b/dist/tools/ethos/ethos.c
@@ -76,9 +76,9 @@ int set_serial_attribs(int fd, int speed, int parity)
cfsetispeed (&tty, speed);
tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; /* 8-bit chars*/
- /* disable IGNBRK for mismatched speed
- * tests; otherwise receive break*/
- /* as \000 chars*/
+ /* disable IGNBRK for mismatched speed
+ * tests; otherwise receive break*/
+ /* as \000 chars*/
tty.c_iflag &= ~IGNBRK; /* disable break processing*/
tty.c_lflag = 0; /* no signaling chars, no echo,*/
/* no canonical processing*/
@@ -151,36 +151,36 @@ typedef struct {
} serial_t;
/**************************************************************************
- * tun_alloc: allocates or reconnects to a tun/tap device. The caller *
- * needs to reserve enough space in *dev. *
- **************************************************************************/
+* tun_alloc: allocates or reconnects to a tun/tap device. The caller *
+* needs to reserve enough space in *dev. *
+**************************************************************************/
int tun_alloc(char *dev, int flags) {
- struct ifreq ifr;
- int fd, err;
+ struct ifreq ifr;
+ int fd, err;
- if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
- perror("Opening /dev/net/tun");
- return fd;
- }
+ if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
+ perror("Opening /dev/net/tun");
+ return fd;
+ }
- memset(&ifr, 0, sizeof(ifr));
+ memset(&ifr, 0, sizeof(ifr));
- ifr.ifr_flags = flags;
+ ifr.ifr_flags = flags;
- if (*dev) {
- strncpy(ifr.ifr_name, dev, IFNAMSIZ);
- }
+ if (*dev) {
+ strncpy(ifr.ifr_name, dev, IFNAMSIZ);
+ }
- if( (err = ioctl(fd, TUNSETIFF, (void *)&ifr)) < 0 ) {
- perror("ioctl(TUNSETIFF)");
- close(fd);
- return err;
- }
+ if( (err = ioctl(fd, TUNSETIFF, (void *)&ifr)) < 0 ) {
+ perror("ioctl(TUNSETIFF)");
+ close(fd);
+ return err;
+ }
- strcpy(dev, ifr.ifr_name);
+ strcpy(dev, ifr.ifr_name);
- return fd;
+ return fd;
}
static void _handle_char(serial_t *serial, char c)
@@ -312,63 +312,63 @@ static int _parse_baudrate(const char *arg, unsigned *baudrate)
}
switch(strtol(arg, (char**)NULL, 10)) {
- case 9600:
- *baudrate = B9600;
- break;
- case 19200:
- *baudrate = B19200;
- break;
- case 38400:
- *baudrate = B38400;
- break;
- case 57600:
- *baudrate = B57600;
- break;
- case 115200:
- *baudrate = B115200;
- break;
- /* the following baudrates might not be available on all platforms */
+ case 9600:
+ *baudrate = B9600;
+ break;
+ case 19200:
+ *baudrate = B19200;
+ break;
+ case 38400:
+ *baudrate = B38400;
+ break;
+ case 57600:
+ *baudrate = B57600;
+ break;
+ case 115200:
+ *baudrate = B115200;
+ break;
+ /* the following baudrates might not be available on all platforms */
#ifdef B234000
- case_baudrate(230400);
+ case_baudrate(230400);
#endif
#ifdef B460800
- case_baudrate(460800);
+ case_baudrate(460800);
#endif
#ifdef B500000
- case_baudrate(500000);
+ case_baudrate(500000);
#endif
#ifdef B576000
- case_baudrate(576000);
+ case_baudrate(576000);
#endif
#ifdef B921600
- case_baudrate(921600);
+ case_baudrate(921600);
#endif
#ifdef B1000000
- case_baudrate(1000000);
+ case_baudrate(1000000);
#endif
#ifdef B1152000
- case_baudrate(1152000);
+ case_baudrate(1152000);
#endif
#ifdef B1500000
- case_baudrate(1500000);
+ case_baudrate(1500000);
#endif
#ifdef B2000000
- case_baudrate(2000000);
+ case_baudrate(2000000);
#endif
#ifdef B2500000
- case_baudrate(2500000);
+ case_baudrate(2500000);
#endif
#ifdef B3000000
- case_baudrate(3000000);
+ case_baudrate(3000000);
#endif
#ifdef B3500000
- case_baudrate(3500000);
+ case_baudrate(3500000);
#endif
#ifdef B4000000
- case_baudrate(4000000);
+ case_baudrate(4000000);
#endif
- default:
- return -1;
+ default:
+ return -1;
}
return 0;
@@ -549,7 +549,7 @@ int main(int argc, char *argv[])
}
FD_SET(tap_fd, &readfds);
FD_SET(serial_fd, &readfds);
- activity = select( max_fd + 1 , &readfds , NULL , NULL , NULL);
+ activity = select( max_fd + 1, &readfds, NULL, NULL, NULL);
if ((activity < 0) && (errno != EINTR))
{
diff --git a/dist/tools/tunslip/tapslip6.c b/dist/tools/tunslip/tapslip6.c
index 0ae6605e2..d48e49180 100644
--- a/dist/tools/tunslip/tapslip6.c
+++ b/dist/tools/tunslip/tapslip6.c
@@ -242,7 +242,7 @@ after_fread:
break;
}
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
default:
uip.inbuf[inbufptr++] = c;
break;
@@ -287,7 +287,7 @@ slip_flushbuf(int fd)
err(1, "slip_flushbuf write failed");
}
else if (n == -1) {
- PROGRESS("Q"); /* Outqueueis full! */
+ PROGRESS("Q"); /* Outqueueis full! */
}
else {
slip_begin += n;
@@ -408,7 +408,7 @@ stty_telos(int fd)
#endif
- usleep(10 * 1000); /* Wait for hardware 10ms. */
+ usleep(10 * 1000); /* Wait for hardware 10ms. */
/* Flush input and output buffers. */
if (tcflush(fd, TCIOFLUSH) == -1) {
@@ -489,7 +489,7 @@ void
sigcleanup(int signo)
{
fprintf(stderr, "signal %d\n", signo);
- exit(0); /* exit(0) will call cleanup() */
+ exit(0); /* exit(0) will call cleanup() */
}
static int got_sigalarm;
@@ -602,7 +602,7 @@ main(int argc, char **argv)
switch (baudrate) {
case -2:
- break; /* Use default. */
+ break; /* Use default. */
case 9600:
b_rate = B9600;
@@ -706,11 +706,11 @@ main(int argc, char **argv)
got_sigalarm = 0;
}
- if (!slip_empty()) { /* Anything to flush? */
+ if (!slip_empty()) { /* Anything to flush? */
FD_SET(slipfd, &wset);
}
- FD_SET(slipfd, &rset); /* Read from slip ASAP! */
+ FD_SET(slipfd, &rset); /* Read from slip ASAP! */
if (slipfd > maxfd) {
maxfd = slipfd;
diff --git a/dist/tools/tunslip/tunslip.c b/dist/tools/tunslip/tunslip.c
index 117bedc97..7cfb67e0d 100644
--- a/dist/tools/tunslip/tunslip.c
+++ b/dist/tools/tunslip/tunslip.c
@@ -62,7 +62,7 @@ void write_to_serial(int outfd, void *inbuf, int len);
#define PROGRESS(s) do { } while (0)
struct ip {
- u_int8_t ip_vhl; /* version and header length */
+ u_int8_t ip_vhl; /* version and header length */
#define IP_V4 0x40
#define IP_V 0xf0
#define IP_HL 0x0f
@@ -78,10 +78,10 @@ struct ip {
u_int8_t ip_p; /* protocol */
u_int16_t ip_sum; /* checksum */
u_int32_t ip_src, ip_dst; /* source and dest address */
- u_int16_t uh_sport; /* source port */
- u_int16_t uh_dport; /* destination port */
- u_int16_t uh_ulen; /* udp length */
- u_int16_t uh_sum; /* udp checksum */
+ u_int16_t uh_sport; /* source port */
+ u_int16_t uh_dport; /* destination port */
+ u_int16_t uh_ulen; /* udp length */
+ u_int16_t uh_sum; /* udp checksum */
};
int check_ip(const struct ip *ip, unsigned ip_len);
@@ -217,7 +217,7 @@ relay_dhcp_to_server(struct ip *ip, int len)
*optptr++ = 4;
memcpy(optptr, &giaddr, 4);
optptr += 4;
- n += 18 + 2; /* Sum of all suboptions + 2! */
+ n += 18 + 2; /* Sum of all suboptions + 2! */
}
/* And finally put back the END. */
*optptr++ = DHCP_OPTION_END;
@@ -225,7 +225,7 @@ relay_dhcp_to_server(struct ip *ip, int len)
m.hops++;
memcpy(m.giaddr, &giaddr, sizeof(m.giaddr));
- if (n != sendto(dhsock, &m, n, 0x0/*flags*/,
+ if (n != sendto(dhsock, &m, n, 0x0 /*flags*/,
(struct sockaddr *)&dhaddr, sizeof(dhaddr))) {
err(1, "sendto relay failed");
}
@@ -249,7 +249,7 @@ relay_dhcp_to_client(int slipfd)
memset(&inm.options, 0x0, sizeof(inm.options));
- n = recv(dhsock, &inm, sizeof(inm), 0x0/*flags*/);
+ n = recv(dhsock, &inm, sizeof(inm), 0x0 /*flags*/);
if (inm.op != BOOTREPLY) {
return;
@@ -266,8 +266,8 @@ relay_dhcp_to_client(int slipfd)
memcpy(pkt.m.options, inm.options, 4); /* Magic cookie */
end = &inm.op + n;
- p = inm.options + 4; /* Magic cookie */
- t = pkt.m.options + 4; /* Magic cookie */
+ p = inm.options + 4; /* Magic cookie */
+ t = pkt.m.options + 4; /* Magic cookie */
while (p < end) {
op = p[0];
@@ -278,11 +278,11 @@ relay_dhcp_to_client(int slipfd)
case DHCP_OPTION_MSG_TYPE:
msg_type = p[2];
- /* deliberate fall-through */
+ /* deliberate fall-through */
case DHCP_OPTION_SUBNET_MASK:
case DHCP_OPTION_ROUTER:
case DHCP_OPTION_LEASE_TIME:
- case DHCP_OPTION_SERVER_ID: /* Copy these options */
+ case DHCP_OPTION_SERVER_ID: /* Copy these options */
memcpy(t, p, p[1] + 2);
t += p[1] + 2;
p += p[1] + 2;
@@ -296,7 +296,7 @@ relay_dhcp_to_client(int slipfd)
p += p[1] + 2;
break;
- default: /* Ignore these options */
+ default: /* Ignore these options */
/* printf("option type %d len %d\n", op, p[1]); */
p += p[1] + 2;
continue;
@@ -314,13 +314,13 @@ done:
ip_len = 20 + 8 + DHCP_BASE_LEN + optlen;
udp_len = 8 + DHCP_BASE_LEN + optlen;
- pkt.ip.ip_vhl = 0x45; /* IPv4 and hdrlen=5*4 */
+ pkt.ip.ip_vhl = 0x45; /* IPv4 and hdrlen=5*4 */
pkt.ip.ip_tos = 0;
pkt.ip.ip_len = htons(ip_len);
pkt.ip.ip_id = htons(ip_id++);
pkt.ip.ip_off = 0;
pkt.ip.ip_ttl = 64;
- pkt.ip.ip_p = 17; /* proto UDP */
+ pkt.ip.ip_p = 17; /* proto UDP */
pkt.ip.ip_sum = 0;
pkt.ip.ip_src = giaddr;
@@ -418,7 +418,7 @@ check_ip(const struct ip *ip, unsigned ip_len)
return -4;
}
- if (ip->ip_p == 6 || ip->ip_p == 17) { /* Check TCP or UDP header. */
+ if (ip->ip_p == 6 || ip->ip_p == 17) { /* Check TCP or UDP header. */
u_int16_t tcp_len = ip_len - ip_hl;
/* Sum pseudoheader. */
@@ -430,10 +430,10 @@ check_ip(const struct ip *ip, unsigned ip_len)
/* Failed checksum test? */
if (sum != 0xffff && sum != 0x0) {
- if (ip->ip_p == 6) { /* TCP == 6 */
+ if (ip->ip_p == 6) { /* TCP == 6 */
return -5;
}
- else { /* UDP */
+ else { /* UDP */
/* Deal with disabled UDP checksums. */
if (ip->uh_sum != 0) {
return -6;
@@ -441,7 +441,7 @@ check_ip(const struct ip *ip, unsigned ip_len)
}
}
}
- else if (ip->ip_p == 1) { /* ICMP */
+ else if (ip->ip_p == 1) { /* ICMP */
u_int16_t icmp_len = ip_len - ip_hl;
sum = ip4sum(0, (u_int8_t *)ip + ip_hl, icmp_len);
@@ -643,7 +643,7 @@ after_fread:
break;
}
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
default:
uip.inbuf[inbufptr++] = c;
break;
@@ -687,7 +687,7 @@ slip_flushbuf(int fd)
err(1, "slip_flushbuf write failed");
}
else if (n == -1) {
- PROGRESS("Q"); /* Outqueueis full! */
+ PROGRESS("Q"); /* Outqueueis full! */
}
else {
slip_begin += n;
@@ -718,10 +718,10 @@ write_to_serial(int outfd, void *inbuf, int len)
if (iphdr->ip_id == 0 && iphdr->ip_off & IP_DF) {
uint16_t nid = htons(ip_id++);
iphdr->ip_id = nid;
- nid = ~nid; /* negate */
- iphdr->ip_sum += nid; /* add */
+ nid = ~nid; /* negate */
+ iphdr->ip_sum += nid; /* add */
- if (iphdr->ip_sum < nid) { /* 1-complement overflow? */
+ if (iphdr->ip_sum < nid) { /* 1-complement overflow? */
iphdr->ip_sum++;
}
@@ -835,7 +835,7 @@ stty_telos(int fd)
#endif
- usleep(10 * 1000); /* Wait for hardware 10ms. */
+ usleep(10 * 1000); /* Wait for hardware 10ms. */
/* Flush input and output buffers. */
if (tcflush(fd, TCIOFLUSH) == -1) {
@@ -916,7 +916,7 @@ void
sigcleanup(int signo)
{
fprintf(stderr, "signal %d\n", signo);
- exit(0); /* exit(0) will call cleanup() */
+ exit(0); /* exit(0) will call cleanup() */
}
static int got_sigalarm;
@@ -1036,7 +1036,7 @@ main(int argc, char **argv)
switch (baudrate) {
case -2:
- break; /* Use default. */
+ break; /* Use default. */
case 9600:
b_rate = B9600;
@@ -1212,11 +1212,11 @@ main(int argc, char **argv)
got_sigalarm = 0;
}
- if (!slip_empty()) { /* Anything to flush? */
+ if (!slip_empty()) { /* Anything to flush? */
FD_SET(slipfd, &wset);
}
- FD_SET(slipfd, &rset); /* Read from slip ASAP! */
+ FD_SET(slipfd, &rset); /* Read from slip ASAP! */
if (slipfd > maxfd) {
maxfd = slipfd;
diff --git a/dist/tools/tunslip/tunslip6.c b/dist/tools/tunslip/tunslip6.c
index 67ad3a0d5..b744f50c9 100644
--- a/dist/tools/tunslip/tunslip6.c
+++ b/dist/tools/tunslip/tunslip6.c
@@ -119,7 +119,7 @@ stamptime(void)
struct timeval tv;
time_t t;
- gettimeofday(&tv, NULL) ;
+ gettimeofday(&tv, NULL);
msecs = tv.tv_usec / 1000;
secs = tv.tv_sec;
@@ -217,7 +217,7 @@ serial_to_tun(FILE *inslip, int outfd)
ret = fread(&c, 1, 1, inslip);
#ifdef __linux__
- after_fread:
+after_fread:
#endif
if (ret == -1) {
@@ -384,7 +384,7 @@ serial_to_tun(FILE *inslip, int outfd)
break;
}
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
default:
uip.inbuf[inbufptr++] = c;
@@ -1260,7 +1260,7 @@ main(int argc, char **argv)
if (delaymsec) {
struct timeval tv;
int dmsec;
- gettimeofday(&tv, NULL) ;
+ gettimeofday(&tv, NULL);
dmsec = (tv.tv_sec - delaystartsec) * 1000 + tv.tv_usec / 1000 - delaystartmsec;
if (dmsec < 0) {
@@ -1281,7 +1281,7 @@ main(int argc, char **argv)
if (basedelay) {
struct timeval tv;
- gettimeofday(&tv, NULL) ;
+ gettimeofday(&tv, NULL);
// delaymsec=basedelay*(1+(size/120));//multiply by # of 6lowpan packets?
delaymsec = basedelay;
delaystartsec = tv.tv_sec;
diff --git a/drivers/adcxx1c/adcxx1c.c b/drivers/adcxx1c/adcxx1c.c
index 33d2b8fe0..ab45180f1 100644
--- a/drivers/adcxx1c/adcxx1c.c
+++ b/drivers/adcxx1c/adcxx1c.c
@@ -106,7 +106,7 @@ int adcxx1c_enable_alert(adcxx1c_t *dev, adcxx1c_cb_t cb, void *arg)
i2c_acquire(I2C);
i2c_read_reg(I2C, ADDR, ADCXX1C_CONF_ADDR, &reg);
reg |= (dev->params.alert_pin != GPIO_UNDEF ? ADCXX1C_CONF_ALERT_PIN_EN : 0)
- | ADCXX1C_CONF_ALERT_FLAG_EN;
+ | ADCXX1C_CONF_ALERT_FLAG_EN;
i2c_write_reg(I2C, ADDR, ADCXX1C_CONF_ADDR, reg);
i2c_release(I2C);
diff --git a/drivers/ads101x/include/ads101x_params.h b/drivers/ads101x/include/ads101x_params.h
index 22f986750..96c034ed8 100644
--- a/drivers/ads101x/include/ads101x_params.h
+++ b/drivers/ads101x/include/ads101x_params.h
@@ -55,16 +55,16 @@ extern "C" {
#endif
#ifndef ADS101X_PARAMS
-#define ADS101X_PARAMS { .i2c = ADS101X_PARAM_I2C, \
- .addr = ADS101X_PARAM_ADDR, \
+#define ADS101X_PARAMS { .i2c = ADS101X_PARAM_I2C, \
+ .addr = ADS101X_PARAM_ADDR, \
.mux_gain = ADS101X_PARAM_MUX_GAIN }
#endif
#ifndef ADS101X_ALERT_PARAMS
-#define ADS101X_ALERT_PARAMS { .i2c = ADS101X_PARAM_I2C, \
- .addr = ADS101X_PARAM_ADDR, \
- .alert_pin = ADS101X_PARAM_ALERT_PIN, \
- .low_limit = ADS101X_PARAM_LOW_LIMIT, \
+#define ADS101X_ALERT_PARAMS { .i2c = ADS101X_PARAM_I2C, \
+ .addr = ADS101X_PARAM_ADDR, \
+ .alert_pin = ADS101X_PARAM_ALERT_PIN, \
+ .low_limit = ADS101X_PARAM_LOW_LIMIT, \
.high_limit = ADS101X_PARAM_HIGH_LIMIT }
#endif
#ifndef ADS101X_SAUL_INFO
diff --git a/drivers/adt7310/adt7310.c b/drivers/adt7310/adt7310.c
index 8af6ad770..41fd9bcf6 100644
--- a/drivers/adt7310/adt7310.c
+++ b/drivers/adt7310/adt7310.c
@@ -36,8 +36,8 @@
#define ADT7310_CMD_CONTINUOUS (0x04)
/* ****************** *
- * Register addresses *
- * ****************** */
+* Register addresses *
+* ****************** */
#define ADT7310_REG_STATUS (0x00)
#define ADT7310_REG_CONFIG (0x01)
#define ADT7310_REG_VALUE (0x02)
@@ -48,8 +48,8 @@
#define ADT7310_REG_TLOW (0x07)
/* ************** *
- * Register sizes *
- * ************** */
+* Register sizes *
+* ************** */
#define ADT7310_REG_SIZE_STATUS (1)
#define ADT7310_REG_SIZE_CONFIG (1)
#define ADT7310_REG_SIZE_VALUE (2)
diff --git a/drivers/adxl345/include/adxl345_params.h b/drivers/adxl345/include/adxl345_params.h
index ec106d7f1..b2781c56b 100644
--- a/drivers/adxl345/include/adxl345_params.h
+++ b/drivers/adxl345/include/adxl345_params.h
@@ -57,9 +57,9 @@ extern "C" {
#define ADXL345_PARAM_SCALE_FACTOR (3.9)
#endif
#ifndef ADXL345_PARAMS
-#define ADXL345_PARAMS { .offset = ADXL345_PARAM_OFFSET, \
- .range = ADXL345_PARAM_RANGE, \
- .rate = ADXL345_PARAM_RATE, \
+#define ADXL345_PARAMS { .offset = ADXL345_PARAM_OFFSET, \
+ .range = ADXL345_PARAM_RANGE, \
+ .rate = ADXL345_PARAM_RATE, \
.full_res = ADXL345_PARAM_FULL_RES }
#endif
#ifndef ADXL345_SAUL_INFO
diff --git a/drivers/adxl345/include/adxl345_regs.h b/drivers/adxl345/include/adxl345_regs.h
index 3743de6ae..fc6ddea6d 100644
--- a/drivers/adxl345/include/adxl345_regs.h
+++ b/drivers/adxl345/include/adxl345_regs.h
@@ -20,7 +20,7 @@
#define ADXL345_REGS_H
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/drivers/apa102/include/apa102_params.h b/drivers/apa102/include/apa102_params.h
index 7a6526d11..077e2180c 100644
--- a/drivers/apa102/include/apa102_params.h
+++ b/drivers/apa102/include/apa102_params.h
@@ -41,7 +41,7 @@ extern "C" {
#ifndef APA102_PARAMS
#define APA102_PARAMS { .led_numof = APA102_PARAM_LED_NUMOF, \
- .data_pin = APA102_PARAM_DATA_PIN, \
+ .data_pin = APA102_PARAM_DATA_PIN, \
.clk_pin = APA102_PARAM_CLK_PIN }
#endif
/**@}*/
@@ -49,7 +49,7 @@ extern "C" {
/**
* @brief APA102 configuration
*/
-static const apa102_params_t apa102_params[] =
+static const apa102_params_t apa102_params[] =
{
APA102_PARAMS
};
diff --git a/drivers/at30tse75x/at30tse75x.c b/drivers/at30tse75x/at30tse75x.c
index 4549301b2..e0a0f8454 100644
--- a/drivers/at30tse75x/at30tse75x.c
+++ b/drivers/at30tse75x/at30tse75x.c
@@ -28,10 +28,10 @@ static inline float temperature_to_float(uint16_t temp)
{
/* Integer part is 8-bit signed */
int8_t temp_int = (temp & AT30TSE75X_INTEGER_MASK) >>
- AT30TSE75X_INTEGER_SHIFT;
+ AT30TSE75X_INTEGER_SHIFT;
/* Fractional part is multiple of 0.0625 */
uint8_t frac_multiplier = (temp & AT30TSE75X_FRACTIONAL_MASK) >>
- AT30TSE75X_FRACTIONAL_SHIFT;
+ AT30TSE75X_FRACTIONAL_SHIFT;
return temp_int + (frac_multiplier * AT30TSE75X_FRACTIONAL_BASE);
}
@@ -132,20 +132,20 @@ int at30tse75x_set_mode(const at30tse75x_t *dev, at30tse75x_mode_t mode)
}
switch(mode) {
- case AT30TSE75X_MODE_ONE_SHOT:
- config |= AT30TSE75X_CONFIG__SHUTDOWN_BIT;
- /* Don't touch alarm mode */
- break;
- case AT30TSE75X_MODE_COMPARATOR:
- config &= ~(AT30TSE75X_CONFIG__SHUTDOWN_BIT);
- config &= ~(AT30TSE75X_CONFIG__ALARM_MODE_BIT);
- break;
- case AT30TSE75X_MODE_INTERRUPT:
- config &= ~(AT30TSE75X_CONFIG__SHUTDOWN_BIT);
- config |= AT30TSE75X_CONFIG__ALARM_MODE_BIT;
- break;
- default:
- return -2;
+ case AT30TSE75X_MODE_ONE_SHOT:
+ config |= AT30TSE75X_CONFIG__SHUTDOWN_BIT;
+ /* Don't touch alarm mode */
+ break;
+ case AT30TSE75X_MODE_COMPARATOR:
+ config &= ~(AT30TSE75X_CONFIG__SHUTDOWN_BIT);
+ config &= ~(AT30TSE75X_CONFIG__ALARM_MODE_BIT);
+ break;
+ case AT30TSE75X_MODE_INTERRUPT:
+ config &= ~(AT30TSE75X_CONFIG__SHUTDOWN_BIT);
+ config |= AT30TSE75X_CONFIG__ALARM_MODE_BIT;
+ break;
+ default:
+ return -2;
}
if(at30tse75x_set_config(dev, config) != 0) {
@@ -163,19 +163,19 @@ int at30tse75x_set_alarm_polarity(const at30tse75x_t *dev, at30tse75x_alarm_pola
}
switch(polarity) {
- case AT30TSE75X_ALARM_ACTIVE_HIGH:
- config |= AT30TSE75X_CONFIG__ALERT_POL_BIT;
- break;
- case AT30TSE75X_ALARM_ACTIVE_LOW:
- config &= ~(AT30TSE75X_CONFIG__ALERT_POL_BIT);
- break;
- default:
- return -2;
+ case AT30TSE75X_ALARM_ACTIVE_HIGH:
+ config |= AT30TSE75X_CONFIG__ALERT_POL_BIT;
+ break;
+ case AT30TSE75X_ALARM_ACTIVE_LOW:
+ config &= ~(AT30TSE75X_CONFIG__ALERT_POL_BIT);
+ break;
+ default:
+ return -2;
}
if(at30tse75x_set_config(dev, config) != 0) {
- return -1;
- }
+ return -1;
+ }
return 0;
}
@@ -255,8 +255,8 @@ int at30tse75x_get_temperature(const at30tse75x_t *dev, float *temperature)
}
/* Use resolution to calculate conversion time */
- uint8_t resolution = (config & AT30TSE75X_CONFIG__RESOLUTION_MASK) >>
- AT30TSE75X_CONFIG__RESOLUTION_SHIFT;
+ uint8_t resolution = (config & AT30TSE75X_CONFIG__RESOLUTION_MASK) >>
+ AT30TSE75X_CONFIG__RESOLUTION_SHIFT;
/* Wait until conversion is finished */
xtimer_usleep((uint32_t)(25000 << resolution));
diff --git a/drivers/at86rf2xx/at86rf2xx_getset.c b/drivers/at86rf2xx/at86rf2xx_getset.c
index 2af840e6c..5c95c6930 100644
--- a/drivers/at86rf2xx/at86rf2xx_getset.c
+++ b/drivers/at86rf2xx/at86rf2xx_getset.c
@@ -197,7 +197,7 @@ int16_t at86rf2xx_get_txpower(const at86rf2xx_t *dev)
return _tx_pow_to_dbm_212b(dev->netdev.chan, dev->page, txpower);
#else
uint8_t txpower = at86rf2xx_reg_read(dev, AT86RF2XX_REG__PHY_TX_PWR)
- & AT86RF2XX_PHY_TX_PWR_MASK__TX_PWR;
+ & AT86RF2XX_PHY_TX_PWR_MASK__TX_PWR;
return tx_pow_to_dbm[txpower];
#endif
}
@@ -332,7 +332,7 @@ void at86rf2xx_set_option(at86rf2xx_t *dev, uint16_t option, bool state)
/* set option field */
dev->netdev.flags = (state) ? (dev->netdev.flags | option)
- : (dev->netdev.flags & ~option);
+ : (dev->netdev.flags & ~option);
/* trigger option specific actions */
switch (option) {
case AT86RF2XX_OPT_CSMA:
@@ -356,12 +356,12 @@ void at86rf2xx_set_option(at86rf2xx_t *dev, uint16_t option, bool state)
/* disable/enable auto ACKs in promiscuous mode */
tmp = at86rf2xx_reg_read(dev, AT86RF2XX_REG__CSMA_SEED_1);
tmp = (state) ? (tmp | AT86RF2XX_CSMA_SEED_1__AACK_DIS_ACK)
- : (tmp & ~AT86RF2XX_CSMA_SEED_1__AACK_DIS_ACK);
+ : (tmp & ~AT86RF2XX_CSMA_SEED_1__AACK_DIS_ACK);
at86rf2xx_reg_write(dev, AT86RF2XX_REG__CSMA_SEED_1, tmp);
/* enable/disable promiscuous mode */
tmp = at86rf2xx_reg_read(dev, AT86RF2XX_REG__XAH_CTRL_1);
tmp = (state) ? (tmp | AT86RF2XX_XAH_CTRL_1__AACK_PROM_MODE)
- : (tmp & ~AT86RF2XX_XAH_CTRL_1__AACK_PROM_MODE);
+ : (tmp & ~AT86RF2XX_XAH_CTRL_1__AACK_PROM_MODE);
at86rf2xx_reg_write(dev, AT86RF2XX_REG__XAH_CTRL_1, tmp);
break;
case AT86RF2XX_OPT_AUTOACK:
@@ -369,7 +369,7 @@ void at86rf2xx_set_option(at86rf2xx_t *dev, uint16_t option, bool state)
(state ? "enable" : "disable"));
tmp = at86rf2xx_reg_read(dev, AT86RF2XX_REG__CSMA_SEED_1);
tmp = (state) ? (tmp & ~AT86RF2XX_CSMA_SEED_1__AACK_DIS_ACK)
- : (tmp | AT86RF2XX_CSMA_SEED_1__AACK_DIS_ACK);
+ : (tmp | AT86RF2XX_CSMA_SEED_1__AACK_DIS_ACK);
at86rf2xx_reg_write(dev, AT86RF2XX_REG__CSMA_SEED_1, tmp);
break;
case AT86RF2XX_OPT_TELL_RX_START:
@@ -377,14 +377,14 @@ void at86rf2xx_set_option(at86rf2xx_t *dev, uint16_t option, bool state)
(state ? "enable" : "disable"));
tmp = at86rf2xx_reg_read(dev, AT86RF2XX_REG__IRQ_MASK);
tmp = (state) ? (tmp | AT86RF2XX_IRQ_STATUS_MASK__RX_START)
- : (tmp & ~AT86RF2XX_IRQ_STATUS_MASK__RX_START);
+ : (tmp & ~AT86RF2XX_IRQ_STATUS_MASK__RX_START);
at86rf2xx_reg_write(dev, AT86RF2XX_REG__IRQ_MASK, tmp);
break;
case AT86RF2XX_OPT_ACK_PENDING:
DEBUG("[at86rf2xx] opt: enabling pending ACKs\n");
tmp = at86rf2xx_reg_read(dev, AT86RF2XX_REG__CSMA_SEED_1);
tmp = (state) ? (tmp | AT86RF2XX_CSMA_SEED_1__AACK_SET_PD)
- : (tmp & ~AT86RF2XX_CSMA_SEED_1__AACK_SET_PD);
+ : (tmp & ~AT86RF2XX_CSMA_SEED_1__AACK_SET_PD);
at86rf2xx_reg_write(dev, AT86RF2XX_REG__CSMA_SEED_1, tmp);
break;
default:
@@ -452,7 +452,7 @@ uint8_t at86rf2xx_set_state(at86rf2xx_t *dev, uint8_t state)
if (state == AT86RF2XX_STATE_SLEEP) {
/* First go to TRX_OFF */
_set_state(dev, AT86RF2XX_STATE_TRX_OFF,
- AT86RF2XX_STATE_FORCE_TRX_OFF);
+ AT86RF2XX_STATE_FORCE_TRX_OFF);
/* Discard all IRQ flags, framebuffer is lost anyway */
at86rf2xx_reg_read(dev, AT86RF2XX_REG__IRQ_STATUS);
/* Go to SLEEP mode from TRX_OFF */
diff --git a/drivers/at86rf2xx/at86rf2xx_netdev.c b/drivers/at86rf2xx/at86rf2xx_netdev.c
index dd697483d..395607650 100644
--- a/drivers/at86rf2xx/at86rf2xx_netdev.c
+++ b/drivers/at86rf2xx/at86rf2xx_netdev.c
@@ -154,8 +154,8 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
return -ENOBUFS;
}
#ifdef MODULE_NETSTATS_L2
- netdev->stats.rx_count++;
- netdev->stats.rx_bytes += pkt_len;
+ netdev->stats.rx_count++;
+ netdev->stats.rx_bytes += pkt_len;
#endif
/* copy payload */
at86rf2xx_fb_read(dev, (uint8_t *)buf, pkt_len);
@@ -332,7 +332,7 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
int res;
if (((res = netdev_ieee802154_get((netdev_ieee802154_t *)netdev, opt, val,
- max_len)) >= 0) || (res != -ENOTSUP)) {
+ max_len)) >= 0) || (res != -ENOTSUP)) {
return res;
}
@@ -381,7 +381,7 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
res = sizeof(int8_t);
break;
- case NETOPT_AUTOACK :
+ case NETOPT_AUTOACK:
assert(max_len >= sizeof(netopt_enable_t));
uint8_t tmp = at86rf2xx_reg_read(dev, AT86RF2XX_REG__CSMA_SEED_1);
*((netopt_enable_t *)val) = (tmp & AT86RF2XX_CSMA_SEED_1__AACK_DIS_ACK) ? false : true;
@@ -546,7 +546,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
case NETOPT_CSMA_RETRIES:
assert(len <= sizeof(uint8_t));
if( !(dev->netdev.flags & AT86RF2XX_OPT_CSMA ||
- (*((uint8_t *)val) > 5)) ) {
+ (*((uint8_t *)val) > 5)) ) {
/* If CSMA is disabled, don't allow setting retries */
res = -EINVAL;
}
diff --git a/drivers/ata8520e/ata8520e.c b/drivers/ata8520e/ata8520e.c
index 7b1380cf5..3d36a4e9f 100644
--- a/drivers/ata8520e/ata8520e.c
+++ b/drivers/ata8520e/ata8520e.c
@@ -37,7 +37,7 @@
/* Warning: to correctly display the debug messages in callbacks,
add CFLAGS+=-DTHREAD_STACKSIZE_IDLE=THREAD_STACKSIZE_DEFAULT to the build
command.
-*/
+ */
#include "debug.h"
#define SPIDEV (dev->params.spi)
diff --git a/drivers/bmp180/bmp180.c b/drivers/bmp180/bmp180.c
index 1927c6e79..a536fcff4 100644
--- a/drivers/bmp180/bmp180.c
+++ b/drivers/bmp180/bmp180.c
@@ -40,8 +40,8 @@ static int _read_up(const bmp180_t *dev, int32_t *up);
static int _compute_b5(const bmp180_t *dev, int32_t ut, int32_t *b5);
/*---------------------------------------------------------------------------*
- * BMP180 Core API *
- *---------------------------------------------------------------------------*/
+* BMP180 Core API *
+*---------------------------------------------------------------------------*/
int bmp180_init(bmp180_t *dev, const bmp180_params_t *params)
{
@@ -212,21 +212,21 @@ static int _read_up(const bmp180_t *dev, int32_t *output)
uint8_t control[2] = { BMP180_REGISTER_CONTROL, BMP180_PRESSURE_COMMAND | (OVERSAMPLING & 0x3) << 6 };
i2c_write_bytes(DEV_I2C, DEV_ADDR, control, 2);
switch (OVERSAMPLING) {
- case BMP180_ULTRALOWPOWER:
- xtimer_usleep(BMP180_ULTRALOWPOWER_DELAY);
- break;
- case BMP180_STANDARD:
- xtimer_usleep(BMP180_STANDARD_DELAY);
- break;
- case BMP180_HIGHRES:
- xtimer_usleep(BMP180_HIGHRES_DELAY);
- break;
- case BMP180_ULTRAHIGHRES:
- xtimer_usleep(BMP180_ULTRAHIGHRES_DELAY);
- break;
- default:
- xtimer_usleep(BMP180_ULTRALOWPOWER_DELAY);
- break;
+ case BMP180_ULTRALOWPOWER:
+ xtimer_usleep(BMP180_ULTRALOWPOWER_DELAY);
+ break;
+ case BMP180_STANDARD:
+ xtimer_usleep(BMP180_STANDARD_DELAY);
+ break;
+ case BMP180_HIGHRES:
+ xtimer_usleep(BMP180_HIGHRES_DELAY);
+ break;
+ case BMP180_ULTRAHIGHRES:
+ xtimer_usleep(BMP180_ULTRAHIGHRES_DELAY);
+ break;
+ default:
+ xtimer_usleep(BMP180_ULTRALOWPOWER_DELAY);
+ break;
}
if (i2c_read_regs(DEV_I2C, DEV_ADDR, BMP180_REGISTER_DATA, up, 3) < 0) {
DEBUG("[Error] Cannot read uncompensated pressure.\n");
diff --git a/drivers/bmx055/include/bmx055_params.h b/drivers/bmx055/include/bmx055_params.h
index 7907119c0..b15dc87a8 100644
--- a/drivers/bmx055/include/bmx055_params.h
+++ b/drivers/bmx055/include/bmx055_params.h
@@ -58,24 +58,24 @@ extern "C" {
#endif
#ifndef BMX055_PARAMS
-#define BMX055_PARAMS \
- { .i2c = BMX055_PARAM_I2C, \
- .addr_mag = BMX055_PARAM_MAG_ADDR, \
- .addr_acc = BMX055_PARAM_ACC_ADDR, \
- .addr_gyro = BMX055_PARAM_GYRO_ADDR, \
- .int1_pin = BMX055_PARAM_INT1, \
- .int2_pin = BMX055_PARAM_INT2, \
- .mag_rate = BMX055_PARAM_MAG_RATE, \
- .acc_range = BMX055_PARAM_ACC_RANGE, \
- .gyro_scale = BMX055_PARAM_GYRO_SCALE, \
+#define BMX055_PARAMS \
+ { .i2c = BMX055_PARAM_I2C, \
+ .addr_mag = BMX055_PARAM_MAG_ADDR, \
+ .addr_acc = BMX055_PARAM_ACC_ADDR, \
+ .addr_gyro = BMX055_PARAM_GYRO_ADDR, \
+ .int1_pin = BMX055_PARAM_INT1, \
+ .int2_pin = BMX055_PARAM_INT2, \
+ .mag_rate = BMX055_PARAM_MAG_RATE, \
+ .acc_range = BMX055_PARAM_ACC_RANGE, \
+ .gyro_scale = BMX055_PARAM_GYRO_SCALE, \
}
#endif
#ifndef BMX055_SAULINFO
-#define BMX055_SAULINFO \
- { { .name = "Magnetometer (bmx055)" }, \
- { .name = "Accelerometer (bmx055)" }, \
- { .name = "Gyroscope (bmx055)" }, \
+#define BMX055_SAULINFO \
+ { { .name = "Magnetometer (bmx055)" }, \
+ { .name = "Accelerometer (bmx055)" }, \
+ { .name = "Gyroscope (bmx055)" }, \
}
#endif
/** @} */
diff --git a/drivers/bmx280/bmx280.c b/drivers/bmx280/bmx280.c
index 3dcc5d0bf..4fd805a5f 100644
--- a/drivers/bmx280/bmx280.c
+++ b/drivers/bmx280/bmx280.c
@@ -62,8 +62,8 @@ static int32_t t_fine;
static uint8_t measurement_regs[8];
/*---------------------------------------------------------------------------*
- * BMX280 Core API *
- *---------------------------------------------------------------------------*/
+* BMX280 Core API *
+*---------------------------------------------------------------------------*/
int bmx280_init(bmx280_t* dev, const bmx280_params_t* params)
{
@@ -108,8 +108,8 @@ int16_t bmx280_read_temperature(const bmx280_t* dev)
/* Read the uncompensated temperature */
int32_t adc_T = (((uint32_t)measurement_regs[3 + 0]) << 12) |
- (((uint32_t)measurement_regs[3 + 1]) << 4) |
- ((((uint32_t)measurement_regs[3 + 2]) >> 4) & 0x0F);
+ (((uint32_t)measurement_regs[3 + 1]) << 4) |
+ ((((uint32_t)measurement_regs[3 + 2]) >> 4) & 0x0F);
/*
* Compensate the temperature value.
@@ -139,8 +139,8 @@ uint32_t bmx280_read_pressure(const bmx280_t *dev)
/* Read the uncompensated pressure */
int32_t adc_P = (((uint32_t)measurement_regs[0 + 0]) << 12) |
- (((uint32_t)measurement_regs[0 + 1]) << 4) |
- ((((uint32_t)measurement_regs[0 + 2]) >> 4) & 0x0F);
+ (((uint32_t)measurement_regs[0 + 1]) << 4) |
+ ((((uint32_t)measurement_regs[0 + 2]) >> 4) & 0x0F);
int64_t var1;
int64_t var2;
@@ -179,7 +179,7 @@ uint16_t bme280_read_humidity(const bmx280_t *dev)
/* Read the uncompensated pressure */
int32_t adc_H = (((uint32_t)measurement_regs[6 + 0]) << 8) |
- (((uint32_t)measurement_regs[6 + 1]));
+ (((uint32_t)measurement_regs[6 + 1]));
/*
* Compensate the humidity value.
@@ -253,9 +253,9 @@ static int read_calibration_data(bmx280_t* dev)
dev->calibration.dig_H2 = get_int16_le(buffer, BME280_DIG_H2_LSB_REG - offset);
dev->calibration.dig_H3 = buffer[BME280_DIG_H3_REG - offset];
dev->calibration.dig_H4 = (((int16_t)buffer[BME280_DIG_H4_MSB_REG - offset]) << 4) +
- (buffer[BME280_DIG_H4_H5_REG - offset] & 0x0F);
+ (buffer[BME280_DIG_H4_H5_REG - offset] & 0x0F);
dev->calibration.dig_H5 = (((int16_t)buffer[BME280_DIG_H5_MSB_REG - offset]) << 4) +
- ((buffer[BME280_DIG_H4_H5_REG - offset] & 0xF0) >> 4);
+ ((buffer[BME280_DIG_H4_H5_REG - offset] & 0xF0) >> 4);
dev->calibration.dig_H6 = buffer[BME280_DIG_H6_REG - offset];
#endif
diff --git a/drivers/bmx280/include/bmx280_params.h b/drivers/bmx280/include/bmx280_params.h
index 98afd8df6..8c74076f5 100644
--- a/drivers/bmx280/include/bmx280_params.h
+++ b/drivers/bmx280/include/bmx280_params.h
@@ -41,12 +41,12 @@ extern "C" {
#endif
/* Defaults for Weather Monitoring */
-#define BMX280_PARAMS_DEFAULT \
- { \
- .i2c_dev = BMX280_PARAM_I2C_DEV, \
- .i2c_addr = BMX280_PARAM_I2C_ADDR, \
- .t_sb = BMX280_SB_0_5, \
- .filter = BMX280_FILTER_OFF, \
+#define BMX280_PARAMS_DEFAULT \
+ { \
+ .i2c_dev = BMX280_PARAM_I2C_DEV, \
+ .i2c_addr = BMX280_PARAM_I2C_ADDR, \
+ .t_sb = BMX280_SB_0_5, \
+ .filter = BMX280_FILTER_OFF, \
.run_mode = BMX280_MODE_FORCED, \
.temp_oversample = BMX280_OSRS_X1, \
.press_oversample = BMX280_OSRS_X1, \
@@ -81,9 +81,9 @@ static const bmx280_params_t bmx280_params[] =
static const saul_reg_info_t bmx280_saul_reg_info[BMX280_NUMOF] =
{
#if defined(MODULE_BME280)
- { .name = "bme280" }
+ { .name = "bme280" }
#else
- { .name = "bmp280" }
+ { .name = "bmp280" }
#endif
};
diff --git a/drivers/cc110x/cc110x-defaultsettings.c b/drivers/cc110x/cc110x-defaultsettings.c
index aded9ece1..80cca3fe7 100644
--- a/drivers/cc110x/cc110x-defaultsettings.c
+++ b/drivers/cc110x/cc110x-defaultsettings.c
@@ -28,7 +28,7 @@
* @brief PATABLE with available output powers
* @note If changed in size, adjust MAX_OUTPUT_POWER definition
* in CC110x interface
-*/
+ */
const char cc110x_default_pa_table[8] = {
0x00, /*< -52 dBm */
0x0D, /*< -20 dBm */
diff --git a/drivers/cc110x/cc110x-netdev.c b/drivers/cc110x/cc110x-netdev.c
index 99f3b58da..396f5d282 100644
--- a/drivers/cc110x/cc110x-netdev.c
+++ b/drivers/cc110x/cc110x-netdev.c
@@ -132,22 +132,22 @@ static int _set(netdev_t *dev, netopt_t opt, const void *value, size_t value_len
switch (opt) {
case NETOPT_CHANNEL:
- {
- const uint16_t *arg = value;
- uint8_t channel = (uint8_t)(*arg);
+ {
+ const uint16_t *arg = value;
+ uint8_t channel = (uint8_t)(*arg);
#if CC110X_MIN_CHANNR
- if (channel < CC110X_MIN_CHANNR) {
- return -EINVAL;
- }
+ if (channel < CC110X_MIN_CHANNR) {
+ return -EINVAL;
+ }
#endif /* CC110X_MIN_CHANNR */
- if (channel > CC110X_MAX_CHANNR) {
- return -EINVAL;
- }
- if (cc110x_set_channel(cc110x, channel) == -1) {
- return -EINVAL;
- }
- return sizeof(uint16_t);
+ if (channel > CC110X_MAX_CHANNR) {
+ return -EINVAL;
}
+ if (cc110x_set_channel(cc110x, channel) == -1) {
+ return -EINVAL;
+ }
+ return sizeof(uint16_t);
+ }
case NETOPT_ADDRESS:
if (value_len < 1) {
return -EINVAL;
diff --git a/drivers/cc110x/cc110x-rxtx.c b/drivers/cc110x/cc110x-rxtx.c
index a717e8e1b..5ccc60847 100644
--- a/drivers/cc110x/cc110x-rxtx.c
+++ b/drivers/cc110x/cc110x-rxtx.c
@@ -49,19 +49,19 @@
const char *cc110x_state_to_text(uint8_t state)
{
- switch (state){
- case RADIO_IDLE:
- return "idle";
- case RADIO_TX_BUSY:
- return "tx busy";
- case RADIO_RX:
- return "rx";
- case RADIO_RX_BUSY:
- return "rx busy";
- case RADIO_PWD:
- return "pwd";
- case RADIO_UNKNOWN:
- return "unknown";
+ switch (state) {
+ case RADIO_IDLE:
+ return "idle";
+ case RADIO_TX_BUSY:
+ return "tx busy";
+ case RADIO_RX:
+ return "rx";
+ case RADIO_RX_BUSY:
+ return "rx busy";
+ case RADIO_PWD:
+ return "pwd";
+ case RADIO_UNKNOWN:
+ return "unknown";
}
return "invalid";
}
@@ -89,7 +89,7 @@ static void _rx_start(cc110x_t *dev)
gpio_irq_enable(dev->params.gdo2);
}
-static void _rx_read_data(cc110x_t *dev, void(*callback)(void*), void*arg)
+static void _rx_read_data(cc110x_t *dev, void (*callback)(void*), void*arg)
{
int fifo = cc110x_get_reg_robust(dev, 0xfb);
@@ -124,7 +124,7 @@ static void _rx_read_data(cc110x_t *dev, void(*callback)(void*), void*arg)
if (to_read) {
cc110x_readburst_reg(dev, CC110X_RXFIFO,
- ((char *)&pkt_buf->packet)+pkt_buf->pos, to_read);
+ ((char *)&pkt_buf->packet)+pkt_buf->pos, to_read);
pkt_buf->pos += to_read;
}
@@ -165,11 +165,11 @@ static void _rx_read_data(cc110x_t *dev, void(*callback)(void*), void*arg)
}
}
-static void _rx_continue(cc110x_t *dev, void(*callback)(void*), void*arg)
+static void _rx_continue(cc110x_t *dev, void (*callback)(void*), void*arg)
{
if (dev->radio_state != RADIO_RX_BUSY) {
DEBUG("%s:%s:%u _rx_continue in invalid state\n", RIOT_FILE_RELATIVE,
- __func__, __LINE__);
+ __func__, __LINE__);
_rx_abort(dev);
return;
}
@@ -241,7 +241,7 @@ static void _tx_continue(cc110x_t *dev)
}
}
-void cc110x_isr_handler(cc110x_t *dev, void(*callback)(void*), void*arg)
+void cc110x_isr_handler(cc110x_t *dev, void (*callback)(void*), void*arg)
{
switch (dev->radio_state) {
case RADIO_RX:
@@ -266,21 +266,21 @@ void cc110x_isr_handler(cc110x_t *dev, void(*callback)(void*), void*arg)
break;
default:
DEBUG("%s:%s:%u: unhandled mode\n", RIOT_FILE_RELATIVE,
- __func__, __LINE__);
+ __func__, __LINE__);
}
}
int cc110x_send(cc110x_t *dev, cc110x_pkt_t *packet)
{
DEBUG("cc110x: snd pkt to %u payload_length=%u\n",
- (unsigned)packet->address, (unsigned)packet->length-3);
+ (unsigned)packet->address, (unsigned)packet->length-3);
unsigned size;
switch (dev->radio_state) {
case RADIO_RX_BUSY:
case RADIO_TX_BUSY:
DEBUG("cc110x: invalid state for sending: %s\n",
- cc110x_state_to_text(dev->radio_state));
+ cc110x_state_to_text(dev->radio_state));
return -EAGAIN;
}
@@ -293,7 +293,7 @@ int cc110x_send(cc110x_t *dev, cc110x_pkt_t *packet)
if (size > CC110X_PACKET_LENGTH) {
DEBUG("%s:%s:%u trying to send oversized packet\n",
- RIOT_FILE_RELATIVE, __func__, __LINE__);
+ RIOT_FILE_RELATIVE, __func__, __LINE__);
return -ENOSPC;
}
diff --git a/drivers/cc110x/cc110x-spi.c b/drivers/cc110x/cc110x-spi.c
index 5a0c4efb1..330ceef7a 100644
--- a/drivers/cc110x/cc110x-spi.c
+++ b/drivers/cc110x/cc110x-spi.c
@@ -39,8 +39,8 @@
#define SPI_MODE SPI_MODE_0
/**********************************************************************
- * CC110x spi access
- **********************************************************************/
+* CC110x spi access
+**********************************************************************/
static inline void lock(cc110x_t *dev)
{
diff --git a/drivers/cc110x/cc110x.c b/drivers/cc110x/cc110x.c
index 8230f9487..61b3d48a3 100644
--- a/drivers/cc110x/cc110x.c
+++ b/drivers/cc110x/cc110x.c
@@ -86,8 +86,8 @@ int cc110x_setup(cc110x_t *dev, const cc110x_params_t *params)
cc110x_set_address(dev, addr);
LOG_INFO("cc110x: initialized with address=%u and channel=%i\n",
- (unsigned)dev->radio_address,
- dev->radio_channel);
+ (unsigned)dev->radio_address,
+ dev->radio_channel);
return 0;
}
@@ -95,7 +95,7 @@ int cc110x_setup(cc110x_t *dev, const cc110x_params_t *params)
uint8_t cc110x_set_address(cc110x_t *dev, uint8_t address)
{
DEBUG("%s:%s:%u setting address %u\n", RIOT_FILE_RELATIVE, __func__,
- __LINE__, (unsigned)address);
+ __LINE__, (unsigned)address);
if (!(address < MIN_UID)) {
if (dev->radio_state != RADIO_UNKNOWN) {
cc110x_write_register(dev, CC110X_ADDR, address);
@@ -114,7 +114,7 @@ void cc110x_set_base_freq_raw(cc110x_t *dev, const char* freq_array)
uint32_t *FREQ = (uint32_t*) _tmp;
DEBUG("cc110x_set_base_freq_raw(): setting base frequency to %uHz\n",
- (26000000>>16) * (unsigned)(*FREQ));
+ (26000000>>16) * (unsigned)(*FREQ));
#endif
cc110x_writeburst_reg(dev, CC110X_FREQ2, freq_array, 3);
}
@@ -177,7 +177,7 @@ void cc110x_switch_to_pwd(cc110x_t *dev)
dev->radio_state = RADIO_PWD;
#ifdef MODULE_CC110X_HOOKS
- cc110x_hook_off();
+ cc110x_hook_off();
#endif
}
@@ -260,7 +260,7 @@ int cc110x_rd_set_mode(cc110x_t *dev, int mode)
break;
case RADIO_MODE_GET:
- /* do nothing, just return current mode */
+ /* do nothing, just return current mode */
default:
/* do nothing */
break;
diff --git a/drivers/cc110x/gnrc_cc110x/gnrc_cc110x.c b/drivers/cc110x/gnrc_cc110x/gnrc_cc110x.c
index d7432196d..5b021e208 100644
--- a/drivers/cc110x/gnrc_cc110x/gnrc_cc110x.c
+++ b/drivers/cc110x/gnrc_cc110x/gnrc_cc110x.c
@@ -53,7 +53,7 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
}
if (netif_hdr->flags & (GNRC_NETIF_HDR_FLAGS_BROADCAST |
- GNRC_NETIF_HDR_FLAGS_MULTICAST)) {
+ GNRC_NETIF_HDR_FLAGS_MULTICAST)) {
cc110x_pkt.address = 0;
}
else {
@@ -84,7 +84,7 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
if (payload_len > CC110X_MAX_DATA_LENGTH) {
DEBUG("gnrc_cc110x: payload length exceeds maximum"
- "(%u>%u)\n", payload_len, CC110X_MAX_DATA_LENGTH);
+ "(%u>%u)\n", payload_len, CC110X_MAX_DATA_LENGTH);
gnrc_pktbuf_release(pkt);
return -EBADMSG;
}
@@ -100,10 +100,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
cc110x_pkt.length = (uint8_t) payload_len + CC110X_HEADER_LENGTH;
DEBUG("gnrc_cc110x: sending packet from %u to %u with payload "
- "length %u\n",
- (unsigned)cc110x_pkt.phy_src,
- (unsigned)cc110x_pkt.address,
- (unsigned)payload_len);
+ "length %u\n",
+ (unsigned)cc110x_pkt.phy_src,
+ (unsigned)cc110x_pkt.address,
+ (unsigned)payload_len);
#if defined(MODULE_OD) && ENABLE_DEBUG
od_hex_dump(cc110x_pkt.data, payload_len, OD_WIDTH_DEFAULT);
#endif
@@ -137,7 +137,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
/* copy packet payload into pktbuf */
gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, cc110x_pkt->data,
- payload_length, nettype);
+ payload_length, nettype);
if(!pkt) {
DEBUG("gnrc_cc110x: _recv: cannot allocate pktsnip.\n");
@@ -147,8 +147,8 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
gnrc_pktsnip_t *netif_hdr;
netif_hdr = gnrc_pktbuf_add(NULL, NULL,
- sizeof(gnrc_netif_hdr_t) + 2*addr_len,
- GNRC_NETTYPE_NETIF);
+ sizeof(gnrc_netif_hdr_t) + 2*addr_len,
+ GNRC_NETTYPE_NETIF);
if (netif_hdr == NULL) {
DEBUG("gnrc_cc110x: no space left in packet buffer\n");
@@ -173,8 +173,8 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
((gnrc_netif_hdr_t *)netif_hdr->data)->rssi = cc110x->pkt_buf.rssi;
DEBUG("gnrc_cc110x: received packet from %02x of length %u\n",
- (unsigned)cc110x_pkt->phy_src,
- (unsigned)cc110x_pkt->length-CC110X_HEADER_LENGTH);
+ (unsigned)cc110x_pkt->phy_src,
+ (unsigned)cc110x_pkt->length-CC110X_HEADER_LENGTH);
#if defined(MODULE_OD) && ENABLE_DEBUG
od_hex_dump(cc110x_pkt->data, payload_length, OD_WIDTH_DEFAULT);
#endif
diff --git a/drivers/cc110x/include/cc110x-interface.h b/drivers/cc110x/include/cc110x-interface.h
index 4e77b9478..eeeddc947 100644
--- a/drivers/cc110x/include/cc110x-interface.h
+++ b/drivers/cc110x/include/cc110x-interface.h
@@ -38,7 +38,7 @@ char *cc110x_get_marc_state(cc110x_t *dev);
const char *cc110x_state_to_text(uint8_t state);
int cc110x_rd_set_mode(cc110x_t *dev, int mode);
uint8_t cc110x_get_buffer_pos(cc110x_t *dev);
-void cc110x_isr_handler(cc110x_t *dev, void(*callback)(void*), void*arg);
+void cc110x_isr_handler(cc110x_t *dev, void (*callback)(void*), void*arg);
void cc110x_set_base_freq_raw(cc110x_t *dev, const char* freq_array);
void cc110x_setup_rx_mode(cc110x_t *dev);
void cc110x_switch_to_pwd(cc110x_t *dev);
diff --git a/drivers/cc110x/include/cc110x-internal.h b/drivers/cc110x/include/cc110x-internal.h
index 0875be83e..d7228c6c7 100644
--- a/drivers/cc110x/include/cc110x-internal.h
+++ b/drivers/cc110x/include/cc110x-internal.h
@@ -86,23 +86,23 @@ extern char cc110x_conf[];
* @brief CC110X layer 0 protocol
*
* <pre>
----------------------------------------------------
-| | | | | |
-| Length | Address | PhySrc | Flags | Data |
-| | | | | |
----------------------------------------------------
- 1 byte 1 byte 1 byte 1 byte <= 251 bytes
-
-Flags:
+ ---------------------------------------------------
+ | | | | | |
+ | Length | Address | PhySrc | Flags | Data |
+ | | | | | |
+ ---------------------------------------------------
+ 1 byte 1 byte 1 byte 1 byte <= 251 bytes
+
+ Flags:
Bit | Meaning
--------------------
7:4 | -
3:1 | Protocol
0 | Identification
-</pre>
-Notes:
-\li length & address are given by CC110X
-\li Identification is increased is used to scan duplicates. It must be increased
+ </pre>
+ Notes:
+ \li length & address are given by CC110X
+ \li Identification is increased is used to scan duplicates. It must be increased
for each new packet and kept for packet retransmissions.
*/
typedef struct __attribute__((packed))
@@ -189,18 +189,18 @@ typedef struct {
* @brief Radio Control Flags
*/
typedef struct {
- uint8_t _RSSI; /**< The RSSI value of last received packet */
- uint8_t _LQI; /**< The LQI value of the last received packet */
+ uint8_t _RSSI; /**< The RSSI value of last received packet */
+ uint8_t _LQI; /**< The LQI value of the last received packet */
} cc110x_flags_t;
/**
* @brief Statistic interface for debugging
*/
typedef struct cc110x_statistic {
- uint32_t packets_in; /**< total nr of packets received */
- uint32_t packets_in_crc_fail; /**< dropped because of invalid crc */
- uint32_t packets_in_while_tx; /**< receive while tx */
- uint32_t raw_packets_out; /**< packets sent */
+ uint32_t packets_in; /**< total nr of packets received */
+ uint32_t packets_in_crc_fail; /**< dropped because of invalid crc */
+ uint32_t packets_in_while_tx; /**< receive while tx */
+ uint32_t raw_packets_out; /**< packets sent */
} cc110x_statistic_t;
#ifdef __cplusplus
diff --git a/drivers/cc110x/include/cc110x_params.h b/drivers/cc110x/include/cc110x_params.h
index e9f0130c2..bddc31f21 100644
--- a/drivers/cc110x/include/cc110x_params.h
+++ b/drivers/cc110x/include/cc110x_params.h
@@ -53,12 +53,12 @@ extern "C" {
#ifndef CC110X_PARAMS
#define CC110X_PARAMS { \
- .spi = CC110X_PARAM_SPI, \
- .cs = CC110X_PARAM_CS, \
- .gdo0 = CC110X_PARAM_GDO0, \
- .gdo1 = CC110X_PARAM_GDO1, \
- .gdo2 = CC110X_PARAM_GDO2, \
- }
+ .spi = CC110X_PARAM_SPI, \
+ .cs = CC110X_PARAM_CS, \
+ .gdo0 = CC110X_PARAM_GDO0, \
+ .gdo1 = CC110X_PARAM_GDO1, \
+ .gdo2 = CC110X_PARAM_GDO2, \
+}
#endif
/** @} */
diff --git a/drivers/cc2420/cc2420_getset.c b/drivers/cc2420/cc2420_getset.c
index caac8114a..c9d4b83bb 100644
--- a/drivers/cc2420/cc2420_getset.c
+++ b/drivers/cc2420/cc2420_getset.c
@@ -40,8 +40,8 @@
* datasheet in section 28, page 51).
*/
static const uint8_t power_dbm_to_pa[26] = {
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7,
- 7, 7, 11, 11, 11, 15, 15, 19, 19, 23, 23, 27, 31
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7,
+ 7, 7, 11, 11, 11, 15, 15, 19, 19, 23, 23, 27, 31
};
/**
diff --git a/drivers/cc2420/include/cc2420_internal.h b/drivers/cc2420/include/cc2420_internal.h
index 3fc61813d..0500960db 100644
--- a/drivers/cc2420/include/cc2420_internal.h
+++ b/drivers/cc2420/include/cc2420_internal.h
@@ -9,19 +9,19 @@
*/
/**
- * @ingroup drivers_cc2420
- * @{
- *
- * @file
- * @brief Definitions and settings for the cc2420
- *
- * @author Milan Babel <babel@inf.fu-berlin.de>
- * @author Kévin Roussel <Kevin.Roussel@inria.fr>
- * @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
- * @author Hauke Petersen <hauke.petersen@fu-berlin.de>
- * @author Francisco Acosta <francisco.acosta@inria.fr>
- *
- */
+ * @ingroup drivers_cc2420
+ * @{
+ *
+ * @file
+ * @brief Definitions and settings for the cc2420
+ *
+ * @author Milan Babel <babel@inf.fu-berlin.de>
+ * @author Kévin Roussel <Kevin.Roussel@inria.fr>
+ * @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
+ * @author Hauke Petersen <hauke.petersen@fu-berlin.de>
+ * @author Francisco Acosta <francisco.acosta@inria.fr>
+ *
+ */
#ifndef CC2420_INTERNAL_H
#define CC2420_INTERNAL_H
diff --git a/drivers/ds1307/ds1307.c b/drivers/ds1307/ds1307.c
index 3141d8ae1..69991fdf7 100644
--- a/drivers/ds1307/ds1307.c
+++ b/drivers/ds1307/ds1307.c
@@ -117,7 +117,7 @@ int ds1307_get_time(const ds1307_t *dev, struct tm *time)
i2c_acquire(dev->i2c);
res = i2c_read_regs(dev->i2c, DS1307_I2C_ADDRESS, DS1307_REG_SEC, regs,
- sizeof(regs));
+ sizeof(regs));
DEBUG("ds1307: read bytes %02x %02x %02x %02x %02x %02x %02x from device (result: %i)\n",
regs[DS1307_REG_SEC], regs[DS1307_REG_MIN], regs[DS1307_REG_HOUR],
regs[DS1307_REG_DOW], regs[DS1307_REG_DOM], regs[DS1307_REG_MON],
@@ -134,7 +134,7 @@ int ds1307_get_time(const ds1307_t *dev, struct tm *time)
DS1307_DOW_OFFSET);
time->tm_mday = bcd_to_byte(regs[DS1307_REG_DOM] & DS1307_REG_DOM_MASK);
time->tm_mon = bcd_to_byte(regs[DS1307_REG_MON] & DS1307_REG_MON_MASK) -
- DS1307_MON_OFFSET;
+ DS1307_MON_OFFSET;
time->tm_year = (bcd_to_byte(regs[DS1307_REG_YEAR]) - DS1307_YEAR_OFFSET);
return 0;
}
diff --git a/drivers/dsp0401/dsp0401.c b/drivers/dsp0401/dsp0401.c
index d5e501f0c..9f7a2a1f9 100644
--- a/drivers/dsp0401/dsp0401.c
+++ b/drivers/dsp0401/dsp0401.c
@@ -45,7 +45,7 @@
#define CHAR_MAP_MAX (127U)
static const uint8_t dsp0401_charmap[][2] = {
- /* dec: char */
+ /* dec: char */
{ 0x00, 0x00 }, /* 30: */
{ 0x00, 0x00 }, /* 31: */
{ 0x00, 0x00 }, /* 32: ' ' */
@@ -153,7 +153,7 @@ static void _shift_char(const dsp0401_t *dev, uint8_t c)
c = ' ';
}
- for (unsigned p = 0 ; p < 2 ; ++p) {
+ for (unsigned p = 0; p < 2; ++p) {
for (unsigned i = 0; i < 8; ++i) {
gpio_write(SDI, !!(dsp0401_charmap[c - CHAR_MAP_MIN][p] & (1 << (7 - i))));
gpio_set(SCK);
@@ -211,9 +211,9 @@ int dsp0401_init(dsp0401_t *dev, const dsp0401_params_t *params)
void dsp0401_display_text(const dsp0401_t *dev, char *text)
{
unsigned text_len = strlen(text);
- for (unsigned i = 0 ; i < MOD_COUNT * 4; ++i) {
+ for (unsigned i = 0; i < MOD_COUNT * 4; ++i) {
if (i < text_len) {
- _shift_char(dev, text[i]);
+ _shift_char(dev, text[i]);
} else {
_shift_char(dev, ' ');
}
diff --git a/drivers/dynamixel/include/dynamixel_reader.h b/drivers/dynamixel/include/dynamixel_reader.h
index ee61d7da5..9adb6a85b 100644
--- a/drivers/dynamixel/include/dynamixel_reader.h
+++ b/drivers/dynamixel/include/dynamixel_reader.h
@@ -100,8 +100,8 @@ static inline uint8_t dynamixel_reader_get_instr(const dynamixel_reader_t *reade
static inline uint16_t dynamixel_reader_get_length(const dynamixel_reader_t *reader)
{
return
- (((uint16_t)reader->buffer[5]) & 0xFF) |
- ((((uint16_t)reader->buffer[6]) & 0xFF) << 8);
+ (((uint16_t)reader->buffer[5]) & 0xFF) |
+ ((((uint16_t)reader->buffer[6]) & 0xFF) << 8);
}
/**
@@ -114,8 +114,8 @@ static inline uint16_t dynamixel_reader_get_length(const dynamixel_reader_t *rea
static inline uint16_t dynamixel_reader_get_crc(const dynamixel_reader_t *reader)
{
return
- (((uint16_t)reader->buffer[reader->size - 2]) & 0xFF) |
- ((((uint16_t)reader->buffer[reader->size - 1]) & 0xFF) << 8);
+ (((uint16_t)reader->buffer[reader->size - 2]) & 0xFF) |
+ ((((uint16_t)reader->buffer[reader->size - 1]) & 0xFF) << 8);
}
/**
diff --git a/drivers/dynamixel/reader.c b/drivers/dynamixel/reader.c
index 5c4ee8171..375451775 100644
--- a/drivers/dynamixel/reader.c
+++ b/drivers/dynamixel/reader.c
@@ -29,9 +29,9 @@ static inline bool dynamixel_reader_check_minsize(const dynamixel_reader_t *read
static inline bool dynamixel_reader_check_start(const dynamixel_reader_t *reader)
{
return
- reader->buffer[0] == DXL_HEADER[0] &&
- reader->buffer[1] == DXL_HEADER[1] &&
- reader->buffer[2] == DXL_HEADER[2];
+ reader->buffer[0] == DXL_HEADER[0] &&
+ reader->buffer[1] == DXL_HEADER[1] &&
+ reader->buffer[2] == DXL_HEADER[2];
}
static inline bool dynamixel_reader_check_size(const dynamixel_reader_t *reader)
@@ -47,8 +47,8 @@ static inline bool dynamixel_reader_check_sum(const dynamixel_reader_t *reader)
bool dynamixel_reader_is_valid(const dynamixel_reader_t *reader)
{
return
- dynamixel_reader_check_minsize(reader) &&
- dynamixel_reader_check_start(reader) &&
- dynamixel_reader_check_size(reader) &&
- dynamixel_reader_check_sum(reader);
+ dynamixel_reader_check_minsize(reader) &&
+ dynamixel_reader_check_start(reader) &&
+ dynamixel_reader_check_size(reader) &&
+ dynamixel_reader_check_sum(reader);
}
diff --git a/drivers/enc28j60/include/enc28j60_params.h b/drivers/enc28j60/include/enc28j60_params.h
index eb82efe77..1ef1f9585 100644
--- a/drivers/enc28j60/include/enc28j60_params.h
+++ b/drivers/enc28j60/include/enc28j60_params.h
@@ -53,7 +53,7 @@ extern "C" {
/**
* @brief ENC28J60 configuration
*/
-static const enc28j60_params_t enc28j60_params[] = {
+static const enc28j60_params_t enc28j60_params[] = {
ENC28J60_PARAMS
};
/** @} */
diff --git a/drivers/encx24j600/encx24j600.c b/drivers/encx24j600/encx24j600.c
index 4f8cd3818..b9119b300 100644
--- a/drivers/encx24j600/encx24j600.c
+++ b/drivers/encx24j600/encx24j600.c
@@ -123,8 +123,8 @@ static void _isr(netdev_t *netdev)
uint16_t estat = reg_get(dev, ENC_ESTAT);
netdev_event_t event = (estat & ENC_PHYLNK) ?
- NETDEV_EVENT_LINK_DOWN :
- NETDEV_EVENT_LINK_UP;
+ NETDEV_EVENT_LINK_DOWN :
+ NETDEV_EVENT_LINK_UP;
netdev->event_callback(netdev, event);
}
diff --git a/drivers/ethos/ethos.c b/drivers/ethos/ethos.c
index 511eec286..064560446 100644
--- a/drivers/ethos/ethos.c
+++ b/drivers/ethos/ethos.c
@@ -90,7 +90,7 @@ static void _handle_char(ethos_t *dev, char c)
case ETHOS_FRAME_TYPE_DATA:
case ETHOS_FRAME_TYPE_HELLO:
case ETHOS_FRAME_TYPE_HELLO_REPLY:
- if (tsrb_add_one(&dev->inbuf, c) == 0) {
+ if (tsrb_add_one(&dev->inbuf, c) == 0) {
dev->framesize++;
} else {
//puts("lost frame");
@@ -118,7 +118,7 @@ static void _end_of_frame(ethos_t *dev)
break;
case ETHOS_FRAME_TYPE_HELLO:
ethos_send_frame(dev, dev->mac_addr, 6, ETHOS_FRAME_TYPE_HELLO_REPLY);
- /* fall through */
+ /* fall through */
case ETHOS_FRAME_TYPE_HELLO_REPLY:
if (dev->framesize == 6) {
tsrb_get(&dev->inbuf, (char*)dev->remote_mac_addr, 6);
diff --git a/drivers/feetech/include/feetech_reader.h b/drivers/feetech/include/feetech_reader.h
index ac62bf5d0..d4ca8361c 100644
--- a/drivers/feetech/include/feetech_reader.h
+++ b/drivers/feetech/include/feetech_reader.h
@@ -88,8 +88,8 @@ static inline bool feetech_reader_check_minsize(const feetech_reader_t *reader)
static inline bool feetech_reader_check_start(const feetech_reader_t *reader)
{
return
- reader->buffer[0] == FEETECH_START &&
- reader->buffer[1] == FEETECH_START;
+ reader->buffer[0] == FEETECH_START &&
+ reader->buffer[1] == FEETECH_START;
}
/**
diff --git a/drivers/feetech/reader.c b/drivers/feetech/reader.c
index 62950aa0c..6558abf06 100644
--- a/drivers/feetech/reader.c
+++ b/drivers/feetech/reader.c
@@ -23,7 +23,7 @@
static uint8_t _compute_sum(const feetech_reader_t *reader)
{
uint8_t sum = 0;
- for (size_t i = 2 ; i < reader->size-1 ; i++) {
+ for (size_t i = 2; i < reader->size-1; i++) {
sum += reader->buffer[i];
}
return sum;
@@ -37,10 +37,10 @@ uint8_t feetech_reader_compute_sum(const feetech_reader_t *reader)
bool feetech_reader_is_valid(const feetech_reader_t *reader)
{
return
- feetech_reader_check_minsize(reader) &&
- feetech_reader_check_start(reader) &&
- feetech_reader_check_size(reader) &&
- feetech_reader_check_sum(reader);
+ feetech_reader_check_minsize(reader) &&
+ feetech_reader_check_start(reader) &&
+ feetech_reader_check_size(reader) &&
+ feetech_reader_check_sum(reader);
}
size_t feetech_reader_sync_write_get_items_count(const feetech_reader_t *reader)
diff --git a/drivers/feetech/writer.c b/drivers/feetech/writer.c
index c8b14db8e..02cdb7cde 100644
--- a/drivers/feetech/writer.c
+++ b/drivers/feetech/writer.c
@@ -51,7 +51,7 @@ void feetech_writer_response_make(feetech_writer_t *writer, uint8_t id, const ui
sum += writer->buffer[3] = len;
sum += writer->buffer[4] = 0;
- for (size_t i = 0 ; i < size ; i++) {
+ for (size_t i = 0; i < size; i++) {
sum += writer->buffer[5 + i] = buffer[i];
}
@@ -167,7 +167,7 @@ void feetech_writer_write_make(feetech_writer_t *writer, uint8_t id, uint8_t reg
sum += writer->buffer[4] = INST_WRITE;
sum += writer->buffer[5] = reg;
- for (size_t i = 0 ; i < size ; i++) {
+ for (size_t i = 0; i < size; i++) {
sum += writer->buffer[6 + i] = buffer[i];
}
@@ -225,7 +225,7 @@ void feetech_writer_sync_write_add(feetech_writer_t *writer, uint8_t id, const u
uint8_t sum = ~writer->buffer[writer->size - 1];
sum += writer->buffer[writer->size - 1] = id;
- for (size_t i = 0 ; i < size ; i++) {
+ for (size_t i = 0; i < size; i++) {
sum += writer->buffer[writer->size + i] = buffer[i];
}
diff --git a/drivers/fxos8700/include/fxos8700_params.h b/drivers/fxos8700/include/fxos8700_params.h
index 2ceed7423..fbab62bf6 100644
--- a/drivers/fxos8700/include/fxos8700_params.h
+++ b/drivers/fxos8700/include/fxos8700_params.h
@@ -49,8 +49,8 @@ extern "C" {
#endif
#ifndef FXOS8700_PARAMS
-#define FXOS8700_PARAMS { .i2c = FXOS8700_PARAM_I2C, \
- .addr = FXOS8700_PARAM_ADDR, \
+#define FXOS8700_PARAMS { .i2c = FXOS8700_PARAM_I2C, \
+ .addr = FXOS8700_PARAM_ADDR, \
.acc_range = FXOS8700_PARAM_ACC_RANGE, \
.renew_interval = FXOS8700_PARAM_RENEW_INTERVAL }
#endif
diff --git a/drivers/hd44780/hd44780.c b/drivers/hd44780/hd44780.c
index ffe58ad52..4352d9214 100644
--- a/drivers/hd44780/hd44780.c
+++ b/drivers/hd44780/hd44780.c
@@ -104,7 +104,7 @@ int hd44780_init(hd44780_t *dev, const hd44780_params_t *params)
memcpy(&dev->p, params, sizeof(hd44780_params_t));
/* verify cols and rows */
if ((dev->p.cols > HD44780_MAX_COLS) || (dev->p.rows > HD44780_MAX_ROWS)
- || (dev->p.rows * dev->p.cols > 80)) {
+ || (dev->p.rows * dev->p.cols > 80)) {
LOG_ERROR("hd44780_init: invalid LCD size!\n");
return -1;
}
diff --git a/drivers/hih6130/hih6130.c b/drivers/hih6130/hih6130.c
index 2175e6500..a790d6126 100644
--- a/drivers/hih6130/hih6130.c
+++ b/drivers/hih6130/hih6130.c
@@ -110,7 +110,7 @@ static inline int hih6130_get_humidity_temperature_raw(const hih6130_t *dev, uin
}
int hih6130_get_humidity_temperature_float(const hih6130_t *dev,
- float *relative_humidity_percent, float *temperature_celsius)
+ float *relative_humidity_percent, float *temperature_celsius)
{
uint16_t hum_raw, temp_raw;
int status;
diff --git a/drivers/hts221/include/hts221_params.h b/drivers/hts221/include/hts221_params.h
index d4d7ab808..df281dc9e 100644
--- a/drivers/hts221/include/hts221_params.h
+++ b/drivers/hts221/include/hts221_params.h
@@ -46,7 +46,7 @@ extern "C" {
#define HTS221_PARAM_RATE (HTS221_REGS_CTRL_REG1_ODR_12HZ)
#endif
#ifndef HTS221_PARAMS
-#define HTS221_PARAMS { .i2c = HTS221_PARAM_I2C, \
+#define HTS221_PARAMS { .i2c = HTS221_PARAM_I2C, \
.addr = HTS221_PARAM_ADDR, \
.avgx = HTS221_PARAM_AVGX, \
.rate = HTS221_PARAM_RATE }
diff --git a/drivers/ina220/include/ina220-regs.h b/drivers/ina220/include/ina220-regs.h
index b9cbab740..a2d15bd0f 100644
--- a/drivers/ina220/include/ina220-regs.h
+++ b/drivers/ina220/include/ina220-regs.h
@@ -23,7 +23,7 @@
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
diff --git a/drivers/include/at30tse75x.h b/drivers/include/at30tse75x.h
index 16cb770fa..238f4c82b 100644
--- a/drivers/include/at30tse75x.h
+++ b/drivers/include/at30tse75x.h
@@ -101,13 +101,13 @@ extern "C" {
/** @} */
/**
- * @name AT30TSE75x configuration types
- * @{
- */
+ * @name AT30TSE75x configuration types
+ * @{
+ */
/**
- * @brief Temperature resolution
- */
+ * @brief Temperature resolution
+ */
typedef enum {
AT30TSE75X_RESOLUTION_9BIT = 0,
AT30TSE75X_RESOLUTION_10BIT = 1,
@@ -116,13 +116,13 @@ typedef enum {
} at30tse75x_resolution_t;
/**
- * @brief Operation mode
- *
- * The device can run in continous or one-shot mode. While in one-shot mode it
- * is effectively shutdown and only wakes up to perform a single measurement.
- * When in comparator or interrupt mode, the device samples contiously the
- * temperature and sets the ALERT pin according to the chosen mode.
- */
+ * @brief Operation mode
+ *
+ * The device can run in continous or one-shot mode. While in one-shot mode it
+ * is effectively shutdown and only wakes up to perform a single measurement.
+ * When in comparator or interrupt mode, the device samples contiously the
+ * temperature and sets the ALERT pin according to the chosen mode.
+ */
typedef enum {
AT30TSE75X_MODE_COMPARATOR,
AT30TSE75X_MODE_INTERRUPT,
@@ -130,8 +130,8 @@ typedef enum {
} at30tse75x_mode_t;
/**
- * @brief After how many limit exceeding measurements the ALERT pin is set
- */
+ * @brief After how many limit exceeding measurements the ALERT pin is set
+ */
typedef enum {
AT30TSE75X_ALARM_AFTER_1 = 0,
AT30TSE75X_ALARM_AFTER_2 = 1,
@@ -140,8 +140,8 @@ typedef enum {
} at30tse75x_fault_tolerance_t;
/**
- * @brief Polarity of the ALERT pin
- */
+ * @brief Polarity of the ALERT pin
+ */
typedef enum {
AT30TSE75X_ALARM_ACTIVE_LOW,
AT30TSE75X_ALARM_ACTIVE_HIGH
@@ -150,8 +150,8 @@ typedef enum {
/** @} */ /* AT30TSE75x configuration types */
/**
- * @brief Device descriptor for a AT30TSE75x device
- */
+ * @brief Device descriptor for a AT30TSE75x device
+ */
typedef struct {
i2c_t i2c; /**< I2C device that sensor is connected to */
uint8_t addr; /**< I2C address of this particular sensor */
diff --git a/drivers/include/bmp180.h b/drivers/include/bmp180.h
index 7c9bc929a..7b99b61cb 100644
--- a/drivers/include/bmp180.h
+++ b/drivers/include/bmp180.h
@@ -68,7 +68,7 @@ typedef struct {
* @brief Device descriptor for the BMP180 sensor
*/
typedef struct {
- bmp180_params_t params; /**< Device initialization parameters */
+ bmp180_params_t params; /**< Device initialization parameters */
bmp180_calibration_t calibration; /**< Device calibration */
} bmp180_t;
diff --git a/drivers/include/bmx055.h b/drivers/include/bmx055.h
index 3471703f3..3c80fb6ab 100644
--- a/drivers/include/bmx055.h
+++ b/drivers/include/bmx055.h
@@ -135,7 +135,7 @@ int bmx055_init(bmx055_t *dev, const bmx055_params_t *params);
*/
int bmx055_mag_read(const bmx055_t *dev, int16_t *data);
- /**
+/**
* @brief Read acceleration value in g from accelerometer
*
* @param[in] dev device descriptor of accelerometer
diff --git a/drivers/include/cc2420.h b/drivers/include/cc2420.h
index b8d217672..feffa0ef9 100644
--- a/drivers/include/cc2420.h
+++ b/drivers/include/cc2420.h
@@ -44,9 +44,9 @@ extern "C" {
#define CC2420_PANID_DEFAULT (IEEE802154_DEFAULT_PANID)
/**
- * @name Channel configuration
- * @{
- */
+ * @name Channel configuration
+ * @{
+ */
#define CC2420_CHAN_MIN (IEEE802154_CHANNEL_MIN)
#define CC2420_CHAN_MAX (IEEE802154_CHANNEL_MAX)
#define CC2420_CHAN_DEFAULT (IEEE802154_DEFAULT_CHANNEL)
diff --git a/drivers/include/grove_ledbar.h b/drivers/include/grove_ledbar.h
index a28d97a83..61bec4998 100644
--- a/drivers/include/grove_ledbar.h
+++ b/drivers/include/grove_ledbar.h
@@ -38,7 +38,7 @@ extern "C" {
/** @} */
/**
- * @brief Maximum value for ledbar level
+ * @brief Maximum value for ledbar level
*/
#define GROVE_LEDBAR_MAX UINT8_MAX
@@ -53,7 +53,7 @@ typedef my9221_params_t grove_ledbar_params_t;
typedef my9221_t grove_ledbar_t;
/**
- * @brief Initialize the given driver
+ * @brief Initialize the given driver
*
* @pre `dev != NULL` and `params != NULL`
*
@@ -65,7 +65,7 @@ typedef my9221_t grove_ledbar_t;
int grove_ledbar_init(grove_ledbar_t *dev, const grove_ledbar_params_t *params);
/**
- * @brief Set overall (brightness) level distributed over all LEDs
+ * @brief Set overall (brightness) level distributed over all LEDs
*
* @pre `dev != NULL`
*
@@ -75,7 +75,7 @@ int grove_ledbar_init(grove_ledbar_t *dev, const grove_ledbar_params_t *params);
void grove_ledbar_set(grove_ledbar_t *dev, uint8_t level);
/**
- * @brief Clear ledbar, i.e. set all LEDs off
+ * @brief Clear ledbar, i.e. set all LEDs off
*
* @pre `dev != NULL`
*
diff --git a/drivers/include/hih6130.h b/drivers/include/hih6130.h
index f3ae2b3bc..b46b5b48f 100644
--- a/drivers/include/hih6130.h
+++ b/drivers/include/hih6130.h
@@ -60,7 +60,7 @@ void hih6130_init(hih6130_t *dev, i2c_t i2c, uint8_t address);
* @return 1 if data is stale
*/
int hih6130_get_humidity_temperature_float(const hih6130_t *dev,
- float *relative_humidity_percent, float *temperature_celsius);
+ float *relative_humidity_percent, float *temperature_celsius);
#ifdef __cplusplus
}
diff --git a/drivers/include/isl29020.h b/drivers/include/isl29020.h
index f17a2c0aa..90128595e 100644
--- a/drivers/include/isl29020.h
+++ b/drivers/include/isl29020.h
@@ -28,9 +28,9 @@
extern "C" {
#endif
- /**
- * @brief The sensors default I2C address
- */
+/**
+ * @brief The sensors default I2C address
+ */
#define ISL29020_DEFAULT_ADDRESS 0x44
/**
diff --git a/drivers/include/isl29125.h b/drivers/include/isl29125.h
index 48d585d9d..f8dbc40d0 100644
--- a/drivers/include/isl29125.h
+++ b/drivers/include/isl29125.h
@@ -183,7 +183,7 @@ int isl29125_init_int(isl29125_t *dev, isl29125_interrupt_status_t interrupt_sta
*/
void isl29125_read_rgb_lux(const isl29125_t *dev, isl29125_rgb_t *dest);
- /**
+/**
* @brief Read color values from device
*
* @param[in] dev device descriptor of an ISL29125 device
diff --git a/drivers/include/jc42.h b/drivers/include/jc42.h
index 6f103a71c..9a358d015 100644
--- a/drivers/include/jc42.h
+++ b/drivers/include/jc42.h
@@ -50,8 +50,8 @@ extern "C" {
/**
- * @brief Device descriptor for a jc42 device
- */
+ * @brief Device descriptor for a jc42 device
+ */
typedef struct {
i2c_t i2c; /**< I2C device that sensor is connected to */
uint8_t addr; /**< I2C address of this particular sensor */
@@ -61,7 +61,7 @@ typedef struct {
* @brief Device initialization parameters
*/
typedef struct {
- i2c_t i2c; /**< I2C device that sensor is connected to */
+ i2c_t i2c; /**< I2C device that sensor is connected to */
i2c_speed_t speed; /**< I2C device speed */
uint8_t addr; /**< Configured address of the sensor */
} jc42_params_t;
diff --git a/drivers/include/kw2xrf.h b/drivers/include/kw2xrf.h
index 5baa07462..9ee4b137c 100644
--- a/drivers/include/kw2xrf.h
+++ b/drivers/include/kw2xrf.h
@@ -95,18 +95,18 @@ extern "C" {
#define KW2XRF_OPT_AUTOCCA (0x0100) /**< CCA befor TX active */
#define KW2XRF_OPT_PROMISCUOUS (0x0200) /**< promiscuous mode
- * active */
+ * active */
#define KW2XRF_OPT_PRELOADING (0x0400) /**< preloading enabled */
#define KW2XRF_OPT_TELL_TX_START (0x0800) /**< notify MAC layer on TX
- * start */
+ * start */
#define KW2XRF_OPT_TELL_TX_END (0x1000) /**< notify MAC layer on TX
- * finished */
+ * finished */
#define KW2XRF_OPT_TELL_RX_START (0x2000) /**< notify MAC layer on RX
- * start */
+ * start */
#define KW2XRF_OPT_TELL_RX_END (0x4000) /**< notify MAC layer on RX
- * finished */
+ * finished */
#define KW2XRF_OPT_AUTOACK (0x8000) /**< enable automatically ACK
- * for incommint packet */
+ * for incommint packet */
/** @} */
/**
diff --git a/drivers/include/l3g4200d.h b/drivers/include/l3g4200d.h
index d8cbf8941..d79ab1b28 100644
--- a/drivers/include/l3g4200d.h
+++ b/drivers/include/l3g4200d.h
@@ -29,7 +29,7 @@
#include "periph/gpio.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/drivers/include/led.h b/drivers/include/led.h
index 5dcdffa6c..2b821f71c 100644
--- a/drivers/include/led.h
+++ b/drivers/include/led.h
@@ -95,9 +95,9 @@ extern "C" {
* @name Convenience LED control macros
* @{
*/
-#define LED_ON(x) LED ## x ##_ON /**< Turn on led x */
+#define LED_ON(x) LED ## x ## _ON /**< Turn on led x */
#define LED_OFF(x) LED ## x ## _OFF /**< Turn off led x */
-#define LED_TOGGLE(x) LED ## x ##_TOGGLE /**< Toggle led x */
+#define LED_TOGGLE(x) LED ## x ## _TOGGLE /**< Toggle led x */
/** @} */
#ifdef __cplusplus
diff --git a/drivers/include/lps331ap.h b/drivers/include/lps331ap.h
index b977bb70d..2516fac15 100644
--- a/drivers/include/lps331ap.h
+++ b/drivers/include/lps331ap.h
@@ -30,9 +30,9 @@ extern "C" {
#include <stdint.h>
#include "periph/i2c.h"
- /**
- * @brief The sensors default I2C address
- */
+/**
+ * @brief The sensors default I2C address
+ */
#define LPS331AP_DEFAULT_ADDRESS (0x5c)
/**
diff --git a/drivers/include/lsm303dlhc.h b/drivers/include/lsm303dlhc.h
index 4281f51b9..c19843d83 100644
--- a/drivers/include/lsm303dlhc.h
+++ b/drivers/include/lsm303dlhc.h
@@ -80,7 +80,7 @@ typedef enum {
/**
* @brief Possible magnetometer gain values
*/
- typedef enum {
+typedef enum {
LSM303DLHC_MAG_GAIN_1100_980_GAUSS = 0x20, /**< 1100Gauss XYZ 980Gauss Z */
LSM303DLHC_MAG_GAIN_855_760_GAUSS = 0x40, /**< 855Gauss XYZ 760Gauss Z */
LSM303DLHC_MAG_GAIN_670_600_GAUSS = 0x60, /**< 670Gauss XYZ 600Gauss Z */
@@ -88,7 +88,7 @@ typedef enum {
LSM303DLHC_MAG_GAIN_400_355_GAUSS = 0xa0, /**< 400Gauss XYZ 355Gauss Z */
LSM303DLHC_MAG_GAIN_330_295_GAUSS = 0xc0, /**< 330Gauss XYZ 295Gauss Z */
LSM303DLHC_MAG_GAIN_230_205_GAUSS = 0xe0, /**< 230Gauss XYZ 205Gauss Z */
- } lsm303dlhc_mag_gain_t;
+} lsm303dlhc_mag_gain_t;
/**
* @brief 3d data container
@@ -106,8 +106,8 @@ typedef struct {
i2c_t i2c; /**< I2C device */
uint8_t acc_address; /**< accelerometer's I2C address */
uint8_t mag_address; /**< magnetometer's I2C address */
- gpio_t acc_pin; /**< accelerometer's data ready pin */
- gpio_t mag_pin; /**< magnetometer's data ready pin */
+ gpio_t acc_pin; /**< accelerometer's data ready pin */
+ gpio_t mag_pin; /**< magnetometer's data ready pin */
lsm303dlhc_acc_scale_t acc_scale; /**< accelerometer scale factor */
lsm303dlhc_mag_gain_t mag_gain; /**< magnetometer gain */
} lsm303dlhc_t;
@@ -233,4 +233,4 @@ int lsm303dlhc_disable(const lsm303dlhc_t *dev);
#endif
#endif /* LSM303DLHC_H */
- /** @} */
+/** @} */
diff --git a/drivers/include/my9221.h b/drivers/include/my9221.h
index 1cf72ca03..92c070939 100644
--- a/drivers/include/my9221.h
+++ b/drivers/include/my9221.h
@@ -102,7 +102,7 @@ int my9221_init(my9221_t *dev, const my9221_params_t *params);
* @param[in] state new device state array
* @param[in] len length of state array
*/
-void my9221_set_state(my9221_t *dev, const uint8_t *state, uint8_t len);
+void my9221_set_state(my9221_t *dev, const uint8_t *state, uint8_t len);
/**
* @brief Set brightness of distinct LED
diff --git a/drivers/include/nrf24l01p.h b/drivers/include/nrf24l01p.h
index 56fe84535..e8368b142 100644
--- a/drivers/include/nrf24l01p.h
+++ b/drivers/include/nrf24l01p.h
@@ -120,507 +120,507 @@ typedef enum {
*/
typedef enum {
RCV_PKT_NRF24L01P = 0, /**< transceiver received data */
-} nrf24l01p_rx_event_t ;
+} nrf24l01p_rx_event_t;
/**
-* @brief Read one register of the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] reg Register address to read from.
-* @param[in] answer Byte to read.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Read one register of the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] reg Register address to read from.
+ * @param[in] answer Byte to read.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_read_reg(const nrf24l01p_t *dev, char reg, char *answer);
/**
-* @brief Write one register to the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] reg Register address to write to.
-* @param[in] write Byte to write.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Write one register to the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] reg Register address to write to.
+ * @param[in] write Byte to write.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_write_reg(const nrf24l01p_t *dev, char reg, char write);
/**
-* @brief Initialize the nrf24l01+ transceiver.
-*
-* @ note
-* This function initializes the transceiver so that it is ready to use.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] spi SPI device to use.
-* @param[in] ce GPIO pin to use for chip enable.
-* @param[in] csn GPIO pin to use for chip select.
-* @param[in] irq GPIO pin to use for interrupt request.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Initialize the nrf24l01+ transceiver.
+ *
+ * @ note
+ * This function initializes the transceiver so that it is ready to use.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] spi SPI device to use.
+ * @param[in] ce GPIO pin to use for chip enable.
+ * @param[in] csn GPIO pin to use for chip select.
+ * @param[in] irq GPIO pin to use for interrupt request.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_init(nrf24l01p_t *dev, spi_t spi, gpio_t ce, gpio_t csn, gpio_t irq);
/**
-* @brief Power on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Power on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_on(const nrf24l01p_t *dev);
/**
-* @brief Power off the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Power off the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_off(const nrf24l01p_t *dev);
/**
-* @brief Transmit payload laying in TX FIFO of the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-*/
+ * @brief Transmit payload laying in TX FIFO of the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ */
void nrf24l01p_transmit(const nrf24l01p_t *dev);
/**
-* @brief Read payload from RX FIFO of the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] answer Buffer to receive bytes to.
-* @param[in] size Number of bytes to transfer. For nrf24l01+ in general 32.
-*
-* @return Number of bytes that were transfered.
-* @return -1 on error.
-*/
+ * @brief Read payload from RX FIFO of the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] answer Buffer to receive bytes to.
+ * @param[in] size Number of bytes to transfer. For nrf24l01+ in general 32.
+ *
+ * @return Number of bytes that were transfered.
+ * @return -1 on error.
+ */
int nrf24l01p_read_payload(const nrf24l01p_t *dev, char *answer, unsigned int size);
/**
-* @brief Register a given ID to the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pid ID to register.
-*
-*/
+ * @brief Register a given ID to the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pid ID to register.
+ *
+ */
void nrf24l01p_register(nrf24l01p_t *dev, unsigned int *pid);
/**
-* @brief Enable dynamic payload for the pipe on give nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pipe RX pipe for which dynamic payload is enabled
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Enable dynamic payload for the pipe on give nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pipe RX pipe for which dynamic payload is enabled
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_enable_dynamic_payload(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe);
/**
-* @brief Enable dynamic ack for the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Enable dynamic ack for the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_enable_dynamic_ack(const nrf24l01p_t *dev);
/**
-* @brief Unregister the nrf24l01+ transceiver from his ID.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pid Actual ID to unregister.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Unregister the nrf24l01+ transceiver from his ID.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pid Actual ID to unregister.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_unregister(nrf24l01p_t *dev, unsigned int pid);
/**
-* @brief Get ID from the nrf24l01p transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pid Transceiver ID.
-*
-*/
+ * @brief Get ID from the nrf24l01p transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pid Transceiver ID.
+ *
+ */
void nrf24l01p_get_id(const nrf24l01p_t *dev, unsigned int *pid);
/**
-* @brief Start searching packets while in RX mode.
-*
-* @param[in] dev Transceiver device to use.
-*
-*/
+ * @brief Start searching packets while in RX mode.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ */
void nrf24l01p_start(const nrf24l01p_t *dev);
/**
-* @brief Stop searching packets while in RX mode.
-*
-* @param[in] dev Transceiver device to use.
-*
-*/
+ * @brief Stop searching packets while in RX mode.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ */
void nrf24l01p_stop(const nrf24l01p_t *dev);
/**
-* @brief Preload TX FIFO with payload to transmit.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] data Buffer to preload.
-* @param[in] size Number of bytes in buffer. For nrf24l01+ e.g. 32
-*
-* @return Number of bytes that were transfered.
-* @return -1 on error.
-*/
+ * @brief Preload TX FIFO with payload to transmit.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] data Buffer to preload.
+ * @param[in] size Number of bytes in buffer. For nrf24l01+ e.g. 32
+ *
+ * @return Number of bytes that were transfered.
+ * @return -1 on error.
+ */
int nrf24l01p_preload(const nrf24l01p_t *dev, char *data, unsigned int size);
/**
-* @brief Set the RF channel for the nrf24l01+ transceiver.
-*
-* @note
-* To ensure non-overlapping channels in 2Mbps mode, don't use directly
-* neighbouring channels in this mode.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] chan Buffer to preload.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Set the RF channel for the nrf24l01+ transceiver.
+ *
+ * @note
+ * To ensure non-overlapping channels in 2Mbps mode, don't use directly
+ * neighbouring channels in this mode.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] chan Buffer to preload.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_channel(const nrf24l01p_t *dev, uint8_t chan);
/**
-* @brief Set the address width for the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] aw Address width (type nrf24l01p_aw_t).
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Set the address width for the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] aw Address width (type nrf24l01p_aw_t).
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_address_width(const nrf24l01p_t *dev, nrf24l01p_aw_t aw);
/**
-* @brief Set the RX payload width for the nrf24l01+ transceiver
-*
-* @ note
-* This function sets the payload width for one packet. If the maximum of 32 bytes is
-* exeeded, this value is set to 32.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pipe RX pipe to set the payload width.
-* @param[in] width Numer of bytes per packet in RX payload.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Set the RX payload width for the nrf24l01+ transceiver
+ *
+ * @ note
+ * This function sets the payload width for one packet. If the maximum of 32 bytes is
+ * exeeded, this value is set to 32.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pipe RX pipe to set the payload width.
+ * @param[in] width Numer of bytes per packet in RX payload.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_payload_width(const nrf24l01p_t *dev,
nrf24l01p_rx_pipe_t pipe, uint8_t width);
/**
-* @brief Set the TX address for the nrf24l01+ transceiver (byte array).
-*
-* @note
-* You can either use this function and give it a pointer to a byte array which
-* holds the address to set, or use "nrf24l01p_set_tx_address_long" which requires
-* a uint64_t which holds the address in the LSBs.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] saddr Byte array which holds the TX address.
-* @param[in] length Number of bytes in address array.
-*
-* @return Address length on success.
-* @return -1 on error.
-*/
+ * @brief Set the TX address for the nrf24l01+ transceiver (byte array).
+ *
+ * @note
+ * You can either use this function and give it a pointer to a byte array which
+ * holds the address to set, or use "nrf24l01p_set_tx_address_long" which requires
+ * a uint64_t which holds the address in the LSBs.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] saddr Byte array which holds the TX address.
+ * @param[in] length Number of bytes in address array.
+ *
+ * @return Address length on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_tx_address(const nrf24l01p_t *dev, const char *saddr, unsigned int length);
/**
-* @brief Set the TX address for the nrf24l01+ transceiver (long int).
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] saddr Long integer which holds the TX address in LSBs.
-* @param[in] length Number of relevant bytes in uint64_t.
-*
-* @return Address length on success.
-* @return -1 on error.
-*/
+ * @brief Set the TX address for the nrf24l01+ transceiver (long int).
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] saddr Long integer which holds the TX address in LSBs.
+ * @param[in] length Number of relevant bytes in uint64_t.
+ *
+ * @return Address length on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_tx_address_long(const nrf24l01p_t *dev, uint64_t saddr, unsigned int length);
/**
-* @brief Set the RX address for the nrf24l01+ transceiver (byte array).
-*
-* @note
-* You can either use this function and give it a pointer to a byte array which
-* holds the address to set, or use "nrf24l01p_set_rx_address_long" which requires
-* a uint64_t which holds the address in the LSBs.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pipe RX pipe to set the address.
-* @param[in] saddr Byte array which holds the RX address.
-* @param[in] length Number of bytes in address array.
-*
-* @return Address length on success.
-* @return -1 on error.
-*/
+ * @brief Set the RX address for the nrf24l01+ transceiver (byte array).
+ *
+ * @note
+ * You can either use this function and give it a pointer to a byte array which
+ * holds the address to set, or use "nrf24l01p_set_rx_address_long" which requires
+ * a uint64_t which holds the address in the LSBs.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pipe RX pipe to set the address.
+ * @param[in] saddr Byte array which holds the RX address.
+ * @param[in] length Number of bytes in address array.
+ *
+ * @return Address length on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_rx_address(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, const char *saddr, unsigned int length);
/**
-* @brief Set the RX address for the nrf24l01+ transceiver (long int).
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pipe RX pipe to set the address.
-* @param[in] saddr Long integer which holds the RX address in LSBs.
-* @param[in] length Number of relevant bytes in uint64_t.
-*
-* @return Address length on success.
-* @return -1 on error.
-*/
+ * @brief Set the RX address for the nrf24l01+ transceiver (long int).
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pipe RX pipe to set the address.
+ * @param[in] saddr Long integer which holds the RX address in LSBs.
+ * @param[in] length Number of relevant bytes in uint64_t.
+ *
+ * @return Address length on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_rx_address_long(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, uint64_t saddr, unsigned int length);
/**
-* @brief Get the TX address for the nrf24l01+ transceiver (long int).
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return TX address of the nrf24l01+ transceiver.
-* @return -1 on error.
-*/
+ * @brief Get the TX address for the nrf24l01+ transceiver (long int).
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return TX address of the nrf24l01+ transceiver.
+ * @return -1 on error.
+ */
uint64_t nrf24l01p_get_tx_address_long(const nrf24l01p_t *dev);
/**
-* @brief Get the RX address for the nrf24l01+ transceiver (long int).
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pipe RX pipe to get the address from.
-*
-* @return RX address of the nrf24l01+ transceiver.
-* @return -1 on error.
-*/
+ * @brief Get the RX address for the nrf24l01+ transceiver (long int).
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pipe RX pipe to get the address from.
+ *
+ * @return RX address of the nrf24l01+ transceiver.
+ * @return -1 on error.
+ */
uint64_t nrf24l01p_get_rx_address_long(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe);
/**
-* @brief Get the TX address for the nrf24l01+ transceiver (long int).
-*
-* @note
-* If you chose 2Mbps you should not allocate directly neighboring RF channels.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] dr Datarate (of type nrf24l01p_dr_t).
-*
-* @return 1 on success.
-* @return -1 on error.
-*/
+ * @brief Get the TX address for the nrf24l01+ transceiver (long int).
+ *
+ * @note
+ * If you chose 2Mbps you should not allocate directly neighboring RF channels.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] dr Datarate (of type nrf24l01p_dr_t).
+ *
+ * @return 1 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_datarate(const nrf24l01p_t *dev, nrf24l01p_dr_t dr);
/**
-* @brief Get the status (register) of the nrf24l01+ transceiver device.
-*
-* @param[in] dev Transceiver device to use.s of the.
-*
-* @return Value of the status register.
-*/
+ * @brief Get the status (register) of the nrf24l01+ transceiver device.
+ *
+ * @param[in] dev Transceiver device to use.s of the.
+ *
+ * @return Value of the status register.
+ */
int nrf24l01p_get_status(const nrf24l01p_t *dev);
/**
-* @brief Set the transmit power for the nrf24l01+ transceiver device.
-*
-* @note
-* This function rounds the input values to the nearest possible setting.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pwr TX power for the nrf24l01p transceiver.
-*
-* @return 1 on success.
-* @return -1 on error.
-*/
+ * @brief Set the transmit power for the nrf24l01+ transceiver device.
+ *
+ * @note
+ * This function rounds the input values to the nearest possible setting.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pwr TX power for the nrf24l01p transceiver.
+ *
+ * @return 1 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_power(const nrf24l01p_t *dev, int pwr);
/**
-* @brief Get the transmit power for the nrf24l01+ transceiver device.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return TX power value of the nrf24l01+ transceiver.
-*/
+ * @brief Get the transmit power for the nrf24l01+ transceiver device.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return TX power value of the nrf24l01+ transceiver.
+ */
int nrf24l01p_get_power(const nrf24l01p_t *dev);
/**
-* @brief Set the nrf24l01+ into TX mode.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Set the nrf24l01+ into TX mode.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_txmode(const nrf24l01p_t *dev);
/**
-* @brief Set the nrf24l01+ into RX mode.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Set the nrf24l01+ into RX mode.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_set_rxmode(const nrf24l01p_t *dev);
/**
-* @brief Reset all interrupts on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 1 on success.
-* @return -1 on error.
-*/
+ * @brief Reset all interrupts on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 1 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_reset_all_interrupts(const nrf24l01p_t *dev);
/**
-* @brief Reset interrupts on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] intrs Interrupt mask to reset
-*
-* @return 1 on success.
-* @return -1 on error.
-*/
+ * @brief Reset interrupts on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] intrs Interrupt mask to reset
+ *
+ * @return 1 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_reset_interrupts(const nrf24l01p_t *dev, char intrs);
/**
-* @brief Mask one interrupt on the nrf24l01+ transceiver.
-*
-* @note
-* There are three interrupts on the nrf24l01+ which can be masked:
-* "MASK_RX_DR", "MASK_TX_DS" and "MASK_MAX_RT". Theay are defined
-* in "include/nrf24l01p_settings.h".
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] intr Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Mask one interrupt on the nrf24l01+ transceiver.
+ *
+ * @note
+ * There are three interrupts on the nrf24l01+ which can be masked:
+ * "MASK_RX_DR", "MASK_TX_DS" and "MASK_MAX_RT". Theay are defined
+ * in "include/nrf24l01p_settings.h".
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] intr Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_mask_interrupt(const nrf24l01p_t *dev, char intr);
/**
-* @brief Unmask one interrupt on the nrf24l01+ transceiver.
-*
-* @note
-* There are three interrupts on the nrf24l01+ which can be unmasked:
-* "MASK_RX_DR", "MASK_TX_DS" and "MASK_MAX_RT". Theay are defined
-* in "include/nrf24l01p_settings.h".
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] intr Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Unmask one interrupt on the nrf24l01+ transceiver.
+ *
+ * @note
+ * There are three interrupts on the nrf24l01+ which can be unmasked:
+ * "MASK_RX_DR", "MASK_TX_DS" and "MASK_MAX_RT". Theay are defined
+ * in "include/nrf24l01p_settings.h".
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] intr Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_unmask_interrupt(const nrf24l01p_t *dev, char intr);
/**
-* @brief Enable RX datapipe on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pipe RX pipe to enable.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Enable RX datapipe on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pipe RX pipe to enable.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_enable_pipe(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe);
/**
-* @brief Disable RX datapipe on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pipe RX pipe to disable.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Disable RX datapipe on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pipe RX pipe to disable.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_disable_pipe(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe);
/**
-* @brief Disable CRC error detection on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0.
-*/
+ * @brief Disable CRC error detection on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0.
+ */
int nrf24l01p_disable_crc(const nrf24l01p_t *dev);
/**
-* @brief Enable CRC error detection on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] crc Length of cyclic redundancy check (type nrf24l01p_crc_t).
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Enable CRC error detection on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] crc Length of cyclic redundancy check (type nrf24l01p_crc_t).
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_enable_crc(const nrf24l01p_t *dev, nrf24l01p_crc_t crc);
/**
-* @brief Setup and enable automatic ACK and retransmission on the nrf24l01+ transceiver.
-*
-* @note
-* This function enables automatic acknowledgement for a given RX data pipe and also sets up the
-* mautomatic retransmission behavior.
-*
-* @param[in] dev Transceiver device to use.
-* @param[in] pipe RX pipe to setup auto ack.
-* @param[in] delay_retrans Automatic retransmission delay
+ * @brief Setup and enable automatic ACK and retransmission on the nrf24l01+ transceiver.
+ *
+ * @note
+ * This function enables automatic acknowledgement for a given RX data pipe and also sets up the
+ * mautomatic retransmission behavior.
+ *
+ * @param[in] dev Transceiver device to use.
+ * @param[in] pipe RX pipe to setup auto ack.
+ * @param[in] delay_retrans Automatic retransmission delay
(type nrf24l01p_retransmit_delay_t)
-* @param[in] count_retrans Auto retransmit count.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @param[in] count_retrans Auto retransmit count.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_setup_auto_ack(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, nrf24l01p_retransmit_delay_t delay_retrans, char count_retrans);
/**
-* @brief Disable automatic ACK on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Disable automatic ACK on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_disable_all_auto_ack(const nrf24l01p_t *dev);
/**
-* @brief Flush TX FIFO on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Flush TX FIFO on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_flush_tx_fifo(const nrf24l01p_t *dev);
/**
-* @brief Flush RX FIFO on the nrf24l01+ transceiver.
-*
-* @param[in] dev Transceiver device to use.
-*
-* @return 0 on success.
-* @return -1 on error.
-*/
+ * @brief Flush RX FIFO on the nrf24l01+ transceiver.
+ *
+ * @param[in] dev Transceiver device to use.
+ *
+ * @return 0 on success.
+ * @return -1 on error.
+ */
int nrf24l01p_flush_rx_fifo(const nrf24l01p_t *dev);
/**
-* @brief Callback that is called when interrupt occurs on interrupt
-* pin from the nrf24l01+ transceiver.
-*
-* @param[in] arg Used to pass transceiver device "dev".
-*/
+ * @brief Callback that is called when interrupt occurs on interrupt
+ * pin from the nrf24l01+ transceiver.
+ *
+ * @param[in] arg Used to pass transceiver device "dev".
+ */
void nrf24l01p_rx_cb(void *arg);
#ifdef __cplusplus
diff --git a/drivers/include/pcd8544.h b/drivers/include/pcd8544.h
index d8733d738..b9bf29f43 100644
--- a/drivers/include/pcd8544.h
+++ b/drivers/include/pcd8544.h
@@ -28,7 +28,7 @@
#include "periph/spi.h"
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/drivers/include/periph/gpio.h b/drivers/include/periph/gpio.h
index 46c03ebc8..881faa96e 100644
--- a/drivers/include/periph/gpio.h
+++ b/drivers/include/periph/gpio.h
@@ -94,7 +94,7 @@ typedef unsigned int gpio_t;
*/
#ifndef HAVE_GPIO_MODE_T
typedef enum {
- GPIO_IN , /**< configure as input without pull resistor */
+ GPIO_IN, /**< configure as input without pull resistor */
GPIO_IN_PD, /**< configure as input with pull-down resistor */
GPIO_IN_PU, /**< configure as input with pull-up resistor */
GPIO_OUT, /**< configure as output in push-pull mode */
diff --git a/drivers/include/periph/rtc.h b/drivers/include/periph/rtc.h
index 291078e4e..6301cd9f4 100644
--- a/drivers/include/periph/rtc.h
+++ b/drivers/include/periph/rtc.h
@@ -38,7 +38,7 @@ extern "C" {
*
* @param[in] arg optional argument to put the callback in the right context
*/
-typedef void(*rtc_alarm_cb_t)(void *arg);
+typedef void (*rtc_alarm_cb_t)(void *arg);
/**
* @brief Initialize RTC module
diff --git a/drivers/include/periph/rtt.h b/drivers/include/periph/rtt.h
index 04b8cdd03..ed300dec4 100644
--- a/drivers/include/periph/rtt.h
+++ b/drivers/include/periph/rtt.h
@@ -34,7 +34,7 @@ extern "C" {
#ifndef RTT_FREQUENCY
#warning "RTT_FREQUENCY undefined. Set RTT_FREQUENCY to the number of ticks" \
- "per second for the current architecture."
+ "per second for the current architecture."
#endif
/**
@@ -99,7 +99,7 @@ extern "C" {
* @param[in] arg Optional argument which is passed to the
* callback
*/
-typedef void(*rtt_cb_t)(void *arg);
+typedef void (*rtt_cb_t)(void *arg);
/**
* @brief Initialize RTT module
diff --git a/drivers/include/periph/uart.h b/drivers/include/periph/uart.h
index dd8165517..0e316512f 100644
--- a/drivers/include/periph/uart.h
+++ b/drivers/include/periph/uart.h
@@ -85,7 +85,7 @@ typedef unsigned int uart_t;
* @param[in] arg context to the callback (optional)
* @param[in] data the byte that was received
*/
-typedef void(*uart_rx_cb_t)(void *arg, uint8_t data);
+typedef void (*uart_rx_cb_t)(void *arg, uint8_t data);
/**
* @brief Interrupt context for a UART device
diff --git a/drivers/include/pir.h b/drivers/include/pir.h
index ac1f6fd17..d11f4905e 100644
--- a/drivers/include/pir.h
+++ b/drivers/include/pir.h
@@ -32,8 +32,8 @@ extern "C" {
* @brief device descriptor for a PIR sensor
*/
typedef struct {
- gpio_t gpio_dev; /**< GPIO device which is used */
- kernel_pid_t msg_thread_pid; /**< thread to msg on irq */
+ gpio_t gpio_dev; /**< GPIO device which is used */
+ kernel_pid_t msg_thread_pid; /**< thread to msg on irq */
} pir_t;
/**
diff --git a/drivers/include/pulse_counter.h b/drivers/include/pulse_counter.h
index 5e69cf8d4..2a5fb4dc4 100644
--- a/drivers/include/pulse_counter.h
+++ b/drivers/include/pulse_counter.h
@@ -34,13 +34,13 @@ extern "C" {
* @brief Parameters needed for device initialization
*/
typedef struct {
- gpio_t gpio; /**< GPIO pin that sensor is connected to */
+ gpio_t gpio; /**< GPIO pin that sensor is connected to */
gpio_flank_t gpio_flank; /**< GPIO flank option */
} pulse_counter_params_t;
/**
- * @brief Device descriptor for a pulse counter device
- */
+ * @brief Device descriptor for a pulse counter device
+ */
typedef struct {
int16_t pulse_count; /**< pulse counter */
} pulse_counter_t;
diff --git a/drivers/include/rn2xx3.h b/drivers/include/rn2xx3.h
index d30029ca2..8209c6bf5 100644
--- a/drivers/include/rn2xx3.h
+++ b/drivers/include/rn2xx3.h
@@ -226,7 +226,7 @@ int rn2xx3_sys_factory_reset(rn2xx3_t *dev);
* @return RN2XX3_OK on success
* @return RN2XX3_TIMEOUT if UART communication failed
*/
- int rn2xx3_sys_sleep(rn2xx3_t *dev);
+int rn2xx3_sys_sleep(rn2xx3_t *dev);
/**
* @brief Initializes the RN2XX3 device MAC layer
@@ -496,7 +496,7 @@ void rn2xx3_mac_set_dr(rn2xx3_t *dev, loramac_dr_idx_t dr);
*
* @return The frequency band
*/
- uint16_t rn2xx3_mac_get_band(rn2xx3_t *dev);
+uint16_t rn2xx3_mac_get_band(rn2xx3_t *dev);
/**
* @brief Checks if the rn2xx3 LoRaMAC adaptive datarate is enabled/disabled
diff --git a/drivers/include/saul.h b/drivers/include/saul.h
index 55a50ea09..ab15851dc 100644
--- a/drivers/include/saul.h
+++ b/drivers/include/saul.h
@@ -96,7 +96,7 @@ enum {
SAUL_SENSE_DISTANCE = 0x8e, /**< sensor: distance */
SAUL_SENSE_CO2 = 0x8f, /**< sensor: CO2 Gas */
SAUL_CLASS_ANY = 0xff /**< any device - wildcard */
- /* extend this list as needed... */
+ /* extend this list as needed... */
};
/**
@@ -116,7 +116,7 @@ enum {
* @return -ENOTSUP if the device does not support this operation
* @return -ECANCELED on other errors
*/
-typedef int(*saul_read_t)(const void *dev, phydat_t *res);
+typedef int (*saul_read_t)(const void *dev, phydat_t *res);
/**
* @brief Write a value (a set of values) to a device
@@ -136,7 +136,7 @@ typedef int(*saul_read_t)(const void *dev, phydat_t *res);
* @return -ENOTSUP if the device does not support this operation
* @return -ECANCELED on other errors
*/
-typedef int(*saul_write_t)(const void *dev, phydat_t *data);
+typedef int (*saul_write_t)(const void *dev, phydat_t *data);
/**
* @brief Definition of the RIOT actuator/sensor interface
diff --git a/drivers/include/sdcard_spi.h b/drivers/include/sdcard_spi.h
index db05a7397..b2530799a 100644
--- a/drivers/include/sdcard_spi.h
+++ b/drivers/include/sdcard_spi.h
@@ -133,16 +133,16 @@ typedef struct {
uint32_t VSC_AU_SIZE : 10; /**< see section 4.10.2.11 in SD-Spec v5.00 */
uint16_t SD_CARD_TYPE : 16; /**< see section 4.10.2 in SD-Spec v5.00 */
uint16_t ERASE_SIZE : 16; /**< see section 4.10.2.5 in SD-Spec v5.00 */
- uint8_t SPEED_CLASS : 8; /**< see section 4.10.2.2 in SD-Spec v5.00 */
- uint8_t PERFORMANCE_MOVE : 8; /**< see section 4.10.2.3 in SD-Spec v5.00 */
- uint8_t VIDEO_SPEED_CLASS : 8; /**< see section 4.10.2.10 in SD-Spec v5.00 */
- uint8_t ERASE_TIMEOUT : 6; /**< see section 4.10.2.6 in SD-Spec v5.00 */
- uint8_t ERASE_OFFSET : 2; /**< see section 4.10.2.7 in SD-Spec v5.00 */
- uint8_t UHS_SPEED_GRADE : 4; /**< see section 4.10.2.8 in SD-Spec v5.00 */
- uint8_t UHS_AU_SIZE : 4; /**< see section 4.10.2.9 in SD-Spec v5.00 */
- uint8_t AU_SIZE : 4; /**< see section 4.10.2.4 in SD-Spec v5.00 */
- uint8_t DAT_BUS_WIDTH : 2; /**< see section 4.10.2 in SD-Spec v5.00 */
- uint8_t SECURED_MODE : 1; /**< see section 4.10.2 in SD-Spec v5.00 */
+ uint8_t SPEED_CLASS : 8; /**< see section 4.10.2.2 in SD-Spec v5.00 */
+ uint8_t PERFORMANCE_MOVE : 8; /**< see section 4.10.2.3 in SD-Spec v5.00 */
+ uint8_t VIDEO_SPEED_CLASS : 8; /**< see section 4.10.2.10 in SD-Spec v5.00 */
+ uint8_t ERASE_TIMEOUT : 6; /**< see section 4.10.2.6 in SD-Spec v5.00 */
+ uint8_t ERASE_OFFSET : 2; /**< see section 4.10.2.7 in SD-Spec v5.00 */
+ uint8_t UHS_SPEED_GRADE : 4; /**< see section 4.10.2.8 in SD-Spec v5.00 */
+ uint8_t UHS_AU_SIZE : 4; /**< see section 4.10.2.9 in SD-Spec v5.00 */
+ uint8_t AU_SIZE : 4; /**< see section 4.10.2.4 in SD-Spec v5.00 */
+ uint8_t DAT_BUS_WIDTH : 2; /**< see section 4.10.2 in SD-Spec v5.00 */
+ uint8_t SECURED_MODE : 1; /**< see section 4.10.2 in SD-Spec v5.00 */
} sd_status_t;
/**
diff --git a/drivers/include/sht11.h b/drivers/include/sht11.h
index 2378ca8c1..25ce729e5 100644
--- a/drivers/include/sht11.h
+++ b/drivers/include/sht11.h
@@ -48,9 +48,9 @@ extern "C" {
* @brief sht11 measureable data
*/
typedef struct {
- float temperature; /**< temperature value */
- float relhum; /**< linear relative humidity */
- float relhum_temp; /**< temperature compensated relative humidity */
+ float temperature; /**< temperature value */
+ float relhum; /**< linear relative humidity */
+ float relhum_temp; /**< temperature compensated relative humidity */
} sht11_val_t;
/**
diff --git a/drivers/include/soft_spi.h b/drivers/include/soft_spi.h
index 456bd754b..7697b71f7 100644
--- a/drivers/include/soft_spi.h
+++ b/drivers/include/soft_spi.h
@@ -225,7 +225,7 @@ uint8_t soft_spi_transfer_byte(soft_spi_t bus, soft_spi_cs_t cs, bool cont, uint
* @param[in] len number of bytes to transfer
*/
void soft_spi_transfer_bytes(soft_spi_t bus, soft_spi_cs_t cs, bool cont,
- const void *out, void *in, size_t len);
+ const void *out, void *in, size_t len);
/**
* @brief Transfer one byte to/from a given register address
@@ -256,7 +256,7 @@ uint8_t soft_spi_transfer_reg(soft_spi_t bus, soft_spi_cs_t cs, uint8_t reg, uin
* @param[in] len number of bytes to transfer
*/
void soft_spi_transfer_regs(soft_spi_t bus, soft_spi_cs_t cs, uint8_t reg,
- const void *out, void *in, size_t len);
+ const void *out, void *in, size_t len);
#ifdef __cplusplus
}
diff --git a/drivers/include/tmp006.h b/drivers/include/tmp006.h
index e37ccf0c0..0e9311dcb 100644
--- a/drivers/include/tmp006.h
+++ b/drivers/include/tmp006.h
@@ -155,7 +155,7 @@ extern "C"
* @brief Parameters needed for device initialization
*/
typedef struct {
- i2c_t i2c; /**< I2C device, the sensor is connected to */
+ i2c_t i2c; /**< I2C device, the sensor is connected to */
uint8_t addr; /**< the sensor's slave address on the I2C bus */
uint8_t rate; /**< number of averaged samples */
} tmp006_params_t;
diff --git a/drivers/include/veml6070.h b/drivers/include/veml6070.h
index 6b4158660..0e3ac0a2f 100644
--- a/drivers/include/veml6070.h
+++ b/drivers/include/veml6070.h
@@ -32,10 +32,10 @@ extern "C" {
* @brief Integration times
*/
typedef enum veml6070_integrationtime {
- VEML6070_HALF_T = 0, /**< 1/2 T integration time */
- VEML6070_1_T, /**< 1 T integration time */
- VEML6070_2_T, /**< 2 T integration time */
- VEML6070_4_T, /**< 4 T integration time */
+ VEML6070_HALF_T = 0, /**< 1/2 T integration time */
+ VEML6070_1_T, /**< 1 T integration time */
+ VEML6070_2_T, /**< 2 T integration time */
+ VEML6070_4_T, /**< 4 T integration time */
} veml6070_itime_t;
/**
@@ -50,8 +50,8 @@ enum {
* @brief Device initialization parameters
*/
typedef struct {
- i2c_t i2c_dev; /**< I2C device which is used */
- veml6070_itime_t itime; /**< Integration time */
+ i2c_t i2c_dev; /**< I2C device which is used */
+ veml6070_itime_t itime; /**< Integration time */
} veml6070_params_t;
/**
diff --git a/drivers/io1_xplained/io1_xplained.c b/drivers/io1_xplained/io1_xplained.c
index 16c6d053a..aacc17328 100644
--- a/drivers/io1_xplained/io1_xplained.c
+++ b/drivers/io1_xplained/io1_xplained.c
@@ -31,8 +31,8 @@
#include "debug.h"
/*---------------------------------------------------------------------------*
- * IO1 Xplained Core API *
- *---------------------------------------------------------------------------*/
+* IO1 Xplained Core API *
+*---------------------------------------------------------------------------*/
int io1_xplained_init(io1_xplained_t *dev, const io1_xplained_params_t *params)
{
diff --git a/drivers/isl29020/include/isl29020_params.h b/drivers/isl29020/include/isl29020_params.h
index dc8e4db07..81e0bdb63 100644
--- a/drivers/isl29020/include/isl29020_params.h
+++ b/drivers/isl29020/include/isl29020_params.h
@@ -44,8 +44,8 @@ extern "C" {
#define ISL29020_PARAM_MODE (ISL29020_MODE_AMBIENT)
#endif
-#define ISL29020_PARAMS_DEFAULT { .i2c = ISL29020_PARAM_I2C, \
- .addr = ISL29020_PARAM_ADDR, \
+#define ISL29020_PARAMS_DEFAULT { .i2c = ISL29020_PARAM_I2C, \
+ .addr = ISL29020_PARAM_ADDR, \
.range = ISL29020_PARAM_RANGE, \
.mode = ISL29020_PARAM_MODE,}
/**@}*/
diff --git a/drivers/jc42/jc42.c b/drivers/jc42/jc42.c
index 6b757646a..17cdf7ffe 100644
--- a/drivers/jc42/jc42.c
+++ b/drivers/jc42/jc42.c
@@ -65,7 +65,7 @@ int jc42_set_config(const jc42_t* dev, uint16_t data)
int jc42_get_temperature(const jc42_t* dev, int16_t* temperature)
{
- struct { signed int x:12;} s;
+ struct { signed int x : 12;} s;
uint16_t tmp;
/* Read temperature */
diff --git a/drivers/kw2xrf/include/overwrites.h b/drivers/kw2xrf/include/overwrites.h
index 817ed8e09..953d1e333 100644
--- a/drivers/kw2xrf/include/overwrites.h
+++ b/drivers/kw2xrf/include/overwrites.h
@@ -1,35 +1,35 @@
/*!
-* Copyright (c) 2015, Freescale Semiconductor, Inc.
-* All rights reserved.
-*
-* \file MCR20Overwrites.h
-* Description: Overwrites header file for MCR20 Register values
-*
-* Redistribution and use in source and binary forms, with or without modification,
-* are permitted provided that the following conditions are met:
-*
-* o Redistributions of source code must retain the above copyright notice, this list
-* of conditions and the following disclaimer.
-*
-* o Redistributions in binary form must reproduce the above copyright notice, this
-* list of conditions and the following disclaimer in the documentation and/or
-* other materials provided with the distribution.
-*
-* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
-* contributors may be used to endorse or promote products derived from this
-* software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2015, Freescale Semiconductor, Inc.
+ * All rights reserved.
+ *
+ * \file MCR20Overwrites.h
+ * Description: Overwrites header file for MCR20 Register values
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * o Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ *
+ * o Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or
+ * other materials provided with the distribution.
+ *
+ * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef OVERWRITES_H
#define OVERWRITES_H
@@ -71,242 +71,242 @@ typedef struct overwrites_tag {
// Write access to direct space requires only a single address, data pair.
overwrites_t const overwrites_direct[] ={
-{0x3B, 0x0C}, //version 0C: new value for ACKDELAY targeting 198us (23 May, 2013, Larry Roshak)
-{0x23, 0x17} //PA_PWR new default Power Step is "23"
+ {0x3B, 0x0C}, //version 0C: new value for ACKDELAY targeting 198us (23 May, 2013, Larry Roshak)
+ {0x23, 0x17} //PA_PWR new default Power Step is "23"
};
overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
-{0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-{0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
-{0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
-{0x52, 0x55}, //AGC_THR1 RSSI tune up
-{0x53, 0x2D}, //AGC_THR2 RSSI tune up
-{0x66, 0x5F}, //ATT_RSSI1 tune up
-{0x67, 0x8F}, //ATT_RSSI2 tune up
-{0x68, 0x61}, //RSSI_OFFSET
-{0x78, 0x03}, //CHF_PMAGAIN
-{0x22, 0x50}, //CCA1_THRESH
-{0x4D, 0x13}, //CORR_NVAL moved from 0x14 to 0x13 for 0.5 dB improved Rx Sensitivity
-{0x39, 0x3D} //ACKDELAY new value targeting a delay of 198us (23 May, 2013, Larry Roshak)
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
+ {0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ {0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
+ {0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
+ {0x52, 0x55}, //AGC_THR1 RSSI tune up
+ {0x53, 0x2D}, //AGC_THR2 RSSI tune up
+ {0x66, 0x5F}, //ATT_RSSI1 tune up
+ {0x67, 0x8F}, //ATT_RSSI2 tune up
+ {0x68, 0x61}, //RSSI_OFFSET
+ {0x78, 0x03}, //CHF_PMAGAIN
+ {0x22, 0x50}, //CCA1_THRESH
+ {0x4D, 0x13}, //CORR_NVAL moved from 0x14 to 0x13 for 0.5 dB improved Rx Sensitivity
+ {0x39, 0x3D} //ACKDELAY new value targeting a delay of 198us (23 May, 2013, Larry Roshak)
};
/* begin of deprecated versions
-==VERSION 1==
-(version 1 is empty)
+ ==VERSION 1==
+ (version 1 is empty)
-==VERSION 2==
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02} //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-};
+ ==VERSION 2==
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02} //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ };
-==VERSION 3==
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1: override VCOALC_REF_TX to 3
-{0x92, 0x07} //VCO_CTRL2: override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-};
+ ==VERSION 3==
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1: override VCOALC_REF_TX to 3
+ {0x92, 0x07} //VCO_CTRL2: override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ };
-==VERSION 4==
-overwrites_t const overwrites_direct[] ={
-{0x3B, 0x04} //version 04 is the current version: update PA_COILTUNING default
-};
+ ==VERSION 4==
+ overwrites_t const overwrites_direct[] ={
+ {0x3B, 0x04} //version 04 is the current version: update PA_COILTUNING default
+ };
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1: override VCOALC_REF_TX to 3
-{0x92, 0x07} //VCO_CTRL2: override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-{0x8A, 0x71} //PA_TUNING: override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
-};
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1: override VCOALC_REF_TX to 3
+ {0x92, 0x07} //VCO_CTRL2: override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ {0x8A, 0x71} //PA_TUNING: override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
+ };
-==VERSION 5==
-overwrites_t const overwrites_direct[] ={
-{0x3B, 0x05} //version 05: updates Channel Filter Register set (21 Dec 2012, on behalf of S. Soca)
-};
+ ==VERSION 5==
+ overwrites_t const overwrites_direct[] ={
+ {0x3B, 0x05} //version 05: updates Channel Filter Register set (21 Dec 2012, on behalf of S. Soca)
+ };
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
-{0x92, 0x07} //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-{0x8A, 0x71} //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
-{0x79, 0x2F} //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7A, 0x2F} //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7B, 0x24} //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7C, 0x24} //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7D, 0x24} //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7E, 0x24} //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x82, 0x24} //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x83, 0x24} //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7F, 0x32} //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x80, 0x1D} //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x81, 0x2D} //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-};
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
+ {0x92, 0x07} //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ {0x8A, 0x71} //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
+ {0x79, 0x2F} //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7A, 0x2F} //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7B, 0x24} //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7C, 0x24} //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7D, 0x24} //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7E, 0x24} //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x82, 0x24} //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x83, 0x24} //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7F, 0x32} //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x80, 0x1D} //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x81, 0x2D} //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ };
-==VERSION 6==
-overwrites_t const overwrites_direct[] ={
-{0x3B, 0x06} //version 06: disable PA calibration
-};
+ ==VERSION 6==
+ overwrites_t const overwrites_direct[] ={
+ {0x3B, 0x06} //version 06: disable PA calibration
+ };
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
-{0x92, 0x07} //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-{0x8A, 0x71} //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
-{0x79, 0x2F} //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7A, 0x2F} //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7B, 0x24} //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7C, 0x24} //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7D, 0x24} //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7E, 0x24} //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x82, 0x24} //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x83, 0x24} //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7F, 0x32} //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x80, 0x1D} //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x81, 0x2D} //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x64, 0x28} //PA_CAL_DIS=1 Disabled PA calibration
-};
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
+ {0x92, 0x07} //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ {0x8A, 0x71} //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
+ {0x79, 0x2F} //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7A, 0x2F} //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7B, 0x24} //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7C, 0x24} //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7D, 0x24} //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7E, 0x24} //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x82, 0x24} //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x83, 0x24} //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7F, 0x32} //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x80, 0x1D} //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x81, 0x2D} //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x64, 0x28} //PA_CAL_DIS=1 Disabled PA calibration
+ };
-==VERSION 7==
-overwrites_t const overwrites_direct[] ={
-{0x3B, 0x07} //version 07: updated registers for ED/RSSI
-};
+ ==VERSION 7==
+ overwrites_t const overwrites_direct[] ={
+ {0x3B, 0x07} //version 07: updated registers for ED/RSSI
+ };
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
-{0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-{0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
-{0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
-{0x52, 0x73}, //AGC_THR1 RSSI tune up
-{0x53, 0x2D}, //AGC_THR2 RSSI tune up
-{0x66, 0x5F}, //ATT_RSSI1 tune up
-{0x67, 0x8F}, //ATT_RSSI2 tune up
-{0x68, 0x60}, //RSSI_OFFSET
-{0x69, 0x65} //RSSI_SLOPE
-};
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
+ {0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ {0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
+ {0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
+ {0x52, 0x73}, //AGC_THR1 RSSI tune up
+ {0x53, 0x2D}, //AGC_THR2 RSSI tune up
+ {0x66, 0x5F}, //ATT_RSSI1 tune up
+ {0x67, 0x8F}, //ATT_RSSI2 tune up
+ {0x68, 0x60}, //RSSI_OFFSET
+ {0x69, 0x65} //RSSI_SLOPE
+ };
-==VERSION 8==
-overwrites_t const overwrites_direct[] ={
-{0x3B, 0x08} //version 08: updated registers for ED/RSSI
-};
+ ==VERSION 8==
+ overwrites_t const overwrites_direct[] ={
+ {0x3B, 0x08} //version 08: updated registers for ED/RSSI
+ };
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
-{0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-{0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
-{0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
-{0x52, 0x73}, //AGC_THR1 RSSI tune up
-{0x53, 0x2D}, //AGC_THR2 RSSI tune up
-{0x66, 0x5F}, //ATT_RSSI1 tune up
-{0x67, 0x8F}, //ATT_RSSI2 tune up
-{0x69, 0x65} //RSSI_SLOPE
-{0x68, 0x61}, //RSSI_OFFSET
-{0x78, 0x03} //CHF_PMAGAIN
-};
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
+ {0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ {0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
+ {0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
+ {0x52, 0x73}, //AGC_THR1 RSSI tune up
+ {0x53, 0x2D}, //AGC_THR2 RSSI tune up
+ {0x66, 0x5F}, //ATT_RSSI1 tune up
+ {0x67, 0x8F}, //ATT_RSSI2 tune up
+ {0x69, 0x65} //RSSI_SLOPE
+ {0x68, 0x61}, //RSSI_OFFSET
+ {0x78, 0x03} //CHF_PMAGAIN
+ };
-==VERSION 9==
-overwrites_t const overwrites_direct[] ={
-{0x3B, 0x09} //version 09: updated registers for ED/RSSI and PowerStep
-{0x23, 0x17} //PA_PWR new default value
-};
+ ==VERSION 9==
+ overwrites_t const overwrites_direct[] ={
+ {0x3B, 0x09} //version 09: updated registers for ED/RSSI and PowerStep
+ {0x23, 0x17} //PA_PWR new default value
+ };
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
-{0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-{0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
-{0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
-{0x52, 0x55}, //AGC_THR1 RSSI tune up
-{0x53, 0x2D}, //AGC_THR2 RSSI tune up
-{0x66, 0x5F}, //ATT_RSSI1 tune up
-{0x67, 0x8F}, //ATT_RSSI2 tune up
-{0x68, 0x61}, //RSSI_OFFSET
-{0x78, 0x03} //CHF_PMAGAIN
-};
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
+ {0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ {0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
+ {0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
+ {0x52, 0x55}, //AGC_THR1 RSSI tune up
+ {0x53, 0x2D}, //AGC_THR2 RSSI tune up
+ {0x66, 0x5F}, //ATT_RSSI1 tune up
+ {0x67, 0x8F}, //ATT_RSSI2 tune up
+ {0x68, 0x61}, //RSSI_OFFSET
+ {0x78, 0x03} //CHF_PMAGAIN
+ };
-==VERSION A==
-overwrites_t const overwrites_direct[] ={
-{0x3B, 0x0A} //version 0A: updated registers for CCA
-{0x23, 0x17} //PA_PWR new default Power Step is "23"
-};
+ ==VERSION A==
+ overwrites_t const overwrites_direct[] ={
+ {0x3B, 0x0A} //version 0A: updated registers for CCA
+ {0x23, 0x17} //PA_PWR new default Power Step is "23"
+ };
-overwrites_t const overwrites_indirect[] ={
-{0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
-{0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
-{0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
-{0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
-{0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
-{0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
-{0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
-{0x52, 0x55}, //AGC_THR1 RSSI tune up
-{0x53, 0x2D}, //AGC_THR2 RSSI tune up
-{0x66, 0x5F}, //ATT_RSSI1 tune up
-{0x67, 0x8F}, //ATT_RSSI2 tune up
-{0x68, 0x61}, //RSSI_OFFSET
-{0x78, 0x03} //CHF_PMAGAIN
-{0x22, 0x50} //CCA1_THRESH
-};
+ overwrites_t const overwrites_indirect[] ={
+ {0x31, 0x02}, //clear MISO_HIZ_EN (for single SPI master/slave pair) and SPI_PUL_EN (minimize HIB currents)
+ {0x91, 0xB3}, //VCO_CTRL1 override VCOALC_REF_TX to 3
+ {0x92, 0x07}, //VCO_CTRL2 override VCOALC_REF_RX to 3, keep VCO_BUF_BOOST = 1
+ {0x8A, 0x71}, //PA_TUNING override PA_COILTUNING to 001 (27 Nov 2012, D. Brown, on behalf of S. Eid)
+ {0x79, 0x2F}, //CHF_IBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7A, 0x2F}, //CHF_QBUF Adjust the gm-C filter gain (+/- 6dB) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7B, 0x24}, //CHF_IRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7C, 0x24}, //CHF_QRIN Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7D, 0x24}, //CHF_IL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7E, 0x24}, //CHF_QL Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x7F, 0x32}, //CHF_CC1 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x80, 0x1D}, //CHF_CCL Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x81, 0x2D}, //CHF_CC2 Adjust the filter center frequency (+/- 1MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x82, 0x24}, //CHF_IROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x83, 0x24}, //CHF_QROUT Adjust the filter bandwidth (+/- 0.5MHz) (21 Dec, 2012, on behalf of S. Soca)
+ {0x64, 0x28}, //PA_CAL_DIS=1 Disabled PA calibration
+ {0x52, 0x55}, //AGC_THR1 RSSI tune up
+ {0x53, 0x2D}, //AGC_THR2 RSSI tune up
+ {0x66, 0x5F}, //ATT_RSSI1 tune up
+ {0x67, 0x8F}, //ATT_RSSI2 tune up
+ {0x68, 0x61}, //RSSI_OFFSET
+ {0x78, 0x03} //CHF_PMAGAIN
+ {0x22, 0x50} //CCA1_THRESH
+ };
-end of deprecated versions */
+ end of deprecated versions */
#ifdef __cplusplus
}
diff --git a/drivers/kw2xrf/kw2xrf_getset.c b/drivers/kw2xrf/kw2xrf_getset.c
index b3bd2f07e..6b10eda0e 100644
--- a/drivers/kw2xrf/kw2xrf_getset.c
+++ b/drivers/kw2xrf/kw2xrf_getset.c
@@ -377,42 +377,42 @@ void kw2xrf_set_option(kw2xrf_t *dev, uint16_t option, bool state)
case KW2XRF_OPT_AUTOCCA:
LOG_DEBUG("[kw2xrf] opt: enabling CCA before TX mode\n");
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_CCABFRTX);
+ MKW2XDM_PHY_CTRL1_CCABFRTX);
break;
case KW2XRF_OPT_PROMISCUOUS:
LOG_DEBUG("[kw2xrf] opt: enabling PROMISCUOUS mode\n");
/* disable auto ACKs in promiscuous mode */
kw2xrf_clear_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_AUTOACK | MKW2XDM_PHY_CTRL1_RXACKRQD);
+ MKW2XDM_PHY_CTRL1_AUTOACK | MKW2XDM_PHY_CTRL1_RXACKRQD);
/* enable promiscuous mode */
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL4,
- MKW2XDM_PHY_CTRL4_PROMISCUOUS);
+ MKW2XDM_PHY_CTRL4_PROMISCUOUS);
break;
case KW2XRF_OPT_AUTOACK:
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_AUTOACK);
+ MKW2XDM_PHY_CTRL1_AUTOACK);
break;
case KW2XRF_OPT_ACK_REQ:
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_RXACKRQD);
+ MKW2XDM_PHY_CTRL1_RXACKRQD);
break;
case KW2XRF_OPT_TELL_RX_START:
kw2xrf_clear_dreg_bit(dev, MKW2XDM_PHY_CTRL2,
- MKW2XDM_PHY_CTRL2_RX_WMRK_MSK);
+ MKW2XDM_PHY_CTRL2_RX_WMRK_MSK);
break;
case KW2XRF_OPT_TELL_RX_END:
kw2xrf_clear_dreg_bit(dev, MKW2XDM_PHY_CTRL2,
- MKW2XDM_PHY_CTRL2_RXMSK);
+ MKW2XDM_PHY_CTRL2_RXMSK);
break;
case KW2XRF_OPT_TELL_TX_END:
kw2xrf_clear_dreg_bit(dev, MKW2XDM_PHY_CTRL2,
- MKW2XDM_PHY_CTRL2_TXMSK);
+ MKW2XDM_PHY_CTRL2_TXMSK);
break;
case KW2XRF_OPT_TELL_TX_START:
@@ -427,47 +427,47 @@ void kw2xrf_set_option(kw2xrf_t *dev, uint16_t option, bool state)
switch (option) {
case KW2XRF_OPT_AUTOCCA:
kw2xrf_clear_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_CCABFRTX);
+ MKW2XDM_PHY_CTRL1_CCABFRTX);
break;
case KW2XRF_OPT_PROMISCUOUS:
/* disable promiscuous mode */
kw2xrf_clear_dreg_bit(dev, MKW2XDM_PHY_CTRL4,
- MKW2XDM_PHY_CTRL4_PROMISCUOUS);
+ MKW2XDM_PHY_CTRL4_PROMISCUOUS);
/* re-enable AUTOACK only if the option is set */
if (dev->netdev.flags & KW2XRF_OPT_AUTOACK) {
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_AUTOACK);
+ MKW2XDM_PHY_CTRL1_AUTOACK);
}
if (dev->netdev.flags & KW2XRF_OPT_ACK_REQ) {
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_RXACKRQD);
+ MKW2XDM_PHY_CTRL1_RXACKRQD);
}
break;
case KW2XRF_OPT_AUTOACK:
kw2xrf_clear_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_AUTOACK);
+ MKW2XDM_PHY_CTRL1_AUTOACK);
break;
case KW2XRF_OPT_ACK_REQ:
kw2xrf_clear_dreg_bit(dev, MKW2XDM_PHY_CTRL1,
- MKW2XDM_PHY_CTRL1_RXACKRQD);
+ MKW2XDM_PHY_CTRL1_RXACKRQD);
break;
case KW2XRF_OPT_TELL_RX_START:
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL2,
- MKW2XDM_PHY_CTRL2_RX_WMRK_MSK);
+ MKW2XDM_PHY_CTRL2_RX_WMRK_MSK);
break;
case KW2XRF_OPT_TELL_RX_END:
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL2,
- MKW2XDM_PHY_CTRL2_RXMSK);
+ MKW2XDM_PHY_CTRL2_RXMSK);
break;
case KW2XRF_OPT_TELL_TX_END:
kw2xrf_set_dreg_bit(dev, MKW2XDM_PHY_CTRL2,
- MKW2XDM_PHY_CTRL2_TXMSK);
+ MKW2XDM_PHY_CTRL2_TXMSK);
break;
diff --git a/drivers/kw2xrf/kw2xrf_netdev.c b/drivers/kw2xrf/kw2xrf_netdev.c
index e22ab31fd..e70249c17 100644
--- a/drivers/kw2xrf/kw2xrf_netdev.c
+++ b/drivers/kw2xrf/kw2xrf_netdev.c
@@ -152,7 +152,7 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
/* current packet data + FCS too long */
if ((len + iol->iol_len + IEEE802154_FCS_LEN) > KW2XRF_MAX_PKT_LENGTH) {
LOG_ERROR("[kw2xrf] packet too large (%u byte) to be send\n",
- (unsigned)len + IEEE802154_FCS_LEN);
+ (unsigned)len + IEEE802154_FCS_LEN);
return -EOVERFLOW;
}
len = kw2xrf_tx_load(pkt_buf, iol->iol_base, iol->iol_len, len);
@@ -473,31 +473,31 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value, size_t len)
case NETOPT_RX_START_IRQ:
kw2xrf_set_option(dev, KW2XRF_OPT_TELL_RX_START,
- ((bool *)value)[0]);
+ ((bool *)value)[0]);
res = sizeof(netopt_enable_t);
break;
case NETOPT_RX_END_IRQ:
kw2xrf_set_option(dev, KW2XRF_OPT_TELL_RX_END,
- ((bool *)value)[0]);
+ ((bool *)value)[0]);
res = sizeof(netopt_enable_t);
break;
case NETOPT_TX_START_IRQ:
kw2xrf_set_option(dev, KW2XRF_OPT_TELL_TX_START,
- ((bool *)value)[0]);
+ ((bool *)value)[0]);
res = sizeof(netopt_enable_t);
break;
case NETOPT_TX_END_IRQ:
kw2xrf_set_option(dev, KW2XRF_OPT_TELL_TX_END,
- ((bool *)value)[0]);
+ ((bool *)value)[0]);
res = sizeof(netopt_enable_t);
break;
case NETOPT_AUTOCCA:
kw2xrf_set_option(dev, KW2XRF_OPT_AUTOCCA,
- ((bool *)value)[0]);
+ ((bool *)value)[0]);
res = sizeof(netopt_enable_t);
break;
@@ -550,7 +550,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value, size_t len)
if (res == -ENOTSUP) {
res = netdev_ieee802154_set((netdev_ieee802154_t *)netdev, opt,
- value, len);
+ value, len);
}
return res;
@@ -785,15 +785,15 @@ static void _isr(netdev_t *netdev)
kw2xrf_read_dregs(dev, MKW2XDM_IRQSTS1, dregs, MKW2XDM_IRQSTS1 + 3);
if (dregs[MKW2XDM_IRQSTS1] & 0x7f) {
DEBUG("[kw2xrf] IRQSTS1 contains untreated IRQs: 0x%02x\n",
- dregs[MKW2XDM_IRQSTS1]);
+ dregs[MKW2XDM_IRQSTS1]);
}
if (dregs[MKW2XDM_IRQSTS2] & 0x02) {
DEBUG("[kw2xrf] IRQSTS2 contains untreated IRQs: 0x%02x\n",
- dregs[MKW2XDM_IRQSTS2]);
+ dregs[MKW2XDM_IRQSTS2]);
}
if (dregs[MKW2XDM_IRQSTS3] & 0x0f) {
DEBUG("[kw2xrf] IRQSTS3 contains untreated IRQs: 0x%02x\n",
- dregs[MKW2XDM_IRQSTS3]);
+ dregs[MKW2XDM_IRQSTS3]);
}
}
diff --git a/drivers/kw2xrf/kw2xrf_tm.c b/drivers/kw2xrf/kw2xrf_tm.c
index e0e9d6b24..c9236dd94 100644
--- a/drivers/kw2xrf/kw2xrf_tm.c
+++ b/drivers/kw2xrf/kw2xrf_tm.c
@@ -166,7 +166,7 @@ int kw2xrf_set_test_mode(kw2xrf_t *dev, uint8_t mode)
case NETOPT_RF_TESTMODE_CTX_PRBS9:
/* set continuous TX mode, transmit PRBS9 pattern */
reg = MKW2XDMI_TX_MODE_CTRL_DTS2 | MKW2XDMI_TX_MODE_CTRL_DTS1
- | MKW2XDMI_TX_MODE_CTRL_DTS0;
+ | MKW2XDMI_TX_MODE_CTRL_DTS0;
kw2xrf_write_iregs(dev, MKW2XDMI_TX_MODE_CTRL, &reg, 1);
enable_xcvr_test_mode(dev);
diff --git a/drivers/l3g4200d/include/l3g4200d-regs.h b/drivers/l3g4200d/include/l3g4200d-regs.h
index c31914f77..5431583d0 100644
--- a/drivers/l3g4200d/include/l3g4200d-regs.h
+++ b/drivers/l3g4200d/include/l3g4200d-regs.h
@@ -21,7 +21,7 @@
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/drivers/l3g4200d/include/l3g4200d_params.h b/drivers/l3g4200d/include/l3g4200d_params.h
index 2ff472150..c3d2e35bd 100644
--- a/drivers/l3g4200d/include/l3g4200d_params.h
+++ b/drivers/l3g4200d/include/l3g4200d_params.h
@@ -50,7 +50,7 @@ extern "C" {
#define L3G4200D_PARAM_SCALE (L3G4200D_SCALE_500DPS)
#endif
-#define L3G4200D_PARAMS_DEFAULT { .i2c = L3G4200D_PARAM_I2C, \
+#define L3G4200D_PARAMS_DEFAULT { .i2c = L3G4200D_PARAM_I2C, \
.addr = L3G4200D_PARAM_ADDR, \
.int1_pin = L3G4200D_PARAM_INT1, \
.int2_pin = L3G4200D_PARAM_INT2, \
diff --git a/drivers/lc709203f/include/lc709203f_params.h b/drivers/lc709203f/include/lc709203f_params.h
index 92be49ca7..c2b0b6eae 100644
--- a/drivers/lc709203f/include/lc709203f_params.h
+++ b/drivers/lc709203f/include/lc709203f_params.h
@@ -43,7 +43,7 @@ extern "C" {
#ifndef LC709203F_PARAMS
#define LC709203F_PARAMS { .alarm_pin = LC709203F_PARAMS_ALARM_PIN, \
- .bus = LC709203F_PARAMS_I2C, \
+ .bus = LC709203F_PARAMS_I2C, \
.addr = LC709203F_PARAMS_ADDR }
#endif
/** @} */
@@ -53,9 +53,9 @@ extern "C" {
*/
static const lc709203f_params_t params_default[] = {
#ifdef LC709203F_PARAMS_BOARD
- LC709203F_PARAMS_BOARD
+ LC709203F_PARAMS_BOARD
#else
- LC709203F_PARAMS
+ LC709203F_PARAMS
#endif
};
diff --git a/drivers/lis2dh12/lis2dh12.c b/drivers/lis2dh12/lis2dh12.c
index 9980a83f0..6b2c26d0a 100644
--- a/drivers/lis2dh12/lis2dh12.c
+++ b/drivers/lis2dh12/lis2dh12.c
@@ -57,7 +57,7 @@ static uint8_t _read(const lis2dh12_t *dev, uint8_t reg)
}
static void _read_burst(const lis2dh12_t *dev, uint8_t reg,
- void *data, size_t len)
+ void *data, size_t len)
{
spi_transfer_regs(BUS, CS, (FLAG_READ | FLAG_AINC | reg), NULL, data, len);
}
diff --git a/drivers/lis3dh/include/lis3dh_params.h b/drivers/lis3dh/include/lis3dh_params.h
index fc6bc9c1f..2c3deb899 100644
--- a/drivers/lis3dh/include/lis3dh_params.h
+++ b/drivers/lis3dh/include/lis3dh_params.h
@@ -50,10 +50,10 @@ extern "C" {
#define LIS3DH_PARAM_ODR (LIS3DH_ODR_100Hz)
#endif
-#define LIS3DH_PARAMS_DEFAULT { .spi = LIS3DH_PARAM_SPI, \
- .cs = LIS3DH_PARAM_CS, \
- .int1 = LIS3DH_PARAM_INT1, \
- .int2 = LIS3DH_PARAM_INT2, \
+#define LIS3DH_PARAMS_DEFAULT { .spi = LIS3DH_PARAM_SPI, \
+ .cs = LIS3DH_PARAM_CS, \
+ .int1 = LIS3DH_PARAM_INT1, \
+ .int2 = LIS3DH_PARAM_INT2, \
.scale = LIS3DH_PARAM_SCALE, \
.odr = LIS3DH_PARAM_ODR }
/**@}*/
diff --git a/drivers/lis3dh/lis3dh.c b/drivers/lis3dh/lis3dh.c
index 48325232e..1111de237 100644
--- a/drivers/lis3dh/lis3dh.c
+++ b/drivers/lis3dh/lis3dh.c
@@ -145,7 +145,7 @@ int lis3dh_set_fifo(const lis3dh_t *dev, const uint8_t mode, const uint8_t water
int status;
uint8_t reg;
reg = (watermark << LIS3DH_FIFO_CTRL_REG_FTH_SHIFT)
- & LIS3DH_FIFO_CTRL_REG_FTH_MASK;
+ & LIS3DH_FIFO_CTRL_REG_FTH_MASK;
reg |= mode;
status = lis3dh_write_reg(dev, LIS3DH_REG_FIFO_CTRL_REG, reg);
if (status < 0) {
@@ -154,10 +154,10 @@ int lis3dh_set_fifo(const lis3dh_t *dev, const uint8_t mode, const uint8_t water
}
if (mode != 0x00) {
status = lis3dh_write_bits(dev, LIS3DH_REG_CTRL_REG5,
- LIS3DH_CTRL_REG5_FIFO_EN_MASK, LIS3DH_CTRL_REG5_FIFO_EN_MASK);
+ LIS3DH_CTRL_REG5_FIFO_EN_MASK, LIS3DH_CTRL_REG5_FIFO_EN_MASK);
} else {
status = lis3dh_write_bits(dev, LIS3DH_REG_CTRL_REG5,
- LIS3DH_CTRL_REG5_FIFO_EN_MASK, 0);
+ LIS3DH_CTRL_REG5_FIFO_EN_MASK, 0);
}
return status;
}
@@ -165,7 +165,7 @@ int lis3dh_set_fifo(const lis3dh_t *dev, const uint8_t mode, const uint8_t water
int lis3dh_set_odr(const lis3dh_t *dev, const uint8_t odr)
{
return lis3dh_write_bits(dev, LIS3DH_REG_CTRL_REG1,
- LIS3DH_CTRL_REG1_ODR_MASK, odr);
+ LIS3DH_CTRL_REG1_ODR_MASK, odr);
}
int lis3dh_set_scale(lis3dh_t *dev, const uint8_t scale)
@@ -233,7 +233,7 @@ static int lis3dh_read_regs(const lis3dh_t *dev, const uint8_t reg,
{
/* Set READ MULTIPLE mode */
uint8_t addr = (reg & LIS3DH_SPI_ADDRESS_MASK) | LIS3DH_SPI_READ_MASK |
- LIS3DH_SPI_MULTI_MASK;
+ LIS3DH_SPI_MULTI_MASK;
/* Acquire exclusive access to the bus. */
spi_acquire(dev->spi, dev->cs, SPI_MODE, dev->clk);
diff --git a/drivers/lis3mdl/lis3mdl.c b/drivers/lis3mdl/lis3mdl.c
index e9612907e..0e14a5c52 100644
--- a/drivers/lis3mdl/lis3mdl.c
+++ b/drivers/lis3mdl/lis3mdl.c
@@ -43,7 +43,7 @@
*
* @return the converted signed number of 'value'
*/
- static inline int16_t _twos_complement(int16_t value)
+static inline int16_t _twos_complement(int16_t value)
{
if (value & MASK_INT16_MSB) {
value = ~(value & MASK_INT16_NMSB) + 1;
@@ -75,8 +75,8 @@ int lis3mdl_init(lis3mdl_t *dev, const lis3mdl_params_t *params)
}
tmp = ( LIS3MDL_MASK_REG1_TEMP_EN /* enable temperature sensor */
- | dev->params.xy_mode /* set x-, y-axis operative mode */
- | dev->params.odr); /* set output data rate */
+ | dev->params.xy_mode /* set x-, y-axis operative mode */
+ | dev->params.odr); /* set output data rate */
i2c_write_reg(DEV_I2C, DEV_ADDR, LIS3MDL_CTRL_REG1, tmp);
/* set Full-scale configuration */
@@ -143,7 +143,7 @@ void lis3mdl_enable(const lis3mdl_t *dev)
void lis3mdl_disable(const lis3mdl_t *dev)
{
uint8_t tmp = ( LIS3MDL_MASK_REG3_LOW_POWER_EN /**< enable power-down mode */
- | LIS3MDL_MASK_REG3_Z_LOW_POWER); /**< Z-axis low-power mode */
+ | LIS3MDL_MASK_REG3_Z_LOW_POWER); /**< Z-axis low-power mode */
i2c_acquire(DEV_I2C);
i2c_write_reg(DEV_I2C, DEV_ADDR, LIS3MDL_CTRL_REG3, tmp);
diff --git a/drivers/lsm303dlhc/include/lsm303dlhc_params.h b/drivers/lsm303dlhc/include/lsm303dlhc_params.h
index c44e7ec0f..533f085d2 100644
--- a/drivers/lsm303dlhc/include/lsm303dlhc_params.h
+++ b/drivers/lsm303dlhc/include/lsm303dlhc_params.h
@@ -59,14 +59,14 @@ extern "C" {
#define LSM303DLHC_PARAM_MAG_GAIN (LSM303DLHC_MAG_GAIN_450_400_GAUSS)
#endif
-#define LSM303DLHC_PARAMS_DEFAULT { .i2c = LSM303DLHC_PARAM_I2C, \
- .acc_addr = LSM303DLHC_PARAM_ACC_ADDR, \
- .acc_pin = LSM303DLHC_PARAM_ACC_PIN, \
- .acc_rate = LSM303DLHC_PARAM_ACC_RATE, \
+#define LSM303DLHC_PARAMS_DEFAULT { .i2c = LSM303DLHC_PARAM_I2C, \
+ .acc_addr = LSM303DLHC_PARAM_ACC_ADDR, \
+ .acc_pin = LSM303DLHC_PARAM_ACC_PIN, \
+ .acc_rate = LSM303DLHC_PARAM_ACC_RATE, \
.acc_scale = LSM303DLHC_PARAM_ACC_SCALE, \
- .mag_addr = LSM303DLHC_PARAM_MAG_ADDR, \
- .mag_pin = LSM303DLHC_PARAM_MAG_PIN, \
- .mag_rate = LSM303DLHC_PARAM_MAG_RATE, \
+ .mag_addr = LSM303DLHC_PARAM_MAG_ADDR, \
+ .mag_pin = LSM303DLHC_PARAM_MAG_PIN, \
+ .mag_rate = LSM303DLHC_PARAM_MAG_RATE, \
.mag_gain = LSM303DLHC_PARAM_MAG_GAIN }
/**@}*/
diff --git a/drivers/lsm303dlhc/lsm303dlhc.c b/drivers/lsm303dlhc/lsm303dlhc.c
index e89120b00..d04e78961 100644
--- a/drivers/lsm303dlhc/lsm303dlhc.c
+++ b/drivers/lsm303dlhc/lsm303dlhc.c
@@ -58,9 +58,9 @@ int lsm303dlhc_init(lsm303dlhc_t *dev, i2c_t i2c, gpio_t acc_pin, gpio_t mag_pin
/* configure accelerometer */
/* enable all three axis and set sample rate */
tmp = (LSM303DLHC_CTRL1_A_XEN
- | LSM303DLHC_CTRL1_A_YEN
- | LSM303DLHC_CTRL1_A_ZEN
- | acc_sample_rate);
+ | LSM303DLHC_CTRL1_A_YEN
+ | LSM303DLHC_CTRL1_A_ZEN
+ | acc_sample_rate);
i2c_acquire(dev->i2c);
res += i2c_write_reg(dev->i2c, dev->acc_address,
LSM303DLHC_REG_CTRL1_A, tmp);
@@ -109,13 +109,13 @@ int lsm303dlhc_read_acc(const lsm303dlhc_t *dev, lsm303dlhc_3d_data_t *data)
LSM303DLHC_REG_OUT_X_H_A, &tmp);
data->x_axis |= tmp<<8;
res += i2c_read_reg(dev->i2c, dev->acc_address,
- LSM303DLHC_REG_OUT_Y_L_A, &tmp);
+ LSM303DLHC_REG_OUT_Y_L_A, &tmp);
data->y_axis = tmp;
res += i2c_read_reg(dev->i2c, dev->acc_address,
LSM303DLHC_REG_OUT_Y_H_A, &tmp);
data->y_axis |= tmp<<8;
res += i2c_read_reg(dev->i2c, dev->acc_address,
- LSM303DLHC_REG_OUT_Z_L_A, &tmp);
+ LSM303DLHC_REG_OUT_Z_L_A, &tmp);
data->z_axis = tmp;
res += i2c_read_reg(dev->i2c, dev->acc_address,
LSM303DLHC_REG_OUT_Z_H_A, &tmp);
@@ -141,7 +141,7 @@ int lsm303dlhc_read_mag(const lsm303dlhc_t *dev, lsm303dlhc_3d_data_t *data)
int res;
DEBUG("lsm303dlhc: wait for mag values... ");
- while (gpio_read(dev->mag_pin) == 0){}
+ while (gpio_read(dev->mag_pin) == 0) {}
DEBUG("read ... ");
@@ -196,9 +196,9 @@ int lsm303dlhc_disable(const lsm303dlhc_t *dev)
res = i2c_write_reg(dev->i2c, dev->acc_address,
LSM303DLHC_REG_CTRL1_A, LSM303DLHC_CTRL1_A_POWEROFF);
res += i2c_write_reg(dev->i2c, dev->mag_address,
- LSM303DLHC_REG_MR_M, LSM303DLHC_MAG_MODE_SLEEP);
+ LSM303DLHC_REG_MR_M, LSM303DLHC_MAG_MODE_SLEEP);
res += i2c_write_reg(dev->i2c, dev->acc_address,
- LSM303DLHC_REG_CRA_M, LSM303DLHC_TEMP_DIS);
+ LSM303DLHC_REG_CRA_M, LSM303DLHC_TEMP_DIS);
i2c_release(dev->i2c);
return (res < 3) ? -1 : 0;
@@ -208,9 +208,9 @@ int lsm303dlhc_enable(const lsm303dlhc_t *dev)
{
int res;
uint8_t tmp = (LSM303DLHC_CTRL1_A_XEN
- | LSM303DLHC_CTRL1_A_YEN
- | LSM303DLHC_CTRL1_A_ZEN
- | LSM303DLHC_CTRL1_A_N1344HZ_L5376HZ);
+ | LSM303DLHC_CTRL1_A_YEN
+ | LSM303DLHC_CTRL1_A_ZEN
+ | LSM303DLHC_CTRL1_A_N1344HZ_L5376HZ);
i2c_acquire(dev->i2c);
res = i2c_write_reg(dev->i2c, dev->acc_address, LSM303DLHC_REG_CTRL1_A, tmp);
@@ -223,10 +223,10 @@ int lsm303dlhc_enable(const lsm303dlhc_t *dev)
res += i2c_write_reg(dev->i2c, dev->mag_address, LSM303DLHC_REG_CRA_M, tmp);
res += i2c_write_reg(dev->i2c, dev->mag_address,
- LSM303DLHC_REG_CRB_M, LSM303DLHC_GAIN_5);
+ LSM303DLHC_REG_CRB_M, LSM303DLHC_GAIN_5);
res += i2c_write_reg(dev->i2c, dev->mag_address,
- LSM303DLHC_REG_MR_M, LSM303DLHC_MAG_MODE_CONTINUOUS);
+ LSM303DLHC_REG_MR_M, LSM303DLHC_MAG_MODE_CONTINUOUS);
i2c_release(dev->i2c);
gpio_init(dev->mag_pin, GPIO_IN);
diff --git a/drivers/lsm6dsl/include/lsm6dsl_internal.h b/drivers/lsm6dsl/include/lsm6dsl_internal.h
index 0f99dbc78..55d98865a 100644
--- a/drivers/lsm6dsl/include/lsm6dsl_internal.h
+++ b/drivers/lsm6dsl/include/lsm6dsl_internal.h
@@ -159,7 +159,7 @@ extern "C" {
#define LSM6DSL_TEMP_OFFSET (0x1900)
/**
- * @brief Reboot wait interval in us (15ms)
+ * @brief Reboot wait interval in us (15ms)
*/
#define LSM6DSL_BOOT_WAIT (15 * US_PER_MS)
diff --git a/drivers/mag3110/include/mag3110_params.h b/drivers/mag3110/include/mag3110_params.h
index f0aa1f529..7a86f012e 100644
--- a/drivers/mag3110/include/mag3110_params.h
+++ b/drivers/mag3110/include/mag3110_params.h
@@ -42,9 +42,9 @@ extern "C" {
#define MAG3110_PARAM_OFFSET { 0, 0, 0 }
#endif
#ifndef MAG3110_PARAMS
-#define MAG3110_PARAMS { .i2c = MAG3110_PARAM_I2C, \
- .addr = MAG3110_PARAM_ADDR, \
- .type = MAG3110_ID, \
+#define MAG3110_PARAMS { .i2c = MAG3110_PARAM_I2C, \
+ .addr = MAG3110_PARAM_ADDR, \
+ .type = MAG3110_ID, \
.dros = MAG3110_DROS_DEFAULT, \
.offset = MAG3110_PARAM_OFFSET }
#endif
diff --git a/drivers/mag3110/include/mag3110_reg.h b/drivers/mag3110/include/mag3110_reg.h
index 6e74e7dbf..69f960cb4 100644
--- a/drivers/mag3110/include/mag3110_reg.h
+++ b/drivers/mag3110/include/mag3110_reg.h
@@ -62,8 +62,8 @@ extern "C"
#define MAG3110_CTRL_REG1_DROS_SHIFT 3
#define MAG3110_CTRL_REG1_DROS_MASK 0xF8
-#define MAG3110_CTRL_REG1_DROS(x) (((uint8_t)(((uint8_t)(x))<<MAG3110_CTRL_REG1_DROS_SHIFT))\
- &MAG3110_CTRL_REG1_DROS_MASK)
+#define MAG3110_CTRL_REG1_DROS(x) (((uint8_t)(((uint8_t)(x))<<MAG3110_CTRL_REG1_DROS_SHIFT)) \
+ &MAG3110_CTRL_REG1_DROS_MASK)
#define MAG3110_CTRL_REG1_FR (1 << 2)
#define MAG3110_CTRL_REG1_TM (1 << 1)
#define MAG3110_CTRL_REG1_AC (1 << 0)
diff --git a/drivers/mag3110/mag3110.c b/drivers/mag3110/mag3110.c
index d1acf21ff..42195883d 100644
--- a/drivers/mag3110/mag3110.c
+++ b/drivers/mag3110/mag3110.c
@@ -198,8 +198,8 @@ int mag3110_read(const mag3110_t *dev, mag3110_data_t *data)
}
i2c_release(BUS);
/* TODO: implement state handling, if needed?
- uint8_t status = buf[0];
- */
+ uint8_t status = buf[0];
+ */
data->x = ((int16_t)buf[1] << 8) | buf[2];
data->y = ((int16_t)buf[3] << 8) | buf[4];
data->z = ((int16_t)buf[5] << 8) | buf[6];
diff --git a/drivers/mma8x5x/include/mma8x5x_regs.h b/drivers/mma8x5x/include/mma8x5x_regs.h
index ec290c48e..4f50fde5a 100644
--- a/drivers/mma8x5x/include/mma8x5x_regs.h
+++ b/drivers/mma8x5x/include/mma8x5x_regs.h
@@ -207,8 +207,8 @@ extern "C"
#define MMA8X5X_CTRL_REG1_F_READ (1 << 1)
#define MMA8X5X_CTRL_REG1_DR_MASK 0x38
#define MMA8X5X_CTRL_REG1_DR_SHIFT 3
-#define MMA8X5X_CTRL_REG1_DR(x) (((uint8_t)(((uint8_t)(x))<<MMA8X5X_CTRL_REG1_DR_SHIFT))\
- &MMA8X5X_CTRL_REG1_DR_MASK)
+#define MMA8X5X_CTRL_REG1_DR(x) (((uint8_t)(((uint8_t)(x))<<MMA8X5X_CTRL_REG1_DR_SHIFT)) \
+ &MMA8X5X_CTRL_REG1_DR_MASK)
#define MMA8X5X_CTRL_REG1_ASR_MASK 0xC0
#define MMA8X5X_CTRL_REG1_ASR_50HZ 0
#define MMA8X5X_CTRL_REG1_ASR_12HZ5 1
diff --git a/drivers/mma8x5x/mma8x5x.c b/drivers/mma8x5x/mma8x5x.c
index 8bf810d6d..7f7564f98 100644
--- a/drivers/mma8x5x/mma8x5x.c
+++ b/drivers/mma8x5x/mma8x5x.c
@@ -61,7 +61,7 @@ int mma8x5x_init(mma8x5x_t *dev, const mma8x5x_params_t *params)
if (reg != dev->params.type) {
i2c_release(BUS);
DEBUG("[mma8x5x] init - error: invalid WHO_AM_I value [0x%02x]\n",
- (int)reg);
+ (int)reg);
return MMA8X5X_NODEV;
}
@@ -130,7 +130,7 @@ static void _reg_setbits(const mma8x5x_t *dev, uint8_t reg, uint8_t val)
i2c_acquire(BUS);
i2c_read_reg(BUS, ADDR, reg, &tmp);
DEBUG("[mma8x5x] 0x%02x: 0x%02x | 0x%02x = 0x%02x\n",
- (unsigned)reg, (unsigned)tmp, (unsigned)val, (unsigned) tmp | val);
+ (unsigned)reg, (unsigned)tmp, (unsigned)val, (unsigned) tmp | val);
tmp |= val;
i2c_write_reg(BUS, ADDR, reg, tmp);
i2c_release(BUS);
@@ -145,7 +145,7 @@ static void _reg_clearbits(const mma8x5x_t *dev, uint8_t reg, uint8_t val)
i2c_acquire(BUS);
i2c_read_reg(BUS, ADDR, reg, &tmp);
DEBUG("[mma8x5x] 0x%02x: 0x%02x &= ~0x%02x = 0x%02x\n",
- (unsigned)reg, (unsigned)tmp, (unsigned)val, (unsigned) tmp & ~val);
+ (unsigned)reg, (unsigned)tmp, (unsigned)val, (unsigned) tmp & ~val);
tmp &= ~val;
i2c_write_reg(BUS, ADDR, reg, tmp);
i2c_release(BUS);
@@ -170,11 +170,11 @@ void mma8x5x_set_motiondetect(const mma8x5x_t *dev, uint8_t int_pin, uint8_t thr
mma8x5x_set_standby(dev);
- _reg_setbits(dev, MMA8X5X_FF_MT_CFG, \
- MMA8X5X_FF_MT_CFG_XEFE | \
- MMA8X5X_FF_MT_CFG_YEFE | \
- MMA8X5X_FF_MT_CFG_ZEFE | \
- MMA8X5X_FF_MT_CFG_OAE | MMA8X5X_FF_MT_CFG_ELE);
+ _reg_setbits(dev, MMA8X5X_FF_MT_CFG, \
+ MMA8X5X_FF_MT_CFG_XEFE | \
+ MMA8X5X_FF_MT_CFG_YEFE | \
+ MMA8X5X_FF_MT_CFG_ZEFE | \
+ MMA8X5X_FF_MT_CFG_OAE | MMA8X5X_FF_MT_CFG_ELE);
switch(int_pin) {
case 0:
diff --git a/drivers/mpl3115a2/include/mpl3115a2_reg.h b/drivers/mpl3115a2/include/mpl3115a2_reg.h
index b7470e142..2edae37df 100644
--- a/drivers/mpl3115a2/include/mpl3115a2_reg.h
+++ b/drivers/mpl3115a2/include/mpl3115a2_reg.h
@@ -89,15 +89,15 @@ extern "C"
#define MPL3115A2_CTRL_REG1_RST (1 << 2)
#define MPL3115A2_CTRL_REG1_OS_SHIFT 3
#define MPL3115A2_CTRL_REG1_OS_MASK 0x38
-#define MPL3115A2_CTRL_REG1_OS(x) (((uint8_t)(((uint8_t)(x))<<MPL3115A2_CTRL_REG1_OS_SHIFT))\
- &MPL3115A2_CTRL_REG1_OS_MASK)
+#define MPL3115A2_CTRL_REG1_OS(x) (((uint8_t)(((uint8_t)(x))<<MPL3115A2_CTRL_REG1_OS_SHIFT)) \
+ &MPL3115A2_CTRL_REG1_OS_MASK)
#define MPL3115A2_CTRL_REG1_RAW (1 << 6)
#define MPL3115A2_CTRL_REG1_ALT (1 << 7)
#define MPL3115A2_CTRL_REG2_ST_SHIFT 0
#define MPL3115A2_CTRL_REG2_ST_MASK 0xF
-#define MPL3115A2_CTRL_REG2_ST(x) (((uint8_t)(((uint8_t)(x))<<MPL3115A2_CTRL_REG2_ST_SHIFT))\
- &MPL3115A2_CTRL_REG2_ST_MASK)
+#define MPL3115A2_CTRL_REG2_ST(x) (((uint8_t)(((uint8_t)(x))<<MPL3115A2_CTRL_REG2_ST_SHIFT)) \
+ &MPL3115A2_CTRL_REG2_ST_MASK)
#define MPL3115A2_CTRL_REG2_ALARM_SEL (1 << 4)
#define MPL3115A2_CTRL_REG2_LOAD_OPUT (1 << 5)
diff --git a/drivers/mpu9150/include/mpu9150-regs.h b/drivers/mpu9150/include/mpu9150-regs.h
index c40ff99fd..9b5683d6a 100644
--- a/drivers/mpu9150/include/mpu9150-regs.h
+++ b/drivers/mpu9150/include/mpu9150-regs.h
@@ -21,7 +21,7 @@
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
@@ -64,10 +64,10 @@
#define MPU9150_WHO_AM_I_REG (0x75)
/** @} */
- /**
- * @name Compass register definitions
- * @{
- */
+/**
+ * @name Compass register definitions
+ * @{
+ */
#define COMPASS_WHOAMI_REG (0x00)
#define COMPASS_ST1_REG (0x02)
#define COMPASS_DATA_START_REG (0x03)
diff --git a/drivers/mpu9150/mpu9150.c b/drivers/mpu9150/mpu9150.c
index cd4b3f909..8308190c3 100644
--- a/drivers/mpu9150/mpu9150.c
+++ b/drivers/mpu9150/mpu9150.c
@@ -53,8 +53,8 @@ static void conf_bypass(const mpu9150_t *dev, uint8_t bypass_enable);
static void conf_lpf(const mpu9150_t *dev, uint16_t rate);
/*---------------------------------------------------------------------------*
- * MPU9150 Core API *
- *---------------------------------------------------------------------------*/
+* MPU9150 Core API *
+*---------------------------------------------------------------------------*/
int mpu9150_init(mpu9150_t *dev, const mpu9150_params_t *params)
{
@@ -136,7 +136,7 @@ int mpu9150_set_accel_power(mpu9150_t *dev, mpu9150_pwr_t pwr_conf)
}
/* Configure power management 1 register if needed */
if ((dev->conf.gyro_pwr == MPU9150_SENSOR_PWR_OFF)
- && (dev->conf.compass_pwr == MPU9150_SENSOR_PWR_OFF)) {
+ && (dev->conf.compass_pwr == MPU9150_SENSOR_PWR_OFF)) {
i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_PWR_MGMT_1_REG, pwr_1_setting);
}
/* Enable/disable accelerometer standby in power management 2 register */
@@ -175,15 +175,15 @@ int mpu9150_set_gyro_power(mpu9150_t *dev, mpu9150_pwr_t pwr_conf)
else {
/* Configure power management 1 register */
if ((dev->conf.accel_pwr == MPU9150_SENSOR_PWR_OFF)
- && (dev->conf.compass_pwr == MPU9150_SENSOR_PWR_OFF)) {
+ && (dev->conf.compass_pwr == MPU9150_SENSOR_PWR_OFF)) {
/* All sensors turned off, put the MPU-9150 to sleep */
i2c_write_reg(DEV_I2C, DEV_ADDR,
- MPU9150_PWR_MGMT_1_REG, BIT_PWR_MGMT1_SLEEP);
+ MPU9150_PWR_MGMT_1_REG, BIT_PWR_MGMT1_SLEEP);
}
else {
/* Reset clock to internal oscillator */
i2c_write_reg(DEV_I2C, DEV_ADDR,
- MPU9150_PWR_MGMT_1_REG, MPU9150_PWR_WAKEUP);
+ MPU9150_PWR_MGMT_1_REG, MPU9150_PWR_WAKEUP);
}
pwr_2_setting |= MPU9150_PWR_GYRO;
}
@@ -227,7 +227,7 @@ int mpu9150_set_compass_power(mpu9150_t *dev, mpu9150_pwr_t pwr_conf)
}
/* Configure power management 1 register if needed */
if ((dev->conf.gyro_pwr == MPU9150_SENSOR_PWR_OFF)
- && (dev->conf.accel_pwr == MPU9150_SENSOR_PWR_OFF)) {
+ && (dev->conf.accel_pwr == MPU9150_SENSOR_PWR_OFF)) {
i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_PWR_MGMT_1_REG, pwr_1_setting);
}
/* Configure mode writing by slave line 1 */
@@ -349,11 +349,11 @@ int mpu9150_read_compass(const mpu9150_t *dev, mpu9150_results_t *output)
/* Compute sensitivity adjustment */
output->x_axis = (int16_t) (((float)output->x_axis) *
- ((((dev->conf.compass_x_adj - 128) * 0.5) / 128.0) + 1));
+ ((((dev->conf.compass_x_adj - 128) * 0.5) / 128.0) + 1));
output->y_axis = (int16_t) (((float)output->y_axis) *
- ((((dev->conf.compass_y_adj - 128) * 0.5) / 128.0) + 1));
+ ((((dev->conf.compass_y_adj - 128) * 0.5) / 128.0) + 1));
output->z_axis = (int16_t) (((float)output->z_axis) *
- ((((dev->conf.compass_z_adj - 128) * 0.5) / 128.0) + 1));
+ ((((dev->conf.compass_z_adj - 128) * 0.5) / 128.0) + 1));
/* Normalize data according to full-scale range */
output->x_axis = output->x_axis * 0.3;
@@ -398,7 +398,7 @@ int mpu9150_set_gyro_fsr(mpu9150_t *dev, mpu9150_gyro_ranges_t fsr)
return -1;
}
i2c_write_reg(DEV_I2C, DEV_ADDR,
- MPU9150_GYRO_CFG_REG, (fsr << 3));
+ MPU9150_GYRO_CFG_REG, (fsr << 3));
i2c_release(DEV_I2C);
dev->conf.gyro_fsr = fsr;
break;
@@ -424,7 +424,7 @@ int mpu9150_set_accel_fsr(mpu9150_t *dev, mpu9150_accel_ranges_t fsr)
return -1;
}
i2c_write_reg(DEV_I2C, DEV_ADDR,
- MPU9150_ACCEL_CFG_REG, (fsr << 3));
+ MPU9150_ACCEL_CFG_REG, (fsr << 3));
i2c_release(DEV_I2C);
dev->conf.accel_fsr = fsr;
break;
@@ -469,7 +469,7 @@ int mpu9150_set_compass_sample_rate(mpu9150_t *dev, uint8_t rate)
uint8_t divider;
if ((rate < MPU9150_MIN_COMP_SMPL_RATE) || (rate > MPU9150_MAX_COMP_SMPL_RATE)
- || (rate > dev->conf.sample_rate)) {
+ || (rate > dev->conf.sample_rate)) {
return -2;
}
else if (dev->conf.compass_sample_rate == rate) {
@@ -538,7 +538,7 @@ static int compass_init(mpu9150_t *dev)
/* Set up slave line 0 */
/* Slave line 0 reads the compass data */
i2c_write_reg(DEV_I2C, DEV_ADDR,
- MPU9150_SLAVE0_ADDR_REG, (BIT_SLAVE_RW | DEV_COMP_ADDR));
+ MPU9150_SLAVE0_ADDR_REG, (BIT_SLAVE_RW | DEV_COMP_ADDR));
/* Slave line 0 read starts at compass data register */
i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_SLAVE0_REG_REG, COMPASS_DATA_START_REG);
/* Enable slave line 0 and configure read length to 6 consecutive registers */
@@ -553,11 +553,11 @@ static int compass_init(mpu9150_t *dev)
i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_SLAVE1_CTRL_REG, (BIT_SLAVE_EN | 0x01));
/* Configure data which is written by slave line 1 to compass control */
i2c_write_reg(DEV_I2C, DEV_ADDR,
- MPU9150_SLAVE1_DATA_OUT_REG, MPU9150_COMP_SINGLE_MEASURE);
+ MPU9150_SLAVE1_DATA_OUT_REG, MPU9150_COMP_SINGLE_MEASURE);
/* Slave line 0 and 1 operate at each sample */
i2c_write_reg(DEV_I2C, DEV_ADDR,
- MPU9150_I2C_DELAY_CTRL_REG, (BIT_SLV0_DELAY_EN | BIT_SLV1_DELAY_EN));
+ MPU9150_I2C_DELAY_CTRL_REG, (BIT_SLV0_DELAY_EN | BIT_SLV1_DELAY_EN));
/* Set I2C bus to VDD */
i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_YG_OFFS_TC_REG, BIT_I2C_MST_VDDIO);
@@ -571,21 +571,21 @@ static int compass_init(mpu9150_t *dev)
*/
static void conf_bypass(const mpu9150_t *dev, uint8_t bypass_enable)
{
- uint8_t data;
- i2c_read_reg(DEV_I2C, DEV_ADDR, MPU9150_USER_CTRL_REG, &data);
-
- if (bypass_enable) {
- data &= ~(BIT_I2C_MST_EN);
- i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_USER_CTRL_REG, data);
- xtimer_usleep(MPU9150_BYPASS_SLEEP_US);
- i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_INT_PIN_CFG_REG, BIT_I2C_BYPASS_EN);
- }
- else {
- data |= BIT_I2C_MST_EN;
- i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_USER_CTRL_REG, data);
- xtimer_usleep(MPU9150_BYPASS_SLEEP_US);
- i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_INT_PIN_CFG_REG, REG_RESET);
- }
+ uint8_t data;
+ i2c_read_reg(DEV_I2C, DEV_ADDR, MPU9150_USER_CTRL_REG, &data);
+
+ if (bypass_enable) {
+ data &= ~(BIT_I2C_MST_EN);
+ i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_USER_CTRL_REG, data);
+ xtimer_usleep(MPU9150_BYPASS_SLEEP_US);
+ i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_INT_PIN_CFG_REG, BIT_I2C_BYPASS_EN);
+ }
+ else {
+ data |= BIT_I2C_MST_EN;
+ i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_USER_CTRL_REG, data);
+ xtimer_usleep(MPU9150_BYPASS_SLEEP_US);
+ i2c_write_reg(DEV_I2C, DEV_ADDR, MPU9150_INT_PIN_CFG_REG, REG_RESET);
+ }
}
/**
diff --git a/drivers/mrf24j40/mrf24j40_getset.c b/drivers/mrf24j40/mrf24j40_getset.c
index 92a19f393..026735a19 100644
--- a/drivers/mrf24j40/mrf24j40_getset.c
+++ b/drivers/mrf24j40/mrf24j40_getset.c
@@ -482,8 +482,8 @@ void mrf24j40_software_reset(mrf24j40_t *dev)
uint8_t softrst;
mrf24j40_reg_write_short(dev, MRF24J40_REG_SOFTRST, MRF24J40_SOFTRST_RSTPWR |
- MRF24J40_SOFTRST_RSTBB |
- MRF24J40_SOFTRST_RSTMAC );
+ MRF24J40_SOFTRST_RSTBB |
+ MRF24J40_SOFTRST_RSTMAC );
do {
softrst = mrf24j40_reg_read_short(dev, MRF24J40_REG_SOFTRST);
} while (softrst != 0); /* wait until soft-reset has finished */
diff --git a/drivers/mrf24j40/mrf24j40_internal.c b/drivers/mrf24j40/mrf24j40_internal.c
index 39e09cdd9..0cbeccc39 100644
--- a/drivers/mrf24j40/mrf24j40_internal.c
+++ b/drivers/mrf24j40/mrf24j40_internal.c
@@ -47,8 +47,8 @@ void mrf24j40_init(mrf24j40_t *dev)
if ((txmcr == 0xFF) || (txmcr == 0x00)) {
/* Write default value to TXMCR register */
mrf24j40_reg_write_short(dev, MRF24J40_REG_TXMCR, MRF24J40_TXMCR_MACMINBE1 |
- MRF24J40_TXMCR_MACMINBE0 |
- MRF24J40_TXMCR_CSMABF2);
+ MRF24J40_TXMCR_MACMINBE0 |
+ MRF24J40_TXMCR_CSMABF2);
txmcr = mrf24j40_reg_read_short(dev, MRF24J40_REG_TXMCR);
if (txmcr != (MRF24J40_TXMCR_MACMINBE1 |
MRF24J40_TXMCR_MACMINBE0 |
@@ -62,8 +62,8 @@ void mrf24j40_init(mrf24j40_t *dev)
/* do a soft reset */
mrf24j40_reg_write_short(dev, MRF24J40_REG_SOFTRST, MRF24J40_SOFTRST_RSTPWR |
- MRF24J40_SOFTRST_RSTBB |
- MRF24J40_SOFTRST_RSTMAC );
+ MRF24J40_SOFTRST_RSTBB |
+ MRF24J40_SOFTRST_RSTMAC );
/* flush RX FIFO */
mrf24j40_reg_write_short(dev, MRF24J40_REG_RXFLUSH, MRF24J40_RXFLUSH_RXFLUSH);
@@ -109,8 +109,8 @@ uint8_t mrf24j40_reg_read_short(mrf24j40_t *dev, const uint8_t addr)
getbus(dev);
value = spi_transfer_reg(SPIDEV, CSPIN, MRF24J40_SHORT_ADDR_TRANS |
- (addr << MRF24J40_ADDR_OFFSET) |
- MRF24J40_ACCESS_READ, 0);
+ (addr << MRF24J40_ADDR_OFFSET) |
+ MRF24J40_ACCESS_READ, 0);
spi_release(SPIDEV);
return (uint8_t)value;
}
@@ -118,9 +118,9 @@ uint8_t mrf24j40_reg_read_short(mrf24j40_t *dev, const uint8_t addr)
void mrf24j40_reg_write_short(mrf24j40_t *dev, const uint8_t addr, const uint8_t value)
{
getbus(dev);
- spi_transfer_reg(SPIDEV, CSPIN , MRF24J40_SHORT_ADDR_TRANS |
- (addr << MRF24J40_ADDR_OFFSET) |
- MRF24J40_ACCESS_WRITE, value);
+ spi_transfer_reg(SPIDEV, CSPIN, MRF24J40_SHORT_ADDR_TRANS |
+ (addr << MRF24J40_ADDR_OFFSET) |
+ MRF24J40_ACCESS_WRITE, value);
spi_release(SPIDEV);
}
diff --git a/drivers/mrf24j40/mrf24j40_netdev.c b/drivers/mrf24j40/mrf24j40_netdev.c
index 10f534689..333aac42a 100644
--- a/drivers/mrf24j40/mrf24j40_netdev.c
+++ b/drivers/mrf24j40/mrf24j40_netdev.c
@@ -320,7 +320,7 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
default:
/* try netdev settings */
res = netdev_ieee802154_get((netdev_ieee802154_t *)netdev, opt,
- val, max_len);
+ val, max_len);
}
return res;
}
@@ -517,7 +517,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
/* try netdev building flags */
if (res == -ENOTSUP) {
res = netdev_ieee802154_set((netdev_ieee802154_t *)netdev, opt,
- val, len);
+ val, len);
}
return res;
}
diff --git a/drivers/mtd_sdcard/mtd_sdcard.c b/drivers/mtd_sdcard/mtd_sdcard.c
index 80423e912..bbab5d3ff 100644
--- a/drivers/mtd_sdcard/mtd_sdcard.c
+++ b/drivers/mtd_sdcard/mtd_sdcard.c
@@ -116,6 +116,6 @@ static int mtd_sdcard_power(mtd_dev_t *dev, enum mtd_power_state power)
(void)power;
/* TODO: implement power down of sdcard in sdcard_spi
- (make use of sdcard_spi_params_t.power pin) */
+ (make use of sdcard_spi_params_t.power pin) */
return -ENOTSUP; /* currently not supported */
}
diff --git a/drivers/my9221/include/my9221_internal.h b/drivers/my9221/include/my9221_internal.h
index ecc895fae..95874e716 100644
--- a/drivers/my9221/include/my9221_internal.h
+++ b/drivers/my9221/include/my9221_internal.h
@@ -26,17 +26,17 @@ extern "C" {
#endif
/**
- * @brief Time to wait until latch register is processed
+ * @brief Time to wait until latch register is processed
*/
#define MY9221_LATCH_WAIT (10U * US_PER_MS)
/**
- * @brief Number of write loops for latch register
+ * @brief Number of write loops for latch register
*/
#define MY9221_LATCH_LOOP (4U)
/**
- * @brief Enable command mode on LED controller
+ * @brief Enable command mode on LED controller
*/
#define MY9221_CMDMODE (0x00)
diff --git a/drivers/netdev_eth/netdev_eth.c b/drivers/netdev_eth/netdev_eth.c
index 550bc049b..1ddf92607 100644
--- a/drivers/netdev_eth/netdev_eth.c
+++ b/drivers/netdev_eth/netdev_eth.c
@@ -47,61 +47,61 @@ int netdev_eth_get(netdev_t *dev, netopt_t opt, void *value, size_t max_len)
switch (opt) {
case NETOPT_DEVICE_TYPE:
- {
- uint16_t *tgt = (uint16_t *)value;
- *tgt = NETDEV_TYPE_ETHERNET;
- res = 2;
- break;
- }
+ {
+ uint16_t *tgt = (uint16_t *)value;
+ *tgt = NETDEV_TYPE_ETHERNET;
+ res = 2;
+ break;
+ }
case NETOPT_ADDR_LEN:
case NETOPT_SRC_LEN:
- {
- assert(max_len == 2);
- uint16_t *tgt = (uint16_t*)value;
- *tgt=6;
- res = sizeof(uint16_t);
- break;
- }
+ {
+ assert(max_len == 2);
+ uint16_t *tgt = (uint16_t*)value;
+ *tgt=6;
+ res = sizeof(uint16_t);
+ break;
+ }
case NETOPT_MAX_PACKET_SIZE:
- {
- assert(max_len >= 2);
- uint16_t *val = (uint16_t*) value;
- *val = ETHERNET_DATA_LEN;
- res = sizeof(uint16_t);
- break;
- }
+ {
+ assert(max_len >= 2);
+ uint16_t *val = (uint16_t*) value;
+ *val = ETHERNET_DATA_LEN;
+ res = sizeof(uint16_t);
+ break;
+ }
case NETOPT_IS_WIRED:
- {
- res = 1;
- break;
- }
+ {
+ res = 1;
+ break;
+ }
case NETOPT_IPV6_IID:
- {
- return _get_iid(dev, value, max_len);
- }
+ {
+ return _get_iid(dev, value, max_len);
+ }
#ifdef MODULE_NETSTATS_L2
case NETOPT_STATS:
- {
- assert(max_len >= sizeof(uintptr_t));
- *((netstats_t**)value) = &dev->stats;
- res = sizeof(uintptr_t);
- break;
- }
+ {
+ assert(max_len >= sizeof(uintptr_t));
+ *((netstats_t**)value) = &dev->stats;
+ res = sizeof(uintptr_t);
+ break;
+ }
#endif
#ifdef MODULE_L2FILTER
case NETOPT_L2FILTER:
- {
- assert(max_len >= sizeof(l2filter_t **));
- *((l2filter_t **)value) = dev->filter;
- res = sizeof(l2filter_t **);
- break;
- }
+ {
+ assert(max_len >= sizeof(l2filter_t **));
+ *((l2filter_t **)value) = dev->filter;
+ res = sizeof(l2filter_t **);
+ break;
+ }
#endif
default:
- {
- res = -ENOTSUP;
- break;
- }
+ {
+ res = -ENOTSUP;
+ break;
+ }
}
return res;
diff --git a/drivers/netdev_ieee802154/netdev_ieee802154.c b/drivers/netdev_ieee802154/netdev_ieee802154.c
index eb5a90f7e..369e6aeee 100644
--- a/drivers/netdev_ieee802154/netdev_ieee802154.c
+++ b/drivers/netdev_ieee802154/netdev_ieee802154.c
@@ -51,7 +51,7 @@ static int _get_iid(netdev_ieee802154_t *dev, eui64_t *value, size_t max_len)
}
int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value,
- size_t max_len)
+ size_t max_len)
{
int res = -ENOTSUP;
@@ -143,7 +143,7 @@ int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value,
}
int netdev_ieee802154_set(netdev_ieee802154_t *dev, netopt_t opt, const void *value,
- size_t len)
+ size_t len)
{
int res = -ENOTSUP;
diff --git a/drivers/nrf24l01p/nrf24l01p.c b/drivers/nrf24l01p/nrf24l01p.c
index f8ecf5d66..6d2ebecb0 100644
--- a/drivers/nrf24l01p/nrf24l01p.c
+++ b/drivers/nrf24l01p/nrf24l01p.c
@@ -729,61 +729,61 @@ int nrf24l01p_enable_dynamic_payload(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t
DEBUG("Can't read REG_FEATURE\n");
return -1;
}
- if (!(feature_val & FEATURE_EN_DPL)){
+ if (!(feature_val & FEATURE_EN_DPL)) {
feature_val |= FEATURE_EN_DPL;
- if (nrf24l01p_write_reg(dev, REG_FEATURE, feature_val) < 0){
+ if (nrf24l01p_write_reg(dev, REG_FEATURE, feature_val) < 0) {
DEBUG("Can't write REG_FEATURE\n");
return -1;
}
}
- if (nrf24l01p_read_reg(dev, REG_EN_AA, &en_aa_val) < 0){
+ if (nrf24l01p_read_reg(dev, REG_EN_AA, &en_aa_val) < 0) {
DEBUG("Can't read REG_EN_AA\n");
return -1;
}
- switch (pipe){
- case NRF24L01P_PIPE0:
- pipe_mask = ENAA_P0;
- dpl_mask = DYNPD_DPL_P0;
- break;
- case NRF24L01P_PIPE1:
- pipe_mask = ENAA_P1;
- dpl_mask = DYNPD_DPL_P1;
- break;
- case NRF24L01P_PIPE2:
- pipe_mask = ENAA_P2;
- dpl_mask = DYNPD_DPL_P2;
- break;
- case NRF24L01P_PIPE3:
- pipe_mask = ENAA_P3;
- dpl_mask = DYNPD_DPL_P3;
- break;
- case NRF24L01P_PIPE4:
- pipe_mask = ENAA_P4;
- dpl_mask = DYNPD_DPL_P4;
- break;
- case NRF24L01P_PIPE5:
- pipe_mask = ENAA_P5;
- dpl_mask = DYNPD_DPL_P5;
- break;
- }
-
- if (!(en_aa_val & pipe_mask)){
+ switch (pipe) {
+ case NRF24L01P_PIPE0:
+ pipe_mask = ENAA_P0;
+ dpl_mask = DYNPD_DPL_P0;
+ break;
+ case NRF24L01P_PIPE1:
+ pipe_mask = ENAA_P1;
+ dpl_mask = DYNPD_DPL_P1;
+ break;
+ case NRF24L01P_PIPE2:
+ pipe_mask = ENAA_P2;
+ dpl_mask = DYNPD_DPL_P2;
+ break;
+ case NRF24L01P_PIPE3:
+ pipe_mask = ENAA_P3;
+ dpl_mask = DYNPD_DPL_P3;
+ break;
+ case NRF24L01P_PIPE4:
+ pipe_mask = ENAA_P4;
+ dpl_mask = DYNPD_DPL_P4;
+ break;
+ case NRF24L01P_PIPE5:
+ pipe_mask = ENAA_P5;
+ dpl_mask = DYNPD_DPL_P5;
+ break;
+ }
+
+ if (!(en_aa_val & pipe_mask)) {
en_aa_val |= pipe_mask;
- if (nrf24l01p_write_reg(dev, REG_EN_AA, en_aa_val) < 0){
+ if (nrf24l01p_write_reg(dev, REG_EN_AA, en_aa_val) < 0) {
DEBUG("Can't write REG_EN_AA\n");
return -1;
}
}
- if (nrf24l01p_read_reg(dev, REG_DYNPD, &dynpd_val) < 0){
+ if (nrf24l01p_read_reg(dev, REG_DYNPD, &dynpd_val) < 0) {
DEBUG("Can't read REG_DYNPD\n");
return -1;
}
- if (!(dynpd_val & dpl_mask)){
+ if (!(dynpd_val & dpl_mask)) {
dynpd_val |= dpl_mask;
- if (nrf24l01p_write_reg(dev, REG_DYNPD, dynpd_val) < 0){
+ if (nrf24l01p_write_reg(dev, REG_DYNPD, dynpd_val) < 0) {
DEBUG("Can't write REG_DYNPD\n");
return -1;
}
@@ -894,13 +894,13 @@ int nrf24l01p_enable_dynamic_ack(const nrf24l01p_t *dev)
{
char feature;
- if (nrf24l01p_read_reg(dev, REG_FEATURE, &feature) < 0){
+ if (nrf24l01p_read_reg(dev, REG_FEATURE, &feature) < 0) {
DEBUG("Can't read FEATURE reg\n");
- return -1;
+ return -1;
}
- if (!(feature & FEATURE_EN_DYN_ACK)){
+ if (!(feature & FEATURE_EN_DYN_ACK)) {
feature |= FEATURE_EN_DYN_ACK;
- if (nrf24l01p_write_reg(dev, REG_FEATURE, feature) < 0){
+ if (nrf24l01p_write_reg(dev, REG_FEATURE, feature) < 0) {
DEBUG("Can't write FEATURE reg\n");
return -1;
}
diff --git a/drivers/nvram_spi/nvram-spi.c b/drivers/nvram_spi/nvram-spi.c
index f9286cae0..1a6022ca6 100644
--- a/drivers/nvram_spi/nvram-spi.c
+++ b/drivers/nvram_spi/nvram-spi.c
@@ -144,8 +144,8 @@ static int nvram_spi_write(nvram_t *dev, const uint8_t *src, uint32_t dst, size_
/* Write command and address */
spi_transfer_byte(spi_dev->spi, spi_dev->cs, true, NVRAM_SPI_CMD_WRITE);
spi_transfer_bytes(spi_dev->spi, spi_dev->cs, true,
- &addr.c[sizeof(addr.c) - spi_dev->address_count], NULL,
- spi_dev->address_count);
+ &addr.c[sizeof(addr.c) - spi_dev->address_count], NULL,
+ spi_dev->address_count);
/* Write data (we still hold the CS line low in between) */
spi_transfer_bytes(spi_dev->spi, spi_dev->cs, false, src, NULL, len);
/* Release exclusive bus access */
@@ -170,8 +170,8 @@ static int nvram_spi_read(nvram_t *dev, uint8_t *dst, uint32_t src, size_t len)
/* Write command and address */
spi_transfer_byte(spi_dev->spi, spi_dev->cs, true, NVRAM_SPI_CMD_READ);
spi_transfer_bytes(spi_dev->spi, spi_dev->cs, true,
- &addr.c[sizeof(addr.c) - spi_dev->address_count],
- NULL, spi_dev->address_count);
+ &addr.c[sizeof(addr.c) - spi_dev->address_count],
+ NULL, spi_dev->address_count);
/* Read data (while still holding the CS line active) */
spi_transfer_bytes(spi_dev->spi, spi_dev->cs, false, NULL, dst, len);
/* Release exclusive bus access */
diff --git a/drivers/pcd8544/include/pcd8544_internal.h b/drivers/pcd8544/include/pcd8544_internal.h
index 23ca7361e..a30c9fcfb 100644
--- a/drivers/pcd8544/include/pcd8544_internal.h
+++ b/drivers/pcd8544/include/pcd8544_internal.h
@@ -21,7 +21,7 @@
#define PCD8544_INTERNAL_H
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/**
diff --git a/drivers/pcd8544/pcd8544.c b/drivers/pcd8544/pcd8544.c
index e018df322..526974fff 100644
--- a/drivers/pcd8544/pcd8544.c
+++ b/drivers/pcd8544/pcd8544.c
@@ -324,7 +324,7 @@ void pcd8544_write_c(const pcd8544_t *dev, uint8_t x, uint8_t y, char c)
{
/* check position */
if (x >= PCD8544_COLS || y >= PCD8544_ROWS) {
- return ;
+ return;
}
/* set position */
lock(dev);
diff --git a/drivers/periph_common/flashpage.c b/drivers/periph_common/flashpage.c
index d5c557576..966cef531 100644
--- a/drivers/periph_common/flashpage.c
+++ b/drivers/periph_common/flashpage.c
@@ -23,7 +23,7 @@
#include "assert.h"
/* guard this file, must be done before including periph/flashpage.h
- * TODO: remove as soon as periph drivers can be build selectively */
+* TODO: remove as soon as periph drivers can be build selectively */
#if defined(FLASHPAGE_NUMOF) && defined(FLASHPAGE_SIZE)
#include "periph/flashpage.h"
diff --git a/drivers/pir/pir.c b/drivers/pir/pir.c
index 1f4ac527d..eb127063e 100644
--- a/drivers/pir/pir.c
+++ b/drivers/pir/pir.c
@@ -26,16 +26,16 @@
#include "debug.h"
/**********************************************************************
- * internal API declaration
- **********************************************************************/
+* internal API declaration
+**********************************************************************/
static int pir_activate_int(pir_t *dev);
static void pir_callback(void *dev);
static void pir_send_msg(pir_t *dev, pir_event_t event);
/**********************************************************************
- * public API implementation
- **********************************************************************/
+* public API implementation
+**********************************************************************/
int pir_init(pir_t *dev, gpio_t gpio)
{
@@ -71,8 +71,8 @@ int pir_register_thread(pir_t *dev)
}
/**********************************************************************
- * internal API implementation
- **********************************************************************/
+* internal API implementation
+**********************************************************************/
static void pir_send_msg(pir_t *dev, pir_event_t event)
{
diff --git a/drivers/rn2xx3/include/rn2xx3_internal.h b/drivers/rn2xx3/include/rn2xx3_internal.h
index 9cf27a391..897cb9c06 100644
--- a/drivers/rn2xx3/include/rn2xx3_internal.h
+++ b/drivers/rn2xx3/include/rn2xx3_internal.h
@@ -51,7 +51,7 @@ void rn2xx3_set_internal_state(rn2xx3_t *dev, uint8_t state);
*
* @param[in] dev The device descriptor
*/
- void rn2xx3_cmd_start(rn2xx3_t *dev);
+void rn2xx3_cmd_start(rn2xx3_t *dev);
/**
* @brief Appends data to a command
@@ -77,7 +77,7 @@ int rn2xx3_cmd_finalize(rn2xx3_t *dev);
*
* @param[in] dev The device descriptor
*/
- void rn2xx3_mac_tx_start(rn2xx3_t *dev);
+void rn2xx3_mac_tx_start(rn2xx3_t *dev);
/**
* @brief Finalize the TX command
diff --git a/drivers/rn2xx3/rn2xx3.c b/drivers/rn2xx3/rn2xx3.c
index faad12900..2075e90b1 100644
--- a/drivers/rn2xx3/rn2xx3.c
+++ b/drivers/rn2xx3/rn2xx3.c
@@ -32,7 +32,7 @@
/* Warning: to correctly display the debug message from sleep timer callback,,
add CFLAGS+=-DTHREAD_STACKSIZE_IDLE=THREAD_STACKSIZE_DEFAULT to the build
command.
-*/
+ */
#include "debug.h"
/**
@@ -80,9 +80,9 @@ static void _rx_cb(void *arg, uint8_t c)
else {
switch (dev->int_state) {
/* A successful mac TX command expects 2 kinds of replies:
- * - mac_tx_ok: transmission done, no data received
- * - mac_rx <port> <data>: transmission done, some data
- * received on port <port>. */
+ * - mac_tx_ok: transmission done, no data received
+ * - mac_rx <port> <data>: transmission done, some data
+ * received on port <port>. */
case RN2XX3_INT_STATE_MAC_TX:
/* some data are available */
dev->resp_buf[dev->resp_size++] = c;
diff --git a/drivers/rn2xx3/rn2xx3_getset.c b/drivers/rn2xx3/rn2xx3_getset.c
index 1785dfa80..7ac8184e2 100644
--- a/drivers/rn2xx3/rn2xx3_getset.c
+++ b/drivers/rn2xx3/rn2xx3_getset.c
@@ -92,7 +92,7 @@ static void _set_bool_value(rn2xx3_t *dev,
const char *command, bool value)
{
size_t p = snprintf(dev->cmd_buf, sizeof(dev->cmd_buf) - 1, "%s %s %s %s",
- mac, set, command, value ? "on": "off");
+ mac, set, command, value ? "on" : "off");
dev->cmd_buf[p] = 0;
rn2xx3_write_cmd(dev);
diff --git a/drivers/rn2xx3/rn2xx3_internal.c b/drivers/rn2xx3/rn2xx3_internal.c
index 7767eb008..4e92c6f8b 100644
--- a/drivers/rn2xx3/rn2xx3_internal.c
+++ b/drivers/rn2xx3/rn2xx3_internal.c
@@ -62,7 +62,7 @@ static bool _wait_reply(rn2xx3_t *dev, uint8_t timeout)
/* wait for results */
while ((!dev->resp_done) &&
xtimer_less(xtimer_diff32_64(xtimer_now64(), sent_time),
- xtimer_ticks_from_usec(timeout * US_PER_SEC))) {
+ xtimer_ticks_from_usec(timeout * US_PER_SEC))) {
mutex_lock(&(dev->resp_lock));
}
diff --git a/drivers/sdcard_spi/include/sdcard_spi_params.h b/drivers/sdcard_spi/include/sdcard_spi_params.h
index 75bdca659..daf27fab1 100644
--- a/drivers/sdcard_spi/include/sdcard_spi_params.h
+++ b/drivers/sdcard_spi/include/sdcard_spi_params.h
@@ -66,7 +66,7 @@ extern "C" {
/**
* @brief sdcard_spi configuration
*/
-static const sdcard_spi_params_t sdcard_spi_params[] = {
+static const sdcard_spi_params_t sdcard_spi_params[] = {
SDCARD_SPI_PARAMS
};
diff --git a/drivers/sdcard_spi/sdcard_spi.c b/drivers/sdcard_spi/sdcard_spi.c
index 012deb6b3..e334c3ff9 100644
--- a/drivers/sdcard_spi/sdcard_spi.c
+++ b/drivers/sdcard_spi/sdcard_spi.c
@@ -50,7 +50,7 @@ static char _crc_7(const char *data, int n);
static inline int _transfer_bytes(sdcard_spi_t *card, const char *out, char *in, unsigned int length);
/* uses bitbanging for spi communication which allows to enable pull-up on the miso pin for
-greater card compatibility on platforms that don't have a hw pull up installed */
+ greater card compatibility on platforms that don't have a hw pull up installed */
static inline int _sw_spi_rxtx_byte(sdcard_spi_t *card, char out, char *in);
/* wrapper for default spi_transfer_byte function */
@@ -244,7 +244,7 @@ static sd_init_fsm_state_t _init_sd_fsm_step(sdcard_spi_t *card, sd_init_fsm_sta
uint32_t ocr = ((uint32_t)r3[0] << (3 * 8)) |
((uint32_t)r3[1] << (2 * 8)) | (r3[2] << 8) | r3[3];
DEBUG("R3 RESPONSE: 0x%02x 0x%02x 0x%02x 0x%02x\n", r3[0], r3[1], r3[2], r3[3]);
- DEBUG("OCR: 0x%"PRIx32"\n", ocr);
+ DEBUG("OCR: 0x%" PRIx32 "\n", ocr);
if ((ocr & SYSTEM_VOLTAGE) != 0) {
DEBUG("OCR: SYS VOLTAGE SUPPORTED\n");
@@ -541,8 +541,8 @@ void _unselect_card_spi(sdcard_spi_t *card)
static inline int _sw_spi_rxtx_byte(sdcard_spi_t *card, char out, char *in){
char rx = 0;
int i = 7;
- for(; i >= 0; i--){
- if( ((out >> (i)) & 0x01) == 1){
+ for(; i >= 0; i--) {
+ if( ((out >> (i)) & 0x01) == 1) {
gpio_set(card->params.mosi);
}else{
gpio_clear(card->params.mosi);
@@ -920,7 +920,7 @@ sd_rw_response_t _read_csd(sdcard_spi_t *card)
card->csd.v2.READ_BLK_MISALIGN = (c[6] & (1<<5))>>5;
card->csd.v2.DSR_IMP = (c[6] & (1<<4))>>4;
card->csd.v2.C_SIZE = (((uint32_t)c[7] & 0x3F)<<16)
- | (c[8]<<8) | c[9];
+ | (c[8]<<8) | c[9];
card->csd.v2.ERASE_BLK_EN = (c[10] & (1<<6))>>6;
card->csd.v2.SECTOR_SIZE = (c[10] & 0x3F)<<1 | (c[11]>>7);
card->csd.v2.WP_GRP_SIZE = (c[11] & 0x7F);
@@ -955,7 +955,7 @@ sd_rw_response_t sdcard_spi_read_sds(sdcard_spi_t *card, sd_status_t *sd_status)
char r1_resu = sdcard_spi_send_cmd(card, SD_CMD_55, SD_CMD_NO_ARG, 0);
_unselect_card_spi(card);
if (R1_VALID(r1_resu)) {
- if(!R1_ERROR(r1_resu)){
+ if(!R1_ERROR(r1_resu)) {
sd_rw_response_t state;
int nbl = _read_blocks(card, SD_CMD_13, 0, sds_raw_data, SD_SIZE_OF_SD_STATUS,
@@ -975,7 +975,7 @@ sd_rw_response_t sdcard_spi_read_sds(sdcard_spi_t *card, sd_status_t *sd_status)
sd_status->SIZE_OF_PROTECTED_AREA = ((uint32_t)sds_raw_data[4] << (3*8)) |
((uint32_t)sds_raw_data[5] << (2*8)) |
(sds_raw_data[6] << 8 ) |
- sds_raw_data[7];
+ sds_raw_data[7];
sd_status->SPEED_CLASS = sds_raw_data[8];
sd_status->PERFORMANCE_MOVE = sds_raw_data[9];
sd_status->AU_SIZE = sds_raw_data[10] >> 4;
diff --git a/drivers/sht11/sht11.c b/drivers/sht11/sht11.c
index e92b15013..327a73670 100644
--- a/drivers/sht11/sht11.c
+++ b/drivers/sht11/sht11.c
@@ -172,7 +172,7 @@ static void transmission_start(void)
DATA: |_______|
___ ___
SCK : ___| |___| |______
- */
+ */
SHT11_DATA_OUT;
/* set initial state */
@@ -206,7 +206,7 @@ static void connection_reset(void)
DATA: |_______|
_ _ _ _ _ _ _ _ _ ___ ___
SCK : __| |__| |__| |__| |__| |__| |__| |__| |__| |______| |___| |__
- */
+ */
uint8_t i;
SHT11_DATA_HIGH;
xtimer_usleep(SHT11_DATA_WAIT);
diff --git a/drivers/si114x/si114x.c b/drivers/si114x/si114x.c
index 4a65f82b7..d17850955 100644
--- a/drivers/si114x/si114x.c
+++ b/drivers/si114x/si114x.c
@@ -42,8 +42,8 @@ static void _initialize(si114x_t *dev);
static void _set_param(si114x_t *dev, uint8_t param, uint8_t value);
/*---------------------------------------------------------------------------*
- * Si114x Core API *
- *---------------------------------------------------------------------------*/
+* Si114x Core API *
+*---------------------------------------------------------------------------*/
int8_t si114x_init(si114x_t *dev, const si114x_params_t *params)
{
diff --git a/drivers/slipdev/slipdev.c b/drivers/slipdev/slipdev.c
index 9d0a15ac3..cecdf4327 100644
--- a/drivers/slipdev/slipdev.c
+++ b/drivers/slipdev/slipdev.c
@@ -134,8 +134,8 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
dev->inesc = 0;
break;
}
- /* Intentionally falls through */
- /* to default when !dev->inesc */
+ /* Intentionally falls through */
+ /* to default when !dev->inesc */
case SLIP_ESC_ESC:
if (dev->inesc) {
*(ptr++) = SLIP_ESC;
@@ -143,8 +143,8 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
dev->inesc = 0;
break;
}
- /* Intentionally falls through */
- /* to default when !dev->inesc */
+ /* Intentionally falls through */
+ /* to default when !dev->inesc */
default:
*(ptr++) = (uint8_t)byte;
res++;
diff --git a/drivers/soft_spi/soft_spi.c b/drivers/soft_spi/soft_spi.c
index 17fa34bd9..d326a0295 100644
--- a/drivers/soft_spi/soft_spi.c
+++ b/drivers/soft_spi/soft_spi.c
@@ -190,7 +190,7 @@ uint8_t soft_spi_transfer_byte(soft_spi_t bus, soft_spi_cs_t cs, bool cont, uint
}
void soft_spi_transfer_bytes(soft_spi_t bus, soft_spi_cs_t cs, bool cont,
- const void *out, void *in, size_t len)
+ const void *out, void *in, size_t len)
{
DEBUG("Soft SPI soft_spi_transfer_bytes\n");
diff --git a/drivers/sx127x/sx127x.c b/drivers/sx127x/sx127x.c
index e7347d2d0..7a0841ca1 100644
--- a/drivers/sx127x/sx127x.c
+++ b/drivers/sx127x/sx127x.c
@@ -218,7 +218,7 @@ static int _init_gpios(sx127x_t *dev)
}
res = gpio_init_int(dev->params.dio1_pin, GPIO_IN, GPIO_RISING,
- sx127x_on_dio1_isr, dev);
+ sx127x_on_dio1_isr, dev);
if (res < 0) {
DEBUG("[sx127x] error: failed to initialize DIO1 pin\n");
return res;
diff --git a/drivers/sx127x/sx127x_getset.c b/drivers/sx127x/sx127x_getset.c
index 5744aaf77..260eeddbd 100644
--- a/drivers/sx127x/sx127x_getset.c
+++ b/drivers/sx127x/sx127x_getset.c
@@ -45,18 +45,18 @@ void sx127x_set_state(sx127x_t *dev, uint8_t state)
{
#if ENABLE_DEBUG
switch (state) {
- case SX127X_RF_IDLE:
- DEBUG("[sx127x] Change state: IDLE\n");
- break;
- case SX127X_RF_RX_RUNNING:
- DEBUG("[sx127x] Change state: RX\n");
- break;
- case SX127X_RF_TX_RUNNING:
- DEBUG("[sx127x] Change state: TX\n");
- break;
- default:
- DEBUG("[sx127x] Change state: UNKNOWN\n");
- break;
+ case SX127X_RF_IDLE:
+ DEBUG("[sx127x] Change state: IDLE\n");
+ break;
+ case SX127X_RF_RX_RUNNING:
+ DEBUG("[sx127x] Change state: RX\n");
+ break;
+ case SX127X_RF_TX_RUNNING:
+ DEBUG("[sx127x] Change state: TX\n");
+ break;
+ default:
+ DEBUG("[sx127x] Change state: UNKNOWN\n");
+ break;
}
#endif
@@ -235,7 +235,7 @@ void sx127x_set_rx(sx127x_t *dev)
((sx127x_reg_read(dev, SX127X_REG_LR_INVERTIQ) &
SX127X_RF_LORA_INVERTIQ_TX_MASK &
SX127X_RF_LORA_INVERTIQ_RX_MASK) |
- ((dev->settings.lora.flags & SX127X_IQ_INVERTED_FLAG) ? SX127X_RF_LORA_INVERTIQ_RX_ON :SX127X_RF_LORA_INVERTIQ_RX_OFF) |
+ ((dev->settings.lora.flags & SX127X_IQ_INVERTED_FLAG) ? SX127X_RF_LORA_INVERTIQ_RX_ON : SX127X_RF_LORA_INVERTIQ_RX_OFF) |
SX127X_RF_LORA_INVERTIQ_TX_OFF));
sx127x_reg_write(dev, SX127X_REG_LR_INVERTIQ2,
((dev->settings.lora.flags & SX127X_IQ_INVERTED_FLAG) ? SX127X_RF_LORA_INVERTIQ2_ON : SX127X_RF_LORA_INVERTIQ2_OFF));
@@ -323,7 +323,7 @@ void sx127x_set_rx(sx127x_t *dev)
void sx127x_set_tx(sx127x_t *dev)
{
- switch (dev->settings.modem) {
+ switch (dev->settings.modem) {
case SX127X_MODEM_FSK:
/* todo */
break;
@@ -364,7 +364,7 @@ void sx127x_set_tx(sx127x_t *dev)
sx127x_reg_write(dev, SX127X_REG_DIOMAPPING1,
(sx127x_reg_read(dev, SX127X_REG_DIOMAPPING1) &
SX127X_RF_LORA_DIOMAPPING1_DIO0_MASK) |
- SX127X_RF_LORA_DIOMAPPING1_DIO0_01);
+ SX127X_RF_LORA_DIOMAPPING1_DIO0_01);
}
}
break;
@@ -415,24 +415,24 @@ void sx127x_set_op_mode(const sx127x_t *dev, uint8_t op_mode)
{
#if ENABLE_DEBUG
switch(op_mode) {
- case SX127X_RF_OPMODE_SLEEP:
- DEBUG("[sx127x] Set op mode: SLEEP\n");
- break;
- case SX127X_RF_OPMODE_STANDBY:
- DEBUG("[sx127x] Set op mode: STANDBY\n");
- break;
- case SX127X_RF_OPMODE_RECEIVER_SINGLE:
- DEBUG("[sx127x] Set op mode: RECEIVER SINGLE\n");
- break;
- case SX127X_RF_OPMODE_RECEIVER:
- DEBUG("[sx127x] Set op mode: RECEIVER\n");
- break;
- case SX127X_RF_OPMODE_TRANSMITTER:
- DEBUG("[sx127x] Set op mode: TRANSMITTER\n");
- break;
- default:
- DEBUG("[sx127x] Set op mode: UNKNOWN (%d)\n", op_mode);
- break;
+ case SX127X_RF_OPMODE_SLEEP:
+ DEBUG("[sx127x] Set op mode: SLEEP\n");
+ break;
+ case SX127X_RF_OPMODE_STANDBY:
+ DEBUG("[sx127x] Set op mode: STANDBY\n");
+ break;
+ case SX127X_RF_OPMODE_RECEIVER_SINGLE:
+ DEBUG("[sx127x] Set op mode: RECEIVER SINGLE\n");
+ break;
+ case SX127X_RF_OPMODE_RECEIVER:
+ DEBUG("[sx127x] Set op mode: RECEIVER\n");
+ break;
+ case SX127X_RF_OPMODE_TRANSMITTER:
+ DEBUG("[sx127x] Set op mode: TRANSMITTER\n");
+ break;
+ default:
+ DEBUG("[sx127x] Set op mode: UNKNOWN (%d)\n", op_mode);
+ break;
}
#endif
@@ -477,35 +477,35 @@ static void _update_bandwidth(const sx127x_t *dev)
#if defined(MODULE_SX1272)
config1_reg &= SX1272_RF_LORA_MODEMCONFIG1_BW_MASK;
switch (dev->settings.lora.bandwidth) {
- case LORA_BW_125_KHZ:
- config1_reg |= SX1272_RF_LORA_MODEMCONFIG1_BW_125_KHZ;
- break;
- case LORA_BW_250_KHZ:
- config1_reg |= SX1272_RF_LORA_MODEMCONFIG1_BW_250_KHZ;
- break;
- case LORA_BW_500_KHZ:
- config1_reg |= SX1272_RF_LORA_MODEMCONFIG1_BW_500_KHZ;
- break;
- default:
- DEBUG("Unsupported bandwidth, %d", dev->settings.lora.bandwidth);
- break;
+ case LORA_BW_125_KHZ:
+ config1_reg |= SX1272_RF_LORA_MODEMCONFIG1_BW_125_KHZ;
+ break;
+ case LORA_BW_250_KHZ:
+ config1_reg |= SX1272_RF_LORA_MODEMCONFIG1_BW_250_KHZ;
+ break;
+ case LORA_BW_500_KHZ:
+ config1_reg |= SX1272_RF_LORA_MODEMCONFIG1_BW_500_KHZ;
+ break;
+ default:
+ DEBUG("Unsupported bandwidth, %d", dev->settings.lora.bandwidth);
+ break;
}
#else /* MODULE_SX1276 */
config1_reg &= SX1276_RF_LORA_MODEMCONFIG1_BW_MASK;
switch (dev->settings.lora.bandwidth) {
- case LORA_BW_125_KHZ:
- config1_reg |= SX1276_RF_LORA_MODEMCONFIG1_BW_125_KHZ;
- break;
- case LORA_BW_250_KHZ:
- config1_reg |= SX1276_RF_LORA_MODEMCONFIG1_BW_250_KHZ;
- break;
- case LORA_BW_500_KHZ:
- config1_reg |= SX1276_RF_LORA_MODEMCONFIG1_BW_500_KHZ;
- break;
- default:
- DEBUG("[sx127x] Unsupported bandwidth, %d\n",
- dev->settings.lora.bandwidth);
- break;
+ case LORA_BW_125_KHZ:
+ config1_reg |= SX1276_RF_LORA_MODEMCONFIG1_BW_125_KHZ;
+ break;
+ case LORA_BW_250_KHZ:
+ config1_reg |= SX1276_RF_LORA_MODEMCONFIG1_BW_250_KHZ;
+ break;
+ case LORA_BW_500_KHZ:
+ config1_reg |= SX1276_RF_LORA_MODEMCONFIG1_BW_500_KHZ;
+ break;
+ default:
+ DEBUG("[sx127x] Unsupported bandwidth, %d\n",
+ dev->settings.lora.bandwidth);
+ break;
}
#endif
sx127x_reg_write(dev, SX127X_REG_LR_MODEMCONFIG1, config1_reg);
@@ -567,18 +567,18 @@ void sx127x_set_spreading_factor(sx127x_t *dev, uint8_t datarate)
_low_datarate_optimize(dev);
switch(dev->settings.lora.datarate) {
- case LORA_SF6:
- sx127x_reg_write(dev, SX127X_REG_LR_DETECTOPTIMIZE,
- SX127X_RF_LORA_DETECTIONOPTIMIZE_SF6);
- sx127x_reg_write(dev, SX127X_REG_LR_DETECTIONTHRESHOLD,
- SX127X_RF_LORA_DETECTIONTHRESH_SF6);
- break;
- default:
- sx127x_reg_write(dev, SX127X_REG_LR_DETECTOPTIMIZE,
- SX127X_RF_LORA_DETECTIONOPTIMIZE_SF7_TO_SF12);
- sx127x_reg_write(dev, SX127X_REG_LR_DETECTIONTHRESHOLD,
- SX127X_RF_LORA_DETECTIONTHRESH_SF7_TO_SF12);
- break;
+ case LORA_SF6:
+ sx127x_reg_write(dev, SX127X_REG_LR_DETECTOPTIMIZE,
+ SX127X_RF_LORA_DETECTIONOPTIMIZE_SF6);
+ sx127x_reg_write(dev, SX127X_REG_LR_DETECTIONTHRESHOLD,
+ SX127X_RF_LORA_DETECTIONTHRESH_SF6);
+ break;
+ default:
+ sx127x_reg_write(dev, SX127X_REG_LR_DETECTOPTIMIZE,
+ SX127X_RF_LORA_DETECTIONOPTIMIZE_SF7_TO_SF12);
+ sx127x_reg_write(dev, SX127X_REG_LR_DETECTIONTHRESHOLD,
+ SX127X_RF_LORA_DETECTIONTHRESH_SF7_TO_SF12);
+ break;
}
}
@@ -854,7 +854,7 @@ void sx127x_set_iq_invert(sx127x_t *dev, bool iq_invert)
(sx127x_reg_read(dev, SX127X_REG_LR_INVERTIQ) &
SX127X_RF_LORA_INVERTIQ_RX_MASK &
SX127X_RF_LORA_INVERTIQ_TX_MASK) |
- SX127X_RF_LORA_INVERTIQ_RX_OFF |
+ SX127X_RF_LORA_INVERTIQ_RX_OFF |
(iq_invert ? SX127X_RF_LORA_INVERTIQ_TX_ON : SX127X_RF_LORA_INVERTIQ_TX_OFF));
sx127x_reg_write(dev, SX127X_REG_LR_INVERTIQ2,
@@ -865,5 +865,5 @@ void sx127x_set_freq_hop(sx127x_t *dev, bool freq_hop_on)
{
DEBUG("[sx127x] Set freq hop: %d\n", freq_hop_on);
- _set_flag(dev, SX127X_CHANNEL_HOPPING_FLAG, freq_hop_on);
+ _set_flag(dev, SX127X_CHANNEL_HOPPING_FLAG, freq_hop_on);
}
diff --git a/drivers/tcs37727/tcs37727.c b/drivers/tcs37727/tcs37727.c
index 11a7acfd2..3d5551d09 100644
--- a/drivers/tcs37727/tcs37727.c
+++ b/drivers/tcs37727/tcs37727.c
@@ -191,7 +191,7 @@ void tcs37727_read(const tcs37727_t *dev, tcs37727_data_t *data)
int32_t tmpr = ((uint16_t)buf[3] << 8) | buf[2];
int32_t tmpg = ((uint16_t)buf[5] << 8) | buf[4];
int32_t tmpb = ((uint16_t)buf[7] << 8) | buf[6];
- DEBUG("rawr: %"PRIi32" rawg %"PRIi32" rawb %"PRIi32" rawc %"PRIi32"\n",
+ DEBUG("rawr: %" PRIi32 " rawg %" PRIi32 " rawb %" PRIi32 " rawc %" PRIi32 "\n",
tmpr, tmpg, tmpb, tmpc);
/* Remove IR component as described in the DN40. */
diff --git a/drivers/tja1042/tja1042.c b/drivers/tja1042/tja1042.c
index 5552beb29..4979e4487 100644
--- a/drivers/tja1042/tja1042.c
+++ b/drivers/tja1042/tja1042.c
@@ -34,20 +34,20 @@ int tja1042_trx_set_mode(can_trx_t *dev, can_trx_mode_t mode)
DEBUG("tja1042_trx_set_mode: dev=%p, mode=%d\n", (void *)dev, (int)mode);
switch (mode) {
- case TRX_NORMAL_MODE:
- case TRX_SILENT_MODE:
- gpio_clear(tja1042->stb_pin);
- ret = 0;
- break;
+ case TRX_NORMAL_MODE:
+ case TRX_SILENT_MODE:
+ gpio_clear(tja1042->stb_pin);
+ ret = 0;
+ break;
- case TRX_SLEEP_MODE:
- gpio_set(tja1042->stb_pin);
- ret = 0;
- break;
+ case TRX_SLEEP_MODE:
+ gpio_set(tja1042->stb_pin);
+ ret = 0;
+ break;
- default:
- ret = -1;
- break;
+ default:
+ ret = -1;
+ break;
}
return ret;
diff --git a/drivers/tmp006/tmp006.c b/drivers/tmp006/tmp006.c
index 6395ebe66..6eaee2531 100644
--- a/drivers/tmp006/tmp006.c
+++ b/drivers/tmp006/tmp006.c
@@ -42,14 +42,14 @@
#define TMP006_CONFIG_MOD_SHIFT (12U)
#define TMP006_CONFIG_MOD_MASK (0x7000)
-#define TMP006_CONFIG_MOD(x) (((uint16_t)(((uint16_t)(x)) << TMP006_CONFIG_MOD_SHIFT))\
+#define TMP006_CONFIG_MOD(x) (((uint16_t)(((uint16_t)(x)) << TMP006_CONFIG_MOD_SHIFT)) \
& TMP006_CONFIG_MOD_MASK)
#define TMP006_CONFIG_MOD_CC (0x07)
#define TMP006_CONFIG_MOD_OFF (0x00)
#define TMP006_CONFIG_CR_SHIFT (9U)
#define TMP006_CONFIG_CR_MASK (0x0E00)
-#define TMP006_CONFIG_CR(x) (((uint16_t)(((uint16_t)(x)) << TMP006_CONFIG_CR_SHIFT))\
+#define TMP006_CONFIG_CR(x) (((uint16_t)(((uint16_t)(x)) << TMP006_CONFIG_CR_SHIFT)) \
& TMP006_CONFIG_CR_MASK)
#define TMP006_CONFIG_DRDY_PIN_EN (1 << 8)
diff --git a/drivers/tsl2561/include/tsl2561_internals.h b/drivers/tsl2561/include/tsl2561_internals.h
index 01c4dbde6..a946c9b4f 100644
--- a/drivers/tsl2561/include/tsl2561_internals.h
+++ b/drivers/tsl2561/include/tsl2561_internals.h
@@ -70,7 +70,7 @@ extern "C" {
#define TSL2561_LUXSCALE (14) /* use 2e14 scaling */
#define TSL2561_RATIOSCALE (9) /* use 2e9 scaling */
#define TSL2561_CHSCALE (10) /* use 2e10 scaling on
- * channel values by */
+ * channel values by */
#define TSL2561_CHSCALE_TINT0 (0x7517)
#define TSL2561_CHSCALE_TINT1 (0x0FE7)
diff --git a/drivers/tsl2561/tsl2561.c b/drivers/tsl2561/tsl2561.c
index 61cde67a6..46948b310 100644
--- a/drivers/tsl2561/tsl2561.c
+++ b/drivers/tsl2561/tsl2561.c
@@ -37,8 +37,8 @@ static void _read_data(const tsl2561_t *dev, uint16_t *full, uint16_t *ir);
static void _print_init_info(const tsl2561_t *dev);
/*---------------------------------------------------------------------------*
- * TSL2561 Core API *
- *---------------------------------------------------------------------------*/
+* TSL2561 Core API *
+*---------------------------------------------------------------------------*/
int tsl2561_init(tsl2561_t *dev,
i2c_t i2c, uint8_t addr, uint8_t gain, uint8_t integration)
@@ -210,7 +210,7 @@ static void _disable(const tsl2561_t *dev)
uint8_t dis;
i2c_read_reg(dev->i2c_dev, dev->addr,
TSL2561_COMMAND_MODE | TSL2561_REGISTER_CONTROL, &dis);
- DEBUG("[Info] Disabled ? %s\n", dis == 0 ? "true": "false");
+ DEBUG("[Info] Disabled ? %s\n", dis == 0 ? "true" : "false");
#endif
}
@@ -272,20 +272,20 @@ static void _print_init_info(const tsl2561_t *dev)
}
switch(dev->integration) {
- case TSL2561_INTEGRATIONTIME_13MS:
- DEBUG("[Info] Integration time: 13ms\n");
- break;
- case TSL2561_INTEGRATIONTIME_101MS:
- DEBUG("[Info] Integration time: 101ms\n");
- break;
- case TSL2561_INTEGRATIONTIME_402MS:
- DEBUG("[Info] Integration time: 402ms\n");
- break;
- case TSL2561_INTEGRATIONTIME_NA:
- DEBUG("[Info] Integration time: n/a\n");
- break;
- default:
- DEBUG("[Info] Invalid integration time %d\n", dev->integration);
- break;
+ case TSL2561_INTEGRATIONTIME_13MS:
+ DEBUG("[Info] Integration time: 13ms\n");
+ break;
+ case TSL2561_INTEGRATIONTIME_101MS:
+ DEBUG("[Info] Integration time: 101ms\n");
+ break;
+ case TSL2561_INTEGRATIONTIME_402MS:
+ DEBUG("[Info] Integration time: 402ms\n");
+ break;
+ case TSL2561_INTEGRATIONTIME_NA:
+ DEBUG("[Info] Integration time: n/a\n");
+ break;
+ default:
+ DEBUG("[Info] Invalid integration time %d\n", dev->integration);
+ break;
}
}
diff --git a/drivers/veml6070/veml6070.c b/drivers/veml6070/veml6070.c
index ea6847aa4..b0089bced 100644
--- a/drivers/veml6070/veml6070.c
+++ b/drivers/veml6070/veml6070.c
@@ -33,8 +33,8 @@
#define VEML6070_ADDRL (0x38)
/*---------------------------------------------------------------------------*
- * VEML6070 Core API *
- *---------------------------------------------------------------------------*/
+* VEML6070 Core API *
+*---------------------------------------------------------------------------*/
int veml6070_init(veml6070_t *dev, const veml6070_params_t * params)
{
diff --git a/drivers/w5100/include/w5100_params.h b/drivers/w5100/include/w5100_params.h
index 53491b46b..4edbe01fa 100644
--- a/drivers/w5100/include/w5100_params.h
+++ b/drivers/w5100/include/w5100_params.h
@@ -53,7 +53,7 @@ extern "C" {
/**
* @brief W5100 configuration
*/
-static const w5100_params_t w5100_params[] = {
+static const w5100_params_t w5100_params[] = {
W5100_PARAMS
};
/** @} */
diff --git a/drivers/w5100/w5100.c b/drivers/w5100/w5100.c
index e391752fa..7c2b75fda 100644
--- a/drivers/w5100/w5100.c
+++ b/drivers/w5100/w5100.c
@@ -247,7 +247,7 @@ static int recv(netdev_t *netdev, void *buf, size_t len, void *info)
/* find the size of the next packet in the RX buffer */
uint16_t rp = raddr(dev, S0_RX_RD0, S0_RX_RD1);
uint16_t psize = raddr(dev, (S0_RX_BASE + (rp & S0_MASK)),
- (S0_RX_BASE + ((rp + 1) & S0_MASK)));
+ (S0_RX_BASE + ((rp + 1) & S0_MASK)));
n = psize - 2;
DEBUG("[w5100] recv: got packet of %i byte (at 0x%04x)\n", n, (int)rp);
diff --git a/drivers/xbee/include/xbee_params.h b/drivers/xbee/include/xbee_params.h
index 3d4aa6739..52d1f2a70 100644
--- a/drivers/xbee/include/xbee_params.h
+++ b/drivers/xbee/include/xbee_params.h
@@ -43,8 +43,8 @@ extern "C" {
#endif
#ifndef XBEE_PARAMS
-#define XBEE_PARAMS { .uart = XBEE_PARAM_UART, \
- .br = XBEE_PARAM_BR, \
+#define XBEE_PARAMS { .uart = XBEE_PARAM_UART, \
+ .br = XBEE_PARAM_BR, \
.pin_sleep = XBEE_PARAM_PIN_SLEEP, \
.pin_reset = XBEE_PARAM_PIN_RESET }
#endif
diff --git a/drivers/xbee/xbee.c b/drivers/xbee/xbee.c
index fb9985896..6eb388d3f 100644
--- a/drivers/xbee/xbee.c
+++ b/drivers/xbee/xbee.c
@@ -436,7 +436,7 @@ static int _set_encryption(xbee_t *dev, const uint8_t *val)
_api_at_cmd(dev, cmd, 2, &resp);
/* Prevent writing the same value in EE. */
- if (val[0] != resp.data[0] ){
+ if (val[0] != resp.data[0] ) {
cmd[0] = 'E';
cmd[1] = 'E';
cmd[2] = val[0];
@@ -450,22 +450,22 @@ static int _set_encryption(xbee_t *dev, const uint8_t *val)
static int _set_encryption_key(xbee_t *dev, const uint8_t *val, size_t len)
{
- uint8_t cmd[18];
- resp_t resp;
- if (len != 16) { /* the AES key is 128bit, 16 byte */
- return -EINVAL;
- }
- cmd[0] = 'K';
- cmd[1] = 'Y';
-
- for (int i = 0; i < 16; i++) { /* Append the key to the KY API AT command */
- cmd[i + 2] = val[i];
- }
- _api_at_cmd(dev, cmd, 18, &resp);
- if (resp.status == 0) {
- return 2;
- }
- return -ECANCELED;
+ uint8_t cmd[18];
+ resp_t resp;
+ if (len != 16) { /* the AES key is 128bit, 16 byte */
+ return -EINVAL;
+ }
+ cmd[0] = 'K';
+ cmd[1] = 'Y';
+
+ for (int i = 0; i < 16; i++) { /* Append the key to the KY API AT command */
+ cmd[i + 2] = val[i];
+ }
+ _api_at_cmd(dev, cmd, 18, &resp);
+ if (resp.status == 0) {
+ return 2;
+ }
+ return -ECANCELED;
}
#endif
diff --git a/examples/dtls-echo/dtls-client.c b/examples/dtls-echo/dtls-client.c
index 669e6b95c..4321d233c 100644
--- a/examples/dtls-echo/dtls-client.c
+++ b/examples/dtls-echo/dtls-client.c
@@ -120,7 +120,7 @@ static void dtls_handle_read(dtls_context_t *ctx, gnrc_pktsnip_t *pkt)
ipv6_addr_to_str(addr_str, &hdr->src, sizeof(addr_str));
/*
- *TODO: More testings with TinyDTLS is neccesary, but seem this is safe.
+ * TODO: More testings with TinyDTLS is neccesary, but seem this is safe.
*/
tmp2 = gnrc_pktsnip_search_type(pkt, GNRC_NETTYPE_UDP);
udp_hdr_t *udp = (udp_hdr_t *)tmp2->data;
@@ -149,10 +149,10 @@ static size_t psk_key_length = sizeof(PSK_DEFAULT_KEY) - 1;
* session.
*/
static int peer_get_psk_info(struct dtls_context_t *ctx UNUSED_PARAM,
- const session_t *session UNUSED_PARAM,
- dtls_credentials_type_t type,
- const unsigned char *id, size_t id_len,
- unsigned char *result, size_t result_length)
+ const session_t *session UNUSED_PARAM,
+ dtls_credentials_type_t type,
+ const unsigned char *id, size_t id_len,
+ unsigned char *result, size_t result_length)
{
switch (type) {
@@ -193,8 +193,8 @@ static int peer_get_psk_info(struct dtls_context_t *ctx UNUSED_PARAM,
#ifdef DTLS_ECC
static int peer_get_ecdsa_key(struct dtls_context_t *ctx,
- const session_t *session,
- const dtls_ecdsa_key_t **result)
+ const session_t *session,
+ const dtls_ecdsa_key_t **result)
{
(void) ctx;
(void) session;
@@ -211,10 +211,10 @@ static int peer_get_ecdsa_key(struct dtls_context_t *ctx,
}
static int peer_verify_ecdsa_key(struct dtls_context_t *ctx,
- const session_t *session,
- const unsigned char *other_pub_x,
- const unsigned char *other_pub_y,
- size_t key_size)
+ const session_t *session,
+ const unsigned char *other_pub_x,
+ const unsigned char *other_pub_y,
+ size_t key_size)
{
(void) ctx;
(void) session;
@@ -301,7 +301,7 @@ static int gnrc_sending(char *addr_str, char *data, size_t data_len )
* TODO: The connected variable could de modified here.
*/
static int read_from_peer(struct dtls_context_t *ctx,
- session_t *session, uint8 *data, size_t len)
+ session_t *session, uint8 *data, size_t len)
{
/* Linux and Contiki version are exactly the same. */
(void) session;
@@ -339,7 +339,7 @@ static void try_send(struct dtls_context_t *ctx, session_t *dst)
* @brief This SIGNAL function will prepare the next DTLS flight to send.
*/
static int send_to_peer(struct dtls_context_t *ctx,
- session_t *session, uint8 *buf, size_t len)
+ session_t *session, uint8 *buf, size_t len)
{
(void) session;
@@ -431,7 +431,7 @@ static void client_send(char *addr_str, char *data, unsigned int delay)
static int connected = 0;
msg_t msg;
- gnrc_netreg_entry_t entry = GNRC_NETREG_ENTRY_INIT_PID(CLIENT_PORT,
+ gnrc_netreg_entry_t entry = GNRC_NETREG_ENTRY_INIT_PID(CLIENT_PORT,
sched_active_pid);
dtls_init();
diff --git a/examples/dtls-echo/dtls-server.c b/examples/dtls-echo/dtls-server.c
index 083764b21..47a2dad5c 100644
--- a/examples/dtls-echo/dtls-server.c
+++ b/examples/dtls-echo/dtls-server.c
@@ -72,8 +72,8 @@ static const unsigned char ecdsa_pub_key_y[] = {
static gnrc_netreg_entry_t server = GNRC_NETREG_ENTRY_INIT_PID(
- GNRC_NETREG_DEMUX_CTX_ALL,
- KERNEL_PID_UNDEF);
+ GNRC_NETREG_DEMUX_CTX_ALL,
+ KERNEL_PID_UNDEF);
#define READER_QUEUE_SIZE (8U)
char _server_stack[THREAD_STACKSIZE_MAIN + THREAD_EXTRA_STACKSIZE_PRINTF];
@@ -129,8 +129,8 @@ static int read_from_peer(struct dtls_context_t *ctx,
#if ENABLE_DEBUG == 1
- size_t i;
- DEBUG("\nDBG-Server: Data from Client: ---");
+ size_t i;
+ DEBUG("\nDBG-Server: Data from Client: ---");
for (i = 0; i < len; i++)
DEBUG("%c", data[i]);
DEBUG("--- \t Sending echo..\n");
@@ -232,9 +232,9 @@ static int send_to_peer(struct dtls_context_t *ctx,
* retrieve a key for the given identity within this particular
* session. */
static int peer_get_psk_info(struct dtls_context_t *ctx, const session_t *session,
- dtls_credentials_type_t type,
- const unsigned char *id, size_t id_len,
- unsigned char *result, size_t result_length)
+ dtls_credentials_type_t type,
+ const unsigned char *id, size_t id_len,
+ unsigned char *result, size_t result_length)
{
(void) ctx;
@@ -278,8 +278,8 @@ static int peer_get_psk_info(struct dtls_context_t *ctx, const session_t *sessio
#ifdef DTLS_ECC
static int peer_get_ecdsa_key(struct dtls_context_t *ctx,
- const session_t *session,
- const dtls_ecdsa_key_t **result)
+ const session_t *session,
+ const dtls_ecdsa_key_t **result)
{
(void) ctx;
(void) session;
@@ -295,10 +295,10 @@ static int peer_get_ecdsa_key(struct dtls_context_t *ctx,
}
static int peer_verify_ecdsa_key(struct dtls_context_t *ctx,
- const session_t *session,
- const unsigned char *other_pub_x,
- const unsigned char *other_pub_y,
- size_t key_size)
+ const session_t *session,
+ const unsigned char *other_pub_x,
+ const unsigned char *other_pub_y,
+ size_t key_size)
{
(void) ctx;
(void) session;
@@ -420,16 +420,16 @@ static void start_server(void)
/* The server is initialized */
server.target.pid = thread_create(_server_stack, sizeof(_server_stack),
- THREAD_PRIORITY_MAIN - 1,
- THREAD_CREATE_STACKTEST,
- dtls_server_wrapper, NULL, "DTLS Server");
+ THREAD_PRIORITY_MAIN - 1,
+ THREAD_CREATE_STACKTEST,
+ dtls_server_wrapper, NULL, "DTLS Server");
server.demux_ctx = (uint32_t)port;
if (gnrc_netreg_register(GNRC_NETTYPE_UDP, &server) == 0)
- printf("Success: started DTLS server on port %" PRIu16 "\n", port);
- else
- printf("FAILURE: The UDP port is not registered!\n");
+ printf("Success: started DTLS server on port %" PRIu16 "\n", port);
+ else
+ printf("FAILURE: The UDP port is not registered!\n");
}
static void stop_server(void)
diff --git a/examples/emcute_mqttsn/main.c b/examples/emcute_mqttsn/main.c
index f8b3ddec8..9377e03d2 100644
--- a/examples/emcute_mqttsn/main.c
+++ b/examples/emcute_mqttsn/main.c
@@ -79,7 +79,7 @@ static int cmd_con(int argc, char **argv)
if (argc < 2) {
printf("usage: %s <ipv6 addr> [port] [<will topic> <will message>]\n",
- argv[0]);
+ argv[0]);
return 1;
}
@@ -153,12 +153,12 @@ static int cmd_pub(int argc, char **argv)
/* step 2: publish data */
if (emcute_pub(&t, argv[2], strlen(argv[2]), flags) != EMCUTE_OK) {
printf("error: unable to publish data to topic '%s [%i]'\n",
- t.name, (int)t.id);
+ t.name, (int)t.id);
return 1;
}
printf("Published %i bytes to topic '%s [%i]'\n",
- (int)strlen(argv[2]), t.name, t.id);
+ (int)strlen(argv[2]), t.name, t.id);
return 0;
}
diff --git a/examples/gcoap/gcoap_cli.c b/examples/gcoap/gcoap_cli.c
index f1a2f6fb7..5865331cd 100644
--- a/examples/gcoap/gcoap_cli.c
+++ b/examples/gcoap/gcoap_cli.c
@@ -67,18 +67,18 @@ static void _resp_handler(unsigned req_state, coap_pkt_t* pdu,
}
char *class_str = (coap_get_code_class(pdu) == COAP_CLASS_SUCCESS)
- ? "Success" : "Error";
+ ? "Success" : "Error";
printf("gcoap: response %s, code %1u.%02u", class_str,
- coap_get_code_class(pdu),
- coap_get_code_detail(pdu));
+ coap_get_code_class(pdu),
+ coap_get_code_detail(pdu));
if (pdu->payload_len) {
if (pdu->content_type == COAP_FORMAT_TEXT
- || pdu->content_type == COAP_FORMAT_LINK
- || coap_get_code_class(pdu) == COAP_CLASS_CLIENT_FAILURE
- || coap_get_code_class(pdu) == COAP_CLASS_SERVER_FAILURE) {
+ || pdu->content_type == COAP_FORMAT_LINK
+ || coap_get_code_class(pdu) == COAP_CLASS_CLIENT_FAILURE
+ || coap_get_code_class(pdu) == COAP_CLASS_SERVER_FAILURE) {
/* Expecting diagnostic payload in failure cases */
printf(", %u bytes\n%.*s\n", pdu->payload_len, pdu->payload_len,
- (char *)pdu->payload);
+ (char *)pdu->payload);
}
else {
printf(", %u bytes\n", pdu->payload_len);
@@ -255,19 +255,19 @@ int gcoap_cli_cmd(int argc, char **argv)
else {
/* send Observe notification for /cli/stats */
switch (gcoap_obs_init(&pdu, &buf[0], GCOAP_PDU_BUF_SIZE,
- &_resources[0])) {
- case GCOAP_OBS_INIT_OK:
- DEBUG("gcoap_cli: creating /cli/stats notification\n");
- size_t payload_len = fmt_u16_dec((char *)pdu.payload, req_count);
- len = gcoap_finish(&pdu, payload_len, COAP_FORMAT_TEXT);
- gcoap_obs_send(&buf[0], len, &_resources[0]);
- break;
- case GCOAP_OBS_INIT_UNUSED:
- DEBUG("gcoap_cli: no observer for /cli/stats\n");
- break;
- case GCOAP_OBS_INIT_ERR:
- DEBUG("gcoap_cli: error initializing /cli/stats notification\n");
- break;
+ &_resources[0])) {
+ case GCOAP_OBS_INIT_OK:
+ DEBUG("gcoap_cli: creating /cli/stats notification\n");
+ size_t payload_len = fmt_u16_dec((char *)pdu.payload, req_count);
+ len = gcoap_finish(&pdu, payload_len, COAP_FORMAT_TEXT);
+ gcoap_obs_send(&buf[0], len, &_resources[0]);
+ break;
+ case GCOAP_OBS_INIT_UNUSED:
+ DEBUG("gcoap_cli: no observer for /cli/stats\n");
+ break;
+ case GCOAP_OBS_INIT_ERR:
+ DEBUG("gcoap_cli: error initializing /cli/stats notification\n");
+ break;
}
}
return 0;
@@ -280,7 +280,7 @@ int gcoap_cli_cmd(int argc, char **argv)
return 1;
}
- end:
+end:
printf("usage: %s <get|post|put|info>\n", argv[0]);
return 1;
}
diff --git a/examples/gnrc_tftp/main.c b/examples/gnrc_tftp/main.c
index e287aa212..a4553795d 100644
--- a/examples/gnrc_tftp/main.c
+++ b/examples/gnrc_tftp/main.c
@@ -33,9 +33,9 @@ extern int tftp_server_cmd(int argc, char * *argv);
static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
static const shell_command_t shell_commands[] = {
- { "tftpc", "get/put data to a TFTP server", tftp_client_cmd },
+ { "tftpc", "get/put data to a TFTP server", tftp_client_cmd },
{ "tftps", "start and stop the TFTP server", tftp_server_cmd },
- { NULL, NULL, NULL }
+ { NULL, NULL, NULL }
};
int main(void)
diff --git a/examples/ipc_pingpong/main.c b/examples/ipc_pingpong/main.c
index 655ff39a7..6bd96baea 100644
--- a/examples/ipc_pingpong/main.c
+++ b/examples/ipc_pingpong/main.c
@@ -51,8 +51,8 @@ int main(void)
msg_t m;
kernel_pid_t pid = thread_create(second_thread_stack, sizeof(second_thread_stack),
- THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
- second_thread, NULL, "pong");
+ THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
+ second_thread, NULL, "pong");
m.content.value = 1;
diff --git a/examples/lua/main.c b/examples/lua/main.c
index 22458153e..8f824e18d 100644
--- a/examples/lua/main.c
+++ b/examples/lua/main.c
@@ -38,7 +38,7 @@ int lua_run_script(const char *buffer, size_t buffer_len)
luaL_openlibs(L);
luaL_loadbuffer(L, buffer, buffer_len, "lua input script");
- if (lua_pcall(L, 0, 0, 0) != LUA_OK){
+ if (lua_pcall(L, 0, 0, 0) != LUA_OK) {
puts("Lua script running failed");
return EINTR;
}
diff --git a/examples/nanocoap_server/coap_handler.c b/examples/nanocoap_server/coap_handler.c
index 9a254ac2d..85784fd32 100644
--- a/examples/nanocoap_server/coap_handler.c
+++ b/examples/nanocoap_server/coap_handler.c
@@ -21,7 +21,7 @@ static ssize_t _riot_board_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, vo
{
(void)context;
return coap_reply_simple(pkt, COAP_CODE_205, buf, len,
- COAP_FORMAT_TEXT, (uint8_t*)RIOT_BOARD, strlen(RIOT_BOARD));
+ COAP_FORMAT_TEXT, (uint8_t*)RIOT_BOARD, strlen(RIOT_BOARD));
}
static ssize_t _riot_value_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, void *context)
@@ -36,24 +36,24 @@ static ssize_t _riot_value_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, vo
unsigned method_flag = coap_method2flag(coap_get_code_detail(pkt));
switch(method_flag) {
- case COAP_GET:
- /* write the response buffer with the internal value */
- p += fmt_u32_dec(rsp, internal_value);
- code = COAP_CODE_205;
- break;
- case COAP_PUT:
- case COAP_POST:
- {
- /* convert the payload to an integer and update the internal value */
- char payload[16] = { 0 };
- memcpy(payload, (char*)pkt->payload, pkt->payload_len);
- internal_value = strtol(payload, NULL, 10);
- code = COAP_CODE_CHANGED;
- }
+ case COAP_GET:
+ /* write the response buffer with the internal value */
+ p += fmt_u32_dec(rsp, internal_value);
+ code = COAP_CODE_205;
+ break;
+ case COAP_PUT:
+ case COAP_POST:
+ {
+ /* convert the payload to an integer and update the internal value */
+ char payload[16] = { 0 };
+ memcpy(payload, (char*)pkt->payload, pkt->payload_len);
+ internal_value = strtol(payload, NULL, 10);
+ code = COAP_CODE_CHANGED;
+ }
}
return coap_reply_simple(pkt, code, buf, len,
- COAP_FORMAT_TEXT, (uint8_t*)rsp, p);
+ COAP_FORMAT_TEXT, (uint8_t*)rsp, p);
}
ssize_t _sha256_handler(coap_pkt_t* pkt, uint8_t *buf, size_t len, void *context)
@@ -73,7 +73,7 @@ ssize_t _sha256_handler(coap_pkt_t* pkt, uint8_t *buf, size_t len, void *context
int blockwise = coap_get_block1(pkt, &block1);
printf("_sha256_handler(): received data: offset=%u len=%u blockwise=%i more=%i\n", \
- (unsigned)block1.offset, pkt->payload_len, blockwise, block1.more);
+ (unsigned)block1.offset, pkt->payload_len, blockwise, block1.more);
if (block1.offset == 0) {
puts("_sha256_handler(): init");
diff --git a/examples/ndn-ping/ndn_ping.c b/examples/ndn-ping/ndn_ping.c
index 5106aa707..5ebdb08bf 100644
--- a/examples/ndn-ping/ndn_ping.c
+++ b/examples/ndn-ping/ndn_ping.c
@@ -75,12 +75,12 @@ static int on_data(ndn_block_t* interest, ndn_block_t* data)
r = ndn_data_verify_signature(data, ecc_key_pub, sizeof(ecc_key_pub));
if (r != 0) {
- printf("client (pid=%" PRIkernel_pid "): fail to verify signature\n",
- handle->id);
+ printf("client (pid=%" PRIkernel_pid "): fail to verify signature\n",
+ handle->id);
}
else {
- printf("client (pid=%" PRIkernel_pid "): signature valid\n",
- handle->id);
+ printf("client (pid=%" PRIkernel_pid "): signature valid\n",
+ handle->id);
}
return NDN_APP_CONTINUE;
@@ -108,11 +108,11 @@ static int send_interest(void* context)
const char* uri = (const char*)context;
printf("client (pid=%" PRIkernel_pid "): in sched callback, count=%d\n",
- handle->id, ++count);
+ handle->id, ++count);
if (count > max_count) {
/* This is pure hack: ideally should wait for all pending I/O requests
- * to finish before stopping the app. However, this may cause the app
- * to block forever if not implemented very carefully. */
+ * to finish before stopping the app. However, this may cause the app
+ * to block forever if not implemented very carefully. */
printf("client (pid=%" PRIkernel_pid "): stop the app\n", handle->id);
return NDN_APP_STOP;
}
@@ -224,9 +224,9 @@ static int on_interest(ndn_block_t* interest)
ndn_block_t content = { buf, sizeof(rand) };
ndn_shared_block_t* sd =
- ndn_data_create(&sdn->block, &meta, &content,
- NDN_SIG_TYPE_ECDSA_SHA256, NULL,
- ecc_key_pri, sizeof(ecc_key_pri));
+ ndn_data_create(&sdn->block, &meta, &content,
+ NDN_SIG_TYPE_ECDSA_SHA256, NULL,
+ ecc_key_pri, sizeof(ecc_key_pri));
if (sd == NULL) {
printf("server (pid=%" PRIkernel_pid "): cannot create data block\n",
handle->id);
diff --git a/examples/riot_and_cpp/c_functions.c b/examples/riot_and_cpp/c_functions.c
index e5681cc5f..fc92dd9d9 100644
--- a/examples/riot_and_cpp/c_functions.c
+++ b/examples/riot_and_cpp/c_functions.c
@@ -20,7 +20,7 @@
#include "c_functions.h"
-#define IS_LEAP_YEAR(year) ((year%4 == 0) ? ((year%100 == 0) ? ((year%400 == 0) ? 1 : 0) : 1): 0)
+#define IS_LEAP_YEAR(year) ((year%4 == 0) ? ((year%100 == 0) ? ((year%400 == 0) ? 1 : 0) : 1) : 0)
int hello(void)
{
diff --git a/examples/riot_and_cpp/cpp_class.hpp b/examples/riot_and_cpp/cpp_class.hpp
index 353cd72f7..2ee09ef62 100644
--- a/examples/riot_and_cpp/cpp_class.hpp
+++ b/examples/riot_and_cpp/cpp_class.hpp
@@ -28,35 +28,35 @@
class cpp_class
{
public:
- /**
- * @brief constructor
- */
- cpp_class();
-
- /**
- * @brief destructor
- */
- ~cpp_class();
-
- /**
- * @brief public function
- */
- void say_hello(void);
-
- /**
- * @brief overloaded public function with int parameter
- */
- void say_hello(int n);
-
- /**
- * @brief overloaded public function with float parameter
- */
- void say_hello(float f);
+/**
+ * @brief constructor
+ */
+cpp_class();
+
+/**
+ * @brief destructor
+ */
+~cpp_class();
+
+/**
+ * @brief public function
+ */
+void say_hello(void);
+
+/**
+ * @brief overloaded public function with int parameter
+ */
+void say_hello(int n);
+
+/**
+ * @brief overloaded public function with float parameter
+ */
+void say_hello(float f);
private:
- /**
- * @brief private function
- */
- void greet(void);
+/**
+ * @brief private function
+ */
+void greet(void);
};
/** @} */
diff --git a/examples/riot_and_cpp/main.cpp b/examples/riot_and_cpp/main.cpp
index 6bca2c4ab..eb21beeaf 100644
--- a/examples/riot_and_cpp/main.cpp
+++ b/examples/riot_and_cpp/main.cpp
@@ -45,8 +45,8 @@ int main()
/* create thread A */
thread_create(threadA_stack, sizeof(threadA_stack), 0,
- THREAD_CREATE_WOUT_YIELD,
- threadA_func, NULL, "thread A");
+ THREAD_CREATE_WOUT_YIELD,
+ threadA_func, NULL, "thread A");
printf("******** Hello, you're in thread #%" PRIkernel_pid " ********\n", sched_active_pid);
printf("We'll test C++ class and methods here!\n");
@@ -94,7 +94,7 @@ void *threadA_func(void *)
printf("day %d, month %d, year %d is ", day, month, year);
ret_day = day_of_week(day, month, year);
- if (ret_day >= 0){
+ if (ret_day >= 0) {
char day_of_week_table[][32] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
printf("%s\n", day_of_week_table[ret_day]);
}
diff --git a/pkg/fatfs/fatfs_diskio/mtd/mtd_diskio.c b/pkg/fatfs/fatfs_diskio/mtd/mtd_diskio.c
index 5e0723975..62cf6c075 100644
--- a/pkg/fatfs/fatfs_diskio/mtd/mtd_diskio.c
+++ b/pkg/fatfs/fatfs_diskio/mtd/mtd_diskio.c
@@ -47,7 +47,7 @@ DSTATUS disk_status(BYTE pdrv)
DEBUG("disk_status %d\n", pdrv);
if (pdrv >= FF_VOLUMES) {
return STA_NODISK;
- } else if (fatfs_mtd_devs[pdrv]->driver == NULL){
+ } else if (fatfs_mtd_devs[pdrv]->driver == NULL) {
return STA_NOINIT;
}
@@ -68,12 +68,12 @@ DSTATUS disk_initialize(BYTE pdrv)
DEBUG("disk_initialize %d\n", pdrv);
if (pdrv >= FF_VOLUMES) {
return STA_NODISK;
- } else if (fatfs_mtd_devs[pdrv]->driver == NULL){
+ } else if (fatfs_mtd_devs[pdrv]->driver == NULL) {
return STA_NOINIT;
}
return (mtd_init(fatfs_mtd_devs[pdrv]) == 0) ? FATFS_DISKIO_DSTASTUS_OK
- : STA_NOINIT;
+ : STA_NOINIT;
}
/**
@@ -177,7 +177,7 @@ DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
return RES_OK;
/*Erase block size in number of sectors (1 to 32768 in power of 2).
- Return 1 if the erase block size is unknown. */
+ Return 1 if the erase block size is unknown. */
case GET_BLOCK_SIZE:
*(DWORD *)buff = fatfs_mtd_devs[pdrv]->pages_per_sector;
return RES_OK;
diff --git a/pkg/littlefs/fs/littlefs_fs.c b/pkg/littlefs/fs/littlefs_fs.c
index c0dfaf57b..c0f0f63ef 100644
--- a/pkg/littlefs/fs/littlefs_fs.c
+++ b/pkg/littlefs/fs/littlefs_fs.c
@@ -34,37 +34,37 @@
static int littlefs_err_to_errno(ssize_t err)
{
switch (err) {
- case LFS_ERR_OK:
- return 0;
- case LFS_ERR_IO:
- return -EIO;
- case LFS_ERR_CORRUPT:
- return -ENODEV;
- case LFS_ERR_NOENT:
- return -ENOENT;
- case LFS_ERR_EXIST:
- return -EEXIST;
- case LFS_ERR_NOTDIR:
- return -ENOTDIR;
- case LFS_ERR_ISDIR:
- return -EISDIR;
- case LFS_ERR_NOTEMPTY:
- return -ENOTEMPTY;
- case LFS_ERR_BADF:
- return -EBADF;
- case LFS_ERR_INVAL:
- return -EINVAL;
- case LFS_ERR_NOSPC:
- return -ENOSPC;
- case LFS_ERR_NOMEM:
- return -ENOMEM;
- default:
- return err;
+ case LFS_ERR_OK:
+ return 0;
+ case LFS_ERR_IO:
+ return -EIO;
+ case LFS_ERR_CORRUPT:
+ return -ENODEV;
+ case LFS_ERR_NOENT:
+ return -ENOENT;
+ case LFS_ERR_EXIST:
+ return -EEXIST;
+ case LFS_ERR_NOTDIR:
+ return -ENOTDIR;
+ case LFS_ERR_ISDIR:
+ return -EISDIR;
+ case LFS_ERR_NOTEMPTY:
+ return -ENOTEMPTY;
+ case LFS_ERR_BADF:
+ return -EBADF;
+ case LFS_ERR_INVAL:
+ return -EINVAL;
+ case LFS_ERR_NOSPC:
+ return -ENOSPC;
+ case LFS_ERR_NOMEM:
+ return -ENOMEM;
+ default:
+ return err;
}
}
static int _dev_read(const struct lfs_config *c, lfs_block_t block,
- lfs_off_t off, void *buffer, lfs_size_t size)
+ lfs_off_t off, void *buffer, lfs_size_t size)
{
littlefs_desc_t *fs = c->context;
mtd_dev_t *mtd = fs->dev;
@@ -81,7 +81,7 @@ static int _dev_read(const struct lfs_config *c, lfs_block_t block,
}
static int _dev_write(const struct lfs_config *c, lfs_block_t block,
- lfs_off_t off, const void *buffer, lfs_size_t size)
+ lfs_off_t off, const void *buffer, lfs_size_t size)
{
littlefs_desc_t *fs = c->context;
mtd_dev_t *mtd = fs->dev;
@@ -393,12 +393,12 @@ static int _stat(vfs_mount_t *mountp, const char *restrict path, struct stat *re
/* info.name */
buf->st_size = info.size;
switch (info.type) {
- case LFS_TYPE_REG:
- buf->st_mode = S_IFREG;
- break;
- case LFS_TYPE_DIR:
- buf->st_mode = S_IFDIR;
- break;
+ case LFS_TYPE_REG:
+ buf->st_mode = S_IFREG;
+ break;
+ case LFS_TYPE_DIR:
+ buf->st_mode = S_IFDIR;
+ break;
}
return littlefs_err_to_errno(ret);
diff --git a/pkg/lwip/contrib/sock/lwip_sock.c b/pkg/lwip/contrib/sock/lwip_sock.c
index dba775c17..ec570e656 100644
--- a/pkg/lwip/contrib/sock/lwip_sock.c
+++ b/pkg/lwip/contrib/sock/lwip_sock.c
@@ -142,12 +142,12 @@ static bool _addr_on_netif(int family, int netif_num, const ip_addr_t *addr)
}
#ifdef MODULE_LWIP_SOCK_IP
-#define _set_port(p, ep, type) \
+#define _set_port(p, ep, type) \
if (!((type) & NETCONN_RAW)) { \
- p = (ep)->port; \
+ p = (ep)->port; \
}
#else
-#define _set_port(p, ep, type) \
+#define _set_port(p, ep, type) \
p = (ep)->port;
#endif
@@ -409,7 +409,7 @@ int lwip_sock_get_addr(struct netconn *conn, struct _sock_tl_ep *ep, u8_t local)
#ifdef MODULE_LWIP_SOCK_IP
/* XXX lwIP's API is very inconsistent here so we need to check if addr
* was changed */
- && !local && ip_addr_isany_val(addr)
+ && !local && ip_addr_isany_val(addr)
#endif
) {
return res;
diff --git a/pkg/lwip/contrib/sock/udp/lwip_sock_udp.c b/pkg/lwip/contrib/sock/udp/lwip_sock_udp.c
index 96a49536e..909855fd3 100644
--- a/pkg/lwip/contrib/sock/udp/lwip_sock_udp.c
+++ b/pkg/lwip/contrib/sock/udp/lwip_sock_udp.c
@@ -93,14 +93,14 @@ ssize_t sock_udp_recv(sock_udp_t *sock, void *data, size_t max_len,
else {
#endif
#if LWIP_IPV4
- addr_len = sizeof(ipv4_addr_t);
- remote->family = AF_INET;
+ addr_len = sizeof(ipv4_addr_t);
+ remote->family = AF_INET;
#else
- netbuf_delete(buf);
- return -EPROTO;
+ netbuf_delete(buf);
+ return -EPROTO;
#endif
#if LWIP_IPV6
- }
+ }
#endif
#if LWIP_NETBUF_RECVINFO
remote->netif = lwip_sock_bind_addr_to_netif(&buf->toaddr);
diff --git a/pkg/lwip/include/arch/cc.h b/pkg/lwip/include/arch/cc.h
index d31d7d8f7..064c05752 100644
--- a/pkg/lwip/include/arch/cc.h
+++ b/pkg/lwip/include/arch/cc.h
@@ -82,24 +82,24 @@ extern "C" {
# ifdef NDEBUG
# define LWIP_PLATFORM_ASSERT(x)
# else
-# define LWIP_PLATFORM_ASSERT(x) \
- do { \
- LOG_ERROR("Assertion \"%s\" failed at %s:%d\n", x, __FILE__, __LINE__); \
- fflush(NULL); \
- abort(); \
- } while (0)
+# define LWIP_PLATFORM_ASSERT(x) \
+ do { \
+ LOG_ERROR("Assertion \"%s\" failed at %s:%d\n", x, __FILE__, __LINE__); \
+ fflush(NULL); \
+ abort(); \
+ } while (0)
# endif
#else
# define LWIP_PLATFORM_DIAG(x) printf x
# ifdef NDEBUG
# define LWIP_PLATFORM_ASSERT(x)
# else
-# define LWIP_PLATFORM_ASSERT(x) \
- do { \
- printf("Assertion \"%s\" failed at %s:%d\n", x, __FILE__, __LINE__); \
- fflush(NULL); \
- abort(); \
- } while (0)
+# define LWIP_PLATFORM_ASSERT(x) \
+ do { \
+ printf("Assertion \"%s\" failed at %s:%d\n", x, __FILE__, __LINE__); \
+ fflush(NULL); \
+ abort(); \
+ } while (0)
# endif
#endif
diff --git a/pkg/lwip/include/lwip/sock_internal.h b/pkg/lwip/include/lwip/sock_internal.h
index 68eca5679..f7c2870cd 100644
--- a/pkg/lwip/include/lwip/sock_internal.h
+++ b/pkg/lwip/include/lwip/sock_internal.h
@@ -48,8 +48,8 @@ extern "C" {
* @{
*/
int lwip_sock_create(struct netconn **conn, const struct _sock_tl_ep *local,
- const struct _sock_tl_ep *remote, int proto,
- uint16_t flags, int type);
+ const struct _sock_tl_ep *remote, int proto,
+ uint16_t flags, int type);
uint16_t lwip_sock_bind_addr_to_netif(const ip_addr_t *bind_addr);
int lwip_sock_get_addr(struct netconn *conn, struct _sock_tl_ep *ep, u8_t local);
#if defined(MODULE_LWIP_SOCK_UDP) || defined(MODULE_LWIP_SOCK_IP)
diff --git a/pkg/nordic_softdevice_ble/src/ble-core.c b/pkg/nordic_softdevice_ble/src/ble-core.c
index b076cab1a..9e3df4815 100644
--- a/pkg/nordic_softdevice_ble/src/ble-core.c
+++ b/pkg/nordic_softdevice_ble/src/ble-core.c
@@ -77,32 +77,32 @@ ble_evt_dispatch(ble_evt_t * p_ble_evt);
void
ble_stack_init(void)
{
- uint32_t err_code;
-
- // Enable BLE stack.
- ble_enable_params_t ble_enable_params;
- memset(&ble_enable_params, 0, sizeof(ble_enable_params));
- ble_enable_params.gatts_enable_params.attr_tab_size =
- BLE_GATTS_ATTR_TAB_SIZE_DEFAULT;
- ble_enable_params.gatts_enable_params.service_changed =
- IS_SRVC_CHANGED_CHARACT_PRESENT;
- err_code = sd_ble_enable(&ble_enable_params);
- APP_ERROR_CHECK(err_code);
-
- // Register with the SoftDevice handler module for BLE events.
- err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
- APP_ERROR_CHECK(err_code);
-
- // Setup address
- ble_gap_addr_t ble_addr;
- err_code = sd_ble_gap_address_get(&ble_addr);
- APP_ERROR_CHECK(err_code);
-
- ble_addr.addr[5] = 0x00;
- ble_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
-
- err_code = sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &ble_addr);
- APP_ERROR_CHECK(err_code);
+ uint32_t err_code;
+
+ // Enable BLE stack.
+ ble_enable_params_t ble_enable_params;
+ memset(&ble_enable_params, 0, sizeof(ble_enable_params));
+ ble_enable_params.gatts_enable_params.attr_tab_size =
+ BLE_GATTS_ATTR_TAB_SIZE_DEFAULT;
+ ble_enable_params.gatts_enable_params.service_changed =
+ IS_SRVC_CHANGED_CHARACT_PRESENT;
+ err_code = sd_ble_enable(&ble_enable_params);
+ APP_ERROR_CHECK(err_code);
+
+ // Register with the SoftDevice handler module for BLE events.
+ err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
+ APP_ERROR_CHECK(err_code);
+
+ // Setup address
+ ble_gap_addr_t ble_addr;
+ err_code = sd_ble_gap_address_get(&ble_addr);
+ APP_ERROR_CHECK(err_code);
+
+ ble_addr.addr[5] = 0x00;
+ ble_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
+
+ err_code = sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &ble_addr);
+ APP_ERROR_CHECK(err_code);
}
/*---------------------------------------------------------------------------*/
/**
@@ -112,13 +112,13 @@ ble_stack_init(void)
void
ble_get_mac(uint8_t addr[8])
{
- uint32_t err_code;
- ble_gap_addr_t ble_addr;
+ uint32_t err_code;
+ ble_gap_addr_t ble_addr;
- err_code = sd_ble_gap_address_get(&ble_addr);
- APP_ERROR_CHECK(err_code);
+ err_code = sd_ble_gap_address_get(&ble_addr);
+ APP_ERROR_CHECK(err_code);
- IPV6_EUI64_CREATE_FROM_EUI48(addr, ble_addr.addr, ble_addr.addr_type);
+ IPV6_EUI64_CREATE_FROM_EUI48(addr, ble_addr.addr, ble_addr.addr_type);
}
/*---------------------------------------------------------------------------*/
/**
@@ -128,38 +128,38 @@ ble_get_mac(uint8_t addr[8])
void
ble_advertising_init(const char *name)
{
- uint32_t err_code;
- ble_advdata_t advdata;
- uint8_t flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
- ble_gap_conn_sec_mode_t sec_mode;
+ uint32_t err_code;
+ ble_advdata_t advdata;
+ uint8_t flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
+ ble_gap_conn_sec_mode_t sec_mode;
- BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
+ BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
- err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)name,
- strlen(name));
- APP_ERROR_CHECK(err_code);
+ err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)name,
+ strlen(name));
+ APP_ERROR_CHECK(err_code);
- ble_uuid_t adv_uuids[] = {{BLE_UUID_IPSP_SERVICE, BLE_UUID_TYPE_BLE}};
+ ble_uuid_t adv_uuids[] = {{BLE_UUID_IPSP_SERVICE, BLE_UUID_TYPE_BLE}};
- // Build and set advertising data.
- memset(&advdata, 0, sizeof(advdata));
+ // Build and set advertising data.
+ memset(&advdata, 0, sizeof(advdata));
- advdata.name_type = BLE_ADVDATA_FULL_NAME;
- advdata.flags = flags;
- advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
- advdata.uuids_complete.p_uuids = adv_uuids;
+ advdata.name_type = BLE_ADVDATA_FULL_NAME;
+ advdata.flags = flags;
+ advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
+ advdata.uuids_complete.p_uuids = adv_uuids;
- err_code = ble_advdata_set(&advdata, NULL);
- APP_ERROR_CHECK(err_code);
+ err_code = ble_advdata_set(&advdata, NULL);
+ APP_ERROR_CHECK(err_code);
- // Initialize advertising parameters (used when starting advertising).
- memset(&m_adv_params, 0, sizeof(m_adv_params));
+ // Initialize advertising parameters (used when starting advertising).
+ memset(&m_adv_params, 0, sizeof(m_adv_params));
- m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND;
- m_adv_params.p_peer_addr = NULL; // Undirected advertisement.
- m_adv_params.fp = BLE_GAP_ADV_FP_ANY;
- m_adv_params.interval = APP_ADV_ADV_INTERVAL;
- m_adv_params.timeout = APP_ADV_TIMEOUT;
+ m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND;
+ m_adv_params.p_peer_addr = NULL; // Undirected advertisement.
+ m_adv_params.fp = BLE_GAP_ADV_FP_ANY;
+ m_adv_params.interval = APP_ADV_ADV_INTERVAL;
+ m_adv_params.timeout = APP_ADV_TIMEOUT;
}
/*---------------------------------------------------------------------------*/
/**
@@ -168,12 +168,12 @@ ble_advertising_init(const char *name)
void
ble_advertising_start(void)
{
- uint32_t err_code;
+ uint32_t err_code;
- err_code = sd_ble_gap_adv_start(&m_adv_params);
- APP_ERROR_CHECK(err_code);
+ err_code = sd_ble_gap_adv_start(&m_adv_params);
+ APP_ERROR_CHECK(err_code);
- DEBUG("ble-core: advertising started\n");
+ DEBUG("ble-core: advertising started\n");
}
/*---------------------------------------------------------------------------*/
/**
@@ -200,23 +200,23 @@ ble_gap_addr_print(const ble_gap_addr_t *addr)
static void
on_ble_evt(ble_evt_t *p_ble_evt)
{
- switch(p_ble_evt->header.evt_id) {
- case BLE_GAP_EVT_CONNECTED:
- DEBUG("ble-core: connected [handle:%d, peer: ", p_ble_evt->evt.gap_evt.conn_handle);
- ble_gap_addr_print(&(p_ble_evt->evt.gap_evt.params.connected.peer_addr));
- DEBUG("]\n");
- sd_ble_gap_rssi_start(p_ble_evt->evt.gap_evt.conn_handle,
- BLE_GAP_RSSI_THRESHOLD_INVALID,
- 0);
- break;
-
- case BLE_GAP_EVT_DISCONNECTED:
- DEBUG("ble-core: disconnected [handle:%d]\n", p_ble_evt->evt.gap_evt.conn_handle);
- ble_advertising_start();
- break;
- default:
- break;
- }
+ switch(p_ble_evt->header.evt_id) {
+ case BLE_GAP_EVT_CONNECTED:
+ DEBUG("ble-core: connected [handle:%d, peer: ", p_ble_evt->evt.gap_evt.conn_handle);
+ ble_gap_addr_print(&(p_ble_evt->evt.gap_evt.params.connected.peer_addr));
+ DEBUG("]\n");
+ sd_ble_gap_rssi_start(p_ble_evt->evt.gap_evt.conn_handle,
+ BLE_GAP_RSSI_THRESHOLD_INVALID,
+ 0);
+ break;
+
+ case BLE_GAP_EVT_DISCONNECTED:
+ DEBUG("ble-core: disconnected [handle:%d]\n", p_ble_evt->evt.gap_evt.conn_handle);
+ ble_advertising_start();
+ break;
+ default:
+ break;
+ }
}
/*---------------------------------------------------------------------------*/
/**
@@ -226,8 +226,8 @@ on_ble_evt(ble_evt_t *p_ble_evt)
static void
ble_evt_dispatch(ble_evt_t *p_ble_evt)
{
- ble_ipsp_evt_handler(p_ble_evt);
- on_ble_evt(p_ble_evt);
+ ble_ipsp_evt_handler(p_ble_evt);
+ on_ble_evt(p_ble_evt);
}
/*---------------------------------------------------------------------------*/
/**
diff --git a/pkg/nordic_softdevice_ble/src/ble-mac.c b/pkg/nordic_softdevice_ble/src/ble-mac.c
index 4724dbd29..910a055db 100644
--- a/pkg/nordic_softdevice_ble/src/ble-mac.c
+++ b/pkg/nordic_softdevice_ble/src/ble-mac.c
@@ -52,8 +52,8 @@
#endif
typedef struct {
- uint8_t peer_addr[8];
- ble_ipsp_handle_t handle;
+ uint8_t peer_addr[8];
+ ble_ipsp_handle_t handle;
} ble_mac_interface_t;
static ble_mac_interface_t interfaces[BLE_MAC_MAX_INTERFACE_NUM];
@@ -150,9 +150,9 @@ static ble_ipsp_handle_t *_find_handle(const uint8_t *addr)
*/
static int _send_to_peer(ble_ipsp_handle_t *handle, void *data, size_t len)
{
- DEBUG("ble-mac: sending packet[GAP handle:%d CID:0x%04X]\n",
+ DEBUG("ble-mac: sending packet[GAP handle:%d CID:0x%04X]\n",
handle->conn_handle, handle->cid);
- return ble_ipsp_send(handle, data, len);
+ return ble_ipsp_send(handle, data, len);
}
static int _is_broadcast(uint8_t dest[8])
diff --git a/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c b/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c
index 312a6135b..240430423 100644
--- a/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c
+++ b/pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c
@@ -84,8 +84,8 @@ static void _ble_mac_callback(ble_mac_event_enum_t event, void* arg)
static void _handle_raw_sixlowpan(ble_mac_inbuf_t *inbuf)
{
gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, inbuf->payload,
- inbuf->len,
- GNRC_NETTYPE_SIXLOWPAN);
+ inbuf->len,
+ GNRC_NETTYPE_SIXLOWPAN);
if(!pkt) {
DEBUG("_handle_raw_sixlowpan(): no space left in packet buffer.\n");
@@ -95,8 +95,8 @@ static void _handle_raw_sixlowpan(ble_mac_inbuf_t *inbuf)
/* create netif header */
gnrc_pktsnip_t *netif_hdr;
netif_hdr = gnrc_pktbuf_add(NULL, NULL,
- sizeof(gnrc_netif_hdr_t) + (2 * sizeof(eui64_t)),
- GNRC_NETTYPE_NETIF);
+ sizeof(gnrc_netif_hdr_t) + (2 * sizeof(eui64_t)),
+ GNRC_NETTYPE_NETIF);
if (netif_hdr == NULL) {
DEBUG("_handle_raw_sixlowpan(): no space left in packet buffer.\n");
@@ -110,9 +110,9 @@ static void _handle_raw_sixlowpan(ble_mac_inbuf_t *inbuf)
((gnrc_netif_hdr_t *)netif_hdr->data)->if_pid = _ble_netif->pid;
DEBUG("_handle_raw_sixlowpan(): received packet from %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
- "of length %d\n",
- inbuf->src[0], inbuf->src[1], inbuf->src[2], inbuf->src[3], inbuf->src[4],
- inbuf->src[5], inbuf->src[6], inbuf->src[7], inbuf->len);
+ "of length %d\n",
+ inbuf->src[0], inbuf->src[1], inbuf->src[2], inbuf->src[3], inbuf->src[4],
+ inbuf->src[5], inbuf->src[6], inbuf->src[7], inbuf->len);
#if defined(MODULE_OD) && ENABLE_DEBUG
od_hex_dump(inbuf->payload, inbuf->len, OD_WIDTH_DEFAULT);
#endif
@@ -258,12 +258,12 @@ static void _netif_msg_handler(gnrc_netif_t *netif, msg_t *msg)
{
switch (msg->type) {
case BLE_EVENT_RX_DONE:
- {
- DEBUG("ble rx:\n");
- _handle_raw_sixlowpan(msg->content.ptr);
- ble_mac_busy_rx = 0;
- break;
- }
+ {
+ DEBUG("ble rx:\n");
+ _handle_raw_sixlowpan(msg->content.ptr);
+ ble_mac_busy_rx = 0;
+ break;
+ }
}
}
diff --git a/pkg/openthread/contrib/netdev/openthread_netdev.c b/pkg/openthread/contrib/netdev/openthread_netdev.c
index 348da5ac9..30ddc77d1 100644
--- a/pkg/openthread/contrib/netdev/openthread_netdev.c
+++ b/pkg/openthread/contrib/netdev/openthread_netdev.c
@@ -133,18 +133,18 @@ static void *_openthread_event_loop(void *arg) {
static void _event_cb(netdev_t *dev, netdev_event_t event) {
switch (event) {
case NETDEV_EVENT_ISR:
- {
- msg_t msg;
- assert(_pid != KERNEL_PID_UNDEF);
+ {
+ msg_t msg;
+ assert(_pid != KERNEL_PID_UNDEF);
- msg.type = OPENTHREAD_NETDEV_MSG_TYPE_EVENT;
- msg.content.ptr = dev;
+ msg.type = OPENTHREAD_NETDEV_MSG_TYPE_EVENT;
+ msg.content.ptr = dev;
- if (msg_send(&msg, _pid) <= 0) {
- DEBUG("openthread_netdev: possibly lost interrupt.\n");
- }
- break;
+ if (msg_send(&msg, _pid) <= 0) {
+ DEBUG("openthread_netdev: possibly lost interrupt.\n");
}
+ break;
+ }
case NETDEV_EVENT_RX_COMPLETE:
DEBUG("openthread_netdev: Reception of a packet\n");
diff --git a/pkg/openthread/contrib/platform_radio.c b/pkg/openthread/contrib/platform_radio.c
index 8095bb658..202092c85 100644
--- a/pkg/openthread/contrib/platform_radio.c
+++ b/pkg/openthread/contrib/platform_radio.c
@@ -150,7 +150,7 @@ void recv_pkt(otInstance *aInstance, netdev_t *dev)
Rssi = (int8_t)rx_info.rssi;
sReceiveFrame.mPower = Rssi;
- DEBUG("Received message: len %d\n", (int) sReceiveFrame.mLength);
+ DEBUG("Received message: len %d\n", (int) sReceiveFrame.mLength);
for (int i = 0; i < sReceiveFrame.mLength; ++i) {
DEBUG("%x ", sReceiveFrame.mPsdu[i]);
}
diff --git a/pkg/semtech-loramac/contrib/semtech_loramac.c b/pkg/semtech-loramac/contrib/semtech_loramac.c
index 0114d6557..19a8efd17 100644
--- a/pkg/semtech-loramac/contrib/semtech_loramac.c
+++ b/pkg/semtech-loramac/contrib/semtech_loramac.c
@@ -702,7 +702,7 @@ uint8_t semtech_loramac_recv(semtech_loramac_t *mac)
default:
ret = SEMTECH_LORAMAC_TX_DONE;
break;
- }
+ }
DEBUG("[semtech-loramac] MAC reply received: %d\n", ret);
diff --git a/pkg/spiffs/fs/spiffs_fs.c b/pkg/spiffs/fs/spiffs_fs.c
index 73c017035..49061ac6f 100644
--- a/pkg/spiffs/fs/spiffs_fs.c
+++ b/pkg/spiffs/fs/spiffs_fs.c
@@ -65,7 +65,7 @@ static int32_t _dev_erase(struct spiffs_t *fs, u32_t addr, u32_t size)
{
mtd_dev_t *dev = (mtd_dev_t *)fs->user_data;
- DEBUG("spiffs: erase: from addr 0x%" PRIx32" size 0x%" PRIx32 "\n", addr, size);
+ DEBUG("spiffs: erase: from addr 0x%" PRIx32 " size 0x%" PRIx32 "\n", addr, size);
return mtd_erase(dev, addr, size);
}
@@ -99,7 +99,7 @@ static int32_t _dev_write(u32_t addr, u32_t size, const u8_t *src)
static int32_t _dev_erase(u32_t addr, u32_t size)
{
- DEBUG("spiffs: erase: from addr 0x%" PRIx32" size 0x%" PRIx32 "\n", addr, size);
+ DEBUG("spiffs: erase: from addr 0x%" PRIx32 " size 0x%" PRIx32 "\n", addr, size);
return mtd_erase(SPIFFS_MTD_DEV, addr, size);
}
@@ -424,82 +424,82 @@ static int spiffs_err_to_errno (s32_t err)
DEBUG("spiffs: error=%" PRId32 "\n", err);
switch (err) {
- case SPIFFS_OK:
- return 0;
- case SPIFFS_ERR_NOT_MOUNTED:
- return -EINVAL;
- case SPIFFS_ERR_FULL:
- return -ENOSPC;
- case SPIFFS_ERR_NOT_FOUND:
- return -ENOENT;
- case SPIFFS_ERR_END_OF_OBJECT:
- return 0;
- case SPIFFS_ERR_DELETED:
- return -ENOENT;
- case SPIFFS_ERR_MOUNTED:
- return -EBUSY;
- case SPIFFS_ERR_ERASE_FAIL:
- return -EIO;
- case SPIFFS_ERR_MAGIC_NOT_POSSIBLE:
- return -ENOSPC;
- case SPIFFS_ERR_NO_DELETED_BLOCKS:
- return 0;
- case SPIFFS_ERR_FILE_EXISTS:
- return -EEXIST;
- case SPIFFS_ERR_NOT_A_FILE:
- return -ENOENT;
- case SPIFFS_ERR_RO_NOT_IMPL:
- return -EROFS;
- case SPIFFS_ERR_RO_ABORTED_OPERATION:
- return -SPIFFS_ERR_RO_ABORTED_OPERATION;
- case SPIFFS_ERR_PROBE_TOO_FEW_BLOCKS:
- return -ENOSPC;
- case SPIFFS_ERR_PROBE_NOT_A_FS:
- return -ENODEV;
- case SPIFFS_ERR_NAME_TOO_LONG:
- return -ENAMETOOLONG;
- case SPIFFS_ERR_NOT_FINALIZED:
- return -ENODEV;
- case SPIFFS_ERR_NOT_INDEX:
- return -ENODEV;
- case SPIFFS_ERR_OUT_OF_FILE_DESCS:
- return -ENFILE;
- case SPIFFS_ERR_FILE_CLOSED:
- return -ENOENT;
- case SPIFFS_ERR_FILE_DELETED:
- return -ENOENT;
- case SPIFFS_ERR_BAD_DESCRIPTOR:
- return -EBADF;
- case SPIFFS_ERR_IS_INDEX:
- return -ENOENT;
- case SPIFFS_ERR_IS_FREE:
- return -ENOENT;
- case SPIFFS_ERR_INDEX_SPAN_MISMATCH:
- return -EIO;
- case SPIFFS_ERR_DATA_SPAN_MISMATCH:
- return -EIO;
- case SPIFFS_ERR_INDEX_REF_FREE:
- return -EIO;
- case SPIFFS_ERR_INDEX_REF_LU:
- return -EIO;
- case SPIFFS_ERR_INDEX_REF_INVALID:
- return -EIO;
- case SPIFFS_ERR_INDEX_FREE:
- return -EIO;
- case SPIFFS_ERR_INDEX_LU:
- return -EIO;
- case SPIFFS_ERR_INDEX_INVALID:
- return -EIO;
- case SPIFFS_ERR_NOT_WRITABLE:
- return -EACCES;
- case SPIFFS_ERR_NOT_READABLE:
- return -EACCES;
- case SPIFFS_ERR_CONFLICTING_NAME:
- return -EEXIST;
- case SPIFFS_ERR_NOT_CONFIGURED:
- return -ENODEV;
- case SPIFFS_ERR_NOT_A_FS:
- return -ENODEV;
+ case SPIFFS_OK:
+ return 0;
+ case SPIFFS_ERR_NOT_MOUNTED:
+ return -EINVAL;
+ case SPIFFS_ERR_FULL:
+ return -ENOSPC;
+ case SPIFFS_ERR_NOT_FOUND:
+ return -ENOENT;
+ case SPIFFS_ERR_END_OF_OBJECT:
+ return 0;
+ case SPIFFS_ERR_DELETED:
+ return -ENOENT;
+ case SPIFFS_ERR_MOUNTED:
+ return -EBUSY;
+ case SPIFFS_ERR_ERASE_FAIL:
+ return -EIO;
+ case SPIFFS_ERR_MAGIC_NOT_POSSIBLE:
+ return -ENOSPC;
+ case SPIFFS_ERR_NO_DELETED_BLOCKS:
+ return 0;
+ case SPIFFS_ERR_FILE_EXISTS:
+ return -EEXIST;
+ case SPIFFS_ERR_NOT_A_FILE:
+ return -ENOENT;
+ case SPIFFS_ERR_RO_NOT_IMPL:
+ return -EROFS;
+ case SPIFFS_ERR_RO_ABORTED_OPERATION:
+ return -SPIFFS_ERR_RO_ABORTED_OPERATION;
+ case SPIFFS_ERR_PROBE_TOO_FEW_BLOCKS:
+ return -ENOSPC;
+ case SPIFFS_ERR_PROBE_NOT_A_FS:
+ return -ENODEV;
+ case SPIFFS_ERR_NAME_TOO_LONG:
+ return -ENAMETOOLONG;
+ case SPIFFS_ERR_NOT_FINALIZED:
+ return -ENODEV;
+ case SPIFFS_ERR_NOT_INDEX:
+ return -ENODEV;
+ case SPIFFS_ERR_OUT_OF_FILE_DESCS:
+ return -ENFILE;
+ case SPIFFS_ERR_FILE_CLOSED:
+ return -ENOENT;
+ case SPIFFS_ERR_FILE_DELETED:
+ return -ENOENT;
+ case SPIFFS_ERR_BAD_DESCRIPTOR:
+ return -EBADF;
+ case SPIFFS_ERR_IS_INDEX:
+ return -ENOENT;
+ case SPIFFS_ERR_IS_FREE:
+ return -ENOENT;
+ case SPIFFS_ERR_INDEX_SPAN_MISMATCH:
+ return -EIO;
+ case SPIFFS_ERR_DATA_SPAN_MISMATCH:
+ return -EIO;
+ case SPIFFS_ERR_INDEX_REF_FREE:
+ return -EIO;
+ case SPIFFS_ERR_INDEX_REF_LU:
+ return -EIO;
+ case SPIFFS_ERR_INDEX_REF_INVALID:
+ return -EIO;
+ case SPIFFS_ERR_INDEX_FREE:
+ return -EIO;
+ case SPIFFS_ERR_INDEX_LU:
+ return -EIO;
+ case SPIFFS_ERR_INDEX_INVALID:
+ return -EIO;
+ case SPIFFS_ERR_NOT_WRITABLE:
+ return -EACCES;
+ case SPIFFS_ERR_NOT_READABLE:
+ return -EACCES;
+ case SPIFFS_ERR_CONFLICTING_NAME:
+ return -EEXIST;
+ case SPIFFS_ERR_NOT_CONFIGURED:
+ return -ENODEV;
+ case SPIFFS_ERR_NOT_A_FS:
+ return -ENODEV;
}
return (int) err;
diff --git a/sys/arduino/include/serialport.hpp b/sys/arduino/include/serialport.hpp
index f9a22ca0f..6d7af0c90 100644
--- a/sys/arduino/include/serialport.hpp
+++ b/sys/arduino/include/serialport.hpp
@@ -45,256 +45,256 @@ enum SerialFormat {
class SerialPort {
private:
- uart_t dev;
- char rx_mem[SERIAL_RX_BUFSIZE];
- ringbuffer_t rx_buf;
+uart_t dev;
+char rx_mem[SERIAL_RX_BUFSIZE];
+ringbuffer_t rx_buf;
public:
- /**
- * @brief Constructor maps the serial port to a RIOT UART device
- *
- * @param[in] dev RIOT UART device
- */
- explicit SerialPort(uart_t dev);
+/**
+ * @brief Constructor maps the serial port to a RIOT UART device
+ *
+ * @param[in] dev RIOT UART device
+ */
+explicit SerialPort(uart_t dev);
- /**
- * @brief Get the number of bytes (characters) available for reading from
- * the serial port
- *
- * This is data that's already arrived and stored in the serial receive
- * buffer (which holds 64 bytes). available() inherits from the Stream
- * utility class.
- *
- * Copied from https://www.arduino.cc/en/Serial/Available
- *
- * @return The number of bytes available to read
- */
- int available(void);
+/**
+ * @brief Get the number of bytes (characters) available for reading from
+ * the serial port
+ *
+ * This is data that's already arrived and stored in the serial receive
+ * buffer (which holds 64 bytes). available() inherits from the Stream
+ * utility class.
+ *
+ * Copied from https://www.arduino.cc/en/Serial/Available
+ *
+ * @return The number of bytes available to read
+ */
+int available(void);
- /**
- * @brief Sets the data rate in bits per second (baud) for serial data
- * transmission
- *
- * For communicating with the computer, use one of these rates: 300, 600,
- * 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200. You
- * can, however, specify other rates - for example, to communicate over
- * pins 0 and 1 with a component that requires a particular baud rate.
- *
- * Copied from https://www.arduino.cc/en/Serial/Begin
- *
- * @param[in] speed speed in bits per second (baud)
- */
- void begin(long speed);
+/**
+ * @brief Sets the data rate in bits per second (baud) for serial data
+ * transmission
+ *
+ * For communicating with the computer, use one of these rates: 300, 600,
+ * 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200. You
+ * can, however, specify other rates - for example, to communicate over
+ * pins 0 and 1 with a component that requires a particular baud rate.
+ *
+ * Copied from https://www.arduino.cc/en/Serial/Begin
+ *
+ * @param[in] speed speed in bits per second (baud)
+ */
+void begin(long speed);
- /**
- * @brief Disables serial communication, allowing the RX and TX pins to be
- * used for general input and output
- *
- * To re-enable serial communication, call @ref begin()
- *
- * Copied from https://www.arduino.cc/en/Serial/End
- */
- void end(void);
+/**
+ * @brief Disables serial communication, allowing the RX and TX pins to be
+ * used for general input and output
+ *
+ * To re-enable serial communication, call @ref begin()
+ *
+ * Copied from https://www.arduino.cc/en/Serial/End
+ */
+void end(void);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- *
- * Prints data to the serial port as human-readable ASCII text. This command
- * can take many forms. Numbers are printed using an ASCII character for
- * each digit. Floats are similarly printed as ASCII digits, defaulting to
- * two decimal places. Bytes are sent as a single character. Characters and
- * strings are sent as is.
- *
- * Copied from https://www.arduino.cc/en/Serial/Print
- *
- * @param[in] val the value to print
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t print(int val);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ *
+ * Prints data to the serial port as human-readable ASCII text. This command
+ * can take many forms. Numbers are printed using an ASCII character for
+ * each digit. Floats are similarly printed as ASCII digits, defaulting to
+ * two decimal places. Bytes are sent as a single character. Characters and
+ * strings are sent as is.
+ *
+ * Copied from https://www.arduino.cc/en/Serial/Print
+ *
+ * @param[in] val the value to print
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t print(int val);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- *
- * @see print()
- *
- * @param[in] val the value to print
- * @param[in] format specifies the number base
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t print(int val, SerialFormat format);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ *
+ * @see print()
+ *
+ * @param[in] val the value to print
+ * @param[in] format specifies the number base
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t print(int val, SerialFormat format);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- *
- * @param[in] val the value to print
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t print(float val);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ *
+ * @param[in] val the value to print
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t print(float val);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- *
- * @see print()
- *
- * @param[in] val the value to print
- * @param[in] format number of decimal places
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t print(float val, int format);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ *
+ * @see print()
+ *
+ * @param[in] val the value to print
+ * @param[in] format number of decimal places
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t print(float val, int format);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- *
- * @see print()
- *
- * @param[in] val the value to print
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t print(char val);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ *
+ * @see print()
+ *
+ * @param[in] val the value to print
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t print(char val);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- *
- * @see print()
- *
- * @param[in] val the value to print
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t print(const char *val);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ *
+ * @see print()
+ *
+ * @param[in] val the value to print
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t print(const char *val);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- * followed by a carriage return character (ASCII 13, or "\r") and
- * a newline character (ASCII 10, or "\n")
- *
- * This command takes the same forms as @ref print().
- *
- * Copied from https://www.arduino.cc/en/Serial/Println
- *
- * @param[in] val the value to print
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t println(int val);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ * followed by a carriage return character (ASCII 13, or "\r") and
+ * a newline character (ASCII 10, or "\n")
+ *
+ * This command takes the same forms as @ref print().
+ *
+ * Copied from https://www.arduino.cc/en/Serial/Println
+ *
+ * @param[in] val the value to print
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t println(int val);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- * followed by a carriage return character (ASCII 13, or "\r") and
- * a newline character (ASCII 10, or "\n")
- *
- * @see println()
- *
- * @param[in] val the value to print
- * @param[in] format specifies the number base
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t println(int val, SerialFormat format);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ * followed by a carriage return character (ASCII 13, or "\r") and
+ * a newline character (ASCII 10, or "\n")
+ *
+ * @see println()
+ *
+ * @param[in] val the value to print
+ * @param[in] format specifies the number base
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t println(int val, SerialFormat format);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- * followed by a carriage return character (ASCII 13, or "\r") and
- * a newline character (ASCII 10, or "\n")
- *
- * @see println()
- *
- * @param[in] val the value to print
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t println(float val);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ * followed by a carriage return character (ASCII 13, or "\r") and
+ * a newline character (ASCII 10, or "\n")
+ *
+ * @see println()
+ *
+ * @param[in] val the value to print
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t println(float val);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- * followed by a carriage return character (ASCII 13, or "\r") and
- * a newline character (ASCII 10, or "\n")
- *
- * @see println()
- *
- * @param[in] val the value to print
- * @param[in] format number of decimal places
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t println(float val, int format);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ * followed by a carriage return character (ASCII 13, or "\r") and
+ * a newline character (ASCII 10, or "\n")
+ *
+ * @see println()
+ *
+ * @param[in] val the value to print
+ * @param[in] format number of decimal places
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t println(float val, int format);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- * followed by a carriage return character (ASCII 13, or "\r") and
- * a newline character (ASCII 10, or "\n")
- *
- * @see println()
- *
- * @param[in] val the value to print
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t println(char val);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ * followed by a carriage return character (ASCII 13, or "\r") and
+ * a newline character (ASCII 10, or "\n")
+ *
+ * @see println()
+ *
+ * @param[in] val the value to print
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t println(char val);
- /**
- * @brief Prints data to the serial port as human-readable ASCII text
- * followed by a carriage return character (ASCII 13, or "\r") and
- * a newline character (ASCII 10, or "\n")
- *
- * @see println()
- *
- * @param[in] val the value to print
- *
- * @return the number of bytes written, reading that number is optional
- */
- size_t println(const char *val);
+/**
+ * @brief Prints data to the serial port as human-readable ASCII text
+ * followed by a carriage return character (ASCII 13, or "\r") and
+ * a newline character (ASCII 10, or "\n")
+ *
+ * @see println()
+ *
+ * @param[in] val the value to print
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+size_t println(const char *val);
- /**
- * @brief Reads incoming serial data
- *
- * Copied from https://www.arduino.cc/en/Serial/Read
- *
- * @return the first byte of incoming serial data available
- * @return -1 if no data is available
- */
- int read(void);
+/**
+ * @brief Reads incoming serial data
+ *
+ * Copied from https://www.arduino.cc/en/Serial/Read
+ *
+ * @return the first byte of incoming serial data available
+ * @return -1 if no data is available
+ */
+int read(void);
- /**
- * @brief Writes binary data to the serial port
- *
- * This data is sent as a byte or series of bytes; to send the characters
- * representing the digits of a number use the @ref print() function instead.
- *
- * Copied from https://www.arduino.cc/en/Serial/Write
- *
- * @param[in] val a value to send as a single byte
- *
- * @return the number of bytes written, reading that number is optional
- */
- int write(int val);
+/**
+ * @brief Writes binary data to the serial port
+ *
+ * This data is sent as a byte or series of bytes; to send the characters
+ * representing the digits of a number use the @ref print() function instead.
+ *
+ * Copied from https://www.arduino.cc/en/Serial/Write
+ *
+ * @param[in] val a value to send as a single byte
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+int write(int val);
- /**
- * @brief Writes binary data to the serial port
- *
- * @see write()
- *
- * @param[in] str a string to send as a series of bytes
- *
- * @return the number of bytes written, reading that number is optional
- */
- int write(const char *str);
+/**
+ * @brief Writes binary data to the serial port
+ *
+ * @see write()
+ *
+ * @param[in] str a string to send as a series of bytes
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+int write(const char *str);
- /**
- * @brief Writes binary data to the serial port
- * @details [long description]
- *
- * @param[in] buf an array to send as a series of bytes
- * @param[in] len the length of the buffer
- *
- * @return the number of bytes written, reading that number is optional
- */
- int write(char *buf, int len);
+/**
+ * @brief Writes binary data to the serial port
+ * @details [long description]
+ *
+ * @param[in] buf an array to send as a series of bytes
+ * @param[in] len the length of the buffer
+ *
+ * @return the number of bytes written, reading that number is optional
+ */
+int write(char *buf, int len);
};
#endif /* ARDUINO_SERIAL_H */
diff --git a/sys/auto_init/auto_init.c b/sys/auto_init/auto_init.c
index 7d47c6334..2a824bad4 100644
--- a/sys/auto_init/auto_init.c
+++ b/sys/auto_init/auto_init.c
@@ -307,8 +307,8 @@ void auto_init(void)
auto_init_lis3dh();
#endif
#ifdef MODULE_LIS3MDL
-extern void auto_init_lis3mdl(void);
-auto_init_lis3mdl();
+ extern void auto_init_lis3mdl(void);
+ auto_init_lis3mdl();
#endif
#ifdef MODULE_MAG3110
extern void auto_init_mag3110(void);
@@ -323,8 +323,8 @@ auto_init_lis3mdl();
auto_init_mpl3115a2();
#endif
#ifdef MODULE_MPU9150
-extern void auto_init_mpu9150(void);
-auto_init_mpu9150();
+ extern void auto_init_mpu9150(void);
+ auto_init_mpu9150();
#endif
#ifdef MODULE_GROVE_LEDBAR
extern void auto_init_grove_ledbar(void);
diff --git a/sys/auto_init/saul/auto_init_si70xx.c b/sys/auto_init/saul/auto_init_si70xx.c
index 11783e6c7..2aa403efe 100644
--- a/sys/auto_init/saul/auto_init_si70xx.c
+++ b/sys/auto_init/saul/auto_init_si70xx.c
@@ -74,7 +74,7 @@ void auto_init_si70xx(void)
saul_entries[(i * 2) + 1].dev = &si70xx_devs[i];
saul_entries[(i * 2) + 1].name = si70xx_saul_info[i].name;
saul_entries[(i * 2) + 1].driver = \
- &si70xx_relative_humidity_saul_driver;
+ &si70xx_relative_humidity_saul_driver;
saul_reg_add(&saul_entries[i * 2]);
saul_reg_add(&saul_entries[(i * 2) + 1]);
diff --git a/sys/can/conn/isotp.c b/sys/can/conn/isotp.c
index bd3516292..86a2042ac 100644
--- a/sys/can/conn/isotp.c
+++ b/sys/can/conn/isotp.c
@@ -170,26 +170,26 @@ int conn_can_isotp_send(conn_can_isotp_t *conn, const void *buf, size_t size, in
while (1) {
get_msg(conn, &msg);
switch (msg.type) {
- case CAN_MSG_TX_ERROR:
- if (msg.content.ptr == conn) {
- ret = -EIO;
- }
+ case CAN_MSG_TX_ERROR:
+ if (msg.content.ptr == conn) {
+ ret = -EIO;
+ }
/* Fall through */
- case CAN_MSG_TX_CONFIRMATION:
+ case CAN_MSG_TX_CONFIRMATION:
#ifdef MODULE_CONN_CAN_ISOTP_MULTI
- if (msg.content.ptr != conn) {
- mbox_put(&conn->master->mbox, &msg);
- break;
- }
+ if (msg.content.ptr != conn) {
+ mbox_put(&conn->master->mbox, &msg);
+ break;
+ }
#endif
- xtimer_remove(&timer);
- return ret;
- case _TIMEOUT_TX_MSG_TYPE:
- return -ETIMEDOUT;
- default:
- DEBUG("conn_can_isotp_send: unexpected msg %x, requeing\n", msg.type);
- put_msg(conn, &msg);
- break;
+ xtimer_remove(&timer);
+ return ret;
+ case _TIMEOUT_TX_MSG_TYPE:
+ return -ETIMEDOUT;
+ default:
+ DEBUG("conn_can_isotp_send: unexpected msg %x, requeing\n", msg.type);
+ put_msg(conn, &msg);
+ break;
}
}
}
@@ -249,57 +249,57 @@ int conn_can_isotp_recv(conn_can_isotp_t *conn, void *buf, size_t size, uint32_t
while (1) {
get_msg(conn, &msg);
switch (msg.type) {
- case CAN_MSG_RX_INDICATION:
- DEBUG("conn_can_isotp_recv: CAN_MSG_RX_INDICATION\n");
- rx = msg.content.ptr;
- snip = rx->data.iov_base;
+ case CAN_MSG_RX_INDICATION:
+ DEBUG("conn_can_isotp_recv: CAN_MSG_RX_INDICATION\n");
+ rx = msg.content.ptr;
+ snip = rx->data.iov_base;
#ifdef MODULE_CONN_CAN_ISOTP_MULTI
- if (rx->arg != conn) {
- mbox_put(&conn->master->mbox, &msg);
- break;
- }
+ if (rx->arg != conn) {
+ mbox_put(&conn->master->mbox, &msg);
+ break;
+ }
#endif
- if (timeout != 0) {
- xtimer_remove(&timer);
- }
- if (snip->size <= size) {
- memcpy(buf, snip->data, snip->size);
- ret = snip->size;
- }
- else {
- ret = -EOVERFLOW;
- }
- isotp_free_rx(rx);
- return ret;
- case _TIMEOUT_RX_MSG_TYPE:
- DEBUG("conn_can_isotp_recv: _TIMEOUT_RX_MSG_TYPE\n");
- if (msg.content.value == _TIMEOUT_MSG_VALUE) {
- ret = -ETIMEDOUT;
- }
- else {
- ret = -EINTR;
- }
- return ret;
- case _CLOSE_CONN_MSG_TYPE:
- DEBUG("conn_can_isotp_recv: _CLOSE_CONN_MSG_TYPE\n");
+ if (timeout != 0) {
+ xtimer_remove(&timer);
+ }
+ if (snip->size <= size) {
+ memcpy(buf, snip->data, snip->size);
+ ret = snip->size;
+ }
+ else {
+ ret = -EOVERFLOW;
+ }
+ isotp_free_rx(rx);
+ return ret;
+ case _TIMEOUT_RX_MSG_TYPE:
+ DEBUG("conn_can_isotp_recv: _TIMEOUT_RX_MSG_TYPE\n");
+ if (msg.content.value == _TIMEOUT_MSG_VALUE) {
+ ret = -ETIMEDOUT;
+ }
+ else {
+ ret = -EINTR;
+ }
+ return ret;
+ case _CLOSE_CONN_MSG_TYPE:
+ DEBUG("conn_can_isotp_recv: _CLOSE_CONN_MSG_TYPE\n");
#ifdef MODULE_CONN_CAN_ISOTP_MULTI
- if ((msg.content.ptr == conn) || (msg.content.ptr == conn->master)) {
+ if ((msg.content.ptr == conn) || (msg.content.ptr == conn->master)) {
#endif
if (timeout != 0) {
xtimer_remove(&timer);
}
return -ECONNABORTED;
#ifdef MODULE_CONN_CAN_ISOTP_MULTI
- }
+ }
#endif
- break;
- default:
- DEBUG("conn_can_isotp_recv: unexpected msg %x\n", msg.type);
- if (timeout != 0) {
- xtimer_remove(&timer);
- }
- ret = -EINTR;
- return ret;
+ break;
+ default:
+ DEBUG("conn_can_isotp_recv: unexpected msg %x\n", msg.type);
+ if (timeout != 0) {
+ xtimer_remove(&timer);
+ }
+ ret = -EINTR;
+ return ret;
}
}
@@ -389,28 +389,28 @@ int conn_can_isotp_select(conn_can_isotp_slave_t **conn, conn_can_isotp_t *maste
xtimer_remove(&timer);
}
switch (msg.type) {
- case CAN_MSG_RX_INDICATION:
- DEBUG("conn_can_isotp_select: CAN_MSG_RX_INDICATION\n");
- rx = msg.content.ptr;
- *conn = rx->arg;
- (*conn)->rx = rx;
- ret = 0;
- break;
- case _TIMEOUT_RX_MSG_TYPE:
- DEBUG("conn_can_isotp_select: _TIMEOUT_MSG_VALUE\n");
- if (msg.content.value == _TIMEOUT_MSG_VALUE) {
- ret = -ETIMEDOUT;
- }
- else {
+ case CAN_MSG_RX_INDICATION:
+ DEBUG("conn_can_isotp_select: CAN_MSG_RX_INDICATION\n");
+ rx = msg.content.ptr;
+ *conn = rx->arg;
+ (*conn)->rx = rx;
+ ret = 0;
+ break;
+ case _TIMEOUT_RX_MSG_TYPE:
+ DEBUG("conn_can_isotp_select: _TIMEOUT_MSG_VALUE\n");
+ if (msg.content.value == _TIMEOUT_MSG_VALUE) {
+ ret = -ETIMEDOUT;
+ }
+ else {
+ ret = -EINTR;
+ }
+ *conn = NULL;
+ break;
+ default:
+ DEBUG("conn_can_isotp_select: %d\n", msg.type);
+ *conn = NULL;
ret = -EINTR;
- }
- *conn = NULL;
- break;
- default:
- DEBUG("conn_can_isotp_select: %d\n", msg.type);
- *conn = NULL;
- ret = -EINTR;
- break;
+ break;
}
return ret;
diff --git a/sys/can/conn/raw.c b/sys/can/conn/raw.c
index 47a791dac..5c3364ebd 100644
--- a/sys/can/conn/raw.c
+++ b/sys/can/conn/raw.c
@@ -81,7 +81,7 @@ int conn_can_raw_set_filter(conn_can_raw_t *conn, struct can_filter *filter, siz
if (conn->count) {
for (size_t i = 0; i < conn->count; i++) {
DEBUG("conn_can_raw_set_filter: unsetting filter=0x%" PRIx32 ", mask=0x%" PRIx32 "\n",
- conn->filter[i].can_id, conn->filter[i].can_mask);
+ conn->filter[i].can_id, conn->filter[i].can_mask);
raw_can_unsubscribe_rx_mbox(conn->ifnum, &conn->filter[i], &conn->mbox, conn);
}
}
@@ -155,31 +155,31 @@ int conn_can_raw_send(conn_can_raw_t *conn, const struct can_frame *frame, int f
mbox_get(&conn->mbox, &msg);
xtimer_remove(&timer);
switch (msg.type) {
- case CAN_MSG_TX_ERROR:
- return -EIO;
- case CAN_MSG_TX_CONFIRMATION:
- if ((int)msg.content.value == handle) {
- DEBUG("conn_can_raw_send: frame sent correctly\n");
- return 0;
- }
- else {
+ case CAN_MSG_TX_ERROR:
+ return -EIO;
+ case CAN_MSG_TX_CONFIRMATION:
+ if ((int)msg.content.value == handle) {
+ DEBUG("conn_can_raw_send: frame sent correctly\n");
+ return 0;
+ }
+ else {
+ raw_can_abort(conn->ifnum, handle);
+ return -EINTR;
+ }
+ break;
+ case _TIMEOUT_TX_MSG_TYPE:
+ DEBUG("conn_can_raw_send: timeout\n");
raw_can_abort(conn->ifnum, handle);
- return -EINTR;
- }
- break;
- case _TIMEOUT_TX_MSG_TYPE:
- DEBUG("conn_can_raw_send: timeout\n");
- raw_can_abort(conn->ifnum, handle);
- return -ETIMEDOUT;
- break;
- default:
- DEBUG("conn_can_raw_send: unexpected msg=%x, requeing\n", msg.type);
- mbox_put(&conn->mbox, &msg);
- if (!timeout--) {
- return -EINTR;
- }
- xtimer_set(&timer, CONN_CAN_RAW_TIMEOUT_TX_CONF);
- break;
+ return -ETIMEDOUT;
+ break;
+ default:
+ DEBUG("conn_can_raw_send: unexpected msg=%x, requeing\n", msg.type);
+ mbox_put(&conn->mbox, &msg);
+ if (!timeout--) {
+ return -EINTR;
+ }
+ xtimer_set(&timer, CONN_CAN_RAW_TIMEOUT_TX_CONF);
+ break;
}
}
}
@@ -221,33 +221,33 @@ int conn_can_raw_recv(conn_can_raw_t *conn, struct can_frame *frame, uint32_t ti
xtimer_remove(&timer);
}
switch (msg.type) {
- case CAN_MSG_RX_INDICATION:
- DEBUG("conn_can_raw_recv: CAN_MSG_RX_INDICATION\n");
- rx = msg.content.ptr;
- memcpy(frame, rx->data.iov_base, rx->data.iov_len);
- ret = rx->data.iov_len;
- raw_can_free_frame(rx);
- break;
- case _TIMEOUT_RX_MSG_TYPE:
- if (msg.content.value == _TIMEOUT_MSG_VALUE) {
- ret = -ETIMEDOUT;
- }
- else {
- ret = -EINTR;
- }
- break;
- case _CLOSE_CONN_MSG_TYPE:
- if (msg.content.ptr == conn) {
- ret = -ECONNABORTED;
- }
- else {
+ case CAN_MSG_RX_INDICATION:
+ DEBUG("conn_can_raw_recv: CAN_MSG_RX_INDICATION\n");
+ rx = msg.content.ptr;
+ memcpy(frame, rx->data.iov_base, rx->data.iov_len);
+ ret = rx->data.iov_len;
+ raw_can_free_frame(rx);
+ break;
+ case _TIMEOUT_RX_MSG_TYPE:
+ if (msg.content.value == _TIMEOUT_MSG_VALUE) {
+ ret = -ETIMEDOUT;
+ }
+ else {
+ ret = -EINTR;
+ }
+ break;
+ case _CLOSE_CONN_MSG_TYPE:
+ if (msg.content.ptr == conn) {
+ ret = -ECONNABORTED;
+ }
+ else {
+ ret = -EINTR;
+ }
+ break;
+ default:
+ mbox_put(&conn->mbox, &msg);
ret = -EINTR;
- }
- break;
- default:
- mbox_put(&conn->mbox, &msg);
- ret = -EINTR;
- break;
+ break;
}
return ret;
@@ -263,7 +263,7 @@ int conn_can_raw_close(conn_can_raw_t *conn)
if (conn->count) {
for (size_t i = 0; i < conn->count; i++) {
DEBUG("conn_can_raw_close: unsetting filter=0x%" PRIx32 ", mask=0x%" PRIx32 "\n",
- conn->filter[i].can_id, conn->filter[i].can_mask);
+ conn->filter[i].can_id, conn->filter[i].can_mask);
raw_can_unsubscribe_rx_mbox(conn->ifnum, &conn->filter[i], &conn->mbox, conn);
}
conn->count = 0;
diff --git a/sys/can/device.c b/sys/can/device.c
index def5273d6..c9df6e746 100644
--- a/sys/can/device.c
+++ b/sys/can/device.c
@@ -61,56 +61,56 @@ static void _can_event(candev_t *dev, candev_event_t event, void *arg)
candev_dev->ifnum, candev_dev->pid, (void*)candev_dev->dev);
switch (event) {
- case CANDEV_EVENT_ISR:
- DEBUG("_can_event: CANDEV_EVENT_ISR\n");
- msg.type = CAN_MSG_EVENT;
- if (msg_send(&msg, candev_dev->pid) <= 0) {
- DEBUG("can device: isr lost\n");
- }
- break;
- case CANDEV_EVENT_WAKE_UP:
- DEBUG("_can_event: CANDEV_EVENT_WAKE_UP\n");
- power_up(candev_dev);
+ case CANDEV_EVENT_ISR:
+ DEBUG("_can_event: CANDEV_EVENT_ISR\n");
+ msg.type = CAN_MSG_EVENT;
+ if (msg_send(&msg, candev_dev->pid) <= 0) {
+ DEBUG("can device: isr lost\n");
+ }
+ break;
+ case CANDEV_EVENT_WAKE_UP:
+ DEBUG("_can_event: CANDEV_EVENT_WAKE_UP\n");
+ power_up(candev_dev);
#ifdef MODULE_CAN_PM
- pm_reset(candev_dev, candev_dev->rx_inactivity_timeout);
+ pm_reset(candev_dev, candev_dev->rx_inactivity_timeout);
#endif
- break;
- case CANDEV_EVENT_TX_CONFIRMATION:
- DEBUG("_can_event: CANDEV_EVENT_TX_CONFIRMATION\n");
- /* frame pointer in arg */
- pkt = container_of((struct can_frame *)arg, can_pkt_t, frame);
- can_dll_dispatch_tx_conf(pkt);
- break;
- case CANDEV_EVENT_TX_ERROR:
- DEBUG("_can_event: CANDEV_EVENT_TX_ERROR\n");
- /* frame pointer in arg */
- pkt = container_of((struct can_frame *)arg, can_pkt_t, frame);
- can_dll_dispatch_tx_error(pkt);
- break;
- case CANDEV_EVENT_RX_INDICATION:
- DEBUG("_can_event: CANDEV_EVENT_RX_INDICATION\n");
+ break;
+ case CANDEV_EVENT_TX_CONFIRMATION:
+ DEBUG("_can_event: CANDEV_EVENT_TX_CONFIRMATION\n");
+ /* frame pointer in arg */
+ pkt = container_of((struct can_frame *)arg, can_pkt_t, frame);
+ can_dll_dispatch_tx_conf(pkt);
+ break;
+ case CANDEV_EVENT_TX_ERROR:
+ DEBUG("_can_event: CANDEV_EVENT_TX_ERROR\n");
+ /* frame pointer in arg */
+ pkt = container_of((struct can_frame *)arg, can_pkt_t, frame);
+ can_dll_dispatch_tx_error(pkt);
+ break;
+ case CANDEV_EVENT_RX_INDICATION:
+ DEBUG("_can_event: CANDEV_EVENT_RX_INDICATION\n");
#ifdef MODULE_CAN_PM
- pm_reset(candev_dev, candev_dev->rx_inactivity_timeout);
+ pm_reset(candev_dev, candev_dev->rx_inactivity_timeout);
#endif
- /* received frame in arg */
- frame = (struct can_frame *) arg;
- can_dll_dispatch_rx_frame(frame, candev_dev->pid);
- break;
- case CANDEV_EVENT_RX_ERROR:
- DEBUG("_can_event: CANDEV_EVENT_RX_ERROR\n");
- break;
- case CANDEV_EVENT_BUS_OFF:
- dev->state = CAN_STATE_BUS_OFF;
- break;
- case CANDEV_EVENT_ERROR_PASSIVE:
- dev->state = CAN_STATE_ERROR_PASSIVE;
- break;
- case CANDEV_EVENT_ERROR_WARNING:
- dev->state = CAN_STATE_ERROR_WARNING;
- break;
- default:
- DEBUG("_can_event: unknown event\n");
- break;
+ /* received frame in arg */
+ frame = (struct can_frame *) arg;
+ can_dll_dispatch_rx_frame(frame, candev_dev->pid);
+ break;
+ case CANDEV_EVENT_RX_ERROR:
+ DEBUG("_can_event: CANDEV_EVENT_RX_ERROR\n");
+ break;
+ case CANDEV_EVENT_BUS_OFF:
+ dev->state = CAN_STATE_BUS_OFF;
+ break;
+ case CANDEV_EVENT_ERROR_PASSIVE:
+ dev->state = CAN_STATE_ERROR_PASSIVE;
+ break;
+ case CANDEV_EVENT_ERROR_WARNING:
+ dev->state = CAN_STATE_ERROR_WARNING;
+ break;
+ default:
+ DEBUG("_can_event: unknown event\n");
+ break;
}
}
@@ -177,7 +177,7 @@ static void pm_reset(candev_dev_t *candev_dev, uint32_t value)
}
if (candev_dev->last_pm_update == 0 ||
- value > (candev_dev->last_pm_value - (xtimer_now_usec() - candev_dev->last_pm_update))) {
+ value > (candev_dev->last_pm_value - (xtimer_now_usec() - candev_dev->last_pm_update))) {
candev_dev->last_pm_value = value;
candev_dev->last_pm_update = xtimer_now_usec();
xtimer_set(&candev_dev->pm_timer, value);
@@ -242,108 +242,108 @@ static void *_can_device_thread(void *args)
while (1) {
msg_receive(&msg);
switch (msg.type) {
- case CAN_MSG_EVENT:
- DEBUG("can device: CAN_MSG_EVENT received\n");
- dev->driver->isr(dev);
- break;
- case CAN_MSG_ABORT_FRAME:
- DEBUG("can device: CAN_MSG_ABORT_FRAME received\n");
- pkt = (can_pkt_t *) msg.content.ptr;
- dev->driver->abort(dev, &pkt->frame);
- reply.type = CAN_MSG_ACK;
- reply.content.value = 0;
- msg_reply(&msg, &reply);
- break;
- case CAN_MSG_SEND_FRAME:
- DEBUG("can device: CAN_MSG_SEND_FRAME received\n");
- wake_up(candev_dev);
- /* read incoming pkt */
- pkt = (can_pkt_t *) msg.content.ptr;
- dev->driver->send(dev, &pkt->frame);
- break;
- case CAN_MSG_SET:
- DEBUG("can device: CAN_MSG_SET received\n");
- /* read incoming options */
- opt = (can_opt_t *)msg.content.ptr;
- /* set option for device driver */
- res = dev->driver->set(dev, opt->opt, opt->data, opt->data_len);
- /* send reply to calling thread */
- reply.type = CAN_MSG_ACK;
- reply.content.value = (uint32_t)res;
- msg_reply(&msg, &reply);
- break;
- case CAN_MSG_GET:
- DEBUG("can device: CAN_MSG_GET received\n");
- /* read incoming options */
- opt = (can_opt_t *)msg.content.ptr;
- /* get option for device driver */
- res = dev->driver->get(dev, opt->opt, opt->data, opt->data_len);
- /* send reply to calling thread */
- reply.type = CAN_MSG_ACK;
- reply.content.value = (uint32_t)res;
- msg_reply(&msg, &reply);
- break;
- case CAN_MSG_SET_FILTER:
- DEBUG("can device: CAN_MSG_SET_FILTER received\n");
- wake_up(candev_dev);
- /* set filter for device driver */
- res = dev->driver->set_filter(dev, msg.content.ptr);
- /* send reply to calling thread */
- reply.type = CAN_MSG_ACK;
- reply.content.value = (uint32_t)res;
- msg_reply(&msg, &reply);
- break;
- case CAN_MSG_REMOVE_FILTER:
- DEBUG("can device: CAN_MSG_REMOVE_FILTER received\n");
- wake_up(candev_dev);
- /* set filter for device driver */
- res = dev->driver->remove_filter(dev, msg.content.ptr);
- /* send reply to calling thread */
- reply.type = CAN_MSG_ACK;
- reply.content.value = (uint32_t)res;
- msg_reply(&msg, &reply);
- break;
- case CAN_MSG_POWER_UP:
- DEBUG("can device: CAN_MSG_POWER_UP received\n");
- res = power_up(candev_dev);
+ case CAN_MSG_EVENT:
+ DEBUG("can device: CAN_MSG_EVENT received\n");
+ dev->driver->isr(dev);
+ break;
+ case CAN_MSG_ABORT_FRAME:
+ DEBUG("can device: CAN_MSG_ABORT_FRAME received\n");
+ pkt = (can_pkt_t *) msg.content.ptr;
+ dev->driver->abort(dev, &pkt->frame);
+ reply.type = CAN_MSG_ACK;
+ reply.content.value = 0;
+ msg_reply(&msg, &reply);
+ break;
+ case CAN_MSG_SEND_FRAME:
+ DEBUG("can device: CAN_MSG_SEND_FRAME received\n");
+ wake_up(candev_dev);
+ /* read incoming pkt */
+ pkt = (can_pkt_t *) msg.content.ptr;
+ dev->driver->send(dev, &pkt->frame);
+ break;
+ case CAN_MSG_SET:
+ DEBUG("can device: CAN_MSG_SET received\n");
+ /* read incoming options */
+ opt = (can_opt_t *)msg.content.ptr;
+ /* set option for device driver */
+ res = dev->driver->set(dev, opt->opt, opt->data, opt->data_len);
+ /* send reply to calling thread */
+ reply.type = CAN_MSG_ACK;
+ reply.content.value = (uint32_t)res;
+ msg_reply(&msg, &reply);
+ break;
+ case CAN_MSG_GET:
+ DEBUG("can device: CAN_MSG_GET received\n");
+ /* read incoming options */
+ opt = (can_opt_t *)msg.content.ptr;
+ /* get option for device driver */
+ res = dev->driver->get(dev, opt->opt, opt->data, opt->data_len);
+ /* send reply to calling thread */
+ reply.type = CAN_MSG_ACK;
+ reply.content.value = (uint32_t)res;
+ msg_reply(&msg, &reply);
+ break;
+ case CAN_MSG_SET_FILTER:
+ DEBUG("can device: CAN_MSG_SET_FILTER received\n");
+ wake_up(candev_dev);
+ /* set filter for device driver */
+ res = dev->driver->set_filter(dev, msg.content.ptr);
+ /* send reply to calling thread */
+ reply.type = CAN_MSG_ACK;
+ reply.content.value = (uint32_t)res;
+ msg_reply(&msg, &reply);
+ break;
+ case CAN_MSG_REMOVE_FILTER:
+ DEBUG("can device: CAN_MSG_REMOVE_FILTER received\n");
+ wake_up(candev_dev);
+ /* set filter for device driver */
+ res = dev->driver->remove_filter(dev, msg.content.ptr);
+ /* send reply to calling thread */
+ reply.type = CAN_MSG_ACK;
+ reply.content.value = (uint32_t)res;
+ msg_reply(&msg, &reply);
+ break;
+ case CAN_MSG_POWER_UP:
+ DEBUG("can device: CAN_MSG_POWER_UP received\n");
+ res = power_up(candev_dev);
#ifdef MODULE_CAN_PM
- pm_reset(candev_dev, 0);
+ pm_reset(candev_dev, 0);
#endif
- /* send reply to calling thread */
- reply.type = CAN_MSG_ACK;
- reply.content.value = (uint32_t)res;
- msg_reply(&msg, &reply);
- break;
- case CAN_MSG_POWER_DOWN:
- DEBUG("can device: CAN_MSG_POWER_DOWN received\n");
- res = power_down(candev_dev);
- /* send reply to calling thread */
- reply.type = CAN_MSG_ACK;
- reply.content.value = (uint32_t)res;
- msg_reply(&msg, &reply);
- break;
+ /* send reply to calling thread */
+ reply.type = CAN_MSG_ACK;
+ reply.content.value = (uint32_t)res;
+ msg_reply(&msg, &reply);
+ break;
+ case CAN_MSG_POWER_DOWN:
+ DEBUG("can device: CAN_MSG_POWER_DOWN received\n");
+ res = power_down(candev_dev);
+ /* send reply to calling thread */
+ reply.type = CAN_MSG_ACK;
+ reply.content.value = (uint32_t)res;
+ msg_reply(&msg, &reply);
+ break;
#ifdef MODULE_CAN_TRX
- case CAN_MSG_SET_TRX:
- DEBUG("can device: CAN_MSG_SET_TRX received\n");
- reply.type = CAN_MSG_ACK;
- if (dev->state != CAN_STATE_SLEEPING) {
- reply.content.value = -EBUSY;
- }
- else {
- candev_dev->trx = msg.content.ptr;
- reply.content.value = 0;
- }
- msg_reply(&msg, &reply);
- break;
+ case CAN_MSG_SET_TRX:
+ DEBUG("can device: CAN_MSG_SET_TRX received\n");
+ reply.type = CAN_MSG_ACK;
+ if (dev->state != CAN_STATE_SLEEPING) {
+ reply.content.value = -EBUSY;
+ }
+ else {
+ candev_dev->trx = msg.content.ptr;
+ reply.content.value = 0;
+ }
+ msg_reply(&msg, &reply);
+ break;
#endif
#ifdef MODULE_CAN_PM
- case CAN_MSG_PM:
- DEBUG("can device: pm power down\n");
- power_down(candev_dev);
- break;
+ case CAN_MSG_PM:
+ DEBUG("can device: pm power down\n");
+ power_down(candev_dev);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
}
@@ -362,7 +362,7 @@ kernel_pid_t can_device_init(char *stack, int stacksize, char priority,
/* create new can device thread */
res = thread_create(stack, stacksize, priority, THREAD_CREATE_STACKTEST,
- _can_device_thread, (void *)params, name);
+ _can_device_thread, (void *)params, name);
if (res <= 0) {
return -EINVAL;
}
diff --git a/sys/can/dll.c b/sys/can/dll.c
index ea221d65f..3ad07a83e 100644
--- a/sys/can/dll.c
+++ b/sys/can/dll.c
@@ -493,7 +493,7 @@ int raw_can_get_ifnum_by_name(const char *name)
{
for (int i = 0; i < candev_nb; i++) {
if ((strcmp(name, candev_list[i]->name) == 0) &&
- (strlen(name) == strlen(candev_list[i]->name))) {
+ (strlen(name) == strlen(candev_list[i]->name))) {
return i;
}
}
diff --git a/sys/can/isotp/isotp.c b/sys/can/isotp/isotp.c
index 3de240118..c2e24fa8b 100644
--- a/sys/can/isotp/isotp.c
+++ b/sys/can/isotp/isotp.c
@@ -108,13 +108,13 @@ static int _send_msg(msg_t *msg, can_reg_entry_t *entry)
{
#ifdef MODULE_CAN_MBOX
switch (entry->type) {
- case CAN_TYPE_DEFAULT:
- return msg_try_send(msg, entry->target.pid);
- case CAN_TYPE_MBOX:
- DEBUG("_send_msg: sending msg=%p to mbox=%p\n", (void *)msg, (void *)entry->target.mbox);
- return mbox_try_put(entry->target.mbox, msg);
- default:
- return -ENOTSUP;
+ case CAN_TYPE_DEFAULT:
+ return msg_try_send(msg, entry->target.pid);
+ case CAN_TYPE_MBOX:
+ DEBUG("_send_msg: sending msg=%p to mbox=%p\n", (void *)msg, (void *)entry->target.mbox);
+ return mbox_try_put(entry->target.mbox, msg);
+ default:
+ return -ENOTSUP;
}
#else
return msg_try_send(msg, entry->target.pid);
@@ -222,7 +222,7 @@ static int _isotp_rcv_fc(struct isotp *isotp, struct can_frame *frame, int ae)
isotp->txfc.bs, isotp->txfc.stmin);
if ((isotp->txfc.stmin > 0x7F) &&
- ((isotp->txfc.stmin < 0xF1) || (isotp->txfc.stmin > 0xF9))) {
+ ((isotp->txfc.stmin < 0xF1) || (isotp->txfc.stmin > 0xF9))) {
/* according to ISO15765-2 8.5.5.6 */
isotp->txfc.stmin = 0x7F;
}
@@ -237,30 +237,30 @@ static int _isotp_rcv_fc(struct isotp *isotp, struct can_frame *frame, int ae)
}
switch (frame->data[ae] & 0xF) {
- case ISOTP_FC_CTS:
- isotp->tx_wft = 0;
- isotp->tx.bs = 0;
- isotp->tx.state = ISOTP_SENDING_NEXT_CF;
- xtimer_set(&isotp->tx_timer, isotp->tx_gap);
- break;
-
- case ISOTP_FC_WT:
- if (isotp->tx_wft++ >= isotp->txfc.wftmax) {
- isotp->tx.state = ISOTP_IDLE;
- _isotp_dispatch_tx(isotp, ETIMEDOUT);
- return 1;
- }
- /* BS and STmin shall be ignored */
- xtimer_set(&isotp->tx_timer, CAN_ISOTP_TIMEOUT_N_Bs);
- break;
+ case ISOTP_FC_CTS:
+ isotp->tx_wft = 0;
+ isotp->tx.bs = 0;
+ isotp->tx.state = ISOTP_SENDING_NEXT_CF;
+ xtimer_set(&isotp->tx_timer, isotp->tx_gap);
+ break;
+
+ case ISOTP_FC_WT:
+ if (isotp->tx_wft++ >= isotp->txfc.wftmax) {
+ isotp->tx.state = ISOTP_IDLE;
+ _isotp_dispatch_tx(isotp, ETIMEDOUT);
+ return 1;
+ }
+ /* BS and STmin shall be ignored */
+ xtimer_set(&isotp->tx_timer, CAN_ISOTP_TIMEOUT_N_Bs);
+ break;
- case ISOTP_FC_OVFLW:
+ case ISOTP_FC_OVFLW:
/* overflow on receiver side -> error */
- default:
- isotp->tx.state = ISOTP_IDLE;
- _isotp_dispatch_tx(isotp, EOVERFLOW);
- break;
+ default:
+ isotp->tx.state = ISOTP_IDLE;
+ _isotp_dispatch_tx(isotp, EOVERFLOW);
+ break;
}
return 0;
@@ -406,7 +406,7 @@ static int _isotp_rcv(struct isotp *isotp, struct can_frame *frame)
#if ENABLE_DEBUG
DEBUG("_isotp_rcv: id=%" PRIx32 " data=", frame->can_id);
for (int i = 0; i < frame->can_dlc; i++) {
- DEBUG("%02hhx", frame->data[i]);
+ DEBUG("%02hhx", frame->data[i]);
}
DEBUG("\n");
#endif
@@ -418,17 +418,17 @@ static int _isotp_rcv(struct isotp *isotp, struct can_frame *frame)
n_pci_type = frame->data[ae] & 0xF0;
switch (n_pci_type) {
- case N_PCI_FC:
- return _isotp_rcv_fc(isotp, frame, ae);
+ case N_PCI_FC:
+ return _isotp_rcv_fc(isotp, frame, ae);
- case N_PCI_SF:
- return _isotp_rcv_sf(isotp, frame, ae);
+ case N_PCI_SF:
+ return _isotp_rcv_sf(isotp, frame, ae);
- case N_PCI_FF:
- return _isotp_rcv_ff(isotp, frame, ae);
+ case N_PCI_FF:
+ return _isotp_rcv_ff(isotp, frame, ae);
- case N_PCI_CF:
- return _isotp_rcv_cf(isotp, frame, ae);
+ case N_PCI_CF:
+ return _isotp_rcv_cf(isotp, frame, ae);
}
@@ -462,7 +462,7 @@ static int _isotp_send_fc(struct isotp *isotp, int ae, uint8_t status)
#if ENABLE_DEBUG
DEBUG("_isotp_send_fc: id=%" PRIx32 " data=", fc.can_id);
for (int i = 0; i < fc.can_dlc; i++) {
- DEBUG("%02hhx", fc.data[i]);
+ DEBUG("%02hhx", fc.data[i]);
}
DEBUG("\n");
#endif
@@ -536,31 +536,31 @@ static void _isotp_tx_timeout_task(struct isotp *isotp)
DEBUG("_isotp_tx_timeout_task: state=%d\n", isotp->tx.state);
switch (isotp->tx.state) {
- case ISOTP_WAIT_FC:
- DEBUG("_isotp_tx_timeout_task: FC not received on time\n");
- isotp->tx.state = ISOTP_IDLE;
- _isotp_dispatch_tx(isotp, ETIMEDOUT);
- break;
+ case ISOTP_WAIT_FC:
+ DEBUG("_isotp_tx_timeout_task: FC not received on time\n");
+ isotp->tx.state = ISOTP_IDLE;
+ _isotp_dispatch_tx(isotp, ETIMEDOUT);
+ break;
- case ISOTP_SENDING_NEXT_CF:
- DEBUG("_isotp_tx_timeout_task: sending next CF\n");
- _isotp_fill_dataframe(isotp, &frame, ae);
- frame.data[ae] = N_PCI_CF | isotp->tx.sn++;
- isotp->tx.sn %= 16;
- isotp->tx.bs++;
-
- isotp->tx.state = ISOTP_SENDING_CF;
- _isotp_tx_send(isotp, &frame);
- break;
-
- case ISOTP_SENDING_CF:
- case ISOTP_SENDING_FF:
- case ISOTP_SENDING_SF:
- DEBUG("_isotp_tx_timeout_task: timeout on DLL\n");
- isotp->tx.state = ISOTP_IDLE;
- raw_can_abort(isotp->entry.ifnum, isotp->tx.tx_handle);
- _isotp_dispatch_tx(isotp, ETIMEDOUT);
- break;
+ case ISOTP_SENDING_NEXT_CF:
+ DEBUG("_isotp_tx_timeout_task: sending next CF\n");
+ _isotp_fill_dataframe(isotp, &frame, ae);
+ frame.data[ae] = N_PCI_CF | isotp->tx.sn++;
+ isotp->tx.sn %= 16;
+ isotp->tx.bs++;
+
+ isotp->tx.state = ISOTP_SENDING_CF;
+ _isotp_tx_send(isotp, &frame);
+ break;
+
+ case ISOTP_SENDING_CF:
+ case ISOTP_SENDING_FF:
+ case ISOTP_SENDING_SF:
+ DEBUG("_isotp_tx_timeout_task: timeout on DLL\n");
+ isotp->tx.state = ISOTP_IDLE;
+ raw_can_abort(isotp->entry.ifnum, isotp->tx.tx_handle);
+ _isotp_dispatch_tx(isotp, ETIMEDOUT);
+ break;
}
}
@@ -572,51 +572,51 @@ static void _isotp_tx_tx_conf(struct isotp *isotp)
DEBUG("_isotp_tx_tx_conf: state=%d\n", isotp->tx.state);
switch (isotp->tx.state) {
- case ISOTP_SENDING_SF:
- isotp->tx.state = ISOTP_IDLE;
- _isotp_dispatch_tx(isotp, 0);
- break;
-
- case ISOTP_SENDING_FF:
- isotp->tx.state = ISOTP_WAIT_FC;
- xtimer_set(&isotp->tx_timer, CAN_ISOTP_TIMEOUT_N_Bs);
- break;
-
- case ISOTP_SENDING_CF:
- if (isotp->tx.idx >= isotp->tx.snip->size) {
- /* Finished */
+ case ISOTP_SENDING_SF:
isotp->tx.state = ISOTP_IDLE;
_isotp_dispatch_tx(isotp, 0);
break;
- }
- if (isotp->txfc.bs && (isotp->tx.bs >= isotp->txfc.bs)) {
- /* wait for FC */
+ case ISOTP_SENDING_FF:
isotp->tx.state = ISOTP_WAIT_FC;
xtimer_set(&isotp->tx_timer, CAN_ISOTP_TIMEOUT_N_Bs);
break;
- }
- isotp->tx.state = ISOTP_SENDING_NEXT_CF;
- xtimer_set(&isotp->tx_timer, isotp->tx_gap);
- break;
+ case ISOTP_SENDING_CF:
+ if (isotp->tx.idx >= isotp->tx.snip->size) {
+ /* Finished */
+ isotp->tx.state = ISOTP_IDLE;
+ _isotp_dispatch_tx(isotp, 0);
+ break;
+ }
+
+ if (isotp->txfc.bs && (isotp->tx.bs >= isotp->txfc.bs)) {
+ /* wait for FC */
+ isotp->tx.state = ISOTP_WAIT_FC;
+ xtimer_set(&isotp->tx_timer, CAN_ISOTP_TIMEOUT_N_Bs);
+ break;
+ }
+
+ isotp->tx.state = ISOTP_SENDING_NEXT_CF;
+ xtimer_set(&isotp->tx_timer, isotp->tx_gap);
+ break;
}
}
static void _isotp_rx_timeout_task(struct isotp *isotp)
{
switch (isotp->rx.state) {
- case ISOTP_SENDING_FC:
- DEBUG("_isotp_rx_timeout_task: FC tx conf timeout\n");
- raw_can_abort(isotp->entry.ifnum, isotp->rx.tx_handle);
+ case ISOTP_SENDING_FC:
+ DEBUG("_isotp_rx_timeout_task: FC tx conf timeout\n");
+ raw_can_abort(isotp->entry.ifnum, isotp->rx.tx_handle);
/* Fall through */
- case ISOTP_WAIT_CF:
- DEBUG("_isotp_rx_timeout_task: free rx buf\n");
- gnrc_pktbuf_release(isotp->rx.snip);
- isotp->rx.snip = NULL;
- isotp->rx.state = ISOTP_IDLE;
- /* TODO dispatch rx error ? */
- break;
+ case ISOTP_WAIT_CF:
+ DEBUG("_isotp_rx_timeout_task: free rx buf\n");
+ gnrc_pktbuf_release(isotp->rx.snip);
+ isotp->rx.snip = NULL;
+ isotp->rx.state = ISOTP_IDLE;
+ /* TODO dispatch rx error ? */
+ break;
}
}
@@ -628,10 +628,10 @@ static void _isotp_rx_tx_conf(struct isotp *isotp)
DEBUG("_isotp_rx_tx_conf: state=%d\n", isotp->rx.state);
switch (isotp->rx.state) {
- case ISOTP_SENDING_FC:
- isotp->rx.state = ISOTP_WAIT_CF;
- xtimer_set(&isotp->rx_timer, CAN_ISOTP_TIMEOUT_N_Cr);
- break;
+ case ISOTP_SENDING_FC:
+ isotp->rx.state = ISOTP_WAIT_CF;
+ xtimer_set(&isotp->rx_timer, CAN_ISOTP_TIMEOUT_N_Cr);
+ break;
}
}
@@ -687,49 +687,49 @@ static void *_isotp_thread(void *args)
while (1) {
msg_receive(&msg);
switch (msg.type) {
- case CAN_MSG_SEND_FRAME:
- _isotp_send_sf_ff(msg.content.ptr);
- break;
- case CAN_MSG_RX_INDICATION:
- rx_frame = msg.content.ptr;
- if (!rx_frame) {
- DEBUG("_isotp_thread: CAN_MSG_RX_INDICATION with NULL ptr\n");
+ case CAN_MSG_SEND_FRAME:
+ _isotp_send_sf_ff(msg.content.ptr);
break;
- }
- DEBUG("_isotp_thread: CAN_MSG_RX_INDICATION, frame=%p, data=%p\n",
- (void *)rx_frame->data.iov_base, rx_frame->arg);
- _isotp_rcv((struct isotp *)rx_frame->arg, rx_frame->data.iov_base);
- raw_can_free_frame(rx_frame);
- break;
- case CAN_MSG_TX_CONFIRMATION:
- DEBUG("_isotp_thread: CAN_MSG_TX_CONFIRMATION, handle=%d\n", (int)msg.content.value);
- mutex_lock(&lock);
- LL_FOREACH(isotp_list, isotp) {
- if (isotp->tx.tx_handle == (int)msg.content.value) {
- mutex_unlock(&lock);
- _isotp_tx_tx_conf(isotp);
+ case CAN_MSG_RX_INDICATION:
+ rx_frame = msg.content.ptr;
+ if (!rx_frame) {
+ DEBUG("_isotp_thread: CAN_MSG_RX_INDICATION with NULL ptr\n");
break;
}
- else if (isotp->rx.tx_handle == (int)msg.content.value) {
+ DEBUG("_isotp_thread: CAN_MSG_RX_INDICATION, frame=%p, data=%p\n",
+ (void *)rx_frame->data.iov_base, rx_frame->arg);
+ _isotp_rcv((struct isotp *)rx_frame->arg, rx_frame->data.iov_base);
+ raw_can_free_frame(rx_frame);
+ break;
+ case CAN_MSG_TX_CONFIRMATION:
+ DEBUG("_isotp_thread: CAN_MSG_TX_CONFIRMATION, handle=%d\n", (int)msg.content.value);
+ mutex_lock(&lock);
+ LL_FOREACH(isotp_list, isotp) {
+ if (isotp->tx.tx_handle == (int)msg.content.value) {
+ mutex_unlock(&lock);
+ _isotp_tx_tx_conf(isotp);
+ break;
+ }
+ else if (isotp->rx.tx_handle == (int)msg.content.value) {
+ mutex_unlock(&lock);
+ _isotp_rx_tx_conf(isotp);
+ break;
+ }
+ }
+ if (isotp == NULL) {
mutex_unlock(&lock);
- _isotp_rx_tx_conf(isotp);
- break;
}
- }
- if (isotp == NULL) {
- mutex_unlock(&lock);
- }
- break;
- case CAN_MSG_ISOTP_RX_TIMEOUT:
- isotp = msg.content.ptr;
- DEBUG("_isotp_thread: RX TIMEOUT arg=%p\n", (void *)isotp);
- _isotp_rx_timeout_task(isotp);
- break;
- case CAN_MSG_ISOTP_TX_TIMEOUT:
- isotp = msg.content.ptr;
- DEBUG("_isotp_thread: TX_TIMEOUT arg=%p\n", (void *)isotp);
- _isotp_tx_timeout_task(isotp);
- break;
+ break;
+ case CAN_MSG_ISOTP_RX_TIMEOUT:
+ isotp = msg.content.ptr;
+ DEBUG("_isotp_thread: RX TIMEOUT arg=%p\n", (void *)isotp);
+ _isotp_rx_timeout_task(isotp);
+ break;
+ case CAN_MSG_ISOTP_TX_TIMEOUT:
+ isotp = msg.content.ptr;
+ DEBUG("_isotp_thread: TX_TIMEOUT arg=%p\n", (void *)isotp);
+ _isotp_tx_timeout_task(isotp);
+ break;
}
}
@@ -744,7 +744,7 @@ kernel_pid_t isotp_init(char *stack, int stacksize, char priority, const char *n
/* create new can device thread */
res = thread_create(stack, stacksize, priority, THREAD_CREATE_STACKTEST,
- _isotp_thread, NULL, name);
+ _isotp_thread, NULL, name);
if (res <= 0) {
return -EINVAL;
}
diff --git a/sys/can/router.c b/sys/can/router.c
index 9b0103ca7..f24ad2d71 100644
--- a/sys/can/router.c
+++ b/sys/can/router.c
@@ -115,7 +115,7 @@ static void _free_filter_el(filter_el_t *el)
}
/* Insert to the list in a sorted way
- * Lower CAN IDs are inserted first */
+* Lower CAN IDs are inserted first */
static void _insert_to_list(can_reg_entry_t **list, filter_el_t *el)
{
can_reg_entry_t *next_entry = *list;
@@ -151,9 +151,9 @@ static void _insert_to_list(can_reg_entry_t **list, filter_el_t *el)
}
#ifdef MODULE_CAN_MBOX
-#define ENTRY_MATCHES(e1, e2) (((e1)->type == (e2)->type) && \
- (((e1)->type == CAN_TYPE_DEFAULT && (e1)->target.pid == (e2)->target.pid) ||\
- ((e1)->type == CAN_TYPE_MBOX && (e1)->target.mbox == (e2)->target.mbox)))
+#define ENTRY_MATCHES(e1, e2) (((e1)->type == (e2)->type) && \
+ (((e1)->type == CAN_TYPE_DEFAULT && (e1)->target.pid == (e2)->target.pid) || \
+ ((e1)->type == CAN_TYPE_MBOX && (e1)->target.mbox == (e2)->target.mbox)))
#else
#define ENTRY_MATCHES(e1, e2) ((e1)->target.pid == (e2)->target.pid)
#endif
@@ -166,7 +166,7 @@ static filter_el_t *_find_filter_el(can_reg_entry_t *list, can_reg_entry_t *entr
}
do {
if ((el->can_id == can_id) && (el->mask == mask) && (el->data == data) &&
- ENTRY_MATCHES(&el->entry, entry)) {
+ ENTRY_MATCHES(&el->entry, entry)) {
DEBUG("_find_filter_el: found el=%p, can_id=%" PRIx32 ", mask=%" PRIx32 ", data=%p\n",
(void *)el, el->can_id, el->mask, el->data);
return el;
@@ -226,12 +226,12 @@ int can_router_register(can_reg_entry_t *entry, canid_t can_id, canid_t mask, vo
#ifdef MODULE_CAN_MBOX
filter->entry.type = entry->type;
switch (entry->type) {
- case CAN_TYPE_DEFAULT:
- filter->entry.target.pid = entry->target.pid;
- break;
- case CAN_TYPE_MBOX:
- filter->entry.target.mbox = entry->target.mbox;
- break;
+ case CAN_TYPE_DEFAULT:
+ filter->entry.target.pid = entry->target.pid;
+ break;
+ case CAN_TYPE_MBOX:
+ filter->entry.target.mbox = entry->target.mbox;
+ break;
}
#else
@@ -283,13 +283,13 @@ static int _send_msg(msg_t *msg, can_reg_entry_t *entry)
{
#ifdef MODULE_CAN_MBOX
switch (entry->type) {
- case CAN_TYPE_DEFAULT:
- return msg_try_send(msg, entry->target.pid);
- case CAN_TYPE_MBOX:
- DEBUG("_send_msg: sending msg=%p to mbox=%p\n", (void *)msg, (void *)entry->target.mbox);
- return mbox_try_put(entry->target.mbox, msg);
- default:
- return -ENOTSUP;
+ case CAN_TYPE_DEFAULT:
+ return msg_try_send(msg, entry->target.pid);
+ case CAN_TYPE_MBOX:
+ DEBUG("_send_msg: sending msg=%p to mbox=%p\n", (void *)msg, (void *)entry->target.mbox);
+ return mbox_try_put(entry->target.mbox, msg);
+ default:
+ return -ENOTSUP;
}
#else
return msg_try_send(msg, entry->target.pid);
diff --git a/sys/cbor/cbor.c b/sys/cbor/cbor.c
index b081368bf..f33906dd4 100644
--- a/sys/cbor/cbor.c
+++ b/sys/cbor/cbor.c
@@ -74,12 +74,12 @@
#define CBOR_ADDITIONAL_INFO(stream, offset) (stream->data[offset] & CBOR_INFO_MASK)
/* Ensure that @p stream is big enough to fit @p bytes bytes, otherwise return 0 */
-#define CBOR_ENSURE_SIZE(stream, bytes) do { \
- if (stream->pos + bytes >= stream->size) { return 0; } \
+#define CBOR_ENSURE_SIZE(stream, bytes) do { \
+ if (stream->pos + bytes >= stream->size) { return 0; } \
} while(0)
#define CBOR_ENSURE_SIZE_READ(stream, bytes) do { \
- if (bytes > stream->size) { return 0; } \
+ if (bytes > stream->size) { return 0; } \
} while(0)
/* Extra defines not related to the protocol itself */
@@ -418,7 +418,7 @@ static size_t decode_bytes(const cbor_stream_t *s, size_t offset, char *out, siz
Will not null termiante input, but will tell you the size of what you read.
Great for reading byte strings which could contain nulls inside of unknown size
without forced copies.
-*/
+ */
static size_t decode_bytes_no_copy(const cbor_stream_t *s, size_t offset, unsigned char **out, size_t *length)
{
CBOR_ENSURE_SIZE_READ(s, offset + 1);
@@ -636,7 +636,7 @@ size_t cbor_deserialize_byte_string(const cbor_stream_t *stream, size_t offset,
}
size_t cbor_deserialize_byte_string_no_copy(const cbor_stream_t *stream, size_t offset, unsigned char **val,
- size_t *length)
+ size_t *length)
{
CBOR_ENSURE_SIZE_READ(stream, offset + 1);
@@ -670,7 +670,7 @@ size_t cbor_deserialize_unicode_string(const cbor_stream_t *stream, size_t offse
}
size_t cbor_deserialize_unicode_string_no_copy(const cbor_stream_t *stream, size_t offset, unsigned char **val,
- size_t *length)
+ size_t *length)
{
CBOR_ENSURE_SIZE_READ(stream, offset + 1);
@@ -911,12 +911,12 @@ static size_t cbor_stream_decode_skip(cbor_stream_t *stream, size_t offset)
*/
static size_t cbor_stream_decode_at(cbor_stream_t *stream, size_t offset, int indent)
{
-#define DESERIALIZE_AND_PRINT(type, suffix, format_string) { \
- type val; \
- size_t read_bytes = cbor_deserialize_##suffix(stream, offset, &val); \
- printf("("#type", "format_string")\n", val); \
- return read_bytes; \
- }
+#define DESERIALIZE_AND_PRINT(type, suffix, format_string) { \
+ type val; \
+ size_t read_bytes = cbor_deserialize_ ## suffix(stream, offset, &val); \
+ printf("("#type ", "format_string ")\n", val); \
+ return read_bytes; \
+}
printf("%*s", indent, "");
@@ -950,7 +950,7 @@ static size_t cbor_stream_decode_at(cbor_stream_t *stream, size_t offset, int in
}
else {
offset += read_bytes = decode_int(stream, offset, &array_length);
- printf("(array, length: %"PRIu64")\n", array_length);
+ printf("(array, length: %" PRIu64 ")\n", array_length);
}
size_t i = 0;
@@ -983,7 +983,7 @@ static size_t cbor_stream_decode_at(cbor_stream_t *stream, size_t offset, int in
}
else {
offset += read_bytes = decode_int(stream, offset, &map_length);
- printf("(map, length: %"PRIu64")\n", map_length);
+ printf("(map, length: %" PRIu64 ")\n", map_length);
}
size_t i = 0;
@@ -1010,8 +1010,8 @@ static size_t cbor_stream_decode_at(cbor_stream_t *stream, size_t offset, int in
unsigned char tag = CBOR_ADDITIONAL_INFO(stream, offset);
switch (tag) {
- /* Non-native builds likely don't have support for ctime (hence disable it there)
- * TODO: Better check for availability of ctime functions? */
+ /* Non-native builds likely don't have support for ctime (hence disable it there)
+ * TODO: Better check for availability of ctime functions? */
#ifdef MODULE_CBOR_CTIME
case CBOR_DATETIME_STRING_FOLLOWS: {
char buf[64];
diff --git a/sys/color/color.c b/sys/color/color.c
index 390b793c2..224199e0b 100644
--- a/sys/color/color.c
+++ b/sys/color/color.c
@@ -146,12 +146,12 @@ void color_rgb2hex(const color_rgb_t *rgb, uint32_t *hex)
void color_str2rgb(const char* str, color_rgb_t *rgb)
{
- rgb->r = (((str[0] > '9') ? (str[0] &~ 0x20) - 'A' + 10 : (str[0] - '0')) << 4) | /* R */
- (((str[1] > '9') ? (str[1] &~ 0x20) - 'A' + 10 : (str[1] - '0')) << 0) ; /* R */
- rgb->g = (((str[2] > '9') ? (str[2] &~ 0x20) - 'A' + 10 : (str[2] - '0')) << 4) | /* G */
- (((str[3] > '9') ? (str[3] &~ 0x20) - 'A' + 10 : (str[3] - '0')) << 0) ; /* G */
- rgb->b = (((str[4] > '9') ? (str[4] &~ 0x20) - 'A' + 10 : (str[4] - '0')) << 4) | /* B */
- (((str[5] > '9') ? (str[5] &~ 0x20) - 'A' + 10 : (str[5] - '0')) << 0) ; /* B */
+ rgb->r = (((str[0] > '9') ? (str[0] &~0x20) - 'A' + 10 : (str[0] - '0')) << 4) | /* R */
+ (((str[1] > '9') ? (str[1] &~0x20) - 'A' + 10 : (str[1] - '0')) << 0); /* R */
+ rgb->g = (((str[2] > '9') ? (str[2] &~0x20) - 'A' + 10 : (str[2] - '0')) << 4) | /* G */
+ (((str[3] > '9') ? (str[3] &~0x20) - 'A' + 10 : (str[3] - '0')) << 0); /* G */
+ rgb->b = (((str[4] > '9') ? (str[4] &~0x20) - 'A' + 10 : (str[4] - '0')) << 4) | /* B */
+ (((str[5] > '9') ? (str[5] &~0x20) - 'A' + 10 : (str[5] - '0')) << 0); /* B */
}
void color_rgb2str(const color_rgb_t *rgb, char* str)
@@ -179,8 +179,8 @@ void color_rgb2str(const color_rgb_t *rgb, char* str)
void color_rgb_complementary(const color_rgb_t *rgb, color_rgb_t *comp_rgb)
{
- uint8_t max = 0;
- uint8_t min = 0;
+ uint8_t max = 0;
+ uint8_t min = 0;
uint16_t val = 0;
max = (rgb->r > rgb->g) ? rgb->r : rgb->g;
diff --git a/sys/cpp11-compat/condition_variable.cpp b/sys/cpp11-compat/condition_variable.cpp
index 0a605bb13..a5f2f233f 100644
--- a/sys/cpp11-compat/condition_variable.cpp
+++ b/sys/cpp11-compat/condition_variable.cpp
@@ -34,83 +34,87 @@ using namespace std::chrono;
namespace riot {
-condition_variable::~condition_variable() { m_queue.first = NULL; }
+condition_variable::~condition_variable() {
+ m_queue.first = NULL;
+}
void condition_variable::notify_one() noexcept {
- unsigned old_state = irq_disable();
- priority_queue_node_t* head = priority_queue_remove_head(&m_queue);
- int other_prio = -1;
- if (head != NULL) {
- thread_t* other_thread = (thread_t*)sched_threads[head->data];
- if (other_thread) {
- other_prio = other_thread->priority;
- sched_set_status(other_thread, STATUS_PENDING);
+ unsigned old_state = irq_disable();
+ priority_queue_node_t* head = priority_queue_remove_head(&m_queue);
+ int other_prio = -1;
+ if (head != NULL) {
+ thread_t* other_thread = (thread_t*)sched_threads[head->data];
+ if (other_thread) {
+ other_prio = other_thread->priority;
+ sched_set_status(other_thread, STATUS_PENDING);
+ }
+ head->data = -1u;
+ }
+ irq_restore(old_state);
+ if (other_prio >= 0) {
+ sched_switch(other_prio);
}
- head->data = -1u;
- }
- irq_restore(old_state);
- if (other_prio >= 0) {
- sched_switch(other_prio);
- }
}
void condition_variable::notify_all() noexcept {
- unsigned old_state = irq_disable();
- int other_prio = -1;
- while (true) {
- priority_queue_node_t* head = priority_queue_remove_head(&m_queue);
- if (head == NULL) {
- break;
+ unsigned old_state = irq_disable();
+ int other_prio = -1;
+ while (true) {
+ priority_queue_node_t* head = priority_queue_remove_head(&m_queue);
+ if (head == NULL) {
+ break;
+ }
+ thread_t* other_thread = (thread_t*)sched_threads[head->data];
+ if (other_thread) {
+ auto max_prio
+ = [](int a, int b) {
+ return (a < 0) ? b : ((a < b) ? a : b);
+ };
+ other_prio = max_prio(other_prio, other_thread->priority);
+ sched_set_status(other_thread, STATUS_PENDING);
+ }
+ head->data = -1u;
}
- thread_t* other_thread = (thread_t*)sched_threads[head->data];
- if (other_thread) {
- auto max_prio
- = [](int a, int b) { return (a < 0) ? b : ((a < b) ? a : b); };
- other_prio = max_prio(other_prio, other_thread->priority);
- sched_set_status(other_thread, STATUS_PENDING);
+ irq_restore(old_state);
+ if (other_prio >= 0) {
+ sched_switch(other_prio);
}
- head->data = -1u;
- }
- irq_restore(old_state);
- if (other_prio >= 0) {
- sched_switch(other_prio);
- }
}
void condition_variable::wait(unique_lock<mutex>& lock) noexcept {
- priority_queue_node_t n;
- n.priority = sched_active_thread->priority;
- n.data = sched_active_pid;
- n.next = NULL;
- // the signaling thread may not hold the mutex, the queue is not thread safe
- unsigned old_state = irq_disable();
- priority_queue_add(&m_queue, &n);
- irq_restore(old_state);
- mutex_unlock_and_sleep(lock.mutex()->native_handle());
- if (n.data != -1u) {
- // on signaling n.data is set to -1u
- // if it isn't set, then the wakeup is either spurious or a timer wakeup
- old_state = irq_disable();
- priority_queue_remove(&m_queue, &n);
+ priority_queue_node_t n;
+ n.priority = sched_active_thread->priority;
+ n.data = sched_active_pid;
+ n.next = NULL;
+ // the signaling thread may not hold the mutex, the queue is not thread safe
+ unsigned old_state = irq_disable();
+ priority_queue_add(&m_queue, &n);
irq_restore(old_state);
- }
- mutex_lock(lock.mutex()->native_handle());
+ mutex_unlock_and_sleep(lock.mutex()->native_handle());
+ if (n.data != -1u) {
+ // on signaling n.data is set to -1u
+ // if it isn't set, then the wakeup is either spurious or a timer wakeup
+ old_state = irq_disable();
+ priority_queue_remove(&m_queue, &n);
+ irq_restore(old_state);
+ }
+ mutex_lock(lock.mutex()->native_handle());
}
cv_status condition_variable::wait_until(unique_lock<mutex>& lock,
const time_point& timeout_time) {
- xtimer_t timer;
- // todo: use function to wait for absolute timepoint once available
- timex_t before;
- xtimer_now_timex(&before);
- auto diff = timex_sub(timeout_time.native_handle(), before);
- xtimer_set_wakeup(&timer, timex_uint64(diff), sched_active_pid);
- wait(lock);
- timex_t after;
- xtimer_now_timex(&after);
- xtimer_remove(&timer);
- auto cmp = timex_cmp(after, timeout_time.native_handle());
- return cmp < 1 ? cv_status::no_timeout : cv_status::timeout;
+ xtimer_t timer;
+ // todo: use function to wait for absolute timepoint once available
+ timex_t before;
+ xtimer_now_timex(&before);
+ auto diff = timex_sub(timeout_time.native_handle(), before);
+ xtimer_set_wakeup(&timer, timex_uint64(diff), sched_active_pid);
+ wait(lock);
+ timex_t after;
+ xtimer_now_timex(&after);
+ xtimer_remove(&timer);
+ auto cmp = timex_cmp(after, timeout_time.native_handle());
+ return cmp < 1 ? cv_status::no_timeout : cv_status::timeout;
}
} // namespace riot
diff --git a/sys/cpp11-compat/cppsupport.cpp b/sys/cpp11-compat/cppsupport.cpp
index f37f28468..b7d3a21cd 100644
--- a/sys/cpp11-compat/cppsupport.cpp
+++ b/sys/cpp11-compat/cppsupport.cpp
@@ -56,7 +56,7 @@ extern "C" void __cxa_pure_virtual ()
* @return 0 on success
* @return non-zero on failure.
*/
-extern "C" int __cxa_atexit (void (*) (void *), void *, void *)
+extern "C" int __cxa_atexit (void (*)(void *), void *, void *)
{
/* We just pretend everything is dandy. */
return 0;
diff --git a/sys/cpp11-compat/include/riot/chrono.hpp b/sys/cpp11-compat/include/riot/chrono.hpp
index bc2d902bf..aa0deec5b 100644
--- a/sys/cpp11-compat/include/riot/chrono.hpp
+++ b/sys/cpp11-compat/include/riot/chrono.hpp
@@ -42,61 +42,69 @@ constexpr uint32_t microsecs_in_sec = 1000000;
* available on RIOT.
*/
class time_point {
- using native_handle_type = timex_t;
-
- public:
- /**
- * @brief Creates a time point with seconds and microseconds set to 0.
- */
- inline time_point() : m_handle{0, 0} {}
- /**
- * @brief Create time point from timex_t struct.
- */
- explicit inline time_point(timex_t&& tp) : m_handle(tp) {}
- /**
- * @brief Use default copy constructor.
- */
- constexpr time_point(const time_point& tp) = default;
- /**
- * @brief Use default move constructor.
- */
- constexpr time_point(time_point&& tp) = default;
-
- /**
- * @brief Gives access to the native handle that stores the time information.
- */
- inline native_handle_type native_handle() const { return m_handle; }
-
- /**
- * @brief Add a standard chrono::duration to this time point.
- */
- template <class Rep, class Period>
- inline time_point& operator+=(const std::chrono::duration<Rep, Period>& d) {
+using native_handle_type = timex_t;
+
+public:
+/**
+ * @brief Creates a time point with seconds and microseconds set to 0.
+ */
+inline time_point() : m_handle{0, 0} {
+}
+/**
+ * @brief Create time point from timex_t struct.
+ */
+explicit inline time_point(timex_t&& tp) : m_handle(tp) {
+}
+/**
+ * @brief Use default copy constructor.
+ */
+constexpr time_point(const time_point& tp) = default;
+/**
+ * @brief Use default move constructor.
+ */
+constexpr time_point(time_point&& tp) = default;
+
+/**
+ * @brief Gives access to the native handle that stores the time information.
+ */
+inline native_handle_type native_handle() const {
+ return m_handle;
+}
+
+/**
+ * @brief Add a standard chrono::duration to this time point.
+ */
+template <class Rep, class Period>
+inline time_point& operator+=(const std::chrono::duration<Rep, Period>& d) {
auto s = std::chrono::duration_cast<std::chrono::seconds>(d);
auto m = (std::chrono::duration_cast<std::chrono::microseconds>(d) - s);
m_handle.seconds += s.count();
m_handle.microseconds += m.count();
adjust_overhead();
return *this;
- }
+}
- /**
- * @brief Returns seconds member as uint32_t.
- */
- inline uint32_t seconds() const { return m_handle.seconds; }
+/**
+ * @brief Returns seconds member as uint32_t.
+ */
+inline uint32_t seconds() const {
+ return m_handle.seconds;
+}
- /**
- * @brief Returns microseconds member as uint32_t.
- */
- inline uint32_t microseconds() const { return m_handle.microseconds; }
+/**
+ * @brief Returns microseconds member as uint32_t.
+ */
+inline uint32_t microseconds() const {
+ return m_handle.microseconds;
+}
- private:
- timex_t m_handle;
- void inline adjust_overhead() {
+private:
+timex_t m_handle;
+void inline adjust_overhead() {
auto secs = m_handle.microseconds / microsecs_in_sec;
m_handle.seconds += secs;
m_handle.microseconds -= (secs * microsecs_in_sec);
- }
+}
};
/**
@@ -105,39 +113,39 @@ class time_point {
* @return time_point containing the current time.
*/
inline time_point now() {
- timex_t tp;
- xtimer_now_timex(&tp);
- return time_point(std::move(tp));
+ timex_t tp;
+ xtimer_now_timex(&tp);
+ return time_point(std::move(tp));
}
/**
* @brief Compares two timepoints.
*/
inline bool operator<(const time_point& lhs, const time_point& rhs) {
- return lhs.seconds() < rhs.seconds()
- || (lhs.seconds() == rhs.seconds() && lhs.microseconds()
- < rhs.microseconds());
+ return lhs.seconds() < rhs.seconds()
+ || (lhs.seconds() == rhs.seconds() && lhs.microseconds()
+ < rhs.microseconds());
}
/**
* @brief Compares two timepoints.
*/
inline bool operator>(const time_point& lhs, const time_point& rhs) {
- return rhs < lhs;
+ return rhs < lhs;
}
/**
* @brief Compares two timepoints.
*/
inline bool operator<=(const time_point& lhs, const time_point& rhs) {
- return !(rhs < lhs);
+ return !(rhs < lhs);
}
/**
* @brief Compare two timepoints.
*/
inline bool operator>=(const time_point& lhs, const time_point& rhs) {
- return !(lhs < rhs);
+ return !(lhs < rhs);
}
} // namespace riot
diff --git a/sys/cpp11-compat/include/riot/condition_variable.hpp b/sys/cpp11-compat/include/riot/condition_variable.hpp
index 4b6b7ede6..2cd23d20c 100644
--- a/sys/cpp11-compat/include/riot/condition_variable.hpp
+++ b/sys/cpp11-compat/include/riot/condition_variable.hpp
@@ -37,8 +37,8 @@ namespace riot {
* @brief Status for timeout-based calls of the condition variable.
*/
enum class cv_status {
- no_timeout,
- timeout
+ no_timeout,
+ timeout
};
/**
@@ -51,140 +51,144 @@ enum class cv_status {
*/
class condition_variable {
public:
- /**
- * @brief The native handle type used by the condition variable.
- */
- using native_handle_type = priority_queue_t*;
- inline condition_variable() { m_queue.first = NULL; }
- ~condition_variable();
-
- /**
- * @brief Notify one thread waiting on this condition.
- */
- void notify_one() noexcept;
- /**
- * @brief Notify all threads waiting on this condition variable.
- */
- void notify_all() noexcept;
-
- /**
- * @brief Block until woken up through the condition variable.
- * @param lock A lock that is locked by the current thread.
- */
- void wait(unique_lock<mutex>& lock) noexcept;
- /**
- * @brief Block until woken up through the condition variable and a predicate
- * is fulfilled.
- * @param lock A lock that is locked by the current thread.
- * @param pred A predicate that returns a bool to signify if the thread
- * should continue to wait when woken up through the cv.
- */
- template <class Predicate>
- void wait(unique_lock<mutex>& lock, Predicate pred);
- /**
- * @brief Block until woken up through the condition variable or a specified
- * point in time is reached. The lock is reacquired either way.
- * @param lock A lock that is locked by the current thread.
- * @param timeout_time Point in time when the thread is woken up
- * independently of the condition variable.
- * @return A status to signify if woken up due to a timeout or the cv.
- */
- cv_status wait_until(unique_lock<mutex>& lock,
- const time_point& timeout_time);
- /**
- * @brief Block until woken up through the condition variable and a predicate
- * is fulfilled or a specified point in time is reached. The lock is
- * reacquired either way.
- * @param lock A lock that is locked by the current thread.
- * @param timeout_time Point in time when the thread is woken up
- * independently of the condition variable.
- * @param pred A predicate that returns a bool to signify if the
- * thread should continue to wait when woken up through
- * the cv.
- * @return Result of the pred when the function returns.
- */
- template <class Predicate>
- bool wait_until(unique_lock<mutex>& lock, const time_point& timeout_time,
- Predicate pred);
-
- /**
- * @brief Blocks until woken up through the condition variable or when the
- * thread has been blocked for a certain time.
- * @param lock A lock that is locked by the current thread.
- * @param rel_time The maximum time spent blocking.
- * @return A status to signify if woken up due to a timeout or the cv.
- */
- template <class Rep, class Period>
- cv_status wait_for(unique_lock<mutex>& lock,
- const std::chrono::duration<Rep, Period>& rel_time);
- /**
- * @brief Blocks until woken up through the condition variable and a predicate
- * is fulfilled or when the thread has been blocked for a certain time.
- * @param lock A lock that is locked by the current thread.
- * @param rel_time The maximum time spent blocking.
- * @param pred A predicate that returns a bool to signify if the thread
- * should continue to wait when woken up through the cv.
- * @return Result of the pred when the function returns.
- */
- template <class Rep, class Period, class Predicate>
- bool wait_for(unique_lock<mutex>& lock,
- const std::chrono::duration<Rep, Period>& rel_time,
+/**
+ * @brief The native handle type used by the condition variable.
+ */
+using native_handle_type = priority_queue_t*;
+inline condition_variable() {
+ m_queue.first = NULL;
+}
+~condition_variable();
+
+/**
+ * @brief Notify one thread waiting on this condition.
+ */
+void notify_one() noexcept;
+/**
+ * @brief Notify all threads waiting on this condition variable.
+ */
+void notify_all() noexcept;
+
+/**
+ * @brief Block until woken up through the condition variable.
+ * @param lock A lock that is locked by the current thread.
+ */
+void wait(unique_lock<mutex>& lock) noexcept;
+/**
+ * @brief Block until woken up through the condition variable and a predicate
+ * is fulfilled.
+ * @param lock A lock that is locked by the current thread.
+ * @param pred A predicate that returns a bool to signify if the thread
+ * should continue to wait when woken up through the cv.
+ */
+template <class Predicate>
+void wait(unique_lock<mutex>& lock, Predicate pred);
+/**
+ * @brief Block until woken up through the condition variable or a specified
+ * point in time is reached. The lock is reacquired either way.
+ * @param lock A lock that is locked by the current thread.
+ * @param timeout_time Point in time when the thread is woken up
+ * independently of the condition variable.
+ * @return A status to signify if woken up due to a timeout or the cv.
+ */
+cv_status wait_until(unique_lock<mutex>& lock,
+ const time_point& timeout_time);
+/**
+ * @brief Block until woken up through the condition variable and a predicate
+ * is fulfilled or a specified point in time is reached. The lock is
+ * reacquired either way.
+ * @param lock A lock that is locked by the current thread.
+ * @param timeout_time Point in time when the thread is woken up
+ * independently of the condition variable.
+ * @param pred A predicate that returns a bool to signify if the
+ * thread should continue to wait when woken up through
+ * the cv.
+ * @return Result of the pred when the function returns.
+ */
+template <class Predicate>
+bool wait_until(unique_lock<mutex>& lock, const time_point& timeout_time,
Predicate pred);
- /**
- * @brief Returns the native handle of the condition variable.
- */
- inline native_handle_type native_handle() { return &m_queue; }
+/**
+ * @brief Blocks until woken up through the condition variable or when the
+ * thread has been blocked for a certain time.
+ * @param lock A lock that is locked by the current thread.
+ * @param rel_time The maximum time spent blocking.
+ * @return A status to signify if woken up due to a timeout or the cv.
+ */
+template <class Rep, class Period>
+cv_status wait_for(unique_lock<mutex>& lock,
+ const std::chrono::duration<Rep, Period>& rel_time);
+/**
+ * @brief Blocks until woken up through the condition variable and a predicate
+ * is fulfilled or when the thread has been blocked for a certain time.
+ * @param lock A lock that is locked by the current thread.
+ * @param rel_time The maximum time spent blocking.
+ * @param pred A predicate that returns a bool to signify if the thread
+ * should continue to wait when woken up through the cv.
+ * @return Result of the pred when the function returns.
+ */
+template <class Rep, class Period, class Predicate>
+bool wait_for(unique_lock<mutex>& lock,
+ const std::chrono::duration<Rep, Period>& rel_time,
+ Predicate pred);
+
+/**
+ * @brief Returns the native handle of the condition variable.
+ */
+inline native_handle_type native_handle() {
+ return &m_queue;
+}
private:
- condition_variable(const condition_variable&);
- condition_variable& operator=(const condition_variable&);
+condition_variable(const condition_variable&);
+condition_variable& operator=(const condition_variable&);
- priority_queue_t m_queue;
+priority_queue_t m_queue;
};
template <class Predicate>
void condition_variable::wait(unique_lock<mutex>& lock, Predicate pred) {
- while (!pred()) {
- wait(lock);
- }
+ while (!pred()) {
+ wait(lock);
+ }
}
template <class Predicate>
bool condition_variable::wait_until(unique_lock<mutex>& lock,
const time_point& timeout_time,
Predicate pred) {
- while (!pred()) {
- if (wait_until(lock, timeout_time) == cv_status::timeout) {
- return pred();
+ while (!pred()) {
+ if (wait_until(lock, timeout_time) == cv_status::timeout) {
+ return pred();
+ }
}
- }
- return true;
+ return true;
}
template <class Rep, class Period>
cv_status condition_variable::wait_for(unique_lock<mutex>& lock,
const std::chrono::duration
<Rep, Period>& timeout_duration) {
- using namespace std::chrono;
- using std::chrono::duration;
- if (timeout_duration <= timeout_duration.zero()) {
- return cv_status::timeout;
- }
- timex_t timeout, before, after;
- auto s = duration_cast<seconds>(timeout_duration);
- timeout.seconds = s.count();
- timeout.microseconds
- = (duration_cast<microseconds>(timeout_duration - s)).count();
- xtimer_now_timex(&before);
- xtimer_t timer;
- xtimer_set_wakeup(&timer, timex_uint64(timeout), sched_active_pid);
- wait(lock);
- xtimer_now_timex(&after);
- xtimer_remove(&timer);
- auto passed = timex_sub(after, before);
- auto cmp = timex_cmp(passed, timeout);
- return cmp < 1 ? cv_status::no_timeout : cv_status::timeout;
+ using namespace std::chrono;
+ using std::chrono::duration;
+ if (timeout_duration <= timeout_duration.zero()) {
+ return cv_status::timeout;
+ }
+ timex_t timeout, before, after;
+ auto s = duration_cast<seconds>(timeout_duration);
+ timeout.seconds = s.count();
+ timeout.microseconds
+ = (duration_cast<microseconds>(timeout_duration - s)).count();
+ xtimer_now_timex(&before);
+ xtimer_t timer;
+ xtimer_set_wakeup(&timer, timex_uint64(timeout), sched_active_pid);
+ wait(lock);
+ xtimer_now_timex(&after);
+ xtimer_remove(&timer);
+ auto passed = timex_sub(after, before);
+ auto cmp = timex_cmp(passed, timeout);
+ return cmp < 1 ? cv_status::no_timeout : cv_status::timeout;
}
template <class Rep, class Period, class Predicate>
@@ -192,8 +196,8 @@ inline bool condition_variable::wait_for(unique_lock<mutex>& lock,
const std::chrono::duration
<Rep, Period>& timeout_duration,
Predicate pred) {
- return wait_until(lock, std::chrono::steady_clock::now() + timeout_duration,
- std::move(pred));
+ return wait_until(lock, std::chrono::steady_clock::now() + timeout_duration,
+ std::move(pred));
}
} // namespace riot
diff --git a/sys/cpp11-compat/include/riot/detail/thread_util.hpp b/sys/cpp11-compat/include/riot/detail/thread_util.hpp
index 1952df4be..8985d14ae 100644
--- a/sys/cpp11-compat/include/riot/detail/thread_util.hpp
+++ b/sys/cpp11-compat/include/riot/detail/thread_util.hpp
@@ -31,35 +31,35 @@ namespace detail {
/**
* @brief A list of integers (wraps a long... template parameter pack).
*/
-template <long... Is>
+template <long ... Is>
struct int_list {};
/**
* @brief Creates indices from `Pos` to `Max`.
*/
-template <long Max, long Pos = 0, typename Indices = int_list<>>
+template <long Max, long Pos = 0, typename Indices = int_list<> >
struct il_indices;
/**
* @brief End of recursion, `Pos` reached `Max`.
*/
-template <long Pos, long... Is>
-struct il_indices<Pos, Pos, int_list<Is...>> {
- /**
- * @brief Result is the list containing `Is...`.
- */
- using type = int_list<Is...>;
+template <long Pos, long ... Is>
+struct il_indices<Pos, Pos, int_list<Is ...> > {
+ /**
+ * @brief Result is the list containing `Is...`.
+ */
+ using type = int_list<Is ...>;
};
/**
* @brief Recursion step.
*/
-template <long Max, long Pos, long... Is>
-struct il_indices<Max, Pos, int_list<Is...>> {
- /**
- * @brief Append `Pos` to list and increment for the next step.
- */
- using type = typename il_indices<Max, Pos + 1, int_list<Is..., Pos>>::type;
+template <long Max, long Pos, long ... Is>
+struct il_indices<Max, Pos, int_list<Is ...> > {
+ /**
+ * @brief Append `Pos` to list and increment for the next step.
+ */
+ using type = typename il_indices<Max, Pos + 1, int_list<Is ..., Pos> >::type;
};
/**
@@ -67,47 +67,47 @@ struct il_indices<Max, Pos, int_list<Is...>> {
*/
template <long To, long From = 0>
typename il_indices<To, From>::type get_indices() {
- return {};
+ return {};
}
/**
* @brief Apply arguments in a tuple to function.
*/
-template <class F, long... Is, class Tuple>
-inline auto apply_args(F& f, detail::int_list<Is...>, Tuple&& tup)
- -> decltype(f(std::get<Is>(tup)...)) {
- return f(std::get<Is>(tup)...);
+template <class F, long ... Is, class Tuple>
+inline auto apply_args(F& f, detail::int_list<Is ...>, Tuple&& tup)
+->decltype(f(std::get<Is>(tup) ...)) {
+ return f(std::get<Is>(tup) ...);
}
/**
* @brief Prefix the argument tuple with additonal arguments.
* In this case the tuple is empty.
*/
-template <class F, class Tuple, class... Ts>
-inline auto apply_args_prefixed(F& f, detail::int_list<>, Tuple&, Ts&&... args)
- -> decltype(f(std::forward<Ts>(args)...)) {
- return f(std::forward<Ts>(args)...);
+template <class F, class Tuple, class ... Ts>
+inline auto apply_args_prefixed(F& f, detail::int_list<>, Tuple&, Ts&& ... args)
+->decltype(f(std::forward<Ts>(args) ...)) {
+ return f(std::forward<Ts>(args) ...);
}
/**
* @brief Prefix the argument tuple with additonal arguments.
* In this case the tuple is contains arguments.
*/
-template <class F, long... Is, class Tuple, class... Ts>
-inline auto apply_args_prefixed(F& f, detail::int_list<Is...>, Tuple& tup,
- Ts&&... args)
- -> decltype(f(std::forward<Ts>(args)..., std::get<Is>(tup)...)) {
- return f(std::forward<Ts>(args)..., std::get<Is>(tup)...);
+template <class F, long ... Is, class Tuple, class ... Ts>
+inline auto apply_args_prefixed(F& f, detail::int_list<Is ...>, Tuple& tup,
+ Ts&& ... args)
+->decltype(f(std::forward<Ts>(args) ..., std::get<Is>(tup) ...)) {
+ return f(std::forward<Ts>(args) ..., std::get<Is>(tup) ...);
}
/**
* @brief Suffix the tuple with additonal arguments.
*/
-template <class F, long... Is, class Tuple, class... Ts>
-inline auto apply_args_suffxied(F& f, detail::int_list<Is...>, Tuple& tup,
- Ts&&... args)
- -> decltype(f(std::get<Is>(tup)..., std::forward<Ts>(args)...)) {
- return f(std::get<Is>(tup)..., std::forward<Ts>(args)...);
+template <class F, long ... Is, class Tuple, class ... Ts>
+inline auto apply_args_suffxied(F& f, detail::int_list<Is ...>, Tuple& tup,
+ Ts&& ... args)
+->decltype(f(std::get<Is>(tup) ..., std::forward<Ts>(args) ...)) {
+ return f(std::get<Is>(tup) ..., std::forward<Ts>(args) ...);
}
} // namespace detail
diff --git a/sys/cpp11-compat/include/riot/mutex.hpp b/sys/cpp11-compat/include/riot/mutex.hpp
index 39cecad8e..f6ec73817 100644
--- a/sys/cpp11-compat/include/riot/mutex.hpp
+++ b/sys/cpp11-compat/include/riot/mutex.hpp
@@ -42,39 +42,43 @@ namespace riot {
*/
class mutex {
public:
- /**
- * The native handle type used by the mutex.
- */
- using native_handle_type = mutex_t*;
+/**
+ * The native handle type used by the mutex.
+ */
+using native_handle_type = mutex_t*;
- inline constexpr mutex() noexcept : m_mtx{{0}} {}
- ~mutex();
+inline constexpr mutex() noexcept : m_mtx{{
+ 0
+ }} {}
+~mutex();
- /**
- * @brief Lock the mutex.
- */
- void lock();
- /**
- * @brief Try to lock the mutex.
- * @return `true` if the mutex was locked, `false` otherwise.
- */
- bool try_lock() noexcept;
- /**
- * @brief Unlock the mutex.
- */
- void unlock() noexcept;
+/**
+ * @brief Lock the mutex.
+ */
+void lock();
+/**
+ * @brief Try to lock the mutex.
+ * @return `true` if the mutex was locked, `false` otherwise.
+ */
+bool try_lock() noexcept;
+/**
+ * @brief Unlock the mutex.
+ */
+void unlock() noexcept;
- /**
- * @brief Provides access to the native handle.
- * @return The native handle of the mutex.
- */
- inline native_handle_type native_handle() { return &m_mtx; }
+/**
+ * @brief Provides access to the native handle.
+ * @return The native handle of the mutex.
+ */
+inline native_handle_type native_handle() {
+ return &m_mtx;
+}
private:
- mutex(const mutex&);
- mutex& operator=(const mutex&);
+mutex(const mutex&);
+mutex& operator=(const mutex&);
- mutex_t m_mtx;
+mutex_t m_mtx;
};
/**
@@ -112,24 +116,29 @@ constexpr adopt_lock_t adopt_lock = adopt_lock_t();
template <class Mutex>
class lock_guard {
public:
- /**
- * The type of Mutex used by the lock_guard.
- */
- using mutex_type = Mutex;
+/**
+ * The type of Mutex used by the lock_guard.
+ */
+using mutex_type = Mutex;
- /**
- * @brief Constructs a lock_gurad from a Mutex and locks it.
- */
- inline explicit lock_guard(mutex_type& mtx) : m_mtx(mtx) { m_mtx.lock(); }
- /**
- * @brief Constructs a lock_guard from a Mutex, acquireing ownership without
- * locking it.
- */
- inline lock_guard(mutex_type& mtx, adopt_lock_t) : m_mtx{mtx} {}
- inline ~lock_guard() { m_mtx.unlock(); }
+/**
+ * @brief Constructs a lock_gurad from a Mutex and locks it.
+ */
+inline explicit lock_guard(mutex_type& mtx) : m_mtx(mtx) {
+ m_mtx.lock();
+}
+/**
+ * @brief Constructs a lock_guard from a Mutex, acquireing ownership without
+ * locking it.
+ */
+inline lock_guard(mutex_type& mtx, adopt_lock_t) : m_mtx{mtx} {
+}
+inline ~lock_guard() {
+ m_mtx.unlock();
+}
private:
- mutex_type& m_mtx;
+mutex_type& m_mtx;
};
/**
@@ -141,163 +150,173 @@ private:
template <class Mutex>
class unique_lock {
public:
- /**
- * The type of Mutex used by the lock.
- */
- using mutex_type = Mutex;
+/**
+ * The type of Mutex used by the lock.
+ */
+using mutex_type = Mutex;
- inline unique_lock() noexcept : m_mtx{nullptr}, m_owns{false} {}
- /**
- * @brief Constructs a unique_lock from a Mutex and locks it.
- */
- inline explicit unique_lock(mutex_type& mtx) : m_mtx{&mtx}, m_owns{true} {
+inline unique_lock() noexcept : m_mtx{nullptr}, m_owns{false} {
+}
+/**
+ * @brief Constructs a unique_lock from a Mutex and locks it.
+ */
+inline explicit unique_lock(mutex_type& mtx) : m_mtx{&mtx}, m_owns{true} {
m_mtx->lock();
- }
- /**
- * @brief Constructs a unique_lock from a Mutex but does not lock it.
- */
- inline unique_lock(mutex_type& mtx, defer_lock_t) noexcept : m_mtx{&mtx},
- m_owns{false} {}
- /**
- * @brief Constructs a unique_lock from a Mutex and tries to lock it.
- */
- inline unique_lock(mutex_type& mtx, try_to_lock_t)
- : m_mtx{&mtx}, m_owns{mtx.try_lock()} {}
- /**
- * @brief Constructs a unique_lock from a Mutex that is already owned by the
- * thread.
- */
- inline unique_lock(mutex_type& mtx, adopt_lock_t)
- : m_mtx{&mtx}, m_owns{true} {}
- inline ~unique_lock() {
+}
+/**
+ * @brief Constructs a unique_lock from a Mutex but does not lock it.
+ */
+inline unique_lock(mutex_type& mtx, defer_lock_t) noexcept : m_mtx{&mtx},
+ m_owns{false} {
+}
+/**
+ * @brief Constructs a unique_lock from a Mutex and tries to lock it.
+ */
+inline unique_lock(mutex_type& mtx, try_to_lock_t)
+ : m_mtx{&mtx}, m_owns{mtx.try_lock()} {
+}
+/**
+ * @brief Constructs a unique_lock from a Mutex that is already owned by the
+ * thread.
+ */
+inline unique_lock(mutex_type& mtx, adopt_lock_t)
+ : m_mtx{&mtx}, m_owns{true} {
+}
+inline ~unique_lock() {
if (m_owns) {
- m_mtx->unlock();
+ m_mtx->unlock();
}
- }
- /**
- * @brief Move constructor.
- */
- inline unique_lock(unique_lock&& lock) noexcept : m_mtx{lock.m_mtx},
- m_owns{lock.m_owns} {
+}
+/**
+ * @brief Move constructor.
+ */
+inline unique_lock(unique_lock&& lock) noexcept : m_mtx{lock.m_mtx},
+ m_owns{lock.m_owns} {
lock.m_mtx = nullptr;
lock.m_owns = false;
- }
- /**
- * @brief Move assignment operator.
- */
- inline unique_lock& operator=(unique_lock&& lock) noexcept {
+}
+/**
+ * @brief Move assignment operator.
+ */
+inline unique_lock& operator=(unique_lock&& lock) noexcept {
if (m_owns) {
- m_mtx->unlock();
+ m_mtx->unlock();
}
m_mtx = lock.m_mtx;
m_owns = lock.m_owns;
lock.m_mtx = nullptr;
lock.m_owns = false;
return *this;
- }
+}
- /**
- * @brief Locks the associated mutex.
- */
- void lock();
- /**
- * @brief Tries to lock the associated mutex.
- * @return `true` if the mutex has been locked successfully,
- * `false` otherwise.
- */
- bool try_lock();
- /**
- * @brief Unlocks the associated mutex.
- */
- void unlock();
+/**
+ * @brief Locks the associated mutex.
+ */
+void lock();
+/**
+ * @brief Tries to lock the associated mutex.
+ * @return `true` if the mutex has been locked successfully,
+ * `false` otherwise.
+ */
+bool try_lock();
+/**
+ * @brief Unlocks the associated mutex.
+ */
+void unlock();
- /**
- * @brief Swap this unique_lock with another unique_lock.
- */
- inline void swap(unique_lock& lock) noexcept {
+/**
+ * @brief Swap this unique_lock with another unique_lock.
+ */
+inline void swap(unique_lock& lock) noexcept {
std::swap(m_mtx, lock.m_mtx);
std::swap(m_owns, lock.m_owns);
- }
+}
- /**
- * @brief Disassociate this lock from its mutex. The caller is responsible to
- * unlock the mutex if it was locked before.
- * @return A pointer to the associated mutex or `nullptr` if there was none.
- */
- inline mutex_type* release() noexcept {
+/**
+ * @brief Disassociate this lock from its mutex. The caller is responsible to
+ * unlock the mutex if it was locked before.
+ * @return A pointer to the associated mutex or `nullptr` if there was none.
+ */
+inline mutex_type* release() noexcept {
mutex_type* mtx = m_mtx;
m_mtx = nullptr;
m_owns = false;
return mtx;
- }
+}
- /**
- * @brief Query ownership of the associate mutex.
- * @return `true` if an associated mutex exists and the lock owns it,
- * `false` otherwise.
- */
- inline bool owns_lock() const noexcept { return m_owns; }
- /**
- * @brief Operator to query the ownership of the associated mutex.
- * @return `true` if an associated mutex exists and the lock owns it,
- * `false` otherwise.
- */
- inline explicit operator bool() const noexcept { return m_owns; }
- /**
- * @brief Provides access to the associated mutex.
- * @return A pointer to the associated mutex or nullptr it there was none.
- */
- inline mutex_type* mutex() const noexcept { return m_mtx; }
+/**
+ * @brief Query ownership of the associate mutex.
+ * @return `true` if an associated mutex exists and the lock owns it,
+ * `false` otherwise.
+ */
+inline bool owns_lock() const noexcept {
+ return m_owns;
+}
+/**
+ * @brief Operator to query the ownership of the associated mutex.
+ * @return `true` if an associated mutex exists and the lock owns it,
+ * `false` otherwise.
+ */
+inline explicit operator bool() const noexcept {
+ return m_owns;
+}
+/**
+ * @brief Provides access to the associated mutex.
+ * @return A pointer to the associated mutex or nullptr it there was none.
+ */
+inline mutex_type* mutex() const noexcept {
+ return m_mtx;
+}
private:
- unique_lock(unique_lock const&);
- unique_lock& operator=(unique_lock const&);
+unique_lock(unique_lock const&);
+unique_lock& operator=(unique_lock const&);
- mutex_type* m_mtx;
- bool m_owns;
+mutex_type* m_mtx;
+bool m_owns;
};
template <class Mutex>
void unique_lock<Mutex>::lock() {
- if (m_mtx == nullptr) {
- throw std::system_error(
- std::make_error_code(std::errc::operation_not_permitted),
- "References null mutex.");
- }
- if (m_owns) {
- throw std::system_error(
- std::make_error_code(std::errc::resource_deadlock_would_occur),
- "Already locked.");
- }
- m_mtx->lock();
- m_owns = true;
+ if (m_mtx == nullptr) {
+ throw std::system_error(
+ std::make_error_code(std::errc::operation_not_permitted),
+ "References null mutex.");
+ }
+ if (m_owns) {
+ throw std::system_error(
+ std::make_error_code(std::errc::resource_deadlock_would_occur),
+ "Already locked.");
+ }
+ m_mtx->lock();
+ m_owns = true;
}
template <class Mutex>
bool unique_lock<Mutex>::try_lock() {
- if (m_mtx == nullptr) {
- throw std::system_error(
- std::make_error_code(std::errc::operation_not_permitted),
- "References null mutex.");
- }
- if (m_owns) {
- throw std::system_error(
- std::make_error_code(std::errc::resource_deadlock_would_occur),
- "Already locked.");
- }
- m_owns = m_mtx->try_lock();
- return m_owns;
+ if (m_mtx == nullptr) {
+ throw std::system_error(
+ std::make_error_code(std::errc::operation_not_permitted),
+ "References null mutex.");
+ }
+ if (m_owns) {
+ throw std::system_error(
+ std::make_error_code(std::errc::resource_deadlock_would_occur),
+ "Already locked.");
+ }
+ m_owns = m_mtx->try_lock();
+ return m_owns;
}
template <class Mutex>
void unique_lock<Mutex>::unlock() {
- if (!m_owns) {
- throw std::system_error(
- std::make_error_code(std::errc::operation_not_permitted),
- "Mutex not locked.");
- }
- m_mtx->unlock();
- m_owns = false;
+ if (!m_owns) {
+ throw std::system_error(
+ std::make_error_code(std::errc::operation_not_permitted),
+ "Mutex not locked.");
+ }
+ m_mtx->unlock();
+ m_owns = false;
}
/**
@@ -307,7 +326,7 @@ void unique_lock<Mutex>::unlock() {
*/
template <class Mutex>
inline void swap(unique_lock<Mutex>& lhs, unique_lock<Mutex>& rhs) noexcept {
- lhs.swap(rhs);
+ lhs.swap(rhs);
}
} // namespace riot
diff --git a/sys/cpp11-compat/include/riot/thread.hpp b/sys/cpp11-compat/include/riot/thread.hpp
index 219167268..7aa2a948a 100644
--- a/sys/cpp11-compat/include/riot/thread.hpp
+++ b/sys/cpp11-compat/include/riot/thread.hpp
@@ -60,14 +60,14 @@ constexpr size_t stack_size = THREAD_STACKSIZE_MAIN;
* @brief Holds context data for the thread.
*/
struct thread_data {
- thread_data() : ref_count{2}, joining_thread{thread_uninitialized} {
- // nop
- }
- /** @cond INTERNAL */
- std::atomic<unsigned> ref_count;
- kernel_pid_t joining_thread;
- std::array<char, stack_size> stack;
- /** @endcond */
+ thread_data() : ref_count{2}, joining_thread{thread_uninitialized} {
+ // nop
+ }
+ /** @cond INTERNAL */
+ std::atomic<unsigned> ref_count;
+ kernel_pid_t joining_thread;
+ std::array<char, stack_size> stack;
+ /** @endcond */
};
/**
@@ -75,15 +75,15 @@ struct thread_data {
* thread object is destroyed before the thread had a chance to run.
*/
struct thread_data_deleter {
- /**
- * @brief Called by the deleter of a thread object to manage the lifetime of
- * the thread internal management data.
- */
- void operator()(thread_data* ptr) {
- if (--ptr->ref_count == 0) {
- delete ptr;
+ /**
+ * @brief Called by the deleter of a thread object to manage the lifetime of
+ * the thread internal management data.
+ */
+ void operator()(thread_data* ptr) {
+ if (--ptr->ref_count == 0) {
+ delete ptr;
+ }
}
- }
};
/**
@@ -93,61 +93,63 @@ struct thread_data_deleter {
* </a>
*/
class thread_id {
- template <class T, class Traits>
- friend std::basic_ostream<T, Traits>& operator<<(std::basic_ostream
- <T, Traits>& out,
- thread_id id);
- friend class thread;
+template <class T, class Traits>
+friend std ::basic_ostream<T, Traits>& operator<<(std::basic_ostream
+ <T, Traits>& out,
+ thread_id id);
+friend class thread;
public:
- /**
- * @brief Creates a uninitialized thread id.
- */
- inline thread_id() noexcept : m_handle{thread_uninitialized} {}
- /**
- * @brief Create a thread id from a native handle.
- */
- explicit inline thread_id(kernel_pid_t handle) : m_handle{handle} {}
-
- /**
- * @brief Comparison operator for thread ids.
- */
- inline bool operator==(thread_id other) noexcept {
+/**
+ * @brief Creates a uninitialized thread id.
+ */
+inline thread_id() noexcept : m_handle{thread_uninitialized} {
+}
+/**
+ * @brief Create a thread id from a native handle.
+ */
+explicit inline thread_id(kernel_pid_t handle) : m_handle{handle} {
+}
+
+/**
+ * @brief Comparison operator for thread ids.
+ */
+inline bool operator==(thread_id other) noexcept {
return m_handle == other.m_handle;
- }
- /**
- * @brief Comparison operator for thread ids.
- */
- inline bool operator!=(thread_id other) noexcept {
+}
+/**
+ * @brief Comparison operator for thread ids.
+ */
+inline bool operator!=(thread_id other) noexcept {
return !(m_handle == other.m_handle);
- }
- /**
- * @brief Comparison operator for thread ids.
- */
- inline bool operator<(thread_id other) noexcept {
+}
+/**
+ * @brief Comparison operator for thread ids.
+ */
+inline bool operator<(thread_id other) noexcept {
return m_handle < other.m_handle;
- }
- /**
- * @brief Comparison operator for thread ids.
- */
- inline bool operator<=(thread_id other) noexcept {
+}
+/**
+ * @brief Comparison operator for thread ids.
+ */
+inline bool operator<=(thread_id other) noexcept {
return !(m_handle > other.m_handle);
- }
- /**
- * @brief Comparison operator for thread ids.
- */
- inline bool operator>(thread_id other) noexcept {
+}
+/**
+ * @brief Comparison operator for thread ids.
+ */
+inline bool operator>(thread_id other) noexcept {
return m_handle > other.m_handle;
- }
- /**
- * @brief Comparison operator for thread ids.
- */
- inline bool operator>=(thread_id other) noexcept {
+}
+/**
+ * @brief Comparison operator for thread ids.
+ */
+inline bool operator>=(thread_id other) noexcept {
return !(m_handle < other.m_handle);
- }
+}
private:
- kernel_pid_t m_handle;
+kernel_pid_t m_handle;
};
/**
@@ -157,7 +159,7 @@ template <class T, class Traits>
inline std::basic_ostream<T, Traits>& operator<<(std::basic_ostream
<T, Traits>& out,
thread_id id) {
- return out << id.m_handle;
+ return out << id.m_handle;
}
namespace this_thread {
@@ -165,11 +167,15 @@ namespace this_thread {
/**
* @brief Access the id of the currently running thread.
*/
-inline thread_id get_id() noexcept { return thread_id{thread_getpid()}; }
+inline thread_id get_id() noexcept {
+ return thread_id{thread_getpid()};
+}
/**
* @brief Yield the currently running thread.
*/
-inline void yield() noexcept { thread_yield(); }
+inline void yield() noexcept {
+ thread_yield();
+}
/**
* @brief Puts the current thread to sleep.
* @param[in] ns Duration to sleep in nanoseconds.
@@ -181,20 +187,20 @@ void sleep_for(const std::chrono::nanoseconds& ns);
*/
template <class Rep, class Period>
void sleep_for(const std::chrono::duration<Rep, Period>& sleep_duration) {
- using namespace std::chrono;
- if (sleep_duration > std::chrono::duration<Rep, Period>::zero()) {
- constexpr std::chrono::duration<long double> max = nanoseconds::max();
- nanoseconds ns;
- if (sleep_duration < max) {
- ns = duration_cast<nanoseconds>(sleep_duration);
- if (ns < sleep_duration) {
- ++ns;
- }
- } else {
- ns = nanoseconds::max();
+ using namespace std::chrono;
+ if (sleep_duration > std::chrono::duration<Rep, Period>::zero()) {
+ constexpr std::chrono::duration<long double> max = nanoseconds::max();
+ nanoseconds ns;
+ if (sleep_duration < max) {
+ ns = duration_cast<nanoseconds>(sleep_duration);
+ if (ns < sleep_duration) {
+ ++ns;
+ }
+ } else {
+ ns = nanoseconds::max();
+ }
+ sleep_for(ns);
}
- sleep_for(ns);
- }
}
/**
* @brief Puts the current thread to sleep.
@@ -202,12 +208,12 @@ void sleep_for(const std::chrono::duration<Rep, Period>& sleep_duration) {
* should wake up.
*/
inline void sleep_until(const riot::time_point& sleep_time) {
- mutex mtx;
- condition_variable cv;
- unique_lock<mutex> lk(mtx);
- while (riot::now() < sleep_time) {
- cv.wait_until(lk, sleep_time);
- }
+ mutex mtx;
+ condition_variable cv;
+ unique_lock<mutex> lk(mtx);
+ while (riot::now() < sleep_time) {
+ cv.wait_until(lk, sleep_time);
+ }
}
} // namespace this_thread
@@ -220,98 +226,103 @@ inline void sleep_until(const riot::time_point& sleep_time) {
*/
class thread {
public:
- /**
- * @brief The id is of type `thread_id`-
- */
- using id = thread_id;
- /**
- * @brief The native handle type is the `kernel_pid_t` of RIOT.
- */
- using native_handle_type = kernel_pid_t;
-
- /**
- * @brief Per default, an uninitialized thread is created.
- */
- inline thread() noexcept : m_handle{thread_uninitialized} {}
- /**
- * @brief Create a thread from a functor and arguments for it.
- * @param[in] f Functor to run as a thread.
- * @param[in] args Arguments passed to the functor.
- */
- template <class F, class... Args>
- explicit thread(F&& f, Args&&... args);
-
- /**
- * @brief Disallow copy constructor.
- */
- thread(const thread&) = delete;
-
- /**
- * @brief Move constructor.
- */
- inline thread(thread&& t) noexcept : m_handle{t.m_handle} {
+/**
+ * @brief The id is of type `thread_id`-
+ */
+using id = thread_id;
+/**
+ * @brief The native handle type is the `kernel_pid_t` of RIOT.
+ */
+using native_handle_type = kernel_pid_t;
+
+/**
+ * @brief Per default, an uninitialized thread is created.
+ */
+inline thread() noexcept : m_handle{thread_uninitialized} {
+}
+/**
+ * @brief Create a thread from a functor and arguments for it.
+ * @param[in] f Functor to run as a thread.
+ * @param[in] args Arguments passed to the functor.
+ */
+template <class F, class ... Args>
+explicit thread(F&& f, Args&& ... args);
+
+/**
+ * @brief Disallow copy constructor.
+ */
+thread(const thread&) = delete;
+
+/**
+ * @brief Move constructor.
+ */
+inline thread(thread&& t) noexcept : m_handle{t.m_handle} {
t.m_handle = thread_uninitialized;
std::swap(m_data, t.m_data);
- }
+}
- ~thread();
+~thread();
- /**
- * @brief Disallow copy assignment operator.
- */
- thread& operator=(const thread&) = delete;
+/**
+ * @brief Disallow copy assignment operator.
+ */
+thread& operator=(const thread&) = delete;
- /**
- * @brief Move assignment operator.
- */
- thread& operator=(thread&&) noexcept;
+/**
+ * @brief Move assignment operator.
+ */
+thread& operator=(thread&&) noexcept;
- /**
- * @brief Swap threads.
- * @param[inout] t Thread to swap data with.
- */
- void swap(thread& t) noexcept {
+/**
+ * @brief Swap threads.
+ * @param[inout] t Thread to swap data with.
+ */
+void swap(thread& t) noexcept {
std::swap(m_data, t.m_data);
std::swap(m_handle, t.m_handle);
- }
+}
- /**
- * @brief Query if the thread is joinable.
- * @return `true` if the thread is joinable, `false` otherwise.
- */
- inline bool joinable() const noexcept {
+/**
+ * @brief Query if the thread is joinable.
+ * @return `true` if the thread is joinable, `false` otherwise.
+ */
+inline bool joinable() const noexcept {
return m_handle != thread_uninitialized;
- }
- /**
- * @brief Block until the thread finishes. Leads to an error if the thread is
- * not joinable or a thread joins itself.
- */
- void join();
- /**
- * @brief Detaches a thread from its handle and allows it to execute
- * independently. The thread cleans up its resources when it
- * finishes.
- */
- void detach();
- /**
- * @brief Returns the id of a thread.
- */
- inline id get_id() const noexcept { return thread_id{m_handle}; }
- /**
- * @brief Returns the native handle to a thread.
- */
- inline native_handle_type native_handle() noexcept { return m_handle; }
-
- /**
- * @brief Returns the number of concurrent threads supported by the
- * underlying hardware. Since there is no RIOT API to query this
- * information, the function always returns 1;
- */
- static unsigned hardware_concurrency() noexcept;
+}
+/**
+ * @brief Block until the thread finishes. Leads to an error if the thread is
+ * not joinable or a thread joins itself.
+ */
+void join();
+/**
+ * @brief Detaches a thread from its handle and allows it to execute
+ * independently. The thread cleans up its resources when it
+ * finishes.
+ */
+void detach();
+/**
+ * @brief Returns the id of a thread.
+ */
+inline id get_id() const noexcept {
+ return thread_id{m_handle};
+}
+/**
+ * @brief Returns the native handle to a thread.
+ */
+inline native_handle_type native_handle() noexcept {
+ return m_handle;
+}
+
+/**
+ * @brief Returns the number of concurrent threads supported by the
+ * underlying hardware. Since there is no RIOT API to query this
+ * information, the function always returns 1;
+ */
+static unsigned hardware_concurrency() noexcept;
private:
- kernel_pid_t m_handle;
- std::unique_ptr<thread_data, thread_data_deleter> m_data;
+kernel_pid_t m_handle;
+std::unique_ptr<thread_data, thread_data_deleter> m_data;
};
/**
@@ -324,59 +335,61 @@ void swap(thread& lhs, thread& rhs) noexcept;
/** @cond INTERNAL */
template <class Tuple>
void* thread_proxy(void* vp) {
- { // without this scope, the objects here are not cleaned up corrctly
- std::unique_ptr<Tuple> p(static_cast<Tuple*>(vp));
- auto tmp = std::get<0>(*p);
- std::unique_ptr<thread_data, thread_data_deleter> data{tmp};
- // create indices for the arguments, 0 is thread_data and 1 is the function
- auto indices = detail::get_indices<std::tuple_size<Tuple>::value, 2>();
- try {
- detail::apply_args(std::get<1>(*p), indices, *p);
- }
- catch (...) {
- // nop
- }
- if (data->joining_thread != thread_uninitialized) {
- thread_wakeup(data->joining_thread);
+ { // without this scope, the objects here are not cleaned up corrctly
+ std::unique_ptr<Tuple> p(static_cast<Tuple*>(vp));
+ auto tmp = std::get<0>(*p);
+ std::unique_ptr<thread_data, thread_data_deleter> data{tmp};
+ // create indices for the arguments, 0 is thread_data and 1 is the function
+ auto indices = detail::get_indices<std::tuple_size<Tuple>::value, 2>();
+ try {
+ detail::apply_args(std::get<1>(*p), indices, *p);
+ }
+ catch (...) {
+ // nop
+ }
+ if (data->joining_thread != thread_uninitialized) {
+ thread_wakeup(data->joining_thread);
+ }
}
- }
- // some riot cleanup code
- sched_task_exit();
- return nullptr;
+ // some riot cleanup code
+ sched_task_exit();
+ return nullptr;
}
/** @endcond */
-template <class F, class... Args>
-thread::thread(F&& f, Args&&... args)
+template <class F, class ... Args>
+thread::thread(F&& f, Args&& ... args)
: m_data{new thread_data} {
- using namespace std;
- using func_and_args = tuple
- <thread_data*, typename decay<F>::type, typename decay<Args>::type...>;
- unique_ptr<func_and_args> p(
- new func_and_args(m_data.get(), forward<F>(f), forward<Args>(args)...));
- m_handle = thread_create(
- m_data->stack.data(), stack_size, THREAD_PRIORITY_MAIN - 1, 0,
- &thread_proxy<func_and_args>, p.get(), "riot_cpp_thread");
- if (m_handle >= 0) {
- p.release();
- } else {
- throw std::system_error(
- std::make_error_code(std::errc::resource_unavailable_try_again),
- "Failed to create thread.");
- }
+ using namespace std;
+ using func_and_args = tuple
+ <thread_data*, typename decay<F>::type, typename decay<Args>::type ...>;
+ unique_ptr<func_and_args> p(
+ new func_and_args(m_data.get(), forward<F>(f), forward<Args>(args) ...));
+ m_handle = thread_create(
+ m_data->stack.data(), stack_size, THREAD_PRIORITY_MAIN - 1, 0,
+ &thread_proxy<func_and_args>, p.get(), "riot_cpp_thread");
+ if (m_handle >= 0) {
+ p.release();
+ } else {
+ throw std::system_error(
+ std::make_error_code(std::errc::resource_unavailable_try_again),
+ "Failed to create thread.");
+ }
}
inline thread& thread::operator=(thread&& other) noexcept {
- if (m_handle != thread_uninitialized) {
- std::terminate();
- }
- m_handle = other.m_handle;
- other.m_handle = thread_uninitialized;
- std::swap(m_data, other.m_data);
- return *this;
+ if (m_handle != thread_uninitialized) {
+ std::terminate();
+ }
+ m_handle = other.m_handle;
+ other.m_handle = thread_uninitialized;
+ std::swap(m_data, other.m_data);
+ return *this;
}
-inline void swap(thread& lhs, thread& rhs) noexcept { lhs.swap(rhs); }
+inline void swap(thread& lhs, thread& rhs) noexcept {
+ lhs.swap(rhs);
+}
} // namespace riot
diff --git a/sys/cpp11-compat/mutex.cpp b/sys/cpp11-compat/mutex.cpp
index aadbb1d66..198734746 100644
--- a/sys/cpp11-compat/mutex.cpp
+++ b/sys/cpp11-compat/mutex.cpp
@@ -23,13 +23,19 @@
namespace riot {
mutex::~mutex() {
- // nop
+ // nop
}
-void mutex::lock() { mutex_lock(&m_mtx); }
+void mutex::lock() {
+ mutex_lock(&m_mtx);
+}
-bool mutex::try_lock() noexcept { return (1 == mutex_trylock(&m_mtx)); }
+bool mutex::try_lock() noexcept {
+ return (1 == mutex_trylock(&m_mtx));
+}
-void mutex::unlock() noexcept { mutex_unlock(&m_mtx); }
+void mutex::unlock() noexcept {
+ mutex_unlock(&m_mtx);
+}
} // namespace riot
diff --git a/sys/cpp11-compat/thread.cpp b/sys/cpp11-compat/thread.cpp
index 6fba13af1..dca1fe999 100644
--- a/sys/cpp11-compat/thread.cpp
+++ b/sys/cpp11-compat/thread.cpp
@@ -30,51 +30,51 @@ using namespace std;
namespace riot {
thread::~thread() {
- if (joinable()) {
- terminate();
- }
+ if (joinable()) {
+ terminate();
+ }
}
void thread::join() {
- if (this->get_id() == this_thread::get_id()) {
- throw system_error(make_error_code(errc::resource_deadlock_would_occur),
- "Joining this leads to a deadlock.");
- }
- if (joinable()) {
- auto status = thread_getstatus(m_handle);
- if (status != STATUS_NOT_FOUND && status != STATUS_STOPPED) {
- m_data->joining_thread = sched_active_pid;
- thread_sleep();
+ if (this->get_id() == this_thread::get_id()) {
+ throw system_error(make_error_code(errc::resource_deadlock_would_occur),
+ "Joining this leads to a deadlock.");
+ }
+ if (joinable()) {
+ auto status = thread_getstatus(m_handle);
+ if (status != STATUS_NOT_FOUND && status != STATUS_STOPPED) {
+ m_data->joining_thread = sched_active_pid;
+ thread_sleep();
+ }
+ m_handle = thread_uninitialized;
+ } else {
+ throw system_error(make_error_code(errc::invalid_argument),
+ "Can not join an unjoinable thread.");
}
- m_handle = thread_uninitialized;
- } else {
- throw system_error(make_error_code(errc::invalid_argument),
- "Can not join an unjoinable thread.");
- }
- // missing: no_such_process system error
+ // missing: no_such_process system error
}
void thread::detach() {
- if (joinable()) {
- m_handle = thread_uninitialized;
- } else {
- throw system_error(make_error_code(errc::invalid_argument),
- "Can not detach an unjoinable thread.");
- }
+ if (joinable()) {
+ m_handle = thread_uninitialized;
+ } else {
+ throw system_error(make_error_code(errc::invalid_argument),
+ "Can not detach an unjoinable thread.");
+ }
}
unsigned thread::hardware_concurrency() noexcept {
- // there is currently no API for this
- return 1;
+ // there is currently no API for this
+ return 1;
}
namespace this_thread {
void sleep_for(const chrono::nanoseconds& ns) {
- using namespace chrono;
- if (ns > nanoseconds::zero()) {
- xtimer_usleep64(static_cast<uint64_t>(duration_cast<microseconds>(ns).count()));
- }
+ using namespace chrono;
+ if (ns > nanoseconds::zero()) {
+ xtimer_usleep64(static_cast<uint64_t>(duration_cast<microseconds>(ns).count()));
+ }
}
} // namespace this_thread
diff --git a/sys/crypto/aes.c b/sys/crypto/aes.c
index c36a5b810..b037ef042 100644
--- a/sys/crypto/aes.c
+++ b/sys/crypto/aes.c
@@ -944,7 +944,7 @@ int aes_encrypt(const cipher_context_t *context, const uint8_t *plainBlock,
AES_KEY aeskey;
const AES_KEY *key = &aeskey;
res = aes_set_encrypt_key((unsigned char *)context->context,
- AES_KEY_SIZE * 8, &aeskey);
+ AES_KEY_SIZE * 8, &aeskey);
if (res < 0) {
return res;
}
@@ -1071,22 +1071,22 @@ int aes_encrypt(const cipher_context_t *context, const uint8_t *plainBlock,
if (key->rounds > 12) {
/* round 12: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) &
- 0xff] ^ Te3[t3 & 0xff] ^ rk[48];
+ 0xff] ^ Te3[t3 & 0xff] ^ rk[48];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) &
- 0xff] ^ Te3[t0 & 0xff] ^ rk[49];
+ 0xff] ^ Te3[t0 & 0xff] ^ rk[49];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) &
- 0xff] ^ Te3[t1 & 0xff] ^ rk[50];
+ 0xff] ^ Te3[t1 & 0xff] ^ rk[50];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) &
- 0xff] ^ Te3[t2 & 0xff] ^ rk[51];
+ 0xff] ^ Te3[t2 & 0xff] ^ rk[51];
/* round 13: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) &
- 0xff] ^ Te3[s3 & 0xff] ^ rk[52];
+ 0xff] ^ Te3[s3 & 0xff] ^ rk[52];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) &
- 0xff] ^ Te3[s0 & 0xff] ^ rk[53];
+ 0xff] ^ Te3[s0 & 0xff] ^ rk[53];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) &
- 0xff] ^ Te3[s1 & 0xff] ^ rk[54];
+ 0xff] ^ Te3[s1 & 0xff] ^ rk[54];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) &
- 0xff] ^ Te3[s2 & 0xff] ^ rk[55];
+ 0xff] ^ Te3[s2 & 0xff] ^ rk[55];
}
}
@@ -1157,16 +1157,16 @@ int aes_encrypt(const cipher_context_t *context, const uint8_t *plainBlock,
#endif /* ?FULL_UNROLL */
/*
- * apply last round and
- * map cipher state to byte array block:
- */
+ * apply last round and
+ * map cipher state to byte array block:
+ */
s0 =
(Te4[(t0 >> 24) ] & 0xff000000) ^
(Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
(Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
(Te4[(t3) & 0xff] & 0x000000ff) ^
rk[0];
- PUTU32(cipherBlock , s0);
+ PUTU32(cipherBlock, s0);
s1 =
(Te4[(t1 >> 24) ] & 0xff000000) ^
(Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
@@ -1417,16 +1417,16 @@ int aes_decrypt(const cipher_context_t *context, const uint8_t *cipherBlock,
#endif /* ?FULL_UNROLL */
/*
- * apply last round and
- * map cipher state to byte array block:
- */
+ * apply last round and
+ * map cipher state to byte array block:
+ */
s0 =
(Td4[(t0 >> 24) ] & 0xff000000) ^
(Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
(Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
(Td4[(t1) & 0xff] & 0x000000ff) ^
rk[0];
- PUTU32(plainBlock , s0);
+ PUTU32(plainBlock, s0);
s1 =
(Td4[(t1 >> 24) ] & 0xff000000) ^
(Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
diff --git a/sys/crypto/chacha.c b/sys/crypto/chacha.c
index b382e7423..77c08c15c 100644
--- a/sys/crypto/chacha.c
+++ b/sys/crypto/chacha.c
@@ -116,7 +116,7 @@ void chacha_encrypt_bytes(chacha_ctx *ctx, const uint8_t *m, uint8_t *c)
{
uint8_t x[64];
chacha_keystream_bytes(ctx, x);
- for (unsigned i = 0 ; i < 64; ++i) {
+ for (unsigned i = 0; i < 64; ++i) {
c[i] = m[i] ^ x[i];
}
}
diff --git a/sys/crypto/modes/ccm.c b/sys/crypto/modes/ccm.c
index 0df28fa4b..9e7650b2b 100644
--- a/sys/crypto/modes/ccm.c
+++ b/sys/crypto/modes/ccm.c
@@ -148,14 +148,14 @@ int cipher_encrypt_ccm(cipher_t* cipher, uint8_t* auth_data, uint32_t auth_data_
{
int len = -1;
uint8_t nonce_counter[16] = {0}, mac_iv[16] = {0}, mac[16] = {0},
- stream_block[16] = {0}, zero_block[16] = {0}, block_size;
+ stream_block[16] = {0}, zero_block[16] = {0}, block_size;
if (mac_length % 2 != 0 || mac_length < 4 || mac_length > 16) {
return CCM_ERR_INVALID_MAC_LENGTH;
}
if (length_encoding < 2 || length_encoding > 8 ||
- !_fits_in_nbytes(input_len, length_encoding)) {
+ !_fits_in_nbytes(input_len, length_encoding)) {
return CCM_ERR_INVALID_LENGTH_ENCODING;
}
@@ -207,15 +207,15 @@ int cipher_decrypt_ccm(cipher_t* cipher, uint8_t* auth_data,
{
int len = -1;
uint8_t nonce_counter[16] = {0}, mac_iv[16] = {0}, mac[16] = {0},
- mac_recv[16] = {0}, stream_block[16] = {0}, zero_block[16] = {0},
- plain_len, block_size;
+ mac_recv[16] = {0}, stream_block[16] = {0}, zero_block[16] = {0},
+ plain_len, block_size;
if (mac_length % 2 != 0 || mac_length < 4 || mac_length > 16) {
return CCM_ERR_INVALID_MAC_LENGTH;
}
if (length_encoding < 2 || length_encoding > 8 ||
- !_fits_in_nbytes(input_len, length_encoding)) {
+ !_fits_in_nbytes(input_len, length_encoding)) {
return CCM_ERR_INVALID_LENGTH_ENCODING;
}
diff --git a/sys/crypto/modes/ctr.c b/sys/crypto/modes/ctr.c
index 8ede35109..bdfdd47a3 100644
--- a/sys/crypto/modes/ctr.c
+++ b/sys/crypto/modes/ctr.c
@@ -7,16 +7,16 @@
*/
/**
-* @ingroup sys_crypto_modes
-* @{
-*
-* @file
-* @brief Crypto mode - Counter
-*
-* @author Nico von Geyso <nico.geyso@fu-berlin.de>
-*
-* @}
-*/
+ * @ingroup sys_crypto_modes
+ * @{
+ *
+ * @file
+ * @brief Crypto mode - Counter
+ *
+ * @author Nico von Geyso <nico.geyso@fu-berlin.de>
+ *
+ * @}
+ */
#include "crypto/helper.h"
#include "crypto/modes/ctr.h"
diff --git a/sys/crypto/modes/ecb.c b/sys/crypto/modes/ecb.c
index a2c0da884..b30460f21 100644
--- a/sys/crypto/modes/ecb.c
+++ b/sys/crypto/modes/ecb.c
@@ -7,16 +7,16 @@
*/
/**
-* @ingroup sys_crypto_modes
-* @{
-*
-* @file
-* @brief Crypto mode - electronic code book
-*
-* @author Nico von Geyso <nico.geyso@fu-berlin.de>
-*
-* @}
-*/
+ * @ingroup sys_crypto_modes
+ * @{
+ *
+ * @file
+ * @brief Crypto mode - electronic code book
+ *
+ * @author Nico von Geyso <nico.geyso@fu-berlin.de>
+ *
+ * @}
+ */
#include <stddef.h>
#include <stdint.h>
diff --git a/sys/div/div.c b/sys/div/div.c
index 95b171ed1..1a541ac8b 100644
--- a/sys/div/div.c
+++ b/sys/div/div.c
@@ -35,12 +35,12 @@ uint64_t _div_mulhi64(const uint64_t a, const uint64_t b)
/* We may get up to 2 carry bits from the lower part of the multiplication */
const uint32_t carry_bits = ((uint64_t)(uint32_t)a_x_b_mid +
- (uint64_t)(uint32_t)b_x_a_mid +
- (a_x_b_lo >> 32) ) >> 32;
+ (uint64_t)(uint32_t)b_x_a_mid +
+ (a_x_b_lo >> 32) ) >> 32;
const uint64_t multhi = a_x_b_hi +
- (a_x_b_mid >> 32) + (b_x_a_mid >> 32) +
- carry_bits;
+ (a_x_b_mid >> 32) + (b_x_a_mid >> 32) +
+ carry_bits;
return multhi;
}
diff --git a/sys/embunit/ColorOutputter.c b/sys/embunit/ColorOutputter.c
index 3c489e156..062d5ca19 100644
--- a/sys/embunit/ColorOutputter.c
+++ b/sys/embunit/ColorOutputter.c
@@ -36,7 +36,7 @@ static void ColorOutputter_printSuccessful(OutputterRef self, TestRef test, int
}
static void ColorOutputter_printFailure(OutputterRef self, TestRef test, char *msg, int line,
- char *file, int runCount)
+ char *file, int runCount)
{
(void) self;
(void) runCount;
@@ -48,7 +48,7 @@ void ColorOutputter_printStatistics(OutputterRef self, TestResultRef result)
(void) self;
if (result->failureCount) {
printf("\n" BGRED SBOLD "FAILED" SDEFAULT " (%d of %d failed)", result->failureCount,
- result->runCount);
+ result->runCount);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment