lwip operating system abstraction layer implementation based on CMSIS-RTOS
Dependents: LwIPNetworking NetServicesMin EthernetInterface EthernetInterface_RSF ... more
Revision 7:b409691fb352, committed 2012-07-27
- Comitter:
- emilmont
- Date:
- Fri Jul 27 10:17:19 2012 +0000
- Parent:
- 6:2ace1ff71ae6
- Child:
- 8:742ae4a0ca3f
- Commit message:
- Implement "sys_jiffies"
Changed in this revision
arch/sys_arch.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/arch/sys_arch.c Mon Jul 23 11:52:46 2012 +0000 +++ b/arch/sys_arch.c Fri Jul 27 10:17:19 2012 +0000 @@ -323,12 +323,25 @@ osMutexDef(lwip_sys_mutex); void sys_init(void) { + us_ticker_read(); // Init sys tick lwip_sys_mutex = osMutexCreate(osMutex(lwip_sys_mutex)); if (lwip_sys_mutex == NULL) error("sys_init error\n"); } /*---------------------------------------------------------------------------* + * Routine: sys_jiffies + *---------------------------------------------------------------------------* + * Description: + * Used by PPP as a timestamp-ish value + *---------------------------------------------------------------------------*/ +u32_t sys_jiffies(void) { + static u32_t jiffies = 0; + jiffies += 1 + (us_ticker_read()/10000); + return jiffies; +} + +/*---------------------------------------------------------------------------* * Routine: sys_arch_protect *---------------------------------------------------------------------------* * Description: