From beb33ff24451f1f03f7fd0074a839b4c292faee4 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Thu, 22 Oct 2020 22:17:13 +0200 Subject: [PATCH] Moved constants for screen dimensions to platform-dependent hwconfig file --- meson.build | 7 ++++--- platform/drivers/display/HX83XX_md380.c | 5 +---- platform/targets/MD380/hwconfig.h | 27 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 platform/targets/MD380/hwconfig.h diff --git a/meson.build b/meson.build index e69f48b8..2e45cd48 100644 --- a/meson.build +++ b/meson.build @@ -58,12 +58,12 @@ def = {'DONT_USE_CMSIS_INIT': ''} ## Linux linux_src = src + ['tests/platform/x64_uC.c', 'platform/drivers/display/display_libSDL.c', - 'openrtx/src/graphics/graphics_rgb565.c', + 'openrtx/src/graphics/graphics_bw.c', 'rtos/uC-OS3/Ports/POSIX/os_cpu_c.c', 'rtos/uC-CPU/Posix/cpu_c.c'] -linux_def = def + {'SCREEN_WIDTH': '160', 'SCREEN_HEIGHT': '128', 'PIX_FMT_RGB565': ''} +linux_def = def + {'SCREEN_WIDTH': '160', 'SCREEN_HEIGHT': '128', 'PIX_FMT_BW': ''} linux_inc = inc + ['rtos/uC-OS3/Ports/POSIX', 'rtos/uC-CPU/Posix'] @@ -102,12 +102,13 @@ md380_src = src + ['openrtx/src/main.c', 'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M/cpu_c.c', 'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M/cpu_a.s'] -md380_def = def + {'SCREEN_WIDTH': '160', 'SCREEN_HEIGHT': '128', 'STM32F40_41xxx': ''} +md380_def = def + {'STM32F40_41xxx': ''} md380_inc = inc + ['platform/mcu/CMSIS/Include', 'platform/mcu/CMSIS/Device/ST/STM32F4xx/Include', 'platform/mcu/STM32F4xx', 'platform/mcu/STM32F4xx/drivers/usb', + 'platform/targets/MD380', 'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M', 'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M'] diff --git a/platform/drivers/display/HX83XX_md380.c b/platform/drivers/display/HX83XX_md380.c index 47e8f3f2..57ac7b20 100644 --- a/platform/drivers/display/HX83XX_md380.c +++ b/platform/drivers/display/HX83XX_md380.c @@ -23,6 +23,7 @@ #include "gpio.h" #include "display.h" #include "delays.h" +#include "hwconfig.h" /* Defines for GPIO control, really ugly but useful. */ #define D0 GPIOD,14 @@ -100,10 +101,6 @@ #define LCD_FSMC_ADDR_COMMAND 0x60000000 #define LCD_FSMC_ADDR_DATA 0x60040000 -/* Screen dimensions */ -#define SCREEN_WIDTH 160 -#define SCREEN_HEIGHT 128 - /* * LCD framebuffer, allocated on the heap by display_init(). * Pixel format is RGB565, 16 bit per pixel diff --git a/platform/targets/MD380/hwconfig.h b/platform/targets/MD380/hwconfig.h new file mode 100644 index 00000000..3404cc70 --- /dev/null +++ b/platform/targets/MD380/hwconfig.h @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (C) 2020 by Federico Amedeo Izzo IU2NUO, * + * Niccolò Izzo IU2KIN * + * Silvano Seva IU2KWO * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see * + ***************************************************************************/ + +#ifndef HWCONFIG_H +#define HWCONFIG_H + +/* Screen dimensions */ +#define SCREEN_WIDTH 160 +#define SCREEN_HEIGHT 128 + +#endif