🧑💻 GD32 fast write non-bool (#27806)
This commit is contained in:
parent
d3687d933c
commit
b23f86f83f
1 changed files with 6 additions and 3 deletions
|
|
@ -27,9 +27,12 @@
|
||||||
#include <PinOps.hpp>
|
#include <PinOps.hpp>
|
||||||
#include <PinOpsMap.hpp>
|
#include <PinOpsMap.hpp>
|
||||||
|
|
||||||
static inline void fast_write_pin_wrapper(pin_size_t IO, bool V) {
|
template<typename T>
|
||||||
if (V) gpio::fast_set_pin(getPortFromPin(IO), getPinInPort(IO));
|
static inline void fast_write_pin_wrapper(pin_size_t IO, T V) {
|
||||||
else gpio::fast_clear_pin(getPortFromPin(IO), getPinInPort(IO));
|
auto port = getPortFromPin(IO);
|
||||||
|
auto pin = getPinInPort(IO);
|
||||||
|
if (static_cast<bool>(V)) gpio::fast_set_pin(port, pin);
|
||||||
|
else gpio::fast_clear_pin(port, pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool fast_read_pin_wrapper(pin_size_t IO) {
|
static inline bool fast_read_pin_wrapper(pin_size_t IO) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue