Previous version which works for my stm32f401 Nucleo board
Fork of X_NUCLEO_IDB0XA1 by
platform/src/clock.c@70:d20d30f59b1c, 2015-06-08 (annotated)
- Committer:
- Silvio Lucio Oliva
- Date:
- Mon Jun 08 17:08:01 2015 +0200
- Revision:
- 70:d20d30f59b1c
Initial commit for mbed support
Signed-off-by: Silvio Lucio Oliva <silvio.oliva@st.com>
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Silvio Lucio Oliva |
70:d20d30f59b1c | 1 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 2 | #include "clock.h" |
Silvio Lucio Oliva |
70:d20d30f59b1c | 3 | #include "wait_api.h" |
Silvio Lucio Oliva |
70:d20d30f59b1c | 4 | #include "rtc_time.h" |
Silvio Lucio Oliva |
70:d20d30f59b1c | 5 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 6 | const uint32_t CLOCK_SECOND = 1000; |
Silvio Lucio Oliva |
70:d20d30f59b1c | 7 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 8 | /*---------------------------------------------------------------------------*/ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 9 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 10 | void Clock_Init(void) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 11 | { |
Silvio Lucio Oliva |
70:d20d30f59b1c | 12 | //Not Used |
Silvio Lucio Oliva |
70:d20d30f59b1c | 13 | } |
Silvio Lucio Oliva |
70:d20d30f59b1c | 14 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 15 | /*---------------------------------------------------------------------------*/ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 16 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 17 | tClockTime Clock_Time(void) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 18 | { |
Silvio Lucio Oliva |
70:d20d30f59b1c | 19 | return clock(); |
Silvio Lucio Oliva |
70:d20d30f59b1c | 20 | } |
Silvio Lucio Oliva |
70:d20d30f59b1c | 21 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 22 | /*---------------------------------------------------------------------------*/ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 23 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 24 | * Wait for a multiple of 1 ms. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 25 | * |
Silvio Lucio Oliva |
70:d20d30f59b1c | 26 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 27 | void Clock_Wait(uint32_t i) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 28 | { |
Silvio Lucio Oliva |
70:d20d30f59b1c | 29 | wait_ms(i); |
Silvio Lucio Oliva |
70:d20d30f59b1c | 30 | } |
Silvio Lucio Oliva |
70:d20d30f59b1c | 31 | /*---------------------------------------------------------------------------*/ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 32 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 33 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 34 |