J L / Mbed 2 deprecated Neptune_170620

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ISR.cpp Source File

ISR.cpp

00001 #include <string> 
00002 #include "main.h"
00003 #include "Functions.h"
00004 #include "Definitions.h"
00005 #include "Boolean.h"
00006 #include "NextionLCD.h"
00007 #include "mbed_debug.h"
00008 #include "mbed.h"
00009 #include "Languages.h"
00010 #include "Ser25lcxxx.h"
00011 #include "NVM.h"
00012 #include "Watchdog.h"
00013 #include "NextionPages.h"
00014 #include "Controls.h"
00015 #include "Threads.h"
00016 #include "FastPWM.h"
00017 
00018 
00019 InterruptIn tachoIn(FG_OUT);
00020 Timer t1Sec;
00021 volatile float rpm = 0;
00022 
00023 
00024 void isr1(){
00025 /*
00026     Tacho feedback from BLDC drive controller
00027 */
00028     static uint16_t cntr =0;   
00029     static bool pulse = HI;
00030 
00031     if(cntr > 5){
00032         ml+=0.1;
00033         cntr = 0;
00034     }
00035     cntr++;
00036     
00037 /* 
00038     if(pulse){//tacho pulse rising edge 
00039         t1Sec.reset();
00040         t1Sec.start();
00041         //startLED = ON;
00042     }
00043     else{
00044         t1Sec.reset();//tacho pulse falling edge
00045         t1Sec.start();
00046         //startLED = OFF;
00047     }
00048     pulse^=1;
00049 */    
00050 }