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
972a6229
Commit
972a6229
authored
Jun 20, 2015
by
Vowstar
Browse files
Merge pull request #492 from nodemcu/dev
Merge dev to dev096
parents
234885e3
74901c56
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/dhtlib/dht.c
View file @
972a6229
...
@@ -252,6 +252,8 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
...
@@ -252,6 +252,8 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
DIRECT_WRITE_LOW
(
pin
);
DIRECT_WRITE_LOW
(
pin
);
// delay(wakeupDelay);
// delay(wakeupDelay);
for
(
i
=
0
;
i
<
wakeupDelay
;
i
++
)
os_delay_us
(
1000
);
for
(
i
=
0
;
i
<
wakeupDelay
;
i
++
)
os_delay_us
(
1000
);
// Disable interrupts
os_intr_lock
();
// digitalWrite(pin, HIGH); // T-go
// digitalWrite(pin, HIGH); // T-go
DIRECT_WRITE_HIGH
(
pin
);
DIRECT_WRITE_HIGH
(
pin
);
os_delay_us
(
40
);
os_delay_us
(
40
);
...
@@ -303,6 +305,8 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
...
@@ -303,6 +305,8 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
idx
++
;
idx
++
;
}
}
}
}
// Enable interrupts
os_intr_unlock
();
// pinMode(pin, OUTPUT);
// pinMode(pin, OUTPUT);
DIRECT_MODE_OUTPUT
(
pin
);
DIRECT_MODE_OUTPUT
(
pin
);
// digitalWrite(pin, HIGH);
// digitalWrite(pin, HIGH);
...
...
app/modules/net.c
View file @
972a6229
...
@@ -224,7 +224,9 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
...
@@ -224,7 +224,9 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
*/
*/
// "enhanced"
// "enhanced"
lua_rawgeti
(
gL
,
LUA_REGISTRYINDEX
,
nud
->
cb_dns_found_ref
);
// the callback function
lua_rawgeti
(
gL
,
LUA_REGISTRYINDEX
,
nud
->
cb_dns_found_ref
);
// the callback function
lua_rawgeti
(
gL
,
LUA_REGISTRYINDEX
,
nud
->
self_ref
);
// pass the userdata(conn) to callback func in lua
if
(
ipaddr
==
NULL
)
if
(
ipaddr
==
NULL
)
{
{
...
@@ -242,7 +244,7 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
...
@@ -242,7 +244,7 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
}
}
// "enhanced" end
// "enhanced" end
lua_call
(
gL
,
1
,
0
);
lua_call
(
gL
,
2
,
0
);
end:
end:
if
((
pesp_conn
->
type
==
ESPCONN_TCP
&&
pesp_conn
->
proto
.
tcp
->
remote_port
==
0
)
if
((
pesp_conn
->
type
==
ESPCONN_TCP
&&
pesp_conn
->
proto
.
tcp
->
remote_port
==
0
)
...
...
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