meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
programming:c:preprocessor:macros [2025/11/01 14:46] – ↷ Page moved from programming:c:macros to programming:c:preprocessor:macros niziakprogramming:c:preprocessor:macros [2025/11/01 14:50] (current) niziak
Line 1: Line 1:
 ====== macros ====== ====== macros ======
 +
 +  * [[https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,-tips,-and-idioms|C Preprocessor tricks, tips, and idioms]]
 +  * [[http://jhnet.co.uk/articles/cpp_magic]]
 +  * [[https://medium.com/codex/c-macros-pseudo-generic-methods-and-structs-b4236e6e50b8|C Macros: Pseudo-generic methods and structs]]
  
 <code c> <code c>
Line 7: Line 11:
     _a > _b ? _a : _b; })     _a > _b ? _a : _b; })
 </code> </code>
 +
 +===== bitfields =====
 +
 +<code c>
 +#define BITMASK(bit_len, bit_shift) (((1U << (bit_len))-1) << (bit_shift))
 +</code<
 +
 +  * [[https://stackoverflow.com/questions/31253045/c-macro-to-create-bitfield-defines|C Macro to Create Bitfield Defines]]
 +  * [[https://forum.arduino.cc/t/calculating-bitmask-values/410649/23?page=2|Calculating Bitmask Values]]
  
  
-[[https://stackoverflow.com/questions/31253045/c-macro-to-create-bitfield-defines|C Macro to Create Bitfield Defines]]