Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

minor fixes

Geod0dc1bb0a573
diff --git a/src/Controllers/SpiController.cpp b/src/Controllers/SpiController.cpp
index ea17a752..bc1b98b1 100644
--- a/src/Controllers/SpiController.cpp
+++ b/src/Controllers/SpiController.cpp
@@ -662,6 +662,7 @@ void SpiController::handleSdCard() {
terminalView.println("SD Card: Mounting...");
delay(500); // let the user see this ^
+ spiService.end();
bool success = sdService.configure(
state.getSpiCLKPin(),
state.getSpiMISOPin(),
@@ -692,7 +693,7 @@ void SpiController::handleSdCard() {
}
// Close and reconfigure
- sdService.close();
+ sdService.end();
spiService.end();
ensureConfigured();
}
@@ -753,6 +754,7 @@ void SpiController::ensureConfigured() {
}
spiService.end();
+ sdService.end();
// Reconfigure, user could have used these pins for another mode
uint8_t sclk = state.getSpiCLKPin();
uint8_t miso = state.getSpiMISOPin();
diff --git a/src/Controllers/TwoWireController.cpp b/src/Controllers/TwoWireController.cpp
index 2c3492b6..217451b4 100644
--- a/src/Controllers/TwoWireController.cpp
+++ b/src/Controllers/TwoWireController.cpp
@@ -152,6 +152,9 @@ void TwoWireController::handleConfig() {
configured = true;
terminalView.println("2WIRE configuration applied.\n");
+
+ terminalView.println(" [INFO] This mode is not implemented yet.");
+ terminalView.println(" Support is planned for a future release.\n");
}
/*
diff --git a/src/Controllers/UartController.cpp b/src/Controllers/UartController.cpp
index 4a71ec55..32a7d770 100644
--- a/src/Controllers/UartController.cpp
+++ b/src/Controllers/UartController.cpp
@@ -433,10 +433,14 @@ void UartController::handleXmodemSend(const std::string& path) {
terminalView.println("UART XMODEM: Sending...");
bool ok = uartService.xmodemSendFile(file);
file.close();
- sdService.close();
+ sdService.end();
- // result
- terminalView.println(ok ? "UART XMODEM: Success, file is transferred" : "UART XMODEM: Failed to transfer file");
+ // Result
+ terminalView.println(ok ? "\nUART XMODEM: Success, file is transferred" : "\nUART XMODEM: Failed to transfer file");
+
+ // Close Xmodem
+ uartService.end();
+ ensureConfigured();
}
void UartController::handleXmodemReceive(const std::string& path) {
@@ -470,13 +474,17 @@ void UartController::handleXmodemReceive(const std::string& path) {
terminalView.println("UART XMODEM: Receiving...");
bool ok = uartService.xmodemReceiveToFile(file);
file.close();
- sdService.close();
+ sdService.end();
// Result
terminalView.println("");
terminalView.println(ok ?
("UART XMODEM: Receive OK, File saved to " + path) :
"UART XMODEM: Receive failed");
+
+ // Close Xmodem
+ uartService.end();
+ ensureConfigured();
}
/*
diff --git a/src/Views/SerialTerminalView.cpp b/src/Views/SerialTerminalView.cpp
index 64a2bc46..358c665e 100644
--- a/src/Views/SerialTerminalView.cpp
+++ b/src/Views/SerialTerminalView.cpp
@@ -48,7 +48,7 @@ void SerialTerminalView::clear() {
}
void SerialTerminalView::waitPress() {
- Serial.println("\n\nPress any key to start...");
+ Serial.println("\n\n\rPress any key to start...");
}
void SerialTerminalView::setBaudrate(unsigned long baud) {
diff --git a/src/main.cpp b/src/main.cpp
index 668ba436..94f28c64 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,7 +36,6 @@ void setup() {
auto cfg = M5.config();
M5Cardputer.begin(cfg, true);
deviceView.setRotation(1);
- M5Cardputer.Speaker.end();
CardputerInput deviceInput;
#endif