kerneltest/e32test/iic/iic_psl/i2c.cpp
changeset 33 0173bcd7697c
parent 0 a41df078684a
child 90 947f0dc9f7a8
child 256 c1f20ce4abcf
equal deleted inserted replaced
31:56f325a607ea 33:0173bcd7697c
   123 	if(size>maxLen)
   123 	if(size>maxLen)
   124 	   size=maxLen;
   124 	   size=maxLen;
   125 	aDes.Copy((TUint8*)&caps,size);
   125 	aDes.Copy((TUint8*)&caps,size);
   126     }
   126     }
   127 
   127 
   128 
       
   129 DSimulatedI2cDevice* gDummyDevice;
       
   130 
       
   131 
       
   132 // supported channels for this implementation
   128 // supported channels for this implementation
   133 static DIicBusChannel* ChannelPtrArray[NUM_CHANNELS];
   129 static DIicBusChannel* ChannelPtrArray[NUM_CHANNELS];
   134 
   130 
   135 
   131 
   136 //DECLARE_EXTENSION_WITH_PRIORITY(BUS_IMPLMENTATION_PRIORITY)	
   132 //DECLARE_EXTENSION_WITH_PRIORITY(BUS_IMPLMENTATION_PRIORITY)	
   137 DECLARE_STANDARD_PDD()		// I2c test driver to be explicitly loaded as an LDD, not kernel extension
   133 DECLARE_STANDARD_PDD()		// I2c test driver to be explicitly loaded as an LDD, not kernel extension
   138 	{	
   134 	{	
   139 	if(gDummyDevice == NULL)
       
   140 		gDummyDevice = new DSimulatedI2cDevice;
       
   141 	if(gDummyDevice == NULL)
       
   142 		return NULL;
       
   143 	I2C_PRINT(("\n\nI2C PDD, channel creation loop follows ...\n"));
       
   144 
       
   145 #ifndef STANDALONE_CHANNEL
   135 #ifndef STANDALONE_CHANNEL
   146 	DIicBusChannel* chan=NULL;
   136 	DIicBusChannel* chan=NULL;
   147 	for(TInt i=0; i<NUM_CHANNELS; i++)
   137 	for(TInt i=0; i<NUM_CHANNELS; i++)
   148 		{
   138 		{
   149 	I2C_PRINT(("\n"));
   139 	I2C_PRINT(("\n"));
   233 		{
   223 		{
   234 		delete chan;
   224 		delete chan;
   235 		return NULL;
   225 		return NULL;
   236 		}
   226 		}
   237 #endif
   227 #endif
   238 	return gDummyDevice;
   228 	return new DSimulatedI2cDevice;
   239 	}
   229 	}
   240 
   230 
   241 
   231 
   242 #ifdef MASTER_MODE
   232 #ifdef MASTER_MODE
   243 #ifdef STANDALONE_CHANNEL
   233 #ifdef STANDALONE_CHANNEL