diff options
author | Moritz Fischer <moritz.fischer@ettus.com> | 2016-01-05 14:56:41 -0800 |
---|---|---|
committer | Moritz Fischer <moritz.fischer@ettus.com> | 2016-01-26 18:25:37 +0100 |
commit | bbeacff2b1bc3a17254167a79a26a2a2c82e906c (patch) | |
tree | 3451b06641219af36fa7b30ab32bd86a3e6860c9 /firmware/e300 | |
parent | ea3040da12af46e5d227fe5edeb4d580e42d7658 (diff) | |
download | uhd-bbeacff2b1bc3a17254167a79a26a2a2c82e906c.tar.gz uhd-bbeacff2b1bc3a17254167a79a26a2a2c82e906c.tar.bz2 uhd-bbeacff2b1bc3a17254167a79a26a2a2c82e906c.zip |
firmware: e3xx: This fixes an issue with the autoboot value.
The bug is a result of wrong order of evaluation:
The '|' operator takes precedence over '?'. Therefore
the intended expression a = x | (y ? 1 : 0) got evaluated
as a = (x | y) ? 1 : 0.
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'firmware/e300')
-rw-r--r-- | firmware/e300/battery/fpga.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/e300/battery/fpga.c b/firmware/e300/battery/fpga.c index 20404e5a1..2dc9fb09d 100644 --- a/firmware/e300/battery/fpga.c +++ b/firmware/e300/battery/fpga.c @@ -248,7 +248,8 @@ void fpga_init(void) fpga_tx2.type = 2; /* get autoboot value from eeprom, keep TX reg on */ - fpga_tx2.settings = BIT(1) | eeprom_get_autoboot() ? 0x1 : 0x0; + fpga_tx2.settings = BIT(1); + fpga_tx2.settings |= eeprom_get_autoboot() ? BIT(0) : 0x0; memset((void *) &fpga_rx, 0, sizeof(fpga_rx)); |