mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 01:11:10 +03:00
i2clcd: use the mraa C++ API instead of the C API
Rewrite the i2c module to be based around the MRAA C++ API, since this makes resource management easier inside of the UPM C++ classes. i2clcd.{h,cxx}: remove the close() function. This now automatically gets called when the object goes out of scope, inside the destructor. examples/i2clcd: fix C++/Python/Javascript examples that explicitly called the close function. The I2c context now gets called by the destructor of the sensor class. This happens when the object goes out of scope or when it gets deleted, if the object was created using the new keyword, as is the case here. Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
53b58225a4
commit
31c4f470fe
@ -191,5 +191,4 @@ for (var i = 0; i < 12; i++)
|
||||
myLcd.write('Hello World');
|
||||
}
|
||||
|
||||
myLcd.close();
|
||||
|
||||
|
Reference in New Issue
Block a user