Commit Graph

12 Commits

Author SHA1 Message Date
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
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
Johny Mattsson fbef7feae1 Discard old console driver.
The IDF provides all we need these days, and the old driver was just
needlessly conflicting with the IDF settings and setup.

This also simplifies our uart input path as we no longer need to
duplicate the raw byte handling for when "run_input" is false.
2021-08-23 23:00:54 +10:00
Johny Mattsson 3af14a367b Rework modules handling to support ESP32-S2/S3 too. 2021-08-22 21:25:24 +10:00
Johny Mattsson 16ef39e255 idf4: overhaul to new build system, part 1 of 3
Yet to come:
  - part 2: dealing with deprecated and removed APIs
  - part 3: making it actually work again
2021-07-15 16:27:03 +10:00
Nathaniel Wesley Filardo dd3b217df2
Kconfig: rename LUA_MODULE_* to NODEMCU_CMODULE_* (#3135)
Using the NODEMCU_ namespace prefix makes it obvious that these are not
part of Lua proper (contrast, e.g., LUA_BUILTIN_STRING).  Using
"CMODULE" gives us room to differentiate between modules whose
implementation is in C and whose implemenation is in Lua ("LMODULE").

The ESP8266 branch can adopt the same convention when it moves to
Kconfig; see https://github.com/nodemcu/nodemcu-firmware/issues/3130
2020-08-23 22:49:18 +02:00
Johny Mattsson eaac369dec
LFS support for ESP32 NodeMCU (#2801)
* Port LFS from ESP8266 to ESP32
2019-07-22 19:13:43 +10:00
devsaurus dc0c6ff65d pack-port bits and pieces in spiffs.c:
- implement file.size for spiffs (#1516)
- fix vfs_lseek() result checking in enduser_setup and clarify SPIFFS_lseek() return value (#1570)
- Handle error condition in file.read() (#1599)
2018-11-04 08:49:17 +01:00
devsaurus fb62011ddf Add sdmmc module and enable fatfs. 2017-04-30 22:49:54 +02:00
Johny Mattsson 60339b812b SPIFFS partition support, file module from dev.
Now uses the designated partition (type 0xC2, 0x00) unconditionally.
2016-09-22 17:18:22 +10:00
Johny Mattsson 4f1b33d522 Grabbed latest spiffs + vfs layer from dev branch.
Also included the recent LVM fix.

Platform flash layer not yet functional.
2016-09-21 18:14:15 +10:00
Johny Mattsson a463d764eb WIP ESP32 IDF port.
Currently the UART driver break boot (or at least output).
2016-09-16 18:11:42 +10:00