CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Translating from mcc18

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BlueTower



Joined: 23 Oct 2008
Posts: 29

View user's profile Send private message

Translating from mcc18
PostPosted: Mon Nov 24, 2008 7:53 am     Reply with quote

Hi I have following code in mcc18:
Quote:

26. extern unsigned char convString [20]; // 20 bytes - string holder
27. extern unsigned char convChar; // 1 byte
28. extern unsigned int convInt; // 2 bytes - unsigned integer
35. extern unsigned long short convInt24; // 3 bytes - unsigned integer

Compiling with CCS I got following errors
Quote:

***Error 46
Line 26(32,33): Expecting an =
Line 27(30,31): Expecting an =
Line 28(30,31): Expecting an =
***Error 38
Line 35(22,27): This type can not be qualified with this qualifier
*** Error 48
Line 35(28,37): Expecting a (

Any ideas?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 24, 2008 12:27 pm     Reply with quote

Basic answer:
http://www.ccsinfo.com/forum/viewtopic.php?t=18649&highlight=extern

http://www.ccsinfo.com/forum/viewtopic.php?t=25605&start=10&highlight=extern
BlueTower



Joined: 23 Oct 2008
Posts: 29

View user's profile Send private message

PostPosted: Tue Nov 25, 2008 5:48 am     Reply with quote

My mistake. Following Errors are to be discussed.

In source code:
Quote:

#FUSES ...
#use delay(clock=8000000)

#pragma udata //Error 7-Invalid Pre-Processor directive

rom const char version[] = "0_00"; //Error 27-Expression must evaluate to a constant
rom const char maj_ver = 0x00;
rom const char min_ver = 0x00;

#pragma code high_vector = 0x08 //Error 7-Invalid Pre-Processor directive
void interrupt_at_high_vector(void)
{
#asm
goto high_isr //jump to interrupt routine
#endasm
}

// High priority interrupt routine

#pragma code //Error 7-Invalid Pre-Processor

#pragma interrupt high_isr //Error 7-Invalid Pre-Processor

void high_isr (void)
{
code
}

#pragma code low_vector = 0x18 //Error 7-Invalid Pre-Processor
void interrupt_at_low_vector (void)
{
_asm
goto low_isr
_endasm
}

#pragma code //Error 7-Invalid Pre-Processor
#pragma interruptlow low_isr //Error 7-Invalid Pre-Processor
void low_isr (void)
{
code...
}


In header file:
Quote:

extern rom const char version[]; // Error46 - Expecting an =
extern rom const char maj_ver; // Error46 - Expecting an =
extern rom const char min_ver; // Error46 - Expecting an =

extern unsigned long short convInt24; //Error 38-This type can not be qualified with this qualifier


Regards
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group