kopia lustrzana https://github.com/peterhinch/micropython-samples
Errors in mutex README fixed
rodzic
8780201bd9
commit
63c660d2f9
|
@ -22,9 +22,11 @@ mutex = mutex.Mutex()
|
|||
data_ready = False
|
||||
|
||||
def callback(): # Timer or interrupt callback
|
||||
global data_ready
|
||||
if mutex.test():
|
||||
data_ready = True
|
||||
# Update critical variables
|
||||
mutex.release()
|
||||
else:
|
||||
# defer any update
|
||||
# Associate callback with device (pin or timer)
|
||||
|
|
Ładowanie…
Reference in New Issue