tkdev_init.c
来自「uT Kernel os source code for AT91」· C语言 代码 · 共 61 行
C
61 行
/* *---------------------------------------------------------------------- * micro T-Kernel * * Copyright (C) 2006-2007 by Ken Sakamura. All rights reserved. * micro T-Kernel is distributed under the micro T-License. *---------------------------------------------------------------------- * * Version: 1.00.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2007/03/26. * *---------------------------------------------------------------------- *//* * tkdev_init.c (H8S2212) * micro T-Kernel Device-Dependent Initialization/Finalization */#include "kernel.h"#include <tk/sysdef.h>#include <tk/syslib.h>#include <tm/tmonitor.h>EXPORT UW knl_TimerClkDiv; /* Dividing rate of timer clock *//* * Target system-dependent initialization */EXPORT ER knl_tkdev_initialize( void ){ /* port settings */ *((UB*)PB_PCR) = 0x00U; *((UB*)PB_DR) = 0x85U; *((UB*)PB_DDR) = 0xFBU; *((UB*)MSTP_CRA) |= (1U << 6); /* DMA controller */ *((UB*)EXMDLSTP) |= (1U << 1); /* RTC */ *((UB*)EXMDLSTP) |= (1U << 0); /* USB */ return E_OK;}#if USE_CLEANUP/* * Target system-dependent finalization * No return from this function. */EXPORT void knl_tkdev_exit( void ){ disint(); tm_exit(0); /* Turn off power and exit */ /* Not suppose to return from 'tm_exit,' but just in case */ for ( ;; ) { tm_monitor(); /* To T-Monitor equivalent function */ }}#endif /* USE_CLEANUP */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?