Delay microbit_panic

master
Sam Kent 2018-10-24 10:04:43 +01:00
parent 11c8205754
commit 96126fd23f
2 changed files with 6 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}