extmod/machine_signal: Add signal_print() as repr() function.#12291
extmod/machine_signal: Add signal_print() as repr() function.#12291IhorNehrutsa wants to merge 1 commit into
Conversation
89f3299 to
6abd27c
Compare
|
Code size report: |
6abd27c to
9ea6255
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12291 +/- ##
==========================================
- Coverage 98.46% 98.45% -0.01%
==========================================
Files 176 176
Lines 22811 22813 +2
==========================================
Hits 22460 22460
- Misses 351 353 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@jimmo |
9ea6255 to
19bb27a
Compare
jimmo
left a comment
There was a problem hiding this comment.
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
This comment was marked as outdated.
This comment was marked as outdated.
|
Ready |
|
Thanks for rebasing. But honestly, the increase in code size is quite substantial for a feature like this that's rarely used/requested so far. |
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> ``` Signed-off-by: IhorNehrutsa <[email protected]> Co-Authored-By: Jim Mussared <[email protected]>
Test code is:
Ounput is:
instead of