Skip to content

Commit 120e1a9

Browse files
committed
Fix typos in documentation
The "codespell" spellchecker tool is used to automatically detect commonly misspelled words in the files of this project. The misspelled words dictionary was expanded in the latest release of codespell, which resulted in the detection of a misspelled word in the project's comments: > Error: ./docs/threadsafe-serial.md:51: pre-emptive ==> preemptive > Codespell found one or more problems The typo is hereby corrected, which will restore the spell check to a passing state. --- I supplemented the correction of the automatically detected typo with a general review of the documentation content, fixing the additional typos I identified during that review.
1 parent 1aa4dd6 commit 120e1a9

24 files changed

+66
-66
lines changed

Diff for: .github/workflows/compile-examples.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,22 @@ jobs:
6868

6969
# it's necessary to checkout the platform before installing it so that the ArduinoCore-API dependency can be added
7070
- name: Checkout ArduinoCore-mbed
71-
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
71+
# this step only needed when the Arduino Mbed OS Boards platform sourced from the repository is being used
7272
uses: actions/checkout@v4
7373
with:
7474
repository: arduino/ArduinoCore-mbed
75-
# the arduino/actions/libraries/compile-examples action will install the platform from this path
75+
# the arduino/compile-sketches action will install the platform from this path
7676
path: ${{ env.ARDUINOCORE_MBED_STAGING_PATH }}
7777

7878
- name: Checkout ArduinoCore-API
79-
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
79+
# this step only needed when the Arduino Mbed OS Boards platform sourced from the repository is being used
8080
uses: actions/checkout@v4
8181
with:
8282
repository: arduino/ArduinoCore-API
8383
path: ${{ env.ARDUINOCORE_API_STAGING_PATH }}
8484

8585
- name: Install ArduinoCore-API
86-
# this step only needed when the Arduino mbed-Enabled Boards platform sourced from the repository is being used
86+
# this step only needed when the Arduino Mbed OS Boards platform sourced from the repository is being used
8787
run: |
8888
mv "${{ env.ARDUINOCORE_API_STAGING_PATH }}/api" "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino"
8989

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
[![Check Arduino status](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/check-arduino.yml)
99
[![Spell Check status](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/spell-check.yml)
1010

11-
This library makes it easy to use the multi-threading capability of [Arduino](https://www.arduino.cc/) boards that use an [Mbed OS](https://os.mbed.com/docs/mbed-os/latest/introduction/index.html)-based core library. Additionally this library provides thread-safe access to `Wire`, `SPI` and `Serial` which is relevant when creating multi-threaded sketches in order to avoid common pitfalls such as race-conditions and invalid state.
11+
This library makes it easy to use the multi-threading capability of [Arduino](https://www.arduino.cc/) boards that use an [Mbed OS](https://os.mbed.com/docs/mbed-os/latest/introduction/index.html)-based core library. Additionally this library provides thread-safe access to `Wire`, `SPI` and `Serial` which is relevant when creating multi-threaded sketches in order to avoid common pitfalls such as race-conditions and invalid state.
1212

13-
Preeliminary **documentation** and download links for **required tooling** are available within the [`/docs`](docs/README.md) subfolder.
13+
Preliminary **documentation** and download links for **required tooling** are available within the [`/docs`](docs/README.md) subfolder.
1414

1515
## :star: Features
1616
### :thread: Multi-threaded sketch execution

Diff for: docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`Arduino_Threads/docs`
44
======================
5-
The Arduino threading APIs brings multi-threading to the world of Arduino. If you're new to the concept of threads we suggest you have first a look at the [Threading Basics](threading-basics.md) document.
5+
The Arduino threading APIs bring multi-threading to the world of Arduino. If you're new to the concept of threads we suggest you first take a look at the [Threading Basics](threading-basics.md) document.
66

77
The following Arduino architectures and boards are currently supported:
88
* `mbed_portenta`: [Portenta H7](https://store.arduino.cc/products/portenta-h7)

Diff for: docs/cli-getting-started.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
How to get started with the `Arduino CLI` and `Arduino_Threads`
44
===============================================================
55
## Introduction
6-
For now, you need to use the Arduino CLI to upload sketches made with the `Arduino_Threads` library. It can be intimidating at first, but once you get the hang of it, it is not that different from working in the IDE.
6+
For now, you need to use the Arduino CLI to upload sketches made with the `Arduino_Threads` library. It can be intimidating at first, but once you get the hang of it, it is not that different from working in the IDE.
77

8-
This document will help you get started, showing you how to find all the information you need to get off the ground without needing to go in depth and learn everything there is to know about the CLI.
8+
This document will help you get started, showing you how to find all the information you need to get off the ground without needing to go in depth and learn everything there is to know about the CLI.
99

10-
## Installing
11-
To use the `Arduino_Threads` library, a special version of the Arduino CLI needs to be downloaded and installed. Installing the Arduino CLI is really just as simple as downloading it and extracting the files from the .zip archive, once it is on your computer it is installed. However, to keep your workflow tidy and organized, we recommend moving it to a directory with a short path. If you have been using the Arduino IDE, most likely the files are stored in your `Documents` folder, so let's put the CLI files in the same place.
10+
## Installing
11+
To use the `Arduino_Threads` library, a special version of the Arduino CLI needs to be downloaded and installed. Installing the Arduino CLI is really just as simple as downloading it and extracting the files from the .zip archive, once it is on your computer it is installed. However, to keep your workflow tidy and organized, we recommend moving it to a directory with a short path. If you have been using the Arduino IDE, most likely the files are stored in your `Documents` folder, so let's put the CLI files in the same place.
1212

13-
Make a new folder in your `Documents` folder, and name it `CLI`, extract the files from the .zip archive to this folder.
13+
Make a new folder in your `Documents` folder, and name it `CLI`, extract the files from the .zip archive to this folder.
1414

1515
## Navigating With the Command Prompt and Launching the Arduino CLI
16-
Since the Arduino CLI is a command line tool, it is not a program that you can launch by double clicking on the `.exe` file. Instead, we need to start it from the command prompt. Using the command prompt can be thought of like using the file explorer, you are in a folder, can move around to other folders, create new files, delete files, etc. The difference is that you do all of these things with commands instead of buttons.
16+
Since the Arduino CLI is a command line tool, it is not a program that you can launch by double clicking on the `.exe` file. Instead, we need to start it from the command prompt. Using the command prompt can be thought of like using the file explorer, you are in a folder, can move around to other folders, create new files, delete files, etc. The difference is that you do all of these things with commands instead of buttons.
1717

18-
Unlike the file explorer where you click the folder you want to go to, navigating in the command prompt is done by first writing the command letting the program know that we want to move somewhere new, then telling it where we want to go.
18+
Unlike the file explorer where you click the folder you want to go to, navigating in the command prompt is done by first writing the command letting the program know that we want to move somewhere new, then telling it where we want to go.
1919

2020
When you open up a command prompt window, you should be started in the root directory of your user profile, you can see in what folder you are by looking at the path text right where you enter your commands. Because you're started at the root of your user profile, the path should say `C:\Users\<your name>`
2121

22-
Inside of this root folder there are other folders, if you want to go into the `Documents` folder, instead of clicking on it like you would do in the file explorer, you write the command:
22+
Inside of this root folder there are other folders, if you want to go into the `Documents` folder, instead of clicking on it like you would do in the file explorer, you write the command:
2323
```
2424
cd Documents
2525
```
@@ -32,7 +32,7 @@ If you want to go back one step, to the folder you came from, you write this com
3232
```
3333
cd ..
3434
```
35-
But we don't need to do that now, we want to be inside of the `CLI` folder, that is inside of the `Documents` folder.
35+
But we don't need to do that now, we want to be inside of the `CLI` folder, that is inside of the `Documents` folder.
3636

3737
Navigate to it with the command:
3838
```
@@ -61,11 +61,11 @@ To compile sketches and to upload to your Arduino board, you need to know some i
6161
```
6262
arduino-cli board list
6363
```
64-
If your board was found, you will get a bunch of information about it. The information we're interested in is the `FQBN`, and the port. `FQBN` stands for "Fully Qualified Board Name", and is how the computer refers to the board. The port is like an address for the board.
64+
If your board was found, you will get a bunch of information about it. The information we're interested in is the `FQBN`, and the port. `FQBN` stands for "Fully Qualified Board Name", and is how the computer refers to the board. The port is like an address for the board.
6565

6666
![Board list](./assets/boardlist.png)
6767

68-
If you are, like we are, using an Arduino Nano 33 BLE Sense, the `FQBN` will be `arduino:mbed_nano:nano33ble`. We need to specify every time we are compiling and uploading sketches that they are to be compiled for this board, just like we do in the IDE.
68+
If you are, like we are, using an Arduino Nano 33 BLE Sense, the `FQBN` will be `arduino:mbed_nano:nano33ble`. We need to specify every time we are compiling and uploading sketches that they are to be compiled for this board, just like we do in the IDE.
6969

7070
## Installing Cores
7171
If you have already used your Arduino board with the IDE, you can skip this step entirely. Otherwise, there are some files you may need to install to be able to use the board. But don't worry, it's just one command. The Arduino Nano 33 BLE Sense uses the `arduino:mbed_nano` core, which is another piece of information that we got from the board list command we executed, so we need to install that before using the board.
@@ -79,32 +79,32 @@ arduino-cli core install arduino:mbed_nano
7979
If you are using a board with another core, replace `arduino:mbed_nano` in the command with whatever core you got from the board list.
8080

8181
## Make a Sketch
82-
Now it is time to either make a new sketch, or to place a sketch that you have already made or want to test in the `CLI` folder.
82+
Now it is time to either make a new sketch, or to place a sketch that you have already made or want to test in the `CLI` folder.
8383

8484
If you want to make a new sketch, use the command:
8585
```
8686
arduino-cli sketch new MySketch
8787
```
8888
and a new folder will be created inside of the `CLI` folder, this new folder is named `MySketch` and contains a file named `MySketch.ino`. This .ino file can be opened, and edited in your text-editor of choice. Once you are happy with the sketch, move on to the next step.
8989

90-
If you already have a sketch that you want to upload, find it and move it into the `CLI` folder. Be sure to move the folder containing the `.ino` file and any extra files included in the sketch, and not the `.ino` file on its own.
90+
If you already have a sketch that you want to upload, find it and move it into the `CLI` folder. Be sure to move the folder containing the `.ino` file and any extra files included in the sketch, and not the `.ino` file on its own.
9191

9292
## Compile and Upload
9393

9494
The final steps to do are to compile and to upload the sketch. We'll do this with two separate commands. To compile, we need to pass the FQBN in the command to specify what board we want to compile it for, and we need to tell it what sketch we want to compile. We'll compile the sketch we created earlier to be uploaded to an Arduino Nano 33 BLE Sense. We can do this with the command:
9595
```
96-
arduino-cli compile --fqbn arduino:mbed_nano:nano33ble MySketch
97-
```
98-
Once you execute this command, it's going to start compiling unless something went wrong. If it looks like nothing is happening - Great! That probably means that everything is going as it should. Depending on the core, compiling might take a few minutes. Be patient, it may seem like it's taking too long, but give it time. Eventually, you'll get a statement about the memory use, libraries included, and platform used.
96+
arduino-cli compile --fqbn arduino:mbed_nano:nano33ble MySketch
97+
```
98+
Once you execute this command, it's going to start compiling unless something went wrong. If it looks like nothing is happening - Great! That probably means that everything is going as it should. Depending on the core, compiling might take a few minutes. Be patient, it may seem like it's taking too long, but give it time. Eventually, you'll get a statement about the memory use, libraries included, and platform used.
9999

100100
![Compiled sketch statement](./assets/compiled.png)
101101

102102
Now that the sketch is compiled, let's upload it! For this, we need to specify the FQBN again, as well as the port the board is connected to, so it's uploaded to the right place. To find the port, go back to the board list we got earlier, ours is connected to port `COM14`, but replace this part of the command with whatever port your list says. Now execute the command:
103103
```
104104
arduino-cli upload -p COM14 --fqbn arduino:mbed_nano:nano33ble MySketch
105105
```
106-
If everything went as it should, the sketch is now uploading to the board, and once that is done, you've successfully used the Arduino CLI to upload a sketch to your board.
106+
If everything went as it should, the sketch is now uploading to the board, and once that is done, you've successfully used the Arduino CLI to upload a sketch to your board.
107107

108108
![Uploaded sketch](./assets/uploaded.png)
109109

110-
Now that you know how to do this, it might be a good opportunity to take the deep dive in the DIY-spirit, experiment with different workflows and interfaces for the terminal to tailor your Arduino experience to your liking.
110+
Now that you know how to do this, it might be a good opportunity to take the deep dive in the DIY-spirit, experiment with different workflows and interfaces for the terminal to tailor your Arduino experience to your liking.

Diff for: docs/threading-basics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Threading Basics
44
================
55
## Introduction
6-
Threading is a concept that is used on many operating systems to run tasks in parallel. An Arduino example of two such tasks could be to read the position of a potentiometer knob while controlling a servo motor to follow that position. Running such tasks in parallel is also called multitasking.
6+
Threading is a concept that is used on many operating systems to run tasks in parallel. An Arduino example of two such tasks could be to read the position of a potentiometer knob while controlling a servo motor to follow that position. Running such tasks in parallel is also called multitasking.
77

88
Previously Arduino sketches didn't support the concept of multitasking, unless you took specific measures to support it. With this so called single-threaded approach instructions in your Arduino sketch are executed sequentially one by one. If an instruction or a function call respectively makes the runtime environment wait for its execution to complete, it's called a "blocking" function. You may have encountered the limitations of this when interacting with multiple sensors and actuators at once. For example if you let a servo motor react to the data read from a potentiometer as mentioned above. While the servo motor is moving to its target position no further reading of the potentiometer can be done because the program waits until the servo is done moving. To solve this issue multitasking can be used which allows to "simultaneously" execute multiple task such as reading from a sensor and controlling a motor. In the context of multitasking a thread is basically a mechanism (provided usually by the operating system) to encapsulate a task to be run concurrently with others.
99

Diff for: docs/threadsafe-serial.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Thread-safe `Serial`
55
## Introduction
66
While both `SPI` and `Wire` are communication protocols which explicitly exist to facilitate communication between one server device and multiple client devices there are no such considerations for the `Serial` interface. `Serial` communication usually exists in a one-to-one mapping between two communication partners of equal power (both can initiate communication on their own right, there is no server/client relationship).
77

8-
One example would be an Arduino sketch sending AT commands to a modem over a Serial connection and interpreting the result of those commands. Another example would be a GPS unit sending NMEA encoded location data to the Arduino for parsing. In both cases the only sensible software representation for such functionality (AT command module or NMEA message parser) is a single thread. Also in both cases it is undesirable for other threads to inject other kind of data into the serial communication as this would only confuse i.e. the AT controlled modem which reads that data.
8+
One example would be an Arduino sketch sending AT commands to a modem over a Serial connection and interpreting the result of those commands. Another example would be a GPS unit sending NMEA encoded location data to the Arduino for parsing. In both cases the only sensible software representation for such functionality (AT command module or NMEA message parser) is a single thread. Also in both cases it is undesirable for other threads to inject other kind of data into the serial communication as this would only confuse i.e. the AT controlled modem which reads that data.
99

1010
A good example for multiple threads writing to `Serial` would be logging where mixing messages from different sources doesn't cause any harm. A possible example for multiple threads reading from `Serial` would be to i.e. split an NMEA parser across multiple threads, i.e. one thread only parses RMC-messages, another parses GGA-messages, etc. In any case the thread-safe `Serial` supports both single-writer/single-reader and multiple-write/multiple-reader scenarios.
1111

@@ -48,7 +48,7 @@ Serial.println(counter);
4848
### Prevent message break-up using `block()`/`unblock()`
4949
([`examples/Threadsafe_IO/Serial_Writer`](../examples/Threadsafe_IO/Serial_Writer))
5050

51-
Due to the pre-emptive nature of the underlying mbed-os threading mechanism a multi-line sequence of `Serial.print/println()` could be interrupted at any point in time. When multiple threads are writing to the same Serial interface, this can lead to jumbled-up messages.
51+
Due to the preemptive nature of the underlying mbed-os threading mechanism a multi-line sequence of `Serial.print/println()` could be interrupted at any point in time. When multiple threads are writing to the same Serial interface, this can lead to jumbled-up messages.
5252

5353
```C++
5454
/* Thread_1.inot */

0 commit comments

Comments
 (0)