477 BBC micro:bit or Calliope mini. |
477 BBC micro:bit or Calliope mini. |
478 |
478 |
479 @return flag indicating a micro:bit device |
479 @return flag indicating a micro:bit device |
480 rtype bool |
480 rtype bool |
481 """ |
481 """ |
482 if self.__device and ( |
482 if ( |
483 "micro:bit" in self.__device.deviceName() |
483 self.__device |
484 or "Calliope" in self.__device.deviceName() |
484 and ( |
|
485 "micro:bit" in self.__device.deviceName() |
|
486 or "Calliope" in self.__device.deviceName() |
|
487 ) |
|
488 and not self.__device.hasCircuitPython() |
485 ): |
489 ): |
486 return True |
490 return True |
487 |
491 |
488 return False |
492 return False |
489 |
493 |
1576 |
1580 |
1577 @param quiet flag indicating to not show a message |
1581 @param quiet flag indicating to not show a message |
1578 @type bool |
1582 @type bool |
1579 """ |
1583 """ |
1580 if self.__device and self.__device.hasTimeCommands(): |
1584 if self.__device and self.__device.hasTimeCommands(): |
1581 hasCPy = ( |
|
1582 self.__device.checkDeviceData() |
|
1583 and self.__device.getDeviceData()["mpy_name"] == "circuitpython" |
|
1584 ) |
|
1585 try: |
1585 try: |
1586 self.__device.syncTime(self.__device.getDeviceType(), hasCPy=hasCPy) |
1586 self.__device.syncTime( |
|
1587 self.__device.getDeviceType(), |
|
1588 hasCPy=self.__device.hasCircuitPython(), |
|
1589 ) |
1587 |
1590 |
1588 if not quiet: |
1591 if not quiet: |
1589 with EricOverridenCursor(): |
1592 with EricOverridenCursor(): |
1590 EricMessageBox.information( |
1593 EricMessageBox.information( |
1591 self, |
1594 self, |