From c235c1fcebd2bcaa80244261d3ef9346581c96ac Mon Sep 17 00:00:00 2001 From: feeling Date: Tue, 19 Jan 2021 11:58:48 +0100 Subject: [PATCH] update main --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e688a15..04fd3b5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,10 +40,10 @@ struct fanMonitor { unsigned int last_time; }; -void ICACHE_RAM_ATTR handleInterrupt() { - rpmCount++; - if( rpmCount > 100 ) { - rpmCount=0; +void ICACHE_RAM_ATTR handleInterrupt( struct fanMonitor &fm ) { + fm.rpmcount++; + if( fm.rpmcount > 100 ) { + fm.rpmcount=0; Serial.println("100 RPM"); } } @@ -68,7 +68,7 @@ void setup() { pinMode(14,INPUT); // 14 = D5 // attachInterrupt(digitalPinToInterrupt(14), handleInterrupt, RISING); - attachInterrupt(14,handleInterrupt,RISING); + // attachInterrupt(14,handleInterrupt,RISING); }