fixed led processing and wait

This commit is contained in:
e.gavrin
2014-07-25 17:47:09 +04:00
parent 5da1df37de
commit 43a8bbd576
3 changed files with 67 additions and 11 deletions
+5 -5
View File
@@ -36,9 +36,9 @@ led_toggle (uint32_t led_id)
#ifdef __TARGET_MCU
init_led (led_id);
init_led (led_id);
GPIOD->ODR ^= (uint16_t) (1 << led_id);
GPIOD->ODR ^= (uint16_t) (1 << led_id);
#endif
}
@@ -54,6 +54,7 @@ led_on (uint32_t led_id)
init_led (led_id);
GPIOD->BSRRH = (uint16_t) (1 << led_id);
GPIOD->BSRRL = (uint16_t) (1 << led_id);
#endif
}
@@ -67,6 +68,7 @@ led_off (uint32_t led_id)
#ifdef __TARGET_MCU
init_led (led_id);
GPIOD->BSRRL = (uint16_t) (1 << led_id);
GPIOD->BSRRH = (uint16_t) (1 << led_id);
#endif
}
@@ -81,13 +83,11 @@ led_blink_once (uint32_t led_id)
#ifdef __TARGET_MCU
init_led (led_id);
uint32_t dot = 600000 * 3;
uint32_t dot = 300000;
GPIOD->BSRRL = (uint16_t) (1 << led_id);
wait_ms (dot);
GPIOD->BSRRH = (uint16_t) (1 << led_id);
wait_ms (dot);
#endif
}