aboutsummaryrefslogtreecommitdiffstats
path: root/app/ticker.c
diff options
context:
space:
mode:
authorroot <root@ka-ata-killa.ourano.james.local>2021-03-03 15:24:13 +0000
committerroot <root@ka-ata-killa.ourano.james.local>2021-03-03 16:03:28 +0000
commit49148e76706e5e24c2ba7f6ccc1d7ec4736ab2f3 (patch)
treef65cb7440711ea1708c25fe78819e9986b2d8566 /app/ticker.c
parent129a103238d69bd90b4fe9a44bbed943b9488fc2 (diff)
downloadserial_over_dp-49148e76706e5e24c2ba7f6ccc1d7ec4736ab2f3.tar.gz
serial_over_dp-49148e76706e5e24c2ba7f6ccc1d7ec4736ab2f3.tar.bz2
serial_over_dp-49148e76706e5e24c2ba7f6ccc1d7ec4736ab2f3.zip
support cheap chinese blue pill boards, make usb dfu compatible with dfuse
Diffstat (limited to 'app/ticker.c')
-rw-r--r--app/ticker.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/app/ticker.c b/app/ticker.c
index 05990d2..a28824c 100644
--- a/app/ticker.c
+++ b/app/ticker.c
@@ -13,9 +13,8 @@ delay_us (uint32_t d)
{
d *= scale;
- while (d--) {
+ while (d--)
__asm__ ("nop");
- }
}
void
@@ -24,25 +23,23 @@ sys_tick_handler (void)
ticks++;
cdcacm_tick();
- if (led1) {
+ if (led1)
led1--;
- }
- if (led2) {
+ if (led2)
led2--;
- }
- if (led1) {
+ if (led1)
gpio_clear (LED1_BANK, LED1_GPIO);
- } else {
+
+ else
gpio_set (LED1_BANK, LED1_GPIO);
- }
- if (led2) {
+ if (led2)
gpio_clear (LED2_BANK, LED2_GPIO);
- } else {
+
+ else
gpio_set (LED2_BANK, LED2_GPIO);
- }
}
@@ -63,9 +60,8 @@ ticker_init (void)
scale--;
v = ticks;
- while (v == ticks) {
+ while (v == ticks)
;
- }
delay_us (1000);
w = ticks;