Skip to content

Commit

Permalink
release R2307
Browse files Browse the repository at this point in the history
  • Loading branch information
maierkomor committed Aug 5, 2023
1 parent c915ded commit 5c42ec7
Show file tree
Hide file tree
Showing 116 changed files with 11,105 additions and 3,610 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
R2307:
======
- added/enhanced support for HDC1000 and HDC1080
- update to IDF version 5.1 for S3 dual-core support
- ILI9341 update
- added support for ESP32-C6
- fixes

R2306:
======
- fix: enable/disable at-jobs not working as expected
Expand Down
2 changes: 1 addition & 1 deletion bin/flash-atrium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ esp32_4m | esp32-s2_4m)
esptool.py --chip $chip erase_flash
esptool.py --baud 1000000 --chip $chip write_flash 0x1000 $1/[email protected] 0x8000 $1/[email protected] 0x100000 $1/atrium.bin
;;
esp32-c3_4m | esp32-s3_4m )
esp32-c3_4m | esp32-c6_4m | esp32-s3_4m )
esptool.py --chip $chip erase_flash
esptool.py --baud 1000000 --chip $chip write_flash 0x0000 $1/[email protected] 0x8000 $1/[email protected] 0x100000 $1/atrium.bin
;;
Expand Down
3 changes: 2 additions & 1 deletion components/cyclic/cyclic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static StaticTask_t CyclicTask;

static SubTask *SubTasks = 0;
static SemaphoreHandle_t Mtx = 0;
static volatile uint64_t TimeSpent = 0;
static uint64_t TimeSpent = 0;

#ifdef CONFIG_ESPTOOLPY_FLASHSIZE_1MB
#define busy_set(...)
Expand Down Expand Up @@ -144,6 +144,7 @@ int cyclic_rm_task(const char *name)
}


// called from event task, if no dedicated cyclic task is created
unsigned cyclic_execute()
{
MLock lock(Mtx,__FUNCTION__);
Expand Down
5 changes: 4 additions & 1 deletion components/event/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ void event_trigger(event_t id)
++Invalid;
} else if (EventHandlers[id].callbacks.empty()) {
++Discarded;
++EventHandlers[id].occur;
} else {
Event e(id);
BaseType_t r = xQueueSend(EventsQ,&e,1000);
Expand All @@ -356,13 +357,15 @@ void event_trigger_arg(event_t id, void *arg)
if ((id != 0) && (id < EventHandlers.size())) {
if (!EventHandlers[id].callbacks.empty()) {
Event e(id,arg);
log_dbug(TAG,"trigger %d %p",id,arg);
BaseType_t r = xQueueSend(EventsQ,&e,1000);
if (r != pdTRUE)
++Lost;
else
log_dbug(TAG,"trigger %d %p",id,arg);
return;
}
++Discarded;
++EventHandlers[id].occur;
} else {
++Invalid;
}
Expand Down
2 changes: 1 addition & 1 deletion components/logging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#register_component()
idf_component_register(
SRCS logging.c modules.c profiling.cpp xlog.cpp
REQUIRES netsvc streams term main esp_timer tinyusb
REQUIRES netsvc streams term main esp_timer #tinyusb
INCLUDE_DIRS .
)
6 changes: 3 additions & 3 deletions components/logging/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void log_common(log_level_t l, logmod_t m, const char *f, va_list val)
#else
struct timespec ts;
clock_gettime(CLOCK_REALTIME,&ts);
p += sprintf(at," (%lu.%03u) %s: ",ts.tv_sec,(unsigned)(ts.tv_nsec/1E6),a);
p += sprintf(at," (%llu.%03u) %s: ",ts.tv_sec,(unsigned)(ts.tv_nsec/1E6),a);
#endif
} else {
struct tm tm;
Expand Down Expand Up @@ -405,10 +405,10 @@ void abort_on_mutex(SemaphoreHandle_t mtx, const char *usage)
uart_print(__FUNCTION__);
TaskHandle_t h = xSemaphoreGetMutexHolder(mtx);
#if defined ESP32
const char *n = pcTaskGetTaskName(0);
const char *n = pcTaskGetName(0);
if (n)
uart_print(n);
n = pcTaskGetTaskName(h);
n = pcTaskGetName(h);
if (n)
uart_print(n);
#else
Expand Down
6 changes: 3 additions & 3 deletions components/netsvc/tcpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typedef struct tcpout_arg {
struct tcp_pcb *pcb;
const char *name;
err_t err;
xSemaphoreHandle sem;
SemaphoreHandle_t sem;
} tcpout_arg_t;

typedef struct tcpwrite_arg {
Expand All @@ -37,12 +37,12 @@ typedef struct tcpwrite_arg {
const char *data;
size_t size;
err_t err;
xSemaphoreHandle sem;
SemaphoreHandle_t sem;
} tcpwrite_arg_t;

typedef struct tcp_pbuf_arg {
struct pbuf *pbuf;
xSemaphoreHandle sem;
SemaphoreHandle_t sem;
} tcp_pbuf_arg_t;

#ifdef __cplusplus
Expand Down
14 changes: 9 additions & 5 deletions components/netsvc/udns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct DnsEntry
{
DnsEntry *next;
ip_addr_t ip;
portTickType ttl;
TickType_t ttl;
uint8_t len;
char host[];
};
Expand All @@ -161,7 +161,7 @@ struct DnsEntry
struct Query
{
Query *next;
portTickType ts;
TickType_t ts;
uint8_t *buf;
void *arg;
void (*cb)(const char *, const ip_addr_t *, void *);
Expand Down Expand Up @@ -463,7 +463,7 @@ static int parseAnswer(struct pbuf *p, size_t off, const ip_addr_t *sender)
return -off;
}
log_devel(TAG,"IPv4 %s",ip2str_r(&ip,ipstr,sizeof(ipstr)));
#if defined CONFIG_LWIP_IPV6 || defined ESP32
#if defined CONFIG_LWIP_IPV6 //|| defined ESP32
// why mask bit 15?
// } else if (((a.rr_class & 0x7fff) == TYPE_ADDR) && (a.rdlen == 16)) {
} else if ((a.rr_class == TYPE_ADDR) && (a.rdlen == 16)) {
Expand Down Expand Up @@ -1087,7 +1087,7 @@ static void udns_cyclic_fn(void *arg)
if (Queries) {
Lock lock(Mtx,__FUNCTION__);
log_dbug(TAG,"locked");
portTickType ts = xTaskGetTickCount();
TickType_t ts = xTaskGetTickCount();
Query *q = Queries;
while (q) {
log_dbug(TAG,"%s: q->ts=%u, ts=%u",q->hostname,q->ts,ts);
Expand Down Expand Up @@ -1139,7 +1139,7 @@ static unsigned udns_cyclic(void *arg)
abort();
}
Lock lock(Mtx,__FUNCTION__);
portTickType ts = xTaskGetTickCount();
TickType_t ts = xTaskGetTickCount();
Query *q = Queries;
while (q) {
if ((q->ts + configTICK_RATE_HZ < ts) && (!q->local)) {
Expand All @@ -1165,12 +1165,14 @@ static void wifi_down(void *)

static inline void mdns_init_fn(void *)
{
#if 0
tcpip_adapter_ip_info_t ipconfig;
assert(Mtx);
if (ESP_OK == tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ipconfig)) {
if (0 != ipconfig.ip.addr)
IP4 = ipconfig.ip;
}
#endif
#if LWIP_IPV6
if (MPCB6 == 0) {
ip_addr_t mdns_ip6;
Expand All @@ -1195,10 +1197,12 @@ static inline void mdns_init_fn(void *)
IP_ADDR4(&mdns,224,0,0,251);
if (err_t e = udp_connect(MPCB,&mdns,MDNS_PORT))
log_warn(TAG,"connect 224.0.0.251: %s",strlwiperr(e));
#if 0
if (err_t e = igmp_joingroup(&ipconfig.ip,ip_2_ip4(&mdns)))
log_warn(TAG,"unable to join MDNS group: %d",e);
else
log_dbug(TAG,"initialized MDNS");
#endif
}
#endif
State = mdns_wifiup;
Expand Down
9 changes: 7 additions & 2 deletions components/streams/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,18 @@ class stream
stream &operator << (uint32_t v)
{ return operator << ((uint64_t) v); }

#if defined CONFIG_IDF_TARGET_ESP32C3
#if defined ESP32 && IDF_VERSION < 50
stream &operator << (size_t v)
{ return operator << ((uint64_t) v); }
#endif

#if IDF_VERSION >= 50
stream &operator << (int v)
{ return operator << ((int64_t) v); }

stream &operator << (unsigned v)
{ return operator << ((uint64_t) v); }
#endif
#endif

stream &operator << (double);

Expand Down
2 changes: 1 addition & 1 deletion components/term/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ idf_component_register(

INCLUDE_DIRS .

REQUIRES logging netsvc streams tinyusb
REQUIRES logging netsvc streams #tinyusb
)
8 changes: 4 additions & 4 deletions components/term/uart_terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ void UartTerminal::init(uint8_t uart)
{
m_uart_rx = uart;
m_uart_tx = uart;
#if CONFIG_UART_CONSOLE_NONE != 1
#if CONFIG_UART_CONSOLE_NONE != 1 && CONFIG_CONSOLE_UART_NUM != -1
if ((int)uart != CONFIG_CONSOLE_UART_NUM)
#endif
uart_driver_install((uart_port_t)uart,UART_FIFO_LEN*2,UART_FIFO_LEN*2,0,DRIVER_ARG);
sprintf(m_name,"uart@%d",uart);
snprintf(m_name,sizeof(m_name),"uart@%d",uart);
}


void UartTerminal::init(uint8_t rx, uint8_t tx)
{
m_uart_rx = rx;
m_uart_tx = tx;
sprintf(m_name,"uart@%d,%d",rx,tx);
#if CONFIG_UART_CONSOLE_NONE != 1
snprintf(m_name,sizeof(m_name),"uart@%d,%d",rx,tx);
#if CONFIG_UART_CONSOLE_NONE != 1 && CONFIG_CONSOLE_UART_NUM != -1
if ((int)rx != CONFIG_CONSOLE_UART_NUM)
#endif
uart_driver_install((uart_port_t)rx,UART_FIFO_LEN*2,UART_FIFO_LEN*2,0,DRIVER_ARG);
Expand Down
4 changes: 4 additions & 0 deletions components/term/uart_terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ class UartTerminal : public Terminal

private:
int8_t m_uart_rx, m_uart_tx;
#if IDF_VERSION >= 50
char m_name[14];
#else
char m_name[10];
#endif
};

extern "C"
Expand Down
17 changes: 16 additions & 1 deletion components/wfc/hwcfg_esp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Copyright: 2018-2023
* Author : Thomas Maier-Komor
*
* Code generated on 2023-07-01, 22:37:39 (CET).
* Code generated on 2023-07-31, 21:35:41 (CET).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -500,6 +500,7 @@ const char *disp_t_str(disp_t e)
static const char *spidrv_t_names[] = {
"spidrv_ili9341",
"spidrv_invalid",
"spidrv_sdcard",
"spidrv_ssd1309",
"spidrv_sx1276",
"spidrv_xpt2046",
Expand All @@ -508,6 +509,7 @@ static const char *spidrv_t_names[] = {
static spidrv_t spidrv_t_values[] = {
spidrv_ili9341,
spidrv_invalid,
spidrv_sdcard,
spidrv_ssd1309,
spidrv_sx1276,
spidrv_xpt2046,
Expand All @@ -520,6 +522,7 @@ size_t parse_ascii_spidrv_t(spidrv_t *v, const char *s)
static std::map<const char *,spidrv_t, cstr_less> namesmap = {
{ "spidrv_ili9341", spidrv_ili9341},
{ "spidrv_invalid", spidrv_invalid},
{ "spidrv_sdcard", spidrv_sdcard},
{ "spidrv_ssd1309", spidrv_ssd1309},
{ "spidrv_sx1276", spidrv_sx1276},
{ "spidrv_xpt2046", spidrv_xpt2046},
Expand Down Expand Up @@ -564,6 +567,8 @@ const char *spidrv_t_str(spidrv_t e)
return "spidrv_ili9341";
case spidrv_xpt2046:
return "spidrv_xpt2046";
case spidrv_sdcard:
return "spidrv_sdcard";
}
#endif // !CONFIG_ESPTOOLPY_FLASHSIZE_1MB
#ifdef CONFIG_ESPTOOLPY_FLASHSIZE_1MB
Expand Down Expand Up @@ -3704,6 +3709,10 @@ void I2CConfig::toASCII(stream &o, size_t indent) const
o << ".drv = " ;
o << i2cdrv_t_str(devices_drv(i));
o << ';';
ascii_indent(o,indent);
o << ".intr = " ;
o << (unsigned) devices_intr(i);
o << ';';
--indent;
}
--indent;
Expand Down Expand Up @@ -4108,6 +4117,12 @@ int I2CConfig::setByName(const char *name, const char *value)
}
}
}
if (!strcmp("intr",idxe)) {
if (eptr != value) {
set_devices_intr(x,(uint8_t)ull);
return 0;
}
}
return -199;
}
}
Expand Down
24 changes: 20 additions & 4 deletions components/wfc/hwcfg_esp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Copyright: 2018-2023
* Author : Thomas Maier-Komor
*
* Code generated on 2023-07-01, 22:37:39 (CET).
* Code generated on 2023-07-31, 21:35:41 (CET).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -201,6 +201,7 @@ typedef enum {
spidrv_ssd1309 = 2,
spidrv_ili9341 = 3,
spidrv_xpt2046 = 4,
spidrv_sdcard = 5,
} spidrv_t;
//! Function to get an ASCII string from a value of a spidrv_t.
const char *spidrv_t_str(spidrv_t e);
Expand All @@ -209,7 +210,7 @@ size_t parse_ascii_spidrv_t(spidrv_t *, const char *);

typedef uint8_t pull_mode_t;
typedef uint8_t relay_cfg_t;
typedef uint16_t i2cdev_t;
typedef uint32_t i2cdev_t;
typedef uint8_t ledcfg_t;
typedef uint16_t gpiocfg_t;
typedef uint8_t spiopt_t;
Expand Down Expand Up @@ -2137,6 +2138,10 @@ class I2CConfig : public Message
i2cdrv_t devices_drv(unsigned x) const;
//! Function to set the drv part of bitset devices.
void set_devices_drv(unsigned x, i2cdrv_t);
//! Function to get the intr part of bitset devices.
uint8_t devices_intr(unsigned x) const;
//! Function to set the intr part of bitset devices.
void set_devices_intr(unsigned x, uint8_t);
//! Set devices using a constant reference
void set_devices(unsigned x, i2cdev_t v);
/*!
Expand Down Expand Up @@ -7264,6 +7269,11 @@ inline i2cdrv_t I2CConfig::devices_drv(unsigned x) const
return (i2cdrv_t)((m_devices[x] >> 8) & 0xff);
}

inline uint8_t I2CConfig::devices_intr(unsigned x) const
{
return (uint8_t)((m_devices[x] >> 16) & 0x3f);
}

/*!
* Function for clearing the associated member variable.
* It will reset the value to the default value.
Expand All @@ -7288,13 +7298,19 @@ inline std::vector<i2cdev_t> *I2CConfig::mutable_devices()
inline void I2CConfig::set_devices_addr(unsigned x, uint8_t v)
{
m_devices[x] &= ~(0x7fULL << 0);
m_devices[x] |= ((uint16_t) v << 0);
m_devices[x] |= ((uint32_t) v << 0);
}

inline void I2CConfig::set_devices_drv(unsigned x, i2cdrv_t v)
{
m_devices[x] &= ~(0xffULL << 8);
m_devices[x] |= ((uint16_t) v << 8);
m_devices[x] |= ((uint32_t) v << 8);
}

inline void I2CConfig::set_devices_intr(unsigned x, uint8_t v)
{
m_devices[x] &= ~(0x3fULL << 16);
m_devices[x] |= ((uint32_t) v << 16);
}

inline void I2CConfig::add_devices(i2cdev_t v)
Expand Down
Loading

0 comments on commit 5c42ec7

Please sign in to comment.