From: SourceForge.net <no...@so...> - 2004-01-22 16:53:48
|
Feature Requests item #882215, was opened at 2004-01-22 17:22 Message generated for change (Comment added) made by bernhardheld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=882215&group_id=599 Category: None Group: None Status: Open Priority: 3 Submitted By: Patrik Spieß (pat1975) Assigned to: Nobody/Anonymous (nobody) Summary: Binary Constant Notation Initial Comment: I think it would be great to be able to write binary constants like this: byte flags= 0b11001010; ---------------------------------------------------------------------- >Comment By: Bernhard Held (bernhardheld) Date: 2004-01-22 17:53 Message: Logged In: YES user_id=203539 #define BIN(x) ( ((0x##x##L & 0x00000001L) ? 0x01 : 0) | ((0x##x##L & 0x00000010L) ? 0x02 : 0) | ((0x##x##L & 0x00000100L) ? 0x04 : 0) | ((0x##x##L & 0x00001000L) ? 0x08 : 0) | ((0x##x##L & 0x00010000L) ? 0x10 : 0) | ((0x##x##L & 0x00100000L) ? 0x20 : 0) | ((0x##x##L & 0x01000000L) ? 0x40 : 0) | ((0x##x##L & 0x10000000L) ? 0x80 : 0)) T2CON = BIN(00110100); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=882215&group_id=599 |