mirror of https://github.com/tinygo-org/tinygo.git
Browse Source
Make the USBCDC use a pointer receiver everywhere. This makes it easier to pass around the object in the future. This commit sometimes changes code size, but not significantly (a few bytes) and usually in a positive way. My eventual goal is the following: - Declare `machine.USB` (or similar, name TBD) as a pointer receiver for the USB-CDC interface. - Let `machine.UART0` always point to an UART, never actually to a USBCDC object. - Define `machine.Serial`, which is either a real UART or an USB-CDC, depending on the board. This way, if you want a real UART you can use machine.UARTx and if you just want to print to the default serial port, you can use machine.Serial. This change does have an effect on code size and memory consumption. There is often a small reduction (-8 bytes) in RAM consumption and an increase in flash consumption.pull/1882/head
Ayke van Laethem
4 years ago
committed by
Ron Evans
11 changed files with 64 additions and 63 deletions
Loading…
Reference in new issue