Index: firmware/App/Controllers/Buttons.c =================================================================== diff -u -r79f3a45ee472c053fd191e8196245729703ebab3 -r0c2b4420fcab891fae916fff9122685e6c583eda --- firmware/App/Controllers/Buttons.c (.../Buttons.c) (revision 79f3a45ee472c053fd191e8196245729703ebab3) +++ firmware/App/Controllers/Buttons.c (.../Buttons.c) (revision 0c2b4420fcab891fae916fff9122685e6c583eda) @@ -274,18 +274,20 @@ // if we're in a mode that allows power off, initiate power off sequence if ( TRUE == isCurrentOpModeOkToTurnOff() ) { + broadcastPowerOffWarning(); + // TODO - maybe delay a bit before starting power off sequence here to allow sub-systems time to get warning and wrap up critical activities offButtonPressPending = TRUE; offRequestPulseCount = OFF_REQUEST_PULSE_COUNT; offRequestPulseTimer = 0; } else - { // inform UI to remove confirmation dialog - sendOffButtonMsgToUI( OFF_BUTTON_CMD_CANCEL_USER_CONFIRM_PROMPT ); + { + sendOffButtonMsgToUI( OFF_BUTTON_CMD_REJECT_USER_OFF_REQUEST ); } } else - { // inform UI to remove confirmation dialog - sendOffButtonMsgToUI( OFF_BUTTON_CMD_CANCEL_USER_CONFIRM_PROMPT ); + { + sendOffButtonMsgToUI( OFF_BUTTON_CMD_REJECT_USER_OFF_REQUEST ); } break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r48278ac6fa3738a97349ed7f3278773daf1d8004 -r0c2b4420fcab891fae916fff9122685e6c583eda --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 48278ac6fa3738a97349ed7f3278773daf1d8004) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 0c2b4420fcab891fae916fff9122685e6c583eda) @@ -644,6 +644,32 @@ return result; } +/************************************************************************* + * @brief + * The broadcastPowerOffWarning function constructs a power off warning msg to \n + * be broadcast and queues the msg for transmit on the appropriate CAN channel. + * @details + * Inputs : none + * Outputs : power off warning msg constructed and queued + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastPowerOffWarning( void ) +{ + BOOL result; + MESSAGE_T msg; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_POWER_OFF_WARNING; + msg.hdr.payloadLen = 0; + + // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_BROADCAST, ACK_NOT_REQUIRED ); + + return result; +} + + #ifdef CAN_TEST void broadcastCANTest1LargeFrequentMessage() { Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r48278ac6fa3738a97349ed7f3278773daf1d8004 -r0c2b4420fcab891fae916fff9122685e6c583eda --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 48278ac6fa3738a97349ed7f3278773daf1d8004) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 0c2b4420fcab891fae916fff9122685e6c583eda) @@ -39,9 +39,10 @@ MSG_ID_DIALYSATE_OUT_FLOW_DATA, // 11 MSG_ID_LOAD_CELL_READINGS, // 12 MSG_ID_TREATMENT_TIME, // 13 + MSG_ID_POWER_OFF_WARNING, // 14 #ifdef CAN_TEST - MSG_ID_HD_CAN_TEST_1_LARGE_FREQ, // 14 - MSG_ID_DG_CAN_TEST_1_LARGE_FREQ, // 15 + MSG_ID_HD_CAN_TEST_1_LARGE_FREQ, + MSG_ID_DG_CAN_TEST_1_LARGE_FREQ, #endif // service/test CAN messages @@ -132,6 +133,9 @@ // MSG_ID_TREATMENT_TIME BOOL broadcastTreatmentTime( U32 secsTotTreatment, U32 secsElapsed, U32 secsRemaining ); +// MSG_ID_POWER_OFF_WARNING +BOOL broadcastPowerOffWarning( void ); + #ifdef CAN_TEST // MSG_ID_HD_CAN_TEST_1_LARGE_FREQ void broadcastCANTest1LargeFrequentMessage(); Index: firmware/HD.dil =================================================================== diff -u -rbe6802eb077d77af6a2334508c428cc50a02ed39 -r0c2b4420fcab891fae916fff9122685e6c583eda --- firmware/HD.dil (.../HD.dil) (revision be6802eb077d77af6a2334508c428cc50a02ed39) +++ firmware/HD.dil (.../HD.dil) (revision 0c2b4420fcab891fae916fff9122685e6c583eda) @@ -1,4 +1,4 @@ -# RM46L852PGE 01/27/20 09:21:54 +# RM46L852PGE 02/11/20 08:33:36 # ARCH=RM46L852PGE #