You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/07/12 19:02:55 UTC

[GitHub] ccollins476ad opened a new pull request #1268: util/debounce: Debouncing / hysteresis utility pkg

ccollins476ad opened a new pull request #1268: util/debounce: Debouncing / hysteresis utility pkg
URL: https://github.com/apache/mynewt-core/pull/1268
 
 
   I needed this utility for something, and I thought it was generally useful enough to be added to core.  Perhaps this would be better placed in a different repo.
   
   I struggled a lot deciding on a width for the integers in `struct debouncer`.  `uint32_t` requires a bit more memory than I was comfortable with.  I thought about using macros to define several instances of the API (`debouncer8`, `debouncer16`, `debouncer32`), but that was making the code too complicated to be readable.  I also considered a single syscfg setting which determined the integer width for all debouncers, but I didn't think that was very useful, and it still made the interface difficult to read due  to the need for macros.  In the end, I just settled on what I think works in most cases: `uint16_t`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services