diff --git a/ili9341.c b/ili9341.c index 06563d6..9b3686b 100644 --- a/ili9341.c +++ b/ili9341.c @@ -523,17 +523,21 @@ void ili9341_clear_screen(void) { ili9341_fill(0, 0, ILI9341_WIDTH, ILI9341_HEIGHT, background_color); } -#if 0 + +#ifndef ili9341_set_foreground void ili9341_set_foreground(uint16_t fg) { foreground_color = fg; } +#endif +#ifndef ili9341_set_background void ili9341_set_background(uint16_t bg) { background_color = bg; } #endif + void ili9341_set_rotation(uint8_t r) { // static const uint8_t rotation_const[]={DISPLAY_ROTATION_0, DISPLAY_ROTATION_90, diff --git a/main.c b/main.c index 7a42927..08b2e2b 100644 --- a/main.c +++ b/main.c @@ -2797,8 +2797,8 @@ void hard_fault_handler_c(uint32_t *sp) int y = 0; int x = OFFSETX + 1; static char buf[96]; - ili9341_set_background(0x0000); - ili9341_set_foreground(0xFFFF); + ili9341_set_background(DEFAULT_BG_COLOR); + ili9341_set_foreground(DEFAULT_FG_COLOR); plot_printf(buf, sizeof(buf), "SP 0x%08x", (uint32_t)sp);ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT); plot_printf(buf, sizeof(buf), "R0 0x%08x", r0);ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT); diff --git a/nanovna.h b/nanovna.h index baaa90b..ae88c5c 100644 --- a/nanovna.h +++ b/nanovna.h @@ -540,13 +540,15 @@ void ili9341_init(void); void ili9341_test(int mode); void ili9341_bulk(int x, int y, int w, int h); void ili9341_fill(int x, int y, int w, int h, uint16_t color); -#if 0 + +#if 1 void ili9341_set_foreground(uint16_t fg); void ili9341_set_background(uint16_t fg); #else #define ili9341_set_foreground(fg) { foreground_color = fg; } #define ili9341_set_background(bg) { background_color = bg;} #endif + void ili9341_clear_screen(void); void blit8BitWidthBitmap(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const uint8_t *bitmap); void ili9341_drawchar(uint8_t ch, int x, int y);