Full Code of pine64/OpenPineBuds for AI

main e2e6bd9b6c4d cached
2096 files
25.3 MB
6.7M tokens
17240 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (26,897K chars total). Download the full file to get everything.
Repository: pine64/OpenPineBuds
Branch: main
Commit: e2e6bd9b6c4d
Files: 2096
Total size: 25.3 MB

Directory structure:
gitextract_cx4f_tq7/

├── .devcontainer/
│   └── devcontainer.json
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── build-and-push-to-registry.yml
│       └── build-firmware.yml
├── .gitignore
├── Dockerfile
├── Makefile
├── README.md
├── apps/
│   ├── Makefile
│   ├── anc/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   ├── anc_assist.h
│   │   │   ├── anc_wnr.h
│   │   │   ├── app_anc.h
│   │   │   └── peak_detector.h
│   │   └── src/
│   │       ├── anc_assist.c
│   │       ├── anc_wnr.c
│   │       ├── app_anc.c
│   │       └── peak_detector.c
│   ├── apptester/
│   │   ├── Makefile
│   │   ├── app_audtest.cpp
│   │   ├── app_audtest.h
│   │   ├── app_audtest_pattern.h
│   │   ├── audiobuffer.c
│   │   └── audiobuffer.h
│   ├── audioplayers/
│   │   ├── Makefile
│   │   ├── a2dp_decoder/
│   │   │   ├── Makefile
│   │   │   ├── a2dp_decoder.cpp
│   │   │   ├── a2dp_decoder.h
│   │   │   ├── a2dp_decoder_aac_lc.cpp
│   │   │   ├── a2dp_decoder_cp.c
│   │   │   ├── a2dp_decoder_cp.h
│   │   │   ├── a2dp_decoder_example.cpp
│   │   │   ├── a2dp_decoder_internal.h
│   │   │   ├── a2dp_decoder_ldac.cpp
│   │   │   ├── a2dp_decoder_lhdc.cpp
│   │   │   ├── a2dp_decoder_sbc.cpp
│   │   │   ├── a2dp_decoder_scalable.cpp
│   │   │   └── a2dp_decoder_trace.h
│   │   ├── a2dpplay.cpp
│   │   ├── app_audio.cpp
│   │   ├── app_audio.h
│   │   ├── bt_sco_chain.c
│   │   ├── bt_sco_chain.h
│   │   ├── bt_sco_chain_cfg.h
│   │   ├── bt_sco_chain_cfg_default.c
│   │   ├── bt_sco_chain_cp.c
│   │   ├── bt_sco_chain_cp.h
│   │   ├── bt_sco_chain_thirdparty.c
│   │   ├── bt_sco_chain_thirdparty_alango.c
│   │   ├── bt_sco_chain_tuning.c
│   │   ├── bt_sco_chain_tuning.h
│   │   ├── cvsdplay.cpp
│   │   ├── digmici2splay.cpp
│   │   ├── flacplay.cpp
│   │   ├── fmradio.cpp
│   │   ├── fmradio.h
│   │   ├── msbcplay.cpp
│   │   ├── plc_utils.c
│   │   ├── plc_utils.h
│   │   ├── rbplay/
│   │   │   ├── rb_ctl.cpp
│   │   │   ├── rb_ctl.h
│   │   │   ├── rbpcmbuf.cpp
│   │   │   ├── rbpcmbuf.h
│   │   │   ├── rbplay.cpp
│   │   │   ├── rbplay.h
│   │   │   ├── rbplaysd.cpp
│   │   │   ├── rbplaysd.h
│   │   │   └── utils.h
│   │   ├── voice_test.c
│   │   ├── voicebtpcmplay.cpp
│   │   ├── voicebtpcmplay_sco_dma_snapshot.cpp
│   │   └── wavplay.cpp
│   ├── battery/
│   │   ├── Makefile
│   │   ├── app_battery.cpp
│   │   └── app_battery.h
│   ├── cmd/
│   │   ├── Makefile
│   │   ├── app_cmd.cpp
│   │   └── app_cmd.h
│   ├── common/
│   │   ├── Makefile
│   │   ├── app_spec_ostimer.cpp
│   │   ├── app_spec_ostimer.h
│   │   ├── app_thread.c
│   │   ├── app_thread.h
│   │   ├── app_utils.c
│   │   ├── app_utils.h
│   │   ├── randfrommic.c
│   │   └── randfrommic.h
│   ├── factory/
│   │   ├── 1k_2ch_44k_16bit.txt
│   │   ├── 1k_2ch_48k_16bit.txt
│   │   ├── Makefile
│   │   ├── app_factory.cpp
│   │   ├── app_factory.h
│   │   ├── app_factory_audio.cpp
│   │   ├── app_factory_audio.h
│   │   ├── app_factory_bt.cpp
│   │   ├── app_factory_bt.h
│   │   ├── app_factory_cdc_comm.c
│   │   ├── app_factory_cdc_comm.h
│   │   ├── sys_api_cdc_comm.c
│   │   └── sys_api_cdc_comm.h
│   ├── key/
│   │   ├── Makefile
│   │   ├── app_key.cpp
│   │   └── app_key.h
│   ├── main/
│   │   ├── Makefile
│   │   ├── app_status_ind.h
│   │   ├── apps.cpp
│   │   ├── apps.h
│   │   ├── apps_tester.cpp
│   │   ├── common_apps_imports.h
│   │   ├── gfps.cpp
│   │   ├── ibrt.cpp
│   │   ├── ibrt.h
│   │   ├── key_handler.cpp
│   │   ├── key_handler.h
│   │   ├── led_control.cpp
│   │   ├── led_control.h
│   │   ├── lhdc.cpp
│   │   ├── rb_codec.cpp
│   │   └── rb_codec.h
│   ├── mic/
│   │   ├── Makefile
│   │   ├── app_mic.cpp
│   │   └── app_mic.h
│   ├── mic_alg/
│   │   ├── Makefile
│   │   ├── app_mic_alg.cpp
│   │   └── app_mic_alg.h
│   ├── pwl/
│   │   ├── Makefile
│   │   ├── app_pwl.cpp
│   │   └── app_pwl.h
│   └── voice_detector/
│       ├── Makefile
│       ├── app_voice_detector.cpp
│       ├── app_voice_detector.h
│       ├── vad_sensor.h
│       ├── voice_detector.c
│       └── voice_detector.h
├── backup.sh
├── build.sh
├── clear.sh
├── config/
│   ├── Makefile
│   ├── _default_cfg_src_/
│   │   ├── app_status_ind.c
│   │   ├── res/
│   │   │   ├── cn/
│   │   │   │   ├── SOUND_ANSWER.opus
│   │   │   │   ├── SOUND_CHARGE_FINISH.opus
│   │   │   │   ├── SOUND_CHARGE_PLEASE.opus
│   │   │   │   ├── SOUND_CONNECTED.opus
│   │   │   │   ├── SOUND_DIS_CONNECT.opus
│   │   │   │   ├── SOUND_EIGHT.opus
│   │   │   │   ├── SOUND_FINDME.opus
│   │   │   │   ├── SOUND_FIVE.opus
│   │   │   │   ├── SOUND_FOUR.opus
│   │   │   │   ├── SOUND_HUNG_UP.opus
│   │   │   │   ├── SOUND_INCOMING_CALL.opus
│   │   │   │   ├── SOUND_LANGUAGE_SWITCH.opus
│   │   │   │   ├── SOUND_MUTE.opus
│   │   │   │   ├── SOUND_NINE.opus
│   │   │   │   ├── SOUND_ONE.opus
│   │   │   │   ├── SOUND_OVER.opus
│   │   │   │   ├── SOUND_PAIRING.opus
│   │   │   │   ├── SOUND_PAIRING_FAIL.opus
│   │   │   │   ├── SOUND_PAIRING_SUCCESS.opus
│   │   │   │   ├── SOUND_PAIR_ENABLE.opus
│   │   │   │   ├── SOUND_POWER_OFF.opus
│   │   │   │   ├── SOUND_POWER_ON.opus
│   │   │   │   ├── SOUND_REFUSE.opus
│   │   │   │   ├── SOUND_SEVEN.opus
│   │   │   │   ├── SOUND_SIX.opus
│   │   │   │   ├── SOUND_THREE.opus
│   │   │   │   ├── SOUND_TWO.opus
│   │   │   │   ├── SOUND_WARNING.opus
│   │   │   │   └── SOUND_ZERO.opus
│   │   │   ├── en/
│   │   │   │   ├── SOUND_ALEXA_START.opus
│   │   │   │   ├── SOUND_ALEXA_STOP.opus
│   │   │   │   ├── SOUND_ANSWER.opus
│   │   │   │   ├── SOUND_CHARGE_FINISH.opus
│   │   │   │   ├── SOUND_CHARGE_PLEASE.opus
│   │   │   │   ├── SOUND_CONNECTED.opus
│   │   │   │   ├── SOUND_DIS_CONNECT.opus
│   │   │   │   ├── SOUND_EIGHT.opus
│   │   │   │   ├── SOUND_FINDME.opus
│   │   │   │   ├── SOUND_FIVE.opus
│   │   │   │   ├── SOUND_FOUR.opus
│   │   │   │   ├── SOUND_GSOUND_MIC_CLOSE.opus
│   │   │   │   ├── SOUND_GSOUND_MIC_OPEN.opus
│   │   │   │   ├── SOUND_GSOUND_NC.opus
│   │   │   │   ├── SOUND_HUNG_UP.opus
│   │   │   │   ├── SOUND_INCOMING_CALL.opus
│   │   │   │   ├── SOUND_LANGUAGE_SWITCH.opus
│   │   │   │   ├── SOUND_MUTE.opus
│   │   │   │   ├── SOUND_NINE.opus
│   │   │   │   ├── SOUND_ONE.opus
│   │   │   │   ├── SOUND_OVER.opus
│   │   │   │   ├── SOUND_PAIRING.opus
│   │   │   │   ├── SOUND_PAIRING_FAIL.opus
│   │   │   │   ├── SOUND_PAIRING_SUCCESS.opus
│   │   │   │   ├── SOUND_PAIR_ENABLE.opus
│   │   │   │   ├── SOUND_POWER_OFF.opus
│   │   │   │   ├── SOUND_POWER_ON.opus
│   │   │   │   ├── SOUND_REFUSE.opus
│   │   │   │   ├── SOUND_SEVEN.opus
│   │   │   │   ├── SOUND_SIX.opus
│   │   │   │   ├── SOUND_THREE.opus
│   │   │   │   ├── SOUND_TWO.opus
│   │   │   │   ├── SOUND_WARNING.opus
│   │   │   │   ├── SOUND_ZERO.opus
│   │   │   │   └── dudu.opus
│   │   │   ├── en_festival/
│   │   │   │   ├── SOUND_ALEXA_START.opus
│   │   │   │   ├── SOUND_ALEXA_START.opus.license
│   │   │   │   ├── SOUND_ALEXA_STOP.opus
│   │   │   │   ├── SOUND_ALEXA_STOP.opus.license
│   │   │   │   ├── SOUND_ANSWER.opus
│   │   │   │   ├── SOUND_ANSWER.opus.license
│   │   │   │   ├── SOUND_CHARGE_FINISH.opus
│   │   │   │   ├── SOUND_CHARGE_FINISH.opus.license
│   │   │   │   ├── SOUND_CHARGE_PLEASE.opus
│   │   │   │   ├── SOUND_CHARGE_PLEASE.opus.license
│   │   │   │   ├── SOUND_CONNECTED.opus
│   │   │   │   ├── SOUND_CONNECTED.opus.license
│   │   │   │   ├── SOUND_DIS_CONNECT.opus
│   │   │   │   ├── SOUND_DIS_CONNECT.opus.license
│   │   │   │   ├── SOUND_EIGHT.opus
│   │   │   │   ├── SOUND_EIGHT.opus.license
│   │   │   │   ├── SOUND_FINDME.opus
│   │   │   │   ├── SOUND_FINDME.opus.license
│   │   │   │   ├── SOUND_FIVE.opus
│   │   │   │   ├── SOUND_FIVE.opus.license
│   │   │   │   ├── SOUND_FOUR.opus
│   │   │   │   ├── SOUND_FOUR.opus.license
│   │   │   │   ├── SOUND_GSOUND_MIC_CLOSE.opus
│   │   │   │   ├── SOUND_GSOUND_MIC_CLOSE.opus.license
│   │   │   │   ├── SOUND_GSOUND_MIC_OPEN.opus
│   │   │   │   ├── SOUND_GSOUND_MIC_OPEN.opus.license
│   │   │   │   ├── SOUND_GSOUND_NC.opus
│   │   │   │   ├── SOUND_GSOUND_NC.opus.license
│   │   │   │   ├── SOUND_HUNG_UP.opus
│   │   │   │   ├── SOUND_HUNG_UP.opus.license
│   │   │   │   ├── SOUND_INCOMING_CALL.opus
│   │   │   │   ├── SOUND_INCOMING_CALL.opus.license
│   │   │   │   ├── SOUND_LANGUAGE_SWITCH.opus
│   │   │   │   ├── SOUND_LANGUAGE_SWITCH.opus.license
│   │   │   │   ├── SOUND_MUTE.opus
│   │   │   │   ├── SOUND_MUTE.opus.license
│   │   │   │   ├── SOUND_NINE.opus
│   │   │   │   ├── SOUND_NINE.opus.license
│   │   │   │   ├── SOUND_ONE.opus
│   │   │   │   ├── SOUND_ONE.opus.license
│   │   │   │   ├── SOUND_OVER.opus
│   │   │   │   ├── SOUND_OVER.opus.license
│   │   │   │   ├── SOUND_PAIRING.opus
│   │   │   │   ├── SOUND_PAIRING.opus.license
│   │   │   │   ├── SOUND_PAIRING_FAIL.opus
│   │   │   │   ├── SOUND_PAIRING_FAIL.opus.license
│   │   │   │   ├── SOUND_PAIRING_SUCCESS.opus
│   │   │   │   ├── SOUND_PAIRING_SUCCESS.opus.license
│   │   │   │   ├── SOUND_PAIR_ENABLE.opus
│   │   │   │   ├── SOUND_PAIR_ENABLE.opus.license
│   │   │   │   ├── SOUND_POWER_OFF.opus
│   │   │   │   ├── SOUND_POWER_OFF.opus.license
│   │   │   │   ├── SOUND_POWER_ON.opus
│   │   │   │   ├── SOUND_POWER_ON.opus.license
│   │   │   │   ├── SOUND_REFUSE.opus
│   │   │   │   ├── SOUND_REFUSE.opus.license
│   │   │   │   ├── SOUND_SEVEN.opus
│   │   │   │   ├── SOUND_SEVEN.opus.license
│   │   │   │   ├── SOUND_SIX.opus
│   │   │   │   ├── SOUND_SIX.opus.license
│   │   │   │   ├── SOUND_THREE.opus
│   │   │   │   ├── SOUND_THREE.opus.license
│   │   │   │   ├── SOUND_TWO.opus
│   │   │   │   ├── SOUND_TWO.opus.license
│   │   │   │   ├── SOUND_WARNING.opus
│   │   │   │   ├── SOUND_WARNING.opus.license
│   │   │   │   ├── SOUND_ZERO.opus
│   │   │   │   ├── SOUND_ZERO.opus.license
│   │   │   │   ├── dudu.opus
│   │   │   │   └── dudu.opus.license
│   │   │   ├── gs_hw/
│   │   │   │   └── en_all.txt
│   │   │   └── ring/
│   │   │       ├── SOUND_RING_16000.txt
│   │   │       ├── SOUND_RING_44100.txt
│   │   │       ├── SOUND_RING_48000.txt
│   │   │       └── SOUND_RING_8000.txt
│   │   ├── slave_code.S
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── bak_open/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── best2300p_ibrt/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── best2300p_ibrt_anc/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── common.mk
│   ├── ef606_average_coefficients.h
│   ├── mic_alg/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── open_source/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   └── suggested_anc_gains.h
├── convert.sh
├── dev_tools/
│   └── anc_decoder/
│       ├── .gitignore
│       ├── Cargo.toml
│       └── src/
│           └── main.rs
├── docker-compose.yml
├── download.sh
├── include/
│   └── rtos/
│       ├── freertos/
│       │   ├── FreeRTOS.h
│       │   ├── FreeRTOSConfig.h
│       │   ├── StackMacros.h
│       │   ├── cmsis_os.h
│       │   ├── cmsis_os2.h
│       │   ├── croutine.h
│       │   ├── deprecated_definitions.h
│       │   ├── event_groups.h
│       │   ├── freertos_evr.h
│       │   ├── freertos_list.h
│       │   ├── message_buffer.h
│       │   ├── mpu_prototypes.h
│       │   ├── mpu_wrappers.h
│       │   ├── portable.h
│       │   ├── portmacro.h
│       │   ├── projdefs.h
│       │   ├── queue.h
│       │   ├── semphr.h
│       │   ├── stack_macros.h
│       │   ├── stdint.readme
│       │   ├── stream_buffer.h
│       │   ├── task.h
│       │   └── timers.h
│       ├── rtx/
│       │   ├── cmsis_os.h
│       │   └── os_tcb.h
│       └── rtx5/
│           ├── cmsis_os.h
│           ├── cmsis_os2.h
│           ├── os_tick.h
│           ├── rtx_evr.h
│           └── rtx_os.h
├── notes.txt
├── platform/
│   ├── Makefile
│   ├── cmsis/
│   │   ├── DSP_Lib/
│   │   │   ├── BasicMathFunctions/
│   │   │   │   ├── BasicMathFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_abs_f32.c
│   │   │   │   ├── arm_abs_q15.c
│   │   │   │   ├── arm_abs_q31.c
│   │   │   │   ├── arm_abs_q7.c
│   │   │   │   ├── arm_add_f32.c
│   │   │   │   ├── arm_add_q15.c
│   │   │   │   ├── arm_add_q31.c
│   │   │   │   ├── arm_add_q7.c
│   │   │   │   ├── arm_dot_prod_f32.c
│   │   │   │   ├── arm_dot_prod_q15.c
│   │   │   │   ├── arm_dot_prod_q31.c
│   │   │   │   ├── arm_dot_prod_q7.c
│   │   │   │   ├── arm_mult_f32.c
│   │   │   │   ├── arm_mult_q15.c
│   │   │   │   ├── arm_mult_q31.c
│   │   │   │   ├── arm_mult_q7.c
│   │   │   │   ├── arm_negate_f32.c
│   │   │   │   ├── arm_negate_q15.c
│   │   │   │   ├── arm_negate_q31.c
│   │   │   │   ├── arm_negate_q7.c
│   │   │   │   ├── arm_offset_f32.c
│   │   │   │   ├── arm_offset_q15.c
│   │   │   │   ├── arm_offset_q31.c
│   │   │   │   ├── arm_offset_q7.c
│   │   │   │   ├── arm_scale_f32.c
│   │   │   │   ├── arm_scale_q15.c
│   │   │   │   ├── arm_scale_q31.c
│   │   │   │   ├── arm_scale_q7.c
│   │   │   │   ├── arm_shift_q15.c
│   │   │   │   ├── arm_shift_q31.c
│   │   │   │   ├── arm_shift_q7.c
│   │   │   │   ├── arm_sub_f32.c
│   │   │   │   ├── arm_sub_q15.c
│   │   │   │   ├── arm_sub_q31.c
│   │   │   │   └── arm_sub_q7.c
│   │   │   ├── CommonTables/
│   │   │   │   ├── CommonTables.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_common_tables.c
│   │   │   │   └── arm_const_structs.c
│   │   │   ├── ComplexMathFunctions/
│   │   │   │   ├── ComplexMathFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_cmplx_conj_f32.c
│   │   │   │   ├── arm_cmplx_conj_q15.c
│   │   │   │   ├── arm_cmplx_conj_q31.c
│   │   │   │   ├── arm_cmplx_dot_prod_f32.c
│   │   │   │   ├── arm_cmplx_dot_prod_q15.c
│   │   │   │   ├── arm_cmplx_dot_prod_q31.c
│   │   │   │   ├── arm_cmplx_mag_f32.c
│   │   │   │   ├── arm_cmplx_mag_q15.c
│   │   │   │   ├── arm_cmplx_mag_q31.c
│   │   │   │   ├── arm_cmplx_mag_squared_f32.c
│   │   │   │   ├── arm_cmplx_mag_squared_q15.c
│   │   │   │   ├── arm_cmplx_mag_squared_q31.c
│   │   │   │   ├── arm_cmplx_mult_cmplx_f32.c
│   │   │   │   ├── arm_cmplx_mult_cmplx_q15.c
│   │   │   │   ├── arm_cmplx_mult_cmplx_q31.c
│   │   │   │   ├── arm_cmplx_mult_real_f32.c
│   │   │   │   ├── arm_cmplx_mult_real_q15.c
│   │   │   │   └── arm_cmplx_mult_real_q31.c
│   │   │   ├── ControllerFunctions/
│   │   │   │   ├── ControllerFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_pid_init_f32.c
│   │   │   │   ├── arm_pid_init_q15.c
│   │   │   │   ├── arm_pid_init_q31.c
│   │   │   │   ├── arm_pid_reset_f32.c
│   │   │   │   ├── arm_pid_reset_q15.c
│   │   │   │   ├── arm_pid_reset_q31.c
│   │   │   │   ├── arm_sin_cos_f32.c
│   │   │   │   └── arm_sin_cos_q31.c
│   │   │   ├── FastMathFunctions/
│   │   │   │   ├── FastMathFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_cos_f32.c
│   │   │   │   ├── arm_cos_q15.c
│   │   │   │   ├── arm_cos_q31.c
│   │   │   │   ├── arm_sin_f32.c
│   │   │   │   ├── arm_sin_q15.c
│   │   │   │   ├── arm_sin_q31.c
│   │   │   │   ├── arm_sqrt_q15.c
│   │   │   │   └── arm_sqrt_q31.c
│   │   │   ├── FilteringFunctions/
│   │   │   │   ├── FilteringFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_biquad_cascade_df1_32x64_init_q31.c
│   │   │   │   ├── arm_biquad_cascade_df1_32x64_q31.c
│   │   │   │   ├── arm_biquad_cascade_df1_f32.c
│   │   │   │   ├── arm_biquad_cascade_df1_fast_q15.c
│   │   │   │   ├── arm_biquad_cascade_df1_fast_q31.c
│   │   │   │   ├── arm_biquad_cascade_df1_init_f32.c
│   │   │   │   ├── arm_biquad_cascade_df1_init_q15.c
│   │   │   │   ├── arm_biquad_cascade_df1_init_q31.c
│   │   │   │   ├── arm_biquad_cascade_df1_q15.c
│   │   │   │   ├── arm_biquad_cascade_df1_q31.c
│   │   │   │   ├── arm_biquad_cascade_df2T_f32.c
│   │   │   │   ├── arm_biquad_cascade_df2T_f64.c
│   │   │   │   ├── arm_biquad_cascade_df2T_init_f32.c
│   │   │   │   ├── arm_biquad_cascade_df2T_init_f64.c
│   │   │   │   ├── arm_biquad_cascade_stereo_df2T_f32.c
│   │   │   │   ├── arm_biquad_cascade_stereo_df2T_init_f32.c
│   │   │   │   ├── arm_conv_f32.c
│   │   │   │   ├── arm_conv_fast_opt_q15.c
│   │   │   │   ├── arm_conv_fast_q15.c
│   │   │   │   ├── arm_conv_fast_q31.c
│   │   │   │   ├── arm_conv_opt_q15.c
│   │   │   │   ├── arm_conv_opt_q7.c
│   │   │   │   ├── arm_conv_partial_f32.c
│   │   │   │   ├── arm_conv_partial_fast_opt_q15.c
│   │   │   │   ├── arm_conv_partial_fast_q15.c
│   │   │   │   ├── arm_conv_partial_fast_q31.c
│   │   │   │   ├── arm_conv_partial_opt_q15.c
│   │   │   │   ├── arm_conv_partial_opt_q7.c
│   │   │   │   ├── arm_conv_partial_q15.c
│   │   │   │   ├── arm_conv_partial_q31.c
│   │   │   │   ├── arm_conv_partial_q7.c
│   │   │   │   ├── arm_conv_q15.c
│   │   │   │   ├── arm_conv_q31.c
│   │   │   │   ├── arm_conv_q7.c
│   │   │   │   ├── arm_correlate_f32.c
│   │   │   │   ├── arm_correlate_fast_opt_q15.c
│   │   │   │   ├── arm_correlate_fast_q15.c
│   │   │   │   ├── arm_correlate_fast_q31.c
│   │   │   │   ├── arm_correlate_opt_q15.c
│   │   │   │   ├── arm_correlate_opt_q7.c
│   │   │   │   ├── arm_correlate_q15.c
│   │   │   │   ├── arm_correlate_q31.c
│   │   │   │   ├── arm_correlate_q7.c
│   │   │   │   ├── arm_fir_decimate_f32.c
│   │   │   │   ├── arm_fir_decimate_fast_q15.c
│   │   │   │   ├── arm_fir_decimate_fast_q31.c
│   │   │   │   ├── arm_fir_decimate_init_f32.c
│   │   │   │   ├── arm_fir_decimate_init_q15.c
│   │   │   │   ├── arm_fir_decimate_init_q31.c
│   │   │   │   ├── arm_fir_decimate_q15.c
│   │   │   │   ├── arm_fir_decimate_q31.c
│   │   │   │   ├── arm_fir_f32.c
│   │   │   │   ├── arm_fir_fast_q15.c
│   │   │   │   ├── arm_fir_fast_q31.c
│   │   │   │   ├── arm_fir_init_f32.c
│   │   │   │   ├── arm_fir_init_q15.c
│   │   │   │   ├── arm_fir_init_q31.c
│   │   │   │   ├── arm_fir_init_q7.c
│   │   │   │   ├── arm_fir_interpolate_f32.c
│   │   │   │   ├── arm_fir_interpolate_init_f32.c
│   │   │   │   ├── arm_fir_interpolate_init_q15.c
│   │   │   │   ├── arm_fir_interpolate_init_q31.c
│   │   │   │   ├── arm_fir_interpolate_q15.c
│   │   │   │   ├── arm_fir_interpolate_q31.c
│   │   │   │   ├── arm_fir_lattice_f32.c
│   │   │   │   ├── arm_fir_lattice_init_f32.c
│   │   │   │   ├── arm_fir_lattice_init_q15.c
│   │   │   │   ├── arm_fir_lattice_init_q31.c
│   │   │   │   ├── arm_fir_lattice_q15.c
│   │   │   │   ├── arm_fir_lattice_q31.c
│   │   │   │   ├── arm_fir_q15.c
│   │   │   │   ├── arm_fir_q31.c
│   │   │   │   ├── arm_fir_q7.c
│   │   │   │   ├── arm_fir_sparse_f32.c
│   │   │   │   ├── arm_fir_sparse_init_f32.c
│   │   │   │   ├── arm_fir_sparse_init_q15.c
│   │   │   │   ├── arm_fir_sparse_init_q31.c
│   │   │   │   ├── arm_fir_sparse_init_q7.c
│   │   │   │   ├── arm_fir_sparse_q15.c
│   │   │   │   ├── arm_fir_sparse_q31.c
│   │   │   │   ├── arm_fir_sparse_q7.c
│   │   │   │   ├── arm_iir_lattice_f32.c
│   │   │   │   ├── arm_iir_lattice_init_f32.c
│   │   │   │   ├── arm_iir_lattice_init_q15.c
│   │   │   │   ├── arm_iir_lattice_init_q31.c
│   │   │   │   ├── arm_iir_lattice_q15.c
│   │   │   │   ├── arm_iir_lattice_q31.c
│   │   │   │   ├── arm_lms_f32.c
│   │   │   │   ├── arm_lms_init_f32.c
│   │   │   │   ├── arm_lms_init_q15.c
│   │   │   │   ├── arm_lms_init_q31.c
│   │   │   │   ├── arm_lms_norm_f32.c
│   │   │   │   ├── arm_lms_norm_init_f32.c
│   │   │   │   ├── arm_lms_norm_init_q15.c
│   │   │   │   ├── arm_lms_norm_init_q31.c
│   │   │   │   ├── arm_lms_norm_q15.c
│   │   │   │   ├── arm_lms_norm_q31.c
│   │   │   │   ├── arm_lms_q15.c
│   │   │   │   └── arm_lms_q31.c
│   │   │   ├── Makefile
│   │   │   ├── MatrixFunctions/
│   │   │   │   ├── Makefile
│   │   │   │   ├── MatrixFunctions.c
│   │   │   │   ├── arm_mat_add_f32.c
│   │   │   │   ├── arm_mat_add_q15.c
│   │   │   │   ├── arm_mat_add_q31.c
│   │   │   │   ├── arm_mat_cmplx_mult_f32.c
│   │   │   │   ├── arm_mat_cmplx_mult_q15.c
│   │   │   │   ├── arm_mat_cmplx_mult_q31.c
│   │   │   │   ├── arm_mat_init_f32.c
│   │   │   │   ├── arm_mat_init_q15.c
│   │   │   │   ├── arm_mat_init_q31.c
│   │   │   │   ├── arm_mat_inverse_f32.c
│   │   │   │   ├── arm_mat_inverse_f64.c
│   │   │   │   ├── arm_mat_mult_f32.c
│   │   │   │   ├── arm_mat_mult_fast_q15.c
│   │   │   │   ├── arm_mat_mult_fast_q31.c
│   │   │   │   ├── arm_mat_mult_q15.c
│   │   │   │   ├── arm_mat_mult_q31.c
│   │   │   │   ├── arm_mat_scale_f32.c
│   │   │   │   ├── arm_mat_scale_q15.c
│   │   │   │   ├── arm_mat_scale_q31.c
│   │   │   │   ├── arm_mat_sub_f32.c
│   │   │   │   ├── arm_mat_sub_q15.c
│   │   │   │   ├── arm_mat_sub_q31.c
│   │   │   │   ├── arm_mat_trans_f32.c
│   │   │   │   ├── arm_mat_trans_q15.c
│   │   │   │   └── arm_mat_trans_q31.c
│   │   │   ├── StatisticsFunctions/
│   │   │   │   ├── Makefile
│   │   │   │   ├── StatisticsFunctions.c
│   │   │   │   ├── arm_max_f32.c
│   │   │   │   ├── arm_max_q15.c
│   │   │   │   ├── arm_max_q31.c
│   │   │   │   ├── arm_max_q7.c
│   │   │   │   ├── arm_mean_f32.c
│   │   │   │   ├── arm_mean_q15.c
│   │   │   │   ├── arm_mean_q31.c
│   │   │   │   ├── arm_mean_q7.c
│   │   │   │   ├── arm_min_f32.c
│   │   │   │   ├── arm_min_q15.c
│   │   │   │   ├── arm_min_q31.c
│   │   │   │   ├── arm_min_q7.c
│   │   │   │   ├── arm_power_f32.c
│   │   │   │   ├── arm_power_q15.c
│   │   │   │   ├── arm_power_q31.c
│   │   │   │   ├── arm_power_q7.c
│   │   │   │   ├── arm_rms_f32.c
│   │   │   │   ├── arm_rms_q15.c
│   │   │   │   ├── arm_rms_q31.c
│   │   │   │   ├── arm_std_f32.c
│   │   │   │   ├── arm_std_q15.c
│   │   │   │   ├── arm_std_q31.c
│   │   │   │   ├── arm_var_f32.c
│   │   │   │   ├── arm_var_q15.c
│   │   │   │   └── arm_var_q31.c
│   │   │   ├── SupportFunctions/
│   │   │   │   ├── Makefile
│   │   │   │   ├── SupportFunctions.c
│   │   │   │   ├── arm_copy_f32.c
│   │   │   │   ├── arm_copy_q15.c
│   │   │   │   ├── arm_copy_q31.c
│   │   │   │   ├── arm_copy_q7.c
│   │   │   │   ├── arm_fill_f32.c
│   │   │   │   ├── arm_fill_q15.c
│   │   │   │   ├── arm_fill_q31.c
│   │   │   │   ├── arm_fill_q7.c
│   │   │   │   ├── arm_float_to_q15.c
│   │   │   │   ├── arm_float_to_q31.c
│   │   │   │   ├── arm_float_to_q7.c
│   │   │   │   ├── arm_q15_to_float.c
│   │   │   │   ├── arm_q15_to_q31.c
│   │   │   │   ├── arm_q15_to_q7.c
│   │   │   │   ├── arm_q31_to_float.c
│   │   │   │   ├── arm_q31_to_q15.c
│   │   │   │   ├── arm_q31_to_q7.c
│   │   │   │   ├── arm_q7_to_float.c
│   │   │   │   ├── arm_q7_to_q15.c
│   │   │   │   └── arm_q7_to_q31.c
│   │   │   └── TransformFunctions/
│   │   │       ├── Makefile
│   │   │       ├── TransformFunctions.c
│   │   │       ├── arm_bitreversal.c
│   │   │       ├── arm_bitreversal2.S
│   │   │       ├── arm_bitreversal2.c
│   │   │       ├── arm_cfft_f32.c
│   │   │       ├── arm_cfft_q15.c
│   │   │       ├── arm_cfft_q31.c
│   │   │       ├── arm_cfft_radix2_f32.c
│   │   │       ├── arm_cfft_radix2_init_f32.c
│   │   │       ├── arm_cfft_radix2_init_q15.c
│   │   │       ├── arm_cfft_radix2_init_q31.c
│   │   │       ├── arm_cfft_radix2_q15.c
│   │   │       ├── arm_cfft_radix2_q31.c
│   │   │       ├── arm_cfft_radix4_f32.c
│   │   │       ├── arm_cfft_radix4_init_f32.c
│   │   │       ├── arm_cfft_radix4_init_q15.c
│   │   │       ├── arm_cfft_radix4_init_q31.c
│   │   │       ├── arm_cfft_radix4_q15.c
│   │   │       ├── arm_cfft_radix4_q31.c
│   │   │       ├── arm_cfft_radix8_f32.c
│   │   │       ├── arm_dct4_f32.c
│   │   │       ├── arm_dct4_init_f32.c
│   │   │       ├── arm_dct4_init_q15.c
│   │   │       ├── arm_dct4_init_q31.c
│   │   │       ├── arm_dct4_q15.c
│   │   │       ├── arm_dct4_q31.c
│   │   │       ├── arm_rfft_f32.c
│   │   │       ├── arm_rfft_fast_f32.c
│   │   │       ├── arm_rfft_fast_init_f32.c
│   │   │       ├── arm_rfft_init_f32.c
│   │   │       ├── arm_rfft_init_q15.c
│   │   │       ├── arm_rfft_init_q31.c
│   │   │       ├── arm_rfft_q15.c
│   │   │       └── arm_rfft_q31.c
│   │   ├── LICENSE.txt
│   │   ├── Makefile
│   │   ├── ca/
│   │   │   ├── Makefile
│   │   │   ├── cmsis_gic.c
│   │   │   ├── default_irq_ca.S
│   │   │   ├── irq_ctrl_gic.c
│   │   │   ├── mmu_ARMCA.c
│   │   │   ├── startup_ARMCA.c
│   │   │   └── system_ARMCA.c
│   │   ├── cmsis_nvic.c
│   │   ├── inc/
│   │   │   ├── arm_common_tables.h
│   │   │   ├── arm_const_structs.h
│   │   │   ├── arm_math.h
│   │   │   ├── best1000.h
│   │   │   ├── best1400.h
│   │   │   ├── best2000.h
│   │   │   ├── best2001.h
│   │   │   ├── best2300.h
│   │   │   ├── best2300a.h
│   │   │   ├── best2300p.h
│   │   │   ├── best3001.h
│   │   │   ├── best3003.h
│   │   │   ├── ca/
│   │   │   │   ├── best2001_dsp.h
│   │   │   │   ├── cmsis_armcc_ca.h
│   │   │   │   ├── cmsis_armclang_ca.h
│   │   │   │   ├── cmsis_compiler_ca.h
│   │   │   │   ├── cmsis_cp15_ca.h
│   │   │   │   ├── cmsis_gcc_ca.h
│   │   │   │   ├── cmsis_iccarm_ca.h
│   │   │   │   ├── core_ca.h
│   │   │   │   ├── irq_ctrl.h
│   │   │   │   ├── mem_ARMCA.h
│   │   │   │   └── system_ARMCA.h
│   │   │   ├── cmsis.h
│   │   │   ├── cmsis_armcc.h
│   │   │   ├── cmsis_armclang.h
│   │   │   ├── cmsis_armclang_ltm.h
│   │   │   ├── cmsis_compiler.h
│   │   │   ├── cmsis_gcc.h
│   │   │   ├── cmsis_iccarm.h
│   │   │   ├── cmsis_nvic.h
│   │   │   ├── cmsis_version.h
│   │   │   ├── core_armv81mml.h
│   │   │   ├── core_armv8mbl.h
│   │   │   ├── core_armv8mml.h
│   │   │   ├── core_cm0.h
│   │   │   ├── core_cm0plus.h
│   │   │   ├── core_cm1.h
│   │   │   ├── core_cm23.h
│   │   │   ├── core_cm3.h
│   │   │   ├── core_cm33.h
│   │   │   ├── core_cm35p.h
│   │   │   ├── core_cm4.h
│   │   │   ├── core_cm7.h
│   │   │   ├── core_sc000.h
│   │   │   ├── core_sc300.h
│   │   │   ├── link_sym_armclang.h
│   │   │   ├── main_entry.h
│   │   │   ├── mpu.h
│   │   │   ├── mpu_armv7.h
│   │   │   ├── mpu_armv8.h
│   │   │   ├── patch.h
│   │   │   ├── system_ARMCM.h
│   │   │   ├── system_cp.h
│   │   │   └── tz_context.h
│   │   ├── mpu_armv7m.c
│   │   ├── mpu_armv8m.c
│   │   ├── patch.c
│   │   ├── patch_armv7m.c
│   │   ├── reg_patch.h
│   │   ├── reg_patch_armv7m.h
│   │   ├── retarget_armclang.cpp
│   │   ├── retarget_armclang_asm.S
│   │   ├── retarget_gcc.cpp
│   │   ├── stack_protector.c
│   │   ├── system_ARMCM.c
│   │   ├── system_cp.c
│   │   └── system_utils.c
│   ├── drivers/
│   │   ├── Makefile
│   │   ├── ana/
│   │   │   ├── Makefile
│   │   │   ├── analog.h
│   │   │   ├── best2300p/
│   │   │   │   ├── Makefile
│   │   │   │   ├── analog_best2300p.c
│   │   │   │   ├── analog_best2300p.h
│   │   │   │   ├── pmu_best2300p.c
│   │   │   │   ├── pmu_best2300p.h
│   │   │   │   ├── reg_usbphy_best2300p.h
│   │   │   │   ├── usbphy_best2300p.c
│   │   │   │   └── usbphy_best2300p.h
│   │   │   ├── pmu.h
│   │   │   ├── psramuhsphy.h
│   │   │   └── usbphy.h
│   │   ├── bt/
│   │   │   ├── Makefile
│   │   │   ├── besbt_string.h
│   │   │   ├── best2300p/
│   │   │   │   ├── Makefile
│   │   │   │   ├── bt_drv.cpp
│   │   │   │   ├── bt_drv_2300p_internal.h
│   │   │   │   ├── bt_drv_calibration.cpp
│   │   │   │   ├── bt_drv_config.c
│   │   │   │   ├── bt_drv_patch.c
│   │   │   │   ├── bt_drv_reg_op.cpp
│   │   │   │   ├── bt_drv_rfconfig.c
│   │   │   │   ├── bt_drv_uart_bridge_intsys.c
│   │   │   │   ├── iqcorrect.c
│   │   │   │   └── iqcorrect.h
│   │   │   ├── bt_drv.h
│   │   │   ├── bt_drv_common.c
│   │   │   ├── bt_drv_interface.h
│   │   │   ├── bt_drv_internal.h
│   │   │   └── bt_drv_reg_op.h
│   │   ├── btpcm/
│   │   │   ├── Makefile
│   │   │   ├── btpcm.c
│   │   │   └── btpcm.h
│   │   ├── codec/
│   │   │   ├── Makefile
│   │   │   ├── best2300p/
│   │   │   │   ├── Makefile
│   │   │   │   ├── codec_best2300p.c
│   │   │   │   └── codec_best2300p.h
│   │   │   ├── codec_int.h
│   │   │   ├── codec_tlv32aic32.c
│   │   │   └── codec_tlv32aic32.h
│   │   ├── norflash/
│   │   │   ├── Makefile
│   │   │   ├── norflash_drv.c
│   │   │   ├── norflash_drv.h
│   │   │   ├── norflash_en25s80b.c
│   │   │   ├── norflash_en25s80b.h
│   │   │   ├── norflash_gd25lq32c.c
│   │   │   ├── norflash_gd25lq32c.h
│   │   │   ├── norflash_gd25q32c.c
│   │   │   └── norflash_gd25q32c.h
│   │   └── sbcacc/
│   │       └── Makefile
│   ├── hal/
│   │   ├── Makefile
│   │   ├── best2300p/
│   │   │   ├── Makefile
│   │   │   ├── hal_analogif_best2300p.c
│   │   │   ├── hal_cmu_best2300p.c
│   │   │   ├── hal_cmu_best2300p.h
│   │   │   ├── hal_codec_best2300p.c
│   │   │   ├── hal_dmacfg_best2300p.h
│   │   │   ├── hal_iomux_best2300p.c
│   │   │   ├── hal_iomux_best2300p.h
│   │   │   ├── hal_psc_best2300p.c
│   │   │   ├── hal_sensor_eng_best2300p.c
│   │   │   ├── plat_addr_map_best2300p.h
│   │   │   ├── reg_aoncmu_best2300p.h
│   │   │   ├── reg_btcmu_best2300p.h
│   │   │   ├── reg_cmu_best2300p.h
│   │   │   ├── reg_codec_best2300p.h
│   │   │   ├── reg_iomux_best2300p.h
│   │   │   ├── reg_psc_best2300p.h
│   │   │   └── reg_sensor_eng_best2300p.h
│   │   ├── hal_analogif.h
│   │   ├── hal_aud.h
│   │   ├── hal_bootmode.c
│   │   ├── hal_bootmode.h
│   │   ├── hal_btdump.c
│   │   ├── hal_btdump.h
│   │   ├── hal_btpcm.c
│   │   ├── hal_btpcm.h
│   │   ├── hal_btpcmip.h
│   │   ├── hal_cache.c
│   │   ├── hal_cache.h
│   │   ├── hal_chipid.c
│   │   ├── hal_chipid.h
│   │   ├── hal_cmd.c
│   │   ├── hal_cmd.h
│   │   ├── hal_cmu.h
│   │   ├── hal_cmu_common.c
│   │   ├── hal_codec.h
│   │   ├── hal_codec_common.c
│   │   ├── hal_dma.c
│   │   ├── hal_dma.h
│   │   ├── hal_gpadc.c
│   │   ├── hal_gpadc.h
│   │   ├── hal_gpio.c
│   │   ├── hal_gpio.h
│   │   ├── hal_hwfft.h
│   │   ├── hal_i2c.c
│   │   ├── hal_i2c.h
│   │   ├── hal_i2cip.h
│   │   ├── hal_i2s.c
│   │   ├── hal_i2s.h
│   │   ├── hal_i2s_tdm.c
│   │   ├── hal_i2s_tdm.h
│   │   ├── hal_i2sip.h
│   │   ├── hal_intersys.c
│   │   ├── hal_intersys.h
│   │   ├── hal_iomux.h
│   │   ├── hal_key.c
│   │   ├── hal_key.h
│   │   ├── hal_location.h
│   │   ├── hal_mcu2cp.c
│   │   ├── hal_mcu2cp.h
│   │   ├── hal_memsc.c
│   │   ├── hal_memsc.h
│   │   ├── hal_norflash.c
│   │   ├── hal_norflash.h
│   │   ├── hal_norflaship.h
│   │   ├── hal_norflaship_v1.c
│   │   ├── hal_norflaship_v2.c
│   │   ├── hal_overlay.c
│   │   ├── hal_overlay.h
│   │   ├── hal_phyif.c
│   │   ├── hal_phyif.h
│   │   ├── hal_psc.h
│   │   ├── hal_psram.h
│   │   ├── hal_psram_v1.c
│   │   ├── hal_psram_v2.c
│   │   ├── hal_psramip_v1.h
│   │   ├── hal_psramuhs.c
│   │   ├── hal_psramuhs.h
│   │   ├── hal_pwm.c
│   │   ├── hal_pwm.h
│   │   ├── hal_rtc.c
│   │   ├── hal_rtc.h
│   │   ├── hal_sec_eng.c
│   │   ├── hal_sec_eng.h
│   │   ├── hal_sensor_eng.h
│   │   ├── hal_slave_i2c.c
│   │   ├── hal_slave_i2c.h
│   │   ├── hal_sleep.c
│   │   ├── hal_sleep.h
│   │   ├── hal_sleep_core_pd.S
│   │   ├── hal_sleep_core_pd.h
│   │   ├── hal_sleep_mcu_pd.S
│   │   ├── hal_sleep_mcu_pd.h
│   │   ├── hal_spdif.c
│   │   ├── hal_spdif.h
│   │   ├── hal_spdifip.h
│   │   ├── hal_spi.c
│   │   ├── hal_spi.h
│   │   ├── hal_sysfreq.c
│   │   ├── hal_sysfreq.h
│   │   ├── hal_tdm.c
│   │   ├── hal_tdm.h
│   │   ├── hal_timer.c
│   │   ├── hal_timer.h
│   │   ├── hal_timer_raw.h
│   │   ├── hal_trace.c
│   │   ├── hal_trace.h
│   │   ├── hal_trace_mod.c
│   │   ├── hal_trace_mod.h
│   │   ├── hal_transq.c
│   │   ├── hal_transq.h
│   │   ├── hal_uart.c
│   │   ├── hal_uart.h
│   │   ├── hal_wdt.c
│   │   ├── hal_wdt.h
│   │   ├── plat_addr_map.h
│   │   ├── plat_types.h
│   │   ├── reg_btpcmip.h
│   │   ├── reg_dma.h
│   │   ├── reg_gpio.h
│   │   ├── reg_i2cip.h
│   │   ├── reg_i2sip.h
│   │   ├── reg_norflaship_v1.h
│   │   ├── reg_norflaship_v2.h
│   │   ├── reg_psram_mc_v2.h
│   │   ├── reg_psram_phy_v2.h
│   │   ├── reg_psramip_v1.h
│   │   ├── reg_psramuhs_mc.h
│   │   ├── reg_pwm.h
│   │   ├── reg_rtc.h
│   │   ├── reg_sec_eng.h
│   │   ├── reg_slave_i2c.h
│   │   ├── reg_spdifip.h
│   │   ├── reg_spi.h
│   │   ├── reg_tdm.h
│   │   ├── reg_timer.h
│   │   ├── reg_transq.h
│   │   ├── reg_uart.h
│   │   └── reg_usb.h
│   └── main/
│       ├── Makefile
│       ├── main.cpp
│       ├── noapp_main.cpp
│       ├── nostd_main.c
│       └── startup_main.S
├── rtos/
│   ├── Makefile
│   ├── rtx/
│   │   ├── TARGET_ARM7/
│   │   │   ├── ARM7/
│   │   │   │   └── TOOLCHAIN_GCC/
│   │   │   │       ├── HAL_CM0.S
│   │   │   │       └── SVC_Table.S
│   │   │   ├── HAL_CM.c
│   │   │   ├── RTX_CM_lib.h
│   │   │   ├── RTX_Conf.h
│   │   │   ├── RTX_Conf_CM.c
│   │   │   ├── cmsis_os.h
│   │   │   ├── os_tcb.h
│   │   │   ├── rt_CMSIS.c
│   │   │   ├── rt_Event.c
│   │   │   ├── rt_Event.h
│   │   │   ├── rt_HAL_CM.h
│   │   │   ├── rt_List.c
│   │   │   ├── rt_List.h
│   │   │   ├── rt_Mailbox.c
│   │   │   ├── rt_Mailbox.h
│   │   │   ├── rt_MemBox.c
│   │   │   ├── rt_MemBox.h
│   │   │   ├── rt_Mutex.c
│   │   │   ├── rt_Mutex.h
│   │   │   ├── rt_Robin.c
│   │   │   ├── rt_Robin.h
│   │   │   ├── rt_Semaphore.c
│   │   │   ├── rt_Semaphore.h
│   │   │   ├── rt_System.c
│   │   │   ├── rt_System.h
│   │   │   ├── rt_Task.c
│   │   │   ├── rt_Task.h
│   │   │   ├── rt_Time.c
│   │   │   ├── rt_Time.h
│   │   │   └── rt_TypeDef.h
│   │   ├── TARGET_CORTEX_A/
│   │   │   ├── HAL_CA.c
│   │   │   ├── RTX_CM_lib.h
│   │   │   ├── RTX_Conf_CA.c
│   │   │   ├── RTX_Config.h
│   │   │   ├── TOOLCHAIN_ARM/
│   │   │   │   ├── HAL_CA9.c
│   │   │   │   └── SVC_Table.S
│   │   │   ├── TOOLCHAIN_GCC/
│   │   │   │   ├── HAL_CA9.S
│   │   │   │   └── SVC_Table.S
│   │   │   ├── cmsis_os.h
│   │   │   ├── rt_CMSIS.c
│   │   │   ├── rt_Event.c
│   │   │   ├── rt_Event.h
│   │   │   ├── rt_HAL_CA.h
│   │   │   ├── rt_HAL_CM.h
│   │   │   ├── rt_List.c
│   │   │   ├── rt_List.h
│   │   │   ├── rt_Mailbox.c
│   │   │   ├── rt_Mailbox.h
│   │   │   ├── rt_MemBox.c
│   │   │   ├── rt_MemBox.h
│   │   │   ├── rt_Memory.c
│   │   │   ├── rt_Memory.h
│   │   │   ├── rt_Mutex.c
│   │   │   ├── rt_Mutex.h
│   │   │   ├── rt_Robin.c
│   │   │   ├── rt_Robin.h
│   │   │   ├── rt_Semaphore.c
│   │   │   ├── rt_Semaphore.h
│   │   │   ├── rt_System.c
│   │   │   ├── rt_System.h
│   │   │   ├── rt_Task.c
│   │   │   ├── rt_Task.h
│   │   │   ├── rt_Time.c
│   │   │   ├── rt_Time.h
│   │   │   ├── rt_Timer.h
│   │   │   └── rt_TypeDef.h
│   │   └── TARGET_CORTEX_M/
│   │       ├── HAL_CM.c
│   │       ├── Makefile
│   │       ├── RTX_CM_lib.h
│   │       ├── RTX_Conf.h
│   │       ├── RTX_Conf_CM.c
│   │       ├── TARGET_M0/
│   │       │   ├── TOOLCHAIN_ARM/
│   │       │   │   ├── HAL_CM0.c
│   │       │   │   └── SVC_Table.S
│   │       │   ├── TOOLCHAIN_GCC/
│   │       │   │   ├── HAL_CM0.S
│   │       │   │   └── SVC_Table.S
│   │       │   └── TOOLCHAIN_IAR/
│   │       │       ├── HAL_CM0.S
│   │       │       └── SVC_Table.S
│   │       ├── TARGET_M0P/
│   │       │   ├── TOOLCHAIN_ARM/
│   │       │   │   ├── HAL_CM0.c
│   │       │   │   └── SVC_Table.S
│   │       │   ├── TOOLCHAIN_GCC/
│   │       │   │   ├── HAL_CM0.S
│   │       │   │   └── SVC_Table.S
│   │       │   └── TOOLCHAIN_IAR/
│   │       │       ├── HAL_CM0.S
│   │       │       └── SVC_Table.S
│   │       ├── TARGET_M3/
│   │       │   ├── TOOLCHAIN_ARM/
│   │       │   │   ├── HAL_CM3.c
│   │       │   │   └── SVC_Table.S
│   │       │   ├── TOOLCHAIN_GCC/
│   │       │   │   ├── HAL_CM3.S
│   │       │   │   └── SVC_Table.S
│   │       │   └── TOOLCHAIN_IAR/
│   │       │       ├── HAL_CM3.S
│   │       │       └── SVC_Table.S
│   │       ├── TARGET_M4/
│   │       │   ├── TOOLCHAIN_ARM/
│   │       │   │   ├── HAL_CM4.c
│   │       │   │   └── SVC_Table.S
│   │       │   ├── TOOLCHAIN_GCC/
│   │       │   │   ├── HAL_CM4.S
│   │       │   │   └── SVC_Table.S
│   │       │   └── TOOLCHAIN_IAR/
│   │       │       ├── HAL_CM4.S
│   │       │       └── SVC_Table.S
│   │       ├── rt_CMSIS.c
│   │       ├── rt_Event.c
│   │       ├── rt_Event.h
│   │       ├── rt_HAL_CM.h
│   │       ├── rt_List.c
│   │       ├── rt_List.h
│   │       ├── rt_Mailbox.c
│   │       ├── rt_Mailbox.h
│   │       ├── rt_MemBox.c
│   │       ├── rt_MemBox.h
│   │       ├── rt_Mutex.c
│   │       ├── rt_Mutex.h
│   │       ├── rt_Robin.c
│   │       ├── rt_Robin.h
│   │       ├── rt_Semaphore.c
│   │       ├── rt_Semaphore.h
│   │       ├── rt_System.c
│   │       ├── rt_System.h
│   │       ├── rt_Task.c
│   │       ├── rt_Task.h
│   │       ├── rt_Time.c
│   │       ├── rt_Time.h
│   │       └── rt_TypeDef.h
│   └── rtx5/
│       ├── ARM/
│       │   ├── irq_armv8mbl.s
│       │   ├── irq_armv8mbl_ns.s
│       │   ├── irq_armv8mml.s
│       │   ├── irq_armv8mml_ns.s
│       │   ├── irq_ca.s
│       │   ├── irq_cm0.s
│       │   ├── irq_cm3.s
│       │   └── irq_cm4f.s
│       ├── GCC/
│       │   ├── Makefile
│       │   ├── irq_armv8mbl.S
│       │   ├── irq_armv8mbl_ns.S
│       │   ├── irq_armv8mml.S
│       │   ├── irq_armv8mml_fp.S
│       │   ├── irq_armv8mml_fp_ns.S
│       │   ├── irq_armv8mml_ns.S
│       │   ├── irq_ca.S
│       │   ├── irq_cm0.S
│       │   ├── irq_cm3.S
│       │   └── irq_cm4f.S
│       ├── IAR/
│       │   ├── irq_armv8mbl.s
│       │   ├── irq_armv8mbl_common.s
│       │   ├── irq_armv8mbl_ns.s
│       │   ├── irq_armv8mml.s
│       │   ├── irq_armv8mml_common.s
│       │   ├── irq_armv8mml_ns.s
│       │   ├── irq_ca.s
│       │   ├── irq_cm0.s
│       │   ├── irq_cm3.s
│       │   └── irq_cm4f.s
│       ├── Makefile
│       ├── RTE_Components.h
│       ├── cmsis_os1.c
│       ├── os_systick.c
│       ├── rtx_config/
│       │   ├── Makefile
│       │   ├── rtx_config.c
│       │   └── rtx_config.h
│       ├── rtx_core_c.h
│       ├── rtx_core_ca.h
│       ├── rtx_core_cm.h
│       ├── rtx_delay.c
│       ├── rtx_evflags.c
│       ├── rtx_evr.c
│       ├── rtx_kernel.c
│       ├── rtx_lib.c
│       ├── rtx_lib.h
│       ├── rtx_memory.c
│       ├── rtx_mempool.c
│       ├── rtx_msgqueue.c
│       ├── rtx_mutex.c
│       ├── rtx_semaphore.c
│       ├── rtx_system.c
│       ├── rtx_thread.c
│       ├── rtx_thread_dump.c
│       └── rtx_timer.c
├── scripts/
│   ├── build.mk
│   ├── clean.mk
│   ├── extrawarn.mk
│   ├── include.mk
│   ├── lib.mk
│   ├── link/
│   │   ├── armca.lds.S
│   │   ├── best1000.lds.S
│   │   ├── best1000_fpga_rom.lds.S
│   │   ├── best1000_intsram.lds.S
│   │   ├── best1000_intsram.lds_scat.S
│   │   ├── best1000_msbc_aac.lds.S
│   │   ├── best1000savepower.lds.S
│   │   ├── best2000_bisto.lds.S
│   │   ├── best2000_dma.lds.S
│   │   ├── programmer.lds.S
│   │   ├── programmer.lds_scat.S
│   │   ├── programmer_inflash.lds.S
│   │   ├── rom.lds.S
│   │   └── rom.lds_scat.S
│   ├── submods.mk
│   └── submods_init.mk
├── services/
│   ├── Makefile
│   ├── anc_spp_tool/
│   │   ├── Makefile
│   │   └── anc_parse_data.h
│   ├── app_ai/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   ├── app_ai_algorithm.h
│   │   │   ├── app_ai_if.h
│   │   │   ├── app_ai_if_config.h
│   │   │   ├── app_ai_if_custom_ui.h
│   │   │   ├── app_ai_if_gsound.h
│   │   │   ├── app_ai_if_thirdparty.h
│   │   │   ├── app_ai_manager_api.h
│   │   │   └── app_ai_tws.h
│   │   ├── src/
│   │   │   ├── app_ai_algorithm.cpp
│   │   │   ├── app_ai_if.cpp
│   │   │   ├── app_ai_if_custom_ui.cpp
│   │   │   ├── app_ai_if_gsound.cpp
│   │   │   ├── app_ai_if_thirdparty.cpp
│   │   │   ├── app_ai_manager_api.cpp
│   │   │   └── app_ai_tws.cpp
│   │   └── voice_sbc/
│   │       ├── voice_sbc.cpp
│   │       └── voice_sbc.h
│   ├── app_ibrt/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   ├── app_ibrt_a2dp.h
│   │   │   ├── app_ibrt_auto_test.h
│   │   │   ├── app_ibrt_auto_test_cmd_handle.h
│   │   │   ├── app_ibrt_ble_adv.h
│   │   │   ├── app_ibrt_custom_cmd.h
│   │   │   ├── app_ibrt_customif_cmd.h
│   │   │   ├── app_ibrt_customif_ui.h
│   │   │   ├── app_ibrt_hf.h
│   │   │   ├── app_ibrt_if.h
│   │   │   ├── app_ibrt_if_internal.h
│   │   │   ├── app_ibrt_keyboard.h
│   │   │   ├── app_ibrt_nvrecord.h
│   │   │   ├── app_ibrt_ota_cmd.h
│   │   │   ├── app_ibrt_ota_update.h
│   │   │   ├── app_ibrt_peripheral_manager.h
│   │   │   ├── app_ibrt_rssi.h
│   │   │   ├── app_ibrt_ui_test.h
│   │   │   ├── app_ibrt_ui_test_cmd_if.h
│   │   │   └── app_ibrt_voice_report.h
│   │   └── src/
│   │       ├── app_ibrt_auto_test.cpp
│   │       ├── app_ibrt_auto_test_cmd_handle.cpp
│   │       ├── app_ibrt_ble_adv.cpp
│   │       ├── app_ibrt_customif_cmd.cpp
│   │       ├── app_ibrt_customif_ui.cpp
│   │       ├── app_ibrt_if.cpp
│   │       ├── app_ibrt_keyboard.cpp
│   │       ├── app_ibrt_nvrecord.cpp
│   │       ├── app_ibrt_ota_cmd.cpp
│   │       ├── app_ibrt_ota_update.cpp
│   │       ├── app_ibrt_peripheral_manager.cpp
│   │       ├── app_ibrt_rssi.cpp
│   │       ├── app_ibrt_search_pair_ui.cpp
│   │       ├── app_ibrt_ui_test.cpp
│   │       ├── app_ibrt_ui_test_cmd_if.cpp
│   │       └── app_ibrt_voice_report.cpp
│   ├── app_tws/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   └── app_tws_if.h
│   │   └── src/
│   │       └── app_tws_if.cpp
│   ├── audio_dump/
│   │   ├── Makefile
│   │   ├── include/
│   │   │   └── audio_dump.h
│   │   └── src/
│   │       └── audio_dump.c
│   ├── audio_process/
│   │   ├── Makefile
│   │   ├── audio_cfg.c
│   │   ├── audio_cfg.h
│   │   ├── audio_process.c
│   │   ├── audio_process.h
│   │   ├── audio_spectrum.cpp
│   │   └── audio_spectrum.h
│   ├── audioflinger/
│   │   ├── Makefile
│   │   ├── audioflinger.c
│   │   └── audioflinger.h
│   ├── auto_test/
│   │   ├── Makefile
│   │   ├── at_thread.cpp
│   │   ├── at_thread.h
│   │   ├── at_thread_user.cpp
│   │   ├── at_thread_user.h
│   │   └── auto_test.cpp
│   ├── ble_app/
│   │   ├── Makefile
│   │   ├── app_amsc/
│   │   │   ├── app_amsc.c
│   │   │   ├── app_amsc.h
│   │   │   ├── app_amsc_task.c
│   │   │   └── app_amsc_task.h
│   │   ├── app_ancc/
│   │   │   ├── app_ancc.c
│   │   │   ├── app_ancc.h
│   │   │   ├── app_ancc_task.c
│   │   │   └── app_ancc_task.h
│   │   ├── app_batt/
│   │   │   ├── app_batt.c
│   │   │   └── app_batt.h
│   │   ├── app_ble_key.cpp
│   │   ├── app_ble_uart.cpp
│   │   ├── app_ble_uart.h
│   │   ├── app_datapath/
│   │   │   ├── app_ble_cmd_handler.c
│   │   │   ├── app_ble_cmd_handler.h
│   │   │   ├── app_ble_custom_cmd.c
│   │   │   ├── app_ble_custom_cmd.h
│   │   │   ├── app_datapath_server.c
│   │   │   └── app_datapath_server.h
│   │   ├── app_dis/
│   │   │   ├── app_dis.c
│   │   │   └── app_dis.h
│   │   ├── app_gfps/
│   │   │   ├── app_gfps.c
│   │   │   └── app_gfps.h
│   │   ├── app_hid/
│   │   │   ├── app_hid.c
│   │   │   └── app_hid.h
│   │   ├── app_hrps/
│   │   │   ├── app_hrps.c
│   │   │   └── app_hrps.h
│   │   ├── app_htp/
│   │   │   ├── app_ht.c
│   │   │   └── app_ht.h
│   │   ├── app_main/
│   │   │   ├── app.c
│   │   │   ├── app.h
│   │   │   ├── app_ble_core.c
│   │   │   ├── app_ble_core.h
│   │   │   ├── app_ble_customif.c
│   │   │   ├── app_ble_customif.h
│   │   │   ├── app_ble_include.h
│   │   │   ├── app_ble_mode_switch.c
│   │   │   ├── app_ble_mode_switch.h
│   │   │   ├── app_ble_rx_handler.c
│   │   │   ├── app_ble_rx_handler.h
│   │   │   ├── app_task.c
│   │   │   └── app_task.h
│   │   ├── app_ota/
│   │   │   ├── app_ota.c
│   │   │   └── app_ota.h
│   │   ├── app_sec/
│   │   │   ├── app_sec.c
│   │   │   └── app_sec.h
│   │   ├── app_tota/
│   │   │   ├── app_tota_ble.c
│   │   │   └── app_tota_ble.h
│   │   ├── app_vob/
│   │   │   └── voice_over_ble.c
│   │   ├── app_voice/
│   │   │   ├── app_voicepath_ble.c
│   │   │   └── app_voicepath_ble.h
│   │   └── ble_app_dbg.h
│   ├── ble_profiles/
│   │   ├── Makefile
│   │   ├── ams/
│   │   │   ├── ams_common.h
│   │   │   └── amsc/
│   │   │       ├── amsc.c
│   │   │       ├── amsc.h
│   │   │       ├── amsc_task.c
│   │   │       └── amsc_task.h
│   │   ├── anc/
│   │   │   ├── anc_common.h
│   │   │   └── ancc/
│   │   │       ├── ancc.c
│   │   │       ├── ancc.h
│   │   │       ├── ancc_task.c
│   │   │       └── ancc_task.h
│   │   ├── anp/
│   │   │   ├── anp_common.h
│   │   │   ├── anpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── anpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── anpc.c
│   │   │   │       ├── anpc.h
│   │   │   │       └── anpc_task.c
│   │   │   └── anps/
│   │   │       ├── api/
│   │   │       │   └── anps_task.h
│   │   │       └── src/
│   │   │           ├── anps.c
│   │   │           ├── anps.h
│   │   │           └── anps_task.c
│   │   ├── bas/
│   │   │   ├── basc/
│   │   │   │   ├── api/
│   │   │   │   │   └── basc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── basc.c
│   │   │   │       ├── basc.h
│   │   │   │       └── basc_task.c
│   │   │   └── bass/
│   │   │       ├── api/
│   │   │       │   └── bass_task.h
│   │   │       └── src/
│   │   │           ├── bass.c
│   │   │           ├── bass.h
│   │   │           └── bass_task.c
│   │   ├── blp/
│   │   │   ├── blp_common.h
│   │   │   ├── blpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── blpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── blpc.c
│   │   │   │       ├── blpc.h
│   │   │   │       └── blpc_task.c
│   │   │   └── blps/
│   │   │       ├── api/
│   │   │       │   └── blps_task.h
│   │   │       └── src/
│   │   │           ├── blps.c
│   │   │           ├── blps.h
│   │   │           └── blps_task.c
│   │   ├── cpp/
│   │   │   ├── cpp_common.h
│   │   │   ├── cppc/
│   │   │   │   ├── api/
│   │   │   │   │   └── cppc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── cppc.c
│   │   │   │       ├── cppc.h
│   │   │   │       └── cppc_task.c
│   │   │   └── cpps/
│   │   │       ├── api/
│   │   │       │   └── cpps_task.h
│   │   │       └── src/
│   │   │           ├── cpps.c
│   │   │           ├── cpps.h
│   │   │           └── cpps_task.c
│   │   ├── cscp/
│   │   │   ├── cscp_common.h
│   │   │   ├── cscpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── cscpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── cscpc.c
│   │   │   │       ├── cscpc.h
│   │   │   │       └── cscpc_task.c
│   │   │   └── cscps/
│   │   │       ├── api/
│   │   │       │   └── cscps_task.h
│   │   │       └── src/
│   │   │           ├── cscps.c
│   │   │           ├── cscps.h
│   │   │           └── cscps_task.c
│   │   ├── datapath/
│   │   │   └── datapathps/
│   │   │       ├── api/
│   │   │       │   └── datapathps_task.h
│   │   │       └── src/
│   │   │           ├── datapathps.c
│   │   │           ├── datapathps.h
│   │   │           └── datapathps_task.c
│   │   ├── dis/
│   │   │   ├── disc/
│   │   │   │   ├── api/
│   │   │   │   │   └── disc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── disc.c
│   │   │   │       ├── disc.h
│   │   │   │       └── disc_task.c
│   │   │   └── diss/
│   │   │       ├── api/
│   │   │       │   └── diss_task.h
│   │   │       └── src/
│   │   │           ├── diss.c
│   │   │           ├── diss.h
│   │   │           └── diss_task.c
│   │   ├── find/
│   │   │   ├── find_common.h
│   │   │   ├── findl/
│   │   │   │   ├── api/
│   │   │   │   │   └── findl_task.h
│   │   │   │   └── src/
│   │   │   │       ├── findl.c
│   │   │   │       ├── findl.h
│   │   │   │       └── findl_task.c
│   │   │   └── findt/
│   │   │       ├── api/
│   │   │       │   └── findt_task.h
│   │   │       └── src/
│   │   │           ├── findt.c
│   │   │           ├── findt.h
│   │   │           └── findt_task.c
│   │   ├── gfps/
│   │   │   ├── Makefile
│   │   │   ├── api/
│   │   │   │   └── gfps_crypto.h
│   │   │   └── gfps_provider/
│   │   │       ├── api/
│   │   │       │   ├── gfps_provider.h
│   │   │       │   ├── gfps_provider_errors.h
│   │   │       │   └── gfps_provider_task.h
│   │   │       └── src/
│   │   │           ├── gfps_provider.c
│   │   │           └── gfps_provider_task.c
│   │   ├── glp/
│   │   │   ├── glp_common.h
│   │   │   ├── glpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── glpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── glpc.c
│   │   │   │       ├── glpc.h
│   │   │   │       └── glpc_task.c
│   │   │   └── glps/
│   │   │       ├── api/
│   │   │       │   ├── glps.h
│   │   │       │   └── glps_task.h
│   │   │       └── src/
│   │   │           ├── glps.c
│   │   │           └── glps_task.c
│   │   ├── hogp/
│   │   │   ├── hogp_common.h
│   │   │   ├── hogpbh/
│   │   │   │   ├── api/
│   │   │   │   │   └── hogpbh_task.h
│   │   │   │   └── src/
│   │   │   │       ├── hogpbh.c
│   │   │   │       ├── hogpbh.h
│   │   │   │       └── hogpbh_task.c
│   │   │   ├── hogpd/
│   │   │   │   ├── api/
│   │   │   │   │   └── hogpd_task.h
│   │   │   │   └── src/
│   │   │   │       ├── hogpd.c
│   │   │   │       ├── hogpd.h
│   │   │   │       └── hogpd_task.c
│   │   │   └── hogprh/
│   │   │       ├── api/
│   │   │       │   └── hogprh_task.h
│   │   │       └── src/
│   │   │           ├── hogprh.c
│   │   │           ├── hogprh.h
│   │   │           └── hogprh_task.c
│   │   ├── hrp/
│   │   │   ├── hrp_common.h
│   │   │   ├── hrpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── hrpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── hrpc.c
│   │   │   │       ├── hrpc.h
│   │   │   │       └── hrpc_task.c
│   │   │   └── hrps/
│   │   │       ├── api/
│   │   │       │   └── hrps_task.h
│   │   │       └── src/
│   │   │           ├── hrps.c
│   │   │           ├── hrps.h
│   │   │           └── hrps_task.c
│   │   ├── htp/
│   │   │   ├── htp_common.h
│   │   │   ├── htpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── htpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── htpc.c
│   │   │   │       ├── htpc.h
│   │   │   │       └── htpc_task.c
│   │   │   └── htpt/
│   │   │       ├── api/
│   │   │       │   └── htpt_task.h
│   │   │       └── src/
│   │   │           ├── htpt.c
│   │   │           ├── htpt.h
│   │   │           └── htpt_task.c
│   │   ├── lan/
│   │   │   ├── lan_common.h
│   │   │   ├── lanc/
│   │   │   │   ├── api/
│   │   │   │   │   └── lanc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── lanc.c
│   │   │   │       ├── lanc.h
│   │   │   │       └── lanc_task.c
│   │   │   └── lans/
│   │   │       ├── api/
│   │   │       │   └── lans_task.h
│   │   │       └── src/
│   │   │           ├── lans.c
│   │   │           ├── lans.h
│   │   │           └── lans_task.c
│   │   ├── ota/
│   │   │   ├── ota.c
│   │   │   ├── ota.h
│   │   │   ├── ota_task.c
│   │   │   └── ota_task.h
│   │   ├── pasp/
│   │   │   ├── pasp_common.h
│   │   │   ├── paspc/
│   │   │   │   ├── api/
│   │   │   │   │   └── paspc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── paspc.c
│   │   │   │       ├── paspc.h
│   │   │   │       └── paspc_task.c
│   │   │   └── pasps/
│   │   │       ├── api/
│   │   │       │   └── pasps_task.h
│   │   │       └── src/
│   │   │           ├── pasps.c
│   │   │           ├── pasps.h
│   │   │           └── pasps_task.c
│   │   ├── prf/
│   │   │   ├── prf.c
│   │   │   ├── prf_utils.c
│   │   │   └── prf_utils_128.c
│   │   ├── prox/
│   │   │   ├── proxm/
│   │   │   │   ├── api/
│   │   │   │   │   └── proxm_task.h
│   │   │   │   └── src/
│   │   │   │       ├── proxm.c
│   │   │   │       ├── proxm.h
│   │   │   │       └── proxm_task.c
│   │   │   └── proxr/
│   │   │       ├── api/
│   │   │       │   └── proxr_task.h
│   │   │       └── src/
│   │   │           ├── proxr.c
│   │   │           ├── proxr.h
│   │   │           └── proxr_task.c
│   │   ├── rscp/
│   │   │   ├── rscp_common.h
│   │   │   ├── rscpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── rscpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── rscpc.c
│   │   │   │       ├── rscpc.h
│   │   │   │       └── rscpc_task.c
│   │   │   └── rscps/
│   │   │       ├── api/
│   │   │       │   └── rscps_task.h
│   │   │       └── src/
│   │   │           ├── rscps.c
│   │   │           ├── rscps.h
│   │   │           └── rscps_task.c
│   │   ├── tip/
│   │   │   ├── tip_common.h
│   │   │   ├── tipc/
│   │   │   │   ├── api/
│   │   │   │   │   └── tipc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── tipc.c
│   │   │   │       ├── tipc.h
│   │   │   │       └── tipc_task.c
│   │   │   └── tips/
│   │   │       ├── api/
│   │   │       │   └── tips_task.h
│   │   │       └── src/
│   │   │           ├── tips.c
│   │   │           ├── tips.h
│   │   │           └── tips_task.c
│   │   └── tota/
│   │       ├── tota_ble.c
│   │       ├── tota_ble.h
│   │       ├── tota_task.c
│   │       └── tota_task.h
│   ├── ble_stack/
│   │   ├── Makefile
│   │   ├── ble_ip/
│   │   │   ├── arch.h
│   │   │   ├── besble.h
│   │   │   ├── compiler.h
│   │   │   ├── rwapp_config.h
│   │   │   ├── rwble_hl.h
│   │   │   ├── rwble_hl_config.h
│   │   │   ├── rwip.h
│   │   │   ├── rwip_config.h
│   │   │   ├── rwip_task.h
│   │   │   └── rwprf_config.h
│   │   ├── common/
│   │   │   └── api/
│   │   │       ├── co_bt.h
│   │   │       ├── co_bt_defines.h
│   │   │       ├── co_endian.h
│   │   │       ├── co_error.h
│   │   │       ├── co_hci.h
│   │   │       ├── co_list.h
│   │   │       ├── co_llcp.h
│   │   │       ├── co_lmp.h
│   │   │       ├── co_math.h
│   │   │       ├── co_utils.h
│   │   │       ├── co_version.h
│   │   │       └── lePhone_rw_ble_error.txt
│   │   ├── dbg/
│   │   │   ├── api/
│   │   │   │   ├── dbg.h
│   │   │   │   ├── dbg_mwsgen.h
│   │   │   │   ├── dbg_swdiag.h
│   │   │   │   ├── dbg_trc.h
│   │   │   │   └── dbg_trc_config.h
│   │   │   └── src/
│   │   │       └── dbg_trc_int.h
│   │   ├── hci/
│   │   │   ├── api/
│   │   │   │   └── hci_ble.h
│   │   │   └── src/
│   │   │       └── hci_int.h
│   │   ├── hl/
│   │   │   ├── api/
│   │   │   │   ├── att.h
│   │   │   │   ├── gap.h
│   │   │   │   ├── gapc_task.h
│   │   │   │   ├── gapm_task.h
│   │   │   │   ├── gattc_task.h
│   │   │   │   ├── gattm_task.h
│   │   │   │   ├── l2cc_task.h
│   │   │   │   ├── prf_types.h
│   │   │   │   └── rwble_hl_error.h
│   │   │   ├── inc/
│   │   │   │   ├── attm.h
│   │   │   │   ├── gapc.h
│   │   │   │   ├── gapm.h
│   │   │   │   ├── gattc.h
│   │   │   │   ├── gattm.h
│   │   │   │   ├── l2cc.h
│   │   │   │   ├── l2cc_pdu.h
│   │   │   │   ├── l2cm.h
│   │   │   │   ├── prf.h
│   │   │   │   ├── prf_utils.h
│   │   │   │   ├── prf_utils_128.h
│   │   │   │   └── smpc.h
│   │   │   └── src/
│   │   │       ├── gap/
│   │   │       │   ├── gapc/
│   │   │       │   │   ├── gapc_int.h
│   │   │       │   │   └── gapc_sig.h
│   │   │       │   ├── gapm/
│   │   │       │   │   └── gapm_int.h
│   │   │       │   ├── smp_common.h
│   │   │       │   └── smpc/
│   │   │       │       ├── smpc_api.h
│   │   │       │       ├── smpc_crypto.h
│   │   │       │       ├── smpc_int.h
│   │   │       │       └── smpc_util.h
│   │   │       ├── gatt/
│   │   │       │   ├── attc/
│   │   │       │   │   └── attc.h
│   │   │       │   ├── attm/
│   │   │       │   │   └── attm_db.h
│   │   │       │   ├── atts/
│   │   │       │   │   └── atts.h
│   │   │       │   ├── gatt.h
│   │   │       │   ├── gattc/
│   │   │       │   │   └── gattc_int.h
│   │   │       │   └── gattm/
│   │   │       │       └── gattm_int.h
│   │   │       └── l2c/
│   │   │           ├── l2cc/
│   │   │           │   ├── l2cc_int.h
│   │   │           │   ├── l2cc_lecb.h
│   │   │           │   ├── l2cc_pdu_int.h
│   │   │           │   └── l2cc_sig.h
│   │   │           └── l2cm/
│   │   │               └── l2cm_int.h
│   │   └── ke/
│   │       ├── api/
│   │       │   ├── ke.h
│   │       │   ├── ke_event.h
│   │       │   ├── ke_mem.h
│   │       │   ├── ke_msg.h
│   │       │   ├── ke_task.h
│   │       │   └── ke_timer.h
│   │       └── src/
│   │           ├── ke_env.h
│   │           └── ke_queue.h
│   ├── bridge/
│   │   ├── Makefile
│   │   └── bridge.h
│   ├── bt_app/
│   │   ├── Makefile
│   │   ├── a2dp_codecs/
│   │   │   ├── Makefile
│   │   │   ├── aac/
│   │   │   │   └── a2dp_codec_aac.cpp
│   │   │   ├── app_a2dp_codecs.cpp
│   │   │   ├── include/
│   │   │   │   ├── a2dp_codec_aac.h
│   │   │   │   ├── a2dp_codec_ldac.h
│   │   │   │   ├── a2dp_codec_lhdc.h
│   │   │   │   ├── a2dp_codec_opus.h
│   │   │   │   ├── a2dp_codec_sbc.h
│   │   │   │   ├── a2dp_codec_scalable.h
│   │   │   │   ├── app_a2dp_codecs.h
│   │   │   │   └── codec_lhdc.h
│   │   │   ├── ldac/
│   │   │   │   └── a2dp_codec_ldac.cpp
│   │   │   ├── lhdc/
│   │   │   │   ├── a2dp_codec_lhdc.cpp
│   │   │   │   └── codec_lhdc.cpp
│   │   │   ├── opus/
│   │   │   │   └── a2dp_codec_opus.cpp
│   │   │   ├── sbc/
│   │   │   │   └── a2dp_codec_sbc.cpp
│   │   │   └── scalable/
│   │   │       └── a2dp_codec_scalable.cpp
│   │   ├── app_a2dp.cpp
│   │   ├── app_a2dp.h
│   │   ├── app_a2dp_source.cpp
│   │   ├── app_a2dp_source.h
│   │   ├── app_bqb.cpp
│   │   ├── app_bqb_new_profile.cpp
│   │   ├── app_bt.cpp
│   │   ├── app_bt.h
│   │   ├── app_bt_func.cpp
│   │   ├── app_bt_func.h
│   │   ├── app_bt_hid.cpp
│   │   ├── app_bt_hid.h
│   │   ├── app_bt_media_manager.cpp
│   │   ├── app_bt_media_manager.h
│   │   ├── app_bt_stream.cpp
│   │   ├── app_bt_stream.h
│   │   ├── app_bt_trace.h
│   │   ├── app_btgatt.cpp
│   │   ├── app_btgatt.h
│   │   ├── app_btmap_sms.cpp
│   │   ├── app_btmap_sms.h
│   │   ├── app_dip.cpp
│   │   ├── app_dip.h
│   │   ├── app_fp_rfcomm.cpp
│   │   ├── app_fp_rfcomm.h
│   │   ├── app_hfp.cpp
│   │   ├── app_hfp.h
│   │   ├── app_hsp.cpp
│   │   ├── app_keyhandle.cpp
│   │   ├── app_media_player.cpp
│   │   ├── app_media_player.h
│   │   ├── app_rfcomm_mgr.cpp
│   │   ├── app_rfcomm_mgr.h
│   │   ├── app_ring_merge.cpp
│   │   ├── app_ring_merge.h
│   │   ├── app_sec.cpp
│   │   ├── app_spp.cpp
│   │   ├── app_spp.h
│   │   ├── audio_prompt_sbc.cpp
│   │   ├── audio_prompt_sbc.h
│   │   ├── besbt.h
│   │   ├── besbt_cfg.h
│   │   ├── besmain.cpp
│   │   ├── btapp.h
│   │   ├── res_audio_data.h
│   │   └── res_audio_ring.h
│   ├── bt_if_enhanced/
│   │   ├── Makefile
│   │   └── inc/
│   │       ├── a2dp_api.h
│   │       ├── avctp_api.h
│   │       ├── avdtp_api.h
│   │       ├── avrcp_api.h
│   │       ├── avtp_api.h
│   │       ├── besaud_api.h
│   │       ├── besble_debug.h
│   │       ├── bluetooth.h
│   │       ├── bt_if.h
│   │       ├── bt_status_conv.h
│   │       ├── bt_xtal_sync.h
│   │       ├── btgatt_api.h
│   │       ├── btif_sys_config.h
│   │       ├── color_log.h
│   │       ├── conmgr_api.h
│   │       ├── dip_api.h
│   │       ├── hci_api.h
│   │       ├── hfp_api.h
│   │       ├── hid_api.h
│   │       ├── hshf_api.h
│   │       ├── l2cap_api.h
│   │       ├── map_api.h
│   │       ├── map_internal.h
│   │       ├── me_api.h
│   │       ├── mei_api.h
│   │       ├── obex_api.h
│   │       ├── os_api.h
│   │       ├── rfcomm_api.h
│   │       ├── sco_api.h
│   │       ├── sdp_api.h
│   │       ├── spp_api.h
│   │       ├── spp_task.h
│   │       └── tws_role_switch.h
│   ├── bt_profiles_enhanced/
│   │   ├── Makefile
│   │   └── inc/
│   │       ├── a2dp.h
│   │       ├── a2dp_i.h
│   │       ├── avctp.h
│   │       ├── avctp_i.h
│   │       ├── avdtp.h
│   │       ├── avdtp_i.h
│   │       ├── avrcp.h
│   │       ├── avrcp_i.h
│   │       ├── bes_os.h
│   │       ├── besaud.h
│   │       ├── besaudalloc.h
│   │       ├── bt_co_list.h
│   │       ├── bt_common.h
│   │       ├── bt_schedule.h
│   │       ├── bt_sys_cfg.h
│   │       ├── btgatt.h
│   │       ├── btlib.h
│   │       ├── btlib_more.h
│   │       ├── btlib_type.h
│   │       ├── btm.h
│   │       ├── btm_devicedb.h
│   │       ├── btm_fast_init.h
│   │       ├── btm_handle_hcievent.h
│   │       ├── btm_hci.h
│   │       ├── btm_i.h
│   │       ├── btm_security.h
│   │       ├── co_lib.h
│   │       ├── co_ppbuff.h
│   │       ├── co_printf.h
│   │       ├── co_queue.h
│   │       ├── co_timer.h
│   │       ├── cobt.h
│   │       ├── cobuf.h
│   │       ├── data_link.h
│   │       ├── debug_cfg.h
│   │       ├── debug_print.h
│   │       ├── dip.h
│   │       ├── hci.h
│   │       ├── hci_buff.h
│   │       ├── hfp.h
│   │       ├── hid_i.h
│   │       ├── hshf.h
│   │       ├── hshf_i.h
│   │       ├── l2cap.h
│   │       ├── l2cap_er.h
│   │       ├── l2cap_i.h
│   │       ├── map_bmessage_builder.h
│   │       ├── map_protocol.h
│   │       ├── map_sdp.h
│   │       ├── map_session.h
│   │       ├── md5.h
│   │       ├── obex.h
│   │       ├── obex_ascii_unicode.h
│   │       ├── obex_i.h
│   │       ├── obex_if.h
│   │       ├── obex_protocol.h
│   │       ├── obex_session.h
│   │       ├── obex_tlv.h
│   │       ├── obex_transmission.h
│   │       ├── obex_transportlayer.h
│   │       ├── overide.h
│   │       ├── packer.h
│   │       ├── pbap.h
│   │       ├── pbap_i.h
│   │       ├── platform_deps.h
│   │       ├── rfcomm.h
│   │       ├── rfcomm_i.h
│   │       ├── sco.h
│   │       ├── sco_i.h
│   │       ├── sdp.h
│   │       ├── sppnew.h
│   │       └── win32_os.h
│   ├── communication/
│   │   ├── Makefile
│   │   ├── comminication_knowles/
│   │   │   ├── Makefile
│   │   │   ├── communication_cmd_handle.cpp
│   │   │   ├── communication_cmd_handle.h
│   │   │   ├── communication_cmd_msg.h
│   │   │   ├── communication_sysapi.cpp
│   │   │   ├── communication_sysapi.h
│   │   │   └── tool_msg.h
│   │   ├── communication_svr.cpp
│   │   └── communication_svr.h
│   ├── cp_accel/
│   │   ├── Makefile
│   │   ├── cp_accel.c
│   │   ├── cp_accel.h
│   │   ├── cp_queue.c
│   │   └── cp_queue.h
│   ├── hw_dsp/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   └── hw_filter_codec_iir.h
│   │   └── src/
│   │       └── hw_filter_codec_iir.c
│   ├── ibrt_core/
│   │   ├── Makefile
│   │   └── inc/
│   │       ├── app_ibrt_bt_profile_sync.h
│   │       ├── app_tws_besaud.h
│   │       ├── app_tws_ctrl_thread.h
│   │       ├── app_tws_ibrt.h
│   │       ├── app_tws_ibrt_audio_analysis.h
│   │       ├── app_tws_ibrt_audio_sync.h
│   │       ├── app_tws_ibrt_cmd_audio_analysis.h
│   │       ├── app_tws_ibrt_cmd_handler.h
│   │       ├── app_tws_ibrt_cmd_sync_a2dp_status.h
│   │       ├── app_tws_ibrt_cmd_sync_hfp_status.h
│   │       ├── app_tws_ibrt_mock.h
│   │       ├── app_tws_ibrt_queue.h
│   │       ├── app_tws_ibrt_trace.h
│   │       ├── app_tws_profile_sync.h
│   │       └── app_vendor_cmd_evt.h
│   ├── ibrt_ota/
│   │   ├── Makefile
│   │   └── inc/
│   │       ├── ota_bes.h
│   │       ├── ota_control.h
│   │       └── ota_spp.h
│   ├── ibrt_ui/
│   │   ├── Makefile
│   │   └── inc/
│   │       └── app_ibrt_ui.h
│   ├── interconnection/
│   │   ├── Makefile
│   │   └── umm_malloc/
│   │       ├── dbglog.h
│   │       ├── umm_malloc.c
│   │       └── umm_malloc.h
│   ├── lhdc_license/
│   │   └── Makefile
│   ├── multimedia/
│   │   ├── Makefile
│   │   ├── algorithm/
│   │   │   └── fft/
│   │   │       └── include/
│   │   │           ├── fft128dot.h
│   │   │           └── fftr4_fxp.h
│   │   ├── audio/
│   │   │   ├── codec/
│   │   │   │   ├── fdkaac_codec/
│   │   │   │   │   ├── ChangeLog
│   │   │   │   │   ├── NOTICE
│   │   │   │   │   ├── README
│   │   │   │   │   ├── libAACdec/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       └── aacdecoder_lib.h
│   │   │   │   │   ├── libAACenc/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       └── aacenc_lib.h
│   │   │   │   │   ├── libFDK/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       ├── FDK_archdef.h
│   │   │   │   │   │       ├── FDK_bitbuffer.h
│   │   │   │   │   │       ├── FDK_bitstream.h
│   │   │   │   │   │       ├── FDK_core.h
│   │   │   │   │   │       ├── FDK_crc.h
│   │   │   │   │   │       ├── FDK_hybrid.h
│   │   │   │   │   │       ├── FDK_tools_rom.h
│   │   │   │   │   │       ├── FDK_trigFcts.h
│   │   │   │   │   │       ├── aarch64/
│   │   │   │   │   │       │   ├── clz_aarch64.h
│   │   │   │   │   │       │   └── fixmul_aarch64.h
│   │   │   │   │   │       ├── abs.h
│   │   │   │   │   │       ├── arm/
│   │   │   │   │   │       │   ├── clz_arm.h
│   │   │   │   │   │       │   ├── cplx_mul.h
│   │   │   │   │   │       │   ├── fixmadd_arm.h
│   │   │   │   │   │       │   ├── fixmul_arm.h
│   │   │   │   │   │       │   ├── scale.h
│   │   │   │   │   │       │   └── scramble.h
│   │   │   │   │   │       ├── autocorr2nd.h
│   │   │   │   │   │       ├── clz.h
│   │   │   │   │   │       ├── common_fix.h
│   │   │   │   │   │       ├── cplx_mul.h
│   │   │   │   │   │       ├── dct.h
│   │   │   │   │   │       ├── fft.h
│   │   │   │   │   │       ├── fft_rad2.h
│   │   │   │   │   │       ├── fixmadd.h
│   │   │   │   │   │       ├── fixminmax.h
│   │   │   │   │   │       ├── fixmul.h
│   │   │   │   │   │       ├── fixpoint_math.h
│   │   │   │   │   │       ├── mdct.h
│   │   │   │   │   │       ├── mips/
│   │   │   │   │   │       │   ├── abs_mips.h
│   │   │   │   │   │       │   ├── clz_mips.h
│   │   │   │   │   │       │   ├── cplx_mul.h
│   │   │   │   │   │       │   ├── fixmadd_mips.h
│   │   │   │   │   │       │   ├── fixmul_mips.h
│   │   │   │   │   │       │   ├── scale.h
│   │   │   │   │   │       │   └── scramble.h
│   │   │   │   │   │       ├── ppc/
│   │   │   │   │   │       │   ├── clz_ppc.h
│   │   │   │   │   │       │   └── fixmul_ppc.h
│   │   │   │   │   │       ├── qmf.h
│   │   │   │   │   │       ├── scale.h
│   │   │   │   │   │       ├── scramble.h
│   │   │   │   │   │       └── x86/
│   │   │   │   │   │           ├── abs_x86.h
│   │   │   │   │   │           ├── clz_x86.h
│   │   │   │   │   │           └── fixmul_x86.h
│   │   │   │   │   ├── libMpegTPDec/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       ├── mpegFileRead.h
│   │   │   │   │   │       ├── tp_data.h
│   │   │   │   │   │       └── tpdec_lib.h
│   │   │   │   │   ├── libMpegTPEnc/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       ├── mpegFileWrite.h
│   │   │   │   │   │       ├── tp_data.h
│   │   │   │   │   │       └── tpenc_lib.h
│   │   │   │   │   ├── libPCMutils/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       ├── limiter.h
│   │   │   │   │   │       └── pcmutils_lib.h
│   │   │   │   │   ├── libSBRdec/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       └── sbrdecoder.h
│   │   │   │   │   ├── libSBRenc/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       └── sbr_encoder.h
│   │   │   │   │   └── libSYS/
│   │   │   │   │       └── include/
│   │   │   │   │           ├── FDK_audio.h
│   │   │   │   │           ├── audio.h
│   │   │   │   │           ├── cmdl_parser.h
│   │   │   │   │           ├── conv_string.h
│   │   │   │   │           ├── genericStds.h
│   │   │   │   │           ├── machine_type.h
│   │   │   │   │           └── wav_file.h
│   │   │   │   └── sbc/
│   │   │   │       └── inc/
│   │   │   │           └── codec_sbc.h
│   │   │   └── process/
│   │   │       ├── adp/
│   │   │       │   └── include/
│   │   │       │       ├── adp_arch.h
│   │   │       │       ├── adp_config.h
│   │   │       │       ├── adp_fftwrap.h
│   │   │       │       ├── adp_filter.h
│   │   │       │       └── adp_smallft.h
│   │   │       ├── anc/
│   │   │       │   ├── cfg/
│   │   │       │   │   ├── Makefile
│   │   │       │   │   └── anc_cfg.c
│   │   │       │   └── include/
│   │   │       │       ├── anc_process.h
│   │   │       │       └── fftfilt2.h
│   │   │       ├── common/
│   │   │       │   └── include/
│   │   │       │       └── audio_memory.h
│   │   │       ├── drc/
│   │   │       │   └── include/
│   │   │       │       └── drc.h
│   │   │       ├── filters/
│   │   │       │   ├── cfg/
│   │   │       │   │   ├── Makefile
│   │   │       │   │   ├── eq_cfg.c
│   │   │       │   │   └── eq_cfg.h
│   │   │       │   └── include/
│   │   │       │       ├── dsd_process.h
│   │   │       │       ├── filter_debug_trace.h
│   │   │       │       ├── fir_process.h
│   │   │       │       ├── hw_codec_iir_process.h
│   │   │       │       ├── hw_iir_process.h
│   │   │       │       └── iir_process.h
│   │   │       ├── fir2iir/
│   │   │       │   └── include/
│   │   │       │       └── fir2iir.h
│   │   │       ├── integer_resampling/
│   │   │       │   └── include/
│   │   │       │       └── integer_resampling.h
│   │   │       ├── limiter/
│   │   │       │   └── include/
│   │   │       │       └── limiter.h
│   │   │       └── resample/
│   │   │           ├── coef/
│   │   │           │   ├── Makefile
│   │   │           │   ├── resample_16k_to_48k_filter.txt
│   │   │           │   ├── resample_32k_to_50p7k_filter.txt
│   │   │           │   ├── resample_44p1k_to_48k_filter.txt
│   │   │           │   ├── resample_44p1k_to_50p7k_filter.txt
│   │   │           │   ├── resample_48k_to_44p1k_filter.txt
│   │   │           │   ├── resample_48k_to_50p7k_filter.txt
│   │   │           │   ├── resample_50p7k_to_44p1k_filter.txt
│   │   │           │   ├── resample_50p7k_to_48k_filter.txt
│   │   │           │   ├── resample_8k_to_8p4k_filter.txt
│   │   │           │   ├── resample_8p4k_to_8k_filter.txt
│   │   │           │   ├── resample_any_up256_filter.txt
│   │   │           │   ├── resample_any_up512_32_filter.txt
│   │   │           │   ├── resample_any_up512_36_filter.txt
│   │   │           │   ├── resample_any_up64_filter.txt
│   │   │           │   └── resample_coef.c
│   │   │           └── include/
│   │   │               ├── audio_resample.h
│   │   │               ├── audio_resample_ex.h
│   │   │               ├── audio_resample_ex_32bit.h
│   │   │               └── resample_coef.h
│   │   └── speech/
│   │       └── inc/
│   │           ├── Pcm8k_Cvsd.h
│   │           ├── SubBandBasedAEC.h
│   │           ├── VoiceActivityDetection.h
│   │           ├── ae_macros.h
│   │           ├── ae_math.h
│   │           ├── agc.h
│   │           ├── anc_assist_algo.h
│   │           ├── audio_drc2.h
│   │           ├── buffer_manager.h
│   │           ├── compexp.h
│   │           ├── crossfade.h
│   │           ├── cvsd_codec.h
│   │           ├── dual_mic_denoise.h
│   │           ├── echo_canceller.h
│   │           ├── ext_fft_f32.h
│   │           ├── ext_heap.h
│   │           ├── far_field_speech_enhancement.h
│   │           ├── fftfilt.h
│   │           ├── frame_resize.h
│   │           ├── g726.h
│   │           ├── g72x.h
│   │           ├── iir_resample.h
│   │           ├── iirfilt.h
│   │           ├── lc_mmse_ns.h
│   │           ├── lc_mmse_ns_float.h
│   │           ├── leftright_denoise.h
│   │           ├── lpc_plc_api.h
│   │           ├── main_classify.h
│   │           ├── med_aec3_comm.h
│   │           ├── med_aec3_main.h
│   │           ├── med_aec3_main_internal.h
│   │           ├── ns3.h
│   │           ├── plc_16000.h
│   │           ├── plc_8000.h
│   │           ├── recognition.h
│   │           ├── sensormic_denoise.h
│   │           ├── single_mic_NNDenoise.h
│   │           ├── spectrum.h
│   │           ├── spectrum_fix.h
│   │           ├── speech_2mic_ns2_denoise.h
│   │           ├── speech_3mic_ns.h
│   │           ├── speech_aec.h
│   │           ├── speech_aec2.h
│   │           ├── speech_cfg.h
│   │           ├── speech_config.h
│   │           ├── speech_dc_filter.h
│   │           ├── speech_eq.h
│   │           ├── speech_ff_2mic_ns2.h
│   │           ├── speech_ff_3mic_ns1.h
│   │           ├── speech_fir_calibration.h
│   │           ├── speech_gain.h
│   │           ├── speech_iir.h
│   │           ├── speech_iir_calibration.h
│   │           ├── speech_memory.h
│   │           ├── speech_mics_calibration.h
│   │           ├── speech_noise_gate.h
│   │           ├── speech_ns.h
│   │           ├── speech_peak_detector.h
│   │           ├── speech_ssat.h
│   │           ├── speech_utils.h
│   │           ├── speex_resampler.h
│   │           ├── triple_mic_denoise3.h
│   │           ├── wind_detection_2mic.h
│   │           └── wnr.h
│   ├── norflash_api/
│   │   ├── Makefile
│   │   ├── norflash_api.cpp
│   │   └── norflash_api.h
│   ├── nv_section/
│   │   ├── Makefile
│   │   ├── aud_section/
│   │   │   ├── Makefile
│   │   │   ├── aud_section.c
│   │   │   ├── aud_section.h
│   │   │   └── aud_section_inc.h
│   │   ├── customparam_section/
│   │   │   ├── Makefile
│   │   │   ├── customparam_section.c
│   │   │   └── customparam_section.h
│   │   ├── factory_section/
│   │   │   ├── Makefile
│   │   │   ├── factory_section.c
│   │   │   └── factory_section.h
│   │   ├── include/
│   │   │   └── section_def.h
│   │   ├── log_section/
│   │   │   ├── Makefile
│   │   │   ├── coredump_section.c
│   │   │   ├── coredump_section.h
│   │   │   ├── crash_dump_section.c
│   │   │   ├── crash_dump_section.h
│   │   │   ├── log_section.c
│   │   │   └── log_section.h
│   │   ├── nv_section_dbg.h
│   │   └── userdata_section/
│   │       ├── Makefile
│   │       ├── nvrecord_ble.c
│   │       ├── nvrecord_ble.h
│   │       ├── nvrecord_bt.c
│   │       ├── nvrecord_bt.h
│   │       ├── nvrecord_dma_config.c
│   │       ├── nvrecord_dma_config.h
│   │       ├── nvrecord_env.c
│   │       ├── nvrecord_env.h
│   │       ├── nvrecord_extension.c
│   │       ├── nvrecord_extension.h
│   │       ├── nvrecord_fp_account_key.c
│   │       ├── nvrecord_fp_account_key.h
│   │       ├── nvrecord_gsound.c
│   │       ├── nvrecord_gsound.h
│   │       ├── nvrecord_ota.c
│   │       └── nvrecord_ota.h
│   ├── nvrecord/
│   │   ├── Makefile
│   │   ├── list_ext.c
│   │   ├── list_ext.h
│   │   ├── nvrec_config.c
│   │   ├── nvrec_config.h
│   │   ├── nvrecord.c
│   │   ├── nvrecord.h
│   │   ├── nvrecord_ble.c
│   │   ├── nvrecord_ble.h
│   │   ├── nvrecord_dev.h
│   │   ├── nvrecord_env.c
│   │   ├── nvrecord_env.h
│   │   ├── nvrecord_fp_account_key.c
│   │   └── nvrecord_fp_account_key.h
│   ├── osif/
│   │   ├── Makefile
│   │   ├── ddbif.h
│   │   ├── ddbif_bes.c
│   │   ├── osif.h
│   │   └── osif_rtx.c
│   ├── ota/
│   │   ├── Makefile
│   │   ├── ota_common.cpp
│   │   ├── ota_common.h
│   │   └── ota_dbg.h
│   ├── overlay/
│   │   ├── Makefile
│   │   ├── app_overlay.cpp
│   │   └── app_overlay.h
│   ├── resources/
│   │   ├── Makefile
│   │   ├── resources.cpp
│   │   └── resources.h
│   ├── through_put/
│   │   ├── Makefile
│   │   ├── app_through_put.cpp
│   │   └── app_through_put.h
│   └── tota/
│       ├── Makefile
│       ├── app_spp_tota.cpp
│       ├── app_spp_tota.h
│       ├── app_spp_tota_general_service.cpp
│       ├── app_spp_tota_general_service.h
│       ├── app_tota.cpp
│       ├── app_tota.h
│       ├── app_tota_anc.cpp
│       ├── app_tota_anc.h
│       ├── app_tota_audio_dump.cpp
│       ├── app_tota_audio_dump.h
│       ├── app_tota_cmd_code.h
│       ├── app_tota_cmd_handler.cpp
│       ├── app_tota_cmd_handler.h
│       ├── app_tota_conn.cpp
│       ├── app_tota_conn.h
│       ├── app_tota_custom.cpp
│       ├── app_tota_custom.h
│       ├── app_tota_data_handler.cpp
│       ├── app_tota_data_handler.h
│       ├── app_tota_flash_program.cpp
│       ├── app_tota_flash_program.h
│       ├── app_tota_general.cpp
│       ├── app_tota_general.h
│       ├── app_tota_mic.cpp
│       ├── app_tota_mic.h
│       ├── tota_buffer_manager.cpp
│       ├── tota_buffer_manager.h
│       ├── tota_stream_data_transfer.cpp
│       ├── tota_stream_data_transfer.h
│       └── tota_test.cpp
├── start_dev.sh
├── thirdparty/
│   ├── Makefile
│   ├── audio_codec_lib/
│   │   ├── Makefile
│   │   ├── ldac/
│   │   │   ├── Makefile
│   │   │   └── inc/
│   │   │       └── ldacBT.h
│   │   └── liblhdc-dec/
│   │       ├── Makefile
│   │       └── inc/
│   │           └── lhdcUtil.h
│   ├── demo_lib/
│   │   ├── Makefile
│   │   ├── demo_lib.c
│   │   └── demo_lib.h
│   ├── noise_tracker_lib/
│   │   ├── Makefile
│   │   ├── noise_tracker.c
│   │   └── noise_tracker.h
│   └── userapi/
│       ├── Makefile
│       ├── app_thirdparty.cpp
│       ├── app_thirdparty.h
│       ├── demo_app/
│       │   ├── LibDemo.cpp
│       │   ├── LibDemo.h
│       │   └── Makefile
│       └── noise_tracker_app/
│           ├── Makefile
│           ├── NoiseTrackerDemo.cpp
│           ├── noise_tracker_callback.c
│           └── noise_tracker_callback.h
├── uart_log.sh
└── utils/
    ├── boot_struct/
    │   ├── Makefile
    │   ├── boot_struct.c
    │   ├── norflash_cfg.h
    │   ├── reboot_param.h
    │   └── tool_msg.h
    ├── build_info/
    │   └── build_info.c
    ├── cqueue/
    │   ├── Makefile
    │   ├── cqueue.c
    │   └── cqueue.h
    ├── crash_catcher/
    │   ├── CrashCatcher.c
    │   ├── CrashCatcherPriv.h
    │   ├── CrashCatcher_armv7m.S
    │   ├── HexDump.c
    │   ├── Makefile
    │   └── include/
    │       ├── CrashCatcher.h
    │       ├── CrashCatcherApi.h
    │       └── FloatMocks.h
    ├── crc16/
    │   ├── Makefile
    │   ├── crc16.c
    │   └── crc16.h
    ├── crc32/
    │   ├── Makefile
    │   ├── crc32.c
    │   ├── crc32.h
    │   └── crc32_rom.c
    ├── encrypt/
    │   ├── Makefile
    │   ├── _sha256.h
    │   ├── aes.h
    │   ├── types.h
    │   ├── uECC.h
    │   └── uECC_vli.h
    ├── heap/
    │   ├── Makefile
    │   ├── heap_api.c
    │   ├── heap_api.h
    │   ├── med_memory.h
    │   ├── multi_heap.c
    │   ├── multi_heap.h
    │   ├── multi_heap_internal.h
    │   ├── multi_heap_platform.h
    │   └── pool_api.c
    ├── hexdump/
    │   ├── Makefile
    │   ├── hexdump.c
    │   └── hexdump.h
    ├── hwtimer_list/
    │   ├── Makefile
    │   ├── hwtimer_list.c
    │   └── hwtimer_list.h
    ├── intersyshci/
    │   ├── Makefile
    │   ├── intersyshci.h
    │   ├── trans_adapt.h
    │   ├── trans_adapt_v1.h
    │   └── trans_adapt_v2.h
    ├── kfifo/
    │   ├── Makefile
    │   ├── kfifo.c
    │   └── kfifo.h
    ├── libc/
    │   ├── Makefile
    │   ├── inc/
    │   │   ├── assert.h
    │   │   ├── ctype.h
    │   │   ├── errno.h
    │   │   ├── stdarg.h
    │   │   ├── stdbool.h
    │   │   ├── stddef.h
    │   │   ├── stdint.h
    │   │   ├── stdio.h
    │   │   ├── stdlib.h
    │   │   └── string.h
    │   └── libc_rom.c
    ├── list/
    │   ├── Makefile
    │   ├── list.c
    │   └── list.h
    ├── lockcqueue/
    │   ├── Makefile
    │   ├── lockcqueue.c
    │   └── lockcqueue.h
    ├── retention_ram/
    │   ├── Makefile
    │   ├── retention_ram.c
    │   └── retention_ram.h
    ├── rom_utils/
    │   ├── Makefile
    │   └── export_fn_rom.h
    ├── sha256/
    │   ├── Makefile
    │   ├── hash-internal.h
    │   ├── sha256.c
    │   ├── sha256.h
    │   └── sha256_rom.c
    └── xyzmodem/
        ├── Makefile
        ├── xyzmodem.c
        └── xyzmodem.h

================================================
FILE CONTENTS
================================================

================================================
FILE: .devcontainer/devcontainer.json
================================================
{
	"name": "Open PineBuds Pro - VS Code Development Environment",
	"build": {
		"dockerfile": "../Dockerfile",
		"context": ".."
	},
	"extensions": [
		"ms-vscode.cmake-tools",
		"ms-vscode.cpptools"
	],
	"runArgs": [
		"--privileged"
	],
	"userEnvProbe": "loginInteractiveShell",
	"remoteUser": "root"
}

================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "docker"
    directory: "/"
    schedule:
      interval: "weekly"
    commit-message:
      prefix: "chore(deps)"

  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
    commit-message:
      prefix: "chore(ci)"


================================================
FILE: .github/workflows/build-and-push-to-registry.yml
================================================
name: Container image builder workflow
on:
  push:
    branches: [main]
  workflow_dispatch:

concurrency:
  group: gh-ref-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build-and-push-images:
    if: ${{ github.repository == 'pine64/OpenPineBuds' }}
    name: Build and push container image for PineBuds Pro SDK to GHCR.io
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v6

      - name: Install qemu dependency
        run: |
          sudo apt-get update
          sudo apt-get install -y qemu-user-static

      - name: Build images
        id: build
        uses: redhat-actions/buildah-build@v2
        with:
          image: ${{ github.repository }}
          platforms: linux/amd64, linux/arm64
          context: /
          tags: ${{ contains(github.ref_name, 'main') && 'latest' || github.ref_name }}-sdk
          containerfiles: /Dockerfile

      - name: Push container
        uses: redhat-actions/push-to-registry@v2
        with:
          image: ${{ steps.build.outputs.image }}
          tags: ${{ steps.build.outputs.tags }}
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.GITHUB_TOKEN }}


================================================
FILE: .github/workflows/build-firmware.yml
================================================
name: CI

on: [push, pull_request]

jobs:
  build-firmware:
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/pine64/openpinebuds:latest-sdk
    steps:
      - name: Build the main firmware
        run: cd /usr/src/ && ./build.sh || cat /usr/src/log.txt

      - name: Archive produced firmware
        uses: actions/upload-artifact@v7
        with:
          path: /usr/src/out/open_source/open_source.bin


================================================
FILE: .gitignore
================================================
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# ('git ls-files -i --exclude-standard -ocs --directory'
# command can show all the tracked and untracked files
# which get ignored after the change.)
#

# Hidden files
.*
# Except for these hidden files
!.gitignore
!.gitattributes
!.mailmap
!.github
!.devcontainer

# Backup files
*~
*.bak
*.BAK
*.orig
\#*#
firmware-backups/

# Tag files
/tags
/TAGS
/cscope.*
/ncscope.*
/compile_commands.json

# Object files
*.o
*.o.*
*.ko
*.obj
*.lo
*.slo
*.py[co]

# List files
*.i
*.lst

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lai
*.pyd

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.elf
*.i*86
*.x86_64
*.hex

# Source insight project files
/[sS][iI]/

# Generated project files
*.ncb
*.idb
*.pdb
*.sdf
*.suo
*.opensdf
#/Debug/
#/Release/
Debug/
Release/
/ipch/

# Library dir
#lib/

# Build dir
/out/
*.pre

# configuration file
# *.ini
log.txt
log.txt


================================================
FILE: Dockerfile
================================================
FROM debian:bullseye-slim AS base

FROM base AS rust_build

LABEL org.opencontainers.image.authors = "Ben V. Brown <ralim@ralimtek.com>, Dom Rodriguez <shymega@shymega.org.uk>"

WORKDIR /usr/src
ENV PATH="/root/.cargo/bin:$PATH"

RUN apt-get update \
    && apt-get install -y \
    bc \
    build-essential \
    curl \
    git  \
    libudev-dev \
    pkg-config \
    && curl https://sh.rustup.rs -sSf | bash -s -- -y \
    && git clone https://github.com/Ralim/bestool.git \
    && cd /usr/src/bestool/bestool/ \
    && cargo build --release

FROM base as dev_env

WORKDIR /usr/src

RUN apt-get update \
    && apt-get install -y \ 
    bash \
    bc \
    bzip2 \
    curl \
    ffmpeg \
    clang-format \ 
    git \
    make \
    tar \
    xxd \
    && git config --global --add safe.directory /src \
    && mkdir -pv /src \
    && curl \
    https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-$(arch)-linux.tar.bz2 | tar -xj -C /src/

RUN apt-get update \
    && apt-get install -y \
    minicom \
    sudo

ENV PATH="${PATH}:/src/gcc-arm-none-eabi-9-2019-q4-major/bin"
COPY --from=rust_build /usr/src/bestool/bestool/target/release/bestool /usr/local/bin/bestool
COPY . /usr/src

ENTRYPOINT ["/bin/bash"]


================================================
FILE: Makefile
================================================

CONFIG_CROSS_COMPILE := arm-none-eabi-
CONFIG_STRICT_CFLAGS ?= y
CONFIG_SAVE_TARGET ?= n
CONFIG_FORCE_WIN_SHELL ?= y

export CONFIG_STRICT_CFLAGS CONFIG_SAVE_TARGET CONFIG_FORCE_WIN_SHELL

# ---------------------------------------------------------------------------
# Platform and shell detection

export WIN_PLAT := n
ifeq ($(OS),Windows_NT)
# Detect Cygwin
ifneq ($(findstring /,$(PWD)),/)
# also $(findstring /,$(HOME)) ?
WIN_PLAT := y
endif
endif

export WIN_SHELL := n
ifeq ($(WIN_PLAT),y)
ifeq ($(CONFIG_FORCE_WIN_SHELL),y)
WIN_SHELL := y
else
# Detect Unix-style shell
ifeq ($(shell echo $$0),$$0)
WIN_SHELL := y
endif
endif
endif

BACKSLASH := \ # backslash
BACKSLASH := $(strip $(BACKSLASH))

TO_UNIX_PATH = $(subst $(BACKSLASH),/,$(1))
TO_WIN_PATH = $(subst /,$(BACKSLASH),$(1))
ESC_WIN_PATH = $(subst $(BACKSLASH),$(BACKSLASH)$(BACKSLASH),$(1))

ifeq ($(WIN_PLAT),y)
ifeq ($(WIN_SHELL),y)
# make will choose sh.exe as SHELL if it finds sh.exe in the directories of PATH, regardless of
# the setting in environment or parent (e.g., when git.exe is in the PATH)
SHELL := cmd.exe
SHELL_CMD = $(call TO_WIN_PATH,$(1))
else
SHELL_CMD = $(call ESC_WIN_PATH,$(call TO_WIN_PATH,$(1)))
endif
else
SHELL_CMD = $(1)
endif

# The Unix-style path is recognized by compiler toolchain, GNU utilities and windows redirection
# operators, but not by windows native commands (e.g., mkdir) and applications.

# End of platform and shell detection
# ---------------------------------------------------------------------------

# Do not use make's built-in rules and variables
# (this increases performance and avoids hard-to-debug behaviour);
MAKEFLAGS += -rR

# Avoid funny character set dependencies
unexport LC_ALL
LC_COLLATE=C
LC_NUMERIC=C
export LC_COLLATE LC_NUMERIC

# Avoid interference with shell env settings
unexport GREP_OPTIONS

# Check if just to show the help content
ifeq ($(MAKECMDGOALS),help)
ifeq ($(T),)
HELP_TARGET := 1
endif
endif

ifneq ($(HELP_TARGET),1)
# We are using a recursive build, so we need to do a little thinking
# to get the ordering right.
#
# Most importantly: sub-Makefiles should only ever modify files in
# their own directory. If in some directory we have a dependency on
# a file in another dir (which doesn't happen often, but it's often
# unavoidable when linking the built-in.o targets which finally
# turn into elf file), we will call a sub make in that other dir, and
# after that we are sure that everything which is in that other dir
# is now up to date.
#
# The only cases where we need to modify files which have global
# effects are thus separated out and done before the recursive
# descending is started. They are now explicitly listed as the
# prepare rule.

# Beautify output
# ---------------------------------------------------------------------------
#
# Normally, we echo the whole command before executing it. By making
# that echo $($(quiet)$(cmd)), we now have the possibility to set
# $(quiet) to choose other forms of output instead, e.g.
#
#         quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
#         cmd_cc_o_c       = $(CC) $(c_flags) -c -o $@ $<
#
# If $(quiet) is empty, the whole command will be printed.
# If it is set to "quiet_", only the short version will be printed.
# If it is set to "silent_", nothing will be printed at all, since
# the variable $(silent_cmd_cc_o_c) doesn't exist.
#
# A simple variant is to prefix commands with $(Q) - that's useful
# for commands that shall be hidden in non-verbose mode.
#
#	$(Q)ln $@ :<
#
# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
# If KBUILD_VERBOSE equals 1 then the above command is displayed.
#
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands

ifeq ("$(origin V)","command line")
  KBUILD_VERBOSE = $(V)
endif
ifndef KBUILD_VERBOSE
  KBUILD_VERBOSE = 0
endif

ifeq ($(KBUILD_VERBOSE),1)
  quiet :=
  Q :=
else
  quiet := quiet_
  Q := @
endif

# If the user is running make -s (silent mode), suppress echoing of
# commands

ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
  quiet=silent_
endif
else                                   # make-3.8x
ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
  quiet=silent_
endif
endif

export quiet Q KBUILD_VERBOSE

TARGET_CFG_FILE = config/$(T)/target.mk
TARGET_COMMON_FILE = config/common.mk

# To locate output files in a separate directory two syntaxes are supported.
# In both cases the working directory must be the root of the kernel src.
# 1) O=
# Use "make O=dir/to/store/output/files/"
#
# 2) Set KBUILD_OUTPUT
# Set the environment variable KBUILD_OUTPUT to point to the directory
# where the output files shall be placed.
# export KBUILD_OUTPUT=dir/to/store/output/files/
# make
#
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
# variable.

# KBUILD_SRC is set on invocation of make in OBJ directory
# KBUILD_SRC is not intended to be used by the regular user (for now)
ifeq ($(KBUILD_SRC),)

export KBUILD_ROOT := $(CURDIR)

# OK, Make called in directory where kernel src resides
# Do we want to locate output files in a separate directory?

export KBUILD_OUTPUT := $(CURDIR)/out
ifeq ("$(origin O)","command line")
  KBUILD_OUTPUT := $(O)
endif

# Select target
ifeq ($(CONFIG_SAVE_TARGET),y)
ifeq ($(T),)
-include $(KBUILD_OUTPUT)/.config
T := $(strip $(T))
endif
endif
ifeq ($(T),)
$(error Please specify the target in the command line: T=<targetName>)
endif
ifeq ($(wildcard $(TARGET_CFG_FILE)),)
$(error Invalid target: T=$(T))
endif
export T

# Default audio source: en (English, config/_default_cfg_src_/res/en)
AUDIO ?= en
AUDIO := $(strip $(AUDIO))
# Select audio source
AUDIO_FOLDER = config/_default_cfg_src_/res/$(AUDIO)
ifeq ($(AUDIO),)
$(error Please specify the sound language in the command line: AUDIO=<audioName>)
endif
ifeq ($(wildcard $(AUDIO_FOLDER)),)
$(error Invalid target: AUDIO=$(AUDIO))
endif
export AUDIO

KBUILD_OUTPUT := $(KBUILD_OUTPUT)/$(T)

# That's our default target when none is given on the command line
PHONY := _all
_all:

# Cancel implicit rules on the config file
$(KBUILD_OUTPUT)/.config: ;

ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists
saved-output := $(KBUILD_OUTPUT)
ifeq ($(WIN_PLAT),y)
KBUILD_OUTPUT := $(subst /,\,$(KBUILD_OUTPUT))
KBUILD_OUTPUT := $(shell ( if not exist $(KBUILD_OUTPUT)\ mkdir $(KBUILD_OUTPUT) ) \
                         && cd $(KBUILD_OUTPUT) && cd)
KBUILD_OUTPUT := $(subst \,/,$(KBUILD_OUTPUT))
else
KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
                         && pwd)
endif

$(if $(KBUILD_OUTPUT),, \
     $(error failed to create output directory "$(saved-output)"))

ifeq ($(CONFIG_SAVE_TARGET),y)
ifeq ($(WIN_PLAT),y)
_dummy := $(shell echo T := $(T)> $(KBUILD_OUTPUT)/../.config)
else
_dummy := $(shell echo "T := $(T)" > $(KBUILD_OUTPUT)/../.config)
endif
endif

PHONY += $(MAKECMDGOALS) sub-make

$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
	@:

include $(CURDIR)/scripts/submods_init.mk

ifneq ($(filter allclean,$(MAKECMDGOALS)),)
ALLCLEAN := 1
export ALLCLEAN
endif

# Look for make include files relative to root of kernel src
MAKEFLAGS += --include-dir=$(CURDIR)

ifeq ($(WIN_PLAT),y)
START_TIME := $(shell echo %time%)
START_DATE_TIME := $(shell echo %date% %time%)
else
START_TIME := $(shell date +"%s.%N")
START_DATE_TIME := $(shell date +"%Y-%m-%d %T.%N")
endif

sub-make: FORCE
	@echo MAKE START: $(START_DATE_TIME)
	$(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
		-f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
ifeq ($(WIN_PLAT),y)
	@echo MAKE END: %date% %time%
ifneq ($(wildcard tools/timediff.bat),)
	@tools/timediff.bat "%time%" "$(START_TIME)"
endif
else
	@echo MAKE END: $$(date +"%Y-%m-%d %T.%N")
	@printf "MAKE TIME: %.2f seconds\n" $$(echo "$$(date +%s.%N) - $(START_TIME)" | bc)
endif

# Leave processing to above invocation of make
skip-makefile := 1
endif # ifneq ($(KBUILD_OUTPUT),)
endif # ifeq ($(KBUILD_SRC),)

# We process the rest of the Makefile if this is the final invocation of make
ifeq ($(skip-makefile),)

# Do not print "Entering directory ...",
# but we want to display it when entering to the output directory
# so that IDEs/editors are able to understand relative filenames.
MAKEFLAGS += --no-print-directory

# If building an external module we do not care about the all: rule
# but instead _all depend on modules
PHONY += all
_all: all

ifeq ($(KBUILD_SRC),)
        # building in the source tree
        srctree := .
else
        ifeq ($(KBUILD_SRC)/,$(dir $(CURDIR)))
                # building in a subdirectory of the source tree
                srctree := ..
        else
                ifeq ($(KBUILD_SRC)/,$(dir $(patsubst %/,%,$(dir $(CURDIR)))))
                        srctree := ../..
                else
                        srctree := $(KBUILD_SRC)
                endif
        endif
endif
objtree		:= .
src		:= $(srctree)
obj		:= $(objtree)

VPATH		:= $(srctree)

export srctree objtree VPATH

# Git revision
ifeq ($(WIN_PLAT),y)
GIT_REVISION := $(shell (where git >nul 2>&1) && (git rev-parse --short HEAD 2>nul))
else
GIT_REVISION := $(shell (which git >/dev/null 2>&1) && (git rev-parse --short HEAD 2>/dev/null))
endif

ifneq ($(GIT_REVISION),)
ifeq ($(WIN_PLAT),y)
GIT_REVISION := $(GIT_REVISION)$(shell (git diff --quiet && git diff --cached --quiet) >nul 2>&1 || echo -dirty)
else
GIT_REVISION := $(GIT_REVISION)$(shell (git diff --quiet && git diff --cached --quiet) >/dev/null 2>&1 || echo -dirty)
endif
endif


# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
# When performing cross compilation for other architectures ARCH shall be set
# to the target architecture. (See arch/* for the possibilities).
# ARCH can be set during invocation of make:
# make ARCH=ia64
# Another way is to have ARCH set in the environment.
# The default ARCH is the host where make is executed.

# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin-utils executables
# are prefixed with $(CROSS_COMPILE).
# CROSS_COMPILE can be set on the command line
# make CROSS_COMPILE=ia64-linux-
# Alternatively CROSS_COMPILE can be set in the environment.
# A third alternative is to store a setting in .config so that plain
# "make" in the configured kernel build directory always uses that.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
ARCH		?= arm
CROSS_COMPILE	?= $(CONFIG_CROSS_COMPILE:"%"=%)

# SHELL used by kbuild
ifneq ($(WIN_PLAT),y)
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
          else if [ -x /bin/bash ]; then echo /bin/bash; \
          else echo sh; fi ; fi)
endif

# Make variables (CC, etc...)
ifeq ($(TOOLCHAIN),armclang)
CC		= armclang --target=arm-arm-none-eabi
CPP		= $(CC) -E
AS		= $(CC)
C++		= $(CC)
LD		= $(CC)
AR		= armar
NM		= fromelf
STRIP	= fromelf
OBJCOPY	= fromelf
OBJDUMP	= fromelf
else
AS		= $(CROSS_COMPILE)as
CC		= $(CROSS_COMPILE)gcc
CPP		= $(CC) -E
C++		= $(CROSS_COMPILE)g++
LD		= $(CC)
#LD		= $(CROSS_COMPILE)ld
AR		= $(CROSS_COMPILE)ar
NM		= $(CROSS_COMPILE)nm
STRIP	= $(CROSS_COMPILE)strip
OBJCOPY	= $(CROSS_COMPILE)objcopy
OBJDUMP	= $(CROSS_COMPILE)objdump
endif

AWK		= awk
PERL	= perl
PYTHON	= python

KBUILD_CPPFLAGS :=

KBUILD_CFLAGS	:= -fno-common -fmessage-length=0 -Wall \
		   -fno-exceptions -ffunction-sections \
		   -fdata-sections -fomit-frame-pointer

# By default char on ARM platform is unsigned char, but char on x86 platform
# is signed char. To avoid porting issues, force char to be signed char
# on ARM platform.
KBUILD_CFLAGS	+= -fsigned-char

ifneq ($(TOOLCHAIN),armclang)
# 1) Avoid checking out-of-bound array accesses in a loop
#    (and unrolling/peeling/exiting the loop based on the check)
# 2) Avoid detecting paths dereferencing a NULL pointer
#    (and turning the problematic statement into a trap)
KBUILD_CFLAGS	+= -fno-aggressive-loop-optimizations \
		   -fno-isolate-erroneous-paths-dereference
endif

# Treat floating-point constants as float instead of double
ifeq ($(TOOLCHAIN),armclang)
KBUILD_CFLAGS	+= -cl-single-precision-constant -fshort-enums
else
KBUILD_CFLAGS	+= -fsingle-precision-constant
endif
KBUILD_CFLAGS	+= -Wdouble-promotion -Wfloat-conversion

KBUILD_CFLAGS	+= -g

#C_ONLY_FLAGS	:= -std=gnu89
C_ONLY_FLAGS	:= -std=gnu99

C++_ONLY_FLAGS	:= -std=gnu++98 -fno-rtti

KBUILD_AFLAGS   := -D__ASSEMBLY__

export ARCH CROSS_COMPILE AS LD CC
export CPP C++ AR NM STRIP OBJCOPY OBJDUMP
export MAKE AWK PERL PYTHON

export KBUILD_CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS
export KBUILD_CFLAGS
export KBUILD_AFLAGS
export KBUILD_ARFLAGS
export C_ONLY_FLAGS C++_ONLY_FLAGS

# Files to ignore in find ... statements

export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o    \
			  -name CVS -o -name .pc -o -name .hg -o -name .git \) \
			  -prune -o
export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
			 --exclude CVS --exclude .pc --exclude .hg --exclude .git

# ===========================================================================
# Build targets only.

# Objects we will link into $(IMAGE_FILE) / subdirs we need to visit
init-y		:= init/
core-y		:= main/

LDS_FILE	:= best1000.lds

# Link flags for all LD processes
LINK_CFLAGS	:=
export LINK_CFLAGS

# Link flags for image only
LIB_LDFLAGS		:=
CFLAGS_IMAGE	:= -static
ifeq ($(TOOLCHAIN),armclang)
LDFLAGS_IMAGE	:= --no_locals
else
LDFLAGS_IMAGE	:= -X --no-wchar-size-warning
endif

# Include target definitions
include $(srctree)/$(TARGET_CFG_FILE)
include $(srctree)/$(TARGET_COMMON_FILE)

$(srctree)/$(TARGET_CFG_FILE): ;
$(srctree)/$(TARGET_COMMON_FILE): ;

ifneq ($(filter-out %/,$(init-y) $(core-y)),)
$(error The object files cannot be linked at top level: $(filter-out %/,$(init-y) $(core-y)))
endif

ifeq ($(TOOLCHAIN),armclang)
# Entry objects
ifeq ($(entry-y),)
entry-y		+= utils/boot_struct/boot_struct.o
ifeq ($(ROM_BUILD),1)
entry-y		+= tests/rom/startup_ARMCM.o
ifneq ($(filter tests/rom/,$(core-y)),)
entry-y		+= tests/rom/export_fn_rom.o
endif
else # !ROM_BUILD
entry-y		+= platform/cmsis/retarget_armclang_asm.o
ifeq ($(PROGRAMMER),1)
entry-y		+= tests/programmer/sys_api_programmer.o
else
entry-y		+= platform/main/startup_main.o
endif
endif # !ROM_BUILD
endif
ifeq ($(filter %.o,$(entry-y)),)
$(error Entry objects must be defined in entry-y in target.mk)
endif
BAD_ENTRY_OBJS := $(filter-out %.o,$(entry-y))
ifneq ($(BAD_ENTRY_OBJS),)
$(error Only objects can be defined in entry-y in target.mk: $(BAD_ENTRY_OBJS))
endif
IMAGE_ENTRY := $(entry-y)
ifeq ($(ROM_BUILD),1)
CFLAGS_IMAGE	+= -e Reset_Handler
else ifeq ($(PROGRAMMER),1)
CFLAGS_IMAGE	+= -e programmer_start
else
CFLAGS_IMAGE	+= -e __main
endif
endif

ifneq ($(NO_BUILDID),1)
ifneq ($(TOOLCHAIN),armclang)
LDFLAGS_IMAGE	+= --build-id
endif
endif
ifeq ($(CROSS_REF),1)
ifeq ($(TOOLCHAIN),armclang)
LDFLAGS_IMAGE	+= --xref
else
LDFLAGS_IMAGE	+= --cref
endif
endif

REAL_LDS_FILE := $(LDS_FILE)
ifeq ($(TOOLCHAIN),armclang)
SCATTER_LDS_SUFFIX := _scat
ifeq ($(filter %$(SCATTER_LDS_SUFFIX),$(LDS_FILE)),)
REAL_LDS_FILE := $(LDS_FILE)$(SCATTER_LDS_SUFFIX)
endif
endif

# Generate REVISION_INFO (might be defined in target)
ifeq ($(REVISION_INFO),)
ifeq ($(CUST_TGT_INFO),)
REVISION_INFO := $(GIT_REVISION):$(T)
else
REVISION_INFO := $(GIT_REVISION):$(CUST_TGT_INFO)
endif
endif

include $(srctree)/scripts/include.mk

REVISION_INFO := $(subst $(space),-,$(strip $(REVISION_INFO)))
SOFTWARE_VERSION := $(subst $(space),-,$(strip $(SOFTWARE_VERSION)))

$(info -------------------------------)
$(info REVISION_INFO: $(REVISION_INFO))
$(info -------------------------------)

# Build host and user info
ifeq ($(WIN_PLAT),y)
export BUILD_HOSTNAME := $(COMPUTERNAME)
export BUILD_USERNAME := $(USERNAME)
else
export BUILD_HOSTNAME := $(shell hostname -s)
export BUILD_USERNAME := $(shell id -un)
endif

BUILD_HOSTNAME := $(subst $(space),-,$(strip $(BUILD_HOSTNAME)))
BUILD_USERNAME := $(subst $(space),-,$(strip $(BUILD_USERNAME)))

# Default kernel image to build when no specific target is given.
# IMAGE_FILE may be overruled on the command line or
# set in the environment
IMAGE_FILE ?= $(notdir $(T)).elf

ifneq ($(filter .map .bin .hex .lst,$(suffix $(IMAGE_FILE))),)
$(error Invalid IMAGE_FILE (conflicted suffix): $(IMAGE_FILE))
endif

LST_SECTION_OPTS :=
LST_SECTION_NAME :=
ifneq ($(LST_ONLY_SECTION),)
ifeq ($(TOOLCHAIN),armclang)
LST_SECTION_OPTS += $(foreach m,$(subst $(comma),$(space),$(LST_ONLY_SECTION)),--only=$m )
else
LST_SECTION_OPTS += $(foreach m,$(subst $(comma),$(space),$(LST_ONLY_SECTION)),-j $m )
endif
LST_SECTION_NAME := _$(subst *,+,$(subst !,-,$(LST_ONLY_SECTION)))
endif
ifneq ($(LST_RM_SECTION),)
ifeq ($(TOOLCHAIN),armclang)
LST_SECTION_OPTS += $(foreach m,$(subst $(comma),$(space),$(LST_RM_SECTION)),--ignore_section=$m )
else
LST_SECTION_OPTS += $(foreach m,$(subst $(comma),$(space),$(LST_RM_SECTION)),-R $m )
endif
LST_SECTION_NAME := $(LST_SECTION_NAME)_no_$(subst *,+,$(subst !,-,$(LST_RM_SECTION)))
endif

IMAGE_MAP := $(addsuffix .map,$(basename $(IMAGE_FILE)))
IMAGE_BIN := $(addsuffix .bin,$(basename $(IMAGE_FILE)))
STR_BIN   := $(addsuffix .str,$(basename $(IMAGE_FILE)))
IMAGE_HEX := $(addsuffix .hex,$(basename $(IMAGE_FILE)))
ifeq ($(LST_SECTION_OPTS),)
IMAGE_LST := $(addsuffix .lst,$(basename $(IMAGE_FILE)))
else
IMAGE_LST := $(addsuffix $(LST_SECTION_NAME).lst,$(basename $(IMAGE_FILE)))
IMAGE_SEC := $(addsuffix $(LST_SECTION_NAME)$(suffix $(IMAGE_FILE)),$(basename $(IMAGE_FILE)))
endif

LDS_TARGET := _$(notdir $(REAL_LDS_FILE))

IMAGE_VER  := build_info.o

targets := $(LDS_TARGET) $(IMAGE_FILE) $(IMAGE_BIN) $(STR_BIN) $(IMAGE_LST) $(IMAGE_VER)
cmd_files := $(wildcard $(foreach f,$(targets),$(call get_depfile_name,$(f))))

ifneq ($(cmd_files),)
include $(cmd_files)
$(cmd_files): ;
endif

# The all: target is the default when no target is given on the
# command line.
# This allow a user to issue only 'make' to build a kernel including modules
# Defaults to $(IMAGE_BIN)
ifeq ($(TRACE_STR_SECTION),1)
all: $(IMAGE_BIN) $(STR_BIN) ;
else
all: $(IMAGE_BIN) ;
endif

ifeq ($(TOOLCHAIN),armclang)
      cmd_gen-IMAGE_BIN = $(OBJCOPY) --bincombined -o $@ $<
else
      cmd_gen-IMAGE_BIN = $(OBJCOPY) -R .trc_str -O binary $< $@
endif
quiet_cmd_gen-IMAGE_BIN = GENBIN  $@

$(IMAGE_BIN): $(IMAGE_FILE)
ifneq ($(filter 1,$(COMPILE_ONLY) $(NO_BIN)),)
	@:
else
	+$(call if_changed,gen-IMAGE_BIN)
endif

ifeq ($(TOOLCHAIN),armclang)
      cmd_gen-STR_BIN = $(OBJCOPY) --bincombined -o $@ $<
else
      cmd_gen-STR_BIN = $(OBJCOPY) -j .code_start_addr -j .rodata_str  -j .trc_str \
          --change-section-lma .code_start_addr=0x00000000 \
          --change-section-lma .rodata_str=0x00000010 \
          --change-section-lma .trc_str=0x00008000 \
          -O binary $< $@
endif
quiet_cmd_gen-STR_BIN = GENBIN  $@

$(STR_BIN): $(IMAGE_FILE)
ifneq ($(filter 1,$(COMPILE_ONLY) $(NO_BIN)),)
	@:
else
	+$(call if_changed,gen-STR_BIN)
endif

ifneq ($(TOOLCHAIN),armclang)
      cmd_gen-IMAGE_HEX = $(OBJCOPY) -O ihex $< $@
quiet_cmd_gen-IMAGE_HEX = GENHEX  $@

$(IMAGE_HEX): $(IMAGE_FILE)
ifeq ($(COMPILE_ONLY),1)
	@:
else
	+$(call if_changed,gen-IMAGE_HEX)
endif
endif

PHONY += lst lst_only
lst lst_only: $(IMAGE_LST) ;

ifneq ($(filter lst_only,$(MAKECMDGOALS)),)
NO_COMPILE := 1
endif

ifeq ($(TOOLCHAIN),armclang)
      cmd_gen-IMAGE_LST = $(OBJDUMP) $(LST_SECTION_OPTS) --datasymbols --text -c -d --output=$@ $<
else
ifeq ($(LST_SECTION_OPTS),)
      cmd_gen-IMAGE_LST = $(OBJDUMP) -Sldx $< > $@
else
      cmd_gen-IMAGE_LST = $(OBJCOPY) $(LST_SECTION_OPTS) $< $(IMAGE_SEC) && $(OBJDUMP) -Sldx $(IMAGE_SEC) > $@
endif
endif
quiet_cmd_gen-IMAGE_LST = GENLST  $@

$(IMAGE_LST): $(IMAGE_FILE)
	+$(call if_changed,gen-IMAGE_LST)


# Flags

# arch Makefile may override CC so keep this after arch Makefile is included
#ifeq ($(CONFIG_STRICT_CFLAGS),y)
#NOSTDINC_FLAGS += -nostdinc
#endif
#NOSTDINC_FLAGS += -isystem "$(subst \,/,$(shell $(CC) -print-file-name=include))"

ifeq ($(CONFIG_STRICT_CFLAGS),y)
# warn about C99 declaration after statement
#C_ONLY_FLAGS    += -Wdeclaration-after-statement

# disallow errors like 'EXPORT_GPL(foo);' with missing header
C_ONLY_FLAGS   += -Werror=implicit-int

# require functions to have arguments in prototypes, not empty 'int foo()'
#C_ONLY_FLAGS    += -Werror=strict-prototypes

C_ONLY_FLAGS    += -Werror-implicit-function-declaration

# Prohibit date/time macros, which would make the build non-deterministic
KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)

KBUILD_CFLAGS   += $(call cc-option,-Wlogical-op)

#KBUILD_CFLAGS   += -Wno-address-of-packed-member

KBUILD_CFLAGS	+= -Wno-trigraphs \
		   -fno-strict-aliasing \
		   -Wno-format-security

#KBUILD_CFLAGS	+= Wundef

# use the deterministic mode of AR if available
KBUILD_ARFLAGS := D

include $(srctree)/scripts/extrawarn.mk
endif # CONFIG_STRICT_CFLAGS

ifeq ($(TOOLCHAIN),armclang)
KBUILD_CFLAGS += -Wno-typedef-redefinition
endif

# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
KBUILD_CPPFLAGS += $(KCPPFLAGS)
KBUILD_AFLAGS += $(KAFLAGS)
KBUILD_CFLAGS += $(KCFLAGS)

IMAGE-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(core-y)))

submodgoals =
ifneq ($(SUBMODS),)
include $(srctree)/scripts/submods.mk

IMAGE-builddirs	:= $(call get_subdirs,$(IMAGE-dirs),$(SUBMODS))
ifeq ($(COMPILE_ONLY),1)
submodgoals = $(call get_submodgoals,$@,$(SUBMODS))
endif
else
IMAGE-builddirs	:= $(IMAGE-dirs)
endif

IMAGE-alldirs	:= $(sort $(IMAGE-dirs) $(patsubst %/,%,$(filter %/, \
			$(init-) $(core-) $(extra-))))

init-y		:= $(patsubst %/, %/built-in$(built_in_suffix), $(init-y))
core-y		:= $(patsubst %/, %/built-in$(built_in_suffix), $(core-y))

IMAGE_INIT := $(init-y)
IMAGE_MAIN := $(core-y)

ifeq ($(NO_COMPILE),1)
IMAGE-deps :=
else
IMAGE-deps := $(LDS_TARGET) $(IMAGE_INIT) $(IMAGE_MAIN) $(IMAGE_VER)
endif

BUILD_INFO_FLAGS := \
	-DREVISION_INFO=$(REVISION_INFO) \
	-DFLASH_SIZE=$(FLASH_SIZE) \
	-DOTA_UPGRADE_CRC_LOG_SIZE=$(OTA_UPGRADE_CRC_LOG_SIZE) \
	-DNV_REC_DEV_VER=$(NV_REC_DEV_VER) \
	-I$(srctree)/platform/hal

BUILD_INFO_FLAGS += $(LDS_SECTION_FLAGS)
BUILD_INFO_FLAGS += -DCHIP=$(CHIP)

ifneq ($(CHIP_SUBTYPE),)
BUILD_INFO_FLAGS += -DCHIP_SUBTYPE=$(CHIP_SUBTYPE)
endif
ifneq ($(SOFTWARE_VERSION),)
BUILD_INFO_FLAGS += -DSOFTWARE_VERSION=$(SOFTWARE_VERSION)
endif
ifneq ($(OTA_BOOT_SIZE),0)
BUILD_INFO_FLAGS += -DOTA_BOOT_SIZE=$(OTA_BOOT_SIZE)
endif
ifneq ($(OTA_CODE_OFFSET),)
BUILD_INFO_FLAGS += -DOTA_CODE_OFFSET=$(OTA_CODE_OFFSET)
endif
ifneq ($(OTA_REMAP_OFFSET),)
BUILD_INFO_FLAGS += -DOTA_REMAP_OFFSET=$(OTA_REMAP_OFFSET)
endif
ifeq ($(CRC32_OF_IMAGE),1)
BUILD_INFO_FLAGS += -DCRC32_OF_IMAGE
endif
ifeq ($(TRACE_CRLF),1)
BUILD_INFO_FLAGS += -DTRACE_CRLF
endif

BUILD_INFO_FLAGS += -DKERNEL=$(KERNEL)

quiet_cmd_image_ver = CC      $(IMAGE_VER)
      cmd_image_ver = $(CC) $(filter-out -Werror=date-time, \
                             $(call flags,KBUILD_CPPFLAGS) \
                             $(call flags,KBUILD_CFLAGS) \
                             $(call flags,C_ONLY_FLAGS) \
                             $(NOSTDINC_FLAGS)) \
                             $(BUILD_INFO_FLAGS) \
                             -MD -MP -MF $(depfile) -MT $@ \
                             -c -o $@ $<

IMAGE_VER_SRC := $(src)/utils/build_info/build_info.c

$(IMAGE_VER): $(IMAGE_VER_SRC) $(filter-out $(IMAGE_VER),$(IMAGE-deps)) FORCE
	$(call if_changed_dep,image_ver)

# Linker scripts preprocessor (.lds.S -> .lds)
# ---------------------------------------------------------------------------
quiet_cmd_cpp_lds_S = LDS     $@
      cmd_cpp_lds_S = $(CPP) $(call flags,KBUILD_CPPFLAGS) \
                             $(call flags,CPPFLAGS_$(LDS_FILE)) \
                             -MD -MP -MF $(depfile) -MT $@ \
                             $(NOSTDINC_FLAGS) \
                             -P -C -E -x c -o $@ $<

LDS_SRC_STEM := $(src)/scripts/link/$(REAL_LDS_FILE)
LDS_SRC := $(firstword $(wildcard $(LDS_SRC_STEM).S $(LDS_SRC_STEM).sx) $(LDS_SRC_STEM).S)

$(LDS_TARGET): $(LDS_SRC) FORCE
	$(call if_changed_dep,cpp_lds_S)

PHONY += lds
lds: $(LDS_TARGET) ;


# Final link of $(IMAGE_FILE)
# ---------------------------------------------------------------------------
#
# 1) Link the archives twice to solve circular references between two or
#    more archives. Otherwise we should use --start-group and --end-group
#    options. Normally, an archive is searched only once in the order that
#    it is specified on the command line.
# 2) Use --whole-archive option to solve weak symbol overriding issue.
#    It tells LD to include every object file in the archive in the link,
#    rather than searching the archive for the required object files.
#    By default the strong symbols defined in the archive will not override
#    any weak symbol, for LD only searches the archive if there is a undefined
#    symbol (and a weak symbol is considered as a defined symbol).
#
ifeq ($(TOOLCHAIN),armclang)
#LDFLAGS_IMAGE += --symbols --list_mapping_symbols
ifeq ($(KBUILD_VERBOSE),1)
LDFLAGS_IMAGE += --verbose
endif

      cmd_link-IMAGE_FILE = $(LD) -o $@ \
	      $(CFLAGS_IMAGE) \
	      -Wl,$(subst $(space),$(comma),$(strip \
	      $(LDFLAGS) $(LDFLAGS_IMAGE) \
	      --scatter=$(LDS_TARGET) \
	      --list=$(IMAGE_MAP) \
	      --info=summarysizes --info=summarystack --info=totals --info=unused \
	      --map --load_addr_map_info \
	      --remove --no_autoat \
	      --emit_debug_overlay_relocs --emit_debug_overlay_section \
	      --diag_style=gnu --diag_suppress=L6314 --diag_suppress=L6329)) \
	      $(IMAGE_ENTRY) $(IMAGE_INIT) $(IMAGE_MAIN) $(IMAGE_VER) \
	      $(LIB_LDFLAGS) $(LIB_LDFLAGS)
else
      cmd_link-IMAGE_FILE = $(LD) -o $@ \
		  $(LD_USE_PATCH_SYMBOL) \
	      -T $(LDS_TARGET) \
	      $(CFLAGS_IMAGE) \
	      -Wl,$(subst $(space),$(comma),$(strip \
	      $(LDFLAGS) $(LDFLAGS_IMAGE) \
	      -Map=$(IMAGE_MAP) \
	      --gc-sections \
	      --whole-archive)) \
	      $(IMAGE_INIT) $(IMAGE_MAIN) $(IMAGE_VER) \
	      -Wl,--no-whole-archive $(LIB_LDFLAGS) $(LIB_LDFLAGS)
		  
endif
quiet_cmd_link-IMAGE_FILE = LINK    $@


# Include targets which we want to
# execute if the rest of the kernel build went well.
$(IMAGE_FILE): $(IMAGE-deps) FORCE
ifneq ($(filter 1,$(COMPILE_ONLY) $(NO_COMPILE)),)
	@:
else
	+$(call if_changed,link-IMAGE_FILE)
endif

ifneq ($(IMAGE-deps),)
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
$(sort $(filter %/built-in$(built_in_suffix),$(IMAGE-deps))): $(IMAGE-builddirs) ;
endif

# Handle descending into subdirectories listed in $(IMAGE-dirs)
# Preset locale variables to speed up the build process. Limit locale
# tweaks to this spot to avoid wrong language settings when running
# make menuconfig etc.
# Error messages still appears in the original language

PHONY += $(IMAGE-dirs)
$(IMAGE-dirs): scripts
	$(Q)$(MAKE) $(build)=$@ $(submodgoals)

# clean - Delete most, but leave enough to build external modules
#
clean: rm-dirs  := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES)
ifneq ($(SUBMODS),)
clean-dirs      := $(addprefix _clean_, $(IMAGE-builddirs))
else
clean-dirs      := $(addprefix _clean_, $(IMAGE-alldirs))
endif

PHONY += $(clean-dirs) clean IMAGE-clean
$(clean-dirs):
	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)

IMAGE-clean:
	$(Q)$(call CMDRMFILE,$(IMAGE_FILE) $(IMAGE_MAP) \
		$(IMAGE_BIN) $(STR_BIN) $(IMAGE_HEX) $(IMAGE_LST) \
		$(IMAGE_VER) $(LDS_TARGET))

clean: IMAGE-clean

clean: $(clean-dirs)
	$(call cmd,rmdirs)
	$(call cmd,rmfiles)
ifeq ($(SUBMODS),)
	$(Q)$(call CMDRMFILER,.,*.o *.a *.s *.d)
endif

PHONY += allclean
ifeq ($(KBUILD_OUTPUT),)
allclean: clean ;
else
ifeq ($(SUBMODS),)
quiet_cmd_clean    = RMDIR   $(KBUILD_OUTPUT)
      cmd_clean    = $(call CMDRMDIR,$(KBUILD_OUTPUT))

allclean:
	+$(call cmd,clean)
else
allclean: clean ;
endif
endif

quiet_cmd_predefined-macros = GEN     $@
      cmd_predefined-macros = $(CPP) $(filter-out -I% -D% -include%,$(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(C_ONLY_FLAGS)) \
                                     -x c -E -dM -o $@ $(devnull)

PREDEF_MACRO_FILE := predefined-macros.txt

$(PREDEF_MACRO_FILE): FORCE
	$(call cmd,predefined-macros)

PHONY += predefined-macros
predefined-macros: $(PREDEF_MACRO_FILE) ;

# FIXME Should go into a make.lib or something
# ===========================================================================

quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   $(wildcard $(rm-dirs)))
      cmd_rmdirs = $(if $(wildcard $(rm-dirs)),$(call CMDRMDIR,$(rm-dirs)))

quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
      cmd_rmfiles = $(if $(wildcard $(rm-files)),$(call CMDRMFILE,$(rm-files)))

# Shorthand for $(Q)$(MAKE) -f scripts/clean.mk obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(srctree)/scripts/clean.mk obj

ifneq ($(WIN_PLAT),y)
# Generate tags for editors
# ---------------------------------------------------------------------------
quiet_cmd_tags = GEN     $@
      cmd_tags = $(CONFIG_SHELL) $(srctree)/tools/tags.sh $@

tags TAGS cscope gtags: FORCE
	$(call cmd,tags)
endif

HELP_TARGET := 2

endif # ifeq ($(skip-makefile),)
endif # ifneq ($(HELP_TARGET),1)

# Help target
ifneq ($(HELP_TARGET),)
ifeq ($(HELP_TARGET),1)
include scripts/include.mk
endif

help: FORCE
	$(call echo-help,Mandatory options:)
	$(call echo-help,  T=<targetBoard> - Select a target board configuration in config/)
	$(call echo-help,)
	$(call echo-help,Cleaning targets:)
	$(call echo-help,  clean           - Remove most generated files)
	$(call echo-help,  allclean        - Remove all generated files and the output directory if possible)
	$(call echo-help,)
	$(call echo-help,Generic targets:)
	$(call echo-help,  all             - Build all targets marked with [*])
	$(call echo-help,  lst             - Build the mixed source/assembly file of the final image)
	$(call echo-help,  lds             - Build the linker script file)
ifeq ($(HELP_TARGET),2)
	$(call echo-help,* $(IMAGE_FILE))
	$(call echo-help,                  - Build the final image)
endif
	$(call echo-help,  dir/            - Build all files in dir and below)
	$(call echo-help,  dir/file.[oisS] - Build specified target only)
	$(call echo-help,  dir/file.lst    - Build specified mixed source/assembly target only)
	$(call echo-help,                    (requires a recent binutils and recent build (System.map)))
	$(call echo-help,)
	$(call echo-help,  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build)
	$(call echo-help,  make V=2   [targets] 2 => give reason for rebuild of target)
	$(call echo-help,  make O=dir [targets] Locate all output files in "dir", including .config)
	$(call echo-help,  make W=n   [targets] Enable extra gcc checks, n=1,2,3 where)
	$(call echo-help,         1: warnings which may be relevant and do not occur too often)
	$(call echo-help,         2: warnings which occur quite often but may still be relevant)
	$(call echo-help,         3: more obscure warnings, can most likely be ignored)
	$(call echo-help,         Multiple levels can be combined with W=12 or W=123)
	$(call echo-help,)
	$(call echo-help,Execute "make" or "make all" to build all targets marked with [*])

endif # ifneq ($(HELP_TARGET),)

# Cancel implicit rules on top Makefile
ifeq ($(KBUILD_SRC),)
$(CURDIR)/Makefile Makefile: ;
else
$(KBUILD_SRC)/Makefile Makefile: ;
endif

PHONY += FORCE
FORCE: ;
### Formatting
ALL_SOURCE = $(shell find . \( -type f \( -name '*.c' -o -name '*.cpp' \) \) )


style:
	@for src in $(ALL_SOURCE) $(ALL_INCLUDES); do \
		echo "Formatting $$src..." ; \
		clang-format -i "$$src" ; \
	done
	@echo "Done"

check-style:
	@for src in $(ALL_SOURCE) $(ALL_INCLUDES) ; do \
		var=`clang-format "$$src" | diff "$$src" - | wc -l` ; \
		if [ $$var -ne 0 ] ; then \
			echo "$$src does not respect the coding style (diff: $$var lines)" ; \
			clang-format "$$src" | diff "$$src" -; \
			exit 1 ; \
		fi ; \
	done
	@echo "Style check passed"
  

PHONY += style check-style

# Declare the contents of the .PHONY variable as phony.  We keep that
# information in a variable so we can use it in if_changed and friends.
.PHONY: $(PHONY)



================================================
FILE: README.md
================================================
# PineBuds SDK

This is just the SDK from the wiki (so far), with dockerfile setup to make building easier, and my reverse engineered bestool integrated.
The docker image will build bestool for you first, then drop you into the dev container for building and flashing the buds.

NOTE: Currently, the SDK is not licensed under an 'open source' license. We are working to resolve this issue, and will be reaching out to contributors and other parties soon. For now, consider this SDK as 'All Rights Reserved'/'shared source'.

## Usage

To use this setup to build & flash your PineBuds you will need a system with docker setup at the minimum.
Docker is used to (1) make this all much more reprodicible and easier to debug and (2) so that we dont mess with your host system at all.
In order to program the buds from inside of the docker container; privileged mode is used. So do be a tad more careful than usual.

```bash

./start_dev.sh # This will cause docker to start your working environment; this should take roughly 1-3 minutes depending on your network speed to the GCC hosting server

# Now you will be inside of the container, and your prompt will look akin to "root@ec5410d0a265:/usr/src#"

./build.sh # This will run make and build the output program. If you have weird build errors try running clean.sh or rm -rf'ing the out folder first

# Now that the firmware has finished building; if there are no errors you can load it to your buds

# You may want to back up the firmware currently on the buds - it will be deleted when the new firmware is loaded on:
./backup.sh

# You may need to take the buds out of the case, wait three seconds, place them back. This wakes them up and the programmer needs to catch this reboot.

# You can try the helper script by running
./download.sh

# Or do it manually by :

# Assuming that your serial ports are 0 and 1, run the following to commands to program each bud in series.
bestool write-image out/open_source/open_source.bin --port /dev/ttyACM0
bestool write-image out/open_source/open_source.bin --port /dev/ttyACM1
```

## Changelist from stock open source SDK

- Long hold (5 ish seconds) the button on the back when buds are in the case to force a device reboot (so it can be programmed)
- Use the resistor in the buds to pick Left/Right rather than TWS master/slave pairing
- Pressing the button on the back while in the case no longer triggers DFU mode
- Debugging baud rate raised to 2000000 to match stock firmware
- Fixed TWS operation such that putting either bud into the case correctly switches to the other bud
- Working (mostly) audio controls using the touch button on the buds
- Turned off showing up as a HID keyboard, as not sure _why_ you would; but it stops android nagging me about a new keyboard

## Current bud tap codes

### Both pods active

#### Right Ear:

- Single tap : Play/Pause
- Double tap : Next track
- Hold : Toggle ANC(Currently non functional, WIP)
- Triple tap : Volume Up

#### Left Ear:

- Single tap : Play/Pause
- Double tap : Previous track
- Hold : Toggle ANC(Currently non functional, WIP)
- Triple tap : Volume Down

### Single pod active

- Single tap : Play/Pause
- Double tap : Next track
- Hold : Previous track
- Triple tap : Volume Up
- Quad tap : Volume Down

## Changing audio alerts

The default audio alerts are stored in:

`config/_default_cfg_src_/res/en/`

If you want to change the alert to a custom sound, just replace the sound file you'd like to change
(ie `config/_default_cfg_src_/res/en/SOUND_POWER_ON.opus`) with your own audio file with the same base
name (ie `config/_default_cfg_src_/res/en/SOUND_POWER_ON.mp3`) and recompile with `./build.sh`!

### Language support

The `AUDIO` environment variable can be set when running the `build.sh` script to load sound files
for languages other than the default English. For example, running `AUDIO=cn ./build.sh` will load sounds files from
`config/_default_cfg_src_/res/cn/` instead of the default `en/` folder.

The current languages supported with sound files are English (`en`) and Chinese (`cn`). Other languages
(or other sets of custom sounds) may be added by adding all the correct sound files into a
`config/_default_cfg_src_/res/<custom_sounds>/` directory and building with `AUDIO=<custom_sounds> ./build.sh`.

### Blue light when connected

The firmware can be configured to either have a blinking blue light when connected or not.
Build with `CONNECTED_BLUE_LIGHT=1 ./build.sh` to enable blinking when connected,
or `CONNECTED_BLUE_LIGHT=0 ./build.sh` (or just the default `./build.sh`) to keep the LEDs off when connected.


================================================
FILE: apps/Makefile
================================================
obj-y := audioplayers/ common/ main/ key/ pwl/ battery/ factory/

ifeq ($(APP_TEST_AUDIO),1)
obj-y += apptester/
endif

ifeq ($(BTUSB_AUDIO_MODE),1)
obj-y += usbaudio/
endif
ifeq ($(BT_USB_AUDIO_DUAL_MODE),1)
obj-y += btusbaudio/
obj-y += usbaudio/
endif


ifeq ($(ANC_APP),1)
obj-y += anc/
endif

ifeq ($(WL_DET),1)
obj-y += mic_alg/
endif

ifeq ($(VOICE_DETECTOR_EN),1)
obj-y += voice_detector/
endif

ifeq ($(PC_CMD_UART),1)
obj-y += cmd/
endif

subdir-ccflags-y += -Iapps/apptester \
					-Iapps/audioplayers \
					-Iapps/common \
					-Iapps/main \
					-Iapps/cmd \
					-Iapps/key \
					-Iapps/pwl \
					-Iapps/battery \
					-Iservices/voicepath \
					-Iservices/ble_app/app_datapath \
					-Iutils/list \
					-Iutils/heap \
					-Iservices/multimedia/audio/process/filters/include
ifeq ($(BT_USB_AUDIO_DUAL_MODE),1)
subdir-ccflags-y += -Iapps/btusbaudio
endif

ifeq ($(A2DP_LDAC_ON),1)
subdir-ccflags-y += -Ithirdparty/audio_codec_lib/ldac/inc
endif



================================================
FILE: apps/anc/Makefile
================================================

cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))

obj_s := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)src/*.s))
obj_c := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)src/*.c))
obj_cpp := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)src/*.cpp))

ifeq ($(ANC_APP),1)
CFLAGS_app_anc.o += -DANC_APP
endif

ifeq ($(ANC_FF_ENABLED),1)
CFLAGS_app_anc.o += -DANC_FF_ENABLED
endif

ifeq ($(ANC_FB_ENABLED),1)
CFLAGS_app_anc.o += -DANC_FB_ENABLED
endif

ifeq ($(ANC_WNR_ENABLED),1)
CFLAGS_app_anc.o += -DANC_WNR_ENABLED
endif



ifeq ($(ANC_ASSIST_ENABLED),1)
CFLAGS_app_anc.o += -DANC_ASSIST_ENABLED
CFLAGS_anc_assist.o += -DANC_ASSIST_ENABLED

ifeq ($(ANC_ASSIST_WNR_ENABLED),1)
CFLAGS_anc_assist.o += -DANC_ASSIST_WNR_ENABLED
endif
ifeq ($(ANC_ASSIST_PILOT_ENABLED),1)
CFLAGS_anc_assist.o += -DANC_ASSIST_PILOT_ENABLED
endif
ifeq ($(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED),1)
CFLAGS_anc_assist.o += -DANC_ASSIST_NOISE_ADAPTIVE_ENABLED
endif
ifeq ($(ANC_ASSIST_HESS_ENABLED),1)
CFLAGS_anc_assist.o += -DANC_ASSIST_HESS_ENABLED
endif
ifeq ($(ANC_ASSIST_PNC_ENABLED),1)
CFLAGS_anc_assist.o += -DANC_ASSIST_PNC_ENABLED
endif
ifeq ($(ANC_ASSIST_DEHOWLING_ENABLED),1)
CFLAGS_anc_assist.o += -DANC_ASSIST_DEHOWLING_ENABLED
endif

else
obj_c := $(filter-out src/anc_assist.c ,$(obj_c))
endif 


ifeq ($(AUDIO_RESAMPLE),1)
CFLAGS_app_anc.o += -D__AUDIO_RESAMPLE__
endif
ifeq ($(SW_PLAYBACK_RESAMPLE),1)
CFLAGS_app_anc.o += -DSW_PLAYBACK_RESAMPLE
endif
ifeq ($(SW_CAPTURE_RESAMPLE),1)
CFLAGS_app_anc.o += -DSW_CAPTURE_RESAMPLE
endif
ifeq ($(AUDIO_SECTION_SUPPT),1)
CFLAGS_app_anc.o += -D__AUDIO_SECTION_SUPPT__
endif

obj-y := $(obj_c:.c=.o) $(obj_s:.S=.o) $(obj_cpp:.cpp=.o)

subdir-ccflags-y += \
	-Iservices/fs/fat \
	-Iservices/fs/sd \
	-Iservices/fs/fat/ChaN \
	-Iservices/overlay \
	-Iservices/nvrecord \
	-Iservices/resources \
	-Iservices/multimedia/audio/process/resample/include \
    -Iservices/multimedia/audio/process/anc/include \
    -Iservices/multimedia/speech/inc \
	-Iplatform/drivers/uarthci \
	-Iplatform/drivers/ana \
	-Iplatform/drivers/bt \
	-Iutils/cqueue \
	-Iservices/audioflinger \
	-Iutils/lockcqueue \
	-Iutils/intersyshci \
	-Iapps/anc/inc \
	-Iapps/key \
	-Iapps/main \
	-Iapps/common \
	-Iapps/audioplayers \
	-Iapps/factory \
	-Iservices/ble_app \
	-Iservices/bt_app \
	-Iservices/anc/inc \
	-Iservices/multimedia/audio/codec/sbc/inc \
    -Iservices/nv_section/aud_section \
    -Iservices/nv_section/include   \
    -Iutils/hwtimer_list \
    -Iservices/ibrt_core/inc \
	-Iservices/tota \
	$(BT_IF_INCLUDES) \
	-Iservices/app_ibrt/inc \
	-Iservices/ble_stack/common/api \
	-Iservices/ble_stack/ble_ip \
	-Iservices/ibrt_ui/inc \
	-Iservices/audio_dump/include


================================================
FILE: apps/anc/inc/anc_assist.h
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/



#ifndef __ANC_ASSIT_H__
#define __ANC_ASSIT_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "plat_types.h"

//#define AF_ANC_DUMP_DATA


#if defined(_24BITS_ENABLE)
#define _SAMPLE_BITS        (24)
typedef int   ASSIST_PCM_T;
#else
#define _SAMPLE_BITS        (16)
typedef short   ASSIST_PCM_T;
#endif


#define ANC_ASSIST_FF1_MIC (1<<2)
#define ANC_ASSIST_FF2_MIC (1<<1)
#define ANC_ASSIST_FB_MIC (1<<0)





typedef enum{
    ANC_ASSIST_STANDALONE = 0,
    ANC_ASSIST_MUSIC,
    ANC_ASSIST_PHONE_8K,
    ANC_ASSIST_PHONE_16K,

    ANC_ASSIST_MODE_QTY

}ANC_ASSIST_MODE_T;


void anc_assist_open(ANC_ASSIST_MODE_T mode);

void anc_assist_process(uint8_t * buf, int len);
void anc_assist_close();



#ifdef __cplusplus
}
#endif

#endif

================================================
FILE: apps/anc/inc/anc_wnr.h
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#ifndef __ANC_WNR_H__
#define __ANC_WNR_H__

#include <stdint.h>
#include "plat_types.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
  ANC_WNR_OPEN_MODE_STANDALONE = 0,
  ANC_WNR_OPEN_MODE_CONFIGURE,

  ANC_WNR_OPEN_MODE_QTY
} anc_wnr_open_mode_t;

void anc_release_gain(void);

typedef enum {
  APP_WNR_NOTIFY_DETECT_RESULT,
  APP_WNR_REQUEST_DETECT_RESULT,
  APP_WNR_RESPONSE_DETECT_RESULT,
  APP_WNR_PROCESS_DETECT_RESULT,
  APP_WNR_SET_TRIGGER,
  APP_WNR_EXCUTE_TRIGGER,
  APP_WNR_SHARE_MODULE_INFO,
} anc_wnr_sync_ctrl_internal_event_e;

int32_t anc_wnr_ctrl(int32_t sample_rate, int32_t frame_len);
int32_t anc_wnr_open(anc_wnr_open_mode_t mode);
int32_t anc_wnr_close(void);
int32_t anc_wnr_process(void *pcm_buf, uint32_t pcm_len);
void app_wnr_sync_state(void);
void app_wnr_cmd_receive_process(uint8_t *p_buff, uint16_t length);

#ifdef __cplusplus
}
#endif
#endif


================================================
FILE: apps/anc/inc/app_anc.h
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#ifndef __APP_ANC_H__
#define __APP_ANC_H__

#include "hal_aud.h"
#include "app_key.h"

#ifdef __cplusplus
extern "C" {
#endif

void app_anc_set_playback_samplerate(enum AUD_SAMPRATE_T sample_rate);
void app_anc_init(enum AUD_IO_PATH_T input_path, enum AUD_SAMPRATE_T playback_rate, enum AUD_SAMPRATE_T capture_rate);
void app_anc_close(void);
void app_anc_enable(void);
void app_anc_disable(void);
bool anc_enabled(void);
void test_anc(void);
void app_anc_resample(uint32_t res_ratio, uint32_t *in, uint32_t *out, uint32_t samples);
#ifdef __BT_ANC_KEY__
void app_anc_key(APP_KEY_STATUS *status, void *param);
#endif
int app_anc_open_module(void);
int app_anc_close_module(void);
enum AUD_SAMPRATE_T app_anc_get_play_rate(void);
bool app_anc_work_status(void);
void app_anc_send_howl_evt(uint32_t howl);
uint32_t app_anc_get_anc_status(void);
bool app_pwr_key_monitor_get_val(void);
bool app_anc_switch_get_val(void);
void app_anc_ios_init(void);
void app_anc_set_init_done(void);
bool app_anc_set_reboot(void);
void app_anc_status_post(uint8_t status);
bool app_anc_is_on(void);
uint32_t app_anc_get_sample_rate(void);
void app_anc_set_coef_idx(uint8_t idx);
uint8_t app_anc_get_coef_idx(void);

#if defined(IBRT)
void app_anc_cmd_receive_process(uint8_t *buf, uint16_t len);
void app_anc_set_peer_coef_idx(uint8_t idx);
uint8_t app_anc_get_peer_coef_idx(void);
void app_anc_set_status_sync_flag(bool status);
bool app_anc_get_status_sync_flag(void);
#endif

#ifndef __BT_ANC_KEY__
int app_anc_start(void);
int app_anc_switch_coef(uint8_t index);
int app_anc_stop(void);
#endif

#ifdef __cplusplus
}
#endif

#endif


================================================
FILE: apps/anc/inc/peak_detector.h
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#ifndef __PEAK_DETECTOR_H__
#define __PEAK_DETECTOR_H__

#include "plat_types.h"
#include "hal_aud.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    enum AUD_SAMPRATE_T fs;
    enum AUD_BITS_T bits;
    float factor_up;
    float factor_down;
    float reduce_dB;
} PEAK_DETECTOR_CFG_T;

void peak_detector_init(void);
void peak_detector_setup(PEAK_DETECTOR_CFG_T *cfg);
void peak_detector_run(uint8_t *buf, uint32_t len, float vol_multiple);

#ifdef __cplusplus
}
#endif
#endif


================================================
FILE: apps/anc/src/anc_assist.c
================================================


/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#include "anc_assist.h"
#include "anc_assist_algo.h"
#include "anc_process.h"
#include "arm_math.h"
#include "audio_dump.h"
#include "audioflinger.h"
#include "hal_aud.h"
#include "hal_codec.h"
#include "hal_timer.h"
#include "hal_trace.h"
#include "speech_cfg.h"
#include "speech_memory.h"
#include "speech_ssat.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#if defined(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED)
#include "main_classify.h"
#endif

static void _close_mic_anc_assist();
static void _open_mic_anc_assist();
#define _SAMPLE_RATE (16000)

#if defined(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED)
#define _FRAME_LEN (128)
#else
#define _FRAME_LEN (160)
#endif

#define _CHANNEL_NUM_MAX (3)
#define SAMPLE_BYTES (sizeof(ASSIST_PCM_T))
#define AF_STREAM_BUFF_SIZE (_FRAME_LEN * SAMPLE_BYTES * _CHANNEL_NUM_MAX * 2)
#define ANC_ADPT_STREAM_ID AUD_STREAM_ID_3

#define _FRAME_LEN_MAX (160)
#define _SAMPLE_BITS_MAX (32)

static uint8_t __attribute__((aligned(4))) af_stream_buff[AF_STREAM_BUFF_SIZE];
static ASSIST_PCM_T af_stream_mic1[_FRAME_LEN_MAX * (_SAMPLE_BITS_MAX / 8)];
static ASSIST_PCM_T af_stream_mic2[_FRAME_LEN_MAX * (_SAMPLE_BITS_MAX / 8)];
static ASSIST_PCM_T af_stream_mic3[_FRAME_LEN_MAX * (_SAMPLE_BITS_MAX / 8)];
int MIC_NUM = 0;
int MIC_MAP = 0;

#if defined(ANC_ASSIST_PILOT_ENABLED)
#define _PLAY_SAMPLE_RATE (8000)
#define _PLAY_FRAME_LEN (80)
#define AF_PLAY_STREAM_BUFF_SIZE (_PLAY_FRAME_LEN * SAMPLE_BYTES * 1 * 2)
static uint8_t __attribute__((aligned(4)))
af_play_stream_buff[AF_PLAY_STREAM_BUFF_SIZE];
#endif

#if defined(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED)
ClassifyState *NoiseClassify_st = NULL;
#endif

#if defined(ANC_ASSIST_PILOT_ENABLED) || defined(ANC_ASSIST_HESS_ENABLED) ||   \
    defined(ANC_ASSIST_PNC_ENABLED) ||                                         \
    defined(ANC_ASSIST_DEHOWLING_ENABLED) ||                                   \
    defined(ANC_ASSIST_WNR_ENABLED) ||                                         \
    defined(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED)

extern const struct_anc_cfg *anc_coef_list_48k[1];
void anc_assist_change_curve(int curve_id) {
  TRACE(2, "[%s] change anc curve %d", __func__, curve_id);
  anc_set_cfg(anc_coef_list_48k[0], ANC_FEEDFORWARD, ANC_GAIN_NO_DELAY);
  anc_set_cfg(anc_coef_list_48k[0], ANC_FEEDBACK, ANC_GAIN_NO_DELAY);
}
bool audio_engine_tt_is_on() { return 1; }

#define _tgt_ff_gain (512)
void anc_assist_set_anc_gain(float gain_ch_l, float gain_ch_r,
                             enum ANC_TYPE_T anc_type) {

  TRACE(2, "[%s] set anc gain %d", __func__, (int)(100 * gain_ch_l));
  uint32_t tgt_ff_gain_l, tgt_ff_gain_r;
  tgt_ff_gain_l = (uint32_t)(_tgt_ff_gain * gain_ch_l);
  tgt_ff_gain_r = (uint32_t)(_tgt_ff_gain * gain_ch_r);
  anc_set_gain(tgt_ff_gain_l, tgt_ff_gain_r, anc_type);
}
#endif

#if defined(ANC_ASSIST_PILOT_ENABLED)
static LeakageDetectionState *pilot_st = NULL;

#endif

#if defined(ANC_ASSIST_HESS_ENABLED) || defined(ANC_ASSIST_PNC_ENABLED) ||     \
    defined(ANC_ASSIST_DEHOWLING_ENABLED) || defined(ANC_ASSIST_WNR_ENABLED)
static ANCAssistMultiState *anc_assist_multi_st = NULL;
#endif

ANC_ASSIST_MODE_T g_anc_assist_mode = ANC_ASSIST_MODE_QTY;
void anc_assist_open(ANC_ASSIST_MODE_T mode) {
  g_anc_assist_mode = mode;

  // normal init
#if defined(ANC_ASSIST_PILOT_ENABLED)
  pilot_st = LeakageDetection_create(160, 0);
#endif

#if defined(ANC_ASSIST_HESS_ENABLED) || defined(ANC_ASSIST_PNC_ENABLED) ||     \
    defined(ANC_ASSIST_DEHOWLING_ENABLED) || defined(ANC_ASSIST_WNR_ENABLED)
  anc_assist_multi_st = ANCAssistMulti_create(_SAMPLE_RATE, _FRAME_LEN, 128);
#endif

#if defined(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED)
  NoiseClassify_st = classify_create(_SAMPLE_RATE, _FRAME_LEN);
#endif

  // audio_dump_init(160,sizeof(short),3);

  if (mode == ANC_ASSIST_MODE_QTY) {
    return;
  } else {
    if (mode == ANC_ASSIST_STANDALONE || mode == ANC_ASSIST_MUSIC) {
      _open_mic_anc_assist();
    }
    if (mode == ANC_ASSIST_PHONE_8K) {
      // normal init 8k
    } else if (mode == ANC_ASSIST_PHONE_16K) {
      // normal init 16k
    }
  }
}

void anc_assist_close() {

#if defined(ANC_ASSIST_PILOT_ENABLED)
  LeakageDetection_destroy(pilot_st);
#endif
#if defined(ANC_ASSIST_HESS_ENABLED) || defined(ANC_ASSIST_PNC_ENABLED) ||     \
    defined(ANC_ASSIST_DEHOWLING_ENABLED) || defined(ANC_ASSIST_WNR_ENABLED)
  ANCAssistMulti_destroy(anc_assist_multi_st);
#endif

#if defined(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED)
  classify_destroy(NoiseClassify_st);
#endif

  // ext_heap_deinit();

  if (g_anc_assist_mode == ANC_ASSIST_MODE_QTY) {
    return;
  } else {
    if (g_anc_assist_mode == ANC_ASSIST_STANDALONE ||
        g_anc_assist_mode == ANC_ASSIST_MUSIC) {
      _close_mic_anc_assist();
    }
    if (g_anc_assist_mode == ANC_ASSIST_PHONE_8K) {
      // normal init 8k
    } else if (g_anc_assist_mode == ANC_ASSIST_PHONE_16K) {
      // normal init 16k
    }
  }
}

extern ASSIST_PCM_T ref_buf_data[80];
void anc_assist_process(uint8_t *buf, int len) {

  int32_t frame_len = len / SAMPLE_BYTES / MIC_NUM;
  ASSERT(frame_len == _FRAME_LEN, "[%s] frame len(%d) is invalid.", __func__,
         frame_len);
  ASSIST_PCM_T *pcm_buf = (ASSIST_PCM_T *)buf;

  ASSIST_PCM_T *mic1 = (ASSIST_PCM_T *)af_stream_mic1;
  ASSIST_PCM_T *mic2 = (ASSIST_PCM_T *)af_stream_mic2;
  ASSIST_PCM_T *mic3 = (ASSIST_PCM_T *)af_stream_mic3;

  for (int32_t i = 0; i < frame_len; i++) {
    mic1[i] = pcm_buf[MIC_NUM * i + 0];
    mic2[i] = pcm_buf[MIC_NUM * i + 1];
    mic3[i] = pcm_buf[MIC_NUM * i + 2];
  }
  // audio_dump_clear_up();
  // audio_dump_add_channel_data(0,mic1,160);
  // audio_dump_add_channel_data(1,mic2,160);
  // audio_dump_add_channel_data(2,mic3,160);
  // audio_dump_run();
  // TRACE(2,"in callback");
#if defined(ANC_ASSIST_PILOT_ENABLED)
  LeakageDetection_process(pilot_st, AF_ANC_OFF, mic3, ref_buf_data, frame_len);
#endif

#if defined(ANC_ASSIST_HESS_ENABLED) || defined(ANC_ASSIST_PNC_ENABLED) ||     \
    defined(ANC_ASSIST_DEHOWLING_ENABLED) || defined(ANC_ASSIST_WNR_ENABLED)
  ANCAssistMulti_process(anc_assist_multi_st, mic1, mic2, mic3, frame_len);
#endif

#if defined(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED)
  static int last_classify_res = -1;
  classify_process(NoiseClassify_st, mic1, last_classify_res);
#endif

  if (g_anc_assist_mode == ANC_ASSIST_PHONE_16K) {
    // down sample
  }

  // process fft

  // wnr

  // pnc

  // hess

  // pilot adpt
}

static uint32_t anc_assist_callback(uint8_t *buf, uint32_t len) {
#ifdef TEST_MIPS
  start_ticks = hal_fast_sys_timer_get();
#endif
  anc_assist_process(buf, len);

#ifdef TEST_MIPS
  end_ticks = hal_fast_sys_timer_get();
  used_mips = (end_ticks - start_ticks) * 1000 / (start_ticks - pre_ticks);
  TRACE(2, "[%s] Usage: %d in a thousand (MIPS).", __func__, used_mips);
  // wnr_ticks = start_ticks;
  // TRACE(2,"[%s] WNR frame takes %d ms.", __func__,
  // FAST_TICKS_TO_MS((start_ticks - pre_ticks)*100));
  pre_ticks = start_ticks;
#endif
  return 0;
}

#if defined(ANC_ASSIST_PILOT_ENABLED)
static uint32_t anc_assist_playback_callback(uint8_t *buf, uint32_t len) {
  get_pilot_data(buf, len);
  // TRACE(2,"playing data %d",len);
  return 0;
}
#endif

static void _open_mic_anc_assist(void) {

  int anc_assist_mic_num = 0;

#if defined(ANC_ASSIST_PILOT_ENABLED)
  anc_assist_mic_num = anc_assist_mic_num | ANC_ASSIST_FB_MIC;
#endif

#if defined(ANC_ASSIST_HESS_ENABLED) ||                                        \
    defined(ANC_ASSIST_NOISE_ADAPTIVE_ENABLED)
  anc_assist_mic_num = anc_assist_mic_num | ANC_ASSIST_FF1_MIC;
#endif

#if defined(ANC_ASSIST_PNC_ENABLED)
  anc_assist_mic_num =
      anc_assist_mic_num | ANC_ASSIST_FF1_MIC | ANC_ASSIST_FB_MIC;
#endif

#if defined(ANC_ASSIST_DEHOWLING_ENABLED)
  anc_assist_mic_num =
      anc_assist_mic_num | ANC_ASSIST_FF1_MIC | ANC_ASSIST_FB_MIC;
#endif

#if defined(ANC_ASSIST_WNR_ENABLED)
  anc_assist_mic_num =
      anc_assist_mic_num | ANC_ASSIST_FF1_MIC | ANC_ASSIST_FF2_MIC;
#endif

  switch (anc_assist_mic_num) {
  case (0): {
    TRACE(2, "[%s] no mic is used", __func__);
    return;
  } break;
  case (1): {
    TRACE(2, "[%s] use fb mic only", __func__);
    MIC_NUM = 3;
    MIC_MAP = AUD_INPUT_PATH_AF_ANC;

  } break;
  case (4): {
    TRACE(2, "[%s] use ff mic only", __func__);
    MIC_NUM = 3;
    MIC_MAP = AUD_INPUT_PATH_ANC_WNR;

  } break;
  case (5): {
    TRACE(2, "[%s] use ff mic and fb mic", __func__);
    MIC_NUM = 3;
    MIC_MAP = AUD_INPUT_PATH_ANC_WNR;

  } break;
  case (6): {
    TRACE(2, "[%s] use ff1 mic and ff2 mic", __func__);
    MIC_NUM = 2;
    MIC_MAP = AUD_INPUT_PATH_AF_ANC;

  } break;
  case (7): {
    TRACE(2, "[%s] use ff1 mic and ff2 mic and fb mic", __func__);
    MIC_NUM = 2;
    MIC_MAP = AUD_INPUT_PATH_AF_ANC;

  } break;

  default: {
    TRACE(2, "[%s] invalid mic order is used", __func__);
  } break;
  }

  MIC_NUM = 3;
  MIC_MAP = AUD_INPUT_PATH_AF_ANC;
  struct AF_STREAM_CONFIG_T stream_cfg;
  TRACE(1, "[%s] ...", __func__);

  memset(&stream_cfg, 0, sizeof(stream_cfg));
  stream_cfg.channel_num = (enum AUD_CHANNEL_NUM_T)MIC_NUM;
  stream_cfg.sample_rate = (enum AUD_SAMPRATE_T)_SAMPLE_RATE;
  stream_cfg.bits = (enum AUD_BITS_T)_SAMPLE_BITS;
  stream_cfg.vol = 12;
  stream_cfg.chan_sep_buf = false;
  stream_cfg.device = AUD_STREAM_USE_INT_CODEC;
  stream_cfg.io_path = (enum AUD_IO_PATH_T)MIC_MAP;
  stream_cfg.handler = anc_assist_callback;
  stream_cfg.data_size = _FRAME_LEN * SAMPLE_BYTES * 2 * MIC_NUM;
  stream_cfg.data_ptr = af_stream_buff;
  ASSERT(stream_cfg.channel_num == MIC_NUM,
         "[%s] channel number(%d) is invalid.", __func__,
         stream_cfg.channel_num);
  TRACE(2, "[%s] sample_rate:%d, data_size:%d", __func__,
        stream_cfg.sample_rate, stream_cfg.data_size);
  TRACE(2, "[%s] af_stream_buff = %p", __func__, af_stream_buff);

  af_stream_open(ANC_ADPT_STREAM_ID, AUD_STREAM_CAPTURE, &stream_cfg);
  af_stream_start(ANC_ADPT_STREAM_ID, AUD_STREAM_CAPTURE);

#if defined(ANC_ASSIST_PILOT_ENABLED)
  // struct AF_STREAM_CONFIG_T stream_cfg;
  TRACE(1, "[%s] set play ...", __func__);

  memset(&stream_cfg, 0, sizeof(stream_cfg));

  stream_cfg.bits = (enum AUD_BITS_T)_SAMPLE_BITS;
  stream_cfg.channel_num = AUD_CHANNEL_NUM_1;
  stream_cfg.sample_rate = (enum AUD_SAMPRATE_T)_PLAY_SAMPLE_RATE;

  stream_cfg.device = AUD_STREAM_USE_INT_CODEC;
  stream_cfg.io_path = AUD_OUTPUT_PATH_SPEAKER;
  stream_cfg.vol = 15;

  stream_cfg.handler = anc_assist_playback_callback;
  stream_cfg.data_ptr = af_play_stream_buff;
  stream_cfg.data_size = sizeof(af_play_stream_buff);

  af_stream_open(ANC_ADPT_STREAM_ID, AUD_STREAM_PLAYBACK, &stream_cfg);
  af_stream_start(ANC_ADPT_STREAM_ID, AUD_STREAM_PLAYBACK);
#endif
}

static void _close_mic_anc_assist() {
  TRACE(1, "[%s] ...", __func__);

  af_stream_stop(ANC_ADPT_STREAM_ID, AUD_STREAM_CAPTURE);
  af_stream_close(ANC_ADPT_STREAM_ID, AUD_STREAM_CAPTURE);
  if (g_anc_assist_mode == ANC_ASSIST_STANDALONE ||
      g_anc_assist_mode == ANC_ASSIST_MUSIC) {
    // close capture
  }
  // destroy
}


================================================
FILE: apps/anc/src/anc_wnr.c
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#include "app_utils.h"
#include "string.h"

#include "anc_process.h"
#include "audioflinger.h"
#include "hal_aud.h"
#include "hal_timer.h"
#include "hal_trace.h"
#include "hwtimer_list.h"
//#include "audio_dump.h"
//#include "anc_usb_app.h"

#include "anc_wnr.h"
#include "app_ibrt_keyboard.h"
#include "app_ibrt_ui.h"
#include "app_thread.h"
#include "bt_drv_interface.h"
#include "cmsis_os.h"
#include "speech_cfg.h"
#include "wind_detection_2mic.h"

#if defined(SPEECH_TX_24BIT)
#define _24BITS_ENABLE
#endif

// Wind detection algorithm
#define _SAMPLE_RATE (8000)
#define _FRAME_LEN (60)
#define _CHANNEL_NUM (2)

#if defined(_24BITS_ENABLE)
#define _SAMPLE_BITS (24)
typedef int WNR_PCM_T;
#else
#define _SAMPLE_BITS (16)
typedef short WNR_PCM_T;
#endif

#define SAMPLE_BYTES sizeof(WNR_PCM_T)

#define _FRAME_LEN_MAX (128)
#define _SAMPLE_BITS_MAX (32)
#define WINDINDICATOR_SIZE (10)
#define _LOOP_CNT (3)

// ff gain coefficient tunning
#define _NO_WIND_FF_GAIN_COEF (1.0)
#define _SMALL_WIND_FF_GAIN_COEF (0.5)
#define _STRONG_WIND_FF_GAIN_COEF (0.0)
#define _STRONG2SMALL_WIND_FF_MID_GAIN_COEF (0.25)
#define _SMALL2NO_WIND_FF_MID_GAIN_COEF (0.75)

// wind indictor threshold
#define _NO_WIND_THD (0.75)
#define _SMALL_WIND_THD (0.55)
#define _STRONG_WIND_THD (0.45)

// energy threshold
#define _POWER_THD (0.1)

// ff close time
#define _PERIOD (12)
#define _TARGET_TIME (4)

//#define TEST_MIPS
#ifdef TEST_MIPS
static uint32_t pre_ticks = 0;
static uint32_t start_ticks = 0;
static uint32_t end_ticks = 0;
static uint32_t used_mips = 0;
#endif

WindDetection2MicState *wind_st = NULL;

static WindDetection2MicConfig wind_cfg = {
    .bypass = 0,
    .power_thd = _POWER_THD,
};
// static uint8_t heap_buf[1024 * 12];

// Wind factor process

extern bool app_anc_work_status(void);

// Mic operation
#define ANC_WNR_STREAM_ID AUD_STREAM_ID_0
static anc_wnr_open_mode_t g_open_mode = ANC_WNR_OPEN_MODE_QTY;
// 2ch, pingpong
#define AF_STREAM_BUFF_SIZE (_FRAME_LEN * SAMPLE_BYTES * 2 * 2)
static uint8_t __attribute__((aligned(4)))
af_stream_buff[AF_STREAM_BUFF_SIZE * _LOOP_CNT];
static uint8_t __attribute__((aligned(4)))
af_stream_mic1[_FRAME_LEN_MAX * (_SAMPLE_BITS_MAX / 8)];
static uint8_t __attribute__((aligned(4)))
af_stream_mic2[_FRAME_LEN_MAX * (_SAMPLE_BITS_MAX / 8)];

static int32_t g_sample_rate = _SAMPLE_RATE;
static int32_t g_frame_len = _FRAME_LEN;

static void _open_mic(void);
static void _close_mic(void);

#define WNR_SYNC_COUNTER_THRESHOLD_FOR_SCO 18    // talk:180ms * 18 = 3240ms
#define WNR_SYNC_COUNTER_THRESHOLD_FOR_NORMAL 35 // normal:90ms * 35 = 3150ms

// if not need to set ANC FF GAIN by trigger delay way, set macro to 0.
#define WNR_SYNC_TRIGGER_DELAY 300 // unit:ms

// if not need to printf information about sync, set macro to 0.
#define WNR_SYNC_DEBUG_LOG 1

// default disable twostage mode so that reduce delay to set ANC FF GAIN, also
// to simplify code. in order to avoid pop voice, recommend to enable twostage
// mode if chip is based on 1303 lower platform. if need to use twostage mode to
// set ANC FF GAIN, set macro to 1.
#define WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE 0

#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
#define WNR_SYNC_TWOSTAGE_DELAY 300 // unit:tick
uint8_t Twostage = 0;
uint8_t FFstate = 0;
#endif

static void app_wnr_sync_timer_handler(void const *param);
osTimerDef(APP_WNR_SYNC_TIMER, app_wnr_sync_timer_handler);
static osTimerId app_wnr_sync_timer = NULL;

#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
static void app_wnr_twostage_handler(void const *param);
osTimerDef(APP_WNR_TWOSTAGE_TIMER, app_wnr_twostage_handler);
static osTimerId app_wnr_twostage_timer = NULL;
#endif

uint8_t g_wind_st = 0;
uint8_t cnt = 0;
uint8_t period = 12;
float windsum = 0.0;
float wind_indictor = 0.0;
static uint8_t g_set_Windstate = 0;
static uint8_t g_local_Windstate = 0;
static uint8_t g_peer_Windstate = 0;
static bool g_local_Wind_module_onoff = false;
static bool g_peer_Wind_module_onoff = false;
static uint8_t wnr_sync_counter_for_sco = 0;
static uint8_t wnr_sync_counter_for_normal = 0;
static anc_wnr_open_mode_t g_wnr_open_mode = ANC_WNR_OPEN_MODE_QTY;
static bool g_wnr_notify_flag = false;
static bool g_wnr_request_flag = false;
static bool g_wnr_sync_flag = false;

struct anc_wnr_state_queue_t {
  uint8_t buf_for_sco[WNR_SYNC_COUNTER_THRESHOLD_FOR_SCO];
  uint8_t buf_for_normal[WNR_SYNC_COUNTER_THRESHOLD_FOR_NORMAL];
  uint8_t index_for_sco;
  uint8_t index_for_normal;
  uint8_t number_for_sco;
  uint8_t number_for_normal;
} g_anc_wnr_state_queue;
float windindicator[WINDINDICATOR_SIZE] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
float windthd[3] = {
    _NO_WIND_THD, _SMALL_WIND_THD,
    _STRONG_WIND_THD}; //{0.75,0.35,0.30};//{0.75,0.40,0.35};{0.75,0.45,0.40};{0.75,0.50,0.45};

#ifndef HW_SUPPORT_SMOOOTHING_GAIN
#define ANC_TCTRL_NUM 2
#define ANC_TIMER_PERIOD_GAIN 50
#define TIMER_CNT 20

struct anc_tuning_ctrl {
  uint8_t timer_init;
  uint8_t timer_ff_gain_run;
  const struct_anc_cfg *cfg;
  enum ANC_TYPE_T type;
  HWTIMER_ID timer_ff_gain_id;
};

static struct anc_tuning_ctrl anc_tctrl;

static uint32_t timer_cnt = 0;
static bool ff_smoothing_flag = false;
#endif

static int32_t anc_ff_gain_l = 512;
static int32_t anc_ff_gain_r = 512;
static int32_t tgt_ff_gain_l, tgt_ff_gain_r;
static int32_t pre_ff_gain_l, pre_ff_gain_r;

#ifndef HW_SUPPORT_SMOOOTHING_GAIN
static int32_t delta_ff_gain_l, delta_ff_gain_r;
#endif

#ifndef HW_SUPPORT_SMOOOTHING_GAIN
void anc_gain_tuning_init(void) {
  timer_cnt = 0;
  ff_smoothing_flag = false;
}

static void anc_tuning_ff_gain_timer_timeout(void *param) {
  timer_cnt++;
  int32_t ff_gain_l = 0;
  int32_t ff_gain_r = 0;
  if ((timer_cnt < delta_ff_gain_l) || (timer_cnt < delta_ff_gain_r)) {
    if (pre_ff_gain_l < tgt_ff_gain_l) {
      pre_ff_gain_l = pre_ff_gain_l + 1;
      ff_gain_l = pre_ff_gain_l;
    } else if (pre_ff_gain_l > tgt_ff_gain_l) {
      pre_ff_gain_l = pre_ff_gain_l - 1;
      ff_gain_l = pre_ff_gain_l;
    }

    if (pre_ff_gain_r < tgt_ff_gain_r) {
      pre_ff_gain_r = pre_ff_gain_r + 1;
      ff_gain_r = pre_ff_gain_r;
    } else if (pre_ff_gain_r > tgt_ff_gain_r) {
      pre_ff_gain_r = pre_ff_gain_r - 1;
      ff_gain_r = pre_ff_gain_r;
    }

    anc_set_gain(ff_gain_l, ff_gain_r, ANC_FEEDFORWARD);
    TRACE(3, "[%s] ff_gain_l = %d, ff_gain_r = %d", __func__, ff_gain_l,
          ff_gain_r);

    struct anc_tuning_ctrl *c = (struct anc_tuning_ctrl *)param;
    hwtimer_start(c->timer_ff_gain_id, US_TO_TICKS(ANC_TIMER_PERIOD_GAIN));
    ff_smoothing_flag = 1;
  } else {
    anc_set_gain(tgt_ff_gain_l, tgt_ff_gain_r, ANC_FEEDFORWARD);
    ff_smoothing_flag = 0;
  }
}
#endif

static void _set_anc_ff_gain(bool update_anc_gain, float gain_coef,
                             enum ANC_TYPE_T type) {

#ifdef HW_SUPPORT_SMOOOTHING_GAIN
  if (update_anc_gain) {
    anc_get_gain(&pre_ff_gain_l, &pre_ff_gain_r, ANC_FEEDFORWARD);
    anc_ff_gain_l = pre_ff_gain_l;
    anc_ff_gain_r = pre_ff_gain_r;
    TRACE(3, "[%s] Update anc_gain_l = %d, anc_gain_r = %d.", __func__,
          anc_ff_gain_l, anc_ff_gain_r);
  }
  tgt_ff_gain_l = (int32_t)(anc_ff_gain_l * gain_coef);
  tgt_ff_gain_r = (int32_t)(anc_ff_gain_r * gain_coef);
  TRACE(3, "[%s] tgt_ff_gain_l = %d, tgt_ff_gain_r = %d.", __func__,
        tgt_ff_gain_l, tgt_ff_gain_r);
  anc_set_gain(tgt_ff_gain_l, tgt_ff_gain_r, ANC_FEEDFORWARD);
#else
  struct anc_tuning_ctrl *c = &anc_tctrl;
  // uint32_t cur_time = TICKS_TO_MS(hal_sys_timer_get());

  // reset timer
  if (c->timer_ff_gain_run) {
    hwtimer_stop(c->timer_ff_gain_id);
  }
  anc_get_gain(&pre_ff_gain_l, &pre_ff_gain_r, ANC_FEEDFORWARD);
  TRACE(3, "[%s] pre_ff_gain_l = %d, pre_ff_gain_r = %d.", __func__,
        pre_ff_gain_l, pre_ff_gain_r);
  if (update_anc_gain && !ff_smoothing_flag) {
    anc_ff_gain_l = pre_ff_gain_l;
    anc_ff_gain_r = pre_ff_gain_r;
    TRACE(3, "[%s] Update anc_gain_l = %d, anc_gain_r = %d.", __func__,
          anc_ff_gain_l, anc_ff_gain_r);
  }
  tgt_ff_gain_l = (int32_t)(anc_ff_gain_l * gain_coef);
  tgt_ff_gain_r = (int32_t)(anc_ff_gain_r * gain_coef);
  delta_ff_gain_l = abs(tgt_ff_gain_l - pre_ff_gain_l);
  delta_ff_gain_r = abs(tgt_ff_gain_r - pre_ff_gain_r);
  TRACE(3, "[%s] tgt_ff_gain_l = %d, tgt_ff_gain_r = %d.", __func__,
        tgt_ff_gain_l, tgt_ff_gain_r);

  timer_cnt = 0;

  // timer restart
  hwtimer_start(c->timer_ff_gain_id, MS_TO_TICKS(ANC_TIMER_PERIOD_GAIN));
  c->timer_ff_gain_run = 1;
  // set gain directly
  // anc_set_gain(gain_ch_l, gain_ch_r, type);

  // AUD_TRACE(TRACE_MASK_INFO, "set anc gain :[%d], gain_ch_l=%d, gian_ch_r=%d,
  // type=%d", cur_time, gain_ch_l, gain_ch_r, (int)type);
#endif
}

void anc_release_gain(void) {
  TRACE(1, "[%s] ...Release FF gain", __func__);

  _set_anc_ff_gain(false, 1, ANC_FEEDFORWARD);
}

int32_t anc_wnr_ctrl(int32_t sample_rate, int32_t frame_len) {
  TRACE(3, "[%s] sample_rate = %d, frame_len = %d", __func__, sample_rate,
        frame_len);

  g_sample_rate = sample_rate;
  g_frame_len = frame_len;

  if (g_sample_rate == 16000) {
    g_frame_len >>= 1;
  }

  return 0;
}

static void app_wnr_reset_state_queue(void) {
  g_anc_wnr_state_queue.index_for_normal = 0;
  g_anc_wnr_state_queue.index_for_sco = 0;
  g_anc_wnr_state_queue.number_for_normal = 0;
  g_anc_wnr_state_queue.number_for_sco = 0;
  memset(g_anc_wnr_state_queue.buf_for_normal, 0,
         WNR_SYNC_COUNTER_THRESHOLD_FOR_NORMAL);
  memset(g_anc_wnr_state_queue.buf_for_sco, 0,
         WNR_SYNC_COUNTER_THRESHOLD_FOR_SCO);
}
static void app_wnr_push_state_to_queue(uint8_t open_mode, uint8_t arg0) {
  if (open_mode == ANC_WNR_OPEN_MODE_STANDALONE) // normal mode...
  {
    g_anc_wnr_state_queue
        .buf_for_normal[g_anc_wnr_state_queue.index_for_normal] = arg0;

    if (++g_anc_wnr_state_queue.index_for_normal >=
        WNR_SYNC_COUNTER_THRESHOLD_FOR_NORMAL) {
      g_anc_wnr_state_queue.index_for_normal = 0;
    }

    if (g_anc_wnr_state_queue.number_for_normal <
        WNR_SYNC_COUNTER_THRESHOLD_FOR_NORMAL) {
      g_anc_wnr_state_queue.number_for_normal++;
    }
  } else // sco mode...
  {
    g_anc_wnr_state_queue.buf_for_sco[g_anc_wnr_state_queue.index_for_sco] =
        arg0;

    if (++g_anc_wnr_state_queue.index_for_sco >=
        WNR_SYNC_COUNTER_THRESHOLD_FOR_SCO) {
      g_anc_wnr_state_queue.index_for_sco = 0;
    }

    if (g_anc_wnr_state_queue.number_for_sco <
        WNR_SYNC_COUNTER_THRESHOLD_FOR_SCO) {
      g_anc_wnr_state_queue.number_for_sco++;
    }
  }
}
static uint8_t app_wnr_get_state_from_queue(uint8_t open_mode) {
  uint8_t counter0 = 0;
  uint8_t counter1 = 0;
  uint8_t counter2 = 0;

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(2, "[%s] open_mode:%d", __func__, open_mode);
  TRACE(2, "[%s] index_for_normal:%d", __func__,
        g_anc_wnr_state_queue.index_for_normal);
  TRACE(2, "[%s] index_for_sco:%d", __func__,
        g_anc_wnr_state_queue.index_for_sco);
  TRACE(2, "[%s] number_for_normal:%d", __func__,
        g_anc_wnr_state_queue.number_for_normal);
  TRACE(2, "[%s] number_for_sco:%d", __func__,
        g_anc_wnr_state_queue.number_for_sco);
  TRACE(1, "[%s] buf_for_normal:", __func__);
  DUMP8("%d ", g_anc_wnr_state_queue.buf_for_normal,
        g_anc_wnr_state_queue.number_for_normal);
  TRACE(1, "[%s] buf_for_sco:", __func__);
  DUMP8("%d ", g_anc_wnr_state_queue.buf_for_sco,
        g_anc_wnr_state_queue.number_for_sco);
#endif

  if (open_mode == ANC_WNR_OPEN_MODE_STANDALONE) // normal mode...
  {
    for (uint8_t i = 0; i < g_anc_wnr_state_queue.number_for_normal; i++) {
      if (g_anc_wnr_state_queue.buf_for_normal[i] == 0) {
        counter0++;
        continue;
      }
      if (g_anc_wnr_state_queue.buf_for_normal[i] == 1) {
        counter1++;
        continue;
      }
      if (g_anc_wnr_state_queue.buf_for_normal[i] == 2) {
        counter2++;
        continue;
      }
    }
  } else // sco mode...
  {
    for (uint8_t i = 0; i < g_anc_wnr_state_queue.number_for_sco; i++) {
      if (g_anc_wnr_state_queue.buf_for_sco[i] == 0) {
        counter0++;
        continue;
      }
      if (g_anc_wnr_state_queue.buf_for_sco[i] == 1) {
        counter1++;
        continue;
      }
      if (g_anc_wnr_state_queue.buf_for_sco[i] == 2) {
        counter2++;
        continue;
      }
    }
  }

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(3, "counter0:%d counter1:%d counter2:%d", counter0, counter1, counter2);
#endif

  if (counter0 >= counter1) {
    if (counter0 >= counter2) {
      return 0;
    } else {
      return 2;
    }
  } else {
    if (counter1 >= counter2) {
      return 1;
    } else {
      return 2;
    }
  }
}
static void app_wnr_trigger_internal_event(uint32_t evt, uint32_t arg0,
                                           uint32_t arg1, uint32_t arg2) {
  APP_MESSAGE_BLOCK msg;
#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(5, "[%s] evt:%d arg0:%d arg1:%d arg2:%d", __func__, evt, arg0, arg1,
        arg2);
#endif
  msg.mod_id = APP_MODUAL_WNR;
  msg.msg_body.message_id = evt;
  msg.msg_body.message_Param0 = arg0;
  msg.msg_body.message_Param1 = arg1;
  msg.msg_body.message_Param2 = arg2;
  app_mailbox_put(&msg);
}
static void app_wnr_share_module_info(void) {
  uint8_t buf[3] = {0};

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(2, "[%s] local_module_onoff:%d", __func__, g_local_Wind_module_onoff);
#endif

  buf[0] = IBRT_ACTION_SYNC_WNR;
  buf[1] = (uint8_t)APP_WNR_SHARE_MODULE_INFO;
  buf[2] = (uint8_t)g_local_Wind_module_onoff;

  app_ibrt_ui_send_user_action(buf, 3);
}
void app_wnr_sync_state(void) {
#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(1, "[%s] enter...", __func__);
#endif

  wnr_sync_counter_for_sco = 0;
  wnr_sync_counter_for_normal = 0;
  g_wnr_notify_flag = false;
  g_wnr_request_flag = false;
  g_peer_Wind_module_onoff = false;
  g_peer_Windstate = 0;

  if (g_local_Wind_module_onoff == true) {
    g_wnr_sync_flag = true;
  }
}

#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
static void app_wnr_twostage_handler(void const *param) {
  float gain_coef = 0.0;

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(1, "[%s] enter...", __func__);
#endif

  if ((Twostage == 1) && (FFstate == 7)) {
    FFstate = 1; // 25%->50%
    Twostage = 0;
    gain_coef = _SMALL_WIND_FF_GAIN_COEF;
    _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);

    TRACE(1, "[%s] Enable 0.5 FF ANC.", __func__);
  } else if ((Twostage == 1) && (FFstate == 6)) {
    FFstate = 0; // 75%->100%
    Twostage = 0;
    gain_coef = _NO_WIND_FF_GAIN_COEF;
    _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);
    TRACE(1, "[%s] Enable FF ANC.", __func__);
  }
}
#endif

static void app_wnr_sync_timer_handler(void const *param) {
  uint8_t temp = *((uint8_t *)param);
#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(2, "[%s] arg0:%d", __func__, temp);
#endif

  if (g_local_Wind_module_onoff == true)
    app_wnr_trigger_internal_event(APP_WNR_EXCUTE_TRIGGER, (uint32_t)temp, 0,
                                   0);
}
static void app_wnr_notify_detect_result(void) {
  uint8_t buf[3] = {0};

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(2, "[%s] local_Windstate:%d", __func__, g_local_Windstate);
#endif
  g_wnr_sync_flag = false;
  g_wnr_notify_flag = true;

  buf[0] = IBRT_ACTION_SYNC_WNR;
  buf[1] = (uint8_t)APP_WNR_NOTIFY_DETECT_RESULT;
  buf[2] = g_local_Windstate;

  app_ibrt_ui_send_user_action(buf, 3);
}
static void app_wnr_request_detect_result(void) {
  uint8_t buf[3] = {0};

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(2, "[%s] local_Windstate:%d", __func__, g_local_Windstate);
#endif
  g_wnr_sync_flag = false;
  g_wnr_request_flag = true;

  buf[0] = IBRT_ACTION_SYNC_WNR;
  buf[1] = (uint8_t)APP_WNR_REQUEST_DETECT_RESULT;
  buf[2] = g_local_Windstate;

  app_ibrt_ui_send_user_action(buf, 3);
}
static void app_wnr_response_detect_result(uint32_t arg0) {
  uint8_t buf[3] = {0};

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(1, "[%s] enter...", __func__);
#endif

  if (g_wnr_notify_flag == true) {
    g_wnr_notify_flag = false;
    return;
  }

  g_wnr_sync_flag = false;
  g_local_Windstate = app_wnr_get_state_from_queue(g_wnr_open_mode);
  g_peer_Windstate = (uint8_t)arg0;

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(3, "[%s] local_Windstate:%d peer_Windstate:%d", __func__,
        g_local_Windstate, g_peer_Windstate);
#endif

  buf[0] = IBRT_ACTION_SYNC_WNR;
  buf[1] = (uint8_t)APP_WNR_RESPONSE_DETECT_RESULT;
  buf[2] = g_local_Windstate;

  app_ibrt_ui_send_user_action(buf, 3);
}
static void app_wnr_process_detect_result(uint32_t arg0) {
  if (g_wnr_request_flag == false) {
    g_local_Windstate = app_wnr_get_state_from_queue(g_wnr_open_mode);
  }

  g_wnr_sync_flag = false;
  g_wnr_request_flag = false;
  g_peer_Windstate = (uint8_t)arg0;

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(3, "[%s] local_Windstate:%d peer_wnr_state:%d", __func__,
        g_local_Windstate, arg0);
#endif

  if (g_local_Windstate >= g_peer_Windstate) {
    if (g_local_Wind_module_onoff == true)
      app_wnr_trigger_internal_event(APP_WNR_SET_TRIGGER,
                                     (uint32_t)g_local_Windstate, 0, 0);
  } else {
    if (g_local_Wind_module_onoff == true)
      app_wnr_trigger_internal_event(APP_WNR_SET_TRIGGER,
                                     (uint32_t)g_peer_Windstate, 0, 0);
  }
}
static void app_wnr_set_trigger(uint32_t arg0, uint32_t arg1) {
  ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();
  uint32_t current_ticks = 0;

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(2, "[%s] set_Windstate:%d", __func__, arg0);
#endif

  if ((app_tws_ibrt_tws_link_connected() == true) &&
      (p_ibrt_ctrl->nv_role == IBRT_MASTER) &&
      (g_peer_Wind_module_onoff == true)) {
    uint8_t buf[7] = {0};
    current_ticks = bt_syn_get_curr_ticks(p_ibrt_ctrl->tws_conhandle);
    uint32_t tg_ticks = current_ticks + MS_TO_TICKS(WNR_SYNC_TRIGGER_DELAY);

#if (WNR_SYNC_DEBUG_LOG == 1)
    TRACE(3, "[%s] current_ticks:%d tg_ticks:%d", __func__, current_ticks,
          tg_ticks);
#endif

    buf[0] = IBRT_ACTION_SYNC_WNR;
    buf[1] = (uint8_t)APP_WNR_SET_TRIGGER;
    buf[2] = (uint8_t)arg0;
    buf[3] = (uint8_t)((tg_ticks & 0xff000000) >> 24);
    buf[4] = (uint8_t)((tg_ticks & 0x00ff0000) >> 16);
    buf[5] = (uint8_t)((tg_ticks & 0x0000ff00) >> 8);
    buf[6] = (uint8_t)(tg_ticks & 0x000000ff);

    app_ibrt_ui_send_user_action(buf, 7);

    if ((app_wnr_sync_timer != NULL) && (tg_ticks != current_ticks)) {
      g_set_Windstate = (uint8_t)arg0;
      osTimerStop(app_wnr_sync_timer);
      osTimerStart(app_wnr_sync_timer, WNR_SYNC_TRIGGER_DELAY);
    } else {
      if (g_local_Wind_module_onoff == true)
        app_wnr_trigger_internal_event(APP_WNR_EXCUTE_TRIGGER, arg0, 0, 0);
    }
    return;
  }

  if ((app_tws_ibrt_tws_link_connected() == true) &&
      (p_ibrt_ctrl->nv_role == IBRT_SLAVE) &&
      (g_peer_Wind_module_onoff == true)) {
    g_wnr_notify_flag = false;
    current_ticks = bt_syn_get_curr_ticks(p_ibrt_ctrl->tws_conhandle);

#if (WNR_SYNC_DEBUG_LOG == 1)
    TRACE(3, "[%s] current_ticks:%d tg_ticks:%d", __func__, current_ticks,
          arg1);
#endif

    if (arg1 > current_ticks) {
      uint32_t diff_ticks = arg1 - current_ticks;

      g_set_Windstate = (uint8_t)arg0;
      if (app_wnr_sync_timer != NULL) {
        osTimerStop(app_wnr_sync_timer);
        osTimerStart(app_wnr_sync_timer, TICKS_TO_MS(diff_ticks));
      }
    } else {
#if (WNR_SYNC_DEBUG_LOG == 1)
      TRACE(1, "[%s] tg_ticks < current_ticks...", __func__);
#endif
      if (g_local_Wind_module_onoff == true)
        app_wnr_trigger_internal_event(APP_WNR_EXCUTE_TRIGGER, arg0, 0, 0);
    }
    return;
  }

  if ((app_tws_ibrt_tws_link_connected() == false) ||
      (g_peer_Wind_module_onoff == false)) {
    if (g_local_Wind_module_onoff == true)
      app_wnr_trigger_internal_event(APP_WNR_EXCUTE_TRIGGER, arg0, 0, 0);
    return;
  }
}

static void app_wnr_excute_trigger(uint32_t arg0) {
  uint8_t t_Windstate = (uint8_t)arg0;
  float gain_coef = 0.0;

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(3, "[%s] last_Windstate:%d set_Windstate:%d", __func__, g_wind_st,
        t_Windstate);
#endif

  if ((t_Windstate != g_wind_st) && (app_anc_work_status())) {
    if (g_wind_st > t_Windstate) {
#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
      Twostage = 1;
#endif
      if (t_Windstate == 1) {
#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
        FFstate = 7; // 25%
        gain_coef = _STRONG2SMALL_WIND_FF_MID_GAIN_COEF;
        _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);
        TRACE(1, "[%s] Enable 0.25 FF ANC.", __func__);
#else
        gain_coef = _SMALL_WIND_FF_GAIN_COEF;
        _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);
        TRACE(1, "[%s] Enable 0.5 FF ANC.", __func__);
#endif
      } // 2->1 0%->25%->50%
      else if (t_Windstate == 0) {
#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
        FFstate = 6; // 75%
        gain_coef = _SMALL2NO_WIND_FF_MID_GAIN_COEF;
        _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);
        TRACE(1, "[%s] Enable 0.75 FF ANC.", __func__);
#else
        gain_coef = _NO_WIND_FF_GAIN_COEF;
        _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);
        TRACE(1, "[%s] Enable FF ANC.", __func__);
#endif
      } // 1->0 50%->75%->100%
    } else {
      if (t_Windstate == 2) // 0%
      {
#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
        FFstate = 2;
#endif
        gain_coef = _STRONG_WIND_FF_GAIN_COEF;
        _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);
        TRACE(1, "[%s] Disable FF ANC.", __func__);
      } else if (t_Windstate == 1) // 50%
      {
#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
        FFstate = 1;
#endif
        gain_coef = _SMALL_WIND_FF_GAIN_COEF;
        _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);
        TRACE(1, "[%s] Enable 0.5 FF ANC.", __func__);
      } else {
#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
        FFstate = 0;
#endif
        gain_coef = _NO_WIND_FF_GAIN_COEF;
        _set_anc_ff_gain(false, gain_coef, ANC_FEEDFORWARD);
        TRACE(1, "[%s] Enable FF ANC.", __func__);
      }
    }

    g_wind_st = t_Windstate;
  }

#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
  if (((Twostage == 1) && (FFstate == 7)) ||
      ((Twostage == 1) && (FFstate == 6))) {
    if (app_wnr_twostage_timer != NULL) {
      osTimerStop(app_wnr_twostage_timer);
      osTimerStart(app_wnr_twostage_timer, WNR_SYNC_TWOSTAGE_DELAY);
    }
  }
#endif
}

static int app_wnr_internal_event_process(APP_MESSAGE_BODY *msg_body) {
  uint32_t evt = msg_body->message_id;
  uint32_t arg0 = msg_body->message_Param0;
  uint32_t arg1 = msg_body->message_Param1;

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(4, "[%s] evt:%d arg0:%d arg1:%d", __func__, evt, arg0, arg1);
#endif

  wnr_sync_counter_for_sco = 0;
  wnr_sync_counter_for_normal = 0;

  switch (evt) {
  case APP_WNR_NOTIFY_DETECT_RESULT:
    app_wnr_notify_detect_result();
    break;
  case APP_WNR_REQUEST_DETECT_RESULT:
    app_wnr_request_detect_result();
    break;
  case APP_WNR_RESPONSE_DETECT_RESULT:
    app_wnr_response_detect_result(arg0);
    break;
  case APP_WNR_PROCESS_DETECT_RESULT:
    app_wnr_process_detect_result(arg0);
    break;
  case APP_WNR_SET_TRIGGER:
    app_wnr_set_trigger(arg0, arg1);
    break;
  case APP_WNR_EXCUTE_TRIGGER:
    app_wnr_excute_trigger(arg0);
    break;
  default:
    TRACE(2, "[%s] invalid evt:%d", __func__, evt);
    break;
  }

  return 0;
}

void app_wnr_cmd_receive_process(uint8_t *p_buff, uint16_t length) {
  ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();

#if (WNR_SYNC_DEBUG_LOG == 1)
  TRACE(1, "[%s] enter...", __func__);
#endif

  if ((p_buff[0] == IBRT_ACTION_SYNC_WNR) &&
      (p_buff[1] == APP_WNR_NOTIFY_DETECT_RESULT) &&
      (app_tws_ibrt_tws_link_connected() == true) &&
      (p_ibrt_ctrl->nv_role == IBRT_MASTER)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
    TRACE(1, "NOTIFY_DETECT_RESULT peer_wnr_state:%d", p_buff[2]);
#endif
    g_peer_Wind_module_onoff = true;
    if (g_local_Wind_module_onoff == true)
      app_wnr_trigger_internal_event(APP_WNR_PROCESS_DETECT_RESULT,
                                     (uint32_t)p_buff[2], 0, 0);
    return;
  }

  if ((p_buff[0] == IBRT_ACTION_SYNC_WNR) &&
      (p_buff[1] == APP_WNR_REQUEST_DETECT_RESULT) &&
      (app_tws_ibrt_tws_link_connected() == true) &&
      (p_ibrt_ctrl->nv_role == IBRT_SLAVE)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
    TRACE(1, "REQUEST_DETECT_RESULT peer_wnr_state:%d", p_buff[2]);
#endif
    g_peer_Wind_module_onoff = true;
    if (g_local_Wind_module_onoff == true)
      app_wnr_trigger_internal_event(APP_WNR_RESPONSE_DETECT_RESULT,
                                     (uint32_t)p_buff[2], 0, 0);
    return;
  }

  if ((p_buff[0] == IBRT_ACTION_SYNC_WNR) &&
      (p_buff[1] == APP_WNR_RESPONSE_DETECT_RESULT) &&
      (app_tws_ibrt_tws_link_connected() == true) &&
      (p_ibrt_ctrl->nv_role == IBRT_MASTER)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
    TRACE(1, "RESPONSE_DETECT_RESULT peer_wnr_state:%d", p_buff[2]);
#endif
    g_peer_Wind_module_onoff = true;
    if (g_local_Wind_module_onoff == true)
      app_wnr_trigger_internal_event(APP_WNR_PROCESS_DETECT_RESULT,
                                     (uint32_t)p_buff[2], 0, 0);
    return;
  }

  if ((p_buff[0] == IBRT_ACTION_SYNC_WNR) &&
      (p_buff[1] == APP_WNR_SET_TRIGGER) &&
      (app_tws_ibrt_tws_link_connected() == true) &&
      (p_ibrt_ctrl->nv_role == IBRT_SLAVE)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
    TRACE(1, "SET_TRIGGER set_Windstate:%d", p_buff[2]);
#endif
    uint32_t tg_ticks = 0;
    tg_ticks += p_buff[3];
    tg_ticks = tg_ticks << 8;
    tg_ticks += p_buff[4];
    tg_ticks = tg_ticks << 8;
    tg_ticks += p_buff[5];
    tg_ticks = tg_ticks << 8;
    tg_ticks += p_buff[6];
    if (g_local_Wind_module_onoff == true)
      app_wnr_trigger_internal_event(APP_WNR_SET_TRIGGER, (uint32_t)p_buff[2],
                                     tg_ticks, 0);
    return;
  }

  if ((p_buff[0] == IBRT_ACTION_SYNC_WNR) &&
      (p_buff[1] == APP_WNR_SHARE_MODULE_INFO)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
    TRACE(1, "APP_WNR_SHARE_MODULE_INFO peer_module_onoff:%d", p_buff[2]);
#endif
    g_peer_Wind_module_onoff = (bool)p_buff[2];

    if ((app_tws_ibrt_tws_link_connected() == true) &&
        (p_ibrt_ctrl->nv_role == IBRT_MASTER) &&
        (g_local_Wind_module_onoff == true) &&
        (g_peer_Wind_module_onoff == true)) {
      wnr_sync_counter_for_normal = 0;
      wnr_sync_counter_for_sco = 0;
      if (g_local_Wind_module_onoff == true) {
        g_wnr_sync_flag = true;
      }
      return;
    }
    if ((app_tws_ibrt_tws_link_connected() == true) &&
        (p_ibrt_ctrl->nv_role == IBRT_SLAVE) &&
        (g_local_Wind_module_onoff == true) &&
        (g_peer_Wind_module_onoff == true)) {
      wnr_sync_counter_for_normal = 0;
      wnr_sync_counter_for_sco = 0;
      if (g_local_Wind_module_onoff == true) {
        g_wnr_sync_flag = true;
      }
      return;
    }
    return;
  }
}

static bool wnr_open_flg = 0;
int32_t anc_wnr_open(anc_wnr_open_mode_t mode) {
  if (wnr_open_flg == 1) {
    return 0;
  }
  TRACE(4, "[%s] mode = %d, g_sample_rate = %d, g_frame_len = %d", __func__,
        mode, g_sample_rate, g_frame_len);

  hal_sysfreq_req(APP_SYSFREQ_USER_ANC_WNR, HAL_CMU_FREQ_26M);
  TRACE(2, "[%s] Sys freq: %d", __func__, hal_sys_timer_calc_cpu_freq(5, 0));

  app_wnr_reset_state_queue();
  app_set_threadhandle(APP_MODUAL_WNR, app_wnr_internal_event_process);
  g_local_Wind_module_onoff = true;
  if (app_wnr_sync_timer == NULL) {
    app_wnr_sync_timer = osTimerCreate(osTimer(APP_WNR_SYNC_TIMER), osTimerOnce,
                                       &g_set_Windstate);
  }
#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
  if (app_wnr_twostage_timer == NULL) {
    app_wnr_twostage_timer =
        osTimerCreate(osTimer(APP_WNR_TWOSTAGE_TIMER), osTimerOnce, NULL);
  }
#endif
  g_set_Windstate = 0;
  g_local_Windstate = 0;
  g_peer_Windstate = 0;
  g_wnr_notify_flag = false;
  g_wnr_request_flag = false;
  g_wnr_sync_flag = false;
  g_wind_st = 0;
  anc_ff_gain_l = 512;
  anc_ff_gain_r = 512;
  app_wnr_share_module_info();
  if (mode == ANC_WNR_OPEN_MODE_STANDALONE) {
    g_wnr_open_mode = ANC_WNR_OPEN_MODE_STANDALONE; // normal mode...
    wnr_sync_counter_for_normal = 0;
    wnr_sync_counter_for_sco = 0;
    g_sample_rate = _SAMPLE_RATE;
    g_frame_len = _FRAME_LEN;
    wind_st = WindDetection2Mic_create(_SAMPLE_RATE, _SAMPLE_BITS, _FRAME_LEN,
                                       &wind_cfg);

    _open_mic();

    // audio_dump_init(_FRAME_LEN, sizeof(short), 2);

  } else if (mode == ANC_WNR_OPEN_MODE_CONFIGURE) {
    g_wnr_open_mode = ANC_WNR_OPEN_MODE_CONFIGURE; // sco mode...
    wnr_sync_counter_for_sco = 0;
    wnr_sync_counter_for_normal = 0;
    ASSERT(g_sample_rate == 8000 || g_sample_rate == 16000,
           "[%s] g_sample_rate(%d) is invalid.", __func__, g_sample_rate);
    ASSERT(g_frame_len == 60 || g_frame_len == 120,
           "[%s] g_frame_len(%d) is invalid.", __func__, g_frame_len);

    wind_st = WindDetection2Mic_create(_SAMPLE_RATE, _SAMPLE_BITS, g_frame_len,
                                       &wind_cfg);

    // audio_dump_init(g_frame_len, sizeof(int), 2);

  } else {
    ASSERT(0, "[%s] mode(%d) is invalid.", __func__, mode);
  }

#ifndef HW_SUPPORT_SMOOOTHING_GAIN
  anc_gain_tuning_init();

  struct anc_tuning_ctrl *c = &anc_tctrl;

  if (!c->timer_init) {
    c->timer_ff_gain_id =
        hwtimer_alloc(anc_tuning_ff_gain_timer_timeout, (void *)c);
    c->timer_ff_gain_run = 0;
    c->timer_init = 1;
  }
#endif

  g_open_mode = mode;

  TRACE(1, "[%s] End...", __func__);
  wnr_open_flg = 1;
  return 0;
}

int32_t anc_wnr_close(void) {
  TRACE(1, "[%s] ...", __func__);

#ifndef HW_SUPPORT_SMOOOTHING_GAIN
  struct anc_tuning_ctrl *c = &anc_tctrl;
  if (c->timer_ff_gain_run) {
    hwtimer_stop(c->timer_ff_gain_id);
  }
  hwtimer_free(c->timer_ff_gain_id);
  c->timer_init = 0;
#endif

  if (g_open_mode == ANC_WNR_OPEN_MODE_STANDALONE) {
    _close_mic();
    g_open_mode = ANC_WNR_OPEN_MODE_QTY;
  }

  WindDetection2Mic_destroy(wind_st);

  // size_t total = 0, used = 0, max_used = 0;
  // speech_memory_info(&total, &used, &max_used);
  // TRACE(3,"ANC WNR MALLOC MEM: total - %d, used - %d, max_used - %d.", total,
  // used, max_used); ASSERT(used == 0, "[%s] used != 0", __func__);
  app_wnr_reset_state_queue();
  app_set_threadhandle(APP_MODUAL_WNR, NULL);
  g_local_Wind_module_onoff = false;
  if (app_wnr_sync_timer != NULL) {
    osTimerStop(app_wnr_sync_timer);
  }
#if (WNR_SYNC_SET_ANC_FF_GAIN_TWOSTAGE == 1)
  if (app_wnr_twostage_timer != NULL) {
    osTimerStop(app_wnr_twostage_timer);
  }
#endif
  g_wnr_open_mode = ANC_WNR_OPEN_MODE_QTY;
  wnr_sync_counter_for_normal = 0;
  wnr_sync_counter_for_sco = 0;
  g_set_Windstate = 0;
  g_local_Windstate = 0;
  g_peer_Windstate = 0;
  g_wnr_notify_flag = false;
  g_wnr_request_flag = false;
  g_wnr_sync_flag = false;
  g_wind_st = 0;
  anc_ff_gain_l = 512;
  anc_ff_gain_r = 512;
  app_wnr_share_module_info();

  hal_sysfreq_req(APP_SYSFREQ_USER_ANC_WNR, HAL_CMU_FREQ_32K);
  wnr_open_flg = 0;
  return 0;
}

// TODO: Provide API to configure performance
static int32_t anc_wnr_process_frame(WNR_PCM_T *inF, WNR_PCM_T *inR,
                                     uint32_t frame_len) {
  // static short mutetimer = 0;
  // short targettimer = _TARGET_TIME;
  float windictor = 0.0;
  float wind_power;

  ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();

  if (cnt <= _PERIOD) {
#if _SAMPLE_BITS == 16
    windictor = WindDetection2Mic_process_16bit(wind_st, inF, inR, frame_len,
                                                &wind_power);
#else
    windictor = WindDetection2Mic_process_24bit(wind_st, inF, inR, frame_len,
                                                &wind_power);
#endif

    // TRACE(2,"[%s] wind_power = %d.", __func__, (int)(wind_power*10000));
    windsum = windsum + windictor;
    cnt = cnt + 1;
    // TRACE(2,"[%s] cnt = %d, windsum = %d.", __func__, cnt, (int)windsum);
  }
  if (cnt == period) {
    cnt = 0;
    wind_indictor = 0.8 * wind_indictor + 0.2 * windsum / period;
    windsum = 0.0;

    // TRACE(2,"[%s] wind_indictor = %d.", __func__, (int)(wind_indictor*1000));

    // float gain_coef;

    static uint8_t Windstate = 0;
    // Windstate = wind_state_detect(g_wind_st, wind_indictor);
    // TRACE(2,"[%s] windstate = %d.", __func__, Windstate);
    // mutetimer = mutetimer + 1;
    wind_state_detect(g_wind_st, wind_indictor, windindicator, windthd,
                      &Windstate);

    for (int i = WINDINDICATOR_SIZE - 1; i > 0; i--) {
      windindicator[i] = windindicator[i - 1];
    }
    windindicator[0] = wind_indictor;

    // TRACE(2,"[%s] windstate = %d.", __func__, Windstate);

    app_wnr_push_state_to_queue(g_wnr_open_mode, Windstate);

    if (g_wnr_open_mode == ANC_WNR_OPEN_MODE_STANDALONE) {
      if (++wnr_sync_counter_for_normal >=
          WNR_SYNC_COUNTER_THRESHOLD_FOR_NORMAL) {
        wnr_sync_counter_for_normal = 0;
        wnr_sync_counter_for_sco = 0;
        g_local_Windstate = app_wnr_get_state_from_queue(g_wnr_open_mode);
#if (WNR_SYNC_DEBUG_LOG == 1)
        TRACE(1, "[%s] OPEN_MODE_STANDALONE", __func__);
        TRACE(2, "[%s] local_Windstate:%d", __func__, g_local_Windstate);
        TRACE(2, "[%s] last_Windstate:%d", __func__, g_wind_st);
#endif
        if ((app_tws_ibrt_tws_link_connected() == true) &&
            (p_ibrt_ctrl->nv_role == IBRT_MASTER) &&
            (g_wnr_sync_flag == true)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] REQUEST_DETECT_RESULT", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_REQUEST_DETECT_RESULT, 0, 0,
                                           0);
          return 0;
        }

        if ((app_tws_ibrt_tws_link_connected() == true) &&
            (p_ibrt_ctrl->nv_role == IBRT_SLAVE) && (g_wnr_sync_flag == true)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] NOTIFY_DETECT_RESULT", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_NOTIFY_DETECT_RESULT, 0, 0,
                                           0);
          return 0;
        }

        if ((app_tws_ibrt_tws_link_connected() == true) &&
            (p_ibrt_ctrl->nv_role == IBRT_MASTER) &&
            (g_local_Windstate != g_wind_st) &&
            (g_peer_Wind_module_onoff == true)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] REQUEST_DETECT_RESULT", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_REQUEST_DETECT_RESULT, 0, 0,
                                           0);
          return 0;
        }

        if ((app_tws_ibrt_tws_link_connected() == true) &&
            (p_ibrt_ctrl->nv_role == IBRT_SLAVE) &&
            (g_local_Windstate != g_wind_st) &&
            (g_peer_Wind_module_onoff == true)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] NOTIFY_DETECT_RESULT", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_NOTIFY_DETECT_RESULT, 0, 0,
                                           0);
          return 0;
        }

        if (((app_tws_ibrt_tws_link_connected() == false) ||
             (g_peer_Wind_module_onoff == false)) &&
            (g_local_Windstate != g_wind_st)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] SET_TRIGGER", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_SET_TRIGGER,
                                           (uint32_t)g_local_Windstate, 0, 0);
          return 0;
        }
      }
    } else {
      if (++wnr_sync_counter_for_sco >= WNR_SYNC_COUNTER_THRESHOLD_FOR_SCO) {
        wnr_sync_counter_for_sco = 0;
        wnr_sync_counter_for_normal = 0;
        g_local_Windstate = app_wnr_get_state_from_queue(g_wnr_open_mode);
#if (WNR_SYNC_DEBUG_LOG == 1)
        TRACE(1, "[%s] OPEN_MODE_CONFIGURE", __func__);
        TRACE(2, "[%s] local_Windstate:%d", __func__, g_local_Windstate);
        TRACE(2, "[%s] last_Windstate:%d", __func__, g_wind_st);
#endif
        if ((app_tws_ibrt_tws_link_connected() == true) &&
            (p_ibrt_ctrl->nv_role == IBRT_MASTER) &&
            (g_wnr_sync_flag == true)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] REQUEST_DETECT_RESULT", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_REQUEST_DETECT_RESULT, 0, 0,
                                           0);
          return 0;
        }

        if ((app_tws_ibrt_tws_link_connected() == true) &&
            (p_ibrt_ctrl->nv_role == IBRT_SLAVE) && (g_wnr_sync_flag == true)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] NOTIFY_DETECT_RESULT", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_NOTIFY_DETECT_RESULT, 0, 0,
                                           0);
          return 0;
        }

        if ((app_tws_ibrt_tws_link_connected() == true) &&
            (p_ibrt_ctrl->nv_role == IBRT_MASTER) &&
            (g_local_Windstate != g_wind_st) &&
            (g_peer_Wind_module_onoff == true)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] REQUEST_DETECT_RESULT", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_REQUEST_DETECT_RESULT, 0, 0,
                                           0);
          return 0;
        }

        if ((app_tws_ibrt_tws_link_connected() == true) &&
            (p_ibrt_ctrl->nv_role == IBRT_SLAVE) &&
            (g_local_Windstate != g_wind_st) &&
            (g_peer_Wind_module_onoff == true)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] NOTIFY_DETECT_RESULT", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_NOTIFY_DETECT_RESULT, 0, 0,
                                           0);
          return 0;
        }

        if (((app_tws_ibrt_tws_link_connected() == false) ||
             (g_peer_Wind_module_onoff == false)) &&
            (g_local_Windstate != g_wind_st)) {
#if (WNR_SYNC_DEBUG_LOG == 1)
          TRACE(1, "[%s] SET_TRIGGER", __func__);
#endif
          if (g_local_Wind_module_onoff == true)
            app_wnr_trigger_internal_event(APP_WNR_SET_TRIGGER,
                                           (uint32_t)g_local_Windstate, 0, 0);
          return 0;
        }
      }
    }
  }
  return 0;
}

static void inline stereo_resample_16k(WNR_PCM_T *pcm_buf, uint32_t pcm_len,
                                       WNR_PCM_T *mic1, WNR_PCM_T *mic2) {
  uint32_t frame_len = pcm_len / _CHANNEL_NUM;

  const float num[3] = {0.020083, 0.040166, 0.020083};
  const float den[3] = {1.000000, -1.561018, 0.641351};

  static float y0 = 0, y1 = 0, y2 = 0, x0 = 0, x1 = 0, x2 = 0;
  static float Y0 = 0, Y1 = 0, Y2 = 0, X0 = 0, X1 = 0, X2 = 0;

  for (uint32_t i = 0; i < frame_len; i++) {
    x0 = pcm_buf[_CHANNEL_NUM * i + 0];
    X0 = pcm_buf[_CHANNEL_NUM * i + 1];

    y0 = x0 * num[0] + x1 * num[1] + x2 * num[2] - y1 * den[1] - y2 * den[2];
    Y0 = X0 * num[0] + X1 * num[1] + X2 * num[2] - Y1 * den[1] - Y2 * den[2];

    y2 = y1;
    y1 = y0;
    x2 = x1;
    x1 = x0;

    Y2 = Y1;
    Y1 = Y0;
    X2 = X1;
    X1 = X0;

    if (i % 2 == 0) {
#if defined(_24BITS_ENABLE)
      mic1[i / 2] = speech_ssat_int24((int32_t)y0);
      mic2[i / 2] = speech_ssat_int24((int32_t)Y0);
#else
      mic1[i / 2] = speech_ssat_int16((int32_t)y0);
      mic2[i / 2] = speech_ssat_int16((int32_t)Y0);
#endif
    }
  }
}

int32_t anc_wnr_process(void *pcm_buf, uint32_t pcm_len) {
  if (wnr_open_flg == 0) {
    TRACE(2, "[%s] WARNING: wnr_open_flg = %d", __func__, wnr_open_flg);
    return 0;
  }
  TRACE(2, "[%s] pcm_len = %d", __func__, pcm_len);

  // audio_dump_clear_up();

  WNR_PCM_T *tmp_buf = (WNR_PCM_T *)pcm_buf;
  if (g_open_mode != ANC_WNR_OPEN_MODE_CONFIGURE) {
    return 1;
  }

  // resample 16k-->8k
  if (g_sample_rate == 16000) {
    stereo_resample_16k(tmp_buf, pcm_len, (WNR_PCM_T *)af_stream_mic1,
                        (WNR_PCM_T *)af_stream_mic2);
    // 2ch --> 1ch, 16k --> 8k
    pcm_len = pcm_len / _CHANNEL_NUM / 2;
  } else {

    WNR_PCM_T *mic1 = (WNR_PCM_T *)af_stream_mic1;
    WNR_PCM_T *mic2 = (WNR_PCM_T *)af_stream_mic2;
    pcm_len = pcm_len / _CHANNEL_NUM;
    for (uint32_t i = 0; i < pcm_len; i++) {
      mic1[i] = tmp_buf[2 * i];
      mic2[i] = tmp_buf[2 * i + 1];
    }
  }

  // TRACE(2,"[%s] new pcm_len = %d", __func__, pcm_len);

  anc_wnr_process_frame((WNR_PCM_T *)af_stream_mic1,
                        (WNR_PCM_T *)af_stream_mic2, pcm_len);

  return 0;
}

// uint32_t wnr_ticks;

static uint32_t anc_wnr_callback(uint8_t *buf, uint32_t len) {

  // TRACE(2,"[%s] len = %d", __func__, len);
  // audio_dump_clear_up();
#ifdef TEST_MIPS
  start_ticks = hal_fast_sys_timer_get();
#endif
  int32_t frame_len = len / SAMPLE_BYTES / _CHANNEL_NUM / _LOOP_CNT;
  ASSERT(frame_len == _FRAME_LEN, "[%s] frame len(%d) is invalid.", __func__,
         frame_len);
  WNR_PCM_T *pcm_buf = (WNR_PCM_T *)buf;

  WNR_PCM_T *mic1 = (WNR_PCM_T *)af_stream_mic1;
  WNR_PCM_T *mic2 = (WNR_PCM_T *)af_stream_mic2;

  for (int32_t j = 0; j < _LOOP_CNT; j++) {
    for (int32_t i = 0; i < frame_len; i++) {
      mic1[i] = pcm_buf[_CHANNEL_NUM * i + 0];
      mic2[i] = pcm_buf[_CHANNEL_NUM * i + 1];
    }

    anc_wnr_process_frame((WNR_PCM_T *)mic1, (WNR_PCM_T *)mic2, frame_len);
    pcm_buf += _FRAME_LEN * _CHANNEL_NUM;
  }

#ifdef TEST_MIPS
  end_ticks = hal_fast_sys_timer_get();
  used_mips = (end_ticks - start_ticks) * 1000 / (start_ticks - pre_ticks);
  TRACE(2, "[%s] Usage: %d in a thousand (MIPS).", __func__, used_mips);
  // wnr_ticks = start_ticks;
  // TRACE(2,"[%s] WNR frame takes %d ms.", __func__,
  // FAST_TICKS_TO_MS((start_ticks - pre_ticks)*100));
  pre_ticks = start_ticks;
#endif

  return len;
}

static void _open_mic(void) {
  struct AF_STREAM_CONFIG_T stream_cfg;

  TRACE(1, "[%s] ...", __func__);

  memset(&stream_cfg, 0, sizeof(stream_cfg));
  stream_cfg.channel_num = (enum AUD_CHANNEL_NUM_T)_CHANNEL_NUM;
  stream_cfg.sample_rate = (enum AUD_SAMPRATE_T)_SAMPLE_RATE;
  stream_cfg.bits = (enum AUD_BITS_T)_SAMPLE_BITS;
  stream_cfg.vol = 12;
  stream_cfg.chan_sep_buf = false;
  stream_cfg.device = AUD_STREAM_USE_INT_CODEC;
  stream_cfg.io_path = AUD_INPUT_PATH_ANC_WNR;
  stream_cfg.handler = anc_wnr_callback;
  stream_cfg.data_size = sizeof(af_stream_buff);
  stream_cfg.data_ptr = af_stream_buff;
  ASSERT(stream_cfg.channel_num == 2, "[%s] channel number(%d) is invalid.",
         __func__, stream_cfg.channel_num);
  TRACE(3, "[%s] sample_rate:%d, data_size:%d", __func__,
        stream_cfg.sample_rate, stream_cfg.data_size);
  TRACE(2, "[%s] af_stream_buff = %p", __func__, af_stream_buff);

  af_stream_open(ANC_WNR_STREAM_ID, AUD_STREAM_CAPTURE, &stream_cfg);
  af_stream_start(ANC_WNR_STREAM_ID, AUD_STREAM_CAPTURE);
}

static void _close_mic(void) {
  TRACE(1, "[%s] ...", __func__);

  af_stream_stop(ANC_WNR_STREAM_ID, AUD_STREAM_CAPTURE);
  af_stream_close(ANC_WNR_STREAM_ID, AUD_STREAM_CAPTURE);
}


================================================
FILE: apps/anc/src/app_anc.c
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#include "app_anc.h"
#include "anc_assist.h"
#include "anc_process.h"
#include "anc_wnr.h"
#include "app_ibrt_keyboard.h"
#include "app_ibrt_ui.h"
#include "app_thread.h"
#include "apps.h"
#include "aud_section.h"
#include "audioflinger.h"
#include "cmsis.h"
#include "cmsis_os.h"
#include "hal_bootmode.h"
#include "hal_codec.h"
#include "hal_sysfreq.h"
#include "hal_timer.h"
#include "hal_trace.h"
#include "hwtimer_list.h"
#include "plat_types.h"
#include "pmu.h"
#include "tgt_hardware.h"

#include "app_status_ind.h"
#ifdef __SIMPLE_INTERNAL_PLAYER_SUPPORT__
#include "simple_internal_player.h"
#endif
#include "hal_aud.h"
#ifdef IBRT
#include "app_tws_ctrl_thread.h"
#include "app_tws_ibrt.h"
#include "app_tws_ibrt_cmd_handler.h"
#endif

#include "co_math.h"
// #define ANC_MODE_SWITCH_WITHOUT_FADE //Comment this line if you need fade
//  function between anc mode

#ifndef _ANC_FADE_STACK_SIZE
#define _ANC_FADE_STACK_SIZE (1 * 1024)
#endif

static osThreadId anc_fade_thread_tid;

#define FADE_IN 0x0001
#define FADE_OUT 0x0002
#define CHANGE_FROM_ANC_TO_TT_DIRECTLY 0x0003

static void anc_fade_thread(void const *argument);
osThreadDef(anc_fade_thread, osPriorityBelowNormal, 1, _ANC_FADE_STACK_SIZE,
            "anc_fade_thread");

extern uint8_t app_poweroff_flag;
uint32_t app_anc_get_anc_status(void);

void app_anc_disable(void);
void app_anc_close_anc(void);
osStatus osDelay(uint32_t millisec);
void app_anc_timer_set(uint32_t request, uint32_t delay);
void app_anc_timer_close(void);
extern bool app_mode_is_usbaudio(void); // 96k 384k
extern bool app_mode_is_i2s(void);      // 96k 384k
void app_anc_init_timer(void);
extern void i2s_player_send_stop(void);
extern void fb_anti_howl_start(void);
extern void fb_anti_howl_stop(void);
extern void hal_codec_reconfig_pll_freq(enum AUD_SAMPRATE_T dac_rate,
                                        enum AUD_SAMPRATE_T adc_rate);
extern void anc_status_sync(void);
extern void anc_status_sync_init(void);

extern uint8_t is_sbc_mode(void);
extern uint8_t is_sco_mode(void);

void app_anc_switch_set_edge(uint8_t down_edge);

#ifdef __ANC_STICK_SWITCH_USE_GPIO__
typedef void (*ANC_KEY_CALLBACK)(uint8_t status);
static ANC_KEY_CALLBACK app_switch_callback;
#endif

extern int app_shutdown(void);
extern int app_reset(void);

extern void analog_aud_codec_speaker_enable(bool en);

#ifdef __SUPPORT_ANC_SINGLE_MODE_WITHOUT_BT__
extern bool anc_single_mode_is_on(void);
#endif
enum {
  ANC_STATUS_OFF = 0,
  ANC_STATUS_ON,
  ANC_STATUS_WAITING_ON,
  ANC_STATUS_WAITING_OFF,
  ANC_STATUS_INIT_ON,
  ANC_STATUS_NONE
};

enum {
  ANC_EVENT_INIT = 0,
  ANC_EVENT_OPEN,
  ANC_EVENT_CLOSE,
  ANC_EVENT_FADE_IN,
  ANC_EVENT_FADE_OUT,
  ANC_EVENT_CHANGE_SAMPLERATE,
  ANC_EVENT_CHANGE_STATUS,
  ANC_EVENT_HOWL_PROCESS,
  ANC_EVENT_SYNC_STATUS,
  ANC_EVENT_SYNC_INIT,
  ANC_EVENT_PWR_KEY_MONITOR,
  ANC_EVENT_PWR_KEY_MONITOR_REBOOT,
  ANC_EVENT_SWITCH_KEY_DEBONCE,
  SIMPLE_PLAYER_CLOSE_CODEC_EVT,
  SIMPLE_PLAYER_DELAY_STOP_EVT,
  ANC_EVENT_NONE
};

static uint32_t anc_work_status = ANC_STATUS_OFF;
static uint32_t anc_timer_request = ANC_EVENT_NONE;

static enum AUD_SAMPRATE_T anc_sample_rate[AUD_STREAM_NUM];

static HWTIMER_ID anc_timerid = NULL;
#define anc_gain_adjust_gap (60)

#define anc_init_switch_off_time (MS_TO_TICKS(1000 * 60 * 2))
#define anc_auto_power_off_time (MS_TO_TICKS(1000 * 60 * 60))
#define anc_switch_on_time (MS_TO_TICKS(600))
#define anc_close_delay_time (MS_TO_TICKS(1000 * 20))
#define anc_pwr_key_monitor_time (MS_TO_TICKS(1500))
#define anc_switch_key_debonce_time (MS_TO_TICKS(40))

#if 0 // def ANC_FB_CHECK
uint32_t app_fb_check_threshold_vale=0x4000000;
enum ANC_TYPE_T app_anc_check_type = ANC_FEEDBACK;
uint32_t app_fb_check_delay_time=((MS_TO_TICKS(5000)));
#endif

#ifdef ANC_FB_CHECK
uint32_t app_fb_check_threshold_vale = 0x4000000;
enum ANC_TYPE_T app_anc_check_type = ANC_FEEDFORWARD;
uint32_t app_fb_check_decrease_resume_delay_time = (MS_TO_TICKS(400));
uint8_t app_fb_check_decrease_value = 18;
uint32_t app_fb_check_delay_time = (MS_TO_TICKS(3000));
uint8_t app_fb_check_delay_time_flag = 0;
uint32_t app_fb_check_delay_time2 = (MS_TO_TICKS(3000));
uint32_t app_fb_check_threshold_count = 20;
uint8_t app_gain_resume_status = 1;
#endif

enum {
  APP_ANC_IDLE = 0,
  APP_ANC_FADE_IN,
  APP_ANC_FADE_OUT,
};

uint32_t app_anc_fade_status = APP_ANC_IDLE;

static bool app_init_done = false;
#ifdef ANC_SWITCH_PIN
static bool app_anc_shutdown = false;
#endif
bool anc_set_dac_pa_delay = false;
static enum ANC_INDEX anc_coef_idx = 0;

extern void analog_aud_enable_dac_pa(uint8_t dac);

bool app_anc_is_on(void) { return (ANC_STATUS_ON == anc_work_status); }

uint32_t app_anc_get_sample_rate(void) {
  return (uint32_t)anc_sample_rate[AUD_STREAM_CAPTURE];
}

void app_anc_set_coef_idx(uint8_t idx) { anc_coef_idx = idx; }

uint8_t app_anc_get_coef_idx(void) { return anc_coef_idx; }

#if defined(IBRT)

static enum ANC_INDEX anc_peer_coef_idx = 0;
static bool anc_status_sync_flag = false;

void app_anc_set_peer_coef_idx(uint8_t idx) { anc_peer_coef_idx = idx; }

uint8_t app_anc_get_peer_coef_idx(void) { return anc_peer_coef_idx; }

void app_anc_set_status_sync_flag(bool status) {
  anc_status_sync_flag = status;
}

bool app_anc_get_status_sync_flag(void) { return anc_status_sync_flag; }

#endif

void app_anc_set_init_done(void) { app_init_done = true; }

void app_anc_switch_turnled(bool on);

#ifdef __SUPPORT_ANC_SINGLE_MODE_WITHOUT_BT__

static ANC_KEY_CALLBACK app_pwr_key_monitor_callback;

static void app_pwr_key_monitor_handler(enum HAL_GPIO_PIN_T pin) {
  uint8_t gpio_val = hal_gpio_pin_get_val(pin);

  TRACE(2, " %s :%d ", __func__, gpio_val);
  if (app_pwr_key_monitor_callback)
    app_pwr_key_monitor_callback(gpio_val);
}

bool app_pwr_key_monitor_get_val(void) {
  return (bool)hal_gpio_pin_get_val((enum HAL_GPIO_PIN_T)PWR_KEY_MONITOR_PIN);
}

void app_pwr_key_monitor_set_int_edge(uint8_t down_edge) {
  struct HAL_GPIO_IRQ_CFG_T gpiocfg;
  gpiocfg.irq_enable = true;
  gpiocfg.irq_debounce = true;
  gpiocfg.irq_type = HAL_GPIO_IRQ_TYPE_EDGE_SENSITIVE;
  gpiocfg.irq_polarity = (down_edge == 1) ? HAL_GPIO_IRQ_POLARITY_LOW_FALLING
                                          : HAL_GPIO_IRQ_POLARITY_HIGH_RISING;
  gpiocfg.irq_handler = app_pwr_key_monitor_handler;
  TRACE(2, " %s :%d ", __func__, down_edge);
  hal_gpio_setup_irq((enum HAL_GPIO_PIN_T)PWR_KEY_MONITOR_PIN, &gpiocfg);
}

void app_pwr_key_monitor_init(ANC_KEY_CALLBACK callback) {
  app_pwr_key_monitor_callback = callback;
}
#endif

#ifdef ANC_LED_PIN
void app_anc_switch_turnled(bool on) {
  TRACE(2, " %s on %d ", __func__, on);

  if (cfg_anc_led.pin != HAL_IOMUX_PIN_NUM) {
    if (on) {
      TRACE(0, "on\n");
      hal_gpio_pin_set((enum HAL_GPIO_PIN_T)cfg_anc_led.pin);
    } else {
      TRACE(0, "off\n");
      hal_gpio_pin_clr((enum HAL_GPIO_PIN_T)cfg_anc_led.pin);
    }
  }
}
#endif

#ifdef __ANC_STICK_SWITCH_USE_GPIO__

static void app_anc_switch_int_handler(enum HAL_GPIO_PIN_T pin) {
  // uint8_t gpio_val;
  uint8_t gpio_val = hal_gpio_pin_get_val(pin);
  TRACE(3, " %s ,pin %d,status %d", __func__, pin, gpio_val);
#ifdef ANC_LED_PIN
  if (gpio_val)
    app_anc_switch_turnled(true);
  else
    app_anc_switch_turnled(false);
#endif
  app_anc_switch_set_edge(gpio_val);

  app_anc_timer_set(ANC_EVENT_SWITCH_KEY_DEBONCE, anc_switch_key_debonce_time);
  // if (app_switch_callback)
  //    app_switch_callback(gpio_val);
  // app_anc_key_handler();
}

void app_anc_switch_init(ANC_KEY_CALLBACK callback) {
  app_switch_callback = callback;
}
#endif

#ifdef ANC_SWITCH_PIN
bool app_anc_set_reboot(void) {
  return (app_anc_shutdown &&
          hal_gpio_pin_get_val((enum HAL_GPIO_PIN_T)ANC_SWITCH_PIN));
}

bool app_anc_switch_get_val(void) {
  return (bool)hal_gpio_pin_get_val((enum HAL_GPIO_PIN_T)ANC_SWITCH_PIN);
}

void app_anc_switch_set_edge(uint8_t down_edge) {
  struct HAL_GPIO_IRQ_CFG_T gpiocfg;
  gpiocfg.irq_enable = true;
  gpiocfg.irq_debounce = true;
  gpiocfg.irq_type = HAL_GPIO_IRQ_TYPE_EDGE_SENSITIVE;
  gpiocfg.irq_polarity = (down_edge == 1) ? HAL_GPIO_IRQ_POLARITY_LOW_FALLING
                                          : HAL_GPIO_IRQ_POLARITY_HIGH_RISING;
  gpiocfg.irq_handler = app_anc_switch_int_handler;
  TRACE(2, " %s :%d ", __func__, down_edge);
  hal_gpio_setup_irq((enum HAL_GPIO_PIN_T)ANC_SWITCH_PIN, &gpiocfg);
}
#endif

int __anc_usb_app_fadein(enum ANC_TYPE_T type) {
  int32_t gain0_curr, gain1_curr;
  int32_t gain0_tg, gain1_tg;

  anc_get_gain(&gain0_curr, &gain1_curr, type);
  anc_get_cfg_gain(&gain0_tg, &gain1_tg, type);

  if (gain0_tg > 0) {
    if (gain0_curr < gain0_tg) {
      gain0_curr++;
    }
  } else {
    if (gain0_curr > gain0_tg) {
      gain0_curr--;
    }
  }

  if (gain1_tg > 0) {
    if (gain1_curr < gain1_tg) {
      gain1_curr++;
    }
  } else {
    if (gain1_curr > gain1_tg) {
      gain1_curr--;
    }
  }
  hal_sys_timer_delay_us(25);

  anc_set_gain(gain0_curr, gain1_curr, type);

  if ((gain0_curr == gain0_tg) && (gain1_curr == gain1_tg)) {
    TRACE(3, "[%s] cur gain: %d %d", __func__, gain0_curr, gain1_curr);
    return 0;
  }

  return 1;
}

int __anc_usb_app_fadeout(enum ANC_TYPE_T type) {
  int32_t gain0_curr, gain1_curr;

  anc_get_gain(&gain0_curr, &gain1_curr, type);

  if (gain0_curr > 0) {
    gain0_curr--;
  } else if (gain0_curr < 0) {
    gain0_curr++;
  }

  if (gain1_curr > 0) {
    gain1_curr--;
  } else if (gain1_curr < 0) {
    gain1_curr++;
  }

  //  gain0_curr = gain1_curr = 0 ;
  hal_sys_timer_delay_us(25);

  anc_set_gain(gain0_curr, gain1_curr, type);

  if ((gain0_curr == 0) && (gain1_curr == 0)) {
    TRACE(3, "[%s] gain: %d, %d", __func__, gain0_curr, gain1_curr);
    return 0;
  }

  return 1;
}

#if defined(ANC_FF_ENABLED) && defined(ANC_FB_ENABLED)
int __anc_usb_app_fadein_ff_fb(void) {
  int32_t gain0_curr, gain1_curr;
  int32_t gain2_curr, gain3_curr;

  int32_t gain0_tg, gain1_tg;
  int32_t gain2_tg, gain3_tg;

  anc_get_gain(&gain0_curr, &gain1_curr, ANC_FEEDFORWARD);
  anc_get_gain(&gain2_curr, &gain3_curr, ANC_FEEDBACK);
  anc_get_cfg_gain(&gain0_tg, &gain1_tg, ANC_FEEDFORWARD);
  anc_get_cfg_gain(&gain2_tg, &gain3_tg, ANC_FEEDBACK);

  uint32_t random_factor = rand();
  random_factor %= 5;
  if (random_factor == 0)
    random_factor++;

  uint32_t random_factor_inverse = 5 - random_factor;
  if (random_factor_inverse == 0)
    random_factor_inverse++;

  random_factor_inverse = 1;

  if (is_sbc_mode() || is_sco_mode()) {
    if (gain0_tg > 0) {
      if (gain0_curr < gain0_tg) {
        gain0_curr = MIN(gain0_curr + random_factor_inverse, gain0_tg);
      }
    } else {
      if (gain0_curr > gain0_tg) {
        gain0_curr = MAX(gain0_curr - random_factor_inverse, gain0_tg);
      }
    }

    if (gain1_tg > 0) {
      if (gain1_curr < gain1_tg) {
        gain1_curr = MIN(gain1_curr + random_factor_inverse, gain1_tg);
      }
    } else {
      if (gain1_curr > gain1_tg) {
        gain1_curr = MAX(gain1_curr - random_factor_inverse, gain1_tg);
      }
    }

    if (gain2_tg > 0) {
      if (gain2_curr < gain2_tg) {
        gain2_curr = MIN(gain2_curr + random_factor_inverse, gain2_tg);
      }
    } else {
      if (gain2_curr > gain2_tg) {
        gain2_curr = MAX(gain2_curr - random_factor_inverse, gain2_tg);
      }
    }

    if (gain3_tg > 0) {
      if (gain3_curr < gain3_tg) {
        gain3_curr = MIN(gain3_curr + random_factor_inverse, gain3_tg);
      }
    } else {
      if (gain3_curr > gain3_tg) {
        gain3_curr = MAX(gain3_curr - random_factor_inverse, gain3_tg);
      }
    }
  } else {
    if (gain0_tg > 0) {
      if (gain0_curr < gain0_tg) {
        gain0_curr = MIN(gain0_curr + random_factor_inverse, gain0_tg);
      }
    } else {
      if (gain0_curr > gain0_tg) {
        gain0_curr = MAX(gain0_curr - random_factor_inverse, gain0_tg);
      }
    }

    if (gain1_tg > 0) {
      if (gain1_curr < gain1_tg) {
        gain1_curr = MIN(gain1_curr + random_factor_inverse, gain1_tg);
      }
    } else {
      if (gain1_curr > gain1_tg) {
        gain1_curr = MAX(gain1_curr - random_factor_inverse, gain1_tg);
      }
    }

    if (gain2_tg > 0) {
      if (gain2_curr < gain2_tg) {
        gain2_curr = MIN(gain2_curr + random_factor_inverse, gain2_tg);
      }
    } else {
      if (gain2_curr > gain2_tg) {
        gain2_curr = MAX(gain2_curr - random_factor_inverse, gain2_tg);
      }
    }

    if (gain3_tg > 0) {
      if (gain3_curr < gain3_tg) {
        gain3_curr = MIN(gain3_curr + random_factor_inverse, gain3_tg);
      }
    } else {
      if (gain3_curr > gain3_tg) {
        gain3_curr = MAX(gain3_curr - random_factor_inverse, gain3_tg);
      }
    }
  }

  anc_set_gain(gain0_curr, gain1_curr, ANC_FEEDFORWARD);
  anc_set_gain(gain2_curr, gain3_curr, ANC_FEEDBACK);

  // TRACE(5,"[%s] cur gain: %d %d %d %d", __func__, gain0_curr, gain1_curr,
  // gain2_curr, gain3_curr);

  // osDelay(random_factor);

  hal_sys_timer_delay_us(40);
  if (gain0_curr % 40 == 0) {
    // osDelay(random_factor);
  }

  if ((gain0_curr == gain0_tg) && (gain1_curr == gain1_tg) &&
      (gain2_curr == gain2_tg) && (gain3_curr == gain3_tg)) {
    anc_disable_gain_updated_when_pass0(1);

    anc_set_gain(gain0_curr, gain1_curr, ANC_FEEDFORWARD);
    anc_set_gain(gain2_curr, gain3_curr, ANC_FEEDBACK);
    TRACE(5, "[%s] end cur gain: %d, %d, %d, %d", __func__, gain0_curr,
          gain1_curr, gain2_curr, gain3_curr);
    return 0;
  }
  return 1;
}

int __anc_usb_app_fadeout_ff_fb(void) {
  int32_t gain0_curr, gain1_curr;
  int32_t gain2_curr, gain3_curr;
  anc_get_gain(&gain0_curr, &gain1_curr, ANC_FEEDFORWARD);
  anc_get_gain(&gain2_curr, &gain3_curr, ANC_FEEDBACK);

  uint32_t random_factor = rand();
  random_factor = random_factor % 5;
  if (random_factor == 0)
    random_factor++;

  uint32_t random_factor_inverse = 5 - random_factor;
  if (random_factor_inverse == 0)
    random_factor_inverse++;

  random_factor_inverse = 1;

  if (is_sbc_mode() || is_sco_mode()) {
    if (gain0_curr > 0) {
      gain0_curr = MAX(gain0_curr - random_factor_inverse, 0);
    } else if (gain0_curr < 0) {
      gain0_curr = MIN(gain0_curr + random_factor_inverse, 0);
    }

    if (gain1_curr > 0) {
      gain1_curr = MAX(gain1_curr - random_factor_inverse, 0);
    } else if (gain1_curr < 0) {
      gain1_curr = MIN(gain1_curr + random_factor_inverse, 0);
    }

    if (gain2_curr > 0) {
      gain2_curr = MAX(gain2_curr - random_factor_inverse, 0);
    } else if (gain2_curr < 0) {
      gain2_curr = MIN(gain2_curr + random_factor_inverse, 0);
    }

    if (gain3_curr > 0) {
      gain3_curr = MAX(gain3_curr - random_factor_inverse, 0);
    } else if (gain3_curr < 0) {
      gain3_curr = MIN(gain3_curr + random_factor_inverse, 0);
    }
  } else {
    if (gain0_curr > 0) {
      gain0_curr = MAX(gain0_curr - random_factor_inverse, 0);
    } else if (gain0_curr < 0) {
      gain0_curr = MIN(gain0_curr + random_factor_inverse, 0);
    }

    if (gain1_curr > 0) {
      gain1_curr = MAX(gain1_curr - random_factor_inverse, 0);
    } else if (gain1_curr < 0) {
      gain1_curr = MIN(gain1_curr + random_factor_inverse, 0);
    }

    if (gain2_curr > 0) {
      gain2_curr = MAX(gain2_curr - random_factor_inverse, 0);
    } else if (gain2_curr < 0) {
      gain2_curr = MIN(gain2_curr + random_factor_inverse, 0);
    }

    if (gain3_curr > 0) {
      gain3_curr = MAX(gain3_curr - random_factor_inverse, 0);
    } else if (gain3_curr < 0) {
      gain3_curr = MIN(gain3_curr + random_factor_inverse, 0);
    }
  }

  anc_set_gain(gain0_curr, gain1_curr, ANC_FEEDFORWARD);
  anc_set_gain(gain2_curr, gain3_curr, ANC_FEEDBACK);
  // TRACE(5,"[%s] cur gain: %d %d %d %d", __func__, gain0_curr, gain1_curr,
  // gain2_curr, gain3_curr);

  // osDelay(random_factor);

  hal_sys_timer_delay_us(40);
  if (gain0_curr % 40 == 0) {
    // osDelay(random_factor);
  }

  if ((gain0_curr == 0) && (gain1_curr == 0) && (gain2_curr == 0) &&
      (gain3_curr == 0)) {
    anc_disable_gain_updated_when_pass0(1);

    anc_set_gain(gain0_curr, gain1_curr, ANC_FEEDFORWARD);
    anc_set_gain(gain2_curr, gain3_curr, ANC_FEEDBACK);
    TRACE(5, "[%s] end cur gain: %d, %d, %d, %d", __func__, gain0_curr,
          gain1_curr, gain2_curr, gain3_curr);
    return 0;
  }

  return 1;
}
#endif

void anc_gain_fade_handle(void) {
  TRACE(2, " %s %d ", __func__, app_anc_fade_status);
  if (app_anc_fade_status == APP_ANC_FADE_OUT) {
    osSignalSet(anc_fade_thread_tid, FADE_OUT);
  }

  if (app_anc_fade_status == APP_ANC_FADE_IN) {
#ifdef ANC_LED_PIN
    app_anc_switch_turnled(true);
#endif

    osSignalSet(anc_fade_thread_tid, FADE_IN);

    if (anc_set_dac_pa_delay) {
      anc_set_dac_pa_delay = false;
      //          osDelay(600);
      //          analog_aud_enable_dac_pa(48);
    }
  }
}

void anc_fade_thread(void const *argument) {

  osEvent evt;
  evt.status = 0;
  uint32_t singles = 0;

  while (1) {
    evt = osSignalWait(0, osWaitForever);

    singles = evt.value.signals;
    TRACE(2, "anc_fade_thread. %d", singles);

    if (evt.status == osEventSignal) {

      switch (singles) {

      case FADE_IN:
#if defined(ANC_FF_ENABLED) && defined(ANC_FB_ENABLED)
        anc_disable_gain_updated_when_pass0(0);
        while (__anc_usb_app_fadein_ff_fb())
          ;
#else
#ifdef ANC_FF_ENABLED
        while (__anc_usb_app_fadein(ANC_FEEDFORWARD))
          ;
#endif
#ifdef ANC_FB_ENABLED
        while (__anc_usb_app_fadein(ANC_FEEDBACK))
          ;
#endif
#endif
        app_anc_fade_status = APP_ANC_IDLE;

        break;
      case FADE_OUT:

#if defined(ANC_FF_ENABLED) && defined(ANC_FB_ENABLED)
        anc_disable_gain_updated_when_pass0(0);
        while (__anc_usb_app_fadeout_ff_fb())
          ;
#else
#ifdef ANC_FF_ENABLED
        while (__anc_usb_app_fadeout(ANC_FEEDFORWARD))
          ;
#endif
#ifdef ANC_FB_ENABLED
        while (__anc_usb_app_fadeout(ANC_FEEDBACK))
          ;
#endif
#endif

        app_anc_fade_status = APP_ANC_IDLE;

#ifdef ANC_FB_CHECK
        hal_codec_anc_fb_check_set_irq_handler(anc_fb_check_irq_handler);

        anc_fb_check_param();
#endif
        break;
      case CHANGE_FROM_ANC_TO_TT_DIRECTLY:
#if defined(ANC_FF_ENABLED) && defined(ANC_FB_ENABLED)
        anc_disable_gain_updated_when_pass0(0);
        while (__anc_usb_app_fadeout_ff_fb())
          ;
#else
#ifdef ANC_FF_ENABLED
        while (__anc_usb_app_fadeout(ANC_FEEDFORWARD))
          ;
#endif

#ifdef ANC_FB_ENABLED
        while (__anc_usb_app_fadeout(ANC_FEEDBACK))
          ;
#endif
#endif

#if defined(ANC_FF_ENABLED) && defined(ANC_FB_ENABLED)
        anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                        ANC_FEEDFORWARD, ANC_GAIN_DELAY);
        anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                        ANC_FEEDBACK, ANC_GAIN_DELAY);
#ifdef AUDIO_ANC_FB_MC_HW
        anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                        ANC_MUSICCANCLE, ANC_GAIN_DELAY);
#endif
#else
#ifdef ANC_FF_ENABLED
        anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                        ANC_FEEDFORWARD, ANC_GAIN_DELAY);
#endif

#ifdef ANC_FB_ENABLED
        anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                        ANC_FEEDBACK, ANC_GAIN_DELAY);
#endif
#endif

#if defined(ANC_FF_ENABLED) && defined(ANC_FB_ENABLED)
        anc_disable_gain_updated_when_pass0(0);
        while (__anc_usb_app_fadein_ff_fb())
          ;
#else
#ifdef ANC_FF_ENABLED
        while (__anc_usb_app_fadein(ANC_FEEDFORWARD))
          ;
#endif

#ifdef ANC_FB_ENABLED
        while (__anc_usb_app_fadein(ANC_FEEDBACK))
          ;
#endif
#endif

        app_anc_fade_status = APP_ANC_IDLE;

        // recommand to play "ANC SWITCH" prompt here...

        break;
      default:
        break;
      }

    } else {
      TRACE(2, "anc fade thread evt error");
      continue;
    }
  }
}

void app_anc_gain_fadein(void) {
  APP_MESSAGE_BLOCK msg;
  TRACE(1, " %s ", __func__);
  if (app_poweroff_flag)
    return;

  app_anc_fade_status = APP_ANC_FADE_IN;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = ANC_EVENT_FADE_IN;
  app_mailbox_put(&msg);
}

void app_anc_post_anc_codec_close(void) {
  APP_MESSAGE_BLOCK msg;
  TRACE(1, " %s ", __func__);
  if (app_poweroff_flag)
    return;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = SIMPLE_PLAYER_CLOSE_CODEC_EVT;
  app_mailbox_put(&msg);
}

void app_anc_gain_fadeout(void) {
  APP_MESSAGE_BLOCK msg;
  TRACE(1, " %s ", __func__);
  if (app_poweroff_flag)
    return;

  app_anc_fade_status = APP_ANC_FADE_OUT;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = ANC_EVENT_FADE_OUT;
  app_mailbox_put(&msg);
}

void app_anc_status_post(uint8_t status) {
  APP_MESSAGE_BLOCK msg;
  TRACE(2, " %s status %d", __func__, status);
  if (app_poweroff_flag)
    return;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = ANC_EVENT_CHANGE_STATUS;
  msg.msg_body.message_Param0 = status;
  app_mailbox_put(&msg);
}

void app_anc_status_sync(uint8_t status) {
  APP_MESSAGE_BLOCK msg;
  TRACE(2, " %s status %d", __func__, status);
  if (app_poweroff_flag)
    return;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = ANC_EVENT_SYNC_STATUS;
  msg.msg_body.message_Param0 = status;
  app_mailbox_put(&msg);
}

void app_anc_status_sync_init(void) {
  APP_MESSAGE_BLOCK msg;
  TRACE(1, " %s ", __func__);
  if (app_poweroff_flag)
    return;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = ANC_EVENT_SYNC_INIT;
  app_mailbox_put(&msg);
}

void app_anc_do_init(void) {
  APP_MESSAGE_BLOCK msg;
  TRACE(1, " %s DO INIT", __func__);
  if (app_poweroff_flag)
    return;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = ANC_EVENT_INIT;
  app_mailbox_put(&msg);
}

void app_anc_send_howl_evt(uint32_t howl) {
  APP_MESSAGE_BLOCK msg;
  TRACE(2, " %s %d", __func__, howl);
  if (app_poweroff_flag)
    return;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = ANC_EVENT_HOWL_PROCESS;
  msg.msg_body.message_Param0 = howl;
  app_mailbox_put(&msg);
}

void app_anc_send_pwr_key_monitor_evt(uint8_t level) {
  APP_MESSAGE_BLOCK msg;
  TRACE(2, " %s %d", __func__, level);
  if (app_poweroff_flag)
    return;

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = ANC_EVENT_PWR_KEY_MONITOR;
  msg.msg_body.message_Param0 = level;
  app_mailbox_put(&msg);
}

extern void simple_player_delay_stop(void);

void app_anc_post_simplayer_stop_evt(void) {
  APP_MESSAGE_BLOCK msg;
  TRACE(1, " %s d", __func__);

  msg.mod_id = APP_MODUAL_ANC;
  msg.msg_body.message_id = SIMPLE_PLAYER_DELAY_STOP_EVT;
  msg.msg_body.message_Param0 = 0;
  app_mailbox_put(&msg);
}

bool anc_enabled(void) { return (anc_work_status == ANC_STATUS_ON); }

void app_anc_resample(uint32_t res_ratio, uint32_t *in, uint32_t *out,
                      uint32_t samples) {
  uint32_t flag = int_lock();
  for (int i = samples; i > 0; i--) {
    for (int j = 0; j < res_ratio; j++) {
      *(out + (i - 1) * res_ratio + j) = *(in + i - 1);
    }
  }
  int_unlock(flag);
}

void app_anc_select_coef(void) {
  TRACE(2, "enter %s %d\n", __FUNCTION__, __LINE__);

#ifdef ANC_FF_ENABLED
  anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                  ANC_FEEDFORWARD, ANC_GAIN_DELAY);
#endif

#ifdef ANC_FB_ENABLED
  anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                  ANC_FEEDBACK, ANC_GAIN_DELAY);
#endif

#ifdef AUDIO_ANC_FB_MC_HW
  anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                  ANC_MUSICCANCLE, ANC_GAIN_NO_DELAY);
#endif

  TRACE(2, "exit %s %d\n", __FUNCTION__, __LINE__);
}

void app_anc_enable(void) {
  TRACE(2, "enter %s %d\n", __FUNCTION__, __LINE__);
// anc_active_codec();
#ifndef __SIMPLE_INTERNAL_PLAYER_SUPPORT__
  analog_aud_codec_speaker_enable(true);
#endif
#ifdef ANC_FF_ENABLED
  anc_open(ANC_FEEDFORWARD);
  anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                  ANC_FEEDFORWARD, ANC_GAIN_DELAY);
#endif

#ifdef ANC_FB_ENABLED
  anc_open(ANC_FEEDBACK);
  anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                  ANC_FEEDBACK, ANC_GAIN_DELAY);
#endif

#ifdef AUDIO_ANC_FB_MC_HW
  anc_open(ANC_MUSICCANCLE);
  anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                  ANC_MUSICCANCLE, ANC_GAIN_NO_DELAY);
#endif

#ifdef AUDIO_ANC_FB_MC_HW
  int32_t gain_ch_l = 0;
  int32_t gain_ch_r = 0;

  anc_get_cfg_gain(&gain_ch_l, &gain_ch_r, ANC_MUSICCANCLE);
  anc_set_gain(gain_ch_l, gain_ch_r, ANC_MUSICCANCLE);
#endif

#if defined(ANC_WNR_ENABLED)
  if (is_sco_mode()) {
    anc_wnr_open(ANC_WNR_OPEN_MODE_CONFIGURE);
  } else {
    anc_wnr_open(ANC_WNR_OPEN_MODE_STANDALONE);
  }
#endif

#if defined(ANC_ASSIST_ENABLED)
  anc_assist_open(ANC_ASSIST_STANDALONE);
#endif

  TRACE(2, "exit %s %d\n", __FUNCTION__, __LINE__);
}

void app_anc_disable(void) {
  TRACE(2, "enter %s %d\n", __FUNCTION__, __LINE__);

#if defined(ANC_WNR_ENABLED)
  anc_wnr_close();
#endif

#if defined(ANC_ASSIST_ENABLED)
  anc_assist_close();
#endif

#ifdef AUDIO_ANC_FB_MC_HW
  anc_close(ANC_MUSICCANCLE);
#endif

#ifdef ANC_FF_ENABLED
  anc_close(ANC_FEEDFORWARD);
#endif

#ifdef ANC_FB_ENABLED
  anc_close(ANC_FEEDBACK);
#endif

  TRACE(2, "exit %s %d\n", __FUNCTION__, __LINE__);
}

static void anc_sample_rate_change(enum AUD_STREAM_T stream,
                                   enum AUD_SAMPRATE_T rate,
                                   enum AUD_SAMPRATE_T *new_play,
                                   enum AUD_SAMPRATE_T *new_cap) {
  enum AUD_SAMPRATE_T play_rate, cap_rate;

  if (anc_sample_rate[stream] != rate) {
#ifdef CHIP_BEST1000
    if (stream == AUD_STREAM_PLAYBACK) {
      play_rate = rate;
      cap_rate = rate * (anc_sample_rate[AUD_STREAM_CAPTURE] /
                         anc_sample_rate[AUD_STREAM_PLAYBACK]);
    } else {
      play_rate = rate / (anc_sample_rate[AUD_STREAM_CAPTURE] /
                          anc_sample_rate[AUD_STREAM_PLAYBACK]);
      cap_rate = rate;
    }
#else
    play_rate = rate;
    cap_rate = rate;
#ifdef ANC_FF_ENABLED
    anc_select_coef(play_rate, anc_coef_idx, ANC_FEEDFORWARD,
                    ANC_GAIN_NO_DELAY);
#endif

#ifdef ANC_FB_ENABLED
    anc_select_coef(play_rate, anc_coef_idx, ANC_FEEDBACK, ANC_GAIN_NO_DELAY);
#endif

#ifdef AUDIO_ANC_FB_MC_HW
    anc_select_coef(play_rate, anc_coef_idx, ANC_MUSICCANCLE,
                    ANC_GAIN_NO_DELAY);
#endif

#endif // CHIP_BEST1000

    TRACE(5, "%s: Update anc sample rate from %u/%u to %u/%u", __func__,
          anc_sample_rate[AUD_STREAM_PLAYBACK],
          anc_sample_rate[AUD_STREAM_CAPTURE], play_rate, cap_rate);

    if (new_play) {
      *new_play = play_rate;
    }
    if (new_cap) {
      *new_cap = cap_rate;
    }

    anc_sample_rate[AUD_STREAM_PLAYBACK] = play_rate;
    anc_sample_rate[AUD_STREAM_CAPTURE] = cap_rate;
  }
}

void app_anc_open_anc(void) {
  enum AUD_SAMPRATE_T playback_rate;
  enum AUD_SAMPRATE_T capture_rate;
  AF_ANC_HANDLER handler;

  TRACE(2, "enter %s %d\n", __FUNCTION__, __LINE__);

  handler = anc_sample_rate_change;

#ifdef __SIMPLE_INTERNAL_PLAYER_SUPPORT__
  app_start_player_by_anc();
#endif

  if (anc_sample_rate[AUD_STREAM_PLAYBACK] == AUD_SAMPRATE_NULL) {
#ifdef CHIP_BEST1000
    anc_sample_rate[AUD_STREAM_PLAYBACK] = AUD_SAMPRATE_96000;
    anc_sample_rate[AUD_STREAM_CAPTURE] = AUD_SAMPRATE_384000;
#else // !CHIP_BEST1000
    anc_sample_rate[AUD_STREAM_PLAYBACK] = AUD_SAMPRATE_48000;
    anc_sample_rate[AUD_STREAM_CAPTURE] = AUD_SAMPRATE_48000;
#endif
    anc_sample_rate[AUD_STREAM_PLAYBACK] =
        hal_codec_anc_convert_rate(anc_sample_rate[AUD_STREAM_PLAYBACK]);
    anc_sample_rate[AUD_STREAM_CAPTURE] =
        hal_codec_anc_convert_rate(anc_sample_rate[AUD_STREAM_CAPTURE]);
  }

  playback_rate = anc_sample_rate[AUD_STREAM_PLAYBACK];
  capture_rate = anc_sample_rate[AUD_STREAM_CAPTURE];

  pmu_anc_config(1);
  int result = 0;
#ifdef ANC_FF_ENABLED
  result = af_anc_open(ANC_FEEDFORWARD, playback_rate, capture_rate, handler);
  TRACE(2, "af_anc_open %s %d -> %d\n", __FUNCTION__, __LINE__, result);
  result = anc_open(ANC_FEEDFORWARD);
  TRACE(2, "anc_open %s %d -> %d\n", __FUNCTION__, __LINE__, result);
  result = anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                           ANC_FEEDFORWARD, ANC_GAIN_DELAY);
  TRACE(2, "anc_select_coef %s %d -> %d\n", __FUNCTION__, __LINE__, result);
#endif

#ifdef ANC_FB_ENABLED
  result = af_anc_open(ANC_FEEDBACK, playback_rate, capture_rate, handler);
  TRACE(2, "anc_open %s %d -> %d\n", __FUNCTION__, __LINE__, result);
  result = anc_open(ANC_FEEDBACK);
  TRACE(2, "anc_open %s %d -> %d\n", __FUNCTION__, __LINE__, result);
  result = anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                           ANC_FEEDBACK, ANC_GAIN_DELAY);
  TRACE(2, "anc_select_coef %s %d -> %d\n", __FUNCTION__, __LINE__, result);
#endif

#ifdef AUDIO_ANC_FB_MC_HW
  result = anc_open(ANC_MUSICCANCLE);
  TRACE(2, "anc_open %s %d -> %d\n", __FUNCTION__, __LINE__, result);
  result = anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                           ANC_MUSICCANCLE, ANC_GAIN_NO_DELAY);
  TRACE(2, "anc_select_coef %s %d -> %d\n", __FUNCTION__, __LINE__, result);
#endif

#if defined(AUDIO_ANC_TT_HW)
  anc_open(ANC_TALKTHRU);
  TRACE(2, "anc_open %s %d -> %d\n", __FUNCTION__, __LINE__, result);
  result = anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                           ANC_TALKTHRU, ANC_GAIN_NO_DELAY);
  TRACE(2, "anc_select_coef %s %d -> %d\n", __FUNCTION__, __LINE__, result);
#endif

#ifdef AUDIO_ANC_FB_MC_HW
  int32_t gain_ch_l = 0;
  int32_t gain_ch_r = 0;

  anc_get_cfg_gain(&gain_ch_l, &gain_ch_r, ANC_MUSICCANCLE);
  anc_set_gain(gain_ch_l, gain_ch_r, ANC_MUSICCANCLE);
#endif

#if defined(ANC_WNR_ENABLED)
  if (is_sco_mode()) {
    anc_wnr_open(ANC_WNR_OPEN_MODE_CONFIGURE);
  } else {
    anc_wnr_open(ANC_WNR_OPEN_MODE_STANDALONE);
  }
#endif

#if defined(ANC_ASSIST_ENABLED)
  anc_assist_open(ANC_ASSIST_STANDALONE);
#endif

  TRACE(2, "exit %s %d\n", __FUNCTION__, __LINE__);
}

void app_anc_close_anc(void) {
  TRACE(2, "enter %s %d\n", __FUNCTION__, __LINE__);
  anc_set_dac_pa_delay = false;
#ifdef __SUPPORT_ANC_SINGLE_MODE_WITHOUT_BT__
  if (anc_single_mode_is_on()) {
    analog_aud_codec_speaker_enable(false);
  }
#endif

#ifdef ANC_WNR_ENABLED
  anc_wnr_close();
#endif

#if defined(ANC_ASSIST_ENABLED)
  anc_assist_close();
#endif

#if defined(AUDIO_ANC_TT_HW)
  anc_close(ANC_TALKTHRU);
#endif

#ifdef ANC_FF_ENABLED
  anc_close(ANC_FEEDFORWARD);
  af_anc_close(ANC_FEEDFORWARD);
#endif

#ifdef ANC_FB_ENABLED
#if defined(AUDIO_ANC_FB_MC_HW)
  anc_close(ANC_MUSICCANCLE);
#endif
  anc_close(ANC_FEEDBACK);
  af_anc_close(ANC_FEEDBACK);
#endif

  pmu_anc_config(0);
#ifdef __SIMPLE_INTERNAL_PLAYER_SUPPORT__
  app_stop_player_by_anc();
#endif
  TRACE(2, "exit %s %d\n", __FUNCTION__, __LINE__);
}

void app_anc_bitrate_reopen(void) {
  TRACE(2, " %s status %d", __func__, anc_work_status);
  if (anc_work_status == ANC_STATUS_INIT_ON) {
    //        hal_codec_reconfig_pll_freq(playback_rate, capture_rate);
  } else if (anc_work_status == ANC_STATUS_ON) {
    //    hal_codec_reconfig_pll_freq(playback_rate, capture_rate);
  } else if (anc_work_status == ANC_STATUS_WAITING_ON) {
  } else {
    TRACE(0, "no deal situation.");
  }
}

void app_anc_status_change(void) {
#if defined(IBRT)
  ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();

  if (p_ibrt_ctrl->current_role == IBRT_SLAVE) {
    anc_coef_idx = anc_peer_coef_idx;
  }
#endif

  TRACE(3, "%s anc_work_status: %d anc_coef_idx: %d", __func__, anc_work_status,
        anc_coef_idx);

  switch (anc_work_status) {
  case ANC_STATUS_OFF:
    anc_work_status = ANC_STATUS_WAITING_ON;
    app_anc_timer_set(ANC_EVENT_OPEN, anc_switch_on_time);
    app_anc_open_anc();
    break;
  case ANC_STATUS_ON:

#if (ANC_COEF_LIST_NUM > 1)

#ifdef __BT_ANC_KEY__
    if (anc_status_sync_flag == false) {
      anc_coef_idx++;
    }
#endif

    if (anc_coef_idx < ANC_COEF_LIST_NUM) {
      TRACE(2, " %s set coef idx: %d ", __func__, anc_coef_idx);

#ifdef ANC_MODE_SWITCH_WITHOUT_FADE

#ifdef ANC_FF_ENABLED
      anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                      ANC_FEEDFORWARD, ANC_GAIN_NO_DELAY);
#endif
#ifdef ANC_FB_ENABLED
      anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                      ANC_FEEDBACK, ANC_GAIN_NO_DELAY);
#endif
#ifdef AUDIO_ANC_FB_MC_HW
      anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                      ANC_MUSICCANCLE, ANC_GAIN_NO_DELAY);
#endif

      // recommand to play "ANC SWITCH" prompt here...

#else
      osSignalSet(anc_fade_thread_tid, CHANGE_FROM_ANC_TO_TT_DIRECTLY);
#endif
    } else {
      anc_coef_idx = 0;
      app_anc_timer_set(ANC_EVENT_CLOSE, anc_close_delay_time);
      app_anc_gain_fadeout();
      anc_work_status = ANC_STATUS_WAITING_OFF;
    }
#else
    anc_coef_idx = 0;
    app_anc_timer_set(ANC_EVENT_CLOSE, anc_close_delay_time);
    app_anc_gain_fadeout();
    anc_work_status = ANC_STATUS_WAITING_OFF;
#endif
    break;
  case ANC_STATUS_INIT_ON:
    app_anc_select_coef();
    app_anc_gain_fadein();
    anc_work_status = ANC_STATUS_WAITING_ON;
    app_anc_timer_close();
    break;
  default:
    break;
  }
  if (anc_status_sync_flag == true)
    anc_status_sync_flag = false;
}

static int app_anc_handle_process(APP_MESSAGE_BODY *msg_body) {
  uint32_t evt = msg_body->message_id;
  uint32_t arg0 = msg_body->message_Param0;

  TRACE(4, " %s evt: %d, arg0: %d , anc status :%d", __func__, evt, arg0,
        anc_work_status);

  switch (evt) {
  case ANC_EVENT_INIT:
    // init anc_timer
    app_anc_init_timer();
    // init anc&open codec
#ifdef __AUDIO_SECTION_SUPPT__
    anc_load_cfg();
#endif

#ifdef __ANC_INIT_ON__
    app_anc_open_anc();
    anc_work_status = ANC_STATUS_INIT_ON;
    app_anc_timer_set(ANC_EVENT_CLOSE, anc_init_switch_off_time);
#else
    anc_work_status = ANC_STATUS_OFF;
#endif
#ifdef __ANC_STICK_SWITCH_USE_GPIO__
    if (app_anc_switch_get_val() == ANC_SWITCH_ON_LEVEL) {
      app_anc_switch_set_edge(ANC_SWITCH_ON_LEVEL);
      app_anc_status_post(ANC_SWITCH_ON_LEVEL);
    } else {
      app_anc_switch_set_edge(!(bool)ANC_SWITCH_ON_LEVEL);
    }
#endif
    // anc_coef_idx = 0;
    anc_fade_thread_tid = osThreadCreate(osThread(anc_fade_thread), NULL);
    break;
  case ANC_EVENT_FADE_IN:
  case ANC_EVENT_FADE_OUT:
    anc_gain_fade_handle();
    if (evt == ANC_EVENT_FADE_IN) {
      anc_work_status = ANC_STATUS_ON;
      // recommand to play "ANC ON" prompt here...
      app_voice_report(APP_STATUS_INDICATION_ALEXA_START,
                       0); // close latlatency mode
    }
    if (evt == ANC_EVENT_FADE_OUT) {
      anc_work_status = ANC_STATUS_INIT_ON;
      // recommand to play "ANC OFF" prompt here...
      app_voice_report(APP_STATUS_INDICATION_ALEXA_STOP,
                       0); // close latlatency mode
    }
    break;
  case ANC_EVENT_CHANGE_SAMPLERATE:
    app_anc_bitrate_reopen();
    break;
  case ANC_EVENT_CHANGE_STATUS:

#ifdef __ANC_STICK_SWITCH_USE_GPIO__
    osDelay(10);
    if (app_anc_switch_get_val() != (bool)arg0) { // debonce
      TRACE(0, "io level not equeue exit");
      break;
    }

#ifdef __SUPPORT_ANC_SINGLE_MODE_WITHOUT_BT__
    if (anc_single_mode_is_on()) {
      if (arg0 != ANC_SWITCH_ON_LEVEL) {
        TRACE(1, " Anc ON but exit %d ", app_init_done);
        if (app_init_done) {
          app_anc_shutdown = true;
          app_shutdown();
        } else {
          app_anc_timer_set(ANC_EVENT_SWITCH_KEY_DEBONCE,
                            anc_switch_key_debonce_time);
        }
        return 0;
      }
    }
#endif
    if (arg0 != ANC_SWITCH_ON_LEVEL)
      app_anc_switch_set_edge((!(bool)ANC_SWITCH_ON_LEVEL));
    else
      app_anc_switch_set_edge(ANC_SWITCH_ON_LEVEL);

    if (((arg0 == ANC_SWITCH_ON_LEVEL) && (anc_work_status == ANC_STATUS_ON)) ||
        ((arg0 != ANC_SWITCH_ON_LEVEL) &&
         (anc_work_status == ANC_STATUS_OFF))) {
      // status same, no handle
      TRACE(0, " Anc NOT ON, exit");
      return 0;
    }
#endif

#if defined(IBRT)
    if (((BOOL)arg0 == false) && (app_anc_work_status() == false)) {
      anc_coef_idx = 0;
      anc_peer_coef_idx = 0;
      anc_status_sync_flag = 0;
      return 0;
    }

    if (((BOOL)arg0 == true) && (app_anc_work_status() == true) &&
        (anc_coef_idx == anc_peer_coef_idx)) {
      anc_status_sync_flag = 0;
      return 0;
    }
#endif
    app_anc_status_change();

    break;
  case ANC_EVENT_SYNC_STATUS:
#if defined(IBRT)
    TRACE(4, "%s anc_work_status %d--->%d anc_coef_idx:%d ", __func__,
          anc_work_status, arg0, anc_coef_idx);

    if (ANC_STATUS_ON == arg0) {
      arg0 = 1;
    } else {
      arg0 = 0;
    }

    uint8_t buf[3] = {0};
    buf[0] = (uint8_t)arg0;
    buf[1] = (uint8_t)anc_coef_idx;
    buf[2] = false; // set peer anc_status_sync_flag = false
    tws_ctrl_send_cmd(APP_TWS_CMD_SYNC_ANC_STATUS, buf, 3);
#endif
    break;
  case ANC_EVENT_SYNC_INIT:
    break;
  case ANC_EVENT_HOWL_PROCESS:
    // disable anc,set max gain,enable anc
    {
      // uint32_t howl = arg0;
      if (anc_work_status == ANC_STATUS_ON) {
        //__anc_usb_app_howl_set_gain(howl);
      }
    }
    break;
#ifdef __SUPPORT_ANC_SINGLE_MODE_WITHOUT_BT__
  case ANC_EVENT_PWR_KEY_MONITOR:
    osDelay(10);

    if (app_pwr_key_monitor_get_val() != (bool)arg0) // debonce
      return 0;

    if ((bool)arg0) {
      app_anc_timer_set(ANC_EVENT_PWR_KEY_MONITOR_REBOOT,
                        anc_pwr_key_monitor_time);
      app_pwr_key_monitor_set_int_edge(1);
    } else {
      hwtimer_stop(anc_timerid);
      app_pwr_key_monitor_set_int_edge(0);
    }

    break;
#endif
  case SIMPLE_PLAYER_DELAY_STOP_EVT:
#ifdef __SIMPLE_INTERNAL_PLAYER_SUPPORT__
    simple_player_delay_stop();
#endif
    break;
  case SIMPLE_PLAYER_CLOSE_CODEC_EVT:
    app_anc_close_anc();
    anc_work_status = ANC_STATUS_OFF;
    break;
  default:
    break;
  }

  return 0;
}

static void anc_gain_fade_timer_handler(void *p) {
  TRACE(2, " %s , request %d ", __func__, anc_timer_request);
  switch (anc_timer_request) {
  case ANC_EVENT_OPEN:
    app_anc_gain_fadein();
    break;
  case ANC_EVENT_CLOSE:
    // real close
    // app_anc_close_anc();
    // anc_work_status = ANC_STATUS_OFF;
    app_anc_post_anc_codec_close();

    break;
  case ANC_EVENT_PWR_KEY_MONITOR_REBOOT:
    TRACE(0, " reboot !");
    hal_sw_bootmode_clear(HAL_SW_BOOTMODE_REBOOT);
    hal_sw_bootmode_clear(HAL_SW_BOOTMODE_REBOOT_ANC_ON);
    hal_sw_bootmode_set(HAL_SW_BOOTMODE_REBOOT_BT_ON);
    app_reset();
    break;
  case ANC_EVENT_SWITCH_KEY_DEBONCE:
    TRACE(0, " ANC SWITCH KEY ");
#ifdef __ANC_STICK_SWITCH_USE_GPIO__
    if (app_switch_callback)
      app_switch_callback(
          hal_gpio_pin_get_val((enum HAL_GPIO_PIN_T)ANC_SWITCH_PIN));
#endif
    break;
  default:
    break;
  }
  anc_timer_request = ANC_EVENT_NONE;
  hwtimer_stop(anc_timerid);
}

void app_anc_init_timer(void) {
  if (anc_timerid == NULL)
    anc_timerid = hwtimer_alloc((HWTIMER_CALLBACK_T)anc_gain_fade_timer_handler,
                                &anc_timer_request);
}

void app_anc_timer_set(uint32_t request, uint32_t delay) {
  TRACE(3, " %s request %d , delay %ds ", __func__, request,
        (TICKS_TO_MS(delay) / 1000));
  if (anc_timerid == NULL)
    return;
  anc_timer_request = request;
  hwtimer_stop(anc_timerid);
  hwtimer_start(anc_timerid, delay);
}

void app_anc_timer_close(void) {
  TRACE(3, " %s enter...", __func__);
  if (anc_timerid == NULL) {
    return;
  }

  anc_timer_request = ANC_EVENT_NONE;
  hwtimer_stop(anc_timerid);
}

#if defined(IBRT)
void app_anc_cmd_receive_process(uint8_t *buf, uint16_t len) {
  TRACE(1, "[%s] enter...", __func__);

  if (buf[0] == IBRT_ACTION_ANC_NOTIRY_MASTER_EXCHANGE_COEF) {
    switch (buf[1]) {
#ifdef __BT_ANC_KEY__
    case 0:
      app_anc_key(NULL, NULL);
      break; // slave invoke app_anc_key();
#endif
#ifndef __BT_ANC_KEY__
    case 1:
      app_anc_start();
      break; // slave invoke app_anc_start();
    case 2:
      app_anc_switch_coef(buf[2]);
      break; // slave invoke app_anc_switch_coef();
    case 3:
      app_anc_stop();
      break; // slave invoke app_anc_stop();
#endif
    default:
      TRACE(1, "[%s] cmd invalid...", __func__);
      break;
    }
  }
}

static void app_anc_notify_master_to_exchange_coef(uint8_t arg0, uint8_t arg1) {
  uint8_t buf[3] = {0};

  TRACE(3, "[%s] arg0:%d arg1:%d", __func__, arg0, arg1);

  buf[0] = IBRT_ACTION_ANC_NOTIRY_MASTER_EXCHANGE_COEF;
  buf[1] = arg0;
  buf[2] = arg1;

  app_ibrt_ui_send_user_action(buf, 3);
}
#endif

#ifdef __BT_ANC_KEY__
void app_anc_key(APP_KEY_STATUS *status, void *param) {
  TRACE(3, "%s anc_work_st:%d , timer:%d", __func__, anc_work_status,
        anc_timer_request);
  bool flag = app_anc_work_status();

#if defined(IBRT)
  app_anc_status_sync(!flag);
#endif
  app_anc_status_post(!flag);
}
#endif

#ifndef __BT_ANC_KEY__
int app_anc_start(void) {
  TRACE(1, "[%s] enter...", __func__);
  bool flag = app_anc_work_status();

  if (flag == true) {
    TRACE(1, "[%s] anc has been on...", __func__);
    return -1;
  }

#if defined(IBRT)
  ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();

  TRACE(2, "[%s] current_role: %d", __func__, p_ibrt_ctrl->current_role);
  if (p_ibrt_ctrl->current_role == IBRT_SLAVE) {
    app_anc_notify_master_to_exchange_coef(1, 0);
    return -1;
  }
  anc_coef_idx = 0;
  app_anc_status_sync(!flag);
#endif
  anc_coef_idx = 0;
  app_anc_status_post(!flag);

  return 0;
}

int app_anc_switch_coef(uint8_t index) {
  TRACE(1, "[%s] enter...", __func__);
  bool flag = app_anc_work_status();

  if (flag == false) {
    TRACE(1, "[%s] anc has been off...", __func__);
    return -1;
  }

  if (index == anc_coef_idx) {
    TRACE(1, "[%s] anc coef has been load...", __func__);
    return -1;
  }

#if defined(IBRT)
  ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();

  TRACE(2, "[%s] current_role: %d", __func__, p_ibrt_ctrl->current_role);
  if (p_ibrt_ctrl->current_role == IBRT_SLAVE) {
    app_anc_notify_master_to_exchange_coef(2, index);
    return -1;
  }
  anc_coef_idx = index;
  app_anc_status_sync(!flag);
#endif
  anc_coef_idx = index;
  app_anc_status_post(!flag);

  return 0;
}

int app_anc_stop(void) {
  TRACE(1, "[%s] enter...", __func__);
  bool flag = app_anc_work_status();

  if (flag == false) {
    TRACE(1, "[%s] anc has been off...", __func__);
    return -1;
  }

#if defined(IBRT)
  ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();

  TRACE(2, "[%s] current_role: %d", __func__, p_ibrt_ctrl->current_role);
  if (p_ibrt_ctrl->current_role == IBRT_SLAVE) {
    app_anc_notify_master_to_exchange_coef(3, 0);
    return -1;
  }
  anc_coef_idx = ANC_COEF_NUM;
  app_anc_status_sync(!flag);
#endif
  anc_coef_idx = ANC_COEF_NUM;
  app_anc_status_post(!flag);

  return 0;
}
#endif

void app_anc_ios_init(void) {
#ifdef __ANC_STICK_SWITCH_USE_GPIO__
  if (cfg_anc_switch.pin != HAL_IOMUX_PIN_NUM) {
    hal_iomux_init((struct HAL_IOMUX_PIN_FUNCTION_MAP *)&cfg_anc_switch, 1);
    hal_gpio_pin_set_dir((enum HAL_GPIO_PIN_T)cfg_anc_switch.pin,
                         HAL_GPIO_DIR_IN, 0);
  }
#endif
#ifdef __SUPPORT_ANC_SINGLE_MODE_WITHOUT_BT__
  if (cfg_pwr_key_monitor.pin != HAL_IOMUX_PIN_NUM) {
    hal_iomux_init((struct HAL_IOMUX_PIN_FUNCTION_MAP *)&cfg_pwr_key_monitor,
                   1);
    hal_gpio_pin_set_dir((enum HAL_GPIO_PIN_T)cfg_pwr_key_monitor.pin,
                         HAL_GPIO_DIR_IN, 0);
  }
  if (cfg_anc_led.pin != HAL_IOMUX_PIN_NUM) {
    hal_iomux_init((struct HAL_IOMUX_PIN_FUNCTION_MAP *)&cfg_anc_led, 1);
    hal_gpio_pin_set_dir((enum HAL_GPIO_PIN_T)cfg_anc_led.pin, HAL_GPIO_DIR_OUT,
                         0);
  }

#endif
#ifdef ANC_SWITCH_PIN
  uint8_t gpio_val = hal_gpio_pin_get_val(ANC_SWITCH_PIN);
  if (gpio_val) {
    app_anc_switch_turnled(true);
    TRACE(1, " %s turn on led", __func__);
  } else {
    app_anc_switch_turnled(false);
    TRACE(1, " %s turn off led", __func__);
  }
#endif
}

int app_anc_open_module(void) {
  TRACE(1, "%s ", __func__);
  // set app module
  app_set_threadhandle(APP_MODUAL_ANC, app_anc_handle_process);
  app_anc_do_init();
#ifdef __ANC_STICK_SWITCH_USE_GPIO__
  app_anc_switch_init(app_anc_status_post);
  app_anc_switch_set_edge(app_anc_switch_get_val());
#endif
#ifdef __SUPPORT_ANC_SINGLE_MODE_WITHOUT_BT__
  if (anc_single_mode_is_on()) {
    // app_pwr_key_monitor_init(app_anc_send_pwr_key_monitor_evt);
    //  app_pwr_key_monitor_set_int_edge(app_pwr_key_monitor_get_val());
  }
#endif

  return 0;
}

int app_anc_close_module(void) {
  TRACE(1, " %s ", __func__);

  anc_timer_request = ANC_EVENT_NONE;
  if (anc_timerid) {
    hwtimer_stop(anc_timerid);
    hwtimer_free(anc_timerid);
    anc_timerid = NULL;
  }
  if (app_anc_get_anc_status() != ANC_STATUS_OFF) {
    anc_work_status = ANC_STATUS_OFF;
    app_anc_disable();
    app_anc_close_anc();
  }
  app_set_threadhandle(APP_MODUAL_ANC, NULL);
  return 0;
}

enum AUD_SAMPRATE_T app_anc_get_play_rate(void) {
  return anc_sample_rate[AUD_STREAM_PLAYBACK];
}

bool app_anc_work_status(void) {
  // TRACE(2," %s st %d", __func__, anc_work_status);
  return (anc_work_status == ANC_STATUS_ON ||
          anc_work_status == ANC_STATUS_WAITING_ON);
}

uint32_t app_anc_get_anc_status(void) { return anc_work_status; }

void test_anc(void) {
  app_anc_open_anc();
  app_anc_enable();
}

void test_anc_switch_coef(void) {
  anc_coef_idx++;

  TRACE(2, " %s set coef idx: %d ", __func__, anc_coef_idx);

  if (ANC_STATUS_OFF == anc_work_status ||
      ANC_STATUS_INIT_ON == anc_work_status) {
    app_anc_status_change();
    anc_coef_idx = 0;
    return;
  }
  if (anc_coef_idx < (ANC_COEF_LIST_NUM)) {
#ifdef ANC_FF_ENABLED
    while (__anc_usb_app_fadeout(ANC_FEEDFORWARD))
      ;
#endif
#ifdef ANC_FB_ENABLED
    while (__anc_usb_app_fadeout(ANC_FEEDBACK))
      ;
#endif

    app_anc_disable();
    anc_select_coef(anc_sample_rate[AUD_STREAM_PLAYBACK], anc_coef_idx,
                    ANC_FEEDFORWARD, ANC_GAIN_DELAY);
    app_anc_enable();

#ifdef ANC_FF_ENABLED
    while (__anc_usb_app_fadein(ANC_FEEDFORWARD))
      ;
#endif
#ifdef ANC_FB_ENABLED
    while (__anc_usb_app_fadein(ANC_FEEDBACK))
      ;
#endif
  } else {
    anc_coef_idx = 0;
    app_anc_timer_set(ANC_EVENT_CLOSE, anc_close_delay_time);
    app_anc_gain_fadeout();
    anc_work_status = ANC_STATUS_WAITING_OFF;
  }
}

#if defined(IBRT)
void app_anc_sync_status(void) {
  uint8_t buf[3] = {0};

  bool flag = app_anc_work_status();

  buf[0] = (uint8_t)flag;

  if (flag == true) {
    buf[1] = (uint8_t)anc_coef_idx;
  } else {
    buf[1] = (uint8_t)ANC_COEF_NUM;
  }

  buf[2] = true; // set peer anc_status_sync_flag = true

  anc_peer_coef_idx = 0;

  TRACE(4, "%s anc_work_status:%d, anc_coef_idx:%d, anc_sync_status_flag:%d",
        __func__, buf[0], buf[1], buf[2]);
  ibrt_ctrl_t *p_ibrt_ctrl = app_tws_ibrt_get_bt_ctrl_ctx();

  if (p_ibrt_ctrl->current_role == IBRT_MASTER) {
    tws_ctrl_send_cmd(APP_TWS_CMD_SYNC_ANC_STATUS, buf, 3);
  }
}
#endif


================================================
FILE: apps/anc/src/peak_detector.c
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#include "peak_detector.h"
#include "math.h"

// #define PKD_FACTOR_UP   (0.6)
// #define PKD_FACTOR_DOWN (2.0)
// #define PKD_REDUCE_RATE (0.0335)    // -30dB

static enum AUD_BITS_T pkd_samp_bits;
static float pkd_alphaR = 0.0f;
static float pkd_alphaA = 0.0f;
static float pkd_factor1 = 0.0f;
static float pkd_factor2 = 0.0f;
static float pkd_reduce_rate = 1.0f;

#define FABS(x) ((x) >= 0.f ? (x) : -(x))
#define Max(a, b) ((a) > (b) ? (a) : (b))

// Depend on codec_dac_vol
// const float pkd_vol_multiple[18] = {0.089125, 0.0, 0.005623, 0.007943,
// 0.011220, 0.015849, 0.022387, 0.031623, 0.044668, 0.063096, 0.089125,
// 0.125893, 0.177828, 0.251189, 0.354813, 0.501187, 0.707946, 1.000000};

// static uint32_t test_num = 0;

// int app_bt_stream_local_volume_get(void);

// y = 20log(x)
static inline float convert_multiple_to_db(float multiple) {
  return 20 * (float)log10(multiple);
}

// x = 10^(y/20)
static inline float convert_db_to_multiple(float db) {
  return (float)pow(10, db / 20);
}

void peak_detector_init(void) {
  pkd_alphaR = 0.0f;
  pkd_alphaA = 0.0f;
  pkd_factor1 = 0.0f;
  pkd_factor2 = 0.0f;
  pkd_reduce_rate = 1.0f;
  // TRACE(3,"[%s] pkd_alphaR = %f, pkd_alphaA = %f", __func__,
  // (double)pkd_alphaR, (double)pkd_alphaA);
}

void peak_detector_setup(PEAK_DETECTOR_CFG_T *cfg) {
  pkd_samp_bits = cfg->bits;
  pkd_alphaR = (float)exp(-1 / (cfg->factor_down * cfg->fs));
  pkd_alphaA = (float)exp(-1 / (cfg->factor_up * cfg->fs));
  pkd_reduce_rate = convert_db_to_multiple(cfg->reduce_dB);
}

static void peak_detector_run_16bits(int16_t *buf, uint32_t len,
                                     float vol_multiple) {
  float normal_rate = 1.0;
  float tgt_rate = 1.0;

  for (uint32_t i = 0; i < len; i++) {
    pkd_factor1 = Max(buf[i], pkd_alphaR * pkd_factor1);
    pkd_factor2 = pkd_alphaA * pkd_factor2 + (1 - pkd_alphaA) * pkd_factor1;

    normal_rate = pkd_factor2 / 32768;

    tgt_rate = pkd_reduce_rate / normal_rate / vol_multiple;

    if (tgt_rate > 1.0) {
      tgt_rate = 1.0;
    }

    // rate += (tgt_rate - rate) / 10000.0;

    // if(pkd_factor2>)
    // {
    //  normal_rate = 0.25;
    // }
    // else
    // {
    //  normal_rate = 0.25;
    // }
    // normal_rate *= 1.0 - pkd_factor2/32768;

    buf[i] = (int16_t)(buf[i] * tgt_rate);
    // buf[i] = 0;
    //
    // TRACE(2,"%d, %d", buf[i], pkd_factor2);
  }

  // if(test_num == 500)
  // {
  //  test_num = 0;
  //  TRACE(0,"START>>>");
  //  TRACE(2,"vol_level = %d, pkd_vol_multiple = %f", vol_level,
  //  pkd_vol_multiple[vol_level]); TRACE(3,"buf = %d, pkd_alphaR = %f,
  //  pkd_alphaA = %f", buf[len-1], pkd_alphaR, pkd_alphaA);
  //  TRACE(4,"pkd_factor1 = %f, pkd_factor2 = %f, normal_rate = %f, tgt_rate =
  //  %f", pkd_factor1, pkd_factor2, normal_rate, tgt_rate); TRACE(0,"END<<<");
  //  // TRACE(7,"[%s] buf = %d, pkd_alphaR = %f, pkd_alphaA = %f, pkd_factor1 =
  //  %f, pkd_factor2 = %f, normal_rate = %f", __func__, buf[len-1], pkd_alphaR,
  //  pkd_alphaA, pkd_factor1, pkd_factor2, (1.0 - pkd_factor2/32768));
  // }

#if 0
    short sample;
    short sample_max = 0;
    short sample_min = 0;

    for (uint32_t i = 0; i < len; i++)
    {
        sample = buf[i];
        if(sample > sample_max)
        {
            sample_max = sample;
        }

        if(sample < sample_min)
        {
            sample_min = sample;
        }
    } 


    TRACE(2,"Max = %10d, Min = %10d",sample_max, sample_min);
#endif
}

static void peak_detector_run_24bits(int32_t *buf, uint32_t len,
                                     float vol_multiple) {
  float normal_rate = 1.0;
  float tgt_rate = 1.0;

  for (uint32_t i = 0; i < len; i++) {
    pkd_factor1 = Max(buf[i], pkd_alphaR * pkd_factor1);
    pkd_factor2 = pkd_alphaA * pkd_factor2 + (1 - pkd_alphaA) * pkd_factor1;

    normal_rate = pkd_factor2 / 32768;

    tgt_rate = pkd_reduce_rate / normal_rate / vol_multiple;

    if (tgt_rate > 1.0) {
      tgt_rate = 1.0;
    }

    // rate += (tgt_rate - rate) / 10000.0;

    // if(pkd_factor2>)
    // {
    //  normal_rate = 0.25;
    // }
    // else
    // {
    //  normal_rate = 0.25;
    // }
    // normal_rate *= 1.0 - pkd_factor2/32768;

    buf[i] = (int32_t)(buf[i] * tgt_rate);
    // buf[i] = 0;
    //
    // TRACE(2,"%d, %d", buf[i], pkd_factor2);
  }
}

void peak_detector_run(uint8_t *buf, uint32_t len, float vol_multiple) {
  // int vol_level = 0;

  if (pkd_samp_bits <= AUD_BITS_16) {
    len = len / sizeof(int16_t);
    peak_detector_run_16bits((int16_t *)buf, len, vol_multiple);
  } else {
    len = len / sizeof(int32_t);
    peak_detector_run_24bits((int32_t *)buf, len, vol_multiple);
  }

  // test_num++;

  // vol_level = app_bt_stream_local_volume_get();
}


================================================
FILE: apps/apptester/Makefile
================================================
cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))

obj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.cpp $(cur_dir)*.S))
ifeq ($(ANC_APP),1)
obj-y += ../../tests/anc_usb/anc_usb_app.c
endif
obj-y += ../../tests/anc_usb/usb_audio_app.c
obj-y += ../../tests/anc_usb/safe_queue.c
obj-y += ../../tests/anc_usb/memutils.c
obj-y += ../../tests/anc_usb/speech_process.c
obj-y := $(obj-y:.c=.o)
obj-y := $(obj-y:.cpp=.o)
obj-y := $(obj-y:.S=.o)

subdir-ccflags-y += \
	-Iutils/cqueue \
	-Iplatform/drivers/ana \
	-Iservices/audio_process \
	-Iservices/multimedia/rbcodec/inc \
	-Iservices/multimedia/audio/process/anc/include \
	-Iservices/multimedia/audio/process/filters/include \
	-Iservices/multimedia/audio/process/resample/include \
	-Iservices/multimedia/speech/inc \
    -Iservices/nv_section/include \
    -Iservices/nv_section/aud_section \
	-Iutils/hwtimer_list

CFLAGS_usb_audio_app.o += -DAUDIO_OUTPUT_VOLUME_DEFAULT=$(AUDIO_OUTPUT_VOLUME_DEFAULT)
CFLAGS_adda_loop_app.o += -DAUDIO_OUTPUT_VOLUME_DEFAULT=$(AUDIO_OUTPUT_VOLUME_DEFAULT)

ifeq ($(APP_TEST_AUDIO),1)
ccflags-y += -DAPP_TEST_AUDIO
endif

ANC_USB_CFG_FLAGS :=

# ANC option
ifeq ($(ANC_APP),1)
ANC_USB_CFG_FLAGS += -DANC_APP
endif

# USB audio option
ifeq ($(USB_AUDIO_APP),1)
ANC_USB_CFG_FLAGS += -DUSB_AUDIO_APP
endif

ifeq ($(USB_HIGH_SPEED),1)
ANC_USB_CFG_FLAGS += -DUSB_HIGH_SPEED
endif

ifeq ($(AUDIO_RESAMPLE),1)
ANC_USB_CFG_FLAGS += -D__AUDIO_RESAMPLE__
endif

ifeq ($(ADC_CH_SEP_BUFF),1)
ANC_USB_CFG_FLAGS += -DADC_CH_SEP_BUFF
endif


ANC_USB_CFG_FLAGS += $(UAUD_CFG_FLAGS)

# USB audio configuration
ifeq ($(USB_AUDIO_DYN_CFG),1)
ifneq ($(AUDIO_RESAMPLE),1)
SW_CAPTURE_RESAMPLE ?= 1
endif
endif

ifeq ($(AUDIO_PLAYBACK_24BIT),1)
ANC_USB_CFG_FLAGS += -DAUDIO_PLAYBACK_24BIT
endif

# DSD configuration
ifeq ($(HW_FIR_DSD_PROCESS),1)
ANC_USB_CFG_FLAGS += -D__HW_FIR_DSD_PROCESS__
endif

# EQ configuration
ifeq ($(HW_FIR_EQ_PROCESS),1)
ANC_USB_CFG_FLAGS += -D__HW_FIR_EQ_PROCESS__
endif

ifeq ($(HW_IIR_EQ_PROCESS),1)
ANC_USB_CFG_FLAGS += -D__HW_IIR_EQ_PROCESS__
endif

ifeq ($(SW_IIR_EQ_PROCESS),1)
ANC_USB_CFG_FLAGS += -D__SW_IIR_EQ_PROCESS__
endif

ifeq ($(SW_CAPTURE_RESAMPLE),1)
ANC_USB_CFG_FLAGS += -DSW_CAPTURE_RESAMPLE
endif

CFLAGS_app_audtest.o += $(ANC_USB_CFG_FLAGS)
CFLAGS_usb_audio_app.o += $(ANC_USB_CFG_FLAGS)
CFLAGS_anc_usb_app.o += $(ANC_USB_CFG_FLAGS)

ifeq ($(ANC_KEY_DOUBLE_CLICK_ON_OFF),1)
CFLAGS_anc_usb_app.o += -DANC_KEY_DOUBLE_CLICK_ON_OFF
endif

ifeq ($(ANC_FF_ENABLED),1)
CFLAGS_anc_usb_app.o += -DANC_FF_ENABLED
endif

ifeq ($(ANC_FB_ENABLED),1)
CFLAGS_anc_usb_app.o += -DANC_FB_ENABLED
endif

ifeq ($(AUDIO_SECTION_SUPPT),1)
CFLAGS_anc_usb_app.o += -D__AUDIO_SECTION_SUPPT__
endif

ifeq ($(ANC_INIT_OFF),1)
CFLAGS_anc_usb_app.o += -DANC_INIT_OFF
endif

ifeq ($(PC_CMD_UART),1)
CFLAGS_app_audtest.o += -D__PC_CMD_UART__
endif

ifeq ($(DELAY_STREAM_OPEN),1)
CFLAGS_usb_audio_app.o += -DDELAY_STREAM_OPEN
endif

ifeq ($(NOISE_GATING),1)
CFLAGS_usb_audio_app.o += -DNOISE_GATING
endif

ifeq ($(NOISE_REDUCTION),1)
CFLAGS_usb_audio_app.o += -DNOISE_REDUCTION
endif

ifeq ($(ANC_L_R_MISALIGN_WORKAROUND),1)
CFLAGS_usb_audio_app.o += -DANC_L_R_MISALIGN_WORKAROUND
endif

ifeq ($(ANDROID_ACCESSORY_SPEC),1)
CFLAGS_usb_audio_app.o += -DANDROID_ACCESSORY_SPEC
ifeq ($(ANDROID_VOICE_CMD_KEY),1)
CFLAGS_usb_audio_app.o += -DANDROID_VOICE_CMD_KEY
endif
endif

ifeq ($(DUAL_AUX_MIC_MORE_FILTER),1)
CFLAGS_usb_audio_app.o += -DDUAL_AUX_MIC_MORE_FILTER
endif

ifeq ($(FREQ_RESP_EQ),1)
CFLAGS_usb_audio_app.o += -DFREQ_RESP_EQ
endif

ifeq ($(KEEP_SAME_LATENCY),1)
CFLAGS_usb_audio_app.o += -DKEEP_SAME_LATENCY
endif

ifeq ($(USB_AUDIO_PWRKEY_TEST),1)
CFLAGS_usb_audio_app.o += -DUSB_AUDIO_PWRKEY_TEST
endif

ifeq ($(AUDIO_RESAMPLE),1)
# If neither best1000 nor best2000
ifeq ($(filter best1000 best2000,$(CHIP)),)
PLL_TUNE_SAMPLE_RATE ?= 1
endif
ifeq ($(PLL_TUNE_SAMPLE_RATE),1)
CFLAGS_usb_audio_app.o += -DPLL_TUNE_SAMPLE_RATE
endif
endif



================================================
FILE: apps/apptester/app_audtest.cpp
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#include "app_thread.h"
#include "cmsis_os.h"
#include "hal_trace.h"

#include "app_audtest_pattern.h"
#include "hal_timer.h"

#include "app_utils.h"
#include "audiobuffer.h"
#include "audioflinger.h"
#include "eq_export.h"
#include "hal_aud.h"
#include "stdbool.h"
#include <string.h>

#if defined(APP_TEST_AUDIO) && defined(ANC_APP)
#include "anc_usb_app.h"
#include "usb_audio_app.h"
#include "usb_audio_frm_defs.h"
//#include "dualadc_audio_app.h"
#endif

#define USB_AUDIO_PLAYBACK_BUFF_SIZE (FRAME_SIZE_PLAYBACK * 4)
#define USB_AUDIO_CAPTURE_BUFF_SIZE (FRAME_SIZE_CAPTURE * 4)

#define USB_AUDIO_RECV_BUFF_SIZE (FRAME_SIZE_RECV * 8)
#define USB_AUDIO_SEND_BUFF_SIZE (FRAME_SIZE_SEND * 8)

#define APP_TEST_PLAYBACK_BUFF_SIZE (128 * 20)
#define APP_TEST_CAPTURE_BUFF_SIZE (128 * 20)

#if (USB_AUDIO_PLAYBACK_BUFF_SIZE > APP_TEST_PLAYBACK_BUFF_SIZE)
#define REAL_PLAYBACK_BUFF_SIZE USB_AUDIO_PLAYBACK_BUFF_SIZE
#else
#define REAL_PLAYBACK_BUFF_SIZE APP_TEST_PLAYBACK_BUFF_SIZE
#endif

#if (USB_AUDIO_CAPTURE_BUFF_SIZE > APP_TEST_CAPTURE_BUFF_SIZE)
#define REAL_CAPTURE_BUFF_SIZE USB_AUDIO_CAPTURE_BUFF_SIZE
#else
#define REAL_CAPTURE_BUFF_SIZE APP_TEST_CAPTURE_BUFF_SIZE
#endif

#define ALIGNED4 ALIGNED(4)

static uint8_t ALIGNED4 app_test_playback_buff[REAL_PLAYBACK_BUFF_SIZE];
static uint8_t ALIGNED4 app_test_capture_buff[REAL_CAPTURE_BUFF_SIZE];

#if defined(APP_TEST_AUDIO) && defined(ANC_APP)
static uint8_t ALIGNED4 app_test_recv_buff[USB_AUDIO_RECV_BUFF_SIZE];
static uint8_t ALIGNED4 app_test_send_buff[USB_AUDIO_SEND_BUFF_SIZE];
#endif

uint32_t pcm_1ksin_more_data(uint8_t *buf, uint32_t len) {
  static uint32_t nextPbufIdx = 0;
  uint32_t remain_size = len;
  uint32_t curr_size = 0;
  static uint32_t pcm_preIrqTime = 0;
  ;
  uint32_t stime = 0;

  stime = hal_sys_timer_get();
  TRACE(3, "pcm_1ksin_more_data irqDur:%d readbuff:0x%08x %d\n ",
        TICKS_TO_MS(stime - pcm_preIrqTime), buf, len);
  pcm_preIrqTime = stime;

  //  TRACE(2,"[pcm_1ksin_more_data] len=%d nextBuf:%d\n", len, nextPbufIdx);
  if (remain_size > sizeof(sinwave)) {
    do {
      if (nextPbufIdx) {
        curr_size = sizeof(sinwave) - nextPbufIdx;
        memcpy(buf, &sinwave[nextPbufIdx / 2], curr_size);
        remain_size -= curr_size;
        nextPbufIdx = 0;
      } else if (remain_size > sizeof(sinwave)) {
        memcpy(buf + curr_size, sinwave, sizeof(sinwave));
        curr_size += sizeof(sinwave);
        remain_size -= sizeof(sinwave);
      } else {
        memcpy(buf + curr_size, sinwave, remain_size);
        nextPbufIdx = remain_size;
        remain_size = 0;
      }
    } while (remain_size);
  } else {
    if ((sizeof(sinwave) - nextPbufIdx) >= len) {
      memcpy(buf, &sinwave[nextPbufIdx / 2], len);
      nextPbufIdx += len;
    } else {
      curr_size = sizeof(sinwave) - nextPbufIdx;
      memcpy(buf, &sinwave[nextPbufIdx / 2], curr_size);
      nextPbufIdx = len - curr_size;
      memcpy(buf + curr_size, sinwave, nextPbufIdx);
    }
  }

  return 0;
}

uint32_t pcm_mute_more_data(uint8_t *buf, uint32_t len) {
  memset(buf, 0, len);
  return 0;
}

void da_output_sin1k(bool on) {
  static bool isRun = false;
  struct AF_STREAM_CONFIG_T stream_cfg;
  memset(&stream_cfg, 0, sizeof(stream_cfg));

  if (isRun == on)
    return;
  else
    isRun = on;
  TRACE(2, "%s %d\n", __func__, on);

  if (on) {
    stream_cfg.bits = AUD_BITS_16;
    stream_cfg.channel_num = AUD_CHANNEL_NUM_2;
    stream_cfg.sample_rate = AUD_SAMPRATE_44100;

    stream_cfg.device = AUD_STREAM_USE_INT_CODEC;
    stream_cfg.io_path = AUD_OUTPUT_PATH_SPEAKER;
    stream_cfg.vol = 16;

    stream_cfg.handler = pcm_1ksin_more_data;
    stream_cfg.data_ptr = app_test_playback_buff;
    stream_cfg.data_size = APP_TEST_PLAYBACK_BUFF_SIZE;

    af_stream_open(AUD_STREAM_ID_0, AUD_STREAM_PLAYBACK, &stream_cfg);
    af_stream_start(AUD_STREAM_ID_0, AUD_STREAM_PLAYBACK);
  } else {
    af_stream_stop(AUD_STREAM_ID_0, AUD_STREAM_PLAYBACK);
    af_stream_close(AUD_STREAM_ID_0, AUD_STREAM_PLAYBACK);
  }
}

void da_tester(uint8_t on) { da_output_sin1k(on); }

extern int voicecvsd_audio_init(void);
extern uint32_t voicecvsd_audio_more_data(uint8_t *buf, uint32_t len);
extern int get_voicecvsd_buffer_size(void);
extern int store_voice_pcm2cvsd(unsigned char *buf, unsigned int len);

static uint32_t pcm_data_capture(uint8_t *buf, uint32_t len) {
  uint32_t stime, etime;
  static uint32_t preIrqTime = 0;

  stime = hal_sys_timer_get();
  //  audio_buffer_set_stereo2mono_16bits(buf, len, 1);
  audio_buffer_set(buf, len);
  etime = hal_sys_timer_get();
  TRACE(4, "%s irqDur:%d fsSpend:%d, Len:%d", __func__,
        TICKS_TO_MS(stime - preIrqTime), TICKS_TO_MS(etime - stime), len);
  preIrqTime = stime;
  return 0;
}

static uint32_t pcm_data_playback(uint8_t *buf, uint32_t len) {
  uint32_t stime, etime;
  static uint32_t preIrqTime = 0;
  stime = hal_sys_timer_get();
  //  audio_buffer_get_mono2stereo_16bits(buf, len);
  audio_buffer_get(buf, len);
  etime = hal_sys_timer_get();
  TRACE(4, "%s irqDur:%d fsSpend:%d, Len:%d", __func__,
        TICKS_TO_MS(stime - preIrqTime), TICKS_TO_MS(etime - stime), len);
  preIrqTime = stime;
  return 0;
}

uint32_t pcm_cvsd_data_capture(uint8_t *buf, uint32_t len) {
  uint32_t stime, etime;
  static uint32_t preIrqTime = 0;

  // TRACE(1,"%s enter", __func__);
  stime = hal_sys_timer_get();
  len >>= 1;
  audio_stereo2mono_16bits(0, (uint16_t *)buf, (uint16_t *)buf, len);
  store_voice_pcm2cvsd(buf, len);
  etime = hal_sys_timer_get();
  TRACE(4, "%s exit irqDur:%d fsSpend:%d, add:%d", __func__,
        TICKS_TO_MS(stime - preIrqTime), TICKS_TO_MS(etime - stime), len);
  preIrqTime = stime;
  return 0;
}

uint32_t pcm_cvsd_data_playback(uint8_t *buf, uint32_t len) {
  int n;
  uint32_t stime, etime;
  static uint32_t preIrqTime = 0;

  // TRACE(1,"%s enter", __func__);
  stime = hal_sys_timer_get();
  pcm_1ksin_more_data(buf, len);
  voicecvsd_audio_more_data(buf, len);
  n = get_voicecvsd_buffer_size();
  etime = hal_sys_timer_get();
  TRACE(5, "%s exit irqDur:%d fsSpend:%d, get:%d remain:%d", __func__,
        TICKS_TO_MS(stime - preIrqTime), TICKS_TO_MS(etime - stime), len, n);
  preIrqTime = stime;
  return 0;
}

void adc_looptester(bool on, enum AUD_IO_PATH_T input_path,
                    enum AUD_SAMPRATE_T sample_rate) {
  struct AF_STREAM_CONFIG_T stream_cfg;

  static bool isRun = false;

  if (isRun == on)
    return;
  else
    isRun = on;

  if (on) {
    audio_buffer_init();
    memset(&stream_cfg, 0, sizeof(stream_cfg));

    stream_cfg.bits = AUD_BITS_16;
    stream_cfg.channel_num = AUD_CHANNEL_NUM_2;
    stream_cfg.sample_rate = sample_rate;

    stream_cfg.device = AUD_STREAM_USE_INT_CODEC;
    stream_cfg.io_path = input_path;
    stream_cfg.vol = 0x03;

    stream_cfg.handler = pcm_data_capture;

    stream_cfg.data_ptr = app_test_capture_buff;
    stream_cfg.data_size = APP_TEST_CAPTURE_BUFF_SIZE;
    af_stream_open(AUD_STREAM_ID_0, AUD_STREAM_CAPTURE, &stream_cfg);

    stream_cfg.handler = pcm_data_playback;
    stream_cfg.io_path = AUD_OUTPUT_PATH_SPEAKER;

    stream_cfg.data_ptr = app_test_playback_buff;
    stream_cfg.data_size = APP_TEST_PLAYBACK_BUFF_SIZE;
    af_stream_open(AUD_STREAM_ID_0, AUD_STREAM_PLAYBACK, &stream_cfg);

    af_stream_start(AUD_STREAM_ID_0, AUD_STREAM_PLAYBACK);
    af_stream_start(AUD_STREAM_ID_0, AUD_STREAM_CAPTURE);
  } else {
    af_stream_stop(AUD_STREAM_ID_0, AUD_STREAM_CAPTURE);
    af_stream_stop(AUD_STREAM_ID_0, AUD_STREAM_PLAYBACK);
    af_stream_close(AUD_STREAM_ID_0, AUD_STREAM_CAPTURE);
    af_stream_close(AUD_STREAM_ID_0, AUD_STREAM_PLAYBACK);
  }
}

#if defined(APP_TEST_AUDIO) && defined(ANC_APP)
void app_anc_usb_init(void) {
  app_sysfreq_req(APP_SYSFREQ_USER_APP_0, APP_SYSFREQ_52M);

  anc_usb_app_init(AUD_INPUT_PATH_MAINMIC, AUD_SAMPRATE_96000,
                   AUD_SAMPRATE_192000);

  struct USB_AUDIO_BUF_CFG cfg;

  memset(&cfg, 0, sizeof(cfg));
  cfg.play_buf = app_test_playback_buff;
  cfg.play_size = USB_AUDIO_PLAYBACK_BUFF_SIZE;
  cfg.cap_buf = app_test_capture_buff;
  cfg.cap_size = USB_AUDIO_CAPTURE_BUFF_SIZE;
  cfg.recv_buf = app_test_recv_buff;
  cfg.recv_size = USB_AUDIO_RECV_BUFF_SIZE;
  cfg.send_buf = app_test_send_buff;
  cfg.send_size = USB_AUDIO_SEND_BUFF_SIZE;

  usb_audio_app_init(&cfg);

  // dualadc_audio_app_init(app_test_playback_buff,
  // USB_AUDIO_PLAYBACK_BUFF_SIZE, app_test_capture_buff,
  // USB_AUDIO_CAPTURE_BUFF_SIZE);
}
#endif


================================================
FILE: apps/apptester/app_audtest.h
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#ifndef __APP_AUDTEST_H__
#define __APP_AUDTEST_H__

#include "audioflinger.h"
void da_output_sin1k(bool  on);
void adc_looptester(bool on,  uint8_t mode, enum AUD_SAMPRATE_T sample_rate);

#endif


================================================
FILE: apps/apptester/app_audtest_pattern.h
================================================
/***************************************************************************
 *
 * Copyright 2015-2019 BES.
 * All rights reserved. All unpublished rights reserved.
 *
 * No part of this work may be used or reproduced in any form or by any
 * means, or stored in a database or retrieval system, without prior written
 * permission of BES.
 *
 * Use of this work is governed by a license granted by BES.
 * This work contains confidential and proprietary information of
 * BES. which is protected by copyright, trade secret,
 * trademark and other intellectual property rights.
 *
 ****************************************************************************/
#ifndef __APP_AUDTEST_PATTERN_H__
#define __APP_AUDTEST_PATTERN_H__

#ifdef __cplusplus
extern "C" {
#endif

#define CODEC_TESTMODE (1)
#define CODEC_1KSIN (1)
#define CODEC_WHITENOISE (2)

#define CODEC_SAMPLERATE (44100)

#if (CODEC_SAMPLERATE == 48000)

#if (CODEC_TESTMODE == CODEC_1KSIN)
const int16_t sinwave[] = {
	0	   ,
	0	   ,
	4234   ,
	4234   ,
	8396   ,
	8396   ,
	12414  ,
	12414  ,
	16220  ,
	16220  ,
	19748  ,
	19748  ,
	22938  ,
	22938  ,
	25736  ,
	25736  ,
	28094  ,
	28094  ,
	29970  ,
	29970  ,
	31334  ,
	31334  ,
	32162  ,
	32162  ,
	32440  ,
	32440  ,
	32162  ,
	32162  ,
	31334  ,
	31334  ,
	29970  ,
	29970  ,
	28094  ,
	28094  ,
	25736  ,
	25736  ,
	22938  ,
	22938  ,
	19748  ,
	19748  ,
	16220  ,
	16220  ,
	12414  ,
	12414  ,
	8396   ,
	8396   ,
	4234   ,
	4234   ,
	0	   ,
	0	   ,
	-4234  ,
	-4234  ,
	-8396  ,
	-8396  ,
	-12414 ,
	-12414 ,
	-16220 ,
	-16220 ,
	-19748 ,
	-19748 ,
	-22938 ,
	-22938 ,
	-25736 ,
	-25736 ,
	-28094 ,
	-28094 ,
	-29970 ,
	-29970 ,
	-31334 ,
	-31334 ,
	-32162 ,
	-32162 ,
	-32440 ,
	-32440 ,
	-32162 ,
	-32162 ,
	-31334 ,
	-31334 ,
	-29970 ,
	-29970 ,
	-28094 ,
	-28094 ,
	-25736 ,
	-25736 ,
	-22938 ,
	-22938 ,
	-19748 ,
	-19748 ,
	-16220 ,
	-16220 ,
	-12414 ,
	-12414 ,
	-8396  ,
	-8396  ,
	-4234  ,
	-4234
};
#elif (CODEC_TESTMODE == CODEC_WHITENOISE)
const int16_t sinwave[] = {
-15137    , 
5197      ,
29897     ,
7339      ,
26187     ,
-16625    ,
1465      ,
20867     ,
5873      ,
11597     ,
-4271     ,
11251     ,
-2911     ,
-4837     ,
22165     ,
-10965    ,
23733     ,
-31833    ,
25389     ,
23105     ,
-8851     ,
13419     ,
-29179    ,
16799     ,
-18493    ,
-19735    ,
31841     ,
14091     ,
2509      ,
-18723    ,
-16523    ,
1551      ,
14723     ,
-5375     ,
20603     ,
-25865    ,
-18393    ,
11831     ,
8529      ,
16975     ,
-18917    ,
-24759    ,
-26227    ,
-8495     ,
-8403     ,
27429     ,
22549     ,
19941     ,
-18561    ,
-10873    ,
4407      ,
-19825    ,
-20269    ,
29757     ,
-7871     ,
-8461     ,
-28565    ,
5343      ,
-5221     ,
-27577    ,
15707     ,
17663     ,
-24995    ,
-11955    ,
-28831    ,
-2841     ,
29287     ,
-6333     ,
13895     ,
11471     ,
32764     ,
-29337    ,
20909     ,
19607     ,
-16431    ,
-21783    ,
-11927    ,
-12805    ,
20659     ,
3939      ,
13919     ,
335       ,
-26221    ,
-11823    ,
-13355    ,
-17223    ,
-24539    ,
-29173    ,
-3757     ,
30173     ,
27637     ,
14519     ,
-29459    ,
-16859    ,
-12805    ,
-15927    ,
15917     ,
-26257    ,
25791     ,
15739     ,
26967     ,
-22713    ,
13543     ,
-13381    ,
-19627    ,
-26975    ,
-20917    ,
-2517     ,
1537      ,
-9203     ,
30109     ,
-17253    ,
-19199    ,
8819      ,
-13709    ,
2043      ,
-9439     ,
28235     ,
-7709     ,
-17451    ,
-30677    ,
27473     ,
3485      ,
7751      ,
-10441    ,
-9023     ,
1919      ,
-12681    ,
-31341    ,
-22517    ,
14771     ,
401       ,
8715      ,
29201     ,
23363     ,
15929     ,
27847     ,
18139     ,
14637     ,
20103     ,
-87       ,
17357     ,
1029      ,
-24453    ,
-10471    ,
-17309    ,
-1529     ,
-13063    ,
-11417    ,
-11929    ,
-14935    ,
32067     ,
-13661    ,
-3411     ,
26819     ,
26345     ,
17127     ,
17217     ,
3095      ,
-27069    ,
27975     ,
22569     ,
-29839    ,
-16523    ,
30991     ,
18843     ,
5695      ,
-12845    ,
-10319    ,
-29005    ,
-17241    ,
27115     ,
-30451    ,
-25687    ,
16667     ,
-21007    ,
2131      ,
-17779    ,
1661      ,
-16193    ,
-3753     ,
5757      ,
29353     ,
-28859    ,
-2455     ,
29021     ,
-25189    ,
23691     ,
16047     ,
31765     ,
-23307    ,
24609     ,
-15115    ,
18745     ,
31787     ,
11029     ,
-12521    ,
-11689    ,
-28401    ,
2937      ,
5571      ,
1947      ,
7399      ,
9801      ,
-19231    ,
25105     ,
31245     ,
32752     ,
31843     ,
28769     ,
22021     ,
-21703    ,
-18013    ,
22009     ,
6163      ,
22219     ,
4401      ,
-19243    ,
21583     ,
28961     ,
-32453    ,
-1619     ,
-23735    ,
6909      ,
9297      ,
-32083    ,
-18927    ,
8293      ,
-13103    ,
-26445    ,
-291      ,
12315     ,
4269      ,
-19713    ,
-14819    ,
-30319    ,
-8749     ,
-649      ,
1037      ,
22885     ,
12023     ,
-26289    ,
-10541    ,
31833     ,
-1801     ,
-28593    ,
-4843     ,
-7995     ,
-5975     ,
-3451     ,
-17131    ,
16023     ,
2365      ,
5755      ,
-8127     ,
24009     ,
-5367     ,
29683     ,
27473     ,
-23727    ,
25323     ,
4383      ,
-25889    ,
7335      ,
31263     ,
-1453     ,
-21381    ,
-15949    ,
-22895    ,
-17335    ,
15433     ,
9539      ,
-7233     ,
22729     ,
-239      ,
19469     ,
-15355    ,
-21011    ,
12513     ,
-7647     ,
4739      ,
-14373    ,
-28647    ,
-31009    ,
7525      ,
5357      ,
15629     ,
26483     ,
16589     ,
-2949     ,
22043     ,
-8245     ,
-13799    ,
-26613    ,
-22463    ,
23057     ,
-13367    ,
-20729    ,
19505     ,
9373      ,
-1585     ,
-11017    ,
-30733    ,
30329     ,
9835      ,
14907     ,
-13067    ,
23113     ,
30589     ,
32581     ,
10917     ,
-18477    ,
-5013     ,
14919     ,
3467      ,
13289     ,
19557     ,
8051      ,
-23841    ,
7919      ,
5453      ,
17335     ,
-18271    ,
10691     ,
-31991    ,
29161     ,
29235     ,
6469      ,
18267     ,
2695      ,
-22163    ,
12355     ,
2619      ,
26097     ,
21561     ,
-30731    ,
19115     ,
12571     ,
-14677    ,
3833      ,
-18415    ,
-17211    ,
10643     ,
26311     ,
-25581    ,
-18631    ,
-611      ,
22437     ,
27881     ,
18559     ,
743       ,
4905      ,
8249      ,
2325      ,
23827     ,
-727      ,
22123     ,
-13529    ,
19431     ,
13109     ,
-2425     ,
-20921    ,
20577     ,
-30063    ,
21125     ,
30121     ,
5709      ,
15529     ,
27695     ,
-26413    ,
-1437     ,
-1521     ,
29293     ,
1757      ,
-31527    ,
-25617    ,
3883      ,
5155      ,
-20353    ,
11267     ,
-25179    ,
-30081    ,
22099     ,
31507     ,
-7871     ,
21509     ,
-27233    ,
-533      ,
21743     ,
-18379    ,
-28531    ,
10449     ,
-21767    ,
-23625    ,
21819     ,
377       ,
-27299    ,
-3443     ,
19295     ,
8069      ,
28327     ,
13527     ,
-433      ,
-11397    ,
-9403     ,
-6659     ,
-25687    ,
-21447    ,
-1179     ,
-29069    ,
-417      ,
4849      ,
17733     ,
-14365    ,
-25003    ,
13725     ,
-24555    ,
-25607    ,
15479     ,
-2051     ,
-10427    ,
13701     ,
-23725    ,
8967      ,
-413      ,
23619     ,
21549     ,
-29973    ,
-8845     ,
-19697    ,
30877     ,
25465     ,
-573      ,
12437     ,
-3937     ,
31533     ,
28485     ,
-13673    ,
-10959    ,
-27495    ,
-8595     ,
-13415    ,
18287     ,
-27039    ,
4733      ,
-13539    ,
-7141     ,
-13897    ,
27749     ,
-16291    ,
-19511    ,
-8373     ,
32285     ,
10117     ,
-4245     ,
-3381     ,
21111     ,
-20129    ,
29031     ,
17621     ,
32119     ,
30109     ,
11063     ,
-7307     ,
-29389    ,
8063      ,
30593     ,
-1771     ,
-3295     ,
3353      ,
-24413    ,
-1541     ,
-523      ,
-9979     ,
29661     ,
26691     ,
-1031     ,
18075     ,
14551     ,
26191     ,
7649      ,
2215      ,
-6713     ,
-12345    ,
12839     ,
23205     ,
-6141     ,
4361      ,
-12063    ,
-7047     ,
22807     ,
29995     ,
4121      ,
-8025     ,
-1951     ,
8807      ,
22695     ,
-765      ,
-16091    ,
32033     ,
29575     ,
-4619     ,
29999     ,
10577     ,
26543     ,
11305     ,
-3109     ,
25223     ,
16493     ,
-11059    ,
-19015    ,
-7591     ,
21563     ,
9281      ,
17569     ,
3425      ,
9237      ,
-31913    ,
2125      ,
-24909    ,
27477     ,
-24829    ,
16237     ,
-30247    ,
30731     ,
-32099    ,
32069     ,
19265     ,
25553     ,
11409     ,
-31809    ,
24387     ,
17703     ,
-27241    ,
-11773    ,
6027      ,
-3767     ,
-23947    ,
-16489    ,
-30947    ,
26247     ,
-2011     ,
31727     ,
-17215    ,
30495     ,
10911     ,
-13691    ,
1031      ,
-13165    ,
15879     ,
-11401    ,
25785     ,
-9345     ,
-3477     ,
-8035     ,
6353      ,
-8199     ,
-11791    ,
24345     ,
12533     ,
31325     ,
31129     ,
-645      ,
8043      ,
1199      ,
5237      ,
15953     ,
24985     ,
14449     ,
-32427    ,
22339     ,
-13       ,
15607     ,
6929      ,
-19287    ,
7289      ,
-18879    ,
-25809    ,
-1627     ,
18349     ,
-5037     ,
3883      ,
-11085    ,
-11253    ,
-23789    ,
22561     ,
-32559    ,
-8189     ,
-17771    ,
11537     ,
19207     ,
20077     ,
12287     ,
6029      ,
-2935     ,
25993     ,
-26925    ,
25337     ,
18759     ,
19563     ,
-23845    ,
30269     ,
-15601    ,
7933      ,
-9619     ,
-28671    ,
-28391    ,
-12175    ,
2381      ,
23905     ,
-9169     ,
-27585    ,
-29689    ,
25389     ,
-24783    ,
1431      ,
3007      ,
-20073    ,
-5057     ,
-15011    ,
-15727    ,
-9619     ,
-2491     ,
-14689    ,
-8093     ,
-24101    ,
-18661    ,
397       ,
10305     ,
24983     ,
-30185    ,
-15121    ,
24117     ,
-26981    ,
-27863    ,
24103     ,
-25191    ,
-28315    ,
19055     ,
20377     ,
12279     ,
-16217    ,
1107      ,
-12881    ,
-933      ,
-29055    ,
-12769    ,
-17839    ,
10035     ,
18489     ,
30483     ,
-10541    ,
-1383     ,
2167      ,
7679      ,
25721     ,
-20675    ,
7155      ,
7007      ,
-5275     ,
11689     ,
-10051    ,
-24593    ,
24601     ,
24623     ,
24543     ,
-8255     ,
24419     ,
11563     ,
16815     ,
8665      ,
-18209    ,
-19989    ,
31855     ,
-29627    ,
-19       ,
-10749    ,
-12907    ,
1199      ,
23333     ,
-12513    ,
-12933    ,
-643      ,
19025     ,
-21151    ,
-12899    ,
-30875    ,
-25879    ,
-30663    ,
-3769     ,
32647     ,
17155     ,
25531     ,
30939     ,
12801     ,
23253     ,
26233     ,
-18565    ,
18699     ,
-4961     ,
30675     ,
-21683    ,
24713     ,
-11467    ,
-8483     ,
-20437    ,
5681      ,
24297     ,
-1621     ,
17627     ,
-4593     ,
-1787     ,
-23245    ,
23245     ,
-7249     ,
32201     ,
28055     ,
10319     ,
-85       ,
-31519    ,
7947      ,
-2747     ,
-13885    ,
20567     ,
-12503    ,
-9631     ,
-4227     ,
-26093    ,
-2365     ,
-5411     ,
-2255     ,
-2097     ,
-19391    ,
-16207    ,
22447     ,
3467      ,
-12677    ,
-7353     ,
-13241    ,
18065     ,
-28665    ,
191       ,
15729     ,
19681     ,
4895      ,
29085     ,
5593      ,
-2261     ,
5609      ,
-257      ,
23547     ,
-6831     ,
-4255     ,
25439     ,
26689     ,
-31919    ,
-17249    ,
32193     ,
-28783    ,
-21817    ,
24253     ,
-20617    ,
-26007    ,
-25889    ,
24869     ,
23623     ,
24697     ,
32465     ,
24691     ,
1335      ,
24761     ,
15063     ,
2501      ,
-2635     ,
-20989    ,
-18521    ,
19091     ,
-1189     ,
2089      ,
25703     ,
-14069    ,
8219      ,
31115     ,
10025     ,
15595     ,
-8447     ,
20787     ,
29665     ,
-16177    ,
-13461    ,
-11923    ,
-15905    ,
-19433    ,
8885      ,
27359     ,
6081      ,
17713     ,
16515     ,
-9193     ,
-6665     ,
15481     ,
28009     ,
3511      ,
-6229     ,
8085      ,
45        ,
759       ,
16971     ,
17727     ,
18807     ,
-18737    ,
-25747    ,
-3669     ,
16915     ,
15749     ,
23897     ,
4953      ,
29599     ,
711       ,
-7689     ,
-18327    ,
5067      ,
31813     ,
-17335    ,
-11135    ,
-13813    ,
10435     ,
-10139    ,
28433     ,
6101      ,
13243     ,
-22037    ,
-11717    ,
-9393     ,
-27281    ,
8445      ,
-11737    ,
-7019     ,
1917      ,
-25159    ,
-15149    ,
5475      ,
-23041    ,
-26069    ,
17017     ,
855       ,
-27361    ,
17103     ,
18009     ,
-27481    ,
-31953    ,
-19071    ,
-14305    ,
-28843    ,
24387     ,
7927      ,
26027     ,
-27927    ,
7239      ,
28347     ,
13687     ,
29865     ,
-10091    ,
-9823     ,
22889     ,
30295     ,
16913     ,
-7491     ,
27179     ,
20317     ,
-28989    ,
8931      ,
21247     ,
-32627    ,
-7709     ,
-31085    ,
-18907    ,
-5543     ,
30085     ,
14973     ,
29087     ,
7563      ,
24731     ,
-399      ,
23709     ,
24183     ,
20893     ,
5849      ,
-10939    ,
-11589    ,
5531      ,
-27469    ,
14101     ,
-11917    ,
17363     ,
11269     ,
-11853    ,
-12815    ,
-6703     ,
20699     ,
30801     ,
-11019    ,
29689     ,
-11591    ,
16757     ,
5221      ,
-335      ,
-20843    ,
-28833    ,
25991     ,
-9241     ,
20307     ,
-1829     ,
20921     ,
-20167    ,
-2889     ,
10903     ,
-30301    ,
12927     ,
30943     ,
22785     ,
18165     ,
27885     ,
11323     ,
23191     ,
-28509    ,
-2393     ,
9         ,
713       ,
-9841     ,
-9511     ,
-18619    ,
-10935    ,
-3633     ,
-26031    ,
22057     ,
-22047    ,
-15779    ,
6293      ,
-30687    ,
22743     ,
-13485    ,
-12937    ,
13377     ,
1977      ,
-9055     ,
4921      ,
-1981     ,
11963     ,
325       ,
-5863     ,
-15881    ,
-4469     ,
5383      ,
621       ,
16197     ,
-12623    ,
-859      ,
31295     ,
23707     ,
31837     ,
-1889     ,
863       ,
-30227    ,
-24125    ,
2647      ,
-4869     ,
-473      ,
28149     ,
-7197     ,
-11329    ,
-20185    ,
-6851     ,
23083     ,
22373     ,
17463     ,
-28181    ,
-11851    ,
-21299    ,
-28413    ,
-21065    ,
-25133    ,
25757     ,
5909      ,
23447     ,
-13731    ,
15951     ,
-63       ,
2577      ,
18413     ,
24525     ,
-3921     ,
-27109    ,
-3439     ,
-13937    ,
25795     ,
18031     ,
27395     ,
24357     ,
-15457    ,
14179     ,
14951     ,
23649     ,
-4203     ,
20289     ,
14463     ,
-28961    ,
-32221    ,
21281     ,
-21407    ,
11301     ,
28395     ,
13375     ,
8119      ,
-25541    ,
17701     ,
11729     ,
23659     ,
4287      ,
-14433    ,
-13467    ,
-29461    ,
16513     ,
4913      ,
28597     ,
-2347     ,
8089      ,
2999      ,
29693     ,
18493     ,
-5119     ,
18307     ,
30679     ,
-4263     ,
26283     ,
12637     ,
-1645     ,
29887     ,
-28393    ,
-26375    ,
-12531    ,
20505     ,
-14481    ,
27111     ,
-26879    ,
12133     ,
-28895    ,
-16103    ,
-17683    ,
10399     ,
-3603     ,
6351      ,
6497      ,
-12789    ,
-17015    ,
-15595    ,
-3875     ,
-25379    ,
32687     ,
27321     ,
8989      ,
-16775    ,
-26945    ,
-11581    ,
26885     ,
-27605    ,
11979     ,
-29585    ,
-28955    ,
1373      ,
-31941    ,
-9307     ,
20827     ,
2125      ,
15581     ,
-32279    ,
-3411     ,
23883     ,
17537     ,
-22559    ,
8343      ,
-2965     ,
-7669     ,
-25281    ,
17075     ,
-2623     ,
-32748    ,
-22713    ,
-14017    ,
-7145     ,
-5119     ,
-27209    ,
-27519    ,
-11739    ,
27277     ,
22095     ,
3227      ,
8779      ,
30963     ,
16059     ,
483       ,
-14137    ,
-28035    ,
17689     ,
-4675     ,
-30613    ,
-11617    ,
-8479     ,
-21519    ,
8665      ,
-13431    ,
-16789    ,
17539     ,
-4803     ,
26953     ,
9953      ,
-8693     ,
-10629    ,
14679     ,
3767      ,
28813     ,
13301     ,
-4419     ,
-14173    ,
20693     ,
28595     ,
31387     ,
27413     ,
11337     ,
-1237     ,
-28335    ,
-20943    ,
-29375    ,
-31379    ,
-3059     ,
30787     ,
32742     ,
-5149     ,
22243     ,
-12099    ,
28545     ,
-8831     ,
15211     ,
29099     ,
-11169    ,
-22395    ,
-26667    ,
-20569    ,
-13799    ,
10923     ,
-23937    ,
-4007     ,
9849      ,
23523     ,
-26091    ,
26477     ,
10445     ,
27537     ,
-7653     ,
21001     ,
22973     ,
-6087     ,
19479     ,
26815     ,
-19541    ,
-5695     ,
-6887     ,
-16361    ,
-21631    ,
-18907    ,
8153      ,
-12431    ,
12811     ,
-10063    ,
-19627    ,
-10611    ,
17883     ,
9139      ,
1503      ,
22907     ,
11661     ,
-27457    ,
31931     ,
-5349     ,
-3407     ,
-27819    ,
-30665    ,
-507      ,
13589     ,
-32209    ,
-15299    ,
-3049     ,
-4437     ,
6885      ,
1395      ,
9305      ,
16341     ,
-29647    ,
-21807    ,
3969      ,
-9153     ,
-11613    ,
2995      ,
31465     ,
12353     ,
17369     ,
23161     ,
-22013    ,
-10585    ,
-15303    ,
-11367    ,
28243     ,
30487     ,
-24793    ,
-28355    ,
17899     ,
-23325    ,
31163     ,
-9387     ,
16475     ,
-10655    ,
22525     ,
19503     ,
-7631     ,
3265      ,
11423     ,
-24169    ,
-16661    ,
17515     ,
-5331     ,
-28057    ,
371       ,
17875     ,
-27445    ,
-32607    ,
-25833    ,
-4401     ,
14187     ,
24583     ,
20733     ,
-29581    ,
22405     ,
-22221    ,
24605     ,
23911     ,
-17325    ,
-20171    ,
-4165     ,
-11069    ,
5761      ,
15773     ,
2653      ,
-19105    ,
31085     ,
-21213    ,
21829     ,
-25169    ,
7897      ,
-29517    ,
15975     ,
7201      ,
27943     ,
-3829     ,
-10019    ,
-7189     ,
-18419    ,
27857     ,
8171      ,
14951     ,
-19499    ,
-1235     ,
-10135    ,
13551     ,
4873      ,
-18723    ,
-14137    ,
-8401     ,
18101     ,
-18991    ,
32635     ,
-7681     ,
-9957     ,
-7871     ,
24575     ,
-15683    ,
23277     ,
8775      ,
11847     ,
21285     ,
23297     ,
-17675    ,
-12099    ,
27045     ,
24717     ,
9195      ,
-32593    ,
31287     ,
24539     ,
18037     ,
8533      ,
10169     ,
-24185    ,
27419     ,
-2757     ,
26059     ,
-27599    ,
-19259    ,
27203     ,
17179     ,
-32581    ,
-32703    ,
13337     ,
-3001     ,
-26375    ,
-32655    ,
27949     ,
14127     ,
22767     ,
-4403     ,
-2525     ,
-22829    ,
-19833    ,
-22385    ,
-13349    ,
6055      ,
-1073     ,
-28615    ,
-29735    ,
-27547    ,
6051      ,
3003      ,
-8381     ,
4983      ,
-12047    ,
-2299     ,
1119      ,
31927     ,
-8079     ,
-7397     ,
11905     ,
6109      ,
-27435    ,
-1609     ,
-2935     ,
-1205     ,
-27257    ,
23899     ,
-31271    ,
-27805    ,
-18465    ,
24037     ,
-8755     ,
-9621     ,
24285     ,
22959     ,
-21069    ,
22743     ,
23901     ,
-23773    ,
13641     ,
-31191    ,
-11563    ,
17109     ,
-15959    ,
-23987    ,
-1403     ,
-4587     ,
2759      ,
-24733    ,
25913     ,
2577      ,
10097     ,
13351     ,
-27275    ,
4963      ,
20407     ,
-20805    ,
30265     ,
16943     ,
9713      ,
-24567    ,
-23503    ,
-15683    ,
-16847    ,
-2151     ,
369       ,
23175     ,
7223      ,
-22557    ,
-29783    ,
-11813    ,
24561     ,
27441     ,
-4893     ,
-1551     ,
22643     ,
-16147    ,
-16719    ,
-22655    ,
-19101    ,
-17535    ,
-2059     ,
31191     ,
-28925    ,
-18779    ,
32009     ,
-14733    ,
31893     ,
-29113    ,
19069     ,
-32479    ,
-3735     ,
28113     ,
12885     ,
30855     ,
6207      ,
-12273    ,
-23629    ,
-16571    ,
-6829     ,
-14463    ,
29985     ,
-26223    ,
-26943    ,
10029     ,
10553     ,
-14527    ,
23443     ,
-23543    ,
-23065    ,
-32139    ,
22819     ,
-31043    ,
-10727    ,
2715      ,
-14555    ,
1547      ,
11777     ,
5145      ,
23059     ,
-7777     ,
-30267    ,
-2979     ,
-19411    ,
21867     ,
24247     ,
-7567     ,
5355      ,
-641      ,
-18667    ,
9243      ,
-265      ,
-15781    ,
-4041     ,
32627     ,
3241      ,
26063     ,
-19635    ,
-14091    ,
-21769    ,
-14257    ,
8341      ,
-6623     ,
-3337     ,
32457     ,
-23275    ,
7309      ,
22985     ,
-12027    ,
29391     ,
1411      ,
28449     ,
-18317    ,
4991      ,
-493      ,
25135     ,
-2169     ,
3531      ,
27563     ,
-31453    ,
-7787     ,
5381      ,
-21191    ,
-30953    ,
-5341     ,
-17575    ,
4275      ,
-25447    ,
-25917    ,
7817      ,
-23237    ,
20115     ,
-3475     ,
-30933    ,
16823     ,
10189     ,
-5801     ,
29269     ,
-26655    ,
-1825     ,
3655      ,
-543      ,
-21533    ,
-5457     ,
-5517     ,
12059     ,
-30603    ,
5983      ,
15573     ,
3071      ,
-30871    ,
-7723     ,
-23035    ,
-269      ,
1741      ,
-15457    ,
-9079     ,
31991     ,
-7553     ,
-13953    ,
443       ,
26209     ,
-30139    ,
30291     ,
12055     ,
6681      ,
3175      ,
17559     ,
-11245    ,
-19635    ,
-4925     ,
32343     ,
-897      ,
27047     ,
8297      ,
-23637    ,
5969      ,
-29687    ,
1457      ,
6061      ,
22023     ,
3525      ,
-20265    ,
19443     ,
15483     ,
7761      ,
25863     ,
8835      ,
31037     ,
-15487    ,
-28153    ,
-16817    ,
-24985    ,
-4541     ,
11841     ,
31275     ,
-11525    ,
465       ,
-15009    ,
15941     ,
5297      ,
17771     ,
4963      ,
-5087     ,
8795      ,
14483     ,
-31677    ,
6407      ,
-22855    ,
16827     ,
28665     ,
-12535    ,
-17463    ,
-20597    ,
27429     ,
-29587    ,
24235     ,
-31603    ,
-31717    ,
14767     ,
-5135     ,
1385      ,
-15233    ,
19957     ,
15481     ,
-32351    ,
-12447    ,
-9721     ,
31433     ,
20161     ,
-3121     ,
-20025    ,
18655     ,
28193     ,
-29709    ,
27691     ,
20111     ,
-10989    ,
161       ,
29107     ,
-14243    ,
-12385    ,
18813     ,
-11935    ,
11981     ,
30145     ,
16773     ,
5169      ,
-29119    ,
-21737    ,
-22477    ,
-14571    ,
-22703    ,
-24291    ,
10003     ,
-3229     ,
28573     ,
21479     ,
13267     ,
15831     ,
2863      ,
-1703     ,
9963      ,
-7157     ,
-10677    ,
-9507     ,
24225     ,
20583     ,
-26679    ,
-28265    ,
-14665    ,
31903     ,
29679     ,
7463      ,
-25493    ,
-9561     ,
-18491    ,
-13095    ,
-14553    ,
-973      ,
5361      ,
29535     ,
-25211    ,
-20317    ,
26127     ,
-8947     ,
28403     ,
-11897    ,
-27769    ,
137       ,
-22071    ,
30095     ,
-20255    ,
-7669     ,
-2593     ,
-15867    ,
-5463     ,
-24305    ,
7073      ,
4805      ,
23737     ,
-22385    ,
4015      ,
-20293    ,
26907     ,
31167     ,
-1291     ,
-12597    ,
-22691    ,
2367      ,
-26823    ,
1375      ,
1129      ,
9943      ,
-18373    ,
1101      ,
10973     ,
-6229     ,
22865     ,
-19627    ,
-13341    ,
-29
Download .txt
gitextract_cx4f_tq7/

├── .devcontainer/
│   └── devcontainer.json
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── build-and-push-to-registry.yml
│       └── build-firmware.yml
├── .gitignore
├── Dockerfile
├── Makefile
├── README.md
├── apps/
│   ├── Makefile
│   ├── anc/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   ├── anc_assist.h
│   │   │   ├── anc_wnr.h
│   │   │   ├── app_anc.h
│   │   │   └── peak_detector.h
│   │   └── src/
│   │       ├── anc_assist.c
│   │       ├── anc_wnr.c
│   │       ├── app_anc.c
│   │       └── peak_detector.c
│   ├── apptester/
│   │   ├── Makefile
│   │   ├── app_audtest.cpp
│   │   ├── app_audtest.h
│   │   ├── app_audtest_pattern.h
│   │   ├── audiobuffer.c
│   │   └── audiobuffer.h
│   ├── audioplayers/
│   │   ├── Makefile
│   │   ├── a2dp_decoder/
│   │   │   ├── Makefile
│   │   │   ├── a2dp_decoder.cpp
│   │   │   ├── a2dp_decoder.h
│   │   │   ├── a2dp_decoder_aac_lc.cpp
│   │   │   ├── a2dp_decoder_cp.c
│   │   │   ├── a2dp_decoder_cp.h
│   │   │   ├── a2dp_decoder_example.cpp
│   │   │   ├── a2dp_decoder_internal.h
│   │   │   ├── a2dp_decoder_ldac.cpp
│   │   │   ├── a2dp_decoder_lhdc.cpp
│   │   │   ├── a2dp_decoder_sbc.cpp
│   │   │   ├── a2dp_decoder_scalable.cpp
│   │   │   └── a2dp_decoder_trace.h
│   │   ├── a2dpplay.cpp
│   │   ├── app_audio.cpp
│   │   ├── app_audio.h
│   │   ├── bt_sco_chain.c
│   │   ├── bt_sco_chain.h
│   │   ├── bt_sco_chain_cfg.h
│   │   ├── bt_sco_chain_cfg_default.c
│   │   ├── bt_sco_chain_cp.c
│   │   ├── bt_sco_chain_cp.h
│   │   ├── bt_sco_chain_thirdparty.c
│   │   ├── bt_sco_chain_thirdparty_alango.c
│   │   ├── bt_sco_chain_tuning.c
│   │   ├── bt_sco_chain_tuning.h
│   │   ├── cvsdplay.cpp
│   │   ├── digmici2splay.cpp
│   │   ├── flacplay.cpp
│   │   ├── fmradio.cpp
│   │   ├── fmradio.h
│   │   ├── msbcplay.cpp
│   │   ├── plc_utils.c
│   │   ├── plc_utils.h
│   │   ├── rbplay/
│   │   │   ├── rb_ctl.cpp
│   │   │   ├── rb_ctl.h
│   │   │   ├── rbpcmbuf.cpp
│   │   │   ├── rbpcmbuf.h
│   │   │   ├── rbplay.cpp
│   │   │   ├── rbplay.h
│   │   │   ├── rbplaysd.cpp
│   │   │   ├── rbplaysd.h
│   │   │   └── utils.h
│   │   ├── voice_test.c
│   │   ├── voicebtpcmplay.cpp
│   │   ├── voicebtpcmplay_sco_dma_snapshot.cpp
│   │   └── wavplay.cpp
│   ├── battery/
│   │   ├── Makefile
│   │   ├── app_battery.cpp
│   │   └── app_battery.h
│   ├── cmd/
│   │   ├── Makefile
│   │   ├── app_cmd.cpp
│   │   └── app_cmd.h
│   ├── common/
│   │   ├── Makefile
│   │   ├── app_spec_ostimer.cpp
│   │   ├── app_spec_ostimer.h
│   │   ├── app_thread.c
│   │   ├── app_thread.h
│   │   ├── app_utils.c
│   │   ├── app_utils.h
│   │   ├── randfrommic.c
│   │   └── randfrommic.h
│   ├── factory/
│   │   ├── 1k_2ch_44k_16bit.txt
│   │   ├── 1k_2ch_48k_16bit.txt
│   │   ├── Makefile
│   │   ├── app_factory.cpp
│   │   ├── app_factory.h
│   │   ├── app_factory_audio.cpp
│   │   ├── app_factory_audio.h
│   │   ├── app_factory_bt.cpp
│   │   ├── app_factory_bt.h
│   │   ├── app_factory_cdc_comm.c
│   │   ├── app_factory_cdc_comm.h
│   │   ├── sys_api_cdc_comm.c
│   │   └── sys_api_cdc_comm.h
│   ├── key/
│   │   ├── Makefile
│   │   ├── app_key.cpp
│   │   └── app_key.h
│   ├── main/
│   │   ├── Makefile
│   │   ├── app_status_ind.h
│   │   ├── apps.cpp
│   │   ├── apps.h
│   │   ├── apps_tester.cpp
│   │   ├── common_apps_imports.h
│   │   ├── gfps.cpp
│   │   ├── ibrt.cpp
│   │   ├── ibrt.h
│   │   ├── key_handler.cpp
│   │   ├── key_handler.h
│   │   ├── led_control.cpp
│   │   ├── led_control.h
│   │   ├── lhdc.cpp
│   │   ├── rb_codec.cpp
│   │   └── rb_codec.h
│   ├── mic/
│   │   ├── Makefile
│   │   ├── app_mic.cpp
│   │   └── app_mic.h
│   ├── mic_alg/
│   │   ├── Makefile
│   │   ├── app_mic_alg.cpp
│   │   └── app_mic_alg.h
│   ├── pwl/
│   │   ├── Makefile
│   │   ├── app_pwl.cpp
│   │   └── app_pwl.h
│   └── voice_detector/
│       ├── Makefile
│       ├── app_voice_detector.cpp
│       ├── app_voice_detector.h
│       ├── vad_sensor.h
│       ├── voice_detector.c
│       └── voice_detector.h
├── backup.sh
├── build.sh
├── clear.sh
├── config/
│   ├── Makefile
│   ├── _default_cfg_src_/
│   │   ├── app_status_ind.c
│   │   ├── res/
│   │   │   ├── cn/
│   │   │   │   ├── SOUND_ANSWER.opus
│   │   │   │   ├── SOUND_CHARGE_FINISH.opus
│   │   │   │   ├── SOUND_CHARGE_PLEASE.opus
│   │   │   │   ├── SOUND_CONNECTED.opus
│   │   │   │   ├── SOUND_DIS_CONNECT.opus
│   │   │   │   ├── SOUND_EIGHT.opus
│   │   │   │   ├── SOUND_FINDME.opus
│   │   │   │   ├── SOUND_FIVE.opus
│   │   │   │   ├── SOUND_FOUR.opus
│   │   │   │   ├── SOUND_HUNG_UP.opus
│   │   │   │   ├── SOUND_INCOMING_CALL.opus
│   │   │   │   ├── SOUND_LANGUAGE_SWITCH.opus
│   │   │   │   ├── SOUND_MUTE.opus
│   │   │   │   ├── SOUND_NINE.opus
│   │   │   │   ├── SOUND_ONE.opus
│   │   │   │   ├── SOUND_OVER.opus
│   │   │   │   ├── SOUND_PAIRING.opus
│   │   │   │   ├── SOUND_PAIRING_FAIL.opus
│   │   │   │   ├── SOUND_PAIRING_SUCCESS.opus
│   │   │   │   ├── SOUND_PAIR_ENABLE.opus
│   │   │   │   ├── SOUND_POWER_OFF.opus
│   │   │   │   ├── SOUND_POWER_ON.opus
│   │   │   │   ├── SOUND_REFUSE.opus
│   │   │   │   ├── SOUND_SEVEN.opus
│   │   │   │   ├── SOUND_SIX.opus
│   │   │   │   ├── SOUND_THREE.opus
│   │   │   │   ├── SOUND_TWO.opus
│   │   │   │   ├── SOUND_WARNING.opus
│   │   │   │   └── SOUND_ZERO.opus
│   │   │   ├── en/
│   │   │   │   ├── SOUND_ALEXA_START.opus
│   │   │   │   ├── SOUND_ALEXA_STOP.opus
│   │   │   │   ├── SOUND_ANSWER.opus
│   │   │   │   ├── SOUND_CHARGE_FINISH.opus
│   │   │   │   ├── SOUND_CHARGE_PLEASE.opus
│   │   │   │   ├── SOUND_CONNECTED.opus
│   │   │   │   ├── SOUND_DIS_CONNECT.opus
│   │   │   │   ├── SOUND_EIGHT.opus
│   │   │   │   ├── SOUND_FINDME.opus
│   │   │   │   ├── SOUND_FIVE.opus
│   │   │   │   ├── SOUND_FOUR.opus
│   │   │   │   ├── SOUND_GSOUND_MIC_CLOSE.opus
│   │   │   │   ├── SOUND_GSOUND_MIC_OPEN.opus
│   │   │   │   ├── SOUND_GSOUND_NC.opus
│   │   │   │   ├── SOUND_HUNG_UP.opus
│   │   │   │   ├── SOUND_INCOMING_CALL.opus
│   │   │   │   ├── SOUND_LANGUAGE_SWITCH.opus
│   │   │   │   ├── SOUND_MUTE.opus
│   │   │   │   ├── SOUND_NINE.opus
│   │   │   │   ├── SOUND_ONE.opus
│   │   │   │   ├── SOUND_OVER.opus
│   │   │   │   ├── SOUND_PAIRING.opus
│   │   │   │   ├── SOUND_PAIRING_FAIL.opus
│   │   │   │   ├── SOUND_PAIRING_SUCCESS.opus
│   │   │   │   ├── SOUND_PAIR_ENABLE.opus
│   │   │   │   ├── SOUND_POWER_OFF.opus
│   │   │   │   ├── SOUND_POWER_ON.opus
│   │   │   │   ├── SOUND_REFUSE.opus
│   │   │   │   ├── SOUND_SEVEN.opus
│   │   │   │   ├── SOUND_SIX.opus
│   │   │   │   ├── SOUND_THREE.opus
│   │   │   │   ├── SOUND_TWO.opus
│   │   │   │   ├── SOUND_WARNING.opus
│   │   │   │   ├── SOUND_ZERO.opus
│   │   │   │   └── dudu.opus
│   │   │   ├── en_festival/
│   │   │   │   ├── SOUND_ALEXA_START.opus
│   │   │   │   ├── SOUND_ALEXA_START.opus.license
│   │   │   │   ├── SOUND_ALEXA_STOP.opus
│   │   │   │   ├── SOUND_ALEXA_STOP.opus.license
│   │   │   │   ├── SOUND_ANSWER.opus
│   │   │   │   ├── SOUND_ANSWER.opus.license
│   │   │   │   ├── SOUND_CHARGE_FINISH.opus
│   │   │   │   ├── SOUND_CHARGE_FINISH.opus.license
│   │   │   │   ├── SOUND_CHARGE_PLEASE.opus
│   │   │   │   ├── SOUND_CHARGE_PLEASE.opus.license
│   │   │   │   ├── SOUND_CONNECTED.opus
│   │   │   │   ├── SOUND_CONNECTED.opus.license
│   │   │   │   ├── SOUND_DIS_CONNECT.opus
│   │   │   │   ├── SOUND_DIS_CONNECT.opus.license
│   │   │   │   ├── SOUND_EIGHT.opus
│   │   │   │   ├── SOUND_EIGHT.opus.license
│   │   │   │   ├── SOUND_FINDME.opus
│   │   │   │   ├── SOUND_FINDME.opus.license
│   │   │   │   ├── SOUND_FIVE.opus
│   │   │   │   ├── SOUND_FIVE.opus.license
│   │   │   │   ├── SOUND_FOUR.opus
│   │   │   │   ├── SOUND_FOUR.opus.license
│   │   │   │   ├── SOUND_GSOUND_MIC_CLOSE.opus
│   │   │   │   ├── SOUND_GSOUND_MIC_CLOSE.opus.license
│   │   │   │   ├── SOUND_GSOUND_MIC_OPEN.opus
│   │   │   │   ├── SOUND_GSOUND_MIC_OPEN.opus.license
│   │   │   │   ├── SOUND_GSOUND_NC.opus
│   │   │   │   ├── SOUND_GSOUND_NC.opus.license
│   │   │   │   ├── SOUND_HUNG_UP.opus
│   │   │   │   ├── SOUND_HUNG_UP.opus.license
│   │   │   │   ├── SOUND_INCOMING_CALL.opus
│   │   │   │   ├── SOUND_INCOMING_CALL.opus.license
│   │   │   │   ├── SOUND_LANGUAGE_SWITCH.opus
│   │   │   │   ├── SOUND_LANGUAGE_SWITCH.opus.license
│   │   │   │   ├── SOUND_MUTE.opus
│   │   │   │   ├── SOUND_MUTE.opus.license
│   │   │   │   ├── SOUND_NINE.opus
│   │   │   │   ├── SOUND_NINE.opus.license
│   │   │   │   ├── SOUND_ONE.opus
│   │   │   │   ├── SOUND_ONE.opus.license
│   │   │   │   ├── SOUND_OVER.opus
│   │   │   │   ├── SOUND_OVER.opus.license
│   │   │   │   ├── SOUND_PAIRING.opus
│   │   │   │   ├── SOUND_PAIRING.opus.license
│   │   │   │   ├── SOUND_PAIRING_FAIL.opus
│   │   │   │   ├── SOUND_PAIRING_FAIL.opus.license
│   │   │   │   ├── SOUND_PAIRING_SUCCESS.opus
│   │   │   │   ├── SOUND_PAIRING_SUCCESS.opus.license
│   │   │   │   ├── SOUND_PAIR_ENABLE.opus
│   │   │   │   ├── SOUND_PAIR_ENABLE.opus.license
│   │   │   │   ├── SOUND_POWER_OFF.opus
│   │   │   │   ├── SOUND_POWER_OFF.opus.license
│   │   │   │   ├── SOUND_POWER_ON.opus
│   │   │   │   ├── SOUND_POWER_ON.opus.license
│   │   │   │   ├── SOUND_REFUSE.opus
│   │   │   │   ├── SOUND_REFUSE.opus.license
│   │   │   │   ├── SOUND_SEVEN.opus
│   │   │   │   ├── SOUND_SEVEN.opus.license
│   │   │   │   ├── SOUND_SIX.opus
│   │   │   │   ├── SOUND_SIX.opus.license
│   │   │   │   ├── SOUND_THREE.opus
│   │   │   │   ├── SOUND_THREE.opus.license
│   │   │   │   ├── SOUND_TWO.opus
│   │   │   │   ├── SOUND_TWO.opus.license
│   │   │   │   ├── SOUND_WARNING.opus
│   │   │   │   ├── SOUND_WARNING.opus.license
│   │   │   │   ├── SOUND_ZERO.opus
│   │   │   │   ├── SOUND_ZERO.opus.license
│   │   │   │   ├── dudu.opus
│   │   │   │   └── dudu.opus.license
│   │   │   ├── gs_hw/
│   │   │   │   └── en_all.txt
│   │   │   └── ring/
│   │   │       ├── SOUND_RING_16000.txt
│   │   │       ├── SOUND_RING_44100.txt
│   │   │       ├── SOUND_RING_48000.txt
│   │   │       └── SOUND_RING_8000.txt
│   │   ├── slave_code.S
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── bak_open/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── best2300p_ibrt/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── best2300p_ibrt_anc/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── common.mk
│   ├── ef606_average_coefficients.h
│   ├── mic_alg/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   ├── open_source/
│   │   ├── target.mk
│   │   ├── tgt_hardware.c
│   │   └── tgt_hardware.h
│   └── suggested_anc_gains.h
├── convert.sh
├── dev_tools/
│   └── anc_decoder/
│       ├── .gitignore
│       ├── Cargo.toml
│       └── src/
│           └── main.rs
├── docker-compose.yml
├── download.sh
├── include/
│   └── rtos/
│       ├── freertos/
│       │   ├── FreeRTOS.h
│       │   ├── FreeRTOSConfig.h
│       │   ├── StackMacros.h
│       │   ├── cmsis_os.h
│       │   ├── cmsis_os2.h
│       │   ├── croutine.h
│       │   ├── deprecated_definitions.h
│       │   ├── event_groups.h
│       │   ├── freertos_evr.h
│       │   ├── freertos_list.h
│       │   ├── message_buffer.h
│       │   ├── mpu_prototypes.h
│       │   ├── mpu_wrappers.h
│       │   ├── portable.h
│       │   ├── portmacro.h
│       │   ├── projdefs.h
│       │   ├── queue.h
│       │   ├── semphr.h
│       │   ├── stack_macros.h
│       │   ├── stdint.readme
│       │   ├── stream_buffer.h
│       │   ├── task.h
│       │   └── timers.h
│       ├── rtx/
│       │   ├── cmsis_os.h
│       │   └── os_tcb.h
│       └── rtx5/
│           ├── cmsis_os.h
│           ├── cmsis_os2.h
│           ├── os_tick.h
│           ├── rtx_evr.h
│           └── rtx_os.h
├── notes.txt
├── platform/
│   ├── Makefile
│   ├── cmsis/
│   │   ├── DSP_Lib/
│   │   │   ├── BasicMathFunctions/
│   │   │   │   ├── BasicMathFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_abs_f32.c
│   │   │   │   ├── arm_abs_q15.c
│   │   │   │   ├── arm_abs_q31.c
│   │   │   │   ├── arm_abs_q7.c
│   │   │   │   ├── arm_add_f32.c
│   │   │   │   ├── arm_add_q15.c
│   │   │   │   ├── arm_add_q31.c
│   │   │   │   ├── arm_add_q7.c
│   │   │   │   ├── arm_dot_prod_f32.c
│   │   │   │   ├── arm_dot_prod_q15.c
│   │   │   │   ├── arm_dot_prod_q31.c
│   │   │   │   ├── arm_dot_prod_q7.c
│   │   │   │   ├── arm_mult_f32.c
│   │   │   │   ├── arm_mult_q15.c
│   │   │   │   ├── arm_mult_q31.c
│   │   │   │   ├── arm_mult_q7.c
│   │   │   │   ├── arm_negate_f32.c
│   │   │   │   ├── arm_negate_q15.c
│   │   │   │   ├── arm_negate_q31.c
│   │   │   │   ├── arm_negate_q7.c
│   │   │   │   ├── arm_offset_f32.c
│   │   │   │   ├── arm_offset_q15.c
│   │   │   │   ├── arm_offset_q31.c
│   │   │   │   ├── arm_offset_q7.c
│   │   │   │   ├── arm_scale_f32.c
│   │   │   │   ├── arm_scale_q15.c
│   │   │   │   ├── arm_scale_q31.c
│   │   │   │   ├── arm_scale_q7.c
│   │   │   │   ├── arm_shift_q15.c
│   │   │   │   ├── arm_shift_q31.c
│   │   │   │   ├── arm_shift_q7.c
│   │   │   │   ├── arm_sub_f32.c
│   │   │   │   ├── arm_sub_q15.c
│   │   │   │   ├── arm_sub_q31.c
│   │   │   │   └── arm_sub_q7.c
│   │   │   ├── CommonTables/
│   │   │   │   ├── CommonTables.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_common_tables.c
│   │   │   │   └── arm_const_structs.c
│   │   │   ├── ComplexMathFunctions/
│   │   │   │   ├── ComplexMathFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_cmplx_conj_f32.c
│   │   │   │   ├── arm_cmplx_conj_q15.c
│   │   │   │   ├── arm_cmplx_conj_q31.c
│   │   │   │   ├── arm_cmplx_dot_prod_f32.c
│   │   │   │   ├── arm_cmplx_dot_prod_q15.c
│   │   │   │   ├── arm_cmplx_dot_prod_q31.c
│   │   │   │   ├── arm_cmplx_mag_f32.c
│   │   │   │   ├── arm_cmplx_mag_q15.c
│   │   │   │   ├── arm_cmplx_mag_q31.c
│   │   │   │   ├── arm_cmplx_mag_squared_f32.c
│   │   │   │   ├── arm_cmplx_mag_squared_q15.c
│   │   │   │   ├── arm_cmplx_mag_squared_q31.c
│   │   │   │   ├── arm_cmplx_mult_cmplx_f32.c
│   │   │   │   ├── arm_cmplx_mult_cmplx_q15.c
│   │   │   │   ├── arm_cmplx_mult_cmplx_q31.c
│   │   │   │   ├── arm_cmplx_mult_real_f32.c
│   │   │   │   ├── arm_cmplx_mult_real_q15.c
│   │   │   │   └── arm_cmplx_mult_real_q31.c
│   │   │   ├── ControllerFunctions/
│   │   │   │   ├── ControllerFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_pid_init_f32.c
│   │   │   │   ├── arm_pid_init_q15.c
│   │   │   │   ├── arm_pid_init_q31.c
│   │   │   │   ├── arm_pid_reset_f32.c
│   │   │   │   ├── arm_pid_reset_q15.c
│   │   │   │   ├── arm_pid_reset_q31.c
│   │   │   │   ├── arm_sin_cos_f32.c
│   │   │   │   └── arm_sin_cos_q31.c
│   │   │   ├── FastMathFunctions/
│   │   │   │   ├── FastMathFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_cos_f32.c
│   │   │   │   ├── arm_cos_q15.c
│   │   │   │   ├── arm_cos_q31.c
│   │   │   │   ├── arm_sin_f32.c
│   │   │   │   ├── arm_sin_q15.c
│   │   │   │   ├── arm_sin_q31.c
│   │   │   │   ├── arm_sqrt_q15.c
│   │   │   │   └── arm_sqrt_q31.c
│   │   │   ├── FilteringFunctions/
│   │   │   │   ├── FilteringFunctions.c
│   │   │   │   ├── Makefile
│   │   │   │   ├── arm_biquad_cascade_df1_32x64_init_q31.c
│   │   │   │   ├── arm_biquad_cascade_df1_32x64_q31.c
│   │   │   │   ├── arm_biquad_cascade_df1_f32.c
│   │   │   │   ├── arm_biquad_cascade_df1_fast_q15.c
│   │   │   │   ├── arm_biquad_cascade_df1_fast_q31.c
│   │   │   │   ├── arm_biquad_cascade_df1_init_f32.c
│   │   │   │   ├── arm_biquad_cascade_df1_init_q15.c
│   │   │   │   ├── arm_biquad_cascade_df1_init_q31.c
│   │   │   │   ├── arm_biquad_cascade_df1_q15.c
│   │   │   │   ├── arm_biquad_cascade_df1_q31.c
│   │   │   │   ├── arm_biquad_cascade_df2T_f32.c
│   │   │   │   ├── arm_biquad_cascade_df2T_f64.c
│   │   │   │   ├── arm_biquad_cascade_df2T_init_f32.c
│   │   │   │   ├── arm_biquad_cascade_df2T_init_f64.c
│   │   │   │   ├── arm_biquad_cascade_stereo_df2T_f32.c
│   │   │   │   ├── arm_biquad_cascade_stereo_df2T_init_f32.c
│   │   │   │   ├── arm_conv_f32.c
│   │   │   │   ├── arm_conv_fast_opt_q15.c
│   │   │   │   ├── arm_conv_fast_q15.c
│   │   │   │   ├── arm_conv_fast_q31.c
│   │   │   │   ├── arm_conv_opt_q15.c
│   │   │   │   ├── arm_conv_opt_q7.c
│   │   │   │   ├── arm_conv_partial_f32.c
│   │   │   │   ├── arm_conv_partial_fast_opt_q15.c
│   │   │   │   ├── arm_conv_partial_fast_q15.c
│   │   │   │   ├── arm_conv_partial_fast_q31.c
│   │   │   │   ├── arm_conv_partial_opt_q15.c
│   │   │   │   ├── arm_conv_partial_opt_q7.c
│   │   │   │   ├── arm_conv_partial_q15.c
│   │   │   │   ├── arm_conv_partial_q31.c
│   │   │   │   ├── arm_conv_partial_q7.c
│   │   │   │   ├── arm_conv_q15.c
│   │   │   │   ├── arm_conv_q31.c
│   │   │   │   ├── arm_conv_q7.c
│   │   │   │   ├── arm_correlate_f32.c
│   │   │   │   ├── arm_correlate_fast_opt_q15.c
│   │   │   │   ├── arm_correlate_fast_q15.c
│   │   │   │   ├── arm_correlate_fast_q31.c
│   │   │   │   ├── arm_correlate_opt_q15.c
│   │   │   │   ├── arm_correlate_opt_q7.c
│   │   │   │   ├── arm_correlate_q15.c
│   │   │   │   ├── arm_correlate_q31.c
│   │   │   │   ├── arm_correlate_q7.c
│   │   │   │   ├── arm_fir_decimate_f32.c
│   │   │   │   ├── arm_fir_decimate_fast_q15.c
│   │   │   │   ├── arm_fir_decimate_fast_q31.c
│   │   │   │   ├── arm_fir_decimate_init_f32.c
│   │   │   │   ├── arm_fir_decimate_init_q15.c
│   │   │   │   ├── arm_fir_decimate_init_q31.c
│   │   │   │   ├── arm_fir_decimate_q15.c
│   │   │   │   ├── arm_fir_decimate_q31.c
│   │   │   │   ├── arm_fir_f32.c
│   │   │   │   ├── arm_fir_fast_q15.c
│   │   │   │   ├── arm_fir_fast_q31.c
│   │   │   │   ├── arm_fir_init_f32.c
│   │   │   │   ├── arm_fir_init_q15.c
│   │   │   │   ├── arm_fir_init_q31.c
│   │   │   │   ├── arm_fir_init_q7.c
│   │   │   │   ├── arm_fir_interpolate_f32.c
│   │   │   │   ├── arm_fir_interpolate_init_f32.c
│   │   │   │   ├── arm_fir_interpolate_init_q15.c
│   │   │   │   ├── arm_fir_interpolate_init_q31.c
│   │   │   │   ├── arm_fir_interpolate_q15.c
│   │   │   │   ├── arm_fir_interpolate_q31.c
│   │   │   │   ├── arm_fir_lattice_f32.c
│   │   │   │   ├── arm_fir_lattice_init_f32.c
│   │   │   │   ├── arm_fir_lattice_init_q15.c
│   │   │   │   ├── arm_fir_lattice_init_q31.c
│   │   │   │   ├── arm_fir_lattice_q15.c
│   │   │   │   ├── arm_fir_lattice_q31.c
│   │   │   │   ├── arm_fir_q15.c
│   │   │   │   ├── arm_fir_q31.c
│   │   │   │   ├── arm_fir_q7.c
│   │   │   │   ├── arm_fir_sparse_f32.c
│   │   │   │   ├── arm_fir_sparse_init_f32.c
│   │   │   │   ├── arm_fir_sparse_init_q15.c
│   │   │   │   ├── arm_fir_sparse_init_q31.c
│   │   │   │   ├── arm_fir_sparse_init_q7.c
│   │   │   │   ├── arm_fir_sparse_q15.c
│   │   │   │   ├── arm_fir_sparse_q31.c
│   │   │   │   ├── arm_fir_sparse_q7.c
│   │   │   │   ├── arm_iir_lattice_f32.c
│   │   │   │   ├── arm_iir_lattice_init_f32.c
│   │   │   │   ├── arm_iir_lattice_init_q15.c
│   │   │   │   ├── arm_iir_lattice_init_q31.c
│   │   │   │   ├── arm_iir_lattice_q15.c
│   │   │   │   ├── arm_iir_lattice_q31.c
│   │   │   │   ├── arm_lms_f32.c
│   │   │   │   ├── arm_lms_init_f32.c
│   │   │   │   ├── arm_lms_init_q15.c
│   │   │   │   ├── arm_lms_init_q31.c
│   │   │   │   ├── arm_lms_norm_f32.c
│   │   │   │   ├── arm_lms_norm_init_f32.c
│   │   │   │   ├── arm_lms_norm_init_q15.c
│   │   │   │   ├── arm_lms_norm_init_q31.c
│   │   │   │   ├── arm_lms_norm_q15.c
│   │   │   │   ├── arm_lms_norm_q31.c
│   │   │   │   ├── arm_lms_q15.c
│   │   │   │   └── arm_lms_q31.c
│   │   │   ├── Makefile
│   │   │   ├── MatrixFunctions/
│   │   │   │   ├── Makefile
│   │   │   │   ├── MatrixFunctions.c
│   │   │   │   ├── arm_mat_add_f32.c
│   │   │   │   ├── arm_mat_add_q15.c
│   │   │   │   ├── arm_mat_add_q31.c
│   │   │   │   ├── arm_mat_cmplx_mult_f32.c
│   │   │   │   ├── arm_mat_cmplx_mult_q15.c
│   │   │   │   ├── arm_mat_cmplx_mult_q31.c
│   │   │   │   ├── arm_mat_init_f32.c
│   │   │   │   ├── arm_mat_init_q15.c
│   │   │   │   ├── arm_mat_init_q31.c
│   │   │   │   ├── arm_mat_inverse_f32.c
│   │   │   │   ├── arm_mat_inverse_f64.c
│   │   │   │   ├── arm_mat_mult_f32.c
│   │   │   │   ├── arm_mat_mult_fast_q15.c
│   │   │   │   ├── arm_mat_mult_fast_q31.c
│   │   │   │   ├── arm_mat_mult_q15.c
│   │   │   │   ├── arm_mat_mult_q31.c
│   │   │   │   ├── arm_mat_scale_f32.c
│   │   │   │   ├── arm_mat_scale_q15.c
│   │   │   │   ├── arm_mat_scale_q31.c
│   │   │   │   ├── arm_mat_sub_f32.c
│   │   │   │   ├── arm_mat_sub_q15.c
│   │   │   │   ├── arm_mat_sub_q31.c
│   │   │   │   ├── arm_mat_trans_f32.c
│   │   │   │   ├── arm_mat_trans_q15.c
│   │   │   │   └── arm_mat_trans_q31.c
│   │   │   ├── StatisticsFunctions/
│   │   │   │   ├── Makefile
│   │   │   │   ├── StatisticsFunctions.c
│   │   │   │   ├── arm_max_f32.c
│   │   │   │   ├── arm_max_q15.c
│   │   │   │   ├── arm_max_q31.c
│   │   │   │   ├── arm_max_q7.c
│   │   │   │   ├── arm_mean_f32.c
│   │   │   │   ├── arm_mean_q15.c
│   │   │   │   ├── arm_mean_q31.c
│   │   │   │   ├── arm_mean_q7.c
│   │   │   │   ├── arm_min_f32.c
│   │   │   │   ├── arm_min_q15.c
│   │   │   │   ├── arm_min_q31.c
│   │   │   │   ├── arm_min_q7.c
│   │   │   │   ├── arm_power_f32.c
│   │   │   │   ├── arm_power_q15.c
│   │   │   │   ├── arm_power_q31.c
│   │   │   │   ├── arm_power_q7.c
│   │   │   │   ├── arm_rms_f32.c
│   │   │   │   ├── arm_rms_q15.c
│   │   │   │   ├── arm_rms_q31.c
│   │   │   │   ├── arm_std_f32.c
│   │   │   │   ├── arm_std_q15.c
│   │   │   │   ├── arm_std_q31.c
│   │   │   │   ├── arm_var_f32.c
│   │   │   │   ├── arm_var_q15.c
│   │   │   │   └── arm_var_q31.c
│   │   │   ├── SupportFunctions/
│   │   │   │   ├── Makefile
│   │   │   │   ├── SupportFunctions.c
│   │   │   │   ├── arm_copy_f32.c
│   │   │   │   ├── arm_copy_q15.c
│   │   │   │   ├── arm_copy_q31.c
│   │   │   │   ├── arm_copy_q7.c
│   │   │   │   ├── arm_fill_f32.c
│   │   │   │   ├── arm_fill_q15.c
│   │   │   │   ├── arm_fill_q31.c
│   │   │   │   ├── arm_fill_q7.c
│   │   │   │   ├── arm_float_to_q15.c
│   │   │   │   ├── arm_float_to_q31.c
│   │   │   │   ├── arm_float_to_q7.c
│   │   │   │   ├── arm_q15_to_float.c
│   │   │   │   ├── arm_q15_to_q31.c
│   │   │   │   ├── arm_q15_to_q7.c
│   │   │   │   ├── arm_q31_to_float.c
│   │   │   │   ├── arm_q31_to_q15.c
│   │   │   │   ├── arm_q31_to_q7.c
│   │   │   │   ├── arm_q7_to_float.c
│   │   │   │   ├── arm_q7_to_q15.c
│   │   │   │   └── arm_q7_to_q31.c
│   │   │   └── TransformFunctions/
│   │   │       ├── Makefile
│   │   │       ├── TransformFunctions.c
│   │   │       ├── arm_bitreversal.c
│   │   │       ├── arm_bitreversal2.S
│   │   │       ├── arm_bitreversal2.c
│   │   │       ├── arm_cfft_f32.c
│   │   │       ├── arm_cfft_q15.c
│   │   │       ├── arm_cfft_q31.c
│   │   │       ├── arm_cfft_radix2_f32.c
│   │   │       ├── arm_cfft_radix2_init_f32.c
│   │   │       ├── arm_cfft_radix2_init_q15.c
│   │   │       ├── arm_cfft_radix2_init_q31.c
│   │   │       ├── arm_cfft_radix2_q15.c
│   │   │       ├── arm_cfft_radix2_q31.c
│   │   │       ├── arm_cfft_radix4_f32.c
│   │   │       ├── arm_cfft_radix4_init_f32.c
│   │   │       ├── arm_cfft_radix4_init_q15.c
│   │   │       ├── arm_cfft_radix4_init_q31.c
│   │   │       ├── arm_cfft_radix4_q15.c
│   │   │       ├── arm_cfft_radix4_q31.c
│   │   │       ├── arm_cfft_radix8_f32.c
│   │   │       ├── arm_dct4_f32.c
│   │   │       ├── arm_dct4_init_f32.c
│   │   │       ├── arm_dct4_init_q15.c
│   │   │       ├── arm_dct4_init_q31.c
│   │   │       ├── arm_dct4_q15.c
│   │   │       ├── arm_dct4_q31.c
│   │   │       ├── arm_rfft_f32.c
│   │   │       ├── arm_rfft_fast_f32.c
│   │   │       ├── arm_rfft_fast_init_f32.c
│   │   │       ├── arm_rfft_init_f32.c
│   │   │       ├── arm_rfft_init_q15.c
│   │   │       ├── arm_rfft_init_q31.c
│   │   │       ├── arm_rfft_q15.c
│   │   │       └── arm_rfft_q31.c
│   │   ├── LICENSE.txt
│   │   ├── Makefile
│   │   ├── ca/
│   │   │   ├── Makefile
│   │   │   ├── cmsis_gic.c
│   │   │   ├── default_irq_ca.S
│   │   │   ├── irq_ctrl_gic.c
│   │   │   ├── mmu_ARMCA.c
│   │   │   ├── startup_ARMCA.c
│   │   │   └── system_ARMCA.c
│   │   ├── cmsis_nvic.c
│   │   ├── inc/
│   │   │   ├── arm_common_tables.h
│   │   │   ├── arm_const_structs.h
│   │   │   ├── arm_math.h
│   │   │   ├── best1000.h
│   │   │   ├── best1400.h
│   │   │   ├── best2000.h
│   │   │   ├── best2001.h
│   │   │   ├── best2300.h
│   │   │   ├── best2300a.h
│   │   │   ├── best2300p.h
│   │   │   ├── best3001.h
│   │   │   ├── best3003.h
│   │   │   ├── ca/
│   │   │   │   ├── best2001_dsp.h
│   │   │   │   ├── cmsis_armcc_ca.h
│   │   │   │   ├── cmsis_armclang_ca.h
│   │   │   │   ├── cmsis_compiler_ca.h
│   │   │   │   ├── cmsis_cp15_ca.h
│   │   │   │   ├── cmsis_gcc_ca.h
│   │   │   │   ├── cmsis_iccarm_ca.h
│   │   │   │   ├── core_ca.h
│   │   │   │   ├── irq_ctrl.h
│   │   │   │   ├── mem_ARMCA.h
│   │   │   │   └── system_ARMCA.h
│   │   │   ├── cmsis.h
│   │   │   ├── cmsis_armcc.h
│   │   │   ├── cmsis_armclang.h
│   │   │   ├── cmsis_armclang_ltm.h
│   │   │   ├── cmsis_compiler.h
│   │   │   ├── cmsis_gcc.h
│   │   │   ├── cmsis_iccarm.h
│   │   │   ├── cmsis_nvic.h
│   │   │   ├── cmsis_version.h
│   │   │   ├── core_armv81mml.h
│   │   │   ├── core_armv8mbl.h
│   │   │   ├── core_armv8mml.h
│   │   │   ├── core_cm0.h
│   │   │   ├── core_cm0plus.h
│   │   │   ├── core_cm1.h
│   │   │   ├── core_cm23.h
│   │   │   ├── core_cm3.h
│   │   │   ├── core_cm33.h
│   │   │   ├── core_cm35p.h
│   │   │   ├── core_cm4.h
│   │   │   ├── core_cm7.h
│   │   │   ├── core_sc000.h
│   │   │   ├── core_sc300.h
│   │   │   ├── link_sym_armclang.h
│   │   │   ├── main_entry.h
│   │   │   ├── mpu.h
│   │   │   ├── mpu_armv7.h
│   │   │   ├── mpu_armv8.h
│   │   │   ├── patch.h
│   │   │   ├── system_ARMCM.h
│   │   │   ├── system_cp.h
│   │   │   └── tz_context.h
│   │   ├── mpu_armv7m.c
│   │   ├── mpu_armv8m.c
│   │   ├── patch.c
│   │   ├── patch_armv7m.c
│   │   ├── reg_patch.h
│   │   ├── reg_patch_armv7m.h
│   │   ├── retarget_armclang.cpp
│   │   ├── retarget_armclang_asm.S
│   │   ├── retarget_gcc.cpp
│   │   ├── stack_protector.c
│   │   ├── system_ARMCM.c
│   │   ├── system_cp.c
│   │   └── system_utils.c
│   ├── drivers/
│   │   ├── Makefile
│   │   ├── ana/
│   │   │   ├── Makefile
│   │   │   ├── analog.h
│   │   │   ├── best2300p/
│   │   │   │   ├── Makefile
│   │   │   │   ├── analog_best2300p.c
│   │   │   │   ├── analog_best2300p.h
│   │   │   │   ├── pmu_best2300p.c
│   │   │   │   ├── pmu_best2300p.h
│   │   │   │   ├── reg_usbphy_best2300p.h
│   │   │   │   ├── usbphy_best2300p.c
│   │   │   │   └── usbphy_best2300p.h
│   │   │   ├── pmu.h
│   │   │   ├── psramuhsphy.h
│   │   │   └── usbphy.h
│   │   ├── bt/
│   │   │   ├── Makefile
│   │   │   ├── besbt_string.h
│   │   │   ├── best2300p/
│   │   │   │   ├── Makefile
│   │   │   │   ├── bt_drv.cpp
│   │   │   │   ├── bt_drv_2300p_internal.h
│   │   │   │   ├── bt_drv_calibration.cpp
│   │   │   │   ├── bt_drv_config.c
│   │   │   │   ├── bt_drv_patch.c
│   │   │   │   ├── bt_drv_reg_op.cpp
│   │   │   │   ├── bt_drv_rfconfig.c
│   │   │   │   ├── bt_drv_uart_bridge_intsys.c
│   │   │   │   ├── iqcorrect.c
│   │   │   │   └── iqcorrect.h
│   │   │   ├── bt_drv.h
│   │   │   ├── bt_drv_common.c
│   │   │   ├── bt_drv_interface.h
│   │   │   ├── bt_drv_internal.h
│   │   │   └── bt_drv_reg_op.h
│   │   ├── btpcm/
│   │   │   ├── Makefile
│   │   │   ├── btpcm.c
│   │   │   └── btpcm.h
│   │   ├── codec/
│   │   │   ├── Makefile
│   │   │   ├── best2300p/
│   │   │   │   ├── Makefile
│   │   │   │   ├── codec_best2300p.c
│   │   │   │   └── codec_best2300p.h
│   │   │   ├── codec_int.h
│   │   │   ├── codec_tlv32aic32.c
│   │   │   └── codec_tlv32aic32.h
│   │   ├── norflash/
│   │   │   ├── Makefile
│   │   │   ├── norflash_drv.c
│   │   │   ├── norflash_drv.h
│   │   │   ├── norflash_en25s80b.c
│   │   │   ├── norflash_en25s80b.h
│   │   │   ├── norflash_gd25lq32c.c
│   │   │   ├── norflash_gd25lq32c.h
│   │   │   ├── norflash_gd25q32c.c
│   │   │   └── norflash_gd25q32c.h
│   │   └── sbcacc/
│   │       └── Makefile
│   ├── hal/
│   │   ├── Makefile
│   │   ├── best2300p/
│   │   │   ├── Makefile
│   │   │   ├── hal_analogif_best2300p.c
│   │   │   ├── hal_cmu_best2300p.c
│   │   │   ├── hal_cmu_best2300p.h
│   │   │   ├── hal_codec_best2300p.c
│   │   │   ├── hal_dmacfg_best2300p.h
│   │   │   ├── hal_iomux_best2300p.c
│   │   │   ├── hal_iomux_best2300p.h
│   │   │   ├── hal_psc_best2300p.c
│   │   │   ├── hal_sensor_eng_best2300p.c
│   │   │   ├── plat_addr_map_best2300p.h
│   │   │   ├── reg_aoncmu_best2300p.h
│   │   │   ├── reg_btcmu_best2300p.h
│   │   │   ├── reg_cmu_best2300p.h
│   │   │   ├── reg_codec_best2300p.h
│   │   │   ├── reg_iomux_best2300p.h
│   │   │   ├── reg_psc_best2300p.h
│   │   │   └── reg_sensor_eng_best2300p.h
│   │   ├── hal_analogif.h
│   │   ├── hal_aud.h
│   │   ├── hal_bootmode.c
│   │   ├── hal_bootmode.h
│   │   ├── hal_btdump.c
│   │   ├── hal_btdump.h
│   │   ├── hal_btpcm.c
│   │   ├── hal_btpcm.h
│   │   ├── hal_btpcmip.h
│   │   ├── hal_cache.c
│   │   ├── hal_cache.h
│   │   ├── hal_chipid.c
│   │   ├── hal_chipid.h
│   │   ├── hal_cmd.c
│   │   ├── hal_cmd.h
│   │   ├── hal_cmu.h
│   │   ├── hal_cmu_common.c
│   │   ├── hal_codec.h
│   │   ├── hal_codec_common.c
│   │   ├── hal_dma.c
│   │   ├── hal_dma.h
│   │   ├── hal_gpadc.c
│   │   ├── hal_gpadc.h
│   │   ├── hal_gpio.c
│   │   ├── hal_gpio.h
│   │   ├── hal_hwfft.h
│   │   ├── hal_i2c.c
│   │   ├── hal_i2c.h
│   │   ├── hal_i2cip.h
│   │   ├── hal_i2s.c
│   │   ├── hal_i2s.h
│   │   ├── hal_i2s_tdm.c
│   │   ├── hal_i2s_tdm.h
│   │   ├── hal_i2sip.h
│   │   ├── hal_intersys.c
│   │   ├── hal_intersys.h
│   │   ├── hal_iomux.h
│   │   ├── hal_key.c
│   │   ├── hal_key.h
│   │   ├── hal_location.h
│   │   ├── hal_mcu2cp.c
│   │   ├── hal_mcu2cp.h
│   │   ├── hal_memsc.c
│   │   ├── hal_memsc.h
│   │   ├── hal_norflash.c
│   │   ├── hal_norflash.h
│   │   ├── hal_norflaship.h
│   │   ├── hal_norflaship_v1.c
│   │   ├── hal_norflaship_v2.c
│   │   ├── hal_overlay.c
│   │   ├── hal_overlay.h
│   │   ├── hal_phyif.c
│   │   ├── hal_phyif.h
│   │   ├── hal_psc.h
│   │   ├── hal_psram.h
│   │   ├── hal_psram_v1.c
│   │   ├── hal_psram_v2.c
│   │   ├── hal_psramip_v1.h
│   │   ├── hal_psramuhs.c
│   │   ├── hal_psramuhs.h
│   │   ├── hal_pwm.c
│   │   ├── hal_pwm.h
│   │   ├── hal_rtc.c
│   │   ├── hal_rtc.h
│   │   ├── hal_sec_eng.c
│   │   ├── hal_sec_eng.h
│   │   ├── hal_sensor_eng.h
│   │   ├── hal_slave_i2c.c
│   │   ├── hal_slave_i2c.h
│   │   ├── hal_sleep.c
│   │   ├── hal_sleep.h
│   │   ├── hal_sleep_core_pd.S
│   │   ├── hal_sleep_core_pd.h
│   │   ├── hal_sleep_mcu_pd.S
│   │   ├── hal_sleep_mcu_pd.h
│   │   ├── hal_spdif.c
│   │   ├── hal_spdif.h
│   │   ├── hal_spdifip.h
│   │   ├── hal_spi.c
│   │   ├── hal_spi.h
│   │   ├── hal_sysfreq.c
│   │   ├── hal_sysfreq.h
│   │   ├── hal_tdm.c
│   │   ├── hal_tdm.h
│   │   ├── hal_timer.c
│   │   ├── hal_timer.h
│   │   ├── hal_timer_raw.h
│   │   ├── hal_trace.c
│   │   ├── hal_trace.h
│   │   ├── hal_trace_mod.c
│   │   ├── hal_trace_mod.h
│   │   ├── hal_transq.c
│   │   ├── hal_transq.h
│   │   ├── hal_uart.c
│   │   ├── hal_uart.h
│   │   ├── hal_wdt.c
│   │   ├── hal_wdt.h
│   │   ├── plat_addr_map.h
│   │   ├── plat_types.h
│   │   ├── reg_btpcmip.h
│   │   ├── reg_dma.h
│   │   ├── reg_gpio.h
│   │   ├── reg_i2cip.h
│   │   ├── reg_i2sip.h
│   │   ├── reg_norflaship_v1.h
│   │   ├── reg_norflaship_v2.h
│   │   ├── reg_psram_mc_v2.h
│   │   ├── reg_psram_phy_v2.h
│   │   ├── reg_psramip_v1.h
│   │   ├── reg_psramuhs_mc.h
│   │   ├── reg_pwm.h
│   │   ├── reg_rtc.h
│   │   ├── reg_sec_eng.h
│   │   ├── reg_slave_i2c.h
│   │   ├── reg_spdifip.h
│   │   ├── reg_spi.h
│   │   ├── reg_tdm.h
│   │   ├── reg_timer.h
│   │   ├── reg_transq.h
│   │   ├── reg_uart.h
│   │   └── reg_usb.h
│   └── main/
│       ├── Makefile
│       ├── main.cpp
│       ├── noapp_main.cpp
│       ├── nostd_main.c
│       └── startup_main.S
├── rtos/
│   ├── Makefile
│   ├── rtx/
│   │   ├── TARGET_ARM7/
│   │   │   ├── ARM7/
│   │   │   │   └── TOOLCHAIN_GCC/
│   │   │   │       ├── HAL_CM0.S
│   │   │   │       └── SVC_Table.S
│   │   │   ├── HAL_CM.c
│   │   │   ├── RTX_CM_lib.h
│   │   │   ├── RTX_Conf.h
│   │   │   ├── RTX_Conf_CM.c
│   │   │   ├── cmsis_os.h
│   │   │   ├── os_tcb.h
│   │   │   ├── rt_CMSIS.c
│   │   │   ├── rt_Event.c
│   │   │   ├── rt_Event.h
│   │   │   ├── rt_HAL_CM.h
│   │   │   ├── rt_List.c
│   │   │   ├── rt_List.h
│   │   │   ├── rt_Mailbox.c
│   │   │   ├── rt_Mailbox.h
│   │   │   ├── rt_MemBox.c
│   │   │   ├── rt_MemBox.h
│   │   │   ├── rt_Mutex.c
│   │   │   ├── rt_Mutex.h
│   │   │   ├── rt_Robin.c
│   │   │   ├── rt_Robin.h
│   │   │   ├── rt_Semaphore.c
│   │   │   ├── rt_Semaphore.h
│   │   │   ├── rt_System.c
│   │   │   ├── rt_System.h
│   │   │   ├── rt_Task.c
│   │   │   ├── rt_Task.h
│   │   │   ├── rt_Time.c
│   │   │   ├── rt_Time.h
│   │   │   └── rt_TypeDef.h
│   │   ├── TARGET_CORTEX_A/
│   │   │   ├── HAL_CA.c
│   │   │   ├── RTX_CM_lib.h
│   │   │   ├── RTX_Conf_CA.c
│   │   │   ├── RTX_Config.h
│   │   │   ├── TOOLCHAIN_ARM/
│   │   │   │   ├── HAL_CA9.c
│   │   │   │   └── SVC_Table.S
│   │   │   ├── TOOLCHAIN_GCC/
│   │   │   │   ├── HAL_CA9.S
│   │   │   │   └── SVC_Table.S
│   │   │   ├── cmsis_os.h
│   │   │   ├── rt_CMSIS.c
│   │   │   ├── rt_Event.c
│   │   │   ├── rt_Event.h
│   │   │   ├── rt_HAL_CA.h
│   │   │   ├── rt_HAL_CM.h
│   │   │   ├── rt_List.c
│   │   │   ├── rt_List.h
│   │   │   ├── rt_Mailbox.c
│   │   │   ├── rt_Mailbox.h
│   │   │   ├── rt_MemBox.c
│   │   │   ├── rt_MemBox.h
│   │   │   ├── rt_Memory.c
│   │   │   ├── rt_Memory.h
│   │   │   ├── rt_Mutex.c
│   │   │   ├── rt_Mutex.h
│   │   │   ├── rt_Robin.c
│   │   │   ├── rt_Robin.h
│   │   │   ├── rt_Semaphore.c
│   │   │   ├── rt_Semaphore.h
│   │   │   ├── rt_System.c
│   │   │   ├── rt_System.h
│   │   │   ├── rt_Task.c
│   │   │   ├── rt_Task.h
│   │   │   ├── rt_Time.c
│   │   │   ├── rt_Time.h
│   │   │   ├── rt_Timer.h
│   │   │   └── rt_TypeDef.h
│   │   └── TARGET_CORTEX_M/
│   │       ├── HAL_CM.c
│   │       ├── Makefile
│   │       ├── RTX_CM_lib.h
│   │       ├── RTX_Conf.h
│   │       ├── RTX_Conf_CM.c
│   │       ├── TARGET_M0/
│   │       │   ├── TOOLCHAIN_ARM/
│   │       │   │   ├── HAL_CM0.c
│   │       │   │   └── SVC_Table.S
│   │       │   ├── TOOLCHAIN_GCC/
│   │       │   │   ├── HAL_CM0.S
│   │       │   │   └── SVC_Table.S
│   │       │   └── TOOLCHAIN_IAR/
│   │       │       ├── HAL_CM0.S
│   │       │       └── SVC_Table.S
│   │       ├── TARGET_M0P/
│   │       │   ├── TOOLCHAIN_ARM/
│   │       │   │   ├── HAL_CM0.c
│   │       │   │   └── SVC_Table.S
│   │       │   ├── TOOLCHAIN_GCC/
│   │       │   │   ├── HAL_CM0.S
│   │       │   │   └── SVC_Table.S
│   │       │   └── TOOLCHAIN_IAR/
│   │       │       ├── HAL_CM0.S
│   │       │       └── SVC_Table.S
│   │       ├── TARGET_M3/
│   │       │   ├── TOOLCHAIN_ARM/
│   │       │   │   ├── HAL_CM3.c
│   │       │   │   └── SVC_Table.S
│   │       │   ├── TOOLCHAIN_GCC/
│   │       │   │   ├── HAL_CM3.S
│   │       │   │   └── SVC_Table.S
│   │       │   └── TOOLCHAIN_IAR/
│   │       │       ├── HAL_CM3.S
│   │       │       └── SVC_Table.S
│   │       ├── TARGET_M4/
│   │       │   ├── TOOLCHAIN_ARM/
│   │       │   │   ├── HAL_CM4.c
│   │       │   │   └── SVC_Table.S
│   │       │   ├── TOOLCHAIN_GCC/
│   │       │   │   ├── HAL_CM4.S
│   │       │   │   └── SVC_Table.S
│   │       │   └── TOOLCHAIN_IAR/
│   │       │       ├── HAL_CM4.S
│   │       │       └── SVC_Table.S
│   │       ├── rt_CMSIS.c
│   │       ├── rt_Event.c
│   │       ├── rt_Event.h
│   │       ├── rt_HAL_CM.h
│   │       ├── rt_List.c
│   │       ├── rt_List.h
│   │       ├── rt_Mailbox.c
│   │       ├── rt_Mailbox.h
│   │       ├── rt_MemBox.c
│   │       ├── rt_MemBox.h
│   │       ├── rt_Mutex.c
│   │       ├── rt_Mutex.h
│   │       ├── rt_Robin.c
│   │       ├── rt_Robin.h
│   │       ├── rt_Semaphore.c
│   │       ├── rt_Semaphore.h
│   │       ├── rt_System.c
│   │       ├── rt_System.h
│   │       ├── rt_Task.c
│   │       ├── rt_Task.h
│   │       ├── rt_Time.c
│   │       ├── rt_Time.h
│   │       └── rt_TypeDef.h
│   └── rtx5/
│       ├── ARM/
│       │   ├── irq_armv8mbl.s
│       │   ├── irq_armv8mbl_ns.s
│       │   ├── irq_armv8mml.s
│       │   ├── irq_armv8mml_ns.s
│       │   ├── irq_ca.s
│       │   ├── irq_cm0.s
│       │   ├── irq_cm3.s
│       │   └── irq_cm4f.s
│       ├── GCC/
│       │   ├── Makefile
│       │   ├── irq_armv8mbl.S
│       │   ├── irq_armv8mbl_ns.S
│       │   ├── irq_armv8mml.S
│       │   ├── irq_armv8mml_fp.S
│       │   ├── irq_armv8mml_fp_ns.S
│       │   ├── irq_armv8mml_ns.S
│       │   ├── irq_ca.S
│       │   ├── irq_cm0.S
│       │   ├── irq_cm3.S
│       │   └── irq_cm4f.S
│       ├── IAR/
│       │   ├── irq_armv8mbl.s
│       │   ├── irq_armv8mbl_common.s
│       │   ├── irq_armv8mbl_ns.s
│       │   ├── irq_armv8mml.s
│       │   ├── irq_armv8mml_common.s
│       │   ├── irq_armv8mml_ns.s
│       │   ├── irq_ca.s
│       │   ├── irq_cm0.s
│       │   ├── irq_cm3.s
│       │   └── irq_cm4f.s
│       ├── Makefile
│       ├── RTE_Components.h
│       ├── cmsis_os1.c
│       ├── os_systick.c
│       ├── rtx_config/
│       │   ├── Makefile
│       │   ├── rtx_config.c
│       │   └── rtx_config.h
│       ├── rtx_core_c.h
│       ├── rtx_core_ca.h
│       ├── rtx_core_cm.h
│       ├── rtx_delay.c
│       ├── rtx_evflags.c
│       ├── rtx_evr.c
│       ├── rtx_kernel.c
│       ├── rtx_lib.c
│       ├── rtx_lib.h
│       ├── rtx_memory.c
│       ├── rtx_mempool.c
│       ├── rtx_msgqueue.c
│       ├── rtx_mutex.c
│       ├── rtx_semaphore.c
│       ├── rtx_system.c
│       ├── rtx_thread.c
│       ├── rtx_thread_dump.c
│       └── rtx_timer.c
├── scripts/
│   ├── build.mk
│   ├── clean.mk
│   ├── extrawarn.mk
│   ├── include.mk
│   ├── lib.mk
│   ├── link/
│   │   ├── armca.lds.S
│   │   ├── best1000.lds.S
│   │   ├── best1000_fpga_rom.lds.S
│   │   ├── best1000_intsram.lds.S
│   │   ├── best1000_intsram.lds_scat.S
│   │   ├── best1000_msbc_aac.lds.S
│   │   ├── best1000savepower.lds.S
│   │   ├── best2000_bisto.lds.S
│   │   ├── best2000_dma.lds.S
│   │   ├── programmer.lds.S
│   │   ├── programmer.lds_scat.S
│   │   ├── programmer_inflash.lds.S
│   │   ├── rom.lds.S
│   │   └── rom.lds_scat.S
│   ├── submods.mk
│   └── submods_init.mk
├── services/
│   ├── Makefile
│   ├── anc_spp_tool/
│   │   ├── Makefile
│   │   └── anc_parse_data.h
│   ├── app_ai/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   ├── app_ai_algorithm.h
│   │   │   ├── app_ai_if.h
│   │   │   ├── app_ai_if_config.h
│   │   │   ├── app_ai_if_custom_ui.h
│   │   │   ├── app_ai_if_gsound.h
│   │   │   ├── app_ai_if_thirdparty.h
│   │   │   ├── app_ai_manager_api.h
│   │   │   └── app_ai_tws.h
│   │   ├── src/
│   │   │   ├── app_ai_algorithm.cpp
│   │   │   ├── app_ai_if.cpp
│   │   │   ├── app_ai_if_custom_ui.cpp
│   │   │   ├── app_ai_if_gsound.cpp
│   │   │   ├── app_ai_if_thirdparty.cpp
│   │   │   ├── app_ai_manager_api.cpp
│   │   │   └── app_ai_tws.cpp
│   │   └── voice_sbc/
│   │       ├── voice_sbc.cpp
│   │       └── voice_sbc.h
│   ├── app_ibrt/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   ├── app_ibrt_a2dp.h
│   │   │   ├── app_ibrt_auto_test.h
│   │   │   ├── app_ibrt_auto_test_cmd_handle.h
│   │   │   ├── app_ibrt_ble_adv.h
│   │   │   ├── app_ibrt_custom_cmd.h
│   │   │   ├── app_ibrt_customif_cmd.h
│   │   │   ├── app_ibrt_customif_ui.h
│   │   │   ├── app_ibrt_hf.h
│   │   │   ├── app_ibrt_if.h
│   │   │   ├── app_ibrt_if_internal.h
│   │   │   ├── app_ibrt_keyboard.h
│   │   │   ├── app_ibrt_nvrecord.h
│   │   │   ├── app_ibrt_ota_cmd.h
│   │   │   ├── app_ibrt_ota_update.h
│   │   │   ├── app_ibrt_peripheral_manager.h
│   │   │   ├── app_ibrt_rssi.h
│   │   │   ├── app_ibrt_ui_test.h
│   │   │   ├── app_ibrt_ui_test_cmd_if.h
│   │   │   └── app_ibrt_voice_report.h
│   │   └── src/
│   │       ├── app_ibrt_auto_test.cpp
│   │       ├── app_ibrt_auto_test_cmd_handle.cpp
│   │       ├── app_ibrt_ble_adv.cpp
│   │       ├── app_ibrt_customif_cmd.cpp
│   │       ├── app_ibrt_customif_ui.cpp
│   │       ├── app_ibrt_if.cpp
│   │       ├── app_ibrt_keyboard.cpp
│   │       ├── app_ibrt_nvrecord.cpp
│   │       ├── app_ibrt_ota_cmd.cpp
│   │       ├── app_ibrt_ota_update.cpp
│   │       ├── app_ibrt_peripheral_manager.cpp
│   │       ├── app_ibrt_rssi.cpp
│   │       ├── app_ibrt_search_pair_ui.cpp
│   │       ├── app_ibrt_ui_test.cpp
│   │       ├── app_ibrt_ui_test_cmd_if.cpp
│   │       └── app_ibrt_voice_report.cpp
│   ├── app_tws/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   └── app_tws_if.h
│   │   └── src/
│   │       └── app_tws_if.cpp
│   ├── audio_dump/
│   │   ├── Makefile
│   │   ├── include/
│   │   │   └── audio_dump.h
│   │   └── src/
│   │       └── audio_dump.c
│   ├── audio_process/
│   │   ├── Makefile
│   │   ├── audio_cfg.c
│   │   ├── audio_cfg.h
│   │   ├── audio_process.c
│   │   ├── audio_process.h
│   │   ├── audio_spectrum.cpp
│   │   └── audio_spectrum.h
│   ├── audioflinger/
│   │   ├── Makefile
│   │   ├── audioflinger.c
│   │   └── audioflinger.h
│   ├── auto_test/
│   │   ├── Makefile
│   │   ├── at_thread.cpp
│   │   ├── at_thread.h
│   │   ├── at_thread_user.cpp
│   │   ├── at_thread_user.h
│   │   └── auto_test.cpp
│   ├── ble_app/
│   │   ├── Makefile
│   │   ├── app_amsc/
│   │   │   ├── app_amsc.c
│   │   │   ├── app_amsc.h
│   │   │   ├── app_amsc_task.c
│   │   │   └── app_amsc_task.h
│   │   ├── app_ancc/
│   │   │   ├── app_ancc.c
│   │   │   ├── app_ancc.h
│   │   │   ├── app_ancc_task.c
│   │   │   └── app_ancc_task.h
│   │   ├── app_batt/
│   │   │   ├── app_batt.c
│   │   │   └── app_batt.h
│   │   ├── app_ble_key.cpp
│   │   ├── app_ble_uart.cpp
│   │   ├── app_ble_uart.h
│   │   ├── app_datapath/
│   │   │   ├── app_ble_cmd_handler.c
│   │   │   ├── app_ble_cmd_handler.h
│   │   │   ├── app_ble_custom_cmd.c
│   │   │   ├── app_ble_custom_cmd.h
│   │   │   ├── app_datapath_server.c
│   │   │   └── app_datapath_server.h
│   │   ├── app_dis/
│   │   │   ├── app_dis.c
│   │   │   └── app_dis.h
│   │   ├── app_gfps/
│   │   │   ├── app_gfps.c
│   │   │   └── app_gfps.h
│   │   ├── app_hid/
│   │   │   ├── app_hid.c
│   │   │   └── app_hid.h
│   │   ├── app_hrps/
│   │   │   ├── app_hrps.c
│   │   │   └── app_hrps.h
│   │   ├── app_htp/
│   │   │   ├── app_ht.c
│   │   │   └── app_ht.h
│   │   ├── app_main/
│   │   │   ├── app.c
│   │   │   ├── app.h
│   │   │   ├── app_ble_core.c
│   │   │   ├── app_ble_core.h
│   │   │   ├── app_ble_customif.c
│   │   │   ├── app_ble_customif.h
│   │   │   ├── app_ble_include.h
│   │   │   ├── app_ble_mode_switch.c
│   │   │   ├── app_ble_mode_switch.h
│   │   │   ├── app_ble_rx_handler.c
│   │   │   ├── app_ble_rx_handler.h
│   │   │   ├── app_task.c
│   │   │   └── app_task.h
│   │   ├── app_ota/
│   │   │   ├── app_ota.c
│   │   │   └── app_ota.h
│   │   ├── app_sec/
│   │   │   ├── app_sec.c
│   │   │   └── app_sec.h
│   │   ├── app_tota/
│   │   │   ├── app_tota_ble.c
│   │   │   └── app_tota_ble.h
│   │   ├── app_vob/
│   │   │   └── voice_over_ble.c
│   │   ├── app_voice/
│   │   │   ├── app_voicepath_ble.c
│   │   │   └── app_voicepath_ble.h
│   │   └── ble_app_dbg.h
│   ├── ble_profiles/
│   │   ├── Makefile
│   │   ├── ams/
│   │   │   ├── ams_common.h
│   │   │   └── amsc/
│   │   │       ├── amsc.c
│   │   │       ├── amsc.h
│   │   │       ├── amsc_task.c
│   │   │       └── amsc_task.h
│   │   ├── anc/
│   │   │   ├── anc_common.h
│   │   │   └── ancc/
│   │   │       ├── ancc.c
│   │   │       ├── ancc.h
│   │   │       ├── ancc_task.c
│   │   │       └── ancc_task.h
│   │   ├── anp/
│   │   │   ├── anp_common.h
│   │   │   ├── anpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── anpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── anpc.c
│   │   │   │       ├── anpc.h
│   │   │   │       └── anpc_task.c
│   │   │   └── anps/
│   │   │       ├── api/
│   │   │       │   └── anps_task.h
│   │   │       └── src/
│   │   │           ├── anps.c
│   │   │           ├── anps.h
│   │   │           └── anps_task.c
│   │   ├── bas/
│   │   │   ├── basc/
│   │   │   │   ├── api/
│   │   │   │   │   └── basc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── basc.c
│   │   │   │       ├── basc.h
│   │   │   │       └── basc_task.c
│   │   │   └── bass/
│   │   │       ├── api/
│   │   │       │   └── bass_task.h
│   │   │       └── src/
│   │   │           ├── bass.c
│   │   │           ├── bass.h
│   │   │           └── bass_task.c
│   │   ├── blp/
│   │   │   ├── blp_common.h
│   │   │   ├── blpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── blpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── blpc.c
│   │   │   │       ├── blpc.h
│   │   │   │       └── blpc_task.c
│   │   │   └── blps/
│   │   │       ├── api/
│   │   │       │   └── blps_task.h
│   │   │       └── src/
│   │   │           ├── blps.c
│   │   │           ├── blps.h
│   │   │           └── blps_task.c
│   │   ├── cpp/
│   │   │   ├── cpp_common.h
│   │   │   ├── cppc/
│   │   │   │   ├── api/
│   │   │   │   │   └── cppc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── cppc.c
│   │   │   │       ├── cppc.h
│   │   │   │       └── cppc_task.c
│   │   │   └── cpps/
│   │   │       ├── api/
│   │   │       │   └── cpps_task.h
│   │   │       └── src/
│   │   │           ├── cpps.c
│   │   │           ├── cpps.h
│   │   │           └── cpps_task.c
│   │   ├── cscp/
│   │   │   ├── cscp_common.h
│   │   │   ├── cscpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── cscpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── cscpc.c
│   │   │   │       ├── cscpc.h
│   │   │   │       └── cscpc_task.c
│   │   │   └── cscps/
│   │   │       ├── api/
│   │   │       │   └── cscps_task.h
│   │   │       └── src/
│   │   │           ├── cscps.c
│   │   │           ├── cscps.h
│   │   │           └── cscps_task.c
│   │   ├── datapath/
│   │   │   └── datapathps/
│   │   │       ├── api/
│   │   │       │   └── datapathps_task.h
│   │   │       └── src/
│   │   │           ├── datapathps.c
│   │   │           ├── datapathps.h
│   │   │           └── datapathps_task.c
│   │   ├── dis/
│   │   │   ├── disc/
│   │   │   │   ├── api/
│   │   │   │   │   └── disc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── disc.c
│   │   │   │       ├── disc.h
│   │   │   │       └── disc_task.c
│   │   │   └── diss/
│   │   │       ├── api/
│   │   │       │   └── diss_task.h
│   │   │       └── src/
│   │   │           ├── diss.c
│   │   │           ├── diss.h
│   │   │           └── diss_task.c
│   │   ├── find/
│   │   │   ├── find_common.h
│   │   │   ├── findl/
│   │   │   │   ├── api/
│   │   │   │   │   └── findl_task.h
│   │   │   │   └── src/
│   │   │   │       ├── findl.c
│   │   │   │       ├── findl.h
│   │   │   │       └── findl_task.c
│   │   │   └── findt/
│   │   │       ├── api/
│   │   │       │   └── findt_task.h
│   │   │       └── src/
│   │   │           ├── findt.c
│   │   │           ├── findt.h
│   │   │           └── findt_task.c
│   │   ├── gfps/
│   │   │   ├── Makefile
│   │   │   ├── api/
│   │   │   │   └── gfps_crypto.h
│   │   │   └── gfps_provider/
│   │   │       ├── api/
│   │   │       │   ├── gfps_provider.h
│   │   │       │   ├── gfps_provider_errors.h
│   │   │       │   └── gfps_provider_task.h
│   │   │       └── src/
│   │   │           ├── gfps_provider.c
│   │   │           └── gfps_provider_task.c
│   │   ├── glp/
│   │   │   ├── glp_common.h
│   │   │   ├── glpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── glpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── glpc.c
│   │   │   │       ├── glpc.h
│   │   │   │       └── glpc_task.c
│   │   │   └── glps/
│   │   │       ├── api/
│   │   │       │   ├── glps.h
│   │   │       │   └── glps_task.h
│   │   │       └── src/
│   │   │           ├── glps.c
│   │   │           └── glps_task.c
│   │   ├── hogp/
│   │   │   ├── hogp_common.h
│   │   │   ├── hogpbh/
│   │   │   │   ├── api/
│   │   │   │   │   └── hogpbh_task.h
│   │   │   │   └── src/
│   │   │   │       ├── hogpbh.c
│   │   │   │       ├── hogpbh.h
│   │   │   │       └── hogpbh_task.c
│   │   │   ├── hogpd/
│   │   │   │   ├── api/
│   │   │   │   │   └── hogpd_task.h
│   │   │   │   └── src/
│   │   │   │       ├── hogpd.c
│   │   │   │       ├── hogpd.h
│   │   │   │       └── hogpd_task.c
│   │   │   └── hogprh/
│   │   │       ├── api/
│   │   │       │   └── hogprh_task.h
│   │   │       └── src/
│   │   │           ├── hogprh.c
│   │   │           ├── hogprh.h
│   │   │           └── hogprh_task.c
│   │   ├── hrp/
│   │   │   ├── hrp_common.h
│   │   │   ├── hrpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── hrpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── hrpc.c
│   │   │   │       ├── hrpc.h
│   │   │   │       └── hrpc_task.c
│   │   │   └── hrps/
│   │   │       ├── api/
│   │   │       │   └── hrps_task.h
│   │   │       └── src/
│   │   │           ├── hrps.c
│   │   │           ├── hrps.h
│   │   │           └── hrps_task.c
│   │   ├── htp/
│   │   │   ├── htp_common.h
│   │   │   ├── htpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── htpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── htpc.c
│   │   │   │       ├── htpc.h
│   │   │   │       └── htpc_task.c
│   │   │   └── htpt/
│   │   │       ├── api/
│   │   │       │   └── htpt_task.h
│   │   │       └── src/
│   │   │           ├── htpt.c
│   │   │           ├── htpt.h
│   │   │           └── htpt_task.c
│   │   ├── lan/
│   │   │   ├── lan_common.h
│   │   │   ├── lanc/
│   │   │   │   ├── api/
│   │   │   │   │   └── lanc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── lanc.c
│   │   │   │       ├── lanc.h
│   │   │   │       └── lanc_task.c
│   │   │   └── lans/
│   │   │       ├── api/
│   │   │       │   └── lans_task.h
│   │   │       └── src/
│   │   │           ├── lans.c
│   │   │           ├── lans.h
│   │   │           └── lans_task.c
│   │   ├── ota/
│   │   │   ├── ota.c
│   │   │   ├── ota.h
│   │   │   ├── ota_task.c
│   │   │   └── ota_task.h
│   │   ├── pasp/
│   │   │   ├── pasp_common.h
│   │   │   ├── paspc/
│   │   │   │   ├── api/
│   │   │   │   │   └── paspc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── paspc.c
│   │   │   │       ├── paspc.h
│   │   │   │       └── paspc_task.c
│   │   │   └── pasps/
│   │   │       ├── api/
│   │   │       │   └── pasps_task.h
│   │   │       └── src/
│   │   │           ├── pasps.c
│   │   │           ├── pasps.h
│   │   │           └── pasps_task.c
│   │   ├── prf/
│   │   │   ├── prf.c
│   │   │   ├── prf_utils.c
│   │   │   └── prf_utils_128.c
│   │   ├── prox/
│   │   │   ├── proxm/
│   │   │   │   ├── api/
│   │   │   │   │   └── proxm_task.h
│   │   │   │   └── src/
│   │   │   │       ├── proxm.c
│   │   │   │       ├── proxm.h
│   │   │   │       └── proxm_task.c
│   │   │   └── proxr/
│   │   │       ├── api/
│   │   │       │   └── proxr_task.h
│   │   │       └── src/
│   │   │           ├── proxr.c
│   │   │           ├── proxr.h
│   │   │           └── proxr_task.c
│   │   ├── rscp/
│   │   │   ├── rscp_common.h
│   │   │   ├── rscpc/
│   │   │   │   ├── api/
│   │   │   │   │   └── rscpc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── rscpc.c
│   │   │   │       ├── rscpc.h
│   │   │   │       └── rscpc_task.c
│   │   │   └── rscps/
│   │   │       ├── api/
│   │   │       │   └── rscps_task.h
│   │   │       └── src/
│   │   │           ├── rscps.c
│   │   │           ├── rscps.h
│   │   │           └── rscps_task.c
│   │   ├── tip/
│   │   │   ├── tip_common.h
│   │   │   ├── tipc/
│   │   │   │   ├── api/
│   │   │   │   │   └── tipc_task.h
│   │   │   │   └── src/
│   │   │   │       ├── tipc.c
│   │   │   │       ├── tipc.h
│   │   │   │       └── tipc_task.c
│   │   │   └── tips/
│   │   │       ├── api/
│   │   │       │   └── tips_task.h
│   │   │       └── src/
│   │   │           ├── tips.c
│   │   │           ├── tips.h
│   │   │           └── tips_task.c
│   │   └── tota/
│   │       ├── tota_ble.c
│   │       ├── tota_ble.h
│   │       ├── tota_task.c
│   │       └── tota_task.h
│   ├── ble_stack/
│   │   ├── Makefile
│   │   ├── ble_ip/
│   │   │   ├── arch.h
│   │   │   ├── besble.h
│   │   │   ├── compiler.h
│   │   │   ├── rwapp_config.h
│   │   │   ├── rwble_hl.h
│   │   │   ├── rwble_hl_config.h
│   │   │   ├── rwip.h
│   │   │   ├── rwip_config.h
│   │   │   ├── rwip_task.h
│   │   │   └── rwprf_config.h
│   │   ├── common/
│   │   │   └── api/
│   │   │       ├── co_bt.h
│   │   │       ├── co_bt_defines.h
│   │   │       ├── co_endian.h
│   │   │       ├── co_error.h
│   │   │       ├── co_hci.h
│   │   │       ├── co_list.h
│   │   │       ├── co_llcp.h
│   │   │       ├── co_lmp.h
│   │   │       ├── co_math.h
│   │   │       ├── co_utils.h
│   │   │       ├── co_version.h
│   │   │       └── lePhone_rw_ble_error.txt
│   │   ├── dbg/
│   │   │   ├── api/
│   │   │   │   ├── dbg.h
│   │   │   │   ├── dbg_mwsgen.h
│   │   │   │   ├── dbg_swdiag.h
│   │   │   │   ├── dbg_trc.h
│   │   │   │   └── dbg_trc_config.h
│   │   │   └── src/
│   │   │       └── dbg_trc_int.h
│   │   ├── hci/
│   │   │   ├── api/
│   │   │   │   └── hci_ble.h
│   │   │   └── src/
│   │   │       └── hci_int.h
│   │   ├── hl/
│   │   │   ├── api/
│   │   │   │   ├── att.h
│   │   │   │   ├── gap.h
│   │   │   │   ├── gapc_task.h
│   │   │   │   ├── gapm_task.h
│   │   │   │   ├── gattc_task.h
│   │   │   │   ├── gattm_task.h
│   │   │   │   ├── l2cc_task.h
│   │   │   │   ├── prf_types.h
│   │   │   │   └── rwble_hl_error.h
│   │   │   ├── inc/
│   │   │   │   ├── attm.h
│   │   │   │   ├── gapc.h
│   │   │   │   ├── gapm.h
│   │   │   │   ├── gattc.h
│   │   │   │   ├── gattm.h
│   │   │   │   ├── l2cc.h
│   │   │   │   ├── l2cc_pdu.h
│   │   │   │   ├── l2cm.h
│   │   │   │   ├── prf.h
│   │   │   │   ├── prf_utils.h
│   │   │   │   ├── prf_utils_128.h
│   │   │   │   └── smpc.h
│   │   │   └── src/
│   │   │       ├── gap/
│   │   │       │   ├── gapc/
│   │   │       │   │   ├── gapc_int.h
│   │   │       │   │   └── gapc_sig.h
│   │   │       │   ├── gapm/
│   │   │       │   │   └── gapm_int.h
│   │   │       │   ├── smp_common.h
│   │   │       │   └── smpc/
│   │   │       │       ├── smpc_api.h
│   │   │       │       ├── smpc_crypto.h
│   │   │       │       ├── smpc_int.h
│   │   │       │       └── smpc_util.h
│   │   │       ├── gatt/
│   │   │       │   ├── attc/
│   │   │       │   │   └── attc.h
│   │   │       │   ├── attm/
│   │   │       │   │   └── attm_db.h
│   │   │       │   ├── atts/
│   │   │       │   │   └── atts.h
│   │   │       │   ├── gatt.h
│   │   │       │   ├── gattc/
│   │   │       │   │   └── gattc_int.h
│   │   │       │   └── gattm/
│   │   │       │       └── gattm_int.h
│   │   │       └── l2c/
│   │   │           ├── l2cc/
│   │   │           │   ├── l2cc_int.h
│   │   │           │   ├── l2cc_lecb.h
│   │   │           │   ├── l2cc_pdu_int.h
│   │   │           │   └── l2cc_sig.h
│   │   │           └── l2cm/
│   │   │               └── l2cm_int.h
│   │   └── ke/
│   │       ├── api/
│   │       │   ├── ke.h
│   │       │   ├── ke_event.h
│   │       │   ├── ke_mem.h
│   │       │   ├── ke_msg.h
│   │       │   ├── ke_task.h
│   │       │   └── ke_timer.h
│   │       └── src/
│   │           ├── ke_env.h
│   │           └── ke_queue.h
│   ├── bridge/
│   │   ├── Makefile
│   │   └── bridge.h
│   ├── bt_app/
│   │   ├── Makefile
│   │   ├── a2dp_codecs/
│   │   │   ├── Makefile
│   │   │   ├── aac/
│   │   │   │   └── a2dp_codec_aac.cpp
│   │   │   ├── app_a2dp_codecs.cpp
│   │   │   ├── include/
│   │   │   │   ├── a2dp_codec_aac.h
│   │   │   │   ├── a2dp_codec_ldac.h
│   │   │   │   ├── a2dp_codec_lhdc.h
│   │   │   │   ├── a2dp_codec_opus.h
│   │   │   │   ├── a2dp_codec_sbc.h
│   │   │   │   ├── a2dp_codec_scalable.h
│   │   │   │   ├── app_a2dp_codecs.h
│   │   │   │   └── codec_lhdc.h
│   │   │   ├── ldac/
│   │   │   │   └── a2dp_codec_ldac.cpp
│   │   │   ├── lhdc/
│   │   │   │   ├── a2dp_codec_lhdc.cpp
│   │   │   │   └── codec_lhdc.cpp
│   │   │   ├── opus/
│   │   │   │   └── a2dp_codec_opus.cpp
│   │   │   ├── sbc/
│   │   │   │   └── a2dp_codec_sbc.cpp
│   │   │   └── scalable/
│   │   │       └── a2dp_codec_scalable.cpp
│   │   ├── app_a2dp.cpp
│   │   ├── app_a2dp.h
│   │   ├── app_a2dp_source.cpp
│   │   ├── app_a2dp_source.h
│   │   ├── app_bqb.cpp
│   │   ├── app_bqb_new_profile.cpp
│   │   ├── app_bt.cpp
│   │   ├── app_bt.h
│   │   ├── app_bt_func.cpp
│   │   ├── app_bt_func.h
│   │   ├── app_bt_hid.cpp
│   │   ├── app_bt_hid.h
│   │   ├── app_bt_media_manager.cpp
│   │   ├── app_bt_media_manager.h
│   │   ├── app_bt_stream.cpp
│   │   ├── app_bt_stream.h
│   │   ├── app_bt_trace.h
│   │   ├── app_btgatt.cpp
│   │   ├── app_btgatt.h
│   │   ├── app_btmap_sms.cpp
│   │   ├── app_btmap_sms.h
│   │   ├── app_dip.cpp
│   │   ├── app_dip.h
│   │   ├── app_fp_rfcomm.cpp
│   │   ├── app_fp_rfcomm.h
│   │   ├── app_hfp.cpp
│   │   ├── app_hfp.h
│   │   ├── app_hsp.cpp
│   │   ├── app_keyhandle.cpp
│   │   ├── app_media_player.cpp
│   │   ├── app_media_player.h
│   │   ├── app_rfcomm_mgr.cpp
│   │   ├── app_rfcomm_mgr.h
│   │   ├── app_ring_merge.cpp
│   │   ├── app_ring_merge.h
│   │   ├── app_sec.cpp
│   │   ├── app_spp.cpp
│   │   ├── app_spp.h
│   │   ├── audio_prompt_sbc.cpp
│   │   ├── audio_prompt_sbc.h
│   │   ├── besbt.h
│   │   ├── besbt_cfg.h
│   │   ├── besmain.cpp
│   │   ├── btapp.h
│   │   ├── res_audio_data.h
│   │   └── res_audio_ring.h
│   ├── bt_if_enhanced/
│   │   ├── Makefile
│   │   └── inc/
│   │       ├── a2dp_api.h
│   │       ├── avctp_api.h
│   │       ├── avdtp_api.h
│   │       ├── avrcp_api.h
│   │       ├── avtp_api.h
│   │       ├── besaud_api.h
│   │       ├── besble_debug.h
│   │       ├── bluetooth.h
│   │       ├── bt_if.h
│   │       ├── bt_status_conv.h
│   │       ├── bt_xtal_sync.h
│   │       ├── btgatt_api.h
│   │       ├── btif_sys_config.h
│   │       ├── color_log.h
│   │       ├── conmgr_api.h
│   │       ├── dip_api.h
│   │       ├── hci_api.h
│   │       ├── hfp_api.h
│   │       ├── hid_api.h
│   │       ├── hshf_api.h
│   │       ├── l2cap_api.h
│   │       ├── map_api.h
│   │       ├── map_internal.h
│   │       ├── me_api.h
│   │       ├── mei_api.h
│   │       ├── obex_api.h
│   │       ├── os_api.h
│   │       ├── rfcomm_api.h
│   │       ├── sco_api.h
│   │       ├── sdp_api.h
│   │       ├── spp_api.h
│   │       ├── spp_task.h
│   │       └── tws_role_switch.h
│   ├── bt_profiles_enhanced/
│   │   ├── Makefile
│   │   └── inc/
│   │       ├── a2dp.h
│   │       ├── a2dp_i.h
│   │       ├── avctp.h
│   │       ├── avctp_i.h
│   │       ├── avdtp.h
│   │       ├── avdtp_i.h
│   │       ├── avrcp.h
│   │       ├── avrcp_i.h
│   │       ├── bes_os.h
│   │       ├── besaud.h
│   │       ├── besaudalloc.h
│   │       ├── bt_co_list.h
│   │       ├── bt_common.h
│   │       ├── bt_schedule.h
│   │       ├── bt_sys_cfg.h
│   │       ├── btgatt.h
│   │       ├── btlib.h
│   │       ├── btlib_more.h
│   │       ├── btlib_type.h
│   │       ├── btm.h
│   │       ├── btm_devicedb.h
│   │       ├── btm_fast_init.h
│   │       ├── btm_handle_hcievent.h
│   │       ├── btm_hci.h
│   │       ├── btm_i.h
│   │       ├── btm_security.h
│   │       ├── co_lib.h
│   │       ├── co_ppbuff.h
│   │       ├── co_printf.h
│   │       ├── co_queue.h
│   │       ├── co_timer.h
│   │       ├── cobt.h
│   │       ├── cobuf.h
│   │       ├── data_link.h
│   │       ├── debug_cfg.h
│   │       ├── debug_print.h
│   │       ├── dip.h
│   │       ├── hci.h
│   │       ├── hci_buff.h
│   │       ├── hfp.h
│   │       ├── hid_i.h
│   │       ├── hshf.h
│   │       ├── hshf_i.h
│   │       ├── l2cap.h
│   │       ├── l2cap_er.h
│   │       ├── l2cap_i.h
│   │       ├── map_bmessage_builder.h
│   │       ├── map_protocol.h
│   │       ├── map_sdp.h
│   │       ├── map_session.h
│   │       ├── md5.h
│   │       ├── obex.h
│   │       ├── obex_ascii_unicode.h
│   │       ├── obex_i.h
│   │       ├── obex_if.h
│   │       ├── obex_protocol.h
│   │       ├── obex_session.h
│   │       ├── obex_tlv.h
│   │       ├── obex_transmission.h
│   │       ├── obex_transportlayer.h
│   │       ├── overide.h
│   │       ├── packer.h
│   │       ├── pbap.h
│   │       ├── pbap_i.h
│   │       ├── platform_deps.h
│   │       ├── rfcomm.h
│   │       ├── rfcomm_i.h
│   │       ├── sco.h
│   │       ├── sco_i.h
│   │       ├── sdp.h
│   │       ├── sppnew.h
│   │       └── win32_os.h
│   ├── communication/
│   │   ├── Makefile
│   │   ├── comminication_knowles/
│   │   │   ├── Makefile
│   │   │   ├── communication_cmd_handle.cpp
│   │   │   ├── communication_cmd_handle.h
│   │   │   ├── communication_cmd_msg.h
│   │   │   ├── communication_sysapi.cpp
│   │   │   ├── communication_sysapi.h
│   │   │   └── tool_msg.h
│   │   ├── communication_svr.cpp
│   │   └── communication_svr.h
│   ├── cp_accel/
│   │   ├── Makefile
│   │   ├── cp_accel.c
│   │   ├── cp_accel.h
│   │   ├── cp_queue.c
│   │   └── cp_queue.h
│   ├── hw_dsp/
│   │   ├── Makefile
│   │   ├── inc/
│   │   │   └── hw_filter_codec_iir.h
│   │   └── src/
│   │       └── hw_filter_codec_iir.c
│   ├── ibrt_core/
│   │   ├── Makefile
│   │   └── inc/
│   │       ├── app_ibrt_bt_profile_sync.h
│   │       ├── app_tws_besaud.h
│   │       ├── app_tws_ctrl_thread.h
│   │       ├── app_tws_ibrt.h
│   │       ├── app_tws_ibrt_audio_analysis.h
│   │       ├── app_tws_ibrt_audio_sync.h
│   │       ├── app_tws_ibrt_cmd_audio_analysis.h
│   │       ├── app_tws_ibrt_cmd_handler.h
│   │       ├── app_tws_ibrt_cmd_sync_a2dp_status.h
│   │       ├── app_tws_ibrt_cmd_sync_hfp_status.h
│   │       ├── app_tws_ibrt_mock.h
│   │       ├── app_tws_ibrt_queue.h
│   │       ├── app_tws_ibrt_trace.h
│   │       ├── app_tws_profile_sync.h
│   │       └── app_vendor_cmd_evt.h
│   ├── ibrt_ota/
│   │   ├── Makefile
│   │   └── inc/
│   │       ├── ota_bes.h
│   │       ├── ota_control.h
│   │       └── ota_spp.h
│   ├── ibrt_ui/
│   │   ├── Makefile
│   │   └── inc/
│   │       └── app_ibrt_ui.h
│   ├── interconnection/
│   │   ├── Makefile
│   │   └── umm_malloc/
│   │       ├── dbglog.h
│   │       ├── umm_malloc.c
│   │       └── umm_malloc.h
│   ├── lhdc_license/
│   │   └── Makefile
│   ├── multimedia/
│   │   ├── Makefile
│   │   ├── algorithm/
│   │   │   └── fft/
│   │   │       └── include/
│   │   │           ├── fft128dot.h
│   │   │           └── fftr4_fxp.h
│   │   ├── audio/
│   │   │   ├── codec/
│   │   │   │   ├── fdkaac_codec/
│   │   │   │   │   ├── ChangeLog
│   │   │   │   │   ├── NOTICE
│   │   │   │   │   ├── README
│   │   │   │   │   ├── libAACdec/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       └── aacdecoder_lib.h
│   │   │   │   │   ├── libAACenc/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       └── aacenc_lib.h
│   │   │   │   │   ├── libFDK/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       ├── FDK_archdef.h
│   │   │   │   │   │       ├── FDK_bitbuffer.h
│   │   │   │   │   │       ├── FDK_bitstream.h
│   │   │   │   │   │       ├── FDK_core.h
│   │   │   │   │   │       ├── FDK_crc.h
│   │   │   │   │   │       ├── FDK_hybrid.h
│   │   │   │   │   │       ├── FDK_tools_rom.h
│   │   │   │   │   │       ├── FDK_trigFcts.h
│   │   │   │   │   │       ├── aarch64/
│   │   │   │   │   │       │   ├── clz_aarch64.h
│   │   │   │   │   │       │   └── fixmul_aarch64.h
│   │   │   │   │   │       ├── abs.h
│   │   │   │   │   │       ├── arm/
│   │   │   │   │   │       │   ├── clz_arm.h
│   │   │   │   │   │       │   ├── cplx_mul.h
│   │   │   │   │   │       │   ├── fixmadd_arm.h
│   │   │   │   │   │       │   ├── fixmul_arm.h
│   │   │   │   │   │       │   ├── scale.h
│   │   │   │   │   │       │   └── scramble.h
│   │   │   │   │   │       ├── autocorr2nd.h
│   │   │   │   │   │       ├── clz.h
│   │   │   │   │   │       ├── common_fix.h
│   │   │   │   │   │       ├── cplx_mul.h
│   │   │   │   │   │       ├── dct.h
│   │   │   │   │   │       ├── fft.h
│   │   │   │   │   │       ├── fft_rad2.h
│   │   │   │   │   │       ├── fixmadd.h
│   │   │   │   │   │       ├── fixminmax.h
│   │   │   │   │   │       ├── fixmul.h
│   │   │   │   │   │       ├── fixpoint_math.h
│   │   │   │   │   │       ├── mdct.h
│   │   │   │   │   │       ├── mips/
│   │   │   │   │   │       │   ├── abs_mips.h
│   │   │   │   │   │       │   ├── clz_mips.h
│   │   │   │   │   │       │   ├── cplx_mul.h
│   │   │   │   │   │       │   ├── fixmadd_mips.h
│   │   │   │   │   │       │   ├── fixmul_mips.h
│   │   │   │   │   │       │   ├── scale.h
│   │   │   │   │   │       │   └── scramble.h
│   │   │   │   │   │       ├── ppc/
│   │   │   │   │   │       │   ├── clz_ppc.h
│   │   │   │   │   │       │   └── fixmul_ppc.h
│   │   │   │   │   │       ├── qmf.h
│   │   │   │   │   │       ├── scale.h
│   │   │   │   │   │       ├── scramble.h
│   │   │   │   │   │       └── x86/
│   │   │   │   │   │           ├── abs_x86.h
│   │   │   │   │   │           ├── clz_x86.h
│   │   │   │   │   │           └── fixmul_x86.h
│   │   │   │   │   ├── libMpegTPDec/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       ├── mpegFileRead.h
│   │   │   │   │   │       ├── tp_data.h
│   │   │   │   │   │       └── tpdec_lib.h
│   │   │   │   │   ├── libMpegTPEnc/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       ├── mpegFileWrite.h
│   │   │   │   │   │       ├── tp_data.h
│   │   │   │   │   │       └── tpenc_lib.h
│   │   │   │   │   ├── libPCMutils/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       ├── limiter.h
│   │   │   │   │   │       └── pcmutils_lib.h
│   │   │   │   │   ├── libSBRdec/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       └── sbrdecoder.h
│   │   │   │   │   ├── libSBRenc/
│   │   │   │   │   │   └── include/
│   │   │   │   │   │       └── sbr_encoder.h
│   │   │   │   │   └── libSYS/
│   │   │   │   │       └── include/
│   │   │   │   │           ├── FDK_audio.h
│   │   │   │   │           ├── audio.h
│   │   │   │   │           ├── cmdl_parser.h
│   │   │   │   │           ├── conv_string.h
│   │   │   │   │           ├── genericStds.h
│   │   │   │   │           ├── machine_type.h
│   │   │   │   │           └── wav_file.h
│   │   │   │   └── sbc/
│   │   │   │       └── inc/
│   │   │   │           └── codec_sbc.h
│   │   │   └── process/
│   │   │       ├── adp/
│   │   │       │   └── include/
│   │   │       │       ├── adp_arch.h
│   │   │       │       ├── adp_config.h
│   │   │       │       ├── adp_fftwrap.h
│   │   │       │       ├── adp_filter.h
│   │   │       │       └── adp_smallft.h
│   │   │       ├── anc/
│   │   │       │   ├── cfg/
│   │   │       │   │   ├── Makefile
│   │   │       │   │   └── anc_cfg.c
│   │   │       │   └── include/
│   │   │       │       ├── anc_process.h
│   │   │       │       └── fftfilt2.h
│   │   │       ├── common/
│   │   │       │   └── include/
│   │   │       │       └── audio_memory.h
│   │   │       ├── drc/
│   │   │       │   └── include/
│   │   │       │       └── drc.h
│   │   │       ├── filters/
│   │   │       │   ├── cfg/
│   │   │       │   │   ├── Makefile
│   │   │       │   │   ├── eq_cfg.c
│   │   │       │   │   └── eq_cfg.h
│   │   │       │   └── include/
│   │   │       │       ├── dsd_process.h
│   │   │       │       ├── filter_debug_trace.h
│   │   │       │       ├── fir_process.h
│   │   │       │       ├── hw_codec_iir_process.h
│   │   │       │       ├── hw_iir_process.h
│   │   │       │       └── iir_process.h
│   │   │       ├── fir2iir/
│   │   │       │   └── include/
│   │   │       │       └── fir2iir.h
│   │   │       ├── integer_resampling/
│   │   │       │   └── include/
│   │   │       │       └── integer_resampling.h
│   │   │       ├── limiter/
│   │   │       │   └── include/
│   │   │       │       └── limiter.h
│   │   │       └── resample/
│   │   │           ├── coef/
│   │   │           │   ├── Makefile
│   │   │           │   ├── resample_16k_to_48k_filter.txt
│   │   │           │   ├── resample_32k_to_50p7k_filter.txt
│   │   │           │   ├── resample_44p1k_to_48k_filter.txt
│   │   │           │   ├── resample_44p1k_to_50p7k_filter.txt
│   │   │           │   ├── resample_48k_to_44p1k_filter.txt
│   │   │           │   ├── resample_48k_to_50p7k_filter.txt
│   │   │           │   ├── resample_50p7k_to_44p1k_filter.txt
│   │   │           │   ├── resample_50p7k_to_48k_filter.txt
│   │   │           │   ├── resample_8k_to_8p4k_filter.txt
│   │   │           │   ├── resample_8p4k_to_8k_filter.txt
│   │   │           │   ├── resample_any_up256_filter.txt
│   │   │           │   ├── resample_any_up512_32_filter.txt
│   │   │           │   ├── resample_any_up512_36_filter.txt
│   │   │           │   ├── resample_any_up64_filter.txt
│   │   │           │   └── resample_coef.c
│   │   │           └── include/
│   │   │               ├── audio_resample.h
│   │   │               ├── audio_resample_ex.h
│   │   │               ├── audio_resample_ex_32bit.h
│   │   │               └── resample_coef.h
│   │   └── speech/
│   │       └── inc/
│   │           ├── Pcm8k_Cvsd.h
│   │           ├── SubBandBasedAEC.h
│   │           ├── VoiceActivityDetection.h
│   │           ├── ae_macros.h
│   │           ├── ae_math.h
│   │           ├── agc.h
│   │           ├── anc_assist_algo.h
│   │           ├── audio_drc2.h
│   │           ├── buffer_manager.h
│   │           ├── compexp.h
│   │           ├── crossfade.h
│   │           ├── cvsd_codec.h
│   │           ├── dual_mic_denoise.h
│   │           ├── echo_canceller.h
│   │           ├── ext_fft_f32.h
│   │           ├── ext_heap.h
│   │           ├── far_field_speech_enhancement.h
│   │           ├── fftfilt.h
│   │           ├── frame_resize.h
│   │           ├── g726.h
│   │           ├── g72x.h
│   │           ├── iir_resample.h
│   │           ├── iirfilt.h
│   │           ├── lc_mmse_ns.h
│   │           ├── lc_mmse_ns_float.h
│   │           ├── leftright_denoise.h
│   │           ├── lpc_plc_api.h
│   │           ├── main_classify.h
│   │           ├── med_aec3_comm.h
│   │           ├── med_aec3_main.h
│   │           ├── med_aec3_main_internal.h
│   │           ├── ns3.h
│   │           ├── plc_16000.h
│   │           ├── plc_8000.h
│   │           ├── recognition.h
│   │           ├── sensormic_denoise.h
│   │           ├── single_mic_NNDenoise.h
│   │           ├── spectrum.h
│   │           ├── spectrum_fix.h
│   │           ├── speech_2mic_ns2_denoise.h
│   │           ├── speech_3mic_ns.h
│   │           ├── speech_aec.h
│   │           ├── speech_aec2.h
│   │           ├── speech_cfg.h
│   │           ├── speech_config.h
│   │           ├── speech_dc_filter.h
│   │           ├── speech_eq.h
│   │           ├── speech_ff_2mic_ns2.h
│   │           ├── speech_ff_3mic_ns1.h
│   │           ├── speech_fir_calibration.h
│   │           ├── speech_gain.h
│   │           ├── speech_iir.h
│   │           ├── speech_iir_calibration.h
│   │           ├── speech_memory.h
│   │           ├── speech_mics_calibration.h
│   │           ├── speech_noise_gate.h
│   │           ├── speech_ns.h
│   │           ├── speech_peak_detector.h
│   │           ├── speech_ssat.h
│   │           ├── speech_utils.h
│   │           ├── speex_resampler.h
│   │           ├── triple_mic_denoise3.h
│   │           ├── wind_detection_2mic.h
│   │           └── wnr.h
│   ├── norflash_api/
│   │   ├── Makefile
│   │   ├── norflash_api.cpp
│   │   └── norflash_api.h
│   ├── nv_section/
│   │   ├── Makefile
│   │   ├── aud_section/
│   │   │   ├── Makefile
│   │   │   ├── aud_section.c
│   │   │   ├── aud_section.h
│   │   │   └── aud_section_inc.h
│   │   ├── customparam_section/
│   │   │   ├── Makefile
│   │   │   ├── customparam_section.c
│   │   │   └── customparam_section.h
│   │   ├── factory_section/
│   │   │   ├── Makefile
│   │   │   ├── factory_section.c
│   │   │   └── factory_section.h
│   │   ├── include/
│   │   │   └── section_def.h
│   │   ├── log_section/
│   │   │   ├── Makefile
│   │   │   ├── coredump_section.c
│   │   │   ├── coredump_section.h
│   │   │   ├── crash_dump_section.c
│   │   │   ├── crash_dump_section.h
│   │   │   ├── log_section.c
│   │   │   └── log_section.h
│   │   ├── nv_section_dbg.h
│   │   └── userdata_section/
│   │       ├── Makefile
│   │       ├── nvrecord_ble.c
│   │       ├── nvrecord_ble.h
│   │       ├── nvrecord_bt.c
│   │       ├── nvrecord_bt.h
│   │       ├── nvrecord_dma_config.c
│   │       ├── nvrecord_dma_config.h
│   │       ├── nvrecord_env.c
│   │       ├── nvrecord_env.h
│   │       ├── nvrecord_extension.c
│   │       ├── nvrecord_extension.h
│   │       ├── nvrecord_fp_account_key.c
│   │       ├── nvrecord_fp_account_key.h
│   │       ├── nvrecord_gsound.c
│   │       ├── nvrecord_gsound.h
│   │       ├── nvrecord_ota.c
│   │       └── nvrecord_ota.h
│   ├── nvrecord/
│   │   ├── Makefile
│   │   ├── list_ext.c
│   │   ├── list_ext.h
│   │   ├── nvrec_config.c
│   │   ├── nvrec_config.h
│   │   ├── nvrecord.c
│   │   ├── nvrecord.h
│   │   ├── nvrecord_ble.c
│   │   ├── nvrecord_ble.h
│   │   ├── nvrecord_dev.h
│   │   ├── nvrecord_env.c
│   │   ├── nvrecord_env.h
│   │   ├── nvrecord_fp_account_key.c
│   │   └── nvrecord_fp_account_key.h
│   ├── osif/
│   │   ├── Makefile
│   │   ├── ddbif.h
│   │   ├── ddbif_bes.c
│   │   ├── osif.h
│   │   └── osif_rtx.c
│   ├── ota/
│   │   ├── Makefile
│   │   ├── ota_common.cpp
│   │   ├── ota_common.h
│   │   └── ota_dbg.h
│   ├── overlay/
│   │   ├── Makefile
│   │   ├── app_overlay.cpp
│   │   └── app_overlay.h
│   ├── resources/
│   │   ├── Makefile
│   │   ├── resources.cpp
│   │   └── resources.h
│   ├── through_put/
│   │   ├── Makefile
│   │   ├── app_through_put.cpp
│   │   └── app_through_put.h
│   └── tota/
│       ├── Makefile
│       ├── app_spp_tota.cpp
│       ├── app_spp_tota.h
│       ├── app_spp_tota_general_service.cpp
│       ├── app_spp_tota_general_service.h
│       ├── app_tota.cpp
│       ├── app_tota.h
│       ├── app_tota_anc.cpp
│       ├── app_tota_anc.h
│       ├── app_tota_audio_dump.cpp
│       ├── app_tota_audio_dump.h
│       ├── app_tota_cmd_code.h
│       ├── app_tota_cmd_handler.cpp
│       ├── app_tota_cmd_handler.h
│       ├── app_tota_conn.cpp
│       ├── app_tota_conn.h
│       ├── app_tota_custom.cpp
│       ├── app_tota_custom.h
│       ├── app_tota_data_handler.cpp
│       ├── app_tota_data_handler.h
│       ├── app_tota_flash_program.cpp
│       ├── app_tota_flash_program.h
│       ├── app_tota_general.cpp
│       ├── app_tota_general.h
│       ├── app_tota_mic.cpp
│       ├── app_tota_mic.h
│       ├── tota_buffer_manager.cpp
│       ├── tota_buffer_manager.h
│       ├── tota_stream_data_transfer.cpp
│       ├── tota_stream_data_transfer.h
│       └── tota_test.cpp
├── start_dev.sh
├── thirdparty/
│   ├── Makefile
│   ├── audio_codec_lib/
│   │   ├── Makefile
│   │   ├── ldac/
│   │   │   ├── Makefile
│   │   │   └── inc/
│   │   │       └── ldacBT.h
│   │   └── liblhdc-dec/
│   │       ├── Makefile
│   │       └── inc/
│   │           └── lhdcUtil.h
│   ├── demo_lib/
│   │   ├── Makefile
│   │   ├── demo_lib.c
│   │   └── demo_lib.h
│   ├── noise_tracker_lib/
│   │   ├── Makefile
│   │   ├── noise_tracker.c
│   │   └── noise_tracker.h
│   └── userapi/
│       ├── Makefile
│       ├── app_thirdparty.cpp
│       ├── app_thirdparty.h
│       ├── demo_app/
│       │   ├── LibDemo.cpp
│       │   ├── LibDemo.h
│       │   └── Makefile
│       └── noise_tracker_app/
│           ├── Makefile
│           ├── NoiseTrackerDemo.cpp
│           ├── noise_tracker_callback.c
│           └── noise_tracker_callback.h
├── uart_log.sh
└── utils/
    ├── boot_struct/
    │   ├── Makefile
    │   ├── boot_struct.c
    │   ├── norflash_cfg.h
    │   ├── reboot_param.h
    │   └── tool_msg.h
    ├── build_info/
    │   └── build_info.c
    ├── cqueue/
    │   ├── Makefile
    │   ├── cqueue.c
    │   └── cqueue.h
    ├── crash_catcher/
    │   ├── CrashCatcher.c
    │   ├── CrashCatcherPriv.h
    │   ├── CrashCatcher_armv7m.S
    │   ├── HexDump.c
    │   ├── Makefile
    │   └── include/
    │       ├── CrashCatcher.h
    │       ├── CrashCatcherApi.h
    │       └── FloatMocks.h
    ├── crc16/
    │   ├── Makefile
    │   ├── crc16.c
    │   └── crc16.h
    ├── crc32/
    │   ├── Makefile
    │   ├── crc32.c
    │   ├── crc32.h
    │   └── crc32_rom.c
    ├── encrypt/
    │   ├── Makefile
    │   ├── _sha256.h
    │   ├── aes.h
    │   ├── types.h
    │   ├── uECC.h
    │   └── uECC_vli.h
    ├── heap/
    │   ├── Makefile
    │   ├── heap_api.c
    │   ├── heap_api.h
    │   ├── med_memory.h
    │   ├── multi_heap.c
    │   ├── multi_heap.h
    │   ├── multi_heap_internal.h
    │   ├── multi_heap_platform.h
    │   └── pool_api.c
    ├── hexdump/
    │   ├── Makefile
    │   ├── hexdump.c
    │   └── hexdump.h
    ├── hwtimer_list/
    │   ├── Makefile
    │   ├── hwtimer_list.c
    │   └── hwtimer_list.h
    ├── intersyshci/
    │   ├── Makefile
    │   ├── intersyshci.h
    │   ├── trans_adapt.h
    │   ├── trans_adapt_v1.h
    │   └── trans_adapt_v2.h
    ├── kfifo/
    │   ├── Makefile
    │   ├── kfifo.c
    │   └── kfifo.h
    ├── libc/
    │   ├── Makefile
    │   ├── inc/
    │   │   ├── assert.h
    │   │   ├── ctype.h
    │   │   ├── errno.h
    │   │   ├── stdarg.h
    │   │   ├── stdbool.h
    │   │   ├── stddef.h
    │   │   ├── stdint.h
    │   │   ├── stdio.h
    │   │   ├── stdlib.h
    │   │   └── string.h
    │   └── libc_rom.c
    ├── list/
    │   ├── Makefile
    │   ├── list.c
    │   └── list.h
    ├── lockcqueue/
    │   ├── Makefile
    │   ├── lockcqueue.c
    │   └── lockcqueue.h
    ├── retention_ram/
    │   ├── Makefile
    │   ├── retention_ram.c
    │   └── retention_ram.h
    ├── rom_utils/
    │   ├── Makefile
    │   └── export_fn_rom.h
    ├── sha256/
    │   ├── Makefile
    │   ├── hash-internal.h
    │   ├── sha256.c
    │   ├── sha256.h
    │   └── sha256_rom.c
    └── xyzmodem/
        ├── Makefile
        ├── xyzmodem.c
        └── xyzmodem.h
Download .txt
Showing preview only (1,492K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (17240 symbols across 1444 files)

FILE: apps/anc/inc/anc_assist.h
  type ASSIST_PCM_T (line 33) | typedef int   ASSIST_PCM_T;
  type ASSIST_PCM_T (line 36) | typedef short   ASSIST_PCM_T;
  type ANC_ASSIST_MODE_T (line 48) | typedef enum{

FILE: apps/anc/inc/anc_wnr.h
  type anc_wnr_open_mode_t (line 26) | typedef enum {
  type anc_wnr_sync_ctrl_internal_event_e (line 35) | typedef enum {

FILE: apps/anc/inc/app_anc.h
  type AUD_SAMPRATE_T (line 26) | enum AUD_SAMPRATE_T
  type AUD_IO_PATH_T (line 27) | enum AUD_IO_PATH_T
  type AUD_SAMPRATE_T (line 27) | enum AUD_SAMPRATE_T
  type AUD_SAMPRATE_T (line 27) | enum AUD_SAMPRATE_T
  type AUD_SAMPRATE_T (line 39) | enum AUD_SAMPRATE_T

FILE: apps/anc/inc/peak_detector.h
  type PEAK_DETECTOR_CFG_T (line 26) | typedef struct {

FILE: apps/anc/src/anc_assist.c
  function anc_assist_change_curve (line 83) | void anc_assist_change_curve(int curve_id) {
  function audio_engine_tt_is_on (line 88) | bool audio_engine_tt_is_on() { return 1; }
  function anc_assist_set_anc_gain (line 91) | void anc_assist_set_anc_gain(float gain_ch_l, float gain_ch_r,
  function anc_assist_open (line 113) | void anc_assist_open(ANC_ASSIST_MODE_T mode) {
  function anc_assist_close (line 146) | void anc_assist_close() {
  function anc_assist_process (line 178) | void anc_assist_process(uint8_t *buf, int len) {
  function anc_assist_callback (line 229) | static uint32_t anc_assist_callback(uint8_t *buf, uint32_t len) {
  function anc_assist_playback_callback (line 248) | static uint32_t anc_assist_playback_callback(uint8_t *buf, uint32_t len) {
  function _open_mic_anc_assist (line 255) | static void _open_mic_anc_assist(void) {
  function _close_mic_anc_assist (line 373) | static void _close_mic_anc_assist() {

FILE: apps/anc/src/anc_wnr.c
  type WNR_PCM_T (line 48) | typedef int WNR_PCM_T;
  type WNR_PCM_T (line 51) | typedef short WNR_PCM_T;
  type anc_wnr_state_queue_t (line 166) | struct anc_wnr_state_queue_t {
  type anc_tuning_ctrl (line 184) | struct anc_tuning_ctrl {
  type anc_tuning_ctrl (line 192) | struct anc_tuning_ctrl
  function anc_gain_tuning_init (line 208) | void anc_gain_tuning_init(void) {
  function anc_tuning_ff_gain_timer_timeout (line 213) | static void anc_tuning_ff_gain_timer_timeout(void *param) {
  function _set_anc_ff_gain (line 248) | static void _set_anc_ff_gain(bool update_anc_gain, float gain_coef,
  function anc_release_gain (line 301) | void anc_release_gain(void) {
  function anc_wnr_ctrl (line 307) | int32_t anc_wnr_ctrl(int32_t sample_rate, int32_t frame_len) {
  function app_wnr_reset_state_queue (line 321) | static void app_wnr_reset_state_queue(void) {
  function app_wnr_push_state_to_queue (line 331) | static void app_wnr_push_state_to_queue(uint8_t open_mode, uint8_t arg0) {
  function app_wnr_get_state_from_queue (line 362) | static uint8_t app_wnr_get_state_from_queue(uint8_t open_mode) {
  function app_wnr_trigger_internal_event (line 437) | static void app_wnr_trigger_internal_event(uint32_t evt, uint32_t arg0,
  function app_wnr_share_module_info (line 451) | static void app_wnr_share_module_info(void) {
  function app_wnr_sync_state (line 464) | void app_wnr_sync_state(void) {
  function app_wnr_twostage_handler (line 482) | static void app_wnr_twostage_handler(void const *param) {
  function app_wnr_sync_timer_handler (line 506) | static void app_wnr_sync_timer_handler(void const *param) {
  function app_wnr_notify_detect_result (line 516) | static void app_wnr_notify_detect_result(void) {
  function app_wnr_request_detect_result (line 531) | static void app_wnr_request_detect_result(void) {
  function app_wnr_response_detect_result (line 546) | static void app_wnr_response_detect_result(uint32_t arg0) {
  function app_wnr_process_detect_result (line 573) | static void app_wnr_process_detect_result(uint32_t arg0) {
  function app_wnr_set_trigger (line 597) | static void app_wnr_set_trigger(uint32_t arg0, uint32_t arg1) {
  function app_wnr_excute_trigger (line 675) | static void app_wnr_excute_trigger(uint32_t arg0) {
  function app_wnr_internal_event_process (line 754) | static int app_wnr_internal_event_process(APP_MESSAGE_BODY *msg_body) {
  function app_wnr_cmd_receive_process (line 793) | void app_wnr_cmd_receive_process(uint8_t *p_buff, uint16_t length) {
  function anc_wnr_open (line 897) | int32_t anc_wnr_open(anc_wnr_open_mode_t mode) {
  function anc_wnr_close (line 981) | int32_t anc_wnr_close(void) {
  function anc_wnr_process_frame (line 1035) | static int32_t anc_wnr_process_frame(WNR_PCM_T *inF, WNR_PCM_T *inR,
  function stereo_resample_16k (line 1231) | static void inline stereo_resample_16k(WNR_PCM_T *pcm_buf, uint32_t pcm_...
  function anc_wnr_process (line 1270) | int32_t anc_wnr_process(void *pcm_buf, uint32_t pcm_len) {
  function anc_wnr_callback (line 1311) | static uint32_t anc_wnr_callback(uint8_t *buf, uint32_t len) {
  function _open_mic (line 1349) | static void _open_mic(void) {
  function _close_mic (line 1375) | static void _close_mic(void) {

FILE: apps/anc/src/app_anc.c
  type AUD_SAMPRATE_T (line 81) | enum AUD_SAMPRATE_T
  type AUD_SAMPRATE_T (line 82) | enum AUD_SAMPRATE_T
  type AUD_SAMPRATE_T (line 135) | enum AUD_SAMPRATE_T
  type ANC_TYPE_T (line 149) | enum ANC_TYPE_T
  type ANC_TYPE_T (line 155) | enum ANC_TYPE_T
  type ANC_INDEX (line 178) | enum ANC_INDEX
  function app_anc_is_on (line 182) | bool app_anc_is_on(void) { return (ANC_STATUS_ON == anc_work_status); }
  function app_anc_get_sample_rate (line 184) | uint32_t app_anc_get_sample_rate(void) {
  function app_anc_set_coef_idx (line 188) | void app_anc_set_coef_idx(uint8_t idx) { anc_coef_idx = idx; }
  function app_anc_get_coef_idx (line 190) | uint8_t app_anc_get_coef_idx(void) { return anc_coef_idx; }
  type ANC_INDEX (line 194) | enum ANC_INDEX
  function app_anc_set_peer_coef_idx (line 197) | void app_anc_set_peer_coef_idx(uint8_t idx) { anc_peer_coef_idx = idx; }
  function app_anc_get_peer_coef_idx (line 199) | uint8_t app_anc_get_peer_coef_idx(void) { return anc_peer_coef_idx; }
  function app_anc_set_status_sync_flag (line 201) | void app_anc_set_status_sync_flag(bool status) {
  function app_anc_get_status_sync_flag (line 205) | bool app_anc_get_status_sync_flag(void) { return anc_status_sync_flag; }
  function app_anc_set_init_done (line 209) | void app_anc_set_init_done(void) { app_init_done = true; }
  function app_pwr_key_monitor_handler (line 217) | static void app_pwr_key_monitor_handler(enum HAL_GPIO_PIN_T pin) {
  function app_pwr_key_monitor_get_val (line 225) | bool app_pwr_key_monitor_get_val(void) {
  function app_pwr_key_monitor_set_int_edge (line 229) | void app_pwr_key_monitor_set_int_edge(uint8_t down_edge) {
  function app_pwr_key_monitor_init (line 241) | void app_pwr_key_monitor_init(ANC_KEY_CALLBACK callback) {
  function app_anc_switch_turnled (line 247) | void app_anc_switch_turnled(bool on) {
  function app_anc_switch_int_handler (line 264) | static void app_anc_switch_int_handler(enum HAL_GPIO_PIN_T pin) {
  function app_anc_switch_init (line 282) | void app_anc_switch_init(ANC_KEY_CALLBACK callback) {
  function app_anc_set_reboot (line 288) | bool app_anc_set_reboot(void) {
  function app_anc_switch_get_val (line 293) | bool app_anc_switch_get_val(void) {
  function app_anc_switch_set_edge (line 297) | void app_anc_switch_set_edge(uint8_t down_edge) {
  function __anc_usb_app_fadein (line 310) | int __anc_usb_app_fadein(enum ANC_TYPE_T type) {
  function __anc_usb_app_fadeout (line 348) | int __anc_usb_app_fadeout(enum ANC_TYPE_T type) {
  function __anc_usb_app_fadein_ff_fb (line 379) | int __anc_usb_app_fadein_ff_fb(void) {
  function __anc_usb_app_fadeout_ff_fb (line 510) | int __anc_usb_app_fadeout_ff_fb(void) {
  function anc_gain_fade_handle (line 604) | void anc_gain_fade_handle(void) {
  function anc_fade_thread (line 625) | void anc_fade_thread(void const *argument) {
  function app_anc_gain_fadein (line 754) | void app_anc_gain_fadein(void) {
  function app_anc_post_anc_codec_close (line 767) | void app_anc_post_anc_codec_close(void) {
  function app_anc_gain_fadeout (line 778) | void app_anc_gain_fadeout(void) {
  function app_anc_status_post (line 791) | void app_anc_status_post(uint8_t status) {
  function app_anc_status_sync (line 803) | void app_anc_status_sync(uint8_t status) {
  function app_anc_status_sync_init (line 815) | void app_anc_status_sync_init(void) {
  function app_anc_do_init (line 826) | void app_anc_do_init(void) {
  function app_anc_send_howl_evt (line 837) | void app_anc_send_howl_evt(uint32_t howl) {
  function app_anc_send_pwr_key_monitor_evt (line 849) | void app_anc_send_pwr_key_monitor_evt(uint8_t level) {
  function app_anc_post_simplayer_stop_evt (line 863) | void app_anc_post_simplayer_stop_evt(void) {
  function anc_enabled (line 873) | bool anc_enabled(void) { return (anc_work_status == ANC_STATUS_ON); }
  function app_anc_resample (line 875) | void app_anc_resample(uint32_t res_ratio, uint32_t *in, uint32_t *out,
  function app_anc_select_coef (line 886) | void app_anc_select_coef(void) {
  function app_anc_enable (line 907) | void app_anc_enable(void) {
  function app_anc_disable (line 954) | void app_anc_disable(void) {
  function anc_sample_rate_change (line 980) | static void anc_sample_rate_change(enum AUD_STREAM_T stream,
  function app_anc_open_anc (line 1032) | void app_anc_open_anc(void) {
  function app_anc_close_anc (line 1123) | void app_anc_close_anc(void) {
  function app_anc_bitrate_reopen (line 1164) | void app_anc_bitrate_reopen(void) {
  function app_anc_status_change (line 1176) | void app_anc_status_change(void) {
  function app_anc_handle_process (line 1253) | static int app_anc_handle_process(APP_MESSAGE_BODY *msg_body) {
  function anc_gain_fade_timer_handler (line 1424) | static void anc_gain_fade_timer_handler(void *p) {
  function app_anc_init_timer (line 1459) | void app_anc_init_timer(void) {
  function app_anc_timer_set (line 1465) | void app_anc_timer_set(uint32_t request, uint32_t delay) {
  function app_anc_timer_close (line 1475) | void app_anc_timer_close(void) {
  function app_anc_cmd_receive_process (line 1486) | void app_anc_cmd_receive_process(uint8_t *buf, uint16_t len) {
  function app_anc_notify_master_to_exchange_coef (line 1514) | static void app_anc_notify_master_to_exchange_coef(uint8_t arg0, uint8_t...
  function app_anc_key (line 1528) | void app_anc_key(APP_KEY_STATUS *status, void *param) {
  function app_anc_start (line 1541) | int app_anc_start(void) {
  function app_anc_switch_coef (line 1567) | int app_anc_switch_coef(uint8_t index) {
  function app_anc_stop (line 1598) | int app_anc_stop(void) {
  function app_anc_ios_init (line 1625) | void app_anc_ios_init(void) {
  function app_anc_open_module (line 1659) | int app_anc_open_module(void) {
  function app_anc_close_module (line 1678) | int app_anc_close_module(void) {
  function app_anc_get_play_rate (line 1696) | enum AUD_SAMPRATE_T app_anc_get_play_rate(void) {
  function app_anc_work_status (line 1700) | bool app_anc_work_status(void) {
  function app_anc_get_anc_status (line 1706) | uint32_t app_anc_get_anc_status(void) { return anc_work_status; }
  function test_anc (line 1708) | void test_anc(void) {
  function test_anc_switch_coef (line 1713) | void test_anc_switch_coef(void) {
  function app_anc_sync_status (line 1756) | void app_anc_sync_status(void) {

FILE: apps/anc/src/peak_detector.c
  type AUD_BITS_T (line 23) | enum AUD_BITS_T
  function convert_multiple_to_db (line 43) | static inline float convert_multiple_to_db(float multiple) {
  function convert_db_to_multiple (line 48) | static inline float convert_db_to_multiple(float db) {
  function peak_detector_init (line 52) | void peak_detector_init(void) {
  function peak_detector_setup (line 62) | void peak_detector_setup(PEAK_DETECTOR_CFG_T *cfg) {
  function peak_detector_run_16bits (line 69) | static void peak_detector_run_16bits(int16_t *buf, uint32_t len,
  function peak_detector_run_24bits (line 142) | static void peak_detector_run_24bits(int32_t *buf, uint32_t len,
  function peak_detector_run (line 178) | void peak_detector_run(uint8_t *buf, uint32_t len, float vol_multiple) {

FILE: apps/apptester/app_audtest.cpp
  function pcm_1ksin_more_data (line 69) | uint32_t pcm_1ksin_more_data(uint8_t *buf, uint32_t len) {
  function pcm_mute_more_data (line 115) | uint32_t pcm_mute_more_data(uint8_t *buf, uint32_t len) {
  function da_output_sin1k (line 120) | void da_output_sin1k(bool on) {
  function da_tester (line 152) | void da_tester(uint8_t on) { da_output_sin1k(on); }
  function pcm_data_capture (line 159) | static uint32_t pcm_data_capture(uint8_t *buf, uint32_t len) {
  function pcm_data_playback (line 173) | static uint32_t pcm_data_playback(uint8_t *buf, uint32_t len) {
  function pcm_cvsd_data_capture (line 186) | uint32_t pcm_cvsd_data_capture(uint8_t *buf, uint32_t len) {
  function pcm_cvsd_data_playback (line 202) | uint32_t pcm_cvsd_data_playback(uint8_t *buf, uint32_t len) {
  function adc_looptester (line 219) | void adc_looptester(bool on, enum AUD_IO_PATH_T input_path,
  function app_anc_usb_init (line 266) | void app_anc_usb_init(void) {

FILE: apps/apptester/app_audtest.h
  type AUD_SAMPRATE_T (line 21) | enum AUD_SAMPRATE_T

FILE: apps/apptester/audiobuffer.c
  function audio_mono2stereo_16bits (line 30) | void audio_mono2stereo_16bits(uint16_t *dst_buf, uint16_t *src_buf,
  function audio_stereo2mono_16bits (line 38) | void audio_stereo2mono_16bits(uint8_t chnlsel, uint16_t *dst_buf,
  function audio_buffer_init (line 46) | void audio_buffer_init(void) {
  function audio_buffer_length (line 56) | int audio_buffer_length(void) {
  function audio_buffer_set (line 68) | int audio_buffer_set(uint8_t *buff, uint16_t len) {
  function audio_buffer_get (line 81) | int audio_buffer_get(uint8_t *buff, uint16_t len) {
  function audio_buffer_set_stereo2mono_16bits (line 104) | int audio_buffer_set_stereo2mono_16bits(uint8_t *buff, uint16_t len,
  function audio_buffer_get_mono2stereo_16bits (line 120) | int audio_buffer_get_mono2stereo_16bits(uint8_t *buff, uint16_t len) {

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder.cpp
  function a2dp_audio_heap_init (line 147) | void a2dp_audio_heap_init(void *begin_addr, uint32_t size) {
  function a2dp_audio_heap_free (line 170) | void a2dp_audio_heap_free(void *rmem) {
  function a2dp_audio_heap_info (line 175) | void a2dp_audio_heap_info(size_t *total, size_t *used, size_t *max_used) {
  function a2dp_audio_semaphore_init (line 189) | int inline a2dp_audio_semaphore_init(void) {
  function a2dp_audio_buffer_mutex_init (line 198) | int inline a2dp_audio_buffer_mutex_init(void) {
  function a2dp_audio_buffer_mutex_lock (line 206) | int inline a2dp_audio_buffer_mutex_lock(void) {
  function a2dp_audio_buffer_mutex_unlock (line 211) | int inline a2dp_audio_buffer_mutex_unlock(void) {
  function a2dp_audio_status_mutex_init (line 216) | int inline a2dp_audio_status_mutex_init(void) {
  function a2dp_audio_status_mutex_lock (line 224) | int inline a2dp_audio_status_mutex_lock(void) {
  function a2dp_audio_status_mutex_unlock (line 229) | int inline a2dp_audio_status_mutex_unlock(void) {
  function a2dp_audio_semaphore_wait (line 234) | int inline a2dp_audio_semaphore_wait(uint32_t timeout_ms) {
  function a2dp_audio_semaphore_release (line 250) | int inline a2dp_audio_semaphore_release(void) {
  function list_node_t (line 268) | list_node_t *a2dp_audio_list_begin(const list_t *list) {
  function list_node_t (line 275) | list_node_t *a2dp_audio_list_end(const list_t *list) {
  function a2dp_audio_list_length (line 282) | uint32_t a2dp_audio_list_length(const list_t *list) {
  function list_node_t (line 296) | list_node_t *a2dp_audio_list_next(const list_node_t *node) {
  function a2dp_audio_list_remove (line 303) | bool a2dp_audio_list_remove(list_t *list, void *data) {
  function a2dp_audio_list_append (line 310) | bool a2dp_audio_list_append(list_t *list, void *data) {
  function a2dp_audio_list_clear (line 317) | void a2dp_audio_list_clear(list_t *list) {
  function a2dp_audio_list_free (line 323) | void a2dp_audio_list_free(list_t *list) {
  function list_t (line 329) | list_t *a2dp_audio_list_new(list_free_cb callback, list_mempool_zmalloc ...
  function a2dp_audio_get_passed (line 337) | uint32_t a2dp_audio_get_passed(uint32_t curr_ticks, uint32_t prev_ticks,
  function get_in_cp_frame_cnt (line 349) | static uint32_t get_in_cp_frame_cnt(void) { return 0; }
  function get_in_cp_frame_delay (line 351) | static uint32_t get_in_cp_frame_delay(void) { return 0; }
  function a2dp_audio_set_status (line 354) | int inline a2dp_audio_set_status(
  function a2dp_audio_get_status (line 363) | enum A2DP_AUDIO_DECODER_STATUS inline a2dp_audio_get_status(void) {
  function a2dp_audio_set_store_packet_status (line 372) | int inline a2dp_audio_set_store_packet_status(
  function a2dp_audio_get_store_packet_status (line 381) | enum A2DP_AUDIO_DECODER_STORE_PACKET_STATUS inline a2dp_audio_get_store_...
  function a2dp_audio_set_playback_status (line 391) | int inline a2dp_audio_set_playback_status(
  function a2dp_audio_get_playback_status (line 400) | enum A2DP_AUDIO_DECODER_PLAYBACK_STATUS inline a2dp_audio_get_playback_s...
  function a2dp_decoder_info_checker (line 410) | static void a2dp_decoder_info_checker(void) {
  function a2dp_audio_sync_pid_config (line 415) | int a2dp_audio_sync_pid_config(void) {
  function a2dp_audio_sync_reset_data (line 426) | int a2dp_audio_sync_reset_data(void) {
  function a2dp_audio_sync_init (line 442) | int a2dp_audio_sync_init(double ratio) {
  function a2dp_audio_sync_tune_sample_rate (line 452) | int a2dp_audio_sync_tune_sample_rate(double ratio) {
  function a2dp_audio_sync_direct_tune_sample_rate (line 476) | int a2dp_audio_sync_direct_tune_sample_rate(double ratio) {
  function a2dp_audio_sync_tune_onprocess (line 499) | bool a2dp_audio_sync_tune_onprocess(void) {
  function a2dp_audio_sync_tune (line 508) | int a2dp_audio_sync_tune(float ratio) {
  function a2dp_audio_sync_tune_cancel (line 537) | int a2dp_audio_sync_tune_cancel(void) {
  function a2dp_audio_sync_pid_calc (line 542) | float a2dp_audio_sync_pid_calc(A2DP_AUDIO_SYNC_PID_T *pid, float diff) {
  function a2dp_audio_sync_fix_diff_proc (line 563) | static int a2dp_audio_sync_fix_diff_proc(uint32_t tick) {
  function a2dp_audio_sync_fix_diff_start (line 575) | static int32_t a2dp_audio_sync_fix_diff_start(uint32_t tick) {
  function a2dp_audio_sync_fix_diff_stop (line 583) | static int a2dp_audio_sync_fix_diff_stop(uint32_t tick) {
  function a2dp_audio_sync_fix_diff_reset (line 592) | static int32_t a2dp_audio_sync_fix_diff_reset(void) {
  function A2DP_AUDIO_SYNC_FIX_DIFF_STATUS (line 601) | static A2DP_AUDIO_SYNC_FIX_DIFF_STATUS
  function a2dp_audio_sync_handler (line 771) | int a2dp_audio_sync_handler(uint8_t *buffer, uint32_t buffer_bytes) {
  function a2dp_audio_reset_history_seq (line 910) | static int a2dp_audio_reset_history_seq(void) {
  function a2dp_audio_save_history_seq (line 927) | static int a2dp_audio_save_history_seq(btif_media_header_t *header,
  function a2dp_audio_show_history_seq (line 958) | int a2dp_audio_show_history_seq(void) {
  function a2dp_audio_alpha_filter (line 1046) | static inline float a2dp_audio_alpha_filter(float y, float x) {
  function a2dp_audio_convert_16bit_to_24bit (line 1055) | static void inline a2dp_audio_convert_16bit_to_24bit(int32_t *out, int16...
  function a2dp_audio_channel_select (line 1062) | static void inline a2dp_audio_channel_select(
  function get_cp_frame_mtus (line 1133) | static uint32_t get_cp_frame_mtus(A2DP_AUDIO_LASTFRAME_INFO_T *info) {
  function is_cp_need_reset (line 1147) | bool is_cp_need_reset(void) { return false; }
  function a2dp_audio_sysfreq_boost_init (line 1156) | int a2dp_audio_sysfreq_boost_init(uint32_t normalfreq) {
  function a2dp_audio_sysfreq_boost_start (line 1164) | int a2dp_audio_sysfreq_boost_start(uint32_t boost_cnt) {
  function a2dp_audio_sysfreq_boost_porc (line 1179) | static int a2dp_audio_sysfreq_boost_porc(void) {
  function a2dp_audio_sysfreq_boost_running (line 1192) | int a2dp_audio_sysfreq_boost_running(void) {
  function a2dp_audio_store_packet_checker_start (line 1196) | int a2dp_audio_store_packet_checker_start(void) {
  function a2dp_audio_store_packet_checker (line 1201) | int a2dp_audio_store_packet_checker(btif_media_header_t *header) {
  function a2dp_audio_store_packet (line 1231) | int a2dp_audio_store_packet(btif_media_header_t *header, unsigned char *...
  function a2dp_audio_playback_handler (line 1330) | uint32_t a2dp_audio_playback_handler(uint8_t *buffer, uint32_t buffer_by...
  function a2dp_audio_packet_free (line 1508) | static void a2dp_audio_packet_free(void *packet) {
  function a2dp_audio_clear_input_raw_packet_list (line 1516) | void a2dp_audio_clear_input_raw_packet_list(void) {
  function a2dp_audio_init (line 1523) | int a2dp_audio_init(uint32_t sysfreq, A2DP_AUDIO_CODEC_TYPE codec_type,
  function a2dp_audio_deinit (line 1666) | int a2dp_audio_deinit(void) {
  function a2dp_audio_stop (line 1707) | int a2dp_audio_stop(void) {
  function a2dp_audio_start (line 1738) | int a2dp_audio_start(void) {
  function a2dp_audio_detect_next_packet_callback_register (line 1746) | int a2dp_audio_detect_next_packet_callback_register(
  function a2dp_audio_detect_store_packet_callback_register (line 1755) | int a2dp_audio_detect_store_packet_callback_register(
  function a2dp_audio_detect_first_packet (line 1764) | int a2dp_audio_detect_first_packet(void) {
  function a2dp_audio_detect_first_packet_clear (line 1771) | int a2dp_audio_detect_first_packet_clear(void) {
  function a2dp_audio_discards_packet (line 1778) | int a2dp_audio_discards_packet(uint32_t packets) {
  function a2dp_audio_synchronize_dest_packet_mut (line 1793) | int a2dp_audio_synchronize_dest_packet_mut(uint32_t mtu) {
  function a2dp_audio_discards_samples (line 1814) | int a2dp_audio_discards_samples(uint32_t samples) {
  function a2dp_audio_convert_list_to_samples (line 1818) | int a2dp_audio_convert_list_to_samples(uint32_t *samples) {
  function a2dp_audio_get_packet_samples (line 1823) | int a2dp_audio_get_packet_samples(void) {
  function a2dp_audio_internal_lastframe_info_ptr_get (line 1839) | static int a2dp_audio_internal_lastframe_info_ptr_get(
  function a2dp_audio_lastframe_info_get (line 1853) | int a2dp_audio_lastframe_info_get(A2DP_AUDIO_LASTFRAME_INFO_T *lastframe...
  function a2dp_audio_decoder_internal_check_sum_reset (line 1869) | int a2dp_audio_decoder_internal_check_sum_reset(void) {
  function a2dp_audio_decoder_internal_check_sum_generate (line 1874) | uint32_t a2dp_audio_decoder_internal_check_sum_generate(const uint8_t *buf,
  function a2dp_audio_lastframe_info_reset_undecodeframe (line 1884) | int a2dp_audio_lastframe_info_reset_undecodeframe(void) {
  function a2dp_audio_decoder_internal_lastframe_info_set (line 1902) | int a2dp_audio_decoder_internal_lastframe_info_set(
  function a2dp_audio_synchronize_packet (line 1930) | int a2dp_audio_synchronize_packet(A2DP_AUDIO_SYNCFRAME_INFO_T *sync_info,
  function a2dp_audio_decoder_headframe_info_get (line 1950) | int a2dp_audio_decoder_headframe_info_get(
  function a2dp_audio_refill_packet (line 1965) | int a2dp_audio_refill_packet(void) {
  function a2dp_audio_auto_synchronize_support (line 1976) | bool a2dp_audio_auto_synchronize_support(void) {
  function A2DP_AUDIO_OUTPUT_CONFIG_T (line 1992) | A2DP_AUDIO_OUTPUT_CONFIG_T *a2dp_audio_get_output_config(void) {
  function a2dp_audio_latency_factor_setlow (line 2006) | int a2dp_audio_latency_factor_setlow(void) {
  function a2dp_audio_latency_factor_sethigh (line 2011) | int a2dp_audio_latency_factor_sethigh(void) {
  function a2dp_audio_latency_factor_get (line 2016) | float a2dp_audio_latency_factor_get(void) { return a2dp_audio_latency_fa...
  function a2dp_audio_latency_factor_set (line 2018) | int a2dp_audio_latency_factor_set(float factor) {
  function a2dp_audio_latency_factor_status_get (line 2023) | int a2dp_audio_latency_factor_status_get(
  function a2dp_audio_frame_delay_get (line 2035) | int a2dp_audio_frame_delay_get(void) { return get_in_cp_frame_delay(); }
  function a2dp_audio_dest_packet_mut_get (line 2037) | int a2dp_audio_dest_packet_mut_get(void) {
  function a2dp_audio_set_channel_select (line 2041) | int a2dp_audio_set_channel_select(A2DP_AUDIO_CHANNEL_SELECT_E chnl_sel) {
  function a2dp_audio_get_sample_reference (line 2055) | float a2dp_audio_get_sample_reference(void) {
  function a2dp_audio_get_current_buf_size (line 2061) | int8_t a2dp_audio_get_current_buf_size(void) {

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder.h
  type A2DP_AUDIO_CODEC_TYPE (line 27) | typedef uint16_t A2DP_AUDIO_CODEC_TYPE;
  type A2DP_AUDIO_LATENCY_STATUS_E (line 48) | typedef enum {
  type A2DP_AUDIO_OUTPUT_CONFIG_T (line 53) | typedef struct  {
  type A2DP_AUDIO_CHANNEL_SELECT_E (line 62) | typedef enum {
  type A2DP_AUDIO_LASTFRAME_INFO_T (line 69) | typedef struct {
  type A2DP_AUDIO_HEADFRAME_INFO_T (line 85) | typedef struct {
  type A2DP_AUDIO_SYNC_PID_T (line 92) | typedef struct{
  type A2DP_AUDIO_LASTFRAME_INFO_T (line 100) | typedef A2DP_AUDIO_LASTFRAME_INFO_T A2DP_AUDIO_SYNCFRAME_INFO_T;

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_aac_lc.cpp
  function a2dp_audio_aac_lc_free (line 82) | static void a2dp_audio_aac_lc_free(void *packet) {
  function a2dp_audio_aac_lc_decoder_init (line 89) | static void a2dp_audio_aac_lc_decoder_init(void) {
  function a2dp_audio_aac_lc_decoder_deinit (line 102) | static void a2dp_audio_aac_lc_decoder_deinit(void) {
  function a2dp_audio_aac_lc_decoder_reinit (line 109) | static void a2dp_audio_aac_lc_decoder_reinit(void) {
  type A2DP_CP_AAC_LC_IN_FRM_INFO_T (line 117) | struct A2DP_CP_AAC_LC_IN_FRM_INFO_T {
  type A2DP_CP_AAC_LC_OUT_FRM_INFO_T (line 122) | struct A2DP_CP_AAC_LC_OUT_FRM_INFO_T {
    type A2DP_CP_AAC_LC_IN_FRM_INFO_T (line 123) | struct A2DP_CP_AAC_LC_IN_FRM_INFO_T
  function a2dp_cp_aac_lc_mcu_decode (line 145) | static int a2dp_cp_aac_lc_mcu_decode(uint8_t *buffer, uint32_t buffer_by...
  function cp_assert (line 266) | int cp_assert(void) {
  function TEXT_AAC_LOC (line 272) | TEXT_AAC_LOC
  function a2dp_audio_aac_lc_list_checker (line 447) | static int a2dp_audio_aac_lc_list_checker(void) {
  function a2dp_audio_aac_lc_channel_select (line 476) | int a2dp_audio_aac_lc_channel_select(A2DP_AUDIO_CHANNEL_SELECT_E chnl_se...
  function a2dp_audio_aac_lc_init (line 499) | int a2dp_audio_aac_lc_init(A2DP_AUDIO_OUTPUT_CONFIG_T *config, void *con...
  function a2dp_audio_aac_lc_deinit (line 538) | int a2dp_audio_aac_lc_deinit(void) {
  function a2dp_audio_aac_lc_mcu_decode_frame (line 554) | int a2dp_audio_aac_lc_mcu_decode_frame(uint8_t *buffer, uint32_t buffer_...
  function a2dp_audio_aac_lc_decode_frame (line 668) | int a2dp_audio_aac_lc_decode_frame(uint8_t *buffer, uint32_t buffer_byte...
  function a2dp_audio_aac_lc_preparse_packet (line 676) | int a2dp_audio_aac_lc_preparse_packet(btif_media_header_t *header,
  function a2dp_audio_aac_lc_reorder_init (line 696) | int a2dp_audio_aac_lc_reorder_init(void) {
  function a2dp_audio_aac_lc_reorder_deinit (line 707) | int a2dp_audio_aac_lc_reorder_deinit(void) {
  function a2dp_audio_aac_lc_reorder_store_packet (line 717) | int a2dp_audio_aac_lc_reorder_store_packet(
  function a2dp_audio_aac_lc_reorder_proc (line 727) | int a2dp_audio_aac_lc_reorder_proc(
  function a2dp_audio_aac_lc_packet_recover_save_last (line 748) | int a2dp_audio_aac_lc_packet_recover_save_last(
  function a2dp_audio_aac_lc_packet_recover_find_missing (line 757) | int a2dp_audio_aac_lc_packet_recover_find_missing(
  function a2dp_audio_aac_lc_packet_recover_proc (line 806) | int a2dp_audio_aac_lc_packet_recover_proc(
  function a2dp_audio_aac_lc_packet_append (line 830) | int inline a2dp_audio_aac_lc_packet_append(
  function a2dp_audio_aac_lc_store_packet (line 840) | int a2dp_audio_aac_lc_store_packet(btif_media_header_t *header, uint8_t ...
  function a2dp_audio_aac_lc_store_packet (line 886) | int a2dp_audio_aac_lc_store_packet(btif_media_header_t *header, uint8_t ...
  function a2dp_audio_aac_lc_discards_packet (line 920) | int a2dp_audio_aac_lc_discards_packet(uint32_t packets) {
  function a2dp_audio_aac_lc_headframe_info_get (line 945) | int a2dp_audio_aac_lc_headframe_info_get(
  function a2dp_audio_aac_lc_info_get (line 966) | int a2dp_audio_aac_lc_info_get(void *info) { return A2DP_DECODER_NO_ERRO...
  function a2dp_audio_aac_lc_synchronize_packet (line 968) | int a2dp_audio_aac_lc_synchronize_packet(A2DP_AUDIO_SYNCFRAME_INFO_T *sy...
  function a2dp_audio_aac_lc_synchronize_dest_packet_mut (line 1018) | int a2dp_audio_aac_lc_synchronize_dest_packet_mut(uint16_t packet_mut) {
  function a2dp_audio_aac_lc_convert_list_to_samples (line 1048) | int a2dp_audio_aac_lc_convert_list_to_samples(uint32_t *samples) {
  function a2dp_audio_aac_lc_discards_samples (line 1061) | int a2dp_audio_aac_lc_discards_samples(uint32_t samples) {

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_cp.c
  type CP_DEC_STATE_T (line 38) | enum CP_DEC_STATE_T {
  type CP_IN_FRAME_INFO_T (line 45) | struct CP_IN_FRAME_INFO_T {
  type CP_OUT_FRAME_INFO_T (line 50) | struct CP_OUT_FRAME_INFO_T {
  type CP_PROC_DELAY_T (line 80) | enum CP_PROC_DELAY_T
  function set_cp_reset_flag (line 84) | CP_TEXT_SRAM_LOC
  function is_cp_need_reset (line 90) | bool is_cp_need_reset(void) {
  function is_cp_init_done (line 96) | bool is_cp_init_done(void) { return cp_accel_init_done(); }
  function CP_TEXT_SRAM_LOC (line 98) | CP_TEXT_SRAM_LOC
  function cp_a2dp_main (line 128) | int cp_a2dp_main(uint8_t event) {
  type cp_task_desc (line 167) | struct cp_task_desc
  function a2dp_cp_init (line 169) | int a2dp_cp_init(A2DP_CP_DECODE_T decode_func, enum CP_PROC_DELAY_T dela...
  function a2dp_cp_deinit (line 189) | int a2dp_cp_deinit(void) {
  function SRAM_TEXT_LOC (line 195) | SRAM_TEXT_LOC
  function CP_TEXT_SRAM_LOC (line 245) | CP_TEXT_SRAM_LOC
  function get_in_cp_frame_cnt (line 258) | uint32_t get_in_cp_frame_cnt(void) {
  function get_in_cp_frame_delay (line 262) | uint32_t get_in_cp_frame_delay(void) { return proc_delay; }
  function SRAM_TEXT_LOC (line 264) | SRAM_TEXT_LOC
  function SRAM_TEXT_LOC (line 278) | SRAM_TEXT_LOC
  function CP_TEXT_SRAM_LOC (line 369) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 398) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 423) | CP_TEXT_SRAM_LOC
  function SRAM_TEXT_LOC (line 426) | SRAM_TEXT_LOC
  function SRAM_TEXT_LOC (line 431) | SRAM_TEXT_LOC
  function SRAM_TEXT_LOC (line 443) | SRAM_TEXT_LOC
  function CP_EMPTY_OUT_FRM_T (line 447) | CP_EMPTY_OUT_FRM_T a2dp_cp_get_emtpy_out_frame(void **p_buf,
  function CP_TEXT_SRAM_LOC (line 484) | CP_TEXT_SRAM_LOC
  function SRAM_TEXT_LOC (line 513) | SRAM_TEXT_LOC
  function SRAM_TEXT_LOC (line 558) | SRAM_TEXT_LOC

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_cp.h
  type CP_PROC_DELAY_T (line 27) | enum CP_PROC_DELAY_T {
  type CP_EMPTY_OUT_FRM_T (line 36) | enum CP_EMPTY_OUT_FRM_T {
  type CP_PROC_DELAY_T (line 44) | enum CP_PROC_DELAY_T
  type CP_EMPTY_OUT_FRM_T (line 64) | enum CP_EMPTY_OUT_FRM_T

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_example.cpp
  function a2dp_audio_example_decode_frame (line 35) | int a2dp_audio_example_decode_frame(uint8_t *buffer, uint32_t buffer_byt...
  function a2dp_audio_example_preparse_packet (line 39) | int a2dp_audio_example_preparse_packet(btif_media_header_t *header,
  function a2dp_audio_example_free (line 57) | void a2dp_audio_example_free(void *packet) {
  function a2dp_audio_example_store_packet (line 64) | int a2dp_audio_example_store_packet(btif_media_header_t *header,
  function a2dp_audio_example_discards_packet (line 80) | int a2dp_audio_example_discards_packet(uint32_t packets) {
  function a2dp_audio_example_headframe_info_get (line 84) | int a2dp_audio_example_headframe_info_get(
  function a2dp_audio_example_info_get (line 89) | int a2dp_audio_example_info_get(void *info) { return A2DP_DECODER_NO_ERR...
  function a2dp_audio_example_init (line 91) | int a2dp_audio_example_init(A2DP_AUDIO_OUTPUT_CONFIG_T *config, void *co...
  function a2dp_audio_example_deinit (line 104) | int a2dp_audio_example_deinit(void) { return A2DP_DECODER_NO_ERROR; }
  function a2dp_audio_example_synchronize_packet (line 106) | int a2dp_audio_example_synchronize_packet(
  function a2dp_audio_example_synchronize_dest_packet_mut (line 111) | int a2dp_audio_example_synchronize_dest_packet_mut(uint16_t packet_mut) {

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_internal.h
  type A2DP_AUDIO_OUTPUT_CONFIG_T (line 54) | typedef A2DP_AUDIO_OUTPUT_CONFIG_T AUDIO_DECODER_STREAM_INFO_T;
  type A2DP_AUDIO_DECODER_T (line 71) | typedef struct {
  type A2DP_AUDIO_DATAPATH_T (line 90) | typedef struct {
  type AUDIO_BUFFER_SEMAPHORE_T (line 95) | typedef struct {
  type A2DP_AUDIO_DECODER_STATUS (line 100) | enum A2DP_AUDIO_DECODER_STATUS {
  type A2DP_AUDIO_DECODER_STORE_PACKET_STATUS (line 107) | enum A2DP_AUDIO_DECODER_STORE_PACKET_STATUS {
  type A2DP_AUDIO_DECODER_PLAYBACK_STATUS (line 112) | enum A2DP_AUDIO_DECODER_PLAYBACK_STATUS {
  type A2DP_AUDIO_DECODER_LASTFRAME_INFO_T (line 117) | typedef struct {
  type A2DP_AUDIO_SYNC_T (line 130) | typedef struct {
  type A2DP_AUDIO_CONTEXT_T (line 136) | typedef struct {

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_ldac.cpp
  function get_ldac_frame_num_by_rawdata (line 144) | static uint8_t get_ldac_frame_num_by_rawdata(uint8_t *buffer,
  function check_ldac_header (line 176) | int check_ldac_header(uint8_t *buffer, uint32_t buff_len) {
  type A2DP_CP_LDAC_IN_FRM_INFO_T (line 234) | struct A2DP_CP_LDAC_IN_FRM_INFO_T {
  type A2DP_CP_LDAC_OUT_FRM_INFO_T (line 241) | struct A2DP_CP_LDAC_OUT_FRM_INFO_T {
    type A2DP_CP_LDAC_IN_FRM_INFO_T (line 242) | struct A2DP_CP_LDAC_IN_FRM_INFO_T
  function TEXT_LDAC_LOC (line 255) | TEXT_LDAC_LOC
  function a2dp_cp_ldac_mcu_decode (line 266) | static int a2dp_cp_ldac_mcu_decode(uint8_t *buffer, uint32_t buffer_byte...
  function TEXT_LDAC_LOC (line 399) | TEXT_LDAC_LOC
  function a2dp_audio_ldac_mcu_decode_frame (line 509) | int a2dp_audio_ldac_mcu_decode_frame(uint8_t *buffer, uint32_t buffer_by...
  function a2dp_audio_ldac_decode_frame (line 611) | int a2dp_audio_ldac_decode_frame(uint8_t *buffer, uint32_t buffer_bytes) {
  function a2dp_audio_ldac_preparse_packet (line 635) | int a2dp_audio_ldac_preparse_packet(btif_media_header_t *header,
  function a2dp_audio_ldac_free (line 667) | void a2dp_audio_ldac_free(void *packet) {
  function a2dp_audio_ldac_header_parser (line 674) | int a2dp_audio_ldac_header_parser(btif_media_header_t *header,
  function a2dp_audio_ldac_store_packet (line 679) | int a2dp_audio_ldac_store_packet(btif_media_header_t *header, uint8_t *b...
  function a2dp_audio_ldac_discards_packet (line 777) | int a2dp_audio_ldac_discards_packet(uint32_t packets) {
  function a2dp_audio_ldac_info_get (line 798) | int a2dp_audio_ldac_info_get(void *info) { return A2DP_DECODER_NO_ERROR; }
  function a2dp_audio_ldac_decoder_init (line 800) | static int a2dp_audio_ldac_decoder_init(void) {
  function a2dp_audio_ldac_decoder_deinit (line 829) | static void a2dp_audio_ldac_decoder_deinit(void) {
  function a2dp_audio_ldac_list_checker (line 836) | static int a2dp_audio_ldac_list_checker(void) {
  function a2dp_audio_ldac_init (line 870) | int a2dp_audio_ldac_init(A2DP_AUDIO_OUTPUT_CONFIG_T *config, void *conte...
  function a2dp_audio_ldac_deinit (line 897) | int a2dp_audio_ldac_deinit(void) {
  function a2dp_audio_ldac_synchronize_packet (line 906) | int a2dp_audio_ldac_synchronize_packet(A2DP_AUDIO_SYNCFRAME_INFO_T *sync...
  function a2dp_audio_ldac_synchronize_dest_packet_mut (line 958) | int a2dp_audio_ldac_synchronize_dest_packet_mut(uint16_t packet_mut) {
  function a2dp_audio_ldac_headframe_info_get (line 978) | static int a2dp_audio_ldac_headframe_info_get(
  function a2dp_audio_ldac_convert_list_to_samples (line 1001) | int a2dp_audio_ldac_convert_list_to_samples(uint32_t *samples) {
  function a2dp_audio_ldac_discards_samples (line 1013) | int a2dp_audio_ldac_discards_samples(uint32_t samples) {

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_lhdc.cpp
  type _lhdc_frame_Info (line 83) | struct _lhdc_frame_Info {
  type A2DP_CP_LHDC_IN_FRM_INFO_T (line 92) | struct A2DP_CP_LHDC_IN_FRM_INFO_T {
  type A2DP_CP_LHDC_OUT_FRM_INFO_T (line 99) | struct A2DP_CP_LHDC_OUT_FRM_INFO_T {
    type A2DP_CP_LHDC_IN_FRM_INFO_T (line 100) | struct A2DP_CP_LHDC_IN_FRM_INFO_T
  type bes_bt_local_info_t (line 109) | struct bes_bt_local_info_t {
  type A2DP_CP_LHDC_IN_FRM_INFO_T (line 151) | struct A2DP_CP_LHDC_IN_FRM_INFO_T
  function sav_lhdc_log_bytes_len (line 171) | void sav_lhdc_log_bytes_len(uint32_t bytes_len) {
  function sav_lhdc_save_last_info (line 188) | static void sav_lhdc_save_last_info(struct A2DP_CP_LHDC_IN_FRM_INFO_T *f...
  function sav_lhdc_get_next_info (line 193) | static void sav_lhdc_get_next_info(struct A2DP_CP_LHDC_IN_FRM_INFO_T *f_...
  function reset_lhdc_assmeble_packet (line 220) | static void reset_lhdc_assmeble_packet(void) {
  function initial_lhdc_assemble_packet (line 226) | static void initial_lhdc_assemble_packet(bool splitFlg) {
  function assemble_lhdc_packet (line 236) | int assemble_lhdc_packet(uint8_t *input, uint32_t input_len, uint8_t **p...
  function assemble_lhdc_packet (line 274) | int assemble_lhdc_packet(uint8_t *input, uint32_t input_len, uint8_t **p...
  function parse_lhdc_info (line 376) | static int parse_lhdc_info(uint8_t *in, lhdc_frame_Info_t *h) {
  function TEXT_LHDC_LOC (line 400) | TEXT_LHDC_LOC
  function a2dp_cp_lhdc_mcu_decode (line 413) | static int a2dp_cp_lhdc_mcu_decode(uint8_t *buffer, uint32_t buffer_byte...
  function cp_assert (line 614) | int cp_assert(void) {
  function TEXT_LHDC_LOC (line 622) | TEXT_LHDC_LOC
  function a2dp_audio_lhdc_list_checker (line 764) | static int a2dp_audio_lhdc_list_checker(void) {
  function a2dp_audio_lhdc_mcu_decode_frame (line 796) | int a2dp_audio_lhdc_mcu_decode_frame(uint8_t *buffer, uint32_t buffer_by...
  function a2dp_audio_lhdc_decode_frame (line 883) | int a2dp_audio_lhdc_decode_frame(uint8_t *buffer, uint32_t buffer_bytes) {
  function a2dp_audio_lhdc_preparse_packet (line 891) | int a2dp_audio_lhdc_preparse_packet(btif_media_header_t *header,
  function a2dp_audio_lhdc_free (line 910) | void a2dp_audio_lhdc_free(void *packet) {
  function a2dp_audio_lhdc_store_packet (line 917) | int a2dp_audio_lhdc_store_packet(btif_media_header_t *header, uint8_t *b...
  function a2dp_audio_lhdc_discards_packet (line 990) | int a2dp_audio_lhdc_discards_packet(uint32_t packets) {
  function a2dp_audio_lhdc_headframe_info_get (line 1007) | static int a2dp_audio_lhdc_headframe_info_get(
  function a2dp_audio_lhdc_info_get (line 1028) | int a2dp_audio_lhdc_info_get(void *info) { return A2DP_DECODER_NO_ERROR; }
  function a2dp_audio_lhdc_init (line 1032) | int a2dp_audio_lhdc_init(A2DP_AUDIO_OUTPUT_CONFIG_T *config, void *conte...
  function a2dp_audio_lhdc_deinit (line 1082) | int a2dp_audio_lhdc_deinit(void) {
  function a2dp_audio_lhdc_synchronize_packet (line 1090) | int a2dp_audio_lhdc_synchronize_packet(A2DP_AUDIO_SYNCFRAME_INFO_T *sync...
  function a2dp_audio_lhdc_synchronize_dest_packet_mut (line 1139) | int a2dp_audio_lhdc_synchronize_dest_packet_mut(uint16_t packet_mut) {
  function a2dp_audio_lhdc_convert_list_to_samples (line 1159) | int a2dp_audio_lhdc_convert_list_to_samples(uint32_t *samples) {
  function a2dp_audio_lhdc_discards_samples (line 1172) | int a2dp_audio_lhdc_discards_samples(uint32_t samples) {

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_sbc.cpp
  function a2dp_audio_sbc_subframe_free (line 81) | static void a2dp_audio_sbc_subframe_free(void *packet) {
  function sbc_codec_init (line 88) | static void sbc_codec_init(void) {
  type A2DP_CP_SBC_IN_FRM_INFO_T (line 96) | struct A2DP_CP_SBC_IN_FRM_INFO_T {
  type A2DP_CP_SBC_OUT_FRM_INFO_T (line 103) | struct A2DP_CP_SBC_OUT_FRM_INFO_T {
    type A2DP_CP_SBC_IN_FRM_INFO_T (line 104) | struct A2DP_CP_SBC_IN_FRM_INFO_T
  function a2dp_cp_sbc_mcu_decode (line 126) | static int a2dp_cp_sbc_mcu_decode(uint8_t *buffer, uint32_t buffer_bytes) {
  function cp_assert_sbc (line 251) | int cp_assert_sbc(void) {
  function TEXT_SBC_LOC (line 257) | TEXT_SBC_LOC
  function a2dp_audio_sbc_list_checker (line 375) | static int a2dp_audio_sbc_list_checker(void) {
  function a2dp_audio_sbc_init (line 406) | int a2dp_audio_sbc_init(A2DP_AUDIO_OUTPUT_CONFIG_T *config, void *contex...
  function a2dp_audio_sbc_deinit (line 445) | int a2dp_audio_sbc_deinit(void) {
  function a2dp_audio_sbc_mcu_decode_frame (line 458) | int a2dp_audio_sbc_mcu_decode_frame(uint8_t *buffer, uint32_t buffer_byt...
  function a2dp_audio_sbc_decode_frame (line 569) | int a2dp_audio_sbc_decode_frame(uint8_t *buffer, uint32_t buffer_bytes) {
  function a2dp_audio_sbc_preparse_packet (line 600) | int a2dp_audio_sbc_preparse_packet(btif_media_header_t *header, uint8_t ...
  function a2dp_audio_sbc_header_parser_init (line 650) | static int a2dp_audio_sbc_header_parser_init(void) {
  function a2dp_audio_sbc_packet_recover_save_last (line 658) | static int a2dp_audio_sbc_packet_recover_save_last(
  function a2dp_audio_sbc_packet_recover_find_missing (line 665) | static int a2dp_audio_sbc_packet_recover_find_missing(
  function a2dp_audio_sbc_packet_recover_proc (line 706) | static int a2dp_audio_sbc_packet_recover_proc(
  function a2dp_audio_sbc_store_packet (line 737) | int a2dp_audio_sbc_store_packet(btif_media_header_t *header, uint8_t *bu...
  function a2dp_audio_sbc_discards_packet (line 829) | int a2dp_audio_sbc_discards_packet(uint32_t packets) {
  function a2dp_audio_sbc_headframe_info_get (line 893) | int a2dp_audio_sbc_headframe_info_get(
  function a2dp_audio_sbc_info_get (line 916) | int a2dp_audio_sbc_info_get(void *info) { return A2DP_DECODER_NO_ERROR; }
  function a2dp_audio_sbc_synchronize_packet (line 918) | int a2dp_audio_sbc_synchronize_packet(A2DP_AUDIO_SYNCFRAME_INFO_T *sync_...
  function a2dp_audio_sbc_synchronize_dest_packet_mut (line 971) | int a2dp_audio_sbc_synchronize_dest_packet_mut(uint16_t packet_mut) {
  function a2dp_audio_sbc_convert_list_to_samples (line 995) | int a2dp_audio_sbc_convert_list_to_samples(uint32_t *samples) {
  function a2dp_audio_sbc_discards_samples (line 1007) | int a2dp_audio_sbc_discards_samples(uint32_t samples) {
  function a2dp_audio_sbc_channel_select (line 1034) | int a2dp_audio_sbc_channel_select(A2DP_AUDIO_CHANNEL_SELECT_E chnl_sel) {

FILE: apps/audioplayers/a2dp_decoder/a2dp_decoder_scalable.cpp
  function ss_to_24bit_buf (line 53) | static void ss_to_24bit_buf(int32_t *out, int32_t *in, int size) {
  function a2dp_audio_scalable_decoder_init (line 59) | static void a2dp_audio_scalable_decoder_init(void) {
  function scalableDecoder_Close (line 68) | static int scalableDecoder_Close(HANDLE_DECODER handle) {
  function a2dp_audio_scalable_decoder_deinit (line 77) | static void a2dp_audio_scalable_decoder_deinit(void) {
  function a2dp_audio_scalable_decoder_reinit (line 84) | static void a2dp_audio_scalable_decoder_reinit(void) {
  function is_valid_frame (line 91) | static bool
  type A2DP_CP_scalable_IN_FRM_INFO_T (line 156) | struct A2DP_CP_scalable_IN_FRM_INFO_T {
  type A2DP_CP_scalable_OUT_FRM_INFO_T (line 161) | struct A2DP_CP_scalable_OUT_FRM_INFO_T {
    type A2DP_CP_scalable_IN_FRM_INFO_T (line 162) | struct A2DP_CP_scalable_IN_FRM_INFO_T
  function TEXT_SSC_LOC (line 172) | TEXT_SSC_LOC static int a2dp_cp_scalable_mcu_decode(uint8_t *buffer,
  function TEXT_SSC_LOC (line 260) | TEXT_SSC_LOC int a2dp_cp_scalable_cp_decode(void) {
  function a2dp_audio_scalable_init (line 359) | static int a2dp_audio_scalable_init(A2DP_AUDIO_OUTPUT_CONFIG_T *config,
  function a2dp_audio_scalable_deinit (line 408) | static int a2dp_audio_scalable_deinit(void) {
  function a2dp_audio_scalable_mcu_decode_frame (line 420) | int a2dp_audio_scalable_mcu_decode_frame(uint8_t *buffer,
  function a2dp_audio_scalable_decode_frame (line 502) | static int a2dp_audio_scalable_decode_frame(uint8_t *buffer,
  function a2dp_audio_scalable_preparse_packet (line 511) | static int a2dp_audio_scalable_preparse_packet(btif_media_header_t *header,
  function a2dp_audio_scalable_free (line 543) | static void a2dp_audio_scalable_free(void *packet) {
  function a2dp_audio_scalable_store_packet (line 550) | static int a2dp_audio_scalable_store_packet(btif_media_header_t *header,
  function a2dp_audio_scalable_discards_packet (line 576) | static int a2dp_audio_scalable_discards_packet(uint32_t packets) {
  function a2dp_audio_scalable_headframe_info_get (line 601) | static int a2dp_audio_scalable_headframe_info_get(
  function a2dp_audio_scalable_info_get (line 623) | static int a2dp_audio_scalable_info_get(void *info) {
  function a2dp_audio_scalable_synchronize_packet (line 627) | static int
  function a2dp_audio_scalable_synchronize_dest_packet_mut (line 672) | static int
  function a2dp_audio_scalable_convert_list_to_samples (line 696) | int a2dp_audio_scalable_convert_list_to_samples(uint32_t *samples) {
  function a2dp_audio_scalable_discards_samples (line 708) | int a2dp_audio_scalable_discards_samples(uint32_t samples) {

FILE: apps/audioplayers/a2dpplay.cpp
  type A2DP_AUDIO_SYNC_STATUS (line 97) | enum A2DP_AUDIO_SYNC_STATUS {
  type A2DPPLAY_STRTEAM_T (line 106) | enum A2DPPLAY_STRTEAM_T {
  type APP_AUDIO_CACHE_T (line 140) | enum APP_AUDIO_CACHE_T
  type AUD_SAMPRATE_T (line 147) | enum AUD_SAMPRATE_T
  function a2dp_audio_sbc_set_frame_info (line 226) | int a2dp_audio_sbc_set_frame_info(int rcv_len, int frame_num) {
  type BT_DEVICE_T (line 240) | struct BT_DEVICE_T
  function expand_1_channel_to_2_channels_16bits (line 242) | void expand_1_channel_to_2_channels_16bits(unsigned char *in,
  type A2DP_AUDIO_SYNC_STATUS (line 258) | enum A2DP_AUDIO_SYNC_STATUS
  function a2dp_audio_sync_proc (line 261) | static int a2dp_audio_sync_proc(uint8_t status, int shift) {
  function a2dp_audio_isrunning (line 301) | bool a2dp_audio_isrunning(enum A2DPPLAY_STRTEAM_T stream, bool run) {
  function get_ldac_frame_num (line 377) | uint8_t get_ldac_frame_num(uint16_t frame_length_index) {
  function a2dp_audio_set_mtu_limit (line 411) | void a2dp_audio_set_mtu_limit(uint8_t mut) { delay_mtu_limit = mut; }
  function TEXT_LDAC_LOC (line 747) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 780) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 806) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 814) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 888) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 934) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 957) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 967) | TEXT_LDAC_LOC
  function aac_meminit (line 1010) | int aac_meminit() {
  function aac_memdeinit (line 1021) | void aac_memdeinit() {
  function aacdec_init (line 1031) | int aacdec_init(void) {
  function aacdec_deinit (line 1047) | int aacdec_deinit(void) {
  function TEXT_AAC_LOC (line 1059) | TEXT_AAC_LOC
  function TEXT_AAC_LOC (line 1079) | TEXT_AAC_LOC
  function TEXT_AAC_LOC (line 1135) | TEXT_AAC_LOC
  function convert_16bit_to_24bit (line 1217) | static void convert_16bit_to_24bit(int32_t *out, int16_t *in, int len) {
  function TEXT_SSC_LOC (line 1241) | TEXT_SSC_LOC
  function TEXT_SSC_LOC (line 1248) | TEXT_SSC_LOC
  function TEXT_SSC_LOC (line 1258) | TEXT_SSC_LOC
  function TEXT_SSC_LOC (line 1373) | TEXT_SSC_LOC
  function TEXT_SBC_LOC (line 1423) | TEXT_SBC_LOC
  function TEXT_SBC_LOC (line 1426) | TEXT_SBC_LOC
  function TEXT_SBC_LOC (line 1505) | TEXT_SBC_LOC
  function TEXT_SBC_LOC (line 1569) | TEXT_SBC_LOC
  function TEXT_SBC_LOC (line 1578) | TEXT_SBC_LOC
  function reset_lhdc_assmeble_packet (line 1665) | void reset_lhdc_assmeble_packet() {
  function initial_lhdc_assemble_packet (line 1672) | void initial_lhdc_assemble_packet(bool splitFlg) {
  function get_lhdc_header (line 1683) | bool get_lhdc_header(uint8_t *in, LHDC_FRAME_HDR *h) {
  function get_lhdc_frame (line 1707) | uint32_t get_lhdc_frame(uint8_t *frame_q, size_t q_available_size,
  function get_lhdc_data (line 1739) | int get_lhdc_data(unsigned char *frame, unsigned int len) {
  function assemble_lhdc_packet (line 1761) | int assemble_lhdc_packet(uint8_t *input, uint32_t input_len, uint8_t **p...
  function TEXT_LHDC_LOC (line 1868) | TEXT_LHDC_LOC
  function TEXT_LHDC_LOC (line 1953) | TEXT_LHDC_LOC
  function TEXT_LHDC_LOC (line 1976) | TEXT_LHDC_LOC
  type CP_DEC_STATE_T (line 1991) | enum CP_DEC_STATE_T {
  type APP_OVERLAY_ID_T (line 2012) | enum APP_OVERLAY_ID_T
  type CP_DEC_STATE_T (line 2013) | enum CP_DEC_STATE_T
  function TEXT_LDAC_LOC (line 2029) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 2068) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 2075) | TEXT_LDAC_LOC
  function TEXT_LDAC_LOC (line 2093) | TEXT_LDAC_LOC
  function TEXT_LHDC_LOC (line 2115) | TEXT_LHDC_LOC
  function TEXT_AAC_LOC (line 2188) | TEXT_AAC_LOC
  function TEXT_SBC_LOC (line 2251) | TEXT_SBC_LOC
  function TEXT_SBC_LOC (line 2292) | TEXT_SBC_LOC
  function CP_TEXT_SRAM_LOC (line 2299) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 2312) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 2328) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 2339) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 2360) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 2385) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 2424) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 2439) | CP_TEXT_SRAM_LOC
  function CP_TEXT_SRAM_LOC (line 2485) | CP_TEXT_SRAM_LOC
  function cp_a2dp_main (line 2527) | CP_TEXT_SRAM_LOC
  function FRAM_TEXT_LOC (line 2553) | FRAM_TEXT_LOC
  function FRAM_TEXT_LOC (line 2587) | FRAM_TEXT_LOC
  function FRAM_TEXT_LOC (line 2679) | FRAM_TEXT_LOC
  type cp_task_desc (line 2731) | struct cp_task_desc
  function cp_a2dp_init (line 2733) | void cp_a2dp_init(void) {
  function cp_a2dp_deinit (line 2744) | void cp_a2dp_deinit(void) { cp_accel_close(CP_TASK_A2DP_DECODE); }
  function FRAM_TEXT_LOC (line 2747) | FRAM_TEXT_LOC
  function FRAM_TEXT_LOC (line 2767) | FRAM_TEXT_LOC
  function FRAM_TEXT_LOC (line 2800) | FRAM_TEXT_LOC
  function FRAM_TEXT_LOC (line 2844) | FRAM_TEXT_LOC
  function FRAM_TEXT_LOC (line 2861) | FRAM_TEXT_LOC
  function FRAM_TEXT_LOC (line 2918) | FRAM_TEXT_LOC
  type APP_RESAMPLE_T (line 2966) | struct APP_RESAMPLE_T
  function FRAM_TEXT_LOC (line 2968) | FRAM_TEXT_LOC
  function attempt_slow_samplerate (line 2985) | void static attempt_slow_samplerate(uint8_t overlay_type) {
  function a2dp_audio_more_data (line 3045) | uint32_t a2dp_audio_more_data(uint8_t overlay_type, uint8_t *buf,
  type APP_OVERLAY_ID_T (line 3195) | enum APP_OVERLAY_ID_T
  function a2dp_trace_codec_name (line 3224) | static void a2dp_trace_codec_name(const char *prefix,
  function a2dp_audio_init (line 3230) | int a2dp_audio_init(void) {
  function a2dp_audio_deinit (line 3430) | int a2dp_audio_deinit(void) {
  function a2dp_audio_latency_factor_get (line 3489) | float a2dp_audio_latency_factor_get(void) { return 1.0f; }

FILE: apps/audioplayers/app_audio.cpp
  function app_capture_audio_mempool_init (line 49) | int app_capture_audio_mempool_init(void) {
  function app_capture_audio_mempool_free_buff_size (line 57) | uint32_t app_capture_audio_mempool_free_buff_size() {
  function app_capture_audio_mempool_get_buff (line 61) | int app_capture_audio_mempool_get_buff(uint8_t **buff, uint32_t size) {
  function LOCK_APP_AUDIO_QUEUE (line 108) | void LOCK_APP_AUDIO_QUEUE() {
  function UNLOCK_APP_AUDIO_QUEUE (line 112) | void UNLOCK_APP_AUDIO_QUEUE() { osMutexRelease(g_app_audio_queue_mutex_i...
  function app_audio_lr_balance (line 114) | uint32_t app_audio_lr_balance(uint8_t *buf, uint32_t len, int8_t balance) {
  function app_audio_mempool_init_with_specific_size (line 138) | void app_audio_mempool_init_with_specific_size(uint32_t size) {
  function app_audio_pcmbuff_init (line 142) | int app_audio_pcmbuff_init(uint8_t *buff, uint16_t len) {
  function app_audio_pcmbuff_length (line 158) | int app_audio_pcmbuff_length(void) {
  function app_audio_pcmbuff_put (line 168) | int app_audio_pcmbuff_put(uint8_t *buff, uint16_t len) {
  function app_audio_pcmbuff_get (line 178) | int app_audio_pcmbuff_get(uint8_t *buff, uint16_t len) {
  function app_audio_pcmbuff_discard (line 199) | int app_audio_pcmbuff_discard(uint16_t len) {
  function app_audio_memcpy_16bit (line 209) | void __attribute__((section(".fast_text_sram")))
  function app_audio_memset_16bit (line 217) | void __attribute__((section(".fast_text_sram")))
  function app_audio_sendrequest_param (line 226) | int app_audio_sendrequest_param(uint16_t id, uint8_t status, uint32_t ptr,
  function app_audio_sendrequest (line 244) | int app_audio_sendrequest(uint16_t id, uint8_t status, uint32_t ptr) {
  function app_audio_get_list_playback_num (line 250) | static uint8_t app_audio_get_list_playback_num(void) {
  function app_audio_switch_flash_flush_req (line 269) | void app_audio_switch_flash_flush_req(void) {
  function app_audio_switch_flash_proc (line 277) | static void app_audio_switch_flash_proc(void) {
  function app_audio_handle_pre_processing (line 301) | static bool app_audio_handle_pre_processing(APP_MESSAGE_BODY *msg_body) {
  function app_audio_handle_process (line 330) | static int app_audio_handle_process(APP_MESSAGE_BODY *msg_body) {
  function app_audio_handle_free (line 418) | static void app_audio_handle_free(void *data) {
  function app_audio_list_create (line 430) | void app_audio_list_create() {
  function app_audio_list_stream_exist (line 436) | bool app_audio_list_stream_exist() {
  function app_audio_list_filter_exist (line 470) | bool app_audio_list_filter_exist(APP_AUDIO_STATUS *aud_status) {
  function app_audio_list_playback_exist (line 507) | bool app_audio_list_playback_exist(void) {
  function app_audio_list_playback_clear (line 527) | void app_audio_list_playback_clear(void) {
  function app_audio_list_append (line 546) | bool app_audio_list_append(APP_AUDIO_STATUS *aud_status) {
  function app_audio_list_rmv_callback (line 606) | bool app_audio_list_rmv_callback(APP_AUDIO_STATUS *status_close,
  function app_audio_list_clear (line 684) | void app_audio_list_clear() { list_clear(app_audio_conifg.audio_list); }
  function app_audio_open (line 687) | void app_audio_open(void) {
  function app_audio_close (line 715) | void app_audio_close(void) {

FILE: apps/audioplayers/app_audio.h
  type APP_AUDIO_CACHE_T (line 137) | enum APP_AUDIO_CACHE_T {
  type APP_BT_AUDIO_Q_POS (line 210) | enum APP_BT_AUDIO_Q_POS

FILE: apps/audioplayers/bt_sco_chain.c
  function CODEC_OpVecCpy (line 189) | void CODEC_OpVecCpy(short *pshwDes, short *pshwSrc, short swLen) {
  function switch_dualmic_status (line 323) | void switch_dualmic_status(void) {
  type APP_SYSFREQ_FREQ_T (line 339) | enum APP_SYSFREQ_FREQ_T
  function speech_store_config (line 353) | int speech_store_config(const SpeechConfig *cfg) {
  function speech_tx_init (line 363) | int speech_tx_init(int sample_rate, int frame_len) {
  function speech_rx_init (line 537) | int speech_rx_init(int sample_rate, int frame_len) {
  function speech_init (line 580) | int speech_init(int tx_sample_rate, int rx_sample_rate, int tx_frame_ms,
  function speech_tx_deinit (line 684) | int speech_tx_deinit(void) {
  function speech_rx_deinit (line 802) | int speech_rx_deinit(void) {
  function speech_deinit (line 838) | int speech_deinit(void) {
  function speech_tx_get_required_mips (line 876) | float speech_tx_get_required_mips(void) {
  function speech_rx_get_required_mips (line 986) | float speech_rx_get_required_mips(void) {
  function speech_get_required_mips (line 1020) | float speech_get_required_mips(void) {
  function speech_get_proper_sysfreq (line 1026) | enum APP_SYSFREQ_FREQ_T speech_get_proper_sysfreq(int *needed_mips) {
  function speech_set_config (line 1046) | int speech_set_config(const SpeechConfig *cfg) {
  function _speech_tx_process_pre (line 1138) | void _speech_tx_process_pre(short *pcm_buf, short *ref_buf, int *_pcm_le...
  function CP_TEXT_SRAM_LOC (line 1403) | CP_TEXT_SRAM_LOC
  function _speech_tx_process_ (line 1415) | int32_t _speech_tx_process_(void *pcm_buf, void *ref_buf, int32_t *_pcm_...
  function _speech_rx_process_ (line 1425) | int32_t _speech_rx_process_(void *pcm_buf, int32_t *_pcm_len) {
  function speech_tx_process (line 1508) | int speech_tx_process(void *pcm_buf, void *ref_buf, int *pcm_len) {
  function speech_rx_process (line 1520) | int speech_rx_process(void *pcm_buf, int *pcm_len) {

FILE: apps/audioplayers/bt_sco_chain_cfg.h
  type SpeechConfig (line 21) | typedef struct {

FILE: apps/audioplayers/bt_sco_chain_cp.c
  type CP_SCO_STATE_T (line 53) | enum CP_SCO_STATE_T {
  type SCO_CP_CMD_T (line 59) | enum SCO_CP_CMD_T {
  function sco_cp_process (line 81) | int sco_cp_process(short *pcm_buf, short *ref_buf, int *_pcm_len) {
  function sco_cp_main (line 138) | int sco_cp_main(uint8_t event) {
  type cp_task_desc (line 171) | struct cp_task_desc
  function sco_cp_init (line 173) | int sco_cp_init(int frame_len, int channel_num) {
  function sco_cp_deinit (line 222) | int sco_cp_deinit(void) {

FILE: apps/audioplayers/bt_sco_chain_thirdparty.c
  function speech_init (line 30) | int speech_init(int tx_sample_rate, int rx_sample_rate, int tx_frame_ms,
  function speech_deinit (line 74) | int speech_deinit(void) {
  function speech_tx_process (line 94) | int speech_tx_process(void *_pcm_buf, void *_ref_buf, int *_pcm_len) {
  function speech_rx_process (line 157) | int speech_rx_process(void *pcm_buf, int *pcm_len) {

FILE: apps/audioplayers/bt_sco_chain_thirdparty_alango.c
  function deinterleave_audio (line 31) | static void deinterleave_audio(int16_t *dst, int16_t *src, uint32_t len,
  function speech_init (line 43) | int speech_init(int tx_sample_rate, int rx_sample_rate, int tx_frame_ms,
  function speech_deinit (line 102) | int speech_deinit(void) {
  function speech_tx_process (line 126) | int speech_tx_process(void *pcm_buf, void *ref_buf, int *pcm_len) {
  function speech_rx_process (line 196) | int speech_rx_process(void *pcm_buf, int *pcm_len) {

FILE: apps/audioplayers/bt_sco_chain_tuning.c
  type AUDIO_SECTION_SPEECH_CFG_T (line 25) | typedef struct {
  function store_speech_cfg_into_audio_section (line 32) | int store_speech_cfg_into_audio_section(SpeechConfig *cfg) {
  function speech_tuning_set_status (line 70) | int speech_tuning_set_status(bool en) {
  function speech_tuning_get_status (line 76) | bool speech_tuning_get_status(void) { return speech_tuning_status; }
  function speech_tuning_check (line 78) | uint32_t speech_tuning_check(unsigned char *buf, uint32_t len) {
  function speech_tuning_rx_callback (line 111) | uint32_t speech_tuning_rx_callback(unsigned char *buf, uint32_t len) {
  function speech_tuning_burn_rx_callback (line 135) | uint32_t speech_tuning_burn_rx_callback(unsigned char *buf, uint32_t len) {
  function speech_tuning_init (line 162) | int speech_tuning_init(void) {
  function speech_tuning_open (line 180) | int speech_tuning_open(void) {
  function speech_tuning_close (line 196) | int speech_tuning_close(void) {

FILE: apps/audioplayers/cvsdplay.cpp
  type APP_AUDIO_CACHE_T (line 49) | enum APP_AUDIO_CACHE_T
  function xLOCK_VOICECVSD_QUEUE (line 56) | void xLOCK_VOICECVSD_QUEUE(void)
  function xUNLOCK_VOICECVSD_QUEUE (line 61) | void xUNLOCK_VOICECVSD_QUEUE(void)
  function copy_one_trace_to_two_track_16bits (line 72) | static void copy_one_trace_to_two_track_16bits(uint16_t *src_buf, uint16...
  function store_voicecvsd_buffer (line 80) | int store_voicecvsd_buffer(unsigned char *buf, unsigned int len)
  function store_voice_pcm2cvsd (line 96) | int store_voice_pcm2cvsd(unsigned char *buf, unsigned int len)
  function get_voicecvsd_buffer_size (line 132) | int get_voicecvsd_buffer_size(void)
  function decode_cvsd_frame (line 142) | int decode_cvsd_frame(unsigned char *pcm_buffer, unsigned int pcm_len)
  function decode_cvsd_frame_noblock (line 189) | uint32_t decode_cvsd_frame_noblock(uint8_t *pcm_buffer, uint32_t pcm_len)
  function voicecvsd_audio_more_data (line 226) | uint32_t voicecvsd_audio_more_data(uint8_t *buf, uint32_t len)
  function voicecvsd_audio_init (line 244) | int voicecvsd_audio_init(void)

FILE: apps/audioplayers/digmici2splay.cpp
  function dig_mic_audio_more_data (line 30) | uint32_t dig_mic_audio_more_data(uint8_t *buf, uint32_t len) {
  function dig_mic_audio_data_come (line 36) | uint32_t dig_mic_audio_data_come(uint8_t *buf, uint32_t len) {

FILE: apps/audioplayers/flacplay.cpp
  function copy_one_trace_to_two_track_16bits (line 45) | static void copy_one_trace_to_two_track_16bits(uint16_t *src_buf,
  function store_flac_buffer (line 54) | int store_flac_buffer(unsigned char *buf, unsigned int len) {
  function decode_flac_frame (line 65) | int decode_flac_frame(unsigned char *pcm_buffer, unsigned int pcm_len) {
  function flac_audio_data_come (line 107) | uint32_t flac_audio_data_come(uint8_t *buf, uint32_t len) {
  function flac_audio_more_data (line 113) | uint32_t flac_audio_more_data(uint8_t *buf, uint32_t len) {
  function flac_audio_init (line 128) | int flac_audio_init(void) {

FILE: apps/audioplayers/fmradio.cpp
  function fm_handler (line 59) | static void fm_handler(uint8_t chan, uint32_t remains, uint32_t error,
  function fm_pcm_more_data (line 93) | uint32_t fm_pcm_more_data(uint8_t *buf, uint32_t len) {
  function fm_capture_more_data (line 117) | uint32_t fm_capture_more_data(uint8_t *buf, uint32_t len) {
  function fm_radio_digit_init (line 122) | void fm_radio_digit_init(void) {
  function fm_radio_analog_init (line 238) | int fm_radio_analog_init(void) {
  function fm_radio_poweron (line 369) | void fm_radio_poweron(void)
  function fm_radio_player (line 406) | int fm_radio_player(bool on) {
  function fm_tune (line 462) | int fm_tune(uint32_t freqkhz) {
  function fm_test_main (line 493) | void fm_test_main(void) {

FILE: apps/audioplayers/msbcplay.cpp
  function dump_buffer_to_psram (line 47) | static void dump_buffer_to_psram(char *buf, unsigned int len)
  function copy_one_trace_to_two_track_16bits (line 53) | static void copy_one_trace_to_two_track_16bits(uint16_t *src_buf, uint16...
  function store_voicemsbc_buffer (line 61) | int store_voicemsbc_buffer(unsigned char *buf, unsigned int len)
  function decode_msbc_frame (line 76) | int decode_msbc_frame(unsigned char *pcm_buffer, unsigned int pcm_len)
  function voicemsbc_audio_more_data (line 124) | uint32_t voicemsbc_audio_more_data(uint8_t *buf, uint32_t len)
  function voicemsbc_audio_init (line 140) | int voicemsbc_audio_init(void)

FILE: apps/audioplayers/plc_utils.c
  function sco_parse_synchronization_header (line 64) | static int sco_parse_synchronization_header(uint8_t *buf, uint8_t *sn) {
  function memcmp_U8 (line 143) | static bool memcmp_U8(uint8_t *x, uint8_t *y, uint16_t size) {
  function update_ble_sco_conflict (line 154) | static bool update_ble_sco_conflict(PacketLossState *st, uint8_t *last_pkt,
  function check_ble_sco_conflict (line 166) | static bool check_ble_sco_conflict(PacketLossState *st, bool ret) {
  function msbc_check_controller_mute_pattern (line 174) | static bool msbc_check_controller_mute_pattern(uint8_t *pkt, uint8_t pat...
  function msbc_check_pkt_trailing_zeros (line 184) | static int msbc_check_pkt_trailing_zeros(uint8_t *pkt) {
  function get_next_sequence_num (line 198) | static uint8_t get_next_sequence_num(uint8_t seq_num) {
  function packet_loss_detection_init (line 202) | void packet_loss_detection_init(PacketLossState *st) {
  function plc_type_t (line 211) | plc_type_t packet_loss_detection_process(PacketLossState *st,
  function packet_loss_detection_update_histogram (line 286) | void packet_loss_detection_update_histogram(PacketLossState *st,
  function packet_loss_detection_report (line 301) | void packet_loss_detection_report(PacketLossState *st) {

FILE: apps/audioplayers/plc_utils.h
  type plc_type_t (line 8) | typedef enum plc_type
  type PacketLossState (line 22) | typedef struct

FILE: apps/audioplayers/rbplay/rb_ctl.cpp
  function rb_ctl_status (line 125) | static rb_ctl_status rb_ctl_get_status(void) { return rb_ctl_context.sta...
  function rb_ctl_parse_file (line 127) | bool rb_ctl_parse_file(const char *file_path) {
  function rb_ctl_vol_operation (line 155) | void rb_ctl_vol_operation(bool inc) {
  function rb_ctl_is_playing (line 181) | bool rb_ctl_is_playing(void) {
  function rb_ctl_set_vol (line 185) | void rb_ctl_set_vol(uint32_t vol) {
  function rb_ctl_stop_play (line 205) | void rb_ctl_stop_play(void) {
  function rb_ctl_sync_stop_play (line 224) | void rb_ctl_sync_stop_play(void) {
  function rb_ctl_pause_playing (line 237) | void rb_ctl_pause_playing(void) {
  function rb_ctl_resume_playing (line 251) | void rb_ctl_resume_playing(void) {
  function rb_ctl_set_priority (line 257) | void rb_ctl_set_priority(int priority) {
  function rb_ctl_get_priority (line 261) | int rb_ctl_get_priority(void) { return (int)osThreadGetPriority(rb_ctl_t...
  function rb_ctl_get_default_priority (line 263) | int rb_ctl_get_default_priority(void) { return rb_ctl_default_priority; }
  function rb_ctl_reset_priority (line 265) | void rb_ctl_reset_priority(void) {
  function rb_ctl_handle_event (line 272) | static int rb_ctl_handle_event(RBCTL_MSG_BLOCK *msg_body) {
  function rb_thread_post_msg (line 493) | int rb_thread_post_msg(RB_MODULE_EVT evt, uint32_t arg) {
  function app_wait_player_stoped (line 508) | void app_wait_player_stoped(void) {
  function app_wait_player_suspend (line 513) | void app_wait_player_suspend(void) {
  function app_wait_player_resumed (line 521) | void app_wait_player_resumed(void) {
  function rb_thread_send_play (line 529) | void rb_thread_send_play(void) {
  function rb_thread_send_stop (line 534) | void rb_thread_send_stop(void) {
  function rb_thread_send_pause (line 542) | void rb_thread_send_pause(void) {
  function rb_thread_send_resume (line 551) | void rb_thread_send_resume(void) {
  function rb_play_dual_play_restore (line 559) | void rb_play_dual_play_restore(uint8_t stream_type) {
  function rb_thread_send_switch (line 566) | void rb_thread_send_switch(bool next) {
  function rb_play_linein_start (line 574) | void rb_play_linein_start(void) {
  function rb_play_reconfig_stream (line 581) | void rb_play_reconfig_stream(uint32_t arg) {
  function rb_play_set_tws_mode (line 588) | void rb_play_set_tws_mode(uint32_t arg) {
  function rb_thread_send_play_idx (line 595) | void rb_thread_send_play_idx(uint32_t array_subidx) {
  function rb_thread_send_vol (line 601) | void rb_thread_send_vol(bool inc) {
  function rb_thread_send_status_change (line 607) | void rb_thread_send_status_change(void) {
  function rb_thread_set_vol (line 613) | void rb_thread_set_vol(uint32_t vol) {
  function rb_thread_send_del_file (line 619) | void rb_thread_send_del_file(uint16_t idx) {
  function rb_thread_send_sbc_record_start (line 625) | void rb_thread_send_sbc_record_start(void) {
  function rb_thread_send_sbc_record_data_ind (line 631) | void rb_thread_send_sbc_record_data_ind(void) {
  function rb_thread_send_sbc_record_stop (line 638) | void rb_thread_send_sbc_record_stop(void) {
  function app_rbplay_audio_reset_pause_status (line 646) | void app_rbplay_audio_reset_pause_status(void) {
  function app_rbplay_audio_onoff (line 650) | int app_rbplay_audio_onoff(bool onoff, uint16_t aud_id) {
  function app_rbplay_pause_resume (line 675) | void app_rbplay_pause_resume(void) {
  function rb_ctl_mailbox_init (line 690) | static int rb_ctl_mailbox_init(void) {
  function rb_ctl_mailbox_put (line 699) | int rb_ctl_mailbox_put(RBCTL_MSG_BLOCK *msg_src) {
  function rb_ctl_mailbox_free (line 720) | int rb_ctl_mailbox_free(RBCTL_MSG_BLOCK *msg_p) {
  function rb_ctl_mailbox_get (line 728) | int rb_ctl_mailbox_get(RBCTL_MSG_BLOCK **msg_p) {
  function rb_ctl_action_init (line 739) | void rb_ctl_action_init(void)
  function rb_ctl_action_run (line 752) | void rb_ctl_action_run(void)
  function rb_ctl_action_stop (line 762) | void rb_ctl_action_stop(void)
  function rb_ctl_thread (line 773) | static void rb_ctl_thread(void const *argument) {
  function rb_ctl_init (line 806) | int rb_ctl_init(void) {
  function rb_ctl_get_vol (line 827) | uint8_t rb_ctl_get_vol(void) { return rb_ctl_context.rb_player_vol; }
  function rb_ctl_is_init_done (line 829) | bool rb_ctl_is_init_done(void) { return rb_ctl_context.init_done; }
  function rb_ctl_is_paused (line 831) | bool rb_ctl_is_paused(void) { return (RB_CTL_SUSPEND == rb_ctl_get_statu...
  function rb_ctl_songs_count (line 833) | uint16_t rb_ctl_songs_count(void) { return sd_playlist.total_songs; }

FILE: apps/audioplayers/rbplay/rb_ctl.h
  type RB_MODULE_EVT (line 22) | typedef enum {
  type rb_ctl_status (line 52) | typedef enum {
  type rb_ctl_struct (line 58) | typedef struct {

FILE: apps/audioplayers/rbplay/rbpcmbuf.cpp
  function rbplay_more_data (line 60) | static uint32_t rbplay_more_data(uint8_t *buf, uint32_t len) {
  function rb_pcmbuf_init (line 86) | void rb_pcmbuf_init(void) {
  function rb_pcmbuf_write (line 124) | void rb_pcmbuf_write(unsigned int size) {
  function rb_pcmbuf_stop (line 135) | void rb_pcmbuf_stop(void) {

FILE: apps/audioplayers/rbplay/rbpcmbuf.h
  type RB_PCMBUF_AUD_STATE_T (line 25) | typedef enum _RB_PCMBUF_AUD_STATE_T {

FILE: apps/audioplayers/rbplay/rbplay.cpp
  type AUD_BITS_T (line 69) | enum AUD_BITS_T
  type AUD_SAMPRATE_T (line 70) | enum AUD_SAMPRATE_T
  type AUD_CHANNEL_NUM_T (line 71) | enum AUD_CHANNEL_NUM_T
  type _rb_tws_codec_info (line 74) | struct _rb_tws_codec_info {
  type mp3entry (line 103) | struct mp3entry
  type codec_api (line 108) | struct codec_api
  type codec_api (line 109) | struct codec_api
  type APP_SYSFREQ_FREQ_T (line 126) | enum APP_SYSFREQ_FREQ_T
  function rb_player_sync_close_done (line 128) | static void rb_player_sync_close_done(void) { thread_tid_waiter = NULL; }
  function f_codec_pcmbuf_insert_callback (line 131) | static void f_codec_pcmbuf_insert_callback(const void *ch1, const void *...
  function f_audio_codec_update_elapsed (line 196) | static void f_audio_codec_update_elapsed(unsigned long elapsed) {
  function f_codec_filebuf_callback (line 201) | static size_t f_codec_filebuf_callback(void *ptr, size_t size) {
  function f_codec_seek_buffer_callback (line 226) | static bool f_codec_seek_buffer_callback(size_t newpos) {
  function f_codec_seek_complete_callback (line 237) | static void f_codec_seek_complete_callback(void) {
  function f_audio_codec_update_offset (line 242) | static void f_audio_codec_update_offset(size_t offset) {}
  function f_codec_configure_callback (line 244) | static void f_codec_configure_callback(int setting, intptr_t value) {
  function f_codec_get_command_callback (line 259) | static enum codec_command_action f_codec_get_command_callback(intptr_t *...
  function f_codec_loop_track_callback (line 266) | static bool f_codec_loop_track_callback(void) { return false; }
  function init_ci_file (line 268) | static void init_ci_file(void) {
  function rb_play_init (line 283) | static void rb_play_init(void) {
  function rb_play_codec_init (line 293) | void rb_play_codec_init(void) {
  function rb_play_codec_run (line 300) | void rb_play_codec_run(void) {
  function rb_codec_init_desc (line 307) | static int rb_codec_init_desc(void) {
  function rb_codec_loop_on (line 344) | static int rb_codec_loop_on(void) {
  function rb_thread_process_evt (line 376) | static int rb_thread_process_evt(RB_CTRL_CMD_T evt) {
  function rb_decode_mailbox_put (line 429) | int rb_decode_mailbox_put(RBTHREAD_MSG_BLOCK *msg_src) {
  function rb_decode_mailbox_free (line 448) | int rb_decode_mailbox_free(RBTHREAD_MSG_BLOCK *msg_p) {
  function rb_decode_mailbox_get (line 456) | int rb_decode_mailbox_get(RBTHREAD_MSG_BLOCK **msg_p) {
  function rb_decode_thread (line 466) | static void rb_decode_thread(void const *argument) {
  function app_rbplay_open (line 490) | int app_rbplay_open(void) {
  function rb_codec_running (line 511) | int rb_codec_running(void) { return ((rb_decode_halt_flag == 0) ? 1 : 0); }
  function rb_codec_set_halt (line 513) | void rb_codec_set_halt(int halt) { rb_decode_halt_flag = halt; }
  function rb_thread_set_decode_vars (line 515) | void rb_thread_set_decode_vars(int fd, int type, void *id3) {
  function rb_player_sync_set_wait_thread (line 521) | void rb_player_sync_set_wait_thread(osThreadId tid) {
  function rb_player_sync_wait_close (line 528) | void rb_player_sync_wait_close(void) {
  function rb_player_get_work_freq (line 534) | enum APP_SYSFREQ_FREQ_T rb_player_get_work_freq(void) {

FILE: apps/audioplayers/rbplay/rbplay.h
  type RB_CTRL_CMD_T (line 22) | typedef enum _RB_CTRL_CMD_T {

FILE: apps/audioplayers/rbplay/rbplaysd.cpp
  function playlist_insert (line 44) | static void playlist_insert(playlist_item *item) {
  function sdcard_mount (line 57) | static bool sdcard_mount(void) {
  function app_rbplay_gen_playlist (line 81) | static void app_rbplay_gen_playlist(playlist_struct *list) {
  function app_rbplay_load_playlist (line 183) | void app_rbplay_load_playlist(playlist_struct *list) {
  function playlist_item (line 192) | playlist_item *app_rbplay_get_playitem(const int idx) {
  function app_ctl_remove_file (line 215) | int app_ctl_remove_file(const int idx) {

FILE: apps/audioplayers/rbplay/rbplaysd.h
  type playlist_item (line 32) | typedef struct {
  type playlist_struct (line 54) | typedef struct {

FILE: apps/audioplayers/voice_test.c
  type VOICE_PCM_T (line 44) | typedef short VOICE_PCM_T;
  type VOICE_PCM_T (line 46) | typedef int VOICE_PCM_T;
  function codec_capture_callback (line 59) | static uint32_t codec_capture_callback(uint8_t *buf, uint32_t len) {
  function codec_playback_callback (line 77) | static uint32_t codec_playback_callback(uint8_t *buf, uint32_t len) {
  function voice_start (line 91) | static int voice_start(bool on) {
  function voice_test (line 175) | void voice_test(void) {

FILE: apps/audioplayers/voicebtpcmplay.cpp
  type APP_AUDIO_CACHE_T (line 140) | enum APP_AUDIO_CACHE_T
  type APP_AUDIO_CACHE_T (line 141) | enum APP_AUDIO_CACHE_T
  type PLC_State (line 160) | struct PLC_State
  function store_voicebtpcm_m2p_buffer (line 184) | int store_voicebtpcm_m2p_buffer(unsigned char *buf, unsigned int len) {
  function decode_cvsd_frame (line 221) | int decode_cvsd_frame(unsigned char *pcm_buffer, unsigned int pcm_len) {
  function encode_cvsd_frame (line 267) | int encode_cvsd_frame(unsigned char *pcm_buffer, unsigned int pcm_len) {
  function sco_parse_synchronization_header (line 329) | inline int sco_parse_synchronization_header(uint8_t *buf, uint8_t *sn) {
  function decode_msbc_frame (line 373) | int decode_msbc_frame(unsigned char *msbc_btpcm_buffer, unsigned int msb...
  function decode_msbc_frame (line 744) | __attribute__((section(".fast_text_sram"))) int
  function decode_msbc_frame (line 888) | int decode_msbc_frame(unsigned char *pcm_buffer, unsigned int pcm_len) {
  function store_voicebtpcm_p2m_buffer (line 1335) | int store_voicebtpcm_p2m_buffer(unsigned char *buf, unsigned int len) {
  function get_msbc_counter (line 1358) | unsigned char get_msbc_counter(void) {
  function CQueue (line 1376) | CQueue *get_tx_esco_queue_ptr() { return &Tx_esco_queue; }
  function CQueue (line 1377) | CQueue *get_rx_esco_queue_ptr() { return &Rx_esco_queue; }
  function get_voicebtpcm_p2m_frame (line 1383) | int get_voicebtpcm_p2m_frame(unsigned char *buf, unsigned int len) {
  function get_mic_data_max (line 1521) | void get_mic_data_max(short *buf, uint32_t len)
  function us_get_coef_para (line 1616) | static inline short us_get_coef_para(U32 samp_idx, U32 coef_idx) {
  function us_fir_init (line 1623) | void us_fir_init(void) {
  function U32 (line 1627) | __attribute__((section(".fast_text_sram"))) U32
  function voicebtpcm_pcm_resample (line 1662) | uint32_t voicebtpcm_pcm_resample(short *src_samp_buf, uint32_t src_smpl_...
  function speech_tx_aec_get_frame_len (line 1671) | int speech_tx_aec_get_frame_len(void) { return speech_tx_aec_frame_len; }
  function speech_tx_aec_set_frame_len (line 1673) | void speech_tx_aec_set_frame_len(int len) {
  function voicebtpcm_pcm_audio_data_come (line 1680) | uint32_t voicebtpcm_pcm_audio_data_come(uint8_t *buf, uint32_t len) {
  function voicebtpcm_pcm_audio_data_come (line 1759) | uint32_t voicebtpcm_pcm_audio_data_come(uint8_t *buf, uint32_t len) {
  function voicebtpcm_pcm_audio_more_data (line 1783) | uint32_t voicebtpcm_pcm_audio_more_data(uint8_t *buf, uint32_t len) {
  function voicebtpcm_pcm_echo_buf_queue_init (line 1932) | int voicebtpcm_pcm_echo_buf_queue_init(uint32_t size) {
  function voicebtpcm_pcm_echo_buf_queue_reset (line 1946) | void voicebtpcm_pcm_echo_buf_queue_reset(void) {
  function voicebtpcm_pcm_echo_buf_queue_deinit (line 1957) | void voicebtpcm_pcm_echo_buf_queue_deinit(void) {
  type AUD_SAMPRATE_T (line 1970) | enum AUD_SAMPRATE_T
  function voicebtpcm_pcm_audio_init (line 1974) | int voicebtpcm_pcm_audio_init(int sco_sample_rate, int codec_sample_rate) {
  function voicebtpcm_pcm_audio_deinit (line 2185) | int voicebtpcm_pcm_audio_deinit(void) {

FILE: apps/audioplayers/voicebtpcmplay_sco_dma_snapshot.cpp
  type PLC_State (line 110) | struct PLC_State
  function process_downlink_bt_voice_frames (line 161) | int process_downlink_bt_voice_frames(uint8_t *in_buf, uint32_t in_len,
  function process_uplink_bt_voice_frames (line 218) | int process_uplink_bt_voice_frames(uint8_t *in_buf, uint32_t in_len,
  function process_downlink_msbc_frames (line 301) | int process_downlink_msbc_frames(unsigned char *msbc_buf, unsigned int m...
  function process_uplink_msbc_frames (line 629) | int process_uplink_msbc_frames(unsigned char *pcm_buf, unsigned int pcm_...
  function POSSIBLY_UNUSED (line 732) | POSSIBLY_UNUSED plc_type_t check_cvsd_mute_pattern(uint8_t *buf, uint32_...
  function process_downlink_cvsd_frames (line 740) | int process_downlink_cvsd_frames(unsigned char *cvsd_buf, unsigned int c...
  function process_uplink_cvsd_frames (line 791) | int process_uplink_cvsd_frames(unsigned char *pcm_buf, unsigned int pcm_...
  function voicebtpcm_pcm_audio_init (line 811) | int voicebtpcm_pcm_audio_init(int sco_sample_rate, int codec_sample_rate) {
  function voicebtpcm_pcm_audio_deinit (line 958) | int voicebtpcm_pcm_audio_deinit(void) {

FILE: apps/audioplayers/wavplay.cpp
  type wave_header (line 35) | struct wave_header {
  type wave_file (line 54) | struct wave_file {
  function wav_file_set_playeback_cb (line 72) | void wav_file_set_playeback_cb(int32_t (*cb)(int32_t)) {
  function wav_file_isplaydone (line 75) | bool wav_file_isplaydone(void) {
  function wav_file_audio_more_data (line 78) | uint32_t wav_file_audio_more_data(uint8_t *buf, uint32_t len) {
  function get_wav_data (line 116) | uint32_t get_wav_data(wave_file_t *waveFile) {
  function audio_wav_init (line 189) | void audio_wav_init(wave_file_t *newWav) {
  function play_wav_file (line 199) | uint32_t play_wav_file(char *file_path) {
  function stop_wav_file (line 230) | uint32_t stop_wav_file(void) {

FILE: apps/battery/app_battery.cpp
  type APP_BATTERY_MEASURE_PERIODIC_T (line 120) | enum APP_BATTERY_MEASURE_PERIODIC_T {
  type APP_BATTERY_MEASURE_CHARGER_STATUS_T (line 128) | struct APP_BATTERY_MEASURE_CHARGER_STATUS_T {
  type APP_BATTERY_STATUS_T (line 135) | enum APP_BATTERY_STATUS_T
  type APP_BATTERY_MEASURE_T (line 138) | struct APP_BATTERY_MEASURE_T {
    type APP_BATTERY_STATUS_T (line 140) | enum APP_BATTERY_STATUS_T
    type APP_BATTERY_MEASURE_PERIODIC_T (line 153) | enum APP_BATTERY_MEASURE_PERIODIC_T
    type APP_BATTERY_MEASURE_CHARGER_STATUS_T (line 156) | struct APP_BATTERY_MEASURE_CHARGER_STATUS_T
  type APP_BATTERY_CHARGER_T (line 161) | enum APP_BATTERY_CHARGER_T
  type APP_BATTERY_MEASURE_T (line 174) | struct APP_BATTERY_MEASURE_T
    type APP_BATTERY_STATUS_T (line 140) | enum APP_BATTERY_STATUS_T
    type APP_BATTERY_MEASURE_PERIODIC_T (line 153) | enum APP_BATTERY_MEASURE_PERIODIC_T
    type APP_BATTERY_MEASURE_CHARGER_STATUS_T (line 156) | struct APP_BATTERY_MEASURE_CHARGER_STATUS_T
  function app_battery_irqhandler (line 184) | void app_battery_irqhandler(uint16_t irq_val, HAL_GPADC_MV_T volt) {
  function app_battery_timer_start (line 240) | static void
  function app_battery_timer_handler (line 263) | static void app_battery_timer_handler(void const *param) {
  function app_battery_event_process (line 268) | static void app_battery_event_process(enum APP_BATTERY_STATUS_T status,
  function app_battery_handle_process_normal (line 281) | int app_battery_handle_process_normal(uint32_t status,
  function app_battery_handle_process_charging (line 353) | int app_battery_handle_process_charging(uint32_t status,
  function app_battery_handle_process (line 407) | static int app_battery_handle_process(APP_MESSAGE_BODY *msg_body) {
  function app_battery_register (line 457) | int app_battery_register(APP_BATTERY_CB_T user_cb) {
  function app_battery_get_info (line 465) | int app_battery_get_info(APP_BATTERY_MV_T *currvolt, uint8_t *currlevel,
  function app_battery_open (line 486) | int app_battery_open(void) {
  function app_battery_start (line 565) | int app_battery_start(void) {
  function app_battery_stop (line 573) | int app_battery_stop(void) {
  function app_battery_close (line 579) | int app_battery_close(void) {
  function app_battery_charger_slope_calc (line 585) | static int32_t app_battery_charger_slope_calc(int32_t t1, int32_t v1,
  function app_battery_charger_handle_process (line 592) | static int app_battery_charger_handle_process(void) {
  function app_battery_charger_forcegetstatus (line 690) | static enum APP_BATTERY_CHARGER_T app_battery_charger_forcegetstatus(voi...
  function app_battery_charger_handler (line 707) | static void app_battery_charger_handler(enum PMU_CHARGER_STATUS_T status) {
  function app_battery_pluginout_debounce_start (line 716) | static void app_battery_pluginout_debounce_start(void) {
  function app_battery_pluginout_debounce_handler (line 725) | static void app_battery_pluginout_debounce_handler(void const *param) {
  function app_battery_charger_indication_open (line 764) | int app_battery_charger_indication_open(void) {
  function app_battery_current_level (line 791) | int8_t app_battery_current_level(void) {
  function app_battery_is_charging (line 799) | int8_t app_battery_is_charging(void) {
  type NTC_CAPTURE_MEASURE_T (line 813) | struct NTC_CAPTURE_MEASURE_T {
  type NTC_CAPTURE_MEASURE_T (line 821) | struct NTC_CAPTURE_MEASURE_T
  function ntc_capture_irqhandler (line 823) | void ntc_capture_irqhandler(uint16_t irq_val, HAL_GPADC_MV_T volt) {
  function ntc_capture_open (line 852) | int ntc_capture_open(void) {
  function ntc_capture_start (line 865) | int ntc_capture_start(void) {

FILE: apps/battery/app_battery.h
  type APP_BATTERY_INFO_T (line 32) | typedef struct
  type APP_BATTERY_STATUS_T (line 45) | enum APP_BATTERY_STATUS_T {
  type APP_BATTERY_MV_T (line 62) | typedef uint16_t APP_BATTERY_MV_T;
  type APP_BATTERY_CHARGER_T (line 64) | enum APP_BATTERY_CHARGER_T
  type APP_BATTERY_CHARGER_T (line 73) | enum APP_BATTERY_CHARGER_T
  type APP_BATTERY_STATUS_T (line 77) | enum APP_BATTERY_STATUS_T
  type APP_BATTERY_STATUS_T (line 80) | enum APP_BATTERY_STATUS_T

FILE: apps/cmd/app_cmd.cpp
  function cmd_event_process (line 28) | void cmd_event_process(hal_cmd_rx_status_t status) {
  function app_cmd_handle_process (line 38) | static int app_cmd_handle_process(APP_MESSAGE_BODY *msg_body) {
  function app_cmd_open (line 45) | void app_cmd_open(void) {
  function app_cmd_close (line 56) | void app_cmd_close(void) {

FILE: apps/cmd/app_cmd.h
  type APP_CMD_HANDLE (line 21) | typedef struct {

FILE: apps/common/app_spec_ostimer.cpp
  function osStatus (line 27) | osStatus app_spec_timer_create(SPEC_TIMER_CTX_T *spec_timer_ctx,
  function osStatus (line 37) | osStatus app_spec_timer_start(SPEC_TIMER_CTX_T *spec_timer_ctx,
  function osStatus (line 56) | osStatus app_spec_timer_stop(SPEC_TIMER_CTX_T *spec_timer_ctx) {
  function osStatus (line 61) | osStatus app_spec_timer_delete(SPEC_TIMER_CTX_T *spec_timer_ctx) {
  function app_spec_timer_handler (line 65) | void app_spec_timer_handler(void const *para) {
  function app_tws_ibrt_test_timer_cb (line 89) | void app_tws_ibrt_test_timer_cb(void const *para)
  function app_tws_ibrt_test_timer (line 94) | void app_tws_ibrt_test_timer(void)

FILE: apps/common/app_spec_ostimer.h
  type SPEC_TIMER_CTX_T (line 20) | typedef struct{

FILE: apps/common/app_thread.c
  function app_mailbox_init (line 32) | static int app_mailbox_init(void) {
  function app_mailbox_put (line 42) | int app_mailbox_put(APP_MESSAGE_BLOCK *msg_src) {
  function app_mailbox_free (line 91) | int app_mailbox_free(APP_MESSAGE_BLOCK *msg_p) {
  function app_mailbox_get (line 101) | int app_mailbox_get(APP_MESSAGE_BLOCK **msg_p) {
  function app_thread (line 111) | static void app_thread(void const *argument) {
  function app_os_init (line 128) | int app_os_init(void) {
  function app_set_threadhandle (line 140) | int app_set_threadhandle(enum APP_MODUAL_ID_T mod_id,
  function app_is_module_registered (line 151) | bool app_is_module_registered(enum APP_MODUAL_ID_T mod_id) {

FILE: apps/common/app_thread.h
  type APP_MODUAL_ID_T (line 28) | enum APP_MODUAL_ID_T {
  type APP_MESSAGE_BODY (line 59) | typedef struct {
  type APP_MESSAGE_BLOCK (line 67) | typedef struct {
  type APP_MODUAL_ID_T (line 85) | enum APP_MODUAL_ID_T
  type APP_MODUAL_ID_T (line 90) | enum APP_MODUAL_ID_T

FILE: apps/common/app_utils.c
  function app_qosfreq_req (line 89) | static int app_qosfreq_req(enum APP_SYSFREQ_USER_T user,
  function app_sysfreq_req (line 167) | int app_sysfreq_req(enum APP_SYSFREQ_USER_T user,
  function watchdog_ping (line 190) | static void watchdog_ping(void) {
  function app_wdt_irq_handle (line 197) | static void app_wdt_irq_handle(enum HAL_WDT_ID_T id, uint32_t status) {
  function pmu_wdt_irq_handle (line 202) | static void pmu_wdt_irq_handle(void) {
  function watchdog_ping_handler (line 207) | static void watchdog_ping_handler(void const *unused) {
  function app_wdt_open (line 219) | int app_wdt_open(int seconds) {
  function app_wdt_reopen (line 242) | int app_wdt_reopen(int seconds) {
  function app_wdt_close (line 257) | int app_wdt_close(void) {

FILE: apps/common/app_utils.h
  type APP_SYSFREQ_USER_T (line 48) | enum APP_SYSFREQ_USER_T {
  type APP_SYSFREQ_FREQ_T (line 69) | enum APP_SYSFREQ_FREQ_T {
  type APP_WDT_THREAD_CHECK_USER_T (line 80) | enum APP_WDT_THREAD_CHECK_USER_T {
  type APP_SYSFREQ_USER_T (line 96) | enum APP_SYSFREQ_USER_T
  type APP_SYSFREQ_FREQ_T (line 96) | enum APP_SYSFREQ_FREQ_T

FILE: apps/common/randfrommic.c
  function randDataParse (line 46) | static int randDataParse(uint8_t *buf, uint32_t len, enum AUD_BITS_T bits,
  function generateRand (line 111) | static void generateRand(bool on) {
  function rand_data_handle (line 157) | static uint32_t rand_data_handle(uint8_t *buf, uint32_t len) {
  function initSeed (line 173) | void initSeed(void) {
  function random_status_sync (line 197) | void random_status_sync(void) {
  function random_data_process (line 204) | void random_data_process(uint8_t *buf, uint32_t len, enum AUD_BITS_T bits,
  function randInit (line 227) | void randInit(void) { randInitialised = true; }

FILE: apps/common/randfrommic.h
  type RAND_STATUS_E (line 11) | typedef enum {
  type RAND_NUMBER_T (line 19) | typedef struct{
  type AUD_BITS_T (line 26) | enum AUD_BITS_T
  type AUD_CHANNEL_NUM_T (line 26) | enum AUD_CHANNEL_NUM_T

FILE: apps/factory/app_factory.cpp
  type APP_FACTORYMODE_STATUS_INDICATION_T (line 65) | enum APP_FACTORYMODE_STATUS_INDICATION_T {
  type message_t (line 79) | struct message_t
  function app_factorymode_languageswitch_proc (line 89) | int app_factorymode_languageswitch_proc(void) {
  function app_factorymode_languageswitch (line 110) | void app_factorymode_languageswitch(APP_KEY_STATUS *status, void *param) {
  function app_factorymode_enter (line 114) | void app_factorymode_enter(void) {
  function app_factorymode_get (line 125) | bool app_factorymode_get(void) { return isInFactoryMode; }
  function app_factorymode_set (line 127) | void app_factorymode_set(bool set) { isInFactoryMode = set; }
  function app_factorymode_i2c_switch (line 130) | void app_factorymode_i2c_switch(APP_KEY_STATUS *status, void *param) {
  function bt_drv_ibrt_test_key_click (line 148) | void bt_drv_ibrt_test_key_click(APP_KEY_STATUS *status, void *param) {
  function app_factorymode_key_init (line 153) | void app_factorymode_key_init(void) {
  function app_factorymode_audioloopswitch (line 204) | static void app_factorymode_audioloopswitch(APP_KEY_STATUS *status,
  function app_factorymode_test_key_init (line 218) | void app_factorymode_test_key_init(void) {
  function app_factorymode_result_clean (line 234) | void app_factorymode_result_clean(void) {
  function app_factorymode_result_set (line 239) | void app_factorymode_result_set(bool result) {
  function app_factorymode_result_wait (line 246) | bool app_factorymode_result_wait(void) {
  function app_factorymode_send_progress (line 268) | static int app_factorymode_send_progress(uint8_t progress) {
  function app_factorymode_send_code (line 279) | static int app_factorymode_send_code(uint32_t progress) {
  function app_factorymode_proc (line 290) | int app_factorymode_proc(void) {
  function app_factorymode_msg_check_sum (line 321) | static unsigned char app_factorymode_msg_check_sum(unsigned char *buf,
  function app_factorymode_msg_uart_send (line 333) | static int app_factorymode_msg_uart_send(const unsigned char *buf, size_...
  function app_factorymode_msg_send_ping (line 347) | static int app_factorymode_msg_send_ping(void) {
  function app_factorymode_msg_send_progress (line 364) | static int app_factorymode_msg_send_progress(uint8_t progress) {
  function app_factorymode_msg_send_32bitcode (line 381) | static int app_factorymode_msg_send_32bitcode(uint32_t code) {
  function app_factorymode_process (line 398) | static int app_factorymode_process(APP_MESSAGE_BODY *msg_body) {
  function app_factorymode_uart_init (line 411) | static int app_factorymode_uart_init(void) {
  function app_factorymode_timehandler (line 428) | static void app_factorymode_timehandler(void const *param) {
  function app_factorymode_indication_init (line 436) | static uint8_t app_factorymode_indication_init(void) {
  function app_factorymode_status_indication (line 446) | static uint8_t
  function app_factorymode_init (line 506) | int app_factorymode_init(uint32_t factorymode) {
  function app_factorymode_calib_only (line 594) | int app_factorymode_calib_only(void) {
  type USB_SERIAL_CFG_T (line 660) | struct USB_SERIAL_CFG_T
  function usb_serial_recv_timeout (line 664) | static void usb_serial_recv_timeout(void *param) { usb_serial_cancel_rec...
  function app_factorymode_cdc_comm (line 666) | int app_factorymode_cdc_comm(void) {

FILE: apps/factory/app_factory_audio.cpp
  type APP_AUDIO_CACHE_T (line 34) | enum APP_AUDIO_CACHE_T
  function app_factorymode_data_come (line 37) | static uint32_t app_factorymode_data_come(uint8_t *buf, uint32_t len) {
  function app_factorymode_more_data (line 47) | static uint32_t app_factorymode_more_data(uint8_t *buf, uint32_t len) {
  function app_factorymode_audioloop (line 56) | int app_factorymode_audioloop(bool on, enum APP_SYSFREQ_FREQ_T freq) {
  function app_factorymode_output_pcmpatten (line 130) | int app_factorymode_output_pcmpatten(audio_test_pcmpatten_t *pcmpatten,
  type mic_st_t (line 172) | struct mic_st_t {
  function app_factorymode_mic_cancellation_run (line 184) | int app_factorymode_mic_cancellation_run(void *mic_st, signed short *inbuf,
  type mic_st_t (line 281) | struct mic_st_t
  type mic_st_t (line 282) | struct mic_st_t
  type mic_st_t (line 282) | struct mic_st_t

FILE: apps/factory/app_factory_audio.h
  type audio_test_pcmpatten_t (line 21) | typedef struct {
  type APP_SYSFREQ_FREQ_T (line 27) | enum APP_SYSFREQ_FREQ_T

FILE: apps/factory/app_factory_bt.cpp
  function bt_error_check_timer_handler (line 49) | static void bt_error_check_timer_handler(void const *param) {
  function app_factorymode_bt_inquiry_buff_update (line 65) | static void app_factorymode_bt_inquiry_buff_update(void) {
  function app_factorymode_CmgrCallback (line 77) | static void app_factorymode_CmgrCallback(btif_cmgr_handler_t *cHandler,
  function app_factorymode_bt_InquiryResult_add (line 103) | static void app_factorymode_bt_InquiryResult_add(void) {
  function app_factorymode_bt_create_connect (line 115) | void app_factorymode_bt_create_connect(void) {
  function app_factorymode_bt_init_connect (line 123) | void app_factorymode_bt_init_connect(void) {
  function app_factorymode_bt_xtalrangetest (line 140) | void app_factorymode_bt_xtalrangetest(APP_KEY_STATUS *status, void *para...
  function app_factorymode_bt_signalingtest (line 189) | void app_factorymode_bt_signalingtest(APP_KEY_STATUS *status, void *para...
  function app_factorymode_bt_nosignalingtest (line 242) | void app_factorymode_bt_nosignalingtest(APP_KEY_STATUS *status, void *pa...
  function app_factorymode_bt_xtalcalib_proc (line 294) | int app_factorymode_bt_xtalcalib_proc(void) {
  function app_factorymode_bt_xtalcalib (line 318) | void app_factorymode_bt_xtalcalib(APP_KEY_STATUS *status, void *param) {

FILE: apps/factory/app_factory_cdc_comm.c
  type PARSE_STATE (line 11) | enum PARSE_STATE
  type message_t (line 12) | struct message_t
  type message_t (line 13) | struct message_t
  function check_sum (line 19) | static unsigned char check_sum(unsigned char *buf, unsigned char len) {
  function send_reply (line 30) | int send_reply(const unsigned char *payload, unsigned int len) {
  function reset_parse_state (line 50) | static void reset_parse_state(unsigned char **buf, size_t *len) {
  function check_msg_hdr (line 58) | static enum ERR_CODE check_msg_hdr(void) {
  function handle_sys_cmd (line 91) | static enum ERR_CODE handle_sys_cmd(enum SYS_CMD_TYPE cmd, unsigned char...
  function handle_data (line 153) | static enum ERR_CODE handle_data(unsigned char **buf, size_t *len, int *...
  function parse_packet (line 212) | static int parse_packet(unsigned char **buf, size_t *len) {
  function comm_loop (line 267) | void comm_loop(void) {

FILE: apps/factory/sys_api_cdc_comm.c
  type USB_SERIAL_CFG_T (line 29) | struct USB_SERIAL_CFG_T
  function reset_transport (line 33) | void reset_transport(void) {
  function set_recv_timeout (line 48) | void set_recv_timeout(unsigned int timeout) { recv_timeout = timeout; }
  function set_send_timeout (line 50) | void set_send_timeout(unsigned int timeout) { send_timeout = timeout; }
  function usb_send_timeout (line 52) | static void usb_send_timeout(void *param) { usb_serial_cancel_send(); }
  function usb_send_timer_start (line 54) | static void usb_send_timer_start(void) {
  function usb_send_timer_stop (line 64) | static void usb_send_timer_stop(void) {
  function usb_send_data (line 70) | static int usb_send_data(const unsigned char *buf, size_t len) {
  function send_data (line 79) | int send_data(const unsigned char *buf, size_t len) {
  function usb_recv_timeout (line 86) | static void usb_recv_timeout(void *param) { usb_serial_cancel_recv(); }
  function usb_recv_timer_start (line 88) | static void usb_recv_timer_start(void) {
  function usb_recv_timer_stop (line 98) | static void usb_recv_timer_stop(void) {
  function usb_recv_data (line 104) | static int usb_recv_data(unsigned char *buf, size_t len, size_t *rlen) {
  function recv_data_ex (line 116) | int recv_data_ex(unsigned char *buf, size_t len, size_t expect, size_t *...
  function usb_handle_error (line 123) | static int usb_handle_error(void) {
  function handle_error (line 136) | int handle_error(void) {
  function usb_cancel_input (line 163) | static int usb_cancel_input(void) { return usb_serial_flush_recv_buffer(...
  function cancel_input (line 165) | int cancel_input(void) { return usb_cancel_input(); }
  function system_reboot (line 167) | void system_reboot(void) {
  function system_shutdown (line 172) | void system_shutdown(void) {
  function system_set_bootmode (line 183) | void system_set_bootmode(unsigned int bootmode) {
  function system_clear_bootmode (line 188) | void system_clear_bootmode(unsigned int bootmode) {
  function system_get_bootmode (line 193) | unsigned int system_get_bootmode(void) { return hal_sw_bootmode_get(); }

FILE: apps/key/app_key.cpp
  function key_event_process (line 37) | static int key_event_process(uint32_t key_code, uint8_t key_event) {
  function app_key_simulate_key_event (line 56) | void app_key_simulate_key_event(uint32_t key_code, uint8_t key_event) {
  function app_key_handle_free (line 60) | static void app_key_handle_free(void *key_handle) {
  function APP_KEY_HANDLE (line 64) | static APP_KEY_HANDLE *app_key_handle_find(const APP_KEY_STATUS *key_sta...
  function app_key_handle_process (line 79) | static int app_key_handle_process(APP_MESSAGE_BODY *msg_body) {
  function app_key_handle_registration (line 99) | int app_key_handle_registration(const APP_KEY_HANDLE *key_handle) {
  function app_key_handle_clear (line 125) | void app_key_handle_clear(void) { list_clear(app_key_conifg.key_list); }
  function app_key_open (line 127) | int app_key_open(int checkPwrKey) {
  function app_key_close (line 141) | int app_key_close(void) {
  function app_key_read_status (line 149) | uint32_t app_key_read_status(uint32_t code) {
  function simul_key_event_process (line 154) | int simul_key_event_process(uint32_t key_code, uint8_t key_event) {

FILE: apps/key/app_key.h
  type APP_KEY_CODE_T (line 34) | enum APP_KEY_CODE_T {
  type APP_KEY_EVENT_T (line 54) | enum APP_KEY_EVENT_T {
  type APP_KEY_STATUS (line 85) | typedef struct {
  type APP_KEY_HANDLE (line 92) | typedef struct {

FILE: apps/main/app_status_ind.h
  type APP_STATUS_INDICATION_T (line 27) | typedef enum APP_STATUS_INDICATION_T {

FILE: apps/main/apps.cpp
  type APP_POWERON_CASE_T (line 59) | enum APP_POWERON_CASE_T {
  function anc_single_mode_is_on (line 78) | bool anc_single_mode_is_on(void) { return anc_single_mode_on; }
  type APP_POWERON_CASE_T (line 90) | enum APP_POWERON_CASE_T
  function app_status_indication_init (line 93) | static uint8_t app_status_indication_init(void) {
  function app_stop_10_second_timer (line 140) | void app_stop_10_second_timer(uint8_t timer_id) {
  function app_start_10_second_timer (line 147) | void app_start_10_second_timer(uint8_t timer_id) {
  function app_set_10_second_timer (line 154) | void app_set_10_second_timer(uint8_t timer_id, uint8_t enable, uint8_t p...
  function app_10_second_timer_check (line 161) | void app_10_second_timer_check(void) {
  function CloseEarphone (line 178) | void CloseEarphone(void) {
  function app_notify_stack_ready (line 199) | void app_notify_stack_ready(uint8_t ready_flag) {
  function app_is_stack_ready (line 212) | bool app_is_stack_ready(void) {
  function app_stack_ready_cb (line 226) | static void app_stack_ready_cb(void) {
  function app_status_battery_report (line 240) | int app_status_battery_report(uint8_t level) {
  function app_bt_power_off_customize (line 275) | void app_bt_power_off_customize() {
  function app_status_set_num (line 284) | void app_status_set_num(const char *p) { media_Set_IncomingNumber(p); }
  function app_voice_report_handler (line 287) | int app_voice_report_handler(APP_STATUS_INDICATION_T status, uint8_t dev...
  function app_voice_report (line 446) | int app_voice_report(APP_STATUS_INDICATION_T status,
  function app_voice_report_generic (line 451) | int app_voice_report_generic(APP_STATUS_INDICATION_T status,
  function app_voice_stop (line 456) | int app_voice_stop(APP_STATUS_INDICATION_T status,
  function app_poweron_normal (line 474) | static void app_poweron_normal(APP_KEY_STATUS *status, void *param) {
  function app_poweron_scan (line 480) | static void app_poweron_scan(APP_KEY_STATUS *status, void *param) {
  function app_poweron_factorymode (line 490) | static void app_poweron_factorymode(APP_KEY_STATUS *status, void *param)
  function app_poweron_finished (line 501) | static void app_poweron_finished(APP_KEY_STATUS *status, void *param) {
  function app_poweron_wait_finished (line 508) | void app_poweron_wait_finished(void) {
  function app_poweron_key_init (line 562) | static void app_poweron_key_init(void) {
  function app_poweron_wait_case (line 572) | static uint8_t app_poweron_wait_case(void) {
  function app_wait_stack_ready (line 592) | static void app_wait_stack_ready(void) {
  function app_shutdown (line 603) | int app_shutdown(void) {
  function app_reset (line 609) | int app_reset(void) {
  function app_postponed_reset_timer_handler (line 618) | static void app_postponed_reset_timer_handler(void const *param) {
  function app_start_postponed_reset (line 623) | void app_start_postponed_reset(void) {
  function app_bt_key_shutdown (line 634) | void app_bt_key_shutdown(APP_KEY_STATUS *status, void *param) {
  function app_bt_key_enter_testmode (line 644) | void app_bt_key_enter_testmode(APP_KEY_STATUS *status, void *param) {
  function app_bt_key_enter_nosignal_mode (line 654) | void app_bt_key_enter_nosignal_mode(APP_KEY_STATUS *status, void *param) {
  function app_otaMode_enter (line 668) | void app_otaMode_enter(APP_KEY_STATUS *status, void *param) {
  function app_usb_cdc_comm_key_handler (line 683) | void app_usb_cdc_comm_key_handler(APP_KEY_STATUS *status, void *param) {
  function app_dfu_key_handler (line 693) | void app_dfu_key_handler(APP_KEY_STATUS *status, void *param)
  function app_dfu_key_handler (line 702) | void app_dfu_key_handler(APP_KEY_STATUS *status, void *param) {
  function app_ota_key_handler (line 712) | void app_ota_key_handler(APP_KEY_STATUS *status, void *param) {
  function app_voice_assistant_key (line 819) | void app_voice_assistant_key(APP_KEY_STATUS *status, void *param) {
  function app_voice_gva_onoff_key (line 859) | void app_voice_gva_onoff_key(APP_KEY_STATUS *status, void *param) {
  function app_voice_ama_onoff_key (line 873) | void app_voice_ama_onoff_key(APP_KEY_STATUS *status, void *param) {
  function app_btusb_audio_dual_mode_test (line 890) | void app_btusb_audio_dual_mode_test(APP_KEY_STATUS *status, void *param) {
  function app_switch_dualmic_key (line 898) | void app_switch_dualmic_key(APP_KEY_STATUS *status, void *param) {
  type BT_DEVICE_T (line 1221) | struct BT_DEVICE_T
  function delay_report_toneinit (line 1230) | void delay_report_toneinit(void) {
  function delay_report_tonefun (line 1234) | static void delay_report_tonefun(const void *) {
  function startdelay_report_tone (line 1264) | void startdelay_report_tone(int ms, APP_STATUS_INDICATION_T status) {
  function low_latlatency_delay_switchinit (line 1280) | void low_latlatency_delay_switchinit(void) {
  function app_ibrt_ui_test_mtu_change_sync_notify (line 1285) | void app_ibrt_ui_test_mtu_change_sync_notify(void) {
  function low_latlatency_delay_switchfun (line 1305) | static void low_latlatency_delay_switchfun(const void *) {
  function startlow_latlatency_delay_switch (line 1323) | void startlow_latlatency_delay_switch(int ms) {
  function stoplow_latlatency_delay_switch (line 1327) | void stoplow_latlatency_delay_switch(void) {
  function app_latency_switch_key_handler (line 1333) | void app_latency_switch_key_handler(void) {
  function app_enterpairing_timehandler (line 1361) | static void app_enterpairing_timehandler(void const *param) {
  function app_enterpairing_timer_start (line 1423) | void app_enterpairing_timer_start(void) {
  function app_enterpairing_timer_stop (line 1437) | void app_enterpairing_timer_stop(void) {
  function app_enterpairing_timer_open (line 1442) | void app_enterpairing_timer_open(void) {
  function Auto_Shutdowm_Timerinit (line 1457) | void Auto_Shutdowm_Timerinit(void) {
  type btdevice_volume (line 1462) | struct btdevice_volume
  function Auto_Shutdowm_Timerfun (line 1464) | static void Auto_Shutdowm_Timerfun(const void *) {
  function startAuto_Shutdowm_Timer (line 1538) | void startAuto_Shutdowm_Timer(int ms) {
  function stopAuto_Shutdowm_Timer (line 1541) | void stopAuto_Shutdowm_Timer(void) {
  function once_delay_event_Timer_init (line 1555) | void once_delay_event_Timer_init(void) {
  function once_delay_event_Timer_fun (line 1560) | static void once_delay_event_Timer_fun(const void *) {
  function startonce_delay_event_Timer_ (line 1629) | void startonce_delay_event_Timer_(int ms) {
  function stoponce_delay_event_Timer_ (line 1633) | void stoponce_delay_event_Timer_(void) {
  function app_is_power_off_in_progress (line 1644) | bool app_is_power_off_in_progress(void) {
  function app_gfps_battery_show_timeout_timer_cb (line 1655) | static void app_gfps_battery_show_timeout_timer_cb(void const *n) {
  function app_gfps_battery_show_timer_start (line 1660) | void app_gfps_battery_show_timer_start() {
  function app_gfps_battery_show_timer_stop (line 1667) | void app_gfps_battery_show_timer_stop() {
  function app_deinit (line 1673) | int app_deinit(int deinit_case) {
  function app_bt_connect2tester_init (line 1726) | int app_bt_connect2tester_init(void) {
  function app_nvrecord_rebuild (line 1768) | int app_nvrecord_rebuild(void) {
  function app_usbaudio_entry (line 1790) | void app_usbaudio_entry(void) {
  function app_usbaudio_mode_on (line 1795) | bool app_usbaudio_mode_on(void) { return app_usbaudio_mode; }
  function app_usb_key (line 1797) | void app_usb_key(APP_KEY_STATUS *status, void *param) {
  function app_usb_key_init (line 1816) | void app_usb_key_init(void) {
  function cpu_usage_timer_handler (line 1833) | static void cpu_usage_timer_handler(void const *param) {
  function app_ibrt_init (line 1845) | void app_ibrt_init(void) {
  function user_io_timer_init (line 1868) | void user_io_timer_init(void) {
  function app_init (line 1889) | int app_init(void) {

FILE: apps/main/apps_tester.cpp
  function bt_signaling_test (line 46) | void bt_signaling_test(APP_KEY_STATUS *status, void *param) {
  function bt_stack_test (line 54) | void bt_stack_test(APP_KEY_STATUS *status, void *param) {
  function bt_ble_test (line 61) | void bt_ble_test(APP_KEY_STATUS *status, void *param) {
  function bt_test_104m (line 72) | void bt_test_104m(APP_KEY_STATUS *status, void *param) {
  function bt_change_to_iic (line 83) | void bt_change_to_iic(APP_KEY_STATUS *status, void *param) {
  function bt_change_to_uart0 (line 89) | void bt_change_to_uart0(APP_KEY_STATUS *status, void *param) {
  function app_switch_i2c_uart (line 95) | void app_switch_i2c_uart(APP_KEY_STATUS *status, void *param) {
  function test_power_off (line 107) | void test_power_off(APP_KEY_STATUS *status, void *param) {
  function test_bt_key (line 113) | void test_bt_key(APP_KEY_STATUS *status, void *param) {
  function test_sd_card (line 128) | void test_sd_card() {
  type AUD_IO_PATH_T (line 138) | enum AUD_IO_PATH_T
  type AUD_SAMPRATE_T (line 139) | enum AUD_SAMPRATE_T
  function test_codec_loop (line 140) | void test_codec_loop(APP_KEY_STATUS *status, void *param) {
  function test_anc (line 146) | void test_anc(APP_KEY_STATUS *status, void *param) { anc_usb_app((bool)p...
  function test_usb_audio (line 148) | void test_usb_audio(APP_KEY_STATUS *status, void *param) {
  function bt_change_to_jlink (line 155) | void bt_change_to_jlink(APP_KEY_STATUS *status, void *param) {
  function bt_enable_tports (line 161) | void bt_enable_tports(void) {
  function bt_test_dsp_process (line 168) | void bt_test_dsp_process(APP_KEY_STATUS *status, void *param) { da_teste...
  function app_testcase_disp_menu (line 249) | int app_testcase_disp_menu(APP_KEY_HANDLE *testcase, bool printall) {
  function app_testcase_key_response (line 293) | int app_testcase_key_response(APP_MESSAGE_BODY *msg_body) {
  function app_test_init (line 322) | void app_test_init(void) {

FILE: apps/main/gfps.cpp
  function app_tell_battery_info_handler (line 8) | static void app_tell_battery_info_handler(uint8_t *batteryValueCount,
  function app_tell_battery_info_handler (line 40) | static void app_tell_battery_info_handler(uint8_t *batteryValueCount,

FILE: apps/main/ibrt.cpp
  type BT_DEVICE_T (line 5) | struct BT_DEVICE_T
  type HAL_GPIO_PIN_T (line 6) | enum HAL_GPIO_PIN_T
  function Curr_Is_Master (line 8) | bool Curr_Is_Master(void) {
  function Curr_Is_Slave (line 16) | bool Curr_Is_Slave(void) {
  function get_curr_role (line 24) | uint8_t get_curr_role(void) {
  function get_nv_role (line 29) | uint8_t get_nv_role(void) {

FILE: apps/main/key_handler.cpp
  type BT_DEVICE_T (line 60) | struct BT_DEVICE_T
  function send_vol_up (line 94) | void send_vol_up(void) {
  function send_play_pause (line 98) | void send_play_pause(void) {
  function send_vol_down (line 107) | void send_vol_down(void) {
  function send_next_track (line 112) | void send_next_track(void) {
  function send_prev_track (line 117) | void send_prev_track(void) {
  function send_enable_disable_anc (line 122) | void send_enable_disable_anc(void) {
  function app_key_single_tap (line 127) | void app_key_single_tap(APP_KEY_STATUS *status, void *param) {
  function app_key_double_tap (line 149) | void app_key_double_tap(APP_KEY_STATUS *status, void *param) {
  function app_key_triple_tap (line 170) | void app_key_triple_tap(APP_KEY_STATUS *status, void *param) {
  function app_key_quad_tap (line 190) | void app_key_quad_tap(APP_KEY_STATUS *status, void *param) {
  function app_key_long_press_down (line 200) | void app_key_long_press_down(APP_KEY_STATUS *status, void *param) {
  function app_key_reboot (line 213) | void app_key_reboot(APP_KEY_STATUS *status, void *param) {
  function app_key_init (line 218) | void app_key_init(void) {
  function app_key_init_on_charging (line 249) | void app_key_init_on_charging(void) {

FILE: apps/main/led_control.cpp
  function LED_statusinit (line 11) | void LED_statusinit(void) {
  function LED_statusfun (line 15) | void LED_statusfun(const void *) {
  function startLED_status (line 31) | void startLED_status(int ms) {
  function stopLED_status (line 35) | void stopLED_status(void) {

FILE: apps/main/lhdc.cpp
  type bes_bt_local_info_t (line 7) | struct bes_bt_local_info_t {
  function lhdc_license_check (line 21) | void lhdc_license_check() {

FILE: apps/main/rb_codec.cpp
  function app_switch_player_key (line 5) | void app_switch_player_key(APP_KEY_STATUS *status, void *param) {

FILE: apps/mic/app_mic.cpp
  type AF_STREAM_CONFIG_T (line 68) | struct AF_STREAM_CONFIG_T
  function internal_mic_start (line 75) | static int internal_mic_start(MIC_APP_TYPE new_mictype) {
  function internal_mic_stop (line 107) | static int internal_mic_stop(MIC_APP_TYPE new_mictype) {
  function app_mic_process (line 122) | static int app_mic_process(APP_MESSAGE_BODY *msg_body) {
  function app_mic_init (line 149) | void app_mic_init() {
  function app_mic_register (line 154) | int app_mic_register(MIC_APP_TYPE mic_type,
  function app_mic_deregister (line 171) | int app_mic_deregister(MIC_APP_TYPE mic_type) {
  function app_mic_is_registed (line 182) | bool app_mic_is_registed(MIC_APP_TYPE mic_type) {
  function app_mic_start (line 193) | bool app_mic_start(MIC_APP_TYPE mic_type) {
  function app_mic_stop (line 202) | bool app_mic_stop(MIC_APP_TYPE mic_type) {
  function app_mic_check (line 211) | void app_mic_check(MIC_APP_TYPE mic_type) {
  function MIC_APP_TYPE (line 219) | MIC_APP_TYPE app_mic_status(void) {

FILE: apps/mic/app_mic.h
  type MIC_APP_TYPE (line 35) | typedef enum {
  type AF_STREAM_CONFIG_T (line 51) | struct AF_STREAM_CONFIG_T

FILE: apps/mic_alg/app_mic_alg.cpp
  function clampf (line 74) | static inline float clampf(float v, float min, float max) {
  type APP_AUDIO_CACHE_T (line 86) | enum APP_AUDIO_CACHE_T
  function convert_multiple_to_db (line 146) | static inline double convert_multiple_to_db(uint32_t multiple) {
  function vol_state_process (line 158) | void vol_state_process(uint32_t db_val) {
  function app_mic_alg_data_come (line 171) | static uint32_t app_mic_alg_data_come(uint8_t *buf, uint32_t len) {
  function app_mic_alg_audioloop (line 256) | int app_mic_alg_audioloop(bool on, enum APP_SYSFREQ_FREQ_T freq) {

FILE: apps/mic_alg/app_mic_alg.h
  type APP_SYSFREQ_FREQ_T (line 21) | enum APP_SYSFREQ_FREQ_T

FILE: apps/pwl/app_pwl.cpp
  type APP_PWL_T (line 36) | struct APP_PWL_T {
    type APP_PWL_ID_T (line 37) | enum APP_PWL_ID_T
    type APP_PWL_CFG_T (line 38) | struct APP_PWL_CFG_T
  type APP_PWL_T (line 43) | struct APP_PWL_T
    type APP_PWL_ID_T (line 37) | enum APP_PWL_ID_T
    type APP_PWL_CFG_T (line 38) | struct APP_PWL_CFG_T
  function app_pwl_timehandler (line 45) | static void app_pwl_timehandler(void const *param) {
  function app_pwl_open (line 84) | int app_pwl_open(void) {
  function app_pwl_start (line 106) | int app_pwl_start(enum APP_PWL_ID_T id) {
  function app_pwl_setup (line 153) | int app_pwl_setup(enum APP_PWL_ID_T id, struct APP_PWL_CFG_T *cfg) {
  function app_pwl_stop (line 170) | int app_pwl_stop(enum APP_PWL_ID_T id) {
  function app_pwl_close (line 182) | int app_pwl_close(void) {

FILE: apps/pwl/app_pwl.h
  type APP_PWL_ID_T (line 25) | enum APP_PWL_ID_T {
  type APP_PWL_CFG_T (line 38) | struct APP_PWL_CFG_T {
  type APP_PWL_ID_T (line 50) | enum APP_PWL_ID_T
  type APP_PWL_ID_T (line 52) | enum APP_PWL_ID_T
  type APP_PWL_CFG_T (line 52) | struct APP_PWL_CFG_T
  type APP_PWL_ID_T (line 54) | enum APP_PWL_ID_T

FILE: apps/voice_detector/app_voice_detector.cpp
  function app_voice_detector_process (line 64) | static int app_voice_detector_process(APP_MESSAGE_BODY *msg_body) {
  function voice_detector_send_msg (line 115) | static void voice_detector_send_msg(uint32_t id, uint32_t evt) {
  function voice_detector_wakeup_system (line 125) | static void voice_detector_wakeup_system(int state, void *param) {
  function voice_not_detector_wakeup_system (line 136) | static void voice_not_detector_wakeup_system(int state, void *param) {
  function app_voice_detector_init (line 147) | void app_voice_detector_init(void) {
  function app_voice_detector_open (line 156) | int app_voice_detector_open(enum voice_detector_id id,
  function app_voice_detector_setup_vad (line 178) | int app_voice_detector_setup_vad(enum voice_detector_id id,
  function app_voice_detector_setup_stream (line 194) | int app_voice_detector_setup_stream(enum voice_detector_id id,
  function app_voice_detector_setup_callback (line 211) | int app_voice_detector_setup_callback(enum voice_detector_id id,
  function app_voice_detector_send_event (line 228) | int app_voice_detector_send_event(enum voice_detector_id id,
  function app_voice_detector_close (line 236) | void app_voice_detector_close(enum voice_detector_id id) {
  function app_voice_detector_capture_start (line 242) | void app_voice_detector_capture_start(enum voice_detector_id id) {
  function app_voice_detector_get_vad_data_info (line 248) | void app_voice_detector_get_vad_data_info(

FILE: apps/voice_detector/app_voice_detector.h
  type voice_detector_evt (line 12) | enum voice_detector_evt {
  type voice_detector_id (line 31) | enum voice_detector_id
  type AUD_VAD_TYPE_T (line 31) | enum AUD_VAD_TYPE_T
  type voice_detector_id (line 39) | enum voice_detector_id
  type AUD_VAD_CONFIG_T (line 40) | struct AUD_VAD_CONFIG_T
  type voice_detector_id (line 47) | enum voice_detector_id
  type AUD_STREAM_T (line 48) | enum AUD_STREAM_T
  type AF_STREAM_CONFIG_T (line 49) | struct AF_STREAM_CONFIG_T
  type voice_detector_id (line 76) | enum voice_detector_id
  type voice_detector_cb_id (line 77) | enum voice_detector_cb_id
  type voice_detector_id (line 85) | enum voice_detector_id
  type voice_detector_evt (line 86) | enum voice_detector_evt
  type voice_detector_id (line 91) | enum voice_detector_id
  type voice_detector_id (line 96) | enum voice_detector_id
  type voice_detector_id (line 101) | enum voice_detector_id
  type CODEC_VAD_BUF_INFO_T (line 101) | struct CODEC_VAD_BUF_INFO_T

FILE: apps/voice_detector/voice_detector.c
  type command_queue (line 45) | struct command_queue {
  type voice_detector_dev (line 51) | struct voice_detector_dev {
  type voice_detector_dev (line 67) | struct voice_detector_dev
  type voice_detector_dev (line 84) | struct voice_detector_dev
  type voice_detector_cb_id (line 85) | enum voice_detector_cb_id
  function cmd_queue_enqueue (line 89) | static int cmd_queue_enqueue(struct command_queue *q, int c) {
  function cmd_queue_dequeue (line 102) | static int cmd_queue_dequeue(struct command_queue *q) {
  function cmd_queue_is_empty (line 121) | static int cmd_queue_is_empty(struct command_queue *q) {
  function voice_detector_init_cmd_queue (line 125) | static void voice_detector_init_cmd_queue(struct command_queue *q) {
  function voice_detector_init_vad (line 132) | static void voice_detector_init_vad(struct AUD_VAD_CONFIG_T *c, int id,
  function voice_detector_open (line 167) | int voice_detector_open(enum voice_detector_id id,
  function voice_detector_close (line 199) | void voice_detector_close(enum voice_detector_id id) {
  function voice_detector_setup_vad (line 216) | int voice_detector_setup_vad(enum voice_detector_id id,
  function voice_detector_setup_stream (line 239) | int voice_detector_setup_stream(enum voice_detector_id id,
  function voice_detector_setup_callback (line 263) | int voice_detector_setup_callback(enum voice_detector_id id,
  function voice_detector_send_cmd (line 288) | int voice_detector_send_cmd(enum voice_detector_id id,
  function voice_detector_send_cmd_array (line 303) | int voice_detector_send_cmd_array(enum voice_detector_id id, int *cmd_ar...
  function voice_detector_query_status (line 322) | enum voice_detector_state
  function voice_detector_vad_callback (line 335) | static void voice_detector_vad_callback(int found) {
  function voice_detector_vad_open (line 357) | static int voice_detector_vad_open(struct voice_detector_dev *pdev) {
  function voice_detector_vad_start (line 370) | static int voice_detector_vad_start(struct voice_detector_dev *pdev) {
  function voice_detector_vad_stop (line 380) | static int voice_detector_vad_stop(struct voice_detector_dev *pdev) {
  function voice_detector_get_vad_data_info (line 401) | void voice_detector_get_vad_data_info(
  function voice_detector_vad_close (line 414) | static int voice_detector_vad_close(struct voice_detector_dev *pdev) {
  function voice_detector_aud_cap_open (line 422) | static int voice_detector_aud_cap_open(struct voice_detector_dev *pdev) {
  function voice_detector_aud_cap_start (line 433) | static int voice_detector_aud_cap_start(struct voice_detector_dev *pdev) {
  function voice_detector_aud_cap_stop (line 438) | static int voice_detector_aud_cap_stop(struct voice_detector_dev *pdev) {
  function voice_detector_aud_cap_close (line 443) | static int voice_detector_aud_cap_close(struct voice_detector_dev *pdev) {
  function voice_detector_sys_clk (line 448) | static int voice_detector_sys_clk(struct voice_detector_dev *pdev) {
  function voice_detector_exit (line 461) | static int voice_detector_exit(struct voice_detector_dev *pdev) {
  function voice_detector_idle (line 466) | static int voice_detector_idle(struct voice_detector_dev *pdev) {
  type cmd_vector (line 471) | struct cmd_vector {
  type cmd_vector (line 477) | struct cmd_vector
  function voice_detector_process_cmd (line 494) | static int voice_detector_process_cmd(struct voice_detector_dev *pdev,
  function voice_detector_set_status (line 520) | static void voice_detector_set_status(struct voice_detector_dev *pdev,
  function voice_detector_exec_callback (line 532) | static void voice_detector_exec_callback(struct voice_detector_dev *pdev,
  function voice_detector_enhance_perform (line 544) | int voice_detector_enhance_perform(enum voice_detector_id id) {
  function voice_detector_run (line 553) | int voice_detector_run(enum voice_detector_id id, int continous) {
  function voice_detector_send_evt (line 631) | static void voice_detector_send_evt(uint32_t evt) { voice_det_evt = evt; }
  function print_vad_raw_data (line 633) | static void print_vad_raw_data(uint8_t *buf, uint32_t len) {
  function dc_filter_f (line 639) | void dc_filter_f(short *in, int len, float left_gain, float right_gain) {
  function mic_data_come (line 649) | static uint32_t mic_data_come(uint8_t *buf, uint32_t len) {
  function CSpotter_Init_bes (line 695) | static int CSpotter_Init_bes() {
  function cmd_wait_handler (line 743) | static void cmd_wait_handler(int state, void *param) {
  function cmd_done_handler (line 753) | static void cmd_done_handler(int state, void *param) {
  function cpu_det_find_wakeup_handler (line 757) | static void cpu_det_find_wakeup_handler(int state, void *param) {
  function cpu_det_notfind_wakeup_handler (line 768) | static void cpu_det_notfind_wakeup_handler(int state, void *param) {
  function voice_detector_test (line 777) | void voice_detector_test(void) {

FILE: apps/voice_detector/voice_detector.h
  type voice_detector_id (line 11) | enum voice_detector_id {
  type voice_detector_cmd (line 23) | enum voice_detector_cmd {
  type voice_detector_state (line 41) | enum voice_detector_state {
  type voice_detector_mode (line 59) | enum voice_detector_mode {
  type voice_detector_cb_id (line 66) | enum voice_detector_cb_id {
  type voice_detector_id (line 106) | enum voice_detector_id
  type AUD_VAD_TYPE_T (line 106) | enum AUD_VAD_TYPE_T
  type voice_detector_id (line 113) | enum voice_detector_id
  type AUD_VAD_CONFIG_T (line 113) | struct AUD_VAD_CONFIG_T
  type voice_detector_id (line 121) | enum voice_detector_id
  type AUD_STREAM_T (line 122) | enum AUD_STREAM_T
  type AF_STREAM_CONFIG_T (line 122) | struct AF_STREAM_CONFIG_T
  type voice_detector_id (line 134) | enum voice_detector_id
  type voice_detector_cb_id (line 135) | enum voice_detector_cb_id
  type voice_detector_state (line 143) | enum voice_detector_state
  type voice_detector_id (line 143) | enum voice_detector_id
  type voice_detector_id (line 149) | enum voice_detector_id
  type voice_detector_id (line 156) | enum voice_detector_id
  type voice_detector_cmd (line 156) | enum voice_detector_cmd
  type voice_detector_id (line 163) | enum voice_detector_id
  type voice_detector_id (line 165) | enum voice_detector_id
  type voice_detector_id (line 178) | enum voice_detector_id
  type voice_detector_id (line 183) | enum voice_detector_id
  type voice_detector_id (line 188) | enum voice_detector_id
  type CODEC_VAD_BUF_INFO_T (line 188) | struct CODEC_VAD_BUF_INFO_T

FILE: config/_default_cfg_src_/app_status_ind.c
  function app_status_indication_filter_set (line 79) | int app_status_indication_filter_set(APP_STATUS_INDICATION_T status) {
  function APP_STATUS_INDICATION_T (line 84) | APP_STATUS_INDICATION_T app_status_indication_get(void) { return app_sta...
  function app_status_indication_set (line 86) | int app_status_indication_set(APP_STATUS_INDICATION_T status) {

FILE: config/_default_cfg_src_/tgt_hardware.c
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 18) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 27) | struct HAL_KEY_GPIOKEY_CFG_T
  type CODEC_DAC_VOL_T (line 58) | struct CODEC_DAC_VOL_T
  type AUD_IO_PATH_CFG_T (line 76) | struct AUD_IO_PATH_CFG_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 92) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 96) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 100) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/_default_cfg_src_/tgt_hardware.h
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 30) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 44) | struct HAL_KEY_GPIOKEY_CFG_T
  type AUD_IO_PATH_CFG_T (line 48) | struct AUD_IO_PATH_CFG_T
  type CODEC_DAC_VOL_T (line 63) | struct CODEC_DAC_VOL_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 76) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 77) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 78) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/bak_open/tgt_hardware.c
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 23) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 33) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 44) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 64) | struct HAL_KEY_GPIOKEY_CFG_T
  type CODEC_DAC_VOL_T (line 133) | struct CODEC_DAC_VOL_T
  type AUD_IO_PATH_CFG_T (line 168) | struct AUD_IO_PATH_CFG_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 200) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 204) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 208) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 219) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 223) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/bak_open/tgt_hardware.h
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 47) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 49) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 53) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 83) | struct HAL_KEY_GPIOKEY_CFG_T
  type AUD_IO_PATH_CFG_T (line 106) | struct AUD_IO_PATH_CFG_T
  type CODEC_DAC_VOL_T (line 121) | struct CODEC_DAC_VOL_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 134) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 135) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 136) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 142) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 143) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/best2300p_ibrt/tgt_hardware.c
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 23) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 33) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 44) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 64) | struct HAL_KEY_GPIOKEY_CFG_T
  type CODEC_DAC_VOL_T (line 132) | struct CODEC_DAC_VOL_T
  type AUD_IO_PATH_CFG_T (line 167) | struct AUD_IO_PATH_CFG_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 199) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 203) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 207) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 211) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 223) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 227) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  function tgt_tws_get_channel_is_right (line 230) | bool tgt_tws_get_channel_is_right(void) {

FILE: config/best2300p_ibrt/tgt_hardware.h
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 47) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 49) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 53) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 83) | struct HAL_KEY_GPIOKEY_CFG_T
  type AUD_IO_PATH_CFG_T (line 106) | struct AUD_IO_PATH_CFG_T
  type CODEC_DAC_VOL_T (line 121) | struct CODEC_DAC_VOL_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 134) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 135) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 136) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 138) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 139) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 144) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 145) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/best2300p_ibrt_anc/tgt_hardware.c
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 24) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 45) | struct HAL_KEY_GPIOKEY_CFG_T
  type CODEC_DAC_VOL_T (line 125) | struct CODEC_DAC_VOL_T
  type AUD_IO_PATH_CFG_T (line 155) | struct AUD_IO_PATH_CFG_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 184) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 188) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 192) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/best2300p_ibrt_anc/tgt_hardware.h
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 37) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 59) | struct HAL_KEY_GPIOKEY_CFG_T
  type AUD_IO_PATH_CFG_T (line 84) | struct AUD_IO_PATH_CFG_T
  type CODEC_DAC_VOL_T (line 99) | struct CODEC_DAC_VOL_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 112) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 113) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 114) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/mic_alg/tgt_hardware.c
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 23) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 33) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 44) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 64) | struct HAL_KEY_GPIOKEY_CFG_T
  type CODEC_DAC_VOL_T (line 132) | struct CODEC_DAC_VOL_T
  type AUD_IO_PATH_CFG_T (line 167) | struct AUD_IO_PATH_CFG_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 199) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 203) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 207) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 211) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 215) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 227) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 231) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  function tgt_tws_get_channel_is_right (line 234) | bool tgt_tws_get_channel_is_right(void) {

FILE: config/mic_alg/tgt_hardware.h
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 47) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 49) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 53) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 83) | struct HAL_KEY_GPIOKEY_CFG_T
  type AUD_IO_PATH_CFG_T (line 106) | struct AUD_IO_PATH_CFG_T
  type CODEC_DAC_VOL_T (line 121) | struct CODEC_DAC_VOL_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 134) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 135) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 136) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 138) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 139) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 144) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 145) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/open_source/tgt_hardware.c
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 54) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 64) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 75) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 95) | struct HAL_KEY_GPIOKEY_CFG_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 156) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  function tgt_tws_get_channel_is_right (line 160) | bool tgt_tws_get_channel_is_right(void) {
  type CODEC_DAC_VOL_T (line 181) | struct CODEC_DAC_VOL_T
  type AUD_IO_PATH_CFG_T (line 217) | struct AUD_IO_PATH_CFG_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 240) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 244) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 248) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: config/open_source/tgt_hardware.h
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 47) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 49) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 53) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_KEY_GPIOKEY_CFG_T (line 83) | struct HAL_KEY_GPIOKEY_CFG_T
  type AUD_IO_PATH_CFG_T (line 121) | struct AUD_IO_PATH_CFG_T
  type CODEC_DAC_VOL_T (line 136) | struct CODEC_DAC_VOL_T
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 149) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 150) | struct HAL_IOMUX_PIN_FUNCTION_MAP
  type HAL_IOMUX_PIN_FUNCTION_MAP (line 151) | struct HAL_IOMUX_PIN_FUNCTION_MAP

FILE: dev_tools/anc_decoder/src/main.rs
  constant AUDIO_START (line 8) | const AUDIO_START: usize = 0x003EE000;
  constant AUDIO_LEN (line 9) | const AUDIO_LEN: usize = 16;
  constant AUD_IIR_NUM (line 10) | const AUD_IIR_NUM: usize = 8;
  constant AUD_COEF_LEN (line 11) | const AUD_COEF_LEN: usize = 0;
  type AudSectionHead (line 14) | struct AudSectionHead {
  type AudSectionBodyIdent (line 27) | struct AudSectionBodyIdent {
  type anc_iir_coefs (line 34) | struct anc_iir_coefs {
  type aud_item (line 41) | struct aud_item {
  type struct_anc_cfg (line 73) | struct struct_anc_cfg {
  type pctool_struct_anc_cfg (line 87) | struct pctool_struct_anc_cfg {
  type AudSectionBodyConfig (line 93) | struct AudSectionBodyConfig {
  type AudSectionBody (line 97) | struct AudSectionBody {
  type PctoolAudSection (line 102) | struct PctoolAudSection {
  function main (line 107) | fn main() {
  function get_firmware_file (line 124) | fn get_firmware_file(filename: &str) -> Vec<u8> {

FILE: include/rtos/freertos/FreeRTOS.h
  type xSTATIC_LIST_ITEM (line 963) | struct xSTATIC_LIST_ITEM
  type StaticListItem_t (line 968) | typedef struct xSTATIC_LIST_ITEM StaticListItem_t;
  type xSTATIC_MINI_LIST_ITEM (line 971) | struct xSTATIC_MINI_LIST_ITEM
  type StaticMiniListItem_t (line 976) | typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;
  type StaticList_t (line 979) | typedef struct xSTATIC_LIST
  type StaticTask_t (line 999) | typedef struct xSTATIC_TCB
  type StaticQueue_t (line 1063) | typedef struct xSTATIC_QUEUE
  type StaticQueue_t (line 1091) | typedef StaticQueue_t StaticSemaphore_t;
  type StaticEventGroup_t (line 1107) | typedef struct xSTATIC_EVENT_GROUP
  type StaticTimer_t (line 1136) | typedef struct xSTATIC_TIMER
  type StaticStreamBuffer_t (line 1168) | typedef struct xSTATIC_STREAM_BUFFER
  type StaticStreamBuffer_t (line 1179) | typedef StaticStreamBuffer_t StaticMessageBuffer_t;

FILE: include/rtos/freertos/cmsis_os.h
  type osPriority (line 184) | typedef enum {
  type os_timer_type (line 207) | typedef enum {
  type osStatus (line 220) | typedef enum {
  type osStatus (line 238) | typedef int32_t                  osStatus;
  type osThreadDef_t (line 294) | typedef struct os_thread_def {
  type osThreadDef_t (line 301) | typedef struct os_thread_def {
  type osTimerDef_t (line 309) | typedef struct os_timer_def {
  type osTimerDef_t (line 313) | typedef struct os_timer_def {
  type osMutexDef_t (line 321) | typedef struct os_mutex_def {
  type osSemaphoreDef_t (line 331) | typedef struct os_semaphore_def {
  type osPoolDef_t (line 342) | typedef struct os_pool_def {
  type osPoolDef_t (line 348) | typedef struct os_pool_def {
  type osMessageQDef_t (line 357) | typedef struct os_messageQ_def {
  type osMessageQDef_t (line 362) | typedef struct os_messageQ_def {
  type osMailQDef_t (line 370) | typedef struct os_mailQ_def {
  type osMailQDef_t (line 376) | typedef struct os_mailQ_def {
  type osEvent (line 388) | typedef struct {

FILE: include/rtos/freertos/cmsis_os2.h
  type osVersion_t (line 76) | typedef struct {
  type osKernelState_t (line 82) | typedef enum {
  type osThreadState_t (line 93) | typedef enum {
  type osPriority_t (line 104) | typedef enum {
  type osTimerType_t (line 167) | typedef enum {
  type osStatus_t (line 198) | typedef enum {
  type TZ_ModuleId_t (line 235) | typedef uint32_t TZ_ModuleId_t;
  type osThreadAttr_t (line 240) | typedef struct {
  type osTimerAttr_t (line 253) | typedef struct {
  type osEventFlagsAttr_t (line 261) | typedef struct {
  type osMutexAttr_t (line 269) | typedef struct {
  type osSemaphoreAttr_t (line 278) | typedef struct {
  type osMemoryPoolAttr_t (line 287) | typedef struct {
  type osMessageQueueAttr_t (line 297) | typedef struct {

FILE: include/rtos/freertos/croutine.h
  type CRCB_t (line 48) | typedef struct corCoRoutineControlBlock

FILE: include/rtos/freertos/event_groups.h
  type EventGroupDef_t (line 81) | struct EventGroupDef_t
  type EventGroupDef_t (line 82) | struct EventGroupDef_t
  type TickType_t (line 92) | typedef TickType_t EventBits_t;

FILE: include/rtos/freertos/freertos_list.h
  type xLIST (line 139) | struct xLIST
  type xLIST_ITEM (line 140) | struct xLIST_ITEM
  type ListItem_t (line 150) | typedef struct xLIST_ITEM ListItem_t;
  type xMINI_LIST_ITEM (line 152) | struct xMINI_LIST_ITEM
  type MiniListItem_t (line 159) | typedef struct xMINI_LIST_ITEM MiniListItem_t;

FILE: include/rtos/freertos/portable.h
  type HeapRegion_t (line 106) | typedef struct HeapRegion
  type xMEMORY_REGION (line 156) | struct xMEMORY_REGION
  type xMEMORY_REGION (line 157) | struct xMEMORY_REGION

FILE: include/rtos/freertos/portmacro.h
  type portSTACK_TYPE (line 55) | typedef portSTACK_TYPE StackType_t;
  type BaseType_t (line 56) | typedef long BaseType_t;
  type UBaseType_t (line 57) | typedef unsigned long UBaseType_t;
  type TickType_t (line 60) | typedef uint16_t TickType_t;
  type TickType_t (line 63) | typedef uint32_t TickType_t;
  function ucPortCountLeadingZeros (line 146) | __attribute__( ( always_inline ) ) static inline uint8_t ucPortCountLead...
  function portFORCE_INLINE (line 185) | portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt( void )
  function portFORCE_INLINE (line 207) | portFORCE_INLINE static void vPortRaiseBASEPRI( void )
  function portFORCE_INLINE (line 221) | portFORCE_INLINE static uint32_t ulPortRaiseBASEPRI( void )
  function portFORCE_INLINE (line 241) | portFORCE_INLINE static void vPortSetBASEPRI( uint32_t ulNewMaskValue )

FILE: include/rtos/freertos/queue.h
  type QueueDefinition (line 47) | struct QueueDefinition
  type QueueDefinition (line 48) | struct QueueDefinition
  type QueueDefinition (line 55) | struct QueueDefinition
  type QueueDefinition (line 62) | struct QueueDefinition

FILE: include/rtos/freertos/semphr.h
  type QueueHandle_t (line 37) | typedef QueueHandle_t SemaphoreHandle_t;

FILE: include/rtos/freertos/stream_buffer.h
  type StreamBufferDef_t (line 64) | struct StreamBufferDef_t
  type StreamBufferDef_t (line 65) | struct StreamBufferDef_t

FILE: include/rtos/freertos/task.h
  type tskTaskControlBlock (line 61) | struct tskTaskControlBlock
  type tskTaskControlBlock (line 62) | struct tskTaskControlBlock
  type BaseType_t (line 68) | typedef BaseType_t (*TaskHookFunction_t)( void * );
  type eTaskState (line 71) | typedef enum
  type eNotifyAction (line 82) | typedef enum
  type TimeOut_t (line 94) | typedef struct xTIME_OUT
  type MemoryRegion_t (line 103) | typedef struct xMEMORY_REGION
  type TaskParameters_t (line 113) | typedef struct xTASK_PARAMETERS
  type TaskStatus_t (line 129) | typedef struct xTASK_STATUS
  type eSleepModeStatus (line 143) | typedef enum

FILE: include/rtos/freertos/timers.h
  type tmrTimerControl (line 76) | struct tmrTimerControl
  type tmrTimerControl (line 77) | struct tmrTimerControl

FILE: include/rtos/rtx/cmsis_os.h
  type osPriority (line 163) | typedef enum  {
  type osStatus (line 180) | typedef enum  {
  type os_timer_type (line 201) | typedef enum  {
  type os_thread_cb (line 218) | struct os_thread_cb
  type os_timer_cb (line 222) | struct os_timer_cb
  type os_mutex_cb (line 226) | struct os_mutex_cb
  type os_semaphore_cb (line 230) | struct os_semaphore_cb
  type os_pool_cb (line 234) | struct os_pool_cb
  type os_messageQ_cb (line 238) | struct os_messageQ_cb
  type os_mailQ_cb (line 242) | struct os_mailQ_cb
  type osThreadDef_t (line 247) | typedef struct os_thread_def  {
  type osTimerDef_t (line 260) | typedef struct os_timer_def  {
  type osMutexDef_t (line 267) | typedef struct os_mutex_def  {
  type osSemaphoreDef_t (line 273) | typedef struct os_semaphore_def  {
  type osPoolDef_t (line 279) | typedef struct os_pool_def  {
  type osMessageQDef_t (line 287) | typedef struct os_messageQ_def  {
  type osMailQDef_t (line 294) | typedef struct os_mailQ_def  {
  type osEvent (line 303) | typedef struct  {

FILE: include/rtos/rtx/os_tcb.h
  type S8 (line 20) | typedef char               S8;
  type U8 (line 21) | typedef unsigned char      U8;
  type S16 (line 22) | typedef short              S16;
  type U16 (line 23) | typedef unsigned short     U16;
  type S32 (line 24) | typedef int                S32;
  type U32 (line 25) | typedef unsigned int       U32;
  type S64 (line 26) | typedef long long          S64;
  type U64 (line 27) | typedef unsigned long long U64;
  type BIT (line 28) | typedef unsigned char      BIT;
  type BOOL (line 29) | typedef unsigned int       BOOL;
  type OS_TCB (line 32) | struct OS_TCB {

FILE: include/rtos/rtx5/cmsis_os.h
  type osPriority (line 173) | typedef enum {
  type os_timer_type (line 196) | typedef enum {
  type osStatus (line 209) | typedef enum {
  type osStatus_t (line 227) | typedef osStatus_t              osStatus;
  type osThreadDef_t (line 291) | typedef struct os_thread_def {
  type osThreadDef_t (line 298) | typedef struct os_thread_def {
  type osTimerDef_t (line 307) | typedef struct os_timer_def {
  type osTimerDef_t (line 311) | typedef struct os_timer_def {
  type osMutexDef_t (line 320) | typedef struct os_mutex_def {
  type osSemaphoreDef_t (line 330) | typedef struct os_semaphore_def {
  type osPoolDef_t (line 340) | typedef struct os_pool_def {
  type osPoolDef_t (line 346) | typedef struct os_pool_def {
  type osMessageQDef_t (line 356) | typedef struct os_messageQ_def {
  type osMessageQDef_t (line 361) | typedef struct os_messageQ_def {
  type osMailQDef_t (line 370) | typedef struct os_mailQ_def {
  type osMailQDef_t (line 376) | typedef struct os_mailQ_def {
  type osEvent (line 387) | typedef struct {

FILE: include/rtos/rtx5/cmsis_os2.h
  type osVersion_t (line 76) | typedef struct {
  type osKernelState_t (line 82) | typedef enum {
  type osThreadState_t (line 93) | typedef enum {
  type osPriority_t (line 104) | typedef enum {
  type osTimerType_t (line 167) | typedef enum {
  type osStatus_t (line 198) | typedef enum {
  type TZ_ModuleId_t (line 235) | typedef uint32_t TZ_ModuleId_t;
  type osThreadAttr_t (line 240) | typedef struct {
  type osTimerAttr_t (line 253) | typedef struct {
  type osEventFlagsAttr_t (line 261) | typedef struct {
  type osMutexAttr_t (line 269) | typedef struct {
  type osSemaphoreAttr_t (line 277) | typedef struct {
  type osMemoryPoolAttr_t (line 285) | typedef struct {
  type osMessageQueueAttr_t (line 295) | typedef struct {

FILE: include/rtos/rtx5/rtx_os.h
  type osRtxThread_t (line 102) | typedef struct osRtxThread_s {
  type osRtxTimerFinfo_t (line 153) | typedef struct {
  type osRtxTimer_t (line 159) | typedef struct osRtxTimer_s {
  type osRtxEventFlags_t (line 176) | typedef struct {
  type osRtxMutex_t (line 190) | typedef struct osRtxMutex_s {
  type osRtxSemaphore_t (line 208) | typedef struct {
  type osRtxMpInfo_t (line 223) | typedef struct {
  type osRtxMemoryPool_t (line 233) | typedef struct {
  type osRtxMessage_t (line 247) | typedef struct osRtxMessage_s {
  type osRtxMessageQueue_t (line 257) | typedef struct {
  type osRtxObject_t (line 275) | typedef struct {
  type osRtxInfo_t (line 288) | typedef struct {
  type osRtxObjectMemUsage_t (line 356) | typedef struct {
  type osRtxConfig_t (line 436) | typedef struct {

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_abs_f32.c
  function arm_abs_f32 (line 63) | void arm_abs_f32(const float32_t *pSrc, float32_t *pDst, uint32_t blockS...

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_abs_q15.c
  function arm_abs_q15 (line 53) | void arm_abs_q15(const q15_t *pSrc, q15_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_abs_q31.c
  function arm_abs_q31 (line 53) | void arm_abs_q31(const q31_t *pSrc, q31_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_abs_q7.c
  function arm_abs_q7 (line 55) | void arm_abs_q7(const q7_t *pSrc, q7_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_add_f32.c
  function arm_add_f32 (line 61) | void arm_add_f32(const float32_t *pSrcA, const float32_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_add_q15.c
  function arm_add_q15 (line 54) | void arm_add_q15(const q15_t *pSrcA, const q15_t *pSrcB, q15_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_add_q31.c
  function arm_add_q31 (line 54) | void arm_add_q31(const q31_t *pSrcA, const q31_t *pSrcB, q31_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_add_q7.c
  function arm_add_q7 (line 54) | void arm_add_q7(const q7_t *pSrcA, const q7_t *pSrcB, q7_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_dot_prod_f32.c
  function arm_dot_prod_f32 (line 63) | void arm_dot_prod_f32(const float32_t *pSrcA, const float32_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_dot_prod_q15.c
  function arm_dot_prod_q15 (line 56) | void arm_dot_prod_q15(const q15_t *pSrcA, const q15_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_dot_prod_q31.c
  function arm_dot_prod_q31 (line 57) | void arm_dot_prod_q31(const q31_t *pSrcA, const q31_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_dot_prod_q7.c
  function arm_dot_prod_q7 (line 56) | void arm_dot_prod_q7(const q7_t *pSrcA, const q7_t *pSrcB, uint32_t bloc...

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_mult_f32.c
  function arm_mult_f32 (line 61) | void arm_mult_f32(const float32_t *pSrcA, const float32_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_mult_q15.c
  function arm_mult_q15 (line 54) | void arm_mult_q15(const q15_t *pSrcA, const q15_t *pSrcB, q15_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_mult_q31.c
  function arm_mult_q31 (line 54) | void arm_mult_q31(const q31_t *pSrcA, const q31_t *pSrcB, q31_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_mult_q7.c
  function arm_mult_q7 (line 54) | void arm_mult_q7(const q7_t *pSrcA, const q7_t *pSrcB, q7_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_negate_f32.c
  function arm_negate_f32 (line 62) | void arm_negate_f32(const float32_t *pSrc, float32_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_negate_q15.c
  function arm_negate_q15 (line 55) | void arm_negate_q15(const q15_t *pSrc, q15_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_negate_q31.c
  function arm_negate_q31 (line 53) | void arm_negate_q31(const q31_t *pSrc, q31_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_negate_q7.c
  function arm_negate_q7 (line 53) | void arm_negate_q7(const q7_t *pSrc, q7_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_offset_f32.c
  function arm_offset_f32 (line 63) | void arm_offset_f32(const float32_t *pSrc, float32_t offset, float32_t *...

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_offset_q15.c
  function arm_offset_q15 (line 54) | void arm_offset_q15(const q15_t *pSrc, q15_t offset, q15_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_offset_q31.c
  function arm_offset_q31 (line 54) | void arm_offset_q31(const q31_t *pSrc, q31_t offset, q31_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_offset_q7.c
  function arm_offset_q7 (line 54) | void arm_offset_q7(const q7_t *pSrc, q7_t offset, q7_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_scale_f32.c
  function arm_scale_f32 (line 77) | void arm_scale_f32(const float32_t *pSrc, float32_t scale, float32_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_scale_q15.c
  function arm_scale_q15 (line 55) | void arm_scale_q15(const q15_t *pSrc, q15_t scaleFract, int8_t shift,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_scale_q31.c
  function arm_scale_q31 (line 55) | void arm_scale_q31(const q31_t *pSrc, q31_t scaleFract, int8_t shift,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_scale_q7.c
  function arm_scale_q7 (line 55) | void arm_scale_q7(const q7_t *pSrc, q7_t scaleFract, int8_t shift, q7_t ...

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_shift_q15.c
  function arm_shift_q15 (line 56) | void arm_shift_q15(const q15_t *pSrc, int8_t shiftBits, q15_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_shift_q31.c
  function arm_shift_q31 (line 74) | void arm_shift_q31(const q31_t *pSrc, int8_t shiftBits, q31_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_shift_q7.c
  function arm_shift_q7 (line 57) | void arm_shift_q7(const q7_t *pSrc, int8_t shiftBits, q7_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_sub_f32.c
  function arm_sub_f32 (line 61) | void arm_sub_f32(const float32_t *pSrcA, const float32_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_sub_q15.c
  function arm_sub_q15 (line 54) | void arm_sub_q15(const q15_t *pSrcA, const q15_t *pSrcB, q15_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_sub_q31.c
  function arm_sub_q31 (line 54) | void arm_sub_q31(const q31_t *pSrcA, const q31_t *pSrcB, q31_t *pDst,

FILE: platform/cmsis/DSP_Lib/BasicMathFunctions/arm_sub_q7.c
  function arm_sub_q7 (line 54) | void arm_sub_q7(const q7_t *pSrcA, const q7_t *pSrcB, q7_t *pDst,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_conj_f32.c
  function arm_cmplx_conj_f32 (line 70) | void arm_cmplx_conj_f32(const float32_t *pSrc, float32_t *pDst,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_conj_q15.c
  function arm_cmplx_conj_q15 (line 53) | void arm_cmplx_conj_q15(const q15_t *pSrc, q15_t *pDst, uint32_t numSamp...

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_conj_q31.c
  function arm_cmplx_conj_q31 (line 53) | void arm_cmplx_conj_q31(const q31_t *pSrc, q31_t *pDst, uint32_t numSamp...

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_dot_prod_f32.c
  function arm_cmplx_dot_prod_f32 (line 78) | void arm_cmplx_dot_prod_f32(const float32_t *pSrcA, const float32_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_dot_prod_q15.c
  function arm_cmplx_dot_prod_q15 (line 58) | void arm_cmplx_dot_prod_q15(const q15_t *pSrcA, const q15_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_dot_prod_q31.c
  function arm_cmplx_dot_prod_q31 (line 60) | void arm_cmplx_dot_prod_q31(const q31_t *pSrcA, const q31_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mag_f32.c
  function arm_cmplx_mag_f32 (line 72) | void arm_cmplx_mag_f32(const float32_t *pSrc, float32_t *pDst,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mag_q15.c
  function arm_cmplx_mag_q15 (line 52) | void arm_cmplx_mag_q15(const q15_t *pSrc, q15_t *pDst, uint32_t numSampl...

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mag_q31.c
  function arm_cmplx_mag_q31 (line 53) | void arm_cmplx_mag_q31(const q31_t *pSrc, q31_t *pDst, uint32_t numSampl...

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mag_squared_f32.c
  function arm_cmplx_mag_squared_f32 (line 72) | void arm_cmplx_mag_squared_f32(const float32_t *pSrc, float32_t *pDst,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mag_squared_q15.c
  function arm_cmplx_mag_squared_q15 (line 52) | void arm_cmplx_mag_squared_q15(const q15_t *pSrc, q15_t *pDst,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mag_squared_q31.c
  function arm_cmplx_mag_squared_q31 (line 53) | void arm_cmplx_mag_squared_q31(const q31_t *pSrc, q31_t *pDst,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mult_cmplx_f32.c
  function arm_cmplx_mult_cmplx_f32 (line 72) | void arm_cmplx_mult_cmplx_f32(const float32_t *pSrcA, const float32_t *p...

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mult_cmplx_q15.c
  function arm_cmplx_mult_cmplx_q15 (line 53) | void arm_cmplx_mult_cmplx_q15(const q15_t *pSrcA, const q15_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mult_cmplx_q31.c
  function arm_cmplx_mult_cmplx_q31 (line 54) | void arm_cmplx_mult_cmplx_q31(const q31_t *pSrcA, const q31_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mult_real_f32.c
  function arm_cmplx_mult_real_f32 (line 72) | void arm_cmplx_mult_real_f32(const float32_t *pSrcCmplx,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mult_real_q15.c
  function arm_cmplx_mult_real_q15 (line 54) | void arm_cmplx_mult_real_q15(const q15_t *pSrcCmplx, const q15_t *pSrcReal,

FILE: platform/cmsis/DSP_Lib/ComplexMathFunctions/arm_cmplx_mult_real_q31.c
  function arm_cmplx_mult_real_q31 (line 54) | void arm_cmplx_mult_real_q31(const q31_t *pSrcCmplx, const q31_t *pSrcReal,

FILE: platform/cmsis/DSP_Lib/ControllerFunctions/arm_pid_init_f32.c
  function arm_pid_init_f32 (line 52) | void arm_pid_init_f32(arm_pid_instance_f32 *S, int32_t resetStateFlag) {

FILE: platform/cmsis/DSP_Lib/ControllerFunctions/arm_pid_init_q15.c
  function arm_pid_init_q15 (line 52) | void arm_pid_init_q15(arm_pid_instance_q15 *S, int32_t resetStateFlag) {

FILE: platform/cmsis/DSP_Lib/ControllerFunctions/arm_pid_init_q31.c
  function arm_pid_init_q31 (line 52) | void arm_pid_init_q31(arm_pid_instance_q31 *S, int32_t resetStateFlag) {

FILE: platform/cmsis/DSP_Lib/ControllerFunctions/arm_pid_reset_f32.c
  function arm_pid_reset_f32 (line 45) | void arm_pid_reset_f32(arm_pid_instance_f32 *S) {

FILE: platform/cmsis/DSP_Lib/ControllerFunctions/arm_pid_reset_q15.c
  function arm_pid_reset_q15 (line 45) | void arm_pid_reset_q15(arm_pid_instance_q15 *S) {

FILE: platform/cmsis/DSP_Lib/ControllerFunctions/arm_pid_reset_q31.c
  function arm_pid_reset_q31 (line 45) | void arm_pid_reset_q31(arm_pid_instance_q31 *S) {

FILE: platform/cmsis/DSP_Lib/ControllerFunctions/arm_sin_cos_f32.c
  function arm_sin_cos_f32 (line 78) | void arm_sin_cos_f32(float32_t theta, float32_t *pSinVal, float32_t *pCo...

FILE: platform/cmsis/DSP_Lib/ControllerFunctions/arm_sin_cos_q31.c
  function arm_sin_cos_q31 (line 52) | void arm_sin_cos_q31(q31_t theta, q31_t *pSinVal, q31_t *pCosVal) {

FILE: platform/cmsis/DSP_Lib/FastMathFunctions/arm_cos_f32.c
  function float32_t (line 72) | float32_t arm_cos_f32(float32_t x) {

FILE: platform/cmsis/DSP_Lib/FastMathFunctions/arm_cos_q15.c
  function q15_t (line 51) | q15_t arm_cos_q15(q15_t x) {

FILE: platform/cmsis/DSP_Lib/FastMathFunctions/arm_cos_q31.c
  function q31_t (line 51) | q31_t arm_cos_q31(q31_t x) {

FILE: platform/cmsis/DSP_Lib/FastMathFunctions/arm_sin_f32.c
  function float32_t (line 72) | float32_t arm_sin_f32(float32_t x) {

FILE: platform/cmsis/DSP_Lib/FastMathFunctions/arm_sin_q15.c
  function q15_t (line 51) | q15_t arm_sin_q15(q15_t x) {

FILE: platform/cmsis/DSP_Lib/FastMathFunctions/arm_sin_q31.c
  function q31_t (line 51) | q31_t arm_sin_q31(q31_t x) {

FILE: platform/cmsis/DSP_Lib/FastMathFunctions/arm_sqrt_q15.c
  function arm_status (line 52) | arm_status arm_sqrt_q15(q15_t in, q15_t *pOut) {

FILE: platform/cmsis/DSP_Lib/FastMathFunctions/arm_sqrt_q31.c
  function arm_status (line 52) | arm_status arm_sqrt_q31(q31_t in, q31_t *pOut) {

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_32x64_init_q31.c
  function arm_biquad_cas_df1_32x64_init_q31 (line 75) | void arm_biquad_cas_df1_32x64_init_q31(arm_biquad_cas_df1_32x64_ins_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c
  function arm_biquad_cas_df1_32x64_q31 (line 194) | void arm_biquad_cas_df1_32x64_q31(const arm_biquad_cas_df1_32x64_ins_q31...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_f32.c
  function arm_biquad_cascade_df1_f32 (line 182) | void arm_biquad_cascade_df1_f32(const arm_biquad_casd_df1_inst_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_fast_q15.c
  function arm_biquad_cascade_df1_fast_q15 (line 67) | void arm_biquad_cascade_df1_fast_q15(const arm_biquad_casd_df1_inst_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_fast_q31.c
  function arm_biquad_cascade_df1_fast_q31 (line 70) | void arm_biquad_cascade_df1_fast_q31(const arm_biquad_casd_df1_inst_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_init_f32.c
  function arm_biquad_cascade_df1_init_f32 (line 74) | void arm_biquad_cascade_df1_init_f32(arm_biquad_casd_df1_inst_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_init_q15.c
  function arm_biquad_cascade_df1_init_q15 (line 77) | void arm_biquad_cascade_df1_init_q15(arm_biquad_casd_df1_inst_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_init_q31.c
  function arm_biquad_cascade_df1_init_q31 (line 74) | void arm_biquad_cascade_df1_init_q31(arm_biquad_casd_df1_inst_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_q15.c
  function arm_biquad_cascade_df1_q15 (line 65) | void arm_biquad_cascade_df1_q15(const arm_biquad_casd_df1_inst_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df1_q31.c
  function arm_biquad_cascade_df1_q31 (line 64) | void arm_biquad_cascade_df1_q31(const arm_biquad_casd_df1_inst_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df2T_f32.c
  function LOW_OPTIMIZATION_ENTER (line 51) | LOW_OPTIMIZATION_ENTER

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df2T_f64.c
  function LOW_OPTIMIZATION_ENTER (line 151) | LOW_OPTIMIZATION_ENTER

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df2T_init_f32.c
  function arm_biquad_cascade_df2T_init_f32 (line 69) | void arm_biquad_cascade_df2T_init_f32(arm_biquad_cascade_df2T_instance_f...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_df2T_init_f64.c
  function arm_biquad_cascade_df2T_init_f64 (line 69) | void arm_biquad_cascade_df2T_init_f64(arm_biquad_cascade_df2T_instance_f...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f32.c
  function LOW_OPTIMIZATION_ENTER (line 51) | LOW_OPTIMIZATION_ENTER

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f32.c
  function arm_biquad_cascade_stereo_df2T_init_f32 (line 69) | void arm_biquad_cascade_stereo_df2T_init_f32(

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_f32.c
  function arm_conv_f32 (line 109) | void arm_conv_f32(const float32_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_fast_opt_q15.c
  function arm_conv_fast_opt_q15 (line 71) | void arm_conv_fast_opt_q15(const q15_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_fast_q15.c
  function arm_conv_fast_q15 (line 67) | void arm_conv_fast_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_fast_q31.c
  function arm_conv_fast_q31 (line 68) | void arm_conv_fast_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_opt_q15.c
  function arm_conv_opt_q15 (line 66) | void arm_conv_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t ...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_opt_q7.c
  function arm_conv_opt_q7 (line 64) | void arm_conv_opt_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pS...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_f32.c
  function arm_status (line 85) | arm_status arm_conv_partial_f32(const float32_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_fast_opt_q15.c
  function arm_status (line 65) | arm_status arm_conv_partial_fast_opt_q15(const q15_t *pSrcA, uint32_t sr...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_fast_q15.c
  function arm_status (line 60) | arm_status arm_conv_partial_fast_q15(const q15_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_fast_q31.c
  function arm_status (line 61) | arm_status arm_conv_partial_fast_q31(const q31_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_opt_q15.c
  function arm_status (line 64) | arm_status arm_conv_partial_opt_q15(const q15_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_opt_q7.c
  function arm_status (line 60) | arm_status arm_conv_partial_opt_q7(const q7_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_q15.c
  function arm_status (line 63) | arm_status arm_conv_partial_q15(const q15_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_q31.c
  function arm_status (line 60) | arm_status arm_conv_partial_q31(const q31_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_partial_q7.c
  function arm_status (line 60) | arm_status arm_conv_partial_q7(const q7_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_q15.c
  function arm_conv_q15 (line 66) | void arm_conv_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_q31.c
  function arm_conv_q31 (line 68) | void arm_conv_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_conv_q7.c
  function arm_conv_q7 (line 63) | void arm_conv_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_f32.c
  function arm_correlate_f32 (line 107) | void arm_correlate_f32(const float32_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_fast_opt_q15.c
  function arm_correlate_fast_opt_q15 (line 70) | void arm_correlate_fast_opt_q15(const q15_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_fast_q15.c
  function arm_correlate_fast_q15 (line 68) | void arm_correlate_fast_q15(const q15_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_fast_q31.c
  function arm_correlate_fast_q31 (line 70) | void arm_correlate_fast_q31(const q31_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_opt_q15.c
  function arm_correlate_opt_q15 (line 65) | void arm_correlate_opt_q15(const q15_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_opt_q7.c
  function arm_correlate_opt_q7 (line 64) | void arm_correlate_opt_q7(const q7_t *pSrcA, uint32_t srcALen,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_q15.c
  function arm_correlate_q15 (line 66) | void arm_correlate_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_q31.c
  function arm_correlate_q31 (line 67) | void arm_correlate_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_correlate_q7.c
  function arm_correlate_q7 (line 64) | void arm_correlate_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *p...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_decimate_f32.c
  function arm_fir_decimate_f32 (line 143) | void arm_fir_decimate_f32(const arm_fir_decimate_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_decimate_fast_q15.c
  function arm_fir_decimate_fast_q15 (line 67) | void arm_fir_decimate_fast_q15(const arm_fir_decimate_instance_q15 *S,
  function arm_fir_decimate_fast_q15 (line 304) | void arm_fir_decimate_fast_q15(const arm_fir_decimate_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_decimate_fast_q31.c
  function arm_fir_decimate_fast_q31 (line 68) | void arm_fir_decimate_fast_q31(const arm_fir_decimate_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_decimate_init_f32.c
  function arm_status (line 67) | arm_status arm_fir_decimate_init_f32(arm_fir_decimate_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_decimate_init_q15.c
  function arm_status (line 67) | arm_status arm_fir_decimate_init_q15(arm_fir_decimate_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_decimate_init_q31.c
  function arm_status (line 67) | arm_status arm_fir_decimate_init_q31(arm_fir_decimate_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_decimate_q15.c
  function arm_fir_decimate_q15 (line 66) | void arm_fir_decimate_q15(const arm_fir_decimate_instance_q15 *S,
  function arm_fir_decimate_q15 (line 302) | void arm_fir_decimate_q15(const arm_fir_decimate_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_decimate_q31.c
  function arm_fir_decimate_q31 (line 64) | void arm_fir_decimate_q31(const arm_fir_decimate_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_f32.c
  function arm_fir_f32 (line 131) | void arm_fir_f32(const arm_fir_instance_f32 *S, const float32_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_fast_q15.c
  function arm_fir_fast_q15 (line 65) | void arm_fir_fast_q15(const arm_fir_instance_q15 *S, const q15_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_fast_q31.c
  function IAR_ONLY_LOW_OPTIMIZATION_ENTER (line 65) | IAR_ONLY_LOW_OPTIMIZATION_ENTER

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_init_f32.c
  function arm_fir_init_f32 (line 62) | void arm_fir_init_f32(arm_fir_instance_f32 *S, uint16_t numTaps,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_init_q15.c
  function arm_status (line 85) | arm_status arm_fir_init_q15(arm_fir_instance_q15 *S, uint16_t numTaps,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_init_q31.c
  function arm_fir_init_q31 (line 61) | void arm_fir_init_q31(arm_fir_instance_q31 *S, uint16_t numTaps,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_init_q7.c
  function arm_fir_init_q7 (line 61) | void arm_fir_init_q7(arm_fir_instance_q7 *S, uint16_t numTaps,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_interpolate_f32.c
  function arm_fir_interpolate_f32 (line 148) | void arm_fir_interpolate_f32(const arm_fir_interpolate_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_interpolate_init_f32.c
  function arm_status (line 72) | arm_status arm_fir_interpolate_init_f32(arm_fir_interpolate_instance_f32...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_interpolate_init_q15.c
  function arm_status (line 71) | arm_status arm_fir_interpolate_init_q15(arm_fir_interpolate_instance_q15...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_interpolate_init_q31.c
  function arm_status (line 70) | arm_status arm_fir_interpolate_init_q31(arm_fir_interpolate_instance_q31...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_interpolate_q15.c
  function arm_fir_interpolate_q15 (line 60) | void arm_fir_interpolate_q15(const arm_fir_interpolate_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_interpolate_q31.c
  function arm_fir_interpolate_q31 (line 61) | void arm_fir_interpolate_q31(const arm_fir_interpolate_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_lattice_f32.c
  function arm_fir_lattice_f32 (line 128) | void arm_fir_lattice_f32(const arm_fir_lattice_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_lattice_init_f32.c
  function arm_fir_lattice_init_f32 (line 53) | void arm_fir_lattice_init_f32(arm_fir_lattice_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_lattice_init_q15.c
  function arm_fir_lattice_init_q15 (line 52) | void arm_fir_lattice_init_q15(arm_fir_lattice_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_lattice_init_q31.c
  function arm_fir_lattice_init_q31 (line 52) | void arm_fir_lattice_init_q31(arm_fir_lattice_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_lattice_q15.c
  function arm_fir_lattice_q15 (line 50) | void arm_fir_lattice_q15(const arm_fir_lattice_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_lattice_q31.c
  function arm_fir_lattice_q31 (line 54) | void arm_fir_lattice_q31(const arm_fir_lattice_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_q15.c
  function arm_fir_q15 (line 64) | void arm_fir_q15(const arm_fir_instance_q15 *S, const q15_t *pSrc, q15_t...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_q31.c
  function arm_fir_q31 (line 64) | void arm_fir_q31(const arm_fir_instance_q31 *S, const q31_t *pSrc, q31_t...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_q7.c
  function arm_fir_q7 (line 58) | void arm_fir_q7(const arm_fir_instance_q7 *S, const q7_t *pSrc, q7_t *pDst,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_sparse_f32.c
  function arm_fir_sparse_f32 (line 124) | void arm_fir_sparse_f32(arm_fir_sparse_instance_f32 *S, const float32_t ...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_sparse_init_f32.c
  function arm_fir_sparse_init_f32 (line 63) | void arm_fir_sparse_init_f32(arm_fir_sparse_instance_f32 *S, uint16_t nu...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_sparse_init_q15.c
  function arm_fir_sparse_init_q15 (line 62) | void arm_fir_sparse_init_q15(arm_fir_sparse_instance_q15 *S, uint16_t nu...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_sparse_init_q31.c
  function arm_fir_sparse_init_q31 (line 61) | void arm_fir_sparse_init_q31(arm_fir_sparse_instance_q31 *S, uint16_t nu...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_sparse_init_q7.c
  function arm_fir_sparse_init_q7 (line 61) | void arm_fir_sparse_init_q7(arm_fir_sparse_instance_q7 *S, uint16_t numT...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_sparse_q15.c
  function arm_fir_sparse_q15 (line 62) | void arm_fir_sparse_q15(arm_fir_sparse_instance_q15 *S, const q15_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_sparse_q31.c
  function arm_fir_sparse_q31 (line 60) | void arm_fir_sparse_q31(arm_fir_sparse_instance_q31 *S, const q31_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_fir_sparse_q7.c
  function arm_fir_sparse_q7 (line 61) | void arm_fir_sparse_q7(arm_fir_sparse_instance_q7 *S, const q7_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_iir_lattice_f32.c
  function arm_iir_lattice_f32 (line 132) | void arm_iir_lattice_f32(const arm_iir_lattice_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_iir_lattice_init_f32.c
  function arm_iir_lattice_init_f32 (line 56) | void arm_iir_lattice_init_f32(arm_iir_lattice_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_iir_lattice_init_q15.c
  function arm_iir_lattice_init_q15 (line 54) | void arm_iir_lattice_init_q15(arm_iir_lattice_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_iir_lattice_init_q31.c
  function arm_iir_lattice_init_q31 (line 55) | void arm_iir_lattice_init_q31(arm_iir_lattice_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_iir_lattice_q15.c
  function arm_iir_lattice_q15 (line 60) | void arm_iir_lattice_q15(const arm_iir_lattice_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_iir_lattice_q31.c
  function arm_iir_lattice_q31 (line 60) | void arm_iir_lattice_q31(const arm_iir_lattice_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_f32.c
  function arm_lms_f32 (line 186) | void arm_lms_f32(const arm_lms_instance_f32 *S, const float32_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_init_f32.c
  function arm_lms_init_f32 (line 58) | void arm_lms_init_f32(arm_lms_instance_f32 *S, uint16_t numTaps,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_init_q15.c
  function arm_lms_init_q15 (line 64) | void arm_lms_init_q15(arm_lms_instance_q15 *S, uint16_t numTaps, q15_t *...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_init_q31.c
  function arm_lms_init_q31 (line 63) | void arm_lms_init_q31(arm_lms_instance_q31 *S, uint16_t numTaps, q31_t *...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_norm_f32.c
  function arm_lms_norm_f32 (line 173) | void arm_lms_norm_f32(arm_lms_norm_instance_f32 *S, const float32_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_norm_init_f32.c
  function arm_lms_norm_init_f32 (line 64) | void arm_lms_norm_init_f32(arm_lms_norm_instance_f32 *S, uint16_t numTaps,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_norm_init_q15.c
  function arm_lms_norm_init_q15 (line 61) | void arm_lms_norm_init_q15(arm_lms_norm_instance_q15 *S, uint16_t numTaps,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_norm_init_q31.c
  function arm_lms_norm_init_q31 (line 61) | void arm_lms_norm_init_q31(arm_lms_norm_instance_q31 *S, uint16_t numTaps,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_norm_q15.c
  function arm_lms_norm_q15 (line 65) | void arm_lms_norm_q15(arm_lms_norm_instance_q15 *S, const q15_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_norm_q31.c
  function arm_lms_norm_q31 (line 66) | void arm_lms_norm_q31(arm_lms_norm_instance_q31 *S, const q31_t *pSrc,

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_q15.c
  function arm_lms_q15 (line 64) | void arm_lms_q15(const arm_lms_instance_q15 *S, const q15_t *pSrc, q15_t...

FILE: platform/cmsis/DSP_Lib/FilteringFunctions/arm_lms_q31.c
  function arm_lms_q31 (line 66) | void arm_lms_q31(const arm_lms_instance_q31 *S, const q31_t *pSrc, q31_t...

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_add_f32.c
  function arm_status (line 61) | arm_status arm_mat_add_f32(const arm_matrix_instance_f32 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_add_q15.c
  function arm_status (line 55) | arm_status arm_mat_add_q15(const arm_matrix_instance_q15 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_add_q31.c
  function arm_status (line 55) | arm_status arm_mat_add_q31(const arm_matrix_instance_q31 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_cmplx_mult_f32.c
  function arm_status (line 65) | arm_status arm_mat_cmplx_mult_f32(const arm_matrix_instance_f32 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_cmplx_mult_q15.c
  function arm_status (line 63) | arm_status arm_mat_cmplx_mult_q15(const arm_matrix_instance_q15 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_cmplx_mult_q31.c
  function arm_status (line 61) | arm_status arm_mat_cmplx_mult_q31(const arm_matrix_instance_q31 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_init_f32.c
  function arm_mat_init_f32 (line 59) | void arm_mat_init_f32(arm_matrix_instance_f32 *S, uint16_t nRows,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_init_q15.c
  function arm_mat_init_q15 (line 50) | void arm_mat_init_q15(arm_matrix_instance_q15 *S, uint16_t nRows,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_init_q31.c
  function arm_mat_init_q31 (line 54) | void arm_mat_init_q31(arm_matrix_instance_q31 *S, uint16_t nRows,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_mult_f32.c
  function arm_status (line 68) | arm_status arm_mat_mult_f32(const arm_matrix_instance_f32 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_mult_fast_q15.c
  function arm_status (line 69) | arm_status arm_mat_mult_fast_q15(const arm_matrix_instance_q15 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_mult_fast_q31.c
  function arm_status (line 68) | arm_status arm_mat_mult_fast_q31(const arm_matrix_instance_q31 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_mult_q31.c
  function arm_status (line 64) | arm_status arm_mat_mult_q31(const arm_matrix_instance_q31 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_scale_f32.c
  function arm_status (line 68) | arm_status arm_mat_scale_f32(const arm_matrix_instance_f32 *pSrc,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_scale_q15.c
  function arm_status (line 56) | arm_status arm_mat_scale_q15(const arm_matrix_instance_q15 *pSrc,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_scale_q31.c
  function arm_status (line 56) | arm_status arm_mat_scale_q31(const arm_matrix_instance_q31 *pSrc,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_sub_f32.c
  function arm_status (line 61) | arm_status arm_mat_sub_f32(const arm_matrix_instance_f32 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_sub_q15.c
  function arm_status (line 55) | arm_status arm_mat_sub_q15(const arm_matrix_instance_q15 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_sub_q31.c
  function arm_status (line 55) | arm_status arm_mat_sub_q31(const arm_matrix_instance_q31 *pSrcA,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_trans_f32.c
  function arm_status (line 59) | arm_status arm_mat_trans_f32(const arm_matrix_instance_f32 *pSrc,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_trans_q15.c
  function arm_status (line 49) | arm_status arm_mat_trans_q15(const arm_matrix_instance_q15 *pSrc,

FILE: platform/cmsis/DSP_Lib/MatrixFunctions/arm_mat_trans_q31.c
  function arm_status (line 49) | arm_status arm_mat_trans_q31(const arm_matrix_instance_q31 *pSrc,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_max_f32.c
  function arm_max_f32 (line 57) | void arm_max_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *p...

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_max_q15.c
  function arm_max_q15 (line 49) | void arm_max_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_max_q31.c
  function arm_max_q31 (line 49) | void arm_max_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_max_q7.c
  function arm_max_q7 (line 49) | void arm_max_q7(const q7_t *pSrc, uint32_t blockSize, q7_t *pResult,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_mean_f32.c
  function arm_mean_f32 (line 62) | void arm_mean_f32(const float32_t *pSrc, uint32_t blockSize,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_mean_q15.c
  function arm_mean_q15 (line 56) | void arm_mean_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_mean_q31.c
  function arm_mean_q31 (line 56) | void arm_mean_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_mean_q7.c
  function arm_mean_q7 (line 56) | void arm_mean_q7(const q7_t *pSrc, uint32_t blockSize, q7_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_min_f32.c
  function arm_min_f32 (line 57) | void arm_min_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *p...

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_min_q15.c
  function arm_min_q15 (line 49) | void arm_min_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_min_q31.c
  function arm_min_q31 (line 49) | void arm_min_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_min_q7.c
  function arm_min_q7 (line 49) | void arm_min_q7(const q7_t *pSrc, uint32_t blockSize, q7_t *pResult,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_power_f32.c
  function arm_power_f32 (line 62) | void arm_power_f32(const float32_t *pSrc, uint32_t blockSize,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_power_q15.c
  function arm_power_q15 (line 57) | void arm_power_q15(const q15_t *pSrc, uint32_t blockSize, q63_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_power_q31.c
  function arm_power_q31 (line 58) | void arm_power_q31(const q31_t *pSrc, uint32_t blockSize, q63_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_power_q7.c
  function arm_power_q7 (line 57) | void arm_power_q7(const q7_t *pSrc, uint32_t blockSize, q31_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_rms_f32.c
  function arm_rms_f32 (line 63) | void arm_rms_f32(const float32_t *pSrc, uint32_t blockSize,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_rms_q15.c
  function arm_rms_q15 (line 58) | void arm_rms_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_rms_q31.c
  function arm_rms_q31 (line 59) | void arm_rms_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_std_f32.c
  function arm_std_f32 (line 66) | void arm_std_f32(const float32_t *pSrc, uint32_t blockSize,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_std_q15.c
  function arm_std_q15 (line 58) | void arm_std_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_std_q31.c
  function arm_std_q31 (line 61) | void arm_std_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_var_f32.c
  function arm_var_f32 (line 65) | void arm_var_f32(const float32_t *pSrc, uint32_t blockSize,

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_var_q15.c
  function arm_var_q15 (line 58) | void arm_var_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult) {

FILE: platform/cmsis/DSP_Lib/StatisticsFunctions/arm_var_q31.c
  function arm_var_q31 (line 61) | void arm_var_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_copy_f32.c
  function arm_copy_f32 (line 60) | void arm_copy_f32(const float32_t *pSrc, float32_t *pDst, uint32_t block...

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_copy_q15.c
  function arm_copy_q15 (line 48) | void arm_copy_q15(const q15_t *pSrc, q15_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_copy_q31.c
  function arm_copy_q31 (line 48) | void arm_copy_q31(const q31_t *pSrc, q31_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_copy_q7.c
  function arm_copy_q7 (line 48) | void arm_copy_q7(const q7_t *pSrc, q7_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_fill_f32.c
  function arm_fill_f32 (line 60) | void arm_fill_f32(float32_t value, float32_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_fill_q15.c
  function arm_fill_q15 (line 48) | void arm_fill_q15(q15_t value, q15_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_fill_q31.c
  function arm_fill_q31 (line 48) | void arm_fill_q31(q31_t value, q31_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_fill_q7.c
  function arm_fill_q7 (line 48) | void arm_fill_q7(q7_t value, q7_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_float_to_q15.c
  function arm_float_to_q15 (line 66) | void arm_float_to_q15(const float32_t *pSrc, q15_t *pDst, uint32_t block...

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_float_to_q31.c
  function arm_float_to_q31 (line 70) | void arm_float_to_q31(const float32_t *pSrc, q31_t *pDst, uint32_t block...

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_float_to_q7.c
  function arm_float_to_q7 (line 63) | void arm_float_to_q7(const float32_t *pSrc, q7_t *pDst, uint32_t blockSi...

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q15_to_float.c
  function arm_q15_to_float (line 60) | void arm_q15_to_float(const q15_t *pSrc, float32_t *pDst, uint32_t block...

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q15_to_q31.c
  function arm_q15_to_q31 (line 54) | void arm_q15_to_q31(const q15_t *pSrc, q31_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q15_to_q7.c
  function arm_q15_to_q7 (line 54) | void arm_q15_to_q7(const q15_t *pSrc, q7_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q31_to_float.c
  function arm_q31_to_float (line 60) | void arm_q31_to_float(const q31_t *pSrc, float32_t *pDst, uint32_t block...

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q31_to_q15.c
  function arm_q31_to_q15 (line 54) | void arm_q31_to_q15(const q31_t *pSrc, q15_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q31_to_q7.c
  function arm_q31_to_q7 (line 54) | void arm_q31_to_q7(const q31_t *pSrc, q7_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q7_to_float.c
  function arm_q7_to_float (line 59) | void arm_q7_to_float(const q7_t *pSrc, float32_t *pDst, uint32_t blockSi...

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q7_to_q15.c
  function arm_q7_to_q15 (line 54) | void arm_q7_to_q15(const q7_t *pSrc, q15_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/SupportFunctions/arm_q7_to_q31.c
  function arm_q7_to_q31 (line 54) | void arm_q7_to_q31(const q7_t *pSrc, q31_t *pDst, uint32_t blockSize) {

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_bitreversal.c
  function arm_bitreversal_f32 (line 42) | void arm_bitreversal_f32(float32_t *pSrc, uint16_t fftSize,
  function arm_bitreversal_q31 (line 105) | void arm_bitreversal_q31(q31_t *pSrc, uint32_t fftLen, uint16_t bitRevFa...
  function arm_bitreversal_q15 (line 167) | void arm_bitreversal_q15(q15_t *pSrc16, uint32_t fftLen, uint16_t bitRev...

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_bitreversal2.c
  function arm_bitreversal_32 (line 41) | void arm_bitreversal_32(uint32_t *pSrc, const uint16_t bitRevLen,
  function arm_bitreversal_16 (line 72) | void arm_bitreversal_16(uint16_t *pSrc, const uint16_t bitRevLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_f32.c
  function arm_cfft_radix8by2_f32 (line 198) | void arm_cfft_radix8by2_f32(arm_cfft_instance_f32 *S, float32_t *p1) {
  function arm_cfft_radix8by4_f32 (line 310) | void arm_cfft_radix8by4_f32(arm_cfft_instance_f32 *S, float32_t *p1) {
  function arm_cfft_f32 (line 572) | void arm_cfft_f32(const arm_cfft_instance_f32 *S, float32_t *p1,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_q15.c
  function arm_cfft_q15 (line 72) | void arm_cfft_q15(const arm_cfft_instance_q15 *S, q15_t *p1, uint8_t iff...
  function arm_cfft_radix4by2_q15 (line 120) | void arm_cfft_radix4by2_q15(q15_t *pSrc, uint32_t fftLen, const q15_t *p...
  function arm_cfft_radix4by2_inverse_q15 (line 211) | void arm_cfft_radix4by2_inverse_q15(q15_t *pSrc, uint32_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_q31.c
  function arm_cfft_q31 (line 73) | void arm_cfft_q31(const arm_cfft_instance_q31 *S, q31_t *p1, uint8_t iff...
  function arm_cfft_radix4by2_q31 (line 121) | void arm_cfft_radix4by2_q31(q31_t *pSrc, uint32_t fftLen, const q31_t *p...
  function arm_cfft_radix4by2_inverse_q31 (line 174) | void arm_cfft_radix4by2_inverse_q31(q31_t *pSrc, uint32_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix2_f32.c
  function arm_cfft_radix2_f32 (line 65) | void arm_cfft_radix2_f32(const arm_cfft_radix2_instance_f32 *S,
  function arm_radix2_butterfly_f32 (line 100) | void arm_radix2_butterfly_f32(float32_t *pSrc, uint32_t fftLen,
  function arm_radix2_butterfly_inverse_f32 (line 255) | void arm_radix2_butterfly_inverse_f32(float32_t *pSrc, uint32_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix2_init_f32.c
  function arm_status (line 77) | arm_status arm_cfft_radix2_init_f32(arm_cfft_radix2_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix2_init_q15.c
  function arm_status (line 77) | arm_status arm_cfft_radix2_init_q15(arm_cfft_radix2_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix2_init_q31.c
  function arm_status (line 77) | arm_status arm_cfft_radix2_init_q31(arm_cfft_radix2_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix2_q15.c
  function arm_cfft_radix2_q15 (line 62) | void arm_cfft_radix2_q15(const arm_cfft_radix2_instance_q15 *S, q15_t *p...
  function arm_radix2_butterfly_q15 (line 78) | void arm_radix2_butterfly_q15(q15_t *pSrc, uint32_t fftLen, const q15_t ...
  function arm_radix2_butterfly_inverse_q15 (line 372) | void arm_radix2_butterfly_inverse_q15(q15_t *pSrc, uint32_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix2_q31.c
  function arm_cfft_radix2_q31 (line 62) | void arm_cfft_radix2_q31(const arm_cfft_radix2_instance_q31 *S, q31_t *p...
  function arm_radix2_butterfly_q31 (line 78) | void arm_radix2_butterfly_q31(q31_t *pSrc, uint32_t fftLen, const q31_t ...
  function arm_radix2_butterfly_inverse_q31 (line 194) | void arm_radix2_butterfly_inverse_q31(q31_t *pSrc, uint32_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix4_f32.c
  function arm_cfft_radix4_f32 (line 65) | void arm_cfft_radix4_f32(const arm_cfft_radix4_instance_f32 *S,
  function arm_radix4_butterfly_f32 (line 99) | void arm_radix4_butterfly_f32(float32_t *pSrc, uint16_t fftLen,
  function arm_radix4_butterfly_inverse_f32 (line 587) | void arm_radix4_butterfly_inverse_f32(float32_t *pSrc, uint16_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix4_init_f32.c
  function arm_status (line 77) | arm_status arm_cfft_radix4_init_f32(arm_cfft_radix4_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix4_init_q15.c
  function arm_status (line 77) | arm_status arm_cfft_radix4_init_q15(arm_cfft_radix4_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix4_init_q31.c
  function arm_status (line 78) | arm_status arm_cfft_radix4_init_q31(arm_cfft_radix4_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix4_q15.c
  function arm_cfft_radix4_q15 (line 72) | void arm_cfft_radix4_q15(const arm_cfft_radix4_instance_q15 *S, q15_t *p...
  function arm_radix4_butterfly_q15 (line 136) | void arm_radix4_butterfly_q15(q15_t *pSrc16, uint32_t fftLen,
  function arm_radix4_butterfly_inverse_q15 (line 987) | void arm_radix4_butterfly_inverse_q15(q15_t *pSrc16, uint32_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix4_q31.c
  function arm_cfft_radix4_q31 (line 72) | void arm_cfft_radix4_q31(const arm_cfft_radix4_instance_q31 *S, q31_t *p...
  function arm_radix4_butterfly_q31 (line 137) | void arm_radix4_butterfly_q31(q31_t *pSrc, uint32_t fftLen, const q31_t ...
  function arm_radix4_butterfly_inverse_q31 (line 512) | void arm_radix4_butterfly_inverse_q31(q31_t *pSrc, uint32_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_cfft_radix8_f32.c
  function arm_radix8_butterfly_f32 (line 45) | void arm_radix8_butterfly_f32(float32_t *pSrc, uint16_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_dct4_f32.c
  function arm_dct4_f32 (line 141) | void arm_dct4_f32(const arm_dct4_instance_f32 *S, float32_t *pState,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_dct4_init_f32.c
  function arm_status (line 11012) | arm_status arm_dct4_init_f32(arm_dct4_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_dct4_init_q15.c
  function arm_status (line 6666) | arm_status arm_dct4_init_q15(arm_dct4_instance_q15 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_dct4_init_q31.c
  function arm_status (line 8292) | arm_status arm_dct4_init_q31(arm_dct4_instance_q31 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_dct4_q15.c
  function arm_dct4_q15 (line 52) | void arm_dct4_q15(const arm_dct4_instance_q15 *S, q15_t *pState,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_dct4_q31.c
  function arm_dct4_q31 (line 54) | void arm_dct4_q31(const arm_dct4_instance_q31 *S, q31_t *pState,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_rfft_f32.c
  function arm_rfft_f32 (line 76) | void arm_rfft_f32(const arm_rfft_instance_f32 *S, float32_t *pSrc,
  function arm_split_rfft_f32 (line 131) | void arm_split_rfft_f32(float32_t *pSrc, uint32_t fftLen,
  function arm_split_rifft_f32 (line 224) | void arm_split_rifft_f32(float32_t *pSrc, uint32_t fftLen,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_rfft_fast_f32.c
  function stage_rfft_f32 (line 31) | void stage_rfft_f32(const arm_rfft_fast_instance_f32 *S, float32_t *p,
  function merge_rfft_f32 (line 114) | void merge_rfft_f32(const arm_rfft_fast_instance_f32 *S, float32_t *p,
  function arm_rfft_fast_f32 (line 287) | void arm_rfft_fast_f32(arm_rfft_fast_instance_f32 *S, float32_t *p,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_rfft_fast_init_f32.c
  function arm_status (line 50) | arm_status arm_rfft_32_fast_init_f32(arm_rfft_fast_instance_f32 *S) {
  function arm_status (line 77) | arm_status arm_rfft_64_fast_init_f32(arm_rfft_fast_instance_f32 *S) {
  function arm_status (line 104) | arm_status arm_rfft_128_fast_init_f32(arm_rfft_fast_instance_f32 *S) {
  function arm_status (line 131) | arm_status arm_rfft_256_fast_init_f32(arm_rfft_fast_instance_f32 *S) {
  function arm_status (line 158) | arm_status arm_rfft_512_fast_init_f32(arm_rfft_fast_instance_f32 *S) {
  function arm_status (line 185) | arm_status arm_rfft_1024_fast_init_f32(arm_rfft_fast_instance_f32 *S) {
  function arm_status (line 211) | arm_status arm_rfft_2048_fast_init_f32(arm_rfft_fast_instance_f32 *S) {
  function arm_status (line 238) | arm_status arm_rfft_4096_fast_init_f32(arm_rfft_fast_instance_f32 *S) {
  function arm_status (line 275) | arm_status arm_rfft_fast_init_f32(arm_rfft_fast_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_rfft_init_f32.c
  function arm_status (line 5579) | arm_status arm_rfft_init_f32(arm_rfft_instance_f32 *S,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_rfft_init_q15.c
  function arm_status (line 3398) | arm_status arm_rfft_init_q15(arm_rfft_instance_q15 *S, uint32_t fftLenReal,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_rfft_init_q31.c
  function arm_status (line 4216) | arm_status arm_rfft_init_q31(arm_rfft_instance_q31 *S, uint32_t fftLenReal,

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_rfft_q15.c
  function arm_rfft_q15 (line 67) | void arm_rfft_q15(const arm_rfft_instance_q15 *S, q15_t *pSrc, q15_t *pD...
  function arm_split_rfft_q15 (line 115) | void arm_split_rfft_q15(q15_t *pSrc, uint32_t fftLen, const q15_t *pATable,
  function arm_split_rifft_q15 (line 266) | void arm_split_rifft_q15(q15_t *pSrc, uint32_t fftLen, const q15_t *pATa...

FILE: platform/cmsis/DSP_Lib/TransformFunctions/arm_rfft_q31.c
  function arm_rfft_q31 (line 67) | void arm_rfft_q31(const arm_rfft_instance_q31 *S, q31_t *pSrc, q31_t *pD...
  function arm_split_rfft_q31 (line 112) | void arm_split_rfft_q31(q31_t *pSrc, uint32_t fftLen, const q31_t *pATable,
  function arm_split_rifft_q31 (line 204) | void arm_split_rifft_q31(q31_t *pSrc, uint32_t fftLen, const q31_t *pATa...

FILE: platform/cmsis/ca/cmsis_gic.c
  type VECTOR_HDLR_T (line 33) | struct VECTOR_HDLR_T {
  type VECTOR_HDLR_T (line 44) | struct VECTOR_HDLR_T
  type VECTOR_HDLR_T (line 45) | struct VECTOR_HDLR_T
  function c_irq_handler (line 52) | void c_irq_handler(void) {
  function c_undef_handler (line 71) | void c_undef_handler(uint32_t opcode, uint32_t state,
  function c_svc_handler (line 89) | void c_svc_handler(uint32_t svc_num, const struct FAULT_REGS_T *regs) {
  function c_pabt_handler (line 105) | void c_pabt_handler(uint32_t IFSR, uint32_t IFAR,
  function c_dabt_handler (line 123) | void c_dabt_handler(uint32_t DFSR, uint32_t DFAR,
  function c_fiq_handler (line 141) | void c_fiq_handler(void) { c_irq_handler(); }
  function GIC_DisableAllIRQs (line 143) | void GIC_DisableAllIRQs(void) {
  function GIC_InitVectors (line 152) | void GIC_InitVectors(void) {
  function GIC_SetFaultDumpHandler (line 174) | void GIC_SetFaultDumpHandler(GIC_FAULT_DUMP_HANDLER_T handler) {
  function IRQn_Type (line 178) | IRQn_Type IRQ_GetCurrentActiveIRQ(void) { return cur_act_irq; }

FILE: platform/cmsis/ca/irq_ctrl_gic.c
  function __WEAK (line 38) | __WEAK int32_t IRQ_Initialize(void) {
  function __WEAK (line 49) | __WEAK int32_t IRQ_SetHandler(IRQn_ID_t irqn, IRQHandler_t handler) {
  function __WEAK (line 63) | __WEAK IRQHandler_t IRQ_GetHandler(IRQn_ID_t irqn) {
  function __WEAK (line 79) | __WEAK int32_t IRQ_Enable(IRQn_ID_t irqn) {
  function __WEAK (line 93) | __WEAK int32_t IRQ_Disable(IRQn_ID_t irqn) {
  function __WEAK (line 107) | __WEAK uint32_t IRQ_GetEnableState(IRQn_ID_t irqn) {
  function __WEAK (line 120) | __WEAK int32_t IRQ_SetMode(IRQn_ID_t irqn, uint32_t mode) {
  function __WEAK (line 189) | __WEAK uint32_t IRQ_GetMode(IRQn_ID_t irqn) {
  function __WEAK (line 218) | __WEAK IRQn_ID_t IRQ_GetActiveIRQ(void) {
  function __WEAK (line 260) | __WEAK IRQn_ID_t IRQ_GetActiveFIQ(void) { return ((IRQn_ID_t)-1); }
  function __WEAK (line 263) | __WEAK int32_t IRQ_EndOfInterrupt(IRQn_ID_t irqn) {
  function __WEAK (line 285) | __WEAK int32_t IRQ_SetPending(IRQn_ID_t irqn) {
  function __WEAK (line 299) | __WEAK uint32_t IRQ_GetPending(IRQn_ID_t irqn) {
  function __WEAK (line 312) | __WEAK int32_t IRQ_ClearPending(IRQn_ID_t irqn) {
  function __WEAK (line 326) | __WEAK int32_t IRQ_SetPriority(IRQn_ID_t irqn, uint32_t priority) {
  function __WEAK (line 340) | __WEAK uint32_t IRQ_GetPriority(IRQn_ID_t irqn) {
  function __WEAK (line 353) | __WEAK int32_t IRQ_SetPriorityMask(uint32_t priority) {
  function __WEAK (line 359) | __WEAK uint32_t IRQ_GetPriorityMask(void) {
  function __WEAK (line 364) | __WEAK int32_t IRQ_SetPriorityGroupBits(uint32_t bits) {
  function __WEAK (line 382) | __WEAK uint32_t IRQ_GetPriorityGroupBits(void) {

FILE: platform/cmsis/ca/mmu_ARMCA.c
  type TTB_L2_T (line 189) | struct TTB_L2_T {
  type TTB_L2_T (line 198) | struct TTB_L2_T
  function MMU_CreateTranslationTable (line 200) | void MMU_CreateTranslationTable(void) {

FILE: platform/cmsis/ca/startup_ARMCA.c
  function Vectors (line 61) | void Vectors(void) {
  function Reset_Handler (line 84) | void Reset_Handler(void) {
  function Default_Handler (line 162) | void Default_Handler(void) {

FILE: platform/cmsis/ca/system_ARMCA.c
  function SystemInit (line 50) | void SystemInit(void) {

FILE: platform/cmsis/cmsis_nvic.c
  function NVIC_DisableAllIRQs (line 58) | void NVIC_DisableAllIRQs(void)
Copy disabled (too large) Download .json
Condensed preview — 2096 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (27,576K chars).
[
  {
    "path": ".devcontainer/devcontainer.json",
    "chars": 304,
    "preview": "{\n\t\"name\": \"Open PineBuds Pro - VS Code Development Environment\",\n\t\"build\": {\n\t\t\"dockerfile\": \"../Dockerfile\",\n\t\t\"contex"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 303,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"docker\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n    commit"
  },
  {
    "path": ".github/workflows/build-and-push-to-registry.yml",
    "chars": 1232,
    "preview": "name: Container image builder workflow\non:\n  push:\n    branches: [main]\n  workflow_dispatch:\n\nconcurrency:\n  group: gh-r"
  },
  {
    "path": ".github/workflows/build-firmware.yml",
    "chars": 420,
    "preview": "name: CI\n\non: [push, pull_request]\n\njobs:\n  build-firmware:\n    runs-on: ubuntu-latest\n    container:\n      image: ghcr."
  },
  {
    "path": ".gitignore",
    "chars": 1240,
    "preview": "#\n# NOTE! Don't add files that are generated in specific\n# subdirectories here. Add them in the \".gitignore\" file\n# in t"
  },
  {
    "path": "Dockerfile",
    "chars": 1331,
    "preview": "FROM debian:bullseye-slim AS base\r\n\r\nFROM base AS rust_build\r\n\r\nLABEL org.opencontainers.image.authors = \"Ben V. Brown <"
  },
  {
    "path": "Makefile",
    "chars": 32491,
    "preview": "\nCONFIG_CROSS_COMPILE := arm-none-eabi-\nCONFIG_STRICT_CFLAGS ?= y\nCONFIG_SAVE_TARGET ?= n\nCONFIG_FORCE_WIN_SHELL ?= y\n\ne"
  },
  {
    "path": "README.md",
    "chars": 4603,
    "preview": "# PineBuds SDK\n\nThis is just the SDK from the wiki (so far), with dockerfile setup to make building easier, and my rever"
  },
  {
    "path": "apps/Makefile",
    "chars": 965,
    "preview": "obj-y := audioplayers/ common/ main/ key/ pwl/ battery/ factory/\n\nifeq ($(APP_TEST_AUDIO),1)\nobj-y += apptester/\nendif\n\n"
  },
  {
    "path": "apps/anc/Makefile",
    "chars": 2678,
    "preview": "\ncur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj_s := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)src/*.s))\nobj_c "
  },
  {
    "path": "apps/anc/inc/anc_assist.h",
    "chars": 1403,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/anc/inc/anc_wnr.h",
    "chars": 1546,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/anc/inc/app_anc.h",
    "chars": 2276,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/anc/inc/peak_detector.h",
    "chars": 1153,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/anc/src/anc_assist.c",
    "chars": 11677,
    "preview": "\n\n/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All rig"
  },
  {
    "path": "apps/anc/src/anc_wnr.c",
    "chars": 43914,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/anc/src/app_anc.c",
    "chars": 48109,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/anc/src/peak_detector.c",
    "chars": 5389,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/apptester/Makefile",
    "chars": 3945,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/apptester/app_audtest.cpp",
    "chars": 9119,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/apptester/app_audtest.h",
    "chars": 856,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/apptester/app_audtest_pattern.h",
    "chars": 2132718,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/apptester/audiobuffer.c",
    "chars": 4237,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/apptester/audiobuffer.h",
    "chars": 1479,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/Makefile",
    "chars": 4985,
    "preview": "\ncur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj_s := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.s))\nobj_c := $"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/Makefile",
    "chars": 3133,
    "preview": "\ncur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := a2dp_decoder.o\nobj-y += a2dp_decoder_sbc.o\nCFLAGS_a2dp_decoder"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder.cpp",
    "chars": 68334,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder.h",
    "chars": 5980,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_aac_lc.cpp",
    "chars": 39583,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_cp.c",
    "chars": 12671,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_cp.h",
    "chars": 2068,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_example.cpp",
    "chars": 4493,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_internal.h",
    "chars": 7679,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_ldac.cpp",
    "chars": 36669,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_lhdc.cpp",
    "chars": 40948,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_sbc.cpp",
    "chars": 36288,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_scalable.cpp",
    "chars": 24592,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dp_decoder/a2dp_decoder_trace.h",
    "chars": 1981,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/a2dpplay.cpp",
    "chars": 96319,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/app_audio.cpp",
    "chars": 21371,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/app_audio.h",
    "chars": 6669,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain.c",
    "chars": 46453,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain.h",
    "chars": 2494,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain_cfg.h",
    "chars": 3182,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain_cfg_default.c",
    "chars": 28588,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain_cp.c",
    "chars": 6575,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain_cp.h",
    "chars": 1258,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain_thirdparty.c",
    "chars": 4405,
    "preview": "#include \"audio_dump.h\"\n#include \"bt_sco_chain.h\"\n#include \"hal_trace.h\"\n#include \"speech_cfg.h\"\n#include \"speech_memory"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain_thirdparty_alango.c",
    "chars": 6225,
    "preview": "#include \"audio_dump.h\"\n#include \"bt_sco_chain.h\"\n#include \"hal_trace.h\"\n#include \"speech_memory.h\"\n#include \"speech_uti"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain_tuning.c",
    "chars": 5447,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/bt_sco_chain_tuning.h",
    "chars": 1111,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/cvsdplay.cpp",
    "chars": 7448,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/digmici2splay.cpp",
    "chars": 1336,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/flacplay.cpp",
    "chars": 3566,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/fmradio.cpp",
    "chars": 14979,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/fmradio.h",
    "chars": 862,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/msbcplay.cpp",
    "chars": 4378,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/plc_utils.c",
    "chars": 9151,
    "preview": "#include \"plc_utils.h\"\n#include \"hal_trace.h\"\n#include <stdbool.h>\n#include <string.h>\n\n#if defined(CHIP_BEST1400) || de"
  },
  {
    "path": "apps/audioplayers/plc_utils.h",
    "chars": 1169,
    "preview": "#ifndef PLC_UTILS_H\n#define PLC_UTILS_H\n\n#include <stdint.h>\n#include <stdbool.h>\n#include \"plat_types.h\"\n\ntypedef enum "
  },
  {
    "path": "apps/audioplayers/rbplay/rb_ctl.cpp",
    "chars": 22443,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/rbplay/rb_ctl.h",
    "chars": 2004,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/rbplay/rbpcmbuf.cpp",
    "chars": 4422,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/rbplay/rbpcmbuf.h",
    "chars": 1095,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/rbplay/rbplay.cpp",
    "chars": 14233,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/rbplay/rbplay.h",
    "chars": 1256,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/rbplay/rbplaysd.cpp",
    "chars": 5602,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/rbplay/rbplaysd.h",
    "chars": 1888,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/rbplay/utils.h",
    "chars": 935,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/voice_test.c",
    "chars": 5683,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/voicebtpcmplay.cpp",
    "chars": 72596,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/voicebtpcmplay_sco_dma_snapshot.cpp",
    "chars": 32141,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/audioplayers/wavplay.cpp",
    "chars": 6319,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/battery/Makefile",
    "chars": 565,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/battery/app_battery.cpp",
    "chars": 27926,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/battery/app_battery.h",
    "chars": 3186,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/cmd/Makefile",
    "chars": 325,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/cmd/app_cmd.cpp",
    "chars": 1763,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/cmd/app_cmd.h",
    "chars": 880,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/common/Makefile",
    "chars": 422,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/common/app_spec_ostimer.cpp",
    "chars": 3130,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/common/app_spec_ostimer.h",
    "chars": 1566,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/common/app_thread.c",
    "chars": 4623,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/common/app_thread.h",
    "chars": 2205,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/common/app_utils.c",
    "chars": 7292,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/common/app_utils.h",
    "chars": 3891,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/common/randfrommic.c",
    "chars": 6710,
    "preview": "#ifdef __RAND_FROM_MIC__\n#include \"randfrommic.h\"\n#include \"app_audio.h\"\n#include \"app_bt_stream.h\"\n#include \"app_utils."
  },
  {
    "path": "apps/common/randfrommic.h",
    "chars": 952,
    "preview": "#ifdef __RAND_FROM_MIC__\n#ifndef __RANDFROMMIC_H__\n#define __RANDFROMMIC_H__\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#de"
  },
  {
    "path": "apps/factory/1k_2ch_44k_16bit.txt",
    "chars": 13716,
    "preview": "0, 0, \n4652, 4653, \n9211, 9210, \n13583, 13583, \n17679, 17680, \n21418, 21417, \n24722, 24722, \n27525, 27524, \n29770, 29770"
  },
  {
    "path": "apps/factory/1k_2ch_48k_16bit.txt",
    "chars": 684,
    "preview": "0,\n0,\n4234,\n4234,\n8396,\n8396,\n12414,\n12414,\n16220,\n16220,\n19748,\n19748,\n22938,\n22938,\n25736,\n25736,\n28094,\n28094,\n29970,"
  },
  {
    "path": "apps/factory/Makefile",
    "chars": 1124,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/factory/app_factory.cpp",
    "chars": 17707,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/factory/app_factory.h",
    "chars": 1384,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/factory/app_factory_audio.cpp",
    "chars": 10079,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/factory/app_factory_audio.h",
    "chars": 1192,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/factory/app_factory_bt.cpp",
    "chars": 9859,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/factory/app_factory_bt.h",
    "chars": 1192,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/factory/app_factory_cdc_comm.c",
    "chars": 7242,
    "preview": "#ifdef __USB_COMM__\n#include \"app_factory_cdc_comm.h\"\n#include \"plat_types.h\"\n#include \"stdbool.h\"\n#include \"stdint.h\"\n#"
  },
  {
    "path": "apps/factory/app_factory_cdc_comm.h",
    "chars": 263,
    "preview": "#ifndef __APP_FACTORY_CDC_COMM__H__\n#define __APP_FACTORY_CDC_COMM__H__\n#ifdef __USB_COMM__\n#ifdef __cplusplus\nextern \"C"
  },
  {
    "path": "apps/factory/sys_api_cdc_comm.c",
    "chars": 4458,
    "preview": "#ifdef __USB_COMM__\n#include \"sys_api_cdc_comm.h\"\n#include \"app_factory_cdc_comm.h\"\n#include \"hal_bootmode.h\"\n#include \""
  },
  {
    "path": "apps/factory/sys_api_cdc_comm.h",
    "chars": 1066,
    "preview": "#ifndef __SYS_API_USB_CDC_H__\n#define __SYS_API_USB_CDC_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"tool_msg."
  },
  {
    "path": "apps/key/Makefile",
    "chars": 247,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/key/app_key.cpp",
    "chars": 4903,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/key/app_key.h",
    "chars": 4106,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/main/Makefile",
    "chars": 3891,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/main/app_status_ind.h",
    "chars": 2637,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/main/apps.cpp",
    "chars": 73687,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/main/apps.h",
    "chars": 2496,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/main/apps_tester.cpp",
    "chars": 9270,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/main/common_apps_imports.h",
    "chars": 2307,
    "preview": "#ifndef COMMON_APP_IMPORTS\n#define COMMON_APP_IMPORTS\n\n#include \"a2dp_api.h\"\n#include \"app_audio.h\"\n#include \"app_batter"
  },
  {
    "path": "apps/main/gfps.cpp",
    "chars": 1895,
    "preview": "\n// Google Fast pairing Service\n#include \"common_apps_imports.h\"\n\n#ifdef GFPS_ENABLED\n#include \"app_gfps.h\"\n#ifdef GFPS_"
  },
  {
    "path": "apps/main/ibrt.cpp",
    "chars": 824,
    "preview": "#include \"ibrt.h\"\n#include \"common_apps_imports.h\"\n#include \"hal_gpio.h\"\n#include \"tgt_hardware.h\"\nextern struct BT_DEVI"
  },
  {
    "path": "apps/main/ibrt.h",
    "chars": 214,
    "preview": "#pragma once \n#include <stdint.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nbool Curr_Is_Master(void);\nuint8_t get_curr_ro"
  },
  {
    "path": "apps/main/key_handler.cpp",
    "chars": 6943,
    "preview": "#include \"a2dp_api.h\"\n#include \"app_audio.h\"\n#include \"app_battery.h\"\n#include \"app_ble_include.h\"\n#include \"app_bt.h\"\n#"
  },
  {
    "path": "apps/main/key_handler.h",
    "chars": 77,
    "preview": "#pragma once\n\nvoid app_key_init(void);\n\nvoid app_key_init_on_charging(void);\n"
  },
  {
    "path": "apps/main/led_control.cpp",
    "chars": 1348,
    "preview": "\n#include \"led_control.h\"\n#include \"common_apps_imports.h\"\n#include \"ibrt.h\"\n\n/******************************LED_status_"
  },
  {
    "path": "apps/main/led_control.h",
    "chars": 132,
    "preview": "#pragma once\n\nvoid LED_statusinit(void);\nvoid startLED_status(int ms);\nvoid stopLED_status(void);\nvoid LED_statusfun(con"
  },
  {
    "path": "apps/main/lhdc.cpp",
    "chars": 1290,
    "preview": "// LHDC needs a licence key\n// We dont have one; so probably cant ever officially use this. But its here for\n// preserva"
  },
  {
    "path": "apps/main/rb_codec.cpp",
    "chars": 671,
    "preview": "\n\n#ifdef RB_CODEC\nextern bool app_rbcodec_check_hfp_active(void);\nvoid app_switch_player_key(APP_KEY_STATUS *status, voi"
  },
  {
    "path": "apps/main/rb_codec.h",
    "chars": 156,
    "preview": "#pragma once\n\n#ifdef RB_CODEC\nextern int rb_ctl_init();\nextern bool rb_ctl_is_init_done(void);\nextern void app_rbplay_au"
  },
  {
    "path": "apps/mic/Makefile",
    "chars": 1668,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/mic/app_mic.cpp",
    "chars": 7013,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/mic/app_mic.h",
    "chars": 1556,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/mic_alg/Makefile",
    "chars": 1327,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/mic_alg/app_mic_alg.cpp",
    "chars": 9347,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/mic_alg/app_mic_alg.h",
    "chars": 851,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/pwl/Makefile",
    "chars": 250,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/pwl/app_pwl.cpp",
    "chars": 5562,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/pwl/app_pwl.h",
    "chars": 1402,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/voice_detector/Makefile",
    "chars": 559,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\nobj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*.c"
  },
  {
    "path": "apps/voice_detector/app_voice_detector.cpp",
    "chars": 7211,
    "preview": "#include \"app_voice_detector.h\"\n#include \"app_thread.h\"\n#include \"audioflinger.h\"\n#include \"cmsis_os.h\"\n#include \"hal_ti"
  },
  {
    "path": "apps/voice_detector/app_voice_detector.h",
    "chars": 3415,
    "preview": "#ifndef __APP_VOICE_DETECTOR_H__\n#define __APP_VOICE_DETECTOR_H__\n#include \"hal_aud.h\"\n#include \"audioflinger.h\"\n#includ"
  },
  {
    "path": "apps/voice_detector/vad_sensor.h",
    "chars": 911,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "apps/voice_detector/voice_detector.c",
    "chars": 24134,
    "preview": "#include \"analog.h\"\n#include \"audioflinger.h\"\n#include \"hal_aud.h\"\n#include \"hal_cmu.h\"\n#include \"hal_sleep.h\"\n#include "
  },
  {
    "path": "apps/voice_detector/voice_detector.h",
    "chars": 6286,
    "preview": "#ifndef __VOICE_DETECTOR_H__\n#define __VOICE_DETECTOR_H__\n#include \"hal_aud.h\"\n#include \"audioflinger.h\"\n\n#ifdef __cplus"
  },
  {
    "path": "backup.sh",
    "chars": 725,
    "preview": "#!/usr/bin/env bash\n\nBKPPATH=\"firmware-backups\"\n\nmkdir -p \"$BKPPATH\"\n\nNOW=$(date +%s)\n\nnum=$(find /dev -name 'ttyACM*' |"
  },
  {
    "path": "build.sh",
    "chars": 174,
    "preview": "#!/usr/bin/env sh\n\nif make -j \"$(nproc)\" T=open_source DEBUG=1 >log.txt 2>&1; then\n\techo \"build success\"\nelse\n\techo \"bui"
  },
  {
    "path": "clear.sh",
    "chars": 66,
    "preview": "#!/usr/bin/env sh\n\nmake -j \"$(nproc)\" T=open_source DEBUG=1 clean\n"
  },
  {
    "path": "config/Makefile",
    "chars": 1515,
    "preview": "cur_dir := $(dir $(lastword $(MAKEFILE_LIST)))\n\n#obj-y := $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)*.c $(cur_dir)*."
  },
  {
    "path": "config/_default_cfg_src_/app_status_ind.c",
    "chars": 8013,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_ALEXA_START.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_ALEXA_STOP.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_ANSWER.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_CHARGE_FINISH.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_CHARGE_PLEASE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_CONNECTED.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_DIS_CONNECT.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_EIGHT.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_FINDME.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_FIVE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_FOUR.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_GSOUND_MIC_CLOSE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_GSOUND_MIC_OPEN.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_GSOUND_NC.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_HUNG_UP.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_INCOMING_CALL.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_LANGUAGE_SWITCH.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_MUTE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_NINE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_ONE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_OVER.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_PAIRING.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_PAIRING_FAIL.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_PAIRING_SUCCESS.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_PAIR_ENABLE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_POWER_OFF.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_POWER_ON.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_REFUSE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_SEVEN.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_SIX.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_THREE.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_TWO.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_WARNING.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/SOUND_ZERO.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/en_festival/dudu.opus.license",
    "chars": 102,
    "preview": "SPDX-FileCopyrightText: 2025 Moshe Nahmias <moshegrey@gmail.com>\n\nSPDX-License-Identifier: Apache-2.0\n"
  },
  {
    "path": "config/_default_cfg_src_/res/gs_hw/en_all.txt",
    "chars": 334959,
    "preview": "0x00,0x00,0x00,0x00,0x0f,0x46,0x0c,0xfa,0x00,0x00,0x00,0x06,0x43,0x4d,0x34,0x5f,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,"
  },
  {
    "path": "config/_default_cfg_src_/res/ring/SOUND_RING_16000.txt",
    "chars": 94419,
    "preview": "0,\n0,\n-1,\n-1,\n0,\n1,\n1,\n4,\n2,\n1,\n1,\n2,\n-2,\n-3,\n0,\n1,\n-1,\n-3,\n0,\n1,\n-1,\n0,\n0,\n0,\n0,\n-1,\n2,\n0,\n0,\n0,\n4,\n0,\n2,\n-2,\n0,\n-2,\n0,"
  },
  {
    "path": "config/_default_cfg_src_/res/ring/SOUND_RING_44100.txt",
    "chars": 27481,
    "preview": "0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n"
  },
  {
    "path": "config/_default_cfg_src_/res/ring/SOUND_RING_48000.txt",
    "chars": 27481,
    "preview": "0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n"
  },
  {
    "path": "config/_default_cfg_src_/res/ring/SOUND_RING_8000.txt",
    "chars": 27481,
    "preview": "0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n0 ,\n"
  },
  {
    "path": "config/_default_cfg_src_/slave_code.S",
    "chars": 944,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/_default_cfg_src_/tgt_hardware.c",
    "chars": 3691,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/_default_cfg_src_/tgt_hardware.h",
    "chars": 2565,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/bak_open/target.mk",
    "chars": 7218,
    "preview": "CHIP        ?= best2300p\n\nDEBUG       ?= 1\n\nMBED        ?= 0\n\nRTOS        ?= 1\n\n#KERNEL      ?= FREERTOS\n\n\nLIBC_ROM    ?"
  },
  {
    "path": "config/bak_open/tgt_hardware.c",
    "chars": 13329,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/bak_open/tgt_hardware.h",
    "chars": 4307,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/best2300p_ibrt/target.mk",
    "chars": 6766,
    "preview": "CHIP        ?= best2300p\n\nDEBUG       ?= 1\n\nMBED        ?= 0\n\nRTOS        ?= 1\n\n#KERNEL      ?= FREERTOS\n\n\nLIBC_ROM    ?"
  },
  {
    "path": "config/best2300p_ibrt/tgt_hardware.c",
    "chars": 13733,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/best2300p_ibrt/tgt_hardware.h",
    "chars": 4437,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/best2300p_ibrt_anc/target.mk",
    "chars": 7157,
    "preview": "CHIP        ?= best2300p\n\nDEBUG       ?= 1\n\nMBED        ?= 0\n\nRTOS        ?= 1\n\n#KERNEL      ?= FREERTOS\n\nLIBC_ROM    ?="
  },
  {
    "path": "config/best2300p_ibrt_anc/tgt_hardware.c",
    "chars": 41512,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/best2300p_ibrt_anc/tgt_hardware.h",
    "chars": 3582,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/common.mk",
    "chars": 60795,
    "preview": "\nadd_if_exists = $(foreach d,$(1),$(if $(wildcard $(srctree)/$(d)),$(d) ,))\n\n# -----------------------------------------"
  },
  {
    "path": "config/ef606_average_coefficients.h",
    "chars": 6822,
    "preview": "/*\n * Average IIR coefficients extracted from 1MORE Fit SE (EF606) firmware v1.1.1\n * BES2300 platform, BES IBRT SDK\n *\n"
  },
  {
    "path": "config/mic_alg/target.mk",
    "chars": 6775,
    "preview": "CHIP        ?= best2300p\n\nDEBUG       ?= 1\n\nMBED        ?= 0\n\nRTOS        ?= 1\n\n#KERNEL      ?= FREERTOS\n\n\nLIBC_ROM    ?"
  },
  {
    "path": "config/mic_alg/tgt_hardware.c",
    "chars": 13891,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/mic_alg/tgt_hardware.h",
    "chars": 4437,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/open_source/target.mk",
    "chars": 7959,
    "preview": "CHIP        ?= best2300p\n\nDEBUG       ?= 1\n\nMBED        ?= 0\n\nRTOS        ?= 1\n\n#KERNEL      ?= FREERTOS\n# We have power"
  },
  {
    "path": "config/open_source/tgt_hardware.c",
    "chars": 45994,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/open_source/tgt_hardware.h",
    "chars": 4556,
    "preview": "/***************************************************************************\n *\n * Copyright 2015-2019 BES.\n * All right"
  },
  {
    "path": "config/suggested_anc_gains.h",
    "chars": 2206,
    "preview": "/*\n * Suggested ANC gain configurations for PineBuds Pro (BES2300-YP)\n *\n * These are starting-point total_gain values f"
  }
]

// ... and 1896 more files (download for full content)

About this extraction

This page contains the full source code of the pine64/OpenPineBuds GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 2096 files (25.3 MB), approximately 6.7M tokens, and a symbol index with 17240 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!