Commit Graph

1909 Commits

Author SHA1 Message Date
Johny Mattsson ccb3b5002d Improvements to external component/module support.
Based on feedback from @tomsci - thanks!
2023-01-17 14:08:47 +11:00
Johny Mattsson 4c510a5a69 Initial support for using external components/modules. 2023-01-17 14:08:47 +11:00
Johny Mattsson c684180dea Remove defunct extmod bits. 2023-01-17 14:08:47 +11:00
Tom Sutcliffe a40d69dbe8 Make sodium.random API behave consistently on all build types
By returning result as a signed 32-bit int between INT32_MIN to IN32_MAX
which is represented the same regardless of 64-bit support or
integral-only builds.

Also updated docs, fixed links and clarified behavior of random APIs
when WiFi isn't started.
2022-12-19 18:53:04 +11:00
Tom Sutcliffe ed85e21a9b Allow LUA_INIT_STRING to be set in menuconfig 2022-11-17 17:26:51 +11:00
serg3295 f592cf4ee5
Fix ledc.md (#3557)
fixes ledc.channel:fade() syntax.
2022-11-10 20:49:16 -05:00
Tom Sutcliffe e3883cd27b Fix file.list() zero sizes. Fixes #3549.
The modern spiffs backend doesn't like stat("./somefile") for something
on the root of the filesystem, and instead only accepts "somefile"
(it also doesn't like "/somefile"). The error from stat was being
ignored which is why the file sizes all appeared to be zero.

The fix is to change file.list() to pass just the filename, unless a
directory was passed to list(). Also improved error handling a bit.
2022-11-08 16:10:47 +11:00
Johny Mattsson cad125c477 Update to use node16 actions per github advice. 2022-10-12 16:14:40 +11:00
Johny Mattsson 38ccd7b2ba Upgrade IDF to v4.4.2
Slightly reworked embed_lfs.sh to better cope with attribute size changes
in future compiler versions, without needing to be updated again.

RMT register naming changed once again...
2022-10-12 16:14:40 +11:00
Philip Gladstone d8f07ddf90 Remove another not-compiling module 2022-10-05 14:53:25 +11:00
Philip Gladstone fef57344db Remove the touch driver as well 2022-10-05 14:53:25 +11:00
Philip Gladstone b9d6e2722e The i2s module doesn't appear to build 2022-10-05 14:53:25 +11:00
Philip Gladstone f15470e44f Include the rmt device for the esp32-c3 (and other missing devices) 2022-10-05 14:53:25 +11:00
Philip Gladstone c7cab0aba4
Adds support for settxpower (#3535)
* Adds support for settxpower

* Update docs/modules/wifi.md

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>

* Update docs/modules/wifi.md

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>

Co-authored-by: Marcel Stör <marcelstoer@users.noreply.github.com>
2022-09-29 21:38:32 -04:00
Philip Gladstone 9965635694
Ported the rtcmem over to ESP32 (#3544)
* Ported the rtcmem over to ESP32

* Apply review comments.

* Add the rtcmem string to the config option
2022-09-29 21:37:34 -04:00
Joo Aun Saw d24f2ae459 platform uart: really feed uart data to both console and on-data cb 2022-08-30 18:14:57 +10:00
Joo Aun Saw 0e71189c11 uart: further clean up 2022-08-30 10:38:29 +10:00
Joo Aun Saw 5e6cb4d1fa uart: slight clean up of uart.setup 2022-08-30 10:38:29 +10:00
Joo Aun Saw ddc770a6f7 uart: do not use uninitialized uart pins config 2022-08-29 20:54:31 +10:00
Joo Aun Saw ca0a2b3f47 platform: platform_uart_setup handles null ptr 2022-08-29 20:53:17 +10:00
Joo Aun Saw 01b94f31dc uart: feed rx data to both lua console and on-data callback 2022-08-29 20:52:03 +10:00
Joo Aun Saw a3712ac990 embed_lfs.sh: handle riscv.attributes in esp32c3 map file 2022-06-16 18:34:50 +10:00
h2zero b8ae6ca6f8 Explicitly set RMT config::flags.
If this variable is not set in the config it may contain random data and set the clock source to the REF_CLK
resulting in timing errors, the DHTx, DS18B20 and ws2812 devices to not communicate.
2022-06-04 16:00:19 +10:00
h2zero 484a7721b5 Ensure flash address is set before obtaining memory mapped address.
Before this change the struck member add_phys would contain random data and the call to spi_flash_phys2cache
could return an incorrect memory address.
2022-06-04 15:57:18 +10:00
h2zero c75ec760aa Fix node.compile fwrite size check.
The return value from fwrite was being checked against the size of the data rather than the number of bytes written.
This caused node.compile() to falsely return failure.
2022-06-04 15:55:00 +10:00
Marcel Stör e8caaebc5a Pin jinja2, see https://twitter.com/readthedocs/status/1507388916013314048 2022-05-20 07:51:42 +02:00
Philip Gladstone c03e7cffb7
Add the invert option for the ledc module (#3506) 2022-05-20 07:36:36 +02:00
Philip Gladstone ceb62993da
First attempt at adding support for the RMT device. (#3493)
* Adding the first version of the rmt documentation.

* Stub RMT module compiles.

* This version seems to work in (at least) simple cases.

* CLean up the docs

* Minor fixes

* Give the SPI module a chance of working...

* Update to the released version of idf4.4

* Try to get the CI Build to work in all cases

* Try to get the CI Build to work in all cases

* FIx a ringbuffer return issue

* Remove bogus comment

* Review comments

* Better example of transmission

* Review comments

* Add table send example

* Improved documentation

* Documentation comments

* Install the driver correctly.

* A couple of doc updates

* Fix typo
2022-03-05 17:27:11 -05:00
Johny Mattsson cb434811ca
IDF web server module (#3502)
* Added httpd module.

Lua-interface to the standard esp_http_server component.

* Added eromfs module.
2022-03-05 13:51:54 +11:00
Philip Gladstone e5892a7286
Give the SPI module a chance of working... (#3496) 2022-01-27 07:02:56 +01:00
Philip Gladstone 8f9295b09e
Update to the released version of idf4.4 (#3498)
* Update to the released version of idf4.4

* Try to get the CI Build to work in all cases
2022-01-25 20:54:17 -05:00
Johny Mattsson 670bf2d6a6
Make UART buffer sizes configurable. (#3500)
Also corrects assumption about number of UARTs available.
2022-01-26 11:32:24 +11:00
Christoph Thelen 8b1ef35b66
Consider RMT channel limitations at allocation time. (#3481)
* Consider RMT channel limitations at allocation time.

The ESP32-C3 is limited to TX on channel 0-1 and RX on channel 2-3.
2022-01-07 14:50:28 +11:00
Johny Mattsson 6e63264963
Support interface-specific hostname on ethernet interface. (#3487) 2022-01-02 13:31:58 +11:00
Johny Mattsson 4b4ce47ed1 Fix file listing on submounts. 2021-11-13 12:26:49 +11:00
Johny Mattsson a0c9085cca Make node.output() RTOS thread safe.
Also removed old, very unsafe node.osoutput(). We're now integrating cleanly
with the IDF/newlib way of redirecting stdout.

Added necessary depends in Kconfig to ensure VFS support is enabled, as
otherwise you'd only get a mysterious crash when attempting to enable
output redirection.
2021-11-04 22:24:01 +11:00
Johny Mattsson 9a2fb84512 Fix broken sjson module init. 2021-11-04 20:55:08 +11:00
Bernd Meyer 6db8c43480 Prevent memory leak in UART driver when message handling is slow 2021-11-04 20:54:56 +11:00
Johny Mattsson 5c59c57a16 Implement tmr.wdclr() 2021-10-22 12:38:07 +11:00
Johny Mattsson a2ba49e36b Switch to IDF-provided VFS and standard `io` module.
The IDF-provided VFS resolves several issues:

 - The IDF components having a different view of the (virtual) file system
   compared to the Lua environment.

 - RTOS task/thread safety. Our legacy VFS was only ever safe to use
   from the LVM thread, which limited its usability. Upgrading it
   would have effectively required a reimplementation of the IDF VFS,
   which would have been a bigger task with larger on-going maintenance
   issues.

 - We're no longer needing to maintain our own SPIFFS component.

 - We're no longer needing to maintain our own FATFS component.

 - The legacy of the 8266's lack of standard C interface to the file system
   is no longer holding us back, meaning that we can use the standard
   Lua `io` module rather than the cobbled-together swiss army knife
   also known as the file module.

Of course, the downside is that we'll either have to declare a backwards
breakage in regard to the file module, or provide a Lua shim for the old
functions, where applicable.

Also included is some necessary integer type fixups in unrelated code,
which apparently had depended on some non-standard types in either the
SPIFFS or FATFS headers.

A memory leak issue in the sdmmc module was also found and fixed while
said module got switched over to the Espressif VFS.

Module documentation has been updated to match the new reality (and I
discovered in some places it wasn't even matching the old reality).
2021-10-20 21:49:11 +11:00
Marcel Stör 32f66e3db5 Attempt to address IDF certificate issue
Details https://github.com/espressif/esp-idf/issues/7631
2021-10-06 21:30:45 +02:00
Marcel Stör 389c119a8b
Add http.put (#3462)
Replaces setpostdata() with setbody().
2021-10-05 13:33:27 +11:00
Johny Mattsson ea968de6f8 Fixup LROT_MASKs for all modules.
Search-and-replace considered harmful. I completely missed the need to
explicitly declare "fast" tag functions (__xyz) in the mask field to
LROT_BEGIN()/LROT_END() when I brought over the 5.1+5.3 support.
Without those flags set properly, the LVM doesn't even bother going
looking for those methods, which in this case led to garbage collection
not calling the __gc functions, among other horrible things.

Mea culpa.
2021-09-16 17:53:35 +10:00
Johny Mattsson 5e52a9e200 Added heaptrace module. 2021-09-16 13:54:55 +10:00
Johny Mattsson b84138595d Add eth.set_ip() functionality.
Effectively the esp_netif version of the recent tcpip_adapter based
support added on dev-esp32 in fa6fd1a41b.
2021-09-09 19:07:51 +10:00
Johny Mattsson 37f682dd70 More ethernet module fixes. 2021-09-09 19:05:48 +10:00
Johny Mattsson 8c69b15591 Lock build runner version. 2021-09-09 17:43:17 +10:00
Johny Mattsson 6f31db5a8a Fix compile issue if ethernet support disabled. 2021-09-01 14:19:04 +10:00
Johny Mattsson 961d996a63 Name luac.cross artifacts better.
They don't need the target in there as the byte code is agnostic, but
it's marginally cleaner than letting the different builds overwrite the
artifacts.
2021-08-30 18:35:48 +10:00
Johny Mattsson 8f83693262 Announce Lua config options with version.
To make it possible to find the right build cross compiler to use with
any given firmware.
2021-08-30 17:55:45 +10:00