Go to Post I guess my point is, let's see how it plays out before we condemn it to failure. - Chris Hibner [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2007, 15:39
LieAfterLie's Avatar
LieAfterLie LieAfterLie is offline
Registered User
FRC #2028
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hampton, VA
Posts: 35
LieAfterLie is an unknown quantity at this point
Generate_Pwms argument error in MPLAB

I get the following error when I try to compile even the raw default code:

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\mcc18\bin\mcc18.exe" -p=18F8722 "ifi_startup.c" -fo="ifi_startup.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\Program Files\Microchip\mcc18\bin\mcc18.exe" -p=18F8722 "ifi_utilities.c" -fo="ifi_utilities.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\Program Files\Microchip\mcc18\bin\mcc18.exe" -p=18F8722 "main.c" -fo="main.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\Program Files\Microchip\mcc18\bin\mcc18.exe" -p=18F8722 "user_routines.c" -fo="user_routines.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
G:\FRC\mplab project\user_routines.c:168:Warning [2066] type qualifier mismatch in assignment
G:\FRC\mplab project\user_routines.c:192:Warning [2066] type qualifier mismatch in assignment
G:\FRC\mplab project\user_routines.c:194:Error [1203] too few arguments in function call
G:\FRC\mplab project\user_routines.c:219:Warning [2066] type qualifier mismatch in assignment
G:\FRC\mplab project\user_routines.c:236:Warning [2066] type qualifier mismatch in assignment
Halting build on first failure as requested.
BUILD FAILED: Thu Feb 01 15:30:09 2007

It occurs here in User Routines.c, the first call to Generate_Pwms():
Code:
void Process_Data_From_Master_uP(void)
{
  static unsigned char i;

  Getdata(&rxdata);   /* Get fresh data from the master microprocessor. */

  //Default_Routine();  /* Optional.  See below. */
  My_Routine();

  /* Add your own code here. (a printf will not be displayed when connected to the breaker panel unless a Y cable is used) */

  printf("Port1 Y %3d, X %3d, Fire %d, Top %d\r",pwm01,pwm05,p1_sw_trig,p1_sw_top);  /* printf EXAMPLE */

  Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

  /* Example code to check if a breaker was ever tripped. */

  if (aBreakerWasTripped)
  {
    for (i=1;i<29;i++)
    {
      if (Breaker_Tripped(i))
        User_Byte1 = i;  /* Update the last breaker tripped on User_Byte1 (to demonstrate the use of a user byte) 
                            Normally, you do something else if a breaker got tripped (ex: limit a PWM output)     */
    }
  }

  Putdata(&txdata);             /* DO NOT CHANGE! */
}
The declaration is here, in ifi_utilities.h:
Code:
void Hex_output(unsigned char temp);  /* located in ifi_library.lib */

#ifdef _FRC_BOARD
  /* located in ifi_library.lib */
void Generate_Pwms(unsigned char pwm_13,unsigned char pwm_14,
                   unsigned char pwm_15,unsigned char pwm_16);
#else
  /* located in ifi_library.lib */
void Generate_Pwms(unsigned char pwm_1,unsigned char pwm_2,
                   unsigned char pwm_3,unsigned char pwm_4,
                   unsigned char pwm_5,unsigned char pwm_6,
                   unsigned char pwm_7,unsigned char pwm_8);
#endif
I'm assuming that _FRC_BOARD wasn't defined, and the 8-argument version of Generate_Pwms() was declared instead of the 4-argument version. The first call the Generate_Pwms() is above, and it's clearly meant for the first declaration. The only other call is in user_routines_fast.c and it's the same line. I haven't found any ifi_library.lib anywhere.

I remember this same error from before and I got it compiled, but now I can't remember what I did or what was wrong. :'(
__________________
SEMPER UBI SUB UBI

Last edited by LieAfterLie : 01-02-2007 at 17:11.
  #2   Spotlight this post!  
Unread 01-02-2007, 16:57
LieAfterLie's Avatar
LieAfterLie LieAfterLie is offline
Registered User
FRC #2028
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hampton, VA
Posts: 35
LieAfterLie is an unknown quantity at this point
Re: Generate_Pwms argument error in MPLAB

Also, what is done to pwms 13-16 that isn't done to the others? Other than the cpp functionality. And another error, although it might go away when the first one does, but it says

Error - processor types do not agree across all input files.

while/after it hits the linker stage.
This is what happens when I commented out the Generate_Pwms in user_routines.c and user_routines_fast.c.
__________________
SEMPER UBI SUB UBI

Last edited by LieAfterLie : 01-02-2007 at 17:37.
  #3   Spotlight this post!  
Unread 01-02-2007, 19:28
ace123's Avatar
ace123 ace123 is offline
Registered User
AKA: Patrick Horn
FRC #0008 (Paly Robotics - http://robotics.paly.net/)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Palo Alto, CA
Posts: 50
ace123 has a spectacular aura aboutace123 has a spectacular aura about
Send a message via AIM to ace123
Re: Generate_Pwms argument error in MPLAB

Just a thought: have you tried rebuilding all? (the button next to "Make").

You probably have some old object (.o) files lying around. I think there's a batch file that will clean it up too.
__________________
-Patrick Horn, Paly Robotics

Check out the space simulator called Vega Strike, modelled after the space simulator games Elite and Wing Commander. It's Open Source too!
If you have ever played Wing Commander, or especially Privateer, and had a feeling of nostalga derived from the you will enjoy these two Vega Strike mods: Privateer Gemini Gold and Privateer Remake!
I'm working on adding multiplayer support this year...
  #4   Spotlight this post!  
Unread 01-02-2007, 20:10
LieAfterLie's Avatar
LieAfterLie LieAfterLie is offline
Registered User
FRC #2028
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hampton, VA
Posts: 35
LieAfterLie is an unknown quantity at this point
Re: Generate_Pwms argument error in MPLAB

I've rebuilt it many times, used the batch file, and completely replaced the code and rebuilt with no object files.
__________________
SEMPER UBI SUB UBI
  #5   Spotlight this post!  
Unread 02-02-2007, 20:37
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: Generate_Pwms argument error in MPLAB

Make sure that the compiler is passed the -D_FRC_BOARD and -D_LARGE_CODE options, to define the corresponding macros. I'm not sure how to do that in MPLAB, it should be in some configuration menu.

The error you are getting has nothing to do with IFI_Library.lib, which is only added statically at link time (not compile time).
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
  #6   Spotlight this post!  
Unread 02-02-2007, 23:17
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Generate_Pwms argument error in MPLAB

The "raw, default code" will compile and link with no problems.

I would suggest that you uninstall and then re-install MPLAB and the C18 compiler.
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #7   Spotlight this post!  
Unread 06-12-2007, 17:01
LieAfterLie's Avatar
LieAfterLie LieAfterLie is offline
Registered User
FRC #2028
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hampton, VA
Posts: 35
LieAfterLie is an unknown quantity at this point
Re: Generate_Pwms argument error in MPLAB

haha this is a little late, but yeah, I just had to add those macro definitions. In MPLAB, go to Project>Build options>Project and add _FRC_BOARD and _LARGE_CODE under the c18 tab.
__________________
SEMPER UBI SUB UBI
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd MPLab error? Andrew Blair Programming 2 21-01-2006 20:45
MPLab build error Derek t Programming 7 17-01-2005 09:33
MPLAB build error cabbagekid2 Programming 7 12-01-2005 13:36
MPlab error ryan_f Programming 9 24-05-2004 07:30
Mplab startup error Team 869 Programming 6 25-01-2004 10:41


All times are GMT -5. The time now is 03:55.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi