From 7a16fadbf843ca5d49fb20b5f5785ffccfd9019f Mon Sep 17 00:00:00 2001 From: ian-v Date: Mon, 6 Jan 2014 09:52:29 -0800 Subject: Co-exist with C++ (issue #85) --- stm/servo.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'stm/servo.c') diff --git a/stm/servo.c b/stm/servo.c index 31190ce795..7facce7456 100644 --- a/stm/servo.c +++ b/stm/servo.c @@ -137,14 +137,15 @@ static mp_obj_t servo_obj_angle(mp_obj_t self_in, mp_obj_t angle) { static MP_DEFINE_CONST_FUN_OBJ_2(servo_obj_angle_obj, servo_obj_angle); +static const mp_method_t servo_obj_type_methods[] = { + { "angle", &servo_obj_angle_obj }, + { NULL, NULL }, +}; static const mp_obj_type_t servo_obj_type = { { &mp_const_type }, "Servo", .print = servo_obj_print, - .methods = { - { "angle", &servo_obj_angle_obj }, - { NULL, NULL }, - } + .methods = servo_obj_type_methods, }; mp_obj_t pyb_Servo(mp_obj_t servo_id) { -- cgit v1.2.3