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
This is a piece of my coce,it complier by large model
In main.c
uchar volatile xdata *data ptr_reg; unsigned char pdata g_size; void dma_task_execute (void) small { size = g_size; do_something(); } void main(void) { while (1) { EA = 0; dma_task_execute(); EA = 1; } }
In Int.c
extern unsigned char volatile xdata *data ptr_reg; extern unsigned char pdata g_size; void int_handler(void) interrupt 2 { EA = 0; g_size = ptr_reg[X_addr]; EA = 1; }
I found the data store into g_size in int_handler function is correct,but why g_size will become to zero when run dma_task_execute() sometimes ?? The vlaue of g_size is never will be zero,but why it will become to zero in dma_task_execute() sometimes?? Sorry my poor english any comment is welcome Best regards
if it is a char?
"if it is a char?"
char is an arithmetic type, so zero.