Reorganising source *.c code with *.h headers; Eclipse IDE

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by timecop »

No, you should add it only to .cpp files that actually use it. There's no reason to expose this variable to everything else.

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

and 5 & 6 (with the help of the indexer ;)

manu
PS: sebbi? how to go further with this reorganization?

COPTERTEST=5
Device: atmega328p
Program: 25528 bytes (77.9% Full)
(.text + .data + .bootloader)
Data: 1709 bytes (83.4% Full)
(.data + .bss + .noinit)
*Arduino-1.0.2: 25528 bytes (out of 28672 bytes)

COPTERTEST=6
Device: atmega328p
Program: 25296 bytes (77.2% Full)
(.text + .data + .bootloader)
Data: 1462 bytes (71.4% Full)
(.data + .bss + .noinit)
*Arduino-1.0.2: 25296 bytes (out of 28672 bytes)

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by timecop »

Make a patch and post it. Me and others can review

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

Like this, i suppose you need the sources too?
Attachments
cpp-reorg-patch-coptertest-4to6.zip
(41.6 KiB) Downloaded 157 times

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

The sources, i didn't reviewed the func() without "void" made by "casquad" as you suggested, the ones i added, i did.
manu
Attachments
MultiWii.zip
(243.08 KiB) Downloaded 155 times

casquad
Posts: 29
Joined: Fri Jun 14, 2013 5:41 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by casquad »

Which version of avr-g++ is included in Arduino IDE 1.0.2? Looks like IDE 1.0.5 produces more optimized code...

Which version of avr-g++ is used in sebbi building system?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by timecop »

alll wrote:Like this, i suppose you need the sources too?


nice start.
you did something with config.h, so most of the patch is just renaming that to CONFIG_CLEAN or something.
You can select which files get included in the patch or not in tortoisesvn GUI.

I think the (void) + coptertest stuff should be committed asap before further cleanups commence.

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

Hi!
@casquad : Optimized on what, size? I get the same size for both!

Yes i used "CONFIG_CLEAN" as the original untouched config (except for COPTERTEST define), otherwise i make copies of it and name them to be used for specific copters/boards.
So here i use config.h to "route" them to the correct "config" file.

Yes, if casquad can asap commit and merge? ;) so that we can further oficially continue with this reorganized MultiWii.

Thanks,
manu

casquad
Posts: 29
Joined: Fri Jun 14, 2013 5:41 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by casquad »

Hello everybody,

Please do not take this the wrong way, but I do not want to become the secretary of anybody. I mean, I can commit a patch this time with pleasure, but as I said in another post, all developers should be free to commit their contributions at least to the experimental branch. We all are adults and we know what we must or must not do. With svn, if someone makes a mistake we can detect it and fix it easily, and working in different branches guarantees that nobody can break the official code. Let's say, If I were on vacations and nobody commited the patch, cpp migration would be stopped. From my point of view, this is a potential risk for the project.

I would suggest that all developers who are interested in mirating the code to cpp raise their hands now in this thread so svn maintainer can give them access at least to the cpp migration branch. Is this ok for everybody?

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

casquad wrote:I would suggest that all developers who are interested in mirating the code to cpp raise their hands now in this thread so svn maintainer can give them access at least to the cpp migration branch. Is this ok for everybody?


Keep in mind that Google Code does not support assigning user permissions by branch. It's all or nothing.

I would of course like to participate, but I also understand if the project owners would like to maintain whatever level of control they prefer. I noticed a couple of silly things the other day (like the type name "pid_") and I would have just fixed them, given the opportunity.

If I did have the ability to commit, I would prefer to make my own branch to keep track of my own experimental code, merge out changes periodically and occasionally merge back what the community felt was valuable, if anything. I prefer to work with a repository behind my local workspace just so I can easily keep track of my work across multiple systems and protect myself against data loss (usually due to silly mistakes).

casquad
Posts: 29
Joined: Fri Jun 14, 2013 5:41 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by casquad »

Ok, I did not know that GoogleCode worked that way. Let's go as you usually do, then. I just thought the other way would be easier to maintain.

The problem is that I do not know if I will be able to maintain the cpp migration branch properly updated (you know, I've got a job, friends, familiy...). Would anyone volunteer to help me with this task?

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

Mmmm, :roll:

So, if i understand it, or Alex is going to abondon the *.ino and move to *.c / *.h style asap, i hope so, that was on his whish list :mrgreen: , or "we" keep a separate branch that we try to keep up to date with the "trunk" branche?

IMO there are no arguments anymore to stay with the *.ino style.

I hope this reorganisation was not a waste of time. :!:

manu
PS: casquad, i can "help" if you like, but it is not clear yet how.

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

timecop wrote:
alll wrote:Like this, i suppose you need the sources too?


nice start.
you did something with config.h, so most of the patch is just renaming that to CONFIG_CLEAN or something.
You can select which files get included in the patch or not in tortoisesvn GUI.

I think the (void) + coptertest stuff should be committed asap before further cleanups commence.


Here's alll's patch, but without the extra text files and the config changes. All six COPTERTESTs compile on my system with these changes.

I would be happy to commit these against the branch, if I had commit privileges.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by timecop »

You forgot to attach it.

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

Oops. I uploaded it as a .patch file and didn't notice the friendly message saying it isn't allowed.

Here it is again, for the first time.
Attachments
cpp-reorg-patch-coptertest-4to6-no-config.zip
(5.71 KiB) Downloaded 140 times

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

Hi,
Checked out CPP, applied the patch and all 6 coptertests do pass the compilation in both Eclipse and Arduino IDE's.
Sad that Alex is on vacation i think, somebody else can apply it in the main trunck?
thanks,
manu

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

Looks like casquad applied it to the cpp migration branch. Thank you, sir.

If Alex, indeed, wants this to go to trunk at some point, it seems like there should be some amount of testing/verification. Is there a standard procedure, or has this historically been done ad-hoc?

casquad
Posts: 29
Joined: Fri Jun 14, 2013 5:41 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by casquad »

Ok, I have commited the Eclipse project into the svn. There are actually two Eclipse projects: one for building the Arduino library and the other to build the MultiWii binary.

I will share a tutorial about how to work with Eclipse when I have the chance. By now, you just need to install Eclipse with AVR and SVN plugins, add the repository url and checkout the two projects: Arduino + MultiWii_shared. You must do it from within Eclipse (under SVN view) and it will take care of everything. All you have to do is choose a build configuration (there are seven at this moment, taken from Arduino IDE 1.0.5. This configuration depends on which kind of hardware you own) and compile.

Thanks to Alll and Clough42 for fixing the coptests 4, 5 and 6. It also would be really nice if someone with a flying device could test that the migration has not side effects on runtime.

If you need any help do not hesitate to ask.

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

THANKS "Cas"!
which eclipse SVN plugin (clients) do you use (i saw there are many)? (i use Tortoise for windows)

I don't see there could be a side effect due to the reorganization!I checked the generated binaries and are both equal in size, the logic didn't change!

Come on, try to convince the "commiters" to go for it, you are a professional, and your arguments will weight more as mine.

manu
PS: if there is interest i can show you how to use the "Arduino eclipse plugin", then you have all the boards (hardware) ready available.

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

I have used the Subclipse SVN plugin for years at work, so that's what I recommend.

I have the ported code running on a Crius MultiWii Lite 1.0 in an airplane. I haven't tuned and flown it yet, but it's talking over Bluetooth, and the control loop appears to be functioning correctly.

casquad
Posts: 29
Joined: Fri Jun 14, 2013 5:41 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by casquad »

I have written a quick tutorial about how to setup a MultiWii development environment with Eclipse, but I cannot post it here because file is too big (there are some screenshots in the document). If someone is interested, please send me a PM with your email and I will send it to you.

I do not know if project owners are willing to move the main development to cpp/h or keep the traditional ino files. Anyway, I will continue maintaining this branch (as far as I can).

I cannot wait to receive my board and start playing around! :-)

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

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by copterrichie »

If you have an account on Google, you can post it on Drive and grant access to the document or make it public.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by timecop »

bumping this before it gets too outdated.

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

timecop wrote:bumping this before it gets too outdated.


Mmmm, too late ?

I saw Revision r1501, I really hope we could move to the new reorganized cpp/h structure. As i see it going, to get the cpp-branch in sync, we will have to do it manually, and apply diffs based on r1474? :cry:

manu

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

alll wrote:
timecop wrote:bumping this before it gets too outdated.


Mmmm, too late ?

I saw Revision r1501, I really hope we could move to the new reorganized cpp/h structure. As i see it going, to get the cpp-branch in sync, we will have to do it manually, and apply diffs based on r1474? :cry:

manu


I took a crack at merging r1501, r1502 and r1503 into the CPP migration branch, and it appears that SVN isn't going to help us. It can't apply merges across the file renames, so it's probably going to be a hand operation. Maybe I'll try creating individual file patches and applying them manually.

When do we anticipate Alex re-engaging in the conversation about migrating this to trunk?

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by felixrising »

It's important to remember this is a big change. Big changes take lots of time and lots of patience. As such, there will have to be parallel streams for a while whilst all the core devs re-tool and get comfortable with it. Think long haul here...

btw, Alex is on holidays at the moment..

casquad kindly shared the document with me, which I've attached here. I would like to update it, but am perhaps not the most qualified to do so.. still, lets get it onto the wiki and keep on hammering away at this...

MultiWii - Eclipse by casquad v1

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

Here is a patch that applies Hamburger's recent yaw PID trunk changes (r1501, 1502, 1503) to the CppMigration branch. This should bring it up to date. Could someone apply this to the branch?

There are two versions of the patch in the ZIP. One was generated out of Eclipse using Subclipse and the other usingTortoiseSVN. They contain the same changes; you can use either one.

I tried a number of different tricks in SVN (renaming files, disabling pre-merge checks and ignoring ancestry) to try to get the changes merged automatically, but to no avail. So I merged the changes by hand.

All six coptertests compile in Eclipse with these changes. I also test-compiled for an Airplane model with the new YAW PID algorithm selected and it worked. I didn't have a chance to fly it or test in the Arduino IDE, but I will be surprised if there are issues.

I'm in a coffee shop right now that appears to be blocking SVN access, so I'm unable to test any further right now.
Attachments
MultiWii-MergeFromTrunk-1501-1502-1503.zip
Patch containing Hamburger's trunk changes (1501, 1502, 1503)
(6.75 KiB) Downloaded 132 times

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

Kiss, kiss, kiss,
Many thanks for keeping the CPP branch up to date,
manu

User avatar
elf128
Posts: 11
Joined: Sun Jun 23, 2013 8:35 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by elf128 »

Guys. This is awesome!
I'm new here, but getting rid of ino-nonsence was my first though since I open sources. What a surprise was to found this thread. Thank you!

I have couple of questions.
First of all, why are some of you rising the question about keeping code C compatible? This code isn't C compatible by definition:
GPS.ino:#33

Code: Select all

class LeadFilter {
public:
    LeadFilter() :
        _last_velocity(0) {
    }

    // setup min and max radio values in CLI
    int32_t         get_position(int32_t pos, int16_t vel, float lag_in_seconds = 1.0);
    void            clear() { _last_velocity = 0; }

private:
    int16_t         _last_velocity;

};

User avatar
elf128
Posts: 11
Joined: Sun Jun 23, 2013 8:35 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by elf128 »

Second question. Are you guys integrating one way only? I mean, development is only in INO branch and you integrating those changes into CppMigration banch, right? Nobody are doing development in CPP. And nobody are integrating changes back to INO. Am I right?
I'm asking, because I'm adding new type of copter and as far as I understand, there is no point to do it in Cpp so far ( which is unfortunate, BTW ) cause changes in Cpp will never get to main branch.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by timecop »

elf128 wrote:Guys. This is awesome!
I'm new here, but getting rid of ino-nonsence was my first though since I open sources. What a surprise was to found this thread. Thank you!

I have couple of questions.
First of all, why are some of you rising the question about keeping code C compatible? This code isn't C compatible by definition:
GPS.ino:#33


There's always been C++ garbage in gps.ino which eventually gets translated to C before final release.
Thats just crap that has been copied from tarducopter.

And noone is doing development on C branch because people would rather dick with useless shit.
Can we just move this as standard and stop ino jokes. Thanks!

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

elf128 wrote:Second question. Are you guys integrating one way only? I mean, development is only in INO branch and you integrating those changes into CppMigration banch, right? Nobody are doing development in CPP. And nobody are integrating changes back to INO. Am I right?
I'm asking, because I'm adding new type of copter and as far as I understand, there is no point to do it in Cpp so far ( which is unfortunate, BTW ) cause changes in Cpp will never get to main branch.


The .cpp/.h migration is a new effort that just got traction in the last week or so. Many people have been thinking about it for a while, and we just developed critical mass to make the port happen.

There are several folks who would like to see the .cpp/.h version become the main line of development, and Alex has indicated that he is generally supportive, assuming the Arduino IDE still works well and the code size doesn't increase. The conversation about moving the code to the trunk is on hold right now because Alex is on vacation. I expect that when he returns we will continue discussing what can happen and when.

In the mean time, those of us who want to see this transition happen are maintaining the branch. I ported Hamburger's yaw algorithm changes and posted them here a couple of days ago, but I do not have commit rights to the repo, so I'm patiently waiting for someone to commit them. (hint, hint) I've got some more Eclipse project setup stuff in the works as well, but I'm kind of stuck waiting for someone to commit the patch.

As for new development, at this time I think your best bet is to submit the changes to trunk and then port them (or convince one of us to port them) to the branch. If you want to see the transition to .cpp/.h happen, I think your best move is to help keep the branches in sync. That will make switching over to the branch at some point a much easier process.

casquad
Posts: 29
Joined: Fri Jun 14, 2013 5:41 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by casquad »

Hello, I have been out of combat for a while because I have moved to a new house and you know, lot of work to do... I will check the patches and apply them. I also detected that the automatic merge is not so easy because of file renaming. I will try to find out a workaround in svn, but looks like we will have to merge manually.

BradQuick2
Posts: 6
Joined: Wed Apr 17, 2013 1:03 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by BradQuick2 »

Hello all.

I just released my code from a somewhat similar project:

http://www.rcgroups.com/forums/showthread.php?t=1922403

It's based on some multiwii ideas, but it's pretty much a complete re-write. It's all done with .c and .h files. I do the development in Xcode on a Mac. I'm sure it would adapt to eclipse quite easily. For distribution, I just copy all of the files into one folder and rename the main file to a .ino and arduino is happy to compile it.

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

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by copterrichie »

I have not flown the BradWii yet but it compiled right up using the Arduino 1.0.5 on my Mac OSX 10.8. I am having a few problems getting it to compile on my Linux machine most likely because I have other Libraries installed. Going to do a fresh install there and retest. Next I will try importing BradWii into Eclipse.

The BradWii is almost a TOTAL Rewrite of the code but is a very good example to follow if the current code base is maintained.

http://www.rcgroups.com/forums/showthread.php?t=1922403

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

I just committed changes to the branch to bring it up-to-date with the trunk. This includes the patch I had posted previously in the forum as well as new merges of everything up through r1506.

Most of the changes were to files that were not renamed, so I was able to merge normally. I also performed a record-only merge of 1501, 1502 and 1503 to avoid future confusion.

All six COPTERTESTs compile in the Arduino IDE.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by Alexinparis »

Hi,

I do not know if project owners are willing to move the main development to cpp/h or keep the traditional ino files. Anyway, I will continue maintaining this branch (as far as I can).

And noone is doing development on C branch because people would rather dick with useless shit.
Can we just move this as standard and stop ino jokes. Thanks!

I remind this topic:
viewtopic.php?f=8&t=3213
So be sure it will be included.

When do we anticipate Alex re-engaging in the conversation about migrating this to trunk?

as soon as I can.
now, I can because I'm back from a huge USA trip ;)

Second question. Are you guys integrating one way only? I mean, development is only in INO branch and you integrating those changes into CppMigration banch, right? Nobody are doing development in CPP. And nobody are integrating changes back to INO. Am I right?

There is no plan to support both ino + cpp/h for a long time.
The plan is clearly to move to cpp/h and maintain only this one.
There will be a remaining .ino file to maintain Arduino IDE compatibility, that's all. (but as many mentioned, I consider also it as mandatory)

And thanks to all of you I think the transition phase is now nearly over.
All six COPTERTESTs compile in the Arduino IDE.

This is what I consider as a threshold to move for cpp/h.
There is still a little flash size increase (less than 200 bytes) which we should explain precisely (non inline functions abroad .o is the only root cause ?) but that's not a blocking point.

So what next:
1) I will create a last .ino zip
2) files in MultiWii_shared will be deleted and replaced by MultiWii_shared files of the CppMigration branch (excluding eclipse files)

I need some advice on 2): in order to keep track on .ino file, it might be better to first rename .ino -> .c files and then replace the files ?

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by alll »

The "boss" is back!

You are welcome to temper the minds down, i feel we are on the right track finally.
Thanks,
Manu

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

Alexinparis wrote:)

I need some advice on 2): in order to keep track on .ino file, it might be better to first rename .ino -> .c files and then replace the files ?


I don't think you'll ever be able to merge across the file rename boundary, but SVN will at least retain history if you rename the files first, then copy in the new data, add the new files and commit. That will retain the history on the trunk, and show the conversion as one commit. The history on the branch won't be linked up, but it's mostly just merges from trunk anyway.

Anyone with changes on other branches will be inconvenienced. Not really any way to help that.

We must be sure everything from trunk is merged first. I've been trying to keep it up to date.

If you would like me to move the files around in SVN, just let me know. I'd be happy to help in any way I can.

Once it's moved, we can set up Eclipse projects in a parallel directory to keep them out of the main source dir. Heck...we could probably even get it going in Visual Studio. :)

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

(Double post; thanks Tapatalk!)

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by Alexinparis »

clough42 wrote:We must be sure everything from trunk is merged first. I've been trying to keep it up to date.

If you would like me to move the files around in SVN, just let me know. I'd be happy to help in any way I can.

Once it's moved, we can set up Eclipse projects in a parallel directory to keep them out of the main source dir. Heck...we could probably even get it going in Visual Studio. :)


I've just uploaded a snapshot zip based on the current r1514.

So if you want to move the files in the trunk _shared, it's now ok, you can do it ;)
If you want also to maintain beside a branch for eclipse or another IDE, no problem.

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

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by Sebbi »

This is the chance to clean up the "trunk" directory ... let's get rid of _shared and just use "MultiWii" and "MultiWiiConf". Other versions are branches or tags, but shouldn't be maintained in trunk ;-)

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

Sebbi wrote:This is the chance to clean up the "trunk" directory ... let's get rid of _shared and just use "MultiWii" and "MultiWiiConf". Other versions are branches or tags, but shouldn't be maintained in trunk ;-)


I would like to see this happen, also, but it is up to Alex if he would like it done that way.

I'm getting ready to move everything to trunk right now, but I'm just going to take it to the _shared directories for now. If Alex agrees, we can later delete Multiwii and MutiWiiConf and rename the _shared directories. Doing it that way will maintain history on the files.

Note that per Alex's request, I won't be putting the Eclipse project files into the MultiWii_shared directory. Alex would like to keep the source directory clean and not tie it to one particular IDE. We'll have to set up a parallel directory with an Eclipse project. Hopefully I can get around to that later tonight.

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

The .cpp/.h files are now on the trunk in MultiWii_shared. All six COPTERTESTs compile in the Arduino IDE.

There are no provisions on the trunk for Eclipse files at this time. I'll work on that later tonight.

User avatar
clough42
Posts: 70
Joined: Sat Dec 08, 2012 6:10 pm
Location: Boise, Idaho

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by clough42 »

I have a prototype of a turnkey Eclipse workspace checked in on a branch. This is based on casquad's fine work on the CppMigration branch, but reorganized to keep the project files separated from the code, as requested by Alex.

I started a new thread to discuss it here: http://www.multiwii.com/forum/viewtopic.php?f=8&t=3775

User avatar
mgros
Posts: 90
Joined: Thu Jan 20, 2011 12:32 am

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by mgros »

I'm not an expert but i have had some problems to compile
an HEX6X, with GIMBAL (SERVO_TILT)
in a MEGA 2560
GPS NMEA
I solved the compilation and it seems every thing is OK
changing
in GPS.H i have added

Code: Select all

bool GPS_NMEA_newFrame(char c);


In Output.cpp line 150
before

Code: Select all

    #if defined(SEC_SERVO_FROM)   // write secundary servos

after

Code: Select all

    #if defined(SEC_SERVO_FROM) && !defined(HW_PWM_SERVOS)  // write secundary servos


Hope this help you.

User avatar
NikTheGreek
Posts: 348
Joined: Thu Dec 08, 2011 4:17 pm
Location: Greece
Contact:

Re: Reorganising source *.c code with *.h headers; Eclipse I

Post by NikTheGreek »

Hi.
i would like to know how can i install eclipse and what additional tools i 'll need in order to compile-upload .
Thank you in advance.

Post Reply