It now passes when run as:
staticcheck -checks all,-U1000,-ST1003,-SA5002,-SA1019 ./...
The disabled checks will be enabled later since they are less trivial to
enable, as this is already a non-trivial number of modifications.
- Temporarily disable caching of sources, it seems corrupted.
- Fix copyright on a few sources.
- Codecov is very aggressive about code coverage, reduce the
expectations.
- Remove deprecated sudo:false
- Add missing os:linux and update to dist:bionic
- Update to go1.14.x
- Convert from matrix to jobs
- Reformat to try to make it slightly more readable
Fix a go formatting that crept in.
* Fix white border color
* Add convenience functions DrawAll and SetModelColor
* Tidy up the initialisation code and apply bugfixes from the upstream
Python library
Now running:
! go vet -vettool=$(which shadow) ./... |& grep -v '"err"' | grep -e '^[^#]'
Which means that "err" aliasing is not checked, but others are. I may
enforce "err" aliasing later but it's more noisy so I'm not 100% sure
yet it's a good idea. Enforcing it for non-err variables looked like a
reasonable initial trade-off.
Ran the following command:
golint -min_confidence 0 ./... | grep -v ALL_CAPS | \
grep -v underscores | grep -v 'another file'
and fixed the comments that made sense.
- Converting the alert registers and the ambient temp register to a
physic.Temperature can use the same procedure. Unify them and document
why this is possible.
- Use != instead of > for bit checks
- Inline bitsToTemperature calls in SenseWithAlerts
The datasheet (http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf)
says that negative temperatures are stored in two's complement. See
page 22 for alert registers and pages 24-25 for the ambient temperature
register.
However, the code currently assumes negative values are stored in a
sign-and-magnitude representation. Fix this to handle two's complement
values correctly.
For register bits to temperature conversion this implementation follows
the datasheet, but the code in the datasheet isn't quite right -- it
should be `temp - 256` instead of `256 - temp` -- but the fact that the
256 figure is in Microchip's code backs up the idea stated in the text
that negative values are in two's complement. Others seem to agree that
this is correct: https://electronics.stackexchange.com/a/244826
For temperature to bits conversion this implementation relies on the
fact that Go also uses two's complement. I've added a long comment in
the code about this.
Add internal context.context
Fixes some fragile time based tests.
Halt() is now synchronous, will only return if the context has been cancelled.
Remove go routine leak in New().
Fix spelling.
- Improve rounding and add unit tests to confirm.
- Period() is the same function than Duration() but better describes what
is returned.
- Fix support for negative value.
- Upgrade all call sites inside periph.
- Fix Frequency documentation that incorrectly stated it's an int32,
it's in fact an int64.
- Duration() will be removed in v4.0.0 as part of issue #379.
This causes a few breaking changes in experimental code:
- hx711.TimeoutError was renamed to ErrTimeout
- unicornhd.NewUnicornhd() was stuttering and was renamed to New()
- Remove Strip, now unnecessary.
- Rename New() to NewStream().
- Merge SPIDev into Dev.
- Rename all unit tests.
- Unexport ToRGB(), this was in a unit test.
- Increase test coverage to 93.8%.
- Fix package documentation.
- Switch the main code to use a lookup array (and not slices!).
- Add unit test to test the lookup table against the algorithm.
- currentLSB is supposed to be Maximum Expected Current / 2^15
2 << 15 is 2^16, not 2^15.
- fix rounding error in powerLSB calculation
- check for overflow in calibration
- fix doc
- Merge PinForDifferenceOfChannels into PinForChannel.
- Make Channel a type.
- Rename ads1x15AnalogPin to analogPin, it was stuttering.
- Shorten few argument names.
- Remove one memory allocation in analogPin.
- Add a minimalistic unit test.
- Reduce (but to not eliminate yet) usage of fmt.
- Tweak documentation to optimize godoc output.
No functional change.
- Move private globals at the bottom of the file.
- Move ads1x15AnalogPin close to its methods.
- Stop using named return variable.
- Inline newADS1x15.
- Move gainConfig and gainVoltage as global variables.
- Wraps comments.
- Rename mutex to mu.
- Use -math.MaxInt16 instead of math.MinInt16 because of the voltage multiplier.
- Change error strings to start with a lower case.