add e22 test demo on edu-riscv64

This commit is contained in:
wgzAIIT 2022-12-28 14:44:16 +08:00
parent d57552e223
commit 32bf012d9a
2 changed files with 7 additions and 3 deletions

View File

@ -47,7 +47,7 @@ CSRCS += k210_w5500.c
endif endif
ifeq ($(CONFIG_K210_UART2),y) ifeq ($(CONFIG_K210_UART2),y)
CSRCS += test_loraE220.c CSRCS += test_lora.c
endif endif
include $(TOPDIR)/boards/Board.mk include $(TOPDIR)/boards/Board.mk

View File

@ -11,8 +11,8 @@
*/ */
/** /**
* @file test_loraE220.c * @file test_lora.c
* @brief edu-riscv64 test_loraE220.c * @brief edu-riscv64 test_lora.c
* @version 1.0 * @version 1.0
* @author AIIT XUOS Lab * @author AIIT XUOS Lab
* @date 2022.12.13 * @date 2022.12.13
@ -52,7 +52,11 @@ void TestLora(void)
m0fd = open("/dev/gpio0", O_RDWR); m0fd = open("/dev/gpio0", O_RDWR);
m1fd = open("/dev/gpio1", O_RDWR); m1fd = open("/dev/gpio1", O_RDWR);
#ifdef CONFIG_ADAPTER_E22
ioctl(m0fd, GPIOC_WRITE, (unsigned long)0);
#else
ioctl(m0fd, GPIOC_WRITE, (unsigned long)1); ioctl(m0fd, GPIOC_WRITE, (unsigned long)1);
#endif
ioctl(m1fd, GPIOC_WRITE, (unsigned long)1); ioctl(m1fd, GPIOC_WRITE, (unsigned long)1);
sleep(1); sleep(1);