Skip to content
Snippets Groups Projects
Commit 52519881 authored by Erik von Reis's avatar Erik von Reis
Browse files

awgptan: build working with explicit sized integers. mbuf analyze improved to...

awgptan: build working with explicit sized integers.  mbuf analyze improved to show the first working awg slot.
parent 240190c2
No related branches found
No related tags found
1 merge request!215Simplified awg data mbuf handles excitation data streaming from awg to models
......@@ -16,21 +16,53 @@ namespace analyze
void dump_awg_data(volatile AWG_DATA *awg_data)
{
int hunt_state = 0;
int slot = 0;
auto detected_type = analyze_header(awg_data);
if(detected_type != MBUF_AWG_DATA)
{
cout << "WARNING: attempting to analyze AWG_DATA structure, but structure was of type " << detected_type << endl;
}
volatile AWG_DATA_PAGE * page = &awg_data->page[0];
while(true)
{
printf("status: %4x d: ", page->status);
for ( int i = 0; i < 8; ++i )
int page_index = FIND_PAGE_INDEX(slot,0);
volatile AWG_DATA_PAGE * page = & awg_data->page[page_index];
printf("slot: %1d status: %4x d: ", slot, page->status);
for ( int i = 0; i < 4; ++i )
{
printf("%8.5f ", page->buf[i]);
printf("%12.5g", page->buf[i]);
}
cout << "\r" << flush;
// update slot if necessary to look for active slots
switch(hunt_state)
{
case 1:
case 0:
if(page->status != 0)
{
++hunt_state;
}
else
{
hunt_state = 0;
}
break;
case 2:
if(page->status != 0)
{
slot = (++slot) % AWG_SLOTS;
}
else
{
hunt_state = 0;
}
}
usleep(20000);
}
}
......
......@@ -6,6 +6,8 @@
#ifndef DAQD_TRUNK_SHARED_MEMORY_H
#define DAQD_TRUNK_SHARED_MEMORY_H
#include <stdint.h>
#include "shmem_awg.h"
extern volatile AWG_DATA *shmemAwgData;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment