diff --git a/meson.build b/meson.build index 2e45cd48..7b27c380 100644 --- a/meson.build +++ b/meson.build @@ -96,6 +96,7 @@ md380_src = src + ['openrtx/src/main.c', 'platform/mcu/STM32F4xx/drivers/gpio.c', 'platform/mcu/CMSIS/Device/ST/STM32F4xx/Source/system_stm32f4xx.c', 'platform/drivers/display/HX83XX_md380.c', + 'platform/targets/MD380/platform.c', 'openrtx/src/graphics/graphics_rgb565.c', 'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M/os_cpu_c.c', 'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M/os_cpu_a.s', diff --git a/platform/targets/MD380/platform.c b/platform/targets/MD380/platform.c index bebba5a6..10ed5d28 100644 --- a/platform/targets/MD380/platform.c +++ b/platform/targets/MD380/platform.c @@ -19,6 +19,7 @@ #include #include "platform.h" +#include "hwconfig.h" #include "gpio.h" void platform_init() diff --git a/tests/platform/MD380_display.c b/tests/platform/MD380_display.c index a8e96d60..a4b68d81 100644 --- a/tests/platform/MD380_display.c +++ b/tests/platform/MD380_display.c @@ -23,10 +23,11 @@ #include #include #include -#include "stm32f4xx.h" #include "gpio.h" #include "delays.h" #include "display.h" +#include "hwconfig.h" +#include "platform.h" static OS_TCB startTCB; static CPU_STK_SIZE startStk[APP_CFG_TASK_START_STK_SIZE]; @@ -50,7 +51,7 @@ void drawRect(int x, int y, int width, int height, uint16_t color) { for(int j=x; j < x_max; j++) { - buf[j + i*display_screenWidth()] = color; + buf[j + i*SCREEN_WIDTH] = color; } } } @@ -142,18 +143,19 @@ static void t2(void *arg) OS_ERR os_err; display_init(); - display_setBacklightLevel(254); + platform_init(); + platform_setBacklightLevel(254); while(1) { /* Horizontal red line */ - drawRect(0, 10, display_screenWidth(), 20, 0xF800); + drawRect(0, 10, SCREEN_WIDTH, 20, 0xF800); /* Vertical blue line */ - drawRect(10, 0, 20, display_screenHeight(), 0x001F); + drawRect(10, 0, 20, SCREEN_HEIGHT, 0x001F); /* Vertical green line */ - drawRect(80, 0, 20, display_screenHeight(), 0x07e0); + drawRect(80, 0, 20, SCREEN_HEIGHT, 0x07e0); display_render();