Tool/software: TI-RTOS
Hi,
I am trying to create an individual task in the simple_peripheral project. so I created two files called: blink.c and blink.h under Application folder, in my blink.c, I have:
#include <string.h> #include <ti/sysbios/knl/Task.h> #include <ti/sysbios/knl/Clock.h> #include <ti/sysbios/knl/Event.h> #include <ti/sysbios/knl/Queue.h> #include <ti/drivers/GPIO.h> #include "board.h" #include "blink.h" // Task configuration #define BLK_TASK_PRIORITY 1 #ifndef BLK_TASK_STACK_SIZE #define BLK_TASK_STACK_SIZE 128 #endif // Task configuration Task_Struct blkTask; Char blkTaskStack[BLK_TASK_STACK_SIZE]; static void blinkled_taskFxn(UArg a0, UArg a1); void blinkled_createTask(void) { Task_Params taskParams; // Configure task Task_Params_init(&taskParams); taskParams.stack = blkTaskStack; taskParams.stackSize = BLK_TASK_STACK_SIZE; taskParams.priority = BLK_TASK_PRIORITY; Task_construct(&blkTask, blinkled_taskFxn, &taskParams, NULL); } static void blinkled_taskFxn(UArg a0, UArg a1) { // Testing Codes GPIO_init(); GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_ON); }
and in blink.h, I have:
#ifndef BLINK_H #define BLINK_H #ifdef __cplusplus extern "C" { #endif extern void blinkled_createTask(void); /********************************************************************* *********************************************************************/ #ifdef __cplusplus } #endif #endif
basically, I just followed simple_peripheral.c kind of style. and in main.c, I call blinkled_createTask();, expecting this code would live in the project. but when I compile it, it thrown an error says:
error: symbol "blinkled_createTask" redeclared with incompatible type:
"int [ExplSign]()"
in "../Startup/main.c" at line 220 and:
"void()"
in "../Application/blink.c" at line 27)
any help would be great!