-
Notifications
You must be signed in to change notification settings - Fork 40
[DNM] zephyrCommon: Changing pin numbering rules #134
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
Open
soburi
wants to merge
14
commits into
zephyrproject-rtos:next
Choose a base branch
from
soburi:global_pin_number
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+268
−224
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93e11fa
to
084197c
Compare
084197c
to
0747e08
Compare
Use the checkpatch.pl included with Zephyr to perform the check. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Changed boards to be specified by their normalized names. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Modify to use west.yml included in the PR version. Accordingly, the initialization process has been changed. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Added cmsis_6 to the repository in line with the update of Zephyr. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Get the variant name (NORMALIZED_BOARD_TARGET) from the Zephyr build system as early as possible. This allows to have per-target build directories. Note that a bug with the shield specifiers does not currently allow to reuse the same build directory multiple times. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com> Co-authored-by: Luca Burelli <l.burelli@arduino.cc>
Fixed an issue where the reference location for the interrupt handler was a bit mask instead of an index value. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Improved to align more closely with the standard Arduino implementation. - Eliminated the end timer and used counting to determine the end. - Improved to handle infinity correctly. - Added a guard to prevent the timeout value from reaching 0. - Set the GPIO value to 0 when the timer starts. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Since the general Arduino implementation does not check the GPIO direction, this check has been removed to improve compatibility. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
If gpio is not initialized, the pulseIn function will terminate without running the timer. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Since Arduino's `delayMicroseconds` is implemented as a busy loop, we change it to using `k_busy_wait` to improve compatibility.
Reformatting indentation for `delay` and `millis`.
Added a comment because it was difficult to understand where the namespace ends. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The PWM index range check processing was performed after the index was referenced, so it was now performed first. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Zephyr's ba48d83bec18e9f2caf61979aadf9f8537086cee changes make it easy to configure pin numbering at compile, so we'll change the pin numbers to be based on the GPIO pin numbers. This is same as the traditional Arduino, using the GPIO numbers as pin numbers. Pin names written on the board, such as D1 and D2, are aliases for these pin numbers. When using multiple GPIO ports, pin numbers are numbered consecutively from the beginning. In other words, if you have two 16-port GPIOs, 17 refers to the second pin (idx=1) of the second port. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
0747e08
to
014a6ed
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Zephyr's ba48d83bec18e9f2caf61979aadf9f8537086cee
changes make it easy to configure pin numbering at compile,
so we'll change the pin numbers to be based on the GPIO pin numbers.
This is same as the traditional Arduino, using the GPIO numbers as
pin numbers. Pin names written on the board, such as D1 and D2,
are aliases for these pin numbers.
When using multiple GPIO ports, pin numbers are numbered consecutively
from the beginning. In other words, if you have two 16-port GPIOs,
17 refers to the second pin (idx=1) of the second port.