zinnet yazıcı / Mbed OS max30105Example
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers millis.cpp Source File

millis.cpp

00001 #include "mbed.h"
00002 #include "millis.h"
00003 
00004 static volatile uint32_t millisValue = 0;
00005 
00006 static  Ticker ticker;
00007 
00008 void  millisTicker ()
00009 {
00010     millisValue ++;
00011 }
00012 
00013 uint32_t  millis ()
00014 {
00015     return millisValue;
00016 }
00017 
00018 void  setMillis (uint32_t theValue) {
00019     millisValue = theValue;
00020 }
00021 
00022 void  startMillis () {
00023     ticker.attach (millisTicker, 0.001);    
00024 }
00025 
00026 void  stopMillis () {
00027     ticker.detach ();
00028 }
00029