 
					
				
		
#pragma DATA_SEG SHARED_DATAvolatile int shared_counter; /* volatile because both cores are accessing it. */#pragma DATA_SEG DEFAULT
#pragma DATA_SEG SHARED_DATA /* allocate the following variables in the segment SHARED_DATA */volatile extern int shared_counter; /* volatile because both cores are accessing it. */#pragma pop
after above insertings there is no problem for using sharing_counter in xgate core or main core. But when I want to use a data structure like below failed the compile operation:
For example, Inserted the followings into main.c
#pragma DATA_SEG SHARED_DATAvolatile int shared_counter; /* volatile because both cores are accessing it. */typedef struct {  unsigned char Member1;  unsigned char Member2;} MyStr;volatile MyStr Str1;#pragma DATA_SEG DEFAULT
And inserted into xgate.h:
#pragma DATA_SEG SHARED_DATA /* allocate the following variables in the segment SHARED_DATA */volatile extern int shared_counter; /* volatile because both cores are accessing it. */volatile extern MyStr Str1;#pragma pop
When I compiled there is "Error : C2450 Expected:   ;=,"  error message. I think that I make a mistake for about syntax but don't know what. May anybody explain me how to use same data structure in both cores.
 
 
Solved! Go to Solution.
 
					
				
		
 CompilerGuru
		
			CompilerGuru
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 
					
				
		
 CompilerGuru
		
			CompilerGuru
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		