summaryrefslogtreecommitdiff
path: root/stmhal/adc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-04-18 15:54:15 +0100
committerDamien George <damien.p.george@gmail.com>2015-04-18 21:40:58 +0100
commitc92c7a69fd87ad0c2d330271bc67aaf9d4838fc3 (patch)
tree5f31f5de224fb6bfcd18634dec5964d2dd9fa733 /stmhal/adc.c
parent7d6595fd188487670635d3e870b6cb6c67edd022 (diff)
stmhal: Exclude code for those timers that don't exist in the hardware.
Diffstat (limited to 'stmhal/adc.c')
-rw-r--r--stmhal/adc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stmhal/adc.c b/stmhal/adc.c
index 57e2e60d2..92df7aee5 100644
--- a/stmhal/adc.c
+++ b/stmhal/adc.c
@@ -212,6 +212,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(adc_read_obj, adc_read);
/// print(val) # print the value out
///
/// This function does not allocate any memory.
+#if defined(TIM6)
STATIC mp_obj_t adc_read_timed(mp_obj_t self_in, mp_obj_t buf_in, mp_obj_t freq_in) {
pyb_obj_adc_t *self = self_in;
@@ -274,10 +275,13 @@ STATIC mp_obj_t adc_read_timed(mp_obj_t self_in, mp_obj_t buf_in, mp_obj_t freq_
return mp_obj_new_int(bufinfo.len);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_3(adc_read_timed_obj, adc_read_timed);
+#endif
STATIC const mp_map_elem_t adc_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&adc_read_obj},
+ #if defined(TIM6)
{ MP_OBJ_NEW_QSTR(MP_QSTR_read_timed), (mp_obj_t)&adc_read_timed_obj},
+ #endif
};
STATIC MP_DEFINE_CONST_DICT(adc_locals_dict, adc_locals_dict_table);