separate in directories
authorMart Lubbers <mart@martlubbers.net>
Mon, 3 Apr 2017 11:57:25 +0000 (13:57 +0200)
committerMart Lubbers <mart@martlubbers.net>
Mon, 3 Apr 2017 11:57:25 +0000 (13:57 +0200)
54 files changed:
.gitmodules
client/Makefile
client/Makefile.NodeMCU [deleted file]
client/Makefile.linux [deleted file]
client/client.c [moved from client/main.c with 91% similarity]
client/interface.h
client/interface_nodemcu.c [deleted file]
client/linux/Makefile [new file with mode: 0644]
client/linux/client [new file with mode: 0755]
client/linux/client.c [new symlink]
client/linux/interface.c [moved from client/interface_linux.c with 98% similarity]
client/linux/interface.h [new symlink]
client/linux/interpret.c [new symlink]
client/linux/interpret.h [new symlink]
client/linux/mTaskSymbols.h [new symlink]
client/linux/sds.c [new symlink]
client/linux/sds.h [new symlink]
client/linux/spec.c [new symlink]
client/linux/spec.h [new symlink]
client/linux/task.c [new symlink]
client/linux/task.h [new symlink]
client/nodemcu/Makefile [new file with mode: 0644]
client/nodemcu/interface.c [new file with mode: 0644]
client/nodemcu/interface.h [new symlink]
client/nodemcu/interpret.c [new symlink]
client/nodemcu/interpret.h [new symlink]
client/nodemcu/mTaskSymbols.h [new symlink]
client/nodemcu/nodemcu.ino [new symlink]
client/nodemcu/sds.c [new symlink]
client/nodemcu/sds.h [new symlink]
client/nodemcu/spec.c [new symlink]
client/nodemcu/spec.h [new symlink]
client/nodemcu/task.c [new symlink]
client/nodemcu/task.h [new symlink]
client/spec.c
client/spec.h
client/stm32/ChibiOS [moved from client/ChibiOS with 100% similarity]
client/stm32/Makefile [new file with mode: 0644]
client/stm32/chconf.h [moved from client/chconf.h with 100% similarity]
client/stm32/client.c [new symlink]
client/stm32/halconf.h [moved from client/halconf.h with 100% similarity]
client/stm32/interface.c [moved from client/interface.c with 97% similarity]
client/stm32/interface.h [new symlink]
client/stm32/interpret.c [new symlink]
client/stm32/interpret.h [new symlink]
client/stm32/mTaskSymbols.h [new symlink]
client/stm32/mcuconf.h [moved from client/mcuconf.h with 100% similarity]
client/stm32/sds.c [new symlink]
client/stm32/sds.h [new symlink]
client/stm32/spec.c [new symlink]
client/stm32/spec.h [new symlink]
client/stm32/task.c [new symlink]
client/stm32/task.h [new symlink]
client/user_config.h [deleted file]

index 5195bdd..2ee1383 100644 (file)
@@ -2,5 +2,5 @@
        path = CleanSerial
        url = https://gitlab.science.ru.nl/mlubbers/CleanSerial
 [submodule "int/ChibiOS"]
-       path = client/ChibiOS
+       path = client/stm32/ChibiOS
        url = https://github.com/ChibiOS/ChibiOS.git
index 3e2db2e..652910b 100644 (file)
@@ -1,235 +1,4 @@
-##############################################################################\r
-# Build global options\r
-# NOTE: Can be overridden externally.\r
-#\r
-\r
-# Compiler options here.\r
-ifeq ($(USE_OPT),)\r
-  USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16\r
-endif\r
-\r
-# C specific options here (added to USE_OPT).\r
-ifeq ($(USE_COPT),)\r
-  USE_COPT = \r
-endif\r
-\r
-# C++ specific options here (added to USE_OPT).\r
-ifeq ($(USE_CPPOPT),)\r
-  USE_CPPOPT = -fno-rtti\r
-endif\r
-\r
-# Enable this if you want the linker to remove unused code and data\r
-ifeq ($(USE_LINK_GC),)\r
-  USE_LINK_GC = yes\r
-endif\r
-\r
-# Linker extra options here.\r
-ifeq ($(USE_LDOPT),)\r
-  USE_LDOPT = \r
-endif\r
-\r
-# Enable this if you want link time optimizations (LTO)\r
-ifeq ($(USE_LTO),)\r
-  USE_LTO = yes\r
-endif\r
-\r
-# If enabled, this option allows to compile the application in THUMB mode.\r
-ifeq ($(USE_THUMB),)\r
-  USE_THUMB = yes\r
-endif\r
-\r
-# Enable this if you want to see the full log while compiling.\r
-ifeq ($(USE_VERBOSE_COMPILE),)\r
-  USE_VERBOSE_COMPILE = no\r
-endif\r
-\r
-# If enabled, this option makes the build process faster by not compiling\r
-# modules not used in the current configuration.\r
-ifeq ($(USE_SMART_BUILD),)\r
-  USE_SMART_BUILD = yes\r
-endif\r
-\r
-#\r
-# Build global options\r
-##############################################################################\r
-\r
-##############################################################################\r
-# Architecture or project specific options\r
-#\r
-\r
-# Stack size to be allocated to the Cortex-M process stack. This stack is\r
-# the stack used by the main() thread.\r
-ifeq ($(USE_PROCESS_STACKSIZE),)\r
-  USE_PROCESS_STACKSIZE = 0x400\r
-endif\r
-\r
-# Stack size to the allocated to the Cortex-M main/exceptions stack. This\r
-# stack is used for processing interrupts and exceptions.\r
-ifeq ($(USE_EXCEPTIONS_STACKSIZE),)\r
-  USE_EXCEPTIONS_STACKSIZE = 0x400\r
-endif\r
-\r
-# Enables the use of FPU (no, softfp, hard).\r
-ifeq ($(USE_FPU),)\r
-  USE_FPU = no\r
-endif\r
-\r
-# FPU-related options.\r
-ifeq ($(USE_FPU_OPT),)\r
-  USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv5-d16\r
-endif\r
-\r
-#\r
-# Architecture or project specific options\r
-##############################################################################\r
-\r
-##############################################################################\r
-# Project, sources and paths\r
-#\r
-\r
-# Define project name here\r
-PROJECT = mTask\r
-\r
-# Imported source files and paths\r
-CHIBIOS = ./ChibiOS\r
-# Startup files.\r
-include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk\r
-# HAL-OSAL files (optional).\r
-include $(CHIBIOS)/os/hal/hal.mk\r
-include $(CHIBIOS)/os/hal/ports/STM32/STM32F7xx/platform.mk\r
-include $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.mk\r
-include $(CHIBIOS)/os/hal/osal/rt/osal.mk\r
-# RTOS files (optional).\r
-include $(CHIBIOS)/os/rt/rt.mk\r
-include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk\r
-# Other files (optional).\r
-include $(CHIBIOS)/test/rt/test.mk\r
-\r
-# Define linker script file here\r
-LDSCRIPT= $(STARTUPLD)/STM32F76xxI.ld\r
-\r
-# C sources that can be compiled in ARM or THUMB mode depending on the global\r
-# setting.\r
-CSRC = $(STARTUPSRC) \\r
-       $(KERNSRC) \\r
-       $(PORTSRC) \\r
-       $(OSALSRC) \\r
-       $(HALSRC) \\r
-       $(PLATFORMSRC) \\r
-       $(BOARDSRC) \\r
-       $(TESTSRC) \\r
-       $(CHIBIOS)/os/hal/lib/streams/memstreams.c \\r
-       $(CHIBIOS)/os/hal/lib/streams/chprintf.c \\r
-          $(filter-out interface_linux.c,$(wildcard *.c))\r
-\r
-# C++ sources that can be compiled in ARM or THUMB mode depending on the global\r
-# setting.\r
-CPPSRC =\r
-\r
-# C sources to be compiled in ARM mode regardless of the global setting.\r
-# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler\r
-#       option that results in lower performance and larger code size.\r
-ACSRC =\r
-\r
-# C++ sources to be compiled in ARM mode regardless of the global setting.\r
-# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler\r
-#       option that results in lower performance and larger code size.\r
-ACPPSRC =\r
-\r
-# C sources to be compiled in THUMB mode regardless of the global setting.\r
-# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler\r
-#       option that results in lower performance and larger code size.\r
-TCSRC =\r
-\r
-# C sources to be compiled in THUMB mode regardless of the global setting.\r
-# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler\r
-#       option that results in lower performance and larger code size.\r
-TCPPSRC =\r
-\r
-# List ASM source files here\r
-ASMSRC =\r
-ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)\r
-\r
-INCDIR = $(CHIBIOS)/os/license \\r
-         $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \\r
-         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \\r
-         $(CHIBIOS)/os/various\r
-\r
-#\r
-# Project, sources and paths\r
-##############################################################################\r
-\r
-##############################################################################\r
-# Compiler settings\r
-#\r
-\r
-MCU  = cortex-m7\r
-\r
-#TRGT = arm-elf-\r
-TRGT = arm-none-eabi-\r
-CC   = $(TRGT)gcc\r
-CPPC = $(TRGT)g++\r
-# Enable loading with g++ only if you need C++ runtime support.\r
-# NOTE: You can use C++ even without C++ support if you are careful. C++\r
-#       runtime support makes code size explode.\r
-LD   = $(TRGT)gcc\r
-#LD   = $(TRGT)g++\r
-CP   = $(TRGT)objcopy\r
-AS   = $(TRGT)gcc -x assembler-with-cpp\r
-AR   = $(TRGT)ar\r
-OD   = $(TRGT)objdump\r
-SZ   = $(TRGT)size\r
-HEX  = $(CP) -O ihex\r
-BIN  = $(CP) -O binary\r
-\r
-# ARM-specific options here\r
-AOPT =\r
-\r
-# THUMB-specific options here\r
-TOPT = -mthumb -DTHUMB\r
-\r
-# Define C warning options here\r
-CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Werror\r
-\r
-# Define C++ warning options here\r
-CPPWARN = -Wall -Wextra -Wundef\r
-\r
-#\r
-# Compiler settings\r
-##############################################################################\r
-\r
-##############################################################################\r
-# Start of user section\r
-#\r
-\r
-# List all user C define here, like -D_DEBUG=1\r
-UDEFS = -DSTM #-DDEBUG\r
-\r
-# Define ASM defines here\r
-UADEFS =\r
-\r
-# List all user directories here\r
-UINCDIR =\r
-\r
-# List the user directory to look for the libraries here\r
-ULIBDIR =\r
-\r
-# List all user libraries here\r
-ULIBS =\r
-\r
-# End of user defines\r
-##############################################################################\r
-\r
-RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC\r
-include $(RULESPATH)/rules.mk\r
-\r
-flash: build/$(PROJECT).bin\r
-       sudo `which openocd` \\r
-               -f interface/stlink-v2-1.cfg\\r
-               -c "transport select hla_swd"\\r
-               -f target/stm32f7x.cfg \\r
-               -c init\\r
-               -c "reset halt"\\r
-               -c "flash write_image erase "$<" 0x08000000"\\r
-               -c "reset run"\\r
-               -c shutdown\r
+all:
+       make -C nodemcu
+       make -C stm32
+       make -C linux
diff --git a/client/Makefile.NodeMCU b/client/Makefile.NodeMCU
deleted file mode 100644 (file)
index 09c18bf..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-CC = xtensa-lx106-elf-gcc
-CFLAGS = -DNODEMCU -I. -mlongcalls -Wall -Wextra -Werror -DDEBUG
-LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -lc -Wl,--end-group -lgcc -I/home/mrl/projects/esp-open-sdk/sdk/include -L/home/mrl/projects/esp-open-sdk/sdk/lib
-LDFLAGS = -Teagle.app.v6.ld
-
-OBJS:=interpret.o sds.o task.o main.o interface.o spec.o
-
-main-0x00000.bin: main
-       esptool.py elf2image $^
-
-main: $(OBJS)
-       $(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) $(OUTPUT_OPTION)
-
-interface.o: interface_nodemcu.c
-       $(CC) $(CFLAGS) -c $< -o $@
-
-#FLASh: %-0x00000.bin
-#      esptool.py write_flash 0 blinky-0x00000.bin 0x40000 blinky-0x40000.bin
-
-clean:
-       $(RM) main $(OBJS)
diff --git a/client/Makefile.linux b/client/Makefile.linux
deleted file mode 100644 (file)
index 8e1bfed..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-CFLAGS:=-DLINUX -g -Wall -Wextra  -DDEBUG
-PROG:=main
-OBJS:=interpret.o sds.o task.o main.o interface.o spec.o
-
-all: $(PROG)
-
-interface.o: interface_linux.c
-       $(CC) $(CFLAGS) -c $< -o $@ 
-
-$(PROG): $(OBJS)
-               $(CC) $(LDFLAGS) -o $@ $(OBJS)
-                               
-clean:
-               $(RM) $(OBJS) $(PROG)
similarity index 91%
rename from client/main.c
rename to client/client.c
index 4919d9d..8fa596f 100644 (file)
@@ -5,11 +5,6 @@
 
 #ifdef LINUX
 #include <stdio.h>
-#elif defined NODEMCU
-#include "ets_sys.h"
-#include "osapi.h"
-#include "gpio.h"
-#include "os_type.h"
 #endif
 
 #include "interpret.h"
@@ -78,7 +73,7 @@ void loop(void)
        read_message();
 
        //Run tasks
-       cyclestart = millis();
+       cyclestart = getmillis();
        for(ct = 0; ct<MAXTASKS; ct++){
                //See whether the task is even in use
                if((curtask = task_get(ct)) == NULL){
@@ -105,8 +100,8 @@ void loop(void)
 
 #ifdef STM
 int main(void){
-#elif defined NODEMCU
-void ICACHE_FLASH_ATTR user_init(){
+#elif defined ARDUINO_ESP8266_NODEMCU
+void setup(){
 #elif defined LINUX
 int main(int argc, char *argv[]){
        gargc = argc;
@@ -121,10 +116,10 @@ int main(int argc, char *argv[]){
        while(true){
                //Check for newtasks
                loop();
-               delay(100);
+               msdelay(100);
        }
 
-#ifndef NODEMCU
+#ifndef ARDUINO_ESP8266_NODEMCU
        return 0;
 #endif
 }
index 042cc20..0982d4c 100644 (file)
@@ -22,7 +22,7 @@ extern char **gargv;
 #define HAVEAIO 1
 #define HAVEDIO 1
 
-#elif defined NODEMCU
+#elif defined ARDUINO_ESP8266_NODEMCU
 #define MAXTASKS 5
 #define MAXSDSS 100
 #define HAVELED 0
@@ -59,8 +59,8 @@ void led_off(uint8_t i);
 #endif
 
 /* Delay and communication */
-long millis(void);
-void delay(long ms);
+long getmillis(void);
+void msdelay(long ms);
 
 /* Auxilliary */
 void setup(void);
diff --git a/client/interface_nodemcu.c b/client/interface_nodemcu.c
deleted file mode 100644 (file)
index 361328f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <stdbool.h>
-#include <stdint.h>
-
-bool input_available(void)
-{
-       return false;
-}
-
-uint8_t read_byte(void)
-{
-       return 0;
-}
-
-void write_byte(uint8_t b)
-{
-       (void)b;
-}
-
-long millis(void)
-{
-       return 0;
-}
-
-void delay(long ms)
-{
-       (void) ms;
-}
-
-void setup(void)
-{
-
-}
-
-void debug(char *fmt, ...)
-{
-       (void)fmt;
-}
-
-void pdie(char *s)
-{
-       (void)s;
-}
-
-void die(char *fmt, ...)
-{
-       (void)fmt;
-}
diff --git a/client/linux/Makefile b/client/linux/Makefile
new file mode 100644 (file)
index 0000000..ad6deff
--- /dev/null
@@ -0,0 +1,11 @@
+CFLAGS:=-DLINUX -g -Wall -Wextra  -DDEBUG
+PROG:=client
+OBJS:=interpret.o sds.o task.o client.o interface.o spec.o
+
+all: $(PROG)
+
+$(PROG): $(OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(OBJS)
+
+clean:
+       $(RM) $(OBJS) $(PROG)
diff --git a/client/linux/client b/client/linux/client
new file mode 100755 (executable)
index 0000000..4b9b984
Binary files /dev/null and b/client/linux/client differ
diff --git a/client/linux/client.c b/client/linux/client.c
new file mode 120000 (symlink)
index 0000000..e47e797
--- /dev/null
@@ -0,0 +1 @@
+../client.c
\ No newline at end of file
similarity index 98%
rename from client/interface_linux.c
rename to client/linux/interface.c
index acfd0b8..971fb0f 100644 (file)
@@ -13,6 +13,7 @@
 #include <unistd.h>
 
 #include "interface.h"
+
 struct timeval tv1;
 int sock_fd = -1;
 int fd = -1;
@@ -32,7 +33,7 @@ void usage(FILE *o, char *arg0){
                "-p PORT  Custom port number, default: 8123\n" , arg0);
 }
 
-long millis(void) {
+long getmillis(void) {
        if (gettimeofday(&tv1, NULL) == -1)
                pdie("gettimeofday");
        return tv1.tv_sec*1000 + tv1.tv_usec/1000;
@@ -91,7 +92,7 @@ uint8_t read_apin(uint8_t i)
        (void) i;
 }
 
-void delay(long ms)
+void msdelay(long ms)
 {
        usleep(ms*1000);
 }
diff --git a/client/linux/interface.h b/client/linux/interface.h
new file mode 120000 (symlink)
index 0000000..b854400
--- /dev/null
@@ -0,0 +1 @@
+../interface.h
\ No newline at end of file
diff --git a/client/linux/interpret.c b/client/linux/interpret.c
new file mode 120000 (symlink)
index 0000000..213f9b8
--- /dev/null
@@ -0,0 +1 @@
+../interpret.c
\ No newline at end of file
diff --git a/client/linux/interpret.h b/client/linux/interpret.h
new file mode 120000 (symlink)
index 0000000..a3858d4
--- /dev/null
@@ -0,0 +1 @@
+../interpret.h
\ No newline at end of file
diff --git a/client/linux/mTaskSymbols.h b/client/linux/mTaskSymbols.h
new file mode 120000 (symlink)
index 0000000..482ac01
--- /dev/null
@@ -0,0 +1 @@
+../mTaskSymbols.h
\ No newline at end of file
diff --git a/client/linux/sds.c b/client/linux/sds.c
new file mode 120000 (symlink)
index 0000000..9d106bb
--- /dev/null
@@ -0,0 +1 @@
+../sds.c
\ No newline at end of file
diff --git a/client/linux/sds.h b/client/linux/sds.h
new file mode 120000 (symlink)
index 0000000..f6b82b5
--- /dev/null
@@ -0,0 +1 @@
+../sds.h
\ No newline at end of file
diff --git a/client/linux/spec.c b/client/linux/spec.c
new file mode 120000 (symlink)
index 0000000..3a0ed1c
--- /dev/null
@@ -0,0 +1 @@
+../spec.c
\ No newline at end of file
diff --git a/client/linux/spec.h b/client/linux/spec.h
new file mode 120000 (symlink)
index 0000000..bbf3789
--- /dev/null
@@ -0,0 +1 @@
+../spec.h
\ No newline at end of file
diff --git a/client/linux/task.c b/client/linux/task.c
new file mode 120000 (symlink)
index 0000000..e4f6627
--- /dev/null
@@ -0,0 +1 @@
+../task.c
\ No newline at end of file
diff --git a/client/linux/task.h b/client/linux/task.h
new file mode 120000 (symlink)
index 0000000..d8ffa8e
--- /dev/null
@@ -0,0 +1 @@
+../task.h
\ No newline at end of file
diff --git a/client/nodemcu/Makefile b/client/nodemcu/Makefile
new file mode 100644 (file)
index 0000000..ffd72dd
--- /dev/null
@@ -0,0 +1,2 @@
+all:
+
diff --git a/client/nodemcu/interface.c b/client/nodemcu/interface.c
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/client/nodemcu/interface.h b/client/nodemcu/interface.h
new file mode 120000 (symlink)
index 0000000..b854400
--- /dev/null
@@ -0,0 +1 @@
+../interface.h
\ No newline at end of file
diff --git a/client/nodemcu/interpret.c b/client/nodemcu/interpret.c
new file mode 120000 (symlink)
index 0000000..213f9b8
--- /dev/null
@@ -0,0 +1 @@
+../interpret.c
\ No newline at end of file
diff --git a/client/nodemcu/interpret.h b/client/nodemcu/interpret.h
new file mode 120000 (symlink)
index 0000000..a3858d4
--- /dev/null
@@ -0,0 +1 @@
+../interpret.h
\ No newline at end of file
diff --git a/client/nodemcu/mTaskSymbols.h b/client/nodemcu/mTaskSymbols.h
new file mode 120000 (symlink)
index 0000000..482ac01
--- /dev/null
@@ -0,0 +1 @@
+../mTaskSymbols.h
\ No newline at end of file
diff --git a/client/nodemcu/nodemcu.ino b/client/nodemcu/nodemcu.ino
new file mode 120000 (symlink)
index 0000000..e47e797
--- /dev/null
@@ -0,0 +1 @@
+../client.c
\ No newline at end of file
diff --git a/client/nodemcu/sds.c b/client/nodemcu/sds.c
new file mode 120000 (symlink)
index 0000000..9d106bb
--- /dev/null
@@ -0,0 +1 @@
+../sds.c
\ No newline at end of file
diff --git a/client/nodemcu/sds.h b/client/nodemcu/sds.h
new file mode 120000 (symlink)
index 0000000..f6b82b5
--- /dev/null
@@ -0,0 +1 @@
+../sds.h
\ No newline at end of file
diff --git a/client/nodemcu/spec.c b/client/nodemcu/spec.c
new file mode 120000 (symlink)
index 0000000..3a0ed1c
--- /dev/null
@@ -0,0 +1 @@
+../spec.c
\ No newline at end of file
diff --git a/client/nodemcu/spec.h b/client/nodemcu/spec.h
new file mode 120000 (symlink)
index 0000000..bbf3789
--- /dev/null
@@ -0,0 +1 @@
+../spec.h
\ No newline at end of file
diff --git a/client/nodemcu/task.c b/client/nodemcu/task.c
new file mode 120000 (symlink)
index 0000000..e4f6627
--- /dev/null
@@ -0,0 +1 @@
+../task.c
\ No newline at end of file
diff --git a/client/nodemcu/task.h b/client/nodemcu/task.h
new file mode 120000 (symlink)
index 0000000..d8ffa8e
--- /dev/null
@@ -0,0 +1 @@
+../task.h
\ No newline at end of file
index 75def00..fdc626b 100644 (file)
@@ -1,4 +1,3 @@
-//TODO
 #include "spec.h"
 #include "interface.h"
 
index a8e0d7d..a7adebc 100644 (file)
@@ -1,9 +1,6 @@
 #ifndef SPEC_H
 #define SPEC_H
 
-#include <stdint.h>
-#include <stdbool.h>
-
 void spec_send(void);
 
 #endif
similarity index 100%
rename from client/ChibiOS
rename to client/stm32/ChibiOS
diff --git a/client/stm32/Makefile b/client/stm32/Makefile
new file mode 100644 (file)
index 0000000..99a26a5
--- /dev/null
@@ -0,0 +1,235 @@
+##############################################################################\r
+# Build global options\r
+# NOTE: Can be overridden externally.\r
+#\r
+\r
+# Compiler options here.\r
+ifeq ($(USE_OPT),)\r
+  USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16\r
+endif\r
+\r
+# C specific options here (added to USE_OPT).\r
+ifeq ($(USE_COPT),)\r
+  USE_COPT = \r
+endif\r
+\r
+# C++ specific options here (added to USE_OPT).\r
+ifeq ($(USE_CPPOPT),)\r
+  USE_CPPOPT = -fno-rtti\r
+endif\r
+\r
+# Enable this if you want the linker to remove unused code and data\r
+ifeq ($(USE_LINK_GC),)\r
+  USE_LINK_GC = yes\r
+endif\r
+\r
+# Linker extra options here.\r
+ifeq ($(USE_LDOPT),)\r
+  USE_LDOPT = \r
+endif\r
+\r
+# Enable this if you want link time optimizations (LTO)\r
+ifeq ($(USE_LTO),)\r
+  USE_LTO = yes\r
+endif\r
+\r
+# If enabled, this option allows to compile the application in THUMB mode.\r
+ifeq ($(USE_THUMB),)\r
+  USE_THUMB = yes\r
+endif\r
+\r
+# Enable this if you want to see the full log while compiling.\r
+ifeq ($(USE_VERBOSE_COMPILE),)\r
+  USE_VERBOSE_COMPILE = no\r
+endif\r
+\r
+# If enabled, this option makes the build process faster by not compiling\r
+# modules not used in the current configuration.\r
+ifeq ($(USE_SMART_BUILD),)\r
+  USE_SMART_BUILD = yes\r
+endif\r
+\r
+#\r
+# Build global options\r
+##############################################################################\r
+\r
+##############################################################################\r
+# Architecture or project specific options\r
+#\r
+\r
+# Stack size to be allocated to the Cortex-M process stack. This stack is\r
+# the stack used by the main() thread.\r
+ifeq ($(USE_PROCESS_STACKSIZE),)\r
+  USE_PROCESS_STACKSIZE = 0x400\r
+endif\r
+\r
+# Stack size to the allocated to the Cortex-M main/exceptions stack. This\r
+# stack is used for processing interrupts and exceptions.\r
+ifeq ($(USE_EXCEPTIONS_STACKSIZE),)\r
+  USE_EXCEPTIONS_STACKSIZE = 0x400\r
+endif\r
+\r
+# Enables the use of FPU (no, softfp, hard).\r
+ifeq ($(USE_FPU),)\r
+  USE_FPU = no\r
+endif\r
+\r
+# FPU-related options.\r
+ifeq ($(USE_FPU_OPT),)\r
+  USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv5-d16\r
+endif\r
+\r
+#\r
+# Architecture or project specific options\r
+##############################################################################\r
+\r
+##############################################################################\r
+# Project, sources and paths\r
+#\r
+\r
+# Define project name here\r
+PROJECT = mTask\r
+\r
+# Imported source files and paths\r
+CHIBIOS = ./ChibiOS\r
+# Startup files.\r
+include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk\r
+# HAL-OSAL files (optional).\r
+include $(CHIBIOS)/os/hal/hal.mk\r
+include $(CHIBIOS)/os/hal/ports/STM32/STM32F7xx/platform.mk\r
+include $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.mk\r
+include $(CHIBIOS)/os/hal/osal/rt/osal.mk\r
+# RTOS files (optional).\r
+include $(CHIBIOS)/os/rt/rt.mk\r
+include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk\r
+# Other files (optional).\r
+include $(CHIBIOS)/test/rt/test.mk\r
+\r
+# Define linker script file here\r
+LDSCRIPT= $(STARTUPLD)/STM32F76xxI.ld\r
+\r
+# C sources that can be compiled in ARM or THUMB mode depending on the global\r
+# setting.\r
+CSRC = $(STARTUPSRC) \\r
+       $(KERNSRC) \\r
+       $(PORTSRC) \\r
+       $(OSALSRC) \\r
+       $(HALSRC) \\r
+       $(PLATFORMSRC) \\r
+       $(BOARDSRC) \\r
+       $(TESTSRC) \\r
+       $(CHIBIOS)/os/hal/lib/streams/memstreams.c \\r
+       $(CHIBIOS)/os/hal/lib/streams/chprintf.c \\r
+          $(filter-out interface_nodemcu.c,$(filter-out interface_linux.c,$(wildcard *.c)))\r
+\r
+# C++ sources that can be compiled in ARM or THUMB mode depending on the global\r
+# setting.\r
+CPPSRC =\r
+\r
+# C sources to be compiled in ARM mode regardless of the global setting.\r
+# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler\r
+#       option that results in lower performance and larger code size.\r
+ACSRC =\r
+\r
+# C++ sources to be compiled in ARM mode regardless of the global setting.\r
+# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler\r
+#       option that results in lower performance and larger code size.\r
+ACPPSRC =\r
+\r
+# C sources to be compiled in THUMB mode regardless of the global setting.\r
+# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler\r
+#       option that results in lower performance and larger code size.\r
+TCSRC =\r
+\r
+# C sources to be compiled in THUMB mode regardless of the global setting.\r
+# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler\r
+#       option that results in lower performance and larger code size.\r
+TCPPSRC =\r
+\r
+# List ASM source files here\r
+ASMSRC =\r
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)\r
+\r
+INCDIR = $(CHIBIOS)/os/license \\r
+         $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \\r
+         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \\r
+         $(CHIBIOS)/os/various\r
+\r
+#\r
+# Project, sources and paths\r
+##############################################################################\r
+\r
+##############################################################################\r
+# Compiler settings\r
+#\r
+\r
+MCU  = cortex-m7\r
+\r
+#TRGT = arm-elf-\r
+TRGT = arm-none-eabi-\r
+CC   = $(TRGT)gcc\r
+CPPC = $(TRGT)g++\r
+# Enable loading with g++ only if you need C++ runtime support.\r
+# NOTE: You can use C++ even without C++ support if you are careful. C++\r
+#       runtime support makes code size explode.\r
+LD   = $(TRGT)gcc\r
+#LD   = $(TRGT)g++\r
+CP   = $(TRGT)objcopy\r
+AS   = $(TRGT)gcc -x assembler-with-cpp\r
+AR   = $(TRGT)ar\r
+OD   = $(TRGT)objdump\r
+SZ   = $(TRGT)size\r
+HEX  = $(CP) -O ihex\r
+BIN  = $(CP) -O binary\r
+\r
+# ARM-specific options here\r
+AOPT =\r
+\r
+# THUMB-specific options here\r
+TOPT = -mthumb -DTHUMB\r
+\r
+# Define C warning options here\r
+CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Werror\r
+\r
+# Define C++ warning options here\r
+CPPWARN = -Wall -Wextra -Wundef\r
+\r
+#\r
+# Compiler settings\r
+##############################################################################\r
+\r
+##############################################################################\r
+# Start of user section\r
+#\r
+\r
+# List all user C define here, like -D_DEBUG=1\r
+UDEFS = -DSTM #-DDEBUG\r
+\r
+# Define ASM defines here\r
+UADEFS =\r
+\r
+# List all user directories here\r
+UINCDIR =\r
+\r
+# List the user directory to look for the libraries here\r
+ULIBDIR =\r
+\r
+# List all user libraries here\r
+ULIBS =\r
+\r
+# End of user defines\r
+##############################################################################\r
+\r
+RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC\r
+include $(RULESPATH)/rules.mk\r
+\r
+flash: build/$(PROJECT).bin\r
+       sudo `which openocd` \\r
+               -f interface/stlink-v2-1.cfg\\r
+               -c "transport select hla_swd"\\r
+               -f target/stm32f7x.cfg \\r
+               -c init\\r
+               -c "reset halt"\\r
+               -c "flash write_image erase "$<" 0x08000000"\\r
+               -c "reset run"\\r
+               -c shutdown\r
similarity index 100%
rename from client/chconf.h
rename to client/stm32/chconf.h
diff --git a/client/stm32/client.c b/client/stm32/client.c
new file mode 120000 (symlink)
index 0000000..e47e797
--- /dev/null
@@ -0,0 +1 @@
+../client.c
\ No newline at end of file
similarity index 100%
rename from client/halconf.h
rename to client/stm32/halconf.h
similarity index 97%
rename from client/interface.c
rename to client/stm32/interface.c
index 432671c..4caf47e 100644 (file)
@@ -77,11 +77,11 @@ void led_off(uint8_t i)
        }
 }
 
-long millis(void){
+long getmillis(void){
        return ST2MS(chVTGetSystemTime());
 }
 
-void delay(long ms)
+void msdelay(long ms)
 {
        chThdSleepMilliseconds(ms);
 }
@@ -117,7 +117,7 @@ void die(char *fmt, ...)
        palWriteLine(LINE_LED2, PAL_HIGH);
        palWriteLine(LINE_LED3, PAL_HIGH);
        while(1){
-               delay(100);
+               msdelay(100);
        }
        (void)fmt;
 }
diff --git a/client/stm32/interface.h b/client/stm32/interface.h
new file mode 120000 (symlink)
index 0000000..b854400
--- /dev/null
@@ -0,0 +1 @@
+../interface.h
\ No newline at end of file
diff --git a/client/stm32/interpret.c b/client/stm32/interpret.c
new file mode 120000 (symlink)
index 0000000..213f9b8
--- /dev/null
@@ -0,0 +1 @@
+../interpret.c
\ No newline at end of file
diff --git a/client/stm32/interpret.h b/client/stm32/interpret.h
new file mode 120000 (symlink)
index 0000000..a3858d4
--- /dev/null
@@ -0,0 +1 @@
+../interpret.h
\ No newline at end of file
diff --git a/client/stm32/mTaskSymbols.h b/client/stm32/mTaskSymbols.h
new file mode 120000 (symlink)
index 0000000..482ac01
--- /dev/null
@@ -0,0 +1 @@
+../mTaskSymbols.h
\ No newline at end of file
similarity index 100%
rename from client/mcuconf.h
rename to client/stm32/mcuconf.h
diff --git a/client/stm32/sds.c b/client/stm32/sds.c
new file mode 120000 (symlink)
index 0000000..9d106bb
--- /dev/null
@@ -0,0 +1 @@
+../sds.c
\ No newline at end of file
diff --git a/client/stm32/sds.h b/client/stm32/sds.h
new file mode 120000 (symlink)
index 0000000..f6b82b5
--- /dev/null
@@ -0,0 +1 @@
+../sds.h
\ No newline at end of file
diff --git a/client/stm32/spec.c b/client/stm32/spec.c
new file mode 120000 (symlink)
index 0000000..3a0ed1c
--- /dev/null
@@ -0,0 +1 @@
+../spec.c
\ No newline at end of file
diff --git a/client/stm32/spec.h b/client/stm32/spec.h
new file mode 120000 (symlink)
index 0000000..bbf3789
--- /dev/null
@@ -0,0 +1 @@
+../spec.h
\ No newline at end of file
diff --git a/client/stm32/task.c b/client/stm32/task.c
new file mode 120000 (symlink)
index 0000000..e4f6627
--- /dev/null
@@ -0,0 +1 @@
+../task.c
\ No newline at end of file
diff --git a/client/stm32/task.h b/client/stm32/task.h
new file mode 120000 (symlink)
index 0000000..d8ffa8e
--- /dev/null
@@ -0,0 +1 @@
+../task.h
\ No newline at end of file
diff --git a/client/user_config.h b/client/user_config.h
deleted file mode 100644 (file)
index e69de29..0000000