Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r55ae901025333639420cb770cd5e7c1dca78afd3 -rbb6e905d7e6330508f00d6a6779cb11ef92c22d1 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 55ae901025333639420cb770cd5e7c1dca78afd3) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision bb6e905d7e6330508f00d6a6779cb11ef92c22d1) @@ -20,6 +20,7 @@ #include "etpwm.h" #include "gio.h" #include "mibspi.h" +#include "reg_het.h" #include "Battery.h" #include "DialInFlow.h" @@ -158,9 +159,10 @@ NUM_OF_DIAL_IN_FLOW_SELF_TEST_STATES ///< Number of dialysate inlet pump self-test states. } DIAL_IN_FLOW_SELF_TEST_STATE_T; -// Pin assignments for pump stop and direction outputs +// Pin assignments for pump stop and direction outputs and DPi rotor hall sensor input #define STOP_DI_PUMP_GIO_PORT_PIN 2U ///< Pin # on GIO A for stopping the dialysate inlet pump. #define DIR_DI_PUMP_SPI5_PORT_MASK 0x00000100 ///< Pin on unused SPI5 peripheral (ENA) - re-purposed as output GPIO to set dialysate inlet pump direction. +#define DIP_ROTOR_HALL_SENSOR_NHET_ID 0x0000001E ///< NHET pin number associated with DPi rotor hall sensor input // DialIn pump stop and direction macros #define SET_DIP_DIR() {mibspiREG5->PC3 |= DIR_DI_PUMP_SPI5_PORT_MASK;} ///< Macro for setting the dialysate inlet pump direction pin high. #define CLR_DIP_DIR() {mibspiREG5->PC3 &= ~DIR_DI_PUMP_SPI5_PORT_MASK;} ///< Macro for setting the dialysate inlet pump direction pin low. @@ -1099,6 +1101,7 @@ { DIALIN_PUMP_STATUS_PAYLOAD_T payload; HD_OP_MODE_T opMode = getCurrentOperationMode(); + U32 hallSensor = gioGetBit( hetPORT1, DIP_ROTOR_HALL_SENSOR_NHET_ID ); payload.setPoint = targetDialInFlowRate; payload.measFlow = getMeasuredDialInFlowRate(); @@ -1116,6 +1119,7 @@ { payload.presFlow = 0; } + payload.rotorHall = ( hallSensor > 0 ? 0 : 1 ); // 1=home, 0=not home broadcastData( MSG_ID_DIALYSATE_FLOW_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&payload, sizeof( DIALIN_PUMP_STATUS_PAYLOAD_T ) ); dialInFlowDataPublicationTimerCounter = 0; }