Skip to content

Draft modmachine: Expose keyboard interrupt as a python function. #16809

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewleech
Copy link
Contributor

Summary

Allows throwing a keyboard interrupt from code, was used from a timer interrupt that was configured to act like a "soft watchdog" with this interrupt triggering a stack trace printout on the main thread.

Testing

Currently this causes a fatal error if another keyboard interrupt comes in on serial line (I think)

Trade-offs and Alternatives

A separate / explicit version of this might be better rather than reusing / overloading keyboard interrupt.

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.52%. Comparing base (2992e34) to head (f0aa0d1).
Report is 274 commits behind head on master.

Files with missing lines Patch % Lines
py/modmicropython.c 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16809      +/-   ##
==========================================
- Coverage   98.53%   98.52%   -0.01%     
==========================================
  Files         169      169              
  Lines       21822    21824       +2     
==========================================
  Hits        21502    21502              
- Misses        320      322       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:  +216 +0.025% standard[incl +32(data)]
      stm32:   +52 +0.013% PYBV10
     mimxrt:   +48 +0.013% TEENSY40
        rp2:   +32 +0.003% RPI_PICO_W
       samd:   +52 +0.019% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:  +109 +0.024% VIRT_RV32

@andrewleech andrewleech changed the title modmachine: Expose keyboard interrupt as a python function. Draft modmachine: Expose keyboard interrupt as a python function. Feb 25, 2025
@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Apr 29, 2025
@andrewleech andrewleech marked this pull request as draft August 6, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
py-core Relates to py/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants