diff --git a/.gitignore b/.gitignore index 4e4578b2f8313468eb2ea7609e65897ee03b67f1..e6faceac0fffc799f981797163e40772deb87730 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ DSTAT/doxygen/ *.sym *.d *.o +!atxmega256a3u_104.hex \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0d9f53dc688d58fee0ddafbe94e4680b2619c06a..3eb44b4f8314e7045280c122d3eceac1e1ef79de 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,19 @@ image: kalledk/docker-avr-toolchain -build: +1.2.3: script: - - cd DSTAT - make artifacts: name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}" paths: - - DSTAT/*.hex + - dstat-firmware.hex + - dstat-firmware.elf + +pre-1.2.3: + script: + - make BOARD_VER_MICRO=0 + artifacts: + name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}" + paths: + - dstat-firmware.hex + - dstat-firmware.elf diff --git a/DSTAT/DSTAT.cproj b/DSTAT/DSTAT.cproj deleted file mode 100644 index b9424306787c71d99a1cc68740f4f7cc123788b2..0000000000000000000000000000000000000000 --- a/DSTAT/DSTAT.cproj +++ /dev/null @@ -1,686 +0,0 @@ - - - - 2.0 - 6.1 - {511f3fe1-f6b0-4e6d-877c-322c1167607e} - DSTAT - $(MSBuildProjectName) - $(MSBuildProjectName) - 3.4.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - atxmega256a3u - xmegaau - C - com.Atmel.AVRGCC8.C - - $(MSBuildProjectDirectory)\$(Configuration) - $(MSBuildProjectName) - .elf - Executable - Native - true - false - exception_table - 0 - true - true - 0x20000000 - - 2 - - - - True - True - True - True - - - True - True - True - True - True - False - - - BOARD=USER_BOARD - IOPORT_XMEGA_COMPAT - - - - - ../src - ../src/asf/common/applications/user_application/user_board - ../src/asf/common/boards - ../src/asf/common/boards/user_board - ../src/asf/common/utils - ../src/asf/xmega/utils - ../src/asf/xmega/utils/preprocessor - ../src/config - ../src/asf/xmega/drivers/cpu - ../src/asf/xmega/drivers/nvm - ../src/asf/xmega/drivers/pmic - ../src/asf/xmega/drivers/rtc - ../src/asf/xmega/drivers/sleep - ../src/asf/xmega/drivers/tc - ../src/asf/xmega/drivers/usart - ../src/asf/common/services/clock - ../src/asf/common/services/delay - ../src/asf/common/services/ioport - ../src/asf/common/services/sleepmgr - ../src/asf/common/services/spi - ../src/asf/common/services/usb - ../src/asf/common/services/usb/class/cdc - ../src/asf/common/services/usb/class/cdc/device - ../src/asf/common/services/usb/udc - ../src/asf/common/utils/stdio/stdio_usb - ../src/asf/xmega/drivers/usb - ../common/applications/user_application/user_board - ../src/ASF/common/services/hugemem - ../src/ASF/xmega/drivers/dma - ../src/ASF/common/drivers/nvm - - - Optimize for size (-Os) - -fdata-sections - True - -std=gnu99 -fno-strict-aliasing -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -mrelax - - - - -Wl,--relax - -mrelax -DBOARD=USER_BOARD - - - ../src - ../src/asf/common/applications/user_application/user_board - ../src/asf/common/boards - ../src/asf/common/boards/user_board - ../src/asf/common/utils - ../src/asf/xmega/utils - ../src/asf/xmega/utils/preprocessor - ../src/config - ../src/asf/xmega/drivers/cpu - ../src/asf/xmega/drivers/nvm - ../src/asf/xmega/drivers/pmic - ../src/asf/xmega/drivers/rtc - ../src/asf/xmega/drivers/sleep - ../src/asf/xmega/drivers/tc - ../src/asf/xmega/drivers/usart - ../src/asf/common/services/clock - ../src/asf/common/services/delay - ../src/asf/common/services/ioport - ../src/asf/common/services/sleepmgr - ../src/asf/common/services/spi - ../src/asf/common/services/usb - ../src/asf/common/services/usb/class/cdc - ../src/asf/common/services/usb/class/cdc/device - ../src/asf/common/services/usb/udc - ../src/asf/common/utils/stdio/stdio_usb - ../src/asf/xmega/drivers/usb - ../common/applications/user_application/user_board - ../src/ASF/common/services/hugemem - ../src/ASF/xmega/drivers/dma - ../src/ASF/common/drivers/nvm - - - - - - - - True - True - True - True - - - True - True - True - True - True - False - - - BOARD=USER_BOARD - IOPORT_XMEGA_COMPAT - - - - - ../src - ../src/asf/common/applications/user_application/user_board - ../src/asf/common/boards - ../src/asf/common/boards/user_board - ../src/asf/common/utils - ../src/asf/xmega/utils - ../src/asf/xmega/utils/preprocessor - ../src/config - ../src/asf/xmega/drivers/cpu - ../src/asf/xmega/drivers/nvm - ../src/asf/xmega/drivers/pmic - ../src/asf/xmega/drivers/rtc - ../src/asf/xmega/drivers/sleep - ../src/asf/xmega/drivers/tc - ../src/asf/xmega/drivers/usart - ../src/asf/common/services/clock - ../src/asf/common/services/delay - ../src/asf/common/services/ioport - ../src/asf/common/services/sleepmgr - ../src/asf/common/services/spi - ../src/asf/common/services/usb - ../src/asf/common/services/usb/class/cdc - ../src/asf/common/services/usb/class/cdc/device - ../src/asf/common/services/usb/udc - ../src/asf/common/utils/stdio/stdio_usb - ../src/asf/xmega/drivers/usb - ../common/applications/user_application/user_board - ../src/ASF/common/services/hugemem - ../src/ASF/xmega/drivers/dma - ../src/ASF/common/drivers/nvm - - - Optimize (-O1) - -fdata-sections - Maximum (-g3) - True - -std=gnu99 -fno-strict-aliasing -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -mrelax - - - - -Wl,--relax - -mrelax -DBOARD=USER_BOARD - - - ../src - ../src/asf/common/applications/user_application/user_board - ../src/asf/common/boards - ../src/asf/common/boards/user_board - ../src/asf/common/utils - ../src/asf/xmega/utils - ../src/asf/xmega/utils/preprocessor - ../src/config - ../src/asf/xmega/drivers/cpu - ../src/asf/xmega/drivers/nvm - ../src/asf/xmega/drivers/pmic - ../src/asf/xmega/drivers/rtc - ../src/asf/xmega/drivers/sleep - ../src/asf/xmega/drivers/tc - ../src/asf/xmega/drivers/usart - ../src/asf/common/services/clock - ../src/asf/common/services/delay - ../src/asf/common/services/ioport - ../src/asf/common/services/sleepmgr - ../src/asf/common/services/spi - ../src/asf/common/services/usb - ../src/asf/common/services/usb/class/cdc - ../src/asf/common/services/usb/class/cdc/device - ../src/asf/common/services/usb/udc - ../src/asf/common/utils/stdio/stdio_usb - ../src/asf/xmega/drivers/usb - ../common/applications/user_application/user_board - ../src/ASF/common/services/hugemem - ../src/ASF/xmega/drivers/dma - ../src/ASF/common/drivers/nvm - - - Default (-Wa,-g) - - - - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - compile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/DSTAT1.atsln b/DSTAT1.atsln deleted file mode 100644 index bf1b058fc0354b920f79d08ed8928740866a014f..0000000000000000000000000000000000000000 --- a/DSTAT1.atsln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Atmel Studio Solution File, Format Version 11.00 -Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DSTAT", "DSTAT\DSTAT.cproj", "{511F3FE1-F6B0-4E6D-877C-322C1167607E}" -EndProject -Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "EEPROM init", "EEPROM init\EEPROM init.cproj", "{F03C750F-9F8B-4E91-9B72-83F6D7CE27F4}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|AVR = Debug|AVR - Release|AVR = Release|AVR - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {511F3FE1-F6B0-4E6D-877C-322C1167607E}.Debug|AVR.ActiveCfg = Debug|AVR - {511F3FE1-F6B0-4E6D-877C-322C1167607E}.Debug|AVR.Build.0 = Debug|AVR - {511F3FE1-F6B0-4E6D-877C-322C1167607E}.Release|AVR.ActiveCfg = Release|AVR - {511F3FE1-F6B0-4E6D-877C-322C1167607E}.Release|AVR.Build.0 = Release|AVR - {F03C750F-9F8B-4E91-9B72-83F6D7CE27F4}.Debug|AVR.ActiveCfg = Debug|AVR - {F03C750F-9F8B-4E91-9B72-83F6D7CE27F4}.Debug|AVR.Build.0 = Debug|AVR - {F03C750F-9F8B-4E91-9B72-83F6D7CE27F4}.Release|AVR.ActiveCfg = Release|AVR - {F03C750F-9F8B-4E91-9B72-83F6D7CE27F4}.Release|AVR.Build.0 = Release|AVR - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(SubversionScc) = preSolution - Svn-Managed = True - Manager = AnkhSVN - Subversion Support for Visual Studio - EndGlobalSection -EndGlobal diff --git a/DSTAT1.atsuo b/DSTAT1.atsuo deleted file mode 100644 index ed3155bba6ffdc35f3520f1daeb779eab2c12534..0000000000000000000000000000000000000000 Binary files a/DSTAT1.atsuo and /dev/null differ diff --git a/DSTAT/Makefile b/Makefile similarity index 97% rename from DSTAT/Makefile rename to Makefile index 617acc533bad4637e5e3c3afcb994e857ff4b4f5..1370d799cc4b9976644ef9d35fa93bf8ab02f8ae 100644 --- a/DSTAT/Makefile +++ b/Makefile @@ -486,10 +486,14 @@ rebuilddoc: cleandoc doc .PHONY: program program: all flash -# Flash µC - flash and disables JTAG -AVRDUDE_FLAGS = -p $(AVRDUDE_DEV) -c $(AVRDUDE_PROG) -P $(AVRDUDE_PORT) -U flash:w:$(TARGET):e -U fuse4:w:0xff:m +# Flash µC - Writes bootloader, application, disables JTAG, and enables boot to bootloader +program: AVRDUDE_FLAGS = -p $(AVRDUDE_DEV) -c $(AVRDUDE_PROG) -P $(AVRDUDE_PORT) -U flash:w:atxmega256a3u_104.hex:i -U application:w:$(TARGET):e -U fuse4:w:0xff:m -U fuse2:w:0xbf:m + +# program over USB +.PHONY: dfu +dfu: all flash +dfu: AVRDUDE_FLAGS = -p $(AVRDUDE_DEV) -c flip2 -U application:w:$(TARGET):e flash: $(TARGET) avrdude $(AVRDUDE_FLAGS) - diff --git a/README.markdown b/README.markdown index 076f93f1e21dbb9208f0e4d14e25045c4260b871..57581b384e561b4e4484a1528ce6f9d95a94adda 100644 --- a/README.markdown +++ b/README.markdown @@ -6,7 +6,6 @@ This is the documentation for the DStat microcontroller firmware. * [Building from source](#building-from-source) * [Build requirements](#build-requirements) * [Building with Make](#building-with-make) - * [Building with Atmel Studio](#building-with-atmel-studio) * [Installation](#installation) * [Requirements](#requirements) * [Fuse bits](#fuse-bits) @@ -25,7 +24,7 @@ The software that runs on the microcontroller is known as firmware and is writte # Building from source Precompiled binaries of the firmware are [available](http://microfluidics.utoronto.ca/gitlab/dstat/dstat-firmware/builds) from the automated build system (click the download button for the desired build) and can be uploaded using [avrdude](http://www.nongnu.org/avrdude/) or Atmel Studio. -The most up to date [code](http://microfluidics.utoronto.ca/gitlab/dstat/dstat-firmware/repository/archive.zip?ref=develop) can be found in the `develop` branch and must be compiled before it can be loaded onto the microcontroller. +The most up to date firmware can be found in the `develop` (or individual feature) branches. ## Build requirements @@ -38,31 +37,33 @@ The most up to date [code](http://microfluidics.utoronto.ca/gitlab/dstat/dstat-f ## Building with Make -The easiest way to build the firmware on Mac or Linux (Make is available in Windows, but the Makefiles may need changes to run correctly) is using the included Makefiles: +The easiest way to build the firmware on Mac or Linux (Make is available in Windows, but the Makefiles may need changes to run correctly) is using the included Makefiles (from the root of dstat-firmware): ```` - cd DSTAT/ - make + make ```` -This will produce binary files in the `DSTAT` directory. -The files in `DSTAT` are the firmware binaries that will be loaded onto the microcontroller. +This will produce the firmware binaries that will be loaded onto the microcontroller. `atxmega256a3u_104.hex` is a bootloader for upgrading firmware over USB after the initial flash (currently experimental) and `dstat-firmware.hex` or `dstat-firmware.elf` is the actual firmware. +To compile for a dstat-hardware version earlier than 1.2.3, instead do: +```` + make BOARD_VER_MICRO=0 +```` + ## Building with Make (using Docker) On Windows, the easiest way to compile the source is using make from docker (Keep in mind you can use the automated build system if you don't intend to make modifications to the firmware).: 1. Install docker from https://docs.docker.com/docker-for-windows/ 2. Use the tray icon for Docker to enable sharing on your C drive (under Shared Drives) -3. In a command prompt: `docker run —rm -w /src -v c:/Users/mdryden/src/dstat-firmware/DSTAT:/src —entrypoint make vyivanov/avr-docker` +3. In a command prompt: `docker run --rm -w /src -v c:/Users/mdryden/src/dstat-firmware/DSTAT:/src --entrypoint make vyivanov/avr-docker` Replacing `c:/Users/mdryden/src/dstat-firmware/DSTAT` with the path to wherever you cloned the source. This should compile your source files and you can upload them with avrdude or Atmel Studio. -## Building with Atmel Studio - -*N.B. Compiling with Atmel Studio is no longer supported. The solution file is still available, but is missing some files in the project to compile properly. Use the makefile method or the Docker-based compilation method instead.* -Instructions for building in Atmel Studio 6 can be found [here](http://www.avr-tutorials.com/avr-studio-6/generating-hex-file-avr-studio-6). -The solution file is in the main `dstat-firmware` directory. +To compile for a dstat-hardware version earlier than 1.2.3, instead do: +```` + docker run --rm -w /src -v c:/Users/mdryden/src/dstat-firmware/DSTAT:/src --entrypoint "make BOARD_VER_MICRO=0" vyivanov/avr-docker +```` # Installation ## Requirements @@ -81,8 +82,8 @@ This must be done manually if you're using Atmel Studio, but will be taken care This can be done from the [Fuses](http://www.atmel.com/webdoc/atmelstudio/atmelstudio.programmingdialog.fuses.html) page of the Device Programming window—simply uncheck `JTAGEN` and click `Program` ## Firmware files -The memory files used to program the microcontroller are found in the DSTAT directory: -* Firmware: `DSTAT/dstat-firmware.elf` or `DSTAT/dstat-firmware.hex` +The memory files used to program the microcontroller are found in the root directory: +* Firmware: `dstat-firmware.elf` Before programming, make sure your programmer is connected to your computer and its PDI connector is connected to the pin header labelled AVR-PDI on the DStat. The side with the red wire should face the pin labelled 1 on the PCB. @@ -95,7 +96,6 @@ See `man avrdude` for more information about these options. To upload the firmware file and set fuse bits: ```` - cd DSTAT/ make program ```` Occasionally, setting the fuse bits may fail. @@ -106,7 +106,7 @@ If an error occurs on verification, simply run `make program` again. Follow the directions [here](http://www.atmel.com/webdoc/atmelstudio/atmelstudio.AVRStudio.ProgrammingDialog.Introduction.html) to program the microcontroller. Be sure to select `ATXMEGA256A3U` as the Device and `PDI` as Interface. -In the Memories tab, `dstat-firmware.elf` or `DSTAT/dstat-firmware.hex` should be selected for Flash, then click Program. +In the Memories tab, `dstat-firmware.elf` should be selected for Flash # Connection and testing If the firmware has been successfully applied, it will be possible to connect to the DStat over USB. diff --git a/DSTAT/atmel_devices_cdc.inf b/atmel_devices_cdc.inf similarity index 100% rename from DSTAT/atmel_devices_cdc.inf rename to atmel_devices_cdc.inf diff --git a/atxmega256a3u_104.hex b/atxmega256a3u_104.hex new file mode 100755 index 0000000000000000000000000000000000000000..4091da13f6ba28dd13e0a1f82156a65bf1842f47 --- /dev/null +++ b/atxmega256a3u_104.hex @@ -0,0 +1,355 @@ +:020000024000BC +:1000000000C00091780005FD42C0F092800608E132 +:10001000009395060FEF0A950023E9F700918806F3 +:1000200005FFECC0E0E0F0E0079116910F3F19F4F6 +:100030001F3F09F4E3C02BC03091CF0137FDFCCF47 +:100040003BB72BBFF8012091CA0113E21093CA01FC +:100050000A01E8952093CA013BBF08953BB72BBF27 +:10006000F8012091CA014093CA013DE93093340060 +:10007000E8952093CA013BBF089501E70DBF00E258 +:100080000EBFC2E9DAE21E94B8001E947C0AF09218 +:10009000950600910020109101200A3A154511F0B3 +:1000A0000C940000F0920020F092012000E20093F6 +:1000B0007800F6CFFF84EE84DD84CC84BB84AA84F0 +:1000C000998488847F806E805D804C80BB81AA810A +:1000D00099818881F0E0EC0FFD1FEF010895FA92FD +:1000E000EA92DA92CA92BA92AA929A928A927A92F0 +:1000F0006A925A924A92BA93AA939A938A930895CB +:10010000AF93BF93D80101900D9241505040D9F761 +:10011000BF91AF9108954091CA01E22FF32F009350 +:10012000CA0104914093CA01089540E04BBFF80111 +:1001300058ED54BF208308954A951AF016950795F7 +:10014000FBCF08954A951AF0000F111FFBCF0895B9 +:1001500020E008D0E9F708953BBF27913BB702D0D4 +:10016000D9F708952D9301501040202F212B089589 +:1001700002E1402E05E1502E04E0602EF201362D02 +:100180006BBE07911691F201EE5FFF4F3F4F3BBFF1 +:10019000A791B691F201362DEC5FFF4F3F4F3BBF69 +:1001A000479157916691242F252B262B21F0FA0198 +:1001B000362FD2DF01C0CCDF07E0400E00E0501E3A +:1001C000601EA201662D403255416440B8F2089588 +:1001D000BD01D801F90104C021912D934150504037 +:0A01E000242F252BC9F7DB01089539 +:1001F4001C947D011C94B2013ECF0FBF08952AE1E7 +:1002040007D00093FA042BE103D00093FB04089574 +:1002140030E002E01E948B000F3F09F40FE10895D3 +:100224001E947C0000E00093600000E31E94040A26 +:1002340030D10064008301E000936000AFB7F8940C +:1002440051D028E0029FF001EC54F64D158303953C +:100254000230C0F3D4DF0091C0040093C00419D16C +:100264000068008300810061008384EB99E20496B6 +:10027400E6EC80839183E0EC46D10FEF0583E8EC54 +:100284000081016000830A2FB8DFE3E01C9467005B +:100294008991089500E008950FB7F89410E410933D +:1002A400CA0410E21093CA04E1ECF4E01081116076 +:1002B4001083E9EC108112601083E8EC1081106463 +:1002C4001083E9EC108111601083E8EC1081106850 +:1002D400108393CF008308950093C304089500917D +:1002E400C304089500E010E008950AD1068F178F23 +:1002F40020A331A3089566D00091CB0407FF05C065 +:1003040000E814D21E94250429C0F9D1002331F544 +:10031400EBECC0D004FF18C000E108D21E94110415 +:1003240000E00093C30420E430E010E062D020E455 +:1003340030E010E000E85DD002EE19E20093BC2941 +:100344001093BD2929D10AC0008106FF02C000E430 +:1003540004C0008105FF02C000E2E8D11ED0189558 +:1003640031D09ED101FD02C085D1B1F402E00093E9 +:10037400CC040091C5043BD0F801008105FF06C000 +:1003840036D020E2F801269308D106C000E830D028 +:1003940020E2F8012693C0D0E1CFACBF9BBF8FBF52 +:1003A40009911991299139914991599169917991B9 +:1003B4000990199029903990E991F991899199912D +:1003C400A9910895AA939A938A93FA93EA933A92F5 +:1003D4002A921A920A927A936A935A934A933A9374 +:1003E4002A931A930A938FB79BB7ACB7089500E08A +:1003F4001AC08A932051304041F02051304039F0E6 +:100404002052304031F080E005C081E003C082E03A +:1004140001C083E0EDDF20E0F801218326E02083A2 +:100424008064818335CF68EB79E2202F2F70220F0F +:10043400402F440F57DF001F020F43E01E94A20019 +:10044400060F171F08959D01E8EC24D00F7D00834B +:1004540000810F7D00833BD102E00593A2ECB9E259 +:1004640041DF0D930C93539600E2069300E4069348 +:1004740038D1069300E406931D931D931C931196A3 +:100484001D931D931C9317971D931C9310A7D901BB +:100494000895E0ECF4E000810895FFD0002331F0EA +:1004A400033011F0043009F41FD176D029D006812D +:1004B4001781083050E0104009F548E022EE39E297 +:1004C4000AEC19E21E94E800E8ECF4E01CD01BD01E +:1004D4001E94DB05002309F4E6C012D0068907FF49 +:1004E40004C014D002E004A717C0048D158D012B9D +:1004F40009F405C00BD001E004A7EFD00895DFC0D4 +:10050400E4EBF9E2089500810062E4CE00E000A784 +:1005140001A702A703A70895BCD0033011F43BD070 +:1005240037C083D080A191A1801B910B282F292B48 +:10053400A9F47FD0048D158D0217130719F005A5B2 +:10054400002311F0C7D024C080D081F07BD071F09B +:1005540000E0FD0102A703A780A191A1803400E07F +:10056400900720F080E490E005A703C001E0009329 +:10057400E129FD0186879787068D178D22A533A56E +:10058400020F131F008B118B89014AD0A0D0A6D073 +:10059400E4E01C946600A8D056CF7BD0043011F45C +:1005A400FADF3DC0FD018681978162A573A520A174 +:1005B40031A18B01080F191F2017310718F4C90145 +:1005C400861B970BAC0122EE39E2068D178D060FC0 +:1005D400171F1E94E80029D023D08034904031F4B2 +:1005E4002CD0448D558D2417350740F000A311A35A +:1005F4002CD011F027D059F062D011C020A131A124 +:100604002017310759F421D011F01CD011F44BD02C +:1006140006C00BD00ED000E002A703A75ED0B8CF6F +:10062400080F191F02A713A70895FD0102A513A51A +:10063400089503D020A731A7089520A531A5200F40 +:10064400311F089559D00023089545A156A167A1EB +:1006540000E0403050076007089522D001FD09C032 +:1006640009D039F41AD0013009F449CF043009F41F +:100674001DD008955ED0E7CF13D001FD09C0FADF85 +:1006840039F40BD0023009F425C0033009F40ED03C +:1006940008951E947B00A4EBB9E20091E02908952B +:1006A4000091CC04089505E00093E029E1ECF9E21F +:1006B40004E00593E9EBF9E204E00593089520DFF3 +:1006C40003E004A700E00687078701D007C0E0EC39 +:1006D400F9E2089504E00093E02903D002E00693D0 +:1006E4000895E8EBF9E208950BDF42A153A164A158 +:1006F400AFDF09F001D00895FA016CBF1994EBEC57 +:10070400C9DE02FF08C0F093CA040091C02906FFA5 +:100714000BC0A3DF09C0008101FF07C002E006D0BF +:100724000091B82906FDA8DF16C0B4CD0093CA0411 +:100734000895B6DF00FFAECD01E00093CC04D1DF15 +:1007440000E80693C4DF00E8069301E0EFDFC9DFA9 +:1007540000E10693A2DE01E00895BD014DD126819A +:10076400222371F1A281B3812D913C91D901149678 +:100774004C91041728F524833583D90112964D91A1 +:100784005C91240F351F06C04C9150E0A40FB51F97 +:10079400A483B583A481B581A217B30788F4119605 +:1007A4004C911197443081F712964C91129704178B +:1007B40059F713964C911397141731F701E001C0C0 +:1007C40000E0DB0108953DD0802F10E0E8D111F462 +:1007D40000E006C015D0038114812581D5D101E044 +:1007E4004DC02FD0802FDBD149F00AD00081118178 +:1007F4002281CAD1002311F001E001C000E03EC013 +:10080400AEE4B1E2ED91FC91A281B38102E0809F5C +:10081400A00DB11DED91FC9108951C94120111D00D +:100824000DD139F080E003C0082FCDDF839509D1C5 +:10083400D8F300E00093522101E010E00D931C93E3 +:100844001DC01C947B00A3D1C9F080E00EC0FD0143 +:1008540018D044855585668500E040305007600710 +:1008640019F0FA016CBF19958395C6D0A281B381A2 +:10087400ED91FC9111970481801748F3E4E01C94F6 +:1008840066000281138177D10081F181E02F089500 +:100894000091CC290F771C946E010091CC29002380 +:1008A40029F00A9541F00A9511F125C024E030E0C1 +:1008B40006E011E21AC025E00EEE10E240E050E03E +:1008C40032E0F801E40FF51F6081439FF001E65325 +:1008D400FF4D628353834395421798F3220F2E5F93 +:1008E4002093CA2030E00AEC10E2A6D005C021E132 +:1008F40004EF10E2E3CF7CC101E0089574D0FD0160 +:100904004281238104E411E22A9529F02A95A1F079 +:100914002A9551F12CC02DD0208130E0F8010081BE +:1009240011818AD065D0228533850217130710F40C +:100934000287138701E054C01CD021894217B8F400 +:10094400F801F9D024E0429F000D111DF801008147 +:100954001181F801228133816FD022E0FD010085ED +:10096400F185E02F2183DECF98DF0023D9F600E064 +:10097400E2CFF8012081F181E22F089534D038D0FC +:10098400012B59F51E947101002339F1E4E4F1E2DD +:100994007BDF2189FD0102812017F8F040DFFD0192 +:1009A400028100935221209152212223C1F0E4E4D8 +:1009B400F1E2C1D034E0239F000D111D045010401A +:1009C4001BD002831383A0E001C0A395EAD0A01733 +:1009D40030F410E04ED00023C1F700E001C001E084 +:1009E400A991B9910895BA93AA93AAECB9E208958A +:1009F400FD01068117810895ECE4F1E2089521DFF9 +:100A040093D0068117810130104039F417D029F0B2 +:100A1400848117D010F4C1D011F400E00CC0FD01A2 +:100A2400A7D02FDFAED00093532121E030E01796FA +:100A34008D0102D001E022CF1C947701ACE4B1E235 +:100A4400A8C0FD01B0D080170895AA938A936CD0F2 +:100A54006ED041F49ED031F0A48182810A2FB3DE9E +:100A6400002311F400E002C0182F03D08991A9914A +:100A740008950A2FB6CE58D0008107FF2DC02681D5 +:100A84003781022F032B09F447C000810F71F1F461 +:100A94001181112329F0165069F0125061F016C02B +:100AA400223000E0304009F0089522E030E00CE408 +:100AB40011E20AC023CF213000E0304009F008954C +:100AC40021E030E002E511E2B7DF16CF013021F575 +:100AD40001810A3009F593CF0F7101F511811A953F +:100AE40081F01250C9F0125019F01450B1F016C030 +:100AF4001ED091F40AE414E022E0048715872687C7 +:100B0400E4CF15D049F417D00130104029F474DF34 +:100B140000810D7F0083D9CF6BC030CF0130E1F766 +:100B240001810B30C9F791CFEAECF9E2089506810F +:100B34001781012B089502811381089528D091F023 +:100B44008091CE292ED0801768F427D059F054DF35 +:100B54000FD0F1DF10D0A081B181FD0112D0102F90 +:100B64001DD011F400E003C043DF20850DD086CEF4 +:100B74000281F3818BCE22E0829F000D111DF801CA +:100B84000895018512852385F8012CBF19941E94BC +:100B94007B00009152210023089510E0082FDDDD31 +:100BA400FACFECE4F1E2E4DF0081F181E02F04818B +:100BB4000895BADF00E00287038704870587068764 +:100BC4000787008B018B008107FF02C0B0DF81F033 +:100BD4000091CA29007619F44EDF002341F40091F4 +:100BE400CA290F71013021F4A9DF002309F084CE52 +:100BF40000E0089500E000936F2152D01E94460A4D +:100C04001E94550AD2C00895BA93AA93AAECB9E2E5 +:100C14000091CA2900760032F9F51091CB290C9184 +:100C240007FF17C0125041F01A9599F526E030E0FD +:100C34000EE511E25ED12BC0F8D0408D518D628D4E +:100C440000E040305007600721F1FA016CBF1995AC +:100C540024C01A9521F01350E1F422D018C0009159 +:100C64006F21002341F000E01E947B0A0CE61AE099 +:100C740022E01C9609C020E430E002E711E239D1F9 +:100C840001E616E022E01F960D931D932C9301E0DC +:100C940004C0CBD00FE064D000E0A991B9910895CD +:100CA40002C000E0089500E0E1D0EAECF9E200E0DF +:100CB4000787008B018B0487058706870895F0DF7B +:100CC40000E0B3D0008F018F028F01E01E947B0AF5 +:100CD400E2E7F1E230812181203001E0300709F4BC +:100CE40020C0203003E0300709F43DC02130300734 +:100CF40009F453C0203004E0300739F41E945D0A2F +:100D0400002300E009F4089550C02330300721F493 +:100D140001E000936F2108952330364009F452C056 +:100D2400C0CF83D0048D158D012309F09CC0478169 +:100D34005085618540305040604011F410D002C0AD +:100D440027D009F4AECF20E038E0D1D002EF17E08D +:100D540022E0EAECF9E20787108B218B28C003E03C +:100D640002870AE0AACF14D019F023D011F4F7DFD8 +:100D740098CF048D158D012321F005E317E022E0BF +:100D840003C00EE617E022E0008F118F228F0FC000 +:100D940004E711E271D000230895FADF19F009D0B5 +:100DA40011F4DDDF7ECFA7D002C00093702101E0F3 +:100DB4000895E4E5F1E24481558166814030504074 +:100DC400604008952497E2E7F1E203811281112340 +:100DD40019F01A9559F026C00131F0F429D000E039 +:100DE40024D0008B018B028B038B1CC040E0488312 +:100DF40049834A834B830B8304810A8316D0088179 +:100E040019812A813B814081518162817381041758 +:100E140015072607370728F008D008E0A1DF00E00F +:100E240002C0CFD001E024960895E4E5F1E20895EC +:100E3400033041F0023031F0043021F0053011F07C +:100E440011E001C010E01093712112E0019FF00144 +:100E5400E955FF4D6081F18104E511E2E62F4AE096 +:100E640050E01C94800003E001D01BCF00935E216E +:100E740002E00093622108951E947A00A4E5B1E291 +:100E8400FD0122893389F80150814180FD01408AA6 +:100E9400518BF801128103810D901D902D903C908F +:100EA4001397001511052205330540F008E000935F +:100EB4005E210AE00093622100E00BC00419150BC7 +:100EC400220B330B66D0FD01048B158B268B378BDD +:100ED40001E0E5E01C946500A8DF2488358964D02E +:100EE400222D6CD0A2DF2489358901D060CF02EB9A +:100EF40011E21C9477011E947B00A4E5B1E24ED06C +:100F0400012B022B032B49F400E018EF048B158B03 +:100F1400068B078B80E098E01BC040D0402F412B0C +:100F2400422B432B99F1003048E0140780E0204025 +:100F3400304010F4C80101C098E0A801668977899F +:100F4400481B590B60407040448B558B668B778BE4 +:100F5400392F2AD0282F32D042EB51E204C0FD01B0 +:100F640058D017D02ED08C010197012BB1F2FA0181 +:100F74000191AF010F3F99F305E000935E2108EE64 +:100F840017E022E0FD01008F118F228FE4E01C9412 +:100F940066000F5F1F4F2F4F3F4F0895FD010489D7 +:100FA4001589268937890895408951896289738909 +:100FB400048115812681F8012CBF089502EB11E20A +:100FC4001994008B118B228B338B08952EDF0089AB +:100FD40041894093B2210093B32122E030E085CFD0 +:100FE40024DF17D064897589402F4F73042E112490 +:100FF40042EB51E2400D511D078010842184F00121 +:101004002CBE199500E0EAECF9E20787008B018B0E +:10101400CECE00891189228933890895B901B2D0CD +:10102400208127FDFDCFECEC208128602083105F18 +:1010340098018B011E94E800ECECF1E00081077F3D +:10104400008308951E947B00C801A22FB091CA01A9 +:101054003AD098D0008107FDFDCF82D09093C10192 +:101064008093C001A093C40105E337D0B093CA01B3 +:10107400E4E01C9466001E947900C801D9012A0199 +:101084000DC08D0134D045E08C011E949C004AD0E3 +:101094008096909600EE400E0FEF501E042D052909 +:1010A40079F0082F0F7129F400E2401600E0500691 +:1010B40040F72D918C01C6DF01960FEF400EEDCF66 +:1010C400E6E01C9464005ED0008107FDFDCF008142 +:1010D40001FF02C006E301D008950093CA0121E094 +:1010E4000BEC11E01C9495003093CA0108953091E3 +:1010F400CA012091CF0127FDFCCF0BD02093C00162 +:10110400F80141918F014093C40123952032B0F33B +:10111400EBCF23E32093CA0120E02093C201209364 +:10112400C10108952ED0108117FDFDCFDAD005E35B +:1011340021C09A938A93802F9091CA01C4DF46D02C +:1011440007FDFDCF0DD00093C10111D08093C401E0 +:1011540003950032D0F39093CA018991999108952F +:1011640003E30093CA0100E00093C20108950093D1 +:10117400C00108950093CA01B2DF8093CA01899126 +:1011840008958A93EFECF1E00895FBDF008107FDF9 +:10119400FDCFB0D000E3EECF01D0F7CF0FEFC9CF32 +:1011A4001E947B00DA01CB01A801622F0FD007FD4A +:1011B400FDCF082F092B49F0FA016BBF06910D935F +:1011C4004F5F5F4F6F4F0197F4CF52CF0091CF0124 +:1011D40008951E946F0022974A015B01280139018A +:1011E4001170802F952DD901801B910BA040B04028 +:1011F400CA8807C0EBDF07FDFDCF45E2002D1E9432 +:101204002E000A2D0B2909F455C0DD24DFDF07FD6C +:10121400FDCFEE24FF24F394CC2071F0FC01ABBF8E +:1012240007911691088319832881312F2F3F3F4F4F +:1012340031F0DD24D39403C00FEF088309830A2D12 +:101244000B29C9F0481659066A067B0631F43BD0CF +:10125400088334D00A2D0B2971F08C019D010F5F96 +:101264001F4F2F4F3F4F401651066206730619F465 +:101274002AD0098323D0488159818C019D011E9471 +:101284001C008E5F9F4FAF4FBF4F0FEFE00EF01E5D +:101294000E2D0F2909F68C019D01005012402040AB +:1012A4003040DD20002E09F0A5CF90DF07FDFDCFF3 +:1012B40044E2A4CF2296E1E11C945A0001E0800E9E +:1012C40000E0901E08950FEFA00EB01E05D0601E22 +:1012D400701EF4010081089501E0400E00E0501EEC +:1012E400089510E2019F00E00093C2011092C10131 +:1012F4000092C0018091CA0108950FBF089508307B +:1013040049F01FB7F894E0E5F0E02081202B20831A +:10131400012F72D008958A938FB7F8940A9519F023 +:101324000A9559F023C0183019F424D0016002C082 +:1013340023D00E7F0083E8E616C01ED0097F008309 +:10134400183019F417D002600CC0143011F4008165 +:1013540008C01F3F39F400E807870BEB008B0081BE +:1013640004600083E0E6008101600083082F44D01C +:101374008991089504E0C3DFE6E5F0E00081089573 +:101384002497E0E7F0E007E01FEF11930A95E9F7EF +:1013940024E001E44AD02CE124D009832DE121D0BA +:1013A400088319810F3F1F4F21F400E413E20883DF +:1013B4001983088119810A831B830A8100936200BF +:1013C4000B810093630034D021E000E42ED00FB7EA +:1013D400F894E0E5F0E010811E7F10830DD0249690 +:1013E400089530E002E01C948B004FB7F8941095F8 +:1013F40004D001230083042F80CFF0E0E02FE059D4 +:10140400FF4FBCCF8A93063011F488E101C080E01D +:101414000091510001FB0EF00BD08360282F04E4EF +:1014240004D010E400E0E1DFA3CF10E01C949500A9 +:1014340002E065DF0091510001FBE6F71FEF02E0D7 +:101444006ACF0A011B01B901A801800191011C9412 +:10145400D208E1E0EA931C94EB080A01A90198017F +:1014640080011C9410089A01AB011C943D080A01E8 +:10147400A90122E730E2200D311D1C94E8000A0185 +:10148400A90128E431E2F7CFE8E4F1E20091900009 +:1014940000830091910001830091920002830091E6 +:1014A400930003830895E0EDF1E0008101FB00E087 +:1014B40000F90F2708950091CF0107FDFCCF40E20A +:1014C40000E010E020E030E01E942E001E94CE08D0 +:1014D40001E00895F8940AEA15E5E0E0F0E20083FB +:1014E400118320917900216009E710E01E94950092 +:1014F400FFCF089527E402EA10E01E9495001E949D +:10150400C20978941E940F041E944E01FFCFDA088A +:101514004821000000D600722020150404000000B9 +:10152400000400230A022B0A02001000002F0A0202 +:10153400350A0203000000390A020000000400001A +:1015440000410A020000000000000000000000004A +:101554000075207F209D209D20892093209D209D23 +:10156400209D209D209D209D209D209D209D209D8F +:10157400209D200000030000000000000000000087 +:101584000000000000000000000000000000000057 +:10159400000000000000000041544D454C0044464A +:1015A40055204154584D4547413235364133550055 +:1015B40004030904FC05020506020606025306029A +:1015C400000000001201000200000040EB03EC2FB9 +:1015D40004000102000109021200010100C03209E5 +:1015E40004000000FF0000000A212C213E211A21E2 +:0215F400402194 +:0400000340000000B9 +:00000001FF diff --git a/DSTAT/config.mk b/config.mk similarity index 92% rename from DSTAT/config.mk rename to config.mk index 62f7e4aa225eaeaf7f46a581fb553659e3314821..d18ee5d68da80e9b333cf67975b5c6eac7e87a6a 100644 --- a/DSTAT/config.mk +++ b/config.mk @@ -48,6 +48,11 @@ AVRDUDE_DEV = x256a3u AVRDUDE_PROG = avrispmkII AVRDUDE_PORT = usb +# Board Settings +BOARD_VER_MAJOR = 1 +BOARD_VER_MINOR = 2 +BOARD_VER_MICRO = 3 + # Application target name. Given with suffix .a for library and .elf for a # standalone application. TARGET = dstat-firmware.elf @@ -104,11 +109,14 @@ CFLAGS = CPPFLAGS = \ -D BOARD=USER_BOARD \ -D IOPORT_XMEGA_COMPAT \ - -D F_CPU=$(F_CPU)UL + -D F_CPU=$(F_CPU)UL \ + -D BOARD_VER_MAJOR=$(BOARD_VER_MAJOR) \ + -D BOARD_VER_MINOR=$(BOARD_VER_MINOR) \ + -D BOARD_VER_MICRO=$(BOARD_VER_MICRO) # Extra flags to use when linking LDFLAGS = -Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt # Pre- and post-build commands PREBUILD_CMD = -POSTBUILD_CMD = \ No newline at end of file +POSTBUILD_CMD = diff --git a/DSTAT/doxyfile b/doxyfile similarity index 100% rename from DSTAT/doxyfile rename to doxyfile diff --git a/DSTAT/src/ads1255.c b/src/ads1255.c similarity index 100% rename from DSTAT/src/ads1255.c rename to src/ads1255.c diff --git a/DSTAT/src/ads1255.h b/src/ads1255.h similarity index 100% rename from DSTAT/src/ads1255.h rename to src/ads1255.h diff --git a/DSTAT/src/asf.h b/src/asf.h similarity index 100% rename from DSTAT/src/asf.h rename to src/asf.h diff --git a/DSTAT/src/asf/common/boards/board.h b/src/asf/common/boards/board.h similarity index 100% rename from DSTAT/src/asf/common/boards/board.h rename to src/asf/common/boards/board.h diff --git a/DSTAT/src/asf/common/boards/user_board/init.c b/src/asf/common/boards/user_board/init.c similarity index 100% rename from DSTAT/src/asf/common/boards/user_board/init.c rename to src/asf/common/boards/user_board/init.c diff --git a/DSTAT/src/asf/common/boards/user_board/user_board.h b/src/asf/common/boards/user_board/user_board.h similarity index 100% rename from DSTAT/src/asf/common/boards/user_board/user_board.h rename to src/asf/common/boards/user_board/user_board.h diff --git a/DSTAT/src/asf/common/drivers/nvm/common_nvm.h b/src/asf/common/drivers/nvm/common_nvm.h similarity index 100% rename from DSTAT/src/asf/common/drivers/nvm/common_nvm.h rename to src/asf/common/drivers/nvm/common_nvm.h diff --git a/DSTAT/src/asf/common/drivers/nvm/xmega/xmega_nvm.c b/src/asf/common/drivers/nvm/xmega/xmega_nvm.c similarity index 100% rename from DSTAT/src/asf/common/drivers/nvm/xmega/xmega_nvm.c rename to src/asf/common/drivers/nvm/xmega/xmega_nvm.c diff --git a/DSTAT/src/asf/common/services/clock/genclk.h b/src/asf/common/services/clock/genclk.h similarity index 100% rename from DSTAT/src/asf/common/services/clock/genclk.h rename to src/asf/common/services/clock/genclk.h diff --git a/DSTAT/src/asf/common/services/clock/osc.h b/src/asf/common/services/clock/osc.h similarity index 100% rename from DSTAT/src/asf/common/services/clock/osc.h rename to src/asf/common/services/clock/osc.h diff --git a/DSTAT/src/asf/common/services/clock/pll.h b/src/asf/common/services/clock/pll.h similarity index 100% rename from DSTAT/src/asf/common/services/clock/pll.h rename to src/asf/common/services/clock/pll.h diff --git a/DSTAT/src/asf/common/services/clock/sysclk.h b/src/asf/common/services/clock/sysclk.h similarity index 100% rename from DSTAT/src/asf/common/services/clock/sysclk.h rename to src/asf/common/services/clock/sysclk.h diff --git a/DSTAT/src/asf/common/services/clock/xmega/osc.h b/src/asf/common/services/clock/xmega/osc.h similarity index 100% rename from DSTAT/src/asf/common/services/clock/xmega/osc.h rename to src/asf/common/services/clock/xmega/osc.h diff --git a/DSTAT/src/asf/common/services/clock/xmega/pll.h b/src/asf/common/services/clock/xmega/pll.h similarity index 100% rename from DSTAT/src/asf/common/services/clock/xmega/pll.h rename to src/asf/common/services/clock/xmega/pll.h diff --git a/DSTAT/src/asf/common/services/clock/xmega/sysclk.c b/src/asf/common/services/clock/xmega/sysclk.c similarity index 100% rename from DSTAT/src/asf/common/services/clock/xmega/sysclk.c rename to src/asf/common/services/clock/xmega/sysclk.c diff --git a/DSTAT/src/asf/common/services/clock/xmega/sysclk.h b/src/asf/common/services/clock/xmega/sysclk.h similarity index 100% rename from DSTAT/src/asf/common/services/clock/xmega/sysclk.h rename to src/asf/common/services/clock/xmega/sysclk.h diff --git a/DSTAT/src/asf/common/services/delay/delay.h b/src/asf/common/services/delay/delay.h similarity index 100% rename from DSTAT/src/asf/common/services/delay/delay.h rename to src/asf/common/services/delay/delay.h diff --git a/DSTAT/src/asf/common/services/delay/xmega/cycle_counter.h b/src/asf/common/services/delay/xmega/cycle_counter.h similarity index 100% rename from DSTAT/src/asf/common/services/delay/xmega/cycle_counter.h rename to src/asf/common/services/delay/xmega/cycle_counter.h diff --git a/DSTAT/src/asf/common/services/hugemem/avr8/avr8_hugemem.c b/src/asf/common/services/hugemem/avr8/avr8_hugemem.c similarity index 100% rename from DSTAT/src/asf/common/services/hugemem/avr8/avr8_hugemem.c rename to src/asf/common/services/hugemem/avr8/avr8_hugemem.c diff --git a/DSTAT/src/asf/common/services/hugemem/avr8/hugemem.h b/src/asf/common/services/hugemem/avr8/hugemem.h similarity index 100% rename from DSTAT/src/asf/common/services/hugemem/avr8/hugemem.h rename to src/asf/common/services/hugemem/avr8/hugemem.h diff --git a/DSTAT/src/asf/common/services/hugemem/generic/hugemem.h b/src/asf/common/services/hugemem/generic/hugemem.h similarity index 100% rename from DSTAT/src/asf/common/services/hugemem/generic/hugemem.h rename to src/asf/common/services/hugemem/generic/hugemem.h diff --git a/DSTAT/src/asf/common/services/hugemem/hugemem.h b/src/asf/common/services/hugemem/hugemem.h similarity index 100% rename from DSTAT/src/asf/common/services/hugemem/hugemem.h rename to src/asf/common/services/hugemem/hugemem.h diff --git a/DSTAT/src/asf/common/services/ioport/ioport.h b/src/asf/common/services/ioport/ioport.h similarity index 100% rename from DSTAT/src/asf/common/services/ioport/ioport.h rename to src/asf/common/services/ioport/ioport.h diff --git a/DSTAT/src/asf/common/services/ioport/xmega/ioport.h b/src/asf/common/services/ioport/xmega/ioport.h similarity index 100% rename from DSTAT/src/asf/common/services/ioport/xmega/ioport.h rename to src/asf/common/services/ioport/xmega/ioport.h diff --git a/DSTAT/src/asf/common/services/ioport/xmega/ioport_compat.c b/src/asf/common/services/ioport/xmega/ioport_compat.c similarity index 100% rename from DSTAT/src/asf/common/services/ioport/xmega/ioport_compat.c rename to src/asf/common/services/ioport/xmega/ioport_compat.c diff --git a/DSTAT/src/asf/common/services/ioport/xmega/ioport_compat.h b/src/asf/common/services/ioport/xmega/ioport_compat.h similarity index 100% rename from DSTAT/src/asf/common/services/ioport/xmega/ioport_compat.h rename to src/asf/common/services/ioport/xmega/ioport_compat.h diff --git a/DSTAT/src/asf/common/services/sleepmgr/sleepmgr.h b/src/asf/common/services/sleepmgr/sleepmgr.h similarity index 100% rename from DSTAT/src/asf/common/services/sleepmgr/sleepmgr.h rename to src/asf/common/services/sleepmgr/sleepmgr.h diff --git a/DSTAT/src/asf/common/services/sleepmgr/xmega/sleepmgr.c b/src/asf/common/services/sleepmgr/xmega/sleepmgr.c similarity index 100% rename from DSTAT/src/asf/common/services/sleepmgr/xmega/sleepmgr.c rename to src/asf/common/services/sleepmgr/xmega/sleepmgr.c diff --git a/DSTAT/src/asf/common/services/sleepmgr/xmega/sleepmgr.h b/src/asf/common/services/sleepmgr/xmega/sleepmgr.h similarity index 100% rename from DSTAT/src/asf/common/services/sleepmgr/xmega/sleepmgr.h rename to src/asf/common/services/sleepmgr/xmega/sleepmgr.h diff --git a/DSTAT/src/asf/common/services/spi/usart_spi.h b/src/asf/common/services/spi/usart_spi.h similarity index 100% rename from DSTAT/src/asf/common/services/spi/usart_spi.h rename to src/asf/common/services/spi/usart_spi.h diff --git a/DSTAT/src/asf/common/services/spi/xmega_usart_spi/usart_spi.c b/src/asf/common/services/spi/xmega_usart_spi/usart_spi.c similarity index 100% rename from DSTAT/src/asf/common/services/spi/xmega_usart_spi/usart_spi.c rename to src/asf/common/services/spi/xmega_usart_spi/usart_spi.c diff --git a/DSTAT/src/asf/common/services/spi/xmega_usart_spi/usart_spi.h b/src/asf/common/services/spi/xmega_usart_spi/usart_spi.h similarity index 100% rename from DSTAT/src/asf/common/services/spi/xmega_usart_spi/usart_spi.h rename to src/asf/common/services/spi/xmega_usart_spi/usart_spi.h diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_0/doxyfile.doxygen b/src/asf/common/services/twi/doxygen/common.services.basic.twi_0/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_0/doxyfile.doxygen rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_0/doxyfile.doxygen diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_0/doxygen_module_mainpage.h b/src/asf/common/services/twi/doxygen/common.services.basic.twi_0/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_0/doxygen_module_mainpage.h rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_0/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_1/doxyfile.doxygen b/src/asf/common/services/twi/doxygen/common.services.basic.twi_1/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_1/doxyfile.doxygen rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_1/doxyfile.doxygen diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_1/doxygen_module_mainpage.h b/src/asf/common/services/twi/doxygen/common.services.basic.twi_1/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_1/doxygen_module_mainpage.h rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_1/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_2/doxyfile.doxygen b/src/asf/common/services/twi/doxygen/common.services.basic.twi_2/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_2/doxyfile.doxygen rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_2/doxyfile.doxygen diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_2/doxygen_module_mainpage.h b/src/asf/common/services/twi/doxygen/common.services.basic.twi_2/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_2/doxygen_module_mainpage.h rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_2/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_3/doxyfile.doxygen b/src/asf/common/services/twi/doxygen/common.services.basic.twi_3/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_3/doxyfile.doxygen rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_3/doxyfile.doxygen diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_3/doxygen_module_mainpage.h b/src/asf/common/services/twi/doxygen/common.services.basic.twi_3/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_3/doxygen_module_mainpage.h rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_3/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_4/doxyfile.doxygen b/src/asf/common/services/twi/doxygen/common.services.basic.twi_4/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_4/doxyfile.doxygen rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_4/doxyfile.doxygen diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_4/doxygen_module_mainpage.h b/src/asf/common/services/twi/doxygen/common.services.basic.twi_4/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_4/doxygen_module_mainpage.h rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_4/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_5/doxyfile.doxygen b/src/asf/common/services/twi/doxygen/common.services.basic.twi_5/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_5/doxyfile.doxygen rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_5/doxyfile.doxygen diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_5/doxygen_module_mainpage.h b/src/asf/common/services/twi/doxygen/common.services.basic.twi_5/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twi_5/doxygen_module_mainpage.h rename to src/asf/common/services/twi/doxygen/common.services.basic.twi_5/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twihs_0/doxyfile.doxygen b/src/asf/common/services/twi/doxygen/common.services.basic.twihs_0/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twihs_0/doxyfile.doxygen rename to src/asf/common/services/twi/doxygen/common.services.basic.twihs_0/doxyfile.doxygen diff --git a/DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twihs_0/doxygen_module_mainpage.h b/src/asf/common/services/twi/doxygen/common.services.basic.twihs_0/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/doxygen/common.services.basic.twihs_0/doxygen_module_mainpage.h rename to src/asf/common/services/twi/doxygen/common.services.basic.twihs_0/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/common/services/twi/twi_master.h b/src/asf/common/services/twi/twi_master.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/twi_master.h rename to src/asf/common/services/twi/twi_master.h diff --git a/DSTAT/src/asf/common/services/twi/xmega_twi/twi_master.h b/src/asf/common/services/twi/xmega_twi/twi_master.h similarity index 100% rename from DSTAT/src/asf/common/services/twi/xmega_twi/twi_master.h rename to src/asf/common/services/twi/xmega_twi/twi_master.h diff --git a/DSTAT/src/asf/common/services/usb/class/cdc/device/udi_cdc.c b/src/asf/common/services/usb/class/cdc/device/udi_cdc.c similarity index 100% rename from DSTAT/src/asf/common/services/usb/class/cdc/device/udi_cdc.c rename to src/asf/common/services/usb/class/cdc/device/udi_cdc.c diff --git a/DSTAT/src/asf/common/services/usb/class/cdc/device/udi_cdc.h b/src/asf/common/services/usb/class/cdc/device/udi_cdc.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/class/cdc/device/udi_cdc.h rename to src/asf/common/services/usb/class/cdc/device/udi_cdc.h diff --git a/DSTAT/src/asf/common/services/usb/class/cdc/device/udi_cdc_conf.h b/src/asf/common/services/usb/class/cdc/device/udi_cdc_conf.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/class/cdc/device/udi_cdc_conf.h rename to src/asf/common/services/usb/class/cdc/device/udi_cdc_conf.h diff --git a/DSTAT/src/asf/common/services/usb/class/cdc/device/udi_cdc_desc.c b/src/asf/common/services/usb/class/cdc/device/udi_cdc_desc.c similarity index 100% rename from DSTAT/src/asf/common/services/usb/class/cdc/device/udi_cdc_desc.c rename to src/asf/common/services/usb/class/cdc/device/udi_cdc_desc.c diff --git a/DSTAT/src/asf/common/services/usb/class/cdc/usb_protocol_cdc.h b/src/asf/common/services/usb/class/cdc/usb_protocol_cdc.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/class/cdc/usb_protocol_cdc.h rename to src/asf/common/services/usb/class/cdc/usb_protocol_cdc.h diff --git a/DSTAT/src/asf/common/services/usb/udc/udc.c b/src/asf/common/services/usb/udc/udc.c similarity index 100% rename from DSTAT/src/asf/common/services/usb/udc/udc.c rename to src/asf/common/services/usb/udc/udc.c diff --git a/DSTAT/src/asf/common/services/usb/udc/udc.h b/src/asf/common/services/usb/udc/udc.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/udc/udc.h rename to src/asf/common/services/usb/udc/udc.h diff --git a/DSTAT/src/asf/common/services/usb/udc/udc_desc.h b/src/asf/common/services/usb/udc/udc_desc.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/udc/udc_desc.h rename to src/asf/common/services/usb/udc/udc_desc.h diff --git a/DSTAT/src/asf/common/services/usb/udc/udd.h b/src/asf/common/services/usb/udc/udd.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/udc/udd.h rename to src/asf/common/services/usb/udc/udd.h diff --git a/DSTAT/src/asf/common/services/usb/udc/udi.h b/src/asf/common/services/usb/udc/udi.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/udc/udi.h rename to src/asf/common/services/usb/udc/udi.h diff --git a/DSTAT/src/asf/common/services/usb/usb_atmel.h b/src/asf/common/services/usb/usb_atmel.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/usb_atmel.h rename to src/asf/common/services/usb/usb_atmel.h diff --git a/DSTAT/src/asf/common/services/usb/usb_protocol.h b/src/asf/common/services/usb/usb_protocol.h similarity index 100% rename from DSTAT/src/asf/common/services/usb/usb_protocol.h rename to src/asf/common/services/usb/usb_protocol.h diff --git a/DSTAT/src/asf/common/utils/interrupt.h b/src/asf/common/utils/interrupt.h similarity index 100% rename from DSTAT/src/asf/common/utils/interrupt.h rename to src/asf/common/utils/interrupt.h diff --git a/DSTAT/src/asf/common/utils/interrupt/interrupt_avr8.h b/src/asf/common/utils/interrupt/interrupt_avr8.h similarity index 100% rename from DSTAT/src/asf/common/utils/interrupt/interrupt_avr8.h rename to src/asf/common/utils/interrupt/interrupt_avr8.h diff --git a/DSTAT/src/asf/common/utils/make/Makefile.avr.in b/src/asf/common/utils/make/Makefile.avr.in similarity index 100% rename from DSTAT/src/asf/common/utils/make/Makefile.avr.in rename to src/asf/common/utils/make/Makefile.avr.in diff --git a/DSTAT/src/asf/common/utils/parts.h b/src/asf/common/utils/parts.h similarity index 100% rename from DSTAT/src/asf/common/utils/parts.h rename to src/asf/common/utils/parts.h diff --git a/DSTAT/src/asf/common/utils/stdio/read.c b/src/asf/common/utils/stdio/read.c similarity index 100% rename from DSTAT/src/asf/common/utils/stdio/read.c rename to src/asf/common/utils/stdio/read.c diff --git a/DSTAT/src/asf/common/utils/stdio/stdio_usb/stdio_usb.c b/src/asf/common/utils/stdio/stdio_usb/stdio_usb.c similarity index 100% rename from DSTAT/src/asf/common/utils/stdio/stdio_usb/stdio_usb.c rename to src/asf/common/utils/stdio/stdio_usb/stdio_usb.c diff --git a/DSTAT/src/asf/common/utils/stdio/stdio_usb/stdio_usb.h b/src/asf/common/utils/stdio/stdio_usb/stdio_usb.h similarity index 100% rename from DSTAT/src/asf/common/utils/stdio/stdio_usb/stdio_usb.h rename to src/asf/common/utils/stdio/stdio_usb/stdio_usb.h diff --git a/DSTAT/src/asf/common/utils/stdio/write.c b/src/asf/common/utils/stdio/write.c similarity index 100% rename from DSTAT/src/asf/common/utils/stdio/write.c rename to src/asf/common/utils/stdio/write.c diff --git a/DSTAT/src/asf/xmega/drivers/cpu/ccp.h b/src/asf/xmega/drivers/cpu/ccp.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/cpu/ccp.h rename to src/asf/xmega/drivers/cpu/ccp.h diff --git a/DSTAT/src/asf/xmega/drivers/cpu/ccp.s b/src/asf/xmega/drivers/cpu/ccp.s similarity index 100% rename from DSTAT/src/asf/xmega/drivers/cpu/ccp.s rename to src/asf/xmega/drivers/cpu/ccp.s diff --git a/DSTAT/src/asf/xmega/drivers/cpu/xmega_reset_cause.h b/src/asf/xmega/drivers/cpu/xmega_reset_cause.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/cpu/xmega_reset_cause.h rename to src/asf/xmega/drivers/cpu/xmega_reset_cause.h diff --git a/DSTAT/src/asf/xmega/drivers/dma/dma.c b/src/asf/xmega/drivers/dma/dma.c similarity index 100% rename from DSTAT/src/asf/xmega/drivers/dma/dma.c rename to src/asf/xmega/drivers/dma/dma.c diff --git a/DSTAT/src/asf/xmega/drivers/dma/dma.h b/src/asf/xmega/drivers/dma/dma.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/dma/dma.h rename to src/asf/xmega/drivers/dma/dma.h diff --git a/DSTAT/src/asf/xmega/drivers/nvm/nvm.c b/src/asf/xmega/drivers/nvm/nvm.c similarity index 100% rename from DSTAT/src/asf/xmega/drivers/nvm/nvm.c rename to src/asf/xmega/drivers/nvm/nvm.c diff --git a/DSTAT/src/asf/xmega/drivers/nvm/nvm.h b/src/asf/xmega/drivers/nvm/nvm.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/nvm/nvm.h rename to src/asf/xmega/drivers/nvm/nvm.h diff --git a/DSTAT/src/asf/xmega/drivers/nvm/nvm_asm.s b/src/asf/xmega/drivers/nvm/nvm_asm.s similarity index 100% rename from DSTAT/src/asf/xmega/drivers/nvm/nvm_asm.s rename to src/asf/xmega/drivers/nvm/nvm_asm.s diff --git a/DSTAT/src/asf/xmega/drivers/pmic/pmic.h b/src/asf/xmega/drivers/pmic/pmic.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/pmic/pmic.h rename to src/asf/xmega/drivers/pmic/pmic.h diff --git a/DSTAT/src/asf/xmega/drivers/rtc/rtc.c b/src/asf/xmega/drivers/rtc/rtc.c similarity index 100% rename from DSTAT/src/asf/xmega/drivers/rtc/rtc.c rename to src/asf/xmega/drivers/rtc/rtc.c diff --git a/DSTAT/src/asf/xmega/drivers/rtc/rtc.h b/src/asf/xmega/drivers/rtc/rtc.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/rtc/rtc.h rename to src/asf/xmega/drivers/rtc/rtc.h diff --git a/DSTAT/src/asf/xmega/drivers/sleep/sleep.h b/src/asf/xmega/drivers/sleep/sleep.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/sleep/sleep.h rename to src/asf/xmega/drivers/sleep/sleep.h diff --git a/DSTAT/src/asf/xmega/drivers/tc/tc.c b/src/asf/xmega/drivers/tc/tc.c similarity index 100% rename from DSTAT/src/asf/xmega/drivers/tc/tc.c rename to src/asf/xmega/drivers/tc/tc.c diff --git a/DSTAT/src/asf/xmega/drivers/tc/tc.h b/src/asf/xmega/drivers/tc/tc.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/tc/tc.h rename to src/asf/xmega/drivers/tc/tc.h diff --git a/DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_both/doxyfile.doxygen b/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_both/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_both/doxyfile.doxygen rename to src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_both/doxyfile.doxygen diff --git a/DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_both/doxygen_module_mainpage.h b/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_both/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_both/doxygen_module_mainpage.h rename to src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_both/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_master/doxyfile.doxygen b/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_master/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_master/doxyfile.doxygen rename to src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_master/doxyfile.doxygen diff --git a/DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_master/doxygen_module_mainpage.h b/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_master/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_master/doxygen_module_mainpage.h rename to src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_master/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_slave/doxyfile.doxygen b/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_slave/doxyfile.doxygen similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_slave/doxyfile.doxygen rename to src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_slave/doxyfile.doxygen diff --git a/DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_slave/doxygen_module_mainpage.h b/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_slave/doxygen_module_mainpage.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_slave/doxygen_module_mainpage.h rename to src/asf/xmega/drivers/twi/doxygen/xmega.drivers.twi_slave/doxygen_module_mainpage.h diff --git a/DSTAT/src/asf/xmega/drivers/twi/twi_common.h b/src/asf/xmega/drivers/twi/twi_common.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/twi_common.h rename to src/asf/xmega/drivers/twi/twi_common.h diff --git a/DSTAT/src/asf/xmega/drivers/twi/twim.c b/src/asf/xmega/drivers/twi/twim.c similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/twim.c rename to src/asf/xmega/drivers/twi/twim.c diff --git a/DSTAT/src/asf/xmega/drivers/twi/twim.h b/src/asf/xmega/drivers/twi/twim.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/twi/twim.h rename to src/asf/xmega/drivers/twi/twim.h diff --git a/DSTAT/src/asf/xmega/drivers/usart/usart.c b/src/asf/xmega/drivers/usart/usart.c similarity index 100% rename from DSTAT/src/asf/xmega/drivers/usart/usart.c rename to src/asf/xmega/drivers/usart/usart.c diff --git a/DSTAT/src/asf/xmega/drivers/usart/usart.h b/src/asf/xmega/drivers/usart/usart.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/usart/usart.h rename to src/asf/xmega/drivers/usart/usart.h diff --git a/DSTAT/src/asf/xmega/drivers/usb/usb_device.c b/src/asf/xmega/drivers/usb/usb_device.c similarity index 100% rename from DSTAT/src/asf/xmega/drivers/usb/usb_device.c rename to src/asf/xmega/drivers/usb/usb_device.c diff --git a/DSTAT/src/asf/xmega/drivers/usb/usb_device.h b/src/asf/xmega/drivers/usb/usb_device.h similarity index 100% rename from DSTAT/src/asf/xmega/drivers/usb/usb_device.h rename to src/asf/xmega/drivers/usb/usb_device.h diff --git a/DSTAT/src/asf/xmega/utils/assembler.h b/src/asf/xmega/utils/assembler.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/assembler.h rename to src/asf/xmega/utils/assembler.h diff --git a/DSTAT/src/asf/xmega/utils/assembler/gas.h b/src/asf/xmega/utils/assembler/gas.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/assembler/gas.h rename to src/asf/xmega/utils/assembler/gas.h diff --git a/DSTAT/src/asf/xmega/utils/bit_handling/clz_ctz.h b/src/asf/xmega/utils/bit_handling/clz_ctz.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/bit_handling/clz_ctz.h rename to src/asf/xmega/utils/bit_handling/clz_ctz.h diff --git a/DSTAT/src/asf/xmega/utils/compiler.h b/src/asf/xmega/utils/compiler.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/compiler.h rename to src/asf/xmega/utils/compiler.h diff --git a/DSTAT/src/asf/xmega/utils/preprocessor/mrepeat.h b/src/asf/xmega/utils/preprocessor/mrepeat.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/preprocessor/mrepeat.h rename to src/asf/xmega/utils/preprocessor/mrepeat.h diff --git a/DSTAT/src/asf/xmega/utils/preprocessor/preprocessor.h b/src/asf/xmega/utils/preprocessor/preprocessor.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/preprocessor/preprocessor.h rename to src/asf/xmega/utils/preprocessor/preprocessor.h diff --git a/DSTAT/src/asf/xmega/utils/preprocessor/stringz.h b/src/asf/xmega/utils/preprocessor/stringz.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/preprocessor/stringz.h rename to src/asf/xmega/utils/preprocessor/stringz.h diff --git a/DSTAT/src/asf/xmega/utils/preprocessor/tpaste.h b/src/asf/xmega/utils/preprocessor/tpaste.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/preprocessor/tpaste.h rename to src/asf/xmega/utils/preprocessor/tpaste.h diff --git a/DSTAT/src/asf/xmega/utils/progmem.h b/src/asf/xmega/utils/progmem.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/progmem.h rename to src/asf/xmega/utils/progmem.h diff --git a/DSTAT/src/asf/xmega/utils/status_codes.h b/src/asf/xmega/utils/status_codes.h similarity index 100% rename from DSTAT/src/asf/xmega/utils/status_codes.h rename to src/asf/xmega/utils/status_codes.h diff --git a/DSTAT/src/config/conf_board.h b/src/config/conf_board.h similarity index 60% rename from DSTAT/src/config/conf_board.h rename to src/config/conf_board.h index 4d91caba27facebd8c3a206d7fbf1ce2937b690d..13aaecc5befda25177f686ce392c5dbac0589208 100644 --- a/DSTAT/src/config/conf_board.h +++ b/src/config/conf_board.h @@ -8,9 +8,16 @@ #ifndef CONF_BOARD_H #define CONF_BOARD_H -#define BOARD_VER_MAJOR 1 -#define BOARD_VER_MINOR 2 +#include +#if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3 + #define BOARD_XOSC_HZ 12000000 + #define BOARD_XOSC_TYPE XOSC_TYPE_XTAL + #define BOARD_XOSC_STARTUP_US 1000 + + #define LED1 IOPORT_CREATE_PIN(PORTF,7) + #define LED2 IOPORT_CREATE_PIN(PORTF,6) +#endif // Default Settings (only used if EEPROM is empty) #define SETTINGS_MAX5443_OFFSET 0 diff --git a/DSTAT/src/config/conf_clock.h b/src/config/conf_clock.h similarity index 66% rename from DSTAT/src/config/conf_clock.h rename to src/config/conf_clock.h index 16e2e72cbdfb889406754f9785d7f3c68fc7bfd7..8f6349c685bc39e54b40ecf122e3ee63da354c92 100644 --- a/DSTAT/src/config/conf_clock.h +++ b/src/config/conf_clock.h @@ -43,23 +43,57 @@ #ifndef CONF_CLOCK_H_INCLUDED #define CONF_CLOCK_H_INCLUDED +#include "conf_board.h" + +#if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >= 3 + #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC32MHZ + + #define CONFIG_SYSCLK_PSADIV SYSCLK_PSADIV_1 + #define CONFIG_SYSCLK_PSBCDIV SYSCLK_PSBCDIV_1_1 + + #define CONFIG_PLL0_SOURCE PLL_SRC_XOSC + + #define CONFIG_PLL0_MUL 48000000 / BOARD_XOSC_HZ + #define CONFIG_PLL0_DIV 1 + + #define CONFIG_XOSC_RANGE XOSC_RANGE_12TO16 + + #define CONFIG_OSC_AUTOCAL_RC32MHZ_REF_OSC OSC_ID_RC32KHZ + + #define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL +#else + #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLL + + #define CONFIG_SYSCLK_PSADIV SYSCLK_PSADIV_1 + #define CONFIG_SYSCLK_PSBCDIV SYSCLK_PSBCDIV_1_1 + + #define CONFIG_PLL0_SOURCE PLL_SRC_RC2MHZ + #define CONFIG_PLL0_MUL 16 + #define CONFIG_PLL0_DIV 1 + + #define CONFIG_USBCLK_SOURCE USBCLK_SRC_RCOSC + #define CONFIG_OSC_RC32_CAL 48000000UL + #define CONFIG_OSC_AUTOCAL_RC32MHZ_REF_OSC OSC_ID_USBSOF +#endif + //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC2MHZ //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC32MHZ //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC32KHZ //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_XOSC -#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLL +//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLL /* Fbus = Fsys / (2 ^ BUS_div) */ -#define CONFIG_SYSCLK_PSADIV SYSCLK_PSADIV_1 -#define CONFIG_SYSCLK_PSBCDIV SYSCLK_PSBCDIV_1_1 +//#define CONFIG_SYSCLK_PSADIV SYSCLK_PSADIV_1 +//#define CONFIG_SYSCLK_PSBCDIV SYSCLK_PSBCDIV_1_1 //#define CONFIG_PLL0_SOURCE PLL_SRC_XOSC -#define CONFIG_PLL0_SOURCE PLL_SRC_RC2MHZ +//#define CONFIG_PLL0_SOURCE PLL_SRC_RC2MHZ //#define CONFIG_PLL0_SOURCE PLL_SRC_RC32MHZ /* Fpll = (Fclk * PLL_mul) / PLL_div */ -#define CONFIG_PLL0_MUL 16 -#define CONFIG_PLL0_DIV 1 +//#define CONFIG_PLL0_MUL 4 +//#define CONFIG_PLL0_DIV 1 + /* External oscillator frequency range */ /** 0.4 to 2 MHz frequency range */ @@ -72,8 +106,8 @@ //#define CONFIG_XOSC_RANGE XOSC_RANGE_12TO16 /* DFLL autocalibration */ -#define CONFIG_OSC_AUTOCAL_RC2MHZ_REF_OSC OSC_ID_RC32KHZ -//#define CONFIG_OSC_AUTOCAL_RC32MHZ_REF_OSC OSC_ID_XOSC +//#define CONFIG_OSC_AUTOCAL_RC2MHZ_REF_OSC OSC_ID_RC32KHZ +//#define CONFIG_OSC_AUTOCAL_RC32MHZ_REF_OSC OSC_ID_RC32KHZ /* The following example clock configuration definitions can be used in XMEGA * devices that contain a USB controller. It configures the USB controller clock @@ -88,9 +122,9 @@ * alternative clock source (e.g. the internal 2MHz RC Oscillator, multiplied * to a higher frequency via the internal PLL module) must be used instead. */ -#define CONFIG_USBCLK_SOURCE USBCLK_SRC_RCOSC -#define CONFIG_OSC_RC32_CAL 48000000UL -#define CONFIG_OSC_AUTOCAL_RC32MHZ_REF_OSC OSC_ID_USBSOF +//#define CONFIG_USBCLK_SOURCE USBCLK_SRC_RCOSC +//#define CONFIG_OSC_RC32_CAL 48000000UL +//#define CONFIG_OSC_AUTOCAL_RC32MHZ_REF_OSC OSC_ID_USBSOF /* Use to enable and select RTC clock source */ #define CONFIG_RTC_SOURCE SYSCLK_RTCSRC_RCOSC diff --git a/DSTAT/src/config/conf_experiment.h b/src/config/conf_experiment.h similarity index 100% rename from DSTAT/src/config/conf_experiment.h rename to src/config/conf_experiment.h diff --git a/DSTAT/src/config/conf_nvm.h b/src/config/conf_nvm.h similarity index 100% rename from DSTAT/src/config/conf_nvm.h rename to src/config/conf_nvm.h diff --git a/DSTAT/src/config/conf_rtc.h b/src/config/conf_rtc.h similarity index 100% rename from DSTAT/src/config/conf_rtc.h rename to src/config/conf_rtc.h diff --git a/DSTAT/src/config/conf_sleepmgr.h b/src/config/conf_sleepmgr.h similarity index 100% rename from DSTAT/src/config/conf_sleepmgr.h rename to src/config/conf_sleepmgr.h diff --git a/DSTAT/src/config/conf_twim.h b/src/config/conf_twim.h similarity index 100% rename from DSTAT/src/config/conf_twim.h rename to src/config/conf_twim.h diff --git a/DSTAT/src/config/conf_usart_spi.h b/src/config/conf_usart_spi.h similarity index 100% rename from DSTAT/src/config/conf_usart_spi.h rename to src/config/conf_usart_spi.h diff --git a/DSTAT/src/config/conf_usb.h b/src/config/conf_usb.h similarity index 100% rename from DSTAT/src/config/conf_usb.h rename to src/config/conf_usb.h diff --git a/DSTAT/src/experiment.c b/src/experiment.c similarity index 100% rename from DSTAT/src/experiment.c rename to src/experiment.c diff --git a/DSTAT/src/experiment.h b/src/experiment.h similarity index 100% rename from DSTAT/src/experiment.h rename to src/experiment.h diff --git a/DSTAT/src/main.c b/src/main.c similarity index 73% rename from DSTAT/src/main.c rename to src/main.c index d54995e389b546b0f81cb6d5b803f498ddccd778..f8755417b7e2affff448aa6ee92f65b5150414e9 100644 --- a/DSTAT/src/main.c +++ b/src/main.c @@ -13,6 +13,7 @@ #include #include #include +#include "conf_board.h" //Internal function declarations int8_t command_handler(char command); @@ -45,6 +46,12 @@ int8_t command_handler(char command){ printf("T%u.%u.%u.%u\n\r", tcs_data[0], tcs_data[1], tcs_data[2], tcs_data[3]); } break; + + case 'R': //Restart USB + udc_detach(); + delay_ms(100); + udc_attach(); + break; case 'V': //check version printf("V%u.%u\n\r", BOARD_VER_MAJOR, BOARD_VER_MINOR); @@ -59,24 +66,26 @@ int8_t command_handler(char command){ } int main(void){ - + irq_initialize_vectors(); + cpu_irq_enable(); + board_init(); + #if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3 + ioport_set_pin_dir(LED1, IOPORT_DIR_OUTPUT); + ioport_set_pin_dir(LED2, IOPORT_DIR_OUTPUT); + #endif pot_init(); pmic_init(); - irq_initialize_vectors(); - cpu_irq_enable(); - sleepmgr_init(); sysclk_init(); //Disables ALL peripheral clocks D: + rtc_init(); + sleepmgr_init(); sysclk_enable_module(SYSCLK_PORT_GEN, SYSCLK_EVSYS); pmic_set_scheduling(PMIC_SCH_ROUND_ROBIN); - delay_ms(500); - stdio_usb_init(); - stdio_usb_enable(); ads1255_init_pins(); ads1255_init_module(); @@ -100,22 +109,25 @@ int main(void){ settings_read_eeprom(); - - // Wait for application connection - Get 'c', reply 'K', get 'k' - while(1){ - while(getchar() != 'c'); - putchar('#'); - while(getchar() != 'k'); - printf("\n\r"); - break; - } tcs_init(); shutter_init(); + delay_s(1); + udc_detach(); + delay_ms(100); + udc_attach(); + stdio_usb_enable(); + program_loop: + #if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3 + ioport_set_pin_level(LED1, 1); + #endif while(getchar() != '!'); printf ("C\r\n"); + #if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3 + ioport_set_pin_level(LED1, 0); + #endif command_handler(getchar()); goto program_loop; -} \ No newline at end of file +} diff --git a/DSTAT/src/max5443.c b/src/max5443.c similarity index 100% rename from DSTAT/src/max5443.c rename to src/max5443.c diff --git a/DSTAT/src/max5443.h b/src/max5443.h similarity index 100% rename from DSTAT/src/max5443.h rename to src/max5443.h diff --git a/DSTAT/src/settings.c b/src/settings.c similarity index 89% rename from DSTAT/src/settings.c rename to src/settings.c index b6cf2cda75d370522f7894eb6a29e5a04762bb01..ecbfdad41b003435d58315a0664b70f033ec70bb 100644 --- a/DSTAT/src/settings.c +++ b/src/settings.c @@ -9,16 +9,23 @@ #include "settings.h" #include "config/conf_board.h" +#include #define SETTINGS_EEPROM_PARAM_PAGE 0 #define SETTINGS_EEPROM_OFFSET_ADDR SETTINGS_EEPROM_PARAM_PAGE * EEPROM_PAGE_SIZE +void update_firmware(void); + void settings_handler(char command){ switch (command){ case 'D': //Reset defaults settings_restore_defaults(); break; + case 'F': //Update Firmware + update_firmware(); + break; + case 'R': //Read settings from EEPROM settings_read_eeprom(); break; @@ -43,6 +50,19 @@ void settings_handler(char command){ } } +void(* start_bootloader)(void) = (void (*)(void))(BOOT_SECTION_START/2+0x1FC/2); + +void update_firmware(void){ + /** + * Jumps to bootloader to do firmware upgrade + */ + udc_stop(); // Disable USB Stack + cli(); // Disable Interrupts + + EIND = BOOT_SECTION_START>>17; + start_bootloader(); +} + void settings_read_eeprom(void){ printf("#INFO: SETTINGS\n\r"); nvm_eeprom_read_buffer(SETTINGS_EEPROM_OFFSET_ADDR, &settings, EEPROM_PAGE_SIZE); diff --git a/DSTAT/src/settings.h b/src/settings.h similarity index 100% rename from DSTAT/src/settings.h rename to src/settings.h diff --git a/DSTAT/src/shutter.c b/src/shutter.c similarity index 100% rename from DSTAT/src/shutter.c rename to src/shutter.c diff --git a/DSTAT/src/shutter.h b/src/shutter.h similarity index 100% rename from DSTAT/src/shutter.h rename to src/shutter.h diff --git a/DSTAT/src/tcs.c b/src/tcs.c similarity index 100% rename from DSTAT/src/tcs.c rename to src/tcs.c diff --git a/DSTAT/src/tcs.h b/src/tcs.h similarity index 100% rename from DSTAT/src/tcs.h rename to src/tcs.h