lancaster-university / codal-core

MIT License
12 stars 27 forks source link

Removed and repurposed DEVICE_USB_ERROR #151

Closed JohnVidler closed 1 year ago

JohnVidler commented 1 year ago

Removed as its never used, and repurposed it for the base error address DEVICE_PERIPHERAL_ERROR, from which on-board periperhal errors can be numbered, as required, for implementing boards.

The Micro:bit v2, for example now has a MicroBitPanic enum with ACCELEROMETER_ERROR = PanicCode::DEVICE_PERIPHERAL_ERROR + 1, // Aka. Panic 51 available for device specific peripheral errors.

Note: the entire 50->59 space is available for board-specific errors.

See also:

jamesadevine commented 1 year ago

DEVICE_USB_ERROR is infact used:

https://github.com/lancaster-university/codal-core/blob/master/source/driver-models/CodalUSB.cpp#L682

jamesadevine commented 1 year ago

I can update the driver to panic against DEVICE_PERIPHERAL_ERROR

jamesadevine commented 1 year ago

@finneyj it would be good to revisit hardware builds to catch breaking changes like these.

Also @JohnVidler, please bear in mind that CODAL is used by many other devices supported in MakeCode.