Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: USBHost USBHostXpad mbed-rtos mbed
utils.cpp
- Committer:
- hotwheelharry
- Date:
- 2014-11-26
- Revision:
- 3:c1620db50a75
- Parent:
- 0:79485480cd7e
File content as of revision 3:c1620db50a75:
#include "utils.h"
double ghettoFloor(double d){
return double((long long)d);
}
double round(double d)
{
return ghettoFloor(d + 0.5);
}
float xpadNormalizeAnalog(int x){
float res = 0;
if(x > 0){
res = (float)x/32767.0;
}else{
res = (float)x/32768.0;
}
return res;
}
float xpadNormalizeTrigger(int x){
float res = (float)x / (float)0xff;
return res;
}
