diff --git a/ablib.py b/ablib.py index 7058a15..7749dff 100644 --- a/ablib.py +++ b/ablib.py @@ -1018,11 +1018,13 @@ def wait_edge(self,fd,callback,debouncingtime): po.register(fd,select.EPOLLET) while True: events = po.poll() + po.unregister(fd) timestamp=time.time() if (timestamp-timestampprec>debouncingtime) and counter>0: callback() counter=counter+1 timestampprec=timestamp + po.register(fd,select.EPOLLET) def set_edge(self,value,callback,debouncingtime=0): if self.fd!=None: @@ -1128,9 +1130,11 @@ def wait_edge(self,fd,callback): po.register(fd,select.EPOLLET) while True: events = po.poll() + po.unregister(fd) if counter>0: callback() counter=counter+1 + po.register(fd,select.EPOLLET) def set_edge(self,value,callback): if self.fd!=None: @@ -1810,9 +1814,11 @@ def wait_edge(self,fd,callback): po.register(fd,select.EPOLLET) while True: events = po.poll() + po.unregister(fd) if counter>0: callback() counter=counter+1 + po.register(fd,select.EPOLLET) def set_edge(self,value,callback): if self.fd!=None: @@ -2147,9 +2153,11 @@ def wait_edge(self,fd,callback): po.register(fd,select.EPOLLET) while True: events = po.poll() + po.unregister(fd) if counter>0: callback() counter=counter+1 + po.register(fd,select.EPOLLET) def set_edge(self,value,callback): if self.fd!=None: