I had tried to define a task like an extern so I could split my task in several files, but it doesnt works I dont know if I can define a task like external.
for exemple:
extern __task void tick_timer (void);
gives me error.
when I try this with others normal functions it works...so its not a problem of files or a thing like that
Thanks
Gabriel
Ok it was a misunderstanding I wanted to put several tasks in several files so its not a task in many pieces.... Its a good Idea to make calling to external fonctions but I wanted to know if I can make that directly, so thanks for the answer.....
I think I'm going to make calls to external functions
This builds just fine: main.c
#include <RTL.h> extern __task void task2 (void); OS_TID id2; __task void task1 (void) { id2 = os_tsk_create (task2, 1); for (;;) { os_evt_set (0x0004, id2); os_dly_wait (5); } } int main (void) { os_sys_init (task1); }
external.c
#include <RTL.h> __task void task2 (void) { for (;;) { os_evt_wait_or (0x0004, 0xffff); } }
Thanks I can see my error now.. I've had a preprocesor symbol "RTX_KERNEL" not defined so It was for that that it wasn't working...
#ifdef RTX_KERNEL
/* Forward references */ __task void init (void); __task void tick_timer (void); __task void tache_display(void); __task void tache_spi (void); __task void send_data (void); __task void send_data2 (void); __task void send_data3 (void); extern __task void flash_table (void); #endif
You can use uVision internal RTX switch instead of your own:
#ifdef __RTX // Options for Target - Operating system - RTX Kernel #else // Options for Target - Operating system - None #endif