Skip to content

Commit 14f1d95

Browse files
committed
qrio: Fix handling of 1-arg decode()
1 parent f9393c9 commit 14f1d95

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

shared-bindings/qrio/QRDecoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ STATIC mp_obj_t qrio_qrdecoder_decode(size_t n_args, const mp_obj_t *pos_args, m
6363
enum { ARG_buffer, ARG_pixel_policy };
6464
static const mp_arg_t allowed_args[] = {
6565
{ MP_QSTR_buffer, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_int = 0} },
66-
{ MP_QSTR_pixel_policy, MP_ARG_OBJ, {.u_int = 0} },
66+
{ MP_QSTR_pixel_policy, MP_ARG_OBJ, {.u_obj = MP_ROM_PTR((mp_obj_t *)&qrio_pixel_policy_EVERY_BYTE_obj)} },
6767
};
6868
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
6969
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);

shared-bindings/qrio/__init__.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#pragma once
2828

29+
#include "py/enum.h"
2930
#include "py/obj.h"
3031
#include "py/objnamedtuple.h"
3132

@@ -36,3 +37,5 @@ extern const mp_obj_type_t qrio_pixel_policy_type;
3637
typedef enum {
3738
QRIO_EVERY_BYTE, QRIO_EVEN_BYTES, QRIO_ODD_BYTES
3839
} qrio_pixel_policy_t;
40+
41+
extern const cp_enum_obj_t qrio_pixel_policy_EVERY_BYTE_obj;

0 commit comments

Comments
 (0)