Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2020-04-21 01:19:48 +0300
committerDavid Crocker <dcrocker@eschertech.com>2020-04-21 01:19:48 +0300
commitd16be9efe85af602b8d34bd4b42b5bb706168a86 (patch)
tree9dd141abe0221a4c0e915623f5bdce067477714e /src/DuetNG/DueXn.cpp
parent64e172adf08f72d766d0abc26002ad9ef3ac0137 (diff)
Fixed to fan handling, more noexcept
Fixed fan handling so that blip time doesn't get randomly extended Added missing noexcept specifiers, including to C functions because doing so eliminates exception table entries for client C++ functions
Diffstat (limited to 'src/DuetNG/DueXn.cpp')
-rw-r--r--src/DuetNG/DueXn.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/DuetNG/DueXn.cpp b/src/DuetNG/DueXn.cpp
index 4f23199f..3ac8f139 100644
--- a/src/DuetNG/DueXn.cpp
+++ b/src/DuetNG/DueXn.cpp
@@ -66,7 +66,7 @@ namespace DuetExpansion
// ISR for when the SX1509B on the DueX indicates that the state of an input has changed.
// Note, we must only wake up the DueX task if it is waiting on this specific interrupt.
// Otherwise we might wake it prematurely when it is waiting for an I2C transaction to be completed.
- static void DueXIrq(CallbackParameter p)
+ static void DueXIrq(CallbackParameter p) noexcept
{
inputsChanged = true;
if (taskWaiting)
@@ -76,7 +76,7 @@ namespace DuetExpansion
}
}
- extern "C" [[noreturn]] void DueXTask(void * pvParameters)
+ extern "C" [[noreturn]] void DueXTask(void * pvParameters) noexcept
{
for (;;)
{
@@ -98,7 +98,7 @@ namespace DuetExpansion
}
// Identify which expansion board (if any) is attached and initialise it
- ExpansionBoardType DueXnInit()
+ ExpansionBoardType DueXnInit() noexcept
{
I2C::Init(); // initialise I2C
delay(200); // the SX1509B has an independent power on reset, so give it some time
@@ -142,7 +142,7 @@ namespace DuetExpansion
// Create the DueXn task and enable the associated interrupt from the DueXn.
// This must be called after interrupt priorities have been configured, to comply with FreeRTOS constraints.
- void DueXnTaskInit()
+ void DueXnTaskInit() noexcept
{
if (dueXnBoardType != ExpansionBoardType::none)
{
@@ -158,7 +158,7 @@ namespace DuetExpansion
}
// Look for an additional output pin expander
- void AdditionalOutputInit()
+ void AdditionalOutputInit() noexcept
{
I2C::Init(); // initialise I2C
@@ -181,7 +181,7 @@ namespace DuetExpansion
}
// Return the name of the expansion board, or nullptr if no expansion board
- const char* _ecv_array null GetExpansionBoardName()
+ const char* _ecv_array null GetExpansionBoardName() noexcept
{
switch(dueXnBoardType)
{
@@ -197,13 +197,13 @@ namespace DuetExpansion
}
// Return the name of the additional expansion board, or nullptr if no expansion board
- const char* _ecv_array null GetAdditionalExpansionBoardName()
+ const char* _ecv_array null GetAdditionalExpansionBoardName() noexcept
{
return (additionalIoExpanderPresent) ? "SX1509B expander" : nullptr;
}
// Set the I/O mode of a pin
- void SetPinMode(Pin pin, PinMode mode)
+ void SetPinMode(Pin pin, PinMode mode) noexcept
{
if (pin >= DueXnExpansionStart && pin < DueXnExpansionStart + 16)
{
@@ -247,7 +247,7 @@ namespace DuetExpansion
// Read a pin
// We need to use the SX1509 interrupt to read the data register using interrupts, and just retrieve that value here.
- bool DigitalRead(Pin pin)
+ bool DigitalRead(Pin pin) noexcept
{
if (pin >= DueXnExpansionStart && pin < DueXnExpansionStart + 16)
{
@@ -281,7 +281,7 @@ namespace DuetExpansion
}
// Write a pin
- void DigitalWrite(Pin pin, bool high)
+ void DigitalWrite(Pin pin, bool high) noexcept
{
if (pin >= DueXnExpansionStart && pin < DueXnExpansionStart + 16)
{
@@ -300,7 +300,7 @@ namespace DuetExpansion
}
// Set the PWM value on this pin
- void AnalogOut(Pin pin, float pwm)
+ void AnalogOut(Pin pin, float pwm) noexcept
{
if (pin >= DueXnExpansionStart && pin < DueXnExpansionStart + 16)
{
@@ -320,12 +320,12 @@ namespace DuetExpansion
// Print diagnostic data
// I2C error counts are now reported by Platform, so nothing to report here.
- void Diagnostics(MessageType mtype)
+ void Diagnostics(MessageType mtype) noexcept
{
}
// Diagnose the SX1509 by setting all pins as inputs and reading them
- uint16_t DiagnosticRead()
+ uint16_t DiagnosticRead() noexcept
{
dueXnExpander.pinModeMultiple(AllStopBitsX5 | AllGpioBits | AllFanBits, INPUT); // Initialise the endstop inputs and GPIO pins (no pullups because 5V-tolerant)
delay(1);