miscISRs.c File Reference

#include "inc/freeEMS.h"
#include "inc/interrupts.h"
#include "inc/miscISRs.h"

Include dependency graph for miscISRs.c:

Go to the source code of this file.

Functions

void UISR (void)
void PortPISR (void)
void PortJISR (void)
void PortHISR (void)
void IRQISR (void)
void XIRQISR (void)
void LowVoltageISR (void)


Function Documentation

void IRQISR ( void   ) 

Definition at line 157 of file miscISRs.c.

References Counters, and Counter::UISRCounter.

00157                  {
00158         /* Clear the flag */
00159         // ?? TODO
00160 
00161         /* Increment the unimplemnted ISR execution counter */
00162         Counters.UISRCounter++;
00163 }

void LowVoltageISR ( void   ) 

Definition at line 175 of file miscISRs.c.

References Counters, Counter::lowVoltISRCounter, and VREGCTRL.

00175                         {
00176         /* Clear the flag */
00177         VREGCTRL |= 0x01;
00178 
00179         /* Increment the counter */
00180         Counters.lowVoltISRCounter++;
00181 }

void PortHISR ( void   ) 

Definition at line 50 of file miscISRs.c.

References ONES, PIFH, PORTA, and portHDebounce.

00051 {
00052 //      // read the interrupt flags to a variable
00053 //      unsigned char portHFlags = PIFH;
00054 //      portHFlags &= 0xF8; // mask out the other bits
00055 //
00056 //      /* Clear all port H flags (we only want one at a time) */
00057         PIFH = ONES;
00058 //
00059 //      // Toggle a LED so we can see if the code ran
00060         PORTA ^= 0x80; // Fuel pump pin (A7)
00061 //
00062         // debounce
00063         if(portHDebounce == 0){
00064                 portHDebounce = 2;
00065         }else{
00066                 return;
00067         }
00068 //
00069 //      // find out which pin triggered it, clear the flag, perform the action.
00070 //      switch(portHFlags)
00071 //      {
00072 //      case 0x80 :     // Increment cylinder count and set port count appropriately.
00073 //              switch (configs.combustionEventsPerEngineCycle) {
00074 //                      case 1 :
00075 //                              configs.combustionEventsPerEngineCycle = 2;
00076 //                              configs.ports = 2;
00077 //                              break;
00078 //                      case 2 :
00079 //                              configs.combustionEventsPerEngineCycle = 3;
00080 //                              configs.ports = 3;
00081 //                              break;
00082 //                      case 3 :
00083 //                              configs.combustionEventsPerEngineCycle = 4;
00084 //                              configs.ports = 4;
00085 //                              break;
00086 //                      case 4 :
00087 //                              configs.combustionEventsPerEngineCycle = 5;
00088 //                              configs.ports = 5;
00089 //                              break;
00090 //                      case 5 :
00091 //                              configs.combustionEventsPerEngineCycle = 6;
00092 //                              configs.ports = 6;
00093 //                              break;
00094 //                      case 6 :
00095 //                              configs.combustionEventsPerEngineCycle = 8;
00096 //                              configs.ports = 4;
00097 //                              break;
00098 //                      case 8 :
00099 //                              configs.combustionEventsPerEngineCycle = 10;
00100 //                              configs.ports = 5;
00101 //                              break;
00102 //                      case 10 :
00103 //                              configs.combustionEventsPerEngineCycle = 12;
00104 //                              configs.ports = 6;
00105 //                              break;
00106 //                      case 12 :
00107 //                              configs.combustionEventsPerEngineCycle = 1;
00108 //                              configs.ports = 1;
00109 //                              break;
00110 //              }
00111 //              break;
00112 //      case 0x40 : // Injection output enable/disable
00113 //              if(coreSettingsA & FUEL_CUT){
00114 //                      coreSettingsA &= FUEL_CUT_OFF;
00115 //              }else{
00116 //                      coreSettingsA |= FUEL_CUT;
00117 //              }
00118 //              break;
00119 //      case 0x20 : // Ignition output enable/disable
00120 //              if(coreSettingsA & HARD_SPARK_CUT){
00121 //                      coreSettingsA &= HARD_SPARK_CUT_OFF;
00122 //              }else{
00123 //                      coreSettingsA |= HARD_SPARK_CUT;
00124 //              }
00125 //              break;
00126 //      case 0x10 : // Staged injection enable/disable
00127 //              if(coreSettingsA & STAGED_ON){
00128 //                      coreSettingsA &= STAGED_OFF;
00129 //              }else{
00130 //                      coreSettingsA |= STAGED_ON;
00131 //              }
00132 //              break;
00133 //      case 0x08 : // Staged injection start sched/fixed
00134 //              if(coreSettingsA & STAGED_START){
00135 //                      coreSettingsA &= CLEAR_STAGED_START;
00136 //              }else{
00137 //                      coreSettingsA |= STAGED_START;
00138 //              }
00139 //              break;
00140 //      case 0x04 : // Staged injection end sched/fixed
00141 //              if(coreSettingsA & STAGED_END){
00142 //                      coreSettingsA &= CLEAR_STAGED_END;
00143 //              }else{
00144 //                      coreSettingsA |= STAGED_END;
00145 //              }
00146 //              break;
00147 //      case 0x02 : // free input
00148 //              break;
00149 //      case 0x01 : // free input
00150 //              break;
00151 //      default : // Two or more pressed, nothing to do except wait for another button press
00152 //              break;
00153 //      }
00154 }

void PortJISR ( void   ) 

Definition at line 42 of file miscISRs.c.

References Counters, ONES, PIFJ, and Counter::UISRCounter.

00042                    {
00043         /* Clear all port H flags (we only want one at a time) */
00044         PIFJ = ONES;
00045         /* Increment the unimplemnted ISR execution counter */
00046         Counters.UISRCounter++;
00047 }

void PortPISR ( void   ) 

Definition at line 34 of file miscISRs.c.

References Counters, ONES, PIFP, and Counter::UISRCounter.

00034                    {
00035         /* Clear all port P flags (we only want one at a time) */
00036         PIFP = ONES;
00037         /* Increment the unimplemnted ISR execution counter */
00038         Counters.UISRCounter++;
00039 }                       /* Port P interrupt service routine */

void UISR ( void   ) 

Definition at line 29 of file miscISRs.c.

References Counters, and Counter::UISRCounter.

00029                {
00030         /* Increment the unimplemnted ISR execution counter */
00031         Counters.UISRCounter++;
00032 }

void XIRQISR ( void   ) 

Definition at line 166 of file miscISRs.c.

References Counters, and Counter::UISRCounter.

00166                   {
00167         /* Clear the flag */
00168         // ?? TODO
00169 
00170         /* Increment the unimplemnted ISR execution counter */
00171         Counters.UISRCounter++;
00172 }


Generated on Mon Nov 10 21:19:13 2008 for freeems by  doxygen 1.5.2