New semantics of utime.ticks_diff

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: New semantics of utime.ticks_diff

Post by pythoncoder » Thu Nov 03, 2016 5:29 am

pfalcon wrote:... to achieve compatibility with older and newer versions you just need to wrap ticks_diff() in abs():
Nice try, Paul, but no banana ;) It works with the current build - but that isn't really relevant. With this recent build:

Code: Select all

MicroPython v1.8.1-505-g67d52d8 on 2016-09-26; PYBLITEv1.0 with STM32F411RE
Type "help()" for more information.
>>> 
>>> import utime
>>> utime.ticks_diff(2,1)
1073741823
>>> 
My original solution is safest.
Peter Hinch
Index to my micropython libraries.

Post Reply