Used in Live Traffic Update Nokia LCD Display Project
Fork of NetServices by
lwip/arch/sys_arch.cpp@8:92b57208ab99, 2013-03-06 (annotated)
- Committer:
- rrajan8
- Date:
- Wed Mar 06 19:07:23 2013 +0000
- Revision:
- 8:92b57208ab99
- Parent:
- 0:ac1725ba162c
This project utilizes mbed's networking features to display live traffic updates on the Nokia LCD using the MapQuest API's Traffic Web Service.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
segundo | 0:ac1725ba162c | 1 | #include "sys_arch.h" |
segundo | 0:ac1725ba162c | 2 | #include "mbed.h" |
segundo | 0:ac1725ba162c | 3 | //DG 2010 |
segundo | 0:ac1725ba162c | 4 | |
segundo | 0:ac1725ba162c | 5 | #ifdef __cplusplus |
segundo | 0:ac1725ba162c | 6 | extern "C" { |
segundo | 0:ac1725ba162c | 7 | #endif |
segundo | 0:ac1725ba162c | 8 | |
segundo | 0:ac1725ba162c | 9 | #ifdef __COMPLEX_AND_BUGGUY_HANDLING__ |
segundo | 0:ac1725ba162c | 10 | static Timer* pTmr = NULL; |
segundo | 0:ac1725ba162c | 11 | |
segundo | 0:ac1725ba162c | 12 | void sys_init(void) |
segundo | 0:ac1725ba162c | 13 | { |
segundo | 0:ac1725ba162c | 14 | //Start Timer |
segundo | 0:ac1725ba162c | 15 | pTmr = new Timer(); |
segundo | 0:ac1725ba162c | 16 | pTmr->start(); |
segundo | 0:ac1725ba162c | 17 | } |
segundo | 0:ac1725ba162c | 18 | |
segundo | 0:ac1725ba162c | 19 | u32_t sys_jiffies(void) /* since power up. */ |
segundo | 0:ac1725ba162c | 20 | { |
segundo | 0:ac1725ba162c | 21 | return (u32_t) (pTmr->read_ms()/10); //In /10ms units |
segundo | 0:ac1725ba162c | 22 | } |
segundo | 0:ac1725ba162c | 23 | |
segundo | 0:ac1725ba162c | 24 | u32_t sys_now(void) |
segundo | 0:ac1725ba162c | 25 | { |
segundo | 0:ac1725ba162c | 26 | return (u32_t) pTmr->read_ms(); //In /ms units |
segundo | 0:ac1725ba162c | 27 | } |
segundo | 0:ac1725ba162c | 28 | #elif0 |
segundo | 0:ac1725ba162c | 29 | void sys_init(void) |
segundo | 0:ac1725ba162c | 30 | { |
segundo | 0:ac1725ba162c | 31 | |
segundo | 0:ac1725ba162c | 32 | } |
segundo | 0:ac1725ba162c | 33 | |
segundo | 0:ac1725ba162c | 34 | u32_t sys_jiffies(void) /* since power up. */ |
segundo | 0:ac1725ba162c | 35 | { |
segundo | 0:ac1725ba162c | 36 | static int count = 0; |
segundo | 0:ac1725ba162c | 37 | return ++count; |
segundo | 0:ac1725ba162c | 38 | } |
segundo | 0:ac1725ba162c | 39 | |
segundo | 0:ac1725ba162c | 40 | u32_t sys_now(void) |
segundo | 0:ac1725ba162c | 41 | { |
segundo | 0:ac1725ba162c | 42 | return (u32_t) time(NULL); |
segundo | 0:ac1725ba162c | 43 | } |
segundo | 0:ac1725ba162c | 44 | #else |
segundo | 0:ac1725ba162c | 45 | static Timer* pTmr = NULL; |
segundo | 0:ac1725ba162c | 46 | |
segundo | 0:ac1725ba162c | 47 | void sys_init(void) |
segundo | 0:ac1725ba162c | 48 | { |
segundo | 0:ac1725ba162c | 49 | //Start Timer |
segundo | 0:ac1725ba162c | 50 | pTmr = new Timer(); |
segundo | 0:ac1725ba162c | 51 | pTmr->start(); |
segundo | 0:ac1725ba162c | 52 | } |
segundo | 0:ac1725ba162c | 53 | |
segundo | 0:ac1725ba162c | 54 | u32_t sys_jiffies(void) /* since power up. */ |
segundo | 0:ac1725ba162c | 55 | { |
segundo | 0:ac1725ba162c | 56 | static int count = 0; |
segundo | 0:ac1725ba162c | 57 | return ++count; |
segundo | 0:ac1725ba162c | 58 | //return (u32_t) (pTmr->read_us()); |
segundo | 0:ac1725ba162c | 59 | } |
segundo | 0:ac1725ba162c | 60 | |
segundo | 0:ac1725ba162c | 61 | u32_t sys_now(void) |
segundo | 0:ac1725ba162c | 62 | { |
segundo | 0:ac1725ba162c | 63 | return (u32_t) (pTmr->read_ms()); //In /ms units |
segundo | 0:ac1725ba162c | 64 | } |
segundo | 0:ac1725ba162c | 65 | #endif |
segundo | 0:ac1725ba162c | 66 | |
segundo | 0:ac1725ba162c | 67 | |
segundo | 0:ac1725ba162c | 68 | #ifdef __cplusplus |
segundo | 0:ac1725ba162c | 69 | } |
segundo | 0:ac1725ba162c | 70 | #endif |