2022-04-29 09:01:44 +08:00
|
|
|
/*
|
2022-06-04 17:04:19 +08:00
|
|
|
* Copyright (c) 2021-2022, RT-Thread Development Team
|
2022-04-29 09:01:44 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
2023-10-20 12:22:28 +08:00
|
|
|
* Date Author Notes
|
|
|
|
* 2022-04-24 supperthomas first version
|
|
|
|
* 2022-06-02 supperthomas fix version
|
|
|
|
* 2023-10-20 WCX1024979076 add wifi application
|
2022-04-29 09:01:44 +08:00
|
|
|
*/
|
|
|
|
|
2022-06-04 17:04:19 +08:00
|
|
|
#include <rtthread.h>
|
|
|
|
#include <rtdevice.h>
|
|
|
|
#include <board.h>
|
2022-04-29 09:01:44 +08:00
|
|
|
|
2022-09-14 15:49:05 +08:00
|
|
|
int main(void)
|
2022-04-29 09:01:44 +08:00
|
|
|
{
|
2022-08-06 01:35:38 +08:00
|
|
|
rt_kprintf("Hello!RT-THREAD!\r\n");
|
2022-07-03 21:40:12 +08:00
|
|
|
rt_pin_mode(RT_BSP_LED_PIN, PIN_MODE_OUTPUT);
|
2023-10-16 14:57:16 +08:00
|
|
|
|
|
|
|
#ifdef BSP_USING_BLE
|
|
|
|
extern void app_main(void);
|
|
|
|
esp_timer_init();
|
2023-10-20 12:22:28 +08:00
|
|
|
app_main(); //该函数为nimble样例程序入口
|
|
|
|
#endif /* BSP_USING_BLE */
|
2023-10-16 14:57:16 +08:00
|
|
|
|
|
|
|
#ifdef RT_USING_WIFI
|
|
|
|
/* set wifi work mode */
|
|
|
|
rt_wlan_set_mode(RT_WLAN_DEVICE_STA_NAME, RT_WLAN_STATION);
|
|
|
|
rt_wlan_set_mode(RT_WLAN_DEVICE_AP_NAME, RT_WLAN_AP);
|
|
|
|
#endif /* RT_USING_WIFI */
|
|
|
|
|
2022-04-29 09:01:44 +08:00
|
|
|
while (1)
|
|
|
|
{
|
2022-07-03 21:40:12 +08:00
|
|
|
rt_pin_write(RT_BSP_LED_PIN, PIN_HIGH);
|
2022-04-29 09:01:44 +08:00
|
|
|
rt_thread_mdelay(1000);
|
2022-07-03 21:40:12 +08:00
|
|
|
rt_pin_write(RT_BSP_LED_PIN, PIN_LOW);
|
2022-04-29 09:01:44 +08:00
|
|
|
rt_thread_mdelay(1000);
|
|
|
|
}
|
|
|
|
}
|