mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-07-12 06:12:22 +00:00
072b204d3d
* ch552 firmware: add ch55x support files directly * Add sdcc compiler to docker image, for building CH552 firmware * Rework production test script * Add menu-based test runner * Rewrite production test flows as lists of individual tests * Add both production flows and manual tests to menu * Switch to using included binaries * production test: Update message format * test_txrx_touchpad: Retry if device communications fail * production test: put all binaries in binaries/ folder * binaries/top.bin: replace broken binary * flash_check: Check for explicit flash IDs * Document most test procedures * Test plan documentation * Sample udev rules * Production test: allow external references to be overridden * Remove outdated descriptions * Correct shebang * Update shebangs to comply with PEP 394 Change the python scripts to call python instead of python3, as this works cross platform. See: https://peps.python.org/pep-0394/#for-python-script-publishers * Move production test to higher-level directory * Clarify production test setup * Move USB C connector test to separate directory Co-authored-by: Michael Cardell Widerkrantz <mc@tillitis.se>
79 lines
2.3 KiB
Python
Executable File
79 lines
2.3 KiB
Python
Executable File
#!/usr/bin/python
|
|
import tkinter as tk
|
|
from tkinter import filedialog as fd
|
|
from tkinter.messagebox import askyesno
|
|
import connected_test
|
|
import datetime
|
|
|
|
def handle_choose_file():
|
|
filetypes = (
|
|
('CSV files', '*.csv'),
|
|
)
|
|
|
|
filename = fd.askopenfilename(
|
|
title='Open a GPIO definition file',
|
|
initialdir='.',
|
|
filetypes=filetypes)
|
|
|
|
print(filename)
|
|
filename_entry.delete(0, 'end')
|
|
filename_entry.insert(0, filename)
|
|
|
|
def handle_record():
|
|
filename = filename_entry.get()
|
|
[filename,x] = filename.split('.')
|
|
|
|
answer = askyesno(title='Record GPIO states',
|
|
message='Record GPIO states? This will delete any previous state recordings')
|
|
|
|
if answer:
|
|
results_text.delete("1.0", "end") # if you want to remove the old data
|
|
results_text.insert('end',datetime.datetime.now())
|
|
results_text.insert('end',' recording gpio connections\n')
|
|
|
|
connected_test.record(filename)
|
|
|
|
changes_good = connected_test.read_pin_changes(filename)
|
|
for [pin, change] in changes_good.items():
|
|
results_text.insert('end','{:} [{:}]\n'.format(pin,','.join(change)))
|
|
|
|
def handle_test():
|
|
filename = filename_entry.get()
|
|
[filename,x] = filename.split('.')
|
|
|
|
results_text.delete("1.0", "end") # if you want to remove the old data
|
|
results_text.insert('end',datetime.datetime.now())
|
|
results_text.insert('end',' testing gpio connections\n')
|
|
results = connected_test.test(filename)
|
|
|
|
if results == []:
|
|
results = ['OK']
|
|
|
|
results_text.insert('end','\n'.join(results))
|
|
|
|
window = tk.Tk()
|
|
window.title('Pin change tester')
|
|
#window.geometry('1600x1200')
|
|
frame = tk.Frame()
|
|
|
|
# Results window will show the test result
|
|
results_text = tk.Text(master=frame, height=30,width=180)
|
|
results_text.pack()
|
|
|
|
choosefile_button = tk.Button(master=frame, text='Choose file', command=handle_choose_file)
|
|
choosefile_button.pack()
|
|
|
|
label = tk.Label(master=frame, text='filename:')
|
|
label.pack();
|
|
filename_entry = tk.Entry(master=frame, width=80)
|
|
filename_entry.pack();
|
|
|
|
record_button = tk.Button(master=frame, text='record', command=handle_record)
|
|
record_button.pack()
|
|
|
|
test_button = tk.Button(master=frame, text='test', command=handle_test)
|
|
test_button.pack()
|
|
|
|
frame.pack()
|
|
window.mainloop()
|