-
Notifications
You must be signed in to change notification settings - Fork 48
Add multi thread Example #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Demonstrate that direct zephyr calls can be made even with the Arduino API in use. - Examples shows concurrency by async blinking of 3 LEDs Signed-off-by: Dhruva Gole <goledhruva@gmail.com>
|
|
||
| This example demonstrates spawning multiple threads using | ||
| :c:func:`K_THREAD_DEFINE`. It spawns two threads. Each thread is then defined | ||
| at compile time using K_THREAD_DEFINE. | ||
|
|
||
| These two each control an LED. These LEDs, ``led0`` and ``led1``, have | ||
| loop control and timing logic controlled by separate functions. | ||
|
|
||
| - ``blink0()`` controls ``led0`` and has a 100ms sleep cycle | ||
| - ``blink1()`` controls ``led1`` and has a 1000ms sleep cycle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be updated to explain all 3 LED (built-in, D10, D11) and the role of the Loop.
| The board must have two LEDs connected via GPIO pins. These are called "User | ||
| LEDs" on many of Zephyr's :ref:`boards`. The LEDs must be configured using the | ||
| ``led0`` and ``led1`` :ref:`devicetree <dt-guide>` aliases, usually in the | ||
| :ref:`BOARD.dts file <devicetree-in-out-files>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still correct? It looks like the code is using pin numbers (which is great!) but this references device tree alias'
|
I again rebased the |
…iables resolves zephyrproject-rtos#13 And: provides for c) option in zephyrproject-rtos#14 In particular, added another config option (config16) that is initialized at beginTransaction with same settings as config except word size set to 16 instead of 8. Also: updated begin() to call beginTransaction with default SPISettings, and the endTransaction, such that sketches that don't call beginTransaction output at the default settings. Changed the header file private: to protected
Signed-off-by: Dhruva Gole goledhruva@gmail.com