#include <ctl_api.h>

CTL_TASK_t main_task, new_task;

#define STACKSIZE 64          
unsigned new_task_stack[STACKSIZE];

void 
new_task_code(void *p)
{  
  unsigned int v=0;
  while (1)
    {      
      // task logic goes here      
      v++;
    }  
}

void
ctl_handle_error(CTL_ERROR_CODE_t e)
{
  while (1);
}

int main(void)
{
  unsigned int v=0;
  ctl_task_init(&main_task, 0, "main");
  ctl_task_run(&new_task, 1, new_task_code, 0, "new_task", sizeof(new_task_stack)/sizeof(unsigned), new_task_stack);
  // start_timer();
  while (1)
    {    
      // power down can go here if supported      
      v++;
    }
  return 0;
}
