ModeInitPOST.c

Clone Tools
  • last updated a few minutes ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Not necessary

Not necessary

This command should be given once on way out of prior state instead of every 50ms while in this state. We also need to zero the timer counter at same time so the timeout check below works.

This command should be given once on way out of prior state instead of every 50ms while in this state.
We also need to zero the timer counter at same time so the timeout check below works.

Response needs to be sent immediately (in message handler function). This is too late.

Response needs to be sent immediately (in message handler function). This is too late.

We shouldn't need to do this door check if you've required door be closed for the state. Call the doorClosedRequired( TRUE ) function on transition into a state that requires the door to be closed ...

We shouldn't need to do this door check if you've required door be closed for the state.
Call the doorClosedRequired( TRUE ) function on transition into a state that requires the door to be closed and call with ( FALSE ) on transition into a state that doesn't require door to be closed. When required = TRUE, the switch monitor will trigger the door open alarm for you.

Same organization comment that I had for post-tx mode. Let's keep functions related to each pre-tx state together separated by some kind of comment banner.

Same organization comment that I had for post-tx mode. Let's keep functions related to each pre-tx state together separated by some kind of comment banner.

Remove extra blank line.

Remove extra blank line.

Looks like there's plans for 4 post-tx states and we only have your auto eject state implemented here below. Since all of these 4 states will be implemented in this file, maybe we should organize t...

Looks like there's plans for 4 post-tx states and we only have your auto eject state implemented here below.
Since all of these 4 states will be implemented in this file, maybe we should organize them - keep functions related to each state together separated by some kind of comment banner.

Not necessary if you give retract command on way out of prior state.

Not necessary if you give retract command on way out of prior state.

I don't think this if statement is necessary. We wouldn't be in this state if the ejector didn't extend already. I think we just want to see if BP is home again (completed 1 revolution) so we know ...

I don't think this if statement is necessary. We wouldn't be in this state if the ejector didn't extend already.
I think we just want to see if BP is home again (completed 1 revolution) so we know when to stop and go to next state.

Give ejector retract command and zero timer counter here too.

Give ejector retract command and zero timer counter here too.

Not needed if you do this on way out of prior state.

Not needed if you do this on way out of prior state.

Start BP and zero timer counter here.

Start BP and zero timer counter here.

Not necessary if fault property of alarm is TRUE.

Not necessary if fault property of alarm is TRUE.

Not necessary if you do this on way out of prior state.

Not necessary if you do this on way out of prior state.

Remove ejector homed stuff. Not needed.

Remove ejector homed stuff. Not needed.

Give eject cmd and zero timer counter here.

Give eject cmd and zero timer counter here.

give BP home command and zero timer counter here.

give BP home command and zero timer counter here.

Not necessary. Just make alarm have fault property = TRUE.

Not necessary. Just make alarm have fault property = TRUE.

Again, ejector should have been retracted way back in pre-treatment mode. We shouldn't need to do it again.

Again, ejector should have been retracted way back in pre-treatment mode. We shouldn't need to do it again.

Shouldn't need this if statement. If we timeout, we want to stop the pump and alarm.

Shouldn't need this if statement. If we timeout, we want to stop the pump and alarm.

Better to home BP on your way out of previous state so you don't have to use a cmd issued flag. Ejector should already be retracted, so I see no reason to home the ejector here. You should also zer...

Better to home BP on your way out of previous state so you don't have to use a cmd issued flag.
Ejector should already be retracted, so I see no reason to home the ejector here.
You should also zero the autoEjectTimerCounter too.

Not necessary to request fault mode. Just set alarm fault property to TRUE.

Not necessary to request fault mode. Just set alarm fault property to TRUE.

This is way too late. UI s/w expects response immediately (so always send it in message handler function.)

This is way too late. UI s/w expects response immediately (so always send it in message handler function.)

rejectionReason should be set to none (zero) here too.

rejectionReason should be set to none (zero) here too.

You should send response regardless of success - so I think this should be moved to the very end of the function, outside of any if statements so that it always responds. You should set accept flag...

You should send response regardless of success - so I think this should be moved to the very end of the function, outside of any if statements so that it always responds. You should set accept flag and reject reason codes in these if statements so the response that gets sent will have the correct payload.

Declare locals at top of scope (so before memcpy). Also, when assigning to a BOOL, be explicit (i.e. TRUE or FALSE). You can use a ternary operation for this (e.g. BOOL b = <bool expr> ? TRUE : FAL...

Declare locals at top of scope (so before memcpy).
Also, when assigning to a BOOL, be explicit (i.e. TRUE or FALSE).
You can use a ternary operation for this (e.g. BOOL b = <bool expr> ? TRUE : FALSE

Does this message need a BOOL? Will UI ever send this message with a FALSE? Check with Nico on this.

Does this message need a BOOL? Will UI ever send this message with a FALSE? Check with Nico on this.

Add a space before )

Add a space before )

Set the fault property for this alarm to TRUE and then you don't need to request to go to fault mode - the alarm will do it for you. You should never have to request fault mode like this.

Set the fault property for this alarm to TRUE and then you don't need to request to go to fault mode - the alarm will do it for you. You should never have to request fault mode like this.

Add a blank line after declaration(s) for a little separation.

Add a blank line after declaration(s) for a little separation.