From 3b161b58f2b9ec3c6ff65116625e0c567f124197 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Thu, 23 Aug 2018 17:21:04 +0800 Subject: [PATCH] [component][ymodem] Fix compilation warning in MDK Signed-off-by: MurphyZhao --- components/utilities/ymodem/ymodem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/utilities/ymodem/ymodem.c b/components/utilities/ymodem/ymodem.c index 2965040a0..164342964 100644 --- a/components/utilities/ymodem/ymodem.c +++ b/components/utilities/ymodem/ymodem.c @@ -72,7 +72,7 @@ static enum rym_code _rym_read_code( { /* Fast path */ if (rt_device_read(ctx->dev, 0, ctx->buf, 1) == 1) - return *ctx->buf; + return (enum rym_code)(*ctx->buf); /* Slow path */ do { @@ -85,7 +85,7 @@ static enum rym_code _rym_read_code( /* Try to read one */ rsz = rt_device_read(ctx->dev, 0, ctx->buf, 1); if (rsz == 1) - return *ctx->buf; + return (enum rym_code)(*ctx->buf); } while (1); }