| 38 | } |
| 39 | |
| 40 | void icu_sample(void) |
| 41 | { |
| 42 | /* init */ |
| 43 | rt_uint32_t pin = rt_pin_get(USER_INPUT); |
| 44 | rt_kprintf("\n pin number : 0x%04X \n", pin); |
| 45 | rt_err_t err = rt_pin_attach_irq(pin, PIN_IRQ_MODE_RISING, irq_callback_test, RT_NULL); |
| 46 | if (RT_EOK != err) |
| 47 | { |
| 48 | rt_kprintf("\n attach irq failed. \n"); |
| 49 | } |
| 50 | err = rt_pin_irq_enable(pin, PIN_IRQ_ENABLE); |
| 51 | if (RT_EOK != err) |
| 52 | { |
| 53 | rt_kprintf("\n enable irq failed. \n"); |
| 54 | } |
| 55 | } |
| 56 | MSH_CMD_EXPORT(icu_sample, icu sample); |
| 57 | #endif |
nothing calls this directly
no test coverage detected