diff options
Diffstat (limited to 'usrp2/firmware/lib/u2_init.c')
-rw-r--r-- | usrp2/firmware/lib/u2_init.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/usrp2/firmware/lib/u2_init.c b/usrp2/firmware/lib/u2_init.c index cb4b679c49..8ecba34976 100644 --- a/usrp2/firmware/lib/u2_init.c +++ b/usrp2/firmware/lib/u2_init.c @@ -30,9 +30,21 @@ #include "ad9777.h" #include "clocks.h" #include "db.h" +#include "usrp2_i2c_addr.h" //#include "nonstdio.h" +unsigned char u2_hw_rev_major; +unsigned char u2_hw_rev_minor; + +static inline void +get_hw_rev(void) +{ + bool ok = eeprom_read(I2C_ADDR_MBOARD, MBOARD_REV_LSB, &u2_hw_rev_minor, 1); + ok &= eeprom_read(I2C_ADDR_MBOARD, MBOARD_REV_MSB, &u2_hw_rev_major, 1); +} + + /* * We ought to arrange for this to be called before main, but for now, * we require that the user's main call u2_init as the first thing... @@ -85,6 +97,8 @@ u2_init(void) lsdac_init(); // low-speed DACs db_init(); // daughterboard init + get_hw_rev(); + hal_enable_ints(); // flash all leds to let us know board is alive |