madsci1016 / Arduino-EasyTransfer

An Easy way to Transfer data between Arduinos
http://www.billporter.info/easytransfer-arduino-library/
318 stars 113 forks source link

Initalize RX packet variables to zero #15

Closed j54n1n closed 1 year ago

j54n1n commented 7 years ago

This change assigns both rx_len and rx_array_inx variables to zero from within the begin method.

This is needed in case the content of the RAM is not cleared by a reset. Such a case would be for example uploading updated code to an Arduino Leonardo type board (with USB bootloader). Otherwise the code used from within the receiveData method would use these uninitialized variables and could potentially fail to read received data.