From 55baff4c9bcbc001cbb8972c289ebfa356d4665b Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 21 Jan 2014 21:40:13 +0000 Subject: Revamp qstrs: they now include length and hash. Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h --- stm/audio.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'stm/audio.c') diff --git a/stm/audio.c b/stm/audio.c index e2aa32b9f..c1a0c8474 100644 --- a/stm/audio.c +++ b/stm/audio.c @@ -1,4 +1,5 @@ #include +#include #include "stm32f4xx_rcc.h" #include "stm32f4xx_gpio.h" @@ -7,6 +8,7 @@ #include "nlr.h" #include "misc.h" #include "mpconfig.h" +#include "qstr.h" #include "parse.h" #include "obj.h" #include "runtime.h" @@ -90,9 +92,9 @@ void audio_init(void) { // enable interrupt // Python interface - mp_obj_t m = mp_obj_new_module(qstr_from_str_static("audio")); - rt_store_attr(m, qstr_from_str_static("dac"), rt_make_function_n(1, pyb_audio_dac)); - rt_store_attr(m, qstr_from_str_static("is_full"), rt_make_function_n(0, pyb_audio_is_full)); - rt_store_attr(m, qstr_from_str_static("fill"), rt_make_function_n(1, pyb_audio_fill)); - rt_store_name(qstr_from_str_static("audio"), m); + mp_obj_t m = mp_obj_new_module(QSTR_FROM_STR_STATIC("audio")); + rt_store_attr(m, QSTR_FROM_STR_STATIC("dac"), rt_make_function_n(1, pyb_audio_dac)); + rt_store_attr(m, QSTR_FROM_STR_STATIC("is_full"), rt_make_function_n(0, pyb_audio_is_full)); + rt_store_attr(m, QSTR_FROM_STR_STATIC("fill"), rt_make_function_n(1, pyb_audio_fill)); + rt_store_name(QSTR_FROM_STR_STATIC("audio"), m); } -- cgit v1.2.3