Jump to content
Sign in to follow this  
Joel Bodenmann

FreeRTOS port

Recommended Posts

I am currently running uGFX (git download from 2014/07/31) with FreeRTOS (v7.3.0) on an Altera NiosII target platform (gcc v4.5.3) with a framebuffer display driver.

My problems were:

  • freertos.h files in src\gos\gos module conflicted the original FreeRTOS.h file. I renamed them to freertos_gfx.h/c
  • Missing type definitions in freertos_gfx.h such as, int8_t, uint8_t, etc. This might work on other platforms without modifications?
  • freertos_gfx.c: renamed portTICK_PERIOD_MS to portTICK_RATE_MS. Again, this might be a platform/port/version issue.

Share this post


Link to post
Share on other sites

Thank you very much for your feedback.

We are aware of the conflicting file names on a case insensitive operating system since a short while. The changes have been made but not yet tested and pushed. We will push a fix to the repository this evening (GTM+01:00).

About the definitions: Which FreeRTOS version are you using? We have tested with FreeRTOS 8.x without any problems so far. Neither did any user report a conflict there.

~ Tectu

Share this post


Link to post
Share on other sites

Thank you for the link. We'll take a look if it's possible to make the types conditional by reading out the FreeRTOS version (is there such a macro?) at compile time. We are doing the same to support ChibiOS/RT 2.x and 3.x in the same way.

~ Tectu

Share this post


Link to post
Share on other sites

Yes there is (defined in task.h)

Before FreeRTOS 8.x.x

#define tskKERNEL_VERSION_NUMBER "V7.3.0"

From FreeRTOS 8.x.x on


#define tskKERNEL_VERSION_NUMBER "V8.0.1"
#define tskKERNEL_VERSION_MAJOR 8
#define tskKERNEL_VERSION_MINOR 0
#define tskKERNEL_VERSION_BUILD 1

Share this post


Link to post
Share on other sites

Too bad that they don't have separate macros for each individual digit before 8.x.

I don't know FreeRTOS that well, what do you think about this?


#if tskKERNEL_VERSION_MAJOR == 8
/* Types for 8.x */
#else
/* Types for 7.x (and lower?) */

I assume taht this should work as the tskKERNEL_VERSION_MAJOR macro should not be implemented at all at any < 8.x release.

~ Tectu

Share this post


Link to post
Share on other sites
Too bad that they don't have separate macros for each individual digit before 8.x.


#if tskKERNEL_VERSION_MAJOR == 8
/* Types for 8.x */
#else
/* Types for 7.x (and lower?) */

I assume taht this should work as the tskKERNEL_VERSION_MAJOR macro should not be implemented at all at any < 8.x release.

~ Tectu

Are undefined preprocessor symbols handled consistently across compilers?

Defensive coding might suggest:


#ifdef tskKERNEL_VERSION_MAJOR
#if tskKERNEL_VERSION_MAJOR == 8
/* Types for 8.x */
#else
/* Types for 7.x (and lower?) */
#endif
#else
/* Types for 7.x (and lower?) */
#endif

Share this post


Link to post
Share on other sites

The c standard says that undefined macro variables if used in an expression will evaluate as 0.

Not all compilers always follow the rules though.

Try...

#if defined (var) && var == 8

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...