Call signature does not match the function definition

General discussion on mikroC PRO for AVR.
Post Reply
Author
Message
granel
Posts: 142
Joined: 13 Feb 2007 11:01

Call signature does not match the function definition

#1 Post by granel » 30 Nov 2010 22:34

Hello!
I add in old working project library code -- SOUND -- and received error :
Call signature does not match the function definition signature 'Delay_Cyc'
itself can not solve the problem. Added simple code:
Sound_Init(&PORTC,0);
Sound_Play(1000,100);
Help me please!

User avatar
ranko.rankovic
Posts: 433
Joined: 11 Jun 2010 09:22

Re: Call signature does not match the function definition

#2 Post by ranko.rankovic » 01 Dec 2010 10:50

Hello granel,

Please, zip your whole project folder and attach it here so we can examine it. Also, try our example that is located in Help file, it is tested and working on ATMega16 @ 10MHz.

Here is example from help file:

Code: Select all

void Tone1() {
  Sound_Play(659, 250);   // Frequency = 659Hz, duration = 250ms
}

void Tone2() {
  Sound_Play(698, 250);   // Frequency = 698Hz, duration = 250ms
}

void Tone3() {
  Sound_Play(784, 250);   // Frequency = 784Hz, duration = 250ms
}

void Melody() {                              // Plays the melody "Yellow house"
  Tone1(); Tone2(); Tone3(); Tone3();
  Tone1(); Tone2(); Tone3(); Tone3();
  Tone1(); Tone2(); Tone3();
  Tone1(); Tone2(); Tone3(); Tone3();
  Tone1(); Tone2(); Tone3();
  Tone3(); Tone3(); Tone2(); Tone2(); Tone1();
}

void ToneA() {
  Sound_Play( 880, 50);
}
void ToneC() {
  Sound_Play(1046, 50);
}
void ToneE() {
  Sound_Play(1318, 50);
}

void Melody2() {                // Plays Melody2
 unsigned short i;
  for (i = 9; i > 0; i--) {
    ToneA();
    ToneC();
    ToneE();
  }
}

void main() {

  DDRB = 0x00;                   // Configure PORTB as input
  Sound_Init(&PORTC,3);                  // Initialize sound pin

  Sound_Play(880, 1000);         // Play sound at 880Hz for 1 second

  while (1) {                    // endless loop

    if (PINB7_bit)               // If PORTB.7 is pressed play Tone1
      Tone1();                   //
    while (PINB7_bit) ;          // Wait for button to be released

    if (PINB6_bit)               // If PORTB.6 is pressed play Tone2
      Tone2();                   //
    while (PINB6_bit) ;          // Wait for button to be released

    if (PINB5_bit)               // If PORTB.5 is pressed play Tone3
      Tone3();                   //
    while (PINB5_bit) ;          // Wait for button to be released

    if (PINB4_bit)               // If PORTB.4 is pressed play Melody2
      Melody2();                 //
    while (PINB4_bit) ;          // Wait for button to be released

    if (PINB3_bit)               // If PORTB.3 is pressed play Melody
      Melody();                  //
    while (PINB3_bit) ;          // Wait for button to be released
  }
}
Best regards
Ranko Rankovic
mikroElektronika [Support Department]

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#3 Post by granel » 01 Dec 2010 16:28

my project with SOUNN LIB. code
Attachments
GE-300-1.zip
(1.63 KiB) Downloaded 126 times

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#4 Post by granel » 01 Dec 2010 16:32

i received same error if compile your test sound code (((???
microc pro for avr 3,50

User avatar
ranko.rankovic
Posts: 433
Joined: 11 Jun 2010 09:22

Re: Call signature does not match the function definition

#5 Post by ranko.rankovic » 02 Dec 2010 12:37

Hello granel,

I've tested your source code and it's working, but unfortunately I couldn't see your settings. Please attach your whole project, with settings etc. Best is to zip whole folder in which your source code is located.

Best regards
Ranko Rankovic
mikroElektronika [Support Department]

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#6 Post by granel » 02 Dec 2010 16:36

my project
Attachments
GE-300-test.ZIP
(49.86 KiB) Downloaded 122 times

User avatar
ranko.rankovic
Posts: 433
Joined: 11 Jun 2010 09:22

Re: Call signature does not match the function definition

#7 Post by ranko.rankovic » 03 Dec 2010 11:54

Hello granel,

It seems that you didn't enable SSA Optimization.

All function prototypes and function pointers have to be built using the same optimizer because of different calling conventions in different optimizers. In SSA, function parameters are passed via working registers, and without SSA they end up on the function frame.

So to enable SSA optimization, go to Tools -> Options (or F12) then Output -> Output Settings, check Enable SSA optimization. After this is done, go to Build -> Rebuild All Sources (or Ctrl + F9).

Best regards
Ranko Rankovic
mikroElektronika [Support Department]

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#8 Post by granel » 03 Dec 2010 14:31

but SSA optimisation switch on.

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#9 Post by granel » 03 Dec 2010 14:37

it seems the problem is not optimizing.
making the project settings in the compiler ran into another problem - the program the programmer receives other options and it is also hampered work in peace, all the time to change and monitor the project settings (AVR FLASH 2.13)
Attachments
__ssp_enable.jpg
__ssp_enable.jpg (129.83 KiB) Viewed 4876 times
__ssp_enable.jpg
__ssp_enable.jpg (129.83 KiB) Viewed 4876 times

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#10 Post by granel » 03 Dec 2010 15:38

i reinstal soft and all ok )))???

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#11 Post by granel » 03 Dec 2010 18:45

after reinstalling the program's all worked.
but then changed the project to install an internal oscillator frequency from 4 to 8 MHz - there was an old bug. changed the frequency to 4 MHz --- error remained.
again to reinstall the program and not to touch anything in the settings? ((((((((((((((((
Attachments
old_error.jpg
old_error.jpg (186.93 KiB) Viewed 4871 times

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#12 Post by granel » 03 Dec 2010 18:55

I did a fresh install of the program without removing the previous installation - again, everything is OK, but now I'm afraid to change the setup of the project - error will appear again and bring a lot of problems over time or loss of the project??

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#13 Post by granel » 03 Dec 2010 19:44

Now the algorithm works like this: reinstalled software worked fine --- --- change the settings (the algorithm of the error is not clear) --- get this error --- reinstalled software - everything is working again ---- in this mode is now reinstalled the software 5 time --- I do not know for how long my nerves enough )))))

mazx
Posts: 7
Joined: 03 Dec 2010 12:39

Re: Call signature does not match the function definition

#14 Post by mazx » 10 Dec 2010 21:56

You might want try to increase optimization level to "One".

I had similar issues with __Lib_SoftUART.c:

Code: Select all

Call signature does not match the function definition signature 'Delay_Cyc' __Lib_SoftUART.c
It seems that optimization level of zero eliminates SSA optimization too.

here is my post... http://www.mikroe.com/forum/viewtopic.php?f=72&t=28182

granel
Posts: 142
Joined: 13 Feb 2007 11:01

Re: Call signature does not match the function definition

#15 Post by granel » 19 Dec 2010 21:14

today made a few changes in the project settings, get the old error, the compilation is not.
reinstall the program already installed on top, as before, does not help.
tried other projects - all in order.
why the compiler does not like my software, although an hour ago everything was ok??

Post Reply

Return to “mikroC PRO for AVR General”