mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
machine: add Device constant
This field contains the microcontroller name that we're compiling for, or "generic" if we're not running on a microcontroller.
This commit is contained in:
committed by
Ron Evans
parent
6b0f2cd697
commit
3d73ee77d3
@@ -10,6 +10,13 @@ var (
|
||||
ErrNoPinChangeChannel = errors.New("machine: no channel available for pin interrupt")
|
||||
)
|
||||
|
||||
// Device is the running program's chip name, such as "ATSAMD51J19A" or
|
||||
// "nrf52840". It is not the same as the CPU name.
|
||||
//
|
||||
// The constant is some hardcoded default value if the program does not target a
|
||||
// particular chip but instead runs in WebAssembly for example.
|
||||
const Device = deviceName
|
||||
|
||||
// PinMode sets the direction and pull mode of the pin. For example, PinOutput
|
||||
// sets the pin as an output and PinInputPullup sets the pin as an input with a
|
||||
// pull-up.
|
||||
|
||||
Reference in New Issue
Block a user