Skip to content

Commit ceba6ce

Browse files
BernardXionggitee-org
authored andcommitted
!349 [BSP] fix foramtting issue in BSP
Merge pull request !349 from bernard/gitee_master
2 parents 5e643ff + c82bce2 commit ceba6ce

File tree

6 files changed

+27
-20
lines changed

6 files changed

+27
-20
lines changed

bsp/apm32/libraries/APM32F10x_Library/APM32F10x_StdPeriphDriver/src/apm32f10x_fmc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,11 @@ FMC_STATUS_T FMC_ProgramOptionByteData(uint32_t address, uint8_t data)
347347
*
348348
* @param page:the address of the pages to be write protection
349349
* This parameter can be any combination of the following values:
350-
* for APM32F10X_LD £º
350+
* for APM32F10X_LD
351351
* @arg FLASH_WRP_PAGE_0_3 to FLASH_WRP_PAGE_28_31
352-
* for APM32F10X_MD £º
352+
* for APM32F10X_MD
353353
* @arg FLASH_WRP_PAGE_0_3 to FLASH_WRP_PAGE_124_127
354-
* for APM32F10X_HD £º
354+
* for APM32F10X_HD
355355
* @arg FLASH_WRP_PAGE_0_1 to FLASH_WRP_PAGE_60_61 or FLASH_WRP_PAGE_62_127
356356
* @arg FMC_WRP_PAGE_ALL
357357
*

bsp/apm32/libraries/APM32F10x_Library/APM32F10x_StdPeriphDriver/src/apm32f10x_gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ void GPIO_ConfigPinRemap(GPIO_REMAP_T remap)
466466
{
467467
regVal |= 0x0F000000;
468468
}
469-
469+
470470
mask <<= bitOffset;
471471
regVal &= (uint32_t)~mask;
472472
val <<= bitOffset;

bsp/apm32/libraries/APM32F10x_Library/APM32F10x_StdPeriphDriver/src/apm32f10x_pmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void PMU_DisablePVD(void)
8888
/*!
8989
* @brief Configure a voltage threshold detected by a power supply voltage detector (PVD).
9090
*
91-
* @param level£ºspecifies the PVD detection level
91+
* @param level : specifies the PVD detection level
9292
* This parameter can be one of the following values:
9393
* @arg PMU_PVD_LEVEL_2V2 : Config PVD detection level to 2.2V
9494
* @arg PMU_PVD_LEVEL_2V3 : Config PVD detection level to 2.3V
@@ -198,7 +198,7 @@ void PMU_EnterSTANDBYMode(void)
198198
/*!
199199
* @brief Read the specified PWR flag is set or not.
200200
*
201-
* @param flag£ºReads the status of specifies the flag.
201+
* @param flag : Reads the status of specifies the flag.
202202
* This parameter can be one of the following values:
203203
* @arg PMU_FLAG_WUE : Wake Up flag
204204
* @arg PMU_FLAG_SB : StandBy flag
@@ -226,7 +226,7 @@ uint8_t PMU_ReadStatusFlag(PMU_FLAG_T flag)
226226
/*!
227227
* @brief Clears the PWR's pending flags.
228228
*
229-
* @param flag£ºClears the status of specifies the flag.
229+
* @param flag : Clears the status of specifies the flag.
230230
* This parameter can be one of the following values:
231231
* @arg PMU_FLAG_WUE : Wake Up flag
232232
* @arg PMU_FLAG_SB : StandBy flag

bsp/apm32/libraries/APM32F10x_Library/APM32F10x_StdPeriphDriver/src/apm32f10x_rcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ void RCM_ClearStatusFlag(void)
10321032
/*!
10331033
* @brief Reads the specified RCM interrupt Flag
10341034
*
1035-
* @param flag £ºReads specifies RCM interrupt flag.
1035+
* @param flag : Reads specifies RCM interrupt flag.
10361036
* This parameter can be one of the following values:
10371037
* @arg RCM_INT_LSIRDY : LSI ready interrupt flag
10381038
* @arg RCM_INT_LSERDY : LSE ready interrupt flag

bsp/apm32/libraries/APM32F10x_Library/APM32F10x_StdPeriphDriver/src/apm32f10x_sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ uint32_t SDIO_ReadDataCounter(void)
289289
/*!
290290
* @brief Write the SDIO Data
291291
*
292-
* @param Data£ºWrite 32-bit data
292+
* @param Data : Write 32-bit data
293293
*
294294
* @retval None
295295
*/

bsp/ls2kdev/drivers/drv_spi.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,38 @@
1515
#include <stdio.h>
1616
#include <stdlib.h>
1717
#include <ctype.h>
18+
1819
#include <rtthread.h>
1920
#include <drivers/spi.h>
2021
#include "drv_spi.h"
2122

2223
#ifdef RT_USING_SPI
24+
#ifdef RT_USING_SPI_GPIOCS
25+
#include <drivers/pin.h>
26+
#endif
27+
2328
static void spi_init(uint8_t spre_spr, uint8_t copl, uint8_t cpha)
2429
{
25-
SET_SPI(SPSR, 0xc0);
30+
SET_SPI(SPSR, 0xc0);
2631
SET_SPI(PARAM, 0x40);
2732
SET_SPI(PARAM2, 0x01);
2833
SET_SPI(SPER, (spre_spr & 0b00001100) >> 2);
29-
SET_SPI(SPCR, 0x50 | copl << 3 | cpha << 2 | (spre_spr & 0b00000011));
34+
SET_SPI(SPCR, 0x50 | copl << 3 | cpha << 2 | (spre_spr & 0b00000011));
3035
SET_SPI(SOFTCS, 0xff);
3136
}
3237

33-
static void spi_set_csn(uint8_t val)
38+
rt_inline void spi_set_csn(uint8_t val)
3439
{
3540
SET_SPI(SOFTCS, val);
3641
}
3742

38-
#ifdef RT_USING_SPI_GPIOCS
39-
#include <drivers/pin.h>
40-
#endif
41-
static void spi_set_cs(unsigned char cs, int new_status)
43+
static void spi_set_cs(unsigned char cs, int new_status)
4244
{
4345
if (cs < 4)
4446
{
4547
unsigned char val = 0;
4648
val = GET_SPI(SOFTCS);
47-
val |= 0x01 << cs ; // csen=1
49+
val |= 0x01 << cs ; // csen=1
4850
if (new_status) // cs = 1
4951
{
5052
val |= (0x10 << cs); // csn=1
@@ -64,6 +66,7 @@ static void spi_set_cs(unsigned char cs, int new_status)
6466
}
6567
#endif
6668
}
69+
6770
static uint8_t spi_write_for_response(uint8_t data)
6871
{
6972
uint8_t val;
@@ -94,6 +97,7 @@ static int cmd_spi_init(int argc, char *argv[])
9497
}
9598
}
9699
MSH_CMD_EXPORT(cmd_spi_init, cmd_spi_init);
100+
97101
static int cmd_spi_set_csn(int argc, char *argv[])
98102
{
99103
uint8_t val, csn;
@@ -110,6 +114,7 @@ static int cmd_spi_set_csn(int argc, char *argv[])
110114
}
111115
}
112116
MSH_CMD_EXPORT(cmd_spi_set_csn, cmd_spi_set_csn);
117+
113118
static int cmd_spi_write(int argc, char *argv[])
114119
{
115120
uint8_t data, resp;
@@ -129,6 +134,7 @@ MSH_CMD_EXPORT(cmd_spi_write, cmd_spi_write);
129134

130135
static rt_err_t configure(struct rt_spi_device *device, struct rt_spi_configuration *configuration);
131136
static rt_uint32_t xfer(struct rt_spi_device *device, struct rt_spi_message *message);
137+
132138
const static unsigned char SPI_DIV_TABLE[] = {0b0000, 0b0001, 0b0100, 0b0010, 0b0011, 0b0101, 0b0110, 0b0111, 0b1000, 0b1001, 0b1010, 0b1011};
133139
// 2 4 8 16 32 64 128 256 512 1024 2048 4096
134140
static rt_err_t configure(struct rt_spi_device *device,
@@ -171,8 +177,8 @@ static rt_err_t configure(struct rt_spi_device *device,
171177

172178
return RT_EOK;
173179
}
174-
static rt_uint32_t xfer(struct rt_spi_device *device,
175-
struct rt_spi_message *message)
180+
181+
static rt_uint32_t xfer(struct rt_spi_device *device, struct rt_spi_message *message)
176182
{
177183

178184
unsigned char cs = 0;
@@ -214,18 +220,19 @@ static rt_uint32_t xfer(struct rt_spi_device *device,
214220
}
215221
return message->length;
216222
}
223+
217224
static struct rt_spi_ops loongson_spi_ops =
218225
{
219226
.configure = configure,
220227
.xfer = xfer
221228
};
222229
static struct rt_spi_bus loongson_spi;
230+
223231
static int loongson_spi_init()
224232
{
225233
//rt_kprintf("spi_init\n");
226234
return rt_spi_bus_register(&loongson_spi, "spi", &loongson_spi_ops);
227235
}
228236
INIT_BOARD_EXPORT(loongson_spi_init);
229-
230237
#endif
231238
/*@}*/

0 commit comments

Comments
 (0)