Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-05-13 11:05:29 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-05-13 11:05:29 +0300
commit78de00576edb980f6474cd4c1ef9cfc139a91137 (patch)
tree5741deb86f195cbd93c0f5c1ae06c4d9740fe545 /src/Networking
parent13b1fb468db27a98b1b528af09b6d8b37cf89a5c (diff)
Removed double use of C parameter in M589
We now use parameter L to set the clock value because C clashed with channel number
Diffstat (limited to 'src/Networking')
-rw-r--r--src/Networking/ESP8266WiFi/WiFiInterface.cpp59
1 files changed, 30 insertions, 29 deletions
diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.cpp b/src/Networking/ESP8266WiFi/WiFiInterface.cpp
index 6f46ccc8..8be20e71 100644
--- a/src/Networking/ESP8266WiFi/WiFiInterface.cpp
+++ b/src/Networking/ESP8266WiFi/WiFiInterface.cpp
@@ -1149,35 +1149,7 @@ GCodeResult WiFiInterface::HandleWiFiCode(int mcode, GCodeBuffer &gb, const Stri
}
case 589: // Configure access point
- if (gb.Seen('T'))
- {
- // Special code to set max transmitter power, 0 to 20.5dBm
- const float powerTimes4 = gb.GetFValue() * 4;
- if (powerTimes4 < 0.0 || powerTimes4 > 82.0)
- {
- reply.copy("Power setting out of range");
- }
- else
- {
- const int32_t rslt = SendCommand(NetworkCommand::networkSetTxPower, 0, (uint8_t)powerTimes4, 0, nullptr, 0, nullptr, 0);
- if (rslt == ResponseEmpty)
- {
- return GCodeResult::ok;
- }
- reply.printf("Failed to set maximum transmit power: %s", TranslateWiFiResponse(rslt));
- }
- }
- else if (gb.Seen('C'))
- {
- const uint32_t clockVal = gb.GetUIValue();
- const int32_t rslt = SendCommand(NetworkCommand::networkSetClockControl, 0, 0, clockVal, nullptr, 0, nullptr, 0);
- if (rslt == ResponseEmpty)
- {
- return GCodeResult::ok;
- }
- reply.printf("Failed to set clock: %s", TranslateWiFiResponse(rslt));
- }
- else if (gb.Seen('S'))
+ if (gb.Seen('S'))
{
// Configure access point parameters
WirelessConfigurationData config;
@@ -1217,6 +1189,35 @@ GCodeResult WiFiInterface::HandleWiFiCode(int mcode, GCodeBuffer &gb, const Stri
reply.printf("Failed to configure access point parameters: %s", TranslateWiFiResponse(rslt));
}
+ else if (gb.Seen('T'))
+ {
+ // Special code to set max transmitter power, 0 to 20.5dBm
+ const float powerTimes4 = gb.GetFValue() * 4;
+ if (powerTimes4 < 0.0 || powerTimes4 > 82.0)
+ {
+ reply.copy("Power setting out of range");
+ }
+ else
+ {
+ const int32_t rslt = SendCommand(NetworkCommand::networkSetTxPower, 0, (uint8_t)powerTimes4, 0, nullptr, 0, nullptr, 0);
+ if (rslt == ResponseEmpty)
+ {
+ return GCodeResult::ok;
+ }
+ reply.printf("Failed to set maximum transmit power: %s", TranslateWiFiResponse(rslt));
+ }
+ }
+ else if (gb.Seen('L'))
+ {
+ // Special code to configure SPI clock speed
+ const uint32_t clockVal = gb.GetUIValue();
+ const int32_t rslt = SendCommand(NetworkCommand::networkSetClockControl, 0, 0, clockVal, nullptr, 0, nullptr, 0);
+ if (rslt == ResponseEmpty)
+ {
+ return GCodeResult::ok;
+ }
+ reply.printf("Failed to set clock: %s", TranslateWiFiResponse(rslt));
+ }
else
{
// Report access point parameters