Skip to content

Commit 457759d

Browse files
committed
[Util] fix the dependence of file feature in ymodem
1 parent 75a3f3d commit 457759d

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

components/utilities/Kconfig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ menu "Utilities"
22

33
config RT_USING_RYM
44
bool "Enable Ymodem"
5-
depends on RT_USING_DFS = y
65
default n
76

87
if RT_USING_RYM
9-
config YMODEM_DISABLE_CRC_TABLE
10-
bool "Disable CRC Table"
8+
config YMODEM_USING_CRC_TABLE
9+
bool "Enable CRC Table in Ymodem"
10+
default n
11+
12+
config YMODEM_USING_FILE_TRANSFER
13+
bool "Enable file transfer feature"
14+
select RT_USING_DFS
1115
default n
1216
endif
1317

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
from building import *
22

33
cwd = GetCurrentDir()
4-
src = Glob('*.c')
4+
src = Split('''
5+
ymodem.c
6+
''')
7+
58
CPPPATH = [cwd]
9+
10+
if GetDepend('RT_USING_DFS') and GetDepend('YMODEM_USING_FILE_TRANSFER'):
11+
src += ['ry_sy.c']
12+
613
group = DefineGroup('Utilities', src, depend = ['RT_USING_RYM'], CPPPATH = CPPPATH)
714

815
Return('group')

components/utilities/ymodem/ry_sy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
#include <rtthread.h>
1212
#include <ymodem.h>
1313
#include <dfs_posix.h>
14+
15+
#include <stdio.h>
1416
#include <stdlib.h>
15-
#include <board.h>
1617
#include <string.h>
1718

1819
struct custom_ctx

components/utilities/ymodem/ymodem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <rthw.h>
1414
#include "ymodem.h"
1515

16-
#ifndef YMODEM_DISABLE_CRC_TABLE
16+
#ifdef YMODEM_USING_CRC_TABLE
1717
static const rt_uint16_t ccitt_table[256] =
1818
{
1919
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,

0 commit comments

Comments
 (0)