Skip to content

Instantly share code, notes, and snippets.

@oyvindrobertsen
Created November 6, 2013 20:52
Show Gist options
  • Save oyvindrobertsen/7343857 to your computer and use it in GitHub Desktop.
Save oyvindrobertsen/7343857 to your computer and use it in GitHub Desktop.
#include <stdint.h>
#include <stdbool.h>
#include "em_device.h"
#include "em_chip.h"
#include "em_cmu.h"
#include "em_emu.h"
#include "bsp.h"
#include "bsp_trace.h"
/**************************************************************************//**
* @brief Main function
*****************************************************************************/
int main(void)
{
/* Chip errata */
CHIP_Init();
/* If first word of user data page is non-zero, enable eA Profiler trace */
BSP_TraceProfilerSetup();
/* Setup SysTick Timer for 1 msec interrupts */
if (SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE) / 1000)) while (1) ;
/* Initialize LED driver */
BSP_LedsInit();
BSP_LedSet(0);
/* Infinite blink loop */
while (1)
{
BSP_LedToggle(0);
BSP_LedToggle(1);
Delay(1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment