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 @@ -153,7 +153,7 @@ class SPIClass
153153
154154 uint8_t transfer (uint8_t data);
155155 inline uint16_t transfer16 (uint16_t data);
156- inline void transfer (uint8_t * buf, uint8_t count);
156+ inline void transfer (void * buf, size_t count);
157157
158158 // Transaction Functions
159159 // Function not used here
@@ -211,14 +211,13 @@ extern SPIClass SPI;
211211# endif
212212#endif
213213
214- void SPIClass::transfer (uint8_t *buf, uint8_t count)
214+ void SPIClass::transfer (void *buf, size_t count)
215215{
216- uint8_t buf_in[count] ;
217- for (uint8_t i = 0 ; i < count; i ++)
216+ uint8_t *buffer = ( uint8_t *) buf ;
217+ for (size_t index = 0 ; index < count; index ++)
218218 {
219- buf_in[i ] = transfer (buf[i ]);
219+ buffer[index ] = transfer (buffer[index ]);
220220 }
221- buf = buf_in;
222221}
223222
224223uint16_t SPIClass::transfer16 (uint16_t data)
You can’t perform that action at this time.
0 commit comments