Updated to latest IDF.
Lost some helpful macros when they changed the uart register header it seems.
This commit is contained in:
parent
baf8249a79
commit
48bbe74cbf
|
@ -34,7 +34,7 @@
|
||||||
#include "driver/console.h"
|
#include "driver/console.h"
|
||||||
#include "esp_intr.h"
|
#include "esp_intr.h"
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
#include "soc/uart_register.h"
|
#include "soc/uart_reg.h"
|
||||||
#include "soc/dport_reg.h"
|
#include "soc/dport_reg.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/queue.h"
|
#include "freertos/queue.h"
|
||||||
|
@ -46,6 +46,20 @@
|
||||||
#define UART_INPUT_QUEUE_SZ 0x100
|
#define UART_INPUT_QUEUE_SZ 0x100
|
||||||
#define MAP_CONSOLE_UART_PRO_INT_NO 9 // PRO interrupt used by this driver for uart0
|
#define MAP_CONSOLE_UART_PRO_INT_NO 9 // PRO interrupt used by this driver for uart0
|
||||||
|
|
||||||
|
// These used to be available in soc/uart_register.h:
|
||||||
|
#define UART_GET_RXFIFO_RD_BYTE(i) GET_PERI_REG_BITS2(UART_FIFO_REG(i) , UART_RXFIFO_RD_BYTE_V, UART_RXFIFO_RD_BYTE_S)
|
||||||
|
#define UART_GET_RXFIFO_CNT(i) GET_PERI_REG_BITS2(UART_STATUS_REG(i) , UART_RXFIFO_CNT_V, UART_RXFIFO_CNT_S)
|
||||||
|
#define UART_SET_AUTOBAUD_EN(i,val) SET_PERI_REG_BITS(UART_AUTOBAUD_REG(i) ,UART_AUTOBAUD_EN_V,(val),UART_AUTOBAUD_EN_S)
|
||||||
|
# define UART_SET_PARITY_EN(i,val) SET_PERI_REG_BITS(UART_CONF0_REG(i) ,UART_PARITY_EN_V,(val),UART_PARITY_EN_S)
|
||||||
|
#define UART_SET_RX_TOUT_EN(i,val) SET_PERI_REG_BITS(UART_CONF1_REG(i) ,UART_RX_TOUT_EN_V,(val),UART_RX_TOUT_EN_S)
|
||||||
|
#define UART_SET_RX_TOUT_THRHD(i,val) SET_PERI_REG_BITS(UART_CONF1_REG(i) ,UART_RX_TOUT_THRHD_V,(val),UART_RX_TOUT_THRHD_S)
|
||||||
|
#define UART_SET_RXFIFO_FULL_THRHD(i,val) SET_PERI_REG_BITS(UART_CONF1_REG(i) ,UART_RXFIFO_FULL_THRHD_V,(val),UART_RXFIFO_FULL_THRHD_S)
|
||||||
|
#define UART_SET_STOP_BIT_NUM(i,val) SET_PERI_REG_BITS(UART_CONF0_REG(i) ,UART_STOP_BIT_NUM_V,(val),UART_STOP_BIT_NUM_S)
|
||||||
|
#define UART_SET_BIT_NUM(i,val) SET_PERI_REG_BITS(UART_CONF0_REG(i) ,UART_BIT_NUM_V,(val),UART_BIT_NUM_S)
|
||||||
|
#define UART_SET_PARITY_EN(i,val) SET_PERI_REG_BITS(UART_CONF0_REG(i) ,UART_PARITY_EN_V,(val),UART_PARITY_EN_S)
|
||||||
|
#define UART_SET_PARITY(i,val) SET_PERI_REG_BITS(UART_CONF0_REG(i) ,UART_PARITY_V,(val),UART_PARITY_S)
|
||||||
|
|
||||||
|
|
||||||
typedef int (*_read_r_fn) (struct _reent *r, int fd, void *buf, int size);
|
typedef int (*_read_r_fn) (struct _reent *r, int fd, void *buf, int size);
|
||||||
|
|
||||||
static _read_r_fn _read_r_pro, _read_r_app;
|
static _read_r_fn _read_r_pro, _read_r_app;
|
||||||
|
@ -159,7 +173,7 @@ void console_init (const ConsoleSetup_t *cfg, task_handle_t tsk)
|
||||||
UART_RXFIFO_FULL_INT_ENA |
|
UART_RXFIFO_FULL_INT_ENA |
|
||||||
UART_FRM_ERR_INT_ENA);
|
UART_FRM_ERR_INT_ENA);
|
||||||
|
|
||||||
WRITE_PERI_REG(PRO_UART_INTR_MAP_REG, MAP_CONSOLE_UART_PRO_INT_NO);
|
WRITE_PERI_REG(DPORT_PRO_UART_INTR_MAP_REG, MAP_CONSOLE_UART_PRO_INT_NO);
|
||||||
ESP_INTR_ENABLE(MAP_CONSOLE_UART_PRO_INT_NO);
|
ESP_INTR_ENABLE(MAP_CONSOLE_UART_PRO_INT_NO);
|
||||||
|
|
||||||
// Register our console_read_r_xxx functions to support stdin input
|
// Register our console_read_r_xxx functions to support stdin input
|
||||||
|
|
|
@ -76,7 +76,7 @@ static bool get_spiffs_partition (spiffs_config *cfg)
|
||||||
NODE_ERR("No filesystem partition found, attempting to create it...\n");
|
NODE_ERR("No filesystem partition found, attempting to create it...\n");
|
||||||
info.type = PLATFORM_PARTITION_TYPE_NODEMCU;
|
info.type = PLATFORM_PARTITION_TYPE_NODEMCU;
|
||||||
info.subtype = PLATFORM_PARTITION_SUBTYPE_NODEMCU_SPIFFS;
|
info.subtype = PLATFORM_PARTITION_SUBTYPE_NODEMCU_SPIFFS;
|
||||||
strcpy (info.label, "spiffs");
|
strcpy ((char *)info.label, "spiffs");
|
||||||
info.offs = cfg->phys_addr = next_free_offs;
|
info.offs = cfg->phys_addr = next_free_offs;
|
||||||
info.size = cfg->phys_size = flash_safe_get_size_byte () - info.offs;
|
info.size = cfg->phys_size = flash_safe_get_size_byte () - info.offs;
|
||||||
if (info.size <= 0)
|
if (info.size <= 0)
|
||||||
|
@ -306,7 +306,7 @@ static uint32_t myspiffs_vfs_isize( const struct vfs_item *di ) {
|
||||||
static const char *myspiffs_vfs_name( const struct vfs_item *di ) {
|
static const char *myspiffs_vfs_name( const struct vfs_item *di ) {
|
||||||
GET_STAT_S(di);
|
GET_STAT_S(di);
|
||||||
|
|
||||||
return s->name;
|
return (const char *)s->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ static vfs_item *myspiffs_vfs_readdir( const struct vfs_dir *dd ) {
|
||||||
stat->vfs_item.fns = &myspiffs_item_fns;
|
stat->vfs_item.fns = &myspiffs_item_fns;
|
||||||
// copy entries to vfs' directory item
|
// copy entries to vfs' directory item
|
||||||
stat->s.size = dirent.size;
|
stat->s.size = dirent.size;
|
||||||
strncpy( stat->s.name, dirent.name, SPIFFS_OBJ_NAME_LEN );
|
strncpy((char *)stat->s.name, (char *)dirent.name, SPIFFS_OBJ_NAME_LEN );
|
||||||
return (vfs_item *)stat;
|
return (vfs_item *)stat;
|
||||||
} else {
|
} else {
|
||||||
free( stat );
|
free( stat );
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit b6b83c33bec18746657ae7cc35b7cff7d1abba6a
|
Subproject commit 4480ab6c8ce70778df4948e587e712540de237eb
|
Loading…
Reference in New Issue