Wrap around on current_amps at 327A

Copter V3.3.2
Mission Planner 1.3.35
Genuine 3DR PixHawk
Frame: Foxtech D130
Props: T-Motor 28x9.2
ESCs: T-Motor Flame 80A
Motors: T-Motor U8-10 (170KV)
Batteries: 2xTattu 4S 10000mah in series to get 8S.

After torture testing on the bench I see in the log that my current draw as reported by the PixHawk never goes above 327 amps and instead it goes negative. I verified that the current value sent to the PixHawk via a clamp on meter.

I checked the code and found the following in LogFile.cpp at line 1609:

current_amps        : (int16_t) (battery.current_amps() * 100.0f),

It looks to me that the value is wrapping and I believe the (int16_t) should be (uint16_t) instead.

This is not a critical bug as I rarely run the bird that hot and will likely only see that again if I have some other failure and the bird is trying to recover. I hope this won’t make things worse if that happens.

I’d love to send you the log but for some reason I can’t upload a log.

Here’s the log at dropbox:

dropbox.com/s/w0nh1e9m5envl … M.bin?dl=0