Browse Source

[Ymodem]Add device open flag as input parameter to ymodem function.

armink 10 years ago
parent
commit
7121697a71
1 changed files with 2 additions and 2 deletions
  1. 2 2
      components/utilities/ymodem/ymodem.c

+ 2 - 2
components/utilities/ymodem/ymodem.c

@@ -311,6 +311,7 @@ static rt_err_t _rym_do_recv(
 rt_err_t rym_recv_on_device(
 rt_err_t rym_recv_on_device(
         struct rym_ctx *ctx,
         struct rym_ctx *ctx,
         rt_device_t dev,
         rt_device_t dev,
+        rt_uint16_t oflag,
         rym_callback on_begin,
         rym_callback on_begin,
         rym_callback on_data,
         rym_callback on_data,
         rym_callback on_end,
         rym_callback on_end,
@@ -341,7 +342,7 @@ rt_err_t rym_recv_on_device(
     dev->flag &= ~RT_DEVICE_FLAG_STREAM;
     dev->flag &= ~RT_DEVICE_FLAG_STREAM;
     rt_hw_interrupt_enable(int_lvl);
     rt_hw_interrupt_enable(int_lvl);
 
 
-    res = rt_device_open(dev, 0);
+    res = rt_device_open(dev, oflag);
     if (res != RT_EOK)
     if (res != RT_EOK)
         goto __exit;
         goto __exit;
 
 
@@ -364,4 +365,3 @@ __exit:
 
 
     return res;
     return res;
 }
 }
-