Commit aa48b7c8 authored by Andrey Filippov's avatar Andrey Filippov

Terminating EEPROM data with 0

parent d9c05168
...@@ -103,6 +103,7 @@ function i2c_write256b_sensor($data, ///< Sring to write ...@@ -103,6 +103,7 @@ function i2c_write256b_sensor($data, ///< Sring to write
///< @return number of bytes written ///< @return number of bytes written
{ {
$len = 0; $len = 0;
if (strlen($data)<256) $data.=chr(0);
for ($ra=0;$ra<strlen($data);$ra++){ for ($ra=0;$ra<strlen($data);$ra++){
$b = ord(substr($data,$ra,1)); $b = ord(substr($data,$ra,1));
if (($d = i2c_send_sensor($name,$sensor_port,$ra,$b,$sa7_offset))<0) break; if (($d = i2c_send_sensor($name,$sensor_port,$ra,$b,$sa7_offset))<0) break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment