kerneltest/e32test/iic/iic_psl/spi.cpp
changeset 44 36bfc973b146
parent 43 96e5fb8b040d
child 90 947f0dc9f7a8
equal deleted inserted replaced
43:96e5fb8b040d 44:36bfc973b146
   120 	if(size>maxLen)
   120 	if(size>maxLen)
   121 	   size=maxLen;
   121 	   size=maxLen;
   122 	aDes.Copy((TUint8*)&caps,size);
   122 	aDes.Copy((TUint8*)&caps,size);
   123     }
   123     }
   124 
   124 
   125 
       
   126 DSimulatedSpiDevice* gDummyDevice;
       
   127 
       
   128 // supported channels for this implementation
   125 // supported channels for this implementation
   129 static DIicBusChannel* ChannelPtrArray[NUM_CHANNELS];
   126 static DIicBusChannel* ChannelPtrArray[NUM_CHANNELS];
   130 
   127 
   131 
       
   132 //DECLARE_EXTENSION_WITH_PRIORITY(BUS_IMPLMENTATION_PRIORITY)	
   128 //DECLARE_EXTENSION_WITH_PRIORITY(BUS_IMPLMENTATION_PRIORITY)	
   133 DECLARE_STANDARD_PDD()		// SPI test driver to be explicitly loaded as an LDD, not kernel extension
   129 DECLARE_STANDARD_PDD()		// SPI test driver to be explicitly loaded as an LDD, not kernel extension
   134 	{
   130 	{
   135 	if(gDummyDevice == NULL)
       
   136 		gDummyDevice = new DSimulatedSpiDevice;
       
   137 	if(gDummyDevice == NULL)
       
   138 		return NULL;
       
   139 	SPI_PRINT(("\n\nSPI PDD, channel creation loop follows ...\n"));
   131 	SPI_PRINT(("\n\nSPI PDD, channel creation loop follows ...\n"));
   140 
   132 
   141 #ifndef STANDALONE_CHANNEL
   133 #ifndef STANDALONE_CHANNEL
   142 	DIicBusChannel* chan=NULL;
   134 	DIicBusChannel* chan=NULL;
   143 	for(TInt i=0; i<NUM_CHANNELS; i++)
   135 	for(TInt i=0; i<NUM_CHANNELS; i++)
   198 		{
   190 		{
   199 		delete chan;
   191 		delete chan;
   200 		return NULL;
   192 		return NULL;
   201 		}
   193 		}
   202 #endif
   194 #endif
   203 	return gDummyDevice;
   195 	return new DSimulatedSpiDevice;
   204 	}
   196 	}
   205 
   197 
   206 #ifdef STANDALONE_CHANNEL
   198 #ifdef STANDALONE_CHANNEL
   207 EXPORT_C
   199 EXPORT_C
   208 #endif
   200 #endif