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] [December 2007 Threads] __inline, ARM7 and IAR compilerPosted by mike on December 11, 2007 Hello All
I am using the IAR ewarm (4.42a) with freeRTOS 4.5.0 at present, and am looking into using some __inline functions.
I find that portmacro.h for the IAR compiler and at91sam7s includes #define inline in Compiler specifics, so that I still don't get inlining even with #define __inline inline added.
If I comment out the #define in portmacros.h the compiler objects to two basic functions:vTaskSwitchContext and vTaskIncrementSwitch, both apparently because they are declared as __inline in the header file, and defined in the source file the same way, which the IAR compiler doesn't seem able to cope with.
To keep rolling on I have commented out the __inline tags, but this doesn't seem the correct way forward.
Do these functions need to be __inline? Is inlining significant in gaining speed of operation?
Any thoughts welcomed
Mike Newsome
Hitek Power Ltd, England
RE: __inline, ARM7 and IAR compilerPosted by Richard on December 11, 2007 The inline thing is a legacy from one of the first ports and is a PITA now. It should be removed.
The #define in portmacro.h is to prevent the problem you are finding when you comment it out. The order in which the include files are listed should be such that the #define does not effect other include files (it comes after), but will your own code. The library files provided by atmel make heavy use of inlines, but these should work correctly the way things are at the moment.
Regards.
RE: __inline, ARM7 and IAR compilerPosted by mike on December 11, 2007 Thanks, Richard
I wanted to make use if a bit of inlining for speed, and was starting to play around with it.
I have commented out the bits in question while I play, and will decide later!
While I understand the concept of in line code, it seems that IAR at least _may_ not inline it, and in this case would put a copy of the function in every module that calls it!
There is also a #pragma inline, but I feel the keyword is more useful - it can be #defined away!
Many thanks
Mike Newsome
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|