Skip to content

Commit 888e4b4

Browse files
committed
main: rename audio_input to ain
1 parent 8838657 commit 888e4b4

File tree

7 files changed

+26
-27
lines changed

7 files changed

+26
-27
lines changed

main/inc/user/audio_input.h renamed to main/inc/user/ain.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* audio_input.h
2+
* ain.h
33
*
44
* Created on: 2019-07-05 21:22
55
* Author: Jack Chen <redchenjs@live.com>
@@ -12,9 +12,9 @@
1212

1313
#define DEFAULT_AIN_MODE 1
1414

15-
extern void audio_input_set_mode(uint8_t idx);
16-
extern uint8_t audio_input_get_mode(void);
15+
extern void ain_set_mode(uint8_t idx);
16+
extern uint8_t ain_get_mode(void);
1717

18-
extern void audio_input_init(void);
18+
extern void ain_init(void);
1919

2020
#endif /* INC_USER_AUDIO_INPUT_H_ */

main/src/app_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#include "user/led.h"
1717
#include "user/vfx.h"
1818
#include "user/key.h"
19+
#include "user/ain.h"
1920
#include "user/bt_app.h"
2021
#include "user/ble_app.h"
21-
#include "user/audio_input.h"
2222
#include "user/audio_player.h"
2323
#include "user/audio_render.h"
2424

@@ -63,7 +63,7 @@ static void user_init(void)
6363
#endif
6464

6565
#ifndef CONFIG_AUDIO_INPUT_NONE
66-
audio_input_init();
66+
ain_init();
6767
#endif
6868

6969
#ifdef CONFIG_ENABLE_AUDIO_PROMPT

main/src/user/audio_input.c renamed to main/src/user/ain.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* audio_input.c
2+
* ain.c
33
*
44
* Created on: 2019-07-05 21:22
55
* Author: Jack Chen <redchenjs@live.com>
@@ -16,13 +16,13 @@
1616
#include "core/app.h"
1717
#include "chip/i2s.h"
1818
#include "user/vfx.h"
19-
#include "user/audio_input.h"
19+
#include "user/ain.h"
2020

2121
#define TAG "ain"
2222

2323
static uint8_t ain_mode = DEFAULT_AIN_MODE;
2424

25-
static void audio_input_task(void *pvParameters)
25+
static void ain_task(void *pvParameters)
2626
{
2727
char data[FFT_N * 4] = {0};
2828

@@ -83,7 +83,7 @@ static void audio_input_task(void *pvParameters)
8383
}
8484
}
8585

86-
void audio_input_set_mode(uint8_t idx)
86+
void ain_set_mode(uint8_t idx)
8787
{
8888
#ifndef CONFIG_AUDIO_INPUT_NONE
8989
ain_mode = idx;
@@ -97,17 +97,17 @@ void audio_input_set_mode(uint8_t idx)
9797
#endif
9898
}
9999

100-
uint8_t audio_input_get_mode(void)
100+
uint8_t ain_get_mode(void)
101101
{
102102
return ain_mode;
103103
}
104104

105-
void audio_input_init(void)
105+
void ain_init(void)
106106
{
107107
size_t length = sizeof(uint8_t);
108108
app_getenv("AIN_INIT_CFG", &ain_mode, &length);
109109

110-
audio_input_set_mode(ain_mode);
110+
ain_set_mode(ain_mode);
111111

112-
xTaskCreatePinnedToCore(audio_input_task, "audioInputT", 1920, NULL, configMAX_PRIORITIES - 3, NULL, 0);
112+
xTaskCreatePinnedToCore(ain_task, "ainT", 1920, NULL, configMAX_PRIORITIES - 3, NULL, 0);
113113
}

main/src/user/ble_gatts.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#include "core/os.h"
1818
#include "core/app.h"
1919
#include "user/vfx.h"
20+
#include "user/ain.h"
2021
#include "user/ble_app.h"
2122
#include "user/ble_gatts.h"
22-
#include "user/audio_input.h"
2323

2424
#define BLE_GATTS_TAG "ble_gatts"
2525

@@ -135,7 +135,7 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
135135
#ifdef CONFIG_ENABLE_VFX
136136
vfx_config_t *vfx = vfx_get_conf();
137137
#ifndef CONFIG_AUDIO_INPUT_NONE
138-
uint8_t ain_mode = audio_input_get_mode();
138+
uint8_t ain_mode = ain_get_mode();
139139
#endif
140140
#endif
141141

@@ -182,7 +182,7 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
182182
#ifdef CONFIG_ENABLE_VFX
183183
vfx_config_t *vfx = vfx_get_conf();
184184
#ifndef CONFIG_AUDIO_INPUT_NONE
185-
uint8_t ain_mode = audio_input_get_mode();
185+
uint8_t ain_mode = ain_get_mode();
186186
#endif
187187
#endif
188188
if (!param->write.is_prep) {
@@ -198,7 +198,7 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
198198
app_setenv("VFX_INIT_CFG", vfx, sizeof(vfx_config_t));
199199
#ifndef CONFIG_AUDIO_INPUT_NONE
200200
ain_mode = DEFAULT_AIN_MODE;
201-
audio_input_set_mode(ain_mode);
201+
ain_set_mode(ain_mode);
202202
app_setenv("AIN_INIT_CFG", &ain_mode, sizeof(uint8_t));
203203
#endif
204204
#endif
@@ -212,7 +212,7 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
212212
app_setenv("VFX_INIT_CFG", vfx, sizeof(vfx_config_t));
213213
#ifndef CONFIG_AUDIO_INPUT_NONE
214214
ain_mode = param->write.value[7];
215-
audio_input_set_mode(ain_mode);
215+
ain_set_mode(ain_mode);
216216
app_setenv("AIN_INIT_CFG", &ain_mode, sizeof(uint8_t));
217217
#endif
218218
#endif

main/src/user/key_handle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
#include "core/os.h"
1818
#include "user/vfx.h"
19+
#include "user/ain.h"
1920
#include "user/bt_av.h"
2021
#include "user/bt_spp.h"
2122
#include "user/ble_gatts.h"
22-
#include "user/audio_input.h"
2323
#include "user/audio_player.h"
2424

2525
#ifdef CONFIG_ENABLE_SLEEP_KEY
@@ -33,7 +33,7 @@ void sleep_key_handle(void)
3333
vfx_set_conf(vfx);
3434
#endif
3535
#ifndef CONFIG_AUDIO_INPUT_NONE
36-
audio_input_set_mode(0);
36+
ain_set_mode(0);
3737
#endif
3838
#ifdef CONFIG_ENABLE_AUDIO_PROMPT
3939
audio_player_play_file(3);

main/src/user/ota.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
#include "core/os.h"
1919
#include "core/app.h"
2020
#include "user/vfx.h"
21+
#include "user/ain.h"
2122
#include "user/bt_av.h"
2223
#include "user/bt_app.h"
2324
#include "user/bt_spp.h"
2425
#include "user/ble_app.h"
2526
#include "user/ble_gatts.h"
26-
#include "user/audio_input.h"
2727

2828
#define OTA_TAG "ota"
2929

@@ -214,8 +214,8 @@ void ota_exec(esp_spp_cb_param_t *param)
214214
vfx_set_conf(vfx);
215215
#endif
216216
#ifndef CONFIG_AUDIO_INPUT_NONE
217-
ain_prev_mode = audio_input_get_mode();
218-
audio_input_set_mode(0);
217+
ain_prev_mode = ain_get_mode();
218+
ain_set_mode(0);
219219
#endif
220220
#ifdef CONFIG_ENABLE_AUDIO_PROMPT
221221
xEventGroupWaitBits(
@@ -285,7 +285,7 @@ void ota_exec(esp_spp_cb_param_t *param)
285285
vfx_set_conf(vfx);
286286
#endif
287287
#ifndef CONFIG_AUDIO_INPUT_NONE
288-
audio_input_set_mode(0);
288+
ain_set_mode(0);
289289
#endif
290290
}
291291

@@ -356,7 +356,7 @@ void ota_end(void)
356356
data_length = 0;
357357

358358
#ifndef CONFIG_AUDIO_INPUT_NONE
359-
audio_input_set_mode(ain_prev_mode);
359+
ain_set_mode(ain_prev_mode);
360360
#endif
361361
#ifdef CONFIG_ENABLE_VFX
362362
vfx->mode = vfx_prev_mode;

main/src/user/vfx.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "user/vfx.h"
1919
#include "user/vfx_core.h"
2020
#include "user/vfx_bitmap.h"
21-
#include "user/audio_input.h"
2221

2322
#define TAG "vfx"
2423

0 commit comments

Comments
 (0)