My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

duration_t.h 4.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env python3
  2. # ----------------------------------------------------------------------------
  3. # "THE BEER-WARE LICENSE" (Revision 42):
  4. # <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice
  5. # you can do whatever you want with this stuff. If we meet some day, and you
  6. # think this stuff is worth it, you can buy me a beer in return. Thomas Buck
  7. # ----------------------------------------------------------------------------
  8. targetIsPi = None
  9. def isPi():
  10. global targetIsPi
  11. if targetIsPi == None:
  12. getTarget()
  13. return targetIsPi
  14. def getTarget():
  15. global targetIsPi
  16. target = None
  17. try:
  18. from pi import PiMatrix
  19. target = PiMatrix()
  20. if targetIsPi == None:
  21. # only print once
  22. print("Raspberry Pi Adafruit RGB LED Matrix detected")
  23. targetIsPi = True
  24. except ModuleNotFoundError:
  25. from test import TestGUI
  26. target = TestGUI()
  27. if targetIsPi == None:
  28. # only print once
  29. print("Falling back to GUI debug interface")
  30. targetIsPi = False
  31. return target