提交 efe00652 编写于 作者: xuzhuoyi96's avatar xuzhuoyi96

[bsp][stm32f429-disco] Change to use rt_components_init()

上级 68c5cc39
......@@ -34,8 +34,6 @@
void rt_init_thread_entry(void* parameter)
{
rt_device_t lcd;
/* GDB STUB */
#ifdef RT_USING_GDB
gdb_set_device("uart6");
......@@ -57,13 +55,9 @@ void rt_init_thread_entry(void* parameter)
rt_kprintf("TCP/IP initialized!\n");
}
#endif
rt_components_init();
#ifdef RT_USING_FINSH
finsh_system_init();
#endif
lcd = rt_device_find("lcd");
rtgui_graphic_set_device(lcd);
rt_gui_demo_init();
}
int rt_application_init()
......
......@@ -15,11 +15,16 @@
#include <rthw.h>
#include <rtthread.h>
#ifdef PKG_USING_GUIENGINE
#include <rtgui/driver.h>
#endif
#include "stm32f4xx.h"
#include "board.h"
#include "usart.h"
#include "stm32f4xx_hal.h"
void _init(void)
{
......@@ -133,6 +138,8 @@ void HAL_Delay(__IO uint32_t Delay)
*/
void rt_hw_board_init()
{
rt_device_t lcd;
HAL_Init();
SystemClock_Config();
......@@ -142,10 +149,16 @@ void rt_hw_board_init()
#else
stm32_hw_usart_init();
#endif
#ifdef RT_USING_CONSOLE
rt_console_set_device(CONSOLE_DEVICE);
#endif
#ifdef RT_USING_CONSOLE
lcd = rt_device_find("lcd");
rtgui_graphic_set_device(lcd);
#endif
}
/*@}*/
......@@ -655,7 +655,7 @@ uint8_t BSP_LCD_Init(void)
void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code)
{
/* Write data value to all SDRAM memory */
*(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*240 + Xpos))) = RGB_Code;
*(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*240 + Xpos))) = RGB_Code;
}
void BSP_LCD_DrawLine(uint32_t pixel, uint16_t X1, uint16_t Y1, uint16_t X2, uint16_t Y2)
......@@ -926,7 +926,7 @@ static rt_err_t lcd_control(rt_device_t dev, int cmd, void *args)
static void ili9341_lcd_set_pixel(const char* pixel, int x, int y)
{
*(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(y * 240 + x))) = *(uint16_t *)pixel;
*(__IO uint16_t*)(LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(y * 240 + x))) = *(uint16_t *)pixel;
}
#ifdef RT_USING_FINSH
static void lcd_set_pixel(uint16_t color, int x, int y)
......@@ -1006,7 +1006,7 @@ static void ili9341_lcd_blit_line(const char* pixels, int x, int y, rt_size_t si
{
int i = 0;
while(size--)
*(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(y*240 + x + i++))) = *(uint16_t *)pixels++;
*(__IO uint16_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(y*240 + x + i++))) = *(uint16_t *)pixels++;
}
#ifdef RT_USING_FINSH
#define LINE_LEN 30
......
......@@ -25,7 +25,7 @@
#include <board.h>
#define SDRAM_BANK_ADDR ((uint32_t)0xD0000000)
#define SDRAM_BANK_ADDR ((uint32_t)0xD0030000) /*0xD0000000-0xD002FFFF used for LCD framebuffer*/
/* #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_8 */
#define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册