Repository navigation
MAVLink Capa Fix - #3632
MAVLink Capa Fix#3632
Conversation
|
Can you provide information as to why you think the shift is required. Copying the field from a 32bit to a 24bit should just use truncation (like it is currently). By shifting the value down by 8 bits you are dividing the mAh used by 256! |
|
htobe32 is a byte swap, so currently the truncating throws away the most significant byte. Alternatively, this htobe24 could be available everywhere instead of just SerialHOTT: https://github.com/ExpressLRS/ExpressLRS/blob/master/src/src/rx-serial/SerialHoTT_TLM.cpp#L795 Has been tested on Ethos, previously capacity would be way under reported and with this change now aligns with what ArduPilot reports. |
|
It would certainly make more sense to extract htobe24 to common code and reuse that. |
|
Sounds good, added htobe24 to crsf_protocol.h, tested that both Tx and Rx code compiles. |
e3faa00 to
153d3ed
Compare
mha1
left a comment
There was a problem hiding this comment.
Only tested the HoTT telemetry side. Seems to still work.
Addresses: #3182 and simplifies the mAh clamp.