* @brief This function will return the nest of interrupt. * * User application can invoke this function to get whether current * context is interrupt context. * * @return the number of nested interrupts. */
| 134 | * @return the number of nested interrupts. |
| 135 | */ |
| 136 | rt_weak rt_uint8_t rt_interrupt_get_nest(void) |
| 137 | { |
| 138 | rt_uint8_t ret; |
| 139 | rt_base_t level; |
| 140 | |
| 141 | level = rt_hw_local_irq_disable(); |
| 142 | ret = rt_atomic_load(&rt_interrupt_nest); |
| 143 | rt_hw_local_irq_enable(level); |
| 144 | return ret; |
| 145 | } |
| 146 | RTM_EXPORT(rt_interrupt_get_nest); |
| 147 | |
| 148 | RTM_EXPORT(rt_hw_interrupt_disable); |
no outgoing calls
no test coverage detected