1. 11 Aug, 2021 1 commit
    • Johny Mattsson's avatar
      Add ESP32C3 support/coexistence. · f123d462
      Johny Mattsson authored
      The uzlib and parts of Lua had to be switched over to use the
      C standard int types, as their custom typedefs conflicted with
      RISC-V toolchain provided typedefs.
      
      UART console driver updated to do less direct register meddling
      and use the IDF uart driver interface for setup. Still using our
      own ISR rather than the default driver ISR. Down the line we
      might want to investigate whether the IDF ISR would be a better
      fit.
      
      Lua C modules have been split into common and ESP32/ESP32-S
      specific ones. In the future there might also be ESP32-C3
      specific modules, which would go into components/modules-esp32c3
      at that point.
      
      Our old automatic fixup of flash size has been discarded as it
      interferes with the checksumming done by the ROM loader and
      results in unbootable systems. The IDF has already taken on
      this work via the ESPTOOL_FLASHSIZE_DETECT option, which handles
      this situation properly.
      f123d462
  2. 04 Aug, 2021 1 commit
  3. 29 Jul, 2021 1 commit
  4. 28 Jul, 2021 3 commits
  5. 26 Jul, 2021 1 commit
  6. 22 Jul, 2021 1 commit
  7. 21 Jul, 2021 2 commits
  8. 20 Jul, 2021 1 commit
    • Johny Mattsson's avatar
      idf4: part 2.2 - update wifi & eth modules to new APIs · d2f8121e
      Johny Mattsson authored
      Only compile-tested so far.
      
      Of note is that the WiFi auto-connect (flag) functionality has been removed
      from the IDF, and as a follow-on so has the "auto" field in the wifi config.
      
      On the Ethernet side, support for the TLK110 PHY seems to have been removed,
      but on the other hand there is now new support for several others.
      d2f8121e
  9. 19 Jul, 2021 1 commit
  10. 15 Jul, 2021 2 commits
  11. 02 Apr, 2021 1 commit
  12. 14 Feb, 2021 1 commit
  13. 22 Jan, 2021 1 commit
  14. 17 Jan, 2021 1 commit
  15. 05 Jan, 2021 2 commits
  16. 17 Sep, 2020 1 commit
  17. 23 Aug, 2020 1 commit
  18. 22 Aug, 2020 1 commit
  19. 03 Aug, 2020 1 commit
    • David Thornley's avatar
      Fix bthci compilation issue (#3201) · 7774b5fa
      David Thornley authored
      Manifests as multiple definition of esp_event_send during compilation, as bthci triggers inclusion of `event_loop.c`. Also improved lbth_init() to support BTDM or BLE_ONLY controller modes.
      7774b5fa
  20. 27 Jul, 2020 1 commit
  21. 08 Jul, 2020 1 commit
  22. 18 May, 2020 1 commit
  23. 01 May, 2020 1 commit
  24. 27 Apr, 2020 1 commit
  25. 29 Oct, 2019 1 commit
  26. 27 Oct, 2019 1 commit
    • John Lauer's avatar
      Add touch sensor module (#2863) · 9a5327ca
      John Lauer authored
      * Touch module 1st checkin
      * ESP32. Check-in 2 for Touch sensor module
      * ESP32: Touch module. Sample Lua code.
      * ESP32: Latest YouTube vid
      * ESP32: Touch docs update
      * Added opt_* methods for value retrieval
      9a5327ca
  27. 12 Oct, 2019 1 commit
    • Johny Mattsson's avatar
      Fix uart regressions & bugs (#2817) · b0558d5b
      Johny Mattsson authored
      * Fix uart regressions & bugs.
      
      Using `uart.on()` with a search character was broken in that it did
      not invoke the callback on a full UART buffer as documented. Logic reworked
      to match docs again.
      
      Fixed memory leak on `task_post()` failure (eep!).
      
      Improved logic to attempt to coalesce input bytes to reduce the number of
      `task_post()` slots used up by the platform uart.
      
      Finally, added a semaphore to prevent the platform uart from overrunning
      the `task_post()` slots all the time on high baud rates (e.g. 1mbit).
      With the semaphore in there, the LVM RTOS task gets a chance to actually
      process the received data and free up a `task_post()` slot or two.
      The above mentioned read coalescing then allows the platform uart to
      immediately catch up.
      
      Also added an error log message if the `task_post()` actually does fail.
      
      * Don't cache the uart delims.
      
      Doing so makes reconfiguring those settings from within the callback not
      take effect until the currently buffered bytes have been processed.
      b0558d5b
  28. 27 Sep, 2019 1 commit
  29. 12 Aug, 2019 1 commit
  30. 22 Jul, 2019 1 commit
  31. 20 Jul, 2019 1 commit
  32. 19 Jul, 2019 1 commit
  33. 14 Jul, 2019 1 commit
    • Johny Mattsson's avatar
      Fix net module data loss & RTOS task unsafety (#2829) · f44e6e96
      Johny Mattsson authored
      To avoid races between the lwIP callbacks (lwIP RTOS task) and the Lua
      handlers (LVM RTOS task), the data flow and ownership has been simplified
      and cleaned up.
      
      lwIP callbacks now have no visibility of the userdata struct. They are
      limited to creating small event objects and task_post()ing them over
      to the LVM "thread", passing ownership in doing so. The shared identifier
      then becomes the struct netconn*.
      
      On the LVM side, we keep a linked list of active userdata objects. This
      allows us to retrieve the correct userdata when we get an event with
      a netconn pointer. Because this list is only ever used within the LVM
      task, no locking is necessary.
      
      The old approach of stashing a userdata pointer into the 'socket' field
      on the netconn has been removed entirely, as this was both not
      thread/RTOS-task safe, and also interfered with the IDFs internal use
      of the socket field (even when using only the netconn layer). As an
      added benefit, this removed the need for all the SYS_ARCH_PROTECT()
      locking stuff.
      
      The need to track receive events before the corresponding userdata object
      has been established has been removed by virtue of not reordering the
      "accept" and the "recv" events any more (previously accepts were posted
      with medium priority, while the receives where high priority, leading
      to the observed reordering and associated headaches).
      
      The workaround for IDF issue 784 has been removed as it is now not needed
      and is in fact directly harmful as it results in a double-free. Yay for
      getting rid of old workarounds!
      
      DNS resolution code paths were merged for the two instances of "socket"
      initiated resolves (connect/dns functions).
      
      Also fixed an instance of using a stack variable for receiving the resolved
      IP address, with said variable going out of scope before the DNS resolution
      necessarily completed (hello, memory corruption!).
      
      Where possible, moved to use the Lua allocator rather than plain malloc.
      
      Finally, the NodeMCU task posting mechanism got a polish and an adjustment.
      Given all the Bad(tm) that tends to happen if something fails task posting,
      I went through a couple of iterations on how to avoid that. Alas, the
      preferred solution of blocking non-LVM RTOS tasks until a slot is free
      turned out to not be viable, as this easily resulted in deadlocks with the
      lwIP stack. After much deliberation I settled on increasing the number of
      available queue slots for the task_post() mechanism, but in the interest
      of user control also now made it user configurable via Kconfig.
      f44e6e96
  34. 11 Jul, 2019 1 commit
    • Johny Mattsson's avatar
      Fix net module losing TCP data. (#2825) · c0145e03
      Johny Mattsson authored
      The netbuf_data() function only returns data from the first pbuf in the
      chain. We need to use netbuf_first() and netbuf_next() to walk the
      pbuf chain and act on each in turn.
      c0145e03
  35. 06 Jul, 2019 1 commit
    • Johny Mattsson's avatar
      OTA support for ESP32 (#2812) · ca89bff0
      Johny Mattsson authored
      * Implemented otaupgrade module.
      
      * Added partition table example for otaupgrade.
      
      * Copy-paste omission. Whoops.
      
      * Updated otaupgrade docs after review.
      ca89bff0