Skip to content

Commit

Permalink
don't allow BBL mah to be -ve
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Sep 26, 2021
1 parent 422ee57 commit 3d45f56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/bbl/bblreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,9 @@ func get_bbl_line(r []string, have_origin bool) types.LogItem {

if s, ok = get_rec_value(r, "energyCumulative (mAh)"); ok {
b.Energy, _ = strconv.ParseFloat(s, 64)
if b.Energy < 0 {
b.Energy = 0
}
}

if s, ok = get_rec_value(r, "rcData[3]"); ok {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ltmgen/ltmgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func LTMGen(seg types.LogSegment, meta types.FlightMeta) {
l = newLTM('S')
l.sframe(b)
s.Write(l.msg)
l = newLTM('a') // provate current
l = newLTM('a') // private current
l.paframe(b)
s.Write(l.msg)
g2t = b.Utc.Add(g2diff)
Expand Down

0 comments on commit 3d45f56

Please sign in to comment.