This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BUTTON_PULL in app_uart.c

Since I'm writing code for my own board, I decided to create my own board.h file to hold the board-specific definitions.

However, I can't do this without hacking the SDK, as app_uart.c includes boards.h, which is part of the sdk, and it won't pickup my board.h without hackery.

Call me a purist, but the SDK shouldn't depend on files that change with board-level configuration. I assume this is a bug, but please correct me if there's another appropriate way to have my own board.h file without modifying the SDK or masquerading as a PCA10001.

-Jim

Parents
  • FYI, I think the error is that app_uart.c only needs boards.h for BUTTON_PULL, which is an alias for NRF_GPIO_PIN_PULLUP, which is already has available and is not board-specific.

    The corrected code would look like this, along with the removal of #include "boards.h":

            
    // Setup the gpiote to handle pin events on cts-pin.
    // For the UART we want to detect both low->high and high->low transitions in order to
    // know when to activate/de-activate the TX/RX in the UART.
    // Configure pin.
    m_pin_cts_mask = (1 << p_comm_params->cts_pin_no);
    nrf_gpio_cfg_sense_input(p_comm_params->cts_pin_no, 
        NRF_GPIO_PIN_PULLUP,              // was BUTTON_PULL
        NRF_GPIO_PIN_SENSE_LOW);
    
    
Reply
  • FYI, I think the error is that app_uart.c only needs boards.h for BUTTON_PULL, which is an alias for NRF_GPIO_PIN_PULLUP, which is already has available and is not board-specific.

    The corrected code would look like this, along with the removal of #include "boards.h":

            
    // Setup the gpiote to handle pin events on cts-pin.
    // For the UART we want to detect both low->high and high->low transitions in order to
    // know when to activate/de-activate the TX/RX in the UART.
    // Configure pin.
    m_pin_cts_mask = (1 << p_comm_params->cts_pin_no);
    nrf_gpio_cfg_sense_input(p_comm_params->cts_pin_no, 
        NRF_GPIO_PIN_PULLUP,              // was BUTTON_PULL
        NRF_GPIO_PIN_SENSE_LOW);
    
    
Children
No Data
Related