File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
first-steps/3-simple-uart-protocol/mcu Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -119,19 +119,15 @@ void sup_handle_rx_byte(const uint8_t byte)
119119 return ;
120120 }
121121
122- // Always listen for a Start-Of-Frame byte, which can reset a broken frame transmission.
123- if (byte == SUP_SOF )
124- {
125- reset_rx_frame_state ();
126- rx_frame_state -> parsing_state = SUP_STATE_WAIT_ID ;
127- return ;
128- }
129-
130122 switch (rx_frame_state -> parsing_state )
131123 {
132124 case SUP_STATE_WAIT_SOF :
133- // This state is effectively handled by the check above,
134- // but we keep the case for clarity. Any byte other than SOF is ignored.
125+ // Listen for a Start-Of-Frame byte. Any byte other than SOF is ignored.
126+ if (byte == SUP_SOF )
127+ {
128+ reset_rx_frame_state ();
129+ rx_frame_state -> parsing_state = SUP_STATE_WAIT_ID ;
130+ }
135131 break ;
136132
137133 case SUP_STATE_WAIT_ID :
You can’t perform that action at this time.
0 commit comments