From f19e24c7ac77e8023525556ac00e5ceb24dd5741 Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 10 Apr 2015 14:56:17 +0500 Subject: [PATCH] Update tmr.c According to NodeMCU team recommendations. --- app/modules/tmr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/modules/tmr.c b/app/modules/tmr.c index 1a0fa478..ee92f4d5 100644 --- a/app/modules/tmr.c +++ b/app/modules/tmr.c @@ -71,6 +71,12 @@ static int tmr_delay( lua_State* L ) us = luaL_checkinteger( L, 1 ); if ( us <= 0 ) return luaL_error( L, "wrong arg range" ); + if(us<1000000) + { + os_delay_us( us ); + WRITE_PERI_REG(0x60000914, 0x73); + return 0; + } unsigned sec = (unsigned)us / 1000000; unsigned remain = (unsigned)us % 1000000; int i = 0;