01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1. Timer procedures must be implemented as short as possible, because they are executed in the<br />

Kernel task. Large timer procedures are blocking the kernel and other tasks of the <strong>@CHIP</strong>-<br />

<strong>RTOS</strong>. Do not use large Clib functions like printf inside of a timer procedure. This can cause<br />

a fatal stack overflow in the kernel task (stack size 1024 Bytes)<br />

2. Declaring of timer procedures with Borland C:<br />

void huge my_timer(void)<br />

3. Microsoft C:<br />

void far _saveregs _loadds my_timer(void)<br />

4. Turbo Pascal:<br />

procedure Timer1_Proc;interrupt;<br />

begin<br />

[... your code ...]<br />

(************************************************)<br />

(* This is needed at the end of the Timer Proc. *)<br />

asm<br />

POP BP<br />

POP ES<br />

POP DS<br />

POP DI<br />

POP SI<br />

POP DX<br />

POP CX<br />

POP BX<br />

POP AX<br />

RETF<br />

end;<br />

(************************************************)<br />

end;<br />

5. DOS applications are running as a task of the <strong>@CHIP</strong>-<strong>RTOS</strong> with a default priority of 25. If the<br />

users application doesn't go to sleep, lower priority tasks like the FTP server or the Web server<br />

will not work. In major loops within user applications, the programmer should insert sleep calls if<br />

the FTP server or Web server should work during the runtime of the user application.<br />

6. The stack of a task created inside of a DOS application should have a minimum stack size of<br />

1024 Bytes. Programmers of task functions who are using Microsoft C-Compilers with C-Library<br />

functions, e.g. sprintf, which requires a lot of stack space should increase this allocation to<br />

6144 (6 Kbytes). More stack space for the task is also required if your task function uses a large<br />

amount of stack for automatic data (local variables) declared inside the task function call.<br />

7. Declaring of task functions with Borland C:<br />

void huge my_task(void)<br />

8. Declaring of task functions with Microsoft C:<br />

void far _saveregs _loadds my_task(void)<br />

9. Before exiting an application, every task or timer procedure created inside of this application<br />

program must be removed.<br />

10. A sleep call with parameter 1 millisecond takes equal or less than one millisecond. If a user<br />

needs a minimal sleep time of 1 millisecond then RTX_SLEEP_TIME must be called with value 2<br />

milliseconds.<br />

11. It is possible to create tasks with a time slicing value in the taskdefblock structure.. Please<br />

note that the kernel executes time slicing only between tasks which have same priority. Other<br />

priority tasks are not affected.<br />

Page 7 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!