Index: AD5941_interface09302025/ad5941_library_extension.cpp =================================================================== diff -u -r27e8dd0f97a999fe4d0b60dd5f9d083455f93509 -rcddeaee04537fb518e201de8f8dbf957f168e71b --- AD5941_interface09302025/ad5941_library_extension.cpp (.../ad5941_library_extension.cpp) (revision 27e8dd0f97a999fe4d0b60dd5f9d083455f93509) +++ AD5941_interface09302025/ad5941_library_extension.cpp (.../ad5941_library_extension.cpp) (revision cddeaee04537fb518e201de8f8dbf957f168e71b) @@ -1479,6 +1479,7 @@ // Handle load command for doubles (format: load) if (command.startsWith("load")) { + handleLoadCommand(); return; } @@ -2470,19 +2471,8 @@ initStatus = INIT_STATUS_IN_PROGRESS; activeSerial->write((uint8_t *)&initStatus, sizeof(initStatus)); - // activeSerial->println("\nUnit Initialization"); - // activeSerial->println("Enter 'all' to initialize all units (1-6)"); - // activeSerial->println("Or enter specific units separated by commas (e.g., '1,3,5')"); - // activeSerial->println("Then press Enter:"); - - // // Wait for user input - // while (!activeSerial->available()) { - // // Wait for input - // delay(100); - // } - // Read the input - String input = activeSerial->readStringUntil('\n'); + String input = activeSerial->readStringUntil('\0'); input.trim(); // Remove any whitespace // Initialize all units @@ -2493,52 +2483,7 @@ initializeSingleUnit(unit); } isInitialized = true; - // Print summary of unit status - // printUnitStatusSummary(); - - // else { - // // Parse the comma-separated list - // activeSerial->print("Initializing selected units: "); - - // // Start at the beginning of the string - // int startPos = 0; - // int endPos; - - // // Parse each number in the comma-separated list - // while (startPos < input.length()) { - // // Find the next comma or the end of the string - // endPos = input.indexOf(',', startPos); - // if (endPos == -1) { - // endPos = input.length(); - // } - - // // Extract the unit number - // String unitStr = input.substring(startPos, endPos); - // unitStr.trim(); - - // // Convert to integer - // int unit = unitStr.toInt(); - - // // Check if it's a valid unit number - // if (unit >= 1 && unit <= 6) { - // activeSerial->print(unit); - // activeSerial->print(" "); - - // // Initialize this unit - // initializeSingleUnit(unit); - // } else { - // activeSerial->print("(Skipping invalid unit "); - // activeSerial->print(unitStr); - // activeSerial->print(") "); - // } - - // // Move to the position after the comma - // startPos = endPos + 1; - // } - - // activeSerial->println("\nSelected units initialization complete"); - - // Print summary of unit status + selectFirstWorkingUnit(); return isInitialized; }