Skip to content

Conversation

@aykevl
Copy link
Member

@aykevl aykevl commented Oct 14, 2020

This flag allows setting the standard output to a few different values:

  • -output=none: do not produce output. This is useful for some systems that lack a native output (e.g. Digispark) or for WebAssembly where the additional wasi output dependency may be a problem.
  • -output=native: use native output for the target, for example stdout on an OS or the native output of QEMU under emulation.
  • -output=uart: use UART output, the default for most microcontrollers.
  • -output=custom: allow setting a custom output with runtime.SetOutput. This provides flexibility for those who need it.

It is quite an invasive change, and it might break things. I have not tested this extensively.

In particular, this includes a change to the Teensy 3.6 to be more like other targets. It now configures the UART at startup and thus no longer needs to configure it on demand when needed. It also doesn't call runtime.Gosched() from the machine package anymore, greatly simplifying the code (this is better solved with #1172 anyway).

Even though there are some more calls, I compared code size before and after and it doesn't change, except for atmega where it is two bytes (one instruction) reduced for some reason. But examples/serial still works on my Uno so I don't think this is something to worry about.

This flag allows setting the standard output to a few different values:

  -output=none:   do not produce output. This is useful for some systems
                  that lack a native output (e.g. Digispark) or for
                  WebAssembly where the additional wasi output
                  dependency may be a problem.
  -output=native: use native output for the target, for example stdout
                  on an OS or the native output of QEMU under emulation.
  -output=uart:   use UART output, the default for most
                  microcontrollers.
  -output=custom: allow setting a custom output with runtime.SetOutput.
                  This provides flexibility for those who need it.
@aykevl
Copy link
Member Author

aykevl commented Oct 14, 2020

This depends on #1441 which should fix CI for this PR.

@aykevl
Copy link
Member Author

aykevl commented Aug 15, 2021

#1922 has been merged, which is the same functionality, so closing.

@aykevl aykevl closed this Aug 15, 2021
@deadprogram deadprogram deleted the output-flag branch January 4, 2022 19:43
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.

2 participants