Open
Description
I tried to run the heartrate example with the latest dev
branch of both this package and TinyGo, only to discover that it crashes:
$ tinygo flash -size short -target itsybitsy-nrf52840 -monitor ./examples/heartrate
code data bss | flash ram
41216 1464 4680 | 42680 6144
Connected to /dev/ttyACM0. Press Ctrl-C to exit.
Sread error: Port has been closed
Some println()
debugging seems to indicate that this the line where it crashes:
https://github.com/tinygo-org/bluetooth/blob/release/examples/heartrate/main.go#L60
Changing that line to
return uint8(min)
allows the example to execute as expected.
Calling rand.Intn()
function from a normal serial
program without softdevice does not cause any problems.
Running the heartrate example on HCI or Linux does not cause any problems either.
I also experience this same crash on most recent TinyGo release.