Skip to content

Conversation

@sago35
Copy link
Member

@sago35 sago35 commented Jun 3, 2020

Because SERCOM used by UART is different in each board, I divided the file by this PR.

I've written about which SERCOM to use in the comments below.
#1124 (comment)

@deadprogram
Copy link
Member

In order to make sure that the simulators as used on the TinyGo Playground, it would be better to add "baremetal" files for each board with these additions.

Here is an example of how this has been done for the Arduino Nano33:

https://github.com/tinygo-org/tinygo/blob/master/src/machine/board_arduino_nano33_baremetal.go

@sago35
Copy link
Member Author

sago35 commented Jun 4, 2020

I have created a baremetal file.

However, at the moment I can't confirm that the change is correct because playground doesn't work in my local environment (win10).

Are these changes correct?

I thought the rules were as follows.

  • board_xxx.go
    • buildtag is only for xxx
    • Only const and usb_VID and usb_PID
  • board_xxx_baremetal.go
    • buildtag is the same as the one before splitting
    • Other than the above

@deadprogram
Copy link
Member

I think you have it correct, and I tested with the PyBoard and seemed to work as expected.

@aykevl any feedback before I squash/merge this?

@aykevl
Copy link
Member

aykevl commented Jun 4, 2020

It's a good idea to move the SERCOM configuration to the board files, as this configuration is board specific.

I'm not sure whether the split to "baremetal" files is necessary. The main purpose is to allow boards to exist on play.tinygo.org, and right now none of the boards are used there. So this split is essentially unused. I'd be fine with merging this as-is, but it might add some unnecessary clutter.

@deadprogram
Copy link
Member

I think that we very likely will want to add a few of these boards to the Playground.

Now merging to help make that happen. Thanks @sago35 for your work on this contribution!

@deadprogram deadprogram merged commit 0c880ec into tinygo-org:dev Jun 5, 2020
@deadprogram deadprogram mentioned this pull request Jun 5, 2020
5 tasks
@niaow niaow added this to the v0.14 milestone Jun 27, 2020
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.

4 participants