Remove reduntant code in MicroBitAccelerometer

Also removes a potential recursive loop, as noted by @dpgeorge.
master
Joe Finney 5 years ago
parent e770f34636
commit 2d46e9dabd

@ -163,8 +163,6 @@ int MicroBitAccelerometer::update()
*/
uint32_t MicroBitAccelerometer::instantaneousAccelerationSquared()
{
requestUpdate();
// Use pythagoras theorem to determine the combined force acting on the device.
return (uint32_t)sample.x*(uint32_t)sample.x + (uint32_t)sample.y*(uint32_t)sample.y + (uint32_t)sample.z*(uint32_t)sample.z;
}

Loading…
Cancel
Save