miscISRs.c File Reference

Miscellaneous Interrupt Handlers. More...

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

Include dependency graph for miscISRs.c:

Go to the source code of this file.

Functions

void UISR (void)
 Unimplemented Interrupt Handler.
void PortPISR (void)
 Port P pins ISR.
void PortJISR (void)
 Port J pins ISR.
void PortHISR (void)
 Port H pins ISR.
void IRQISR (void)
 IRQ/PE1 pin ISR.
void XIRQISR (void)
 XIRQ/PE0 pin ISR.
void LowVoltageISR (void)
 Low Voltage Counter.


Detailed Description

Miscellaneous Interrupt Handlers.

Various non-descript interrupt handlers that don't really fit anywhere else and aren't big enough to live on their own just yet.

Author:
Fred Cooke

Definition in file miscISRs.c.


Function Documentation

void IRQISR ( void   ) 

IRQ/PE1 pin ISR.

Interrupt handler for edge events on the IRQ/PE1 pin. Not currently used.

Author:
Fred Cooke

Definition at line 202 of file miscISRs.c.

References Counter::callsToUISRs, and Counters.

00202                  {
00203     /* Clear the flag */
00204     // ?? TODO
00205 
00206     /* Increment the unimplemented ISR execution counter */
00207     Counters.callsToUISRs++;
00208 }

void LowVoltageISR ( void   ) 

Low Voltage Counter.

Count how often our voltage drops lower than it should without resetting.

Author:
Fred Cooke

Definition at line 232 of file miscISRs.c.

References Counters, Counter::lowVoltageConditions, and VREGCTRL.

00232                         {
00233     /* Clear the flag */
00234     VREGCTRL |= 0x01;
00235 
00236     /* Increment the counter */
00237     Counters.lowVoltageConditions++;
00238 }

void PortHISR ( void   ) 

Port H pins ISR.

Interrupt handler for edge events on port H pins. Not currently used.

Author:
Fred Cooke

Definition at line 89 of file miscISRs.c.

References ONES, PIFH, PORTA, and portHDebounce.

00090 {
00091 //  // read the interrupt flags to a variable
00092 //  unsigned char portHFlags = PIFH;
00093 //  portHFlags &= 0xF8; // mask out the other bits
00094 //
00095 //  /* Clear all port H flags (we only want one at a time) */
00096     PIFH = ONES;
00097 //
00098 //  // Toggle a LED so we can see if the code ran
00099     PORTA ^= 0x80; // Fuel pump pin (A7)
00100 //
00101     // debounce
00102     if(portHDebounce == 0){
00103         portHDebounce = 2;
00104     }else{
00105         return;
00106     }
00107 //
00108 //  // find out which pin triggered it, clear the flag, perform the action.
00109 //  switch(portHFlags)
00110 //  {
00111 //  case 0x80 : // Increment cylinder count and set port count appropriately.
00112 //      switch (configs.combustionEventsPerEngineCycle) {
00113 //          case 1 :
00114 //              configs.combustionEventsPerEngineCycle = 2;
00115 //              configs.ports = 2;
00116 //              break;
00117 //          case 2 :
00118 //              configs.combustionEventsPerEngineCycle = 3;
00119 //              configs.ports = 3;
00120 //              break;
00121 //          case 3 :
00122 //              configs.combustionEventsPerEngineCycle = 4;
00123 //              configs.ports = 4;
00124 //              break;
00125 //          case 4 :
00126 //              configs.combustionEventsPerEngineCycle = 5;
00127 //              configs.ports = 5;
00128 //              break;
00129 //          case 5 :
00130 //              configs.combustionEventsPerEngineCycle = 6;
00131 //              configs.ports = 6;
00132 //              break;
00133 //          case 6 :
00134 //              configs.combustionEventsPerEngineCycle = 8;
00135 //              configs.ports = 4;
00136 //              break;
00137 //          case 8 :
00138 //              configs.combustionEventsPerEngineCycle = 10;
00139 //              configs.ports = 5;
00140 //              break;
00141 //          case 10 :
00142 //              configs.combustionEventsPerEngineCycle = 12;
00143 //              configs.ports = 6;
00144 //              break;
00145 //          case 12 :
00146 //              configs.combustionEventsPerEngineCycle = 1;
00147 //              configs.ports = 1;
00148 //              break;
00149 //      }
00150 //      break;
00151 //  case 0x40 : // Injection output enable/disable
00152 //      if(coreSettingsA & FUEL_CUT){
00153 //          coreSettingsA &= FUEL_CUT_OFF;
00154 //      }else{
00155 //          coreSettingsA |= FUEL_CUT;
00156 //      }
00157 //      break;
00158 //  case 0x20 : // Ignition output enable/disable
00159 //      if(coreSettingsA & HARD_SPARK_CUT){
00160 //          coreSettingsA &= HARD_SPARK_CUT_OFF;
00161 //      }else{
00162 //          coreSettingsA |= HARD_SPARK_CUT;
00163 //      }
00164 //      break;
00165 //  case 0x10 : // Staged injection enable/disable
00166 //      if(coreSettingsA & STAGED_ON){
00167 //          coreSettingsA &= STAGED_OFF;
00168 //      }else{
00169 //          coreSettingsA |= STAGED_ON;
00170 //      }
00171 //      break;
00172 //  case 0x08 : // Staged injection start sched/fixed
00173 //      if(coreSettingsA & STAGED_START){
00174 //          coreSettingsA &= CLEAR_STAGED_START;
00175 //      }else{
00176 //          coreSettingsA |= STAGED_START;
00177 //      }
00178 //      break;
00179 //  case 0x04 : // Staged injection end sched/fixed
00180 //      if(coreSettingsA & STAGED_END){
00181 //          coreSettingsA &= CLEAR_STAGED_END;
00182 //      }else{
00183 //          coreSettingsA |= STAGED_END;
00184 //      }
00185 //      break;
00186 //  case 0x02 : // free input
00187 //      break;
00188 //  case 0x01 : // free input
00189 //      break;
00190 //  default : // Two or more pressed, nothing to do except wait for another button press
00191 //      break;
00192 //  }
00193 }

void PortJISR ( void   ) 

Port J pins ISR.

Interrupt handler for edge events on port J pins. Not currently used.

Author:
Fred Cooke

Definition at line 75 of file miscISRs.c.

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

00075                    {
00076     /* Clear all port H flags (we only want one at a time) */
00077     PIFJ = ONES;
00078     /* Increment the unimplemented ISR execution counter */
00079     Counters.callsToUISRs++;
00080 }

void PortPISR ( void   ) 

Port P pins ISR.

Interrupt handler for edge events on port P pins. Not currently used.

Author:
Fred Cooke

Definition at line 61 of file miscISRs.c.

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

00061                    {
00062     /* Clear all port P flags (we only want one at a time) */
00063     PIFP = ONES;
00064     /* Increment the unimplemented ISR execution counter */
00065     Counters.callsToUISRs++;
00066 }           /* Port P interrupt service routine */

void UISR ( void   ) 

Unimplemented Interrupt Handler.

Unimplemented interrupt service routine for calls we weren't expecting. Currently this simply counts bad calls like any other event type.

Author:
Fred Cooke

Definition at line 49 of file miscISRs.c.

References Counter::callsToUISRs, and Counters.

00049                {
00050     /* Increment the unimplemented ISR execution counter */
00051     Counters.callsToUISRs++;
00052 }

void XIRQISR ( void   ) 

XIRQ/PE0 pin ISR.

Interrupt handler for edge events on the XIRQ/PE0 pin. Not currently used.

Author:
Fred Cooke

Definition at line 217 of file miscISRs.c.

References Counter::callsToUISRs, and Counters.

00217                   {
00218     /* Clear the flag */
00219     // ?? TODO
00220 
00221     /* Increment the unimplemented ISR execution counter */
00222     Counters.callsToUISRs++;
00223 }


Generated on Mon Jan 26 00:17:11 2009 for FreeEMS by  doxygen 1.5.8