From 0b71b9abaa0fad7533cd455b0306ee84d3c47521 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 8 Apr 2015 11:24:39 +0500 Subject: [PATCH] Update tmr.c I don't know C so good, but looks like we can decrease tmr.delay latency --- app/modules/tmr.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/modules/tmr.c b/app/modules/tmr.c index 1a0fa478..adbe3a7b 100644 --- a/app/modules/tmr.c +++ b/app/modules/tmr.c @@ -71,15 +71,8 @@ static int tmr_delay( lua_State* L ) us = luaL_checkinteger( L, 1 ); if ( us <= 0 ) return luaL_error( L, "wrong arg range" ); - unsigned sec = (unsigned)us / 1000000; - unsigned remain = (unsigned)us % 1000000; - int i = 0; - for(i=0;i0) - os_delay_us( remain ); + + os_delay_us( us ); return 0; }