FreeRTOS on Atmega644

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
I just found out a port of FreeRTOS for the mcu I use: http://gonium.net/md/2008/08/10/... , http://gonium.net/media/freertos... ;
It compiles well and it works but... I want to use C++ code. I tried changing the CC variable to avr-g++ but it doesn't compile, first complaining about a cast, if I fix that, it complains about another cast in tasks.c ...
So I tried to go another way. I declared a variable CSRC where I enumerate the c files, CPPSRC, CC for c compiler, CPPC but it gives a linker error.
Can someone please point me in the right direction?

Nicu reSpawn.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess freertos is all c..... if you know c++, 'all you have to do' is edit every c syntax in every file that confuses the c++ compiler and you're golden.

Imagecraft compiler user

Last Edited: Tue. Mar 9, 2010 - 07:13 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought that I could compile every c file with gcc and every c++ file with g++ then link the resulted objects.

Nicu reSpawn.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought there was some 'feature' of c++ called 'name mangling' that made linking mangled and unmangled symbols tricky?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simplistic idea but simply rename all the .c source files to be .C files (which leads to the C++ rather than C compiler being invoked for them)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Where did you learn that tidbit? It bypassed me entirely.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Where did you learn that tidbit?

http://www.gnu.org/software/make...

(that is GNU make manual - it invokes the C++ compiler for .cc, .cpp and .C)