File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed
libraries/Wire/src/utility Expand file tree Collapse file tree 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,
250250 uint8_t send_stop )
251251{
252252 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- }
258253
259254 /*Initiate transaction if bus is ready. */
260255 if (master_trans_status == TWIM_STATUS_READY ) {
261256
262257 master_trans_status = TWIM_STATUS_BUSY ;
263258 master_result = TWIM_RESULT_UNKNOWN ;
264259
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 ;
269261
270262 master_bytesToWrite = bytes_to_write ;
271263 master_bytesToRead = bytes_to_read ;
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ typedef enum TWI_MODE_enum {
7474
7575/* Master variables */
7676register8_t master_slaveAddress ; /*!< Slave address */
77- register8_t master_writeData [ TWI_BUFFER_SIZE ]; /*!< Data to write */
77+ register8_t * master_writeData ; /*!< Data to write */
7878register8_t * master_readData ; /*!< Read data */
7979register8_t master_bytesToWrite ; /*!< Number of bytes to write */
8080register8_t master_bytesToRead ; /*!< Number of bytes to read */
You can’t perform that action at this time.
0 commit comments