From 710f1e815f53c551243f810b35651bb6fdac3603 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Wed, 4 Jan 2023 10:16:35 +0100 Subject: [PATCH] added stop function --- src/ntp_client.cpp | 6 +++++- src/ntp_client.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ntp_client.cpp b/src/ntp_client.cpp index 3a53db6..bc2ab15 100644 --- a/src/ntp_client.cpp +++ b/src/ntp_client.cpp @@ -36,4 +36,8 @@ void NtpClient::setDateTime() { while (!rtc_running()) { sleep_ms(500); } -} \ No newline at end of file +} + +void NtpClient::stop() { + sntp_stop(); +} diff --git a/src/ntp_client.h b/src/ntp_client.h index dd4da70..b4c81bc 100644 --- a/src/ntp_client.h +++ b/src/ntp_client.h @@ -9,6 +9,7 @@ extern "C" void set_system_time(u32_t sec); class NtpClient { public: static void setDateTime(); + static void stop(); private: NtpClient() {} // Disallow creating an instance of this object