Author Topic: help with sfr  (Read 9533 times)

Offline signalman

  • Single posting newcomer
  • *
  • Posts: 2
help with sfr
« on: May 07, 2012, 08:27:04 pm »
I am writing a signalling application which I intend to use with Texas Ins CC1110 TxRx. The CC1110 has an in-built 8051 chip. I have found the header file for a CC1110 but when I build it, I am getting error messages when it gets to the SFRBIT and SFR lines of the header. The relevant lines are:
 #define SFR(sfr name,addr) name  =  addr;
#define SFRBIT(sfr name, addr, bit7, bit6, bit5, bit4, bit3, bit2, bit1, bit0) name = addr;


(error reads : macro parameters must be comma separated)

and then later when it tries to read the sfr's

SFRBIT( P0      ,  0x80, P0_7, P0_6, P0_5, P0_4, P0_3, P0_2, P0_1, P0_0 )
SFR(  SP        ,  0x81  )   /*  Stack Pointer                                      */
SFR(  DPL0      ,  0x82  )   /*  Data Pointer 0 Low Byte                            */
SFR(  DPH0      ,  0x83  )   /*  Data Pointer 0 High Byte                           */


(error reads : sfr does not declare a type)

I have programmed in several languages, including machine code, but I am very much a newboy when it comes to C++.

Can anybody point me in the right direction, or can I get a syntax of the code::blocks version of C++ since each version appears to have slight differences.

Jim.






Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: help with sfr
« Reply #1 on: May 07, 2012, 08:32:06 pm »
Well why don't you start with reading the FAQ:
http://wiki.codeblocks.org/index.php?title=FAQ
Compiler errors are no Code::Blocks errors, so you better ask in the right forum:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline signalman

  • Single posting newcomer
  • *
  • Posts: 2
Re: help with sfr
« Reply #2 on: May 08, 2012, 05:00:55 am »
Thanks - I am looking

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: help with sfr
« Reply #3 on: May 08, 2012, 08:46:16 pm »
A C++ compiler for 8051 architecture. :o I didn't really know it existed apart from the fact that your problem doesn't anyway related to CB.