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
Thanks all
Sorry,the variables of g_size and ptr_reg has realy initialized to zero before program running.
my question is in the interrupt rountine,the g_size will be assign to some value ,but back to main ,the g_size value will become to zero sometimes.
I have check the SRC to see asm code,it look like well
Best regards