Skip to content

Conversation

@niaow
Copy link
Member

@niaow niaow commented Oct 2, 2019

This PR attempts to add a mechanism for an interrupt to resume a goroutine.

@niaow
Copy link
Member Author

niaow commented Oct 7, 2019

There is now a working demo of an async echo. This was tested on my arduino nano33, using the coroutines scheduler. The tasks scheduler is still not yet working with this. Also, we will need to update the timing code on all platforms to accommodate a source of wakeups that is not the timer.

time.Sleep(time.Second)
time.Sleep(time.Second)

//uart.Configure(machine.UARTConfig{TX: tx, RX: rx})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not quite understand why this prevented it from working. Can someone explain what is going on?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably because UART0 is already configured as part of the runtime setup on most platforms. Otherwise we cannot do any println() statements on panic etc.

@niaow
Copy link
Member Author

niaow commented Oct 13, 2019

As of now, this compiles and runs with the latest version of #607 .

func main() {
go delayedResume()
cond.Wait()
cond.Wait()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 2 calls to cond.Wait() here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To test that subsequent calls will not block until the condition is cleared.

@niaow
Copy link
Member Author

niaow commented Nov 13, 2019

This PR is not going to be merged, but I am slowly ripping stuff out of here to make other smaller PRs.

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.

2 participants