build and link hello-world for esp32s2beta

This commit is contained in:
suda-morris
2019-06-06 10:57:29 +08:00
parent 61ce868396
commit 84b2f9f14d
108 changed files with 3377 additions and 645 deletions

View File

@@ -25,7 +25,11 @@
#include "driver/uart.h"
#include "sdkconfig.h"
#include "driver/uart_select.h"
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/uart.h"
#elif CONFIG_IDF_TARGET_ESP32S2BETA
#include "esp32s2beta/rom/uart.h"
#endif
// TODO: make the number of UARTs chip dependent
#define UART_NUM 3
@@ -131,7 +135,11 @@ static void uart_tx_char(int fd, int c)
while (uart->status.txfifo_cnt >= 127) {
;
}
#if CONFIG_IDF_TARGET_ESP32
uart->fifo.rw_byte = c;
#elif CONFIG_IDF_TARGET_ESP32S2BETA
uart->ahb_fifo.rw_byte = c;
#endif
}
static void uart_tx_char_via_driver(int fd, int c)
@@ -146,7 +154,11 @@ static int uart_rx_char(int fd)
if (uart->status.rxfifo_cnt == 0) {
return NONE;
}
#if CONFIG_IDF_TARGET_ESP32
return uart->fifo.rw_byte;
#elif CONFIG_IDF_TARGET_ESP32S2BETA
return uart->ahb_fifo.rw_byte;
#endif
}
static int uart_rx_char_via_driver(int fd)