Skip to content

Add back preprocessor defines to guard libraries#29

Closed
mirh wants to merge 1 commit intoSK21:masterfrom
mirh:master
Closed

Add back preprocessor defines to guard libraries#29
mirh wants to merge 1 commit intoSK21:masterfrom
mirh:master

Conversation

@mirh
Copy link

@mirh mirh commented Apr 17, 2023

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 3d93ce9
(cleanup of them wouldn't hurt then now, though it would have seemed excessive to proceed with it in this PR)

@SK21
Copy link
Owner

SK21 commented Apr 18, 2023

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
Copy link
Author

mirh commented Apr 18, 2023

The every doesn't work due to njh/EtherCard#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
Copy link
Owner

SK21 commented Apr 19, 2023

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

@mirh
Copy link
Author

mirh commented Apr 19, 2023

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
Copy link
Owner

SK21 commented Apr 19, 2023

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
Copy link
Author

mirh commented Apr 19, 2023

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

To avoid usage of (sometimes) unneeded libraries, but also to hopefully help supporting more boards.
@mirh
Copy link
Author

mirh commented Jul 18, 2023

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.

@mirh mirh reopened this Jul 18, 2023
@SK21 SK21 closed this Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants