Skip to content

Commit 9debfd3

Browse files
committed
[bsp] 修改 PR 审核意见~
1 parent a12b25f commit 9debfd3

File tree

14 files changed

+294
-5844
lines changed

14 files changed

+294
-5844
lines changed

bsp/gd32105c-eval/JLinkLog.txt

Lines changed: 0 additions & 168 deletions
This file was deleted.

bsp/gd32105c-eval/JLinkSettings.ini

Lines changed: 0 additions & 35 deletions
This file was deleted.
File renamed without changes.

bsp/gd32105c-eval/drivers/drv_gpio.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ const struct pin_index *get_pin(rt_uint8_t pin)
219219
return index;
220220
};
221221

222-
void gd32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
222+
static void _pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
223223
{
224224
const struct pin_index *index;
225225
rt_uint32_t pin_mode;
@@ -262,7 +262,7 @@ void gd32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
262262
gpio_init(index->gpio_periph, pin_mode, GPIO_OSPEED_50MHZ, index->pin);
263263
}
264264

265-
void gd32_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value)
265+
static void _pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value)
266266
{
267267
const struct pin_index *index;
268268

@@ -275,7 +275,7 @@ void gd32_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value)
275275
gpio_bit_write(index->gpio_periph, index->pin, (bit_status)value);
276276
}
277277

278-
int gd32_pin_read(rt_device_t dev, rt_base_t pin)
278+
static int _pin_read(rt_device_t dev, rt_base_t pin)
279279
{
280280
int value;
281281
const struct pin_index *index;
@@ -315,7 +315,7 @@ rt_inline const struct pin_irq_map *get_pin_irq_map(rt_uint32_t pinbit)
315315
}
316316
return &pin_irq_map[mapindex];
317317
};
318-
rt_err_t gd32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
318+
static rt_err_t _pin_attach_irq(struct rt_device *device, rt_int32_t pin,
319319
rt_uint32_t mode, void (*hdr)(void *args), void *args)
320320
{
321321
const struct pin_index *index;
@@ -355,7 +355,7 @@ rt_err_t gd32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
355355

356356
return RT_EOK;
357357
}
358-
rt_err_t gd32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
358+
static rt_err_t _pin_detach_irq(struct rt_device *device, rt_int32_t pin)
359359
{
360360
const struct pin_index *index;
361361
rt_base_t level;
@@ -386,7 +386,7 @@ rt_err_t gd32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
386386

387387
return RT_EOK;
388388
}
389-
rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_t enabled)
389+
static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_t enabled)
390390
{
391391
const struct pin_index *index;
392392
const struct pin_irq_map *irqmap;
@@ -462,12 +462,12 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_
462462
}
463463
const static struct rt_pin_ops _gd32_pin_ops =
464464
{
465-
gd32_pin_mode,
466-
gd32_pin_write,
467-
gd32_pin_read,
468-
gd32_pin_attach_irq,
469-
gd32_pin_detach_irq,
470-
gd32_pin_irq_enable,
465+
_pin_mode,
466+
_pin_write,
467+
_pin_read,
468+
_pin_attach_irq,
469+
_pin_detach_irq,
470+
_pin_irq_enable,
471471
RT_NULL,
472472
};
473473

bsp/gd32105c-eval/drivers/drv_spi.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,15 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes
188188
data = *send_ptr++;
189189
}
190190

191-
// Todo: replace register read/write by gd32f3 lib
192-
//Wait until the transmit buffer is empty
191+
/* Todo: replace register read/write by gd32f3 lib */
192+
/* Wait until the transmit buffer is empty */
193193
while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_TBE));
194-
// Send the byte
194+
/* Send the byte */
195195
spi_i2s_data_transmit(spi_periph, data);
196196

197-
//Wait until a data is received
197+
/* Wait until a data is received */
198198
while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_RBNE));
199-
// Get the received data
199+
/* Get the received data */
200200
data = spi_i2s_data_receive(spi_periph);
201201

202202
if(recv_ptr != RT_NULL)
@@ -221,14 +221,14 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes
221221
data = *send_ptr++;
222222
}
223223

224-
//Wait until the transmit buffer is empty
224+
/*Wait until the transmit buffer is empty */
225225
while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_TBE));
226-
// Send the byte
226+
/* Send the byte */
227227
spi_i2s_data_transmit(spi_periph, data);
228228

229-
//Wait until a data is received
229+
/*Wait until a data is received */
230230
while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_RBNE));
231-
// Get the received data
231+
/* Get the received data */
232232
data = spi_i2s_data_receive(spi_periph);
233233

234234
if(recv_ptr != RT_NULL)

bsp/gd32105c-eval/drivers/drv_spi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
#define gd32F30X_SPI_H_INCLUDED
1313

1414

15-
#endif // gd32F30X_SPI_H_INCLUDED
15+
#endif /* gd32F30X_SPI_H_INCLUDED */

bsp/gd32105c-eval/drivers/drv_spi_flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define SPI_BUS_NAME "spi0"
1717
#define SPI_DEVICE_NAME "spi01"
1818
#define SPI_FLASH_DEVICE_NAME "gd25q"
19-
#define GD25Q_SPI_CS_PIN 67 //PE3,在 drv_gpio.c 文件 pin_index pins[]中查到 PE3 编号为 2
19+
#define GD25Q_SPI_CS_PIN 67 /* PE3,在 drv_gpio.c 文件 pin_index pins[]中查到 PE3 编号为 67 */
2020

2121
static int rt_hw_gd25q40_init(void)
2222
{

0 commit comments

Comments
 (0)