Skip to content

Commit cea5dfb

Browse files
author
Martin Crossley
committed
Minor typos
1 parent 1cbc5e8 commit cea5dfb

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

pico_w/wifi/ntp_system_time/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
Creates a time of day clock that periodically synchronises itself to Internet time servers using simple NTP (see [RFC 4330](https://datatracker.ietf.org/doc/html/rfc4330)).
44

5-
The example connects to Wi-Fi and displays the local time in the UK or another timezone that you specify, synchronised once an hour to one of the servers from [ntp.pool.org](https://www.ntppool.org/en/).
5+
The example connects to Wi-Fi and displays the local time in the UK or another timezone that you specify, synchronised once an hour to one of the servers from [pool.ntp.org](https://www.ntppool.org/en/).
66

77
Uses the SNTP application provided by lwIP and the Pico 'always-on timer' _(RTC on Pico/rp2040, powman timer on Pico-2/rp2350)_.
88

99
# Running the example
1010

11-
First provide the SSID and password of your Wi-Fi network by editing `CmakeLists.txt` or from your environment; then build and run the example as usual.
11+
Provide the SSID and password of your Wi-Fi network by editing `CmakeLists.txt` or on the command line; then build and run the example as usual.
1212

1313
You should see something like this:
1414

@@ -56,7 +56,7 @@ The example uses:
5656

5757
### lwIP SNTP
5858

59-
The lwIP SNTP app provides a straightworward way to obtain and process timestamps from a pool of NTP servers without the complexity of a full NTP implementation. The lwIP documentation covers the [configuration options](https://www.nongnu.org/lwip/2_0_x/group__sntp.html) but the comments in the [source code](https://github.com/lwip-tcpip/lwip/blob/master/src/apps/sntp/sntp.c) are also very helpful.
59+
The lwIP SNTP app provides a straightforward way to obtain and process timestamps from a pool of NTP servers without the complexity of a full NTP implementation. The lwIP documentation covers the [configuration options](https://www.nongnu.org/lwip/2_0_x/group__sntp.html) but the comments in the [source code](https://github.com/lwip-tcpip/lwip/blob/master/src/apps/sntp/sntp.c) are also very helpful.
6060

6161
SNTP uses the **macros** `SNTP_GET_SYSTEM_TIME(sec, us)` and `SNTP_SET_SYSTEM_TIME(sec, us)` to call user-provided functions for accessing the system clock. The example defines the macros in `lwipopts.h` and the callbacks themselves are near the top of `ntp_system_time.c`.
6262

@@ -75,7 +75,7 @@ For further details refer to the [SDK documentation](https://www.raspberrypi.com
7575

7676
NTP timestamps always refer to universal coordinated time (UTC) in seconds past the epoch. In contrast users and user applications often require **local time**, which varies from region to region and at different times of the year (daylight-saving time or DST).
7777

78-
Converting from UTC to local time often requires inconventient rules, but fortunately however the Pico SDK time-conversion functions like `ctime()` and `pico_localtime_r()` do it automatically if you define a **POSIX timezone (TZ)**.
78+
Converting from UTC to local time often requires inconventient rules, but fortunately the Pico SDK time-conversion functions like `ctime()` and `pico_localtime_r()` can do it automatically if you define a **POSIX timezone (TZ)**.
7979

8080
The example shows a suitable definition for the Europe/London timezone:
8181
```

pico_w/wifi/ntp_system_time/ntp_system_time.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,7 @@ int get_time_utc(struct timespec *ts_ptr) {
6363
int main() {
6464
stdio_init_all();
6565

66-
// Set local timezone for London
67-
68-
// BST starts at 01:00 on the last Sunday in March and ends at 02:00 on the last Sunday in October
69-
70-
71-
// OPTIONAL: if you define a POSIX TZ here then the example will display local time instead of UTC.
66+
// If you (optionally) define a POSIX TZ here then the example will display local time instead of UTC.
7267
// For the format see https://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_node/libc_431.html
7368
setenv("TZ", "BST0GMT,M3.5.0/1,M10.5.0/2", 1); // <-- this is the timezone spec for Europe/London
7469
// there is no need to call tzset()

0 commit comments

Comments
 (0)