diff --git a/py/objcomplex.c b/py/objcomplex.c index af148a2786..24762e8b11 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -24,9 +24,9 @@ mp_obj_t mp_obj_new_complex(mp_float_t real, mp_float_t imag); void complex_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) { mp_obj_complex_t *o = o_in; if (o->real == 0) { - print(env, "%.8gj", o->imag); + print(env, "%.8gj", (double) o->imag); } else { - print(env, "(%.8g+%.8gj)", o->real, o->imag); + print(env, "(%.8g+%.8gj)", (double) o->real, (double) o->imag); } } diff --git a/py/objfloat.c b/py/objfloat.c index 9f1f478cab..69fd65e199 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -21,7 +21,7 @@ mp_obj_t mp_obj_new_float(mp_float_t value); static void float_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) { mp_obj_float_t *o = o_in; - print(env, "%.8g", o->value); + print(env, "%.8g", (double) o->value); } static mp_obj_t float_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { diff --git a/stm/lcd.c b/stm/lcd.c index dae4157a46..6f5019db1b 100644 --- a/stm/lcd.c +++ b/stm/lcd.c @@ -41,6 +41,16 @@ #define PYB_LCD_BL_PORT (GPIOB) #define PYB_LCD_BL_PIN (GPIO_Pin_1) // Y12 = PB1 */ +#elif defined(STM32F4DISC) +/* Configure if needed */ +#define PYB_LCD_PORT (GPIOA) +#define PYB_LCD_CS1_PIN (GPIO_Pin_2) // X3 +#define PYB_LCD_RST_PIN (GPIO_Pin_3) // X4 +#define PYB_LCD_A0_PIN (GPIO_Pin_4) // X5 +#define PYB_LCD_SCL_PIN (GPIO_Pin_5) // X6 +#define PYB_LCD_SI_PIN (GPIO_Pin_7) // X8 +#define PYB_LCD_BL_PORT (GPIOC) +#define PYB_LCD_BL_PIN (GPIO_Pin_5) // X12 #endif #define LCD_INSTR (0) diff --git a/stm/printf.c b/stm/printf.c index 82b168d1c4..2669a55344 100644 --- a/stm/printf.c +++ b/stm/printf.c @@ -6,6 +6,7 @@ #include "misc.h" #include "systick.h" #include "mpconfig.h" +#include "mpconfigport.h" #include "qstr.h" #include "obj.h" #include "lcd.h" @@ -247,7 +248,9 @@ void stdout_print_strn(void *data, const char *str, unsigned int len) { any = true; } if (!any) { +#if MICROPY_HW_HAS_LCD lcd_print_strn(str, len); +#endif } }