Skip to content

Commit

Permalink
Update adafruit_ticks.py
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Halbert <halbert@adafruit.com>
  • Loading branch information
jepler and dhalbert authored Aug 9, 2024
1 parent 5946e83 commit 97d6a3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adafruit_ticks.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ def ticks_ms() -> int:

def ticks_add(ticks: int, delta: int) -> int:
"Add a delta to a base number of ticks, performing wraparound at 2**29ms."
if delta <= -_TICKS_PERIOD / 2 or delta >= _TICKS_PERIOD / 2:
raise OverflowError("ticks interval overflow")
return (ticks + delta) % _TICKS_PERIOD
if -_TICKS_HALFPERIOD < delta < _TICKS_HALFPERIOD:
return (ticks + delta) % _TICKS_PERIOD
raise OverflowError("ticks interval overflow")

Check failure on line 127 in adafruit_ticks.py

View workflow job for this annotation

GitHub Actions / test

Parsing failed: 'unindent does not match any outer indentation level (<unknown>, line 127)'

Check failure on line 127 in adafruit_ticks.py

View workflow job for this annotation

GitHub Actions / test

Parsing failed: 'unindent does not match any outer indentation level (<unknown>, line 127)'


def ticks_diff(ticks1: int, ticks2: int) -> int:
Expand Down

0 comments on commit 97d6a3e

Please sign in to comment.