diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-29 21:57:30 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-29 21:57:30 +0000 |
commit | 64563e39b3b6456a50b3ad04a61809ebb7b61b4b (patch) | |
tree | 3caaf053d945342fb6d9d5aa97617432ee0f05cb /stmhal/modpyb.c | |
parent | f4417a1f95eca0ef0a9446059e3ed070dd5e4b6f (diff) | |
download | micropython-64563e39b3b6456a50b3ad04a61809ebb7b61b4b.tar.gz micropython-64563e39b3b6456a50b3ad04a61809ebb7b61b4b.zip |
stmhal: Add CDC+HID USB device.
The HID device must appear before the CDC in order for both to work at
the same time.
Whilst the code is working, it's not currently used.
Diffstat (limited to 'stmhal/modpyb.c')
-rw-r--r-- | stmhal/modpyb.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c index 45bd8b1e0f..6bdb2db846 100644 --- a/stmhal/modpyb.c +++ b/stmhal/modpyb.c @@ -28,9 +28,7 @@ #include "servo.h" #include "dac.h" #include "i2c.h" -#if 0 #include "usb.h" -#endif #include "modpyb.h" #include "ff.h" @@ -185,15 +183,14 @@ STATIC mp_obj_t pyb_standby(void) { MP_DEFINE_CONST_FUN_OBJ_0(pyb_standby_obj, pyb_standby); STATIC mp_obj_t pyb_hid_send_report(mp_obj_t arg) { -#if 0 - mp_obj_t *items = mp_obj_get_array_fixed_n(arg, 4); + mp_obj_t *items; + mp_obj_get_array_fixed_n(arg, 4, &items); uint8_t data[4]; data[0] = mp_obj_get_int(items[0]); data[1] = mp_obj_get_int(items[1]); data[2] = mp_obj_get_int(items[2]); data[3] = mp_obj_get_int(items[3]); usb_hid_send_report(data); -#endif return mp_const_none; } @@ -267,9 +264,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_Accel), (mp_obj_t)&pyb_accel_type }, #endif -#if 0 { MP_OBJ_NEW_QSTR(MP_QSTR_hid), (mp_obj_t)&pyb_hid_send_report_obj }, -#endif // input { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&pyb_input_obj }, |