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:
authorManuel Coenen <manuel@duet3d.com>2021-01-19 18:09:51 +0300
committerManuel Coenen <manuel@duet3d.com>2021-01-19 18:09:51 +0300
commitb52fe6b5480ec8fdef388ca2273b038e3d2b334c (patch)
tree66ffdd242641f62c04eda234390bb7c171c9ddec
parent13f2a61c28178b8457361f05650c19b5c09e3c37 (diff)
Restore compilability for SAM4E/4S builds
-rw-r--r--.cproject4
-rw-r--r--src/Hardware/ExceptionHandlers.cpp6
-rw-r--r--src/Hardware/NonVolatileMemory.cpp12
-rw-r--r--src/Hardware/SharedSpi/SharedSpiDevice.cpp10
-rw-r--r--src/Platform.cpp4
-rw-r--r--src/RepRap.cpp6
6 files changed, 35 insertions, 7 deletions
diff --git a/.cproject b/.cproject
index 1d125390..c1f98657 100644
--- a/.cproject
+++ b/.cproject
@@ -468,7 +468,7 @@
</tool>
<tool commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.cross.c.compiler.571566293" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1052167633" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.more" valueType="enumerated"/>
- <option id="gnu.c.compiler.option.debugging.level.1431164406" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.1431164406" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.misc.verbose.1282164464" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.c.compiler.option.misc.other.1326549359" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -nostdlib -Wundef -Wdouble-promotion -Werror=return-type -Werror=implicit -fsingle-precision-constant &quot;-Wa,-ahl=$*.s&quot;" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.747218438" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
@@ -523,7 +523,7 @@
</tool>
<tool command="g++" id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1213237862" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.853356157" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.more" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.option.debugging.level.1666050145" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1666050145" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.other.verbose.513668348" name="Verbose (-v)" superClass="gnu.cpp.compiler.option.other.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.other.other.1799333383" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -mno-unaligned-access -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fexceptions -nostdlib -Wundef -Wdouble-promotion -Werror=return-type -fsingle-precision-constant &quot;-Wa,-ahl=$*.s&quot; -fstack-usage" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.1493725201" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
diff --git a/src/Hardware/ExceptionHandlers.cpp b/src/Hardware/ExceptionHandlers.cpp
index c1fa5186..17c5c4b5 100644
--- a/src/Hardware/ExceptionHandlers.cpp
+++ b/src/Hardware/ExceptionHandlers.cpp
@@ -20,8 +20,10 @@
cpu_irq_disable(); // disable interrupts before we call any flash functions. We don't enable them again.
WatchdogReset(); // kick the watchdog
-#if SAM4E || SAME70
- WatchdogResetSecondary(); // kick the secondary watchdog
+#if SAM4E
+ rswdt_restart(RSWDT); // kick the secondary watchdog
+#elif SAME70
+ WatchdogResetSecondary(); // kick the secondary watchdog
#endif
Cache::Disable();
diff --git a/src/Hardware/NonVolatileMemory.cpp b/src/Hardware/NonVolatileMemory.cpp
index 45aee49e..e0ef6d85 100644
--- a/src/Hardware/NonVolatileMemory.cpp
+++ b/src/Hardware/NonVolatileMemory.cpp
@@ -27,7 +27,11 @@ void NonVolatileMemory::EnsureRead() noexcept
# error //TODO
#elif SAM4E || SAM4S || SAME70
const bool cacheEnabled = Cache::Disable();
+# if SAME70
Flash::ReadUserSignature(reinterpret_cast<uint32_t*>(&buffer), sizeof(buffer)/sizeof(uint32_t));
+# else
+ flash_read_user_signature(reinterpret_cast<uint32_t*>(&buffer), sizeof(buffer)/sizeof(uint32_t));
+# endif
if (cacheEnabled)
{
Cache::Enable();
@@ -66,7 +70,11 @@ void NonVolatileMemory::EnsureWritten() noexcept
{
// Erase the page
# if SAM4E || SAM4S || SAME70
+# if SAME70
Flash::EraseUserSignature();
+# else
+ flash_erase_user_signature();
+# endif
# elif defined(__LPC17xx__)
LPC_EraseSoftwareResetDataSlots(); // erase the last flash sector
# endif
@@ -77,7 +85,11 @@ void NonVolatileMemory::EnsureWritten() noexcept
{
# if SAM4E || SAM4S || SAME70
const bool cacheEnabled = Cache::Disable();
+# if SAME70
Flash::WriteUserSignature(reinterpret_cast<const uint32_t*>(&buffer));
+# else
+ flash_write_user_signature(reinterpret_cast<const uint32_t*>(&buffer));
+# endif
if (cacheEnabled)
{
Cache::Enable();
diff --git a/src/Hardware/SharedSpi/SharedSpiDevice.cpp b/src/Hardware/SharedSpi/SharedSpiDevice.cpp
index c7c9c4d2..cc6a6783 100644
--- a/src/Hardware/SharedSpi/SharedSpiDevice.cpp
+++ b/src/Hardware/SharedSpi/SharedSpiDevice.cpp
@@ -15,7 +15,9 @@
# include <peripheral_clk_config.h>
# include <hri_sercom_e54.h>
#elif USART_SPI
-# include <pmc/pmc.h>
+# if SAME70
+# include <pmc/pmc.h>
+# endif
# include <usart/usart.h>
#else
# include <spi/spi.h>
@@ -345,9 +347,15 @@ void SharedSpiDevice::Init() noexcept
SetPinFunction(SharedSpiSclkPin, SharedSpiPinFunction);
mainSharedSpiDevice = new SharedSpiDevice(SharedSpiSercomNumber);
#elif USART_SPI
+# if SAME70
SetPinFunction(APIN_USART_SSPI_SCK, USARTSSPIPeriphMode);
SetPinFunction(APIN_USART_SSPI_MOSI, USARTSSPIPeriphMode);
SetPinFunction(APIN_USART_SSPI_MISO, USARTSSPIPeriphMode);
+# else
+ ConfigurePin(APIN_USART_SSPI_SCK);
+ ConfigurePin(APIN_USART_SSPI_MOSI);
+ ConfigurePin(APIN_USART_SSPI_MISO);
+#endif
mainSharedSpiDevice = new SharedSpiDevice(0);
#else
ConfigurePin(g_APinDescription[APIN_SHARED_SPI_SCK]);
diff --git a/src/Platform.cpp b/src/Platform.cpp
index b82d029c..4ba4ee43 100644
--- a/src/Platform.cpp
+++ b/src/Platform.cpp
@@ -876,7 +876,11 @@ void Platform::ReadUniqueId()
memset(uniqueId, 0, sizeof(uniqueId));
const bool cacheWasEnabled = Cache::Disable();
+#if SAME70
const bool success = Flash::ReadUniqueId(uniqueId);
+#else
+ const bool success = flash_read_unique_id(uniqueId) == 0;
+#endif
if (cacheWasEnabled)
{
Cache::Enable();
diff --git a/src/RepRap.cpp b/src/RepRap.cpp
index b93018d5..cfc787a6 100644
--- a/src/RepRap.cpp
+++ b/src/RepRap.cpp
@@ -2834,8 +2834,10 @@ void RepRap::StartIap() noexcept
WatchdogReset(); // kick the watchdog one last time
-#if SAM4E || SAME70
- WatchdogResetSecondary(); // kick the secondary watchdog
+#if SAM4E
+ rswdt_restart(RSWDT); // kick the secondary watchdog
+#elif SAME70
+ WatchdogResetSecondary(); // kick the secondary watchdog
#endif
// Modify vector table location