diff options
-rw-r--r-- | src/CAN/CanInterface.cpp | 6 | ||||
-rw-r--r-- | src/Platform/Platform.cpp | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/CAN/CanInterface.cpp b/src/CAN/CanInterface.cpp index 96bfd602..6bcdb362 100644 --- a/src/CAN/CanInterface.cpp +++ b/src/CAN/CanInterface.cpp @@ -1173,10 +1173,10 @@ GCodeResult CanInterface::RemoteDiagnostics(MessageType mt, uint32_t boardAddres if (type == (uint16_t)DiagnosticTestType::AccessMemory) { gb.MustSee('A'); - msg->param32[0] = gb.GetUIValue(); + msg->param32[0] = (uint32_t)gb.GetIValue(); // allow negative values so that we can read high memory addresses if (gb.Seen('V')) { - msg->param32[1] = gb.GetUIValue(); + msg->param32[1] = (uint32_t)gb.GetIValue(); // allow negative values so that we set high values msg->param16 = 1; } else @@ -1184,7 +1184,7 @@ GCodeResult CanInterface::RemoteDiagnostics(MessageType mt, uint32_t boardAddres msg->param16 = 0; } } - return SendRequestAndGetStandardReply(buf, rid, reply); // we may not actually get a reply if the test is one that crashes the expansion board + return SendRequestAndGetStandardReply(buf, rid, reply); // we may not actually get a reply if the test is one that crashes the expansion board } GCodeResult CanInterface::RemoteM408(uint32_t boardAddress, unsigned int type, GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeException) diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp index 9c392fb1..15ead4cd 100644 --- a/src/Platform/Platform.cpp +++ b/src/Platform/Platform.cpp @@ -2035,16 +2035,16 @@ GCodeResult Platform::DiagnosticTest(GCodeBuffer& gb, const StringRef& reply, Ou case (unsigned int)DiagnosticTestType::AccessMemory: { gb.MustSee('A'); - uint32_t address = gb.GetUIValue(); + uint32_t address = (uint32_t)gb.GetIValue(); // allow negative values here so that we can read high addresses unsigned int numValues = (gb.Seen('R')) ? gb.GetUIValue() : 1; - uint32_t val; + int32_t val; bool dummy; deliberateError = true; // in case the memory access causes a fault - if (gb.TryGetUIValue('V', val, dummy)) + if (gb.TryGetIValue('V', val, dummy)) // allow negative values so that we can use values like 0xffffffff { while (numValues != 0) { - *reinterpret_cast<uint32_t*>(address) = val; + *reinterpret_cast<uint32_t*>(address) = (uint32_t)val; address += 4; --numValues; } |