@@ -85,14 +85,16 @@ mp_obj_t Hub75_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, c
85
85
ARG_height,
86
86
ARG_buffer,
87
87
ARG_panel_type,
88
- ARG_stb_invert
88
+ ARG_stb_invert,
89
+ ARG_color_order
89
90
};
90
91
static const mp_arg_t allowed_args[] = {
91
92
{ MP_QSTR_width, MP_ARG_REQUIRED | MP_ARG_INT },
92
93
{ MP_QSTR_height, MP_ARG_REQUIRED | MP_ARG_INT },
93
94
{ MP_QSTR_buffer, MP_ARG_OBJ, {.u_obj = nullptr } },
94
95
{ MP_QSTR_panel_type, MP_ARG_INT, {.u_int = 0 } },
95
96
{ MP_QSTR_stb_invert, MP_ARG_INT, {.u_int = 0 } },
97
+ { MP_QSTR_color_order, MP_ARG_INT, {.u_int = (uint8_t )Hub75::COLOR_ORDER::RGB} },
96
98
};
97
99
98
100
// Parse args.
@@ -103,6 +105,7 @@ mp_obj_t Hub75_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, c
103
105
int height = args[ARG_height].u_int ;
104
106
PanelType paneltype = (PanelType)args[ARG_panel_type].u_int ;
105
107
bool stb_invert = args[ARG_stb_invert].u_int ;
108
+ Hub75::COLOR_ORDER color_order = (Hub75::COLOR_ORDER)args[ARG_color_order].u_int ;
106
109
107
110
Pixel *buffer = nullptr ;
108
111
@@ -120,7 +123,7 @@ mp_obj_t Hub75_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, c
120
123
hub75_obj = m_new_obj_with_finaliser (_Hub75_obj_t);
121
124
hub75_obj->base .type = &Hub75_type;
122
125
hub75_obj->buf = buffer;
123
- hub75_obj->hub75 = m_new_class (Hub75, width, height, buffer, paneltype, stb_invert);
126
+ hub75_obj->hub75 = m_new_class (Hub75, width, height, buffer, paneltype, stb_invert, color_order );
124
127
125
128
return MP_OBJ_FROM_PTR (hub75_obj);
126
129
}
0 commit comments