While it may not look necessary to some drivers, it is useful to have a
consistent pattern. The Opts never specify connectivity, only other parameters.
Issue #194
Make the float calibration calculation to use float64 instead of float32. It's
the same performance on all platforms.
Include conversion back to physic units for the float based benchmark, to be
more realistic.
- .gohci.yml: Run with both -cover and -bench on odroid and win10 and make the
benchtime 1000ms instead of 10ms to increase precision, as this was lacking.
- apa102: add benchmark for toRGBFast()
- bmxx80: add benchmark for conversion functions.
- gpiotest: silence test (was leaking output during benchmarks)
- physic: add benchmark for the current int64 String() implementation compared
to an hypothetical (simpler) float64 based implementation.
This defines a image/draw compatible Gray14 image type and Intensity14
pixel type. These will soon be used to store the frames return by the
lepton driver.
This is part of the work for #218.
It realized I did it wrong. Decouple and disambiguate the 'measurement type'
from the 'unit used'.
While trying to micro-optimize for 32 bits architecture, I missed the greater
picture. Use int64 for most types.
Include 100% test coverage and examples.
Looks like my gofmt and the one used by travis do not agree on a comment inside
an empty struct. Move the comment outside the struct to work around the problem.
The idea is to enable navigating across the code more easily by using similar
layout amongs the drivers.
Similar to gofmt, it's not about making a stylistic choice, but having a single
style.
Use the following layout for drivers:
- exported support types
- Opts struct
- New func
- Dev struct and methods
- Private support code
No functional change.
A lot of code moved around, so it will likely break any pending PR or fork. :/
If the passed key is longer than 6 bytes, it will corrupt the access
bits for the trailing sector.
Fixed the bit calculation, updates tests.
Changed signatures to accept 6-byte long arrays instead of slices.
Minor typo for HD44780
Signed-off-by: Eugene Dzhurinsky <jdevelop@gmail.com>
This creates an example_test.go for each package with at least one
Example, and move all examples in it. Make the example_test.go file live
into a separate package 'foo_test' so it can call host.Init() and thus
can be copied as-is.
- Make errors consistents.
- Standardize comments.
- Make unit test much faster by not sleeping.
- Reduce the number of properties of Dev.
- Do not export Opts.
- Commented out I/O for unused data.
- Slightly reduce memory usage.
- Comment out NewSPI() since it is not implemented.
- Remove verbosity by default.
- Ran github.com/kisielk/errcheck on the code base, and either trapped errors or
marked them as ignored explicitly. The stats was calculated via:
errcheck ./... | grep -v defer | wc -l
- Stop registering gpio.INVALID, it can't be registered.
- Fix a go vet issue in cap1188.
This makes the tool more pleasant to use for newcomers and this makes flag
parsing more coherent.
- Print help on error.
- Consistently use NewFlagSet() everywhere with Usage() that prints nicer help
page.
- Move code around for the ones that were not layed out in the same way as the
rest.
This is a breaking change for gpiosmoketest, since it is switched from
undocumented positional arguments to flags.
No functional change.
I plan to add more units, and eventually this could make sense to split it off
into its own package. For now split it into its own source file.
In practice I want to be able for gpioreg.Register() to eventually enforce that
Halt() is implemented on gpio.Pin, so that three's a consistent way to stop
gpiostream operations or PWM() output. This requires the interface to live in
conn, not in devices.
Do not use go1.9 type alias to not break compatibility with older Go version
yet.
- Disallow writing a buffer longer than the number used. Silently
dropping data is always annoying to debug. Clear failure is better.
- Rename private variables and document them better.
- Replace 'lights' by 'pixels'. This is more precise.
- cmd/bmxx80 now can read any of these 3 devices.
- Rewrite the driver to support all 3 devices. More devices of the family (like
the bme680) could be easily added.
- Add -ia to bmx280smoketest
Fix#155
- bme280: fix hang in Halt() if SenseContinuous() listener is hung.
- bmp180: Add unit tests; increase test coverage to 96%.
- bmp180: Remove Reset(). There's no known use case.
- bmp180: Implement SenseContinuous().
- Consistently wrap errors in both packages.
- Various typos.