From efcd3c8c38a040ff589d70d59b5a85c9c0e92259 Mon Sep 17 00:00:00 2001 From: Fabiano Riccardi <fabiuz4@hotmail.it> Date: Mon, 21 Nov 2016 20:16:07 +0100 Subject: [PATCH] Fixed the Master, now is time to fix the slave ad try more test case Signed-off-by: Fabiano Riccardi <fabiuz4@hotmail.it> --- .../efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp | 4 +++- .../efm32gg332f1024_wandstem/interfaces-impl/gpioirq.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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 e87de34d..e8b47acb 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 7e9b2a0d..38cc739d 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); -- GitLab