-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ntp server ip to settings menu and ntp via dhcp support. Prepare …
…manual ntp server ip entry. Add M1702 gcode for setting ntp ip addr manually.
- Loading branch information
Showing
10 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ target_sources( | |
G64.cpp | ||
gcode.cpp | ||
M123.cpp | ||
M1702.cpp | ||
M300.cpp | ||
M330.cpp | ||
M340.cpp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @file | ||
*/ | ||
#include "../../lib/Marlin/Marlin/src/gcode/gcode.h" | ||
#include "../../lib/Marlin/Marlin/src/gcode/queue.h" | ||
#include "PrusaGcodeSuite.hpp" | ||
#include "selftest_esp.hpp" | ||
#include <sntp_client.h> | ||
/** | ||
* Set ntp server ip | ||
* | ||
* Used for setting the ntp server ip manually | ||
* | ||
* ## Parameters | ||
* | ||
* - `I` - Set ntp ip address, for example: `I "192.168.0.1"` | ||
*/ | ||
void PrusaGcodeSuite::M1702() { | ||
char ip_address[config_store_ns::lan_hostname_max_len + 1] = { 0 }; | ||
if (parser.seen('I')) { | ||
const char *ip_str = nullptr; | ||
if ((ip_str = strstr(parser.string_arg, "\"")) != nullptr) { | ||
++ip_str; | ||
strncpy(ip_address, ip_str, sizeof(ip_address)); | ||
for (char *fn = ip_address; *fn; ++fn) { | ||
if (*fn == '"') { | ||
*fn = '\0'; | ||
break; | ||
} | ||
} | ||
config_store().lan_ntp_server.set(ip_address); | ||
sntp_client_static_init(ip_address); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters