Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -rd3e3e25740d545eb958a595e87fa3034633e7392 -rade19b8aa4c3b60cdda4028871ef009b01368948 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision d3e3e25740d545eb958a595e87fa3034633e7392) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision ade19b8aa4c3b60cdda4028871ef009b01368948) @@ -588,7 +588,7 @@ /*********************************************************************//** * @brief setDialOutPumpDirection - * The setDialOutPumpDirection function sets the set dialIn pump direction to \n + * The setDialOutPumpDirection function sets the set dialOut pump direction to \n * the given direction. * @details * Inputs : none @@ -1047,11 +1047,11 @@ /*********************************************************************//** * @brief * The testSetMeasuredDialOutPumpRotorSpeedOverride function overrides the measured \n - * dialIn pump rotor speed. \n + * dialOut pump rotor speed. \n * @details * Inputs : DialOutPumpRotorSpeedRPM * Outputs : DialOutPumpRotorSpeedRPM - * @param value : override measured dialIn pump rotor speed (in RPM) + * @param value : override measured dialOut pump rotor speed (in RPM) * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetMeasuredDialOutPumpRotorSpeedOverride( F32 value ) @@ -1071,7 +1071,7 @@ /*********************************************************************//** * @brief * The testResetMeasuredDialOutPumpRotorSpeedOverride function resets the override of the \n - * measured dialIn pump rotor speed. + * measured dialOut pump rotor speed. * @details * Inputs : DialOutPumpRotorSpeedRPM * Outputs : DialOutPumpRotorSpeedRPM @@ -1094,11 +1094,11 @@ /*********************************************************************//** * @brief * The testSetMeasuredDialOutPumpSpeedOverride function overrides the measured \n - * dialIn pump motor speed. \n + * dialOut pump motor speed. \n * @details * Inputs : dialOutPumpSpeedRPM * Outputs : dialOutPumpSpeedRPM - * @param value : override measured dialIn pump motor speed (in RPM) + * @param value : override measured dialOut pump motor speed (in RPM) * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetMeasuredDialOutPumpSpeedOverride( F32 value ) @@ -1118,7 +1118,7 @@ /*********************************************************************//** * @brief * The testResetMeasuredDialOutPumpSpeedOverride function resets the override of the \n - * measured dialIn pump motor speed. + * measured dialOut pump motor speed. * @details * Inputs : dialOutPumpSpeedRPM * Outputs : dialOutPumpSpeedRPM @@ -1141,11 +1141,11 @@ /*********************************************************************//** * @brief * The testSetMeasuredDialOutPumpMCSpeedOverride function overrides the measured \n - * dialIn pump motor speed. + * dialOut pump motor speed. * @details * Inputs : dialOutPumpMCSpeedRPM * Outputs : dialOutPumpMCSpeedRPM - * @param value : override measured dialIn pump speed (in RPM) + * @param value : override measured dialOut pump speed (in RPM) * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetMeasuredDialOutPumpMCSpeedOverride( F32 value ) @@ -1165,7 +1165,7 @@ /*********************************************************************//** * @brief * The testResetMeasuredDialOutPumpMCSpeedOverride function resets the override of the \n - * measured dialIn pump motor speed. + * measured dialOut pump motor speed. * @details * Inputs : dialOutPumpMCSpeedRPM * Outputs : dialOutPumpMCSpeedRPM Index: firmware/App/HDCommon.h =================================================================== diff -u -r744b177ec4114c62303e976aed1677b820f7a281 -rade19b8aa4c3b60cdda4028871ef009b01368948 --- firmware/App/HDCommon.h (.../HDCommon.h) (revision 744b177ec4114c62303e976aed1677b820f7a281) +++ firmware/App/HDCommon.h (.../HDCommon.h) (revision ade19b8aa4c3b60cdda4028871ef009b01368948) @@ -29,7 +29,7 @@ #ifndef _VECTORCAST_ // #define RM46_EVAL_BOARD_TARGET 1 - #define BREADBOARD_TARGET 1 +// #define BREADBOARD_TARGET 1 // #define SIMULATE_UI 1 #define DISABLE_CRC_ERROR 1 #define DISABLE_MOTOR_CURRENT_ERRORS 1 Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r7478d513d7493d08484a880f5cd6c296c9616e70 -rade19b8aa4c3b60cdda4028871ef009b01368948 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 7478d513d7493d08484a880f5cd6c296c9616e70) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision ade19b8aa4c3b60cdda4028871ef009b01368948) @@ -139,7 +139,11 @@ setDialysateFlowRate = dPFlow; maxUFVolumeML = maxUFVol; setUFRate = uFRate; - // TODO - if performing dialysis now, set new pump rates immediately + + setBloodPumpTargetFlowRate( setBloodFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); // TODO - test code - remove later + setDialInPumpTargetFlowRate( setDialysateFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); +// setBloodPumpTargetFlowRate( setBloodFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); // TODO - restore these later +// setDialInPumpTargetFlowRate( setDialysateFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); } /*********************************************************************//** Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -rd3e3e25740d545eb958a595e87fa3034633e7392 -rade19b8aa4c3b60cdda4028871ef009b01368948 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision d3e3e25740d545eb958a595e87fa3034633e7392) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision ade19b8aa4c3b60cdda4028871ef009b01368948) @@ -100,7 +100,7 @@ treatmentTimeMS = 0; lastTreatmentTimeStamp = 0; treatmentTimeBroadcastTimerCtr = 0; - treatmentParamsRangesBroadcastTimerCtr = 0; + treatmentParamsRangesBroadcastTimerCtr = TREATMENT_SETTINGS_RANGES_PUB_INTERVAL; // so we send ranges immediately presTreatmentTimeSecs = 0; presBloodFlowRate = 0; Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -r9b262ba08e3180f121c3cf19d8d25e565183f87d -rade19b8aa4c3b60cdda4028871ef009b01368948 --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 9b262ba08e3180f121c3cf19d8d25e565183f87d) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision ade19b8aa4c3b60cdda4028871ef009b01368948) @@ -16,6 +16,7 @@ **************************************************************************/ #include "can.h" +#include "rti.h" #include "sci.h" #include "sys_dma.h" @@ -24,6 +25,9 @@ #include "Interrupts.h" #include "FPGA.h" #include "SystemComm.h" +#include "TaskGeneral.h" +#include "TaskPriority.h" +#include "TaskTimer.h" #ifdef DEBUG_ENABLED #include "SystemCommMessages.h" #endif @@ -49,7 +53,7 @@ /************************************************************************* - * @brief phantomInterrupt + * @brief * The phantomInterrupt function handles phantom interrupts. * @details * Inputs : none @@ -63,7 +67,42 @@ } /************************************************************************* - * @brief canMessageNotification + * @brief + * The rtiNotification function handles real-time interrupt notifications. + * @details + * Inputs : none + * Outputs : RTI notification handled. + * @param notification : Which RTI timer caused this interrupt. + * @return none + *************************************************************************/ +void rtiNotification(uint32 notification) +{ + switch ( notification ) + { + case rtiNOTIFICATION_COMPARE0: + taskTimer(); + break; + + case rtiNOTIFICATION_COMPARE1: + taskPriority(); + break; + + case rtiNOTIFICATION_COMPARE2: + // do nothing - unused at this time + break; + + case rtiNOTIFICATION_COMPARE3: + taskGeneral(); + break; + + default: + // TODO - s/w fault? + break; + } +} + +/************************************************************************* + * @brief * The canMessageNotification function handles CAN message notifications. * @details * Inputs : none @@ -81,7 +120,7 @@ } /************************************************************************* - * @brief canErrorNotification + * @brief * The canErrorNotification function handles CAN error notifications. * @details * Inputs : none @@ -145,7 +184,7 @@ } /************************************************************************* - * @brief sciNotification + * @brief * The sciNotification function handles UART communication error interrupts. \n * Frame and Over-run errors are handled. * @details @@ -215,7 +254,7 @@ } /************************************************************************* - * @brief dmaGroupANotification + * @brief * The dmaGroupANotification function handles communication DMA interrupts. * @details * Inputs : none Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rd3e3e25740d545eb958a595e87fa3034633e7392 -rade19b8aa4c3b60cdda4028871ef009b01368948 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision d3e3e25740d545eb958a595e87fa3034633e7392) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision ade19b8aa4c3b60cdda4028871ef009b01368948) @@ -883,10 +883,8 @@ { sendACKMsg( &message.msg ); } - else - { // otherwise, process the received message - processReceivedMessage( &message.msg ); - } + // process the received message + processReceivedMessage( &message.msg ); } } else // CRC failed @@ -1289,4 +1287,3 @@ } } } - Index: firmware/source/rti.c =================================================================== diff -u -r070554b23739bf16ea2bf9528ebabda1ce0ffeb3 -rade19b8aa4c3b60cdda4028871ef009b01368948 --- firmware/source/rti.c (.../rti.c) (revision 070554b23739bf16ea2bf9528ebabda1ce0ffeb3) +++ firmware/source/rti.c (.../rti.c) (revision ade19b8aa4c3b60cdda4028871ef009b01368948) @@ -865,7 +865,6 @@ void rtiCompare0Interrupt(void) { /* USER CODE BEGIN (74) */ - taskTimer(); /* USER CODE END */ rtiREG1->INTFLAG = 1U; @@ -891,7 +890,6 @@ void rtiCompare1Interrupt(void) { /* USER CODE BEGIN (77) */ - taskPriority(); /* USER CODE END */ rtiREG1->INTFLAG = 2U; @@ -919,7 +917,6 @@ void rtiCompare3Interrupt(void) { /* USER CODE BEGIN (83) */ - taskGeneral(); /* USER CODE END */ rtiREG1->INTFLAG = 8U;