Skip to content

Commit 58106b0

Browse files
Fix -Wshadow warning for Interrupt callbacks
Adding -Wshadow to builds identified a template for the Interrupt callback which used a local variable the same as the class variable. Rename the local variable to not shadow the class one and make GCC happier.
1 parent 4a02bfc commit 58106b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/Interrupts.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ template<typename T> void attachInterrupt(pin_size_t interruptNum, voidTemplateF
4747
// TODO: add structure to delete(__container__) when detachInterrupt() is called
4848
auto f = [](void* a) -> void
4949
{
50-
T param = *(T*)((struct __container__<T>*)a)->param;
51-
(((struct __container__<T>*)a)->function)(param);
50+
T funcparam = *(T*)((struct __container__<T>*)a)->param;
51+
(((struct __container__<T>*)a)->function)(funcparam);
5252
};
5353

5454
attachInterruptParam(interruptNum, f, mode, cont);

0 commit comments

Comments
 (0)