Thanks to visit codestin.com
Credit goes to github.com

Skip to content

renesas-ra: Consolidate hal_entry.c code and remove hal_entry() func. #11590

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

Merged

Conversation

dpgeorge
Copy link
Member

The hal_entry.c code is duplicated across all boards, so consolidate it to a common ra_hal.c file. And remove the hal_entry() function because it simply calls main().

@dpgeorge
Copy link
Member Author

@TakeoTakahashi2020 I am trying to simplify the renesas-ra port, to reduce the amount of code that is in the boards/ directories. This PR is a start, it just makes a small step to remove some duplicated code.

What do you think?

@TakeoTakahashi2020
Copy link
Contributor

Thank you very much @dpgeorge san. I agree with you and it's good for me. I just checked build and got REPL for all EKs & CLICKER. It looks working well.

The hal_entry.c code is duplicated across all boards, so consolidate it to
a common ra_hal.c file.  And remove the hal_entry() function because it
simply calls main().

Signed-off-by: Damien George <[email protected]>
@dpgeorge dpgeorge force-pushed the renesas-ra-simplify-board-code branch from 3bd7e6b to 324d01e Compare May 24, 2023 01:44
@dpgeorge dpgeorge merged commit 324d01e into micropython:master May 24, 2023
@dpgeorge dpgeorge deleted the renesas-ra-simplify-board-code branch May 24, 2023 01:59
@dpgeorge
Copy link
Member Author

Thank you @TakeoTakahashi2020 san for reviewing and testing.

Now merged.

@iabdalkader
Copy link
Contributor

@TakeoTakahashi2020 Is there any reason PA/B pins are not generated with make-pins.py ? I need to use those pins in mpconfigboard.h but they're not generated in headers.

@iabdalkader
Copy link
Contributor

iabdalkader commented May 26, 2023

Seem that numbering goes 9, A, B, so it's just hex, might be as easy as:

diff --git a/ports/renesas-ra/boards/make-pins.py b/ports/renesas-ra/boards/make-pins.py
index 98d7026c2..baac4a69a 100644
--- a/ports/renesas-ra/boards/make-pins.py
+++ b/ports/renesas-ra/boards/make-pins.py
@@ -140,8 +140,8 @@ class Pins(object):
             for row in rows:
                 try:
                     cpu_pin_name = row[0]
-                    cpu_pin_port = int(row[1])
-                    cpu_pin_bit = int(row[2])
+                    cpu_pin_port = int(row[1], 16)
+                    cpu_pin_bit = int(row[2], 16)
                 except:
                     continue
                 pin = Pin(cpu_pin_name, cpu_pin_port, cpu_pin_bit)

@TakeoTakahashi2020
Copy link
Contributor

TakeoTakahashi2020 commented May 29, 2023

@iabdalkader san, Thank you for the report of make-pins.py issue. I was not aware of it since EK & CLICKER's device has no PA/B pins. I will check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants