⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p_clock.c

📁 RTEMS (Real-Time Executive for Multiprocessor Systems) is a free open source real-time operating sys
💻 C
字号:
/* *  Clock Tick interrupt conexion code. * *  COPYRIGHT (c) 1989-1997. *  On-Line Applications Research Corporation (OAR). * *  The license and distribution terms for this file may in *  the file LICENSE in this distribution or at *  http://www.rtems.com/license/LICENSE. * *  Modified to support the MPC750. *  Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr * *  $Id: p_clock.c,v 1.2.4.2 2003/09/04 18:45:08 joel Exp $ */#include <bsp.h>#include <rtems/bspIo.h>#include <bsp/irq.h>extern void clockOn(void*);extern void clockOff (void*);extern int clockIsOn(void*);extern void Clock_isr();static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,					      (rtems_irq_hdl)Clock_isr,					      (rtems_irq_enable)clockOn,					      (rtems_irq_disable)clockOff,					      (rtems_irq_is_enabled)clockIsOn};					      int BSP_get_clock_irq_level(){  /*   * Caution : if you change this, you must change the   * definition of BSP_PERIODIC_TIMER accordingly   */  return BSP_PERIODIC_TIMER;}int BSP_disconnect_clock_handler (void){  if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {     printk("Unable to stop system clock\n");    rtems_fatal_error_occurred(1);  }  return BSP_remove_rtems_irq_handler (&clockIrqData);}int BSP_connect_clock_handler (rtems_irq_hdl hdl){  if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {     printk("Unable to get system clock handler\n");    rtems_fatal_error_occurred(1);  }  if (!BSP_remove_rtems_irq_handler (&clockIrqData)) {   printk("Unable to remove current system clock handler\n");    rtems_fatal_error_occurred(1);  }  /*   * Reinit structure   */  clockIrqData.name = BSP_PERIODIC_TIMER;  clockIrqData.hdl = (rtems_irq_hdl) hdl;  clockIrqData.on = (rtems_irq_enable)clockOn;  clockIrqData.off = (rtems_irq_enable)clockOff;  clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn;  return BSP_install_rtems_irq_handler (&clockIrqData);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -