diff options
| author | Bernard Xiong <[email protected]> | 2021-04-12 12:54:37 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-12 12:54:37 +0800 |
| commit | c44e5165bef5b7b069eb99a4f027454f417a726b (patch) | |
| tree | 8298cad21f8deb430a3bda7637252fee8c246ef1 | |
| parent | 211b62aea73699e1822063b79f7eda1dd5b151ab (diff) | |
| parent | f1d45a184a2131312cb931ff3d1a073eb13ea78e (diff) | |
Merge pull request #4599 from mysterywolf/ab32
[ab32vg1] optimize main function
| -rw-r--r-- | bsp/bluetrum/ab32vg1-ab-prougen/applications/main.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/applications/main.c b/bsp/bluetrum/ab32vg1-ab-prougen/applications/main.c index 9fa2a7204e..dc043f56e1 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/applications/main.c +++ b/bsp/bluetrum/ab32vg1-ab-prougen/applications/main.c @@ -19,7 +19,6 @@ int main(void) { - uint32_t cnt = 0; uint8_t pin = rt_pin_get("PE.1"); rt_pin_mode(pin, PIN_MODE_OUTPUT); @@ -27,14 +26,9 @@ int main(void) while (1) { - if (cnt % 2 == 0) { - rt_pin_write(pin, PIN_LOW); - } else { - rt_pin_write(pin, PIN_HIGH); - } - cnt++; - rt_thread_mdelay(1000); + rt_pin_write(pin, PIN_LOW); + rt_thread_mdelay(500); + rt_pin_write(pin, PIN_HIGH); + rt_thread_mdelay(500); } - - return 0; } |
