From 99545a006cc1f61f14c78d231142acb1ea3e4bdc Mon Sep 17 00:00:00 2001 From: odaki Date: Sun, 12 Jan 2020 12:45:43 +0900 Subject: [PATCH] M46 "Show the assigned IP address" activated According to the reprap wiki, M46 has been assigned to display its assigned IP address, but has been disabled. Now that Toshiba FlashAir IP address processing is working, I activate the M46 code so that I can read the IP address information via serial. --- Firmware/Marlin_main.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 4970091e..fb0f1a1b 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5584,28 +5584,32 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /* + //! ### M46 - Show the assigned IP address (Prusa specific) + // -------------------------------------------------------------------- case 46: { // M46: Prusa3D: Show the assigned IP address. - uint8_t ip[4]; - bool hasIP = card.ToshibaFlashAir_GetIP(ip); - if (hasIP) { - SERIAL_ECHOPGM("Toshiba FlashAir current IP: "); - SERIAL_ECHO(int(ip[0])); - SERIAL_ECHOPGM("."); - SERIAL_ECHO(int(ip[1])); - SERIAL_ECHOPGM("."); - SERIAL_ECHO(int(ip[2])); - SERIAL_ECHOPGM("."); - SERIAL_ECHO(int(ip[3])); - SERIAL_ECHOLNPGM(""); + if (card.ToshibaFlashAir_isEnabled()) { + uint8_t ip[4]; + bool hasIP = card.ToshibaFlashAir_GetIP(ip); + if (hasIP) { + // SERIAL_PROTOCOLPGM("Toshiba FlashAir current IP: "); + SERIAL_PROTOCOL(int(ip[0])); + SERIAL_PROTOCOLPGM("."); + SERIAL_PROTOCOL(int(ip[1])); + SERIAL_PROTOCOLPGM("."); + SERIAL_PROTOCOL(int(ip[2])); + SERIAL_PROTOCOLPGM("."); + SERIAL_PROTOCOL(int(ip[3])); + SERIAL_PROTOCOLPGM("\n"); + } else { + SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); + } } else { - SERIAL_ECHOLNPGM("Toshiba FlashAir GetIP failed"); + SERIAL_PROTOCOLPGM("n/a\n"); } break; } - */ //! ### M47 - Show end stops dialog on the display (Prusa specific) // ----------------------------------------------------