diff options
author | eb | 2008-09-10 23:50:19 +0000 |
---|---|---|
committer | eb | 2008-09-10 23:50:19 +0000 |
commit | 8cb024901c66ff487f2724199d31b8acfde71078 (patch) | |
tree | 19b4320420b883a1d082957dc8f97389a940b39d /usrp2/firmware/lib | |
parent | 924831afcdb187b3de670be6fd1f6147d62be5cf (diff) | |
download | gnuradio-8cb024901c66ff487f2724199d31b8acfde71078.tar.gz gnuradio-8cb024901c66ff487f2724199d31b8acfde71078.tar.bz2 gnuradio-8cb024901c66ff487f2724199d31b8acfde71078.zip |
now reads h/w rev from eeprom. f/w app set_hw_rev sets it
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9554 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp2/firmware/lib')
-rw-r--r-- | usrp2/firmware/lib/u2_init.c | 14 | ||||
-rw-r--r-- | usrp2/firmware/lib/u2_init.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/usrp2/firmware/lib/u2_init.c b/usrp2/firmware/lib/u2_init.c index cb4b679c4..8ecba3497 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 diff --git a/usrp2/firmware/lib/u2_init.h b/usrp2/firmware/lib/u2_init.h index 901e61250..91654dac8 100644 --- a/usrp2/firmware/lib/u2_init.h +++ b/usrp2/firmware/lib/u2_init.h @@ -18,6 +18,9 @@ #ifndef INCLUDED_U2_INIT_H #define INCLUDED_U2_INIT_H +extern unsigned char u2_hw_rev_major; +extern unsigned char u2_hw_rev_minor; + /*! * one-time init */ |