Commit Graph

19 Commits

Author SHA1 Message Date
Johny Mattsson afbbeb4566 Replaced UART driver.
New driver is a three-way merger between Espressif's esp8266-rtos-sdk example
driver, Espressif's esp32-rtos-sdk not-example driver, and the previous
NodeMCU driver, plus some general clean-ups.

Basic interactivity is now available on the ESP32!
2016-06-23 18:23:04 +10:00
Johny Mattsson d33945b68b Moved sdk submodules for easier branch switching. 2016-06-21 18:06:04 +10:00
Johny Mattsson 224788b642 Make NodeMCU compile and link for ESP32.
A fair bit of reshuffling with include paths and overrides was necessary, as
the two RTOS SDKs (ESP8266 and ESP32) don't have the same header structure
(or even libraries for that matter). Uses the xtensa-esp108-elf toolchain
to build.

Completely untested beyond linking, as I still can't flash the ESP32 module
I have :(  I'd be most surprised if it does anything useful at this point
considering I've spent almost no time on the linker script or UART setup.

Anything using espconn has been ifdef'd out since espconn is not (and
probably will not be) available. Notably this includes the entire net module
as well as coap, mqtt and enduser_setup.

Many (most?) hardware bus drivers and related modules are also ifdef'd
out for now due to hardware differences. Functions surrounding sleep,
rtc and RF modes have also been hit by the ifdef hammer. Grep'ing for
__ESP8266__ and/or FIXME is a quick way of finding these places. With
time I hope all of these will be reinstated.
2016-06-09 18:40:56 +10:00
Johny Mattsson 860aa47dc1 Replacement system_set_os_print() function. 2016-06-02 15:49:56 +10:00
Johny Mattsson 56789592fa Boot to (nonresponsive) Lua prompt on RTOS!
Uart driver currently disabled as it's not (yet) compatible with RTOS.

Running Lua task with excessive stack to avoid smashing it; need to work out
what's using so much stack space.

Changed some flash reading functions to not attempt to drop an entire 4k
flash page onto the stack.

Ensure the task pump doesn't attempt to retrieve from uninitialised queues.
2016-05-30 17:56:33 +10:00
Johny Mattsson e49f2bb13f Remove conflicting libc, rename c_xx and os_xx to xx.
c_strtod and c_getenv are kept since strtod doesn't appear in the SDK's libc,
and we want our own c_getenv to initialize the Lua main anyway.
2016-05-26 18:50:20 +10:00
Johny Mattsson f3e2a3afd9 Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.

Lua environment does not yet start due to the different task architecture.

Known pain points:

  - task implementation needs to be rewritten for RTOS (next up on my TODO)

  - secure espconn does not exist, all secure espconn stuff has been #if 0'd

  - lwip now built from within the RTOS SDK, but does not appear to include
    MDNS support. Investigation needed.

  - there is no access to FRC1 NMI, not sure if we ever actually used that
    however. Also #if 0'd out for now.

  - new timing constraints introduced by the RTOS, all use of ets_delay_us()
    and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).

  - even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
    In the long run everything should be switched to non-prefixed versions.

  - system_set_os_print() not available, needs to be reimplemented

  - all the RTOS rodata is loaded into RAM, as it apparently uses some
    constants while the flash isn't mapped, so our exception handler can't
    work its magic. This should be narrowed down to the minimum possible
    at some point.

  - with each task having its own stack in RTOS, we probably need change
    flash-page buffers from the stack to the heap in a bunch of places.
    A single, shared, page buffer *might* be possible if we limit ourselves
    to running NodeMCU in a single task.

  - there's a ton of junk in the sdk-overrides now; over time the core code
    should be updated to not need those shims
2016-05-24 16:05:02 +10:00
Johny Mattsson 9a7a2c4dc3 Merge pull request #1184 from devsaurus/user-gnu11
Enable -std=gnu11 for user dir
2016-04-30 13:26:09 +10:00
Philip Gladstone 5b4b1e0388 Autobaudrate detection by default -- to reduce problems with speed change (#1215)
* Auto autobaud detection by default

* Added stopping the autobaud if explicitly configured

* Add note about auto-baud to the uart.md
2016-04-17 23:44:18 +02:00
dnc40085 5e9ab01523 Modified wifi module
Implement SDK event monitor
Move wifi status event monitor code into seperate file
(app/modules/wifi_eventmon.c)
Modify wifi lua callback registration code.
Add Functions wifi.ap.deauth and wifi.sta.getrssi
Rework wifi event monitor to use tasking interface
fix for Lua coroutine compatibility issue
Made changes Suggested by TerryE

Also, moved code that sets the default host name out of
luaopen_wifi_init and into a separate function and added a post_task_low
entry in it's place.

Replaced some if test then return error lines with
luaL_argcheck
Add check for malloc null return in wifi.eventmon 
to catch out of memory errors
2016-03-31 19:01:41 -07:00
devsaurus 8bc2e8aa19 Enable -std=gnu11 for user dir 2016-03-24 00:06:09 +01:00
Arnim Läuger 8743319b02 Merge pull request #1000 from devsaurus/sigma_delta
Add sigma_delta module.
2016-02-20 20:11:42 +01:00
devsaurus 8982650df9 Add sigma_delta module. 2016-02-18 21:35:58 +01:00
philip 669543bbf2 Hardware timer support and convert the PWM module to use it 2016-02-17 21:07:33 -05:00
devsaurus 19fda87e33 enable -std=gnu11 for http dir 2016-01-23 22:41:41 +01:00
devsaurus 9f54c8f5d4 enable -std=gnu11 for driver dir with corrected os_printf* decls 2016-01-23 11:22:03 +01:00
Johny Mattsson 182d45f928 Enable -std=gnu11 for modules dir.
Plus boat-load of fixes to actually make that build.
2016-01-20 19:40:47 +11:00
Johny Mattsson a6c0873a28 Upgrade to SDK 1.5.0 + Espressif's Open LWIP 1.5.0.
Removed earlier TCP port randomisation fix - the new SDK has its own fix
even though Espressif told me they wouldn't fix it. Yay?
2015-12-23 11:17:05 +11:00
Johny Mattsson d8ba7d5bd8 Override the c_types.h to get int64_t defined properly.
I really wish they'd just used stdint.h instead of rolling their own broken
stuff.
2015-10-12 13:26:04 +11:00