Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Commit 362b2a1

Browse files
committed
Remove AVR specific warnings
1 parent bfaae09 commit 362b2a1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/bsp/source/nm_bsp_arduino_avr.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void attachFakeInterruptToTimer(void) {
104104
#endif
105105

106106
// strategy 1 - attach external interrupt to change pin (works on 328)
107-
void attachInterruptToChangePin(uint32_t pin) {
107+
void attachInterruptToChangePin(int pin) {
108108
pinMode(pin, INPUT_PULLUP);
109109
_receiveBitMask = digitalPinToBitMask(pin);
110110
uint8_t port = digitalPinToPort(pin);
@@ -121,13 +121,13 @@ void attachInterruptToChangePin(uint32_t pin) {
121121
*_pcint_maskreg |= _BV(digitalPinToPCMSKbit(pin));
122122
}
123123

124-
void detachInterruptToChangePin(uint32_t pin) {
124+
void detachInterruptToChangePin(int pin) {
125125
*_pcint_maskreg &= ~(_BV(digitalPinToPCMSKbit(pin)));
126126
}
127127

128128
void attachInterruptMultiArch(uint32_t pin, void *chip_isr, uint32_t mode)
129129
{
130-
int32_t pin_irq = (int32_t)pin;
130+
int pin_irq;
131131
gpfIsr = chip_isr;
132132

133133
// stategy 0 - attach external interrupt to pin (works on 32u4)
@@ -143,13 +143,15 @@ void attachInterruptMultiArch(uint32_t pin, void *chip_isr, uint32_t mode)
143143

144144
void detachInterruptMultiArch(uint32_t pin)
145145
{
146-
pin = digitalPinToInterrupt(pin);
147-
if (pin == NOT_AN_INTERRUPT) {
146+
int pin_irq;
147+
148+
pin_irq = digitalPinToInterrupt(pin);
149+
if (pin_irq == NOT_AN_INTERRUPT) {
148150
detachInterruptToChangePin(pin);
149151
return;
150152
}
151153

152-
detachInterrupt(pin);
154+
detachInterrupt(pin_irq);
153155
}
154156

155157
#endif

0 commit comments

Comments
 (0)