commit 4e29d729f6a364de594a3b4cc665195ba391f925 Author: Sergey Yarkov Date: Sun Sep 18 21:53:55 2022 +0300 feat: added firmware diff --git a/.generated_files/flags/default/244ff3d6ca5f6fe1ad3255fce837d326ef857c0e b/.generated_files/flags/default/244ff3d6ca5f6fe1ad3255fce837d326ef857c0e new file mode 100644 index 0000000..d3728f8 --- /dev/null +++ b/.generated_files/flags/default/244ff3d6ca5f6fe1ad3255fce837d326ef857c0e @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 D:\Apps\avr128da48_web-serial-example.X\main.c \ No newline at end of file diff --git a/.generated_files/flags/default/316ffe5fc1b0327ad1888acca4fe8f061c349913 b/.generated_files/flags/default/316ffe5fc1b0327ad1888acca4fe8f061c349913 new file mode 100644 index 0000000..7ecd679 --- /dev/null +++ b/.generated_files/flags/default/316ffe5fc1b0327ad1888acca4fe8f061c349913 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 D:\Apps\avr128da48_web-serial-example.X\command.c \ No newline at end of file diff --git a/.generated_files/flags/default/454d3881b9ef453d62371ca6ae5d493a9db2f763 b/.generated_files/flags/default/454d3881b9ef453d62371ca6ae5d493a9db2f763 new file mode 100644 index 0000000..d5e2180 --- /dev/null +++ b/.generated_files/flags/default/454d3881b9ef453d62371ca6ae5d493a9db2f763 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 D:\Apps\avr128da48_web-serial-example.X\usart.c \ No newline at end of file diff --git a/.generated_files/flags/default/67130230c37141f762328d3477127279e5794533 b/.generated_files/flags/default/67130230c37141f762328d3477127279e5794533 new file mode 100644 index 0000000..d8202b3 --- /dev/null +++ b/.generated_files/flags/default/67130230c37141f762328d3477127279e5794533 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 D:\Apps\avr128da48_web-serial-example.X\command.c \ No newline at end of file diff --git a/.generated_files/flags/default/9b2f2a27767e8fb25a5e864c373fffef3c042982 b/.generated_files/flags/default/9b2f2a27767e8fb25a5e864c373fffef3c042982 new file mode 100644 index 0000000..d60bd97 --- /dev/null +++ b/.generated_files/flags/default/9b2f2a27767e8fb25a5e864c373fffef3c042982 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 D:\Apps\avr128da48_web-serial-example.X\usart.c \ No newline at end of file diff --git a/.generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 b/.generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 new file mode 100644 index 0000000..26a823a --- /dev/null +++ b/.generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 @@ -0,0 +1,38 @@ +# +# Generated Makefile - do not edit! +# +# +# This file contains information about the location of compilers and other tools. +# If you commmit this file into your revision control server, you will be able to +# to checkout the project and build it from the command line with make. However, +# if more than one person works on the same project, then this file might show +# conflicts since different users are bound to have compilers in different places. +# In that case you might choose to not commit this file and let MPLAB X recreate this file +# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at +# least once so the file gets created and the project can be built. Finally, you can also +# avoid using this file at all if you are only building from the command line with make. +# You can invoke make with the values of the macros: +# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ... +# +SHELL=cmd.exe +PATH_TO_IDE_BIN=C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/ +# Adding MPLAB X bin directory to path. +PATH:=C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH) +# Path to java used to run MPLAB X when this makefile was created +MP_JAVA_PATH="C:\Program Files\Microchip\MPLABX\v6.00\sys\java\zulu8.54.0.21-ca-fx-jre8.0.292-win_x64/bin/" +OS_CURRENT="$(shell uname -s)" +MP_CC="C:\Program Files\Microchip\xc8\v2.36\bin\xc8-cc.exe" +# MP_CPPC is not defined +# MP_BC is not defined +MP_AS="C:\Program Files\Microchip\xc8\v2.36\bin\xc8-cc.exe" +MP_LD="C:\Program Files\Microchip\xc8\v2.36\bin\xc8-cc.exe" +MP_AR="C:\Program Files\Microchip\xc8\v2.36\bin\xc8-ar.exe" +DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" +MP_CC_DIR="C:\Program Files\Microchip\xc8\v2.36\bin" +# MP_CPPC_DIR is not defined +# MP_BC_DIR is not defined +MP_AS_DIR="C:\Program Files\Microchip\xc8\v2.36\bin" +MP_LD_DIR="C:\Program Files\Microchip\xc8\v2.36\bin" +MP_AR_DIR="C:\Program Files\Microchip\xc8\v2.36\bin" +# MP_BC_DIR is not defined +DFP_DIR=C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124 diff --git a/.generated_files/flags/default/baf556898677ce2f71fcf7d1ed7762047b1b08b2 b/.generated_files/flags/default/baf556898677ce2f71fcf7d1ed7762047b1b08b2 new file mode 100644 index 0000000..8539d7a --- /dev/null +++ b/.generated_files/flags/default/baf556898677ce2f71fcf7d1ed7762047b1b08b2 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 D:\Apps\avr128da48_web-serial-example.X\main.c \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fca8e2c --- /dev/null +++ b/Makefile @@ -0,0 +1,113 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin +RANLIB=ranlib + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... +# WARNING: the IDE does not call this target since it takes a long time to +# simply run make. Instead, the IDE removes the configuration directories +# under build and dist directly without calling make. +# This target is left here so people can do a clean when running a clean +# outside the IDE. + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/build/default/production/command.o b/build/default/production/command.o new file mode 100644 index 0000000..c4a1fd7 Binary files /dev/null and b/build/default/production/command.o differ diff --git a/build/default/production/command.o.d b/build/default/production/command.o.d new file mode 100644 index 0000000..ee724fc --- /dev/null +++ b/build/default/production/command.o.d @@ -0,0 +1,54 @@ +build/default/production/command.o.d build/default/production/command.o: \ + command.c command.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\io.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\sfr_defs.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\inttypes.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\features.h \ + c:\program\ files\microchip\xc8\v2.36\avr\lib\gcc\avr\5.4.0\include\stdint.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdint.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\alltypes.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\stdint.h \ + C:/Program\ Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/include/avr/ioavr128da48.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\portpins.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\common.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\xmega.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\fuse.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\lock.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\string.h usart.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdio.h + +command.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\io.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\sfr_defs.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\inttypes.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\features.h: + +c:\program\ files\microchip\xc8\v2.36\avr\lib\gcc\avr\5.4.0\include\stdint.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdint.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\alltypes.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\stdint.h: + +C:/Program\ Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/include/avr/ioavr128da48.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\portpins.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\common.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\xmega.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\fuse.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\lock.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\string.h: + +usart.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdio.h: diff --git a/build/default/production/main.o b/build/default/production/main.o new file mode 100644 index 0000000..e775f54 Binary files /dev/null and b/build/default/production/main.o differ diff --git a/build/default/production/main.o.d b/build/default/production/main.o.d new file mode 100644 index 0000000..3ce3fcc --- /dev/null +++ b/build/default/production/main.o.d @@ -0,0 +1,65 @@ +build/default/production/main.o.d build/default/production/main.o: main.c \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\io.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\sfr_defs.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\inttypes.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\features.h \ + c:\program\ files\microchip\xc8\v2.36\avr\lib\gcc\avr\5.4.0\include\stdint.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdint.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\alltypes.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\stdint.h \ + C:/Program\ Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/include/avr/ioavr128da48.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\portpins.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\common.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\xmega.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\fuse.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\lock.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\interrupt.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\util\delay.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\util\delay_basic.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\math.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\string.h command.h \ + usart.h c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdio.h + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\io.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\sfr_defs.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\inttypes.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\features.h: + +c:\program\ files\microchip\xc8\v2.36\avr\lib\gcc\avr\5.4.0\include\stdint.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdint.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\alltypes.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\stdint.h: + +C:/Program\ Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/include/avr/ioavr128da48.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\portpins.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\common.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\xmega.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\fuse.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\lock.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\interrupt.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\util\delay.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\util\delay_basic.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\math.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\string.h: + +command.h: + +usart.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdio.h: diff --git a/build/default/production/usart.o b/build/default/production/usart.o new file mode 100644 index 0000000..45b508a Binary files /dev/null and b/build/default/production/usart.o differ diff --git a/build/default/production/usart.o.d b/build/default/production/usart.o.d new file mode 100644 index 0000000..05e794f --- /dev/null +++ b/build/default/production/usart.o.d @@ -0,0 +1,52 @@ +build/default/production/usart.o.d build/default/production/usart.o: \ + usart.c usart.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\io.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\sfr_defs.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\inttypes.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\features.h \ + c:\program\ files\microchip\xc8\v2.36\avr\lib\gcc\avr\5.4.0\include\stdint.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdint.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\alltypes.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\stdint.h \ + C:/Program\ Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/include/avr/ioavr128da48.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\portpins.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\common.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\xmega.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\fuse.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\lock.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdio.h \ + c:\program\ files\microchip\xc8\v2.36\avr\avr\include\string.h + +usart.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\io.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\sfr_defs.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\inttypes.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\features.h: + +c:\program\ files\microchip\xc8\v2.36\avr\lib\gcc\avr\5.4.0\include\stdint.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdint.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\alltypes.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\bits\stdint.h: + +C:/Program\ Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/include/avr/ioavr128da48.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\portpins.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\common.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\xmega.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\fuse.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\avr\lock.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\stdio.h: + +c:\program\ files\microchip\xc8\v2.36\avr\avr\include\string.h: diff --git a/command.c b/command.c new file mode 100644 index 0000000..80373e1 --- /dev/null +++ b/command.c @@ -0,0 +1,40 @@ +#include "command.h" +#include "usart.h" + +struct Command commands[COMMAND_SIZE]; +uint8_t cmd_idx = 0; + +uint8_t command_define(void *fp, char name[COMMAND_MAX_NAME_LENGTH]) { + size_t name_length = strlen(name); + if (name_length > COMMAND_MAX_NAME_LENGTH) { + return 0; + } + + if (cmd_idx >= COMMAND_SIZE) { + cmd_idx = 0; + } + + struct Command command; + command.addr = fp; + strcpy(command.name, name); + commands[cmd_idx++] = command; + return 1; +} + +uint8_t command_process(char *cmd_name) { + uint8_t i = 0; + + do { + if (strcmp(cmd_name, commands[i].name) == 0) { + int (*execute)(); + execute = commands[i].addr; + execute(); + USART1_SendString("[LOG]: Command completed successfully with code \"0\".\n"); + return 0; + } + } while (i++ < COMMAND_SIZE); + + USART1_SendString("[LOG]: Invalid command name!\n"); + + return 1; +} \ No newline at end of file diff --git a/command.h b/command.h new file mode 100644 index 0000000..e674fa4 --- /dev/null +++ b/command.h @@ -0,0 +1,19 @@ +#ifndef COMMAND_H +#define COMMAND_H + +#include +#include + +#define COMMAND_SIZE 5 +#define COMMAND_MAX_NAME_LENGTH 20 + +struct Command { + void *addr; + char name[COMMAND_MAX_NAME_LENGTH]; +}; + +uint8_t command_define(void *fp, char name[COMMAND_MAX_NAME_LENGTH]); +uint8_t command_process(char *cmd_name); + +#endif /* COMMAND_H */ + diff --git a/dist/default/production/avr128da48_web-serial-example.X.production.elf b/dist/default/production/avr128da48_web-serial-example.X.production.elf new file mode 100644 index 0000000..e264d40 Binary files /dev/null and b/dist/default/production/avr128da48_web-serial-example.X.production.elf differ diff --git a/dist/default/production/avr128da48_web-serial-example.X.production.hex b/dist/default/production/avr128da48_web-serial-example.X.production.hex new file mode 100644 index 0000000..d56315b --- /dev/null +++ b/dist/default/production/avr128da48_web-serial-example.X.production.hex @@ -0,0 +1,82 @@ +:100000000C9477000C9429020C9429020C94290278 +:100010000C9429020C9429020C9429020C942902B4 +:100020000C9429020C9429020C9429020C942902A4 +:100030000C9429020C9429020C9429020C94290294 +:100040000C9429020C9429020C9429020C94290284 +:100050000C9429020C9429020C9429020C94290274 +:100060000C9429020C9429020C9429020C94290264 +:100070000C9429020C9429020C9429020C94E4009B +:100080000C9429020C9429020C9429020C94290244 +:100090000C9429020C9429020C9429020C94290234 +:1000A0000C9429020C9429020C9429020C94290224 +:1000B0000C9429020C9429020C9429020C94290214 +:1000C0000C9429020C9429020C9429020C94290204 +:1000D0000C9429020C9429020C9429020C942902F4 +:1000E0000C9429020C9429024000408480008091E5 +:1000F00001108F7C806080688093011011241FBEE6 +:10010000CFEFCDBFDFE7DEBFE8EEF0E040E019C0A3 +:10011000B791A79137912791079107FD0EC097914D +:100120008791EF01F92FE82F0BBF07900D92A217CF +:10013000B307D9F7FE011BBE04C01D92A217B30777 +:10014000E1F7ED3EF40721F70E94DB010C94FC017E +:04015000F894FFCF51 +:100154005B4C4F475D3A20436F6D6D616E64206365 +:100164006F6D706C65746564207375636365737318 +:1001740066756C6C79207769746820636F64652098 +:100184002230222E0A005B4C4F475D3A20496E769E +:10019400616C696420636F6D6D616E64206E616D66 +:0401A40065210A00C7 +:1001A80048656C6C6F20776F726C64210A006C650F +:0F01B800645F746F67676C650068656C6C6F00DF +:1001C8001F920F920FB60F9211240BB60F922F9316 +:1001D8003F934F935F936F937F938F939F93AF93C7 +:1001E800BF93EF93FF9380912008803221F18A30EA +:1001F80069F08D3001F1E091824091E09E0F90937B +:100208008240F0E0E259FF4B808315C08EE690E40F +:100218000E94320110928240EEE6F0E40190002044 +:10022800E9F73197AF014E56504460E070E08EE632 +:1002380090E40E940702FF91EF91BF91AF919F91C7 +:100248008F917F916F915F914F913F912F910F9077 +:0C0258000BBE0F900FBE0F901F9018956A +:10026400CF92DF92EF92FF920F931F93CF93DF937E +:100274007C0102E010E4C0E0D0E0B801C7010E94B4 +:10028400EE01892B91F486E18C9FF0018D9FF00D96 +:100294001124E050F04C0190F081E02D099584E5A3 +:1002A40091E80E94A30180E00BC021960A5E1F4FD3 +:1002B400C630D10511F78AE891E80E94A30181E0D4 +:1002C400DF91CF911F910F91FF90EF90DF90CF902E +:0202D40008958B +:1002D600CF93DF93CDB7DEB76697CDBFDEBFFB0109 +:1002E60001900020E9F73197E61BF70B759708F5A3 +:1002F60020918340253010F01092834089839A83A1 +:10030600CE0103960E941802A091834081E08A0FD5 +:100316008093834086E1A89FD0011124A050B04C61 +:1003260086E1FE01319601900D928A95E1F781E012 +:1003360001C080E06696CDBFDEBFDF91CF91089504 +:10034600EF92FF920F931F93CF93DF938C017C0163 +:10035600C0E0D0E006C0F70181917F010E94100243 +:100366002196F80101900020E9F73197E01BF10B87 +:10037600CE17DF0780F3DF91CF911F910F91FF908A +:04038600EF90089557 +:10038A00E0E2F8E083E896E08087918783E087835C +:10039A00A0E4B4E081E011968C93119782E0129662 +:0C03AA008C9380E8858380EC86830895A6 +:1003B60080E4809341040E94C501789466EB71E85D +:1003C60085E292E00E946B0161EC71E880E292E0C6 +:0603D6000E946B01FFCF45 +:1003DC00DC01FB019D912191921303C09111FACF85 +:0C03EC00292F892F90E0821B91090895B1 +:1003F800EC010E942E020E942D02CE010E942F02C3 +:06040800CE010E942B0250 +:10040E00FC01480F591FE417F50711F06193FBCF5C +:02041E0008953F +:10042000E0E2F8E0948195FFFDCF809322080895E3 +:10043000FC01DB012D91BD0121932111FACF08951B +:0A04400088EA91E80E94A3010895E4 +:08044A0080E48093470408954B +:040452000C94000006 +:040456000E94A80058 +:02045A00089503 +:02045C00089501 +:02045E000895FF +:00000001FF diff --git a/dist/default/production/avr128da48_web-serial-example.X.production.map b/dist/default/production/avr128da48_web-serial-example.X.production.map new file mode 100644 index 0000000..19f76d5 --- /dev/null +++ b/dist/default/production/avr128da48_web-serial-example.X.production.map @@ -0,0 +1,658 @@ +Archive member included to satisfy reference by file (symbol) + +c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + build/default/production/main.o (__do_clear_bss) +c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o (exit) +c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(memset.o) + build/default/production/main.o (memset) +c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcmp.o) + build/default/production/command.o (strcmp) +c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcpy.o) + build/default/production/command.o (strcpy) +c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(_Exit.o) + c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) (_Exit) +c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(_Exit.o) (_exit) + +Discarded input sections + + .data 0x0000000000000000 0x0 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + .bss 0x0000000000000000 0x0 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + .text 0x0000000000000000 0x0 build/default/production/main.o + .data 0x0000000000000000 0x0 build/default/production/main.o + .bss 0x0000000000000000 0x0 build/default/production/main.o + .text.MCU_Init_Ports + 0x0000000000000000 0x8 build/default/production/main.o + .text 0x0000000000000000 0x0 build/default/production/usart.o + .data 0x0000000000000000 0x0 build/default/production/usart.o + .bss 0x0000000000000000 0x0 build/default/production/usart.o + .text 0x0000000000000000 0x0 build/default/production/command.o + .data 0x0000000000000000 0x0 build/default/production/command.o + .bss 0x0000000000000000 0x0 build/default/production/command.o + .text 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .data 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .bss 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .text.libgcc.mul + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .text.libgcc.div + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .text.libgcc 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .text.libgcc.prologue + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .text.libgcc.builtins + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .text.libgcc.fmul + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .text.libgcc.fixed + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + .text 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + .data 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + .bss 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + .text 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(memset.o) + .data 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(memset.o) + .bss 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(memset.o) + .text 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcmp.o) + .data 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcmp.o) + .bss 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcmp.o) + .text 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcpy.o) + .data 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcpy.o) + .bss 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcpy.o) + .text 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(_Exit.o) + .data 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(_Exit.o) + .bss 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(_Exit.o) + .text 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .data 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .bss 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .text.libgcc.mul + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .text.libgcc.div + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .text.libgcc 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .text.libgcc.prologue + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .stack.descriptors + 0x0000000000000000 0x13 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .text.libgcc.builtins + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .text.libgcc.fmul + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + .text.libgcc.fixed + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + +Memory Configuration + +Name Origin Length Attributes +text 0x0000000000000000 0x0000000000020000 xr +data 0x0000000000804000 0x0000000000004000 rw !x +eeprom 0x0000000000810000 0x0000000000000200 rw !x +fuse 0x0000000000820000 0x0000000000000010 rw !x +lock 0x0000000000830000 0x0000000000000400 rw !x +signature 0x0000000000840000 0x0000000000000400 rw !x +user_signatures 0x0000000000850000 0x0000000000000400 rw !x +*default* 0x0000000000000000 0xffffffffffffffff + +Linker script and memory map + +Address of section .data set to 0x804000 + 0x0000000000008000 __RODATA_PM_OFFSET__ = 0x8000 +LOAD C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + 0x0000000000000001 __MPLAB_BUILD = 0x1 +LOAD build/default/production/main.o +LOAD build/default/production/usart.o +LOAD build/default/production/command.o +START GROUP +LOAD c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libm.a +END GROUP +START GROUP +LOAD c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a +LOAD c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libm.a +LOAD c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a +LOAD C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped\libavr128da48.a +END GROUP + [0x0000000000000000] __TEXT_REGION_ORIGIN__ = DEFINED (__TEXT_REGION_ORIGIN__)?__TEXT_REGION_ORIGIN__:0x0 + [0x0000000000804000] __DATA_REGION_ORIGIN__ = DEFINED (__DATA_REGION_ORIGIN__)?__DATA_REGION_ORIGIN__:0x802000 + [0x0000000000020000] __TEXT_REGION_LENGTH__ = DEFINED (__TEXT_REGION_LENGTH__)?__TEXT_REGION_LENGTH__:0x100000 + [0x0000000000004000] __DATA_REGION_LENGTH__ = DEFINED (__DATA_REGION_LENGTH__)?__DATA_REGION_LENGTH__:0xffa0 + [0x0000000000000200] __EEPROM_REGION_LENGTH__ = DEFINED (__EEPROM_REGION_LENGTH__)?__EEPROM_REGION_LENGTH__:0x10000 + [0x0000000000000010] __FUSE_REGION_LENGTH__ = DEFINED (__FUSE_REGION_LENGTH__)?__FUSE_REGION_LENGTH__:0x400 + 0x0000000000000400 __LOCK_REGION_LENGTH__ = DEFINED (__LOCK_REGION_LENGTH__)?__LOCK_REGION_LENGTH__:0x400 + 0x0000000000000400 __SIGNATURE_REGION_LENGTH__ = DEFINED (__SIGNATURE_REGION_LENGTH__)?__SIGNATURE_REGION_LENGTH__:0x400 + 0x0000000000000400 __USER_SIGNATURE_REGION_LENGTH__ = DEFINED (__USER_SIGNATURE_REGION_LENGTH__)?__USER_SIGNATURE_REGION_LENGTH__:0x400 + +.hash + *(.hash) + +.dynsym + *(.dynsym) + +.dynstr + *(.dynstr) + +.gnu.version + *(.gnu.version) + +.gnu.version_d + *(.gnu.version_d) + +.gnu.version_r + *(.gnu.version_r) + +.rel.init + *(.rel.init) + +.rela.init + *(.rela.init) + +.rel.text + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + +.rela.text + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + +.rel.fini + *(.rel.fini) + +.rela.fini + *(.rela.fini) + +.rel.rodata + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + +.rela.rodata + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + +.rel.data + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + +.rela.data + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + +.rel.ctors + *(.rel.ctors) + +.rela.ctors + *(.rela.ctors) + +.rel.dtors + *(.rel.dtors) + +.rela.dtors + *(.rela.dtors) + +.rel.got + *(.rel.got) + +.rela.got + *(.rela.got) + +.rel.bss + *(.rel.bss) + +.rela.bss + *(.rela.bss) + +.rel.plt + *(.rel.plt) + +.rela.plt + *(.rela.plt) + +.text 0x0000000000000000 0x154 + *(.vectors) + .vectors 0x0000000000000000 0xe8 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + 0x0000000000000000 __vector_default + 0x0000000000000000 __vectors + *(.vectors) + *(.progmem.gcc*) + *(.dinit) + .dinit 0x00000000000000e8 0x5 data_init + 0x00000000000000ee . = ALIGN (0x2) + *fill* 0x00000000000000ed 0x1 + 0x00000000000000ee __trampolines_start = . + *(.trampolines) + .trampolines 0x00000000000000ee 0x0 linker stubs + *(.trampolines*) + 0x00000000000000ee __trampolines_end = . + *libprintf_flt.a:*(.progmem.data) + *libc.a:*(.progmem.data) + 0x00000000000000ee . = ALIGN (0x2) + *(.jumptables) + *(.jumptables*) + *(.lowtext) + *(.lowtext*) + 0x00000000000000ee __ctors_start = . + *(.ctors) + 0x00000000000000ee __ctors_end = . + 0x00000000000000ee __dtors_start = . + *(.dtors) + 0x00000000000000ee __dtors_end = . + SORT(*)(.ctors) + SORT(*)(.dtors) + *(.init0) + .init0 0x00000000000000ee 0x0 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + 0x00000000000000ee __init + *(.init0) + *(.init1) + .init1 0x00000000000000ee 0xe C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + *(.init1) + *(.init2) + .init2 0x00000000000000fc 0xc C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + *(.init2) + *(.init3) + *(.init3) + *(.init4) + .init4 0x0000000000000108 0x40 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_copy_data.o) + 0x0000000000000108 __do_copy_data + 0x000000000000013a __do_clear_bss + *(.init4) + *(.init5) + *(.init5) + *(.init6) + *(.init6) + *(.init7) + *(.init7) + *(.init8) + *(.init8) + *(.init9) + .init9 0x0000000000000148 0x8 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + *(.init9) + 0x0000000000000150 . = ALIGN (0x2) + *(.fini9) + .fini9 0x0000000000000150 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + 0x0000000000000150 _exit + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + .fini0 0x0000000000000150 0x4 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + *(.fini0) + 0x0000000000000154 _etext = . + +.data 0x0000000000804000 0x0 load address 0x0000000000000154 + [!provide] PROVIDE (__data_start, .) + *(.gnu.linkonce.d*) + *(.gnu.linkonce.r*) + 0x0000000000804000 . = ALIGN (0x2) + 0x0000000000804000 _edata = . + [!provide] PROVIDE (__data_end, .) + +.bss 0x0000000000804000 0x0 + [!provide] PROVIDE (__bss_start, .) + *(COMMON) + [!provide] PROVIDE (__bss_end, .) + 0x0000000000000154 __data_load_start = LOADADDR (.data) + 0x0000000000000154 __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit 0x0000000000804000 0x0 + [!provide] PROVIDE (__noinit_start, .) + *(.noinit*) + [!provide] PROVIDE (__noinit_end, .) + 0x0000000000804000 _end = . + +.eeprom 0x0000000000810000 0x0 + *(.eeprom*) + 0x0000000000810000 __eeprom_end = . + +.fuse + *(.fuse) + *(.lfuse) + *(.hfuse) + *(.efuse) + +.lock + *(.lock*) + +.signature + *(.signature*) + +.user_signatures + *(.user_signatures*) + +.stab + *(.stab) + +.stabstr + *(.stabstr) + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.comment 0x0000000000000000 0x2f + *(.comment) + .comment 0x0000000000000000 0x2f build/default/production/main.o + 0x30 (size before relaxing) + .comment 0x000000000000002f 0x30 build/default/production/usart.o + .comment 0x000000000000002f 0x30 build/default/production/command.o + .comment 0x000000000000002f 0x30 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + .comment 0x000000000000002f 0x30 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(memset.o) + .comment 0x000000000000002f 0x30 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcmp.o) + .comment 0x000000000000002f 0x30 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcpy.o) + .comment 0x000000000000002f 0x30 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(_Exit.o) + +.note.GNU-stack + 0x0000000000000000 0x0 + .note.GNU-stack + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + .note.GNU-stack + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(memset.o) + .note.GNU-stack + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcmp.o) + .note.GNU-stack + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcpy.o) + .note.GNU-stack + 0x0000000000000000 0x0 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(_Exit.o) + +.stack.descriptors.hdr + 0x0000000000000000 0xe + .stack.descriptors.hdr + 0x0000000000000000 0xe c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/avrxmega4/memx-const/mapped\libgcc.a(_exit.o) + +.note.gnu.build-id + *(.note.gnu.build-id) + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges 0x0000000000000000 0x98 + *(.debug_aranges) + .debug_aranges + 0x0000000000000000 0x40 build/default/production/main.o + .debug_aranges + 0x0000000000000040 0x30 build/default/production/usart.o + .debug_aranges + 0x0000000000000070 0x28 build/default/production/command.o + +.debug_pubnames + *(.debug_pubnames) + +.debug_info 0x0000000000000000 0x3f44 + *(.debug_info .gnu.linkonce.wi.*) + .debug_info 0x0000000000000000 0x2c24 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + .debug_info 0x0000000000002c24 0x7ef build/default/production/main.o + .debug_info 0x0000000000003413 0x6b2 build/default/production/usart.o + .debug_info 0x0000000000003ac5 0x47f build/default/production/command.o + +.debug_abbrev 0x0000000000000000 0x2e07 + *(.debug_abbrev) + .debug_abbrev 0x0000000000000000 0x29ce C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + .debug_abbrev 0x00000000000029ce 0x1a8 build/default/production/main.o + .debug_abbrev 0x0000000000002b76 0x14c build/default/production/usart.o + .debug_abbrev 0x0000000000002cc2 0x145 build/default/production/command.o + +.debug_line 0x0000000000000000 0x6ab + *(.debug_line .debug_line.* .debug_line_end) + .debug_line 0x0000000000000000 0x222 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + .debug_line 0x0000000000000222 0x1b6 build/default/production/main.o + .debug_line 0x00000000000003d8 0x175 build/default/production/usart.o + .debug_line 0x000000000000054d 0x15e build/default/production/command.o + +.debug_frame 0x0000000000000000 0x17c + *(.debug_frame) + .debug_frame 0x0000000000000000 0xac build/default/production/main.o + .debug_frame 0x00000000000000ac 0x64 build/default/production/usart.o + .debug_frame 0x0000000000000110 0x6c build/default/production/command.o + +.debug_str 0x0000000000000000 0x138b + *(.debug_str) + .debug_str 0x0000000000000000 0x1320 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + .debug_str 0x0000000000001320 0x4e build/default/production/main.o + .debug_str 0x000000000000136e 0xb build/default/production/usart.o + .debug_str 0x0000000000001379 0x12 build/default/production/command.o + +.debug_loc 0x0000000000000000 0x1b2 + *(.debug_loc) + .debug_loc 0x0000000000000000 0x13 build/default/production/main.o + .debug_loc 0x0000000000000013 0x5a build/default/production/usart.o + .debug_loc 0x000000000000006d 0x145 build/default/production/command.o + +.debug_macinfo + *(.debug_macinfo) + +.debug_weaknames + *(.debug_weaknames) + +.debug_funcnames + *(.debug_funcnames) + +.debug_typenames + *(.debug_typenames) + +.debug_varnames + *(.debug_varnames) + +.debug_pubtypes + *(.debug_pubtypes) + +.debug_ranges 0x0000000000000000 0x68 + *(.debug_ranges) + .debug_ranges 0x0000000000000000 0x30 build/default/production/main.o + .debug_ranges 0x0000000000000030 0x20 build/default/production/usart.o + .debug_ranges 0x0000000000000050 0x18 build/default/production/command.o + +.debug_macro + *(.debug_macro) +OUTPUT(dist/default/production/avr128da48_web-serial-example.X.production.elf elf32-avr) +LOAD linker stubs +LOAD data_init + +.note.gnu.avr.deviceinfo + 0x0000000000000000 0x40 + .note.gnu.avr.deviceinfo + 0x0000000000000000 0x40 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + +.bss.buff_idx 0x0000000000804082 0x1 + .bss.buff_idx 0x0000000000804082 0x1 build/default/production/main.o + 0x0000000000804082 buff_idx + +.bss.buffer 0x000000000080406e 0x14 + .bss.buffer 0x000000000080406e 0x14 build/default/production/main.o + 0x000000000080406e buffer + +.bss.cmd_idx 0x0000000000804083 0x1 + .bss.cmd_idx 0x0000000000804083 0x1 build/default/production/command.o + 0x0000000000804083 cmd_idx + +.bss.commands 0x0000000000804000 0x6e + .bss.commands 0x0000000000804000 0x6e build/default/production/command.o + 0x0000000000804000 commands + +.rodata 0x0000000000808154 0x54 load address 0x0000000000000154 + .rodata 0x0000000000808154 0x54 build/default/production/command.o + +.rodata 0x00000000008081a8 0x1f load address 0x00000000000001a8 + .rodata 0x00000000008081a8 0x1f build/default/production/main.o + +.text.__vector_31 + 0x00000000000001c8 0x9c + .text.__vector_31 + 0x00000000000001c8 0x9c build/default/production/main.o + 0x00000000000001c8 __vector_31 + +.text.command_process + 0x0000000000000264 0x72 + .text.command_process + 0x0000000000000264 0x72 build/default/production/command.o + 0x0000000000000264 command_process + +.text.command_define + 0x00000000000002d6 0x70 + .text.command_define + 0x00000000000002d6 0x70 build/default/production/command.o + 0x00000000000002d6 command_define + +.text.USART1_SendString + 0x0000000000000346 0x44 + .text.USART1_SendString + 0x0000000000000346 0x44 build/default/production/usart.o + 0x0000000000000346 USART1_SendString + +.text.USART1_Initialize + 0x000000000000038a 0x2c + .text.USART1_Initialize + 0x000000000000038a 0x2c build/default/production/usart.o + 0x000000000000038a USART1_Initialize + +.text.main 0x00000000000003b6 0x26 + .text.main 0x00000000000003b6 0x26 build/default/production/main.o + 0x00000000000003b6 main + +.text.strcmp 0x00000000000003dc 0x1c + .text.strcmp 0x00000000000003dc 0x1c c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcmp.o) + 0x00000000000003dc strcmp + +.text.exit 0x00000000000003f8 0x16 + .text.exit 0x00000000000003f8 0x16 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + 0x00000000000003f8 exit + +.text.memset 0x000000000000040e 0x12 + .text.memset 0x000000000000040e 0x12 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(memset.o) + 0x000000000000040e memset + +.text.USART1_SendChar + 0x0000000000000420 0x10 + .text.USART1_SendChar + 0x0000000000000420 0x10 build/default/production/usart.o + 0x0000000000000420 USART1_SendChar + +.text.strcpy 0x0000000000000430 0x10 + .text.strcpy 0x0000000000000430 0x10 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(strcpy.o) + 0x0000000000000430 strcpy + +.text.hello_world + 0x0000000000000440 0xa + .text.hello_world + 0x0000000000000440 0xa build/default/production/main.o + 0x0000000000000440 hello_world + +.text.led_toggle + 0x000000000000044a 0x8 + .text.led_toggle + 0x000000000000044a 0x8 build/default/production/main.o + 0x000000000000044a led_toggle + +.text 0x0000000000000452 0x4 + .text 0x0000000000000452 0x4 C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124/xc8/avr/lib/avrxmega4/memx-const/mapped/crtavr128da48.o + 0x0000000000000452 __vector_38 + 0x0000000000000452 __vector_22 + 0x0000000000000452 __vector_28 + 0x0000000000000452 __vector_1 + 0x0000000000000452 __vector_32 + 0x0000000000000452 __vector_34 + 0x0000000000000452 __vector_24 + 0x0000000000000452 __vector_12 + 0x0000000000000452 __vector_55 + 0x0000000000000452 __vector_46 + 0x0000000000000452 __bad_interrupt + 0x0000000000000452 __vector_6 + 0x0000000000000452 __vector_35 + 0x0000000000000452 __vector_39 + 0x0000000000000452 __vector_3 + 0x0000000000000452 __vector_23 + 0x0000000000000452 __vector_30 + 0x0000000000000452 __vector_45 + 0x0000000000000452 __vector_25 + 0x0000000000000452 __vector_11 + 0x0000000000000452 __vector_54 + 0x0000000000000452 __vector_13 + 0x0000000000000452 __vector_17 + 0x0000000000000452 __vector_19 + 0x0000000000000452 __vector_56 + 0x0000000000000452 __vector_7 + 0x0000000000000452 __vector_49 + 0x0000000000000452 __vector_41 + 0x0000000000000452 __vector_43 + 0x0000000000000452 __vector_27 + 0x0000000000000452 __vector_5 + 0x0000000000000452 __vector_33 + 0x0000000000000452 __vector_47 + 0x0000000000000452 __vector_52 + 0x0000000000000452 __vector_37 + 0x0000000000000452 __vector_4 + 0x0000000000000452 __vector_44 + 0x0000000000000452 __vector_51 + 0x0000000000000452 __vector_9 + 0x0000000000000452 __vector_2 + 0x0000000000000452 __vector_21 + 0x0000000000000452 __vector_15 + 0x0000000000000452 __vector_36 + 0x0000000000000452 __vector_29 + 0x0000000000000452 __vector_40 + 0x0000000000000452 __vector_8 + 0x0000000000000452 __vector_26 + 0x0000000000000452 __vector_48 + 0x0000000000000452 __vector_14 + 0x0000000000000452 __vector_57 + 0x0000000000000452 __vector_53 + 0x0000000000000452 __vector_10 + 0x0000000000000452 __vector_50 + 0x0000000000000452 __vector_16 + 0x0000000000000452 __vector_18 + 0x0000000000000452 __vector_20 + 0x0000000000000452 __vector_42 + +.text._Exit 0x0000000000000456 0x4 + .text._Exit 0x0000000000000456 0x4 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(_Exit.o) + 0x0000000000000456 _Exit + +.text.__dummy_fini + 0x000000000000045a 0x2 + .text.__dummy_fini + 0x000000000000045a 0x2 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + 0x000000000000045a _fini + +.text.__dummy_funcs_on_exit + 0x000000000000045c 0x2 + .text.__dummy_funcs_on_exit + 0x000000000000045c 0x2 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + 0x000000000000045c __funcs_on_exit + +.text.__dummy_simulator_exit + 0x000000000000045e 0x2 + .text.__dummy_simulator_exit + 0x000000000000045e 0x2 c:/program files/microchip/xc8/v2.36/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avrxmega4/memx-const/mapped\libc.a(exit.o) + 0x000000000000045e __simulator_exit diff --git a/dist/default/production/memoryfile.xml b/dist/default/production/memoryfile.xml new file mode 100644 index 0000000..26bb6ae --- /dev/null +++ b/dist/default/production/memoryfile.xml @@ -0,0 +1,17 @@ + + + + + bytes + 131072 + 1119 + 129953 + + + bytes + 16384 + 132 + 16252 + + + diff --git a/main.c b/main.c new file mode 100644 index 0000000..ba15420 --- /dev/null +++ b/main.c @@ -0,0 +1,55 @@ +#define F_CPU (4000000UL) +#include +#include +#include +#include +#include "command.h" +#include "usart.h" + +#define BUFFER_SIZE 20 + +char buffer[BUFFER_SIZE]; +volatile uint8_t buff_idx = 0; + +void led_toggle(void); +void hello_world(void); + +ISR(USART1_RXC_vect) { + char c; + c = USART1.RXDATAL; + + if (c != ' ' && c != '\n' && c != '\r') { + buffer[buff_idx++] = c; + } + + if (c == '\n') { + command_process(buffer); + buff_idx = 0; + memset(buffer, 0, strlen(buffer)); + } +} + +void MCU_Init_Ports(void) { + /* led pin PC6 to output */ + PORTC.DIRSET = PIN6_bm; +} + +int main(void) { + MCU_Init_Ports(); + USART1_Initialize(); + sei(); + + command_define(led_toggle, "led_toggle"); + command_define(hello_world, "hello"); + + while (1) { + } +} + +void led_toggle(void) { + PORTC.OUTTGL = PIN6_bm; +} + +void hello_world(void) { + USART1_SendString("Hello world!\n"); +} \ No newline at end of file diff --git a/nbproject/Makefile-default.mk b/nbproject/Makefile-default.mk new file mode 100644 index 0000000..954fb26 --- /dev/null +++ b/nbproject/Makefile-default.mk @@ -0,0 +1,182 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Include project Makefile +ifeq "${IGNORE_LOCAL}" "TRUE" +# do not include local makefile. User is passing all local related variables already +else +include Makefile +# Include makefile containing local settings +ifeq "$(wildcard nbproject/Makefile-local-default.mk)" "nbproject/Makefile-local-default.mk" +include nbproject/Makefile-local-default.mk +endif +endif + +# Environment +MKDIR=gnumkdir -p +RM=rm -f +MV=mv +CP=cp + +# Macros +CND_CONF=default +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +IMAGE_TYPE=debug +OUTPUT_SUFFIX=elf +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +else +IMAGE_TYPE=production +OUTPUT_SUFFIX=hex +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +endif + +ifeq ($(COMPARE_BUILD), true) +COMPARISON_BUILD=-mafrlcsj +else +COMPARISON_BUILD= +endif + +ifdef SUB_IMAGE_ADDRESS + +else +SUB_IMAGE_ADDRESS_COMMAND= +endif + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} + +# Distribution Directory +DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} + +# Source Files Quoted if spaced +SOURCEFILES_QUOTED_IF_SPACED=main.c usart.c command.c + +# Object Files Quoted if spaced +OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/main.o ${OBJECTDIR}/usart.o ${OBJECTDIR}/command.o +POSSIBLE_DEPFILES=${OBJECTDIR}/main.o.d ${OBJECTDIR}/usart.o.d ${OBJECTDIR}/command.o.d + +# Object Files +OBJECTFILES=${OBJECTDIR}/main.o ${OBJECTDIR}/usart.o ${OBJECTDIR}/command.o + +# Source Files +SOURCEFILES=main.c usart.c command.c + + + +CFLAGS= +ASFLAGS= +LDLIBSOPTIONS= + +############# Tool locations ########################################## +# If you copy a project from one host to another, the path where the # +# compiler is installed may be different. # +# If you open this project with MPLAB X in the new host, this # +# makefile will be regenerated and the paths will be corrected. # +####################################################################### +# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build +FIXDEPS=fixDeps + +.build-conf: ${BUILD_SUBPROJECTS} +ifneq ($(INFORMATION_MESSAGE), ) + @echo $(INFORMATION_MESSAGE) +endif + ${MAKE} -f nbproject/Makefile-default.mk ${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} + +MP_PROCESSOR_OPTION=AVR128DA48 +# ------------------------------------------------------------------------------------ +# Rules for buildStep: compile +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${OBJECTDIR}/main.o: main.c .generated_files/flags/default/baf556898677ce2f71fcf7d1ed7762047b1b08b2 .generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/main.o.d + @${RM} ${OBJECTDIR}/main.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/main.o.d" -MT "${OBJECTDIR}/main.o.d" -MT ${OBJECTDIR}/main.o -o ${OBJECTDIR}/main.o main.c + +${OBJECTDIR}/usart.o: usart.c .generated_files/flags/default/454d3881b9ef453d62371ca6ae5d493a9db2f763 .generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/usart.o.d + @${RM} ${OBJECTDIR}/usart.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/usart.o.d" -MT "${OBJECTDIR}/usart.o.d" -MT ${OBJECTDIR}/usart.o -o ${OBJECTDIR}/usart.o usart.c + +${OBJECTDIR}/command.o: command.c .generated_files/flags/default/67130230c37141f762328d3477127279e5794533 .generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/command.o.d + @${RM} ${OBJECTDIR}/command.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/command.o.d" -MT "${OBJECTDIR}/command.o.d" -MT ${OBJECTDIR}/command.o -o ${OBJECTDIR}/command.o command.c + +else +${OBJECTDIR}/main.o: main.c .generated_files/flags/default/244ff3d6ca5f6fe1ad3255fce837d326ef857c0e .generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/main.o.d + @${RM} ${OBJECTDIR}/main.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/main.o.d" -MT "${OBJECTDIR}/main.o.d" -MT ${OBJECTDIR}/main.o -o ${OBJECTDIR}/main.o main.c + +${OBJECTDIR}/usart.o: usart.c .generated_files/flags/default/9b2f2a27767e8fb25a5e864c373fffef3c042982 .generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/usart.o.d + @${RM} ${OBJECTDIR}/usart.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/usart.o.d" -MT "${OBJECTDIR}/usart.o.d" -MT ${OBJECTDIR}/usart.o -o ${OBJECTDIR}/usart.o usart.c + +${OBJECTDIR}/command.o: command.c .generated_files/flags/default/316ffe5fc1b0327ad1888acca4fe8f061c349913 .generated_files/flags/default/adc60f139592a80ffba15ee218ef4587961729e8 + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/command.o.d + @${RM} ${OBJECTDIR}/command.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/command.o.d" -MT "${OBJECTDIR}/command.o.d" -MT ${OBJECTDIR}/command.o -o ${OBJECTDIR}/command.o command.c + +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assemble +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +else +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assembleWithPreprocess +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +else +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: link +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} ${DISTDIR} + ${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.map -D__DEBUG=1 -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -gdwarf-2 -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -gdwarf-3 $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o ${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 + @${RM} ${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.hex + +else +${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} ${DISTDIR} + ${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.map -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -Wall -gdwarf-3 $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o ${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group + ${MP_CC_DIR}\\avr-objcopy -O ihex "${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/avr128da48_web-serial-example.X.${IMAGE_TYPE}.hex" +endif + + +# Subprojects +.build-subprojects: + + +# Subprojects +.clean-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${OBJECTDIR} + ${RM} -r ${DISTDIR} + +# Enable dependency checking +.dep.inc: .depcheck-impl + +DEPFILES=$(shell mplabwildcard ${POSSIBLE_DEPFILES}) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/nbproject/Makefile-genesis.properties b/nbproject/Makefile-genesis.properties new file mode 100644 index 0000000..66aa6af --- /dev/null +++ b/nbproject/Makefile-genesis.properties @@ -0,0 +1,14 @@ +# +#Sun Sep 18 19:33:06 MSK 2022 +default.languagetoolchain.version=2.36 +default.Pack.dfplocation=C\:\\Program Files\\Microchip\\MPLABX\\v6.00\\packs\\Microchip\\AVR-Dx_DFP\\1.10.124 +default.com-microchip-mplab-mdbcore-AtmelIceScripting-AtmelIceScriptingBase.md5=482739504911ebc0014ce7a2f768600b +conf.ids=default +default.languagetoolchain.dir=C\:\\Program Files\\Microchip\\xc8\\v2.36\\bin +host.id=j1xa-hixg-b +configurations-xml=aebb80b5ae0e47377ddbf10c5632d870 +com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6e02ca5e9f5042ffd365b42ab82d3a9b +user-defined-mime-resolver-xml=none +default.com-microchip-mplab-nbide-toolchain-xc8-XC8LanguageToolchain.md5=ab1e0737b447a24f7366e9fd8fe5a2f0 +proj.dir=D\:\\Apps\\avr128da48_web-serial-example.X +host.platform=windows diff --git a/nbproject/Makefile-impl.mk b/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..0622cd3 --- /dev/null +++ b/nbproject/Makefile-impl.mk @@ -0,0 +1,69 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=avr128da48_web-serial-example.X + +# Active Configuration +DEFAULTCONF=default +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=default + + +# build +.build-impl: .build-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default clean + + + +# all +.all-impl: .all-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default build + + + +# dependency checking support +.depcheck-impl: +# @echo "# This code depends on make tool being used" >.dep.inc +# @if [ -n "${MAKE_VERSION}" ]; then \ +# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ +# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ +# echo "include \$${DEPFILES}" >>.dep.inc; \ +# echo "endif" >>.dep.inc; \ +# else \ +# echo ".KEEP_STATE:" >>.dep.inc; \ +# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ +# fi diff --git a/nbproject/Makefile-local-default.mk b/nbproject/Makefile-local-default.mk new file mode 100644 index 0000000..26a823a --- /dev/null +++ b/nbproject/Makefile-local-default.mk @@ -0,0 +1,38 @@ +# +# Generated Makefile - do not edit! +# +# +# This file contains information about the location of compilers and other tools. +# If you commmit this file into your revision control server, you will be able to +# to checkout the project and build it from the command line with make. However, +# if more than one person works on the same project, then this file might show +# conflicts since different users are bound to have compilers in different places. +# In that case you might choose to not commit this file and let MPLAB X recreate this file +# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at +# least once so the file gets created and the project can be built. Finally, you can also +# avoid using this file at all if you are only building from the command line with make. +# You can invoke make with the values of the macros: +# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ... +# +SHELL=cmd.exe +PATH_TO_IDE_BIN=C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/ +# Adding MPLAB X bin directory to path. +PATH:=C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH) +# Path to java used to run MPLAB X when this makefile was created +MP_JAVA_PATH="C:\Program Files\Microchip\MPLABX\v6.00\sys\java\zulu8.54.0.21-ca-fx-jre8.0.292-win_x64/bin/" +OS_CURRENT="$(shell uname -s)" +MP_CC="C:\Program Files\Microchip\xc8\v2.36\bin\xc8-cc.exe" +# MP_CPPC is not defined +# MP_BC is not defined +MP_AS="C:\Program Files\Microchip\xc8\v2.36\bin\xc8-cc.exe" +MP_LD="C:\Program Files\Microchip\xc8\v2.36\bin\xc8-cc.exe" +MP_AR="C:\Program Files\Microchip\xc8\v2.36\bin\xc8-ar.exe" +DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" +MP_CC_DIR="C:\Program Files\Microchip\xc8\v2.36\bin" +# MP_CPPC_DIR is not defined +# MP_BC_DIR is not defined +MP_AS_DIR="C:\Program Files\Microchip\xc8\v2.36\bin" +MP_LD_DIR="C:\Program Files\Microchip\xc8\v2.36\bin" +MP_AR_DIR="C:\Program Files\Microchip\xc8\v2.36\bin" +# MP_BC_DIR is not defined +DFP_DIR=C:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/AVR-Dx_DFP/1.10.124 diff --git a/nbproject/Makefile-variables.mk b/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..885c9ec --- /dev/null +++ b/nbproject/Makefile-variables.mk @@ -0,0 +1,10 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +# default configuration +CND_ARTIFACT_DIR_default=dist/default/production +CND_ARTIFACT_NAME_default=avr128da48_web-serial-example.X.production.hex +CND_ARTIFACT_PATH_default=dist/default/production/avr128da48_web-serial-example.X.production.hex diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml new file mode 100644 index 0000000..4aa1da4 --- /dev/null +++ b/nbproject/configurations.xml @@ -0,0 +1,261 @@ + + + + + usart.h + command.h + + + + + main.c + usart.c + command.c + + + Makefile + + + Makefile + + + + localhost + AVR128DA48 + + + nEdbgTool + XC8 + 2.36 + 3 + + + + + + + + + + + + + + + false + false + + + + + + + false + false + + false + + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/private/configurations.xml b/nbproject/private/configurations.xml new file mode 100644 index 0000000..bc16218 --- /dev/null +++ b/nbproject/private/configurations.xml @@ -0,0 +1,25 @@ + + + Makefile + 0 + + + :=MPLABComm-USB-Microchip:=<vid>03EB:=<pid>2175:=<rev>0100:=<man>Microchip Technology Incorporated:=<prod>nEDBG CMSIS-DAP:=<sn>MCHP3280031800000837:=<drv>x:=<xpt>h:=end + C:\Program Files\Microchip\xc8\v2.36\bin + + place holder 1 + place holder 2 + + + + + true + 0 + 0 + 0 + + + + + + diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 0000000..630003a --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,9 @@ + + + + + + file:/D:/Apps/avr128da48_web-serial-example.X/main.c + + + diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..fbaac60 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,27 @@ + + + com.microchip.mplab.nbide.embedded.makeproject + + + avr128da48_web-serial-example + 69755243-2fe5-4cd4-8aa3-cd1c6ee51a0e + 0 + c + + h + + ISO-8859-1 + + + + + default + 2 + + + + false + + + + diff --git a/usart.c b/usart.c new file mode 100644 index 0000000..9eb88e1 --- /dev/null +++ b/usart.c @@ -0,0 +1,35 @@ +#include "usart.h" + +void USART1_Initialize(void) { + /* set baud rate */ + USART1.BAUD = (uint16_t) (USART1_BAUD_RATE(BAUD_RATE)); + + /* set char size in a frame to 8 bit */ + USART1.CTRLC = USART_CHSIZE0_bm | USART_CHSIZE1_bm; + + /* config pins for TX and RX */ + PORTC.DIRSET = PIN0_bm; + PORTC.DIRCLR = PIN1_bm; + + /* enable reveice complete interrupt */ + USART1.CTRLA = USART_RXCIE_bm; + + /* enable transmitter and receiver */ + USART1.CTRLB = USART_TXEN_bm | USART_RXEN_bm; + +} + +void USART1_SendChar(char c) { + while (!(USART1.STATUS & USART_DREIF_bm)) { + ; + } + + USART1.TXDATAL = c; +} + +void USART1_SendString(char *str) { + for (size_t i = 0; i < strlen(str); i++) { + USART1_SendChar(str[i]); + } +} + diff --git a/usart.h b/usart.h new file mode 100644 index 0000000..4d5103d --- /dev/null +++ b/usart.h @@ -0,0 +1,15 @@ +#ifndef USART_H +#define USART_H +#define BAUD_RATE (9600) +#define USART1_BAUD_RATE(BAUD_RATE) ((float)(64 * 4000000 / (16 * (float)BAUD_RATE)) + 0.5) + +#include +#include +#include + +void USART1_Initialize(void); +void USART1_SendChar(char c); +void USART1_SendString(char *str); + +#endif /* USART_H */ +