Bug 16085 - buggy #define in config.h of msp430 fw
: buggy #define in config.h of msp430 fw
Status: CLOSED FIXED
Product: SB Radio
Classification: Unclassified
Component: Power Management
: Include FW version in comment
: Other Windows Vista
: -- normal (vote)
: 7.6.0
Assigned To: Vahid Fereydouny
: factory_mp
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-16 17:44 UTC by Maurice Alou
Modified: 2011-05-18 15:32 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maurice Alou 2010-04-16 17:44:21 UTC
The following define fail to clear multiple bits:
  #define BIC(LOC, BITS)  (LOC = (LOC & (~BITS)))

For example, in rtc.c the statement BIC(BCSCTL3, LFXT1S0|LFXT1S1|XCAP0) will only clear bit LFXT1S0 and fail to clear the other two bits.

The correct way is:
  #define BIC(LOC, BITS)  (LOC = (LOC & ~(BITS)))

I would also change:
  #define BIS(LOC, BITS)  (LOC = (LOC | BITS))
into
  #define BIS(LOC, BITS)  (LOC = (LOC | (BITS)))
Comment 1 Vahid Fereydouny 2010-07-14 00:43:24 UTC
Made the changes and ran some tests to make sure that it works fine. It is ready to be checked in
Comment 2 Bradley D. Wall 2011-05-18 15:32:59 UTC
Closing due to fix