An Observation about Multiwii and an interface question

Post Reply
picstart
Posts: 10
Joined: Fri Aug 09, 2013 9:30 pm
Location: Florida USA

An Observation about Multiwii and an interface question

Post by picstart »

First this is remarkable code that makes my Quadp fly. Now to the "but.". Yes a newbie always has a "but" observation. Now a camel is perfect for the dessert but it is a bit ungainly...this is because it didn't originate in the dessert; it adapted to it. Multiwii has done well to adapt to all the different platforms and flight demands. It has done so with a heavy dose of #if #endif's. The ardruino IDE does not differentiate between active and inactive code blocks. This makes the code with the arduino IDE look ungainly.
The solution is the Eclipse IDE. There is an excellent tutorial in porting arduino to Eclipse. Sure it was a bit quirky with the avrdude on my win7 64 but mode com9 dtr=on ( my multiwii usb comport is 9) at the windows command line fixed it. Eclipse is code aware so it has the ability to grayout code within #if #endif blocks that aren't active due to the various #defines being set. This IMHO makes Eclipse essential to anyone beginning to understand the code let alone develop it. I suspect even the active developers are challenged..since commenting and uncommenting #defines often leads to functions being errorred as not defined in the scope at compile time. Ex uncommenting #define ESC_CALIB_CANNOT_FLY will cause blinkLED to be found out of scope.
A minor annoyance to fix for sure but symptomatic of a camel type adaption.
I'm a week or so into the code and I am assuming two things. The first is that excellent tweaks and new code will get added to multiwii and second I want to do some interesting ( to me ) things to the code. I don't want to get into the traffic. I'm guessing my solution is to use the annex call provided in the main loop and I2C. I2C gets data to and from my custom daughter board acting as a slave with a unique address and annexCode() manages my process with writes and reads to my I2C slave. Now if developers put essential to fly stuff in annex I get the being in traffic issue back albeit in a lesser form.
Is this the right solution or should I be using a unique to me routine that is called in the main loop?
info
I have a Crius AIOP 2560 5x5 board and it is convenient to piggy back a daughter 5x5 board using spacers and the JST I2C connector.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: An Observation about Multiwii and an interface question

Post by copterrichie »

Not sure if you are aware however, there is currently an effort to post the code over to Eclipse discussed here: viewtopic.php?f=8&t=2931

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: An Observation about Multiwii and an interface question

Post by Plüschi »

Me, i did try eclipse and i did hate it.

I dream about a tool taking in multiwii and producing multiwii ommitting ALL defines. Means i have a 32u4 ...
i only see the "#if promicro" part.

Sebbi
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany
Contact:

Re: An Observation about Multiwii and an interface question

Post by Sebbi »

The gcc "-E" option outputs just the code after the preprocessor ...

Post Reply