Skip to content

Commit

Permalink
Fix 2749 + restore correct user_modules.h (#2750)
Browse files Browse the repository at this point in the history
  • Loading branch information
TerryE authored May 7, 2019
1 parent bc61528 commit e0f3dbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions app/include/user_modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/modules/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 )
Expand Down

0 comments on commit e0f3dbe

Please sign in to comment.