Other Parts Discussed in Thread: HALCOGEN
hello
i need help in Software Timer .
I am trying to use Software Timer with tms570ls0432 but I have a problem with Software Timer functions (xTimerCreate(), xTimerReset(),xTimerStop() etc.):
after calling xTimerCreate inside main func. causes the program stop runing there (xTimerCreate )and does not move to next line(xTimerStart) even thogh i have opened os timer in halcogen
#include "sys_common.h"
#include "system.h"
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include "FreeRTOS.h"
#include "os_task.h"
#include "os_timer.h"
#include "het.h"
#include "gio.h"
/* Define Task Handles */
xTaskHandle xTask1Handle,
xTask2Handle;
xTimerHandle xTimer1;
uint32 i = 0;
void vTimerFunction(xTimerHandle xTimer1)
{
// toggle port bits
gioToggleBit(hetPORT1, i);
i++;
if (i>31)
i=0;
// restart timer
xTimerReset(xTimer1, 0);
xTimerStop( xTimer1 ,0 );
}
void main(void)
{
/* USER CODE BEGIN (3) */
gioInit();
gioSetDirection(gioPORTA, 0xFFFFFFFF);
gioSetDirection(hetPORT1, 0xFFFFFFFF);
gioSetBit(gioPORTA, 2U, 1);
xTimer1 = xTimerCreate("Timer1", 500, pdTRUE, (void*) 0, vTimerFunction);
xTimerStart( xTimer1, 0 );
/* Start Scheduler */
vTaskStartScheduler();
while(1);
}
