J L
/
Neptune_170620
Neptune_170620
Diff: ISR.cpp
- Revision:
- 0:20b4b057fa7f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ISR.cpp Wed Jun 17 10:11:19 2020 +0000 @@ -0,0 +1,50 @@ +#include <string> +#include "main.h" +#include "Functions.h" +#include "Definitions.h" +#include "Boolean.h" +#include "NextionLCD.h" +#include "mbed_debug.h" +#include "mbed.h" +#include "Languages.h" +#include "Ser25lcxxx.h" +#include "NVM.h" +#include "Watchdog.h" +#include "NextionPages.h" +#include "Controls.h" +#include "Threads.h" +#include "FastPWM.h" + + +InterruptIn tachoIn(FG_OUT); +Timer t1Sec; +volatile float rpm = 0; + + +void isr1(){ +/* + Tacho feedback from BLDC drive controller +*/ + static uint16_t cntr =0; + static bool pulse = HI; + + if(cntr > 5){ + ml+=0.1; + cntr = 0; + } + cntr++; + +/* + if(pulse){//tacho pulse rising edge + t1Sec.reset(); + t1Sec.start(); + //startLED = ON; + } + else{ + t1Sec.reset();//tacho pulse falling edge + t1Sec.start(); + //startLED = OFF; + } + pulse^=1; +*/ +}