Index: firmware/App/Modes/ModeGenIdle.c =================================================================== diff -u -r4d4223c4fd424a65a12c70b123cbad43d844f4cd -rbd80dccfee1f58fdbc49bf05dd000005b105fe26 --- firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision 4d4223c4fd424a65a12c70b123cbad43d844f4cd) +++ firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision bd80dccfee1f58fdbc49bf05dd000005b105fe26) @@ -54,8 +54,8 @@ // ********** private data ********** static DG_GEN_IDLE_MODE_STATE_T genIdleState; ///< Currently active generation idle state. -static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T badFillState = DG_HANDLE_BAD_FILL_STATE_START; ///< Initialize bad fill sub-state. -static U32 hdLostCommStartTime_ms = 0; ///< Lost communication with HD start time in ms. +static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T badFillState; ///< Initialize bad fill sub-state. +static U32 hdLostCommStartTime_ms; ///< Lost communication with HD start time in ms. static U32 badFillSubstatesPublicationTimerCounter; ///< Used to schedule bad fill sub-states publication to CAN bus. static U32 targetFillVolumeML; ///< Save the target fill volume before calling startFillCmd(). static BOOL handleBadFillFlag; ///< Internal signal flag to handle bad fill. @@ -86,11 +86,11 @@ *************************************************************************/ void initGenIdleMode( void ) { - genIdleState = DG_GEN_IDLE_MODE_STATE_START; - + genIdleState = DG_GEN_IDLE_MODE_STATE_START; + badFillState = DG_HANDLE_BAD_FILL_STATE_START; hdLostCommStartTime_ms = 0; - targetFillVolumeML = 0; - handleBadFillFlag = FALSE; + targetFillVolumeML = 0; + handleBadFillFlag = FALSE; } /*********************************************************************//** @@ -431,7 +431,11 @@ // publish bad fill sub-states on interval if ( ++badFillSubstatesPublicationTimerCounter >= getU32OverrideValue( &badFillSubstatesPublishInterval ) ) { - broadcastData( MSG_ID_DG_BAD_FILL_SUB_STATE, COMM_BUFFER_OUT_CAN_DG_BROADCAST, (U08*)&badFillState, sizeof( U32 ) ); + GEN_IDLE_BAD_FILL_STATE data; + + data.badFillState = (U32)badFillState; + + broadcastData( MSG_ID_DG_BAD_FILL_SUB_STATE, COMM_BUFFER_OUT_CAN_DG_BROADCAST, (U08*)&data, sizeof( GEN_IDLE_BAD_FILL_STATE ) ); badFillSubstatesPublicationTimerCounter = 0; } }