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

Timer.Reset() not implemented #3456

Open
jadefox10200 opened this issue Feb 17, 2023 · 1 comment
Open

Timer.Reset() not implemented #3456

jadefox10200 opened this issue Feb 17, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jadefox10200
Copy link

timer.modTimer appears to not be implemented.

The error I am getting is:

referenced by tick.go:60 (/opt/homebrew/Cellar/go/1.19.4/libexec/src/time/tick.go:60)
/Users/stillshot/Library/Caches/tinygo/thinlto/llvmcache-0ACC4295CB94FD749B6046AA38636C6DBE5FF8A5:((*time.Ticker).Reset)
failed to run tool: ld.lld
error: failed to link /var/folders/mn/5m1sf0ys2hv3pypqprmrrdp80000gn/T/tinygo1735139416/main: exit status 1

I'm trying to use the function *time.Reset() to reset a ticker but it apparently doesn't like that. This is on an RP2040. tinygo version 0.26.0 darwin/amd64 (using go version go1.19.4 and LLVM version 14.0.0)

@tdunning
Copy link

tdunning commented Feb 4, 2025

This issue is not really an enhancement. Existing functionality does not behave according to spec. That's a bug.

Here is more info ported from #4688

I wrote a small program that was using a Ticker as a timeout and found that resetting the Ticker exposed a missing bit in the runtime.

Here is a tiny program that illustrates this:

package main

import (
	"time"
)

func main() {
	t := time.NewTicker(10 * time.Millisecond)
	t.Reset(time.Duration(100) * time.Millisecond)
}

Attempting to compile and flash this results in this output:

$  tinygo flash -target=pico2 -scheduler=tasks -gc=conservative -size=full -stack-size=20kb -monitor TickerBug/main.go
/usr/local/go/src/time/tick.go:58: linker could not find symbol time.modTimer
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants