diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-10-31 00:05:13 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-10-31 00:05:13 +0300 |
commit | 22276b993bc8db027d55d8d47de4559ad10ca044 (patch) | |
tree | a69319e723ce32ce0e638057c325473fe3b16691 | |
parent | 4d27cc210b6af47b3e99353c67568a157fb484ed (diff) |
Added explicit constructor calls
-rw-r--r-- | src/Accelerometers/LIS3DH.cpp | 2 | ||||
-rw-r--r-- | src/DuetNG/DueXn.cpp | 2 | ||||
-rw-r--r-- | src/Endstops/LocalZProbe.cpp | 2 | ||||
-rw-r--r-- | src/Fans/LocalFan.cpp | 2 | ||||
-rw-r--r-- | src/FilamentMonitors/FilamentMonitor.cpp | 4 | ||||
-rw-r--r-- | src/Heating/Sensors/DhtSensor.cpp | 4 | ||||
-rw-r--r-- | src/Movement/DDARing.cpp | 2 | ||||
-rw-r--r-- | src/Networking/ESP8266WiFi/WiFiInterface.cpp | 2 | ||||
-rw-r--r-- | src/Platform/Platform.cpp | 4 | ||||
-rw-r--r-- | src/RepRapFirmware.h | 2 |
10 files changed, 13 insertions, 13 deletions
diff --git a/src/Accelerometers/LIS3DH.cpp b/src/Accelerometers/LIS3DH.cpp index c254c71b..4fd80be6 100644 --- a/src/Accelerometers/LIS3DH.cpp +++ b/src/Accelerometers/LIS3DH.cpp @@ -179,7 +179,7 @@ bool LIS3DH:: StartCollecting(uint8_t axes) noexcept totalNumRead = 0; const bool ok = WriteRegister(LisRegister::Ctrl_0x20, ctrlReg_0x20 | (axes & 7)); - return ok && attachInterrupt(int1Pin, Int1Interrupt, InterruptMode::rising, this); + return ok && attachInterrupt(int1Pin, Int1Interrupt, InterruptMode::rising, CallbackParameter(this)); } // Collect some data from the FIFO, suspending until the data is available diff --git a/src/DuetNG/DueXn.cpp b/src/DuetNG/DueXn.cpp index 7b59b49e..caa6167d 100644 --- a/src/DuetNG/DueXn.cpp +++ b/src/DuetNG/DueXn.cpp @@ -145,7 +145,7 @@ void DuetExpansion::DueXnTaskInit() noexcept if (dueXnBoardType != ExpansionBoardType::none) { // Set up the interrupt on any input change - attachInterrupt(DueX_INT, DueXIrq, InterruptMode::falling, nullptr); + attachInterrupt(DueX_INT, DueXIrq, InterruptMode::falling, CallbackParameter(nullptr)); // Clear any initial interrupts (void)dueXnExpander.interruptSourceAndClear(); diff --git a/src/Endstops/LocalZProbe.cpp b/src/Endstops/LocalZProbe.cpp index 98b8a94e..3fad705f 100644 --- a/src/Endstops/LocalZProbe.cpp +++ b/src/Endstops/LocalZProbe.cpp @@ -159,7 +159,7 @@ GCodeResult LocalZProbe::SendProgram(const uint32_t zProbeProgram[], size_t len, modulationPort.WriteDigital(false); // start with 2 bits of zero startTime = StepTimer::GetTimerTicks(); - timer.SetCallback(LocalZProbe::TimerInterrupt, static_cast<void*>(this)); + timer.SetCallback(LocalZProbe::TimerInterrupt, CallbackParameter(this)); timer.ScheduleCallback(startTime + 2 * bitTime); // TODO wait until all bytes sent or some error occurs, but for now we return immediately diff --git a/src/Fans/LocalFan.cpp b/src/Fans/LocalFan.cpp index 13566f8a..3acfce43 100644 --- a/src/Fans/LocalFan.cpp +++ b/src/Fans/LocalFan.cpp @@ -206,7 +206,7 @@ bool LocalFan::AssignPorts(const char *pinNames, const StringRef& reply) noexcep // Tacho initialisation if (tachoPort.IsValid()) { - tachoPort.AttachInterrupt(FanInterrupt, InterruptMode::falling, this); + tachoPort.AttachInterrupt(FanInterrupt, InterruptMode::falling, CallbackParameter(this)); } InternalRefresh(true); diff --git a/src/FilamentMonitors/FilamentMonitor.cpp b/src/FilamentMonitors/FilamentMonitor.cpp index f44871a6..95e68357 100644 --- a/src/FilamentMonitors/FilamentMonitor.cpp +++ b/src/FilamentMonitors/FilamentMonitor.cpp @@ -110,7 +110,7 @@ GCodeResult FilamentMonitor::CommonConfigure(GCodeBuffer& gb, const StringRef& r } haveIsrStepsCommanded = false; - if (interruptMode != InterruptMode::none && !port.AttachInterrupt(InterruptEntry, interruptMode, this)) + if (interruptMode != InterruptMode::none && !port.AttachInterrupt(InterruptEntry, interruptMode, CallbackParameter(this))) { reply.copy("unsuitable pin"); return GCodeResult::error; @@ -457,7 +457,7 @@ GCodeResult FilamentMonitor::CommonConfigure(const CanMessageGenericParser& pars } haveIsrStepsCommanded = false; - if (interruptMode != InterruptMode::none && !port.AttachInterrupt(InterruptEntry, interruptMode, this)) + if (interruptMode != InterruptMode::none && !port.AttachInterrupt(InterruptEntry, interruptMode, CallbackParameter(this))) { reply.copy("unsuitable pin"); return GCodeResult::error; diff --git a/src/Heating/Sensors/DhtSensor.cpp b/src/Heating/Sensors/DhtSensor.cpp index 521e25bb..748593fc 100644 --- a/src/Heating/Sensors/DhtSensor.cpp +++ b/src/Heating/Sensors/DhtSensor.cpp @@ -67,7 +67,7 @@ GCodeResult DhtTemperatureSensor::Configure(GCodeBuffer& gb, const StringRef& re } numPulses = ARRAY_SIZE(pulses); // tell the ISR not to collect data yet - if (!interruptPort.AttachInterrupt(DhtDataTransition, InterruptMode::change, this)) + if (!interruptPort.AttachInterrupt(DhtDataTransition, InterruptMode::change, CallbackParameter(this))) { reply.copy("failed to attach interrupt to port "); interruptPort.AppendPinName(reply); @@ -193,7 +193,7 @@ void DhtTemperatureSensor::TakeReading() noexcept // It appears that switching the pin to an output disables the interrupt, so we need to call attachInterrupt here // We are likely to get an immediate interrupt at this point corresponding to the low-to-high transition. We must ignore this. - irqPort.AttachInterrupt(DhtDataTransition, InterruptMode::change, this); + irqPort.AttachInterrupt(DhtDataTransition, InterruptMode::change, CallbackParameter(this)); delayMicroseconds(2); // give the interrupt time to occur lastPulseTime = 0; numPulses = 0; // tell the ISR to collect data diff --git a/src/Movement/DDARing.cpp b/src/Movement/DDARing.cpp index 27cd1aa7..c15b5809 100644 --- a/src/Movement/DDARing.cpp +++ b/src/Movement/DDARing.cpp @@ -62,7 +62,7 @@ void DDARing::Init1(unsigned int numDdas) noexcept getPointer = checkPointer = addPointer; currentDda = nullptr; - timer.SetCallback(DDARing::TimerCallback, static_cast<void*>(this)); + timer.SetCallback(DDARing::TimerCallback, CallbackParameter(this)); } // This must be called from Move::Init, not from the Move constructor, because it indirectly refers to the GCodes module which must therefore be initialised first diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.cpp b/src/Networking/ESP8266WiFi/WiFiInterface.cpp index fa436053..ed27f7dc 100644 --- a/src/Networking/ESP8266WiFi/WiFiInterface.cpp +++ b/src/Networking/ESP8266WiFi/WiFiInterface.cpp @@ -226,7 +226,7 @@ static void EspTransferRequestIsr(CallbackParameter) noexcept static inline void EnableEspInterrupt() noexcept { - attachInterrupt(EspDataReadyPin, EspTransferRequestIsr, InterruptMode::rising, nullptr); + attachInterrupt(EspDataReadyPin, EspTransferRequestIsr, InterruptMode::rising, CallbackParameter(nullptr)); } static inline void DisableEspInterrupt() noexcept diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp index be34c04a..086daf08 100644 --- a/src/Platform/Platform.cpp +++ b/src/Platform/Platform.cpp @@ -799,9 +799,9 @@ void Platform::Init() noexcept #if HAS_CPU_TEMP_SENSOR # if SAME5x tpFilter.Init(0); - AnalogIn::EnableTemperatureSensor(0, tpFilter.CallbackFeedIntoFilter, &tpFilter, 1, 0); + AnalogIn::EnableTemperatureSensor(0, tpFilter.CallbackFeedIntoFilter, CallbackParameter(&tpFilter), 1, 0); tcFilter.Init(0); - AnalogIn::EnableTemperatureSensor(1, tcFilter.CallbackFeedIntoFilter, &tcFilter, 1, 0); + AnalogIn::EnableTemperatureSensor(1, tcFilter.CallbackFeedIntoFilter, CallbackParameter(&tcFilter), 1, 0); TemperatureCalibrationInit(); # else filteredAdcChannels[CpuTempFilterIndex] = diff --git a/src/RepRapFirmware.h b/src/RepRapFirmware.h index b741cb38..ef1420d6 100644 --- a/src/RepRapFirmware.h +++ b/src/RepRapFirmware.h @@ -28,7 +28,7 @@ Licence: GPL #include <climits> // for CHAR_BIT #include <ctime> -[[deprecated("use gmtime_r instead for thread-safety")]] tm* gmtime(const time_t* time); +[[deprecated("use gmtime_r instead for thread-safety")]] tm* gmtime(const time_t* t); [[deprecated("use SafeStrptime instead")]] char * strptime (const char *buf, const char *format, struct tm *timeptr); const char *SafeStrptime(const char *buf, const char *format, struct tm *timeptr) noexcept; |