testing bugs

This commit is contained in:
Daniel Ledda
2020-10-31 15:25:12 +01:00
parent 4ed2d97de5
commit fa225a4a2d

View File

@@ -1,7 +1,6 @@
package main package main
import ( import (
"errors"
"fmt" "fmt"
"github.com/warthog618/gpio" "github.com/warthog618/gpio"
"math" "math"
@@ -91,9 +90,9 @@ func storeCycleCountsAsBinarySequence(store *[4]byte, cycles *[80]int) error {
for i := 0; i < 40; i++ { for i := 0; i < 40; i++ {
lowCycles := cycles[2 * i] lowCycles := cycles[2 * i]
highCycles := cycles[2 * i + 1] highCycles := cycles[2 * i + 1]
if (lowCycles == Timeout) || (highCycles == Timeout) { //if (lowCycles == Timeout) || (highCycles == Timeout) {
return errors.New("Timed out waiting for sensor pulse!") // return errors.New("Timed out waiting for sensor pulse!")
} //}
store[i / 8] <<= 1 store[i / 8] <<= 1
if highCycles > lowCycles { if highCycles > lowCycles {
store[i / 8] |= 1 store[i / 8] |= 1