Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
f8311855
Commit
f8311855
authored
Mar 21, 2018
by
Arnim Läuger
Committed by
Marcel Stör
Mar 21, 2018
Browse files
revert os_delay_us() usage to uint32 (#2310)
parent
c7006dfb
Changes
2
Show whitespace changes
Inline
Side-by-side
app/modules/tmr.c
View file @
f8311855
...
@@ -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
>=
10000
00
){
us
-=
10000
;
us
-=
10000
00
;
os_delay_us
(
10000
);
os_delay_us
(
10000
00
);
system_soft_wdt_feed
();
system_soft_wdt_feed
();
}
}
if
(
us
>
0
){
if
(
us
>
0
){
...
...
app/tsl2561/tsl2561.c
View file @
f8311855
...
@@ -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_
m
s
(
14
);
//systickDelay(14);
os_
delay_
u
s
(
14
000
);
//systickDelay(14);
break
;
break
;
case
TSL2561_INTEGRATIONTIME_101MS
:
case
TSL2561_INTEGRATIONTIME_101MS
:
delay_
m
s
(
102
);
//systickDelay(102);
os_
delay_
u
s
(
102
000
);
//systickDelay(102);
break
;
break
;
default:
default:
delay_
m
s
(
404
);
//systickDelay(404);
os_
delay_
u
s
(
404
000
);
//systickDelay(404);
break
;
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment