Merge pull request #401 from microbit-sam/050
Delay microbit_panic for 050 / 051 errors
This commit is contained in:
commit
3b3848a4c3
2 changed files with 6 additions and 2 deletions
|
@ -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…
Reference in a new issue