aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/e300/battery/fpga.c
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2016-01-05 14:56:41 -0800
committerMoritz Fischer <moritz.fischer@ettus.com>2016-01-26 18:27:22 +0100
commitd432506509ba86585e2d29de7e1c16df2ff8a549 (patch)
treebd7ed1fd12f8045c05bf22873b4ac763828f045b /firmware/e300/battery/fpga.c
parent2ba7395f88df4a0ad73621a978f2fa3043234d32 (diff)
downloaduhd-d432506509ba86585e2d29de7e1c16df2ff8a549.tar.gz
uhd-d432506509ba86585e2d29de7e1c16df2ff8a549.tar.bz2
uhd-d432506509ba86585e2d29de7e1c16df2ff8a549.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/battery/fpga.c')
-rw-r--r--firmware/e300/battery/fpga.c3
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));