SK21 / AOG_RC

AgOpenGPS rate control.
Other
32 stars 8 forks source link

Add back preprocessor defines to guard libraries #29

Open mirh opened 1 year ago

mirh commented 1 year ago

I was trying to make an arduino nano every board work with RC.. and well, simply put Ethercard is kinda old and unmaintained by now (you may want to check EthernetENC perhaps as an alternative, but idk really about the technical merits aside of "age"). So, since I'm just fine with serial while excluding it I also took the occasion to satisfy my #11 itch.

I still kept useMCP as a moduleconfig variable, because I'm 100% certain I would have broken/forgot something if I had touched it. (but please dispose of it as you like).

p.s. I also updated .gitignore as a bonus with all the files you usually forget. Merged with 3d93ce914aec216e5a3309cb11cbfb2396dc6741 (cleanup of them wouldn't hurt then now, though it would have seemed excessive to proceed with it in this PR)

SK21 commented 1 year ago

What prevents the nano every from working? For the nano the existing code works. There are some files that are not needed for usb use, but I don't believe they cause a problem. The concept of the code is to not require users to edit the ino. PCBsetup is used to change the settings. If someone wants to edit the code they can make whatever changes they want.

I will try your changes to gitignore.

mirh commented 1 year ago

The every doesn't work due to https://github.com/njh/EtherCard/pull/335 and due to your checkshield code making direct use of 328-specific registers.

You are absolutely right I had forgotten about the toggles within the application... I'll move the logic to "support X" (which is going to be true by default of course) rather than "enable X".

Then it would be cool if RC could detect when the arduino wasn't compiled with the right libraries and grey out buttons (maybe the mcp setting field could be set to -1 to signal this situation?) but I reckon beggars can't be choosers.

SK21 commented 1 year ago

I have created a new branch with your changes and some modifications. It should still work with the nano every.

mirh commented 1 year ago

Yes. Though, did you put it in a new branch just to let it soak for testing undisturbed from other concerns? Or does it mean that you aren't comfortable at all with that going to mainline? (too much visual clutter when reading files?) Also, why did you go with that code duplication in the SupportMCP23017 ifs, as opposed to my (as dumb as elegant) version?

SK21 commented 1 year ago

I would just like to test it to make sure it works. I wasn't sure of your method of #if statements. The code is only duplicated in the ino and not the compiled version so it costs nothing for memory.

mirh commented 1 year ago

Sure, by all means take even a month if you need/want.

mirh commented 1 year ago

Remember kids.. If git gui says that you are on a detached head and that the thing you are trying to do is dangerous, believe it.