ClockP_usleep() for FreeRTOS calculates delay incorrectly

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • TI Device Drivers
    • TIDRIVERS-1441
    • 3.50.00
    • 3.60.00
    • Hide
      ClockP_usleep(usec) for FreeRTOS calculates the delay passed to vTaskDelay(), using portTICK_PERIOD_MS. This macro is defined in FreeRTOS/Source/portable///portmacro.h as:
      #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )

      If configTICK_RATE_HZ were ever set to a value > 1000, this would be 0. It is probably also better to use defines that are in FreeRTOSConfig.h.
      Instead, we could calculate the delay for ClockP_usleep(usec) as:

      tickPeriouUs = 1000000 / configTICK_RATE_HZ; /* Tick period in microseconds */
      delay = (usec + tickPeriodUs - 1) / tickPeriodUs; /* Take the ceiling */
      Show
      ClockP_usleep(usec) for FreeRTOS calculates the delay passed to vTaskDelay(), using portTICK_PERIOD_MS. This macro is defined in FreeRTOS/Source/portable///portmacro.h as: #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) If configTICK_RATE_HZ were ever set to a value > 1000, this would be 0. It is probably also better to use defines that are in FreeRTOSConfig.h. Instead, we could calculate the delay for ClockP_usleep(usec) as: tickPeriouUs = 1000000 / configTICK_RATE_HZ; /* Tick period in microseconds */ delay = (usec + tickPeriodUs - 1) / tickPeriodUs; /* Take the ceiling */

      ClockP_usleep() for FreeRTOS calculates delay incorrectly

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-1456 - ClockP_usleep() for FreeRTOS calcul...
                SYNCHRONIZED
                • Last Sync Date: