Steven 0 Posted January 18, 2009 Report Share Posted January 18, 2009 Header file #define nrf24l01_CE_IOREGISTER PORTB #define nrf24l01_CE_PINMASK 0x01 C file nrf24l01_CE_IOREGISTER &= ~nrf24l01_CE_PINMASK; I’m receiving the following compiler error: c(510): error: left operand must be l-value c(510:9): error: failed to generate expression I understand that this is because im trying to assign a value to a constant. Is there anyway around this??? Quote Link to post Share on other sites
Steven 0 Posted January 18, 2009 Author Report Share Posted January 18, 2009 I think i may have discovered my own solution by using the set_bit and clear_bit functions. Does the boost C compiler have a spi.h header file for using the hardware spi on the 16f pics? Quote Link to post Share on other sites
Pavel 0 Posted January 18, 2009 Report Share Posted January 18, 2009 In C you can not assign a value to a constant (don't confuse this with const variable thought). The expression you quoted will look like this after passing the pre-processor: 6 &= ~1 This is an assignment expression and in C left side of an assignment expression must be an l-value. Regards, Pavel Quote Link to post Share on other sites
Steven 0 Posted January 19, 2009 Author Report Share Posted January 19, 2009 After much reading I think i have a better grasp of the concept. Thanks for the help. Also does the sourceBoost compiler have a spi.h header for the spi on the 16F pic's? Quote Link to post Share on other sites
Pavel 0 Posted January 19, 2009 Report Share Posted January 19, 2009 ...Also does the sourceBoost compiler have a spi.h header for the spi on the 16F pic's?... There are no SPI libraries or headers supplied in SourceBoost. We recommend to aks on the BoostC programming forum. There are a lot of talented BoostC users there. Regards, Pavel Quote Link to post Share on other sites
Recommended Posts
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.