summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/dac.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/dac.c')
-rw-r--r--stmhal/dac.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/stmhal/dac.c b/stmhal/dac.c
index 22622d4747..5e809412e9 100644
--- a/stmhal/dac.c
+++ b/stmhal/dac.c
@@ -180,12 +180,8 @@ mp_obj_t pyb_dac_dma(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
// set TIM6 to trigger the DAC at the given frequency
TIM6_Config(mp_obj_get_int(args[2]));
- mp_obj_type_t *type = mp_obj_get_type(args[1]);
- if (type->buffer_p.get_buffer == NULL) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "buffer argument must support buffer protocol"));
- }
buffer_info_t bufinfo;
- type->buffer_p.get_buffer(args[1], &bufinfo, BUFFER_READ);
+ mp_get_buffer_raise(args[1], &bufinfo);
__DMA1_CLK_ENABLE();