Skip to content

Commit

Permalink
release R2311
Browse files Browse the repository at this point in the history
  • Loading branch information
maierkomor committed Dec 3, 2023
1 parent 30a48ce commit 437a0ed
Show file tree
Hide file tree
Showing 135 changed files with 22,378 additions and 21,062 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
R2311:
======
- added driver foc.config_init_high()r BQ25601D charging IC
- added BMP388
- added buzzer driver
- added USB-C interface driver for CC1/CC2 power detection
- added SPI per device bus frequency setting
- added LED init level support
- update to head of ESP8266 IDF v3.3
- screen/display caching
- font unifications and optimization
- many bug-fixes (ADC, XIO, SM, SSD130x, display, ...)

R2310:
======
- fixes for SGP30: re-initialize after error, false detection
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ action.
Parasite power is supported and is enabled if you configure the
related gpio.

1-Wire does not work when the CPU runs in a lower frequency mode, as an
internal ROM function does not adjust to that alternate frequency.


Lua support:
============
Expand Down
1 change: 1 addition & 0 deletions components/actions/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void Action::activate(void *a)
if (arg != 0)
a = arg;
assert(func);
log_dbug(TAG,"activate %s",name);
uint64_t st = esp_timer_get_time();
func(a);
uint64_t end = esp_timer_get_time();
Expand Down
12 changes: 10 additions & 2 deletions components/env/env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "sdkconfig.h"

#include "env.h"
#include "stream.h"

Expand Down Expand Up @@ -85,6 +87,7 @@ void EnvBool::writeValue(stream &o) const
void EnvNumber::set(float v)
{
m_value = v;
#ifdef CONFIG_THRESHOLDS
if (m_evhi) {
if (m_tst <= 0) {
if (v > m_high) {
Expand All @@ -100,19 +103,24 @@ void EnvNumber::set(float v)
}
}
}
#endif
}


int EnvNumber::setThresholds(float l, float h, const char *n)
{
#ifdef CONFIG_THRESHOLDS
if (l+FLT_EPSILON >= h)
return 1;
if (m_evhi == 0) {
m_evhi = event_register(n ? n : m_name,"`high");
m_evlo = event_register(n ? n : m_name,"`low");
if (n == 0)
n = concat(getParent()->name(),m_name);
m_evhi = event_register(n,"`high");
m_evlo = event_register(n,"`low");
}
m_low = l;
m_high = h;
#endif
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions components/event/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void event_trigger_arg(event_t id, void *arg)
}


void event_isr_trigger(event_t id)
void IRAM_ATTR event_isr_trigger(event_t id)
{
// ! don't log from ISR
if (id != 0) {
Expand All @@ -385,7 +385,7 @@ void event_isr_trigger(event_t id)
}


void event_isr_trigger_arg(event_t id, void *arg)
void IRAM_ATTR event_isr_trigger_arg(event_t id, void *arg)
{
// ! don't log from ISR
if (id != 0) {
Expand Down
20 changes: 12 additions & 8 deletions components/logging/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <driver/hw_timer.h>
#endif

#ifdef CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
#if defined CONFIG_USB_CONSOLE || defined CONFIG_USB_DIAGLOG
#include <driver/usb_serial_jtag.h>
#endif

Expand Down Expand Up @@ -91,6 +91,7 @@

extern void log_usb(const char *, size_t n);

uint8_t UsbDiag = 1;
static SemaphoreHandle_t UartLock;
#if CONFIG_CONSOLE_UART_NONE != 1
static uart_port_t LogUart = (uart_port_t) CONFIG_CONSOLE_UART_NUM;
Expand Down Expand Up @@ -131,7 +132,7 @@ void con_print(const char *str)
xSemaphoreGive(UartLock);
}
#endif
#if defined CONFIG_USB_DIAGLOG && (defined CONFIG_IDF_TARGET_ESP32C3 || defined CONFIG_IDF_TARGET_ESP32S3)
#if defined CONFIG_USB_DIAGLOG
// will block until a jtag connection is present
// therefore, max delay: 10ms
usb_serial_jtag_write_bytes(str,s,10);
Expand Down Expand Up @@ -166,7 +167,7 @@ void con_printv(const char *f, va_list val)
xSemaphoreGive(UartLock);
}
#endif
#ifdef CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
#ifdef CONFIG_USB_DIAGLOG
usb_serial_jtag_write_bytes(buf,n,portMAX_DELAY);
#endif
}
Expand All @@ -182,7 +183,7 @@ void con_write(const char *str, ssize_t s)
xSemaphoreGive(UartLock);
}
#endif
#ifdef CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
#ifdef CONFIG_USB_DIAGLOG
usb_serial_jtag_write_bytes(str,s,portMAX_DELAY);
#endif
}
Expand All @@ -205,7 +206,7 @@ void log_setup()
#endif
#endif

#ifdef CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
#if defined CONFIG_USB_DIAGLOG || defined CONFIG_USB_CONSOLE
usb_serial_jtag_driver_config_t cfg;
bzero(&cfg,sizeof(cfg));
cfg.rx_buffer_size = 256;
Expand Down Expand Up @@ -301,7 +302,9 @@ void log_common(log_level_t l, logmod_t m, const char *f, va_list val)
if (pdTRUE != xSemaphoreTake(UartLock,MUTEX_ABORT_TIMEOUT))
abort_on_mutex(UartLock,__BASE_FILE__);
uart_write_bytes((uart_port_t)LogUart,buf,s);
// if (l <= ll_warn)
#ifndef CONFIG_DEVEL
if (l <= ll_warn)
#endif
uart_wait_tx_done((uart_port_t)LogUart,portMAX_DELAY);
xSemaphoreGive(UartLock);
}
Expand All @@ -316,8 +319,9 @@ void log_common(log_level_t l, logmod_t m, const char *f, va_list val)
if ((l != ll_local) && (m != MODULE_LOG) && (m != MODULE_LWTCP))
log_syslog(l,m,buf+p,s-p-2,&tv);
#endif
#ifdef CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
usb_serial_jtag_write_bytes(buf,s,0);
#ifdef CONFIG_USB_DIAGLOG
if (UsbDiag)
usb_serial_jtag_write_bytes(buf,s,0);
#endif
#if 0 // defined CONFIG_USB_CONSOLE && defined CONFIG_TINYUSB_CDC_ENABLED
// Logging to CDC would only work if driver is ready.
Expand Down
142 changes: 72 additions & 70 deletions components/logging/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "modules.h"

const char ModNames[] =
"<undef>\0action\0adc\0alarms\0apds\0bh1750\0bmx\0button\0cam\0ccs811b\0cfg\0con\0cyclic\0dht\0dim\0disp\0ds18b20\0event\0fs\0ftpd\0gpio\0hcsr04\0hd44780u\0hdc1000\0hlw8012\0ht16k33\0http\0i2c\0ili9341\0ina219\0influx\0init\0led\0ledc\0log\0lua\0lwtcp\0max7219\0mcp230xx\0mqtt\0nightsky\0ns\0nvm\0opt3001\0ota\0owb\0pca9685\0pcf8574\0relay\0rgbleds\0romfs\0screen\0sgp30\0shell\0si7021\0sm\0sntp\0spi\0ssd130x\0sx1276\0tca9555\0telnet\0ti\0timefuse\0tlc5916\0tlc5947\0tp\0uart\0udns\0udpctrl\0usb\0wlan\0ws2812\0www\0xio\0xpt2046\0";
"<undef>\0action\0adc\0alarms\0apds\0bh1750\0bmx\0bq25\0button\0buzzer\0cam\0ccs811b\0cfg\0con\0cyclic\0dht\0dim\0disp\0ds18b20\0event\0fs\0ftpd\0gpio\0hcsr04\0hd44780u\0hdc1000\0hlw8012\0ht16k33\0http\0i2c\0ili9341\0ina219\0influx\0init\0led\0ledc\0log\0lua\0lwtcp\0max7219\0mcp230xx\0mqtt\0nightsky\0ns\0nvm\0opt3001\0ota\0owb\0pca9685\0pcf8574\0relay\0rgbleds\0romfs\0screen\0sgp30\0shell\0si7021\0sm\0sntp\0spi\0ssd130x\0sx1276\0tca9555\0telnet\0ti\0timefuse\0tlc5916\0tlc5947\0tp\0uart\0udns\0udpctrl\0usb\0wlan\0ws2812\0www\0xio\0xpt2046\0";

const uint16_t ModNameOff[] = {
0,
Expand All @@ -29,73 +29,75 @@ const uint16_t ModNameOff[] = {
26, // apds
31, // bh1750
38, // bmx
42, // button
49, // cam
53, // ccs811b
61, // cfg
65, // con
69, // cyclic
76, // dht
80, // dim
84, // disp
89, // ds18b20
97, // event
103, // fs
106, // ftpd
111, // gpio
116, // hcsr04
123, // hd44780u
132, // hdc1000
140, // hlw8012
148, // ht16k33
156, // http
161, // i2c
165, // ili9341
173, // ina219
180, // influx
187, // init
192, // led
196, // ledc
201, // log
205, // lua
209, // lwtcp
215, // max7219
223, // mcp230xx
232, // mqtt
237, // nightsky
246, // ns
249, // nvm
253, // opt3001
261, // ota
265, // owb
269, // pca9685
277, // pcf8574
285, // relay
291, // rgbleds
299, // romfs
305, // screen
312, // sgp30
318, // shell
324, // si7021
331, // sm
334, // sntp
339, // spi
343, // ssd130x
351, // sx1276
358, // tca9555
366, // telnet
373, // ti
376, // timefuse
385, // tlc5916
393, // tlc5947
401, // tp
404, // uart
409, // udns
414, // udpctrl
422, // usb
426, // wlan
431, // ws2812
438, // www
442, // xio
446, // xpt2046
42, // bq25
47, // button
54, // buzzer
61, // cam
65, // ccs811b
73, // cfg
77, // con
81, // cyclic
88, // dht
92, // dim
96, // disp
101, // ds18b20
109, // event
115, // fs
118, // ftpd
123, // gpio
128, // hcsr04
135, // hd44780u
144, // hdc1000
152, // hlw8012
160, // ht16k33
168, // http
173, // i2c
177, // ili9341
185, // ina219
192, // influx
199, // init
204, // led
208, // ledc
213, // log
217, // lua
221, // lwtcp
227, // max7219
235, // mcp230xx
244, // mqtt
249, // nightsky
258, // ns
261, // nvm
265, // opt3001
273, // ota
277, // owb
281, // pca9685
289, // pcf8574
297, // relay
303, // rgbleds
311, // romfs
317, // screen
324, // sgp30
330, // shell
336, // si7021
343, // sm
346, // sntp
351, // spi
355, // ssd130x
363, // sx1276
370, // tca9555
378, // telnet
385, // ti
388, // timefuse
397, // tlc5916
405, // tlc5947
413, // tp
416, // uart
421, // udns
426, // udpctrl
434, // usb
438, // wlan
443, // ws2812
450, // www
454, // xio
458, // xpt2046
};
8 changes: 6 additions & 2 deletions components/logging/modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ typedef enum logmod_e {
logmod_apds,
logmod_bh1750,
logmod_bmx,
logmod_bq25,
logmod_button,
logmod_buzzer,
logmod_cam,
logmod_ccs811b,
logmod_cfg,
Expand Down Expand Up @@ -113,7 +115,9 @@ typedef enum logmod_e {
#define MODULE_APDS logmod_apds
#define MODULE_BH1750 logmod_bh1750
#define MODULE_BMX logmod_bmx
#define MODULE_BQ25 logmod_bq25
#define MODULE_BUTTON logmod_button
#define MODULE_BUZZER logmod_buzzer
#define MODULE_CAM logmod_cam
#define MODULE_CCS811B logmod_ccs811b
#define MODULE_CFG logmod_cfg
Expand Down Expand Up @@ -182,8 +186,8 @@ typedef enum logmod_e {
#define MODULE_WWW logmod_www
#define MODULE_XIO logmod_xio
#define MODULE_XPT2046 logmod_xpt2046
#define MAX_MODULE_ID 75
#define NUM_MODULES 76
#define MAX_MODULE_ID 77
#define NUM_MODULES 78

#ifdef USE_MODULE
#define TAG USE_MODULE
Expand Down
18 changes: 12 additions & 6 deletions components/streams/estring.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ class estring
bool operator != (const estring &a) const
{ return (a.len != len) || (0 != memcmp(str,a.str,len)); }

bool operator == (const char *s) const
{ return (str == 0) ? (*s == 0) : (0 == strcmp(str,s)); }

bool operator != (const char *s) const
{ return (str == 0) ? (*s != 0) : (0 != strcmp(str,s)); }

const char *c_str() const
{
if (str == 0)
Expand Down Expand Up @@ -103,6 +97,8 @@ class estring
friend bool operator <= (const estring &, const char *);
friend bool operator > (const estring &, const char *);
friend bool operator >= (const estring &, const char *);
friend bool operator == (const estring &, const char *);
friend bool operator != (const estring &, const char *);

private:
friend struct estring_cmp;
Expand Down Expand Up @@ -170,4 +166,14 @@ inline bool operator >= (const estring &l, const char *rs)
return strcmp(l.str,rs) >= 0;
}

inline bool operator == (const estring &l, const char *rs)
{
return strcmp(l.str,rs) == 0;
}

inline bool operator != (const estring &l, const char *rs)
{
return strcmp(l.str,rs) != 0;
}

#endif
Loading

0 comments on commit 437a0ed

Please sign in to comment.