Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
6e001276
Verified
Commit
6e001276
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
chore(pycardium): Move object definitions to their functions
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
5c6cc3e9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pycardium/modules/sys_display.c
+18
-20
18 additions, 20 deletions
pycardium/modules/sys_display.c
with
18 additions
and
20 deletions
pycardium/modules/sys_display.c
+
18
−
20
View file @
6e001276
...
...
@@ -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 */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment