Skip to content

Commit 699796e

Browse files
author
Alasdair Allan
authored
Merge pull request raspberrypi#2196 from raspberrypi/whitespace_code_fixes
Fix up whitespace and code formatting (inspired by issue raspberrypi#2194)
2 parents 612ec75 + 353ea94 commit 699796e

File tree

15 files changed

+91
-55
lines changed

15 files changed

+91
-55
lines changed

documentation/asciidoc/accessories/sense-hat.adoc

+9-3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Taken from this https://www.raspberrypi.org/forums/viewtopic.php?f=104&t=109064&
6464
6565
Install the necessary software and run the calibration program as follows:
6666
67+
[,bash]
6768
----
6869
sudo apt update
6970
sudo apt install octave -y
@@ -75,7 +76,7 @@ RTIMULibCal
7576
7677
You will then see this menu:
7778
78-
....
79+
----
7980
Options are:
8081

8182
m - calibrate magnetometer with min/max
@@ -84,7 +85,7 @@ Options are:
8485
x - exit
8586

8687
Enter option:
87-
....
88+
----
8889
8990
Press lowercase `m`. The following message will then show; press any key to start.
9091
@@ -101,8 +102,10 @@ Press lowercase `m`. The following message will then show; press any key to star
101102
102103
After it starts, you will see something similar to this scrolling up the screen:
103104
105+
----
104106
Min x: 51.60 min y: 69.39 min z: 65.91
105107
Max x: 53.15 max y: 70.97 max z: 67.97
108+
----
106109
107110
Focus on the two lines at the very bottom of the screen, as these are the most recently posted measurements from the program.
108111
Now you have to move the Astro Pi around in every possible way you can think of. It helps if you unplug all non-essential cables to avoid clutter.
@@ -115,8 +118,11 @@ In addition to those steps, you can also do the ellipsoid fit by performing the
115118
116119
When you're done, copy the resulting `RTIMULib.ini` to /etc/ and remove the local copy in `~/.config/sense_hat/`:
117120
121+
[,bash]
122+
----
118123
rm ~/.config/sense_hat/RTIMULib.ini
119124
sudo cp RTIMULib.ini /etc
125+
----
120126
121127
You are now done.
122128
@@ -187,4 +193,4 @@ NOTE: These steps may not work on Raspberry Pi 2 Model B Rev 1.0 and Raspberry P
187193
i2cset -y -f 1 0x46 0xf3 0
188194
----
189195
190-
WARNING: Please note that this operation is potentially dangerous, and is not needed for the everyday user. The steps above are provided for debugging purposes only. If an error occurs, the HAT may no longer be automatically detected.
196+
WARNING: Please note that this operation is potentially dangerous, and is not needed for the everyday user. The steps above are provided for debugging purposes only. If an error occurs, the HAT may no longer be automatically detected.

documentation/asciidoc/computers/compute-module/cm-emmc-flashing.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ For a small percentage of Raspberry Pi Compute Module 3s, booting problems have
170170

171171
[,bash]
172172
----
173-
$ sudo parted /dev/<device>
173+
sudo parted /dev/<device>
174174
(parted) mkpart primary fat32 4MiB 64MiB
175175
(parted) q
176-
$ sudo mkfs.vfat -F32 /dev/<device>
177-
$ sudo cp -r <files>/* <mountpoint>
176+
sudo mkfs.vfat -F32 /dev/<device>
177+
sudo cp -r <files>/* <mountpoint>
178178
----

documentation/asciidoc/computers/config_txt/boot.adoc

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ These options specify the firmware files transferred to the VideoCore GPU prior
1212
These provide a shortcut to some alternative `start_file` and `fixup_file` settings, and are the recommended methods for selecting firmware configurations.
1313

1414
`start_x=1` implies
15-
`start_file=start_x.elf`
16-
`fixup_file=fixup_x.dat`
15+
----
16+
start_file=start_x.elf
17+
fixup_file=fixup_x.dat
18+
----
1719

1820
On the Pi 4, if the files `start4x.elf` and `fixup4x.dat` are present, these files will be used instead.
1921

2022
`start_debug=1` implies
21-
`start_file=start_db.elf`
22-
`fixup_file=fixup_db.dat`
23+
----
24+
start_file=start_db.elf
25+
fixup_file=fixup_db.dat
26+
----
2327

2428
`start_x=1` should be specified when using the camera module. Enabling the camera via `raspi-config` will set this automatically.
2529

documentation/asciidoc/computers/config_txt/conditional.adoc

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,17 @@ The conditional model filters are applied according to the following table.
4949

5050
These are particularly useful for defining different `kernel`, `initramfs`, and `cmdline` settings, as the Pi 1 and Pi 2 require different kernels. They can also be useful to define different overclocking settings, as the Pi 1 and Pi 2 have different default speeds. For example, to define separate `initramfs` images for each:
5151

52+
----
5253
[pi1]
5354
initramfs initrd.img-3.18.7+ followkernel
5455
[pi2]
5556
initramfs initrd.img-3.18.7-v7+ followkernel
5657
[all]
58+
----
5759

5860
Remember to use the `[all]` filter at the end, so that any subsequent settings aren't limited to Pi 2 hardware only.
5961

60-
It is important to note that the Raspberry Pi Zero W will see the contents of [pi0w] AND [pi0]. Likewise, a Raspberry Pi 3B Plus sees [pi3+] AND [pi3], and a Raspberry Pi 400 sees [pi400] AND [pi4]. If you want a setting to apply only to Pi Zero, Pi 3B or Pi 4B, you need to follow it (order is important) with a setting in the [pi0w], [pi3+] or [pi400] section that reverts it.
62+
It is important to note that the Raspberry Pi Zero W will see the contents of `[pi0w]` AND `[pi0]`. Likewise, a Raspberry Pi 3B Plus sees `[pi3+]` AND `[pi3]`, and a Raspberry Pi 400 sees `[pi400]` AND `[pi4]`. If you want a setting to apply only to Pi Zero, Pi 3B or Pi 4B, you need to follow it (order is important) with a setting in the `[pi0w]`, `[pi3+]` or `[pi400]` section that reverts it.
6163

6264
=== The `[none]` filter
6365

documentation/asciidoc/computers/configuration/device-tree.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ It is interesting to dump the contents of the DTB file to see what the compiler
234234

235235
[,console]
236236
----
237-
$ fdtdump 1st.dtbo
237+
fdtdump 1st.dtbo
238238
/dts-v1/;
239239
// magic: 0xd00dfeed
240240
// totalsize: 0x207 (519)
@@ -732,10 +732,10 @@ There are some new commands for managing overlays:
732732
[[part3.5.1]]
733733
===== The `dtoverlay` command
734734

735-
`dtoverlay` is a command line utility that loads and removes overlays while the system is running, as well as listing the available overlays and displaying their help information:
735+
`dtoverlay` is a command line utility that loads and removes overlays while the system is running, as well as listing the available overlays and displaying their help information.
736+
Use `dtoverlay -h` to get usage information:
736737

737738
----
738-
pi@raspberrypi ~ $ dtoverlay -h
739739
Usage:
740740
dtoverlay <overlay> [<param>=<val>...]
741741
Add an overlay (with parameters)

documentation/asciidoc/computers/getting-started/installing-from-mac.adoc

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Insert the SD card in the slot, or connect the SD card reader with the SD card i
99

1010
[source,bash]
1111
----
12-
$ diskutil list
1312
/dev/disk0 (internal):
1413
#: TYPE NAME SIZE IDENTIFIER
1514
0: GUID_partition_scheme 500.3 GB disk0

documentation/asciidoc/computers/linux_kernel/configuring.adoc

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,32 @@ Configuration is most commonly done through the `make menuconfig` interface. Alt
88

99
The `menuconfig` tool requires the `ncurses` development headers to compile properly. These can be installed with the following command:
1010

11-
$ sudo apt install libncurses5-dev
11+
[,bash]
12+
----
13+
sudo apt install libncurses5-dev
14+
----
1215

1316
You'll also need to download and prepare your kernel sources, as described in the xref:linux_kernel.adoc#choosing_sources[build guide]. In particular, ensure you have installed the xref:linux_kernel.adoc#default_configuration[default configuration].
1417

1518
=== Using `menuconfig`
1619

1720
Once you've got everything set up and ready to go, you can compile and run the `menuconfig` utility as follows:
1821

19-
$ make menuconfig
22+
[,bash]
23+
----
24+
make menuconfig
25+
----
2026

2127
If you're cross-compiling a 32-bit kernel:
2228

29+
[,bash]
2330
----
2431
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
2532
----
2633

2734
Or, if you are cross-compiling a 64-bit kernel:
2835

36+
[,bash]
2937
----
3038
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
3139
----

documentation/asciidoc/computers/linux_kernel/headers.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ If you are compiling a kernel module or similar, you will need the Linux Kernel
44

55
If you have cloned the entire kernel from github, the headers are already included in the source tree. If you don't need all the extra files, it is possible to install only the kernel headers from the Raspberry Pi OS repo.
66

7-
[source]
7+
[,bash]
88
----
9-
$ sudo apt install raspberrypi-kernel-headers
9+
sudo apt install raspberrypi-kernel-headers
1010
----
1111
1212
NOTE: It can take quite a while for this command to complete, as it installs a lot of small files. There is no progress indicator.

documentation/asciidoc/computers/linux_kernel/patching.adoc

+11-12
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,43 @@ Patchsets are often provided with newer hardware as a temporary measure, before
66

77
=== Version Identification
88

9-
It's important to check what version of the kernel you have when downloading and applying patches. In a kernel source directory, the following command will show you the version the sources relate to:
9+
It's important to check what version of the kernel you have when downloading and applying patches. In a kernel source directory, running `head Makefile -n 3` will show you the version the sources relate to:
1010

1111
[source]
1212
----
13-
$ head Makefile -n 3
1413
VERSION = 3
1514
PATCHLEVEL = 10
1615
SUBLEVEL = 25
1716
----
18-
17+
1918
In this instance, the sources are for a 3.10.25 kernel. You can see what version you're running on your system with the `uname -r` command.
2019

2120
=== Applying Patches
2221

2322
How you apply patches depends on the format in which the patches are made available. Most patches are a single file, and applied with the `patch` utility. For example, let's download and patch our example kernel version with the real-time kernel patches:
2423

25-
[source]
24+
[,bash]
2625
----
27-
$ wget https://www.kernel.org/pub/linux/kernel/projects/rt/3.10/older/patch-3.10.25-rt23.patch.gz
28-
$ gunzip patch-3.10.25-rt23.patch.gz
29-
$ cat patch-3.10.25-rt23.patch | patch -p1
26+
wget https://www.kernel.org/pub/linux/kernel/projects/rt/3.10/older/patch-3.10.25-rt23.patch.gz
27+
gunzip patch-3.10.25-rt23.patch.gz
28+
cat patch-3.10.25-rt23.patch | patch -p1
3029
----
3130

3231
In our example we simply download the file, uncompress it, and then pass it to the `patch` utility using the `cat` tool and a Unix pipe.
3332

3433
Some patchsets come as mailbox-format patchsets, arranged as a folder of patch files. We can use Git to apply these patches to our kernel, but first we must configure Git to let it know who we are when we make these changes:
3534

36-
[source]
35+
[,bash]
3736
----
38-
$ git config --global user.name "Your name"
39-
$ git config --global user.email "your email in here"
37+
git config --global user.name "Your name"
38+
git config --global user.email "your email in here"
4039
----
4140

4241
Once we've done this we can apply the patches:
4342

44-
[source]
43+
[,bash]
4544
----
46-
$ git am -3 /path/to/patches/*
45+
git am -3 /path/to/patches/*
4746
----
4847

4948
If in doubt, consult with the distributor of the patches, who should tell you how to apply them. Some patchsets will require a specific commit to patch against; follow the details provided by the patch distributor.

documentation/asciidoc/computers/raspberry-pi/boot-net.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ If you put all your files into the root of your tftp directory then all followin
2727
2828
The first thing to check is that the OTP bit is correctly programmed. To do this, you need to add `program_usb_boot_mode=1` to config.txt and reboot (with a standard SD card that boots correctly into Raspberry Pi OS). Once you've done this, you should be able to do:
2929
30-
$ vcgencmd otp_dump | grep 17:
31-
17:3020000a
30+
[,bash]
31+
----
32+
vcgencmd otp_dump | grep 17:
33+
----
3234
33-
If row 17 contains that value then the OTP is correctly programmed. You should now be able to remove the SD card, plug in Ethernet,
35+
If row 17 contains `3020000a` then the OTP is correctly programmed. You should now be able to remove the SD card, plug in Ethernet,
3436
and then the Ethernet LEDs should light up around 5 seconds after the Pi powers up.
3537
3638
To capture the ethernet packets on the server, use tcpdump on the tftpboot server (or DHCP server if they are different). You will need to capture the packets there otherwise you will not be able to see packets that get sent directly because network switches are not hubs!

documentation/asciidoc/computers/raspberry-pi/bootmodes.adoc

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@ For information on enabling the UART on the Pi4 bootloader, please see xref:rasp
2222

2323
It is possible to enable an early stage UART to debug booting issues (useful with the above bootcode.bin only boot mode). To do this, make sure you've got a recent version of the firmware (including bootcode.bin). To check if UART is supported in your current firmware:
2424

25-
[source]
25+
[,bash]
2626
----
27-
$ strings bootcode.bin | grep BOOT_UART
28-
BOOT_UART=0
27+
strings bootcode.bin | grep BOOT_UART
2928
----
3029

3130
To enable UART from bootcode.bin use:
3231

33-
[source]
32+
[,bash]
3433
----
3534
sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" bootcode.bin
3635
----

documentation/asciidoc/computers/raspberry-pi/frequency-management.adoc

+5-4
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,19 @@ In addition, a more stepped CPU governor is also used to produce finer-grained c
3535

3636
The default CPU governor is `ondemand`, the governor can be manually changed with the `cpufreq-set` command (from the `cpufrequtils` package) to reduce idle power consumption:
3737

38+
[,bash]
3839
----
39-
$ sudo apt install cpufrequtils
40-
$ sudo cpufreq-set -g powersave
40+
sudo apt install cpufrequtils
41+
sudo cpufreq-set -g powersave
4142
----
4243

4344
=== Measuring Temperatures
4445

4546
Due to the architecture of the SoCs used on the Raspberry Pi range, and the use of the upstream temperature monitoring code in the Raspberry Pi OS distribution, Linux-based temperature measurements can be inaccurate. However, the `vcgencmd` command provides an accurate and instantaneous reading of the current SoC temperature as it communicates with the GPU directly:
4647

47-
[source]
48+
[,bash]
4849
----
49-
$ vcgencmd measure_temp
50+
vcgencmd measure_temp
5051
----
5152

5253
=== Adding Heatsinks

documentation/asciidoc/computers/raspberry-pi/raspberry-pi-industrial.adoc

+24-7
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ The Raspberry Pi is often used as part of another product. This documentation de
66

77
There are a number of OTP values that can be used. To see a list of all the xref:raspberry-pi.adoc#otp-register-and-bit-definitions[OTP values], you can use:
88

9+
[,bash]
910
----
10-
pi@raspberrypi:~ $ vcgencmd otp_dump
11+
vcgencmd otp_dump
1112
----
1213

1314
Some interesting lines from this dump are:
@@ -22,8 +23,14 @@ To program these bits, you will need to use the vcmailbox. This is a Linux drive
2223

2324
The vcmailbox application can be used directly from the command line on a Raspberry Pi Raspberry Pi OS build. An example usage would be:
2425

26+
[,bash]
27+
----
28+
/opt/vc/bin/vcmailbox 0x00010004 8 8 0 0
29+
----
30+
31+
which will return something like:
32+
2533
----
26-
pi@raspberrypi:~ $ /opt/vc/bin/vcmailbox 0x00010004 8 8 0 0
2734
0x00000020 0x80000000 0x00010004 0x00000008 0x800000008 0xnnnnnnnn 0x00000000 0x00000000
2835
----
2936

@@ -35,8 +42,9 @@ WARNING: The OTP values are One-Time Programmable, once a bit has been changed f
3542

3643
To set the customer OTP values you will need to use the `SET_CUSTOMER_OTP` (0x38021) tag as follows:
3744

45+
[,bash]
3846
----
39-
pi@raspberrypi:~ $ /opt/vc/bin/vcmailbox 0x00038021 [8 + number * 4] [8 + number * 4] [start_num] [number] [value] [value] [value] ...
47+
/opt/vc/bin/vcmailbox 0x00038021 [8 + number * 4] [8 + number * 4] [start_num] [number] [value] [value] [value] ...
4048
----
4149

4250
* `start_num` = the first row to program from 0-7
@@ -45,16 +53,23 @@ pi@raspberrypi:~ $ /opt/vc/bin/vcmailbox 0x00038021 [8 + number * 4] [8 + number
4553

4654
So, to program OTP customer rows 4, 5, and 6 to 0x11111111, 0x22222222, 0x33333333 respectively, you would use:
4755

56+
[,bash]
4857
----
49-
pi@raspberrypi:~ $ /opt/vc/bin/vcmailbox 0x00038021 20 20 4 3 0x11111111 0x22222222 0x33333333
58+
/opt/vc/bin/vcmailbox 0x00038021 20 20 4 3 0x11111111 0x22222222 0x33333333
5059
----
5160

5261
This will then program rows 40, 41, and 42.
5362

5463
To read the values back, you can use:
5564

65+
[,bash]
66+
----
67+
/opt/vc/bin/vcmailbox 0x00030021 20 20 4 3 0 0 0
68+
----
69+
70+
which should display:
71+
5672
----
57-
pi@raspberrypi:~ $ /opt/vc/bin/vcmailbox 0x00030021 20 20 4 3 0 0 0
5873
0x0000002c 0x80000000 0x00030021 0x00000014 0x80000014 0x00000000 0x00000003 0x11111111 0x22222222 0x33333333
5974
----
6075

@@ -64,8 +79,9 @@ If you'd like to integrate this functionality into your own code, you should be
6479

6580
It is possible to lock the OTP changes to avoid them being edited again. This can be done using a special argument with the OTP write mailbox:
6681

82+
[,bash]
6783
----
68-
pi@raspberrypi:~ $ /opt/vc/bin/vcmailbox 0x00038021 8 8 0xffffffff 0xaffe0000
84+
/opt/vc/bin/vcmailbox 0x00038021 8 8 0xffffffff 0xaffe0000
6985
----
7086

7187
Once locked, the customer OTP values can no longer be altered. Note that this locking operation is irreversible.
@@ -74,8 +90,9 @@ Once locked, the customer OTP values can no longer be altered. Note that this lo
7490

7591
It is possible to prevent the customer OTP bits from being read at all. This can be done using a special argument with the OTP write mailbox:
7692

93+
[,bash]
7794
----
78-
pi@raspberrypi:~ $ /opt/vc/bin/vcmailbox 0x00038021 8 8 0xffffffff 0xaffebabe
95+
/opt/vc/bin/vcmailbox 0x00038021 8 8 0xffffffff 0xaffebabe
7996
----
8097

8198
This operation is unlikely to be useful for the vast majority of users, and is irreversible.

0 commit comments

Comments
 (0)