Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
DhruvaG2000 wants to merge 4 commits into dev from eg/thread
Closed

Add multi thread Example #13

DhruvaG2000 wants to merge 4 commits into dev from eg/thread

Conversation

@DhruvaG2000
Copy link
Member

@DhruvaG2000 DhruvaG2000 commented Jul 9, 2022

  • 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

- 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>
Comment on lines +8 to +17

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
Copy link
Member

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.

Comment on lines +22 to +25
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>`.
Copy link
Member

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'

Copy link
Member Author

I again rebased the dev on top of this branch 🤦🏼
Now this has added all latest commits from main into this branch showing too many unnecessary files changes. I am closing this PR and creating a different branch and will cherrypick the useful commits there.

szczys and beriberikix reacted with thumbs up emoji

@DhruvaG2000 DhruvaG2000 deleted the eg/thread branch August 31, 2022 12:41
soburi pushed a commit to soburi/gsoc-2022-arduino-core that referenced this pull request Sep 24, 2025
...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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@szczys szczys szczys requested changes

@alvarowolfx alvarowolfx Awaiting requested review from alvarowolfx

@beriberikix beriberikix Awaiting requested review from beriberikix

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /