Expand pow(#, 2) to optimize math in nx_touch

This commit is contained in:
Daniel Bernard 2018-10-28 18:13:27 -05:00 committed by yellows8
parent 1483f4d012
commit bc6d98a534

View File

@ -14,7 +14,7 @@
#define LAUNCH_BUTTON_START_X 1092 #define LAUNCH_BUTTON_START_X 1092
#define LAUNCH_BUTTON_END_X 1200 #define LAUNCH_BUTTON_END_X 1200
#define distance(x1, y1, x2, y2) (int) sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)) #define distance(x1, y1, x2, y2) (int) sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))
struct touchInfo_s touchInfo; struct touchInfo_s touchInfo;