aboutsummaryrefslogtreecommitdiff
path: root/stmhal/usrsw.h
diff options
context:
space:
mode:
authorDamien George2014-04-21 18:23:50 +0100
committerDamien George2014-04-21 18:23:50 +0100
commit6125ba4a7f9d757abd89f85745f458e52e2ef6fb (patch)
treeec19b9cef0fc8c4630f54816cc9466cb5c8e4cd6 /stmhal/usrsw.h
parentaf797f476fe03b7c1f6c645f0e43df5ca3254bc3 (diff)
stmhal: Make switch a class, to follow suit of all other modules.
Instead of pyb.switch() as a function, it's more consistent (with respect to all the other modules and peripherals) to have pyb.Switch() create a switch object. This then generalises to having multiple switches. Call the object to get its state. Use sw.callback to set the callback function for when the switch is pressed.
Diffstat (limited to 'stmhal/usrsw.h')
-rw-r--r--stmhal/usrsw.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/stmhal/usrsw.h b/stmhal/usrsw.h
index b1b838653..f60147c54 100644
--- a/stmhal/usrsw.h
+++ b/stmhal/usrsw.h
@@ -1,5 +1,4 @@
void switch_init0(void);
-void switch_init(void);
int switch_get(void);
-MP_DECLARE_CONST_FUN_OBJ(pyb_switch_obj);
+extern const mp_obj_type_t pyb_switch_type;