Skip to content

Commit

Permalink
gpio workaround for cdev timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyIvan359 committed Dec 20, 2020
1 parent c326955 commit 070efc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Development

* **Changed**
* GPIO CDev interrupts now use Python timestamp instead of event timestamp. On some
systems it seems that it reports uptime nanoseconds, not epoch nanoseconds. Fixes
[#86](https://github.com/CrazyIvan359/mqttany/issues/86).

* **Fixed**
* Math error in GPIO debounce calculation, multiplied when I should have divided. Also
corrects cast error in CDev interrupt where epoch nanoseconds (1.6×10<sup>15</sup>)
Expand Down
3 changes: 2 additions & 1 deletion mqttany/gpio/pins/digital.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ def get_event(self) -> (bool, int):
edge, ns = self._pin._interface.read_event()
return (
edge == periphery_PinEdge[PinEdge.RISING],
round(ns / 1000000000.0, 6),
# round(ns / 1000000000.0, 6),
now().timestamp(),
)


Expand Down

0 comments on commit 070efc3

Please sign in to comment.