aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/f1/obldc/pwmleds
diff options
context:
space:
mode:
authorUwe Hermann2011-11-13 17:07:21 +0100
committerUwe Hermann2011-11-13 23:21:58 +0100
commitbb8741a79bba96416b0454d4a97060866fa3a3a1 (patch)
treedbe7daf4c6b37a20362bce48a82f373c4eb5c3aa /examples/stm32/f1/obldc/pwmleds
parentc3fea659d1313e324bb7512e7e50875e0cb0318a (diff)
examples: Even more coding-style fixes.
Diffstat (limited to 'examples/stm32/f1/obldc/pwmleds')
-rw-r--r--examples/stm32/f1/obldc/pwmleds/pwmleds.c38
1 files changed, 18 insertions, 20 deletions
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;
}