Mercurial > hg > beaglert
comparison core/I2c_Codec.cpp @ 216:869f5e703844
Fixed compiler warnings
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Sat, 13 Feb 2016 01:51:01 +0000 |
parents | 4c5acd649d46 |
children | 838a4a4a8580 |
comparison
equal
deleted
inserted
replaced
215:b10f5ba8fd33 | 216:869f5e703844 |
---|---|
412 } | 412 } |
413 | 413 |
414 // Write a specific register on the codec | 414 // Write a specific register on the codec |
415 int I2c_Codec::writeRegister(unsigned int reg, unsigned int value) | 415 int I2c_Codec::writeRegister(unsigned int reg, unsigned int value) |
416 { | 416 { |
417 char buf[2] = { reg & 0xFF, value & 0xFF }; | 417 char buf[2] = { static_cast<char>(reg & 0xFF), static_cast<char>(value & 0xFF) }; |
418 | 418 |
419 if(write(i2C_file, buf, 2) != 2) | 419 if(write(i2C_file, buf, 2) != 2) |
420 { | 420 { |
421 cout << "Failed to write register " << reg << " on codec\n"; | 421 cout << "Failed to write register " << reg << " on codec\n"; |
422 return 1; | 422 return 1; |