Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Scripting/AP_Arming: add pre-arm check that scripting has initialised successfull #12894
This PR resolves issue #12798 by adding a pre-arm check to alert the user if scripting has failed to initialise because it has run out of memory. In my tests a CubeBlack (and thus probably many other boards) are very close to running out of memory when using Copter in the default configuration so it is fairly likely that users will hit this issue and so we should provide protection and a decent warning.
This also removes the automatic setting of SCR_ENABLE to zero which we've recently agreed is not a good pattern because users may inadvertantly save/re-load parameter and permanently disable scripting.
This PR also makes an unrelated change to print an initialisation failure message from the scripting library itself instead of duplicating it in each vehicle.
WickedShell left a comment
Generally looks good. I think there is maybe a slight tweak around the enabled logic, but I am quite happy to see the scripting failure handling moved out of the vehicle code.