diff --git a/debugpin.h b/debugpin.h new file mode 100644 index 0000000000000000000000000000000000000000..5349383e9b4bef5684218f7f86740637bff9a7fc --- /dev/null +++ b/debugpin.h @@ -0,0 +1,25 @@ + + +#ifndef DEBUGPIN_H +#define DEBUGPIN_H + +#include "miosix/interfaces/gpio.h" + +typedef miosix::Gpio<GPIOA_BASE, 1> debug1; +typedef miosix::Gpio<GPIOA_BASE,15> debug2; + +template<typename T> +class HighPin +{ +public: + HighPin() { T::high(); } + ~HighPin() { T::low(); } +}; + +inline void initDebugPins() +{ + debug1::mode(miosix::Mode::OUTPUT); + debug2::mode(miosix::Mode::OUTPUT); +} + +#endif //DEBUGPIN_H diff --git a/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/cstimer.cpp b/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/cstimer.cpp index d990a28173a365fc6ee7b3c111ac213e718a7e8d..0874558e4c89a4731b7ba85f85aae54a661efb4f 100644 --- a/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/cstimer.cpp +++ b/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/cstimer.cpp @@ -3,6 +3,7 @@ #include "interfaces/arch_registers.h" #include "kernel/kernel.h" #include "kernel/scheduler/timer_interrupt.h" +#include "../../../../../debugpin.h" using namespace miosix; @@ -60,12 +61,14 @@ void __attribute__((naked)) TIM2_IRQHandler() void __attribute__((used)) cstirqhnd() { + HighPin<debug1> h1; if(TIM2->SR & TIM_SR_CC1IF || lateIrq) { TIM2->SR = ~TIM_SR_CC1IF; if(ms32time==ms32chkp || lateIrq) { lateIrq=false; + HighPin<debug2> h2; IRQtimerInterrupt(nextInterrupt()); }