sync
This commit is contained in:
10
buzzer_tool/core/commands/mkdir.py
Normal file
10
buzzer_tool/core/commands/mkdir.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# core/commands/mkdir.py
|
||||
from core.connection import BuzzerError
|
||||
|
||||
def execute(conn, path: str):
|
||||
"""Erstellt ein Verzeichnis auf dem Controller."""
|
||||
try:
|
||||
conn.send_command(f"mkdir {path}")
|
||||
print(f"📁 Verzeichnis '{path}' erfolgreich erstellt.")
|
||||
except BuzzerError as e:
|
||||
print(f"❌ Fehler beim Erstellen von '{path}': {e}")
|
||||
44
buzzer_tool/core/commands/rm.py
Normal file
44
buzzer_tool/core/commands/rm.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# core/commands/rm.py
|
||||
from core.connection import BuzzerError
|
||||
from core.commands.ls import get_file_tree
|
||||
|
||||
def _delete_recursive(conn, nodes):
|
||||
"""Löscht Knoten Bottom-Up (erst Dateien/Unterordner, dann den Ordner selbst)"""
|
||||
for node in nodes:
|
||||
if node["type"] == 'D':
|
||||
if "children" in node and node["children"]:
|
||||
_delete_recursive(conn, node["children"])
|
||||
_try_rm(conn, node["path"], is_dir=True)
|
||||
elif node["type"] == 'F':
|
||||
_try_rm(conn, node["path"], is_dir=False)
|
||||
|
||||
def _try_rm(conn, path, is_dir=False):
|
||||
icon = "📁" if is_dir else "📄"
|
||||
try:
|
||||
conn.send_command(f"rm {path}")
|
||||
print(f" 🗑️ {icon} Gelöscht: {path}")
|
||||
except BuzzerError as e:
|
||||
print(f" ❌ Fehler bei {path}: {e}")
|
||||
|
||||
def execute(conn, path: str, recursive: bool = False):
|
||||
"""Löscht eine Datei oder ein Verzeichnis."""
|
||||
if recursive:
|
||||
print(f"Sammle Dateibaum für rekursives Löschen von '{path}'...")
|
||||
# Lade den kompletten Baum ab diesem Pfad
|
||||
tree = get_file_tree(conn, target_path=path, recursive=True)
|
||||
|
||||
if len(tree) == 1 and tree[0].get("type") == "E":
|
||||
print(f"❌ Pfad nicht gefunden oder Fehler: {tree[0]['name']}")
|
||||
return
|
||||
|
||||
if not tree:
|
||||
print(f"Ordner '{path}' ist bereits leer.")
|
||||
else:
|
||||
_delete_recursive(conn, tree)
|
||||
|
||||
# Am Ende das eigentliche Ziel löschen (die Datei oder den nun leeren Ordner)
|
||||
try:
|
||||
conn.send_command(f"rm {path}")
|
||||
print(f"🗑️ '{path}' erfolgreich gelöscht.")
|
||||
except BuzzerError as e:
|
||||
print(f"❌ Fehler beim Löschen von '{path}': {e}")
|
||||
14
firmware/boards/nrf52840dk_nrf52840.prod.overlay
Normal file
14
firmware/boards/nrf52840dk_nrf52840.prod.overlay
Normal file
@@ -0,0 +1,14 @@
|
||||
/* 1. Hardware-Controller abschalten - das reicht meistens aus */
|
||||
&uart0 { status = "disabled"; };
|
||||
|
||||
/* 2. Spezialfall Bluetooth & IEEE 802.15.4 */
|
||||
/* Wir löschen die chosen-Einträge, damit das System nicht versucht,
|
||||
darauf zuzugreifen, falls die Stacks noch irgendwo aktiv sind */
|
||||
/ {
|
||||
chosen {
|
||||
/delete-property/ zephyr,console;
|
||||
/delete-property/ zephyr,shell-uart;
|
||||
/delete-property/ zephyr,uart-mcumgr;
|
||||
/delete-property/ zephyr,ieee802154;
|
||||
};
|
||||
};
|
||||
1
firmware/sysbuild.conf
Normal file
1
firmware/sysbuild.conf
Normal file
@@ -0,0 +1 @@
|
||||
SB_CONFIG_BOOTLOADER_MCUBOOT=y
|
||||
2
firmware/sysbuild/mcuboot.conf
Normal file
2
firmware/sysbuild/mcuboot.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
CONFIG_LOG=y
|
||||
CONFIG_MCUBOOT_LOG_LEVEL_INF=y
|
||||
Reference in New Issue
Block a user