📄 task_test7.c
字号:
/* * dspapps/dsp/task_testB/task_test7.c * * DSP task example: private IPBUF * * Copyright (C) 2002,2003 Nokia Corporation * * Written by Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: task_test7.c * $Revision: 2.0 * $Date: 2003/11/11 * */#include <std.h>#include "mailbox.h"#include "tokliBIOS.h"#define T7_BUF_SZ 0x10static Uns t7_rcv_bksnd(struct dsptask *task, Uns cnt);static Uns t7_rcv_tctl(struct dsptask *task, Uns ctlcmd);//#pragma DATA_SECTION(t7_rbuf_data, "ipbuf");//#pragma DATA_SECTION(t7_wbuf_data, "ipbuf");Int t7_rbuf_data[T7_BUF_SZ];Int t7_wbuf_data[T7_BUF_SZ];struct dsptask task_test7 = { TID_MAGIC, // tid "test7", // name MBCMD_TTYP_PVDM | MBCMD_TTYP_PVMD | MBCMD_TTYP_BKDM | MBCMD_TTYP_BKMD | MBCMD_TTYP_ASND | MBCMD_TTYP_AREQ, // ttyp: active block snd, active block rcv t7_rcv_bksnd, // rcv_snd NULL, // rcv_req t7_rcv_tctl, // rcv_tctl NULL // tsk_attrs};static Uns t7_rcv_bksnd(struct dsptask *task, Uns cnt){ if(cnt > T7_BUF_SZ) return MBCMD_EID_BADCNT; memcpy(t7_wbuf_data, t7_rbuf_data, cnt); bksndp(task, t7_wbuf_data, cnt); // echo back bkreqp(task, t7_rbuf_data, T7_BUF_SZ); return 0;}static Uns t7_rcv_tctl(struct dsptask *task, Uns ctlcmd){ switch(ctlcmd) { case MBCMD_TCTL_TINIT: memset(t7_rbuf_data, 0xbeef, T7_BUF_SZ); memset(t7_wbuf_data, 0xdead, T7_BUF_SZ); bkreqp(task, t7_rbuf_data, T7_BUF_SZ); return 0; default: return MBCMD_EID_BADTCTL; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -