Commit Graph

4755 Commits

Author SHA1 Message Date
deadprogram 2602d4c25d main: update to espflasher 0.7.1 and add flash erase progress tracker
Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-20 14:12:53 +02:00
deadprogram 0a9b3f91bc builder: improvements needed for esp32 XIP to allow for correctly flashing large programs
This fixes the builder for ESP32 (original) by separating the RAM segments loadable by the
ROM bootloader from flash-mapped segments (DROM/IROM) which require MMU setup by startup code.

These changes are needed for to allow for ESP32 to correctly flashing large programs which
as a result require XIP support.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-20 14:12:53 +02:00
deadprogram 3b137c3053 ci: fix sizediff check by updating to go 1.25, which is the new minimum version
Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-19 17:24:30 +02:00
Konstantin Sharlaimov 5f02d6b659 feat(machine/stm32): make HSE crystal frequency selectable.
Define the board's external crystal (HSE) frequency `xtalHz` in the
respective `board_*.go` files. Per-topology PLL tables (F1, F4, F7)
will compute the register dividers from it.

Moving this parameter to the board definition level cleanly isolates
board hardware characteristics from general MCU chip configurations,
eliminating the need for custom target build tags. Targets using
HSE-clocked STM32 chips must define `xtalHz` or fail to build.
2026-07-19 10:56:14 +02:00
rdon(あーるどん) b8adb803c4 runtime: wake channel waiters after releasing locks (#5513)
* runtime: wake channel waiters after releasing locks

* runtime: add comment explaining next field reuse in chanClose
2026-07-18 08:42:46 +02:00
deadprogram 36d3b83e9c builder: add chkstk2.S to windows/386 builtins for __alloca symbol
Clang on i386 mingw emits calls to _alloca (decorated as __alloca)
for stack probing. This was provided by chkstk2.S, not chkstk.S
which only provides __chkstk_ms.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-17 19:06:57 +02:00
deadprogram a2a638c198 all: fix LLVM version compatibility for targets and interp
cc1as: change AssemblerInvocation.Triple from std::string to
llvm::Triple, matching upstream LLVM 22 and fixing deprecation warnings
for lookupTarget, createMCRegInfo, createMCAsmInfo, and
createMCSubtargetInfo.

interp: always use ConstNamedStruct in rawValue.toLLVMValue instead of
falling back to ConstStruct for unnamed structs. LLVM 22 uses anonymous
identified struct types where previous versions used literal structs;
ConstStruct creates a literal type that doesn't match, causing an
"initializer type mismatch" panic for globals like fmt.ppFree.

compileopts: add build-tag-guarded feature patching for pre-LLVM 20
(strip +bulk-memory-opt and +call-indirect-overlong from wasm features)
and restructure into three files covering all LLVM version ranges.

targets: strip redundant negative features from RISC-V target JSONs
(esp32c3, esp32c6, fe310, k210, riscv-qemu, tkey). These ~190 negative
features per target listed every extension LLVM knows about that the
target doesn't use, but LLVM disables them by default. They became stale
across LLVM versions, causing "not a recognized feature" warnings. Keep
only positive features and -relax.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-17 19:06:57 +02:00
deadprogram 0ffa3eb748 all: add LLVM 22 support
Builder:
- Update clang.cpp for LLVM 22 API changes: DiagnosticOptions is no
  longer ref-counted, TextDiagnosticPrinter and DiagnosticsEngine take
  references instead of pointers, createDiagnostics() signature changed.
- Update cc1as.cpp: clang/Driver/Options.h moved to
  clang/Options/Options.h, namespace changed from clang::driver::options
  to clang::options, MCInstPrinter now passed as unique_ptr.
- Add new LLVM 22 libraries to GNUmakefile: clangAnalysisLifetimeSafety,
  clangOptions, LLVMDTLTO, and dtlto component.
- Add llvm22 build tag to all build/test commands.

CGo:
- Handle CXType_Unexposed in libclang.go by resolving via canonical
  type. LLVM 22 reports builtin type aliases (e.g. __size_t) as
  Unexposed instead of Typedef.
- Always make C typedefs into Go type aliases. LLVM 22 changed
  getTypedefDeclUnderlyingType to return CXType_Enum directly instead
  of wrapping in an elaborated type.

Compileopts:
- Add build-tag-guarded ClangTriple() to substitute wasm32-unknown-wasi
  with wasm32-unknown-wasip1 for LLVM 22 (deprecated triple).
- Add build-tag-guarded patchFeatures() to map renamed Xtensa features
  (atomctl, memctl, timerint, esp32s3) for LLVM 22.

Targets:
- Remove -zca from RISC-V target feature strings (esp32c3, esp32c6,
  fe310, k210, riscv-qemu, tkey). LLVM 22 now implies +zca from +c.
- Remove -zcd from k210. LLVM 22 now implies +zcd from +c,+d.

Tests:
- Change TestClangAttributes to check individual feature flags instead
  of exact string match, allowing new LLVM features without failures.
- Update TestBinarySize expected values for LLVM 22 codegen.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-17 19:06:57 +02:00
deadprogram 922f583dd4 ci: modify builds to use llvm 22
Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-17 19:06:57 +02:00
Damian Gryski 91a56b28a2 go.mod: update to go-llvm with needed changes 2026-07-17 13:09:00 +02:00
Damian Gryski 9c864f0d79 interp: fix switch-instruction handling for LLVM 22's new case-value API
Written entirely by Claude (Anthropic's Claude Code), at the request of
and under the direction of dgryski, on the dgryski/llvm23 branch (LLVM
22 support, in preparation for the eventual LLVM 23 release; the
corresponding go-llvm branch of the same name adds the matching
binding support this depends on).

Found while running real-world Go test suites through a tinygo built
against LLVM 22 (as a smoke test of the earlier captures(none)/
nocapture and lifetime-intrinsic fixes on this branch): `tinygo test`
on github.com/dgryski/go-rc5 panicked at compile time with "unknown
value" inside interp.(*runner).getValue, while compiling
(*sync.Once).Do. Bisecting against LLVM 21 (unaffected) narrowed it to
a change introduced in LLVM 22 specifically, unrelated to the earlier
captures/lifetime work.

Root cause: LLVM 22 stopped exposing switch-instruction case values as
regular instruction operands -- only the condition and
destination-block operands remain. interp/compiler.go's `case
llvm.Switch:` handling walked raw operands assuming the old
alternating (value, label) layout, so under LLVM 22 it read a
destination *block* where it expected an integer case value,
eventually panicking deep inside a getValue call it couldn't resolve.
This only manifested on functions actually compiled by the interp
package (TinyGo's compile-time evaluator for global initializers) that
happen to reach a switch-based dispatch, such as sync.Once's
defer-based Do method -- hence it needed a real, moderately complex
package (crypto/cipher via go-rc5) to surface, and never showed up in
smaller smoke tests.

Fix: use the new version-independent Value.SuccessorsCount()/
Value.Successor(i) and Value.GetSwitchCaseValue(i) helpers just added
to go-llvm, instead of raw Operand() indexing.

Also applies the same captures(none)/nocapture golden-IR normalization
already used in transform/transform_test.go and compiler/compiler_test.go
to interp/interp_test.go's separate copy of the same comparator helper,
which was missed in the earlier pass and started failing two of its
subtests once actually run against LLVM 22.

Verified: `tinygo test` on go-rc5 now passes reliably (repeated runs)
against both LLVM 20 (default) and LLVM 22; full transform/compiler/
interp/cgo/goenv test suites pass on both versions. The `builder`
package has pre-existing, environment-related test failures (stale
GOROOT cache, local clang/target-feature drift) confirmed identical
against an unmodified LLVM 20 build, so unrelated to this change.
2026-07-17 13:09:00 +02:00
Damian Gryski 6203b624c5 transform, compiler: support LLVM 21's captures(none) attribute; add LLVM 22 build support
Written entirely by Claude (Anthropic's Claude Code), at the request of
and under the direction of dgryski, as part of an effort to get TinyGo
building against upcoming LLVM releases (this branch currently targets
LLVM 22, verified against real LLVM 22.1.8; a corresponding go-llvm
branch of the same name adds the matching binding support).

LLVM 21 replaced the boolean 'nocapture' enum attribute with the more
expressive 'captures' int attribute, where captures(none) (value 0) is
the equivalent of the old nocapture. This matters for
transform.OptimizeAllocs, which relies on reading this attribute for
its interprocedural escape analysis, and for compiler/symbol.go, which
emits it on a number of runtime/generated functions. Confirmed
empirically (via `opt -passes=function-attrs`) that the cutoff is
LLVM 20 emits/expects nocapture, LLVM 21+ emits/expects
captures(none). Since TinyGo must keep working with LLVM 20, both
sites now go through new version-gated helpers in
compiler/llvmutil (NoCaptureAttrName/IsNoCapture) rather than switching
unconditionally.

Also fixes a second, unrelated but load-bearing break found while
testing against LLVM 22: llvm.lifetime.start/end dropped their i64
size argument (confirmed via `opt -passes=verify`, the cutoff here is
one version later, at LLVM 22). compiler/llvmutil now builds the
right call signature based on version.

Adds llvm21 and llvm22 build-tag config files to the cgo package,
which parses cgo fragments via libclang and had never been updated
past LLVM 20 even though the compiler package itself already gained
LLVM 21 support previously -- a latent gap that would have caused a
version mismatch between the cgo preprocessor and the rest of the
compiler when building with -tags llvm21 or llvm22.

Finally, updates the golden-IR test comparators in
transform/transform_test.go and compiler/compiler_test.go to
normalize a few cosmetic LLVM 21/22 output differences (the
captures(none) rename/reordering, a new 'nocreateundeforpoison'
intrinsic attribute, and the lifetime intrinsic arity change) so a
single golden file continues to match output from either LLVM
version.

Verified by building a full (non-byollvm) tinygo binary against real
LLVM 22.1.8 and running a compiled Go program end-to-end (exercising
OptimizeAllocs' stack-allocation path), and by running the
transform/compiler/cgo test suites against both LLVM 20 (default) and
LLVM 22.

Not yet addressed: the byollvm embedded-clang/lld build path hits
separate, unrelated Clang C++ API breakage against LLVM 22
(DiagnosticOptions reference-to-pointer change, missing headers) --
that is a larger follow-up effort.
2026-07-17 13:09:00 +02:00
Konstantin Sharlaimov ea003da13f Add UART line inversion support (#5522)
* feat(machine): add UART line inversion support.

Add InvertTX and InvertRX to UARTConfig to allow enabling hardware
line inversion on supported targets. Added hardware implementation for
RP2 (RP2040, RP2350), STM32 (newer families), SAM (SAMD51, SAME5x),
and ESP (ESP32, ESP32-C3, ESP32-C6).

* refactor(machine): Refactor UART inversion with pin setter helpers.

RP2: Extract setOutOver/setInOver methods on Pin, removing inline
IO control register manipulation from UART configure.

SAM: Switch to SetCTRLA_TXINV/SetCTRLA_RXINV methods, dropping
the unused device/sam import and raw SetBits/ClearBits calls.

---------

Co-authored-by: Konstantin Sharlaimov <ksharlaimov@inavflight.com>
2026-07-17 10:45:50 +02:00
felipegenef 7994d2e912 runtime: implement SetFinalizer to fix syscall/js finalizeRef leak 2026-07-17 08:12:46 +02:00
rdon(あーるどん) f1c39e8356 targets: add M5Stack Stamp-S3A (#5524)
* targets: add M5Stack Stamp-S3A

* targets: add Stamp-S3A smoke test

* targets: rename Stamp-S3A target

* targets: rename Stamp-S3A target
2026-07-16 14:31:47 +02:00
deadprogram 801bd484ab test: skip crypto/ecdsa on wasi for now, since it never finishes
Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-14 11:52:59 +02:00
deadprogram be7b6b316e test: skip compress/flate for now due to Go 1.27 changes
Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-14 11:52:59 +02:00
Jake Bailey ec184e90c1 main_test: skip json on Cortex-M QEMU with Go 1.27
Go 1.27 jsonv2 pushes testdata/json.go beyond the LM3S6965 flash
budget. Keep coverage on larger emulated targets while skipping only the
too-small Cortex-M QEMU configuration.
2026-07-14 11:52:59 +02:00
Jake Bailey 07c9cdcbc4 builder: link stack probes on Windows amd64 and arm64
Go 1.27 packages can emit stack probes on Windows amd64 and arm64.
Link the compiler-rt stack probe builtins and use compiler-rt for those
targets so these packages build.
2026-07-14 11:52:59 +02:00
deadprogram bd1d11d166 compiler: support Go 1.27 generic methods via x/tools upgrade
Go 1.27 adds generic methods (golang/go#77273). golang.org/x/tools
go/ssa v0.42.0 does not instantiate them: objectMethod only applies
receiverTypeArgs and ignores method-level type parameters, so a call
such as (*math/rand/v2.Rand).N resolves to the abstract generic method
and its body reaches createConst with a type-parameter-typed zero
constant, triggering "panic: expected nil interface constant".

Upgrade golang.org/x/tools to v0.47.0, whose go/ssa returns nil from
MethodValue for generic methods and instantiates method-level type
parameters. No compiler changes are required.

Since x/tools v0.47.0 requires Go 1.25, raise the minimum supported Go
version from 1.24 to 1.25.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-14 11:52:59 +02:00
deadprogram 919c998355 builder: update max supported Go version to 1.27
Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-14 11:52:59 +02:00
deadprogram a3375fb2c4 all: build/test using Go 1.27-rc2
Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-14 11:52:59 +02:00
rdon-key 09bda77b78 runtime: fix leaking GC build with cores scheduler 2026-07-13 12:58:46 +02:00
Jake Bailey 047ed57005 compiler: canonicalize method signature identities
The interface lowering pass used a separate formatter for method
signatures. Same-named local aliases could therefore make distinct generic
methods compare equal. Reuse getTypeCodeName so interface checks preserve
type identity.
2026-07-13 07:33:32 +02:00
Jake Bailey c7923d1c64 compiler: canonicalize generic instance identities
x/tools SSA names and go/types strings can preserve the source spelling of
type arguments, so aliases can make distinct instances collide. Use the
canonical type encoding for function names, synthetic local type owners,
instantiated named types, and method sets.
2026-07-13 07:33:32 +02:00
Jake Bailey 73db9776b1 testdata: add generic alias identity regressions
Add cases where same-named local aliases instantiate generic functions,
local types, and methods with float32 and float64. Record the current
collisions and incorrect results.
2026-07-13 07:33:32 +02:00
deadprogram 6d49f0177b compiler: support //go:linknamestd pragma
Go 1.27 introduced the //go:linknamestd directive, a standard-library
variant of //go:linkname that does not require importing "unsafe". The
iter package switched to it for referencing runtime.newcoro and
runtime.coroswitch, which caused "linker could not find symbol
iter.newcoro / iter.coroswitch" errors when building with Go 1.27.

Handle //go:linknamestd the same as //go:linkname, bypassing the unsafe
import requirement, and add test coverage in the pragma compiler test.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-12 14:05:34 +02:00
Evan Wies 35a61ac8c5 compiler: support file-level //go:linkname directives
Modern golang.org/x/sys/unix (v0.36+) declares its linknames
detached from function declarations, e.g.:

    func syscall_syscall(...)
    //go:linkname syscall_syscall syscall.syscall

TinyGo's pragma parser only inspected function doc comments and
therefore missed these, producing link errors like:

    undefined symbol: _golang.org/x/sys/unix.syscall_syscall

Extend parsePragmas to also walk the enclosing *ast.File's
free-standing comments for //go:linkname directives matching the
function's name. Function-attached directives still take
precedence. The existing 'unsafe' import gate is preserved.

Fixes #4395, #5365
2026-07-12 11:54:38 +02:00
Konstantin Sharlaimov c1a4ed1489 machine/stm32: add OTG FS USB driver for F4/F7
STM32F4 and F7 share the same OTG FS IP but have no USB driver in
TinyGo. This adds a full device-mode driver covering CDC, HID, and
MSC with working examples.

- OTG FS has 4 physical EPs (0–3); virtual indices 4–7 fold onto
  them via physEP() so the existing machine/usb API is unchanged
- F4 bypasses VBUS sensing via GCCFG.NOVBUSSENS; F7 uses the USB
  voltage regulator + GOTGCTL B-valid override instead
- STM32F7 PLL_Q changed 2→9 to produce the 48 MHz clock required
  by USB/RNG/SDMMC; CK48MSEL cleared to select main PLL as source
- HID and MSC descriptors remapped at init() to physical endpoint
  addresses (EP2/EP1 for HID, EP2/EP3 for MSC)
- usb-storage example replaced machine.Flash with a FAT12 RAM disk
  so the host mounts without reformatting
- MSC sendCSW sets queuedBytes before state transition to fix a
  missed byte-count on the status phase
2026-07-12 10:45:49 +02:00
Jake Bailey 140c82e012 compiler: disambiguate generic instance link names with local type args 2026-07-11 16:20:08 +02:00
Jake Bailey dc23ce73d6 testdata: add regression test for generic instances with local type args 2026-07-11 16:20:08 +02:00
Jake Bailey e039ce131c runtime: encode pending Goexit in panic state
Treat panicState as a bitmask so a recovered panic during Goexit
can clear the panic bit while preserving the pending Goexit bit.
This removes the separate deferFrame Goexit field and restores the
previous defer frame size.
2026-07-11 11:53:33 +02:00
Jake Bailey d59c706e60 GNUmakefile: increase encoding/xml test stack
Top-level tests now run in goroutines, which puts stdlib tests on
TinyGo's default host goroutine stack. encoding/xml's depth-limit
test needs a larger stack on Linux and Darwin, so run just that
package with a larger stack while leaving the rest of the host stdlib
tests on the default stack.
2026-07-11 11:53:33 +02:00
Jake Bailey 26d3645317 GNUMakefile: change skip reason note 2026-07-11 11:53:33 +02:00
Jake Bailey 432ebe13ed runtime: make Goexit exit host threads
The threads scheduler handled runtime.Goexit using the generic deadlock
path, which parked the current pthread forever. Add a scheduler-specific
goexit hook so it can remove the current task and exit the pthread while
ordinary blocking deadlocks still block.

Track main goroutine Goexit so the last remaining goroutine reports the
expected deadlock instead of letting the process exit successfully.
Expand the crash coverage with the Goexit cases covered by Big Go's
runtime tests.
2026-07-11 11:53:33 +02:00
Jake Bailey 16eefc59eb runtime, testing: support Goexit, SkipNow, FailNow
Keep a pending Goexit separate from the active panic state so recovered
deferred panics do not cancel the original Goexit unwind. Goexit should
also ignore -panic=trap, since it is not a panic.

Wire testing.FailNow and SkipNow through runtime.Goexit, and run tests
and benchmarks in goroutines. This lets Goexit terminate the user
function without skipping test bookkeeping. Add Goexit/recover coverage
and enable crypto/ecdh in the Linux stdlib test list.
2026-07-11 11:53:33 +02:00
deadprogram fb1bf2e6bf build: statically link MinGW runtime in LLVM tools on Windows
Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-10 23:54:46 +02:00
Matthew Hiles 0922e3e956 add device/uefi and device/amd64 2026-07-08 14:19:59 +02:00
Victor Costa bd61913973 wasm: patch wasm_exec.js and wasm_exec_node.js from Go 1.18+ (#5483)
* wasm: patch wasm_exec.js and wasm_exec_node.js from Go 1.18+

Port this commit https://github.com/golang/go/commit/680caf15355057ca84857a2a291b6f5c44e73329 removing polyfills from `wasm_exec.js`, now the environment is expected to provide all the required polyfills.

`wasm_exec.js` now only provides stub fallbacks for globalThis.fs and globalThis.process.

All NodeJS specific code is now in a separate file `wasm_exec_node.js` with its required polyfills.

* feat: bump minimum node version to 22

Drops official support for NodeJS 18 for WASM by removing the provided polyfills in the `wasm_exec.js`.

Now the environment is expected to provide the polyfill if it is running on older NodeJS versions

The new minimum required version for WASM is NodeJS 22+.

* chore: removed wrong comment

`wasm_exec_node.js` no longer contains the polyfill for NodeJS 18
2026-07-08 12:32:00 +02:00
Matthew Hiles 2dbfdbae10 UEFI Target Groundwork: Add LinkerFlavor compile option (#5465)
* Add LinkerFlavor so the odd pairing of COFF+Linux is possible (necessary for UEFI)

* But back bits of builder.go that were mistakenly removed

* Update compileopts/config.go

Co-authored-by: Ayke <aykevanlaethem@gmail.com>

* update LinkerFlavor test

---------

Co-authored-by: Ayke <aykevanlaethem@gmail.com>
2026-07-08 10:33:59 +02:00
Ayke van Laethem 05029c4fb5 machine: add support for the STM32U031 chip 2026-07-08 08:54:06 +02:00
Bryan Souza a7b30639d8 Adding support for the 'Plus' board variant of SeeedStudio XIAO nrf52840, works with Sense variants as well (#5479)
* adding support for SeeedStudio XIAO BLE Plus and Sense Plus boards;

* adjusting definitions for UARTs on XIAO BLE Plus;

* fixed buid tag on XIAO BLE Plus;

* tested by building some examples; fixed UART nomenclature;

* added xiao-ble-plus to GNUmakefile smoketests;
2026-07-07 13:36:18 +02:00
Pat Whittingslow 4adc661197 upgrade net (#5490)
* upgrade net

* add some missing crypto and os API (#5488)

* add missing crypto API

* gofmt crypto/tls/common.go

* pull new net with unixsock formatted

* update net to latest main
2026-07-07 10:40:36 +02:00
Pat Whittingslow 311c071ae6 add runtime.fastrandn (#5502) 2026-07-06 22:35:41 -03:00
Jake Bailey f1fdfe2313 reflect: add missing iterator methods 2026-07-06 23:47:28 +02:00
Jake Bailey 7c3dc05117 all: modernize (#5498)
* modernize string cut usage

* modernize string cut prefix usage

* modernize slices helper usage

* modernize min and max usage

* modernize loop variable copies

* modernize integer range loops

* modernize map copy loops

* modernize go types iterator usage

* modernize empty interface usage

* modernize atomic type usage

* modernize string builders

* modernize string split iteration

* modernize remaining loop variable copies

* modernize usb cdc min usage

* modernize src integer range loops

* modernize example empty interface usage

* modernize src min and max usage

* modernize src integer range loops

* modernize src empty interface usage

* modernize src atomic type usage

* modernize reflect type lookups

* modernize review nits
2026-07-06 21:58:48 +02:00
Ron Evans e569dcfe38 runtime: fix ticker not stopping when Stop races with its callback (#5487)
* runtime: fix ticker not stopping when Stop races with its callback

On the threads and cores schedulers, timer callbacks run concurrently
with user goroutines.

If Stop (or Reset) was called in the window after the node was popped
but before its callback re-added it, removeTimer would not find the
timer in the queue, so it would be re-added to timer anyway.

Track timers whose callback is currently running in a firing list, and
have removeTimer mark a firing timer as stopped so its callback does not
re-add it.

Also make the timers test drain robust: allow a possible in-flight tick
delivered concurrently with Stop to settle before draining the channel.

Signed-off-by: deadprogram <ron@hybridgroup.com>

* runtime: fix Stop/Reset semantics when racing a firing timer callback

Address review feedback on the ticker Stop-race fix. On the threads and
cores schedulers a timer callback runs concurrently with user goroutines,
which left several problems:

- removeTimer reported a firing timer as successfully removed, so
  Stop/Reset could return true even though the callback had already
  started (wrong semantics, notably for AfterFunc). firingTimerStop now
  returns a bool and removeTimer no longer hands the still-firing node
  back to resetTimer.

- The periodic advance (when += period) ran in timerCallback outside the
  scheduler timer lock. Move it into each scheduler's reAddTimer, under
  the lock and after the stopped check, so a concurrent Reset can't have
  its freshly-queued deadline corrupted.

- resetTimer now sets when/period after removeTimer for the same reason.

Add testdata/timer_stop_reset_race.go and TestTimerStopResetRace, which
reproduce the stop-while-firing and reset-while-firing races via the
runtime timer linkname hooks.

Signed-off-by: deadprogram <ron@hybridgroup.com>

* runtime: fix timer Stop/Reset race with firing periodic timers

Signed-off-by: deadprogram <ron@hybridgroup.com>

---------

Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-06 20:14:53 +02:00
wikto 20038817ae [feature] moved ReadTemeprature to machine_esp32s3.go 2026-07-05 14:27:31 +02:00
Wikwoj0512 9ce73cfafa [feature] added temperature reading to esp32s3 2026-07-05 14:27:31 +02:00
deadprogram 0033c23848 machine/esp32c6: add ADC driver
Adds machine_esp32c6_adc.go implementing the machine.ADC interface for
ESP32-C6 (ADC1 only, GPIO0–GPIO6, channels 0–6; there is no ADC2).

Signed-off-by: deadprogram <ron@hybridgroup.com>
2026-07-05 14:22:58 +02:00