-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Draft: tinyusb cdc class in python / dupterm #16017
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?
Draft: tinyusb cdc class in python / dupterm #16017
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #16017 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 169 169
Lines 21864 21864
=======================================
Hits 21545 21545
Misses 319 319 ☔ View full report in Codecov by Sentry. |
Code size report:
|
b7850b4
to
57f64c8
Compare
d50bff1
to
a9099b3
Compare
I started adding |
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
Signed-off-by: Andrew Leech <andrew@alelec.net>
a9099b3
to
9d8632f
Compare
Summary
In the stm port the built-in USB CDC / virtual com port is exposed as a class in python. It's also connected to repl by being registered in dupterm by default.
The benefits of this are that at runtime the user can de-register it from dupterm to disable repl in that port and then also use it as a custom stream if desired.
This PR replicates this behaviour on other ports which use TinyUSB.
Testing
This has been tested so far on:
Trade-offs and Alternatives
This does come at a cost to code size.
Currently it's written such that it dupterm is not enabled the previous behaviour is used, with the class no longer created.
A define
MICROPY_HW_UART_REPL
is commonly used to specify whether a UART should be connected to repl, I'm considering whether a matchingMICROPY_HW_USBD_CDC_REPL
define should be added to specify whether the CDC should be registered in dupterm automatically or not.Then there's also a question about whether a separate define should be added to specify if the class should be created anyway in case people want access to that for custom data.