plat_clock.h

来自「MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis」· C头文件 代码 · 共 85 行

H
85
字号
//  This file is part of MANTIS OS, Operating System for Nymph.//  See http://mantis.cs.colorado.edu/////  Copyright (C) 2003 University of Colorado, Boulder////  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//  (See http://www.gnu.org/copyleft/gpl.html)//  along with this program; if not, write to the Free Software//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,//  USA, or send email to help@mantis.cs.colorado.edu./** @file plat_clock.h * @brief A few defines for clock speeds, used for timing. * *  */#ifndef __PLAT_CLOCK_H__#define __PLAT_CLOCK_H__/** @file avr/include/plat_clock.h * @brief Defines for clock speeds specific to the AVR architecture * */#ifdef CLOCK_SPEED_7_37//a few defines which make calculations easier....#define CLOCK_SPEED      (uint32_t)7372800#endif#ifdef CLOCK_SPEED_3_68#define CLOCK_SPEED      (uint32_t)3686400#endif#ifdef CLOCK_SPEED_4_0#define CLOCK_SPEED      (uint32_t)4000000#endif#define CLOCK_SPEED_0    CLOCK_SPEED //no prescaling#define CLOCK_SPEED_8    (CLOCK_SPEED /    (uint32_t)8)#define CLOCK_SPEED_32   (CLOCK_SPEED /   (uint32_t)32)#define CLOCK_SPEED_64   (CLOCK_SPEED /   (uint32_t)64)#define CLOCK_SPEED_128  (CLOCK_SPEED /  (uint32_t)128)#define CLOCK_SPEED_256  (CLOCK_SPEED /  (uint32_t)256)#define CLOCK_SPEED_1024 (CLOCK_SPEED /  (uint32_t)1024)#define EXT_CLOCK      32768#define EXT_CLOCK_0    EXT_CLOCK //no prescaling#define EXT_CLOCK_8    (EXT_CLOCK /    8)#define EXT_CLOCK_32   (EXT_CLOCK /   32)#define EXT_CLOCK_64   (EXT_CLOCK /   64)#define EXT_CLOCK_128  (EXT_CLOCK /  128)#define EXT_CLOCK_256  (EXT_CLOCK /  256)#define EXT_CLOCK_1024 (EXT_CLOCK / 1024)#ifdef CLOCK_SPEED_7_37#define TIMESLICE_20_MS 144 // value of OCR at 1024 prescaler for 20ms timeslice//#define TIMESLICE_20_MS 216 // 30 ms//#define TIMESLICE_20_MS 72 // 10 ms//#define TIMESLICE_20_MS 288 // 40 ms//#define TIMESLICE_20_MS 360 // 50 ms#else#  ifdef CLOCK_SPEED_3_68#define TIMESLICE_20_MS 72#  else#  ifdef CLOCK_SPEED_4_0#define TIMESLICE_20_MS 80#  else#     error "Timeslice not defined for clock. (msched.c)"#  endif#endif#endif#endif

⌨️ 快捷键说明

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