removed X-NUCLEO-COMMON and ST-INTERFACES

Dependents:   unh-hackathon-example unh-hackathon-example-raw

Fork of X_NUCLEO_IKS01A1 by ST

Files at this revision

API Documentation at this revision

Comitter:
Wolfgang Betz
Date:
Wed Apr 29 16:14:03 2015 +0200
Parent:
9:b989c9bc2f3e
Child:
11:001a21c6ac1d
Child:
14:298bc52b4a70
Commit message:
Added some important safety checks

Changed in this revision

x_nucleo_iks01a1.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/x_nucleo_iks01a1.cpp	Mon Apr 20 11:42:38 2015 +0200
+++ b/x_nucleo_iks01a1.cpp	Wed Apr 29 16:14:03 2015 +0200
@@ -73,7 +73,9 @@
 	if(_instance == NULL) {
 		if(ext_i2c == NULL)
 			ext_i2c = new DevI2C(IKS01A1_PIN_I2C_SDA, IKS01A1_PIN_I2C_SCL);
-		_instance = new X_NUCLEO_IKS01A1(ext_i2c);
+
+		if(ext_i2c != NULL)
+			_instance = new X_NUCLEO_IKS01A1(ext_i2c);
 	
 		if(_instance != NULL) {
 			bool ret = _instance->Init();