add more flash protect for key verification
This commit is contained in:
@@ -431,6 +431,22 @@ void button_task(chanend c_hidSendData, chanend cc_mic_level, chanend c_uac_vol,
|
|||||||
unsigned char hp_mute_path[] = "hp_mute";
|
unsigned char hp_mute_path[] = "hp_mute";
|
||||||
unsigned char monitor_sw_path[] = "monitor_sw";
|
unsigned char monitor_sw_path[] = "monitor_sw";
|
||||||
unsigned host_os;
|
unsigned host_os;
|
||||||
|
#if DNR_ENABLE
|
||||||
|
unsigned dnr_init_flag = 0;
|
||||||
|
while (dnr_init_flag == 0)
|
||||||
|
{
|
||||||
|
GET_SHARED_GLOBAL(dnr_init_flag, g_dnr_init_flag);
|
||||||
|
asm("nop");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if USE_EX3D == 1
|
||||||
|
unsigned ex3d_key_verified = 0;
|
||||||
|
while (ex3d_key_verified == 0)
|
||||||
|
{
|
||||||
|
GET_SHARED_GLOBAL(ex3d_key_verified, g_ex3d_key_verified);
|
||||||
|
asm("nop");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
delay_milliseconds(10);
|
delay_milliseconds(10);
|
||||||
saved_mode = load_value(path);
|
saved_mode = load_value(path);
|
||||||
|
|||||||
@@ -84,12 +84,18 @@ chanend_t uc_dsp_to_dnr_t1;
|
|||||||
//chanend_t uc_dsp_to_dnr_t0;
|
//chanend_t uc_dsp_to_dnr_t0;
|
||||||
chanend_t uc_key_to_ubm_t0;
|
chanend_t uc_key_to_ubm_t0;
|
||||||
volatile EXTERN DS_BOOL m_hThread;
|
volatile EXTERN DS_BOOL m_hThread;
|
||||||
|
extern unsigned g_dnr_init_flag;
|
||||||
void SetEqDataChan (chanend_t c) {
|
void SetEqDataChan (chanend_t c) {
|
||||||
uc_eq_data = c;
|
uc_eq_data = c;
|
||||||
}
|
}
|
||||||
void key_receiver(chanend_t c)
|
void key_receiver(chanend_t c)
|
||||||
{
|
{
|
||||||
debug_printf("===> key_receiver\n");
|
debug_printf("===> key_receiver\n");
|
||||||
|
#if DNR_ENABLE
|
||||||
|
while (g_dnr_init_flag == 0) {
|
||||||
|
asm("nop");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// tile0
|
// tile0
|
||||||
// load the license key
|
// load the license key
|
||||||
// This function must be called before audio_ex3d_activate_key.
|
// This function must be called before audio_ex3d_activate_key.
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ extern uint32_t get_reference_time(void);
|
|||||||
extern void update_eq_post_gain(void);
|
extern void update_eq_post_gain(void);
|
||||||
extern unsigned int g_eq_sample_rate;
|
extern unsigned int g_eq_sample_rate;
|
||||||
extern unsigned g_windows_detect_done;
|
extern unsigned g_windows_detect_done;
|
||||||
|
extern unsigned g_dnr_init_flag;
|
||||||
|
extern unsigned g_ex3d_key_verified;
|
||||||
|
|
||||||
#pragma unsafe arrays
|
#pragma unsafe arrays
|
||||||
void dsp_core0(void)
|
void dsp_core0(void)
|
||||||
@@ -55,11 +57,31 @@ void dsp_core0(void)
|
|||||||
// EQ Flash存储初始化标志
|
// EQ Flash存储初始化标志
|
||||||
|
|
||||||
delay_milliseconds(300);
|
delay_milliseconds(300);
|
||||||
unsigned windows_detect_done;
|
unsigned windows_detect_done, dnr_init_flag, ex3d_key_verified;
|
||||||
GET_SHARED_GLOBAL(windows_detect_done, g_windows_detect_done);
|
GET_SHARED_GLOBAL(windows_detect_done, g_windows_detect_done);
|
||||||
while (windows_detect_done == 0) {
|
#if DNR_ENABLE
|
||||||
|
GET_SHARED_GLOBAL(dnr_init_flag, g_dnr_init_flag);
|
||||||
|
#endif
|
||||||
|
#if USE_EX3D
|
||||||
|
GET_SHARED_GLOBAL(ex3d_key_verified, g_ex3d_key_verified);
|
||||||
|
#endif
|
||||||
|
while ((windows_detect_done == 0)
|
||||||
|
#if DNR_ENABLE
|
||||||
|
|| (dnr_init_flag == 0)
|
||||||
|
#endif
|
||||||
|
#if USE_EX3D
|
||||||
|
|| (ex3d_key_verified == 0)
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
asm("nop");
|
asm("nop");
|
||||||
GET_SHARED_GLOBAL(windows_detect_done, g_windows_detect_done);
|
GET_SHARED_GLOBAL(windows_detect_done, g_windows_detect_done);
|
||||||
|
#if DNR_ENABLE
|
||||||
|
GET_SHARED_GLOBAL(dnr_init_flag, g_dnr_init_flag);
|
||||||
|
#endif
|
||||||
|
#if USE_EX3D
|
||||||
|
GET_SHARED_GLOBAL(ex3d_key_verified, g_ex3d_key_verified);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EQ_EN
|
#if EQ_EN
|
||||||
|
|||||||
@@ -570,6 +570,7 @@ int main()
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
SetEqDataChan(c_eq_data);
|
SetEqDataChan(c_eq_data);
|
||||||
|
delay_milliseconds(200);
|
||||||
key_sender(c_key);
|
key_sender(c_key);
|
||||||
for (int i = 0; i < DSP_WORKER_COUNT; i++)
|
for (int i = 0; i < DSP_WORKER_COUNT; i++)
|
||||||
uc_dsp_to_ex3d[i] = (chanend)c_dsp_to_ex3d[i];
|
uc_dsp_to_ex3d[i] = (chanend)c_dsp_to_ex3d[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user