Skip to content

Commit 830454c

Browse files
webcam: less errors
1 parent 079d9ff commit 830454c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

c_mpos/src/webcam.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ static mp_obj_t webcam_deinit(mp_obj_t self_in) {
224224
}
225225
MP_DEFINE_CONST_FUN_OBJ_1(webcam_deinit_obj, webcam_deinit);
226226

227-
// Method dispatch for webcam object
228-
static mp_obj_t webcam_call(mp_obj_t self_in, mp_obj_t attr, mp_obj_t *dest) {
227+
// Attribute lookup for webcam object
228+
static void webcam_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
229229
if (dest[0] == MP_OBJ_NULL) {
230230
// Lookup attribute
231231
if (attr == MP_QSTR_capture_grayscale) {
@@ -236,14 +236,13 @@ static mp_obj_t webcam_call(mp_obj_t self_in, mp_obj_t attr, mp_obj_t *dest) {
236236
dest[1] = self_in;
237237
}
238238
}
239-
return MP_OBJ_NULL;
240239
}
241240

242241
// Webcam type definition
243242
static const mp_obj_type_t webcam_type = {
244243
{ &mp_type_type },
245244
.name = MP_QSTR_webcam,
246-
.call = webcam_call,
245+
.attr = webcam_attr,
247246
};
248247

249248
// Module definition

0 commit comments

Comments
 (0)