UART LF CR

Hello,

I am using the peripheral uart sample and it works fine. My issue is that whenever the buffer is full it automatically sends the data from the com. How do I stop that from happening (meaning data from the com is sent IF AND ONLY IF I press the send key and not if the buffer is full)?

Parents
  • Hi,

    Are you referring to this example?

    The UART peripheral example in the nRF5SDK will not wait for the FIFO to be full, but will rather send a character as long as there is any data in the FIFO buffer by using app_uart_get and app_uart_put.

    If you want to only send data when you press a button, then you have to combine something like the bsp example with the uart example. You can then call app_uart_get and app_uart_put in the bsp_evt_handler(), or even better set a flag in the bsp event handler that indicates that a button has been pressed and then call app_uart_get and app_uart_put in the main loop.

    best regards

    Jared

Reply
  • Hi,

    Are you referring to this example?

    The UART peripheral example in the nRF5SDK will not wait for the FIFO to be full, but will rather send a character as long as there is any data in the FIFO buffer by using app_uart_get and app_uart_put.

    If you want to only send data when you press a button, then you have to combine something like the bsp example with the uart example. You can then call app_uart_get and app_uart_put in the bsp_evt_handler(), or even better set a flag in the bsp event handler that indicates that a button has been pressed and then call app_uart_get and app_uart_put in the main loop.

    best regards

    Jared

Children
Related