diff options
author | Christian Hammacher <bmasterc@gmail.com> | 2021-06-04 10:08:30 +0300 |
---|---|---|
committer | Christian Hammacher <bmasterc@gmail.com> | 2021-06-04 10:08:30 +0300 |
commit | ffbb0080f75dc69a0fb0a52a57f4f5b4102e64e0 (patch) | |
tree | cf60c65238cc2a87ec64950be4a5754bb236ee9f | |
parent | c2896dbc1f7738ad9c412aa8a57166e0e54548fc (diff) | |
parent | 6200d42e0254e91112baf62abef1c533c8fe95f5 (diff) |
Merge remote-tracking branch 'origin/3.3-dev' into v3-chrishamm
-rw-r--r-- | src/Linux/LinuxInterface.cpp | 10 | ||||
-rw-r--r-- | src/Linux/LinuxMessageFormats.h | 2 | ||||
-rw-r--r-- | src/Platform/TaskPriorities.h | 3 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/Linux/LinuxInterface.cpp b/src/Linux/LinuxInterface.cpp index 9545a8f0..db9a4a30 100644 --- a/src/Linux/LinuxInterface.cpp +++ b/src/Linux/LinuxInterface.cpp @@ -69,7 +69,7 @@ void LinuxInterface::Init() noexcept transfer.Init(); sbcTask = new Task<SBCTaskStackWords>; - sbcTask->Create(SBCTaskStart, "SBC", nullptr, TaskPriority::SpinPriority); + sbcTask->Create(SBCTaskStart, "SBC", nullptr, TaskPriority::SbcPriority); iapRamAvailable = &_estack - Tasks::GetHeapTop(); } @@ -352,9 +352,9 @@ void LinuxInterface::Init() noexcept // Return heightmap as generated by G29 S0 case LinuxRequest::GetHeightMap: { - if (!reprap.GetMove().heightMapLock.IsLocked()) + ConditionalReadLocker locker(reprap.GetMove().heightMapLock); + if (locker.IsLocked()) { - ReadLocker locker(reprap.GetMove().heightMapLock); packetAcknowledged = transfer.WriteHeightMap(); } else @@ -367,9 +367,9 @@ void LinuxInterface::Init() noexcept // Set heightmap via G29 S1 case LinuxRequest::SetHeightMap: { - if (!reprap.GetMove().heightMapLock.IsLocked()) + ConditionalWriteLocker locker(reprap.GetMove().heightMapLock); + if (locker.IsLocked()) { - WriteLocker locker(reprap.GetMove().heightMapLock); if (!transfer.ReadHeightMap()) { reprap.GetPlatform().Message(ErrorMessage, "Failed to set height map - bad data?\n"); diff --git a/src/Linux/LinuxMessageFormats.h b/src/Linux/LinuxMessageFormats.h index 9c690684..98d5110f 100644 --- a/src/Linux/LinuxMessageFormats.h +++ b/src/Linux/LinuxMessageFormats.h @@ -29,7 +29,7 @@ static_assert(MaxCodeBufferSize >= GCODE_LENGTH, "MaxCodeBufferSize must be at l constexpr uint32_t SpiMacroRequestTimeout = 3000; // maximum time to wait a macro file constexpr uint32_t SpiTransferTimeout = 500; // maximum allowed delay between data exchanges during a full transfer (in ms) -constexpr uint32_t SpiConnectionTimeout = 4000; // maximum time to wait for the next transfer (in ms) +constexpr uint32_t SpiConnectionTimeout = 8000; // maximum time to wait for the next transfer (in ms) constexpr uint16_t SpiCodeBufferSize = 4096; // number of bytes available for G-code caching // Shared structures diff --git a/src/Platform/TaskPriorities.h b/src/Platform/TaskPriorities.h index cc9ab004..b65f1568 100644 --- a/src/Platform/TaskPriorities.h +++ b/src/Platform/TaskPriorities.h @@ -13,6 +13,9 @@ namespace TaskPriority { constexpr int IdlePriority = 0; constexpr int SpinPriority = 1; // priority for tasks that rarely block +#if HAS_LINUX_INTERFACE + constexpr int SbcPriority = 1; // priority for SBC task +#endif #if defined(LPC_NETWORKING) constexpr int TcpPriority = 2; //EMAC priority = 3 defined in FreeRTOSIPConfig.h |