From 5fb16d9b2ba756f330249e75968a3110b4a45075 Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Thu, 28 Dec 2017 14:54:15 +0100 Subject: [PATCH 1/2] Fix regression in i2c_master_read() which rejected all data lenths. --- components/driver/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/driver/i2c.c b/components/driver/i2c.c index e0778be701..e87623bcc7 100644 --- a/components/driver/i2c.c +++ b/components/driver/i2c.c @@ -1005,7 +1005,7 @@ esp_err_t i2c_master_read(i2c_cmd_handle_t cmd_handle, uint8_t* data, size_t dat I2C_CHECK((data != NULL), I2C_ADDR_ERROR_STR, ESP_ERR_INVALID_ARG); I2C_CHECK(cmd_handle != NULL, I2C_CMD_LINK_INIT_ERR_STR, ESP_ERR_INVALID_ARG); I2C_CHECK(ack < I2C_MASTER_ACK_MAX, I2C_ACK_TYPE_ERR_STR, ESP_ERR_INVALID_ARG); - I2C_CHECK(data_len < 1, I2C_DATA_LEN_ERR_STR, ESP_ERR_INVALID_ARG); + I2C_CHECK(data_len > 0, I2C_DATA_LEN_ERR_STR, ESP_ERR_INVALID_ARG); if(ack != I2C_MASTER_LAST_NACK) { return i2c_master_read_static(cmd_handle, data, data_len, ack); From f2370b283051db127bfd0f8e09eb51930eb8cdb4 Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Thu, 28 Dec 2017 15:21:00 +0100 Subject: [PATCH 2/2] Removed logging from pthread conditional variable which completely drowned out any other logging and also had negative effects on the RMT due to sharing the same log system. Related to #1345 / TW#16842 --- components/pthread/pthread_cond_var.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/components/pthread/pthread_cond_var.c b/components/pthread/pthread_cond_var.c index 1d43787d3c..39e23821f1 100644 --- a/components/pthread/pthread_cond_var.c +++ b/components/pthread/pthread_cond_var.c @@ -46,8 +46,6 @@ typedef struct esp_pthread_cond { int pthread_cond_signal(pthread_cond_t *cv) { - ESP_LOGV(TAG, "%s %p", __FUNCTION__, cv); - if (cv == NULL || *cv == (pthread_cond_t) 0) { return EINVAL; } @@ -67,8 +65,6 @@ int pthread_cond_signal(pthread_cond_t *cv) int pthread_cond_broadcast(pthread_cond_t *cv) { - ESP_LOGV(TAG, "%s %p", __FUNCTION__, cv); - if (cv == NULL || *cv == (pthread_cond_t) 0) { return EINVAL; } @@ -87,8 +83,6 @@ int pthread_cond_broadcast(pthread_cond_t *cv) int pthread_cond_wait(pthread_cond_t *cv, pthread_mutex_t *mut) { - ESP_LOGV(TAG, "%s %p %p", __FUNCTION__, cv, mut); - return pthread_cond_timedwait(cv, mut, NULL); } @@ -97,8 +91,6 @@ int pthread_cond_timedwait(pthread_cond_t *cv, pthread_mutex_t *mut, const struc int ret; TickType_t timeout_ticks; - ESP_LOGV(TAG, "%s %p %p %p", __FUNCTION__, cv, mut, to); - if (cv == NULL || *cv == (pthread_cond_t) 0) { return EINVAL; } @@ -166,8 +158,6 @@ int pthread_cond_init(pthread_cond_t *cv, const pthread_condattr_t *att) { (void) att; /* Unused argument as of now */ - ESP_LOGV(TAG, "%s %p %p", __FUNCTION__, cv, att); - if (cv == NULL) { return EINVAL; } @@ -188,7 +178,6 @@ int pthread_cond_destroy(pthread_cond_t *cv) { int ret = 0; - ESP_LOGV(TAG, "%s %p", __FUNCTION__, cv); if (cv == NULL || *cv == (pthread_cond_t) 0) { return EINVAL; }