RTX51 and function calls

Hi all,

This is my second message on the issue to clarify the question.

From the documentation:

****************
Standart C51 functions must not be called simultaneously from several tasks or interrupt procedures. These functions store their parameters and local data in static memory segments; for this reason, this data is overwritten by a repetitive call.

In order to solve this problem, C51 provides reentrant functions. ..... Since RTX51 Tiny does not contaion any management for the reentrant stack, the round robin task switching must be disabled when reentrant functions are used. RTX51 Tiny can manage reentrant functions in the compact model.
****************

In the light of these, can I use reentrant functions with task switching in the compact model?

If I cannot use task switching with reentrant function, where is the multi-tasking property of RTX51? If round-robin task switching disabled, is a task switching performed when an os_wait() function is executed?

regards,

Parents
  • Which version do you have?

    Here is the text from the latest manual (v2.95):

    It is not allowed to call non-reentrant C functions from several tasks or interrupt proce-dures.
    Non-reentrant C51 functions store their parameters and automatic variables (local data) in static memory segments; for this reason, this data is overwritten when multiple function calls occur simultaneously. Therefore non-reentrant C functions can only be call for several tasks, if the user can ensure that they are not called recursive. Usally this means that the Round-Robin task scheduling must be disabled and that such functions do not call any RTX51 Tiny system functions.
    C functions which are only using registers for parameter and automatic variables are in-herently reentrant and can be called without any restrictions from different RTX51 Tiny
    tasks.
    The C51 Compiler provides also reentrant functions. Refer to the C51 User's Manual for more information. Reentrant functions store their parameters and local data variables on
    a reentrant stack and the data are protected in this way against multiple calls. However, RTX51 Tiny does not contain any management for the C51 reentrant stack. If you are using reentrant functions in your application you must ensure that these functions do not call any RTX51 Tiny system functions and that reentrant functions are not interrupted by the Round-Robin task scheduling of RTX51 Tiny. The full version, RTX51 Full contains a stack management for reentrant functions.


    dunno if that makes it any clearer!?

Reply
  • Which version do you have?

    Here is the text from the latest manual (v2.95):

    It is not allowed to call non-reentrant C functions from several tasks or interrupt proce-dures.
    Non-reentrant C51 functions store their parameters and automatic variables (local data) in static memory segments; for this reason, this data is overwritten when multiple function calls occur simultaneously. Therefore non-reentrant C functions can only be call for several tasks, if the user can ensure that they are not called recursive. Usally this means that the Round-Robin task scheduling must be disabled and that such functions do not call any RTX51 Tiny system functions.
    C functions which are only using registers for parameter and automatic variables are in-herently reentrant and can be called without any restrictions from different RTX51 Tiny
    tasks.
    The C51 Compiler provides also reentrant functions. Refer to the C51 User's Manual for more information. Reentrant functions store their parameters and local data variables on
    a reentrant stack and the data are protected in this way against multiple calls. However, RTX51 Tiny does not contain any management for the C51 reentrant stack. If you are using reentrant functions in your application you must ensure that these functions do not call any RTX51 Tiny system functions and that reentrant functions are not interrupted by the Round-Robin task scheduling of RTX51 Tiny. The full version, RTX51 Full contains a stack management for reentrant functions.


    dunno if that makes it any clearer!?

Children
More questions in this forum