[Icc-mot] GNU to ICC
Edward Karpicz
ekarpicz at freemail.lt
Sat Aug 25 10:05:13 PDT 2007
Oskar Atkinson wrote:
Hi,
I am absulutly new to programming on Frescale uC's ( HC9S12C64 ), professionally I am developing for the win32 platform.
I am attemting to port code which is written for GNU to ICC. Of course I am getting all kinds of compiler errors
Porting is easy when you know what you are doing. I'm not familiar with GCC, I may only guess what all those attributes are about.
How would this be correct in ICC ?
#define LOOKUP_ATTR __attribute__ ((section (".lookup")))
#define VECT_ATTR __attribute__ ((section (".vectors")))
extern const int cltfactor_table[1024] LOOKUP_ATTR;
^^ this looks like putting some table of constants into nondefault memory area. Well, with extern declaration (in the header probably) you shouldn't do anything, just remove LOOKUP_ATTR.
extern const int cltfactor_table[1024];
Definition is bit different. First of all create you custom memory section by putting -b linker option into Project->Options->Other Options edit box. For example
-blookup:0x1000.0x4FFF
^^ this defines area lookup from 0x1000 to 0x4FFF
Then in C source you write
#pragma text:lookup
const int cltfactor_table[1024]={1,2,3,4,5,6};
// add here more initialized const variables
#pragma text:text
INTERRUPT void UnimplementedISR(void) POST_INTERRUPT;
INTERRUPT void ISR_Ign_TimerIn(void) POST_INTERRUPT_TEXT3;
ISR's must be easier than in GCC. 1) Remove INTERRUPT and POST_xxx, 2) add #pragma interrupt_handler <function name> to the file where ISR's are defined:
#pragma interrupt_handler UnimplementedISR
void UnimplementedISR(void)
{
...
}
#pragma interrupt_handler ISR_Ign_TimerIn
void ISR_Ign_TimerIn(void)
{
}
Regards
Edward
TIA
Oskar
------------------------------------------------------------------------------
_______________________________________________
Icc-mot mailing list
Icc-mot at imagecraft.com
http://dragonsgate.net/mailman/listinfo/icc-mot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dragonsgate.net/pipermail/icc-mot/attachments/20070825/c10f5d35/attachment.html
More information about the Icc-mot
mailing list