diff --git a/.gitignore b/.gitignore index a431dc7..d9f24cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ /.settings /Debug +/debug +/bin /targetConfigs /.ccsproject /.cproject diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..e1cadd0 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,34 @@ +{ + "env": { + "DEBUGDIR": "./debug", + "SRCDIR" : "./src", + "BINDIR" : "./bin", + "TI_CCSDIR" : "/home/mreenen/.local/share/ccs10/ccs", + "TI_SL_CC32xxDIR": "/home/mreenen/.local/share/ccs10/simplelink_cc32xx_sdk_4_30_00_06", + "TI_INCLUDEDIR" : "${TI_SL_CC32xxDIR}/source", + "TI_XDCTOOLSDIR" : "/home/mreenen/.local/share/ccs10/xdctools_3_61_02_27_core", + "TI_KERNEL" : "${TI_SL_CC32xxDIR}/kernel/tirtos", + "TI_EABI" : "${TI_KERNEL}/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/", + "TI_CGT" : "${TI_CCSDIR}/tools/compiler/ti-cgt-arm_20.2.1.LTS/include" + },"configurations": [ + { + "name": "TI", + "compilerPath": "/usr/bin/gcc", + "includePath": [ + "${TI_INCLUDEDIR}", + "${TI_INCLUDEDIR}/ti/posix/gcc", + "${TI_KERNEL}/packages", + "${TI_XDCTOOLSDIR}/packages", + "${TI_CGT}", + "${TI_EABI}" + ], + "defines": [ + "DEVICE_FAMALY=CC32xx", + "DEVICE=CC3220S" + ] + } + ], + "version": 4 + } + + \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..be120a3 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "gcc-9 - Build and debug active file", + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}/${fileBasenameNoExtension}", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "C/C++: gcc-9 build active file", + "miDebuggerPath": "/usr/bin/gdb" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..fef3ce0 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "type": "cppbuild", + "label": "build using make", + "command": "/usr/bin/make", + "args": [ "all" ], + "options": { + "cwd": "${workspaceFolder}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "Task generated by Debugger." + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cea580b --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +CC := /usr/bin/gcc -x c +CURDIR := $(shell pwd) + +DEBUGDIR := $(CURDIR)/debug +SRCDIR := $(CURDIR)/src +BINDIR := $(CURDIR)/bin + +# TI +TI_CCSDIR := /home/mreenen/.local/share/ccs10/ccs +TI_SL_CC32xxDIR := /home/mreenen/.local/share/ccs10/simplelink_cc32xx_sdk_4_30_00_06 +TI_XDCTOOLSDIR := /home/mreenen/.local/share/ccs10/xdctools_3_61_02_27_core +TI_INCLUDEDIR := $(TI_SL_CC32xxDIR)/source +TI_KERNEL := $(TI_SL_CC32xxDIR)/kernel/tirtos +TI_EABI := $(TI_KERNEL)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/ +TI_CGT := $(TI_CCSDIR)/tools/compiler/ti-cgt-arm_20.2.1.LTS/include +TI_CCINCLUDES := -I"$(TI_INCLUDEDIR)" -I"$(TI_INCLUDEDIR)/ti/posix/gcc" -I"$(TI_KERNEL)/packages" -I"$(TI_XDCTOOLSDIR)/packages" -I"$(TI_CGT)" -I"$(TI_EABI)" + +# CC ARGS +CC_INCLUDES := $(TI_CCINCLUDES) +CC_ARGS := $(CC_INCLUDES) + +OBJECTS := $(DEBUGDIR)/main.o $(DEBUGDIR)/communicatieBeheer.o $(DEBUGDIR)/noodstop.o $(DEBUGDIR)/systeemBeheer.o + +dirs: + mkdir -p $(DEBUGDIR) $(SRCDIR) $(BINDIR) + +# compile +main.o: src/main.c dirs + $(CC) $(CC_ARGS) -c $(SRCDIR)/main.c -o $(DEBUGDIR)/main.o +communicatieBeheer.o: src/communicatieBeheer.c dirs + $(CC) $(CC_ARGS) -c $(SRCDIR)/communicatieBeheer.c -o $(DEBUGDIR)/communicatieBeheer.o +noodstop.o: src/noodstop.c dirs + $(CC) $(CC_ARGS) -c $(SRCDIR)/noodstop.c -o $(DEBUGDIR)/noodstop.o +systeemBeheer.o: src/systeemBeheer.c dirs + $(CC) $(CC_ARGS) -c $(SRCDIR)/systeemBeheer.c -o $(DEBUGDIR)/systeemBeheer.o + +# link +link: main.o communicatieBeheer.o noodstop.o systeemBeheer.o + $(CC) $(CC_ARGS) -o $(BINDIR)/binary $(OBJECTS) + +all: link + +clean: + rm -p domeTimer $(DEBUGDIR)/*