Commit 4dec7621 authored by Federico Vaga's avatar Federico Vaga

common: fix blinky function

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent e741c0c5
......@@ -41,24 +41,21 @@ void ResetEFM32(void)
*****************************************************************************/
void supercar_blink(int delay, int rep)
{
int i, c = rep;
int i, c = rep * 2;
/* Setup SysTick Timer for 1 msec interrupts */
if (SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE) / 1000)) while (1);
CMU_ClockEnable(cmuClock_HFPER, true);
CMU_ClockEnable(cmuClock_GPIO, true);
for (i = 1; i < 5; ++i) {
GPIO_PinModeSet(gpioPortD, i, gpioModePushPull, 0);
}
GPIO_PinModeSet(gpioPortE, 11, gpioModePushPull, 0);
GPIO_PinModeSet(gpioPortE, 12, gpioModePushPull, 0);
/* Infinite blink loop */
while (c--) {
for (i = 1; i < 5; ++i) {
GPIO_PinOutToggle(gpioPortD, i);
GPIO_PinOutToggle(gpioPortE, 11);
GPIO_PinOutToggle(gpioPortE, 12);
Delay(delay);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment