BES RTOS系统应用实例

/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*/#defi.
摘要由CSDN通过智能技术生成

线程+消息+先入先出队列

/*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 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值