Rev 361 | Rev 372 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 361 | Rev 362 | ||
|---|---|---|---|
| Line 104... | Line 104... | ||
| 104 | * @return |
104 | * @return |
| 105 | * The current time in milliseconds (32bit value). |
105 | * The current time in milliseconds (32bit value). |
| 106 | */ |
106 | */ |
| 107 | uint32_t Timebase_CurrentTime(void) { |
107 | uint32_t Timebase_CurrentTime(void) { |
| 108 | uint8_t sreg; |
108 | uint8_t sreg; |
| 109 |
|
109 | uint32_t res; |
| 110 | sreg=SREG; |
110 | sreg=SREG; |
| 111 | cli(); |
111 | cli(); |
| 112 | res = gMilliSecTick; |
112 | res = gMilliSecTick; |
| 113 | SREG=sreg; |
113 | SREG=sreg; |
| 114 | return res; |
114 | return res; |
| Line 123... | Line 123... | ||
| 123 | * @return |
123 | * @return |
| 124 | * Number of milliseconds that have passed since t0. |
124 | * Number of milliseconds that have passed since t0. |
| 125 | */ |
125 | */ |
| 126 | uint32_t Timebase_PassedTimeMillis(uint32_t t0) { |
126 | uint32_t Timebase_PassedTimeMillis(uint32_t t0) { |
| 127 | uint8_t sreg; |
127 | uint8_t sreg; |
| 128 |
|
128 | uint32_t res; |
| 129 | sreg=SREG; |
129 | sreg=SREG; |
| 130 | cli(); |
130 | cli(); |
| 131 | res = ( |
131 | res = (uint32_t)(gMilliSecTick-t0); |
| 132 | SREG=sreg; |
132 | SREG=sreg; |
| 133 | return res; |
133 | return res; |
| 134 | } |
134 | } |