From bd61a6cee8f348b0c4fcc21031b0eceba7dc0cb9 Mon Sep 17 00:00:00 2001 From: mux Date: Mon, 27 Jan 2014 10:56:47 +0200 Subject: Add missing LCD driver definitions for STM32F4DISC * Add missing LCD definitions for STM32F4DISC target, current code breaks build. --- stm/lcd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'stm') diff --git a/stm/lcd.c b/stm/lcd.c index dae4157a4..6f5019db1 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) -- cgit v1.2.3 From 8d3b0a9f74c39f5876b74a5829bddf0c0588276b Mon Sep 17 00:00:00 2001 From: mux Date: Mon, 27 Jan 2014 18:53:16 +0200 Subject: Add LCD check to stdout_print_strn --- stm/printf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'stm') diff --git a/stm/printf.c b/stm/printf.c index 82b168d1c..2669a5534 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 } } -- cgit v1.2.3