Skip to content

Commit 6144da9

Browse files
authored
Merge pull request #2574 from HiFiPhile/fsdev
FSDEV fix/cleanup.
2 parents c83e28c + 0f77563 commit 6144da9

File tree

8 files changed

+440
-613
lines changed

8 files changed

+440
-613
lines changed

examples/device/audio_4_channel_mic/src/main.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -104,39 +104,39 @@ int main(void)
104104
// Generate dummy data
105105
#if CFG_TUD_AUDIO_ENABLE_ENCODING
106106
uint16_t * p_buff = i2s_dummy_buffer[0];
107-
uint16_t dataVal = 1;
107+
uint16_t dataVal = 0;
108108
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
109109
{
110110
// CH0 saw wave
111111
*p_buff++ = dataVal;
112112
// CH1 inverted saw wave
113-
*p_buff++ = 60 + AUDIO_SAMPLE_RATE/1000 - dataVal;
114-
dataVal++;
113+
*p_buff++ = 3200 + AUDIO_SAMPLE_RATE/1000 - dataVal;
114+
dataVal+= 32;
115115
}
116116
p_buff = i2s_dummy_buffer[1];
117117
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
118118
{
119119
// CH3 square wave
120-
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 120:170;
120+
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 3400:5000;
121121
// CH4 sinus wave
122122
float t = 2*3.1415f * cnt / (AUDIO_SAMPLE_RATE/1000);
123-
*p_buff++ = (uint16_t)(sinf(t) * 25) + 200;
123+
*p_buff++ = (uint16_t)((int16_t)(sinf(t) * 750) + 6000);
124124
}
125125
#else
126126
uint16_t * p_buff = i2s_dummy_buffer;
127-
uint16_t dataVal = 1;
127+
uint16_t dataVal = 0;
128128
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
129129
{
130130
// CH0 saw wave
131131
*p_buff++ = dataVal;
132132
// CH1 inverted saw wave
133-
*p_buff++ = 60 + AUDIO_SAMPLE_RATE/1000 - dataVal;
134-
dataVal++;
133+
*p_buff++ = 3200 + AUDIO_SAMPLE_RATE/1000 - dataVal;
134+
dataVal+= 32;
135135
// CH3 square wave
136-
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 120:170;
136+
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 3400:5000;
137137
// CH4 sinus wave
138138
float t = 2*3.1415f * cnt / (AUDIO_SAMPLE_RATE/1000);
139-
*p_buff++ = (uint16_t)(sinf(t) * 25) + 200;
139+
*p_buff++ = (uint16_t)((int16_t)(sinf(t) * 750) + 6000);
140140
}
141141
#endif
142142

examples/device/uac2_headset/src/main.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@
3535
//--------------------------------------------------------------------+
3636

3737
// List of supported sample rates
38-
#if defined(__RX__)
39-
const uint32_t sample_rates[] = {44100, 48000};
40-
#else
41-
const uint32_t sample_rates[] = {44100, 48000, 88200, 96000};
42-
#endif
38+
const uint32_t sample_rates[] = {44100, 48000};
4339

4440
uint32_t current_sample_rate = 44100;
4541

examples/device/uac2_headset/src/tusb_config.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,9 @@ extern "C" {
114114
#define CFG_TUD_AUDIO_FUNC_1_N_FORMATS 2
115115

116116
// Audio format type I specifications
117-
#if defined(__RX__)
118-
#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 48000 // 16bit/48kHz is the best quality for Renesas RX
119-
#else
120-
#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 96000 // 24bit/96kHz is the best quality for full-speed, high-speed is needed beyond this
121-
#endif
117+
/* 24bit/48kHz is the best quality for headset or 24bit/96kHz for 2ch speaker,
118+
high-speed is needed beyond this */
119+
#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 48000
122120
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1
123121
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX 2
124122

hw/bsp/stm32h5/boards/stm32h573i_dk/board.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ extern "C" {
3535
// LED
3636
#define LED_PORT GPIOI
3737
#define LED_PIN GPIO_PIN_9
38-
#define LED_STATE_ON 0
38+
#define LED_STATE_ON 1
3939

4040
// Button
4141
#define BUTTON_PORT GPIOC
4242
#define BUTTON_PIN GPIO_PIN_13
43-
#define BUTTON_STATE_ACTIVE 0
43+
#define BUTTON_STATE_ACTIVE 1
4444

4545
// UART Enable for STLink VCOM
4646
#define UART_DEV USART1

hw/bsp/stm32h5/family.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ void board_init(void) {
7373
__HAL_RCC_GPIOE_CLK_ENABLE();
7474
#endif
7575
#ifdef __HAL_RCC_GPIOG_CLK_ENABLE
76-
__HAL_RCC_GPIOE_CLK_ENABLE();
76+
__HAL_RCC_GPIOG_CLK_ENABLE();
7777
#endif
7878
#ifdef __HAL_RCC_GPIOI_CLK_ENABLE
79-
__HAL_RCC_GPIOE_CLK_ENABLE();
79+
__HAL_RCC_GPIOI_CLK_ENABLE();
8080
#endif
8181

8282
UART_CLK_EN();

hw/bsp/stm32l0/family.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ uint32_t board_millis(void)
163163

164164
void HardFault_Handler (void)
165165
{
166-
asm("bkpt");
166+
__asm("BKPT #0\n");
167167
}
168168

169169
#ifdef USE_FULL_ASSERT

0 commit comments

Comments
 (0)