
#include "globals.h"

										 /* Reserve 500 32-bit words for use as message memory pool */


OS_TID idLED_Task;                       /* assigned task id of task: LED_Task    */
OS_TID idButton_Task;                    /* assigned task id of task: Button_Task */
OS_TID idADC_Calc_Task;                  /* assigned task id of task: idADC_Calc_Task */
OS_TID idADC_Sample_Task;


/*----------------------------------------------------------------------------
 *        Task 'init': Initialize
 *---------------------------------------------------------------------------*/
__task void init (void) {
    _init_box	(xxx, xxx(mpoolCom), xxx);		  // Initialize a memory box called mpoolCom with a size of mpoolCom
														  // 125 is the size of the message, so the memory pool in this example
														  // can hold 4 messages of sixe 125

    idLED_Task        = os_tsk_create (LED_Task, 20);	          /* create instance of task: LED_Task       */
    idButton_Task     = os_tsk_create (Button_Task, 30);	      /* create instance of task: Button_Task    */
	//idADC_Calc_Task   = os_tsk_create (ADC_Calc_Task, 1);    	  /* create instance of task: ADC_Calc_Task  */
    //idADC_Sample_Task = os_tsk_create (ADC_Sample_Task, 50);	  /* create instance of task: ADC_Sample_Task*/
														 

    os_tsk_delete_self ();							      /* remove instance of task: init           */
}

/*----------------------------------------------------------------------------
 *        Main: Initialize and start RTX Kernel
 *---------------------------------------------------------------------------*/
int main (void) {

    InitHAL   ();                             /* initialize clocks             */
    InitGPIO  ();							  /* initialize GPIO               */
    InitSerial();							  /* initialize Serial             */

    os_sys_init (init);                       /* Initialize RTX and start init */
}

/*----------------------------------------------------------------------------
 * end of file
 *---------------------------------------------------------------------------*/

