Skip to content

Interrupts#83

Open
mkopec wants to merge 15 commits intomasterfrom
interrupts
Open

Interrupts#83
mkopec wants to merge 15 commits intomasterfrom
interrupts

Conversation

@mkopec
Copy link
Member

@mkopec mkopec commented Mar 6, 2026

  • Make more functions __reentrant to free up internal ram
  • Increase SRAM_SIZE to 3.5K to get more XSEG for free
  • Implement keyboard scan matrix mode instead of scanning the matrix in firmware
  • Implement interrupt handling in the main loop
  • Add 1ms sleep to the main loop
  • Split power.c from one large monolithic power_event into per-signal handlers and dispatch them from IRQ
  • Added debug command interface for remote power control over DBGR/SMB

Reduces power usage and improves performance and responsiveness. No functional changes.

  ┌──────────────────────────┬─────────────────┬───────────────────┬──────────────┐
  │          Metric          │ master baseline │ interrupts branch │    Delta     │
  ├──────────────────────────┼─────────────────┼───────────────────┼──────────────┤
  │ Stack (DSEG free)        │ 132 bytes       │ 204 bytes         │ +72 bytes    │
  ├──────────────────────────┼─────────────────┼───────────────────┼──────────────┤
  │ XSEG (External RAM used) │ 1533 bytes      │ 1511 bytes        │ −22 bytes    │
  ├──────────────────────────┼─────────────────┼───────────────────┼──────────────┤
  │ ROM                      │ 38,372 bytes    │ 40,568 bytes      │ +2,196 bytes │
  └──────────────────────────┴─────────────────┴───────────────────┴──────────────┘

Needs full regression testing.

Tested on NV40MB:

  • PMC works
  • SMFI works
  • KBC works
  • kbscan works
  • battery charging works
  • power on / off works
  • suspend works

No regressions spotted so far.

Reduces compile time DSEG usage.
Add interrupt and wakeup support. This improves performance and responsiveness
and reduces the power usage by sleeping in the main loop.
@mkopec mkopec marked this pull request as ready for review March 7, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant