-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the block diagram of connecting a new plug-in? #43
Comments
$I will list all the loaded plugins. You would put your plugin name & version information in onReportOptions() |
Hmm I thought that was the case with $I. Not only is my plugin not appearing but I haven't see the odomoeter one appear yet either. Will be looking at it again shortly with fresh eyes. |
Depending on where you include the header file it may never get called. It should be called at the end of the
Which driver are you developing for? SAM3X8E (Arduino Due)? Development can sometimes be a bit tricky if a debugger is not used. And if debug (or startup) messages are written to an USB stream they may be lost as it may be impossible to connect to it before the messages are written. Some drivers may buffer them until a connection is made, others not. I prefer to use a UART stream when debugging using messages as this can be connected at all times. |
I will rename it and try this to get it going.
This is the new Teensy 4.1 based GrblHAL2000 board.
Exellent points. I'll get a Pi set up on the UART so I can see debug messages that way. |
Is there a graphical relationship between the various files available anywhere? It would be good to understand the relationships visually. I'm loooking for the driver_init() function, as I see multiple places that talk about enabling plugins but have not found a reference to my_plugin_init() yet. I know a tremendous amount of thinking and work on the structure has gone in to all of this, and the potential seems tremendous - so thank you for all your work on it. I'll do what I can to try and document the process of wiring up a plugin for someone new who comes after me. |
I believe I understand the chain now: drivers.c (in the board top level directory) contains the function driver_init() which in turn includes grbl/plugins_init.h. The call to my_plugin_init() is contained in grbl/plugins_init.h The default template, in order to avoid the example being called, has an "x" in front of the example init structure which is to be removed to enable it. So presumably the appropriate path is to develop a plugin as a private plugin using this structure, and when it is all working discuss how and where it will wire in once committed? Going to try it now. |
On build I am seeing this: src\my_plugin.c:225:8: warning: return type defaults to 'int' [-Wimplicit-int] |
My init function looks like this:
|
Where in the directory tree is I see there is a placeholder under |
I moved my code out of the way and renamed my init function. I took the As there is an additional file named my_plugin.c located at What is the correct way to activate/hook the unmodified my_plugin.c code as a starting point? |
OK, I finally have my plugin reporting as loaded. I think I ran myelf in circle trying to chase this down. It seems like the warnings about line 188 of plugins_init.h conflicting can be safely ignored? If I replace the |
Wherever you want, but best practice would be to add your code in a subdirectory in the same place where the other plugins live.
Don't do that, it has a weak definition and will be overridden by your implementation.
Yes, but it is easy to fix. C functions with no declared return type defaults to |
Will do, thank you. Closing issue as it is fully resolved. |
I've written a basic plugin using the my_plugin example, as well as fans.c as a reference.
On a state change, it should set aux output pins high or low, depending on the state.
I have added an enable define to my_machine.h and I had added a line to the driver.c to include the header file for my plugin. In the header file I call the init function. The plugin never seems to be called.
Is there was a way via the serial console to see what plugins are loaded and their version (I copied the version reporting from fan.c). I'm fairly certain the plugin is not being triggered, but I am unable to determine why.
Any guidance would be appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: