From b3f83445ff462fa59321ef67a2830cbb893115a2 Mon Sep 17 00:00:00 2001 From: acevest Date: Fri, 17 Apr 2020 00:12:47 +0800 Subject: [PATCH] send string data --- board/Sipeed_LonganNano/eclipse/nRF24L01/main.c | 4 ++-- board/Sipeed_LonganNano/eclipse/nRF24L01/nrf24.c | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/board/Sipeed_LonganNano/eclipse/nRF24L01/main.c b/board/Sipeed_LonganNano/eclipse/nRF24L01/main.c index 8d36a833..a0e2c794 100644 --- a/board/Sipeed_LonganNano/eclipse/nRF24L01/main.c +++ b/board/Sipeed_LonganNano/eclipse/nRF24L01/main.c @@ -81,8 +81,8 @@ void main(void) { tos_sem_create(&sem_led, 1); - tos_task_create(&led_handle, "led", task_led, NULL, 3, led_stk, LED_TASK_SIZE, 0); - tos_task_create(&lcd_handle, "lcd", task_lcd, NULL, 3, lcd_stk, LCD_TASK_SIZE, 0); + tos_task_create(&led_handle, "led", task_led, NULL, 6, led_stk, LED_TASK_SIZE, 0); + tos_task_create(&lcd_handle, "lcd", task_lcd, NULL, 6, lcd_stk, LCD_TASK_SIZE, 0); tos_knl_start(); diff --git a/board/Sipeed_LonganNano/eclipse/nRF24L01/nrf24.c b/board/Sipeed_LonganNano/eclipse/nRF24L01/nrf24.c index 60933e79..89f3922d 100644 --- a/board/Sipeed_LonganNano/eclipse/nRF24L01/nrf24.c +++ b/board/Sipeed_LonganNano/eclipse/nRF24L01/nrf24.c @@ -244,15 +244,16 @@ void test_nrf24l01_tx() { while(1) { nrf_flush_rx(); nrf_flush_tx(); - uint8_t buf[] = {0x0A, 0x0C, 0x0E, cnt++ }; - nrf_write_payload(buf, sizeof(buf)); + uint8_t buf[32]; + snprintf(buf, sizeof(buf), "Ace nRF24L01+ %u", cnt++); + nrf_write_payload(buf, strlen(buf)+1); tos_sem_post(&sem_led); nrf_delay(100); } } void task_nrf24() { - test_nrf24l01_irq_rx(); + //test_nrf24l01_irq_rx(); //test_nrf24l01_rx(); - //test_nrf24l01_tx(); + test_nrf24l01_tx(); }