aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/f1/obldc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32/f1/obldc')
-rw-r--r--examples/stm32/f1/obldc/can/can.c8
-rw-r--r--examples/stm32/f1/obldc/pwmleds/pwmleds.c38
-rw-r--r--examples/stm32/f1/obldc/systick/systick.c8
-rw-r--r--examples/stm32/f1/obldc/usart/usart.c2
-rw-r--r--examples/stm32/f1/obldc/usart_irq/usart_irq.c2
5 files changed, 28 insertions, 30 deletions
diff --git a/examples/stm32/f1/obldc/can/can.c b/examples/stm32/f1/obldc/can/can.c
index dd137f1..5914eaf 100644
--- a/examples/stm32/f1/obldc/can/can.c
+++ b/examples/stm32/f1/obldc/can/can.c
@@ -62,15 +62,15 @@ void gpio_setup(void)
/* Set GPIO6/7 (in GPIO port A) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO6);
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO6);
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO7);
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO7);
/* Set GPIO0/1 (in GPIO port B) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO0);
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO0);
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO1);
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO1);
}
void systick_setup(void)
diff --git a/examples/stm32/f1/obldc/pwmleds/pwmleds.c b/examples/stm32/f1/obldc/pwmleds/pwmleds.c
index e55396f..ad08c6f 100644
--- a/examples/stm32/f1/obldc/pwmleds/pwmleds.c
+++ b/examples/stm32/f1/obldc/pwmleds/pwmleds.c
@@ -257,18 +257,16 @@ void gpio_setup(void)
* 'output alternate function push-pull'.
*/
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_ALTFN_PUSHPULL,
- GPIO_TIM3_CH1 |
- GPIO_TIM3_CH2);
+ GPIO_CNF_OUTPUT_ALTFN_PUSHPULL,
+ GPIO_TIM3_CH1 | GPIO_TIM3_CH2);
/*
* Set GPIO0 and 1 (in GPIO port B) to
* 'output alternate function push-pull'.
*/
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_ALTFN_PUSHPULL,
- GPIO_TIM3_CH3 |
- GPIO_TIM3_CH4);
+ GPIO_CNF_OUTPUT_ALTFN_PUSHPULL,
+ GPIO_TIM3_CH3 | GPIO_TIM3_CH4);
}
void tim_setup(void)
@@ -354,25 +352,25 @@ int main(void)
TIM3_CCR1 = gamma_table_linear[j0];
j0 += d0;
if (j0 == 255)
- d0 =- 1;
+ d0 = -1;
if (j0 == 0)
d0 = 1;
TIM3_CCR2 = gamma_table_1_3[j1];
j1 += d1;
if (j1 == 255)
- d1 =- 1;
+ d1 = -1;
if (j1 == 0)
d1 = 1;
TIM3_CCR3 = gamma_table_2_5[j2];
j2 += d2;
if (j2 == 255)
- d2 =- 1;
+ d2 = -1;
if (j2 == 0)
d2 = 1;
- TIM3_CCR4= gamma_table_3_0[j3];
+ TIM3_CCR4 = gamma_table_3_0[j3];
j3 += d3;
if (j3 == 255)
- d3 =- 1;
+ d3 = -1;
if (j3 == 0)
d3 = 1;
for (i = 0; i < 50000; i++);
@@ -392,25 +390,25 @@ int main(void)
TIM3_CCR1 = GAMMA_TABLE[j0];
j0 += d0;
if (j0 == 255)
- d0 =- 1;
+ d0 = -1;
if (j0 == 0)
d0 = 1;
TIM3_CCR2 = GAMMA_TABLE[j1];
j1 += d1;
if (j1 == 255)
- d1 =- 1;
+ d1 = -1;
if (j1 == 0)
d1 = 1;
TIM3_CCR3 = GAMMA_TABLE[j2];
j2 += d2;
if (j2 == 255)
- d2 =- 1;
+ d2 = -1;
if (j2 == 0)
d2 = 1;
TIM3_CCR4 = GAMMA_TABLE[j3];
j3 += d3;
if (j3 == 255)
- d3 =- 1;
+ d3 = -1;
if (j3 == 0)
d3 = 1;
for (i = 0; i < 10000; i++);
@@ -433,25 +431,25 @@ int main(void)
TIM3_CCR1 = GAMMA_TABLE[j0];
j0 += d0;
if (j0 == 255)
- d0 =- 1;
+ d0 = -1;
if (j0 == 19)
j0 = 20;
TIM3_CCR2 = GAMMA_TABLE[j1];
j1 += d1;
if (j1 == 255)
- d1 =- 1;
+ d1 = -1;
if (j1 == 19)
j1 = 20;
TIM3_CCR3 = GAMMA_TABLE[j2];
j2 += d2;
if (j2 == 255)
- d2 =- 1;
+ d2 = -1;
if (j2 == 19)
j2 = 20;
TIM3_CCR4 = GAMMA_TABLE[j3];
j3 += d3;
if (j3 == 255)
- d3 =- 1;
+ d3 = -1;
if (j3 == 19)
j3 = 20;
for (i = 0; i < 15000; i++)
@@ -474,7 +472,7 @@ int main(void)
break;
}
if (k == 3)
- kd =- 1;
+ kd = -1;
if (k == 0)
kd = 1;
}
diff --git a/examples/stm32/f1/obldc/systick/systick.c b/examples/stm32/f1/obldc/systick/systick.c
index f011a76..ecd98a4 100644
--- a/examples/stm32/f1/obldc/systick/systick.c
+++ b/examples/stm32/f1/obldc/systick/systick.c
@@ -41,15 +41,15 @@ void gpio_setup(void)
/* Set GPIO6/7 (in GPIO port A) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO6);
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO6);
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO7);
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO7);
/* Set GPIO0/1 (in GPIO port B) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO0);
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO0);
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_PUSHPULL, GPIO1);
+ GPIO_CNF_OUTPUT_PUSHPULL, GPIO1);
}
void sys_tick_handler(void)
diff --git a/examples/stm32/f1/obldc/usart/usart.c b/examples/stm32/f1/obldc/usart/usart.c
index 9999f72..70959d3 100644
--- a/examples/stm32/f1/obldc/usart/usart.c
+++ b/examples/stm32/f1/obldc/usart/usart.c
@@ -44,7 +44,7 @@ void usart_setup(void)
/* Setup GPIO pin GPIO_USART3_TX/GPIO10 on GPIO port B for transmit. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_RE_TX);
+ GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_RE_TX);
/* Setup UART parameters. */
usart_set_baudrate(USART1, 230400, rcc_ppre2_frequency);
diff --git a/examples/stm32/f1/obldc/usart_irq/usart_irq.c b/examples/stm32/f1/obldc/usart_irq/usart_irq.c
index fb59472..6309233 100644
--- a/examples/stm32/f1/obldc/usart_irq/usart_irq.c
+++ b/examples/stm32/f1/obldc/usart_irq/usart_irq.c
@@ -45,7 +45,7 @@ void usart_setup(void)
/* Setup GPIO pin GPIO_USART1_RE_TX on GPIO port B for transmit. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
- GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_RE_TX);
+ GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_RE_TX);
/* Setup GPIO pin GPIO_USART1_RE_RX on GPIO port B for receive. */
gpio_set_mode(GPIOB, GPIO_MODE_INPUT,