Implemented the tick handler
This commit is contained in:
		
							
								
								
									
										12
									
								
								lib/Gpio.php
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								lib/Gpio.php
									
									
									
									
									
								
							@@ -57,11 +57,13 @@ class Gpio implements \ArrayAccess
 | 
			
		||||
        $read = $this->fd_gpio;
 | 
			
		||||
        $write = array();
 | 
			
		||||
        $except = $read;
 | 
			
		||||
        select($read, $write, $except, 0);
 | 
			
		||||
        foreach($except as $fd) {
 | 
			
		||||
            $pin = $this->getPinFromFd($fd);
 | 
			
		||||
            $pin->doInterrupt();
 | 
			
		||||
        
 | 
			
		||||
        if (count($read)>0) {
 | 
			
		||||
            stream_select($read, $write, $except, 0);
 | 
			
		||||
            foreach($except as $fd) {
 | 
			
		||||
                $pin = $this->getPinFromFd($fd);
 | 
			
		||||
                $pin->doInterrupt();
 | 
			
		||||
            
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user