Skip to content

Port current codebase to S140 softdevice#2

Closed
thegrumpylion wants to merge 1 commit into
tinygo-org:masterfrom
thegrumpylion:s140v7
Closed

Port current codebase to S140 softdevice#2
thegrumpylion wants to merge 1 commit into
tinygo-org:masterfrom
thegrumpylion:s140v7

Conversation

@thegrumpylion

Copy link
Copy Markdown
Contributor

No description provided.

@thegrumpylion

Copy link
Copy Markdown
Contributor Author

Tested with ./examples/advertisement and works. Tested with e453c4d ./examples/heartrate works but with current master i get

starting
tick 00:00.010
panic: runtime error: goroutine stack overflow

@aykevl

aykevl commented Nov 19, 2019

Copy link
Copy Markdown
Member

Great, thank you for the contribution! I will soon take a look at it.

For the stack overflow, can you maybe test with this pull request? I had to manually increase the default (hardcoded) stack in TinyGo to get the heartrate example to work, but this PR fixes it for me when using the S132 SoftDevice: tinygo-org/tinygo#741

@thegrumpylion

Copy link
Copy Markdown
Contributor Author

Tested heartrate example with tinygo-org/tinygo#723 on top tinygo-org/tinygo#741 on pca10056 and works.

@aykevl

aykevl commented Nov 21, 2019

Copy link
Copy Markdown
Member

There is a lot of duplicate code in this PR, that should really be factored into common files (so you get adapter_sd.go, adapter_s132v6.go, adapter_s140v7.go, etc).

I think it will be needed to support #cgo CFLAGS for that. I have initial support working, but need to make it safe against arbitrary code execution before I can make a PR (see golang/go#23672 for details).

@deadprogram

Copy link
Copy Markdown
Member

Anything more that can be done to land this PR? Seems like it will be needed by tinygo-org/tinygo#819

@deadprogram

Copy link
Copy Markdown
Member

I wonder if tinygo-org/tinygo#822 is sufficient to address what @aykevl mentions in #2 (comment)

@aykevl

aykevl commented Mar 6, 2020

Copy link
Copy Markdown
Member

@thegrumpylion to avoid duplication of code, I made a new branch (s140v7) originally based on your code but relying on tinygo-org/tinygo#942 to avoid all the code duplication. The only two files left over are adapter_s140.go and adapter_s140.c and they are both very small. Another change is that I renamed the vendored SoftDevice tree to be consistent with the s132v6 tree.

What do you think of it? Can it be merged? Note that basically none of your code is left in that PR, it's either modified or directly downloaded from Nordic.

@aykevl aykevl force-pushed the master branch 5 times, most recently from bbf15de to f87fda3 Compare May 24, 2020 17:19
@aykevl

aykevl commented May 24, 2020

Copy link
Copy Markdown
Member

I have now merged the s140 branch, so the functionality of this PR is now supported.

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.

3 participants