Verified Commit 6e001276 authored by Rahix's avatar Rahix
Browse files

chore(pycardium): Move object definitions to their functions



Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 5c6cc3e9
......@@ -48,6 +48,9 @@ static mp_obj_t mp_display_print(size_t n_args, const mp_obj_t *args)
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_print_obj, 5, 5, mp_display_print
);
/* draw pixel on the display */
static mp_obj_t mp_display_pixel(size_t n_args, const mp_obj_t *args)
......@@ -71,6 +74,9 @@ static mp_obj_t mp_display_pixel(size_t n_args, const mp_obj_t *args)
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_pixel_obj, 3, 3, mp_display_pixel
);
/* draw line on the display */
static mp_obj_t mp_display_line(size_t n_args, const mp_obj_t *args)
......@@ -102,6 +108,9 @@ static mp_obj_t mp_display_line(size_t n_args, const mp_obj_t *args)
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_line_obj, 7, 7, mp_display_line
);
/* draw rectangle on the display */
static mp_obj_t mp_display_rect(size_t n_args, const mp_obj_t *args)
......@@ -133,6 +142,9 @@ static mp_obj_t mp_display_rect(size_t n_args, const mp_obj_t *args)
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_rect_obj, 7, 7, mp_display_rect
);
/* draw rectangle on the display */
static mp_obj_t mp_display_circ(size_t n_args, const mp_obj_t *args)
......@@ -154,6 +166,9 @@ static mp_obj_t mp_display_circ(size_t n_args, const mp_obj_t *args)
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_circ_obj, 6, 6, mp_display_circ
);
/* clear the display */
static mp_obj_t mp_display_clear(mp_obj_t col)
......@@ -165,6 +180,7 @@ static mp_obj_t mp_display_clear(mp_obj_t col)
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_clear_obj, mp_display_clear);
static mp_obj_t mp_display_update()
{
......@@ -174,6 +190,7 @@ static mp_obj_t mp_display_update()
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(display_update_obj, mp_display_update);
static mp_obj_t mp_display_open()
{
......@@ -183,6 +200,7 @@ static mp_obj_t mp_display_open()
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(display_open_obj, mp_display_open);
static mp_obj_t mp_display_close()
{
......@@ -192,26 +210,6 @@ static mp_obj_t mp_display_close()
}
return mp_const_none;
}
/* Create an object for this function */
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_print_obj, 5, 5, mp_display_print
);
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_pixel_obj, 3, 3, mp_display_pixel
);
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_line_obj, 7, 7, mp_display_line
);
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_rect_obj, 7, 7, mp_display_rect
);
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_circ_obj, 6, 6, mp_display_circ
);
STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_clear_obj, mp_display_clear);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(display_update_obj, mp_display_update);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(display_open_obj, mp_display_open);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(display_close_obj, mp_display_close);
/* The globals table for this module */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment