File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -206,14 +206,20 @@ begin
206
206
sda_internal <= 1'b1 ; // Should help reduce slave rise time
207
207
end
208
208
// See Section 3.1.6. Transmitter got an acknowledge bit or receiver sent it.
209
- // transaction continues immediately in the next LOW, latch now
209
+ // transfer continues immediately in the next LOW, latch now
210
+ // refuses to continue the transfer if receiver got a NACK
210
211
else if (transaction_progress == 4'd10 && latched_transfer_continues)
211
212
begin
212
- transaction_progress <= 4'd1 ;
213
- latched_mode <= mode;
214
- // if (!mode) // Mode doesn't matter, save some logic cells
215
- latched_data <= data_tx;
216
- latched_transfer_continues <= transfer_continues;
213
+ if (! mode && nack)
214
+ transaction_progress <= 4'd11 ; // TODO: if user set transfer_start when there's a NACK (they shouldn't) then there will be a repeated start
215
+ else
216
+ begin
217
+ transaction_progress <= 4'd1 ;
218
+ latched_mode <= mode;
219
+ // if (!mode) // Mode doesn't matter, save some logic cells
220
+ latched_data <= data_tx;
221
+ latched_transfer_continues <= transfer_continues;
222
+ end
217
223
end
218
224
// STOP condition
219
225
else if (transaction_progress == 4'd11 && ! transfer_start)
You can’t perform that action at this time.
0 commit comments