-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
extmod/machine_signal: Add signal_print() as repr() function. #12291
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
base: master
Are you sure you want to change the base?
Conversation
89f3299
to
6abd27c
Compare
Code size report:
|
6abd27c
to
9ea6255
Compare
Codecov Report
@@ Coverage Diff @@
## master #12291 +/- ##
==========================================
- Coverage 98.43% 98.39% -0.04%
==========================================
Files 158 158
Lines 20978 20985 +7
==========================================
Hits 20649 20649
- Misses 329 336 +7
|
@jimmo |
9ea6255
to
19bb27a
Compare
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.
Thanks @IhorNehrutsa -- I think this is useful.
Having this is useful for debugging and we already do it for Pin, so Signal should match. If all this printing support is too much code size we could consider making it a build option (e.g. MICROPY_PY_MACHINE_DETAILED_PRINTING
) similar to how we do terse/detailed error messages.
19bb27a
to
6a62f30
Compare
6a62f30
to
c1a6cb3
Compare
c1a6cb3
to
760241c
Compare
760241c
to
e17c6f2
Compare
e17c6f2
to
c9843c3
Compare
Test code is: ``` from machine import Pin, Signal signal22= Signal(Pin(22, mode=Pin.OUT)) signal22 signal21= Signal(Pin(21, mode=Pin.IN), invert=True) signal21 ``` Ounput is: ``` Signal(Pin(22)) Signal(Pin(21), invert=True) ``` instead of ``` <Signal> <Signal> ``` Co-Authored-By: Jim Mussared <[email protected]> Signed-off-by: IhorNehrutsa <[email protected]>
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
Test code is:
Ounput is:
instead of