2023-06-30 00:05:55 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2023/06/25 flyingcys first version
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include <stdio.h>
|
2024-08-24 06:15:09 +08:00
|
|
|
#include <drivers/dev_pin.h>
|
2024-05-14 06:20:57 +08:00
|
|
|
|
|
|
|
#if defined(BOARD_TYPE_MILKV_DUO256M) || defined(BOARD_TYPE_MILKV_DUO256M_SPINOR)
|
|
|
|
#define LED_PIN "E02" /* Onboard LED pins */
|
|
|
|
#elif defined(BOARD_TYPE_MILKV_DUO) || defined(BOARD_TYPE_MILKV_DUO_SPINOR)
|
|
|
|
#define LED_PIN "C24" /* Onboard LED pins */
|
2024-08-27 10:17:21 +08:00
|
|
|
#elif defined(BOARD_TYPE_MILKV_DUOS)
|
|
|
|
#define LED_PIN "A29" /* Onboard LED pins */
|
2024-05-14 06:20:57 +08:00
|
|
|
#endif
|
2023-06-30 00:05:55 +08:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2024-04-08 00:35:53 +08:00
|
|
|
#ifdef RT_USING_SMART
|
2023-06-30 00:05:55 +08:00
|
|
|
rt_kprintf("Hello RT-Smart!\n");
|
2024-04-08 00:35:53 +08:00
|
|
|
#else
|
|
|
|
rt_kprintf("Hello RISC-V!\n");
|
|
|
|
#endif
|
2024-05-14 06:20:57 +08:00
|
|
|
|
|
|
|
/* LED pin: C24 */
|
|
|
|
rt_uint16_t led = rt_pin_get(LED_PIN);
|
|
|
|
|
|
|
|
/* set LED pin mode to output */
|
|
|
|
rt_pin_mode(led, PIN_MODE_OUTPUT);
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
rt_pin_write(led, PIN_HIGH);
|
|
|
|
|
|
|
|
rt_thread_mdelay(500);
|
|
|
|
|
|
|
|
rt_pin_write(led, PIN_LOW);
|
|
|
|
|
|
|
|
rt_thread_mdelay(500);
|
|
|
|
}
|
|
|
|
|
2023-06-30 00:05:55 +08:00
|
|
|
return 0;
|
|
|
|
}
|