BlinkenArea - GitList
Repositories
Blog
Wiki
bluebox
Code
Commits
Branches
Tags
Search
Tree:
fd252ce
Branches
Tags
master
bluebox
BlueDataDistributor
firmware
macros.h
initial commit of files from bluebox project
Stefan Schuermans
commited
fd252ce
at 2015-12-19 20:16:38
macros.h
Blame
History
Raw
/* BlueDataDistributor - data distribution module from ethernet to 32 serial ports * version 0.1.1 date 2006-10-07 * Copyright (C) 2006 Stefan Schuermans <stefan@blinkenarea.org> * a BlinkenArea project - http://www.blinkenarea.org/ */ #ifndef INC_macros #define INC_macros // minimum and maximum #define min( a, b ) ((a) < (b) ? (a) : (b)) #define max( a, b ) ((a) > (b) ? (a) : (b)) // number of entries in an array #define count( array ) (sizeof( (array) ) / sizeof( (array)[0] )) // waiting #define nop( ) { __asm__ __volatile__ ("nop"::); } // bit manipulation #define bit_set( var, bit ) (var |= (1 << bit)) #define bit_clear( var, bit ) (var &= ~(1 << bit)) #define bit_toggle( var, bit ) (var ^= (1 << bit)) #endif // #ifndef INC_macros