?? wdt.c
字號:
/* * dspapps/dsp/task_testB/wdt.c * * DSP Watchdog timer module * * Copyright (C) 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: wdt.c * $Revision: 2.0 * $Date: 2003/11/11 * */#include <std.h>#include "omap1510.h"#include "mailbox.h"#include "tokliBIOSlib.h"#define __wdt_start() \ do {\ outw(inw(_CNTL_TIMER) | _CNTL_TIMER_BIT_ST,\ _CNTL_TIMER);\ } while(0)#define __wdt_stop() \ do {\ outw(inw(_CNTL_TIMER) & ~_CNTL_TIMER_BIT_ST,\ _CNTL_TIMER);\ } while(0)/* * WDT configuration (timer mode) */Void init_wdt(Void){ // Enable WDT clock outw(inw(_DSP_IDLECT2) | _DSP_IDLECT2_BIT_EN_WDTCK, _DSP_IDLECT2); // Start WDT with autoreload mode, expires in 19.57s. outw(0xFFFF, _LOAD_TIM); outw((inw(_CNTL_TIMER) & ~_CNTL_TIMER_BIT_PTV_MASK) | _CNTL_TIMER_BIT_AR | _CNTL_TIMER_BIT_PTV(7) | _CNTL_TIMER_BIT_ST, _CNTL_TIMER); // Enable Interrupt *_IER0 |= _IER0_BIT_WDGTIMER;}Void wdt_reflesh(Void){ Uns intm_saved; intm_saved = HWI_disable(); __wdt_start(); __wdt_stop(); HWI_restore(intm_saved);}Void wdt_start(Void){ __wdt_start();}Void wdt_stop(Void){ __wdt_stop();}Void wdt_handle(Void){ mbsend(mbcmd(MBCMD_WDT,0),0x0a21); // "!\n"}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -