mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
compiler: Implement init()
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
#include "runtime.h"
|
||||
#include <string.h>
|
||||
|
||||
void go_init() __asm__("runtime.initAll");
|
||||
void go_main() __asm__("main.main");
|
||||
|
||||
int main() {
|
||||
go_init();
|
||||
go_main();
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -18,7 +18,6 @@ void uart_send(uint8_t c) {
|
||||
}
|
||||
|
||||
void _start() {
|
||||
uart_init(6); // pin_tx = 6, for NRF52840-DK
|
||||
main();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,10 @@ package runtime
|
||||
// #include "runtime_nrf.h"
|
||||
import "C"
|
||||
|
||||
func init() {
|
||||
C.uart_init(6) // pin_tx = 6, for NRF52840-DK
|
||||
}
|
||||
|
||||
const Microsecond = 1
|
||||
|
||||
func putchar(c byte) {
|
||||
|
||||
Reference in New Issue
Block a user