#define versus const and other software performance issues

return (voltage * 1000 - 500) / 10;
This can be rewritten as:
return (voltage * 1000 - 500) * .10; // Original was divided by 10
In a tight loop, this change saved about 3% execution time.

Not when voltage is an integer datatype.