- apa102 benchmark used image.CMYK, which was added in go 1.5. This has the side
effect of making benchmark BenchmarkDrawSlowpath a bit faster.
- mpu9250 used type aliasing by accident, which was added in go1.9.
- periph-web used http.Server.Shutdown(), which was added in go1.8.
This is important to enable portability across platforms.
- UART_TX, UART_RX, UART_RTS, UART_CTS
- SPI_MISO, SPI_MOSI, SPI_CLK
This could break users who were depending on the previous wording but that would
be highly surprising.
Used the following:
go get github.com/kisielk/errcheck
errcheck -ignore 'Close|rintf' ./...
While some are irrelevant, there were some genuine issues so this is worth
enforcing, hence a few innocuous places were 'fixed' so that the list could go
down to zero.
Do not enforce this in travis yet, but should be done soon.
It regressed in e9544992d9. :( This is due to
integer overflow. Tested against the executable compiled from periph v2.
Refactor the tests to make the error messages clearer.
Fixes#256
The rationale is that both intensity limiting and temperature correction can
still be used with 8 bits resolution, but perceptual mapping can't.
Make the documentation clearer about the implications. Add global PassThruOpts
to make its clear for users.
Add example for ToRGB() using PassThruOpts.
Add unit tests.
Add flag -g to cmd/apa102.
Extracts a condition from the inner raster loop, increasing performance by up to
25%.
Fix bug in dst overrun.
- Convert existing tests to table-driven
- Make reading []byte diffs easier by aligning lines
- Should be a no-op in terms of what's being tested and with what data
The remainder is ALL_CAPS, underscores and golint confusion when multiple
exported variables are defined on a single line.
No functional change except one error string tweaked.
display: move devices.Display as display.Drawer
This removes the last interface from devices, which was misplaced due to
historical accident. The new package display will also be the location for an
interface for text output only devices.
Remove io.Writer from this interface. While it's a good performance optimization
for some drivers, it shouldn't be required.
Change Draw():
- Return an error, so that communication erorr can be surfaced correctly,
instead of an adhoc driver specific Err() method.
This is borderline pedantic but enables 30*physic.MegaHertz which I think is
more readable than 30000000, reducing the risk of typos.
Do not change Stream.Resolution() gpiostream yet, but I'll likely change it too
to match in a follow up.
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.