diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp index e87de34d0110834538fa66caa8d46c99b8e444fa..e8b47acb4f1c42cfb25fcb38c4d9b28e80ae915e 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp @@ -31,6 +31,7 @@ #include <cstdlib> #include <cstdio> #include "../../../../debugpin.h" +#include "gpioirq.h" using namespace miosix; @@ -163,10 +164,11 @@ GPIOtimer& GPIOtimer::instance(){ return instance; } -const int GPIOtimer::stabilizingTime = 4; +const int GPIOtimer::stabilizingTime = 3; GPIOtimer::GPIOtimer(): b(HighResolutionTimerBase::instance()),tc(b.getTimerFrequency()) { b.setModeGPIOTimer(true); expansion::gpio10::mode(Mode::INPUT); isInput=true; + registerGpioIrq(expansion::gpio10::getPin(),GpioIrqEdge::RISING,[](){}); } \ No newline at end of file diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpioirq.cpp b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpioirq.cpp index 7e9b2a0dfa8b8c4c5b5a39ca3baf122e6b4e3052..38cc739d4920f3a1612a93b1dddd955c2d1f2ea8 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpioirq.cpp +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpioirq.cpp @@ -95,7 +95,7 @@ void registerGpioIrq(GpioPin pin, GpioIrqEdge edge, function<void ()> callback) if(first==false) { first=true; - GPIO->INSENSE |= 1<<0; + GPIO->INSENSE |= GPIO_INSENSE_INT | GPIO_INSENSE_PRS; NVIC_EnableIRQ(GPIO_EVEN_IRQn); NVIC_SetPriority(GPIO_EVEN_IRQn,10); //Low priority NVIC_EnableIRQ(GPIO_ODD_IRQn);