summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormux <freelancer.c@gmail.com>2014-01-10 11:19:34 +0200
committermux <freelancer.c@gmail.com>2014-01-10 11:19:34 +0200
commite98cc2b6912a4698f5fb33cc9093c77600a32ef6 (patch)
treebe3381cb25d791b765f465a24da50a7dd7102662
parentab04f5804f72181076af4e61fe9377a7e2dbafa1 (diff)
Fix usart_obj_tx_str
* Fix usart_obj_tx_str to send the actual string. * Fix issue #126
-rw-r--r--stm/usart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stm/usart.c b/stm/usart.c
index 9adc7d6ae..bc5bfc736 100644
--- a/stm/usart.c
+++ b/stm/usart.c
@@ -205,8 +205,10 @@ static mp_obj_t usart_obj_tx_char(mp_obj_t self_in, mp_obj_t c) {
static mp_obj_t usart_obj_tx_str(mp_obj_t self_in, mp_obj_t s) {
pyb_usart_obj_t *self = self_in;
if (self->is_enabled) {
- //usart_tx_str(self->usart_id, mp_obj_get_str(s));
- usart_tx_str(self->usart_id, "test");
+ if (MP_OBJ_IS_TYPE(s, &str_type)) {
+ const char *str = qstr_str(mp_obj_get_qstr(s));
+ usart_tx_str(self->usart_id, str);
+ }
}
return mp_const_none;
}