# Copyright (C) 2018 LongSung Technologies Limited and/or its affiliates("LongSung"). # All rights reserved. # # This software is supplied "AS IS" without any warranties. # LongSung assumes no responsibility or liability for the use of the software, # conveys no license or title under any patent, copyright, or mask work # right to the product. LongSung reserves the right to make changes in the # software without notification. LongSung also make no representation or # warranty that such application will be suitable for the specified use # without further testing or modification. #####################################evrc files##################################### option(ENABLE_ANT_MODE "只使能天线测试模式" OFF) if(ENABLE_ANT_MODE) add_definitions(-D ENABLE_ANT_MODE) else() option(ENABLE_TICKET "使能深度休眠功能" ON) option(ENABLE_QUE_TASK_LOCK "使能消息队列加任务锁" ON) option(ENABLE_EVRC_ARM "使能EVRC的汇编驱动" OFF) option(ENABLE_EVRC "使能EVRC编码驱动" OFF) option(ENABLE_AMRNB "使能AMRNB编码驱动" ON) option(ENABLE_DEV_KIT "使能开板板音频通道,否则RTL271音频通道" OFF) endif() option(ENABLE_USB_PORT "使能USB虚拟的PORTx功能" ON) option(ENABLE_UART1_MCU_CMD_ONLY "使能UART1只处理MCU指令" ON) if(ENABLE_UART1_MCU_CMD_ONLY) add_definitions(-D ENABLE_UART1_MCU_CMD_ONLY) endif() if(ENABLE_USB_PORT) add_definitions(-D ENABLE_USB_PORT) endif() if(ENABLE_USB_PORT) if(ENABLE_UART1_MCU_CMD_ONLY) option(ENABLE_NO_ERROR "使能编译主程序" ON) else() message(STATUS "error:打开ENABLE_USB_PORT时必须打开ENABLE_UART1_MCU_CMD_ONLY") endif() else() option(ENABLE_NO_ERROR "使能编译主程序" ON) endif() if(ENABLE_NO_ERROR) if(ENABLE_DEV_KIT) add_definitions(-D ENABLE_DEV_KIT) endif() if(ENABLE_TICKET) add_definitions(-D ENABLE_TICKET) endif() if(ENABLE_QUE_TASK_LOCK) add_definitions(-D ENABLE_QUE_TASK_LOCK) endif() set(hpoc_evrc_dir ./evrcc) set(hpoc_evrc_code_dir ${hpoc_evrc_dir}/code) set(hpoc_evrc_dsp_arm_dir ${hpoc_evrc_dir}/dsp_arm) set(hpoc_evrc_dspmath_dir ${hpoc_evrc_dir}/dspmath) set(hpoc_evrc_all_dir ${hpoc_evrc_dir} ${hpoc_evrc_dir}/include ${hpoc_evrc_dsp_arm_dir} ${hpoc_evrc_dspmath_dir}) if(ENABLE_EVRC_ARM) set(hpoc_evrc_dspmath_files ${hpoc_evrc_dspmath_dir}/mathadv.c ${hpoc_evrc_dspmath_dir}/ehwutl.c ${hpoc_evrc_dspmath_dir}/globdefs.c) set(hpoc_evrc_arm_files ${hpoc_evrc_dsp_arm_dir}/abs_s.s ${hpoc_evrc_dsp_arm_dir}/dsp_math.c ${hpoc_evrc_dsp_arm_dir}/l_add.s ${hpoc_evrc_dsp_arm_dir}/l_sub.s ${hpoc_evrc_dsp_arm_dir}/l_mac.s ${hpoc_evrc_dsp_arm_dir}/l_msu.s ${hpoc_evrc_dsp_arm_dir}/l_shr.s ${hpoc_evrc_dsp_arm_dir}/l_shl.s ${hpoc_evrc_dsp_arm_dir}/divide_s.s ${hpoc_evrc_dsp_arm_dir}/l_abs.s ${hpoc_evrc_dsp_arm_dir}/l_mult.s ${hpoc_evrc_dsp_arm_dir}/mac_r.s ${hpoc_evrc_dsp_arm_dir}/sub.s ${hpoc_evrc_dsp_arm_dir}/add.s ${hpoc_evrc_dsp_arm_dir}/mult_r.s ${hpoc_evrc_dsp_arm_dir}/negate.s ${hpoc_evrc_dsp_arm_dir}/norm_s.s ${hpoc_evrc_dsp_arm_dir}/shr_r.s ${hpoc_evrc_dsp_arm_dir}/shift_r.s ${hpoc_evrc_dsp_arm_dir}/msu_r.s ${hpoc_evrc_dsp_arm_dir}/l_negate.s ${hpoc_evrc_dsp_arm_dir}/l_shr_r.s ${hpoc_evrc_dsp_arm_dir}/l_shift_r.s ${hpoc_evrc_dsp_arm_dir}/norm_l.s ${hpoc_evrc_dsp_arm_dir}/mult.s ${hpoc_evrc_dsp_arm_dir}/round32.s ${hpoc_evrc_dsp_arm_dir}/shl.s ${hpoc_evrc_dsp_arm_dir}/shr.s ${hpoc_evrc_dsp_arm_dir}/saturate.s ${hpoc_evrc_dsp_arm_dir}/l_mpy_ls.s ${hpoc_evrc_dsp_arm_dir}/l_mpy_ll.s ${hpoc_evrc_dsp_arm_dir}/div_32.s ${hpoc_evrc_dsp_arm_dir}/fft_tabs.s ${hpoc_evrc_dsp_arm_dir}/c_fft.s ${hpoc_evrc_dsp_arm_dir}/test.s) else() set(hpoc_evrc_dspmath_files ${hpoc_evrc_dspmath_dir}/mathevrc.c ${hpoc_evrc_dspmath_dir}/mathadv.c ${hpoc_evrc_dspmath_dir}/ehwutl.c ${hpoc_evrc_dspmath_dir}/globdefs.c ${hpoc_evrc_dspmath_dir}/mathdp31.c) set(hpoc_evrc_arm_files ) endif() set(hpoc_evrc_code_files ${hpoc_evrc_code_dir}/acb_ex.c ${hpoc_evrc_code_dir}/acelp_pf.c ${hpoc_evrc_code_dir}/apf.c ${hpoc_evrc_code_dir}/auto.c ${hpoc_evrc_code_dir}/a2lsp.c ${hpoc_evrc_code_dir}/bitpack.c ${hpoc_evrc_code_dir}/bitupack.c ${hpoc_evrc_code_dir}/bl_intrp.c ${hpoc_evrc_code_dir}/bqiir.c ${hpoc_evrc_code_dir}/c3_10pf.c ${hpoc_evrc_code_dir}/c8_35pf.c ${hpoc_evrc_code_dir}/comacb.c ${hpoc_evrc_code_dir}/convh.c ${hpoc_evrc_code_dir}/cshift.c ${hpoc_evrc_code_dir}/d3_10pf.c ${hpoc_evrc_code_dir}/d8_35pf.c ${hpoc_evrc_code_dir}/decode.c ${hpoc_evrc_code_dir}/d_fer.c ${hpoc_evrc_code_dir}/d_no_fer.c ${hpoc_evrc_code_dir}/d_rate_1.c ${hpoc_evrc_code_dir}/durbin.c ${hpoc_evrc_code_dir}/encode.c ${hpoc_evrc_code_dir}/fcbgq.c ${hpoc_evrc_code_dir}/fer.c ${hpoc_evrc_code_dir}/filter.c ${hpoc_evrc_code_dir}/fndppf.c ${hpoc_evrc_code_dir}/getext1k.c ${hpoc_evrc_code_dir}/getgain.c ${hpoc_evrc_code_dir}/getres.c ${hpoc_evrc_code_dir}/impulser.c ${hpoc_evrc_code_dir}/interpol.c ${hpoc_evrc_code_dir}/intr_cos.c ${hpoc_evrc_code_dir}/inv_sqrt.c ${hpoc_evrc_code_dir}/lpcana.c ${hpoc_evrc_code_dir}/lspmaq.c ${hpoc_evrc_code_dir}/lsp2a.c ${hpoc_evrc_code_dir}/maxeloc.c ${hpoc_evrc_code_dir}/mdfyorig.c ${hpoc_evrc_code_dir}/mod.c ${hpoc_evrc_code_dir}/ns127.c ${hpoc_evrc_code_dir}/pit_shrp.c ${hpoc_evrc_code_dir}/pktoav.c ${hpoc_evrc_code_dir}/pre_enc.c ${hpoc_evrc_code_dir}/putacbc.c ${hpoc_evrc_code_dir}/r_fft.c ${hpoc_evrc_code_dir}/rda.c ${hpoc_evrc_code_dir}/rom.c ${hpoc_evrc_code_dir}/synfltr.c ${hpoc_evrc_code_dir}/weight.c ${hpoc_evrc_code_dir}/w2res.c ${hpoc_evrc_code_dir}/zeroinpt.c ${hpoc_evrc_code_dir}/globs.c ${hpoc_evrc_code_dir}/e_globs.c ${hpoc_evrc_code_dir}/d_globs.c) if(ENABLE_EVRC) add_definitions(-D ENABLE_EVRC) set(hpoc_evrc_files ${hpoc_evrc_code_files} ${hpoc_evrc_dspmath_files} ${hpoc_evrc_arm_files} ${hpoc_evrc_dir}/evrcc.c ${hpoc_evrc_dir}/evrcpacket.c) else() set(hpoc_evrc_files ) endif() #####################################amr files##################################### set(hpoc_amr_dir ./amrnb) if (ENABLE_AMRNB) add_definitions(-D ENABLE_AMRNB) set(hpoc_amr_files ${hpoc_amr_dir}/agc.c ${hpoc_amr_dir}/autocorr.c ${hpoc_amr_dir}/az_lsp.c ${hpoc_amr_dir}/bits2prm.c ${hpoc_amr_dir}/cl_ltp.c ${hpoc_amr_dir}/convolve.c ${hpoc_amr_dir}/c1035pf.c ${hpoc_amr_dir}/d_plsf.c ${hpoc_amr_dir}/d_plsf_5.c ${hpoc_amr_dir}/d_gain_c.c ${hpoc_amr_dir}/d_gain_p.c ${hpoc_amr_dir}/dec_lag6.c ${hpoc_amr_dir}/d1035pf.c ${hpoc_amr_dir}/cor_h.c ${hpoc_amr_dir}/enc_lag3.c ${hpoc_amr_dir}/enc_lag6.c ${hpoc_amr_dir}/g_code.c ${hpoc_amr_dir}/g_pitch.c ${hpoc_amr_dir}/int_lpc.c ${hpoc_amr_dir}/inter_36.c ${hpoc_amr_dir}/inv_sqrt_ex.c ${hpoc_amr_dir}/lag_wind.c ${hpoc_amr_dir}/levinson.c ${hpoc_amr_dir}/lsp_az.c ${hpoc_amr_dir}/lsp_lsf.c ${hpoc_amr_dir}/ol_ltp.c ${hpoc_amr_dir}/pitch_fr.c ${hpoc_amr_dir}/pitch_ol.c ${hpoc_amr_dir}/pow2.c ${hpoc_amr_dir}/pre_big.c ${hpoc_amr_dir}/pre_proc.c ${hpoc_amr_dir}/pred_lt.c ${hpoc_amr_dir}/preemph.c ${hpoc_amr_dir}/prm2bits.c ${hpoc_amr_dir}/pstfilt.c ${hpoc_amr_dir}/q_gain_c.c ${hpoc_amr_dir}/q_gain_p.c ${hpoc_amr_dir}/q_plsf.c ${hpoc_amr_dir}/q_plsf_5.c ${hpoc_amr_dir}/lsfwt.c ${hpoc_amr_dir}/reorder.c ${hpoc_amr_dir}/residu.c ${hpoc_amr_dir}/lsp.c ${hpoc_amr_dir}/lpc.c ${hpoc_amr_dir}/ec_gains.c ${hpoc_amr_dir}/spreproc.c ${hpoc_amr_dir}/syn_filt.c ${hpoc_amr_dir}/weight_a.c ${hpoc_amr_dir}/qua_gain.c ${hpoc_amr_dir}/gc_pred.c ${hpoc_amr_dir}/q_plsf_3.c ${hpoc_amr_dir}/post_pro.c ${hpoc_amr_dir}/dec_lag3.c ${hpoc_amr_dir}/dec_gain.c ${hpoc_amr_dir}/d_plsf_3.c ${hpoc_amr_dir}/d4_17pf.c ${hpoc_amr_dir}/c4_17pf.c ${hpoc_amr_dir}/d3_14pf.c ${hpoc_amr_dir}/c3_14pf.c ${hpoc_amr_dir}/d2_11pf.c ${hpoc_amr_dir}/c2_11pf.c ${hpoc_amr_dir}/d2_9pf.c ${hpoc_amr_dir}/c2_9pf.c ${hpoc_amr_dir}/cbsearch.c ${hpoc_amr_dir}/spstproc.c ${hpoc_amr_dir}/gain_q.c ${hpoc_amr_dir}/cod_amr.c ${hpoc_amr_dir}/dec_amr.c ${hpoc_amr_dir}/sp_enc.c ${hpoc_amr_dir}/sp_dec.c ${hpoc_amr_dir}/ph_disp.c ${hpoc_amr_dir}/g_adapt.c ${hpoc_amr_dir}/calc_en.c ${hpoc_amr_dir}/qgain795.c ${hpoc_amr_dir}/qgain475.c ${hpoc_amr_dir}/sqrt_l.c ${hpoc_amr_dir}/set_sign.c ${hpoc_amr_dir}/s10_8pf.c ${hpoc_amr_dir}/bgnscd.c ${hpoc_amr_dir}/gmed_n.c ${hpoc_amr_dir}/mac_32.c ${hpoc_amr_dir}/ex_ctrl.c ${hpoc_amr_dir}/c_g_aver.c ${hpoc_amr_dir}/lsp_avg.c ${hpoc_amr_dir}/int_lsf.c ${hpoc_amr_dir}/c8_31pf.c ${hpoc_amr_dir}/d8_31pf.c ${hpoc_amr_dir}/p_ol_wgh.c ${hpoc_amr_dir}/ton_stab.c ${hpoc_amr_dir}/vad1.c ${hpoc_amr_dir}/dtx_enc.c ${hpoc_amr_dir}/dtx_dec.c ${hpoc_amr_dir}/a_refl.c ${hpoc_amr_dir}/b_cn_cod.c ${hpoc_amr_dir}/calc_cor.c ${hpoc_amr_dir}/hp_max.c ${hpoc_amr_dir}/vadname.c ${hpoc_amr_dir}/vad2.c ${hpoc_amr_dir}/r_fft_ex.c ${hpoc_amr_dir}/lflg_upd.c ${hpoc_amr_dir}/e_homing.c ${hpoc_amr_dir}/d_homing.c ${hpoc_amr_dir}/sid_sync.c ${hpoc_amr_dir}/count.c ${hpoc_amr_dir}/basicop2.c ${hpoc_amr_dir}/oper_32b.c ${hpoc_amr_dir}/set_zero.c ${hpoc_amr_dir}/log2.c ${hpoc_amr_dir}/copy.c ${hpoc_amr_dir}/wamr.c) else() set(hpoc_amr_files ) endif() #####################################pt files##################################### set(hpoc_pt_dir ./pt) set(hpoc_pt_files ${hpoc_pt_dir}/pt-timer.c) #####################################queue##################################### set(hpoc_queue_dir ./queue) set(hpoc_queue_files ${hpoc_queue_dir}/bufQueue.c) #####################################log##################################### set(hpoc_log_dir ./log) set(hpoc_log_files ${hpoc_log_dir}/log.c) #####################################app files##################################### set(hpoc_app_dir ./app) set(hpoc_app_file ./hpocapp.c ${hpoc_app_dir}/main.c ${hpoc_app_dir}/atCmdList.c ${hpoc_app_dir}/netWork.c ${hpoc_app_dir}/app.c ${hpoc_app_dir}/para.c ${hpoc_app_dir}/domain.c ${hpoc_app_dir}/common.c ${hpoc_app_dir}/tts.c ${hpoc_app_dir}/plyRec.c ${hpoc_app_dir}/bsp.c ${hpoc_app_dir}/tupApi.c ${hpoc_app_dir}/ticket.c ${hpoc_app_dir}/authLogin.c ${hpoc_app_dir}/ProtocolPack.c ${hpoc_app_dir}/location.c ${hpoc_app_dir}/nmea.c ${hpoc_app_dir}/mcuIap.c ${hpoc_app_dir}/mcu.c ${hpoc_app_dir}/crc.c ${hpoc_app_dir}/http.c ${hpoc_app_dir}/mcuCmds.c ${hpoc_app_dir}/devMsg.c ${hpoc_app_dir}/records.c ${hpoc_app_dir}/hook.c) #####################################include path##################################### set(hpoc_all_files ${hpoc_app_file} ${hpoc_evrc_files} ${hpoc_amr_files} ${hpoc_pt_files} ${hpoc_queue_files} ${hpoc_log_files} ${lsapi_osi_api_dir}) ################################################################################## #aux_source_directory(${SOURCE_TOP_DIR}/hpoc/app SRC_LIST) include_directories(${hpoc_app_dir} ${hpoc_evrc_all_dir} ${hpoc_amr_dir} ${hpoc_pt_dir} ${hpoc_queue_dir} ${hpoc_log_dir}) #add_definitions(-Wall) add_definitions(-w) add_definitions(-D PLATFORM_MS5700 -D NO_EXIT_ABORT_CALL -D UNUSED_STD_MALLOC -D NDEBUG -D __unix -D linux) if(ENABLE_EVRC_ARM) add_definitions(-D ANDROID -D __ARM_ARCH__=7 ) #enable_language(ASM-ATT) endif() if(CONFIG_APPIMG_LOAD_FLASH) set(target RTL271) add_appimg(${target} ${flash_ldscript} ${hpoc_all_files}) target_link_libraries(${target} PRIVATE ${libc_file_name} ${libm_file_name} ${libgcc_file_name}) set(pac_file ${out_hex_dir}/${target}.pac) set(target_img_file ${out_hex_dir}/${target}.img) pac_init_fdl(init_fdl) add_custom_command(OUTPUT ${pac_file} COMMAND python3 ${pacgen_py} ${init_fdl} cfg-image -i APPIMG -a ${CONFIG_APPIMG_FLASH_ADDRESS} -s ${CONFIG_APPIMG_FLASH_SIZE} -p ${target_img_file} pac-gen ${pac_file} DEPENDS ${pacgen_py} ${target_img_file} WORKING_DIRECTORY ${SOURCE_TOP_DIR} ) add_custom_target(${target}_pacgen ALL DEPENDS ${pac_file}) endif() endif()