Getting undeclared(first use in this function error)

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

 I created a project through gcc c asf board project and added the necessary files. When i build it, I got the undeclared error(first use in this function error). Even though when I right click the particular function and able to navigate to it.

 

Inside initialize function, I call the  function configure_buttons which is in Button.c, there are several #defines which are already there in #include "sam4e8c.h". I am getting the error for those #defines.

For example --#define    PIN_PUSHBUTTON_1_ID    (ID_PIOA)

#include <asf.h>
#include "sam4e8c.h"
#include "Button.h"
#include "spiinit.h"

 

int main (void)
{
    /* Insert system clock initialization code here (sysclk_init()). */
    
    board_init();
    sysclk_init();
    initialize();
    //configure_buttons();
    /* Insert application code here, after the board has been initialized. */
    return 0;
}

Aditya

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am getting this type of error also, in an ASF Board project for the S70:

 implicit declaration of function 'pmc_sleep' [-Werror=implicit-function-declaration]    ssi-cpu    C:\dev10\basestation\ssinterface\ssi-cpu\ssi-cpu\src\ASF\common\services\sleepmgr\sam\sleepmgr.h

 

The ASF modules are Generic Board Support, USART (service), SPI (service), USB Device (service), and FreeRTOS 7.3.0 (service).  I'm playing around with adding modules one at a time, but the code looks okay.  For an unmodified ASF Board project not to compile, I'm wondering if I'm missing some part of the big picture with Atmel ARM development?

 

Atmel Studio 7 (Version: 7.0.634)
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
ASF: 3.28.1