File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ class SPIClass
150150
151151 uint8_t transfer (uint8_t data);
152152 inline uint16_t transfer16 (uint16_t data);
153- inline void transfer (uint8_t * buf, uint8_t count);
153+ inline void transfer (void * buf, size_t count);
154154
155155 // Transaction Functions
156156 // Function not used here
@@ -208,14 +208,13 @@ extern SPIClass SPI;
208208# endif
209209#endif
210210
211- void SPIClass::transfer (uint8_t *buf, uint8_t count)
211+ void SPIClass::transfer (void *buf, size_t count)
212212{
213- uint8_t buf_in[count] ;
214- for (uint8_t i = 0 ; i < count; i ++)
213+ uint8_t *buffer = ( uint8_t *) buf ;
214+ for (size_t index = 0 ; index < count; index ++)
215215 {
216- buf_in[i ] = transfer (buf[i ]);
216+ buffer[index ] = transfer (buffer[index ]);
217217 }
218- buf = buf_in;
219218}
220219
221220uint16_t SPIClass::transfer16 (uint16_t data)
You can’t perform that action at this time.
0 commit comments