672 |
672 |
673 # step 1: determine all known UF2 volumes that are mounted |
673 # step 1: determine all known UF2 volumes that are mounted |
674 if not OSUtilities.isWindowsPlatform(): |
674 if not OSUtilities.isWindowsPlatform(): |
675 userMounts = FileSystemUtilities.getUserMounts() |
675 userMounts = FileSystemUtilities.getUserMounts() |
676 |
676 |
677 boardTypes = [boardType] if boardType else [*SupportedUF2Boards.keys()] |
677 boardTypes = [boardType] if boardType else list(SupportedUF2Boards) |
678 for board in boardTypes: |
678 for board in boardTypes: |
679 for vidpid, volumes in SupportedUF2Boards[board]["volumes"].items(): |
679 for vidpid, volumes in SupportedUF2Boards[board]["volumes"].items(): |
680 for volume, description in volumes: |
680 for volume, description in volumes: |
681 if OSUtilities.isWindowsPlatform(): |
681 if OSUtilities.isWindowsPlatform(): |
682 if FileSystemUtilities.findVolume(volume, findAll=True): |
682 if FileSystemUtilities.findVolume(volume, findAll=True): |
780 # now populate the entries with data |
780 # now populate the entries with data |
781 devices = getFoundDevices(boardType=self.__boardType) |
781 devices = getFoundDevices(boardType=self.__boardType) |
782 if len(devices) == 0: |
782 if len(devices) == 0: |
783 # no device set yet |
783 # no device set yet |
784 devices = [ |
784 devices = [ |
785 d |
785 d for d in Devices.getFoundDevices()[0] if d[0] in SupportedUF2Boards |
786 for d in Devices.getFoundDevices()[0] |
|
787 if d[0] in SupportedUF2Boards |
|
788 ] |
786 ] |
789 self.devicesComboBox.addItem("") |
787 self.devicesComboBox.addItem("") |
790 self.devicesComboBox.addItem(self.tr("Manual Select")) |
788 self.devicesComboBox.addItem(self.tr("Manual Select")) |
791 self.devicesComboBox.setItemData( |
789 self.devicesComboBox.setItemData( |
792 self.devicesComboBox.count() - 1, self.__manualType, self.DeviceTypeRole |
790 self.devicesComboBox.count() - 1, self.__manualType, self.DeviceTypeRole |