What is wrong
cameraif.available() is exported as a capability probe, but the implementation is a constant:
static mp_obj_t cameraif_available(void) {
return mp_const_true;
}
A probe that cannot fail is not a probe. Code that branches on available() before constructing a Camera will always take the camera path, including on firmware built without a sensor driver or on a board with no CSI.
What it should mean
Either:
- return whether this firmware was built with at least one
CONFIG_CAMERA_* driver linked and the CSI controller is present, or
- be removed from the public surface until it can tell the truth.
Why it surfaced
The examples catalog work needed a honest "does this board have a camera?" check. board_config.camera already raises usefully; available() does not add anything until it can fail.
What is wrong
cameraif.available()is exported as a capability probe, but the implementation is a constant:A probe that cannot fail is not a probe. Code that branches on
available()before constructing aCamerawill always take the camera path, including on firmware built without a sensor driver or on a board with no CSI.What it should mean
Either:
CONFIG_CAMERA_*driver linked and the CSI controller is present, orWhy it surfaced
The examples catalog work needed a honest "does this board have a camera?" check.
board_config.cameraalready raises usefully;available()does not add anything until it can fail.