FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [January 2011 Threads] Incorrect definitiion on portmacro.h PIC24Posted by https://www.google.com/accounts on January 15, 2011 Hello everybody;
The define of portTICK_RATE_MS is wrong for PIC24 :
Original : #define portTICK_RATE_MS( ( portTickType ) 1000 / configTICK_RATE_HZ )
If configTICK_RATE_HZ == 100, so 100 TICKs per second, then portTICK_RATE_MS egal 10, and the real rate is 100 ms, not 1 ms ...
Correct version :
#if configTICK_RATE_HZ >= 1000 #define portTICK_RATE_MS( configTICK_RATE_HZ / 1000) #endif
Cordially.
RE: Incorrect definitiion on portmacro.h PIC24Posted by Richard on January 15, 2011 configTICK_RATE_HZ is not used in the kernel code anywhere. It is provided just for convenience, so you can change the tick rate without having to change all delay and block times. It is used extensively in the demo tasks.
To convert ms into ticks, you divide the ms value by configTICK_RATE_HZ (provided the tick rate is equal to or slower than 1KHz).
If you want to block for 1 second, then you want to block for 1000ms. If your tick rate is 100Hz, you want to block for 100 ticks. In this case, with the definition as it stands, portTICK_RATE_MS would be 1000 / 100 = 10. Converting 1 second (1000ms) into ticks would be 1000ms / configTICK_RATE_HZ == 1000 / 100 == 10 == the right answer.
Regards.
RE: Incorrect definitiion on portmacro.h PIC24Posted by Richard on January 15, 2011 Correction: “To convert ms into ticks, you divide the ms value by configTICK_RATE_HZ (provided the tick rate is equal to or slower than 1KHz)” should have read “To convert ms into ticks, you divide the ms value by configTICK_RATE_MS (provided the tick rate is equal to or slower than 1KHz)” Regards.
RE: Incorrect definitiion on portmacro.h PIC24Posted by MEdwards on January 15, 2011 You can see that the macro name is confusing. Its the same for all ports though.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|