diff options
author | David Crocker <dcrocker@eschertech.com> | 2017-08-14 21:41:49 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2017-08-14 21:41:49 +0300 |
commit | f8507434bd770432a2b424af28dd42057996cdf3 (patch) | |
tree | e299a71367bca733f79b34f1b6765c8359462ca8 /src/Platform.cpp | |
parent | ba7778b3e6f278fed1f5d30d31ed2a2a8be7369c (diff) |
Version 1.19 releasev1.19
Fixed some filament sensor issues
Diffstat (limited to 'src/Platform.cpp')
-rw-r--r-- | src/Platform.cpp | 75 |
1 files changed, 7 insertions, 68 deletions
diff --git a/src/Platform.cpp b/src/Platform.cpp index 5d037a84..d62169aa 100644 --- a/src/Platform.cpp +++ b/src/Platform.cpp @@ -478,7 +478,6 @@ void Platform::Init() { extruderDrivers[extr] = (uint8_t)(extr + MinAxes); // set up default extruder drive mapping SetPressureAdvance(extr, 0.0); // no pressure advance - filamentSensors[extr] = nullptr; // no filament sensor } #ifdef DUET_NG @@ -1531,36 +1530,6 @@ void Platform::Spin() } #endif - // Filament sensors - for (size_t extruder = 0; extruder < MaxExtruders; ++extruder) - { - if (filamentSensors[extruder] != nullptr) - { - GCodes& gCodes = reprap.GetGCodes(); - const float extrusionCommanded = (float)reprap.GetMove().GetAccumulatedExtrusion(extruder)/driveStepsPerUnit[extruder + gCodes.GetTotalAxes()]; - // get and clear the Move extrusion commanded - if (reprap.GetPrintMonitor().IsPrinting() && !gCodes.IsPausing() && !gCodes.IsResuming() && !gCodes.IsPaused()) - { - const FilamentSensorStatus fstat = filamentSensors[extruder]->Check(extrusionCommanded); - if (fstat != FilamentSensorStatus::ok && extrusionCommanded > 0.0) - { - if (reprap.Debug(moduleFilamentSensors)) - { - debugPrintf("Filament error: extruder %u reports %s\n", extruder, FilamentSensor::GetErrorMessage(fstat)); - } - else - { - gCodes.FilamentError(extruder, fstat); - } - } - } - else - { - filamentSensors[extruder]->Clear(); - } - } - } - ClassReport(longWait); } @@ -1799,6 +1768,12 @@ void Platform::InitialiseInterrupts() NVIC_SetPriority(PIOE_IRQn, NvicPriorityPins); #endif +#if SAM3XA + NVIC_SetPriority(UOTGHS_IRQn, NvicPriorityUSB); +#endif +#if SAM4E + NVIC_SetPriority(UDP_IRQn, NvicPriorityUSB); +#endif NVIC_SetPriority(TWI1_IRQn, NvicPriorityTwi); // Interrupt for 4-pin PWM fan sense line @@ -1814,7 +1789,7 @@ void Platform::InitialiseInterrupts() // Set up the timeout of the regulator watchdog, and set up the backup watchdog if there is one // The clock frequency for both watchdogs is 32768/128 = 256Hz const uint16_t timeout = 32768/128; // set watchdog timeout to 1 second (max allowed value is 4095 = 16 seconds) - wdt_init(WDT, WDT_MR_WDRSTEN, timeout,timeout); // reset the processor on a watchdog fault + wdt_init(WDT, WDT_MR_WDRSTEN, timeout, timeout); // reset the processor on a watchdog fault active = true; // this enables the tick interrupt, which keeps the watchdog happy } @@ -2060,15 +2035,6 @@ void Platform::Diagnostics(MessageType mtype) } #endif - // Filament sensors - for (size_t i = 0; i < MaxExtruders; ++i) - { - if (filamentSensors[i] != nullptr) - { - filamentSensors[i]->Diagnostics(mtype, i); - } - } - // Show current RTC time Message(mtype, "Date/time: "); struct tm timeInfo; @@ -3370,39 +3336,12 @@ bool Platform::SetExtrusionAncilliaryPwmPin(int logicalPin) return GetFirmwarePin(logicalPin, PinAccess::pwm, extrusionAncilliaryPwmFirmwarePin, extrusionAncilliaryPwmInvert); } -// Filament sensor support -// Get the filament sensor object for an extruder, or nullptr if there isn't one -FilamentSensor *Platform::GetFilamentSensor(int extruder) const -{ - return (extruder >= 0 && extruder < (int)MaxExtruders) ? filamentSensors[extruder] : nullptr; -} - -// Set the filament sensor type for an extruder, returning true if it has changed. -// Passing newSensorType as 0 sets no sensor. -bool Platform::SetFilamentSensorType(int extruder, int newSensorType) -{ - if (extruder >= 0 && extruder < (int)MaxExtruders) - { - FilamentSensor*& sensor = filamentSensors[extruder]; - const int oldSensorType = (sensor == nullptr) ? 0 : sensor->GetType(); - if (newSensorType != oldSensorType) - { - delete sensor; - sensor = FilamentSensor::Create(newSensorType); - return true; - } - } - - return false; -} - // Get the firmware pin number for an endstop, or NoPin if it is out of range Pin Platform::GetEndstopPin(int endstop) const { return (endstop >= 0 && endstop < (int)ARRAY_SIZE(endStopPins)) ? endStopPins[endstop] : NoPin; } - #if SUPPORT_INKJET // Fire the inkjet (if any) in the given pattern |