00001 /* FreeEMS - the open source engine management system 00002 * 00003 * Copyright 2008, 2009 Fred Cooke 00004 * 00005 * This file is part of the FreeEMS project. 00006 * 00007 * FreeEMS software is free software: you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation, either version 3 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * FreeEMS software is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with any FreeEMS software. If not, see http://www.gnu.org/licenses/ 00019 * 00020 * We ask that if you make any changes to this file you email them upstream to 00021 * us at admin(at)diyefi(dot)org or, even better, fork the code on github.com! 00022 * 00023 * Thank you for choosing FreeEMS to run your engine! 00024 */ 00025 00026 00032 /* Header file multiple inclusion protection courtesy eclipse Header Template */ 00033 /* and http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/ C pre processor manual */ 00034 #ifndef FILE_INJECTION_ISRS_H_SEEN 00035 #define FILE_INJECTION_ISRS_H_SEEN 00036 00037 00038 #ifdef EXTERN 00039 #warning "EXTERN already defined by another header, please sort it out!" 00040 #undef EXTERN /* If fail on warning is off, remove the definition such that we can redefine correctly. */ 00041 #endif 00042 00043 00044 #ifdef INJECTIONISRS_C 00045 #define EXTERN 00046 #else 00047 #define EXTERN extern 00048 #endif 00049 00050 00051 /* Staged injector channel bit masks and registers */ 00052 00053 /* Use port K for staged injector output */ 00054 #define STAGEDPORT PORTK 00055 00056 /* Masks for setting and checking stagedOn status var and turning the channel on */ 00057 #define STAGED1ON BIT0 00058 #define STAGED2ON BIT1 00059 #define STAGED3ON BIT2 00060 #define STAGED4ON BIT3 00061 #define STAGED5ON BIT4 00062 #define STAGED6ON BIT5 00063 00064 /* Masks for unsetting stagedOn status var and turning the channel off */ 00065 #define STAGED1OFF NBIT0 00066 #define STAGED2OFF NBIT1 00067 #define STAGED3OFF NBIT2 00068 #define STAGED4OFF NBIT3 00069 #define STAGED5OFF NBIT4 00070 #define STAGED6OFF NBIT5 00071 00072 /* Internal use to decide if staged is actually required or not based on pulsewidth etc */ 00073 unsigned char stagedRequired; 00074 00075 00076 #undef EXTERN 00077 00078 00079 #else 00080 /* let us know if we are being untidy with headers */ 00081 #warning "Header file INJECTION_ISRS_H seen before, sort it out!" 00082 /* end of the wrapper ifdef from the very top */ 00083 #endif