File tree 1 file changed +14
-11
lines changed
1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -136,19 +136,22 @@ void WireDispatcher::processWireIoRequest(WireIoTransaction * wire_io_transactio
136
136
IoResponse io_response = wire_io_transaction->rsp ;
137
137
WireBusDeviceConfig * config = wire_io_transaction->config ;
138
138
139
- config->wire ().beginTransmission (config->slave_addr ());
140
-
141
- size_t bytes_written = 0 ;
142
- for (; bytes_written < io_request->bytes_to_write ; bytes_written++)
139
+ if (io_request->bytes_to_write > 0 )
143
140
{
144
- config->wire ().write (io_request->write_buf [bytes_written]);
145
- }
146
- io_response->bytes_written = bytes_written;
141
+ config->wire ().beginTransmission (config->slave_addr ());
142
+
143
+ size_t bytes_written = 0 ;
144
+ for (; bytes_written < io_request->bytes_to_write ; bytes_written++)
145
+ {
146
+ config->wire ().write (io_request->write_buf [bytes_written]);
147
+ }
148
+ io_response->bytes_written = bytes_written;
147
149
148
- if (config->restart () && (io_request->bytes_to_read > 0 ))
149
- config->wire ().endTransmission (false /* stop */ );
150
- else
151
- config->wire ().endTransmission (true /* stop */ );
150
+ if (config->restart () && (io_request->bytes_to_read > 0 ))
151
+ config->wire ().endTransmission (false /* stop */ );
152
+ else
153
+ config->wire ().endTransmission (true /* stop */ );
154
+ }
152
155
153
156
if (io_request->bytes_to_read > 0 )
154
157
{
You can’t perform that action at this time.
0 commit comments