Page 1 of 1

ChibiOS/GFX C++

Posted: Sun Jan 27, 2013 10:59 pm
by Tectu
Hello folks,

Lately I was doing a lot of work using C++. I did came across several advanced C++ concepts and design patterns. At some points, I nearly started to cry. Many problems and many lines of code could have been saved by using C++ instead of C for ChibiOS/GFX.
Since many threads and discussions about ChibiOS/RT together with C++ have been pop'd up, I'm asking myself if people would be intersted in a C++ based ChibiOS/GFX? No features would be missing, the current state would just be completely ported and adding new features at the current level (GUI and stuff) would be quite a lot easier.

What do you think? Please tell us your thoughts.


~ Tectu

Re: ChibiOS/GFX C++

Posted: Mon Jan 28, 2013 9:24 am
by tecnologic
hi Tectu,

a C++ port of GFX would be a great thing for me. I am just looking at optimisation of the ChibiosRT C++ wrapper to get more benefits from C++.
http://www.stf12.org/developers/FreeRTOS_EC.html mainly i want to try something more like this FreeRTOS wrapper. To encasule the Task management from the Users line of sight.

But i have to say right now i am in exam trouble, but when i have the time this would be my way.

Greetings

Tec

Re: ChibiOS/GFX C++

Posted: Mon Jan 28, 2013 3:55 pm
by Tectu
Bha! Don't tell me anything about exam trouble! :D

I lack the experience to know how much time it will take and how much trouble it will make to rewrite the library in C++.
I am mostly just not sure if people wouldn't use it anymore. Personally, I am not a bit interested in having a C and a C++ library archiving the same.


~ Tectu

P.S. Stop stealing my second signature! :mrgreen:

Re: ChibiOS/GFX C++

Posted: Mon Jan 28, 2013 4:19 pm
by tecnologic
HI Tectu,

i to would not want to maintain both versions. What about a Wrapper for a set of high level C++ functions. I know its not as elegant as C++ from bottom up.
For my actual project based on STM32F4 i wrote a C++ Graphics interface for my 1Bit Graphic displays, and i loved the modularity of it. But it was an big effort to write the graphic functions, and then i looked at GFX and it gives my a lot of benefit, the only trade of is that i only hab 1Bit color but a fix in the low level Driver will be the solution.

So i think u have Gwen nearly in C++, when you now wrap the rest in C++ its elegant and you have less efford to maintain the code. and only the highlevel windowing is in C++
and with µCLibc++ u have a mostly full C++ for ARM controllers.

Greetings

TecNoLogic

P.S.: :D just read ur ps, have not thought about it :)

Re: ChibiOS/GFX C++

Posted: Sun Feb 03, 2013 12:36 pm
by Tectu
What exactly do you mean by wrapper instead of rewrite from ground up? You know that the library is already fully usable with C++ code? All the functions are wrapped in the #ifdef __cplusplu macro.


~ Tectu


P.S. Don't worry about the signature at all. It was more a kind of a joke. I used it back a few years ;-)

Re: ChibiOS/GFX C++

Posted: Mon Feb 04, 2013 9:30 am
by mabl
I am also using C++ with ChibiOS. I guess the main problem is to know what you should do, and what not ^^. I've never used uClibc++.

One of the important things when using C++ is to suppress all the useless stuff. I typically go with "-fno-rtti -fno-exceptions -fno-unwind-tables -std=c++11".

@tecnologic: Are you using the new wrapper? If so, I'd be very interested in your changes. I've since rewritten the memory pool without any void pointers and using placement new.

Re: ChibiOS/GFX C++

Posted: Mon Feb 04, 2013 2:25 pm
by tecnologic
Hi mabl,

i am porting the ManagedTasks Class from FreeRTOS Enhanced Class to Chibi, cause i like the way of using it. when i am done, i think off ne next week then i will post the code here. I also forked your Chibi mirror on github unter this username and i will publish the changes there.

Right now i think of this Class as an addon, in inherits BaseThread i think.

Greets

Tec Nologic :)

Re: ChibiOS/GFX C++

Posted: Mon Feb 04, 2013 3:53 pm
by Tectu
tecnologic wrote:Tec Nologic :)

I hope you can sleep well, man :D


~ Tectu