waiting for an interrupt flag to be set

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
User avatar
devnull
Posts: 401
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: waiting for an interrupt flag to be set

Post by devnull » Fri Nov 08, 2019 11:18 am

Is there any difference / benefit to using a time.sleep in a tight loop rather than a pass ?

Code: Select all

while x = False:
   pass

while x = False:
   time.sleep_ms(10)

User avatar
emtee
Posts: 8
Joined: Thu Jun 14, 2018 4:55 pm
Location: BC, Canada

Re: waiting for an interrupt flag to be set

Post by emtee » Sat Nov 09, 2019 8:38 pm

Sorry to jump in, but 65535 as a 2 byte interger viewed as a hex value is 0xFFFF. If you re-interpret this as a signed 2 byte integer value, this is -1. Not sure if this is significant for the return status for the connection, but it may be an error status.

Just my 2 bits (or bytes in this case) ... :geek:

Post Reply