mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2024-12-26 10:58:28 +01:00
tuner_e4k: fix off-by-one error in e4k_if_gain_set()
Thanks to patchvonbraun for providing debug logs that helped to track this beast down. Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
parent
86c34428aa
commit
59198d6342
@ -715,7 +715,7 @@ int e4k_if_gain_set(struct e4k_state *e4k, uint8_t stage, int8_t value)
|
||||
return rc;
|
||||
|
||||
/* compute the bit-mask for the given gain field */
|
||||
field = &if_stage_gain_regs[stage];
|
||||
field = &if_stage_gain_regs[stage-1];
|
||||
mask = width2mask[field->width] << field->shift;
|
||||
|
||||
return e4k_reg_set_mask(e4k, field->reg, mask, rc << field->shift);
|
||||
|
Loading…
Reference in New Issue
Block a user