File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,15 @@ def show_no_libusb_warning():
3333    """! @brief Logs a warning about missing libusb library only the first time it is called.""" 
3434    global  did_show_no_libusb_warning 
3535    if  not  did_show_no_libusb_warning :
36-         LOG .warning ("STLink and  CMSIS-DAPv2 probes are not supported because no libusb library was found." )
36+         LOG .warning ("STLink,  CMSIS-DAPv2 and PicoProbe  probes are not supported because no libusb library was found." )
3737        did_show_no_libusb_warning  =  True 
38-      
38+ 
3939def  should_show_libusb_device_error (vidpid ):
4040    """! @brief Returns whether a debug warning should be shown for the given VID/PID pair. 
41-      
41+ 
4242    The first time a given VID/PID is passed to this function, the result will be True. Any 
4343    subsequent times, False will be returned for the same VID/PID pair. 
44-      
44+ 
4545    @param vidpi A bi-tuple of USB VID and PID, in that order. 
4646    """ 
4747    should_log  =  vidpid  not  in   libusb_error_device_set 
Original file line number Diff line number Diff line change 2626from  typing  import  List 
2727
2828from  .debug_probe  import  DebugProbe 
29+ from  .common  import  show_no_libusb_warning 
2930from  ..core  import  exceptions 
3031from  ..core .options  import  OptionInfo 
3132from  ..core .plugin  import  Plugin 
@@ -104,8 +105,12 @@ def close(self):
104105    @classmethod  
105106    def  enumerate_picoprobes (cls , uid = None ) ->  List ["PicoLink" ]:
106107        """! @brief Find and return all Picoprobes """ 
107-         # Use a custom matcher to make sure the probe is a Picoprobe and accessible. 
108-         return  [PicoLink (probe ) for  probe  in  core .find (find_all = True , custom_match = FindPicoprobe (uid ))]
108+         try :
109+             # Use a custom matcher to make sure the probe is a Picoprobe and accessible. 
110+             return  [PicoLink (probe ) for  probe  in  core .find (find_all = True , custom_match = FindPicoprobe (uid ))]
111+         except  core .NoBackendError :
112+             show_no_libusb_warning ()
113+             return  []
109114
110115    def  q_read_bits (self , bits ):
111116        """! @brief Queue a read request for 'bits' bits to the probe """ 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments