From 22ab98a59e0b4711485203f637dd2e0ebdfb6d69 Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Wed, 10 Mar 2021 23:31:14 +0800 Subject: [sfud] Correct dual_io dummy cycle setting to 4. --- components/drivers/spi/sfud/src/sfud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components') diff --git a/components/drivers/spi/sfud/src/sfud.c b/components/drivers/spi/sfud/src/sfud.c index e5b03131ff..4078179262 100644 --- a/components/drivers/spi/sfud/src/sfud.c +++ b/components/drivers/spi/sfud/src/sfud.c @@ -218,7 +218,7 @@ sfud_err sfud_qspi_fast_read_enable(sfud_flash *flash, uint8_t data_line_width) break; case 2: if (read_mode & DUAL_IO) { - qspi_set_read_cmd_format(flash, SFUD_CMD_DUAL_IO_READ_DATA, 1, 2, 8, 2); + qspi_set_read_cmd_format(flash, SFUD_CMD_DUAL_IO_READ_DATA, 1, 2, 4, 2); } else if (read_mode & DUAL_OUTPUT) { qspi_set_read_cmd_format(flash, SFUD_CMD_DUAL_OUTPUT_READ_DATA, 1, 1, 8, 2); } else { -- cgit v1.3.1 From c30a715380be49427fe23f0b00e041f2cb7ac64c Mon Sep 17 00:00:00 2001 From: yangjie Date: Wed, 24 Mar 2021 18:59:36 +0800 Subject: [components]update GPL license to Apache-2.0 --- components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c | 18 ++---------------- components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c | 18 ++---------------- 2 files changed, 4 insertions(+), 32 deletions(-) (limited to 'components') diff --git a/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c b/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c index 129cc7da17..e14e34cfec 100644 --- a/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c +++ b/components/net/lwip-2.0.2/src/apps/tftp/tftp_port.c @@ -1,21 +1,7 @@ /* - * File : tftp_port.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes diff --git a/components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c b/components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c index 129cc7da17..e14e34cfec 100644 --- a/components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c +++ b/components/net/lwip-2.1.2/src/apps/tftp/tftp_port.c @@ -1,21 +1,7 @@ /* - * File : tftp_port.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes -- cgit v1.3.1 From a584b8ba6b6f137480e47eead44d40938e8e6774 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 28 Mar 2021 10:32:20 +0800 Subject: [libc][time] add debug tag --- components/libc/compilers/common/time.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'components') diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index 286a173347..83b6ed5672 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -21,11 +21,15 @@ #include #include -#include + #ifdef RT_USING_DEVICE #include #endif +#define DBG_TAG "TIME" +#define DBG_LVL DBG_INFO +#include + /* seconds per day */ #define SPD 24*60*60 -- cgit v1.3.1 From 7c999e195016456f1b0c977afa8f658c1727994d Mon Sep 17 00:00:00 2001 From: jeshrz Date: Wed, 31 Mar 2021 09:22:47 +0800 Subject: enhance robustness for pthread --- components/libc/pthreads/pthread.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'components') diff --git a/components/libc/pthreads/pthread.c b/components/libc/pthreads/pthread.c index 8a728c4e99..79104d1fd5 100644 --- a/components/libc/pthreads/pthread.c +++ b/components/libc/pthreads/pthread.c @@ -209,6 +209,8 @@ int pthread_create(pthread_t *pid, /* get pthread data */ ptd = _pthread_get_data(pth_id); + RT_ASSERT(ptd != RT_NULL); + if (attr != RT_NULL) { ptd->attr = *attr; @@ -299,6 +301,12 @@ int pthread_detach(pthread_t thread) { int ret = 0; _pthread_data_t *ptd = _pthread_get_data(thread); + if (ptd == RT_NULL) + { + /* invalid pthread id */ + ret = EINVAL; + goto __exit; + } rt_enter_critical(); if (ptd->attr.detachstate == PTHREAD_CREATE_DETACHED) @@ -360,6 +368,12 @@ int pthread_join(pthread_t thread, void **value_ptr) rt_err_t result; ptd = _pthread_get_data(thread); + + if (ptd == RT_NULL) + { + return EINVAL; /* invalid pthread id */ + } + if (ptd && ptd->tid == rt_thread_self()) { /* join self */ @@ -367,7 +381,9 @@ int pthread_join(pthread_t thread, void **value_ptr) } if (ptd->attr.detachstate == PTHREAD_CREATE_DETACHED) + { return EINVAL; /* join on a detached pthread */ + } result = rt_sem_take(ptd->joinable_sem, RT_WAITING_FOREVER); if (result == RT_EOK) @@ -662,7 +678,10 @@ int pthread_cancel(pthread_t thread) /* get posix thread data */ ptd = _pthread_get_data(thread); - RT_ASSERT(ptd != RT_NULL); + if (ptd == RT_NULL) + { + return EINVAL; + } /* cancel self */ if (ptd->tid == rt_thread_self()) -- cgit v1.3.1