compiler: Implement init()

This commit is contained in:
Ayke van Laethem
2018-04-26 18:54:46 +02:00
parent 9a988dd1d1
commit c940617849
4 changed files with 19 additions and 2 deletions
+2
View File
@@ -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;
-1
View File
@@ -18,7 +18,6 @@ void uart_send(uint8_t c) {
}
void _start() {
uart_init(6); // pin_tx = 6, for NRF52840-DK
main();
}
+4
View File
@@ -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) {