Skip to content

Commit 8a180d5

Browse files
committed
Convert format
1 parent 025b715 commit 8a180d5

File tree

4 files changed

+44
-44
lines changed

4 files changed

+44
-44
lines changed

bsp/tkm32F499/drivers/board.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ MSH_CMD_EXPORT(reboot, Reboot System);
2626
static void bsp_clock_config(void)
2727
{
2828
RemapVtorTable();
29-
SystemClk_HSEInit(RCC_PLLMul_20);//启动PLL时钟,12MHz*20=240MHz
30-
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//2:2,全局性函数,仅需设置一次
29+
SystemClk_HSEInit(RCC_PLLMul_20);//启动PLL时钟,12MHz*20=240MHz
30+
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//2:2,全局性函数,仅需设置一次
3131

3232
uint32_t sysclk = 0;
3333
getSystemClock(&sysclk);

bsp/tkm32F499/drivers/drv_gpio.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2018, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*

bsp/tkm32F499/drivers/lcd/lcd.c

+21-21
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void BlockWrite(unsigned int Xstart, unsigned int Xend, unsigned int Ystart, uns
187187
SPI_WriteData(Yend & 0xff);
188188

189189
SPI_WriteComm(0x2c00);
190-
// for(Xstart=0;Xstart<1000;Xstart++)SPI_WriteData(0x55);
190+
// for(Xstart=0;Xstart<1000;Xstart++)SPI_WriteData(0x55);
191191
}
192192
void Lcd_Initialize(void)
193193
{
@@ -1040,23 +1040,23 @@ void LCD_Initial(rt_uint32_t LTDC_Buf1, rt_uint32_t LTDC_Buf2) //LCD初始化函
10401040
// LTDC_Buf[yStart + i + YSIZE_PHYS * j + temp] = Color;
10411041
// }
10421042

1043-
// // rt_uint16_t i,j;
1044-
// // rt_uint32_t temp;
1045-
// // temp = XSIZE_PHYS*yStart;
1046-
// // for(i=0;i<yLong;i++)
1047-
// // {
1048-
// // for(j=0;j<xLong;j++)
1049-
// // LTDC_Buf[xStart+j+XSIZE_PHYS*i+temp]=Color;
1050-
// // }
1043+
// // rt_uint16_t i,j;
1044+
// // rt_uint32_t temp;
1045+
// // temp = XSIZE_PHYS*yStart;
1046+
// // for(i=0;i<yLong;i++)
1047+
// // {
1048+
// // for(j=0;j<xLong;j++)
1049+
// // LTDC_Buf[xStart+j+XSIZE_PHYS*i+temp]=Color;
1050+
// // }
10511051
// }
10521052

10531053
/******************************************
10541054
函数名:Lcd图像填充
10551055
功能:向Lcd指定位置填充图像
10561056
入口参数:
1057-
(x,y): 图片左上角起始坐标
1058-
(pic_H,pic_V): 图片的宽高
1059-
pic 指向存储图片数组的指针
1057+
(x,y): 图片左上角起始坐标
1058+
(pic_H,pic_V): 图片的宽高
1059+
pic 指向存储图片数组的指针
10601060
LCD_Fill_Pic(400,100,320,480,(rt_uint32_t*)gImage_MM_T035);
10611061
******************************************/
10621062
// void LCD_Fill_Pic(rt_uint16_t x, rt_uint16_t y, rt_uint16_t pic_H, rt_uint16_t pic_V, rt_uint32_t *pic)
@@ -1070,20 +1070,20 @@ LCD_Fill_Pic(400,100,320,480,(rt_uint32_t*)gImage_MM_T035);
10701070
// LTDC_Buf[Xstart + i + YSIZE_PHYS * j + y] = pic[k++];
10711071
// }
10721072

1073-
// // rt_uint16_t i,j;
1074-
// // rt_uint32_t Ystart,k=0;
1075-
// // Ystart = YSIZE_PHYS*y;
1076-
// // for(i=0;i<pic_V;i++)
1077-
// // {
1078-
// // for(j=0;j<pic_H;j++)
1079-
// // LTDC_Buf[x+j+YSIZE_PHYS*i+Ystart]=pic[k++];
1080-
// // }
1073+
// // rt_uint16_t i,j;
1074+
// // rt_uint32_t Ystart,k=0;
1075+
// // Ystart = YSIZE_PHYS*y;
1076+
// // for(i=0;i<pic_V;i++)
1077+
// // {
1078+
// // for(j=0;j<pic_H;j++)
1079+
// // LTDC_Buf[x+j+YSIZE_PHYS*i+Ystart]=pic[k++];
1080+
// // }
10811081
// }
10821082
//=============== 在x,y 坐标上打一个颜色为Color的点 ===============
10831083
// void DrawPixel(rt_uint16_t x, rt_uint16_t y, int Color)
10841084
// {
10851085
// LTDC_Buf[y + YSIZE_PHYS * x] = Color;
1086-
// // LTDC_Buf[x+XSIZE_PHYS*y] = Color;
1086+
// // LTDC_Buf[x+XSIZE_PHYS*y] = Color;
10871087
// }
10881088
/**********8*16字体 ASCII码 显示*************
10891089
(x,y): 显示字母的起始坐标

bsp/tkm32F499/drivers/lcd/lcd.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
// #define XSIZE_PHYS 800
1414
// #define YSIZE_PHYS 480
1515
// extern __align(256) rt_uint32_t LTDC_Buf[XSIZE_PHYS*YSIZE_PHYS];
16-
#define LCD_SPI_CS(a) \
17-
if (a) \
18-
GPIOB->BSRR = GPIO_Pin_11; \
19-
else \
20-
GPIOB->BRR = GPIO_Pin_11;
21-
#define SPI_DCLK(a) \
22-
if (a) \
23-
GPIOB->BSRR = GPIO_Pin_9; \
24-
else \
25-
GPIOB->BRR = GPIO_Pin_9;
26-
#define SPI_SDA(a) \
27-
if (a) \
28-
GPIOB->BSRR = GPIO_Pin_0; \
29-
else \
30-
GPIOB->BRR = GPIO_Pin_0;
16+
#define LCD_SPI_CS(a) \
17+
if (a) \
18+
GPIOB->BSRR = GPIO_Pin_11; \
19+
else \
20+
GPIOB->BRR = GPIO_Pin_11;
21+
#define SPI_DCLK(a) \
22+
if (a) \
23+
GPIOB->BSRR = GPIO_Pin_9; \
24+
else \
25+
GPIOB->BRR = GPIO_Pin_9;
26+
#define SPI_SDA(a) \
27+
if (a) \
28+
GPIOB->BSRR = GPIO_Pin_0; \
29+
else \
30+
GPIOB->BRR = GPIO_Pin_0;
3131

32-
#define LCD_RST(a) \
33-
if (a) \
34-
GPIOD->BSRR = GPIO_Pin_6; \
35-
else \
36-
GPIOD->BRR = GPIO_Pin_6;
32+
#define LCD_RST(a) \
33+
if (a) \
34+
GPIOD->BSRR = GPIO_Pin_6; \
35+
else \
36+
GPIOD->BRR = GPIO_Pin_6;
3737
#define Set_Rst GPIOD->BSRR = GPIO_Pin_6
3838
#define Clr_Rst GPIOD->BRR = GPIO_Pin_6
3939
#define Lcd_Light_ON GPIOD->BSRR = GPIO_Pin_8 //PD8为高电平 背光打开

0 commit comments

Comments
 (0)