******************************************************************************* ** \brief Main function of GPIO output ** ** \param None ** ** \retval int32_t Return value, if needed ** ******************************************************************************/
| 60 | ** |
| 61 | ******************************************************************************/ |
| 62 | int main(void) |
| 63 | { |
| 64 | rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT); |
| 65 | rt_pin_attach_irq(KEY_PIN, PIN_IRQ_MODE_FALLING, key_handler, RT_NULL); |
| 66 | rt_pin_irq_enable(KEY_PIN, PIN_IRQ_ENABLE); |
| 67 | |
| 68 | while(1) |
| 69 | { |
| 70 | if (flag == 0) |
| 71 | { |
| 72 | rt_pin_write(LED_PIN, PIN_HIGH); |
| 73 | rt_thread_delay(500); |
| 74 | rt_pin_write(LED_PIN, PIN_LOW); |
| 75 | rt_thread_delay(500); |
| 76 | } |
| 77 | else |
| 78 | { |
| 79 | rt_pin_write(LED_PIN, PIN_HIGH); |
| 80 | rt_thread_delay(2000); |
| 81 | rt_pin_write(LED_PIN, PIN_LOW); |
| 82 | rt_thread_delay(2000); |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | /******************************************************************************* |
| 88 | * EOF (not truncated) |
nothing calls this directly
no test coverage detected