diff options
author | Josh Blum <josh@joshknows.com> | 2010-03-24 18:03:03 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-03-24 18:03:03 -0700 |
commit | de2e7bb9acc556378e52c8bb6801cf3621a0ed72 (patch) | |
tree | 080eab18a790f18d7d26c2893bde32347d9baaaa /firmware/microblaze | |
parent | 24bd27b90d06820d858c008cff915319873321c5 (diff) | |
download | uhd-de2e7bb9acc556378e52c8bb6801cf3621a0ed72.tar.gz uhd-de2e7bb9acc556378e52c8bb6801cf3621a0ed72.tar.bz2 uhd-de2e7bb9acc556378e52c8bb6801cf3621a0ed72.zip |
added easy way to compile firmware for debug mode
Diffstat (limited to 'firmware/microblaze')
-rw-r--r-- | firmware/microblaze/apps/txrx.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/firmware/microblaze/apps/txrx.c b/firmware/microblaze/apps/txrx.c index b82c7702b..5eec99c4f 100644 --- a/firmware/microblaze/apps/txrx.c +++ b/firmware/microblaze/apps/txrx.c @@ -22,6 +22,8 @@ #include "config.h" #endif +#define DEBUG_MODE 0 //0 for normal operation + #include <lwip/ip.h> #include <lwip/udp.h> #include "u2_init.h" @@ -275,7 +277,7 @@ void handle_udp_ctrl_packet( * GPIO ******************************************************************/ case USRP2_CTRL_ID_USE_THESE_GPIO_DDR_SETTINGS_BRO: - hal_gpio_set_ddr( + if (!DEBUG_MODE) hal_gpio_set_ddr( OTW_GPIO_BANK_TO_NUM(ctrl_data_in->data.gpio_config.bank), ctrl_data_in->data.gpio_config.value, ctrl_data_in->data.gpio_config.mask @@ -284,7 +286,7 @@ void handle_udp_ctrl_packet( break; case USRP2_CTRL_ID_SET_YOUR_GPIO_PIN_OUTS_BRO: - hal_gpio_write( + if (!DEBUG_MODE) hal_gpio_write( OTW_GPIO_BANK_TO_NUM(ctrl_data_in->data.gpio_config.bank), ctrl_data_in->data.gpio_config.value, ctrl_data_in->data.gpio_config.mask @@ -302,7 +304,7 @@ void handle_udp_ctrl_packet( case USRP2_CTRL_ID_USE_THESE_ATR_SETTINGS_BRO:{ //setup the atr registers for this bank int bank = OTW_GPIO_BANK_TO_NUM(ctrl_data_in->data.atr_config.bank); - set_atr_regs( + if (!DEBUG_MODE) set_atr_regs( bank, ctrl_data_in->data.atr_config.rx_value, ctrl_data_in->data.atr_config.tx_value @@ -312,7 +314,7 @@ void handle_udp_ctrl_packet( int mask = ctrl_data_in->data.atr_config.mask; for (int i = 0; i < 16; i++){ // set to either GPIO_SEL_SW or GPIO_SEL_ATR - hal_gpio_set_sel(bank, i, (mask & (1 << i)) ? 'a' : 's'); + if (!DEBUG_MODE) hal_gpio_set_sel(bank, i, (mask & (1 << i)) ? 'a' : 's'); } ctrl_data_out.id = USRP2_CTRL_ID_GOT_THE_ATR_SETTINGS_DUDE; } @@ -757,9 +759,9 @@ main(void) #endif output_regs->debug_mux_ctrl = 1; -#if 0 - hal_gpio_set_sels(GPIO_TX_BANK, "1111111111111111"); - hal_gpio_set_sels(GPIO_RX_BANK, "1111111111111111"); +#if DEBUG_MODE + hal_gpio_set_sels(GPIO_TX_BANK, "0000000000000000"); + hal_gpio_set_sels(GPIO_RX_BANK, "0000000000000000"); hal_gpio_set_ddr(GPIO_TX_BANK, 0xffff, 0xffff); hal_gpio_set_ddr(GPIO_RX_BANK, 0xffff, 0xffff); #endif |