Commit Graph

7 Commits (97998e315bc904636701e6c721508c03654f4d53)

Author SHA1 Message Date
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
Florian Klink fe248193e0
nrzled: Don't set NoCS (#4)
Whether or not CS (chip select) is used really depends on the way how
you wire things together, not on the device you're talking to.

Not using CS (and explicitly telling the SPI controller about that)
might keep some pins free on pin-constrained boards, but also, some
controllers (or Linux drivers) don't support disabling CS, and fail when
that flag is given.

On the other hand, even though nrzleds don't make use of CS by
themselves, you could very well have some circuit in front to do the
chip select, and then actually write to different nrzled devices
sequentially.

Long-term, the fact on whether to do chip select should be specified
while passing in the SPI port to be used, as it really depends on the
way it's wired together on the specific board, not on the type of
device.
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
Florian Klink 51e659fc71 nrzled/rasterSPI: fix ordering
This is supposed to be sent out in GRB order (and the comment below also
below claims it), but the code (and corresponding unit tests) did output
RGB order.
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