summaryrefslogtreecommitdiff
path: root/components/utilities
diff options
context:
space:
mode:
authorWayne Lin <[email protected]>2021-07-12 18:17:25 +0800
committerWayne Lin <[email protected]>2021-07-12 18:17:25 +0800
commit735285360929c97d49ed51dbc41dfeec570a35b3 (patch)
tree9c1b5303717e80442037fd43f4144ff67c86bc5c /components/utilities
parent978ea520d982ede86feee1f5f08b04bddd6efd1e (diff)
parent19f1c82bc8355879d157805748b23e6dabed701d (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
Diffstat (limited to 'components/utilities')
-rw-r--r--components/utilities/Kconfig4
-rw-r--r--components/utilities/ulog/ulog.c13
-rw-r--r--components/utilities/ulog/ulog.h1
-rw-r--r--components/utilities/ymodem/SConscript2
4 files changed, 17 insertions, 3 deletions
diff --git a/components/utilities/Kconfig b/components/utilities/Kconfig
index 39bb970f6b..71869bee81 100644
--- a/components/utilities/Kconfig
+++ b/components/utilities/Kconfig
@@ -11,8 +11,8 @@ config RT_USING_RYM
config YMODEM_USING_FILE_TRANSFER
bool "Enable file transfer feature"
- select RT_USING_DFS
- default n
+ depends on RT_USING_DFS
+ default y
endif
config RT_USING_ULOG
diff --git a/components/utilities/ulog/ulog.c b/components/utilities/ulog/ulog.c
index 9dd2ed2fd0..c36fc6ff26 100644
--- a/components/utilities/ulog/ulog.c
+++ b/components/utilities/ulog/ulog.c
@@ -77,6 +77,7 @@
struct rt_ulog
{
rt_bool_t init_ok;
+ rt_bool_t output_lock_enabled;
struct rt_semaphore output_locker;
/* all backends */
rt_slist_t backend_list;
@@ -186,6 +187,9 @@ size_t ulog_ultoa(char *s, unsigned long int n)
static void output_unlock(void)
{
+ if (!ulog.output_lock_enabled)
+ return;
+
/* is in thread context */
if (rt_interrupt_get_nest() == 0)
{
@@ -201,6 +205,9 @@ static void output_unlock(void)
static void output_lock(void)
{
+ if (!ulog.output_lock_enabled)
+ return;
+
/* is in thread context */
if (rt_interrupt_get_nest() == 0)
{
@@ -214,6 +221,11 @@ static void output_lock(void)
}
}
+void ulog_output_lock_enabled(rt_bool_t enabled)
+{
+ ulog.output_lock_enabled = enabled;
+}
+
static char *get_log_buf(void)
{
/* is in thread context */
@@ -1392,6 +1404,7 @@ int ulog_init(void)
return 0;
rt_sem_init(&ulog.output_locker, "ulog lock", 1, RT_IPC_FLAG_FIFO);
+ ulog.output_lock_enabled = RT_TRUE;
rt_slist_init(&ulog.backend_list);
#ifdef ULOG_USING_FILTER
diff --git a/components/utilities/ulog/ulog.h b/components/utilities/ulog/ulog.h
index 3754828e56..1e139222aa 100644
--- a/components/utilities/ulog/ulog.h
+++ b/components/utilities/ulog/ulog.h
@@ -25,6 +25,7 @@ extern "C" {
*/
int ulog_init(void);
int ulog_async_init(void);
+void ulog_output_lock_enabled(rt_bool_t enabled);
void ulog_deinit(void);
/*
diff --git a/components/utilities/ymodem/SConscript b/components/utilities/ymodem/SConscript
index 5be32247d6..d75539fe2c 100644
--- a/components/utilities/ymodem/SConscript
+++ b/components/utilities/ymodem/SConscript
@@ -7,7 +7,7 @@ ymodem.c
CPPPATH = [cwd]
-if GetDepend('RT_USING_DFS') and GetDepend('YMODEM_USING_FILE_TRANSFER'):
+if GetDepend('YMODEM_USING_FILE_TRANSFER'):
src += ['ry_sy.c']
group = DefineGroup('Utilities', src, depend = ['RT_USING_RYM'], CPPPATH = CPPPATH)