Javascript wrappers for HTS221 Sensor library

Dependencies:   HTS221

Dependents:   ST_SENSOR_JS

Revision:
1:924fb53eb7f8
Parent:
0:89911ffe212d
Child:
2:c8589b137d5a
--- a/HTS221_JS-js.cpp	Tue Oct 10 11:51:26 2017 +0200
+++ b/HTS221_JS-js.cpp	Wed Oct 11 10:08:12 2017 +0200
@@ -95,7 +95,6 @@
     // Cast it back to JavaScript and return
     return jerry_create_number(result);
 
-    //return jerry_create_string((unsigned char*)"5C");
 }
 
 
@@ -126,7 +125,6 @@
     // Cast it back to JavaScript and return
     return jerry_create_number(result);
 
-    //return jerry_create_string((unsigned char*)"5C");
 }
 
 /**
@@ -185,15 +183,16 @@
     const jerry_object_native_info_t *devI2c_type_ptr;
     bool devI2c_has_ptr = jerry_get_object_native_pointer(args[0], &devI2c_ptr, &devI2c_type_ptr);
 
+    // Check if we have the i2c pointer
     if (!devI2c_has_ptr) {
         printf("Not a I2C input!");
         return jerry_create_error(JERRY_ERROR_TYPE,
                                   (const jerry_char_t *) "Failed to get native DigitalOut pointer");
     }
 
+    // Cast the argument to C++
     DevI2C* devI2c = reinterpret_cast<DevI2C*>(devI2c_ptr);
     
-
     // Extract native HTS221_JS pointer (from this object) 
     HTS221_JS *native_ptr = new HTS221_JS(*devI2c);