线程+消息+先入先出队列
/*start thread and msg define*/
static osThreadId thread1_tid;
static void thread1(void const *argument);
osThreadDef(thread1, osPriorityAboveNormal, 1, 2048, "thread1");
APP_MESSAGE_BLOCK msg;
/*end thread and msg define*/
/*start fifo queue define*/
#define GTK_CQ_SIZE (1024*20)
uint8_t gtk_loopback_buff[GTK_CQ_SIZE];
CQueue gtk_queue;
int16_t test16_buf[13]={0x1001,0x1002,0x1003,0x1004,0x1005,0x1006,0x1007,0x1008,0x1009,0x100A,0x100B,0x100C,0x100D};
int8_t test8_buf[26]={0};
int16_t audio16_buf[13];
/*end fifo queue define*/
void gtk_16bits_to_8bit(int8_t *dst_buf, int16_t *src_buf, uint32_t src_len)
{
for (int i = 0; i < (int)src_len; i++)
{
dst_buf[i*2] =(src_buf[i] >> 8) & 0xff;
dst_buf[i*2+1] = src_buf[i]& 0xff;
TRACE(1, "dst_buf_high [0x%x],dst_buf_low [0x%x]\r\n", dst_buf[i*2],dst_buf[i*2+1]);
}
return;
}
void