Make more type structures const to save RAM.

This commit is contained in:
Scott Shawcroft 2017-02-24 15:23:26 +01:00
parent e0ef7e3092
commit baf3ff377e
6 changed files with 11 additions and 11 deletions

View File

@ -118,7 +118,7 @@ STATIC mp_obj_t nativeio_analogin_obj_get_value(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(nativeio_analogin_get_value_obj, nativeio_analogin_obj_get_value);
mp_obj_property_t nativeio_analogin_value_obj = {
const mp_obj_property_t nativeio_analogin_value_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_analogin_get_value_obj,
(mp_obj_t)&mp_const_none_obj,
@ -139,7 +139,7 @@ STATIC mp_obj_t nativeio_analogin_obj_get_reference_voltage(mp_obj_t self_in) {
MP_DEFINE_CONST_FUN_OBJ_1(nativeio_analogin_get_reference_voltage_obj,
nativeio_analogin_obj_get_reference_voltage);
mp_obj_property_t nativeio_analogin_reference_voltage_obj = {
const mp_obj_property_t nativeio_analogin_reference_voltage_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_analogin_get_reference_voltage_obj,
(mp_obj_t)&mp_const_none_obj,

View File

@ -120,7 +120,7 @@ STATIC mp_obj_t nativeio_analogout_obj_set_value(mp_obj_t self_in, mp_obj_t valu
}
MP_DEFINE_CONST_FUN_OBJ_2(nativeio_analogout_set_value_obj, nativeio_analogout_obj_set_value);
mp_obj_property_t nativeio_analogout_value_obj = {
const mp_obj_property_t nativeio_analogout_value_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&nativeio_analogout_set_value_obj,

View File

@ -199,7 +199,7 @@ STATIC mp_obj_t nativeio_digitalinout_obj_get_direction(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(nativeio_digitalinout_get_direction_obj, nativeio_digitalinout_obj_get_direction);
mp_obj_property_t nativeio_digitalinout_direction_obj = {
const mp_obj_property_t nativeio_digitalinout_direction_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_digitalinout_get_direction_obj,
(mp_obj_t)&mp_const_none_obj,
@ -228,7 +228,7 @@ STATIC mp_obj_t nativeio_digitalinout_obj_set_value(mp_obj_t self_in, mp_obj_t v
}
MP_DEFINE_CONST_FUN_OBJ_2(nativeio_digitalinout_set_value_obj, nativeio_digitalinout_obj_set_value);
mp_obj_property_t nativeio_digitalinout_value_obj = {
const mp_obj_property_t nativeio_digitalinout_value_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_digitalinout_get_value_obj,
(mp_obj_t)&nativeio_digitalinout_set_value_obj,
@ -268,7 +268,7 @@ STATIC mp_obj_t nativeio_digitalinout_obj_set_drive_mode(mp_obj_t self_in, mp_ob
}
MP_DEFINE_CONST_FUN_OBJ_2(nativeio_digitalinout_set_drive_mode_obj, nativeio_digitalinout_obj_set_drive_mode);
mp_obj_property_t nativeio_digitalinout_drive_mode_obj = {
const mp_obj_property_t nativeio_digitalinout_drive_mode_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_digitalinout_get_drive_mode_obj,
(mp_obj_t)&nativeio_digitalinout_set_drive_mode_obj,
@ -314,7 +314,7 @@ STATIC mp_obj_t nativeio_digitalinout_obj_set_pull(mp_obj_t self_in, mp_obj_t pu
}
MP_DEFINE_CONST_FUN_OBJ_2(nativeio_digitalinout_set_pull_obj, nativeio_digitalinout_obj_set_pull);
mp_obj_property_t nativeio_digitalinout_pull_obj = {
const mp_obj_property_t nativeio_digitalinout_pull_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_digitalinout_get_pull_obj,
(mp_obj_t)&nativeio_digitalinout_set_pull_obj,

View File

@ -162,7 +162,7 @@ STATIC mp_obj_t nativeio_pwmout_obj_set_duty_cycle(mp_obj_t self_in, mp_obj_t du
}
MP_DEFINE_CONST_FUN_OBJ_2(nativeio_pwmout_set_duty_cycle_obj, nativeio_pwmout_obj_set_duty_cycle);
mp_obj_property_t nativeio_pwmout_duty_cycle_obj = {
const mp_obj_property_t nativeio_pwmout_duty_cycle_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_pwmout_get_duty_cycle_obj,
(mp_obj_t)&nativeio_pwmout_set_duty_cycle_obj,
@ -192,7 +192,7 @@ STATIC mp_obj_t nativeio_pwmout_obj_set_frequency(mp_obj_t self_in, mp_obj_t fre
}
MP_DEFINE_CONST_FUN_OBJ_2(nativeio_pwmout_set_frequency_obj, nativeio_pwmout_obj_set_frequency);
mp_obj_property_t nativeio_pwmout_frequency_obj = {
const mp_obj_property_t nativeio_pwmout_frequency_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_pwmout_get_frequency_obj,
(mp_obj_t)&nativeio_pwmout_set_frequency_obj,

View File

@ -114,7 +114,7 @@ STATIC mp_obj_t nativeio_touchin_obj_get_value(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(nativeio_touchin_get_value_obj, nativeio_touchin_obj_get_value);
mp_obj_property_t nativeio_touchin_value_obj = {
const mp_obj_property_t nativeio_touchin_value_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&nativeio_touchin_get_value_obj,
(mp_obj_t)&mp_const_none_obj,

View File

@ -103,7 +103,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, size_t n
//| :param int tm_yday: the day of the year, range [1, 366], -1 indicates not known
//| :param int tm_isdst: 1 when in daylight savings, 0 when not, -1 if unknown.
//|
mp_obj_namedtuple_type_t struct_time_type_obj = {
const mp_obj_namedtuple_type_t struct_time_type_obj = {
.base = {
.base = {
.type = &mp_type_type