File tree 2 files changed +2
-10
lines changed
libraries/Wire/src/utility
2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -250,22 +250,14 @@ uint8_t TWI_MasterWriteRead(uint8_t slave_address,
250
250
uint8_t send_stop )
251
251
{
252
252
if (twi_mode != TWI_MODE_MASTER ) return false;
253
-
254
- /* Parameter sanity check. */
255
- if (bytes_to_write > TWI_BUFFER_SIZE ) {
256
- return 1 ;
257
- }
258
253
259
254
/*Initiate transaction if bus is ready. */
260
255
if (master_trans_status == TWIM_STATUS_READY ) {
261
256
262
257
master_trans_status = TWIM_STATUS_BUSY ;
263
258
master_result = TWIM_RESULT_UNKNOWN ;
264
259
265
- /* Fill write data buffer. */
266
- for (uint8_t bufferIndex = 0 ; bufferIndex < bytes_to_write ; bufferIndex ++ ) {
267
- master_writeData [bufferIndex ] = write_data [bufferIndex ];
268
- }
260
+ master_writeData = write_data ;
269
261
270
262
master_bytesToWrite = bytes_to_write ;
271
263
master_bytesToRead = bytes_to_read ;
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ typedef enum TWI_MODE_enum {
74
74
75
75
/* Master variables */
76
76
register8_t master_slaveAddress ; /*!< Slave address */
77
- register8_t master_writeData [ TWI_BUFFER_SIZE ]; /*!< Data to write */
77
+ register8_t * master_writeData ; /*!< Data to write */
78
78
register8_t * master_readData ; /*!< Read data */
79
79
register8_t master_bytesToWrite ; /*!< Number of bytes to write */
80
80
register8_t master_bytesToRead ; /*!< Number of bytes to read */
You can’t perform that action at this time.
0 commit comments