Skip to content

Commit f1566aa

Browse files
authored
Merge pull request #61 from YuzukiHD/dev
avaota-a1 add lcd warn info
2 parents a0bef1e + 5314061 commit f1566aa

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

board/avaota-a1/extlinux_boot/main.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ static int fatfs_loadimage_size(char *filename, BYTE *dest, uint32_t *file_size)
125125
fret = f_open(&file, filename, FA_OPEN_EXISTING | FA_READ);
126126
if (fret != FR_OK) {
127127
printk(LOG_LEVEL_ERROR, "FATFS: open, filename: [%s]: error %d\n", filename, fret);
128+
LCD_ShowString(0, 0, "WARN: Open file fail, filename:", SPI_LCD_COLOR_YELLOW, SPI_LCD_COLOR_BLACK, 12);
129+
LCD_ShowString(10, 12, filename, SPI_LCD_COLOR_YELLOW, SPI_LCD_COLOR_BLACK, 12);
128130
ret = -1;
129131
goto open_fail;
130132
}
@@ -687,9 +689,10 @@ int main(void) {
687689
printk(LOG_LEVEL_INFO, "ATF: Kernel addr: 0x%08x\n", atf_head->nos_base);
688690
printk(LOG_LEVEL_INFO, "ATF: Kernel DTB addr: 0x%08x\n", atf_head->dtb_base);
689691

690-
LCD_ShowString(0, 0, "SyterKit Now Booting", SPI_LCD_COLOR_GREEN, SPI_LCD_COLOR_BLACK, 12);
691-
LCD_ShowString(0, 12, "Kernel addr: 0x40800000", SPI_LCD_COLOR_GREEN, SPI_LCD_COLOR_BLACK, 12);
692-
LCD_ShowString(0, 24, "DTB addr: 0x40400000", SPI_LCD_COLOR_GREEN, SPI_LCD_COLOR_BLACK, 12);
692+
/* flush buffer */
693+
LCD_ShowString(0, 0, "SyterKit Now Booting Linux ", SPI_LCD_COLOR_GREEN, SPI_LCD_COLOR_BLACK, 12);
694+
LCD_ShowString(0, 12, "Kernel Addr: 0x40800000 ", SPI_LCD_COLOR_GREEN, SPI_LCD_COLOR_BLACK, 12);
695+
LCD_ShowString(0, 24, "DTB Addr: 0x40400000 ", SPI_LCD_COLOR_GREEN, SPI_LCD_COLOR_BLACK, 12);
693696

694697
clean_syterkit_data();
695698

board/avaota-a1/extlinux_boot/spi_lcd.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@
5050

5151
static sunxi_spi_t sunxi_spi0_lcd = {
5252
.base = SUNXI_R_SPI_BASE,
53+
.clk_reg = {
54+
.ccu_base = SUNXI_R_PRCM_BASE,
55+
.spi_clk_reg_offest = SUNXI_S_SPI_CLK_REG,
56+
.spi_bgr_reg_offset = SUNXI_S_SPI_BGR_REG,
57+
},
5358
.id = 0,
5459
.clk_rate = 75 * 1000 * 1000,
5560
.gpio_cs = {GPIO_PIN(GPIO_PORTL, 10), GPIO_PERIPH_MUX6},
5661
.gpio_sck = {GPIO_PIN(GPIO_PORTL, 11), GPIO_PERIPH_MUX6},
5762
.gpio_mosi = {GPIO_PIN(GPIO_PORTL, 12), GPIO_PERIPH_MUX6},
58-
.clk_reg = {
59-
.ccu_base = SUNXI_R_PRCM_BASE,
60-
.spi_clk_reg_offest = SUNXI_S_SPI_CLK_REG,
61-
.spi_bgr_reg_offset = SUNXI_S_SPI_BGR_REG,
62-
}};
63+
};
6364

6465
static gpio_mux_t lcd_dc_pins = {
6566
.pin = GPIO_PIN(GPIO_PORTL, 13),
@@ -131,7 +132,7 @@ static void LCD_Open_BLK() {
131132

132133
static void LCD_Fill_All(uint16_t color) {
133134
uint16_t i, j;
134-
LCD_Address_Set(0, 0, LCD_W - 1, LCD_H - 1);// 设置显示范围
135+
LCD_Address_Set(0, 0, LCD_W - 1, LCD_H - 1);
135136
uint16_t *video_mem = smalloc(LCD_W * LCD_H);
136137

137138
for (uint32_t i = 0; i < LCD_W * LCD_H; i++) {
@@ -154,7 +155,7 @@ static void LCD_Init(void) {
154155
printk(LOG_LEVEL_ERROR, "SPI: init failed\n");
155156
}
156157

157-
LCD_Set_RES(0);//复位
158+
LCD_Set_RES(0);
158159
mdelay(100);
159160
LCD_Set_RES(1);
160161
mdelay(100);
@@ -245,7 +246,7 @@ static void LCD_Init(void) {
245246

246247
static void LCD_Show_Splash(uint8_t *splash_dest) {
247248
uint16_t i, j, k = 0;
248-
LCD_Address_Set(SPLASH_START_X, SPLASH_START_Y, SPLASH_START_X + SPLASH_W - 1, SPLASH_START_Y + SPLASH_H - 1);// 设置显示范围
249+
LCD_Address_Set(SPLASH_START_X, SPLASH_START_Y, SPLASH_START_X + SPLASH_W - 1, SPLASH_START_Y + SPLASH_H - 1);
249250

250251
uint16_t *video_mem = smalloc(SPLASH_W * SPLASH_H);
251252

@@ -383,7 +384,7 @@ void LCD_ShowChar(uint16_t x, uint16_t y, uint8_t num, uint16_t fc, uint16_t bc,
383384
}
384385
}
385386

386-
void LCD_ShowString(uint16_t x, uint16_t y, const uint8_t *p, uint16_t fc, uint16_t bc, uint8_t sizey) {
387+
static void LCD_ShowString(uint16_t x, uint16_t y, const uint8_t *p, uint16_t fc, uint16_t bc, uint8_t sizey) {
387388
printk(LOG_LEVEL_DEBUG, "LCD: Show String: \"%s\"\n", p);
388389
while (*p != '\0') {
389390
LCD_ShowChar(x, y, *p, fc, bc, sizey);

0 commit comments

Comments
 (0)