?? board.c
字號:
/* * File : board.c * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://openlab.rt-thread.com/license/LICENSE * * Change Logs: * Date Author Notes * 2006-03-24 Bernard first implementation * 2006-05-05 Bernard add DATA_COUNT definition */#include <rtthread.h>#include <rthw.h>#include <s3c4510.h>#define DATA_COUNT 0x7a120/** * @addtogroup lumit4510 *//*@{*/void rt_timer_handler(int vector){ /* reset TDATA0 */ TDATA0 = DATA_COUNT; rt_tick_increase();}/** * This function will initialize lumit4510 board */void rt_hw_board_init(){ /* set timer0 register */ TDATA0 = DATA_COUNT; TCNT0 = 0x0; TMOD = 0x3; /* install interrupt handler */ rt_hw_interrupt_install(INTTIMER0, rt_timer_handler, RT_NULL); rt_hw_interrupt_umask(INTTIMER0);}/** * This function will set led status. * @param led the led status */void rt_hw_led_set(rt_uint32_t led){ IOPDATA = 1 << led;}void rt_hw_led_flash(void){ int i; rt_hw_led_set(4); for ( i = 0; i < 2000000; i++); rt_hw_led_set(5); for ( i = 0; i < 2000000; i++); rt_hw_led_set(6); for ( i = 0; i < 2000000; i++); rt_hw_led_set(17); for ( i = 0; i < 2000000; i++);}#ifdef RT_USING_FINSHextern void finsh_notify(void);void rt_serial_isr(int vector){ finsh_notify();}void rt_hw_finsh_init(){ /* install UART isr */ rt_hw_interrupt_install(INTUART0_RX, rt_serial_isr, RT_NULL); rt_hw_interrupt_umask(INTUART0_RX);}#endif/*@}*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -