V1.1.0
This commit is contained in:
+23
-15
@@ -17,15 +17,14 @@ class RP2040UploaderApp:
|
||||
self.folder_path = os.path.join(os.getcwd(), "Resources/RP2040")
|
||||
self.config_path = os.path.join(self.folder_path, "config.json")
|
||||
|
||||
|
||||
self.label = tk.Label(master, text="Searching for RP2040...")
|
||||
self.label = tk.Label(master, text="Searching for board...")
|
||||
self.label.pack(pady=10)
|
||||
|
||||
self.port = self.find_rp2040_port()
|
||||
self.port, self.board_name = self.find_supported_port()
|
||||
if self.port:
|
||||
self.label.config(text=f"RP2040 detected on {self.port}")
|
||||
self.label.config(text=f"{self.board_name} detected on {self.port}")
|
||||
else:
|
||||
self.label.config(text="RP2040 not found.")
|
||||
self.label.config(text="No supported board found.")
|
||||
|
||||
# Config entry fields
|
||||
self.ip_entry = self.create_labeled_entry("IP Address:")
|
||||
@@ -34,7 +33,13 @@ class RP2040UploaderApp:
|
||||
|
||||
self.load_config()
|
||||
|
||||
self.upload_button = ttk.Button(master, text="Upload Files", style="Accent.TButton", command=self.upload_files, state=tk.NORMAL if self.port else tk.DISABLED)
|
||||
self.upload_button = ttk.Button(
|
||||
master,
|
||||
text="Upload Files",
|
||||
style="Accent.TButton",
|
||||
command=self.upload_files,
|
||||
state=tk.NORMAL if self.port else tk.DISABLED
|
||||
)
|
||||
self.upload_button.pack(pady=10)
|
||||
|
||||
def create_labeled_entry(self, label_text):
|
||||
@@ -46,17 +51,20 @@ class RP2040UploaderApp:
|
||||
entry.pack(side=tk.RIGHT)
|
||||
return entry
|
||||
|
||||
def find_rp2040_port(self):
|
||||
target_vid = 0x239A
|
||||
target_pid = 0x80F2
|
||||
def find_supported_port(self):
|
||||
# List of supported boards (VID, PID, Name)
|
||||
supported_boards = [
|
||||
(0x239A, 0x80F2, "RP2040"),
|
||||
(0x2E8A, 0x0009, "RP2350"),
|
||||
]
|
||||
|
||||
ports = serial.tools.list_ports.comports()
|
||||
for port in ports:
|
||||
if port.vid == target_vid and port.pid == target_pid:
|
||||
return port.device
|
||||
|
||||
return None
|
||||
for vid, pid, name in supported_boards:
|
||||
if port.vid == vid and port.pid == pid:
|
||||
return port.device, name
|
||||
|
||||
return None, None
|
||||
|
||||
def load_config(self):
|
||||
if os.path.isfile(self.config_path):
|
||||
@@ -120,7 +128,7 @@ class RP2040UploaderApp:
|
||||
if __name__ == "__main__":
|
||||
root = tk.Tk()
|
||||
app = RP2040UploaderApp(root)
|
||||
root.title("RP2040 Loader V1.0.2")
|
||||
root.title("RP Loader V1.1.0")
|
||||
|
||||
root.iconbitmap(r'Resources/icon1.ico')
|
||||
|
||||
@@ -135,7 +143,7 @@ if __name__ == "__main__":
|
||||
# Footer label in bottom right
|
||||
footer_frame = tk.Frame(root)
|
||||
footer_frame.pack(side=tk.BOTTOM, fill=tk.X)
|
||||
footer_label = tk.Label(footer_frame, text="Made by Hendo 23/07/2025", anchor="e", justify="right", font=("TkDefaultFont", 7, "bold"))
|
||||
footer_label = tk.Label(footer_frame, text="Made by Hendo 06/10/2025", anchor="e", justify="right", font=("TkDefaultFont", 7, "bold"))
|
||||
footer_label.pack(side=tk.RIGHT, padx=10, pady=5)
|
||||
|
||||
root.mainloop()
|
||||
|
||||
Reference in New Issue
Block a user