Selaa lähdekoodia

[component][ymodem] Fix compilation warning in MDK

Signed-off-by: MurphyZhao <d2014zjt@163.com>
MurphyZhao 6 vuotta sitten
vanhempi
commit
3b161b58f2
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      components/utilities/ymodem/ymodem.c

+ 2 - 2
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);
 }