Commit Graph

2414 Commits

Author SHA1 Message Date
Philip Gladstone 432fe49612
Convert test documentation to Markdown (#3346)
* COnvert the rst to md...

* CLeanup the automatic conversion

* Try and make the tables work

* And again

* Get rid of the end-of-table marker
2020-12-12 03:24:31 +00:00
Gregor Hartmann ad8f82c6e2
fix search path for lua require (#3336) 2020-11-25 19:07:17 +00:00
Gregor Hartmann 63d82131a7
Doc fixes (#3333) 2020-11-25 12:53:46 +01:00
Nathaniel Wesley Filardo 49b09d050e
Basic hardware test examples for adc and gpio + define hardware setup (#3324) 2020-11-15 16:01:15 +01:00
Gregor Hartmann 02dcc235c9
Allow turning off softwd again as documented (#3327)
* Allow turning off softwd again as documented

* fix luacheck warnings

* fix outcome of review
2020-11-13 11:11:29 +00:00
Lukáš Voborský d279ba2fd9
BME280 Lua module - `(config[3] & 0xFC) | BME280_FORCED_MODE` workaround bug fix (#3325) 2020-11-11 22:07:20 +00:00
Gregor Hartmann c4baa9f3b9
Create NodeMCU test system based on gambiarra (#2984)
* Create mispec_file.lua

* Initial commit of gambiarra

* Adapt gambiarra to NodeMCU

* adapt to NodeMCU spacing and add nok functionality

* Some refactoring to make it easier to add new functionality

* Add methode `fail` to check failing code and pass error messages to output

- fail can be called with a function that should fail and a string which should be contained in the errormessage.
- Pass failed check reasons to output.

* Create gambiarra_file.lua

* Add reporting of tests that failed with Lua error

* ok, nok and fail will terminate the running test

* Add capability to run sync and async tests in mixed order and have a task.post inbetween them

* fix gambiarra self test to also run on device (not only host)

Use less ram in checking tests directly after they ran.
Use nateie task.post to tame watchdog.

* Update file tests + add async tmr tests

* Another fix in executing async test

* Catch errors in callbacks using node.setonerror

* change interface to return an object with several test methods

* Update README.md

* Change interface of Gambiarra + add reason for failed eq

* Update gambiarra documentation

* Add coroutine testcases to gambiarra

* Delete mispec_file.lua as it is superseeded by gambiarra_file.lua

* improve regexp for stack frame extraction

* Use Lua 53 debug capabilities

* move actual tests upfront

* remove debug code + optimization

* Show errors immediately instead of at the end of the test, freeing memory earlier

* Split tests to be run in 2 tranches

* rename to NTest and move to new location

* Add tests to checking mechanisms

* Add luacheck to tests

* Some pushing around of files

* more (last) fixes and file juggling

* Minor tweaks and forgotten checkin

* Add NTest selftest to travis

* Trying how to master travis

* another try

* restrict NTest selftest to linux
2020-11-08 14:31:11 +00:00
Lukáš Voborský b9b5815e97
DS18B20 Lua module (#3150) 2020-11-07 22:41:16 +01:00
Philip Gladstone f67792e0d3
Add support for using doubles in the LUA53 build. (#3225) 2020-11-07 22:38:40 +01:00
Gregor Hartmann 4f6792773f Fix ftpserver documentation and some formating in httpserver.md (#3322) 2020-11-07 16:23:43 +01:00
Marcel Stör 1503e280e1 Replace master with release 2020-11-07 16:23:43 +01:00
Nathaniel Wesley Filardo 0cafaca4cb 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-11-07 16:23:43 +01:00
Marcel P 7f30381301 Add mcp23017 Lua module (#3197) 2020-11-07 16:23:43 +01:00
Nathaniel Wesley Filardo 29e5108876 Further adaptation of lfs/_init.lua
See https://github.com/nodemcu/nodemcu-firmware/issues/3278 .  Thanks to
@vsky279 and @bazooka07 for suggestions.
2020-11-07 16:23:43 +01:00
Nathaniel Wesley Filardo 3a17258d39 pipe: comment and style fixes (NFC)
Reflow comments to 80 columns; fix some typos and other nits.
2020-11-07 16:23:43 +01:00
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