@@ -375,34 +375,34 @@ bool I2Cdev::writeBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_
375375
376376 if (length > 127 ) {
377377 fprintf (stderr, " Byte write count (%d) > 127\n " , length);
378- return (FALSE );
378+ return (false );
379379 }
380380
381381 fd = open (I2CDEV , O_RDWR);
382382 if (fd < 0 ) {
383383 fprintf (stderr, " Failed to open device: %s\n " , strerror (errno));
384- return (FALSE );
384+ return (false );
385385 }
386386 if (ioctl (fd, I2C_SLAVE, devAddr) < 0 ) {
387387 fprintf (stderr, " Failed to select device: %s\n " , strerror (errno));
388388 close (fd);
389- return (FALSE );
389+ return (false );
390390 }
391391 buf[0 ] = regAddr;
392392 memcpy (buf+1 ,data,length);
393393 count = write (fd, buf, length+1 );
394394 if (count < 0 ) {
395395 fprintf (stderr, " Failed to write device(%d): %s\n " , count, ::strerror (errno));
396396 close (fd);
397- return (FALSE );
397+ return (false );
398398 } else if (count != length+1 ) {
399399 fprintf (stderr, " Short write to device, expected %d, got %d\n " , length+1 , count);
400400 close (fd);
401- return (FALSE );
401+ return (false );
402402 }
403403 close (fd);
404404
405- return TRUE ;
405+ return true ;
406406}
407407
408408/* * Write multiple words to a 16-bit device register.
@@ -422,18 +422,18 @@ bool I2Cdev::writeWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16
422422
423423 if (length > 63 ) {
424424 fprintf (stderr, " Word write count (%d) > 63\n " , length);
425- return (FALSE );
425+ return (false );
426426 }
427427
428428 fd = open (I2CDEV, O_RDWR);
429429 if (fd < 0 ) {
430430 fprintf (stderr, " Failed to open device: %s\n " , strerror (errno));
431- return (FALSE );
431+ return (false );
432432 }
433433 if (ioctl (fd, I2C_SLAVE, devAddr) < 0 ) {
434434 fprintf (stderr, " Failed to select device: %s\n " , strerror (errno));
435435 close (fd);
436- return (FALSE );
436+ return (false );
437437 }
438438 buf[0 ] = regAddr;
439439 for (i = 0 ; i < length; i++) {
@@ -444,14 +444,14 @@ bool I2Cdev::writeWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16
444444 if (count < 0 ) {
445445 fprintf (stderr, " Failed to write device(%d): %s\n " , count, ::strerror (errno));
446446 close (fd);
447- return (FALSE );
447+ return (false );
448448 } else if (count != length*2 +1 ) {
449449 fprintf (stderr, " Short write to device, expected %d, got %d\n " , length+1 , count);
450450 close (fd);
451- return (FALSE );
451+ return (false );
452452 }
453453 close (fd);
454- return TRUE ;
454+ return true ;
455455}
456456
457457/* * Default timeout value for read operations.
0 commit comments