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
e0f3dbed
Unverified
Commit
e0f3dbed
authored
May 07, 2019
by
Terry Ellison
Committed by
GitHub
May 07, 2019
Browse files
Fix 2749 + restore correct user_modules.h (#2750)
parent
bc61528d
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/include/user_modules.h
View file @
e0f3dbed
...
...
@@ -7,7 +7,7 @@
// includes general purpose interface modules which require at most two GPIO pins.
// See https://github.com/nodemcu/nodemcu-firmware/pull/1127 for discussions.
// New modules should be disabled by default and added in alphabetical order.
//
#define LUA_USE_MODULES_ADC
#define LUA_USE_MODULES_ADC
//#define LUA_USE_MODULES_ADS1115
//#define LUA_USE_MODULES_ADXL345
//#define LUA_USE_MODULES_AM2320
...
...
@@ -21,22 +21,22 @@
//#define LUA_USE_MODULES_COLOR_UTILS
//#define LUA_USE_MODULES_CRON
//#define LUA_USE_MODULES_CRYPTO
//
#define LUA_USE_MODULES_DHT
#define LUA_USE_MODULES_DHT
//#define LUA_USE_MODULES_ENCODER
//#define LUA_USE_MODULES_ENDUSER_SETUP // USE_DNS in dhcpserver.h needs to be enabled for this module to work.
#define LUA_USE_MODULES_FILE
#define LUA_USE_MODULES_GDBSTUB
//
#define LUA_USE_MODULES_GPIO
//
#define LUA_USE_MODULES_GDBSTUB
#define LUA_USE_MODULES_GPIO
//#define LUA_USE_MODULES_GPIO_PULSE
//#define LUA_USE_MODULES_HDC1080
//#define LUA_USE_MODULES_HMC5883L
//#define LUA_USE_MODULES_HTTP
//#define LUA_USE_MODULES_HX711
//
#define LUA_USE_MODULES_I2C
#define LUA_USE_MODULES_I2C
//#define LUA_USE_MODULES_L3G4200D
//#define LUA_USE_MODULES_MCP4725
//#define LUA_USE_MODULES_MDNS
//
#define LUA_USE_MODULES_MQTT
#define LUA_USE_MODULES_MQTT
#define LUA_USE_MODULES_NET
#define LUA_USE_MODULES_NODE
#define LUA_USE_MODULES_OW
...
...
@@ -54,7 +54,7 @@
//#define LUA_USE_MODULES_SJSON
//#define LUA_USE_MODULES_SNTP
//#define LUA_USE_MODULES_SOMFY
//
#define LUA_USE_MODULES_SPI
#define LUA_USE_MODULES_SPI
//#define LUA_USE_MODULES_SQLITE3
//#define LUA_USE_MODULES_STRUCT
//#define LUA_USE_MODULES_SWITEC
...
...
app/modules/file.c
View file @
e0f3dbed
...
...
@@ -431,7 +431,7 @@ static int file_g_read( lua_State* L, int n, int16_t end_char, int fd )
luaL_buffinit
(
L
,
&
b
);
for
(
j
=
0
;
j
<
n
;
j
+=
sizeof
(
p
))
{
int
nwanted
=
(
j
<=
n
-
sizeof
(
p
))
?
sizeof
(
p
)
:
n
-
j
;
int
nwanted
=
(
n
-
j
>=
sizeof
(
p
))
?
sizeof
(
p
)
:
n
-
j
;
int
nread
=
vfs_read
(
fd
,
p
,
nwanted
);
if
(
nread
==
VFS_RES_ERR
||
nread
==
0
)
{
...
...
@@ -456,7 +456,7 @@ static int file_g_read( lua_State* L, int n, int16_t end_char, int fd )
}
// Lua: read()
// file.read() will read FILE
_READ
_CHUNK bytes, or EOF is reached.
// file.read() will read FILE
_CHUNK bytes, or EOF is reached.
// file.read(10) will read 10 byte from file, or EOF is reached.
// file.read('q') will read until 'q' or EOF is reached.
static
int
file_read
(
lua_State
*
L
)
...
...
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