Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Haun
firmware
Commits
d293ce3c
Verified
Commit
d293ce3c
authored
Jul 25, 2019
by
Rahix
Browse files
chore(pycardium): Use `static` instead of `STATIC`
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
6e001276
Changes
4
Hide whitespace changes
Inline
Side-by-side
pycardium/modules/interrupt.c
View file @
d293ce3c
...
...
@@ -23,7 +23,7 @@ void epic_isr_default_handler(api_int_id_t id)
}
}
STATIC
mp_obj_t
mp_interrupt_set_callback
(
mp_obj_t
id_in
,
mp_obj_t
callback_obj
)
static
mp_obj_t
mp_interrupt_set_callback
(
mp_obj_t
id_in
,
mp_obj_t
callback_obj
)
{
api_int_id_t
id
=
mp_obj_get_int
(
id_in
);
if
(
callback_obj
!=
mp_const_none
&&
...
...
@@ -39,7 +39,7 @@ STATIC mp_obj_t mp_interrupt_set_callback(mp_obj_t id_in, mp_obj_t callback_obj)
return
mp_const_none
;
}
STATIC
mp_obj_t
mp_interrupt_enable_callback
(
mp_obj_t
id_in
)
static
mp_obj_t
mp_interrupt_enable_callback
(
mp_obj_t
id_in
)
{
api_int_id_t
id
=
mp_obj_get_int
(
id_in
);
...
...
@@ -50,7 +50,7 @@ STATIC mp_obj_t mp_interrupt_enable_callback(mp_obj_t id_in)
return
mp_const_none
;
}
STATIC
mp_obj_t
mp_interrupt_disable_callback
(
mp_obj_t
id_in
)
static
mp_obj_t
mp_interrupt_disable_callback
(
mp_obj_t
id_in
)
{
api_int_id_t
id
=
mp_obj_get_int
(
id_in
);
...
...
@@ -61,18 +61,17 @@ STATIC mp_obj_t mp_interrupt_disable_callback(mp_obj_t id_in)
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_2
(
static
MP_DEFINE_CONST_FUN_OBJ_2
(
interrupt_set_callback_obj
,
mp_interrupt_set_callback
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
static
MP_DEFINE_CONST_FUN_OBJ_1
(
interrupt_enable_callback_obj
,
mp_interrupt_enable_callback
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
static
MP_DEFINE_CONST_FUN_OBJ_1
(
interrupt_disable_callback_obj
,
mp_interrupt_disable_callback
);
STATIC
const
mp_rom_map_elem_t
interrupt_module_globals_table
[]
=
{
static
const
mp_rom_map_elem_t
interrupt_module_globals_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM_QSTR
(
MP_QSTR_interrupt
)
},
{
MP_ROM_QSTR
(
MP_QSTR_set_callback
),
MP_ROM_PTR
(
&
interrupt_set_callback_obj
)
},
...
...
@@ -82,7 +81,7 @@ STATIC const mp_rom_map_elem_t interrupt_module_globals_table[] = {
MP_ROM_PTR
(
&
interrupt_disable_callback_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_BHI160
),
MP_OBJ_NEW_SMALL_INT
(
2
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
static
MP_DEFINE_CONST_DICT
(
interrupt_module_globals
,
interrupt_module_globals_table
);
...
...
pycardium/modules/light_sensor.c
View file @
d293ce3c
...
...
@@ -3,7 +3,7 @@
#include
"py/builtin.h"
#include
"epicardium.h"
STATIC
mp_obj_t
mp_light_sensor_start
()
static
mp_obj_t
mp_light_sensor_start
()
{
int
status
=
epic_light_sensor_run
();
if
(
status
==
-
EBUSY
)
{
...
...
@@ -13,9 +13,9 @@ STATIC mp_obj_t mp_light_sensor_start()
}
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
light_sensor_start_obj
,
mp_light_sensor_start
);
static
MP_DEFINE_CONST_FUN_OBJ_0
(
light_sensor_start_obj
,
mp_light_sensor_start
);
STATIC
mp_obj_t
mp_light_sensor_get_reading
()
static
mp_obj_t
mp_light_sensor_get_reading
()
{
uint16_t
last
;
int
status
=
epic_light_sensor_get
(
&
last
);
...
...
@@ -25,11 +25,11 @@ STATIC mp_obj_t mp_light_sensor_get_reading()
}
return
mp_obj_new_int_from_uint
(
last
);
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
static
MP_DEFINE_CONST_FUN_OBJ_0
(
light_sensor_get_obj
,
mp_light_sensor_get_reading
);
STATIC
mp_obj_t
mp_light_sensor_stop
()
static
mp_obj_t
mp_light_sensor_stop
()
{
int
status
=
epic_light_sensor_stop
();
if
(
status
==
-
EBUSY
)
{
...
...
@@ -39,15 +39,15 @@ STATIC mp_obj_t mp_light_sensor_stop()
}
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
light_sensor_stop_obj
,
mp_light_sensor_stop
);
static
MP_DEFINE_CONST_FUN_OBJ_0
(
light_sensor_stop_obj
,
mp_light_sensor_stop
);
STATIC
const
mp_rom_map_elem_t
light_sensor_module_globals_table
[]
=
{
static
const
mp_rom_map_elem_t
light_sensor_module_globals_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM_QSTR
(
MP_QSTR_light_sensor
)
},
{
MP_ROM_QSTR
(
MP_QSTR_start
),
MP_ROM_PTR
(
&
light_sensor_start_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_stop
),
MP_ROM_PTR
(
&
light_sensor_stop_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_get_reading
),
MP_ROM_PTR
(
&
light_sensor_get_obj
)
}
};
STATIC
MP_DEFINE_CONST_DICT
(
static
MP_DEFINE_CONST_DICT
(
light_sensor_module_globals
,
light_sensor_module_globals_table
);
...
...
pycardium/modules/sys_display.c
View file @
d293ce3c
...
...
@@ -48,7 +48,7 @@ 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
(
static
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
display_print_obj
,
5
,
5
,
mp_display_print
);
...
...
@@ -74,7 +74,7 @@ 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
(
static
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
display_pixel_obj
,
3
,
3
,
mp_display_pixel
);
...
...
@@ -108,7 +108,7 @@ 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
(
static
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
display_line_obj
,
7
,
7
,
mp_display_line
);
...
...
@@ -142,7 +142,7 @@ 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
(
static
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
display_rect_obj
,
7
,
7
,
mp_display_rect
);
...
...
@@ -166,7 +166,7 @@ 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
(
static
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
display_circ_obj
,
6
,
6
,
mp_display_circ
);
...
...
@@ -180,7 +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_DEFINE_CONST_FUN_OBJ_1
(
display_clear_obj
,
mp_display_clear
);
static
mp_obj_t
mp_display_update
()
{
...
...
@@ -190,7 +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_DEFINE_CONST_FUN_OBJ_0
(
display_update_obj
,
mp_display_update
);
static
mp_obj_t
mp_display_open
()
{
...
...
@@ -200,7 +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_DEFINE_CONST_FUN_OBJ_0
(
display_open_obj
,
mp_display_open
);
static
mp_obj_t
mp_display_close
()
{
...
...
@@ -210,7 +210,7 @@ static mp_obj_t mp_display_close()
}
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
display_close_obj
,
mp_display_close
);
static
MP_DEFINE_CONST_FUN_OBJ_0
(
display_close_obj
,
mp_display_close
);
/* The globals table for this module */
static
const
mp_rom_map_elem_t
display_module_globals_table
[]
=
{
...
...
pycardium/modules/vibra.c
View file @
d293ce3c
...
...
@@ -3,7 +3,7 @@
#include
"py/builtin.h"
#include
"epicardium.h"
STATIC
mp_obj_t
mp_vibra_set
(
mp_obj_t
state_obj
)
static
mp_obj_t
mp_vibra_set
(
mp_obj_t
state_obj
)
{
if
(
state_obj
==
mp_const_true
)
{
epic_vibra_set
(
1
);
...
...
@@ -14,22 +14,22 @@ STATIC mp_obj_t mp_vibra_set(mp_obj_t state_obj)
}
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
vibra_set_obj
,
mp_vibra_set
);
static
MP_DEFINE_CONST_FUN_OBJ_1
(
vibra_set_obj
,
mp_vibra_set
);
STATIC
mp_obj_t
mp_vibra_vibrate
(
mp_obj_t
a_obj
)
static
mp_obj_t
mp_vibra_vibrate
(
mp_obj_t
a_obj
)
{
int
millis
=
mp_obj_get_int
(
a_obj
);
epic_vibra_vibrate
(
millis
);
return
mp_const_none
;
int
millis
=
mp_obj_get_int
(
a_obj
);
epic_vibra_vibrate
(
millis
);
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
vibra_vibrate_obj
,
mp_vibra_vibrate
);
static
MP_DEFINE_CONST_FUN_OBJ_1
(
vibra_vibrate_obj
,
mp_vibra_vibrate
);
STATIC
const
mp_rom_map_elem_t
vibra_module_globals_table
[]
=
{
static
const
mp_rom_map_elem_t
vibra_module_globals_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM_QSTR
(
MP_QSTR_vibra
)
},
{
MP_ROM_QSTR
(
MP_QSTR_set
),
MP_ROM_PTR
(
&
vibra_set_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_vibrate
),
MP_ROM_PTR
(
&
vibra_vibrate_obj
)
}
{
MP_ROM_QSTR
(
MP_QSTR_vibrate
),
MP_ROM_PTR
(
&
vibra_vibrate_obj
)
}
};
STATIC
MP_DEFINE_CONST_DICT
(
vibra_module_globals
,
vibra_module_globals_table
);
static
MP_DEFINE_CONST_DICT
(
vibra_module_globals
,
vibra_module_globals_table
);
// Define module object.
const
mp_obj_module_t
vibra_module
=
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment