Skip to content

Commit

Permalink
pios_i2c: significantly smush down state machine
Browse files Browse the repository at this point in the history
Mostly the F4 state machine.  Factor a little bit more common between F3
and F4.  This makes what's actually happening more obvious and I'm
hoping can be used to further simplify.
  • Loading branch information
mlyle committed Dec 15, 2017
1 parent 226db51 commit 28fed93
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 327 deletions.
10 changes: 4 additions & 6 deletions flight/PiOS/STM32/inc/pios_i2c_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ enum i2c_adapter_state {
I2C_STATE_R_MORE_TXN_PRE_FIRST,
I2C_STATE_R_MORE_TXN_PRE_MIDDLE,
I2C_STATE_R_MORE_TXN_PRE_LAST,
I2C_STATE_R_MORE_TXN_POST_LAST,

I2C_STATE_MORE_TXN_POST_LAST,

I2C_STATE_R_LAST_TXN_ADDR,
I2C_STATE_R_LAST_TXN_PRE_ONE,
Expand All @@ -85,11 +86,8 @@ enum i2c_adapter_state {
I2C_STATE_W_LAST_TXN_MIDDLE,
I2C_STATE_W_LAST_TXN_LAST,

I2C_STATE_W_MORE_TXN_PRE_LAST,
I2C_STATE_W_MORE_TXN_POST_LAST,
I2C_STATE_W_MORE_TXN_PRE_MIDDLE,
I2C_STATE_W_LAST_TXN_PRE_MIDDLE,
I2C_STATE_W_LAST_TXN_PRE_LAST,
I2C_STATE_W_MORE_TXN_PRE,
I2C_STATE_W_LAST_TXN_PRE,
I2C_STATE_W_LAST_TXN_POST_LAST,
#endif // STM32F4XX

Expand Down
Loading

0 comments on commit 28fed93

Please sign in to comment.