| 140 | } |
| 141 | |
| 142 | int gpio_get_value(unsigned int gpio) |
| 143 | { |
| 144 | unsigned int offset; |
| 145 | int ret=0; |
| 146 | |
| 147 | rt_ubase_t temp = rt_hw_interrupt_disable(); |
| 148 | ret = gpio_to_base(gpio); |
| 149 | if (ret < 0) { |
| 150 | goto gpio_free; |
| 151 | } |
| 152 | |
| 153 | offset = gpio & ((1 << GPIO_GRP_MASK) -1); |
| 154 | ret = gpio_get(offset); |
| 155 | |
| 156 | gpio_free: |
| 157 | rt_hw_interrupt_enable(temp); |
| 158 | |
| 159 | return ret; |
| 160 | } |
| 161 | |
| 162 |
nothing calls this directly
no test coverage detected