We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all i want to read RTC time parameters. RTC is treated as one of memory location,it gets enabled when parameters are refered. following where the codes:
struct tm{ unsigned char xdata second _at_(0xe000); unsigned char xdata minute _at_(0xe002); unsigned char xdata hour _at_(0xe004); }; void main() { struct tm time; printf("seconds %x",time.second) ... }
struct tm{ unsigned char second _at_(0xe000); }
xdata unsigned char second _at_(0xe000); xdata unsigned char minute _at_(0xe002); xdata unsigned char hour _at_(0xe004); void main() { printf("\nseconds %x",second); printf("\nminutes %x",minutes); printf("\nhours %x",hour); }
struct tm{ unsigned char xdata second _at_(0xe000); unsigned char xdata minute _at_(0xe002); unsigned char xdata hour _at_(0xe004); }; void main() { struct tm time1,time2; ......
"Yes, I was surprised that he seemed to be suggesting that the compiler accepted _at_ within a structure definition!!?? Does it really????" The compiler ignores the _at_ statement applied to structure elements! There is no compile error - I have tried it with V7.06a. The compiler calculates the addresses of structure elements from the beginning of the structure - and this is not 0xe000