[riot-notifications] [RIOT-OS/RIOT] uart_init seems not return (#11613)

jhx2002 notifications at github.com
Sun Jun 2 08:03:42 CEST 2019


- code : 

```

#include <stdio.h>
#include "periph/uart.h"


void uart_rx_cb(void *arg, uint8_t data) {
    int i = 0;
    if (arg == NULL) {
	i += 0;
    }
    //printf("uart data: %d", data);                                                                                                                                                                               
    data += 1;

    return; //TODO                                                                                                                                                                                                 
}


int main(void)
{
    puts("Hello World!");

    printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
    printf("This board features a(n) %s MCU.\n", RIOT_MCU);

    uart_t uart_id = 1;
    uint32_t baudrate = 115200;
    uint32_t key = 111;
    int ret = uart_init(uart_id, baudrate, uart_rx_cb, (void *)&key);
    if (ret != UART_OK) {
        printf("Init uart  %d , return error code %d", uart_id, ret);
    }
    else {
        printf("Init uart  %d", uart_id);
    }

    return 0;
}

```

- uart_init seems not return.  running log is : 

```
/home/huaxing/oproj/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyUSB0" -b "115200"
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2019-06-02 14:00:40,019 - INFO # Connect to serial port /dev/ttyUSB0
Welcome to pyterm!
Type '/exit' to exit.
2019-06-02 14:00:42,755 - INFO # main(): This is RIOT! (Version: 2019.04)
2019-06-02 14:00:42,756 - INFO # Hello World!
2019-06-02 14:00:42,760 - INFO # You are running RIOT on a(n) stm32f407vet6 board.
2019-06-02 14:00:42,764 - INFO # This board features a(n) stm32f407 MCU.

```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11613
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190602/0bd36f61/attachment.html>


More information about the notifications mailing list