periph / conn

Go·Hardware·Lean - Interfaces
https://periph.io
Apache License 2.0
74 stars 13 forks source link

gpioutil: Note that Debounce is not implemented #10

Closed lutzky closed 3 years ago

lutzky commented 3 years ago

Fixes #8

codecov-commenter commented 3 years ago

Codecov Report

Merging #10 (a3a867b) into main (1c39224) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##            main     #10   +/-   ##
=====================================
  Coverage   98.3%   98.3%           
=====================================
  Files         31      31           
  Lines       2699    2699           
=====================================
  Hits        2652    2652           
  Misses        44      44           
  Partials       3       3           
Impacted Files Coverage Δ
gpio/gpioutil/debounce.go 100.0% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1c39224...a3a867b. Read the comment docs.

maruel commented 3 years ago

Humm it seems like I messed up the CI, I'll have to double check.

maruel commented 3 years ago

Thinking about it more I think it's because my canary testing trick to fetch a not-yet-merged-commit works but only for commits in branches but not for PRs. I will have to fix this. In the meantime I'll just do a quick check how it looks in local godoc and will merge later ignoring the CI failure.

maruel commented 3 years ago

Sorry for the delay, the reason is that I wanted to confirm how it looks in godoc, compare the current layout:

image

versus moving stuff around:

image

The second works by putting warning on a single line. I also feel putting it at the end of the description instead of the middle flows better for the reader. The rationale is that vast majority of the users will be using the online view at pkg.go.dev, only a minority will read the code. That's why I'm a bit picky about how it renders.

maruel commented 3 years ago

Doc for the second form:

// Debounce returns a debounced gpio.PinIO from a gpio.PinIO source. Only the   
// PinIn behavior is mutated.                                                   
//                                                                              
// denoise is a noise filter, which waits a pin to be steady for this amount    
// of time BEFORE reporting the new level.                                      
//                                                                              
// debounce will lock on a level for this amount of time AFTER the pin changed  
// state, ignoring following state changes.                                     
//                                                                              
// Either value can be 0.                                                       
//                                                                              
// WARNING                                                                      
//                                                                              
// This is not yet implemented.                                                 
//                                                                              
// TODO(https://github.com/periph/conn/issues/5): Implement this
lutzky commented 3 years ago

Makes sense, done.