Build errors on Blinky example

Hello all

I suspect this is  a simple coding error that was I not a complete beginner I'd know how to fix.

I'm using the YouTube series to work through here : nRF5 SDK - Tutorial for Beginners Pt 6 - Reading Digital Input from Buttons - YouTube

The same hardware and software as in the video.

On build, I get the following in Segger. 

Could anyone at least point me in the right direction please?

Thanks in advance.

Andrew

NOTE : I am looking to start on the Nordic Dev Academy and have just ordered a Thingy:53.

Building ‘blinky_pca10040’ from solution ‘blinky_pca10040’ in configuration ‘Debug’
Compiling ‘nrf_fprintf_format.c’
Compiling ‘nrf_memobj.c’
Compiling ‘nrf_ringbuf.c’
Compiling ‘nrf_strerror.c’
Compiling ‘nrfx_atomic.c’
Compiling ‘main.c’
Compiling ‘system_nrf52.c’
Compiling ‘Basic Intput Functions.c’
data definition has no type or storage class
type defaults to 'int' in declaration of 'nrf_gpio_cfg_input' [-Wimplicit-int]
conflicting types for 'nrf_gpio_cfg_input'; have 'int(uint32_t, nrf_gpio_pin_pull_t)' {aka 'int(unsigned int, nrf_gpio_pin_pull_t)'}
Basic Intput Functions.c
previous definition of 'nrf_gpio_cfg_input' with type 'void(uint32_t, nrf_gpio_pin_pull_t)' {aka 'void(unsigned int, nrf_gpio_pin_pull_t)'}
return type defaults to 'int' [-Wimplicit-int]
conflicting types for 'nrf_gpio_range_cfg_input'; have 'int(uint32_t, uint32_t, nrf_gpio_pin_pull_t)' {aka 'int(unsigned int, unsigned int, nrf_gpio_pin_pull_t)'}
Basic Intput Functions.c
previous definition of 'nrf_gpio_range_cfg_input' with type 'void(uint32_t, uint32_t, nrf_gpio_pin_pull_t)' {aka 'void(unsigned int, unsigned int, nrf_gpio_pin_pull_t)'}
expected declaration specifiers before 'nrf_gpio_pin_read'
expected declaration specifiers before 'nrf_gpio_port_in_read'
expected '{' at end of input
Build failed

Parents
  • Here's my "Basic Input Functions.c"

    // Include this in your project
    #include "nrf_gpio.h"


    // Function to Configure the Pin as INPUT pin

    /*
    1st Parameter:

    pin_number can be equal to:
    0 to 31 // (number)


    2nd Parameter:

    pull_config can be equal to any of these values:

    NRF_GPIO_PIN_PULLUP
    NRF_GPIO_PIN_PULLDOWN
    NRF_GPIO_PIN_NOPULL

    for e.g:
    nrf_gpio_cfg_input(13,NRF_GPIO_PIN_NOPULL); // Configure Pin 13 as input with no internal pull_up resistor


    */
    nrf_gpio_cfg_input( uint32_t pin_number,nrf_gpio_pin_pull_t pull_config);

    /*
    for e.g:

    nrf_gpio_range_cfg_input (13,16,NRF_GPIO_PIN_PULLUP);

    */

    // Function to configure multiple consective pins as input pins:
    nrf_gpio_range_cfg_input ( uint32_t pin_range_start,uint32_t pin_range_end,nrf_gpio_pin_pull_t pull_config )


    /*

    */

    // Function to Read Input Pin value:
    nrf_gpio_pin_read(uint32_t pin_number);

    // Function to read all 32 pins status i.e read all pins at once from pin 0 to pin31 all together. Not usually needed
    nrf_gpio_port_in_read();

Reply
  • Here's my "Basic Input Functions.c"

    // Include this in your project
    #include "nrf_gpio.h"


    // Function to Configure the Pin as INPUT pin

    /*
    1st Parameter:

    pin_number can be equal to:
    0 to 31 // (number)


    2nd Parameter:

    pull_config can be equal to any of these values:

    NRF_GPIO_PIN_PULLUP
    NRF_GPIO_PIN_PULLDOWN
    NRF_GPIO_PIN_NOPULL

    for e.g:
    nrf_gpio_cfg_input(13,NRF_GPIO_PIN_NOPULL); // Configure Pin 13 as input with no internal pull_up resistor


    */
    nrf_gpio_cfg_input( uint32_t pin_number,nrf_gpio_pin_pull_t pull_config);

    /*
    for e.g:

    nrf_gpio_range_cfg_input (13,16,NRF_GPIO_PIN_PULLUP);

    */

    // Function to configure multiple consective pins as input pins:
    nrf_gpio_range_cfg_input ( uint32_t pin_range_start,uint32_t pin_range_end,nrf_gpio_pin_pull_t pull_config )


    /*

    */

    // Function to Read Input Pin value:
    nrf_gpio_pin_read(uint32_t pin_number);

    // Function to read all 32 pins status i.e read all pins at once from pin 0 to pin31 all together. Not usually needed
    nrf_gpio_port_in_read();

Children
Related