Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cproject14
-rw-r--r--.project6
-rw-r--r--.settings/language.settings.xml4
-rw-r--r--.settings/org.eclipse.cdt.core.prefs261
-rw-r--r--ArduinoCorePatches-1.5.7/sam/cores/arduino/Stream.h103
-rw-r--r--ArduinoCorePatches-1.5.7/sam/cores/arduino/UARTClass.cpp142
-rw-r--r--ArduinoCorePatches-1.5.7/sam/cores/arduino/UARTClass.h62
-rw-r--r--ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/CDC.cpp309
-rw-r--r--ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/USBAPI.h222
-rw-r--r--ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/USBCore.cpp884
-rw-r--r--ArduinoCorePatches-1.5.7/sam/system/libsam/source/emac.c808
-rw-r--r--ArduinoCorePatches/sam/arduino_due_x/variant.cpp (renamed from ArduinoCorePatches-1.5.7/sam/variants/arduino_due_x/variant.cpp)0
-rw-r--r--ArduinoCorePatches/sam/cores/arduino/Stream.h8
-rw-r--r--ArduinoCorePatches/sam/cores/arduino/UARTClass.h3
-rw-r--r--ArduinoCorePatches/sam/cores/arduino/USB/CDC.cpp19
-rw-r--r--ArduinoCorePatches/sam/cores/arduino/USB/USBAPI.h3
-rw-r--r--ArduinoCorePatches/sam/cores/arduino/USB/USBCore.cpp19
-rw-r--r--Configuration.h4
-rw-r--r--Release/RepRapFirmware-1.00g-dc42.binbin0 -> 212896 bytes
19 files changed, 201 insertions, 2670 deletions
diff --git a/.cproject b/.cproject
index 2fab03e1..1370b897 100644
--- a/.cproject
+++ b/.cproject
@@ -20,8 +20,7 @@
<tool id="it.baeyens.arduino.tool.sketch.compiler.cpp.2087861045" name="Arduino C++ Compiler" superClass="it.baeyens.arduino.tool.sketch.compiler.cpp">
<option id="it.baeyens.arduino.compiler.cpp.sketch.option.incpath.274618772" name="Include Paths (-I)" superClass="it.baeyens.arduino.compiler.cpp.sketch.option.incpath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/arduino/core}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/arduino/variant}&quot;"/>
- <listOptionValue builtIn="false" value="C:/arduino-1.5.4/hardware/arduino/sam/system/libsam/include"/>
+ <listOptionValue builtIn="false" value="C:/arduino-1.5.8/hardware/arduino/sam/system/libsam/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/network}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/EMAC}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/Lwip}&quot;"/>
@@ -31,14 +30,14 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/SD_HSMCI/utility}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/Wire}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Flash}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/arduino/variant}&quot;"/>
</option>
<inputType id="it.baeyens.arduino.compiler.cpp.sketch.input.1531738210" name="CPP source files" superClass="it.baeyens.arduino.compiler.cpp.sketch.input"/>
</tool>
<tool id="it.baeyens.arduino.tool.compiler.c.993630870" name="Arduino C Compiler" superClass="it.baeyens.arduino.tool.compiler.c">
<option id="it.baeyens.arduino.compiler.c.sketch.option.incpath.1536622716" name="Include Paths (-I)" superClass="it.baeyens.arduino.compiler.c.sketch.option.incpath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/arduino/core}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/arduino/variant}&quot;"/>
- <listOptionValue builtIn="false" value="C:/arduino-1.5.4/hardware/arduino/sam/system/libsam/include"/>
+ <listOptionValue builtIn="false" value="C:/arduino-1.5.8/hardware/arduino/sam/system/libsam/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/network}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/EMAC}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/Lwip}&quot;"/>
@@ -47,6 +46,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/SD_HSMCI}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/SD_HSMCI/utility}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/Libraries/Wire}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RepRapFirmware/arduino/variant}&quot;"/>
</option>
<inputType id="it.baeyens.arduino.compiler.c.sketch.input.1546791595" name="C Source Files" superClass="it.baeyens.arduino.compiler.c.sketch.input"/>
</tool>
@@ -72,6 +72,10 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="refreshScope"/>
+ <storageModule moduleId="refreshScope" versionNumber="2">
+ <configuration configurationName="Release">
+ <resource resourceType="PROJECT" workspacePath="/RepRapFirmware"/>
+ </configuration>
+ </storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>
diff --git a/.project b/.project
index bd59a279..7478a809 100644
--- a/.project
+++ b/.project
@@ -70,15 +70,15 @@
<variableList>
<variable>
<name>ArduinoHardwareLibPath</name>
- <value>file:/C:/Arduino-1.5.4/hardware/arduino/sam/libraries</value>
+ <value>file:/C:/Arduino-1.5.8/hardware/arduino/sam/libraries</value>
</variable>
<variable>
<name>ArduinoPinPath</name>
- <value>file:/C:/Arduino-1.5.4/hardware/arduino/sam/variants</value>
+ <value>file:/C:/Arduino-1.5.8/hardware/arduino/sam/variants</value>
</variable>
<variable>
<name>ArduinoPlatformPath</name>
- <value>file:/C:/Arduino-1.5.4/hardware/arduino/sam</value>
+ <value>file:/C:/Arduino-1.5.8/hardware/arduino/sam</value>
</variable>
</variableList>
</projectDescription>
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index ae07477f..16d0fb79 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -3,11 +3,11 @@
<configuration id="it.baeyens.arduino.core.toolChain.release.674980254" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
- <provider class="it.baeyens.arduino.toolchain.ArduinoLanguageProvider" console="false" env-hash="-837606763" id="it.baeyens.arduino.languageSettingsProvider" keep-relative-paths="false" name="Arduino Compiler Settings" parameter="${COMMAND} -E -P -v -dD ${INPUTS}" prefer-non-shared="true">
+ <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+ <provider class="it.baeyens.arduino.toolchain.ArduinoLanguageProvider" console="false" id="it.baeyens.arduino.languageSettingsProvider" keep-relative-paths="false" name="Arduino Compiler Settings" parameter="${COMMAND} -E -P -v -dD ${INPUTS}" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
- <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project>
diff --git a/.settings/org.eclipse.cdt.core.prefs b/.settings/org.eclipse.cdt.core.prefs
index 61074d14..95df602b 100644
--- a/.settings/org.eclipse.cdt.core.prefs
+++ b/.settings/org.eclipse.cdt.core.prefs
@@ -1,262 +1,301 @@
eclipse.preferences.version=1
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.ARCHIVE_FILE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.ARCHIVE_FILE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.ARCHIVE_FILE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.ARCHIVE_FILE/value=arduino.ar
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.CORE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.BOARD/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.BOARD/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.BOARD/value=SAM_DUE
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.CORE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.CORE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.CORE/value=arduino
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.EXTRA_FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.EXTRA_FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.EXTRA_FLAGS/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.EXTRA_FLAGS/value=-D__SAM3X8E__ -mthumb -DUSB_PID\=${A.BUILD.PID} -DUSB_VID\=${A.BUILD.VID} -DUSBCON
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.F_CPU/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.EXTRA_FLAGS/value=-D__SAM3X8E__ -mthumb ${A.BUILD.USB_FLAGS}
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.F_CPU/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.F_CPU/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.F_CPU/value=84000000L
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.GENERIC.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.GENERIC.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.GENERIC.PATH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.GENERIC.PATH/value=${A.RUNTIME.IDE.PATH}/hardware/tools/g++_arm_none_eabi/arm-none-eabi/bin
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.LDSCRIPT/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.LDSCRIPT/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.LDSCRIPT/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.LDSCRIPT/value=linker_scripts/gcc/flash.ld
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.MCU/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.MCU/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.MCU/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.MCU/value=cortex-m3
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PATH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PATH/value=${ProjDirPath}/${ConfigName}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PID/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PID/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PID/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PID/value=0x003e
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PROJECT_NAME/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PROJECT_NAME/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PROJECT_NAME/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.PROJECT_NAME/value=${ProjName}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.SYSTEM.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.SYSTEM.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.SYSTEM.PATH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.SYSTEM.PATH/value=${A.RUNTIME.IDE.PATH}/hardware/arduino/sam/system
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USE_ARCHIVER/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_FLAGS/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_FLAGS/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_FLAGS/value=-DUSB_VID\=${A.BUILD.VID} -DUSB_PID\=${A.BUILD.PID} -DUSBCON "-DUSB_MANUFACTURER\=${A.BUILD.USB_MANUFACTURER}" "-DUSB_PRODUCT\=\\"${A.BUILD.USB_PRODUCT}\\""
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_MANUFACTURER/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_MANUFACTURER/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_MANUFACTURER/value=Unknown
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_PRODUCT/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_PRODUCT/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USB_PRODUCT/value=Arduino Due
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USE_ARCHIVER/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USE_ARCHIVER/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.USE_ARCHIVER/value=true
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT.PATH/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT.PATH/value=C:/Arduino-1.5.4/hardware/arduino/sam/variants/${A.BUILD.VARIANT}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT.PATH/value=C\:/Arduino-1.5.8/hardware/arduino/sam/variants/${A.BUILD.VARIANT}
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT/value=arduino_due_x
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT_SYSTEM_LIB/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT_SYSTEM_LIB/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT_SYSTEM_LIB/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VARIANT_SYSTEM_LIB/value=libsam_sam3x8e_gcc_rel.a
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VID/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VID/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VID/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.BUILD.VID/value=0x2341
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CMD.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CMD.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CMD.PATH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CMD.PATH/value=${A.TOOLS.AVRDUDE.CMD.PATH}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CMD/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CMD/value=${A.TOOLS.BOSSAC.CMD}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.CMD/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.CMD/value=arm-none-eabi-ar
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.EXTRA_FLAGS/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.EXTRA_FLAGS/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.EXTRA_FLAGS/value=
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.FLAGS/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.AR.FLAGS/value=rcs
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.CMD/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.CMD/value=arm-none-eabi-gcc
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.CMD/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.CMD/value=arm-none-eabi-g++
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.CMD/value=arm-none-eabi-gcc
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.EXTRA_FLAGS/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.EXTRA_FLAGS/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.EXTRA_FLAGS/value=
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.FLAGS/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.ELF.FLAGS/value=-O2 -Wl,--gc-sections
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.EXTRA_FLAGS/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.EXTRA_FLAGS/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.EXTRA_FLAGS/value=
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.FLAGS/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.C.FLAGS/value=-c -g -O2 -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single\=500 -Dprintf\=iprintf
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.CMD/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.CMD/value=arm-none-eabi-g++
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.EXTRA_FLAGS/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.EXTRA_FLAGS/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.EXTRA_FLAGS/value=
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.FLAGS/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.FLAGS/value=-c -g -O2 -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single\=500 -fno-rtti -fno-exceptions -Dprintf\=iprintf
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.DEFINE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.CPP.FLAGS/value=-c -g -std\=gnu++11 -O2 -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single\=500 -fno-rtti -fno-exceptions -Dprintf\=iprintf
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.DEFINE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.DEFINE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.DEFINE/value=-DARDUINO\=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.CMD/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.CMD/value=arm-none-eabi-objcopy
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.EXTRA_FLAGS/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.EXTRA_FLAGS/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.EXTRA_FLAGS/value=
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.FLAGS/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.ELF2HEX.FLAGS/value=-O binary
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.LDFLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.LDFLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.LDFLAGS/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.LDFLAGS/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.LIBSAM.C.FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.LIBSAM.C.FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.LIBSAM.C.FLAGS/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.LIBSAM.C.FLAGS/value="-I${A.BUILD.SYSTEM.PATH}/libsam" "-I${A.BUILD.SYSTEM.PATH}/CMSIS/CMSIS/Include/" "-I${A.BUILD.SYSTEM.PATH}/CMSIS/Device/ATMEL/"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.OBJCOPY.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.OBJCOPY.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.OBJCOPY.CMD/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.OBJCOPY.CMD/value=arm-none-eabi-objcopy
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.OBJCOPY.EEP.FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.OBJCOPY.EEP.FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.OBJCOPY.EEP.FLAGS/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.OBJCOPY.EEP.FLAGS/value=-O ihex -j .eeprom --set-section-flags\=.eeprom\=alloc,load --no-change-warnings --change-section-lma .eeprom\=0
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.PATH/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.PATH/value=${A.RUNTIME.IDE.PATH}/hardware/tools/g++_arm_none_eabi/bin/
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.S.FLAGS/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.PATH/value=${A.RUNTIME.IDE.PATH}/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.S.FLAGS/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.S.FLAGS/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.S.FLAGS/value=-c -g -assembler-with-cpp
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.SIZE.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.S.FLAGS/value=-c -g -x assembler-with-cpp
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.SIZE.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.SIZE.CMD/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.COMPILER.SIZE.CMD/value=arm-none-eabi-size
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CONFIG.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CONFIG.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CONFIG.PATH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.CONFIG.PATH/value=${A.TOOLS.AVRDUDE.CONFIG.PATH}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.NAME/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.NAME/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.NAME/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.NAME/value=Arduino Due (Native USB Port)
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.PATH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.PATH/value=${A.TOOLS.BOSSAC.PATH}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.1/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.PID.0/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.PID.0/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.PID.0/value=0x003e
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.1/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.1/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.AR.CMD}" ${A.COMPILER.AR.FLAGS} "${A.BUILD.PATH}/${A.ARCHIVE_FILE}"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.2/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.AR.CMD}" ${A.COMPILER.AR.FLAGS} ${A.COMPILER.AR.EXTRA_FLAGS} "${A.BUILD.PATH}/${A.ARCHIVE_FILE}"
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.2/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.2/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN.2/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.AR.CMD}" ${A.COMPILER.AR.FLAGS} "${A.BUILD.PATH}/${A.ARCHIVE_FILE}" "${A.OBJECT_FILE}"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.1/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.AR.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.AR.CMD}" ${A.COMPILER.AR.FLAGS} ${A.COMPILER.AR.EXTRA_FLAGS} "${A.BUILD.PATH}/${A.ARCHIVE_FILE}" "${A.OBJECT_FILE}"
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.1/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.1/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.C.ELF.CMD}" ${A.COMPILER.C.ELF.FLAGS} -mcpu\=${A.BUILD.MCU} "-T${A.BUILD.VARIANT.PATH}/${A.BUILD.LDSCRIPT}" "-Wl,-Map,${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.map" -o "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "-L${A.BUILD.PATH}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry\=Reset_Handler -Wl,--unresolved-symbols\=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "${A.BUILD.PATH}/arduino/syscalls_sam3.c.o"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.2/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.C.ELF.CMD}" ${A.COMPILER.C.ELF.FLAGS} -mcpu\=${A.BUILD.MCU} "-T${A.BUILD.VARIANT.PATH}/${A.BUILD.LDSCRIPT}" "-Wl,-Map,${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.map" ${A.COMPILER.C.ELF.EXTRA_FLAGS} -o "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "-L${A.BUILD.PATH}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry\=Reset_Handler -Wl,--unresolved-symbols\=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "${A.BUILD.PATH}/arduino/syscalls_sam3.c.o"
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.2/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.2/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.2/value=\ "${A.BUILD.VARIANT.PATH}/${A.BUILD.VARIANT_SYSTEM_LIB}" "${A.BUILD.PATH}/${A.ARCHIVE_FILE}" -Wl,--end-group
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN.2/value=\ "${A.BUILD.VARIANT.PATH}/${A.BUILD.VARIANT_SYSTEM_LIB}" "${A.BUILD.PATH}/${A.ARCHIVE_FILE}" -Wl,--end-group -lm -gcc
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.C.ELF.CMD}" ${A.COMPILER.C.ELF.FLAGS} -mcpu\=${A.BUILD.MCU} "-T${A.BUILD.VARIANT.PATH}/${A.BUILD.LDSCRIPT}" "-Wl,-Map,${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.map" -o "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "-L${A.BUILD.PATH}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry\=Reset_Handler -Wl,--unresolved-symbols\=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "${A.BUILD.PATH}/arduino/syscalls_sam3.c.o" ${A.OBJECT_FILES} "${A.BUILD.VARIANT.PATH}/${A.BUILD.VARIANT_SYSTEM_LIB}" "${A.BUILD.PATH}/${A.ARCHIVE_FILE}" -Wl,--end-group
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.1/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.COMBINE.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.C.ELF.CMD}" ${A.COMPILER.C.ELF.FLAGS} -mcpu\=${A.BUILD.MCU} "-T${A.BUILD.VARIANT.PATH}/${A.BUILD.LDSCRIPT}" "-Wl,-Map,${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.map" ${A.COMPILER.C.ELF.EXTRA_FLAGS} -o "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "-L${A.BUILD.PATH}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry\=Reset_Handler -Wl,--unresolved-symbols\=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "${A.BUILD.PATH}/arduino/syscalls_sam3.c.o" ${A.OBJECT_FILES} "${A.BUILD.VARIANT.PATH}/${A.BUILD.VARIANT_SYSTEM_LIB}" "${A.BUILD.PATH}/${A.ARCHIVE_FILE}" -Wl,--end-group -lm -gcc
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.1/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.1/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.C.CMD}" ${A.COMPILER.C.FLAGS} -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -D${A.SOFTWARE}\=${A.RUNTIME.IDE.VERSION} ${A.BUILD.EXTRA_FLAGS} ${A.COMPILER.LIBSAM.C.FLAGS} ${A.INCLUDES}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.2/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.C.CMD}" ${A.COMPILER.C.FLAGS} -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -DARDUINO\=${A.RUNTIME.IDE.VERSION} -DARDUINO_${A.BUILD.BOARD} -DARDUINO_ARCH_${A.BUILD.ARCH} ${A.COMPILER.C.EXTRA_FLAGS} ${A.BUILD.EXTRA_FLAGS} ${A.COMPILER.LIBSAM.C.FLAGS} ${A.INCLUDES}
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.2/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.2/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.2/value=\ -o
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.3/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.3/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.3/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN.3/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.C.CMD}" ${A.COMPILER.C.FLAGS} -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -D${A.SOFTWARE}\=${A.RUNTIME.IDE.VERSION} ${A.BUILD.EXTRA_FLAGS} ${A.COMPILER.LIBSAM.C.FLAGS} ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.1/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.C.O.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.C.CMD}" ${A.COMPILER.C.FLAGS} -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -DARDUINO\=${A.RUNTIME.IDE.VERSION} -DARDUINO_${A.BUILD.BOARD} -DARDUINO_ARCH_${A.BUILD.ARCH} ${A.COMPILER.C.EXTRA_FLAGS} ${A.BUILD.EXTRA_FLAGS} ${A.COMPILER.LIBSAM.C.FLAGS} ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}"
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.1/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.1/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.CPP.CMD}" ${A.COMPILER.CPP.FLAGS} -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -D${A.SOFTWARE}\=${A.RUNTIME.IDE.VERSION} ${A.BUILD.EXTRA_FLAGS} ${A.COMPILER.LIBSAM.C.FLAGS} ${A.INCLUDES}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.2/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.CPP.CMD}" ${A.COMPILER.CPP.FLAGS} -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -DARDUINO\=${A.RUNTIME.IDE.VERSION} -DARDUINO_${A.BUILD.BOARD} -DARDUINO_ARCH_${A.BUILD.ARCH} ${A.COMPILER.CPP.EXTRA_FLAGS} ${A.BUILD.EXTRA_FLAGS} ${A.COMPILER.LIBSAM.C.FLAGS} ${A.INCLUDES}
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.2/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.2/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.2/value=\ -o
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.3/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.3/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.3/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN.3/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.CPP.CMD}" ${A.COMPILER.CPP.FLAGS} -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -D${A.SOFTWARE}\=${A.RUNTIME.IDE.VERSION} ${A.BUILD.EXTRA_FLAGS} ${A.COMPILER.LIBSAM.C.FLAGS} ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.EEP.PATTERN.1/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.CPP.O.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.CPP.CMD}" ${A.COMPILER.CPP.FLAGS} -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -DARDUINO\=${A.RUNTIME.IDE.VERSION} -DARDUINO_${A.BUILD.BOARD} -DARDUINO_ARCH_${A.BUILD.ARCH} ${A.COMPILER.CPP.EXTRA_FLAGS} ${A.BUILD.EXTRA_FLAGS} ${A.COMPILER.LIBSAM.C.FLAGS} ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}"
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.EEP.PATTERN.1/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.EEP.PATTERN.1/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.EEP.PATTERN.1/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.EEP.PATTERN/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.EEP.PATTERN/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.EEP.PATTERN/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.EEP.PATTERN/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN.1/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN.1/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN.1/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.ELF2HEX.CMD}" ${A.COMPILER.ELF2HEX.FLAGS} "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.bin"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.ELF2HEX.CMD}" ${A.COMPILER.ELF2HEX.FLAGS} ${A.COMPILER.ELF2HEX.EXTRA_FLAGS} "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.bin"
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.ELF2HEX.CMD}" ${A.COMPILER.ELF2HEX.FLAGS} "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.bin"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.PATTERN.1/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.OBJCOPY.HEX.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.ELF2HEX.CMD}" ${A.COMPILER.ELF2HEX.FLAGS} ${A.COMPILER.ELF2HEX.EXTRA_FLAGS} "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.bin"
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.PATTERN.1/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.PATTERN.1/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.PATTERN.1/value="${A.COMPILER.PATH}${A.COMPILER.SIZE.CMD}" -A "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.PATTERN/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.PATTERN/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.PATTERN/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.PATTERN/value="${A.COMPILER.PATH}${A.COMPILER.SIZE.CMD}" -A "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.REGEX/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.REGEX/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.REGEX/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RECIPE.SIZE.REGEX/value=\\.text\\s+([0-9]+).*
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.PATH/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.PATH/value=C:/Arduino-1.5.4
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.VERSION/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.PATH/value=C\:/Arduino-1.5.8
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.VERSION/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.VERSION/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.VERSION/value=154
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.SOFTWARE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.RUNTIME.IDE.VERSION/value=158
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.SOFTWARE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.SOFTWARE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.SOFTWARE/value=ARDUINO
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.CMD.WINDOWS/delimiter=\;
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.CMD.WINDOWS/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.CMD.WINDOWS/value=bossac.exe
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.CMD/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.AVRDUDE.PROGRAM.PARAMS.QUIET/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.AVRDUDE.PROGRAM.PARAMS.QUIET/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.AVRDUDE.PROGRAM.PARAMS.QUIET/value=-q -q
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.CMD/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.CMD/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.CMD/value=bossac
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.CMD/value=bossac.exe
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.PATH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.PATH/value=${A.RUNTIME.IDE.PATH}/hardware/tools
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PARAMS.QUIET/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PARAMS.QUIET/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PARAMS.QUIET/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PARAMS.QUIET/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PARAMS.VERBOSE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PARAMS.VERBOSE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PARAMS.VERBOSE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PARAMS.VERBOSE/value=-i -d
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PATTERN/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PATTERN/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PATTERN/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.TOOLS.BOSSAC.UPLOAD.PATTERN/value="${A.PATH}/${A.CMD}" ${A.UPLOAD.VERBOSE} --port\=${A.SERIAL.PORT.FILE} -U ${A.UPLOAD.NATIVE_USB} -e -w -v -b "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.bin" -R
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.MAXIMUM_SIZE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.MAXIMUM_SIZE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.MAXIMUM_SIZE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.MAXIMUM_SIZE/value=524288
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.NATIVE_USB/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.NATIVE_USB/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.NATIVE_USB/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.NATIVE_USB/value=true
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.PROTOCOL/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.PROTOCOL/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.PROTOCOL/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.PROTOCOL/value=sam-ba
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.TOOL/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.TOOL/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.TOOL/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.TOOL/value=bossac
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.USE_1200BPS_TOUCH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.USE_1200BPS_TOUCH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.USE_1200BPS_TOUCH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.USE_1200BPS_TOUCH/value=true
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.WAIT_FOR_UPLOAD_PORT/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.WAIT_FOR_UPLOAD_PORT/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.WAIT_FOR_UPLOAD_PORT/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.UPLOAD.WAIT_FOR_UPLOAD_PORT/value=true
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARDS_FILE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.VERSION/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.VERSION/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.VERSION/value=1.5.8
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.VID.0/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.VID.0/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/A.VID.0/value=0x2341
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARDS_FILE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARDS_FILE/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARDS_FILE/value=C:/Arduino-1.5.4/hardware/arduino/sam/boards.txt
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARD_NAME/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARDS_FILE/value=C\:\\Arduino-1.5.8\\hardware\\arduino\\sam\\boards.txt
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARD_NAME/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARD_NAME/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.BOARD_NAME/value=Arduino Due (Native USB Port)
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.COM_PORT/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.COM_PORT/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.COM_PORT/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.COM_PORT/value=/dev/ttyACM0
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.C.COMPILE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.C.COMPILE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.C.COMPILE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.C.COMPILE/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.COMPILE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.COMPILE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.COMPILE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.COMPILE/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.CPP.COMPILE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.CPP.COMPILE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.CPP.COMPILE/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.EXTRA.CPP.COMPILE/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.PLATFORM_FILE/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.PLATFORM_FILE/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.PLATFORM_FILE/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.PLATFORM_FILE/value=C:/Arduino-1.5.4/hardware/arduino/sam/platform.txt
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.Processor/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.PLATFORM_FILE/value=C\:/Arduino-1.5.8/hardware/arduino/sam/platform.txt
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.Processor/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.Processor/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.Processor/value=
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.SIZE.SWITCH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.SIZE.SWITCH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.SIZE.SWITCH/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.SIZE.SWITCH/value=${A.RECIPE.SIZE.PATTERN}
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.SIZE_COMMAND/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.SIZE_COMMAND/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.SIZE_COMMAND/operation=replace
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.SIZE_COMMAND/value="${A.COMPILER.PATH}${A.COMPILER.SIZE.CMD}" --format\=avr --mcu\=${A.BUILD.MCU} "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf"
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/PATH/delimiter=\;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.WARNING_LEVEL/delimiter=;
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.WARNING_LEVEL/operation=replace
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/JANTJE.WARNING_LEVEL/value=\ -Wall
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/PATH/delimiter=;
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/PATH/operation=replace
-environment/project/it.baeyens.arduino.core.toolChain.release.674980254/PATH/value=${A.COMPILER.PATH}${PathDelimiter}${A.BUILD.GENERIC.PATH}${PathDelimiter}${PATH}
+environment/project/it.baeyens.arduino.core.toolChain.release.674980254/PATH/value=${A.COMPILER.PATH}${PathDelimiter}${A.BUILD.GENERIC.PATH}${PathDelimiter}${A.RUNTIME.IDE.PATH}/hardware/tools/avr/utils/bin${PathDelimiter}${PATH}
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/append=true
environment/project/it.baeyens.arduino.core.toolChain.release.674980254/appendContributed=true
indexer/indexAllFiles=true
diff --git a/ArduinoCorePatches-1.5.7/sam/cores/arduino/Stream.h b/ArduinoCorePatches-1.5.7/sam/cores/arduino/Stream.h
deleted file mode 100644
index 78971fa1..00000000
--- a/ArduinoCorePatches-1.5.7/sam/cores/arduino/Stream.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- Stream.h - base class for character-based streams.
- Copyright (c) 2010 David A. Mellis. All right reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- parsing functions based on TextFinder library by Michael Margolis
-*/
-
-#ifndef Stream_h
-#define Stream_h
-
-#include <inttypes.h>
-#include "Print.h"
-
-// compatability macros for testing
-/*
-#define getInt() parseInt()
-#define getInt(skipChar) parseInt(skipchar)
-#define getFloat() parseFloat()
-#define getFloat(skipChar) parseFloat(skipChar)
-#define getString( pre_string, post_string, buffer, length)
-readBytesBetween( pre_string, terminator, buffer, length)
-*/
-
-class Stream : public Print
-{
- protected:
- unsigned long _timeout; // number of milliseconds to wait for the next char before aborting timed read
- unsigned long _startMillis; // used for timeout measurement
- int timedRead(); // private method to read stream with timeout
- int timedPeek(); // private method to peek stream with timeout
- int peekNextDigit(); // returns the next numeric digit in the stream or -1 if timeout
-
- public:
- virtual int available() = 0;
- virtual int read() = 0;
- virtual int peek() = 0;
- virtual void flush() = 0;
- virtual size_t canWrite() const { return 1; } // DC42 added
-
- Stream() {_timeout=1000;}
-
-// parsing methods
-
- void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second
-
- bool find(char *target); // reads data from the stream until the target string is found
- bool find(uint8_t *target) { return find ((char *)target); }
- // returns true if target string is found, false if timed out (see setTimeout)
-
- bool find(char *target, size_t length); // reads data from the stream until the target string of given length is found
- bool find(uint8_t *target, size_t length) { return find ((char *)target, length); }
- // returns true if target string is found, false if timed out
-
- bool findUntil(char *target, char *terminator); // as find but search ends if the terminator string is found
- bool findUntil(uint8_t *target, char *terminator) { return findUntil((char *)target, terminator); }
-
- bool findUntil(char *target, size_t targetLen, char *terminate, size_t termLen); // as above but search ends if the terminate string is found
- bool findUntil(uint8_t *target, size_t targetLen, char *terminate, size_t termLen) {return findUntil((char *)target, targetLen, terminate, termLen); }
-
-
- long parseInt(); // returns the first valid (long) integer value from the current position.
- // initial characters that are not digits (or the minus sign) are skipped
- // integer is terminated by the first character that is not a digit.
-
- float parseFloat(); // float version of parseInt
-
- size_t readBytes( char *buffer, size_t length); // read chars from stream into buffer
- size_t readBytes( uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); }
- // terminates if length characters have been read or timeout (see setTimeout)
- // returns the number of characters placed in the buffer (0 means no valid data found)
-
- size_t readBytesUntil( char terminator, char *buffer, size_t length); // as readBytes with terminator character
- size_t readBytesUntil( char terminator, uint8_t *buffer, size_t length) { return readBytesUntil(terminator, (char *)buffer, length); }
- // terminates if length characters have been read, timeout, or if the terminator character detected
- // returns the number of characters placed in the buffer (0 means no valid data found)
-
- // Arduino String functions to be added here
- String readString();
- String readStringUntil(char terminator);
-
- protected:
- long parseInt(char skipChar); // as above but the given skipChar is ignored
- // as above but the given skipChar is ignored
- // this allows format characters (typically commas) in values to be ignored
-
- float parseFloat(char skipChar); // as above but the given skipChar is ignored
-};
-
-#endif
diff --git a/ArduinoCorePatches-1.5.7/sam/cores/arduino/UARTClass.cpp b/ArduinoCorePatches-1.5.7/sam/cores/arduino/UARTClass.cpp
deleted file mode 100644
index 5520a9f7..00000000
--- a/ArduinoCorePatches-1.5.7/sam/cores/arduino/UARTClass.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- Copyright (c) 2011 Arduino. All right reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "UARTClass.h"
-
-// Constructors ////////////////////////////////////////////////////////////////
-
-UARTClass::UARTClass( Uart* pUart, IRQn_Type dwIrq, uint32_t dwId, RingBuffer* pRx_buffer )
-{
- _rx_buffer = pRx_buffer ;
-
- _pUart=pUart ;
- _dwIrq=dwIrq ;
- _dwId=dwId ;
-}
-
-// Public Methods //////////////////////////////////////////////////////////////
-
-void UARTClass::begin( const uint32_t dwBaudRate )
-{
- // Configure PMC
- pmc_enable_periph_clk( _dwId ) ;
-
- // Disable PDC channel
- _pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS ;
-
- // Reset and disable receiver and transmitter
- _pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | UART_CR_TXDIS ;
-
- // Configure mode
- _pUart->UART_MR = UART_MR_PAR_NO | UART_MR_CHMODE_NORMAL ;
-
- // Configure baudrate (asynchronous, no oversampling)
- _pUart->UART_BRGR = (SystemCoreClock / dwBaudRate) >> 4 ;
-
- // Configure interrupts
- _pUart->UART_IDR = 0xFFFFFFFF;
- _pUart->UART_IER = UART_IER_RXRDY | UART_IER_OVRE | UART_IER_FRAME;
-
- // Enable UART interrupt in NVIC
- NVIC_EnableIRQ(_dwIrq);
-
- // Enable receiver and transmitter
- _pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN ;
-}
-
-void UARTClass::end( void )
-{
- // clear any received data
- _rx_buffer->_iHead = _rx_buffer->_iTail ;
-
- // Disable UART interrupt in NVIC
- NVIC_DisableIRQ( _dwIrq ) ;
-
- // Wait for any outstanding data to be sent
- flush();
-
- pmc_disable_periph_clk( _dwId ) ;
-}
-
-int UARTClass::available( void )
-{
- return (uint32_t)(SERIAL_BUFFER_SIZE + _rx_buffer->_iHead - _rx_buffer->_iTail) % SERIAL_BUFFER_SIZE ;
-}
-
-int UARTClass::peek( void )
-{
- if ( _rx_buffer->_iHead == _rx_buffer->_iTail )
- return -1 ;
-
- return _rx_buffer->_aucBuffer[_rx_buffer->_iTail] ;
-}
-
-int UARTClass::read( void )
-{
- // if the head isn't ahead of the tail, we don't have any characters
- if ( _rx_buffer->_iHead == _rx_buffer->_iTail )
- return -1 ;
-
- uint8_t uc = _rx_buffer->_aucBuffer[_rx_buffer->_iTail] ;
- _rx_buffer->_iTail = (unsigned int)(_rx_buffer->_iTail + 1) % SERIAL_BUFFER_SIZE ;
- return uc ;
-}
-
-void UARTClass::flush( void )
-{
- // Wait for transmission to complete
- while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY)
- ;
-}
-
-size_t UARTClass::write( const uint8_t uc_data )
-{
- // Check if the transmitter is ready
- while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY)
- ;
-
- // Send character
- _pUart->UART_THR = uc_data;
- return 1;
-}
-
-size_t UARTClass::canWrite( void ) const //***** DC42 added
-{
- return (_pUart->UART_SR & UART_SR_TXRDY) ? 1 : 0;
-}
-
-void UARTClass::IrqHandler( void )
-{
- uint32_t status = _pUart->UART_SR;
-
- // Did we receive data ?
- if ((status & UART_SR_RXRDY) == UART_SR_RXRDY)
- _rx_buffer->store_char(_pUart->UART_RHR);
-
- // Acknowledge errors
- if ((status & UART_SR_OVRE) == UART_SR_OVRE ||
- (status & UART_SR_FRAME) == UART_SR_FRAME)
- {
- // TODO: error reporting outside ISR
- _pUart->UART_CR |= UART_CR_RSTSTA;
- }
-}
-
diff --git a/ArduinoCorePatches-1.5.7/sam/cores/arduino/UARTClass.h b/ArduinoCorePatches-1.5.7/sam/cores/arduino/UARTClass.h
deleted file mode 100644
index b36ca7cd..00000000
--- a/ArduinoCorePatches-1.5.7/sam/cores/arduino/UARTClass.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Copyright (c) 2011 Arduino. All right reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef _UART_CLASS_
-#define _UART_CLASS_
-
-#include "HardwareSerial.h"
-#include "RingBuffer.h"
-
-// Includes Atmel CMSIS
-#include <chip.h>
-
-class UARTClass : public HardwareSerial
-{
- protected:
- RingBuffer *_rx_buffer ;
-
- protected:
- Uart* _pUart ;
- IRQn_Type _dwIrq ;
- uint32_t _dwId ;
-
- public:
- UARTClass( Uart* pUart, IRQn_Type dwIrq, uint32_t dwId, RingBuffer* pRx_buffer ) ;
-
- void begin( const uint32_t dwBaudRate ) ;
- void end( void ) ;
- int available( void ) ;
- int peek( void ) ;
- int read( void ) ;
- void flush( void ) ;
- size_t write( const uint8_t c ) ;
- size_t canWrite( void ) const override; //***** DC42 added
-
- void IrqHandler( void ) ;
-
-#if defined __GNUC__ /* GCC CS3 */
- using Print::write ; // pull in write(str) and write(buf, size) from Print
-#elif defined __ICCARM__ /* IAR Ewarm 5.41+ */
-// virtual void write( const char *str ) ;
-// virtual void write( const uint8_t *buffer, size_t size ) ;
-#endif
-
- operator bool() { return true; }; // UART always active
-};
-
-#endif // _UART_CLASS_
diff --git a/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/CDC.cpp b/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/CDC.cpp
deleted file mode 100644
index 74330b9a..00000000
--- a/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/CDC.cpp
+++ /dev/null
@@ -1,309 +0,0 @@
-/* Copyright (c) 2011, Peter Barrett
-**
-** Permission to use, copy, modify, and/or distribute this software for
-** any purpose with or without fee is hereby granted, provided that the
-** above copyright notice and this permission notice appear in all copies.
-**
-** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
-** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
-** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
-** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
-** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-** SOFTWARE.
-*/
-
-#include "Arduino.h"
-#include "USBAPI.h"
-#include "Reset.h"
-
-#ifdef CDC_ENABLED
-
-#define CDC_SERIAL_BUFFER_SIZE 512
-
-/* For information purpose only since RTS is not always handled by the terminal application */
-#define CDC_LINESTATE_DTR 0x01 // Data Terminal Ready
-#define CDC_LINESTATE_RTS 0x02 // Ready to Send
-
-#define CDC_LINESTATE_READY (CDC_LINESTATE_RTS | CDC_LINESTATE_DTR)
-
-struct ring_buffer
-{
- uint8_t buffer[CDC_SERIAL_BUFFER_SIZE];
- volatile uint32_t head;
- volatile uint32_t tail;
-};
-
-ring_buffer cdc_rx_buffer = { { 0 }, 0, 0};
-
-typedef struct
-{
- uint32_t dwDTERate;
- uint8_t bCharFormat;
- uint8_t bParityType;
- uint8_t bDataBits;
- uint8_t lineState;
-} LineInfo;
-
-static volatile LineInfo _usbLineInfo = {
- 57600, // dWDTERate
- 0x00, // bCharFormat
- 0x00, // bParityType
- 0x08, // bDataBits
- 0x00 // lineState
-};
-
-_Pragma("pack(1)")
-static const CDCDescriptor _cdcInterface =
-{
- D_IAD(0,2,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,1),
-
- // CDC communication interface
- D_INTERFACE(CDC_ACM_INTERFACE,1,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,0),
- D_CDCCS(CDC_HEADER,0x10,0x01), // Header (1.10 bcd)
- D_CDCCS(CDC_CALL_MANAGEMENT,1,1), // Device handles call management (not)
- D_CDCCS4(CDC_ABSTRACT_CONTROL_MANAGEMENT,6), // SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported
- D_CDCCS(CDC_UNION,CDC_ACM_INTERFACE,CDC_DATA_INTERFACE), // Communication interface is master, data interface is slave 0
- D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_ACM),USB_ENDPOINT_TYPE_INTERRUPT,0x10, 0x10),
-
- // CDC data interface
- D_INTERFACE(CDC_DATA_INTERFACE,2,CDC_DATA_INTERFACE_CLASS,0,0),
- D_ENDPOINT(USB_ENDPOINT_OUT(CDC_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,512,0),
- D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_IN ),USB_ENDPOINT_TYPE_BULK,512,0)
-};
-static const CDCDescriptor _cdcOtherInterface =
-{
- D_IAD(0,2,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,1),
-
- // CDC communication interface
- D_INTERFACE(CDC_ACM_INTERFACE,1,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,0),
- D_CDCCS(CDC_HEADER,0x10,0x01), // Header (1.10 bcd)
- D_CDCCS(CDC_CALL_MANAGEMENT,1,1), // Device handles call management (not)
- D_CDCCS4(CDC_ABSTRACT_CONTROL_MANAGEMENT,6), // SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported
- D_CDCCS(CDC_UNION,CDC_ACM_INTERFACE,CDC_DATA_INTERFACE), // Communication interface is master, data interface is slave 0
- D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_ACM),USB_ENDPOINT_TYPE_INTERRUPT,0x10, 0x10),
-
- // CDC data interface
- D_INTERFACE(CDC_DATA_INTERFACE,2,CDC_DATA_INTERFACE_CLASS,0,0),
- D_ENDPOINT(USB_ENDPOINT_OUT(CDC_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,64,0),
- D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_IN ),USB_ENDPOINT_TYPE_BULK,64,0)
-};
-_Pragma("pack()")
-
-int WEAK CDC_GetInterface(uint8_t* interfaceNum)
-{
- interfaceNum[0] += 2; // uses 2
- return USBD_SendControl(0,&_cdcInterface,sizeof(_cdcInterface));
-}
-
-int WEAK CDC_GetOtherInterface(uint8_t* interfaceNum)
-{
- interfaceNum[0] += 2; // uses 2
- return USBD_SendControl(0,&_cdcOtherInterface,sizeof(_cdcOtherInterface));
-}
-
-bool WEAK CDC_Setup(Setup& setup)
-{
- uint8_t r = setup.bRequest;
- uint8_t requestType = setup.bmRequestType;
-
- if (REQUEST_DEVICETOHOST_CLASS_INTERFACE == requestType)
- {
- if (CDC_GET_LINE_CODING == r)
- {
- USBD_SendControl(0,(void*)&_usbLineInfo,7);
- return true;
- }
- }
-
- if (REQUEST_HOSTTODEVICE_CLASS_INTERFACE == requestType)
- {
- if (CDC_SET_LINE_CODING == r)
- {
- USBD_RecvControl((void*)&_usbLineInfo,7);
- return true;
- }
-
- if (CDC_SET_CONTROL_LINE_STATE == r)
- {
- _usbLineInfo.lineState = setup.wValueL;
- // auto-reset into the bootloader is triggered when the port, already
- // open at 1200 bps, is closed.
- if (1200 == _usbLineInfo.dwDTERate)
- {
- // We check DTR state to determine if host port is open (bit 0 of lineState).
- if ((_usbLineInfo.lineState & 0x01) == 0)
- initiateReset(250);
- else
- cancelReset();
- }
- return true;
- }
- }
- return false;
-}
-
-int _serialPeek = -1;
-void Serial_::begin(uint32_t baud_count)
-{
- // suppress "unused parameter" warning
- (void)baud_count;
-}
-
-void Serial_::begin(uint32_t baud_count, uint8_t config)
-{
- // suppress "unused parameter" warning
- (void)baud_count;
- (void)config;
-}
-
-void Serial_::end(void)
-{
-}
-
-void Serial_::accept(void)
-{
- static uint32_t guard = 0;
-
- // synchronized access to guard
- do {
- if (__LDREXW(&guard) != 0) {
- __CLREX();
- return; // busy
- }
- } while (__STREXW(1, &guard) != 0); // retry until write succeed
-
- ring_buffer *buffer = &cdc_rx_buffer;
- uint32_t i = (uint32_t)(buffer->head+1) % CDC_SERIAL_BUFFER_SIZE;
-
- // if we should be storing the received character into the location
- // just before the tail (meaning that the head would advance to the
- // current location of the tail), we're about to overflow the buffer
- // and so we don't write the character or advance the head.
- while (i != buffer->tail) {
- uint32_t c;
- if (!USBD_Available(CDC_RX)) {
- udd_ack_fifocon(CDC_RX);
- break;
- }
- c = USBD_Recv(CDC_RX);
- // c = UDD_Recv8(CDC_RX & 0xF);
- buffer->buffer[buffer->head] = c;
- buffer->head = i;
-
- i = (i + 1) % CDC_SERIAL_BUFFER_SIZE;
- }
-
- // release the guard
- guard = 0;
-}
-
-int Serial_::available(void)
-{
- ring_buffer *buffer = &cdc_rx_buffer;
- return (unsigned int)(CDC_SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % CDC_SERIAL_BUFFER_SIZE;
-}
-
-int Serial_::peek(void)
-{
- ring_buffer *buffer = &cdc_rx_buffer;
-
- if (buffer->head == buffer->tail)
- {
- return -1;
- }
- else
- {
- return buffer->buffer[buffer->tail];
- }
-}
-
-int Serial_::read(void)
-{
- ring_buffer *buffer = &cdc_rx_buffer;
-
- // if the head isn't ahead of the tail, we don't have any characters
- if (buffer->head == buffer->tail)
- {
- return -1;
- }
- else
- {
- unsigned char c = buffer->buffer[buffer->tail];
- buffer->tail = (unsigned int)(buffer->tail + 1) % CDC_SERIAL_BUFFER_SIZE;
- if (USBD_Available(CDC_RX))
- accept();
- return c;
- }
-}
-
-void Serial_::flush(void)
-{
- USBD_Flush(CDC_TX);
-}
-
-size_t Serial_::write(const uint8_t *buffer, size_t size)
-{
- /* only try to send bytes if the high-level CDC connection itself
- is open (not just the pipe) - the OS should set lineState when the port
- is opened and clear lineState when the port is closed.
- bytes sent before the user opens the connection or after
- the connection is closed are lost - just like with a UART. */
-
- // TODO - ZE - check behavior on different OSes and test what happens if an
- // open connection isn't broken cleanly (cable is yanked out, host dies
- // or locks up, or host virtual serial port hangs)
- if (_usbLineInfo.lineState > 0)
- {
- int r = USBD_Send(CDC_TX, buffer, size);
-
- if (r > 0)
- {
- return r;
- } else
- {
- setWriteError();
- return 0;
- }
- }
- setWriteError();
- return 0;
-}
-
-// Function added by DC42 so we can find out how much data we can write without blocking
-size_t Serial_::canWrite() const {
- return USBD_SendSpace(CDC_TX);
-}
-
-size_t Serial_::write(uint8_t c) {
- return write(&c, 1);
-}
-
-// This operator is a convenient way for a sketch to check whether the
-// port has actually been configured and opened by the host (as opposed
-// to just being connected to the host). It can be used, for example, in
-// setup() before printing to ensure that an application on the host is
-// actually ready to receive and display the data.
-// We add a short delay before returning to fix a bug observed by Federico
-// where the port is configured (lineState != 0) but not quite opened.
-Serial_::operator bool()
-{
- // this is here to avoid spurious opening after upload
- if (millis() < 500)
- return false;
-
- bool result = false;
-
- if (_usbLineInfo.lineState > 0)
- {
- result = true;
- }
-
- delay(10);
- return result;
-}
-
-Serial_ SerialUSB;
-
-#endif
diff --git a/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/USBAPI.h b/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/USBAPI.h
deleted file mode 100644
index 4630a55a..00000000
--- a/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/USBAPI.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- Copyright (c) 2012 Arduino. All right reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef __USBAPI__
-#define __USBAPI__
-
-#if defined __cplusplus
-
-#include "RingBuffer.h"
-
-//================================================================================
-//================================================================================
-// USB
-
-class USBDevice_
-{
-public:
- USBDevice_();
- bool configured();
-
- bool attach();
- bool detach(); // Serial port goes down too...
- void poll();
-};
-extern USBDevice_ USBDevice;
-
-//================================================================================
-//================================================================================
-// Serial over CDC (Serial1 is the physical port)
-
-class Serial_ : public Stream
-{
-private:
- RingBuffer *_cdc_rx_buffer;
-public:
- void begin(uint32_t baud_count);
- void begin(uint32_t baud_count, uint8_t config);
- void end(void);
-
- virtual int available(void);
- virtual void accept(void);
- virtual int peek(void);
- virtual int read(void);
- virtual void flush(void);
- virtual size_t write(uint8_t);
- virtual size_t write(const uint8_t *buffer, size_t size);
- size_t canWrite() const /*override*/; // Function added by DC42 so that we can tell how many characters we can write without blocking
- using Print::write; // pull in write(str) from Print
- operator bool();
-};
-extern Serial_ SerialUSB;
-
-//================================================================================
-//================================================================================
-// Mouse
-
-#define MOUSE_LEFT 1
-#define MOUSE_RIGHT 2
-#define MOUSE_MIDDLE 4
-#define MOUSE_ALL (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE)
-
-class Mouse_
-{
-private:
- uint8_t _buttons;
- void buttons(uint8_t b);
-public:
- Mouse_(void);
- void begin(void);
- void end(void);
- void click(uint8_t b = MOUSE_LEFT);
- void move(signed char x, signed char y, signed char wheel = 0);
- void press(uint8_t b = MOUSE_LEFT); // press LEFT by default
- void release(uint8_t b = MOUSE_LEFT); // release LEFT by default
- bool isPressed(uint8_t b = MOUSE_ALL); // check all buttons by default
-};
-extern Mouse_ Mouse;
-
-//================================================================================
-//================================================================================
-// Keyboard
-
-#define KEY_LEFT_CTRL 0x80
-#define KEY_LEFT_SHIFT 0x81
-#define KEY_LEFT_ALT 0x82
-#define KEY_LEFT_GUI 0x83
-#define KEY_RIGHT_CTRL 0x84
-#define KEY_RIGHT_SHIFT 0x85
-#define KEY_RIGHT_ALT 0x86
-#define KEY_RIGHT_GUI 0x87
-
-#define KEY_UP_ARROW 0xDA
-#define KEY_DOWN_ARROW 0xD9
-#define KEY_LEFT_ARROW 0xD8
-#define KEY_RIGHT_ARROW 0xD7
-#define KEY_BACKSPACE 0xB2
-#define KEY_TAB 0xB3
-#define KEY_RETURN 0xB0
-#define KEY_ESC 0xB1
-#define KEY_INSERT 0xD1
-#define KEY_DELETE 0xD4
-#define KEY_PAGE_UP 0xD3
-#define KEY_PAGE_DOWN 0xD6
-#define KEY_HOME 0xD2
-#define KEY_END 0xD5
-#define KEY_CAPS_LOCK 0xC1
-#define KEY_F1 0xC2
-#define KEY_F2 0xC3
-#define KEY_F3 0xC4
-#define KEY_F4 0xC5
-#define KEY_F5 0xC6
-#define KEY_F6 0xC7
-#define KEY_F7 0xC8
-#define KEY_F8 0xC9
-#define KEY_F9 0xCA
-#define KEY_F10 0xCB
-#define KEY_F11 0xCC
-#define KEY_F12 0xCD
-
-// Low level key report: up to 6 keys and shift, ctrl etc at once
-typedef struct
-{
- uint8_t modifiers;
- uint8_t reserved;
- uint8_t keys[6];
-} KeyReport;
-
-class Keyboard_ : public Print
-{
-private:
- KeyReport _keyReport;
- void sendReport(KeyReport* keys);
-public:
- Keyboard_(void);
- void begin(void);
- void end(void);
- virtual size_t write(uint8_t k);
- virtual size_t press(uint8_t k);
- virtual size_t release(uint8_t k);
- virtual void releaseAll(void);
-};
-extern Keyboard_ Keyboard;
-
-//================================================================================
-//================================================================================
-// Low level API
-
-typedef struct
-{
- uint8_t bmRequestType;
- uint8_t bRequest;
- uint8_t wValueL;
- uint8_t wValueH;
- uint16_t wIndex;
- uint16_t wLength;
-} Setup;
-
-//================================================================================
-//================================================================================
-// HID 'Driver'
-
-int HID_GetInterface(uint8_t* interfaceNum);
-int HID_GetDescriptor(int i);
-bool HID_Setup(Setup& setup);
-void HID_SendReport(uint8_t id, const void* data, uint32_t len);
-
-//================================================================================
-//================================================================================
-// MSC 'Driver'
-
-int MSC_GetInterface(uint8_t* interfaceNum);
-int MSC_GetDescriptor(int i);
-bool MSC_Setup(Setup& setup);
-bool MSC_Data(uint8_t rx,uint8_t tx);
-
-//================================================================================
-//================================================================================
-// CSC 'Driver'
-
-int CDC_GetInterface(uint8_t* interfaceNum);
-int CDC_GetOtherInterface(uint8_t* interfaceNum);
-int CDC_GetDescriptor(int i);
-bool CDC_Setup(Setup& setup);
-
-//================================================================================
-//================================================================================
-
-#define TRANSFER_RELEASE 0x40
-#define TRANSFER_ZERO 0x20
-
-void USBD_InitControl(int end);
-int USBD_SendControl(uint8_t flags, const void* d, uint32_t len);
-int USBD_RecvControl(void* d, uint32_t len);
-int USBD_SendInterfaces(void);
-bool USBD_ClassInterfaceRequest(Setup& setup);
-
-
-uint32_t USBD_Available(uint32_t ep);
-uint32_t USBD_SendSpace(uint32_t ep);
-uint32_t USBD_Send(uint32_t ep, const void* d, uint32_t len);
-uint32_t USBD_Recv(uint32_t ep, void* data, uint32_t len); // non-blocking
-uint32_t USBD_Recv(uint32_t ep); // non-blocking
-void USBD_Flush(uint32_t ep);
-uint32_t USBD_Connected(void);
-
-#endif
-#endif
diff --git a/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/USBCore.cpp b/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/USBCore.cpp
deleted file mode 100644
index 5c3120be..00000000
--- a/ArduinoCorePatches-1.5.7/sam/cores/arduino/USB/USBCore.cpp
+++ /dev/null
@@ -1,884 +0,0 @@
-// Copyright (c) 2010, Peter Barrett
-/*
-** Permission to use, copy, modify, and/or distribute this software for
-** any purpose with or without fee is hereby granted, provided that the
-** above copyright notice and this permission notice appear in all copies.
-**
-** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
-** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
-** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
-** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
-** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-** SOFTWARE.
-*/
-
-#include "Arduino.h"
-#include "USBAPI.h"
-#include "Reset.h"
-#include <stdio.h>
-
-//#define TRACE_CORE(x) x
-#define TRACE_CORE(x)
-
-static const uint32_t EndPoints[] =
-{
- EP_TYPE_CONTROL,
-
-#ifdef CDC_ENABLED
- EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM
- EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT
- EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN
-#endif
-
-#ifdef HID_ENABLED
- EP_TYPE_INTERRUPT_IN_HID // HID_ENDPOINT_INT
-#endif
-};
-
-/** Pulse generation counters to keep track of the number of milliseconds remaining for each pulse type */
-#define TX_RX_LED_PULSE_MS 100
-volatile uint8_t TxLEDPulse; /**< Milliseconds remaining for data Tx LED pulse */
-volatile uint8_t RxLEDPulse; /**< Milliseconds remaining for data Rx LED pulse */
-static char isRemoteWakeUpEnabled = 0;
-static char isEndpointHalt = 0;
-//==================================================================
-//==================================================================
-
-extern const uint16_t STRING_LANGUAGE[];
-extern const uint8_t STRING_PRODUCT[];
-extern const uint8_t STRING_MANUFACTURER[];
-extern const DeviceDescriptor USB_DeviceDescriptor;
-extern const DeviceDescriptor USB_DeviceDescriptorA;
-
-const uint16_t STRING_LANGUAGE[2] = {
- (3<<8) | (2+2),
- 0x0409 // English
-};
-
-#ifndef USB_PRODUCT
-// Use a hardcoded product name if none is provided
-#if USB_PID == USB_PID_DUE
-#define USB_PRODUCT "Arduino Due"
-#else
-#define USB_PRODUCT "USB IO Board"
-#endif
-#endif
-
-const uint8_t STRING_PRODUCT[] = USB_PRODUCT;
-
-#if USB_VID == 0x2341
-# if defined(USB_MANUFACTURER)
-# undef USB_MANUFACTURER
-# endif
-# define USB_MANUFACTURER "Arduino LLC"
-#elif !defined(USB_MANUFACTURER)
-// Fall through to unknown if no manufacturer name was provided in a macro
-# define USB_MANUFACTURER "Unknown"
-#endif
-
-const uint8_t STRING_MANUFACTURER[12] = USB_MANUFACTURER;
-
-#ifdef CDC_ENABLED
-#define DEVICE_CLASS 0x02
-#else
-#define DEVICE_CLASS 0x00
-#endif
-
-// DEVICE DESCRIPTOR
-const DeviceDescriptor USB_DeviceDescriptor =
- D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
-
-const DeviceDescriptor USB_DeviceDescriptorA =
- D_DEVICE(DEVICE_CLASS,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
-
-const DeviceDescriptor USB_DeviceQualifier =
- D_QUALIFIER(0x00,0x00,0x00,64,1);
-
-//! 7.1.20 Test Mode Support
-static const unsigned char test_packet_buffer[] = {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // JKJKJKJK * 9
- 0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA, // JJKKJJKK * 8
- 0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0xEE, // JJJJKKKK * 8
- 0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // JJJJJJJKKKKKKK * 8
- 0x7F,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD, // JJJJJJJK * 8
- 0xFC,0x7E,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0x7E // {JKKKKKKK * 10}, JK
-};
-
-//==================================================================
-//==================================================================
-
-volatile uint32_t _usbConfiguration = 0;
-volatile uint32_t _usbInitialized = 0;
-uint32_t _usbSetInterface = 0;
-uint32_t _cdcComposite = 0;
-
-//==================================================================
-//==================================================================
-
-#define USB_RECV_TIMEOUT
-class LockEP
-{
- irqflags_t flags;
-public:
- LockEP(uint32_t ep) : flags(cpu_irq_save())
- {
- }
- ~LockEP()
- {
- cpu_irq_restore(flags);
- }
-};
-
-// Number of bytes, assumes a rx endpoint
-uint32_t USBD_Available(uint32_t ep)
-{
- LockEP lock(ep);
- return UDD_FifoByteCount(ep & 0xF);
-}
-
-// Non Blocking receive
-// Return number of bytes read
-uint32_t USBD_Recv(uint32_t ep, void* d, uint32_t len)
-{
- if (!_usbConfiguration)
- return -1;
-
- LockEP lock(ep);
- uint32_t n = UDD_FifoByteCount(ep & 0xF);
- len = min(n,len);
- n = len;
- uint8_t* dst = (uint8_t*)d;
- while (n--)
- *dst++ = UDD_Recv8(ep & 0xF);
- if (len && !UDD_FifoByteCount(ep & 0xF)) // release empty buffer
- UDD_ReleaseRX(ep & 0xF);
-
- return len;
-}
-
-// Recv 1 byte if ready
-uint32_t USBD_Recv(uint32_t ep)
-{
- uint8_t c;
- if (USBD_Recv(ep & 0xF, &c, 1) != 1)
- return -1;
- else
- return c;
-}
-
-// DC42 uncommented and modified this function to support the cabWrite function in file CDC.cpp
-uint32_t USBD_SendSpace(uint32_t ep)
-{
- if (!UDD_ReadWriteAllowed(ep & 0xF))
- {
- //printf("pb "); // UOTGHS->UOTGHS_DEVEPTISR[%d]=0x%X\n\r", ep, UOTGHS->UOTGHS_DEVEPTISR[ep]);
- return 0;
- }
-
- return ((ep==0) ? EP0_SIZE : EPX_SIZE) - UDD_FifoByteCount(ep & 0xF);
-}
-
-// Blocking Send of data to an endpoint
-uint32_t USBD_Send(uint32_t ep, const void* d, uint32_t len)
-{
- uint32_t n;
- int r = len;
- const uint8_t* data = (const uint8_t*)d;
-
- if (!_usbConfiguration)
- {
- TRACE_CORE(printf("pb conf\n\r");)
- return -1;
- }
-
- while (len)
- {
- if(ep==0) n = EP0_SIZE;
- else n = EPX_SIZE;
- if (n > len)
- n = len;
- len -= n;
-
- UDD_Send(ep & 0xF, data, n);
- data += n;
- }
- //TXLED1; // light the TX LED
- //TxLEDPulse = TX_RX_LED_PULSE_MS;
- return r;
-}
-
-int _cmark;
-int _cend;
-
-void USBD_InitControl(int end)
-{
- _cmark = 0;
- _cend = end;
-}
-
-// Clipped by _cmark/_cend
-int USBD_SendControl(uint8_t flags, const void* d, uint32_t len)
-{
- const uint8_t* data = (const uint8_t*)d;
- uint32_t length = len;
- uint32_t sent = 0;
- uint32_t pos = 0;
-
- TRACE_CORE(printf("=> USBD_SendControl TOTAL len=%lu\r\n", len);)
-
- if (_cmark < _cend)
- {
- while (len > 0)
- {
- sent = UDD_Send(EP0, data + pos, len);
- TRACE_CORE(printf("=> USBD_SendControl sent=%lu\r\n", sent);)
- pos += sent;
- len -= sent;
- }
- }
-
- _cmark += length;
-
- return length;
-}
-
-// Send a USB descriptor string. The string is stored as a
-// plain ASCII string but is sent out as UTF-16 with the
-// correct 2-byte prefix
-static bool USB_SendStringDescriptor(const uint8_t *string, int wLength) {
- uint16_t buff[64];
- int l = 1;
- wLength-=2;
- while (*string && wLength>0) {
- buff[l++] = (uint8_t)(*string++);
- wLength-=2;
- }
- buff[0] = (3<<8) | (l*2);
- return USBD_SendControl(0, (uint8_t*)buff, l*2);
-}
-
-// Does not timeout or cross fifo boundaries
-// Will only work for transfers <= 64 bytes
-// TODO
-int USBD_RecvControl(void* d, uint32_t len)
-{
- UDD_WaitOUT();
- UDD_Recv(EP0, (uint8_t*)d, len);
- UDD_ClearOUT();
-
- return len;
-}
-
-// Handle CLASS_INTERFACE requests
-bool USBD_ClassInterfaceRequest(Setup& setup)
-{
- uint8_t i = setup.wIndex;
-
- TRACE_CORE(printf("=> USBD_ClassInterfaceRequest\r\n");)
-
-#ifdef CDC_ENABLED
- if (CDC_ACM_INTERFACE == i)
- {
- return CDC_Setup(setup);
- }
-#endif
-
-#ifdef HID_ENABLED
- if (HID_INTERFACE == i)
- {
- return HID_Setup(setup);
- }
-#endif
-
- return false;
-}
-
-int USBD_SendInterfaces(void)
-{
- int total = 0;
- uint8_t interfaces = 0;
-
-#ifdef CDC_ENABLED
- total = CDC_GetInterface(&interfaces);
-#endif
-
-#ifdef HID_ENABLED
- total += HID_GetInterface(&interfaces);
-#endif
-
- total = total; // Get rid of compiler warning
- TRACE_CORE(printf("=> USBD_SendInterfaces, total=%d interfaces=%d\r\n", total, interfaces);)
- return interfaces;
-}
-
-int USBD_SendOtherInterfaces(void)
-{
- int total = 0;
- uint8_t interfaces = 0;
-
-#ifdef CDC_ENABLED
- total = CDC_GetOtherInterface(&interfaces);
-#endif
-
-#ifdef HID_ENABLED
- total += HID_GetInterface(&interfaces);
-#endif
-
- total = total; // Get rid of compiler warning
- TRACE_CORE(printf("=> USBD_SendInterfaces, total=%d interfaces=%d\r\n", total, interfaces);)
- return interfaces;
-}
-
-// Construct a dynamic configuration descriptor
-// This really needs dynamic endpoint allocation etc
-// TODO
-static bool USBD_SendConfiguration(int maxlen)
-{
- // Count and measure interfaces
- USBD_InitControl(0);
- //TRACE_CORE(printf("=> USBD_SendConfiguration _cmark1=%d\r\n", _cmark);)
- int interfaces = USBD_SendInterfaces();
- //TRACE_CORE(printf("=> USBD_SendConfiguration _cmark2=%d\r\n", _cmark);)
- //TRACE_CORE(printf("=> USBD_SendConfiguration sizeof=%d\r\n", sizeof(ConfigDescriptor));)
-
-_Pragma("pack(1)")
- ConfigDescriptor config = D_CONFIG(_cmark + sizeof(ConfigDescriptor),interfaces);
-_Pragma("pack()")
- //TRACE_CORE(printf("=> USBD_SendConfiguration clen=%d\r\n", config.clen);)
-
- //TRACE_CORE(printf("=> USBD_SendConfiguration maxlen=%d\r\n", maxlen);)
-
- // Now send them
- USBD_InitControl(maxlen);
- USBD_SendControl(0,&config,sizeof(ConfigDescriptor));
- USBD_SendInterfaces();
- return true;
-}
-
-static bool USBD_SendOtherConfiguration(int maxlen)
-{
- // Count and measure interfaces
- USBD_InitControl(0);
- //TRACE_CORE(printf("=> USBD_SendConfiguration _cmark1=%d\r\n", _cmark);)
- int interfaces = USBD_SendOtherInterfaces();
- //TRACE_CORE(printf("=> USBD_SendConfiguration _cmark2=%d\r\n", _cmark);)
- //TRACE_CORE(printf("=> USBD_SendConfiguration sizeof=%d\r\n", sizeof(ConfigDescriptor));)
-
-_Pragma("pack(1)")
- ConfigDescriptor config = D_OTHERCONFIG(_cmark + sizeof(ConfigDescriptor),interfaces);
-_Pragma("pack()")
- //TRACE_CORE(printf("=> USBD_SendConfiguration clen=%d\r\n", config.clen);)
-
- //TRACE_CORE(printf("=> USBD_SendConfiguration maxlen=%d\r\n", maxlen);)
-
- // Now send them
- USBD_InitControl(maxlen);
- USBD_SendControl(0,&config,sizeof(ConfigDescriptor));
- USBD_SendOtherInterfaces();
- return true;
-}
-
-static bool USBD_SendDescriptor(Setup& setup)
-{
- uint8_t t = setup.wValueH;
- uint8_t desc_length = 0;
- const uint8_t* desc_addr = 0;
-
- if (USB_CONFIGURATION_DESCRIPTOR_TYPE == t)
- {
- TRACE_CORE(printf("=> USBD_SendDescriptor : USB_CONFIGURATION_DESCRIPTOR_TYPE length=%d\r\n", setup.wLength);)
- return USBD_SendConfiguration(setup.wLength);
- }
-
- USBD_InitControl(setup.wLength);
-#ifdef HID_ENABLED
- if (HID_REPORT_DESCRIPTOR_TYPE == t)
- {
- TRACE_CORE(puts("=> USBD_SendDescriptor : HID_REPORT_DESCRIPTOR_TYPE\r\n");)
- return HID_GetDescriptor(t);
- }
-#endif
-
- if (USB_DEVICE_DESCRIPTOR_TYPE == t)
- {
- TRACE_CORE(puts("=> USBD_SendDescriptor : USB_DEVICE_DESCRIPTOR_TYPE\r\n");)
- if (setup.wLength == 8)
- {
- _cdcComposite = 1;
- }
- desc_addr = _cdcComposite ? (const uint8_t*)&USB_DeviceDescriptorA : (const uint8_t*)&USB_DeviceDescriptor;
- if( *desc_addr > setup.wLength ) {
- desc_length = setup.wLength;
- }
- }
- else if (USB_STRING_DESCRIPTOR_TYPE == t)
- {
- TRACE_CORE(puts("=> USBD_SendDescriptor : USB_STRING_DESCRIPTOR_TYPE\r\n");)
- if (setup.wValueL == 0) {
- desc_addr = (const uint8_t*)&STRING_LANGUAGE;
- }
- else if (setup.wValueL == IPRODUCT) {
- return USB_SendStringDescriptor(STRING_PRODUCT, setup.wLength);
- }
- else if (setup.wValueL == IMANUFACTURER) {
- return USB_SendStringDescriptor(STRING_MANUFACTURER, setup.wLength);
- }
- else {
- return false;
- }
- if( *desc_addr > setup.wLength ) {
- desc_length = setup.wLength;
- }
- }
- else if (USB_DEVICE_QUALIFIER == t)
- {
- // Device qualifier descriptor requested
- desc_addr = (const uint8_t*)&USB_DeviceQualifier;
- if( *desc_addr > setup.wLength ) {
- desc_length = setup.wLength;
- }
- }
- else if (USB_OTHER_SPEED_CONFIGURATION == t)
- {
- // Other configuration descriptor requested
- return USBD_SendOtherConfiguration(setup.wLength);
- }
- else
- {
- //printf("Device ERROR");
- }
-
- if (desc_addr == 0)
- {
- return false;
- }
-
- if (desc_length == 0)
- {
- desc_length = *desc_addr;
- }
-
- TRACE_CORE(printf("=> USBD_SendDescriptor : desc_addr=%p desc_length=%d\r\n", desc_addr, desc_length);)
- USBD_SendControl(0, desc_addr, desc_length);
-
- return true;
-}
-
-
-static void USB_SendZlp( void )
-{
- while( UOTGHS_DEVEPTISR_TXINI != (UOTGHS->UOTGHS_DEVEPTISR[0] & UOTGHS_DEVEPTISR_TXINI ) )
- {
- if((UOTGHS->UOTGHS_DEVISR & UOTGHS_DEVISR_SUSP) == UOTGHS_DEVISR_SUSP)
- {
- return;
- }
- }
- UOTGHS->UOTGHS_DEVEPTICR[0] = UOTGHS_DEVEPTICR_TXINIC;
-}
-
-
-static void Test_Mode_Support( uint8_t wIndex )
-{
- uint8_t i;
- uint8_t *ptr_dest = (uint8_t *) &udd_get_endpoint_fifo_access8(2);
-
- switch( wIndex )
- {
- case 4:
- //Test mode Test_Packet:
- //Upon command, a port must repetitively transmit the following test packet until
- //the exit action is taken. This enables the testing of rise and fall times, eye
- //patterns, jitter, and any other dynamic waveform specifications.
- //The test packet is made up by concatenating the following strings.
- //(Note: For J/K NRZI data, and for NRZ data, the bit on the left is the first one
- //transmitted. "S" indicates that a bit stuff occurs, which inserts an "extra" NRZI data bit.
- //"* N" is used to indicate N occurrences of a string of bits or symbols.)
- //A port in Test_Packet mode must send this packet repetitively. The inter-packet timing
- //must be no less than the minimum allowable inter-packet gap as defined in Section 7.1.18 and
- //no greater than 125 us.
-
- // Send ZLP
- USB_SendZlp();
-
- UOTGHS->UOTGHS_DEVDMA[0].UOTGHS_DEVDMACONTROL = 0; // raz
- UOTGHS->UOTGHS_DEVDMA[1].UOTGHS_DEVDMACONTROL = 0; // raz
-
- // Configure endpoint 2, 64 bytes, direction IN, type BULK, 1 bank
- UOTGHS->UOTGHS_DEVEPTCFG[2] = UOTGHS_DEVEPTCFG_EPSIZE_64_BYTE
- | UOTGHS_DEVEPTCFG_EPDIR_IN
- | UOTGHS_DEVEPTCFG_EPTYPE_BLK
- | UOTGHS_DEVEPTCFG_EPBK_1_BANK;
- // Check if the configuration is ok
- UOTGHS->UOTGHS_DEVEPTCFG[2] |= UOTGHS_DEVEPTCFG_ALLOC;
- while((UOTGHS->UOTGHS_DEVEPTISR[2]&UOTGHS_DEVEPTISR_CFGOK)==0) {}
- UOTGHS->UOTGHS_DEVEPT |= UOTGHS_DEVEPT_EPEN2;
- // Write FIFO
- for( i=0; i<sizeof(test_packet_buffer); i++)
- {
- ptr_dest[i] = test_packet_buffer[i];;
- }
- // Tst PACKET
- UOTGHS->UOTGHS_DEVCTRL |= UOTGHS_DEVCTRL_TSTPCKT;
- // Send packet
- UOTGHS->UOTGHS_DEVEPTICR[2] = UOTGHS_DEVEPTICR_TXINIC;
- UOTGHS->UOTGHS_DEVEPTIDR[2] = UOTGHS_DEVEPTIDR_FIFOCONC;
- for(;;);
-// break;
-
- case 1:
- //Test mode Test_J:
- //Upon command, a port's transceiver must enter the high-speed J state and remain in that
- //state until the exit action is taken. This enables the testing of the high output drive
- //level on the D+ line.
- // Send a ZLP
- USB_SendZlp();
- UOTGHS->UOTGHS_DEVCTRL |= UOTGHS_DEVCTRL_TSTJ;
- for(;;);
-// break;
-
- case 2:
- //Test mode Test_K:
- //Upon command, a port's transceiver must enter the high-speed K state and remain in
- //that state until the exit action is taken. This enables the testing of the high output drive
- //level on the D- line.
- // Send a ZLP
- USB_SendZlp();
- UOTGHS->UOTGHS_DEVCTRL |= UOTGHS_DEVCTRL_TSTK;
- for(;;);
-// break;
-
- case 3:
- //Test mode Test_SE0_NAK:
- //Upon command, a port's transceiver must enter the high-speed receive mode
- //and remain in that mode until the exit action is taken. This enables the testing
- //of output impedance, low level output voltage, and loading characteristics.
- //In addition, while in this mode, upstream facing ports (and only upstream facing ports)
- //must respond to any IN token packet with a NAK handshake (only if the packet CRC is
- //determined to be correct) within the normal allowed device response time. This enables testing of
- //the device squelch level circuitry and, additionally, provides a general purpose stimulus/response
- //test for basic functional testing.
-
- // Send a ZLP
- USB_SendZlp();
- UOTGHS->UOTGHS_DEVIDR = UOTGHS_DEVIDR_SUSPEC
- | UOTGHS_DEVIDR_MSOFEC
- | UOTGHS_DEVIDR_SOFEC
- | UOTGHS_DEVIDR_EORSTEC
- | UOTGHS_DEVIDR_WAKEUPEC
- | UOTGHS_DEVIDR_EORSMEC
- | UOTGHS_DEVIDR_UPRSMEC
- | UOTGHS_DEVIDR_PEP_0
- | UOTGHS_DEVIDR_PEP_1
- | UOTGHS_DEVIDR_PEP_2
- | UOTGHS_DEVIDR_PEP_3
- | UOTGHS_DEVIDR_PEP_4
- | UOTGHS_DEVIDR_PEP_5
- | UOTGHS_DEVIDR_PEP_6
- | UOTGHS_DEVIDR_DMA_1
- | UOTGHS_DEVIDR_DMA_2
- | UOTGHS_DEVIDR_DMA_3
- | UOTGHS_DEVIDR_DMA_4
- | UOTGHS_DEVIDR_DMA_5
- | UOTGHS_DEVIDR_DMA_6;
- for(;;);
-// break;
- }
-}
-
-
-//unsigned int iii=0;
-// Endpoint 0 interrupt
-static void USB_ISR(void)
-{
-// printf("ISR=0x%X\n\r", UOTGHS->UOTGHS_DEVISR); // jcb
-// if( iii++ > 1500 ) while(1); // jcb
- // End of bus reset
- if (Is_udd_reset())
- {
- TRACE_CORE(printf(">>> End of Reset\r\n");)
-
- // Reset USB address to 0
- udd_configure_address(0);
- udd_enable_address();
-
- // Configure EP 0
- UDD_InitEP(0, EP_TYPE_CONTROL);
- udd_enable_setup_received_interrupt(0);
- udd_enable_endpoint_interrupt(0);
-
- _usbConfiguration = 0;
- udd_ack_reset();
- }
-
-#ifdef CDC_ENABLED
- if (Is_udd_endpoint_interrupt(CDC_RX))
- {
- udd_ack_out_received(CDC_RX);
-
- // Handle received bytes
- if (USBD_Available(CDC_RX))
- SerialUSB.accept();
- }
-
- if (Is_udd_sof())
- {
- udd_ack_sof();
- // USBD_Flush(CDC_TX); // jcb
- }
-#endif
-
- // EP 0 Interrupt
- if (Is_udd_endpoint_interrupt(0) )
- {
- if (!UDD_ReceivedSetupInt())
- {
- return;
- }
-
- Setup setup;
- UDD_Recv(EP0, (uint8_t*)&setup, 8);
- UDD_ClearSetupInt();
-
- uint8_t requestType = setup.bmRequestType;
- if (requestType & REQUEST_DEVICETOHOST)
- {
- TRACE_CORE(puts(">>> EP0 Int: IN Request\r\n");)
- UDD_WaitIN();
- }
- else
- {
- TRACE_CORE(puts(">>> EP0 Int: OUT Request\r\n");)
- UDD_ClearIN();
- }
-
- bool ok = true;
- if (REQUEST_STANDARD == (requestType & REQUEST_TYPE))
- {
- // Standard Requests
- uint8_t r = setup.bRequest;
- if (GET_STATUS == r)
- {
- if( setup.bmRequestType == 0 ) // device
- {
- // Send the device status
- TRACE_CORE(puts(">>> EP0 Int: GET_STATUS\r\n");)
- // Check current configuration for power mode (if device is configured)
- // TODO
- // Check if remote wake-up is enabled
- // TODO
- UDD_Send8(EP0, 0); // TODO
- UDD_Send8(EP0, 0);
- }
- // if( setup.bmRequestType == 2 ) // Endpoint:
- else
- {
- // Send the endpoint status
- // Check if the endpoint if currently halted
- if( isEndpointHalt == 1 )
- UDD_Send8(EP0, 1); // TODO
- else
- UDD_Send8(EP0, 0); // TODO
- UDD_Send8(EP0, 0);
- }
- }
- else if (CLEAR_FEATURE == r)
- {
- // Check which is the selected feature
- if( setup.wValueL == 1) // DEVICEREMOTEWAKEUP
- {
- // Enable remote wake-up and send a ZLP
- if( isRemoteWakeUpEnabled == 1 )
- UDD_Send8(EP0, 1);
- else
- UDD_Send8(EP0, 0);
- UDD_Send8(EP0, 0);
- }
- else // if( setup.wValueL == 0) // ENDPOINTHALT
- {
- isEndpointHalt = 0; // TODO
- UDD_Send8(EP0, 0);
- UDD_Send8(EP0, 0);
- }
-
- }
- else if (SET_FEATURE == r)
- {
- // Check which is the selected feature
- if( setup.wValueL == 1) // DEVICEREMOTEWAKEUP
- {
- // Enable remote wake-up and send a ZLP
- isRemoteWakeUpEnabled = 1;
- UDD_Send8(EP0, 0);
- }
- if( setup.wValueL == 0) // ENDPOINTHALT
- {
- // Halt endpoint
- isEndpointHalt = 1;
- //USBD_Halt(USBGenericRequest_GetEndpointNumber(pRequest));
- UDD_Send8(EP0, 0);
- }
- if( setup.wValueL == 2) // TEST_MODE
- {
- // 7.1.20 Test Mode Support, 9.4.9 SetFeature
- if( (setup.bmRequestType == 0 /*USBGenericRequest_DEVICE*/) &&
- ((setup.wIndex & 0x000F) == 0) )
- {
- // the lower byte of wIndex must be zero
- // the most significant byte of wIndex is used to specify the specific test mode
-
- UOTGHS->UOTGHS_DEVIDR &= ~UOTGHS_DEVIDR_SUSPEC;
- UOTGHS->UOTGHS_DEVCTRL |= UOTGHS_DEVCTRL_SPDCONF_HIGH_SPEED; // remove suspend ?
-
- Test_Mode_Support( (setup.wIndex & 0xFF00)>>8 );
- }
- }
- }
- else if (SET_ADDRESS == r)
- {
- TRACE_CORE(puts(">>> EP0 Int: SET_ADDRESS\r\n");)
- UDD_WaitIN();
- UDD_SetAddress(setup.wValueL);
- }
- else if (GET_DESCRIPTOR == r)
- {
- TRACE_CORE(puts(">>> EP0 Int: GET_DESCRIPTOR\r\n");)
- ok = USBD_SendDescriptor(setup);
- }
- else if (SET_DESCRIPTOR == r)
- {
- TRACE_CORE(puts(">>> EP0 Int: SET_DESCRIPTOR\r\n");)
- ok = false;
- }
- else if (GET_CONFIGURATION == r)
- {
- TRACE_CORE(puts(">>> EP0 Int: GET_CONFIGURATION\r\n");)
- UDD_Send8(EP0, _usbConfiguration);
- }
- else if (SET_CONFIGURATION == r)
- {
- if (REQUEST_DEVICE == (requestType & REQUEST_RECIPIENT))
- {
- TRACE_CORE(printf(">>> EP0 Int: SET_CONFIGURATION REQUEST_DEVICE %d\r\n", setup.wValueL);)
-
- UDD_InitEndpoints(EndPoints, (sizeof(EndPoints) / sizeof(EndPoints[0])));
- _usbConfiguration = setup.wValueL;
-
-#ifdef CDC_ENABLED
- // Enable interrupt for CDC reception from host (OUT packet)
- udd_enable_out_received_interrupt(CDC_RX);
- udd_enable_endpoint_interrupt(CDC_RX);
-#endif
- }
- else
- {
- TRACE_CORE(puts(">>> EP0 Int: SET_CONFIGURATION failed!\r\n");)
- ok = false;
- }
- }
- else if (GET_INTERFACE == r)
- {
- TRACE_CORE(puts(">>> EP0 Int: GET_INTERFACE\r\n");)
- UDD_Send8(EP0, _usbSetInterface);
- }
- else if (SET_INTERFACE == r)
- {
- _usbSetInterface = setup.wValueL;
- TRACE_CORE(puts(">>> EP0 Int: SET_INTERFACE\r\n");)
- }
- }
- else
- {
- TRACE_CORE(puts(">>> EP0 Int: ClassInterfaceRequest\r\n");)
-
- UDD_WaitIN(); // Workaround: need tempo here, else CDC serial won't open correctly
-
- USBD_InitControl(setup.wLength); // Max length of transfer
- ok = USBD_ClassInterfaceRequest(setup);
- }
-
- if (ok)
- {
- TRACE_CORE(puts(">>> EP0 Int: Send packet\r\n");)
- UDD_ClearIN();
- }
- else
- {
- TRACE_CORE(puts(">>> EP0 Int: Stall\r\n");)
- UDD_Stall();
- }
- }
-}
-
-void USBD_Flush(uint32_t ep)
-{
- if (UDD_FifoByteCount(ep))
- UDD_ReleaseTX(ep);
-}
-
-// VBUS or counting frames
-// Any frame counting?
-uint32_t USBD_Connected(void)
-{
- uint8_t f = UDD_GetFrameNumber();
-
- delay(3);
-
- return f != UDD_GetFrameNumber();
-}
-
-
-//=======================================================================
-//=======================================================================
-
-USBDevice_ USBDevice;
-
-USBDevice_::USBDevice_()
-{
- UDD_SetStack(&USB_ISR);
-
- if (UDD_Init() == 0UL)
- {
- _usbInitialized=1UL;
- }
-}
-
-bool USBDevice_::attach(void)
-{
- if (_usbInitialized != 0UL)
- {
- UDD_Attach();
- _usbConfiguration = 0;
- return true;
- }
- else
- {
- return false;
- }
-}
-
-bool USBDevice_::detach(void)
-{
- if (_usbInitialized != 0UL)
- {
- UDD_Detach();
- return true;
- }
- else
- {
- return false;
- }
-}
-
-// Check for interrupts
-// TODO: VBUS detection
-bool USBDevice_::configured()
-{
- return _usbConfiguration;
-}
-
-void USBDevice_::poll()
-{
-}
diff --git a/ArduinoCorePatches-1.5.7/sam/system/libsam/source/emac.c b/ArduinoCorePatches-1.5.7/sam/system/libsam/source/emac.c
deleted file mode 100644
index d97e66bc..00000000
--- a/ArduinoCorePatches-1.5.7/sam/system/libsam/source/emac.c
+++ /dev/null
@@ -1,808 +0,0 @@
- /**
- * \file
- *
- * \brief EMAC (Ethernet MAC) driver for SAM.
- *
- * Copyright (c) 2011-2012 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- * Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-
-#include "../chip.h"
-#include <string.h>
-
-/// @cond 0
-/**INDENT-OFF**/
-#ifdef __cplusplus
-extern "C" {
-#endif
-/**INDENT-ON**/
-/// @endcond
-
-#if SAM3XA_SERIES
-
-/**
- * \defgroup emac_group Ethernet Media Access Controller
- *
- * See \ref emac_quickstart.
- *
- * Driver for the EMAC (Ethernet Media Access Controller).
- * This file contains basic functions for the EMAC, with support for all modes, settings
- * and clock speeds.
- *
- * \section dependencies Dependencies
- * This driver does not depend on other modules.
- *
- * @{
- */
-
-#if 1 // dc42 change for Duet
-#define EMAC_RX_BUFFERS (32)
-#define EMAC_TX_BUFFERS (8)
-#else
-#define EMAC_RX_BUFFERS 16
-#define EMAC_TX_BUFFERS 8
-#endif
-
-#define MAC_PHY_RETRY_MAX 1000000
-
-
-/** TX descriptor lists */
-#ifdef __ICCARM__ /* IAR */
-#pragma data_alignment=8
-#endif
-static emac_tx_descriptor_t gs_tx_desc[EMAC_TX_BUFFERS];
-/** TX callback lists */
-static emac_dev_tx_cb_t gs_tx_callback[EMAC_TX_BUFFERS];
-/** RX descriptors lists */
-#ifdef __ICCARM__ /* IAR */
-#pragma data_alignment=8
-#endif
-static emac_rx_descriptor_t gs_rx_desc[EMAC_RX_BUFFERS];
-/** Send Buffer. Section 3.6 of AMBA 2.0 spec states that burst should not cross the
- * 1K Boundaries. Receive buffer manager write operations are burst of 2 words => 3 lsb bits
- * of the address shall be set to 0.
- */
-#ifdef __ICCARM__ /* IAR */
-#pragma data_alignment=8
-#endif
-static uint8_t gs_uc_tx_buffer[EMAC_TX_BUFFERS * EMAC_TX_UNITSIZE]
- __attribute__ ((aligned(8)));
-
-#ifdef __ICCARM__ /* IAR */
-#pragma data_alignment=8
-#endif
-/** Receive Buffer */
-static uint8_t gs_uc_rx_buffer[EMAC_RX_BUFFERS * EMAC_RX_UNITSIZE]
- __attribute__ ((aligned(8)));
-
-/**
- * EMAC device memory management struct.
- */
-typedef struct emac_dev_mem {
- /* Pointer to allocated buffer for RX. The address should be 8-byte aligned
- and the size should be EMAC_RX_UNITSIZE * wRxSize. */
- uint8_t *p_rx_buffer;
- /* Pointer to allocated RX descriptor list. */
- emac_rx_descriptor_t *p_rx_dscr;
- /* RX size, in number of registered units (RX descriptors). */
- uint16_t us_rx_size;
- /* Pointer to allocated buffer for TX. The address should be 8-byte aligned
- and the size should be EMAC_TX_UNITSIZE * wTxSize. */
- uint8_t *p_tx_buffer;
- /* Pointer to allocated TX descriptor list. */
- emac_tx_descriptor_t *p_tx_dscr;
- /* TX size, in number of registered units (TX descriptors). */
- uint16_t us_tx_size;
-} emac_dev_mem_t;
-
-/** Return count in buffer */
-#define CIRC_CNT(head,tail,size) (((head) - (tail)) % (size))
-
-/*
- * Return space available, from 0 to size-1.
- * Always leave one free char as a completely full buffer that has (head == tail),
- * which is the same as empty.
- */
-#define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
-
-/** Circular buffer is empty ? */
-#define CIRC_EMPTY(head, tail) (head == tail)
-/** Clear circular buffer */
-#define CIRC_CLEAR(head, tail) (head = tail = 0)
-
-/** Increment head or tail */
-static void circ_inc(uint16_t *headortail, uint32_t size)
-{
- (*headortail)++;
- if((*headortail) >= size) {
- (*headortail) = 0;
- }
-}
-
-/**
- * \brief Wait PHY operation to be completed.
- *
- * \param p_emac HW controller address.
- * \param ul_retry The retry times, 0 to wait forever until completeness.
- *
- * Return EMAC_OK if the operation is completed successfully.
- */
-static uint8_t emac_wait_phy(Emac* p_emac, const uint32_t ul_retry)
-{
- volatile uint32_t ul_retry_count = 0;
-
- while (!emac_is_phy_idle(p_emac)) {
- if (ul_retry == 0) {
- continue;
- }
-
- ul_retry_count++;
-
- if (ul_retry_count >= ul_retry) {
- return EMAC_TIMEOUT;
- }
- }
- return EMAC_OK;
-}
-
-/**
- * \brief Disable transfer, reset registers and descriptor lists.
- *
- * \param p_dev Pointer to EMAC driver instance.
- *
- */
-static void emac_reset_tx_mem(emac_device_t* p_dev)
-{
- Emac *p_hw = p_dev->p_hw;
- uint8_t *p_tx_buff = p_dev->p_tx_buffer;
- emac_tx_descriptor_t *p_td = p_dev->p_tx_dscr;
-
- uint32_t ul_index;
- uint32_t ul_address;
-
- /* Disable TX */
- emac_enable_transmit(p_hw, 0);
-
- /* Set up the TX descriptors */
- CIRC_CLEAR(p_dev->us_tx_head, p_dev->us_tx_tail);
- for (ul_index = 0; ul_index < p_dev->us_tx_list_size; ul_index++) {
- ul_address = (uint32_t) (&(p_tx_buff[ul_index * EMAC_TX_UNITSIZE]));
- p_td[ul_index].addr = ul_address;
- p_td[ul_index].status.val = EMAC_TXD_USED;
- }
- p_td[p_dev->us_tx_list_size - 1].status.val =
- EMAC_TXD_USED | EMAC_TXD_WRAP;
-
- /* Set transmit buffer queue */
- emac_set_tx_queue(p_hw, (uint32_t) p_td);
-}
-
-/**
- * \brief Disable receiver, reset registers and descriptor list.
- *
- * \param p_drv Pointer to EMAC Driver instance.
- */
-static void emac_reset_rx_mem(emac_device_t* p_dev)
-{
- Emac *p_hw = p_dev->p_hw;
- uint8_t *p_rx_buff = p_dev->p_rx_buffer;
- emac_rx_descriptor_t *pRd = p_dev->p_rx_dscr;
-
- uint32_t ul_index;
- uint32_t ul_address;
-
- /* Disable RX */
- emac_enable_receive(p_hw, 0);
-
- /* Set up the RX descriptors */
- p_dev->us_rx_idx = 0;
- for (ul_index = 0; ul_index < p_dev->us_rx_list_size; ul_index++) {
- ul_address = (uint32_t) (&(p_rx_buff[ul_index * EMAC_RX_UNITSIZE]));
- pRd[ul_index].addr.val = ul_address & EMAC_RXD_ADDR_MASK;
- pRd[ul_index].status.val = 0;
- }
- pRd[p_dev->us_rx_list_size - 1].addr.val |= EMAC_RXD_WRAP;
-
- /* Set receive buffer queue */
- emac_set_rx_queue(p_hw, (uint32_t) pRd);
-}
-
-
-/**
- * \brief Initialize the allocated buffer lists for EMAC driver to transfer data.
- * Must be invoked after emac_dev_init() but before RX/TX starts.
- *
- * \note If input address is not 8-byte aligned, the address is automatically
- * adjusted and the list size is reduced by one.
- *
- * \param p_emac Pointer to EMAC instance.
- * \param p_emac_dev Pointer to EMAC device instance.
- * \param p_dev_mm Pointer to the EMAC memory management control block.
- * \param p_tx_cb Pointer to allocated TX callback list.
- *
- * \return EMAC_OK or EMAC_PARAM.
- */
-static uint8_t emac_init_mem(Emac* p_emac, emac_device_t* p_emac_dev,
- emac_dev_mem_t* p_dev_mm,
- emac_dev_tx_cb_t* p_tx_cb)
-{
- if (p_dev_mm->us_rx_size <= 1 || p_dev_mm->us_tx_size <= 1 || p_tx_cb == NULL) {
- return EMAC_PARAM;
- }
-
- /* Assign RX buffers */
- if (((uint32_t) p_dev_mm->p_rx_buffer & 0x7)
- || ((uint32_t) p_dev_mm->p_rx_dscr & 0x7)) {
- p_dev_mm->us_rx_size--;
- }
- p_emac_dev->p_rx_buffer =
- (uint8_t *) ((uint32_t) p_dev_mm->p_rx_buffer & 0xFFFFFFF8);
- p_emac_dev->p_rx_dscr =
- (emac_rx_descriptor_t *) ((uint32_t) p_dev_mm->p_rx_dscr
- & 0xFFFFFFF8);
- p_emac_dev->us_rx_list_size = p_dev_mm->us_rx_size;
-
- /* Assign TX buffers */
- if (((uint32_t) p_dev_mm->p_tx_buffer & 0x7)
- || ((uint32_t) p_dev_mm->p_tx_dscr & 0x7)) {
- p_dev_mm->us_tx_size--;
- }
- p_emac_dev->p_tx_buffer =
- (uint8_t *) ((uint32_t) p_dev_mm->p_tx_buffer & 0xFFFFFFF8);
- p_emac_dev->p_tx_dscr =
- (emac_tx_descriptor_t *) ((uint32_t) p_dev_mm->p_tx_dscr
- & 0xFFFFFFF8);
- p_emac_dev->us_tx_list_size = p_dev_mm->us_tx_size;
- p_emac_dev->func_tx_cb_list = p_tx_cb;
-
- /* Reset TX & RX */
- emac_reset_rx_mem(p_emac_dev);
- emac_reset_tx_mem(p_emac_dev);
-
- /* Enable Rx and Tx, plus the statistics register */
- emac_enable_transmit(p_emac, 1);
- emac_enable_receive(p_emac, 1);
- emac_enable_statistics_write(p_emac, 1);
-
- /* Set up the interrupts for transmission and errors */
- emac_enable_interrupt(p_emac,
- EMAC_IER_RXUBR | /* Enable receive used bit read interrupt. */
- EMAC_IER_TUND | /* Enable transmit underrun interrupt. */
- EMAC_IER_RLE | /* Enable retry limit exceeded interrupt. */
- EMAC_IER_TXERR | /* Enable transmit buffers exhausted in mid-frame interrupt. */
- EMAC_IER_TCOMP | /* Enable transmit complete interrupt. */
- EMAC_IER_ROVR | /* Enable receive overrun interrupt. */
- EMAC_IER_HRESP | /* Enable Hresp not OK interrupt. */
- EMAC_IER_PFR | /* Enable pause frame received interrupt. */
- EMAC_IER_PTZ); /* Enable pause time zero interrupt. */
-
- return EMAC_OK;
-}
-
-/**
- * \brief Read the PHY register.
- *
- * \param p_emac Pointer to the EMAC instance.
- * \param uc_phy_address PHY address.
- * \param uc_address Register address.
- * \param p_value Pointer to a 32-bit location to store read data.
- *
- * \Return EMAC_OK if successfully, EMAC_TIMEOUT if timeout.
- */
-uint8_t emac_phy_read(Emac* p_emac, uint8_t uc_phy_address, uint8_t uc_address,
- uint32_t* p_value)
-{
- emac_maintain_phy(p_emac, uc_phy_address, uc_address, 1, 0);
-
- if (emac_wait_phy(p_emac, MAC_PHY_RETRY_MAX) == EMAC_TIMEOUT) {
- return EMAC_TIMEOUT;
- }
- *p_value = emac_get_phy_data(p_emac);
- return EMAC_OK;
-}
-
-/**
- * \brief Write the PHY register.
- *
- * \param p_emac Pointer to the EMAC instance.
- * \param uc_phy_address PHY Address.
- * \param uc_address Register Address.
- * \param ul_value Data to write, actually 16-bit data.
- *
- * \Return EMAC_OK if successfully, EMAC_TIMEOUT if timeout.
- */
-uint8_t emac_phy_write(Emac* p_emac, uint8_t uc_phy_address,
- uint8_t uc_address, uint32_t ul_value)
-{
- emac_maintain_phy(p_emac, uc_phy_address, uc_address, 0, ul_value);
-
- if (emac_wait_phy(p_emac, MAC_PHY_RETRY_MAX) == EMAC_TIMEOUT) {
- return EMAC_TIMEOUT;
- }
- return EMAC_OK;
-}
-
-/**
- * \brief Initialize the EMAC driver.
- *
- * \param p_emac Pointer to the EMAC instance.
- * \param p_emac_dev Pointer to the EMAC device instance.
- * \param p_opt EMAC configure options.
- */
-void emac_dev_init(Emac* p_emac, emac_device_t* p_emac_dev,
- emac_options_t* p_opt)
-{
- emac_dev_mem_t emac_dev_mm;
-
- /* Disable TX & RX and more */
- emac_network_control(p_emac, 0);
- emac_disable_interrupt(p_emac, ~0u);
-
- emac_clear_statistics(p_emac);
-
- /* Clear all status bits in the receive status register. */
- emac_clear_rx_status(p_emac, EMAC_RSR_OVR | EMAC_RSR_REC | EMAC_RSR_BNA);
-
- /* Clear all status bits in the transmit status register */
- emac_clear_tx_status(p_emac, EMAC_TSR_UBR | EMAC_TSR_COL | EMAC_TSR_RLES
- | EMAC_TSR_BEX | EMAC_TSR_COMP | EMAC_TSR_UND);
-
- /* Clear interrupts */
- emac_get_interrupt_status(p_emac);
-
- /* Enable the copy of data into the buffers
- ignore broadcasts, and not copy FCS. */
- emac_set_configure(p_emac,
- emac_get_configure(p_emac) | EMAC_NCFGR_DRFCS | EMAC_NCFGR_PAE);
-
- emac_enable_copy_all(p_emac, p_opt->uc_copy_all_frame);
- emac_disable_broadcast(p_emac, p_opt->uc_no_boardcast);
-
- /* Fill in EMAC device memory management */
- emac_dev_mm.p_rx_buffer = gs_uc_rx_buffer;
- emac_dev_mm.p_rx_dscr = gs_rx_desc;
- emac_dev_mm.us_rx_size = EMAC_RX_BUFFERS;
-
- emac_dev_mm.p_tx_buffer = gs_uc_tx_buffer;
- emac_dev_mm.p_tx_dscr = gs_tx_desc;
- emac_dev_mm.us_tx_size = EMAC_TX_BUFFERS;
-
- emac_init_mem(p_emac, p_emac_dev, &emac_dev_mm, gs_tx_callback);
-
- emac_set_address(p_emac, 0, p_opt->uc_mac_addr);
-
-}
-
-/**
- * \brief Frames can be read from the EMAC in multiple sections.
- * Read ul_frame_size bytes from the EMAC receive buffers to pcTo.
- * p_rcv_size is the size of the entire frame. Generally emac_read
- * will be repeatedly called until the sum of all the ul_frame_size equals
- * the value of p_rcv_size.
- *
- * \param p_emac_dev Pointer to the EMAC device instance.
- * \param p_frame Address of the frame buffer.
- * \param ul_frame_size Length of the frame.
- * \param p_rcv_size Received frame size.
- *
- * \return EMAC_OK if receiving frame successfully, otherwise failed.
- */
-uint32_t emac_dev_read(emac_device_t* p_emac_dev, uint8_t* p_frame,
- uint32_t ul_frame_size, uint32_t* p_rcv_size)
-{
- uint16_t us_buffer_length;
- uint32_t tmp_ul_frame_size = 0;
- uint8_t *p_tmp_frame = 0;
- uint16_t us_tmp_idx = p_emac_dev->us_rx_idx;
- emac_rx_descriptor_t *p_rx_td =
- &p_emac_dev->p_rx_dscr[p_emac_dev->us_rx_idx];
- int8_t c_is_frame = 0;
-
- if (p_frame == NULL)
- return EMAC_PARAM;
-
- /* Set the default return value */
- *p_rcv_size = 0;
-
- /* Process received RX descriptor */
- while ((p_rx_td->addr.val & EMAC_RXD_OWNERSHIP) == EMAC_RXD_OWNERSHIP) {
- /* A start of frame has been received, discard previous fragments */
- if ((p_rx_td->status.val & EMAC_RXD_SOF) == EMAC_RXD_SOF) {
- /* Skip previous fragment */
- while (us_tmp_idx != p_emac_dev->us_rx_idx) {
- p_rx_td = &p_emac_dev->p_rx_dscr[p_emac_dev->us_rx_idx];
- p_rx_td->addr.val &= ~(EMAC_RXD_OWNERSHIP);
-
- circ_inc(&p_emac_dev->us_rx_idx, p_emac_dev->us_rx_list_size);
- }
- /* Reset the temporary frame pointer */
- p_tmp_frame = p_frame;
- tmp_ul_frame_size = 0;
- /* Start to gather buffers in a frame */
- c_is_frame = 1;
- }
-
- /* Increment the pointer */
- circ_inc(&us_tmp_idx, p_emac_dev->us_rx_list_size);
-
- /* Copy data in the frame buffer */
- if (c_is_frame) {
- if (us_tmp_idx == p_emac_dev->us_rx_idx) {
- do {
- p_rx_td = &p_emac_dev->p_rx_dscr[p_emac_dev->us_rx_idx];
- p_rx_td->addr.val &= ~(EMAC_RXD_OWNERSHIP);
- circ_inc(&p_emac_dev->us_rx_idx, p_emac_dev->us_rx_list_size);
-
- } while (us_tmp_idx != p_emac_dev->us_rx_idx);
-
- return EMAC_RX_NULL;
- }
- /* Copy the buffer into the application frame */
- us_buffer_length = EMAC_RX_UNITSIZE;
- if ((tmp_ul_frame_size + us_buffer_length) > ul_frame_size) {
- us_buffer_length = ul_frame_size - tmp_ul_frame_size;
- }
-
- memcpy(p_tmp_frame,
- (void *)(p_rx_td->addr.val & EMAC_RXD_ADDR_MASK),
- us_buffer_length);
- p_tmp_frame += us_buffer_length;
- tmp_ul_frame_size += us_buffer_length;
-
- /* An end of frame has been received, return the data */
- if ((p_rx_td->status.val & EMAC_RXD_EOF) == EMAC_RXD_EOF) {
- /* Frame size from the EMAC */
- *p_rcv_size = (p_rx_td->status.val & EMAC_RXD_LEN_MASK);
-
- /* All data have been copied in the application frame buffer => release TD */
- while (p_emac_dev->us_rx_idx != us_tmp_idx) {
- p_rx_td = &p_emac_dev->p_rx_dscr[p_emac_dev->us_rx_idx];
- p_rx_td->addr.val &= ~(EMAC_RXD_OWNERSHIP);
- circ_inc(&p_emac_dev->us_rx_idx, p_emac_dev->us_rx_list_size);
- }
-
- /* Application frame buffer is too small so that all data have not been copied */
- if (tmp_ul_frame_size < *p_rcv_size) {
- return EMAC_SIZE_TOO_SMALL;
- }
-
- return EMAC_OK;
- }
- }
- /* SOF has not been detected, skip the fragment */
- else {
- p_rx_td->addr.val &= ~(EMAC_RXD_OWNERSHIP);
- p_emac_dev->us_rx_idx = us_tmp_idx;
- }
-
- /* Process the next buffer */
- p_rx_td = &p_emac_dev->p_rx_dscr[us_tmp_idx];
- }
-
- return EMAC_RX_NULL;
-}
-
-/**
- * \brief Send ulLength bytes from pcFrom. This copies the buffer to one of the
- * EMAC Tx buffers, and then indicates to the EMAC that the buffer is ready.
- * If lEndOfFrame is true then the data being copied is the end of the frame
- * and the frame can be transmitted.
- *
- * \param p_emac_dev Pointer to the EMAC device instance.
- * \param p_buffer Pointer to the data buffer.
- * \param ul_size Length of the frame.
- * \param func_tx_cb Transmit callback function.
- *
- * \return Length sent.
- */
-uint32_t emac_dev_write(emac_device_t* p_emac_dev, void *p_buffer,
- uint32_t ul_size, emac_dev_tx_cb_t func_tx_cb)
-{
-
- volatile emac_tx_descriptor_t *p_tx_td;
- volatile emac_dev_tx_cb_t *p_func_tx_cb;
-
- Emac *p_hw = p_emac_dev->p_hw;
-
-
- /* Check parameter */
- if (ul_size > EMAC_TX_UNITSIZE) {
- return EMAC_PARAM;
- }
-
- /* Pointers to the current transmit descriptor */
- p_tx_td = &p_emac_dev->p_tx_dscr[p_emac_dev->us_tx_head];
-
- /* If no free TxTd, buffer can't be sent, schedule the wakeup callback */
- if (CIRC_SPACE(p_emac_dev->us_tx_head, p_emac_dev->us_tx_tail,
- p_emac_dev->us_tx_list_size) == 0) {
- return EMAC_TX_BUSY;
- }
-
- /* Pointers to the current Tx callback */
- p_func_tx_cb = &p_emac_dev->func_tx_cb_list[p_emac_dev->us_tx_head];
-
- /* Set up/copy data to transmission buffer */
- if (p_buffer && ul_size) {
- /* Driver manages the ring buffer */
- memcpy((void *)p_tx_td->addr, p_buffer, ul_size);
- }
-
- /* Tx callback */
- *p_func_tx_cb = func_tx_cb;
-
- /* Update transmit descriptor status */
-
- /* The buffer size defined is the length of ethernet frame,
- so it's always the last buffer of the frame. */
- if (p_emac_dev->us_tx_head == p_emac_dev->us_tx_list_size - 1) {
- p_tx_td->status.val =
- (ul_size & EMAC_TXD_LEN_MASK) | EMAC_TXD_LAST
- | EMAC_TXD_WRAP;
- } else {
- p_tx_td->status.val =
- (ul_size & EMAC_TXD_LEN_MASK) | EMAC_TXD_LAST;
- }
-
- circ_inc(&p_emac_dev->us_tx_head, p_emac_dev->us_tx_list_size);
-
- /* Now start to transmit if it is still not done */
- emac_start_transmission(p_hw);
-
- return EMAC_OK;
-}
-
-/**
- * \brief Get current load of transmit.
- *
- * \param p_emac_dev Pointer to the EMAC device instance.
- *
- * \return Current load of transmit.
- */
-uint32_t emac_dev_get_tx_load(emac_device_t* p_emac_dev)
-{
- uint16_t us_head = p_emac_dev->us_tx_head;
- uint16_t us_tail = p_emac_dev->us_tx_tail;
- return CIRC_CNT(us_head, us_tail, p_emac_dev->us_tx_list_size);
-}
-
-/**
- * \brief Register/Clear RX callback. Callback will be invoked after the next received
- * frame.
- *
- * When emac_dev_read() returns EMAC_RX_NULL, the application task calls
- * emac_dev_set_rx_callback() to register func_rx_cb() callback and enters suspend state.
- * The callback is in charge to resume the task once a new frame has been
- * received. The next time emac_dev_read() is called, it will be successful.
- *
- * This function is usually invoked from the RX callback itself with NULL
- * callback, to unregister. Once the callback has resumed the application task,
- * there is no need to invoke the callback again.
- *
- * \param p_emac_dev Pointer to the EMAC device instance.
- * \param func_tx_cb Receive callback function.
- */
-void emac_dev_set_rx_callback(emac_device_t* p_emac_dev,
- emac_dev_tx_cb_t func_rx_cb)
-{
- Emac *p_hw = p_emac_dev->p_hw;
-
- if (func_rx_cb == NULL) {
- emac_disable_interrupt(p_hw, EMAC_IDR_RCOMP);
- p_emac_dev->func_rx_cb = NULL;
- } else {
- p_emac_dev->func_rx_cb = func_rx_cb;
- emac_enable_interrupt(p_hw, EMAC_IER_RCOMP);
- }
-}
-
-/**
- * \brief Register/Clear TX wakeup callback.
- *
- * When emac_dev_write() returns EMAC_TX_BUSY (all transmit descriptor busy), the application
- * task calls emac_dev_set_tx_wakeup_callback() to register func_wakeup() callback and
- * enters suspend state. The callback is in charge to resume the task once
- * several transmit descriptors have been released. The next time emac_dev_write() will be called,
- * it shall be successful.
- *
- * This function is usually invoked with NULL callback from the TX wakeup
- * callback itself, to unregister. Once the callback has resumed the
- * application task, there is no need to invoke the callback again.
- *
- * \param p_emac_dev Pointer to EMAC device instance.
- * \param func_wakeup Pointer to wakeup callback function.
- * \param uc_threshold Number of free transmit descriptor before wakeup callback invoked.
- *
- * \return EMAC_OK, EMAC_PARAM on parameter error.
- */
-uint8_t emac_dev_set_tx_wakeup_callback(emac_device_t* p_emac_dev,
- emac_dev_wakeup_cb_t func_wakeup_cb, uint8_t uc_threshold)
-{
- if (func_wakeup_cb == NULL) {
- p_emac_dev->func_wakeup_cb = NULL;
- } else {
- if (uc_threshold <= p_emac_dev->us_tx_list_size) {
- p_emac_dev->func_wakeup_cb = func_wakeup_cb;
- p_emac_dev->uc_wakeup_threshold = uc_threshold;
- } else {
- return EMAC_PARAM;
- }
- }
-
- return EMAC_OK;
-}
-
-
-/**
- * \brief Reset TX & RX queue & statistics.
- *
- * \param p_emac_dev Pointer to EMAC device instance.
- */
-void emac_dev_reset(emac_device_t* p_emac_dev)
-{
- Emac *p_hw = p_emac_dev->p_hw;
-
- emac_reset_rx_mem(p_emac_dev);
- emac_reset_tx_mem(p_emac_dev);
- emac_network_control(p_hw, EMAC_NCR_TE | EMAC_NCR_RE
- | EMAC_NCR_WESTAT | EMAC_NCR_CLRSTAT);
-}
-
-
-/**
- * \brief EMAC Interrupt handler.
- *
- * \param p_emac_dev Pointer to EMAC device instance.
- */
-void emac_handler(emac_device_t* p_emac_dev)
-{
- Emac *p_hw = p_emac_dev->p_hw;
-
- emac_tx_descriptor_t *p_tx_td;
- emac_dev_tx_cb_t *p_tx_cb;
- volatile uint32_t ul_isr;
- volatile uint32_t ul_rsr;
- volatile uint32_t ul_tsr;
- uint32_t ul_rx_status_flag;
- uint32_t ul_tx_status_flag;
-
- ul_isr = emac_get_interrupt_status(p_hw);
- ul_rsr = emac_get_rx_status(p_hw);
- ul_tsr = emac_get_tx_status(p_hw);
-
- ul_isr &= ~(emac_get_interrupt_mask(p_hw) | 0xFFC300);
-
- /* RX packet */
- if ((ul_isr & EMAC_ISR_RCOMP) || (ul_rsr & EMAC_RSR_REC)) {
- ul_rx_status_flag = EMAC_RSR_REC;
-
- /* Check OVR */
- if (ul_rsr & EMAC_RSR_OVR) {
- ul_rx_status_flag |= EMAC_RSR_OVR;
- }
- /* Check BNA */
- if (ul_rsr & EMAC_RSR_BNA) {
- ul_rx_status_flag |= EMAC_RSR_BNA;
- }
- /* Clear status */
- emac_clear_rx_status(p_hw, ul_rx_status_flag);
-
- /* Invoke callbacks */
- if (p_emac_dev->func_rx_cb) {
- p_emac_dev->func_rx_cb(ul_rx_status_flag);
- }
- }
-
- /* TX packet */
- if ((ul_isr & EMAC_ISR_TCOMP) || (ul_tsr & EMAC_TSR_COMP)) {
-
- ul_tx_status_flag = EMAC_TSR_COMP;
-
- /* A frame transmitted */
-
- /* Check RLE */
- if (ul_tsr & EMAC_TSR_RLES) {
- /* Status RLE & Number of discarded buffers */
- ul_tx_status_flag = EMAC_TSR_RLES | CIRC_CNT(p_emac_dev->us_tx_head,
- p_emac_dev->us_tx_tail, p_emac_dev->us_tx_list_size);
- p_tx_cb = &p_emac_dev->func_tx_cb_list[p_emac_dev->us_tx_tail];
- emac_reset_tx_mem(p_emac_dev);
- emac_enable_transmit(p_hw, 1);
- }
- /* Check COL */
- if (ul_tsr & EMAC_TSR_COL) {
- ul_tx_status_flag |= EMAC_TSR_COL;
- }
- /* Check BEX */
- if (ul_tsr & EMAC_TSR_BEX) {
- ul_tx_status_flag |= EMAC_TSR_BEX;
- }
- /* Check UND */
- if (ul_tsr & EMAC_TSR_UND) {
- ul_tx_status_flag |= EMAC_TSR_UND;
- }
- /* Clear status */
- emac_clear_tx_status(p_hw, ul_tx_status_flag);
-
- if (!CIRC_EMPTY(p_emac_dev->us_tx_head, p_emac_dev->us_tx_tail)) {
- /* Check the buffers */
- do {
- p_tx_td = &p_emac_dev->p_tx_dscr[p_emac_dev->us_tx_tail];
- p_tx_cb = &p_emac_dev->func_tx_cb_list[p_emac_dev->us_tx_tail];
- /* Any error? Exit if buffer has not been sent yet */
- if ((p_tx_td->status.val & EMAC_TXD_USED) == 0) {
- break;
- }
-
- /* Notify upper layer that a packet has been sent */
- if (*p_tx_cb) {
- (*p_tx_cb) (ul_tx_status_flag);
- }
-
- circ_inc(&p_emac_dev->us_tx_tail, p_emac_dev->us_tx_list_size);
- } while (CIRC_CNT(p_emac_dev->us_tx_head, p_emac_dev->us_tx_tail,
- p_emac_dev->us_tx_list_size));
- }
-
- if (ul_tsr & EMAC_TSR_RLES) {
- /* Notify upper layer RLE */
- if (*p_tx_cb) {
- (*p_tx_cb) (ul_tx_status_flag);
- }
- }
-
- /* If a wakeup has been scheduled, notify upper layer that it can
- send other packets, and the sending will be successful. */
- if ((CIRC_SPACE(p_emac_dev->us_tx_head, p_emac_dev->us_tx_tail,
- p_emac_dev->us_tx_list_size) >= p_emac_dev->uc_wakeup_threshold)
- && p_emac_dev->func_wakeup_cb) {
- p_emac_dev->func_wakeup_cb();
- }
- }
-}
-
-//@}
-
-#endif // SAM3XA_SERIES
-
-/// @cond 0
-/**INDENT-OFF**/
-#ifdef __cplusplus
-}
-#endif
-/**INDENT-ON**/
-/// @endcond
diff --git a/ArduinoCorePatches-1.5.7/sam/variants/arduino_due_x/variant.cpp b/ArduinoCorePatches/sam/arduino_due_x/variant.cpp
index 35e79ddc..35e79ddc 100644
--- a/ArduinoCorePatches-1.5.7/sam/variants/arduino_due_x/variant.cpp
+++ b/ArduinoCorePatches/sam/arduino_due_x/variant.cpp
diff --git a/ArduinoCorePatches/sam/cores/arduino/Stream.h b/ArduinoCorePatches/sam/cores/arduino/Stream.h
index b1461bf7..2ce9cb92 100644
--- a/ArduinoCorePatches/sam/cores/arduino/Stream.h
+++ b/ArduinoCorePatches/sam/cores/arduino/Stream.h
@@ -49,7 +49,7 @@ class Stream : public Print
virtual int read() = 0;
virtual int peek() = 0;
virtual void flush() = 0;
- virtual size_t canWrite() const { return 1; } // DC42 added
+ virtual size_t canWrite() const { return 1; } // DC42 added
Stream() {_timeout=1000;}
@@ -58,14 +58,18 @@ class Stream : public Print
void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second
bool find(char *target); // reads data from the stream until the target string is found
+ bool find(uint8_t *target) { return find ((char *)target); }
// returns true if target string is found, false if timed out (see setTimeout)
bool find(char *target, size_t length); // reads data from the stream until the target string of given length is found
+ bool find(uint8_t *target, size_t length) { return find ((char *)target, length); }
// returns true if target string is found, false if timed out
bool findUntil(char *target, char *terminator); // as find but search ends if the terminator string is found
+ bool findUntil(uint8_t *target, char *terminator) { return findUntil((char *)target, terminator); }
bool findUntil(char *target, size_t targetLen, char *terminate, size_t termLen); // as above but search ends if the terminate string is found
+ bool findUntil(uint8_t *target, size_t targetLen, char *terminate, size_t termLen) {return findUntil((char *)target, targetLen, terminate, termLen); }
long parseInt(); // returns the first valid (long) integer value from the current position.
@@ -75,10 +79,12 @@ class Stream : public Print
float parseFloat(); // float version of parseInt
size_t readBytes( char *buffer, size_t length); // read chars from stream into buffer
+ size_t readBytes( uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); }
// terminates if length characters have been read or timeout (see setTimeout)
// returns the number of characters placed in the buffer (0 means no valid data found)
size_t readBytesUntil( char terminator, char *buffer, size_t length); // as readBytes with terminator character
+ size_t readBytesUntil( char terminator, uint8_t *buffer, size_t length) { return readBytesUntil(terminator, (char *)buffer, length); }
// terminates if length characters have been read, timeout, or if the terminator character detected
// returns the number of characters placed in the buffer (0 means no valid data found)
diff --git a/ArduinoCorePatches/sam/cores/arduino/UARTClass.h b/ArduinoCorePatches/sam/cores/arduino/UARTClass.h
index 6decd5d9..79ff0e01 100644
--- a/ArduinoCorePatches/sam/cores/arduino/UARTClass.h
+++ b/ArduinoCorePatches/sam/cores/arduino/UARTClass.h
@@ -45,8 +45,7 @@ class UARTClass : public HardwareSerial
int read( void ) ;
void flush( void ) ;
size_t write( const uint8_t c ) ;
-
- size_t canWrite( void ) const /*override*/; //***** DC42 added
+ size_t canWrite( void ) const override; //***** DC42 added
void IrqHandler( void ) ;
diff --git a/ArduinoCorePatches/sam/cores/arduino/USB/CDC.cpp b/ArduinoCorePatches/sam/cores/arduino/USB/CDC.cpp
index d15ce4f5..31c19ca9 100644
--- a/ArduinoCorePatches/sam/cores/arduino/USB/CDC.cpp
+++ b/ArduinoCorePatches/sam/cores/arduino/USB/CDC.cpp
@@ -147,6 +147,15 @@ bool WEAK CDC_Setup(Setup& setup)
int _serialPeek = -1;
void Serial_::begin(uint32_t baud_count)
{
+ // suppress "unused parameter" warning
+ (void)baud_count;
+}
+
+void Serial_::begin(uint32_t baud_count, uint8_t config)
+{
+ // suppress "unused parameter" warning
+ (void)baud_count;
+ (void)config;
}
void Serial_::end(void)
@@ -262,15 +271,15 @@ size_t Serial_::write(const uint8_t *buffer, size_t size)
return 0;
}
-size_t Serial_::canWrite() const {
- return USBD_SendSpace(CDC_TX);
-}
-
-
size_t Serial_::write(uint8_t c) {
return write(&c, 1);
}
+// Function added by DC42 so we can find out how much data we can write without blocking
+size_t Serial_::canWrite() const {
+ return USBD_SendSpace(CDC_TX);
+}
+
// This operator is a convenient way for a sketch to check whether the
// port has actually been configured and opened by the host (as opposed
// to just being connected to the host). It can be used, for example, in
diff --git a/ArduinoCorePatches/sam/cores/arduino/USB/USBAPI.h b/ArduinoCorePatches/sam/cores/arduino/USB/USBAPI.h
index 0866c02b..a2029cd9 100644
--- a/ArduinoCorePatches/sam/cores/arduino/USB/USBAPI.h
+++ b/ArduinoCorePatches/sam/cores/arduino/USB/USBAPI.h
@@ -49,6 +49,7 @@ private:
RingBuffer *_cdc_rx_buffer;
public:
void begin(uint32_t baud_count);
+ void begin(uint32_t baud_count, uint8_t config);
void end(void);
virtual int available(void);
@@ -58,8 +59,8 @@ public:
virtual void flush(void);
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buffer, size_t size);
- size_t canWrite() const;
using Print::write; // pull in write(str) from Print
+ size_t canWrite() const /*override*/; // Function added by DC42 so that we can tell how many characters we can write without blocking
operator bool();
};
extern Serial_ SerialUSB;
diff --git a/ArduinoCorePatches/sam/cores/arduino/USB/USBCore.cpp b/ArduinoCorePatches/sam/cores/arduino/USB/USBCore.cpp
index e1a61c4c..f162ad6c 100644
--- a/ArduinoCorePatches/sam/cores/arduino/USB/USBCore.cpp
+++ b/ArduinoCorePatches/sam/cores/arduino/USB/USBCore.cpp
@@ -69,10 +69,13 @@ const uint16_t STRING_LANGUAGE[2] = {
const uint8_t STRING_PRODUCT[] = USB_PRODUCT;
#if USB_VID == 0x2341
-#define USB_MANUFACTURER "Arduino LLC"
+# if defined(USB_MANUFACTURER)
+# undef USB_MANUFACTURER
+# endif
+# define USB_MANUFACTURER "Arduino LLC"
#elif !defined(USB_MANUFACTURER)
// Fall through to unknown if no manufacturer name was provided in a macro
-#define USB_MANUFACTURER "Unknown"
+# define USB_MANUFACTURER "Unknown"
#endif
const uint8_t STRING_MANUFACTURER[12] = USB_MANUFACTURER;
@@ -139,7 +142,7 @@ uint32_t USBD_Available(uint32_t ep)
// Return number of bytes read
uint32_t USBD_Recv(uint32_t ep, void* d, uint32_t len)
{
- if (!_usbConfiguration || len < 0)
+ if (!_usbConfiguration)
return -1;
LockEP lock(ep);
@@ -166,15 +169,15 @@ uint32_t USBD_Recv(uint32_t ep)
}
// Space in send EP
+// DC42 uncommented and modified this function to support the canWrite function in file CDC.cpp
uint32_t USBD_SendSpace(uint32_t ep)
{
if (!UDD_ReadWriteAllowed(ep & 0xF))
- {
- //printf("pb "); // UOTGHS->UOTGHS_DEVEPTISR[%d]=0x%X\n\r", ep, UOTGHS->UOTGHS_DEVEPTISR[ep]);
+ {
+ //printf("pb "); // UOTGHS->UOTGHS_DEVEPTISR[%d]=0x%X\n\r", ep, UOTGHS->UOTGHS_DEVEPTISR[ep]);
return 0;
- }
-
- return ((ep==0) ? EP0_SIZE : EPX_SIZE) - UDD_FifoByteCount(ep & 0xF);
+ }
+ return ((ep==0) ? EP0_SIZE : EPX_SIZE) - UDD_FifoByteCount(ep & 0xF);
}
// Blocking Send of data to an endpoint
diff --git a/Configuration.h b/Configuration.h
index ef2c62bc..306c50bc 100644
--- a/Configuration.h
+++ b/Configuration.h
@@ -24,8 +24,8 @@ Licence: GPL
#define CONFIGURATION_H
#define NAME "RepRapFirmware"
-#define VERSION "1.00f-dc42"
-#define DATE "2015-02-05"
+#define VERSION "1.00g-dc42"
+#define DATE "2015-02-06"
#define AUTHORS "reprappro, dc42, zpl"
#define FLASH_SAVE_ENABLED (1)
diff --git a/Release/RepRapFirmware-1.00g-dc42.bin b/Release/RepRapFirmware-1.00g-dc42.bin
new file mode 100644
index 00000000..8c2d86ff
--- /dev/null
+++ b/Release/RepRapFirmware-1.00g-dc42.bin
Binary files differ