fix underflow bug
This commit is contained in:
+2
-2
@@ -217,9 +217,9 @@ func DecodePayload(s string, deveui string, devaddr string, lrrlat float32, lrrl
|
||||
func WriteDatapoint(mytime int64, deveui string, devaddr string, v uint8, h uint8, p uint8, w uint16, w1 int32, w2 int32, t int16, lrrlat float32, lrrlon float32, fw_version int32) {
|
||||
// wir nehmen humidity als Referenz, wenn diese > 0 ist, dann ist es
|
||||
// eine gueltige Messung
|
||||
var vp uint8 // Voltage in %
|
||||
var vp uint16 // Voltage in %
|
||||
if (h > 0) {
|
||||
vp = v - 70
|
||||
vp = uint16(v) - 70
|
||||
if vp < 0 {
|
||||
vp = 0
|
||||
} else if vp > 100 {
|
||||
|
||||
Reference in New Issue
Block a user