Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -rb948375777d4eb9c766befdcfde1e717a37977a8 -r9d4666bf3064df18a6d935125d7a69e4e8234e84 --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision b948375777d4eb9c766befdcfde1e717a37977a8) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 9d4666bf3064df18a6d935125d7a69e4e8234e84) @@ -17,12 +17,16 @@ #include #include "can.h" +#include "het.h" #include "rti.h" #include "sci.h" #include "sys_dma.h" #include "AlarmMgmt.h" +#include "BloodFlow.h" #include "Comm.h" +#include "DialInFlow.h" +#include "DialOutFlow.h" #include "Interrupts.h" #include "FPGA.h" #include "SystemComm.h" @@ -35,6 +39,9 @@ // ********** private definitions ********** +#define HET1_EDGE_BP_ROTOR_HALL_SENSOR 0 +#define HET1_EDGE_DPI_ROTOR_HALL_SENSOR 1 +#define HET1_EDGE_DPO_ROTOR_HALL_SENSOR 2 // ********** private data ********** @@ -301,3 +308,37 @@ } } +/************************************************************************* + * @brief + * The edgeNotification function handles rotor hall sensor interrupts. + * @details + * Inputs : none + * Outputs : Rotor hall sensor interrupt is handled according to pin associated with given edge. + * @param hetREG : HET controller associated with the edge. + * @param edge : Which edge was detected. + * @return none + *************************************************************************/ +void edgeNotification(hetBASE_t * hetREG, uint32 edge) +{ + if ( hetREG == hetREG1 ) + { + switch ( edge ) + { + case HET1_EDGE_BP_ROTOR_HALL_SENSOR: + signalBloodPumpRotorHallSensor(); + break; + + case HET1_EDGE_DPI_ROTOR_HALL_SENSOR: + //signalDialInPumpRotorHallSensor(); + break; + + case HET1_EDGE_DPO_ROTOR_HALL_SENSOR: + //signalDialOutPumpRotorHallSensor(); + break; + + default: + // TODO - ignore? + break; + } + } +}