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 203 of file miscISRs.c.

References Counter::callsToUISRs, and Counters.

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

void LowVoltageISR ( void   ) 

Low Voltage Counter.

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

Author:
Fred Cooke

Definition at line 233 of file miscISRs.c.

References Counters, Counter::lowVoltageConditions, and VREGCTRL.

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

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 90 of file miscISRs.c.

References ONES, PIFH, PORTA, and portHDebounce.

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

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 76 of file miscISRs.c.

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

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

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 62 of file miscISRs.c.

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

00062                    {
00063     /* Clear all port P flags (we only want one at a time) */
00064     PIFP = ONES;
00065     /* Increment the unimplemented ISR execution counter */
00066     Counters.callsToUISRs++;
00067 }           /* 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 50 of file miscISRs.c.

References Counter::callsToUISRs, and Counters.

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

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 218 of file miscISRs.c.

References Counter::callsToUISRs, and Counters.

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

Generated on Sat Oct 16 21:29:19 2010 for FreeEMS by  doxygen 1.6.3