Neptune_170620

Dependencies:   mbed

ISR.cpp

Committer:
Picmon
Date:
2020-06-17
Revision:
0:20b4b057fa7f

File content as of revision 0:20b4b057fa7f:

#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;
*/    
}