ardupilot
ardupilot copied to clipboard
AP_EFI: Hirth: fix sensor health flags
There is no crankshaft sensor status reported by this EFI. This line is misleading and should be removed. The sensor health bitmask is already logged elsewhere.
How did we end up with this in here, then?
Is it in the datasheet?
How did we end up with this in here, then?
I really don't know how this got there. I asked around but didn't get a confident answer.
Is it in the datasheet?
No, that sensor_ok bitmask holds 4 bits for 4 different sensor healths, none of which are crankshaft, and all 4 of which are logged a couple lines later correctly. From the bitwise & here, you'd think that CRANK_SHAFT_SENSOR_OK held a single bit, but it doesn't: its 0x0F (4 LSB set). So this line is effectively marking crankshaft sensor healthy if any of these 4 sensors are healthy, and unhealthy if all are unhealthy.
While I was here, I noticed that our other sensor health bitmask is actually wrong. The datasheet shows bits 1-4, not bits 0-3, and I have confirmed with my Hirth EFI that bit 0 always reports 0.
I have pushed another commit to this PR to address that too.
Merged, thanks!