Evan Brown
/
APpart3_E_start
11/18
millis.cpp@0:f43994f44684, 2018-11-08 (annotated)
- Committer:
- evenbrownie
- Date:
- Thu Nov 08 20:48:47 2018 +0000
- Revision:
- 0:f43994f44684
All I put in were the addresses from the beginning
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
evenbrownie | 0:f43994f44684 | 1 | /* |
evenbrownie | 0:f43994f44684 | 2 | * @author: Natasha Sarkar, 2018 |
evenbrownie | 0:f43994f44684 | 3 | */ |
evenbrownie | 0:f43994f44684 | 4 | |
evenbrownie | 0:f43994f44684 | 5 | #include "mbed.h" |
evenbrownie | 0:f43994f44684 | 6 | #include "millis.h" |
evenbrownie | 0:f43994f44684 | 7 | |
evenbrownie | 0:f43994f44684 | 8 | volatile unsigned long _millis; |
evenbrownie | 0:f43994f44684 | 9 | |
evenbrownie | 0:f43994f44684 | 10 | void millis_begin(void) { |
evenbrownie | 0:f43994f44684 | 11 | SysTick_Config(SystemCoreClock / 1000); |
evenbrownie | 0:f43994f44684 | 12 | } |
evenbrownie | 0:f43994f44684 | 13 | |
evenbrownie | 0:f43994f44684 | 14 | extern "C" void SysTick_Handler(void) { |
evenbrownie | 0:f43994f44684 | 15 | _millis++; |
evenbrownie | 0:f43994f44684 | 16 | } |
evenbrownie | 0:f43994f44684 | 17 | |
evenbrownie | 0:f43994f44684 | 18 | unsigned long millis(void) { |
evenbrownie | 0:f43994f44684 | 19 | return _millis; |
evenbrownie | 0:f43994f44684 | 20 | } |
evenbrownie | 0:f43994f44684 | 21 |