key verify support
This commit is contained in:
@@ -47,7 +47,7 @@ set(SW_USB_AUDIO_FLAGS ${EXTRA_BUILD_FLAGS} -O3
|
||||
-D${TARGET_BOARD}
|
||||
-D${CODEC_IC}
|
||||
-DWINDOWS_OS_DESCRIPTOR_SUPPORT
|
||||
-DDEBUG_PRINT_ENABLE=1)
|
||||
-DDEBUG_PRINT_ENABLE=0)
|
||||
|
||||
|
||||
LINK_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/../../lib_dnr/lib_dnr)
|
||||
@@ -81,7 +81,7 @@ set(APP_COMPILER_FLAGS_ex3d_stereo_8k ${SW_USB_AUDIO_FLAGS} -DI2S_CHANS_DAC=2
|
||||
-DMAX_FREQ=48000
|
||||
-DUSE_EX3D
|
||||
-DMIXER=0
|
||||
-DAIZIP_DNR=0 -ldnr_50ms
|
||||
-DAIZIP_DNR=0 #-ldnr_50ms
|
||||
-llib_ex3d_stereo_8k
|
||||
-DNUM_USB_CHAN_OUT=2
|
||||
-DNUM_USB_CHAN_IN=2
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "xua_hid_report.h"
|
||||
#include "xc_ptr.h"
|
||||
#include "dnr_dsp_buf.h"
|
||||
#include "debug_print.h"
|
||||
|
||||
|
||||
chanend_t uc_ex3d_to_ubm;
|
||||
@@ -56,6 +57,31 @@ chanend_t uc_dsp_to_dnr_t1;
|
||||
//chanend_t uc_dsp_to_dnr_t0;
|
||||
chanend_t uc_key_to_ubm_t0;
|
||||
volatile EXTERN DS_BOOL m_hThread;
|
||||
void key_receiver(chanend_t c)
|
||||
{
|
||||
debug_printf("===> key_receiver\n");
|
||||
|
||||
// tile0
|
||||
// load the license key
|
||||
// This function must be called before audio_ex3d_activate_key.
|
||||
audio_ex3d_load_key(c);
|
||||
}
|
||||
|
||||
void key_sender(chanend_t c)
|
||||
{
|
||||
debug_printf("===> key_sender\n");
|
||||
|
||||
// tile1
|
||||
// activate the license key
|
||||
// if the keys match, the function returns 0.
|
||||
int ret = audio_ex3d_activate_key(c);
|
||||
if (ret == NO_ERR) {
|
||||
debug_printf("License keys match.\n");
|
||||
} else {
|
||||
debug_printf("License keys do not match. Error code: %d\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
void UserBufferManagementInit(unsigned sampFreq)
|
||||
{
|
||||
(void)sampFreq;
|
||||
@@ -835,6 +861,7 @@ void ex3d_task(){
|
||||
uc_ex3d_to_ubm = c.end_b;
|
||||
|
||||
// set_core_high_priority_on();
|
||||
delay_milliseconds(500);
|
||||
int ret = audio_ex3d_init(NUM_USB_CHAN_OUT, NUM_USB_CHAN_OUT * FRAME_SIZE * sizeof(AUDIO_T), 48000, sizeof(AUDIO_T));
|
||||
if(ret != 0) {
|
||||
printf("audio_ex3d_init() error:%d\n\r", ret);
|
||||
|
||||
@@ -57,6 +57,8 @@ extern unsafe chanend uc_dsp_to_ex3d[DSP_WORKER_COUNT];
|
||||
extern unsafe chanend uc_dsp_to_dnr_t1;
|
||||
extern unsafe chanend uc_key_to_ubm_t0;
|
||||
extern unsafe chanend uc_audiohw;
|
||||
extern void key_sender(chanend c_key);
|
||||
extern void key_receiver(chanend c_key);
|
||||
|
||||
#if AIZIP_DNR == 1
|
||||
#define USER_MAIN_DECLARATIONS \
|
||||
@@ -84,7 +86,7 @@ extern unsafe chanend uc_audiohw;
|
||||
unsafe\
|
||||
{\
|
||||
board_setup();\
|
||||
}\
|
||||
} \
|
||||
AudioHwRemote(c);\
|
||||
dnr_dsp_buffer_task(cc_dsp_in, cc_dsp_eof, cc_mic_level);\
|
||||
dnr_dsp_proc_task(cc_dsp_eof);\
|
||||
@@ -93,7 +95,7 @@ extern unsafe chanend uc_audiohw;
|
||||
#else
|
||||
|
||||
#define USER_MAIN_DECLARATIONS \
|
||||
chan c_dsp_to_ex3d[DSP_WORKER_COUNT]; chan c; chan cc_mic_level; chan c_hidSendData; chan c_hidRcvData;
|
||||
chan c_dsp_to_ex3d[DSP_WORKER_COUNT]; chan c; chan cc_mic_level; chan c_key; chan c_hidSendData; chan c_hidRcvData;
|
||||
|
||||
#define USER_MAIN_CORES on tile[1]: {\
|
||||
par\
|
||||
@@ -103,6 +105,7 @@ extern unsafe chanend uc_audiohw;
|
||||
unsafe\
|
||||
{\
|
||||
uc_audiohw = (chanend) c;\
|
||||
key_sender(c_key);\
|
||||
for(int i=0;i<DSP_WORKER_COUNT;i++)\
|
||||
uc_dsp_to_ex3d[i] = (chanend) c_dsp_to_ex3d[i];\
|
||||
}\
|
||||
@@ -115,6 +118,7 @@ extern unsafe chanend uc_audiohw;
|
||||
unsafe\
|
||||
{\
|
||||
board_setup();\
|
||||
key_receiver(c_key);\
|
||||
}\
|
||||
AudioHwRemote(c);\
|
||||
button_task(c_hidSendData);\
|
||||
|
||||
Reference in New Issue
Block a user