Example #1
0
int
main(void)
{
  u2_init();

  puts("\nburn_dbsrx_eeprom\n");

  hal_set_leds(0, ~0);	// all off

  int i2c_addr = I2C_ADDR_RX_A;
  int dbid = read_dboard_eeprom(i2c_addr);
  bool ok;
  const char *msg = 0;

  switch (dbid){
  case -1:
    msg = "No RX daughterboard found";
    goto bad;

  case -2:
    msg = "Invalid RX EEPROM contents";
    goto bad;

  case USRP_DBID_DBS_RX_WITH_CLOCK_MOD:
    msg = "RX Daughterboard already reports being a DBS RX w/ CLOCK_MOD";
    goto good;

  case USRP_DBID_DBS_RX:
    // Says it's a DBS_RX, attempt to burn the EEPROM
    ok = eeprom_write(i2c_addr, 0,
		      dbs_rx_rev2_eeprom, sizeof(dbs_rx_rev2_eeprom));
    if (ok){
      msg = "Successfully programmed db as DBS RX Rev 2.1";
      goto good;
    }
    else {
      msg = "Failed to write daugherboard eeprom";
      goto bad;
    }

  default:
    msg = "Daughterboard is not a DBS RX; ignored";
    goto bad;
  }
  
 good:
  puts(msg);
  hal_set_leds(LED_VALS, LED_MASK);
  while (1)
    ;

 bad:
  puts(msg);
  while(1){
    hal_toggle_leds(LED_VALS);
    mdelay(50);
  }
}
Example #2
0
void
buffer_irq_handler(unsigned irq)
{
  uint32_t  status = buffer_pool_status->status;

  if (0){
    putstr("irq: ");
    puthex32(status);
    putchar('\n');
  }

  if (status & BPS_ERROR_ALL){
    // FIXME rare path, handle error conditions
  }

  if (status & BPS_DONE(DSP_TX_BUF_0)){
    bp_clear_buf(DSP_TX_BUF_0);
    SEND_CONST_TO_DSP_TX();
    hal_toggle_leds(0x1);
  }

}