From c0d70dd9ceb2eec3f2ae7c26a53fad47b6d24073 Mon Sep 17 00:00:00 2001 From: David Crocker Date: Sun, 29 Dec 2019 09:35:50 +0000 Subject: 3.0RC2 final (I hope) Bug fix to StringParser when a Pi is attached --- src/GCodes/GCodeBuffer/StringParser.cpp | 6 +++++- src/RADDS/Pins_RADDS.h | 30 ++++++++++++++++++++---------- src/RepRap.cpp | 6 +++--- src/Version.h | 2 +- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/GCodes/GCodeBuffer/StringParser.cpp b/src/GCodes/GCodeBuffer/StringParser.cpp index ee05cc30..cf115be3 100644 --- a/src/GCodes/GCodeBuffer/StringParser.cpp +++ b/src/GCodes/GCodeBuffer/StringParser.cpp @@ -590,7 +590,11 @@ void StringParser::SetFinished() FilePosition StringParser::GetFilePosition() const { #if HAS_MASS_STORAGE - if (gb.machineState->DoingFile()) + if (gb.machineState->DoingFile() +# if HAS_LINUX_INTERFACE + && !reprap.UsingLinuxInterface() +# endif + ) { return gb.machineState->fileState.GetPosition() - gb.fileInput->BytesCached() - commandLength + commandStart; } diff --git a/src/RADDS/Pins_RADDS.h b/src/RADDS/Pins_RADDS.h index 5ffc7dae..7d4c4825 100644 --- a/src/RADDS/Pins_RADDS.h +++ b/src/RADDS/Pins_RADDS.h @@ -2,6 +2,23 @@ #define PINS_DUET_H__ #define FIRMWARE_NAME "RepRapFirmware for RADDS" +#define IAP_FIRMWARE_FILE "RepRapFirmware-RADDS.bin" + +#define IAP_IN_RAM 0 + +#if IAP_IN_RAM + +// TODO + +#else + +constexpr uint32_t IAP_IMAGE_START = 0x000F0000; +constexpr uint32_t IAP_IMAGE_END = 0x000FFBFF; // don't touch the last 1KB, it's used for NvData +# define IAP_UPDATE_FILE "iapradds.bin" + +#endif + +const size_t NumFirmwareUpdateModules = 1; // Features definition #define HAS_LWIP_NETWORKING 0 @@ -12,10 +29,6 @@ #define HAS_VREF_MONITOR 0 #define ACTIVE_LOW_HEAT_ON 0 -const size_t NumFirmwareUpdateModules = 1; -#define IAP_UPDATE_FILE "iapradds.bin" -#define IAP_FIRMWARE_FILE "RepRapFirmware-RADDS.bin" - // Default board type #define DEFAULT_BOARD_TYPE BoardType::RADDS_15 #define ELECTRONICS "RADDS" @@ -33,8 +46,7 @@ const size_t NumFirmwareUpdateModules = 1; // The number of drives in the machine, including X, Y, and Z plus extruder drives constexpr size_t NumDirectDrivers = 9; -constexpr size_t MaxSensorsInSystem = 32; -typedef uint32_t SensorsBitmap; +constexpr size_t MaxSensors = 32; constexpr size_t MaxHeaters = 3; constexpr size_t MaxExtraHeaterProtections = 4; // The number of extra heater protection instances @@ -63,6 +75,8 @@ constexpr size_t MaxExtrudersPerTool = 5; constexpr size_t MaxFans = 12; +constexpr unsigned int MaxTriggers = 16; // Must be <= 32 because we store a bitmap of pending triggers in a uint32_t + constexpr size_t NUM_SERIAL_CHANNELS = 2; // Use TX0/RX0 for the auxiliary serial line #define SERIAL_MAIN_DEVICE SerialUSB @@ -238,10 +252,6 @@ constexpr PwmFrequency DefaultFanPwmFrequencies[] = { DefaultFanPwmFreq }; // Function to look up a pin name pass back the corresponding index into the pin table bool LookupPinName(const char *pn, LogicalPin& lpin, bool& hardwareInverted); -// SAM3X Flash locations (may be expanded in the future) -constexpr uint32_t IAP_FLASH_START = 0x000F0000; -constexpr uint32_t IAP_FLASH_END = 0x000FFBFF; // don't touch the last 1KB, it's used for NvData - // Timer allocation #define NETWORK_TC (TC1) #define NETWORK_TC_CHAN (1) diff --git a/src/RepRap.cpp b/src/RepRap.cpp index 53e2c73c..399b0403 100644 --- a/src/RepRap.cpp +++ b/src/RepRap.cpp @@ -2481,7 +2481,7 @@ void RepRap::UpdateFirmware() noexcept # else // SAM3X code - for (uint32_t flashAddr = IAP_FLASH_START; flashAddr < IAP_FLASH_END; flashAddr += IFLASH_PAGE_SIZE) + for (uint32_t flashAddr = IAP_IMAGE_START; flashAddr < IAP_IMAGE_END; flashAddr += IFLASH_PAGE_SIZE) { const int bytesRead = iapFile->Read(data, IFLASH_PAGE_SIZE); @@ -2513,13 +2513,13 @@ void RepRap::UpdateFirmware() noexcept if (rc != FLASH_RC_OK) { - MessageF(FirmwareUpdateErrorMessage, "flash %s failed, code=%" PRIu32 ", address=0x%08" PRIx32 "\n", op, rc, flashAddr); + platform->MessageF(FirmwareUpdateErrorMessage, "flash %s failed, code=%" PRIu32 ", address=0x%08" PRIx32 "\n", op, rc, flashAddr); return; } // Verify written data if (memcmp(reinterpret_cast(flashAddr), data, bytesRead) != 0) { - MessageF(FirmwareUpdateErrorMessage, "verify during flash write failed, address=0x%08" PRIx32 "\n", flashAddr); + platform->MessageF(FirmwareUpdateErrorMessage, "verify during flash write failed, address=0x%08" PRIx32 "\n", flashAddr); return; } } diff --git a/src/Version.h b/src/Version.h index d5e981f9..e104a766 100644 --- a/src/Version.h +++ b/src/Version.h @@ -20,7 +20,7 @@ #endif #ifndef DATE -# define DATE "2019-12-28b2" +# define DATE "2019-12-29b1" #endif #define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman, printm3d" -- cgit v1.2.3