diff options
| author | thewon86 <[email protected]> | 2022-04-20 10:56:11 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2022-04-20 14:22:43 +0800 |
| commit | f5b0bfd3f4f450424b5bc1f084959d0436c8a6e6 (patch) | |
| tree | 1081304c855cd4002a7f460e59561415bf3e95c1 /components/utilities | |
| parent | 5fa15a19a0917e762c8d10207544f2a0396fd15b (diff) | |
uniform code writing-disable interrupt
Diffstat (limited to 'components/utilities')
| -rw-r--r-- | components/utilities/ymodem/ymodem.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/components/utilities/ymodem/ymodem.c b/components/utilities/ymodem/ymodem.c index a74237689d..51b0578d44 100644 --- a/components/utilities/ymodem/ymodem.c +++ b/components/utilities/ymodem/ymodem.c @@ -627,7 +627,7 @@ rt_err_t rym_recv_on_device( rt_err_t res; rt_err_t (*odev_rx_ind)(rt_device_t dev, rt_size_t size); rt_uint16_t odev_flag; - int int_lvl; + rt_base_t level; RT_ASSERT(_rym_the_ctx == 0); _rym_the_ctx = ctx; @@ -641,13 +641,13 @@ rt_err_t rym_recv_on_device( odev_rx_ind = dev->rx_indicate; /* no data should be received before the device has been fully setted up. */ - int_lvl = rt_hw_interrupt_disable(); + level = rt_hw_interrupt_disable(); rt_device_set_rx_indicate(dev, _rym_rx_ind); odev_flag = dev->open_flag; /* make sure the device don't change the content. */ dev->open_flag &= ~RT_DEVICE_FLAG_STREAM; - rt_hw_interrupt_enable(int_lvl); + rt_hw_interrupt_enable(level); res = rt_device_open(dev, oflag); if (res != RT_EOK) @@ -660,12 +660,12 @@ rt_err_t rym_recv_on_device( __exit: /* no rx_ind should be called before the callback has been fully detached. */ - int_lvl = rt_hw_interrupt_disable(); + level = rt_hw_interrupt_disable(); rt_sem_detach(&ctx->sem); dev->open_flag = odev_flag; rt_device_set_rx_indicate(dev, odev_rx_ind); - rt_hw_interrupt_enable(int_lvl); + rt_hw_interrupt_enable(level); _rym_the_ctx = RT_NULL; @@ -684,7 +684,7 @@ rt_err_t rym_send_on_device( rt_err_t res = 0; rt_err_t (*odev_rx_ind)(rt_device_t dev, rt_size_t size); rt_uint16_t odev_flag; - int int_lvl; + rt_base_t level; RT_ASSERT(_rym_the_ctx == 0); _rym_the_ctx = ctx; @@ -698,13 +698,13 @@ rt_err_t rym_send_on_device( odev_rx_ind = dev->rx_indicate; /* no data should be received before the device has been fully setted up. */ - int_lvl = rt_hw_interrupt_disable(); + level = rt_hw_interrupt_disable(); rt_device_set_rx_indicate(dev, _rym_rx_ind); odev_flag = dev->open_flag; /* make sure the device don't change the content. */ dev->open_flag &= ~RT_DEVICE_FLAG_STREAM; - rt_hw_interrupt_enable(int_lvl); + rt_hw_interrupt_enable(level); res = rt_device_open(dev, oflag); if (res != RT_EOK) @@ -716,12 +716,12 @@ rt_err_t rym_send_on_device( __exit: - int_lvl = rt_hw_interrupt_disable(); + level = rt_hw_interrupt_disable(); rt_sem_detach(&ctx->sem); dev->open_flag = odev_flag; rt_device_set_rx_indicate(dev, odev_rx_ind); - rt_hw_interrupt_enable(int_lvl); + rt_hw_interrupt_enable(level); _rym_the_ctx = RT_NULL; |
