alot of stuff, mostly testing
This commit is contained in:
parent
613fde5a61
commit
dabd9dda17
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Linux",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"/home/franchioping/NSpire/Ndless/ndless-sdk/include/*"
|
||||||
|
],
|
||||||
|
"defines": [],
|
||||||
|
"compilerPath": "/usr/bin/clang",
|
||||||
|
"cStandard": "c17",
|
||||||
|
"cppStandard": "c++17",
|
||||||
|
"intelliSenseMode": "linux-gcc-arm"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ main:
|
||||||
mov r9, sp
|
mov r9, sp
|
||||||
sub sp, sp, #s_SIZE // Reserve space for state ADDED
|
sub sp, sp, #s_SIZE // Reserve space for state ADDED
|
||||||
|
|
||||||
|
|
||||||
mov r4, #0
|
mov r4, #0
|
||||||
mov r6, #s_SIZE
|
mov r6, #s_SIZE
|
||||||
1: subs r6, r6, #4
|
1: subs r6, r6, #4
|
||||||
|
|
@ -19,6 +20,9 @@ main:
|
||||||
bne 1b
|
bne 1b
|
||||||
str r5, [r9, #s_saved_sp]
|
str r5, [r9, #s_saved_sp]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ Get our folder path
|
@ Get our folder path
|
||||||
add r4, r9, #s_path
|
add r4, r9, #s_path
|
||||||
mov r2, r4
|
mov r2, r4
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
5
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
DEBUG = FALSE
|
||||||
|
|
||||||
|
BLD_FILE ?= .buildver
|
||||||
|
|
||||||
|
# Initiate BLD_FILE if not exists
|
||||||
|
buildver_create := $(shell if ! test -f $(BLD_FILE); then echo 0 > $(BLD_FILE); fi)
|
||||||
|
|
||||||
|
# Prepare callable function. This function updates BLD_FILE
|
||||||
|
buildver = $(shell echo $$(($$(cat $(BLD_FILE)) + 1)) > $(BLD_FILE))
|
||||||
|
|
||||||
|
VER = buildver
|
||||||
|
|
||||||
|
GCC = nspire-gcc
|
||||||
|
AS = nspire-as
|
||||||
|
GXX = nspire-g++
|
||||||
|
LD = nspire-ld
|
||||||
|
GENZEHN = genzehn
|
||||||
|
|
||||||
|
EXE = nespire_mod_$(shell cat $(BLD_FILE))
|
||||||
|
|
||||||
|
|
||||||
|
GCCFLAGS = -Wall -W -marm
|
||||||
|
LDFLAGS =
|
||||||
|
ZEHNFLAGS = --name "$(EXE)"
|
||||||
|
|
||||||
|
ifeq ($(DEBUG),FALSE)
|
||||||
|
GCCFLAGS += -Os
|
||||||
|
else
|
||||||
|
GCCFLAGS += -O0 -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
OBJS = $(patsubst %.c, %.o, $(shell find . -name \*.c))
|
||||||
|
OBJS += $(patsubst %.cpp, %.o, $(shell find . -name \*.cpp))
|
||||||
|
OBJS += $(patsubst %.S, %.o, $(shell find . -name \*.S))
|
||||||
|
DISTDIR = .
|
||||||
|
vpath %.tns $(DISTDIR)
|
||||||
|
vpath %.elf $(DISTDIR)
|
||||||
|
|
||||||
|
all: $(EXE).tns
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(GCC) $(GCCFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
%.o: %.cpp
|
||||||
|
$(GXX) $(GCCFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
%.o: %.S
|
||||||
|
$(AS) -c $< -o $@
|
||||||
|
|
||||||
|
$(EXE).elf: $(OBJS)
|
||||||
|
mkdir -p $(DISTDIR)
|
||||||
|
$(LD) $^ -o $@ $(LDFLAGS)
|
||||||
|
|
||||||
|
$(EXE).tns: $(EXE).elf
|
||||||
|
$(GENZEHN) --input $^ --output $@.zehn $(ZEHNFLAGS)
|
||||||
|
$(call buildver)
|
||||||
|
make-prg $@.zehn $@
|
||||||
|
rm $@.zehn
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJS) $(DISTDIR)/$(EXE).tns $(DISTDIR)/$(EXE).elf $(DISTDIR)/$(EXE).zehn nespire_mod_*.elf nespire_mod_*.tns
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
.global arm_util_stuff
|
||||||
|
arm_util_stuff:
|
||||||
|
bx lr
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,17 @@
|
||||||
|
.extern arm_util_stuff
|
||||||
|
|
||||||
|
|
||||||
|
.global main
|
||||||
|
main:
|
||||||
|
push {r4-r11, lr}
|
||||||
|
mov r9, sp
|
||||||
|
|
||||||
|
|
||||||
|
bl util_stuff
|
||||||
|
|
||||||
|
|
||||||
|
mov sp, r9
|
||||||
|
pop {r4-r11, pc}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <libndls.h>
|
||||||
|
|
||||||
|
void util_stuff();
|
||||||
|
|
||||||
|
void util_stuff(){
|
||||||
|
|
||||||
|
printf("Hello World!\n");
|
||||||
|
|
||||||
|
|
||||||
|
wait_key_pressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
Binary file not shown.
Loading…
Reference in New Issue