Skip to content

Commit 1d4b4f0

Browse files
jimmodpgeorge
authored andcommitted
ports: Standardise docs link in help text.
Updates all `help()` output to use the phrase: `For online docs please visit http://docs.micropython.org/` Some ports previously used different wording, some pointed to the wrong link. Also make all ports use `help.c` for consistency. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <[email protected]>
1 parent 7a17596 commit 1d4b4f0

File tree

16 files changed

+152
-93
lines changed

16 files changed

+152
-93
lines changed

ports/cc3200/misc/help.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
#include "py/builtin.h"
2929

3030
const char cc3200_help_text[] = "Welcome to MicroPython!\n"
31-
"For online help please visit http://micropython.org/help/.\n"
31+
"For online docs please visit http://docs.micropython.org/\n"
3232
"For further help on a specific object, type help(obj)\n";

ports/esp32/help.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
const char esp32_help_text[] =
3232
"Welcome to MicroPython on the ESP32!\n"
3333
"\n"
34-
"For generic online docs please visit http://docs.micropython.org/\n"
34+
"For online docs please visit http://docs.micropython.org/\n"
3535
"\n"
3636
"For access to the hardware use the 'machine' module:\n"
3737
"\n"

ports/esp8266/help.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
const char esp_help_text[] =
3030
"Welcome to MicroPython!\n"
3131
"\n"
32-
"For online docs please visit http://docs.micropython.org/en/latest/esp8266/ .\n"
32+
"For online docs please visit http://docs.micropython.org/\n"
33+
"\n"
3334
"For diagnostic information to include in bug reports execute 'import port_diag'.\n"
3435
"\n"
3536
"Basic WiFi configuration:\n"

ports/mimxrt/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ SRC_C += \
191191
fatfs_port.c \
192192
flash.c \
193193
hal/pwm_backport.c \
194+
help.c \
194195
led.c \
195196
machine_adc.c \
196197
machine_bitstream.c \

ports/mimxrt/help.c

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2023 Damien P. George
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "py/builtin.h"
28+
29+
const char mimxrt_help_text[] =
30+
"Welcome to MicroPython!\n"
31+
"\n"
32+
"For online docs please visit http://docs.micropython.org/\n"
33+
"\n"
34+
"For access to the hardware use the 'machine' module. \n"
35+
"\n"
36+
"Quick overview of some objects:\n"
37+
" machine.Pin(pin) -- get a pin, eg machine.Pin(0)\n"
38+
" machine.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p\n"
39+
" methods: init(..), value([v]), high(), low())\n"
40+
"\n"
41+
" Pins are numbered board specific, either 0-n, or 'D0'-'Dn', or 'A0' - 'An',\n"
42+
" according to the boards's pinout sheet.\n"
43+
" Pin IO modes are: Pin.IN, Pin.OUT, Pin.OPEN_DRAIN\n"
44+
" Pin pull modes are: Pin.PULL_UP, Pin.PULL_UP_47K, Pin.PULL_UP_22K, Pin.PULL_DOWN, Pin.PULL_HOLD\n"
45+
" machine.ADC(pin) -- make an analog object from a pin\n"
46+
" methods: read_u16()\n"
47+
" machine.UART(id, baudrate=115200) -- create an UART object (id=1 - 8, board-specific)\n"
48+
" methods: init(), write(buf), any()\n"
49+
" buf=read(n), readinto(buf), buf=readline()\n"
50+
" The RX and TX pins are fixed and board-specific.\n"
51+
" machine.SoftI2C() -- create a Soft I2C object\n"
52+
" machine.I2C(id) -- create a HW I2C object\n"
53+
" methods: readfrom(addr, buf, stop=True), writeto(addr, buf, stop=True)\n"
54+
" readfrom_mem(addr, memaddr, arg), writeto_mem(addr, memaddr, arg)\n"
55+
" SoftI2C allows to use any pin for sda and scl, HW I2C id's and pins are fixed\n"
56+
" machine.SoftSPI(baudrate=1000000) -- create a Soft SPI object\n"
57+
" machine.SPI(id, baudrate=1000000) -- create a HW SPI object\n"
58+
" methods: read(nbytes, write=0x00), write(buf), write_readinto(wr_buf, rd_buf)\n"
59+
" SoftSPI allows to use any pin for SPI, HW SPI id's and pins are fixed\n"
60+
" machine.Timer(id, freq, callback) -- create a hardware timer object (id=0,1,2)\n"
61+
" eg: machine.Timer(freq=1, callback=lambda t:print(t))\n"
62+
" machine.RTC() -- create a Real Time Clock object\n"
63+
" methods: init(), datetime([dateime_tuple]), now()\n"
64+
" machine.PWM(pin, freq, duty_u16[, kw_opts]) -- create a PWM object\n"
65+
" methods: init(), duty_u16([value]), duty_ns([value]), freq([value])\n"
66+
"\n"
67+
"Useful control commands:\n"
68+
" CTRL-C -- interrupt a running program\n"
69+
" CTRL-D -- on a blank line, do a soft reset of the board\n"
70+
" CTRL-E -- on a blank line, enter paste mode\n"
71+
"\n"
72+
"For further help on a specific object, type help(obj)\n"
73+
"For a list of available modules, type help('modules')\n"
74+
;

ports/mimxrt/main.c

-47
Original file line numberDiff line numberDiff line change
@@ -151,50 +151,3 @@ void MP_WEAK __assert_func(const char *file, int line, const char *func, const c
151151
}
152152
}
153153
#endif
154-
155-
const char mimxrt_help_text[] =
156-
"Welcome to MicroPython!\n"
157-
"\n"
158-
"For online help please visit https://micropython.org/help/.\n"
159-
"\n"
160-
"For access to the hardware use the 'machine' module. \n"
161-
"\n"
162-
"Quick overview of some objects:\n"
163-
" machine.Pin(pin) -- get a pin, eg machine.Pin(0)\n"
164-
" machine.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p\n"
165-
" methods: init(..), value([v]), high(), low())\n"
166-
"\n"
167-
" Pins are numbered board specific, either 0-n, or 'D0'-'Dn', or 'A0' - 'An',\n"
168-
" according to the boards's pinout sheet.\n"
169-
" Pin IO modes are: Pin.IN, Pin.OUT, Pin.OPEN_DRAIN\n"
170-
" Pin pull modes are: Pin.PULL_UP, Pin.PULL_UP_47K, Pin.PULL_UP_22K, Pin.PULL_DOWN, Pin.PULL_HOLD\n"
171-
" machine.ADC(pin) -- make an analog object from a pin\n"
172-
" methods: read_u16()\n"
173-
" machine.UART(id, baudrate=115200) -- create an UART object (id=1 - 8, board-specific)\n"
174-
" methods: init(), write(buf), any()\n"
175-
" buf=read(n), readinto(buf), buf=readline()\n"
176-
" The RX and TX pins are fixed and board-specific.\n"
177-
" machine.SoftI2C() -- create a Soft I2C object\n"
178-
" machine.I2C(id) -- create a HW I2C object\n"
179-
" methods: readfrom(addr, buf, stop=True), writeto(addr, buf, stop=True)\n"
180-
" readfrom_mem(addr, memaddr, arg), writeto_mem(addr, memaddr, arg)\n"
181-
" SoftI2C allows to use any pin for sda and scl, HW I2C id's and pins are fixed\n"
182-
" machine.SoftSPI(baudrate=1000000) -- create a Soft SPI object\n"
183-
" machine.SPI(id, baudrate=1000000) -- create a HW SPI object\n"
184-
" methods: read(nbytes, write=0x00), write(buf), write_readinto(wr_buf, rd_buf)\n"
185-
" SoftSPI allows to use any pin for SPI, HW SPI id's and pins are fixed\n"
186-
" machine.Timer(id, freq, callback) -- create a hardware timer object (id=0,1,2)\n"
187-
" eg: machine.Timer(freq=1, callback=lambda t:print(t))\n"
188-
" machine.RTC() -- create a Real Time Clock object\n"
189-
" methods: init(), datetime([dateime_tuple]), now()\n"
190-
" machine.PWM(pin, freq, duty_u16[, kw_opts]) -- create a PWM object\n"
191-
" methods: init(), duty_u16([value]), duty_ns([value]), freq([value])\n"
192-
"\n"
193-
"Useful control commands:\n"
194-
" CTRL-C -- interrupt a running program\n"
195-
" CTRL-D -- on a blank line, do a soft reset of the board\n"
196-
" CTRL-E -- on a blank line, enter paste mode\n"
197-
"\n"
198-
"For further help on a specific object, type help(obj)\n"
199-
"For a list of available modules, type help('modules')\n"
200-
;

ports/nrf/help.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
const char nrf5_help_text[] =
3535
"Welcome to MicroPython!\n"
3636
"\n"
37-
"For online help please visit http://micropython.org/help/.\n"
37+
"For online docs please visit http://docs.micropython.org/\n"
3838
"\n"
3939
"Quick overview of commands for the board:\n"
4040
#if MICROPY_HW_HAS_LED

ports/renesas-ra/help.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
const char ra_help_text[] =
3131
"Welcome to MicroPython for Renesas RA!\n"
3232
"\n"
33-
"For online docs please visit http://docs.micropython.org/.\n"
33+
"For online docs please visit http://docs.micropython.org/\n"
3434
"\n"
3535
"For access to hardware please use machine module.\n"
3636
"import machine\n"

ports/rp2/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ set(MICROPY_SOURCE_DRIVERS
114114

115115
set(MICROPY_SOURCE_PORT
116116
fatfs_port.c
117+
help.c
117118
machine_adc.c
118119
machine_bitstream.c
119120
machine_i2c.c

ports/rp2/help.c

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2023 Damien P. George
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "py/builtin.h"
28+
29+
const char rp2_help_text[] =
30+
"Welcome to MicroPython!\n"
31+
"\n"
32+
"For online docs please visit http://docs.micropython.org/\n"
33+
"\n"
34+
"For access to the hardware use the 'machine' module. RP2 specific commands\n"
35+
"are in the 'rp2' module.\n"
36+
"\n"
37+
"Quick overview of some objects:\n"
38+
" machine.Pin(pin) -- get a pin, eg machine.Pin(0)\n"
39+
" machine.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p\n"
40+
" methods: init(..), value([v]), high(), low(), irq(handler)\n"
41+
" machine.ADC(pin) -- make an analog object from a pin\n"
42+
" methods: read_u16()\n"
43+
" machine.PWM(pin) -- make a PWM object from a pin\n"
44+
" methods: deinit(), freq([f]), duty_u16([d]), duty_ns([d])\n"
45+
" machine.I2C(id) -- create an I2C object (id=0,1)\n"
46+
" methods: readfrom(addr, buf, stop=True), writeto(addr, buf, stop=True)\n"
47+
" readfrom_mem(addr, memaddr, arg), writeto_mem(addr, memaddr, arg)\n"
48+
" machine.SPI(id, baudrate=1000000) -- create an SPI object (id=0,1)\n"
49+
" methods: read(nbytes, write=0x00), write(buf), write_readinto(wr_buf, rd_buf)\n"
50+
" machine.Timer(freq, callback) -- create a software timer object\n"
51+
" eg: machine.Timer(freq=1, callback=lambda t:print(t))\n"
52+
"\n"
53+
"Pins are numbered 0-29, and 26-29 have ADC capabilities\n"
54+
"Pin IO modes are: Pin.IN, Pin.OUT, Pin.ALT\n"
55+
"Pin pull modes are: Pin.PULL_UP, Pin.PULL_DOWN\n"
56+
"\n"
57+
"Useful control commands:\n"
58+
" CTRL-C -- interrupt a running program\n"
59+
" CTRL-D -- on a blank line, do a soft reset of the board\n"
60+
" CTRL-E -- on a blank line, enter paste mode\n"
61+
"\n"
62+
"For further help on a specific object, type help(obj)\n"
63+
"For a list of available modules, type help('modules')\n"
64+
;

ports/rp2/main.c

-37
Original file line numberDiff line numberDiff line change
@@ -260,40 +260,3 @@ uint32_t rosc_random_u32(void) {
260260
}
261261
return value;
262262
}
263-
264-
const char rp2_help_text[] =
265-
"Welcome to MicroPython!\n"
266-
"\n"
267-
"For online help please visit https://micropython.org/help/.\n"
268-
"\n"
269-
"For access to the hardware use the 'machine' module. RP2 specific commands\n"
270-
"are in the 'rp2' module.\n"
271-
"\n"
272-
"Quick overview of some objects:\n"
273-
" machine.Pin(pin) -- get a pin, eg machine.Pin(0)\n"
274-
" machine.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p\n"
275-
" methods: init(..), value([v]), high(), low(), irq(handler)\n"
276-
" machine.ADC(pin) -- make an analog object from a pin\n"
277-
" methods: read_u16()\n"
278-
" machine.PWM(pin) -- make a PWM object from a pin\n"
279-
" methods: deinit(), freq([f]), duty_u16([d]), duty_ns([d])\n"
280-
" machine.I2C(id) -- create an I2C object (id=0,1)\n"
281-
" methods: readfrom(addr, buf, stop=True), writeto(addr, buf, stop=True)\n"
282-
" readfrom_mem(addr, memaddr, arg), writeto_mem(addr, memaddr, arg)\n"
283-
" machine.SPI(id, baudrate=1000000) -- create an SPI object (id=0,1)\n"
284-
" methods: read(nbytes, write=0x00), write(buf), write_readinto(wr_buf, rd_buf)\n"
285-
" machine.Timer(freq, callback) -- create a software timer object\n"
286-
" eg: machine.Timer(freq=1, callback=lambda t:print(t))\n"
287-
"\n"
288-
"Pins are numbered 0-29, and 26-29 have ADC capabilities\n"
289-
"Pin IO modes are: Pin.IN, Pin.OUT, Pin.ALT\n"
290-
"Pin pull modes are: Pin.PULL_UP, Pin.PULL_DOWN\n"
291-
"\n"
292-
"Useful control commands:\n"
293-
" CTRL-C -- interrupt a running program\n"
294-
" CTRL-D -- on a blank line, do a soft reset of the board\n"
295-
" CTRL-E -- on a blank line, enter paste mode\n"
296-
"\n"
297-
"For further help on a specific object, type help(obj)\n"
298-
"For a list of available modules, type help('modules')\n"
299-
;

ports/samd/help.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
const char samd_help_text[] =
3030
"Welcome to MicroPython!\n"
3131
"\n"
32-
"For online docs please visit http://docs.micropython.org/en/latest/samd/ .\n"
32+
"For online docs please visit http://docs.micropython.org/\n"
3333
"\n"
3434
"Control commands:\n"
3535
" CTRL-A -- on a blank line, enter raw REPL mode\n"

ports/stm32/factoryreset.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static const char fresh_readme_txt[] =
7575
" - Mac OS X: use the command: screen /dev/tty.usbmodem*\r\n"
7676
" - Linux: use the command: screen /dev/ttyACM0\r\n"
7777
"\r\n"
78-
"Please visit http://micropython.org/help/ for further help.\r\n"
78+
"For online docs please visit http://docs.micropython.org/\r\n"
7979
;
8080
#endif
8181

ports/stm32/help.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
const char stm32_help_text[] =
3030
"Welcome to MicroPython!\n"
3131
"\n"
32-
"For online help please visit http://micropython.org/help/.\n"
32+
"For online docs please visit http://docs.micropython.org/\n"
3333
"\n"
3434
"Quick overview of commands for the board:\n"
3535
" pyb.info() -- print some general information\n"

ports/teensy/help.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
const char teensy_help_text[] =
3030
"Welcome to MicroPython!\n"
3131
"\n"
32-
"For online help please visit http://micropython.org/help/.\n"
32+
"For online docs please visit http://docs.micropython.org/\n"
3333
"\n"
3434
"Quick overview of commands for the board:\n"
3535
" pyb.info() -- print some general information\n"

ports/zephyr/help.c

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
const char zephyr_help_text[] =
3030
"Welcome to MicroPython!\n"
3131
"\n"
32+
"For online docs please visit http://docs.micropython.org/\n"
33+
"\n"
3234
"Control commands:\n"
3335
" CTRL-A -- on a blank line, enter raw REPL mode\n"
3436
" CTRL-B -- on a blank line, enter normal REPL mode\n"

0 commit comments

Comments
 (0)