Jump to content
Sign in to follow this  
Guest Joe

Bug If Header Files, Or Compiler?

Recommended Posts

Guest Joe

OK,

 

 

Im using BoostC 1.8 with all patches installed over existing lines etc...

 

To recreate:

 

1. create a new project - empty with source and header.

2. set to use BoostC, 12F629

3. In the header file, add this:

#include <system.h>

 

4. in the Source file, add this:

void main()
{
char a, b;

a = _INTRC_OSC_NOCLK |  _CPD_OFF | _CP_OFF | _BODEN_ON | _MCLRE_OFF | _PWRTE_ON | _WDT_OFF;
b =                     _CPD_OFF | _CP_OFF | _BODEN_ON | _MCLRE_OFF | _PWRTE_ON | _WDT_OFF;
}

 

4. Compile

 

Compiler complains that _INTRC_OSC_NOCLK is undefined.

 

Look in the header file for the processor, it IS defined as shown below:

 

 

// Configuration Bits

#define	_CPD_ON	0x3EFF
#define	_CPD_OFF	0x3FFF
#define	_CP_ON	0x3F7F
#define	_CP_OFF	0x3FFF
#define	_BODEN_ON	0x3FFF
#define	_BODEN_OFF	0x3FBF
#define	_MCLRE_ON	0x3FFF
#define	_MCLRE_OFF	0x3FDF
#define	_PWRTE_OFF	0x3FFF
#define	_PWRTE_ON	0x3FEF
#define	_WDT_ON	0x3FFF
#define	_WDT_OFF	0x3FF7
#define	_LP_OSC	0x3FF8
#define	_XT_OSC	0x3FF9
#define	_HS_OSC	0x3FFA
#define	_EC_OSC	0x3FFB
#define	_INTRC_OSC_NOCLK	0x3FFC
#define	_INTRC_OSC_CLKOU	0x3FFD
#define	_EXTRC_OSC_NOCLK	0x3FFE
#define	_EXTRC_OSC_CLKOU	0x3FFF

 

So this is a bug, right? Please someone confirm this, its driving me crazzzzy!

 

:blink:

 

Joe

Share this post


Link to post
Share on other sites

I was able to reproduce the problem. For some reasons preprocessor doesn't replace _INTRC_OSC_NOCLK with the number. Can't say right away what's wrong as preprocessor that BoostC uses was written by a third party. Need to spend more time on this.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

OK got it. The latest header update uses new headers for BoostC that start with PIC<device> (like PIC12F629.h) as opposed to old headers that are still used by C2C that have name P<device>. In the new header there is no _INTRC_OSC_NOCLK but _INTRC_OSC_NOCLKOUT define.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
Guest Joe

In that case, clicking on browse in the file window, then double-clicking the constants shown opens the wrong header file -- so this is a bug also ?

 

Joe

Share this post


Link to post
Share on other sites
In that case, clicking on browse in the file window, then double-clicking the constants shown opens the wrong header file -- so this is a bug also ?

 

Yes this is a bug. Ctags that ide uses to create browse information has some limitations. I need to spend more time and check if it can be fixed (or find some other solution).

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...