Skip to content

Commit 765d7ff

Browse files
committed
Add version info.
1 parent 2aa50fa commit 765d7ff

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

firmware/firmware.bin

96 Bytes
Binary file not shown.

rm67162/rm67162.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <string.h>
1414
#include <math.h>
1515

16+
#define RM67162_DRIVER_VERSION "0.0.1"
17+
1618
#if MICROPY_VERSION >= MICROPY_MAKE_VERSION(1, 23, 0) // STATIC should be replaced with static.
1719
#undef STATIC // This may become irrelevant later on.
1820
#define STATIC static
@@ -114,11 +116,12 @@ STATIC void rm67162_RM67162_print(const mp_print_t *print,
114116
rm67162_RM67162_obj_t *self = MP_OBJ_TO_PTR(self_in);
115117
mp_printf(
116118
print,
117-
"<RM67162 bus=%p, reset=%p, color_space=%s, bpp=%u>",
119+
"<RM67162 bus=%p, reset=%p, color_space=%s, bpp=%u>, version=%s",
118120
self->bus_obj,
119121
self->reset,
120122
color_space_desc[self->color_space],
121-
self->bpp
123+
self->bpp,
124+
RM67162_DRIVER_VERSION
122125
);
123126
}
124127

@@ -239,6 +242,13 @@ mp_obj_t rm67162_RM67162_make_new(const mp_obj_type_t *type,
239242
}
240243

241244

245+
STATIC mp_obj_t rm67162_RM67162_version()
246+
{
247+
return mp_obj_new_str(RM67162_DRIVER_VERSION, 5);
248+
}
249+
STATIC MP_DEFINE_CONST_FUN_OBJ_0(rm67162_RM67162_version_obj, rm67162_RM67162_version);
250+
251+
242252
STATIC mp_obj_t rm67162_RM67162_deinit(mp_obj_t self_in)
243253
{
244254
rm67162_RM67162_obj_t *self = MP_OBJ_TO_PTR(self_in);
@@ -1677,6 +1687,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(rm67162_RM67162_vscroll_start_obj, 2,
16771687
// Mapping to Micropython
16781688
STATIC const mp_rom_map_elem_t rm67162_RM67162_locals_dict_table[] = {
16791689
/* { MP_ROM_QSTR(MP_QSTR_custom_init), MP_ROM_PTR(&rm67162_RM67162_custom_init_obj) }, */
1690+
{ MP_ROM_QSTR(MP_QSTR_version), MP_ROM_PTR(&rm67162_RM67162_version_obj) },
16801691
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&rm67162_RM67162_deinit_obj) },
16811692
{ MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&rm67162_RM67162_reset_obj) },
16821693
{ MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&rm67162_RM67162_init_obj) },

0 commit comments

Comments
 (0)