4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-30 04:57:18 +08:00

Merge pull request #4599 from mysterywolf/ab32

[ab32vg1] optimize main function
This commit is contained in:
Bernard Xiong 2021-04-12 12:54:37 +08:00 committed by GitHub
commit c44e5165be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,6 @@
int main(void) int main(void)
{ {
uint32_t cnt = 0;
uint8_t pin = rt_pin_get("PE.1"); uint8_t pin = rt_pin_get("PE.1");
rt_pin_mode(pin, PIN_MODE_OUTPUT); rt_pin_mode(pin, PIN_MODE_OUTPUT);
@ -27,14 +26,9 @@ int main(void)
while (1) while (1)
{ {
if (cnt % 2 == 0) { rt_pin_write(pin, PIN_LOW);
rt_pin_write(pin, PIN_LOW); rt_thread_mdelay(500);
} else { rt_pin_write(pin, PIN_HIGH);
rt_pin_write(pin, PIN_HIGH); rt_thread_mdelay(500);
}
cnt++;
rt_thread_mdelay(1000);
} }
return 0;
} }