Merge pull request #401 from microbit-sam/050

Delay microbit_panic for 050 / 051 errors
master
Joe Finney 4 years ago committed by GitHub
commit 3b3848a4c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      source/drivers/MicroBitAccelerometer.cpp
  2. 4
      source/drivers/MicroBitCompass.cpp

@ -112,7 +112,8 @@ MicroBitAccelerometer& MicroBitAccelerometer::autoDetect(MicroBitI2C &i2c)
else
{
microbit_panic(MICROBIT_HARDWARE_UNAVAILABLE_ACC);
MicroBitAccelerometer *unavailable = new MicroBitAccelerometer(coordinateSpace, MICROBIT_ID_ACCELEROMETER);
MicroBitAccelerometer::detectedAccelerometer = unavailable;
}
}
@ -438,6 +439,7 @@ int MicroBitAccelerometer::configure()
*/
int MicroBitAccelerometer::requestUpdate()
{
microbit_panic(MICROBIT_HARDWARE_UNAVAILABLE_ACC);
return MICROBIT_NOT_SUPPORTED;
}

@ -134,7 +134,8 @@ MicroBitCompass& MicroBitCompass::autoDetect(MicroBitI2C &i2c)
else
{
microbit_panic(MICROBIT_HARDWARE_UNAVAILABLE_MAG);
MicroBitCompass *unavailable = new MicroBitCompass(coordinateSpace, MICROBIT_ID_COMPASS);
MicroBitCompass::detectedCompass = unavailable;
}
}
@ -357,6 +358,7 @@ int MicroBitCompass::getPeriod()
*/
int MicroBitCompass::requestUpdate()
{
microbit_panic(MICROBIT_HARDWARE_UNAVAILABLE_MAG);
return MICROBIT_NOT_SUPPORTED;
}

Loading…
Cancel
Save