Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Remove unused template parameter from GeneralPurposeTimer::signalToChannel() #1142

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/modm/platform/timer/stm32/advanced.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public:
static void
setOutputIdleState(OutputIdleState idle, OutputIdleState idle_n = OutputIdleState::Reset)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
setOutputIdleState(channel, idle, idle_n);
}

Expand Down Expand Up @@ -408,7 +408,7 @@ public:
static void
configureInputChannel(uint8_t filter)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureInputChannel(channel, filter);
}

Expand All @@ -425,7 +425,7 @@ public:
InputCapturePolarity polarity, uint8_t filter,
bool xor_ch1_3=false)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureInputChannel(channel, input, prescaler, polarity, filter, xor_ch1_3);
}

Expand All @@ -441,7 +441,7 @@ public:
configureOutputChannel(OutputCompareMode mode,
Value compareValue, PinState out = PinState::Enable)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureOutputChannel(channel, mode, compareValue, out);
}

Expand All @@ -460,7 +460,7 @@ public:
OutputComparePolarity polarity_n = OutputComparePolarity::ActiveHigh,
OutputComparePreload preload = OutputComparePreload::Disable)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureOutputChannel(channel, mode, compareValue, out, polarity, out_n, polarity_n, preload);
}

Expand Down Expand Up @@ -491,7 +491,7 @@ public:
OutputComparePolarity polarity_n = OutputComparePolarity::ActiveHigh,
OutputComparePreload preload = OutputComparePreload::Disable)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureOutputChannel(channel, mode, out, polarity, out_n, polarity_n, preload);
}

Expand Down Expand Up @@ -522,7 +522,7 @@ public:
static void
configureOutputChannel(uint32_t modeOutputPorts)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureOutputChannel(channel, modeOutputPorts);
}

Expand All @@ -546,7 +546,7 @@ public:
static void
setCompareValue(Value value)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
setCompareValue(channel, value);
}

Expand All @@ -560,7 +560,7 @@ public:
static inline Value
getCompareValue()
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
return getCompareValue(channel);
}

Expand Down
22 changes: 11 additions & 11 deletions src/modm/platform/timer/stm32/general_purpose.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public:
static void
configureInputChannel(uint8_t filter)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureInputChannel(channel, filter);
}

Expand All @@ -422,7 +422,7 @@ public:
InputCapturePolarity polarity, uint8_t filter,
bool xor_ch1_3=false)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureInputChannel(channel, input, prescaler, polarity, filter, xor_ch1_3);
}

Expand All @@ -437,7 +437,7 @@ public:
Value compareValue, PinState out = PinState::Enable,
bool enableComparePreload = true)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureOutputChannel(channel, mode, compareValue, out, enableComparePreload);
}

Expand All @@ -454,7 +454,7 @@ public:
OutputComparePolarity polarity,
OutputComparePreload preload = OutputComparePreload::Disable)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
configureOutputChannel(channel, mode, compareValue, out, polarity, PinState::Disable, OutputComparePolarity::ActiveHigh, preload);
}

Expand Down Expand Up @@ -485,7 +485,7 @@ public:
OutputComparePolarity polarity_n = OutputComparePolarity::ActiveHigh,
OutputComparePreload preload = OutputComparePreload::Disable)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
%% if id in [15, 16, 17]
static_assert(channel == 1, "Timer{{ id }} has complementary output only on channel 1");
%% endif
Expand Down Expand Up @@ -528,7 +528,7 @@ public:
static void
setInvertedPwm()
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
setInvertedPwm(channel);
}

Expand Down Expand Up @@ -568,7 +568,7 @@ public:
static void
setNormalPwm()
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
setNormalPwm(channel);
}

Expand Down Expand Up @@ -607,7 +607,7 @@ public:
static void
forceInactive()
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
forceInactive(channel);
}

Expand Down Expand Up @@ -646,7 +646,7 @@ public:
static void
forceActive()
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
forceActive(channel);
}

Expand Down Expand Up @@ -687,7 +687,7 @@ public:
static void
setCompareValue(Value value)
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{id}}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
setCompareValue(channel, value);
}

Expand All @@ -701,7 +701,7 @@ public:
static inline Value
getCompareValue()
{
constexpr auto channel = signalToChannel<Peripheral::Tim{{ id }}, Signal>();
constexpr auto channel = signalToChannel<Signal>();
return getCompareValue(channel);
}
public:
Expand Down
3 changes: 1 addition & 2 deletions src/modm/platform/timer/stm32/general_purpose_base.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,10 @@ public:
}

protected:
template<Peripheral p, typename Signal>
template<typename Signal>
static consteval int
signalToChannel()
{
modm::platform::detail::SignalConnection<Signal, p>{};
%% for signal, number in signals
%% if loop.first
if constexpr (Signal::Signal == Gpio::Signal::{{ signal }}) {
Expand Down