expression must be a modifiable lvalue

Thread Starter

Jswale

Joined Jun 30, 2015
121
Hi All,

Using MSP430F6679 on IAR Workbench..

I'm trying to disable GIE...

C:
/************************************************************
* STATUS REGISTER BITS
************************************************************/

#define C                   (0x0001u)
#define Z                   (0x0002u)
#define N                   (0x0004u)
#define V                   (0x0100u)
#define GIE                 (0x0008u)
#define CPUOFF              (0x0010u)
#define OSCOFF              (0x0020u)
#define SCG0                (0x0040u)
#define SCG1                (0x0080u)
This is the register in the MCU library.

When I put in GIE=0; the error comes up, so my question is how do I set and unset this bit?

Cheers!
 

dannyf

Joined Sep 13, 2015
2,197
Those macros are constant - as such they cannot be changed, and they are defined masks on the status register. All you need is to use the masks to set / clear the respective bits in the status register.
 
Top