Skip to content

Commit c33289a

Browse files
committed
[ymodem] move error codes to rym_code to silence warnings
1 parent 16ceacd commit c33289a

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

components/utilities/ymodem/ymodem.h

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd
2+
* COPYRIGHT (C) 2011-2022, Real-Thread Information Technology Ltd
33
* All rights reserved
44
*
55
* SPDX-License-Identifier: Apache-2.0
@@ -8,6 +8,7 @@
88
* Date Author Notes
99
* 2013-04-14 Grissiom initial implementation
1010
* 2019-12-09 Steven Liu add YMODEM send protocol
11+
* 2022-08-04 Meco Man move error codes to rym_code to silence warnings
1112
*/
1213

1314
#ifndef __YMODEM_H__
@@ -17,7 +18,6 @@
1718
#include <string.h>
1819

1920
/* The word "RYM" is stand for "Real-YModem". */
20-
2121
enum rym_code
2222
{
2323
RYM_CODE_NONE = 0x00,
@@ -28,29 +28,17 @@ enum rym_code
2828
RYM_CODE_NAK = 0x15,
2929
RYM_CODE_CAN = 0x18,
3030
RYM_CODE_C = 0x43,
31-
};
3231

33-
/* RYM error code
34-
*
35-
* We use the rt_err_t to return error values. We take use of current error
36-
* codes available in RTT and append ourselves.
37-
*/
38-
/* timeout on handshake */
39-
#define RYM_ERR_TMO 0x70
40-
/* wrong code, wrong SOH, STX etc. */
41-
#define RYM_ERR_CODE 0x71
42-
/* wrong sequence number */
43-
#define RYM_ERR_SEQ 0x72
44-
/* wrong CRC checksum */
45-
#define RYM_ERR_CRC 0x73
46-
/* not enough data received */
47-
#define RYM_ERR_DSZ 0x74
48-
/* the transmission is aborted by user */
49-
#define RYM_ERR_CAN 0x75
50-
/* wrong answer, wrong ACK or C */
51-
#define RYM_ERR_ACK 0x76
52-
/* transmit file invalid */
53-
#define RYM_ERR_FILE 0x77
32+
/* RYM error code */
33+
RYM_ERR_TMO = 0x70, /* timeout on handshake */
34+
RYM_ERR_CODE = 0x71, /* wrong code, wrong SOH, STX etc */
35+
RYM_ERR_SEQ = 0x72, /* wrong sequence number */
36+
RYM_ERR_CRC = 0x73, /* wrong CRC checksum */
37+
RYM_ERR_DSZ = 0x74, /* not enough data received */
38+
RYM_ERR_CAN = 0x75, /* the transmission is aborted by user */
39+
RYM_ERR_ACK = 0x76, /* wrong answer, wrong ACK or C */
40+
RYM_ERR_FILE = 0x77, /* transmit file invalid */
41+
};
5442

5543
/* how many ticks wait for chars between packet. */
5644
#ifndef RYM_WAIT_CHR_TICK

0 commit comments

Comments
 (0)