thiagoralves / OpenPLC_v3

OpenPLC Runtime version 3
1.06k stars 432 forks source link

RPi HW layer compiles correctly now #191

Closed GeVanCo closed 1 year ago

GeVanCo commented 1 year ago

Currently, the RPi HW layer file is not compiled at all since the background_installer script was invoking the change_hardware_layer script incorrectly. The parameter blank_script was passed instead of the parameter rpi. Due to this change, the file raspberrypi.cpp is now compiled (was not in the past, it was just the empty blank file) and installed when running the compilation script ./install.sh with the argument rpi.

Next to this, the content of the file raspberrypi.cpp was wrong. When iterating over the arrays, the index parameter i of the for-loop was passed to the function pinNotPresent() instead of the item at location i of the corresponding array. This has been corrected, is tested and works perfect now.

thiagoralves commented 1 year ago

Having the blank layer at the end of installation is the correct approach. Activation of the rpi driver should be done after install on the “Hardware” tab. There are several rpi based boards (like UniPi for example) that will just break if the rpi driver is installed automatically

GeVanCo commented 1 year ago

Ok, I was missing that part of the build flow. Will revert the changes in the script in a next commit

GeVanCo commented 1 year ago

Reverted back the changes I did in background_installer.sh since I didn't know the target to compile against was chosen the moment you select the hardware layer in the web client. So, this commit only contains the necessary changes in the raspberrypi.cpp file to work correctly.