summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-04-13 16:38:42 +0000
committerPhilip Balister <philip@opensdr.com>2010-04-13 16:38:42 +0000
commitf1838b9284a124fcfb5996eaf1647a69b4473278 (patch)
tree15e69f3641f8919fae201ec002a2edfc61f6cb42 /firmware
parentb59c54e334dfc1c6ab7da81c62038444f93efe61 (diff)
parent41a515f3f97ae77b7c1b4371fdef7c085dce8c1c (diff)
downloaduhd-f1838b9284a124fcfb5996eaf1647a69b4473278.tar.gz
uhd-f1838b9284a124fcfb5996eaf1647a69b4473278.tar.bz2
uhd-f1838b9284a124fcfb5996eaf1647a69b4473278.zip
Merge branch 'usrp_e' of git@ettus.sourcerepo.com:ettus/uhd into usrp_e
Diffstat (limited to 'firmware')
-rw-r--r--firmware/microblaze/apps/txrx.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/firmware/microblaze/apps/txrx.c b/firmware/microblaze/apps/txrx.c
index 39a503091..69a04d771 100644
--- a/firmware/microblaze/apps/txrx.c
+++ b/firmware/microblaze/apps/txrx.c
@@ -385,7 +385,7 @@ void handle_udp_ctrl_packet(
issue_stream_command(
(chain)? streaming_items_per_frame : num_samps, //nsamps
(ctrl_data_in->data.stream_cmd.now == 0)? false : true, //now
- chain, //chain
+ (ctrl_data_in->data.stream_cmd.chain == 0)? chain : true, //chain
ctrl_data_in->data.stream_cmd.secs,
ctrl_data_in->data.stream_cmd.ticks,
false
@@ -398,7 +398,7 @@ void handle_udp_ctrl_packet(
issue_stream_command(
(chain)? streaming_items_per_frame : num_samps, //nsamps
true, //now
- chain, //chain
+ (ctrl_data_in->data.stream_cmd.chain == 0)? chain : true, //chain
0, 0, //time does not matter
false
);
@@ -415,14 +415,38 @@ void handle_udp_ctrl_packet(
if (ctrl_data_in->data.poke_args.addr < 0xC000){
printf("error! tried to poke into 0x%x\n", ctrl_data_in->data.poke_args.addr);
}
- else{
- *((uint32_t *) ctrl_data_in->data.poke_args.addr) = ctrl_data_in->data.poke_args.data;
+ else switch(ctrl_data_in->data.poke_args.num_bytes){
+ case sizeof(uint32_t):
+ *((uint32_t *) ctrl_data_in->data.poke_args.addr) = (uint32_t)ctrl_data_in->data.poke_args.data;
+ break;
+
+ case sizeof(uint16_t):
+ *((uint16_t *) ctrl_data_in->data.poke_args.addr) = (uint16_t)ctrl_data_in->data.poke_args.data;
+ break;
+
+ case sizeof(uint8_t):
+ *((uint8_t *) ctrl_data_in->data.poke_args.addr) = (uint8_t)ctrl_data_in->data.poke_args.data;
+ break;
+
}
ctrl_data_out.id = USRP2_CTRL_ID_OMG_POKED_REGISTER_SO_BAD_DUDE;
break;
case USRP2_CTRL_ID_PEEK_AT_THIS_REGISTER_FOR_ME_BRO:
- ctrl_data_in->data.poke_args.data = *((uint32_t *) ctrl_data_in->data.poke_args.addr);
+ switch(ctrl_data_in->data.poke_args.num_bytes){
+ case sizeof(uint32_t):
+ ctrl_data_in->data.poke_args.data = *((uint32_t *) ctrl_data_in->data.poke_args.addr);
+ break;
+
+ case sizeof(uint16_t):
+ ctrl_data_in->data.poke_args.data = *((uint16_t *) ctrl_data_in->data.poke_args.addr);
+ break;
+
+ case sizeof(uint8_t):
+ ctrl_data_in->data.poke_args.data = *((uint8_t *) ctrl_data_in->data.poke_args.addr);
+ break;
+
+ }
ctrl_data_out.id = USRP2_CTRL_ID_WOAH_I_DEFINITELY_PEEKED_IT_DUDE;
break;