runtime/nrf: translate nrf sleep function from C to Go

This is the last critical part of the C runtime.

Code size is reduced by 4 bytes for examples/blinky2 (probably due to
inlining) and is unchanged for examples/test.
This commit is contained in:
Ayke van Laethem
2018-09-12 22:16:06 +02:00
parent 67e33ac30e
commit f7f7d4cbbc
3 changed files with 27 additions and 39 deletions
-6
View File
@@ -36,7 +36,6 @@ CFLAGS += -I$(CURDIR)/lib/nrfx/mdk
CFLAGS += -I$(CURDIR)/lib/CMSIS/CMSIS/Include
CFLAGS += -DNRF52832_XXAA
CFLAGS += -Wno-uninitialized
RUNTIME_PARTS += build/runtime_nrf.bc
RUNTIME_PARTS += build/nrfx_system_nrf52.bc
OBJ += build/nrfx_startup_nrf51.o # TODO nrf52, see https://bugs.llvm.org/show_bug.cgi?id=31601
@@ -98,11 +97,6 @@ build/tgo: *.go
build/%.o: src/examples/% src/examples/%/*.go build/tgo src/runtime/*.go build/runtime-$(TARGET)-combined.bc
./build/tgo build $(TGOFLAGS) -runtime build/runtime-$(TARGET)-combined.bc -o $@ $(subst src/,,$<)
# Compile C sources for the runtime.
build/%.bc: src/runtime/%.c src/runtime/*.h
@mkdir -p build
clang $(CFLAGS) -c -o $@ $<
# Compile LLVM bitcode from LLVM source.
build/%.bc: src/runtime/%.ll
$(LLAS) -o $@ $<