Archived
debug stuff
This commit is contained in:
@@ -17,6 +17,7 @@ from PIL import ImageFont, ImageDraw, Image
|
||||
# load more needed modules
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
|
||||
# load randommodules
|
||||
#from random import randint, gauss
|
||||
@@ -29,11 +30,25 @@ RST_PIN = 25 #Reset
|
||||
CS_PIN = 8
|
||||
DC_PIN = 24
|
||||
|
||||
# set variables
|
||||
|
||||
|
||||
|
||||
|
||||
# define display settings and create display device
|
||||
serial = spi(device=0, port=0, bus_speed_hz = 8000000, transfer_size = 4096, gpio_DC = DC_PIN, gpio_RST = RST_PIN)
|
||||
device_used = sh1106(serial, rotate=2) #sh1106
|
||||
|
||||
# get udev context
|
||||
context = pyudev.Context()
|
||||
|
||||
def prepSystem():
|
||||
Path("/data/images").mkdir(parents=True, exist_ok=True)
|
||||
Path("/data/thumbnails").mkdir(parents=True, exist_ok=True)
|
||||
Path("/data/mnt_sd").mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
while True:
|
||||
@@ -43,8 +58,11 @@ def main():
|
||||
monitor.filter_by('block')
|
||||
for device in iter(monitor.poll, None):
|
||||
if 'ID_FS_TYPE' in device:
|
||||
term.println('{0} partition {1}'.format(device.action, device.get('ID_FS_LABEL')))
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
term.println("SD-Card inserted. Starting copy...")
|
||||
time.sleep(2)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user