?? task_test2.c
字號:
/* * dspapps/dsp/task_testB/task_test2.c * * DSP task example: block send / block receive * * 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_test2.c * $Revision: 2.0 * $Date: 2003/11/11 * */#include <std.h>#include "mailbox.h"#include "tokliBIOS.h"static Uns t2_rcv_bksnd(struct dsptask *task, Uns bid, Uns cnt);static Uns t2_rcv_bkreq(struct dsptask *task, Uns cnt);struct task_t2 { struct dsptask task_head; Uns bkdata[128];};struct task_t2 task_test2 = { { TID_MAGIC, // tid "test2", // name MBCMD_TTYP_BKDM | MBCMD_TTYP_BKMD, // ttyp: passive block snd, passive block rcv t2_rcv_bksnd, // rcv_snd t2_rcv_bkreq, // rcv_req NULL, // rcv_tctl NULL // tsk_attrs },};static Uns t2_rcv_bksnd(struct dsptask *task, Uns bid, Uns cnt){ struct task_t2 *task_t2 = (struct task_t2*)task; memcpy(task_t2->bkdata, ipbuf_d[bid], cnt); unuse_ipbuf(task, bid); return 0;}static Uns t2_rcv_bkreq(struct dsptask *task, Uns cnt){ struct task_t2 *task_t2 = (struct task_t2*)task; Uns bid; bid = get_free_ipbuf(task); if(bid == MBCMD_BID_NULL) return MBCMD_EID_STVBUF; memcpy(ipbuf_d[bid], task_t2->bkdata, cnt); bksnd(task, bid, cnt); return 0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -