Skip to content

Commit

Permalink
Fix incorrect parameter order in attachInterrupt()
Browse files Browse the repository at this point in the history
  • Loading branch information
board707 committed Aug 7, 2023
1 parent b1a463f commit 0ac89f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cores/w806/W_interrupt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gpio_irq_callback GPIOA_Callback[GPIOA_PINS_CNT] = {0};
uint32_t GPIOB_CallbackFlag =0;
gpio_irq_callback GPIOB_Callback[GPIOB_PINS_CNT] = {0};

void attachInterrupt(uint16_t pin, uint16_t mode, gpio_irq_callback callback)
void attachInterrupt(uint16_t pin, gpio_irq_callback callback, uint16_t mode)
{

if (pin_Map[pin].ulPinAttribute & PIN_DIO_Msk)
Expand Down
2 changes: 1 addition & 1 deletion cores/w806/W_interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern gpio_irq_callback GPIOA_Callback[GPIOA_PINS_CNT];
extern uint32_t GPIOB_CallbackFlag;
extern gpio_irq_callback GPIOB_Callback[GPIOB_PINS_CNT];*/

void attachInterrupt(uint16_t pin, uint16_t mode, gpio_irq_callback callback);
void attachInterrupt(uint16_t pin, gpio_irq_callback callback, uint16_t mode);
void detachInterrupt(uint16_t pin);

void HAL_GPIO_EXTI_Callback(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void setup() {
* HIGH_LEVEL or GPIO_MODE_IT_HIGH_LEVEL
* LOW_LEVEL or GPIO_MODE_IT_LOW_LEVEL */

attachInterrupt(PB10, FALLING, &_irq_routine);
attachInterrupt(PB10, &_irq_routine, FALLING);

// Also available
// detachInterrupt(pin);
Expand Down

0 comments on commit 0ac89f4

Please sign in to comment.