MakingThings
  • Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

fasttimer_internal.h

00001 /*********************************************************************************
00002 
00003  Copyright 2006-2008 MakingThings
00004 
00005  Licensed under the Apache License, 
00006  Version 2.0 (the "License"); you may not use this file except in compliance 
00007  with the License. You may obtain a copy of the License at
00008 
00009  http://www.apache.org/licenses/LICENSE-2.0 
00010  
00011  Unless required by applicable law or agreed to in writing, software distributed
00012  under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
00013  CONDITIONS OF ANY KIND, either express or implied. See the License for
00014  the specific language governing permissions and limitations under the License.
00015 
00016 *********************************************************************************/
00017 
00018 /*
00019   timer_internal.h
00020 
00021   timer Internal headers
00022 
00023   MakingThings
00024 */
00025 
00026 #ifndef FASTTIMER_INTERNAL_H
00027 #define FASTTIMER_INTERNAL_H
00028 
00029 #include "io.h"
00030 
00031 // Uncomment this to put a pulse out on the specified input when the FastIRQ routine is running
00032 // Note that this make timing a bit more rough
00033 // #define FASTIRQ_MONITOR_IO IO_PA04
00034 // Uncomment this to track some stats
00035 // #define FASTIRQ_STATS      1
00036 
00037 #include "types.h"
00038 
00039 #define FASTTIMER_COUNT 8
00040 #define FASTTIMER_MARGIN 2
00041 #define FASTTIMER_MAXCOUNT 0xFF00
00042 #define FASTTIMER_MINCOUNT 20
00043 
00044 struct FastTimer_
00045 {
00046   char users;
00047   short count;
00048 
00049   int jitterTotal;
00050   int jitterMax;
00051   int jitterMaxAllDay;
00052 
00053   int durationTotal;
00054   int durationMax;
00055   int durationMaxAllDay;
00056 
00057   char running;
00058   char servicing;
00059 
00060   int nextTime;
00061   int temp;
00062   
00063   FastTimerEntry* first;
00064   FastTimerEntry* next;
00065   FastTimerEntry* previous;
00066   FastTimerEntry* lastAdded;
00067 };
00068 
00069 #endif

The Make Controller Kit is an open source project maintained by MakingThings.
MakingThings code is released under the Apache 2.0 license.
Bug tracker, development wiki and status can be found at http://dev.makingthings.com.
This document was last updated on 18 May 2009.