Compare commits
No commits in common. "2cc53ca4f5793b13bea011fa2df200887700042c" and "d9902acf4388349563439309d1fe10e158ad852d" have entirely different histories.
2cc53ca4f5
...
d9902acf43
53
README.md
53
README.md
|
@ -18,58 +18,17 @@ In order to program the buds from inside of the docker container; privileged mod
|
|||
./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 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.
|
||||
# You may need to take the buds out of the case, wait three seconds, place them back. This wakes them up.
|
||||
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 opeen 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 200000 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
|
||||
+ 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 200000 to match stock firmware
|
||||
|
||||
## 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 audio alerts are stored in:
|
||||
|
||||
`config/_default_cfg_src_/res/en/`
|
||||
|
||||
You can convert these .txt files to .wav files by using the script `convert.sh` with the -T flag, the resulting file will be named `output.wav`.
|
||||
If you want to change the alert to a custom sound use the -W flag on your wav file and then move the resulting `SOUND.txt` file to the place you want to replace (eg. `config/_default_cfg_src_/res/en/SOUND_POWER_ON.txt`)
|
||||
|
|
|
@ -401,7 +401,6 @@ int app_battery_handle_process_charging(uint32_t status, union APP_BATTERY_MSG_
|
|||
{
|
||||
TRACE(1,"FULL_CHARGING:%d", app_battery_measure.currvolt);
|
||||
app_status_indication_set(APP_STATUS_INDICATION_FULLCHARGE);
|
||||
app_shutdown();
|
||||
#ifdef MEDIA_PLAYER_SUPPORT
|
||||
#if defined(BT_USB_AUDIO_DUAL_MODE) || defined(IBRT)
|
||||
#else
|
||||
|
|
|
@ -786,6 +786,21 @@ void app_bt_key_enter_nosignal_mode(APP_KEY_STATUS *status, void *param)
|
|||
}
|
||||
}
|
||||
|
||||
void app_bt_singleclick(APP_KEY_STATUS *status, void *param)
|
||||
{
|
||||
TRACE(3,"%s %d,%d",__func__, status->code, status->event);
|
||||
}
|
||||
|
||||
void app_bt_doubleclick(APP_KEY_STATUS *status, void *param)
|
||||
{
|
||||
TRACE(3,"%s %d,%d",__func__, status->code, status->event);
|
||||
}
|
||||
|
||||
void app_power_off(APP_KEY_STATUS *status, void *param)
|
||||
{
|
||||
TRACE(0,"app_power_off\n");
|
||||
}
|
||||
|
||||
extern "C" void OS_NotifyEvm(void);
|
||||
|
||||
#define PRESS_KEY_TO_ENTER_OTA_INTERVEL (15000) // press key 15s enter to ota
|
||||
|
@ -1354,190 +1369,37 @@ void app_latency_switch_key_handler(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* handling of touch events when the devices are turned on
|
||||
|
||||
* Both pods active:
|
||||
|
||||
* Right Ear:
|
||||
* Single tap : Play/Pause
|
||||
* Double tap : Next track
|
||||
* Hold : ANC on/off
|
||||
* Triple tap : Volume Up
|
||||
*
|
||||
* Left Ear:
|
||||
* Single tap : Play/Pause
|
||||
* Double tap : Previous track
|
||||
* Hold : ANC on/off
|
||||
* 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
|
||||
|
||||
|
||||
|
||||
* We use app_ibrt_if_start_user_action for handling actions, as this will apply locally if we are link master
|
||||
* OR send it over the link to the other bud if we are not
|
||||
*/
|
||||
|
||||
void send_vol_up(void){
|
||||
uint8_t action[] = {IBRT_ACTION_LOCAL_VOLUP};
|
||||
app_ibrt_if_start_user_action(action, sizeof(action));
|
||||
}
|
||||
void send_play_pause(void){
|
||||
if (app_bt_device.a2dp_play_pause_flag!=0) {
|
||||
uint8_t action[] = {IBRT_ACTION_PAUSE};
|
||||
app_ibrt_if_start_user_action(action, sizeof(action));
|
||||
}else {
|
||||
uint8_t action[] = {IBRT_ACTION_PLAY};
|
||||
app_ibrt_if_start_user_action(action, sizeof(action));
|
||||
}
|
||||
}
|
||||
void send_vol_down(void){
|
||||
uint8_t action[] = {IBRT_ACTION_LOCAL_VOLDN};
|
||||
app_ibrt_if_start_user_action(action, sizeof(action));
|
||||
}
|
||||
|
||||
void send_next_track(void){
|
||||
uint8_t action[] = {IBRT_ACTION_FORWARD};
|
||||
app_ibrt_if_start_user_action(action, sizeof(action));
|
||||
}
|
||||
|
||||
void send_prev_track(void){
|
||||
uint8_t action[] = {IBRT_ACTION_BACKWARD};
|
||||
app_ibrt_if_start_user_action(action, sizeof(action));
|
||||
}
|
||||
void app_key_single_tap(APP_KEY_STATUS *status, void *param){
|
||||
TRACE(2,"%s event %d", __func__, status->event);
|
||||
|
||||
if (!app_tws_ibrt_tws_link_connected()){
|
||||
//No other bud paired
|
||||
TRACE(0,"Handling %s in single bud mode",__func__);
|
||||
send_play_pause();
|
||||
}else {
|
||||
//Bud's are working as a pair
|
||||
if (app_tws_is_left_side()){
|
||||
TRACE(0,"Handling %s as left bud",__func__);
|
||||
//Lefty
|
||||
send_play_pause();
|
||||
}else {
|
||||
TRACE(0,"Handling %s as right bud",__func__);
|
||||
//Righty
|
||||
send_play_pause();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void app_key_double_tap(APP_KEY_STATUS *status, void *param){
|
||||
TRACE(2,"%s event %d", __func__, status->event);
|
||||
|
||||
if (!app_tws_ibrt_tws_link_connected()){
|
||||
//No other bud paired
|
||||
TRACE(0,"Handling %s in single bud mode",__func__);
|
||||
send_next_track();
|
||||
}else {
|
||||
//Bud's are working as a pair
|
||||
if (app_tws_is_left_side()){
|
||||
TRACE(0,"Handling %s as left bud",__func__);
|
||||
//Lefty
|
||||
send_prev_track();
|
||||
}else {
|
||||
TRACE(0,"Handling %s as right bud",__func__);
|
||||
//Righty
|
||||
send_next_track();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void app_key_triple_tap(APP_KEY_STATUS *status, void *param){
|
||||
TRACE(2,"%s event %d", __func__, status->event);
|
||||
|
||||
if (!app_tws_ibrt_tws_link_connected()){
|
||||
//No other bud paired
|
||||
TRACE(0,"Handling %s in single bud mode",__func__);
|
||||
send_vol_up();
|
||||
}else {
|
||||
//Bud's are working as a pair
|
||||
if (app_tws_is_left_side()){
|
||||
TRACE(0,"Handling %s as left bud",__func__);
|
||||
//Lefty
|
||||
send_vol_down();
|
||||
}else {
|
||||
TRACE(0,"Handling %s as right bud",__func__);
|
||||
//Righty
|
||||
send_vol_up();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void app_key_quad_tap(APP_KEY_STATUS *status, void *param){
|
||||
TRACE(2,"%s event %d", __func__, status->event);
|
||||
|
||||
if (!app_tws_ibrt_tws_link_connected()){
|
||||
//No other bud paired
|
||||
TRACE(0,"Handling %s in single bud mode",__func__);
|
||||
send_vol_down();
|
||||
}else {
|
||||
//Bud's are working as a pair
|
||||
if (app_tws_is_left_side()){
|
||||
TRACE(0,"Handling %s as left bud",__func__);
|
||||
//Lefty
|
||||
}else {
|
||||
TRACE(0,"Handling %s as right bud",__func__);
|
||||
//Righty
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void app_key_long_press_down(APP_KEY_STATUS *status, void *param)
|
||||
void app_bt_function_key(APP_KEY_STATUS *status, void *param)
|
||||
{
|
||||
TRACE(2,"%s event %d", __func__, status->event);
|
||||
|
||||
if (!app_tws_ibrt_tws_link_connected()){
|
||||
//No other bud paired
|
||||
TRACE(0,"Handling %s in single bud mode",__func__);
|
||||
send_prev_track();
|
||||
}else {
|
||||
//Bud's are working as a pair
|
||||
app_anc_key(status,param);
|
||||
bt_key_send(status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void app_key_reboot(APP_KEY_STATUS *status, void *param)
|
||||
{
|
||||
TRACE(1,"%s ",__func__);
|
||||
hal_cmu_sys_reboot();
|
||||
}
|
||||
|
||||
|
||||
void app_key_init(void)
|
||||
{
|
||||
#if defined(IBRT_TESTMODE)
|
||||
app_ibrt_ui_test_key_init();
|
||||
#else
|
||||
uint8_t i = 0;
|
||||
TRACE(1,"%s",__func__);
|
||||
|
||||
const APP_KEY_HANDLE key_cfg[] = {
|
||||
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_CLICK},"",app_key_single_tap, NULL},
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_DOUBLECLICK},"",app_key_double_tap, NULL},
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_TRIPLECLICK},"",app_key_triple_tap, NULL},
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_ULTRACLICK},"",app_key_quad_tap, NULL},
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_LONGPRESS},"",app_key_long_press_down, NULL},
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_CLICK},"bt function key",app_bt_function_key, NULL},
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_DOUBLECLICK},"bt function key",app_bt_function_key, NULL},
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_LONGPRESS},"bt function key",app_bt_function_key, NULL},
|
||||
{{APP_KEY_CODE_PWR,APP_KEY_EVENT_TRIPLECLICK},"bt anc key",app_anc_key, NULL},
|
||||
};
|
||||
|
||||
app_key_handle_clear();
|
||||
for (i=0; i<(sizeof(key_cfg)/sizeof(APP_KEY_HANDLE)); i++){
|
||||
app_key_handle_registration(&key_cfg[i]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void app_key_reboot(APP_KEY_STATUS *status, void *param)
|
||||
{
|
||||
TRACE(1,"%s ",__func__);
|
||||
hal_cmu_sys_reboot();
|
||||
}
|
||||
|
||||
void app_key_init_on_charging(void)
|
||||
|
@ -1924,8 +1786,7 @@ int app_deinit(int deinit_case)
|
|||
{
|
||||
int nRet = 0;
|
||||
TRACE(2,"%s case:%d",__func__, deinit_case);
|
||||
app_tws_if_trigger_role_switch();
|
||||
osDelay(200); // This is a hack; a hackkitttyy hack. To wait for the tws exchange to occur
|
||||
|
||||
#ifdef WL_DET
|
||||
app_mic_alg_audioloop(false,APP_SYSFREQ_78M);
|
||||
#endif
|
||||
|
|
|
@ -97,14 +97,14 @@ int app_status_indication_set(APP_STATUS_INDICATION_T status)
|
|||
struct APP_PWL_CFG_T cfg0;
|
||||
struct APP_PWL_CFG_T cfg1;
|
||||
|
||||
TRACE(2,"%s %d",__func__, status);
|
||||
|
||||
if (app_status == status)
|
||||
return 0;
|
||||
|
||||
if (app_status_ind_filter == status)
|
||||
return 0;
|
||||
|
||||
TRACE(2,"%s %d",__func__, status);
|
||||
|
||||
app_status = status;
|
||||
memset(&cfg0, 0, sizeof(struct APP_PWL_CFG_T));
|
||||
memset(&cfg1, 0, sizeof(struct APP_PWL_CFG_T));
|
||||
|
@ -160,7 +160,6 @@ int app_status_indication_set(APP_STATUS_INDICATION_T status)
|
|||
app_pwl_start(APP_PWL_ID_1);
|
||||
break;
|
||||
case APP_STATUS_INDICATION_CONNECTING:
|
||||
// LED's alternating Red/Blue
|
||||
cfg0.part[0].level = 1;
|
||||
cfg0.part[0].time = (300);
|
||||
cfg0.part[1].level = 0;
|
||||
|
@ -213,32 +212,25 @@ int app_status_indication_set(APP_STATUS_INDICATION_T status)
|
|||
app_pwl_start(APP_PWL_ID_1);
|
||||
break;
|
||||
case APP_STATUS_INDICATION_FULLCHARGE:
|
||||
cfg0.part[0].level = 0;
|
||||
cfg0.part[0].level = 1;
|
||||
cfg0.part[0].time = (5000);
|
||||
cfg0.parttotal = 1;
|
||||
cfg0.startlevel = 1;
|
||||
cfg0.periodic = false;
|
||||
cfg0.periodic = true;
|
||||
app_pwl_setup(APP_PWL_ID_0, &cfg0);
|
||||
app_pwl_start(APP_PWL_ID_0);
|
||||
app_pwl_setup(APP_PWL_ID_1, &cfg0);
|
||||
app_pwl_start(APP_PWL_ID_1);
|
||||
break;
|
||||
case APP_STATUS_INDICATION_POWEROFF:
|
||||
cfg1.part[0].level = 0;
|
||||
cfg1.part[0].time = (100);
|
||||
cfg1.parttotal = 1;
|
||||
cfg1.part[0].level = 1;
|
||||
cfg1.part[0].time = (3000);
|
||||
cfg1.part[1].level = 0;
|
||||
cfg1.part[1].time = (200);
|
||||
cfg1.parttotal = 2;
|
||||
cfg1.startlevel = 1;
|
||||
cfg1.periodic = false;
|
||||
cfg0.part[0].level = 0;
|
||||
cfg0.part[0].time = (100);
|
||||
cfg0.parttotal = 1;
|
||||
cfg0.startlevel = 1;
|
||||
cfg0.periodic = false;
|
||||
|
||||
app_pwl_setup(APP_PWL_ID_1, &cfg1);
|
||||
app_pwl_start(APP_PWL_ID_1);
|
||||
app_pwl_setup(APP_PWL_ID_0, &cfg0);
|
||||
app_pwl_start(APP_PWL_ID_0);
|
||||
break;
|
||||
case APP_STATUS_INDICATION_CHARGENEED:
|
||||
cfg1.part[0].level = 1;
|
||||
|
|
|
@ -315,7 +315,7 @@ export TX_IQ_CAL ?= 0
|
|||
|
||||
export BT_XTAL_SYNC ?= 1
|
||||
|
||||
export BTADDR_FOR_DEBUG ?= 0
|
||||
export BTADDR_FOR_DEBUG ?= 1
|
||||
|
||||
export POWERKEY_I2C_SWITCH ?=0
|
||||
|
||||
|
@ -331,7 +331,7 @@ export DUMP_NORMAL_LOG ?= 0
|
|||
|
||||
SUPPORT_BATTERY_REPORT ?= 1
|
||||
|
||||
SUPPORT_HF_INDICATORS ?= 1
|
||||
SUPPORT_HF_INDICATORS ?= 0
|
||||
|
||||
SUPPORT_SIRI ?= 1
|
||||
|
||||
|
@ -425,7 +425,7 @@ KBUILD_CFLAGS +=
|
|||
|
||||
LIB_LDFLAGS += -lstdc++ -lsupc++
|
||||
|
||||
export BTIF_HID_DEVICE ?= 0
|
||||
export BTIF_HID_DEVICE ?= 1
|
||||
ifeq ($(BTIF_HID_DEVICE),1)
|
||||
KBUILD_CPPFLAGS += -DBTIF_HID_DEVICE
|
||||
endif
|
||||
|
|
|
@ -988,21 +988,13 @@ const struct_anc_cfg * anc_coef_list_44p1k[ANC_COEF_LIST_NUM] = {
|
|||
const IIR_CFG_T audio_eq_sw_iir_cfg = {
|
||||
.gain0 = 0,
|
||||
.gain1 = 0,
|
||||
.num = 13,
|
||||
.num = 5,
|
||||
.param = {
|
||||
{IIR_TYPE_PEAK, -2.2, 10, 2},
|
||||
{IIR_TYPE_PEAK, 5.1, 21, 2},
|
||||
{IIR_TYPE_PEAK, 0.9, 42, 2},
|
||||
{IIR_TYPE_PEAK, -6, 83, 2},
|
||||
{IIR_TYPE_PEAK, -6, 166, 2},
|
||||
{IIR_TYPE_PEAK, -4.6, 333, 2},
|
||||
{IIR_TYPE_PEAK, -2, 577, 2},
|
||||
{IIR_TYPE_PEAK, -0.7, 1000, 2},
|
||||
{IIR_TYPE_PEAK, 1.7, 2000, 2},
|
||||
{IIR_TYPE_PEAK, 3.2, 4000, 2},
|
||||
{IIR_TYPE_PEAK, -5.6, 8000, 2},
|
||||
{IIR_TYPE_PEAK, 10.1, 16000, 2},
|
||||
{IIR_TYPE_PEAK, 5.9, 20000, 2},
|
||||
{IIR_TYPE_PEAK, .0, 200, 2},
|
||||
{IIR_TYPE_PEAK, .0, 600, 2},
|
||||
{IIR_TYPE_PEAK, .0, 2000.0, 2},
|
||||
{IIR_TYPE_PEAK, .0, 6000.0, 2},
|
||||
{IIR_TYPE_PEAK, .0, 12000.0, 2}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1045,21 +1037,59 @@ const FIR_CFG_T * const audio_eq_hw_fir_cfg_list[EQ_HW_FIR_LIST_NUM]={
|
|||
};
|
||||
|
||||
//hardware dac iir eq
|
||||
const IIR_CFG_T audio_eq_hw_dac_iir_cfg = audio_eq_sw_iir_cfg;
|
||||
const IIR_CFG_T audio_eq_hw_dac_iir_cfg = {
|
||||
.gain0 = 0,
|
||||
.gain1 = 0,
|
||||
.num = 8,
|
||||
.param = {
|
||||
{IIR_TYPE_PEAK, 0, 1000.0, 0.7},
|
||||
{IIR_TYPE_PEAK, 0, 1000.0, 0.7},
|
||||
{IIR_TYPE_PEAK, 0, 1000.0, 0.7},
|
||||
{IIR_TYPE_PEAK, 0, 1000.0, 0.7},
|
||||
{IIR_TYPE_PEAK, 0, 1000.0, 0.7},
|
||||
{IIR_TYPE_PEAK, 0, 1000.0, 0.7},
|
||||
{IIR_TYPE_PEAK, 0, 1000.0, 0.7},
|
||||
{IIR_TYPE_PEAK, 0, 1000.0, 0.7},
|
||||
}
|
||||
};
|
||||
|
||||
const IIR_CFG_T * const POSSIBLY_UNUSED audio_eq_hw_dac_iir_cfg_list[EQ_HW_DAC_IIR_LIST_NUM]={
|
||||
&audio_eq_hw_dac_iir_cfg,
|
||||
};
|
||||
|
||||
//hardware dac iir eq
|
||||
const IIR_CFG_T audio_eq_hw_adc_iir_adc_cfg = audio_eq_sw_iir_cfg;
|
||||
const IIR_CFG_T audio_eq_hw_adc_iir_adc_cfg = {
|
||||
.gain0 = 0,
|
||||
.gain1 = 0,
|
||||
.num = 1,
|
||||
.param = {
|
||||
{IIR_TYPE_PEAK, 0.0, 1000.0, 0.7},
|
||||
}
|
||||
};
|
||||
|
||||
const IIR_CFG_T * const POSSIBLY_UNUSED audio_eq_hw_adc_iir_cfg_list[EQ_HW_ADC_IIR_LIST_NUM]={
|
||||
&audio_eq_hw_adc_iir_adc_cfg,
|
||||
};
|
||||
|
||||
|
||||
|
||||
//hardware iir eq
|
||||
const IIR_CFG_T audio_eq_hw_iir_cfg = audio_eq_sw_iir_cfg;
|
||||
const IIR_CFG_T audio_eq_hw_iir_cfg = {
|
||||
.gain0 = 0,
|
||||
.gain1 = 0,
|
||||
.num = 8,
|
||||
.param = {
|
||||
{IIR_TYPE_PEAK, -10.1, 100.0, 7},
|
||||
{IIR_TYPE_PEAK, -10.1, 400.0, 7},
|
||||
{IIR_TYPE_PEAK, -10.1, 700.0, 7},
|
||||
{IIR_TYPE_PEAK, -10.1, 1000.0, 7},
|
||||
{IIR_TYPE_PEAK, -10.1, 3000.0, 7},
|
||||
{IIR_TYPE_PEAK, -10.1, 5000.0, 7},
|
||||
{IIR_TYPE_PEAK, -10.1, 7000.0, 7},
|
||||
{IIR_TYPE_PEAK, -10.1, 9000.0, 7},
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
const IIR_CFG_T * const POSSIBLY_UNUSED audio_eq_hw_iir_cfg_list[EQ_HW_IIR_LIST_NUM]={
|
||||
&audio_eq_hw_iir_cfg,
|
||||
|
|
26
convert.sh
26
convert.sh
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh
|
||||
txt_to_wav() {
|
||||
xxd -r -p $args > out.raw
|
||||
ffmpeg -f sbc -ac 1 -i ./out.raw output.wav
|
||||
rm ./out.raw
|
||||
}
|
||||
|
||||
wav_to_txt() {
|
||||
ffmpeg -i $args -f sbc -ac 16000 -ac 1 -map_metadata -1 out.raw
|
||||
xxd -i ./out.raw | head -n -2 \
|
||||
| tail -n +2 | sed 's/ //g' \
|
||||
| tr --delete '\n' \
|
||||
| sed 's/,/\,\n/16; P; D' > SOUND.txt
|
||||
rm ./out.raw
|
||||
}
|
||||
|
||||
[ ${1} = "-T" ] || [ ${1} = "--txt-to-wav" ] && shift 1 && args=$@ && txt_to_wav && exit
|
||||
[ ${1} = "-W" ] || [ ${1} = "--wav-to-txt" ] && shift 1 && args=$@ && wav_to_txt && exit
|
||||
echo "
|
||||
Sound format converter:
|
||||
Usage:
|
||||
./convert.sh [option] [input-file]
|
||||
Options:
|
||||
-T or --txt-to-wav Converts the text file to a wav audio file (output.wav)
|
||||
-W or --wav-to-txt Converts a wav file to a file readable by the pinebuds firmware (SOUND.txt)
|
||||
"
|
16
download.sh
16
download.sh
|
@ -1,15 +1,7 @@
|
|||
#! /bin/bash
|
||||
|
||||
num=$(ls -l /dev/ttyACM* | rev | cut -c 1)
|
||||
num=$(ls -l /dev/ttyUSB* | rev | cut -c 1)
|
||||
#num=3
|
||||
echo com is:$num
|
||||
splitPorts=($num)
|
||||
echo "This tool assumes your buds are the only thing connected and are enumerated {right,left} order. YMMV"
|
||||
echo "Right bud is at ${splitPorts[0]}"
|
||||
echo "Left bud is at ${splitPorts[1]}"
|
||||
|
||||
echo "Please disconnect and reconnect the bud on the right"
|
||||
|
||||
bestool write-image out/open_source/open_source.bin --port /dev/ttyACM${splitPorts[0]}
|
||||
|
||||
echo "Please disconnect and reconnect the bud on the left"
|
||||
bestool write-image out/open_source/open_source.bin --port /dev/ttyACM${splitPorts[1]}
|
||||
sudo -S dldtool -c $num -f out/open_source/open_source.bin
|
||||
sudo minicom port$num
|
||||
|
|
|
@ -223,12 +223,12 @@ enum AUD_IO_PATH_T {
|
|||
AUD_IO_PATH_NULL = 0,
|
||||
|
||||
// Input path
|
||||
AUD_INPUT_PATH_MAINMIC, // Main User Mic
|
||||
AUD_INPUT_PATH_VADMIC, // Voice Activity Detection
|
||||
AUD_INPUT_PATH_ASRMIC, // Ambient Sound Reduction? (? Is this the external mic?)
|
||||
AUD_INPUT_PATH_MAINMIC,
|
||||
AUD_INPUT_PATH_VADMIC,
|
||||
AUD_INPUT_PATH_ASRMIC,
|
||||
AUD_INPUT_PATH_LINEIN,
|
||||
AUD_INPUT_PATH_NTMIC,
|
||||
AUD_INPUT_PATH_ANC_WNR, // Wind Noise Reduction
|
||||
AUD_INPUT_PATH_ANC_WNR,
|
||||
AUD_INPUT_PATH_USBAUDIO,
|
||||
#ifdef __ANC_ASSIST__
|
||||
AUD_INPUT_PATH_AF_ANC,
|
||||
|
|
|
@ -45,31 +45,31 @@ enum HAL_KEY_CODE_T {
|
|||
|
||||
enum HAL_KEY_EVENT_T {
|
||||
HAL_KEY_EVENT_NONE = 0,
|
||||
HAL_KEY_EVENT_DOWN, // 1
|
||||
HAL_KEY_EVENT_FIRST_DOWN, // 2
|
||||
HAL_KEY_EVENT_CONTINUED_DOWN, // 3
|
||||
HAL_KEY_EVENT_UP, // 4
|
||||
HAL_KEY_EVENT_UP_AFTER_LONGPRESS, // 5
|
||||
HAL_KEY_EVENT_LONGPRESS, // 6
|
||||
HAL_KEY_EVENT_LONGLONGPRESS, // 7
|
||||
HAL_KEY_EVENT_CLICK, // 8
|
||||
HAL_KEY_EVENT_DOUBLECLICK, // 9
|
||||
HAL_KEY_EVENT_TRIPLECLICK, // 10
|
||||
HAL_KEY_EVENT_ULTRACLICK, // 11
|
||||
HAL_KEY_EVENT_RAMPAGECLICK, // 12
|
||||
HAL_KEY_EVENT_SIXTHCLICK, // 13
|
||||
HAL_KEY_EVENT_SEVENTHCLICK, // 14
|
||||
HAL_KEY_EVENT_EIGHTHCLICK, // 15
|
||||
HAL_KEY_EVENT_NINETHCLICK, // 16
|
||||
HAL_KEY_EVENT_TENTHCLICK, // 17
|
||||
HAL_KEY_EVENT_REPEAT, // 18
|
||||
HAL_KEY_EVENT_GROUPKEY_DOWN, // 19
|
||||
HAL_KEY_EVENT_GROUPKEY_REPEAT, // 20
|
||||
HAL_KEY_EVENT_INITDOWN, // 21
|
||||
HAL_KEY_EVENT_INITUP, // 22
|
||||
HAL_KEY_EVENT_INITLONGPRESS, // 23
|
||||
HAL_KEY_EVENT_INITLONGLONGPRESS, // 24
|
||||
HAL_KEY_EVENT_INITFINISHED, // 25
|
||||
HAL_KEY_EVENT_DOWN,
|
||||
HAL_KEY_EVENT_FIRST_DOWN,
|
||||
HAL_KEY_EVENT_CONTINUED_DOWN,
|
||||
HAL_KEY_EVENT_UP,
|
||||
HAL_KEY_EVENT_UP_AFTER_LONGPRESS,
|
||||
HAL_KEY_EVENT_LONGPRESS,
|
||||
HAL_KEY_EVENT_LONGLONGPRESS,
|
||||
HAL_KEY_EVENT_CLICK,
|
||||
HAL_KEY_EVENT_DOUBLECLICK,
|
||||
HAL_KEY_EVENT_TRIPLECLICK,
|
||||
HAL_KEY_EVENT_ULTRACLICK,
|
||||
HAL_KEY_EVENT_RAMPAGECLICK,
|
||||
HAL_KEY_EVENT_SIXTHCLICK,
|
||||
HAL_KEY_EVENT_SEVENTHCLICK,
|
||||
HAL_KEY_EVENT_EIGHTHCLICK,
|
||||
HAL_KEY_EVENT_NINETHCLICK,
|
||||
HAL_KEY_EVENT_TENTHCLICK,
|
||||
HAL_KEY_EVENT_REPEAT,
|
||||
HAL_KEY_EVENT_GROUPKEY_DOWN,
|
||||
HAL_KEY_EVENT_GROUPKEY_REPEAT,
|
||||
HAL_KEY_EVENT_INITDOWN,
|
||||
HAL_KEY_EVENT_INITUP,
|
||||
HAL_KEY_EVENT_INITLONGPRESS,
|
||||
HAL_KEY_EVENT_INITLONGLONGPRESS,
|
||||
HAL_KEY_EVENT_INITFINISHED,
|
||||
|
||||
HAL_KEY_EVENT_NUM,
|
||||
};
|
||||
|
|
|
@ -4840,17 +4840,6 @@ uint32_t app_bt_restore_hid_app_ctx(uint8_t *buf)
|
|||
|
||||
return offset;
|
||||
}
|
||||
#else
|
||||
uint32_t app_bt_restore_hid_app_ctx(uint8_t *buf)
|
||||
{return 4;}
|
||||
uint32_t app_bt_save_hid_app_ctx(uint8_t *buf)
|
||||
{
|
||||
buf[0]=0;
|
||||
buf[1]=0;
|
||||
buf[2]=0;
|
||||
buf[3]=0;
|
||||
return 4;}
|
||||
|
||||
#endif
|
||||
#endif /* ENHANCED_STACK */
|
||||
|
||||
|
|
|
@ -229,8 +229,10 @@ uint32_t app_bt_restore_spp_app_ctx(uint8_t *buf, uint32_t buf_len, uint32_t app
|
|||
uint32_t app_bt_save_map_app_ctx(btif_remote_device_t *rem_dev, uint8_t *buf, uint32_t buf_len);
|
||||
uint32_t app_bt_restore_map_app_ctx(uint8_t *buf, uint32_t buf_len);
|
||||
#endif
|
||||
uint32_t app_bt_restore_hid_app_ctx(uint8_t *buf);
|
||||
#ifdef BTIF_HID_DEVICE
|
||||
uint32_t app_bt_save_hid_app_ctx(uint8_t *buf);
|
||||
uint32_t app_bt_restore_hid_app_ctx(uint8_t *buf);
|
||||
#endif
|
||||
#endif /* ENHANCED_STACK */
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue