📄 port_clock.c
字号:
/* * iRTOS * Copyright (C) 2008 Dmitriy Cherepanov * * This file is part of iRTOS * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public either * version 2.1 of the License, or (at your option) any later version. * This source 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 * Lesser General Public License for more details. * * Do not be lasy! For the latest version see http://irtos.sourceforge.net . */#include "iRTOS.h"#include "kernel/clock.h"#include "kernel/thread.h"#include "port_clock.h"#include "port_os.h"#include <avr/io.h>/** \addtogroup xgportAVRAt mega 128 Clock prescalersCSn2 CSn1 CSn0 Description0 0 0 No clock source. (Timer/Counter stopped)0 0 1 clkI/O/1 (No prescaling0 1 0 clkI/O/8 (From prescaler)0 1 1 clkI/O/64 (From prescaler)1 0 0 clkI/O/256 (From prescaler)1 0 1 clkI/O/1024 (From prescaler)1 1 0 External clock source on Tn pin. Clock on falling edge1 1 1 External clock source on Tn pin. Clock on rising edge*/#if (iZERO_CLOCK_DIV == portZERO_CLOCK_DIV0)#warning Timer Clock Sourse Undefined#define portZERO_CLOCK_CSN 0#endif#if (iZERO_CLOCK_DIV == portZERO_CLOCK_DIV0)#define portZERO_CLOCK_CSN 1#endif#if (iZERO_CLOCK_DIV == portZERO_CLOCK_DIV8)#define portZERO_CLOCK_CSN 2#endif#if (iZERO_CLOCK_DIV == portZERO_CLOCK_DIV64)#define portZERO_CLOCK_CSN 3#endif#if (iZERO_CLOCK_DIV == portZERO_CLOCK_DIV256)#define portZERO_CLOCK_CSN 4#endif#if (iZERO_CLOCK_DIV == portZERO_CLOCK_DIV1024)#define portZERO_CLOCK_CSN 5#endif#if (iZERO_CLOCK_DIV == portZERO_CLOCK_DIV1024)#define portZERO_CLOCK_CSN 5#endif#ifdef portZERO_CLOCK_Ext_clk_src_faling_edge#define portZERO_CLOCK_CSN 6#warning External clock source on Tn pin. Clock on falling edge#endif#ifdef portZERO_CLOCK_Ext_clk_src_faling_edge#warning External clock source on Tn pin. Clock on rising edge#define portZERO_CLOCK_CSN 7#endif//#include "kernel/variables.h" /*------ Varables defined in varaibles.h------------------------------------*///volatile iClockFull current_time;/*----------------------------------------------------------------------------*//** \file *\if russian_lng * 泽黻鲨
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -