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 100%
rename from DSTAT/Makefile
rename to Makefile
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/DSTAT/atxmega256a3u_104.hex b/atxmega256a3u_104.hex
similarity index 100%
rename from DSTAT/atxmega256a3u_104.hex
rename to atxmega256a3u_104.hex
diff --git a/DSTAT/config.mk b/config.mk
similarity index 100%
rename from DSTAT/config.mk
rename to config.mk
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..1bcdf8c340f3b7c07d2ccd018862e7e59bd331f4 100644
--- a/DSTAT/src/config/conf_board.h
+++ b/src/config/conf_board.h
@@ -8,9 +8,20 @@
#ifndef CONF_BOARD_H
#define CONF_BOARD_H
+#include
+
#define BOARD_VER_MAJOR 1
#define BOARD_VER_MINOR 2
+#define BOARD_VER_MICRO 3
+
+#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 90%
rename from DSTAT/src/main.c
rename to src/main.c
index 6a3931b77d4ba65eb510bd5093ca2a56e3ad30a8..6daaa6686dd5473e0bf71ea9e6c4351f505c71a5 100644
--- a/DSTAT/src/main.c
+++ b/src/main.c
@@ -69,6 +69,8 @@ int main(void){
cpu_irq_enable();
board_init();
+ ioport_set_pin_dir(LED1, IOPORT_DIR_OUTPUT);
+ ioport_set_pin_dir(LED2, IOPORT_DIR_OUTPUT);
pot_init();
pmic_init();
@@ -88,6 +90,8 @@ int main(void){
PORTD.INT0MASK = PIN5_bm;
PORTD.INT1MASK = PIN5_bm;
PORTD.INTCTRL = PORT_INT0LVL_OFF_gc | PORT_INT1LVL_OFF_gc;
+
+// PORTCFG.CLKEVOUT = PORTCFG_CLKEVPIN_PIN4_gc | PORTCFG_CLKOUTSEL_CLK1X_gc | PORTCFG_CLKOUT_PD7_gc;
max5443_init_pins();
max5443_init_module();
@@ -124,8 +128,10 @@ int main(void){
stdio_usb_enable();
program_loop:
+ ioport_set_pin_level(LED1, 1);
while(getchar() != '!');
printf ("C\r\n");
+ ioport_set_pin_level(LED1, 0);
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 100%
rename from DSTAT/src/settings.c
rename to src/settings.c
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