The Wayback Machine - https://web.archive.org/web/20201129162843/https://github.com/tinygo-org/tinygo/issues/1214
Skip to content
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

runtime: allow interrupts to wake the scheduler #1214

Open
niaow opened this issue Jul 6, 2020 · 1 comment
Open

runtime: allow interrupts to wake the scheduler #1214

niaow opened this issue Jul 6, 2020 · 1 comment

Comments

@niaow
Copy link
Member

@niaow niaow commented Jul 6, 2020

In order for interrupt-based wake-ups (as introduced by #1142) to work concurrently with time.Sleep, we need to make some per-board changes.

Previously, sleepTicks (the function used as an interface between the scheduler and the hardware timer) was defined to block until the timer completed, since there was nothing else to do. Now we need to change this so that it bails out when an interrupt wakes the chip. I started with the 2 main chip types I have (atsamd21 and atsamd51). This change is trivial, but requires testing on all supported platforms.

My atsamd51 fix can be used as a reference for how this works: https://github.com/tinygo-org/tinygo/pull/1197/files

If you want to try to port over the fix to a board class, comment on this thread to claim it so we don't duplicate work.

Platforms:

  • wasm
  • arm7tdmi (GBA) (no actual timer implemented yet so I guess this is done)
  • avr
  • stm32f103xx
  • stm32f407
  • nrf
  • fe310
  • atsamd21
  • atsamd51
  • mk66f18 (new board in #863)
firelizzard18 added a commit to firelizzard18/tinygo that referenced this issue Jul 8, 2020
- Fix UART & putChar
- Timer-based sleep
- Enable systick in abort
- Buffered, interrupt-based UART TX
- Use the new interrupt API and fix sleepTicks
- Make pins behave more like other boards
- Use the MCU's UART numbering
- Allow interrupts to wake the scheduler (tinygo-org#1214)
@firelizzard18
Copy link
Contributor

@firelizzard18 firelizzard18 commented Jul 8, 2020

I updated #863 with support for this

firelizzard18 added a commit to firelizzard18/tinygo that referenced this issue Jul 8, 2020
- Fix UART & putChar
- Timer-based sleep
- Enable systick in abort
- Buffered, interrupt-based UART TX
- Use the new interrupt API and fix sleepTicks
- Make pins behave more like other boards
- Use the MCU's UART numbering
- Allow interrupts to wake the scheduler (tinygo-org#1214)
deadprogram added a commit that referenced this issue Jul 8, 2020
- Fix UART & putChar
- Timer-based sleep
- Enable systick in abort
- Buffered, interrupt-based UART TX
- Use the new interrupt API and fix sleepTicks
- Make pins behave more like other boards
- Use the MCU's UART numbering
- Allow interrupts to wake the scheduler (#1214)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.