Commit f8311855 authored by Arnim Läuger's avatar Arnim Läuger Committed by Marcel Stör
Browse files

revert os_delay_us() usage to uint32 (#2310)

parent c7006dfb
...@@ -128,9 +128,9 @@ static int tmr_delay( lua_State* L ){ ...@@ -128,9 +128,9 @@ static int tmr_delay( lua_State* L ){
sint32_t us = luaL_checkinteger(L, 1); sint32_t us = luaL_checkinteger(L, 1);
if(us <= 0) if(us <= 0)
return luaL_error(L, "wrong arg range"); return luaL_error(L, "wrong arg range");
while(us >= 10000){ while(us >= 1000000){
us -= 10000; us -= 1000000;
os_delay_us(10000); os_delay_us(1000000);
system_soft_wdt_feed (); system_soft_wdt_feed ();
} }
if(us>0){ if(us>0){
......
...@@ -76,12 +76,6 @@ static tsl2561Gain_t _tsl2561Gain = TSL2561_GAIN_1X; ...@@ -76,12 +76,6 @@ static tsl2561Gain_t _tsl2561Gain = TSL2561_GAIN_1X;
static tsl2561Address_t tsl2561Address = TSL2561_ADDRESS_FLOAT; static tsl2561Address_t tsl2561Address = TSL2561_ADDRESS_FLOAT;
static tsl2561Package_t tsl2561Package = TSL2561_PACKAGE_T_FN_CL; static tsl2561Package_t tsl2561Package = TSL2561_PACKAGE_T_FN_CL;
static void delay_ms(uint16_t ms)
{
while (ms--)
os_delay_us(1000);
}
/**************************************************************************/ /**************************************************************************/
/*! /*!
@brief Writes an 8 bit values over I2C @brief Writes an 8 bit values over I2C
...@@ -236,13 +230,13 @@ tsl2561Error_t tsl2561GetLuminosity(uint16_t *broadband, uint16_t *ir) { ...@@ -236,13 +230,13 @@ tsl2561Error_t tsl2561GetLuminosity(uint16_t *broadband, uint16_t *ir) {
// Wait x ms for ADC to complete // Wait x ms for ADC to complete
switch (_tsl2561IntegrationTime) { switch (_tsl2561IntegrationTime) {
case TSL2561_INTEGRATIONTIME_13MS: case TSL2561_INTEGRATIONTIME_13MS:
delay_ms(14); //systickDelay(14); os_delay_us(14000); //systickDelay(14);
break; break;
case TSL2561_INTEGRATIONTIME_101MS: case TSL2561_INTEGRATIONTIME_101MS:
delay_ms(102); //systickDelay(102); os_delay_us(102000); //systickDelay(102);
break; break;
default: default:
delay_ms(404); //systickDelay(404); os_delay_us(404000); //systickDelay(404);
break; break;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment