mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Forgot some return statements in case the controller isn't connected
This commit is contained in:
parent
7731f17c21
commit
bbfd49310c
2 changed files with 8 additions and 4 deletions
|
@ -108,7 +108,8 @@ double PS3BT::getAngle(Angle a) {
|
||||||
accXval = -(int16_t)(getSensor(aXmove) - zeroG);
|
accXval = -(int16_t)(getSensor(aXmove) - zeroG);
|
||||||
accYval = (int16_t)(getSensor(aYmove) - zeroG);
|
accYval = (int16_t)(getSensor(aYmove) - zeroG);
|
||||||
accZval = (int16_t)(getSensor(aZmove) - zeroG);
|
accZval = (int16_t)(getSensor(aZmove) - zeroG);
|
||||||
}
|
} else
|
||||||
|
return 0;
|
||||||
|
|
||||||
// Convert to 360 degrees resolution
|
// Convert to 360 degrees resolution
|
||||||
// atan2 outputs the value of -π to π (radians)
|
// atan2 outputs the value of -π to π (radians)
|
||||||
|
@ -162,7 +163,8 @@ String PS3BT::getTemperature() {
|
||||||
output += String(input % 100);
|
output += String(input % 100);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
} else
|
||||||
|
return "Error";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PS3BT::getStatus(Status c) {
|
bool PS3BT::getStatus(Status c) {
|
||||||
|
@ -219,7 +221,8 @@ String PS3BT::getStatusString() {
|
||||||
else strcat(statusOutput, "Error");
|
else strcat(statusOutput, "Error");
|
||||||
|
|
||||||
return statusOutput;
|
return statusOutput;
|
||||||
}
|
} else
|
||||||
|
return "Error";
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS3BT::Reset() {
|
void PS3BT::Reset() {
|
||||||
|
|
|
@ -390,7 +390,8 @@ String PS3USB::getStatusString() {
|
||||||
else strcat(statusOutput, "Error");
|
else strcat(statusOutput, "Error");
|
||||||
|
|
||||||
return statusOutput;
|
return statusOutput;
|
||||||
}
|
} else
|
||||||
|
return "Error";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Playstation Sixaxis Dualshock and Navigation Controller commands */
|
/* Playstation Sixaxis Dualshock and Navigation Controller commands */
|
||||||
|
|
Loading…
Reference in a new issue