diff --git a/embedded/atsams70-tinyrouter/.vs/atsams70-tinyrouter/v14/.atsuo b/embedded/atsams70-tinyrouter/.vs/atsams70-tinyrouter/v14/.atsuo index 49d311941691e1062bf65383cb2dd5b6e74b1d11..b7969d22e345530db6e335273301e2d407f90dc7 100644 Binary files a/embedded/atsams70-tinyrouter/.vs/atsams70-tinyrouter/v14/.atsuo and b/embedded/atsams70-tinyrouter/.vs/atsams70-tinyrouter/v14/.atsuo differ diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/Makefile b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/Makefile index 1dd84978a2ba15bf69feb84fc25585c3129bef03..23033bf51fb456c53e187a348f6c7a21ee734e76 100644 --- a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/Makefile +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/Makefile @@ -80,6 +80,7 @@ SUBDIRS := \ # Add inputs and outputs from these tool invocations to the build variables C_SRCS += \ ../src/packet.c \ +../src/packet_handling.c \ ../src/pin.c \ ../src/ringbuffer.c \ ../src/tinyport.c \ @@ -103,6 +104,7 @@ ASM_SRCS += OBJS += \ src/packet.o \ +src/packet_handling.o \ src/pin.o \ src/ringbuffer.o \ src/tinyport.o \ @@ -119,6 +121,7 @@ src/main.o OBJS_AS_ARGS += \ src/packet.o \ +src/packet_handling.o \ src/pin.o \ src/ringbuffer.o \ src/tinyport.o \ @@ -135,6 +138,7 @@ src/main.o C_DEPS += \ src/packet.d \ +src/packet_handling.d \ src/pin.d \ src/ringbuffer.d \ src/tinyport.d \ @@ -151,6 +155,7 @@ src/main.d C_DEPS_AS_ARGS += \ src/packet.d \ +src/packet_handling.d \ src/pin.d \ src/ringbuffer.d \ src/tinyport.d \ @@ -206,68 +211,70 @@ LINKER_SCRIPT_DEP+= \ + + src/%.o: ../src/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< src/ASF/common/services/delay/sam/%.o: ../src/ASF/common/services/delay/sam/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< src/ASF/common/services/clock/sams70/%.o: ../src/ASF/common/services/clock/sams70/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< src/ASF/sam/drivers/pmc/%.o: ../src/ASF/sam/drivers/pmc/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< src/ASF/common/boards/user_board/%.o: ../src/ASF/common/boards/user_board/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< src/ASF/common/utils/interrupt/%.o: ../src/ASF/common/utils/interrupt/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< src/ASF/sam/utils/cmsis/sams70/source/templates/gcc/%.o: ../src/ASF/sam/utils/cmsis/sams70/source/templates/gcc/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< src/ASF/sam/utils/cmsis/sams70/source/templates/%.o: ../src/ASF/sam/utils/cmsis/sams70/source/templates/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< src/ASF/sam/utils/syscalls/gcc/%.o: ../src/ASF/sam/utils/syscalls/gcc/%.c @echo Building file: $< - @echo Invoking: ARM/GNU C Compiler : 6.3.1 + @echo Invoking: ARM/GNU C Compiler : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAMS70N20__ -DDEBUG -Dscanf=iscanf -DBOARD=USER_BOARD -DARM_MATH_CM7=true -Dprintf=iprintf -I"../src/ASF/common/boards" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/utils" -I"../src/ASF/sam/utils/cmsis/sams70/source/templates" -I"../src/ASF/sam/utils/cmsis/sams70/include" -I"../src/ASF/common/boards/user_board" -I"../src" -I"../src/config" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/common/services/clock" -I"../src/ASF/common/services/delay" -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m7 -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -296,7 +303,7 @@ all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES) $(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP) @echo Building target: $@ - @echo Invoking: ARM/GNU Linker : 6.3.1 + @echo Invoking: ARM/GNU Linker : 6.2.1 $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -mthumb -Wl,-Map="atsams70-tinyrouter.map" -Wl,--start-group -larm_cortexM7lfsp_math_softfp -lm -Wl,--end-group -L"../src/ASF/thirdparty/CMSIS/Lib/GCC" -Wl,--gc-sections -mcpu=cortex-m7 -Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam/utils/linker_scripts/sams70/sams70n20/gcc/flash.ld @echo Finished building target: $@ "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-objcopy.exe" -O binary "atsams70-tinyrouter.elf" "atsams70-tinyrouter.bin" diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/atsams70-tinyrouter.bin b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/atsams70-tinyrouter.bin index 38332778cd43592e78eb58900ce904e14aa06616..2ed84e36c9185051d7b2b2f99cd24f64f6034d26 100644 Binary files a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/atsams70-tinyrouter.bin and b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/atsams70-tinyrouter.bin differ diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/makedep.mk b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/makedep.mk index 19558e031ccc808be4fc7a2870f7cd8f49cd0a74..af67d53d7ceaed84c7d79f89821c79490fcdb668 100644 --- a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/makedep.mk +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/Debug/makedep.mk @@ -4,6 +4,8 @@ src\packet.c +src\packet_handling.c + src\pin.c src\ringbuffer.c diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/atsams70-tinyrouter.cproj b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/atsams70-tinyrouter.cproj index 8e772773c444448b2116515d1e187c44db2c2c05..817f1d0d82f0ee63aef4f3679e3c3f3d168e7fd8 100644 --- a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/atsams70-tinyrouter.cproj +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/atsams70-tinyrouter.cproj @@ -472,12 +472,21 @@ <Folder Include="src\config\" /> </ItemGroup> <ItemGroup> + <Compile Include="src\node.h"> + <SubType>compile</SubType> + </Compile> <Compile Include="src\packet.c"> <SubType>compile</SubType> </Compile> <Compile Include="src\packet.h"> <SubType>compile</SubType> </Compile> + <Compile Include="src\packet_handling.c"> + <SubType>compile</SubType> + </Compile> + <Compile Include="src\packet_handling.h"> + <SubType>compile</SubType> + </Compile> <Compile Include="src\pin.c"> <SubType>compile</SubType> </Compile> diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/main.c b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/main.c index 5aa8fc35c8de7f6171170a9a068518aed2900595..216b13949ca0f0f35d9d23e18a9bae57e10cbd06 100644 --- a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/main.c +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/main.c @@ -31,6 +31,7 @@ #include <asf.h> #include "pin.h" #include "tinyport.h" +#include "packet_handler.h" pin_t stlb; pin_t stlr; @@ -64,8 +65,6 @@ pin_t p4lr; pin_t p4lg; pin_t p4lb; - - void setupperipherals(void){ PMC->PMC_PCER0 = 1 << ID_PIOA; // Pins @@ -247,10 +246,11 @@ int main (void) for(int i = 0; i < 4; i++){ // loop over ports and check for packets, add packets to packet buffer if(ports[i].haspacket){ - packetlooper = ports[i].packet; // pull into buffer + packetlooper = ports[i].packet; // pull into buffer packet_clean(&ports[i].packet); // reset packet states ports[i].haspacket = TP_NO_PACKET; + // TODO: update heartbeat / buffer depth pin_clear(ports[i].stlb); // for debugging: we have seen a packet on this port @@ -258,13 +258,18 @@ int main (void) tp_putchar(&ports[i], packetlooper.raw[c]); } + handle_packet(); // put data in block, error if returns 0 b/c overfull ringbuffer /* if(!tp_putdata(&ports[i], packetlooper.raw, packetlooper.size)){ pin_clear(ports[i].stlr); } */ - } + } + + // packet handler + // pull a packet from the buffer, + // handle_packet() /* if(!rb_empty(ports[i].rbrx)){ tp_putchar(&ports[i], rb_get(ports[i].rbrx)); diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/node.h b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/node.h index b40c692657442a78d5235cd286202a13b19cb2a0..96c9cc9d48249cd59166334ab7972b68ef2e1fe2 100644 --- a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/node.h +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/node.h @@ -1,5 +1,5 @@ typedef struct { uint8_t portBufferSizes[4]; - uint16_t LUT[][4]; // TODO: fix representation - uint16_t myAddress; + uint16_t LUT[1024][4]; // TODO: fix representation + uint16_t myAddress; } node_t; diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/packet_handling.c b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/packet_handling.c index 4e2ed3c233a2d2d0e1b0becd4427e9454560c8c6..65cd0bb90a7207687af7fa4aab79477eb4c98cb4 100644 --- a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/packet_handling.c +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/packet_handling.c @@ -1,5 +1,7 @@ #include "packet.h" #include "node.h" +#include "packet_handling.h" +#include <string.h> int parse_type(packet_t* p) { return p->raw[0]; @@ -10,7 +12,7 @@ void update_LUT(node_t* n, uint16_t src, uint8_t hopCount, uint8_t port) { } void send_packet(packet_t* p, uint8_t port) { - + // TODO: } void broadcast_packet(packet_t* p, uint8_t exclude) { @@ -20,9 +22,14 @@ void broadcast_packet(packet_t* p, uint8_t exclude) { if (exclude != 3) send_packet(p, 3); } -packet_t turn_to_standard_flood(node_t n, packet_t* p) { - packet_t newPacket = {.raw = p->raw, .destination = p->destination, .source = n->myAddress, - .hopcount = p->hopcount, .size = p->size, .counter = p->counter}; +packet_t* turn_to_standard_flood(node_t* n, packet_t* p) { + packet_t* newPacket = (packet_t*)malloc(sizeof(packet_t)); + memcpy((void*)newPacket->raw, (const void*)p->raw, (size_t)256); + newPacket->destination = p->destination; + newPacket->source = n->myAddress; + newPacket->hopcount = p->hopcount; + newPacket->size = p->size; + newPacket->counter = p->counter; return newPacket; } @@ -30,9 +37,9 @@ void handle_packet(node_t* n, packet_t* p, uint8_t port) { if (parse_type(p) != BUFFER_UPDATE) { update_LUT(n, p->source, p->hopcount, port); } - switch parse_type(p) { + switch (parse_type(p)) { case STANDARD: - if (p->destination == n.myAddress) { + if (p->destination == n->myAddress) { //process //reply } else { @@ -48,12 +55,12 @@ void handle_packet(node_t* n, packet_t* p, uint8_t port) { } send_packet(p, bestPort); } else { - broadcast_packet(turn_to_standard_flood(n, p)); + broadcast_packet(turn_to_standard_flood(n, p), port); } } break; case ACK: - if (p->destination == n.myAddress) { + if (p->destination == n->myAddress) { //process } else { p->hopcount++; @@ -68,13 +75,13 @@ void handle_packet(node_t* n, packet_t* p, uint8_t port) { } send_packet(p, bestPort); } else { - broadcast_packet(turn_to_standard_flood(n, p)); + broadcast_packet(turn_to_standard_flood(n, p), port); } } break; case STANDARD_FLOOD: n->LUT[p->destination][port] = 255; - if (p->destination == n.myAddress) { + if (p->destination == n->myAddress) { //process //reply } else { @@ -96,7 +103,7 @@ void handle_packet(node_t* n, packet_t* p, uint8_t port) { break; case ACK_FLOOD: n->LUT[p->destination][port] = 255; - if (p->destination == n.myAddress) { + if (p->destination == n->myAddress) { //process } else { p->hopcount++; @@ -118,7 +125,5 @@ void handle_packet(node_t* n, packet_t* p, uint8_t port) { case BUFFER_UPDATE: n->portBufferSizes[port] = p->raw[0]; break; - default: - // not possible } } diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/packet_handling.h b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/packet_handling.h new file mode 100644 index 0000000000000000000000000000000000000000..7f8c316b1093c5d93e888b9eba3b5b3919b54ee4 --- /dev/null +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/packet_handling.h @@ -0,0 +1,28 @@ +/* + * packet_handling.h + * + * Created: 12/7/2017 2:14:08 PM + * Author: Jake + */ + + +#ifndef PACKET_HANDLING_H_ +#define PACKET_HANDLING_H_ + + + +int parse_type(packet_t* p); + +void update_LUT(node_t* n, uint16_t src, uint8_t hopCount, uint8_t port); + +void send_packet(packet_t* p, uint8_t port); + +void broadcast_packet(packet_t* p, uint8_t exclude); + +packet_t* turn_to_standard_flood(node_t* n, packet_t* p); + +void handle_packet(node_t* n, packet_t* p, uint8_t port); + + + +#endif /* PACKET_HANDLING_H_ */ \ No newline at end of file diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/tinyport.c b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/tinyport.c index 1725da88c0c8de443bd88d4aacdf24d84fc27d74..1138af4e68add901a4fae3d7ded621c3af261d60 100644 --- a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/tinyport.c +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/tinyport.c @@ -81,7 +81,7 @@ void tp_packetparser(tinyport_t *tp){ case TP_PACKETSTATE_OUTSIDE: // check if start, add 1st byte, change state // if not start, assume buffer depth data, update - if(data == TP_DELIMITER_START){ + if(data == TP_DELIMITER_START){ // TODO: more types, and types, not delimiters tp->packetstate = TP_PACKETSTATE_INSIDE; tp->packet.raw[tp->packet.counter] = data; tp->packet.counter ++; diff --git a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/tinyport.h b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/tinyport.h index 9b96f808af61c3d87a864021fd7e72d9c5cb70f9..e17f99a740f273957a5a95b6dbd5d2b0c155f23c 100644 --- a/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/tinyport.h +++ b/embedded/atsams70-tinyrouter/atsams70-tinyrouter/src/tinyport.h @@ -49,7 +49,7 @@ #define TP_DELIMITER_START 255 #define UART_BAUD_DIVIDER 81 // 977: 9600 baud, 81: 115200, 10: 921600 -#define RINGBUFFER_SIZE 512 // in bytes, or 4 full length packets, have 384KBytes total in system +#define RINGBUFFER_SIZE 1024 // in bytes, or 4 full length packets, have 384KBytes total in system #include "asf.h" #include "pin.h"