Is there an easy way, through code, to determine what type of CPU the code is running on?
My project calls for modular CPU boards depending on need or scale out. So a client can start with a G30 for a small setup but swap out the board for a G80, 120, or 400 when the need arises (for RAM, speed, etc).
I would like the framework I am building to work regardless of what it is deployed to.
But I’m having trouble trying to figure out what MCU the code is running on to handle pin reconfiguration.
I’m faced with the proposition of either having a separate program version for each CPU, or incorporating a flash memory module to store configuration data, or using an SD card with a config file, etc… All of those solutions adds to cost and complexity. And I haven’t tested whether I can even late-bind pin declarations like that. When I try to execute code with bad pin declarations it breaks immediately (e.g. swapping from a G400 to a G30) when that program loads.
So is there a way to do this?