stevenvar / OMicroB

An OCaml generic virtual machine for microcontrollers
Other
142 stars 23 forks source link

Better avr switcher #20

Closed Vertmo closed 5 years ago

Vertmo commented 5 years ago

With this PR, it should be possible to switch dynamically from an AVR to another. The chosen device can be selected with -device={arduboy,arduino-uno,arduino-mega}. This also prepares the code for integrating other architectures. The plan is to be able to simply add / remove relevant architectures from the configure file (see the target_avr procedure for instance).

I reintegrated the changes made during my PSTL with the last refactors of the code (in particular, the target specific code is located in the targets folder). I still have a few things to work out, but it should be ready soon.

Vertmo commented 5 years ago

Ok, I think this is pretty good now. So the main goal of these changes is to be able to compile OMicroB for any subset of the future available target architectures. This would allow user to enable the architectures they are interested in (say for instance Avr and Microbit but not ESP8266) so as to not have to install all the versions of gcc, but also not to have to recompile several versions of OMicroB.

This is mainly accomplished thanks to the incremental additions to the Device_config module (by redefining the get_config function with each architecture in the target-specific versions of the file), and by adding files from the target directory through the configure script.

What do you think ?

Vertmo commented 5 years ago

I think this should solve your concerns. What do you think ?