Commit Graph

2399 Commits

Author SHA1 Message Date
Nathaniel Wesley Filardo a97d8f114c pipe: fix unread buffer chunk management
unread contained two subtle bugs:

 - it created a buffer chunk at pipe[1], when that position is reserved
   for the pipe reader function.  Because it shifted pipe[i] to
   pipe[i+1], including pipe[1], this was likely to manifest as the pipe
   later attempting to dequeue a function rather than a buffer chunk
   user datum.  Solve this by adjusting the loop bounds and creation
   index.

 - when it created a new buffer chunk, it left that chunk's ->start and
   ->end fields at 0, but would then exit the loop to do the tail fill,
   which was in turn assuming the exit condition of the loop when an
   existing chunk had room, namely that data had been moved to the right
   and so ->start > l.  Solve this by making new chunks empty but with
   ->start = ->end = LUAL_BUFFERSIZE.  It may be slightly better to
   instead try to leave room at both ends if the buffer was empty prior
   to this unread.

FIXES: https://github.com/nodemcu/nodemcu-firmware/issues/3155
2020-11-07 16:23:43 +01:00
Lukáš Voborský 1b29843b78 wiegand Lua 5.3 fix 2020-11-07 16:23:43 +01:00
Cody Cutrer 5ee658e22b add wiegand module (#3203)
* add wiegand module

* minor tweaks to wiegand module

 * fix a whitespace error (tabs!!!!)
 * remove an unnecessary volatile qualifier
2020-11-07 16:23:43 +01:00
Philip Gladstone 335cf62a4d Fix the initialization of the wifi default hostname. (#3303)
* It appears that the rf_pre_init is not called any more. Also cleaned up the code in
wifi_common.
* Log a message (at the right baud rate) if the hostname is invalid
* Updated the comment in the user_config.h file
2020-11-07 16:23:43 +01:00
Philip Gladstone a01aada0ff Improved startup performance and measurement tools. (#3171)
* Don't adjust the clock until after we deal with rtctime...
* Switched to using START_OPTION_CPU_FREQ_MAX instead.
* Use setfield and add caching of the startup option
* Put the startupcounts warning into a warning box
2020-11-07 16:23:43 +01:00
hanfengcan 5e849af9c5 fix: fixed the memory leak 2020-11-07 16:23:43 +01:00
Philip Gladstone ff778dfc4b Guard against freeing a ref of zero (#3308) 2020-11-07 16:23:43 +01:00
Lukáš Voborský 90a077b987 bme280 driver in Lua+C 2020-11-07 16:23:43 +01:00
Lukáš Voborský 5f53531d77 struct module minor documentation fix (#3306)
Thanks
2020-11-07 16:23:43 +01:00
Lukáš Voborský 336013ab9e Fixing bug in `file.readline` when line length exceeds 128 chars 2020-11-07 16:23:43 +01:00
Gregor Hartmann 3d9c441e09 Change from `master` to `release` 2020-11-07 16:23:43 +01:00
Nathaniel Wesley Filardo b4f2686567 crypto: remove toHex and toBase64 (#3300)
We marked these for deprecation in favor of the functions of the same
name in encoder.  Let's actually make good on that.
2020-11-07 16:23:43 +01:00
philip 53283d189e Add the submodule properly 2020-11-07 16:23:43 +01:00
philip 020f5fe107 Remove ets_printf reference 2020-11-07 16:23:43 +01:00
philip 7a25f522d2 CLean up the PR a bit 2020-11-07 16:23:43 +01:00
philip b80cfe9f1e Now use the original c99-snprintf as a submodule. 2020-11-07 16:23:43 +01:00
philip 78ee67fd2e Remove some uses of etc_*printf 2020-11-07 16:23:43 +01:00
philip d1be80e4a3 Conditionalize int2float on lua 5.3 2020-11-07 16:23:43 +01:00
philip 9ca1672f9e Remove ESP8266 special case 2020-11-07 16:23:43 +01:00
philip aaef4c3db4 Make it work for the integer lua51 build 2020-11-07 16:23:43 +01:00
philip bae01c47a0 Now round trips in float firmware, and gets it roughly right in double (in lua 51) 2020-11-07 16:23:43 +01:00
philip 3795e22b89 Give it a chance of working under Lua 5.1 2020-11-07 16:23:43 +01:00
philip 60f0150736 Add snprintf and remove our sprintf 2020-11-07 16:23:43 +01:00
philip a6beec9f0f Make round tripping work for lua53 and floats 2020-11-07 16:23:43 +01:00
philip b1a6cb1d43 Make it inline 2020-11-07 16:23:43 +01:00
philip 5eb81197cb Add missing ICACHE_RAM_ATTR 2020-11-07 16:23:43 +01:00
Philip Gladstone cc7cc395ac Improve the enduser setup experience by triggering captive portal detection. (#3282)
* Make captive portal detection work on macOS
* Change the default SSID prefix to be NodeMCU
2020-11-07 16:23:43 +01:00
Nathaniel Wesley Filardo 625397d133 uart: expose fifo depth counters (#3177) 2020-11-07 16:23:43 +01:00
Philip Gladstone fee81bf9ad Handle tcp fragmentation and also fix XSS problem. (#3275) 2020-11-07 16:23:43 +01:00
Philip Gladstone f527ad86e4 Fix problem reading files a multiple of 128 bytes long (#3280) 2020-11-07 16:23:43 +01:00
Gregor Hartmann 0e88617659
Fix ftpserver documentation and some formating in httpserver.md (#3322) 2020-11-04 09:34:05 +01:00
Marcel Stör fab34a6cd0 Replace master with release 2020-11-03 22:57:15 +01:00
Nathaniel Wesley Filardo f5665ace71
MCP23017 module refactorings to save some heap (#3317)
* mcp23017: functions to metatable

Avoids closures for each module.

* mcp23017: inline constants

Saves nearly half a kilobyte of heap.
2020-10-29 12:59:30 +00:00
Marcel P ef353809eb
Add mcp23017 Lua module (#3197) 2020-10-25 12:48:34 +01:00
Nathaniel Wesley Filardo f8baf63a73 Further adaptation of lfs/_init.lua
See https://github.com/nodemcu/nodemcu-firmware/issues/3278 .  Thanks to
@vsky279 and @bazooka07 for suggestions.
2020-10-23 04:22:30 +01:00
Nathaniel Wesley Filardo 045fc80c70 pipe: comment and style fixes (NFC)
Reflow comments to 80 columns; fix some typos and other nits.
2020-10-23 04:21:51 +01:00
Nathaniel Wesley Filardo 962991ed18 pipe: fix unread buffer chunk management
unread contained two subtle bugs:

 - it created a buffer chunk at pipe[1], when that position is reserved
   for the pipe reader function.  Because it shifted pipe[i] to
   pipe[i+1], including pipe[1], this was likely to manifest as the pipe
   later attempting to dequeue a function rather than a buffer chunk
   user datum.  Solve this by adjusting the loop bounds and creation
   index.

 - when it created a new buffer chunk, it left that chunk's ->start and
   ->end fields at 0, but would then exit the loop to do the tail fill,
   which was in turn assuming the exit condition of the loop when an
   existing chunk had room, namely that data had been moved to the right
   and so ->start > l.  Solve this by making new chunks empty but with
   ->start = ->end = LUAL_BUFFERSIZE.  It may be slightly better to
   instead try to leave room at both ends if the buffer was empty prior
   to this unread.

FIXES: https://github.com/nodemcu/nodemcu-firmware/issues/3155
2020-10-23 04:21:51 +01:00
Lukáš Voborský 734b02a734 wiegand Lua 5.3 fix 2020-10-23 04:19:41 +01:00
Cody Cutrer 63e1fcda06
add wiegand module (#3203)
* add wiegand module

* minor tweaks to wiegand module

 * fix a whitespace error (tabs!!!!)
 * remove an unnecessary volatile qualifier
2020-10-19 01:05:31 +01:00
Philip Gladstone 73df18d738
Fix the initialization of the wifi default hostname. (#3303)
* It appears that the rf_pre_init is not called any more. Also cleaned up the code in
wifi_common.
* Log a message (at the right baud rate) if the hostname is invalid
* Updated the comment in the user_config.h file
2020-10-18 20:48:10 +02:00
Philip Gladstone 7185b9c603
Improved startup performance and measurement tools. (#3171)
* Don't adjust the clock until after we deal with rtctime...
* Switched to using START_OPTION_CPU_FREQ_MAX instead.
* Use setfield and add caching of the startup option
* Put the startupcounts warning into a warning box
2020-10-18 20:46:47 +02:00
hanfengcan 02e4720b3d fix: fixed the memory leak 2020-10-18 16:35:32 +01:00
Philip Gladstone 7830ae671e
Guard against freeing a ref of zero (#3308) 2020-10-13 21:43:38 +02:00
Lukáš Voborský b9091784ae bme280 driver in Lua+C 2020-10-05 20:41:36 +01:00
Lukáš Voborský 54e8696ac9
struct module minor documentation fix (#3306)
Thanks
2020-10-04 17:26:42 -04:00
Lukáš Voborský ebfce4a911 Fixing bug in `file.readline` when line length exceeds 128 chars 2020-09-29 22:57:18 +01:00
Gregor Hartmann 8124341a7b
Change from `master` to `release` 2020-09-29 17:37:20 +02:00
Nathaniel Wesley Filardo 0a1d122cb8
crypto: remove toHex and toBase64 (#3300)
We marked these for deprecation in favor of the functions of the same
name in encoder.  Let's actually make good on that.
2020-09-28 20:42:16 +02:00
philip ed8c50872a Add the submodule properly 2020-09-27 03:05:36 +01:00
philip 274828cfd5 Remove ets_printf reference 2020-09-27 03:05:36 +01:00