diff options
| author | Bernard Xiong <[email protected]> | 2019-12-17 19:30:53 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-12-17 19:30:53 +0800 |
| commit | 4e295d00cdd9056d72b5716bcd39881f68bfee46 (patch) | |
| tree | 7d10f97b72e8ca57e63e540d71884e2c24c7ec7c /components | |
| parent | 75a3f3dd3a930eab1dc58fa0258a9d1605a0ac11 (diff) | |
| parent | 457759ded7f39dcfe861a4668c627b4731032348 (diff) | |
Merge pull request #3270 from BernardXiong/fix_ymodem
[Util] fix the dependence of file feature in ymodem
Diffstat (limited to 'components')
| -rw-r--r-- | components/utilities/Kconfig | 10 | ||||
| -rw-r--r-- | components/utilities/ymodem/SConscript | 9 | ||||
| -rw-r--r-- | components/utilities/ymodem/ry_sy.c | 3 | ||||
| -rw-r--r-- | components/utilities/ymodem/ymodem.c | 2 |
4 files changed, 18 insertions, 6 deletions
diff --git a/components/utilities/Kconfig b/components/utilities/Kconfig index 7fa6b47601..8b733ecf5c 100644 --- a/components/utilities/Kconfig +++ b/components/utilities/Kconfig @@ -2,12 +2,16 @@ menu "Utilities" config RT_USING_RYM bool "Enable Ymodem" - depends on RT_USING_DFS = y default n if RT_USING_RYM - config YMODEM_DISABLE_CRC_TABLE - bool "Disable CRC Table" + config YMODEM_USING_CRC_TABLE + bool "Enable CRC Table in Ymodem" + default n + + config YMODEM_USING_FILE_TRANSFER + bool "Enable file transfer feature" + select RT_USING_DFS default n endif diff --git a/components/utilities/ymodem/SConscript b/components/utilities/ymodem/SConscript index 3fc3b17249..5be32247d6 100644 --- a/components/utilities/ymodem/SConscript +++ b/components/utilities/ymodem/SConscript @@ -1,8 +1,15 @@ from building import * cwd = GetCurrentDir() -src = Glob('*.c') +src = Split(''' +ymodem.c +''') + CPPPATH = [cwd] + +if GetDepend('RT_USING_DFS') and GetDepend('YMODEM_USING_FILE_TRANSFER'): + src += ['ry_sy.c'] + group = DefineGroup('Utilities', src, depend = ['RT_USING_RYM'], CPPPATH = CPPPATH) Return('group') diff --git a/components/utilities/ymodem/ry_sy.c b/components/utilities/ymodem/ry_sy.c index fa57b8553a..4f4476e402 100644 --- a/components/utilities/ymodem/ry_sy.c +++ b/components/utilities/ymodem/ry_sy.c @@ -11,8 +11,9 @@ #include <rtthread.h> #include <ymodem.h> #include <dfs_posix.h> + +#include <stdio.h> #include <stdlib.h> -#include <board.h> #include <string.h> struct custom_ctx diff --git a/components/utilities/ymodem/ymodem.c b/components/utilities/ymodem/ymodem.c index 0214845303..07055db615 100644 --- a/components/utilities/ymodem/ymodem.c +++ b/components/utilities/ymodem/ymodem.c @@ -13,7 +13,7 @@ #include <rthw.h> #include "ymodem.h" -#ifndef YMODEM_DISABLE_CRC_TABLE +#ifdef YMODEM_USING_CRC_TABLE static const rt_uint16_t ccitt_table[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, |
