#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "ti/platform/platform.h"
#include "ti/platform/resource_mgr.h"

extern void MulticoreBoot();

int main()
{
	int coreId = 0;
	coreId = platform_get_coreid ();

	MulticoreBoot();

	if (coreId == 0)
    {

    	platform_led(0, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
    	platform_led(1, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
    	platform_led(2, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
    	platform_led(3, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);


		while (1)
		{
			(void) platform_led(0, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
			(void) platform_delay(1000000);
			(void) platform_led(0, PLATFORM_LED_ON, PLATFORM_USER_LED_CLASS);
			(void) platform_delay(1000000);

		};
    }
    else if(coreId < 4)
    {
    	int i;
    	for(i = 0;i < coreId * 5;i++)
    	{
    	   (void) platform_delay(1000000);
    	}

    	while (1)
    	{
    		(void) platform_led(coreId, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
    		(void) platform_delay(1000000);
    		(void) platform_led(coreId, PLATFORM_LED_ON, PLATFORM_USER_LED_CLASS);
    		(void) platform_delay(1000000);

    	}
    }
    else
    {
    	while(1)
    	{
    		coreId = coreId;//do noting
    	}
    }
}


