Advertisement
Guest User

Untitled

a guest
Jan 17th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. diff --git a/host/lib/usrp/common/fx2_ctrl.cpp b/host/lib/usrp/common/fx2_ctrl.cpp
  2. index 650fba7..93d66d1 100644
  3. --- a/host/lib/usrp/common/fx2_ctrl.cpp
  4. +++ b/host/lib/usrp/common/fx2_ctrl.cpp
  5. @@ -22,6 +22,7 @@
  6. #include <uhd/transport/usb_control.hpp>
  7. #include <boost/functional/hash.hpp>
  8. #include <boost/thread/thread.hpp>
  9. +#include <boost/cstdint.hpp>
  10. #include <fstream>
  11. #include <sstream>
  12. #include <string>
  13. @@ -35,6 +36,8 @@ using namespace uhd::usrp;
  14.  
  15. static const bool load_img_msg = true;
  16.  
  17. +typedef boost::uint32_t hash_type;
  18. +
  19. /***********************************************************************
  20. * Helper Functions
  21. **********************************************************************/
  22. @@ -140,9 +143,9 @@ public:
  23. {
  24. const char *filename = filestring.c_str();
  25.  
  26. - size_t hash = generate_hash(filename);
  27. + hash_type hash = generate_hash(filename);
  28.  
  29. - size_t loaded_hash; usrp_get_firmware_hash(loaded_hash);
  30. + hash_type loaded_hash; usrp_get_firmware_hash(loaded_hash);
  31.  
  32. if (not force and (hash == loaded_hash)) return;
  33.  
  34. @@ -217,9 +220,9 @@ public:
  35. {
  36. const char *filename = filestring.c_str();
  37.  
  38. - size_t hash = generate_hash(filename);
  39. + hash_type hash = generate_hash(filename);
  40.  
  41. - size_t loaded_hash; usrp_get_fpga_hash(loaded_hash);
  42. + hash_type loaded_hash; usrp_get_fpga_hash(loaded_hash);
  43.  
  44. if (hash == loaded_hash) return;
  45. const int ep0_size = 64;
  46. @@ -308,32 +311,32 @@ public:
  47. }
  48.  
  49.  
  50. - void usrp_get_firmware_hash(size_t &hash)
  51. + void usrp_get_firmware_hash(hash_type &hash)
  52. {
  53. UHD_ASSERT_THROW(usrp_control_read(0xa0, USRP_HASH_SLOT_0_ADDR, 0,
  54. - (unsigned char*) &hash, sizeof(size_t)) >= 0);
  55. + (unsigned char*) &hash, sizeof(hash)) >= 0);
  56. }
  57.  
  58.  
  59. - void usrp_set_firmware_hash(size_t hash)
  60. + void usrp_set_firmware_hash(hash_type hash)
  61. {
  62. UHD_ASSERT_THROW(usrp_control_write(0xa0, USRP_HASH_SLOT_0_ADDR, 0,
  63. - (unsigned char*) &hash, sizeof(size_t)) >= 0);
  64. + (unsigned char*) &hash, sizeof(hash)) >= 0);
  65.  
  66. }
  67.  
  68.  
  69. - void usrp_get_fpga_hash(size_t &hash)
  70. + void usrp_get_fpga_hash(hash_type &hash)
  71. {
  72. UHD_ASSERT_THROW(usrp_control_read(0xa0, USRP_HASH_SLOT_1_ADDR, 0,
  73. - (unsigned char*) &hash, sizeof(size_t)) >= 0);
  74. + (unsigned char*) &hash, sizeof(hash)) >= 0);
  75. }
  76.  
  77.  
  78. - void usrp_set_fpga_hash(size_t hash)
  79. + void usrp_set_fpga_hash(hash_type hash)
  80. {
  81. UHD_ASSERT_THROW(usrp_control_write(0xa0, USRP_HASH_SLOT_1_ADDR, 0,
  82. - (unsigned char*) &hash, sizeof(size_t)) >= 0);
  83. + (unsigned char*) &hash, sizeof(hash)) >= 0);
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement