/*
   main.c
   Main C source file
   Test for harware profiling

   History:
      11/03/2015 : First version
 */

#define HPROFILE  // Activate Hardware Profiling

#include "Base.h"           // Basic definitions
#include "hprofile.h"       // Hardware Profile Header file

// Function that blinks the Green LED
// Parameters: NONE
// Never returns
void ledBlink(void)
 {
 while(1) // Infinite loop
   {
   // Turn ON Green LED
   (LEDS_PORT->BSRR.H.set)=BIT(GREEN_LED_PAD);

   // Wait 200ms
   SLEEP_MS(200);

   // Turn OFF Green LED
   (LEDS_PORT->BSRR.H.clear)=BIT(GREEN_LED_PAD);

   // Wait 200ms
   SLEEP_MS(200);
   }
 }

int main(void)
 {
 // Global initializations
 baseInit();

 // Blink function
 ledBlink();

 // Infinite loop although it cannot be reached
 while (1) {};

 // Main should never return
 // This line is included so that the compiler doesn't complain
 return 0;
 }

