diff --git a/components/utilities/ymodem/ymodem.c b/components/utilities/ymodem/ymodem.c index 2965040a0055ce4aceb3c43d68ec084631c5f7da..164342964741a8c104326abb8d7cc9be041ebc34 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); }