Commit 9bbf8f43 authored by Johny Mattsson's avatar Johny Mattsson
Browse files

Successfully boot barebones NodeMCU on ESP32 (only).

RTOS driver evicted as it did not play nice with stdio etc.

Implemented a minimal driver to fully support Lua console on UART0. Output
on UART0 done via stdout (provided by the IDF). Input and setup handled
via driver_console/console.c. In addition to the direct input function
console_getc(), the driver also registers in the syscall tables to enable
regular stdio input functions to work (yay!). The Lua VM is still using the
direct interface since it's less overhead, but does also work when going
through stdin/fd 0.

Auto-bauding on the console is not yet functional; revisit when the UART docs
are available.

Module registration/linking/enabling moved over to be Kconfig based. See
updates to base_nodemcu/include/module.h and base_nodemcu/Kconfig for
details.

The sdk-overrides directory/approach is no longer used. The IDF is simply
too different to the old RTOS SDK - we need to adapt our code directly instead.

Everything in app/ is now unused, and will need to be gradually migrated
into components/ though it is probably better to migrate straight from the
latest dev branch.
parent a463d764
#ifndef _SDK_OVERRIDES_EAGLE_SOC_
#define _SDK_OVERRIDES_EAGLE_SOC_
// TODO: Discover what this is now called in ESP-IDF...
#define ICACHE_RAM_ATTR
#endif
#ifndef _SDK_OVERRIDES_ESP_LIBC_H_
#define _SDK_OVERRIDES_ESP_LIBC_H_
void *zalloc(size_t n);
#endif
../../sdk/esp32-rtos-sdk/include
\ No newline at end of file
#ifndef _SDK_OVERRIDES_ETS_SYS_H_
#define _SDK_OVERRIDES_ETS_SYS_H_
#include_next <rom/ets_sys.h>
#include <freertos/xtensa_api.h>
#define ETS_UART_INTR_ATTACH(fn,arg) xt_set_interrupt_handler(ETS_UART_INUM, fn, arg)
#define ETS_UART_INTR_ENABLE() xt_ints_on(1 << ETS_UART_INUM)
#define ETS_UART_INTR_DISABLE() xt_ints_off(1 << ETS_UART_INUM)
#define ETS_SPI_INTR_ATTACH(fn,arg) xt_set_interrupt_handler(ETS_SPI_INUM, fn, arg)
#define ETS_SPI_INTR_ENABLE() xt_ints_on(1 << ETS_SPI_INUM)
#define ETS_SPI_INTR_DISABLE() xt_ints_off(1 << ETS_SPI_INUM)
#define ETS_GPIO_INTR_ATTACH(fn,arg) xt_set_interrupt_handler(ETS_GPIO_INUM, fn, arg)
#define ETS_GPIO_INTR_ENABLE() xt_ints_on(1 << ETS_GPIO_INUM)
#define ETS_GPIO_INTR_DISABLE() xt_ints_off(1 << ETS_GPIO_INUM)
#define ETS_FRC_TIMER1_INTR_ATTACH(fn,arg) xt_set_interrupt_handler(ETS_FRC_TIMER1_INUM, fn, arg)
#define ETS_FRC1_INTR_ENABLE() xt_ints_on(1 << ETS_FRC_TIMER1_INUM)
#define ETS_FRC1_INTR_DISABLE() xt_ints_off(1 << ETS_FRC_TIMER1_INUM)
// FIXME: double-check this is the correct bit!
#define TM1_EDGE_INT_ENABLE() SET_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1)
#define TM1_EDGE_INT_DISABLE() CLEAR_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1)
#endif
#ifndef _SDK_OVERRIDES_GPIO_H_
#define _SDK_OVERRIDES_GPIO_H_
#include_next <gpio.h>
#define GPIO_STATUS_W1TC_ADDRESS GPIO_STATUS_W1TC
#define GPIO_STATUS_ADDRESS GPIO_STATUS
#define GPIO_OUT_W1TS_ADDRESS GPIO_OUT_W1TS
#define GPIO_OUT_W1TC_ADDRESS GPIO_OUT_W1TC
#define GPIO_ENABLE_W1TC_ADDRESS GPIO_ENABLE_W1TC
#define GPIO_ENABLE_ADDRESS GPIO_ENABLE
// FIXME: how does this apply to the ESP32?
#define GPIO_PIN_SOURCE_SET(x) 0
#define GPIO_PIN_SOURCE_MASK 0
#endif
#ifndef _SDK_OVERRIDES_USER_INTERFACE_H_
#define _SDK_OVERRIDES_USER_INTERFACE_H_
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment