diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-08-17 16:51:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-17 16:51:45 -0700 |
| commit | 4a4d84ba42fb84032b31344e14fc3bb1f9e8dce2 (patch) | |
| tree | ed2e486dea85dd416975d30e6beca608ce5597bc /py/obj.h | |
| parent | 5dd420f7ff2c87a5412a55fea29eb21615a89e14 (diff) | |
| parent | 11cbeb87adb10883fe46c46bd4e22e3ad3991ed3 (diff) | |
Merge pull request #1064 from notro/i2cslave
Add busio.I2CSlave
Diffstat (limited to 'py/obj.h')
| -rw-r--r-- | py/obj.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -295,6 +295,13 @@ typedef struct _mp_rom_obj_t { mp_const_obj_t o; } mp_rom_obj_t; #define MP_DEFINE_CONST_FUN_OBJ_KW(obj_name, n_args_min, fun_name) \ const mp_obj_fun_builtin_var_t obj_name = \ {{&mp_type_fun_builtin_var}, true, n_args_min, MP_OBJ_FUN_ARGS_MAX, .fun.kw = fun_name} +#define MP_DEFINE_CONST_PROP_GET(obj_name, fun_name) \ + const mp_obj_fun_builtin_fixed_t fun_name##_obj = {{&mp_type_fun_builtin_1}, .fun._1 = fun_name}; \ + const mp_obj_property_t obj_name = { \ + .base.type = &mp_type_property, \ + .proxy = {(mp_obj_t)&fun_name##_obj, \ + (mp_obj_t)&mp_const_none_obj, \ + (mp_obj_t)&mp_const_none_obj}, } // These macros are used to define constant map/dict objects // You can put "static" in front of the definition to make it local |
