#include <string.h>
|
|
#include "protocol.h"
|
#include "queue.h"
|
#include "report.h"
|
|
static int device_status_count =0;
|
static device_status_mem dev_status[16];
|
|
void device_status_report(short ID , short* value, int numOfValue)
|
{
|
int i;
|
int found =0;
|
|
for(i=0;i<device_status_count;i++){
|
if(dev_status[i].ID == ID){
|
found = 1;
|
break;
|
}
|
}
|
|
if(found){
|
memcpy(dev_status[i].value , value, numOfValue*sizeof(short));
|
}
|
else{
|
dev_status[device_status_count].ID = ID;
|
memcpy(dev_status[device_status_count].value, value, numOfValue*sizeof(short));
|
device_status_count++;
|
}
|
}
|
|
|
/*
|
CPU ʹÓÃÂÊ
|
ÄÚ´æ ʹÓÃÂÊ
|
USB jitter
|
*/
|
void msg_report_dsp_status(command_type type)
|
{
|
tag_msg msg;
|
extern void* htx_que;
|
|
msg.magic = 0x5aa5;
|
msg.ctype = type;
|
msg.len = sizeof(device_status_mem)*device_status_count*2;
|
memcpy(msg.data , dev_status, sizeof(device_status_mem)*device_status_count);
|
|
queue_push(htx_que,&msg,SPI_PKT_SIZE);
|
device_status_count =0;
|
}
|