examples: Even more coding-style fixes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user