fprime icon indicating copy to clipboard operation
fprime copied to clipboard

Make the stub Linux drivers emulate nominal behavior

Open bocchino opened this issue 3 years ago • 2 comments

As I revise the RPI demo, I'm encountering the following behavior: if I put in flight-like assertions that driver initialization is OK, then the app crashes on the Mac. I presume this is because the stub drivers return error status on the Mac, even when nothing is wrong. Presumably it would work better on the RPI, but we want the demo to behave nicely on Mac/Linux. So for now I am putting in a bunch of code to handle error cases and behave nicely if things fail. This code is non-flight-like, and somewhat annoying to write.

I think it would be better if we had stub drivers always do something reasonable and always return OK. That way we could plug a stub driver into flight-like code that says FW_ASSERT(driverInit()) and everything will still work. The driver behavior can still be very limited for the demo, but at least it won't report a failure that the application layer has to handle in a non-flight-like way.

bocchino avatar Dec 09 '21 18:12 bocchino

We should add in serial stubbed driver as requested by another issue.

LeStarch avatar Dec 20 '21 20:12 LeStarch

Another clean-up issue: #1066

LeStarch avatar Dec 20 '21 21:12 LeStarch