Skip to content

Commit c44e516

Browse files
authored
Merge pull request #4599 from mysterywolf/ab32
[ab32vg1] optimize main function
2 parents 211b62a + f1d45a1 commit c44e516

File tree

1 file changed

+4
-10
lines changed
  • bsp/bluetrum/ab32vg1-ab-prougen/applications

1 file changed

+4
-10
lines changed

bsp/bluetrum/ab32vg1-ab-prougen/applications/main.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,16 @@
1919

2020
int main(void)
2121
{
22-
uint32_t cnt = 0;
2322
uint8_t pin = rt_pin_get("PE.1");
2423

2524
rt_pin_mode(pin, PIN_MODE_OUTPUT);
2625
rt_kprintf("Hello, world\n");
2726

2827
while (1)
2928
{
30-
if (cnt % 2 == 0) {
31-
rt_pin_write(pin, PIN_LOW);
32-
} else {
33-
rt_pin_write(pin, PIN_HIGH);
34-
}
35-
cnt++;
36-
rt_thread_mdelay(1000);
29+
rt_pin_write(pin, PIN_LOW);
30+
rt_thread_mdelay(500);
31+
rt_pin_write(pin, PIN_HIGH);
32+
rt_thread_mdelay(500);
3733
}
38-
39-
return 0;
4034
}

0 commit comments

Comments
 (0)