mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2024-11-10 04:37:37 +01:00
Merge pull request #20 from lcl7/correct-e4k_reg_write
Correct return code of e4k_reg_write().
This commit is contained in:
commit
8b4d755ba1
@ -64,11 +64,13 @@ static const uint8_t width2mask[] = {
|
|||||||
*/
|
*/
|
||||||
static int e4k_reg_write(struct e4k_state *e4k, uint8_t reg, uint8_t val)
|
static int e4k_reg_write(struct e4k_state *e4k, uint8_t reg, uint8_t val)
|
||||||
{
|
{
|
||||||
|
int r;
|
||||||
uint8_t data[2];
|
uint8_t data[2];
|
||||||
data[0] = reg;
|
data[0] = reg;
|
||||||
data[1] = val;
|
data[1] = val;
|
||||||
|
|
||||||
return rtlsdr_i2c_write_fn(e4k->rtl_dev, e4k->i2c_addr, data, 2);
|
r = rtlsdr_i2c_write_fn(e4k->rtl_dev, e4k->i2c_addr, data, 2);
|
||||||
|
return r == 2 ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Read a register of the tuner chip
|
/*! \brief Read a register of the tuner chip
|
||||||
|
Loading…
Reference in New Issue
Block a user