Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

timers API from ISR version 7.3.0

GregK
2013-01-23
2013-09-16
  • GregK
    GregK
    2013-01-23

    HI

    I found inconsistent in API in timers and queue.

    Lets consider: xTimerStartFromISR()

    1. In documentation nothing about parameter portBASE_TYPE *pxHigherPriorityTaskWoken may be NULL
    2. the same situation in documentation xQueueSendFromISR() about portBASE_TYPE *pxHigherPriorityTaskWoken

    I do not remember why I use NULL in xQueueSendFromISR(queue,item, NULL) (was in documentation in past or simply I have brose source code what I should not?) if I do not want feature of "task woken".

    In similar method from timers when I browse source code, NULL is not supported! and it is ok, since it is not in documentation.

    Hewer why in xQueueSendFromISR() NULL is supported since is also not in documentation.

    PS.
    I wopuld prefer support NULL in both, since I do not use this feature and I would like to keep it simply.

     
  • Dave
    Dave
    2013-01-23

    Allowing the last parameter to be NULL was added in V7.2.0 (http://www.freertos.org/History.txt).

     
  • GregK
    GregK
    2013-01-23

    davedoors: Good.
    1. But is not explictly include in documentation: http://www.freertos.org/a00119.html
    and i so

    2. THERE IS A BUG in version 7.3.0

    API:
    xTimerStartFromISR(Timer,NULL);

    xTimerGenericCommand( ( Timer ), 0, ( xTaskGetTickCountFromISR() ), ( ((void *) 0) ), 0U )

    what is ok but implementation will call than API what is not allowed to use from ISR!!:

    xTimerGenericCommand()
    {
    (…)
    if( pxHigherPriorityTaskWoken == NULL )
    {
    if( xTaskGetSchedulerState() == taskSCHEDULER_RUNNING )
    {
    xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xBlockTime );
    }
           }

    and this is inconsistent  what I mentioned while open topic

     
  • Richard
    Richard
    2013-01-23

    Sorry - you say there is a bug, but I can't understand from your post what the bug is.

    Currently the timer API that can be used from an ISR cannot have its last parameter set to NULL, and I don't think anything in the documentation says it can.  The queue/semaphore implementation can set the parameter to NULL, but this is also not documented so I don't think people using the API documentation will be trying to do that yet.

    Are you reporting a bug in the timer implementation, or are you saying you can't use the interrupt safe timer API with pxHigherPriorityTaskWoken parameter set to NULL and you wish to do so (in which case it would be a feature request rather than bug report).

    Regards.

     
  • GregK
    GregK
    2013-01-23

    Richard:

    if what point davedoors is true:

    Allowing the last parameter to be NULL was added in V7.2.0 (http://www.freertos.org/History.txt).

    and quoting http://www.freertos.org/History.txt:

    + The last parameter in ISR safe FreeRTOS functions
      (xHigherPriorityTaskWoken) is now optional and can be set to NULL if it
      is not required.

    period.

    than is a bug because:

    1. this point do not refer to any specific module like, queue, timers or semaphores

    however is a history.txt a official documentation? I do not know… I guess not. Please do not feel offend.
    just my few thoughts of possibly inconsistent/bug depend on how to treat.

    Regards
    /Greg

     
  • Richard
    Richard
    2013-01-23

    Ok - now I understand.  I have updated the History.txt file, which now reads

    The last parameter in ISR safe FreeRTOS queue and semaphore functions
      (xHigherPriorityTaskWoken) is now optional and can be set to NULL if it
      is not required.

    Regards.