File tree 1 file changed +2
-11
lines changed
1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ void I2C2_EV_IRQHandler(void)
31
31
i2c_ev_handler ();
32
32
}
33
33
34
-
35
34
#define I2C_DEFAULT_TIMEOUT 30000
36
35
static volatile uint16_t i2cErrorCount = 0 ;
37
36
@@ -79,26 +78,18 @@ static void i2c_er_handler(void)
79
78
bool i2cWriteBuffer (uint8_t addr_ , uint8_t reg_ , uint8_t len_ , uint8_t * data )
80
79
{
81
80
uint8_t i ;
82
- uint8_t my_data [16 ];
83
81
uint32_t timeout = I2C_DEFAULT_TIMEOUT ;
84
82
85
83
addr = addr_ << 1 ;
86
84
reg = reg_ ;
87
85
writing = 1 ;
88
86
reading = 0 ;
89
- write_p = my_data ;
90
- read_p = my_data ;
87
+ write_p = data ;
88
+ read_p = data ;
91
89
bytes = len_ ;
92
90
busy = 1 ;
93
91
error = false;
94
92
95
- // too long
96
- if (len_ > 16 )
97
- return false;
98
-
99
- for (i = 0 ; i < len_ ; i ++ )
100
- my_data [i ] = data [i ];
101
-
102
93
if (!(I2Cx -> CR2 & I2C_IT_EVT )) { //if we are restarting the driver
103
94
if (!(I2Cx -> CR1 & 0x0100 )) { // ensure sending a start
104
95
while (I2Cx -> CR1 & 0x0200 ) { ; } //wait for any stop to finish sending
You can’t perform that action at this time.
0 commit comments