
7 Jun
2011
7 Jun
'11
5:06 p.m.
On Tuesday, June 07, 2011 06:06:23 Wolfgang Denk wrote:
#define FIELD_VAL(x) (x << 16) #define FIELD_MASK FIELD_VAL(0xF)
this is basically what we do in the blackfin port. we keep most of the logic in the defines so that we can use the simpler i/o logic without too much hassle.
the only additional thing we do is add a define for the shift in case we need to do something the macros cant provide. #define FIELD_SHIFT 16 #define FIELD_VAL(x) ((x) << FIELD_SHIFT) #define FIELD_MASK FIELD_FAL(0xF) -mike