Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: NetServices/lwip/arch/sys_arch.cpp
- Revision:
- 1:f5ac63519541
diff -r 01f77deabc95 -r f5ac63519541 NetServices/lwip/arch/sys_arch.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/NetServices/lwip/arch/sys_arch.cpp Wed Mar 05 06:14:02 2014 -0800 @@ -0,0 +1,70 @@ +#include "sys_arch.h" +#include "mbed.h" +//DG 2010 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __COMPLEX_AND_BUGGUY_HANDLING__ +static Timer* pTmr = NULL; + +void sys_init(void) +{ + //Start Timer + pTmr = new Timer(); + pTmr->start(); +} + +u32_t sys_jiffies(void) /* since power up. */ +{ + return (u32_t) (pTmr->read_ms()/10); //In /10ms units +} + +u32_t sys_now(void) +{ + return (u32_t) pTmr->read_ms(); //In /ms units +} +#elif0 +void sys_init(void) +{ + +} + +u32_t sys_jiffies(void) /* since power up. */ +{ + static int count = 0; + return ++count; +} + +u32_t sys_now(void) +{ + return (u32_t) time(NULL); +} +#else +static Timer* pTmr = NULL; + +void sys_init(void) +{ + //Start Timer + pTmr = new Timer(); + pTmr->start(); +} + +u32_t sys_jiffies(void) /* since power up. */ +{ + static int count = 0; + return ++count; + //return (u32_t) (pTmr->read_us()); +} + +u32_t sys_now(void) +{ + return (u32_t) (pTmr->read_ms()); //In /ms units +} +#endif + + +#ifdef __cplusplus +} +#endif