Question about _SFR_IO_ADDR() macro

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This macro is defined in sfr_defs.h like...

#define _SFR_IO_ADDR(sfr) ((sfr) - __SFR_OFFSET)

But when I create a preprocessed source file it expands like...
app.c

_SFR_IO_ADDR(0x3F);

app.i

(((uint16_t) &(0x3F)) - 0x20);

How and/or why is the addressing symbol '&' there?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was reading the file wrong. the define I was looking at was under the defined '_SFR_ASM_COMPAT' section.