This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can I change SFR (bit) address definition when program is running?

In my application, I want to easily change address of SFR include user's commands. Such as:

sbit ram_en=P1^0;
......
/*In another place, I want to change ram_en to P1^2 dynamiclly.*/

I am try to do this(not definition field) in my code:
...
sbit ram_en=P1^2;
....

But it can not pass when compiling.
So, how can I implement this function?

Best regards!

Parents
  • Hehe, I believe it will take less time to re-compile project code. But I just want to make one system that can cast off IDE and programmer when I change some pin functions, that's it.
    If so, it seems I have to give up this idea....

    Thanks for your help!

Reply
  • Hehe, I believe it will take less time to re-compile project code. But I just want to make one system that can cast off IDE and programmer when I change some pin functions, that's it.
    If so, it seems I have to give up this idea....

    Thanks for your help!

Children