Skip to content

Commit 5af4f89

Browse files
committed
Removed unecesary text
1 parent ece1b40 commit 5af4f89

File tree

2 files changed

+4
-38
lines changed

2 files changed

+4
-38
lines changed

libraries/MultiThreading/examples/BasicMultiThreading/README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ It is also worth mentioning that two or more tasks running the exact same functi
4343

4444
This example supports all SoCs.
4545

46-
## How to Use Example
47-
48-
Read this documentation and the code and try to understand it.
49-
When you flash it to your ESP, open a Serial Plotter and observe the analog signal.
50-
51-
* How to install the Arduino IDE: [Install Arduino IDE](https://github.com/espressif/arduino-esp32/tree/master/docs/arduino-ide).
52-
5346
### Hardware Connection
5447

5548
If your board does not have built in LED, please connect one to the pin specified by the `LED_BUILTIN` in code (you can also change the number and connect it on pin you desire).
@@ -77,12 +70,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
7770

7871
***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***
7972

80-
* **LED not blinking:** Check the wiring connection and the IO selection.
81-
* **Programming Fail:** If the programming/flash procedure fails, try reducing the serial connection speed.
82-
* **COM port not detected:** Check the USB cable and the USB to Serial driver installation.
83-
84-
If the error persists, you can ask for help at the official [ESP32 forum](https://esp32.com) or see [Contribute](#contribute).
85-
8673
## Contribute
8774

8875
To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst)

libraries/MultiThreading/examples/Semaphore/Semaphore.ino

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
1-
/*
2-
This example demonstrates basic usage of FreeRTOS Semaphores and queue sets for coordination between tasks for multi threading.
3-
Please refer to other examples in this folder to better understand usage of tasks.
4-
It is also advised to read documentation on FreeRTOS web pages:
5-
https://www.freertos.org/a00106.html
1+
// Please read file README.md in the folder containing this example.
62

7-
Theory:
8-
Semaphore is in essence a variable. Tasks can set the value, wait until one or more
9-
semaphores are set and thus communicate between each other their state.
10-
A binary semaphore is a semaphore that has a maximum count of 1, hence the 'binary' name.
11-
A task can only 'take' the semaphore if it is available, and the semaphore is only available if its count is 1.
12-
13-
Semaphore can be controlled from any number of tasks. If you use semaphore as a one-way
14-
signalization with only one task giving and only one task taking there is much faster option
15-
called Task Notifications - please see FreeRTOS documentation read more about them: https://www.freertos.org/RTOS-task-notifications.html
16-
17-
The example:
18-
We'll use a semaphore to signal when a package is delivered to a warehouse by multiple
19-
delivery trucks, and multiple workers are waiting to receive the package.
20-
*/
213
#include <Arduino.h>
224

23-
245
SemaphoreHandle_t package_delivered_semaphore;
256

267
void delivery_truck_task(void *pvParameters) {
@@ -51,21 +32,19 @@ void warehouse_worker_task(void *pvParameters) {
5132

5233
void setup() {
5334
Serial.begin(115200);
35+
while(!Serial){ delay(100); }
5436
// Create the semaphore
5537
package_delivered_semaphore = xSemaphoreCreateCounting(10, 0);
5638

5739
// Create multiple delivery truck tasks
5840
for (int i = 0; i < 5; i++) {
59-
xTaskCreate(delivery_truck_task, "Delivery Truck", 1024, (void *)i, tskIDLE_PRIORITY, NULL);
41+
xTaskCreate(delivery_truck_task, "Delivery Truck", 512, (void *)i, tskIDLE_PRIORITY, NULL);
6042
}
6143

6244
// Create multiple warehouse worker tasks
6345
for (int i = 0; i < 3; i++) {
64-
xTaskCreate(warehouse_worker_task, "Warehouse Worker", 1024, (void *)i, tskIDLE_PRIORITY, NULL);
46+
xTaskCreate(warehouse_worker_task, "Warehouse Worker", 512, (void *)i, tskIDLE_PRIORITY, NULL);
6547
}
66-
67-
// Start the RTOS scheduler
68-
vTaskStartScheduler();
6948
}
7049

7150
void loop() {

0 commit comments

Comments
 (0)