Skip to content

Commit c3ffe18

Browse files
authored
Merge pull request #27 from RT-Thread/master
pr
2 parents 849c99d + ca867e8 commit c3ffe18

File tree

398 files changed

+1642
-45200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

398 files changed

+1642
-45200
lines changed

bsp/bluetrum/ab32vg1-ab-prougen/board/board.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020-2021, Bluetrum Development Team
3-
*
3+
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
@@ -65,16 +65,16 @@ void timer0_isr(int vector, void *param)
6565

6666
void timer0_init(void)
6767
{
68-
TMR0CON = BIT(7); //TIE
69-
TMR0CNT = 0;
68+
TMR0CON = BIT(7); //TIE
69+
TMR0CNT = 0;
7070

71-
rt_hw_interrupt_install(IRQ_TMR0_VECTOR, timer0_isr, RT_NULL, "tick");
71+
rt_hw_interrupt_install(IRQ_TMR0_VECTOR, timer0_isr, RT_NULL, "tick");
7272
}
7373

7474
void timer0_cfg(uint32_t ticks)
7575
{
76-
TMR0PR = (uint32_t)(ticks - 1UL); //1ms interrupt
77-
TMR0CON |= BIT(0); // EN
76+
TMR0PR = (uint32_t)(ticks - 1UL); //1ms interrupt
77+
TMR0CON |= BIT(0); // EN
7878
}
7979

8080
void hal_mdelay(uint32_t ms)
@@ -127,3 +127,8 @@ void rt_hw_board_init(void)
127127
rt_components_board_init();
128128
#endif
129129
}
130+
131+
void rt_hw_us_delay(rt_uint32_t us)
132+
{
133+
134+
}

bsp/bluetrum/ab32vg1-ab-prougen/board/board.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020-2021, Bluetrum Development Team
3-
*
3+
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
@@ -12,7 +12,13 @@
1212
#define BOARD_H__
1313

1414
#include <rtthread.h>
15-
#include "ab32vgx.h"
16-
#include "drv_gpio.h"
15+
#include <ab32vgx.h>
16+
#ifdef RT_USING_PIN
17+
#include <drv_gpio.h>
18+
#endif
19+
#ifdef RT_USING_WDT
20+
#include <drv_wdt.h>
21+
#endif
22+
1723

1824
#endif

bsp/bluetrum/ab32vg1-ab-prougen/board/ports/audio/drv_sound.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020-2021, Bluetrum Development Team
3-
*
3+
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Date Author Notes
@@ -139,7 +139,7 @@ void saia_volume_set(rt_uint8_t volume)
139139
{
140140
if (volume > 100)
141141
volume = 100;
142-
142+
143143
uint32_t dvol = volume * 327; // max is 0x7ffff
144144
LOG_D("dvol=0x%x", dvol);
145145
DACVOLCON = dvol | (0x02 << 16); // dac fade in
@@ -155,7 +155,7 @@ static rt_err_t sound_getcaps(struct rt_audio_device *audio, struct rt_audio_cap
155155
rt_err_t result = RT_EOK;
156156
struct sound_device *snd_dev = RT_NULL;
157157

158-
RT_ASSERT(audio != RT_NULL);
158+
RT_ASSERT(audio != RT_NULL);
159159
snd_dev = (struct sound_device *)audio->parent.user_data;
160160

161161
switch (caps->main_type)
@@ -231,7 +231,7 @@ static rt_err_t sound_getcaps(struct rt_audio_device *audio, struct rt_audio_cap
231231
break;
232232
}
233233

234-
return RT_EOK;
234+
return RT_EOK;
235235
}
236236

237237
static rt_err_t sound_configure(struct rt_audio_device *audio, struct rt_audio_caps *caps)
@@ -320,14 +320,14 @@ static rt_err_t sound_configure(struct rt_audio_device *audio, struct rt_audio_c
320320
break;
321321
}
322322

323-
return RT_EOK;
323+
return RT_EOK;
324324
}
325325

326326
static rt_err_t sound_init(struct rt_audio_device *audio)
327327
{
328328
struct sound_device *snd_dev = RT_NULL;
329329

330-
RT_ASSERT(audio != RT_NULL);
330+
RT_ASSERT(audio != RT_NULL);
331331
snd_dev = (struct sound_device *)audio->parent.user_data;
332332

333333
adpll_init(0);
@@ -337,14 +337,14 @@ static rt_err_t sound_init(struct rt_audio_device *audio)
337337
saia_frequency_set(snd_dev->replay_config.samplerate);
338338
saia_channels_set(snd_dev->replay_config.channels);
339339

340-
return RT_EOK;
340+
return RT_EOK;
341341
}
342342

343343
static rt_err_t sound_start(struct rt_audio_device *audio, int stream)
344344
{
345345
struct sound_device *snd_dev = RT_NULL;
346346

347-
RT_ASSERT(audio != RT_NULL);
347+
RT_ASSERT(audio != RT_NULL);
348348
snd_dev = (struct sound_device *)audio->parent.user_data;
349349

350350
if (stream == AUDIO_STREAM_REPLAY)
@@ -369,8 +369,8 @@ static rt_err_t sound_stop(struct rt_audio_device *audio, int stream)
369369
{
370370
struct sound_device *snd_dev = RT_NULL;
371371

372-
RT_ASSERT(audio != RT_NULL);
373-
snd_dev = (struct sound_device *)audio->parent.user_data;
372+
RT_ASSERT(audio != RT_NULL);
373+
snd_dev = (struct sound_device *)audio->parent.user_data;
374374

375375
if (stream == AUDIO_STREAM_REPLAY)
376376
{
@@ -387,22 +387,22 @@ rt_size_t sound_transmit(struct rt_audio_device *audio, const void *writeBuf, vo
387387
rt_size_t tmp_size = size / 4;
388388
rt_size_t count = 0;
389389

390-
RT_ASSERT(audio != RT_NULL);
390+
RT_ASSERT(audio != RT_NULL);
391391
snd_dev = (struct sound_device *)audio->parent.user_data;
392392

393393
while (tmp_size-- > 0) {
394394
while(AUBUFCON & BIT(8)); // aubuf full
395395
AUBUFDATA = ((const uint32_t *)writeBuf)[count++];
396396
}
397397

398-
return size;
398+
return size;
399399
}
400400

401401
static void sound_buffer_info(struct rt_audio_device *audio, struct rt_audio_buf_info *info)
402402
{
403403
struct sound_device *snd_dev = RT_NULL;
404404

405-
RT_ASSERT(audio != RT_NULL);
405+
RT_ASSERT(audio != RT_NULL);
406406
snd_dev = (struct sound_device *)audio->parent.user_data;
407407

408408
/**
@@ -425,7 +425,7 @@ static struct rt_audio_ops ops =
425425
.init = sound_init,
426426
.start = sound_start,
427427
.stop = sound_stop,
428-
.transmit = sound_transmit,
428+
.transmit = sound_transmit,
429429
.buffer_info = sound_buffer_info,
430430
};
431431

@@ -443,20 +443,20 @@ void audio_isr(int vector, void *param)
443443

444444
static int rt_hw_sound_init(void)
445445
{
446-
rt_uint8_t *tx_fifo = RT_NULL;
447-
rt_uint8_t *rx_fifo = RT_NULL;
446+
rt_uint8_t *tx_fifo = RT_NULL;
447+
rt_uint8_t *rx_fifo = RT_NULL;
448448

449-
/* 分配 DMA 搬运 buffer */
450-
tx_fifo = rt_calloc(1, TX_FIFO_SIZE);
449+
/* 分配 DMA 搬运 buffer */
450+
tx_fifo = rt_calloc(1, TX_FIFO_SIZE);
451451
if(tx_fifo == RT_NULL)
452452
{
453453
return -RT_ENOMEM;
454454
}
455455

456456
snd_dev.tx_fifo = tx_fifo;
457457

458-
/* 分配 DMA 搬运 buffer */
459-
rx_fifo = rt_calloc(1, TX_FIFO_SIZE);
458+
/* 分配 DMA 搬运 buffer */
459+
rx_fifo = rt_calloc(1, TX_FIFO_SIZE);
460460
if(rx_fifo == RT_NULL)
461461
{
462462
return -RT_ENOMEM;

bsp/bluetrum/libcpu/cpu/cpuport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
4141
stk--;
4242
*stk = (rt_uint32_t)0x10003; /* Start address */
4343
stk--;
44-
*stk = (rt_uint32_t)tentry; /* Start address */
44+
*stk = (rt_uint32_t)tentry; /* Start address */
4545
stk -= 22;
46-
*stk = (rt_uint32_t)parameter; /* Register a0 parameter*/
46+
*stk = (rt_uint32_t)parameter; /* Register a0 parameter*/
4747
stk -= 6;
4848
*stk = (rt_uint32_t)tp; /* Register thread pointer */
4949
stk --;

bsp/bluetrum/libcpu/cpu/interrupt.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ void set_cpu_irq_comm(void (*irq_hook)(void))
2424

2525
void cpu_irq_comm_do(void)
2626
{
27-
void (*pfnct)(void);
27+
void (*pfnct)(void);
2828
uint32_t irq_pend = PICPND & irq_mask;
29-
for (int i = 0; i < IRQ_TOTAL_NUM; i++) {
29+
for (int i = 0; i < IRQ_TOTAL_NUM; i++) {
3030
if (irq_pend & BIT(i)) {
3131
pfnct = tbl_irq_vector[i];
3232
if (pfnct) {
33-
pfnct(); /* call ISR */
33+
pfnct(); /* call ISR */
3434
}
3535
}
36-
}
36+
}
3737
}
3838

3939
void rt_hw_irq_enable(int vector)
@@ -56,12 +56,12 @@ void rt_hw_interrupt_init(void)
5656

5757
/**
5858
* @brief This function will install a interrupt service routine to a interrupt.
59-
*
60-
* @param vector
61-
* @param handler
62-
* @param param
63-
* @param name
64-
* @return rt_isr_handler_t
59+
*
60+
* @param vector
61+
* @param handler
62+
* @param param
63+
* @param name
64+
* @return rt_isr_handler_t
6565
*/
6666
rt_isr_handler_t rt_hw_interrupt_install(int vector,
6767
rt_isr_handler_t handler,

bsp/bluetrum/libraries/hal_drivers/config/adc_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020-2021, Bluetrum Development Team
3-
*
3+
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:

bsp/bluetrum/libraries/hal_drivers/config/tim_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020-2021, Bluetrum Development Team
3-
*
3+
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:

bsp/bluetrum/libraries/hal_drivers/drv_adc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020-2021, Bluetrum Development Team
3-
*
3+
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
@@ -45,15 +45,15 @@ static rt_err_t ab32_adc_enabled(struct rt_adc_device *device, rt_uint32_t chann
4545
{
4646
RT_ASSERT(device != RT_NULL);
4747

48-
hal_adc_enable(enabled);
48+
hal_adc_enable(enabled);
4949

5050
return RT_EOK;
5151
}
5252

5353
static rt_uint32_t ab32_adc_get_channel(rt_uint32_t channel)
5454
{
5555
rt_uint32_t ab32_channel = 0;
56-
56+
5757
switch (channel)
5858
{
5959
case 0:

bsp/bluetrum/libraries/hal_drivers/drv_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020-2021, Bluetrum Development Team
3-
*
3+
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:

bsp/bluetrum/libraries/hal_drivers/drv_gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020-2021, Bluetrum Development Team
3-
*
3+
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:

0 commit comments

Comments
 (0)