Commit Graph

8 Commits (c331b2498cc6b3ad121b747277f70f9f23dd95ae)

Author SHA1 Message Date
gsexton c46abe928c
Issue #73 - restructure so voltage can be returned even if power/current is meaningless. (#87) 1 year ago
eldondevat ae3205944c
ina219: Interpret signed output register values (#54)
The current and shunt voltage register values are signed, twos
complement format. In my tests interpreting them directly in the
way implemented here gave output consistent with other ina219
libraries.

Co-authored-by: Eldon Stegall <periphgithub@eldondev.com>
4 years ago
Marc-Antoine Ruel eb0d2cc2b9 Update to go1.17
Update dependencies
Update github actions
Ran gofmt
Fix one gosec warning
4 years ago
Marc-Antoine Ruel 823eae07fd staticcheck: enforce
This does result in a few awkward cases but in general it's worth
enforcing and most importantly will make my life as a code reviewer
easier.

It's mostly deletion of dead code.
5 years ago
Marc-Antoine Ruel a27238ec6e enforce no shadowed variable
Convert a few wrapped error from %v to %w.

This does result in a few awkward cases but the value outweighs the
downsides.
5 years ago
Marc-Antoine Ruel 402bbcc930 Migrate to devices/v3
Ran:
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/conn#periph.io/x/conn/v3#g'
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/host#periph.io/x/host/v3#g'
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/devices#periph.io/x/devices/v3#g'
  go test ./...
  go mod tidy
5 years ago
Marc-Antoine Ruel 655d1cef69 Update import path to what devices will be
Also update imports to conn and host.

Ran (roughly):
  # Update the references.
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/conn#x/conn#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/conn#x/conn#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/host#x/host#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/host#x/host#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/devices#x/devices#g'
  git ls-files -- . | xargs -L 1 sed -i 's#x/periph/experimental/devices#x/devices#g'

  # Initialize the go module:
  go mod init periph.io/x/devices

  # Edited it to require go 1.13:
  vi go.mod

  # Reorder imports.
  goimports -w .
5 years ago
Marc-Antoine Ruel 1de83694a1 Migrate layout to the destination layout
First I imported the commits from v3.6.6 with:

  PKG=devices
  git init $PKG
  cd $PKG
  git remote add origin https://github.com/google/periph
  git fetch origin
  git filter-repo \
    --path AUTHORS \
    --path CONTRIBUTING.md \
    --path CONTRIBUTORS \
    --path LICENSE \
    --path README.md \
    --path $PKG --path experimental/$PKG $@
  git remote add origin git@github.com:periph/$PKG
  git fetch origin
  # Use the occasion to rename from master to main since we are starting from
  # scratch.
  git branch -m main
  git push origin main

Then I fixed the layout to get rid of experimental with:

  git rm experimental/devices/README.md
  git mv experimental/devices/* .
  git mv devices/* .

The import paths will be fixed in a follow up.
5 years ago