enable eq2
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
#include "xua.h"
|
#include "xua.h"
|
||||||
#include <print.h>
|
#include <print.h>
|
||||||
|
#include "xc_ptr.h"
|
||||||
|
|
||||||
#if defined (CODEC_AIC3204)
|
#if defined (CODEC_AIC3204)
|
||||||
#include "codec_ti3204.h"
|
#include "codec_ti3204.h"
|
||||||
@@ -321,9 +322,23 @@ void AudioHwRemote(chanend c)
|
|||||||
AudioHwRemote2(c, i2c[0]);
|
AudioHwRemote2(c, i2c[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define EQ_MODE_DELAY (20000000) //100ms delay
|
||||||
|
#define EQ_SYNC_DELAY (50000000) //500ms delay for EQ parameter syn
|
||||||
|
|
||||||
void AudioHwRemote2(chanend c, client interface i2c_master_if i2c)
|
void AudioHwRemote2(chanend c, client interface i2c_master_if i2c)
|
||||||
{
|
{
|
||||||
unsigned cmd;
|
unsigned cmd;
|
||||||
|
unsigned eq_mode_time = 0;
|
||||||
|
timer eq_mode_timer, eq_sync_timer;
|
||||||
|
unsigned eq_sync_time = 0;
|
||||||
|
|
||||||
|
eq_mode_timer :> eq_mode_time;
|
||||||
|
eq_mode_time += EQ_MODE_DELAY;
|
||||||
|
eq_sync_timer :> eq_sync_time;
|
||||||
|
eq_sync_time += EQ_SYNC_DELAY;
|
||||||
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
select {
|
select {
|
||||||
case c :> cmd:
|
case c :> cmd:
|
||||||
@@ -339,6 +354,46 @@ void AudioHwRemote2(chanend c, client interface i2c_master_if i2c)
|
|||||||
CODEC_IC_REGWRITE(regAddr, regVal, i2c);
|
CODEC_IC_REGWRITE(regAddr, regVal, i2c);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#if EQ_EN
|
||||||
|
case eq_mode_timer when timerafter(eq_mode_time) :> void :
|
||||||
|
eq_mode_time += EQ_MODE_DELAY;
|
||||||
|
unsigned request_eq_mode, new_eq_mode;
|
||||||
|
unsigned force_request_mode_change;
|
||||||
|
GET_SHARED_GLOBAL(request_eq_mode, g_request_eq_mode);
|
||||||
|
GET_SHARED_GLOBAL(new_eq_mode, g_new_eq_mode);
|
||||||
|
GET_SHARED_GLOBAL(force_request_mode_change, g_force_request_eq_mode_change);
|
||||||
|
if (new_eq_mode != request_eq_mode)
|
||||||
|
{
|
||||||
|
SET_SHARED_GLOBAL(g_new_eq_mode, request_eq_mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (force_request_mode_change == 1)
|
||||||
|
{
|
||||||
|
SET_SHARED_GLOBAL(g_force_eq_mode_change, 1);
|
||||||
|
SET_SHARED_GLOBAL(g_force_request_eq_mode_change, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#if 0
|
||||||
|
case eq_sync_timer when timerafter(eq_sync_time) :> void :
|
||||||
|
eq_sync_time += EQ_SYNC_DELAY;
|
||||||
|
|
||||||
|
// 使用单参数存储系统保存脏参数(独立保存EQ参数)
|
||||||
|
if (eq_save_dirty_params() == 0) {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
|
||||||
|
// 独立保存脏的增益
|
||||||
|
if (eq_save_dirty_gain() == 0) {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
|
||||||
|
// 独立保存脏的模式名称
|
||||||
|
if (eq_save_dirty_names() == 0) {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ class EQDesigner(QMainWindow):
|
|||||||
self.show_qshift_debug = False # 默认不显示qshift调试信息
|
self.show_qshift_debug = False # 默认不显示qshift调试信息
|
||||||
self.current_mode = 0 # 初始化当前模式为0
|
self.current_mode = 0 # 初始化当前模式为0
|
||||||
self.total_bshift = 0 # 初始化total_bshift为0
|
self.total_bshift = 0 # 初始化total_bshift为0
|
||||||
self.log_level = LOG_LEVEL_VERBOSE # 设置默认日志级别
|
self.log_level = LOG_LEVEL_WARN # 设置默认日志级别
|
||||||
|
|
||||||
# 创建主窗口部件
|
# 创建主窗口部件
|
||||||
main_widget = QWidget()
|
main_widget = QWidget()
|
||||||
@@ -711,7 +711,6 @@ class EQDesigner(QMainWindow):
|
|||||||
import time
|
import time
|
||||||
time.sleep(0.05) # 等待设备响应
|
time.sleep(0.05) # 等待设备响应
|
||||||
reply = h.get_input_report(0x1, 64) # 64字节响应
|
reply = h.get_input_report(0x1, 64) # 64字节响应
|
||||||
print(reply)
|
|
||||||
if reply and len(reply) == 64:
|
if reply and len(reply) == 64:
|
||||||
# 检查Report ID和同步头
|
# 检查Report ID和同步头
|
||||||
if reply[0] == 0x01 and reply[1] == 0x77 and reply[2] == 0x8B:
|
if reply[0] == 0x01 and reply[1] == 0x77 and reply[2] == 0x8B:
|
||||||
|
|||||||
Reference in New Issue
Block a user