1 /* 2 * Copyright (c) 2021 hpmicro 3 * 4 * Change Logs: 5 * Date Author Notes 6 * 2021-08-13 Fan YANG first version 7 * 8 */ 9 10 #include <rtthread.h> 11 #include <rtdevice.h> 12 #include "rtt_board.h" 13 #include <drv_gpio.h> 14 15 void thread_entry(void *arg); 16 17 main(void)18int main(void) 19 { 20 static uint32_t led_thread_arg = 0; 21 rt_thread_t led_thread = rt_thread_create("led_th", thread_entry, &led_thread_arg, 1024, 1, 10); 22 rt_thread_startup(led_thread); 23 24 return 0; 25 } 26 27 thread_entry(void * arg)28void thread_entry(void *arg) 29 { 30 rt_pin_mode(APP_LED0_PIN_NUM, PIN_MODE_OUTPUT); 31 32 while(1){ 33 rt_pin_write(APP_LED0_PIN_NUM, APP_LED_ON); 34 rt_thread_mdelay(500); 35 rt_pin_write(APP_LED0_PIN_NUM, APP_LED_OFF); 36 rt_thread_mdelay(500); 37 } 38 } 39