X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/d537298fdd7d39e4cb0e74e8e6d227245d638afe..8571e67d6a7cfb042ebd7dded77094b56409f126:/main.c diff --git a/main.c b/main.c index d0dd354..bb2c280 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ Software License Agreement (BSD License) - Copyright (c) 2011, microBuilder SARL + Copyright (c) 2012, microBuilder SARL All rights reserved. Redistribution and use in source and binary forms, with or without @@ -33,10 +33,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /**************************************************************************/ -#include -#include -#include - #include "projectconfig.h" #include "sysinit.h" @@ -63,19 +59,12 @@ int main(void) while (1) { - // Toggle LED once per second ... rollover = 136 years :) + // Toggle LED once per second currentSecond = systickGetSecondsActive(); if (currentSecond != lastSecond) { lastSecond = currentSecond; - if (gpioGetValue(CFG_LED_PORT, CFG_LED_PIN) == CFG_LED_OFF) - { - gpioSetValue (CFG_LED_PORT, CFG_LED_PIN, CFG_LED_ON); - } - else - { - gpioSetValue (CFG_LED_PORT, CFG_LED_PIN, CFG_LED_OFF); - } + gpioSetValue(CFG_LED_PORT, CFG_LED_PIN, lastSecond % 2); } // Poll for CLI input if CFG_INTERFACE is enabled in projectconfig.h