Skip to content

Change int casts to long cast statements

Choose a tag to compare

@DavidArmstrong DavidArmstrong released this 09 Feb 04:30
· 12 commits to main since this release
e907750

On the Mega 2560, doing an (int) cast can result in an overflow condition when the number being cast is larger than the machine allocation for integers. For SAMD processors, an (int) cast doesn't approach this limit because 32-bit processors default to a larger number of bytes to store integers. Therefore, to avoid a possible overflow condition when using the Mega 2560, the two code functions that used (int) have been updated to use (long) instead. This will avoid that problem.