Index: d.bat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/d.bat	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/d.bat	(working copy)
@@ -0,0 +1,8 @@
+call do.bat eep
+e pu
+e 8070 00000000000000000000
+e 807a 00000000000000000000
+e 8070 3e6c6d   
+e ep output/eeprom.dat
+e er 0 10
+e ku
Index: do.bat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/do.bat	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/do.bat	(working copy)
@@ -0,0 +1,100 @@
+@set FPGA_PATH=fpgajic\fpga
+@set ROM_PATH=.
+@set MV_PATCH=mv\src\yichip
+@set YC_PATCH_FILE=yc_patch_yc1021.h
+@set enc=1
+@set enckey=0000000000000000
+@rem set device_option=rfbqb
+@set device_option=mouse
+@rem set device_option=shutter
+@rem set device_option=hci
+@rem set device_option=antilost
+@rem set device_option=dongle
+@rem set device_option=module
+@rem set device_option=car
+@rem set device_option=remote_car
+@rem set device_option=mesh
+@echo off
+
+setlocal enabledelayedexpansion
+for %%f in (program\ble_protocol_stack\*.prog) do @set progs=!progs! %%f
+for %%f in (program\g24_protocol_stack\*.prog) do @set progs=!progs! %%f
+for %%f in (program\mesh_protocol_stack\*.prog) do @set progs=!progs! %%f
+for %%f in (program\*.prog) do @if not %%f==program\bt.prog if not %%f==program\patch.prog if not %%f==program\sim.prog set progs=!progs! %%f
+type program\bt.prog %progs% > output\bt_program23.meta
+
+::for %%f in (format\peipherals_config\*.format) do set fmts=!fmts! %%f
+for %%f in (format\ble_protocol_stack\*.format) do set fmts=!fmts! %%f
+for %%f in (format\g24_protocol_stack\*.format) do set fmts=!fmts! %%f
+for %%f in (format\mesh_protocol_stack\*.format) do set fmts=!fmts! %%f
+for %%f in (format\*.format) do @if not %%f==format\bt.format if not %%f==format\command.format set fmts=!fmts! %%f
+type format\bt.format %fmts% format\command.format > output\bt_format.meta
+::perl util/memalloc.pl output/bt_format.meta
+
+if "%device_option%" equ "hci" (
+  copy sched\hci_boot.dat output\sched.rom
+) else if "%device_option%" equ "mouse" (
+  copy sched\mouse.dat output\sched.rom
+) else if "%device_option%" equ "module" (
+  copy sched\DM_module.dat + sched\1308.dat output\sched.rom
+) else if "%device_option%" equ "shutter" (
+  copy sched\shutter.dat output\sched.rom
+) else if "%device_option%" equ "antilost" (
+  copy sched\antilost.dat + sched\1308.dat output\sched.rom
+) else if "%device_option%" equ "dongle" (
+  copy sched\dongle.dat output\sched.rom
+) else if "%device_option%" equ "car" (
+  copy sched\car.dat + sched\1308.dat output\sched.rom
+) else if "%device_option%" equ "remote_car" (
+  copy sched\remote_car.dat + sched\1308.dat output\sched.rom
+) else if "%device_option%" equ "esl" (
+  copy sched\esl.dat + sched\1308.dat output\sched.rom  
+ ) else if "%device_option%" equ "mesh" (
+  copy sched\mesh.dat output\sched.rom
+) else (
+
+cd ..
+echo **********************************
+echo Error: illegal device_option !
+echo **********************************
+goto end
+) 
+
+perl util/mergepatch.pl 
+
+cd output
+osiuasm bt_program23 -O-W
+
+::geneep -n -k key.dat
+echo no c51 code
+geneep -n
+::echo exist c51 code
+::geneep
+
+
+create_exen.pl 1  1024 64
+
+
+if "%device_option%" equ "mouse" (
+cd ..\output
+copy eeprom.dat ..\util\eeprom.dat
+cd ..\util
+eeprom2fulleeprom.exe eeprom.dat 64>compare2.dat
+crc16.exe compare2.dat 2 >..\output\eeprom.dat
+del eeprom.dat
+del compare2.dat
+cd ..\output
+copy eeprom.dat ..\output\flash.dat 
+
+)
+
+
+if "%device_option%" equ "module" (
+	perl eeprom2hciimage_1021s.pl
+
+)
+:: perl ..\util\eeprom2hciimage.pl
+:: perl ..\util\bin2array.pl > bt_patch.h
+
+:end
+
Index: format/Hid.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/Hid.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/Hid.format	(working copy)
@@ -0,0 +1,21 @@
+
+(
+/*HID TYPE*/
+0x01 HID_TYPE_CONTROL
+0x04 HID_TYPE_GET_REPORT
+0x05 HID_TYPE_SET_REPORT
+0x07 HID_TYPE_SET_PROTOCOL
+0x09 HID_TYPE_SET_IDLE
+0x0a HID_TYPE_DATA
+/*HID REPORT ID*/
+0x01 HID_REPORT_ID_KB
+
+0x00 HID_CONTROL_P_NOOPERATION
+0x01 HID_CONTROL_P_HARDRESET
+0x02 HID_CONTROL_P_SOFTRESET
+0x03 HID_CONTROL_P_SUSPEND
+0x04 HID_CONTROL_P_EXITSUSPEND
+0x05 HID_CONTROL_P_VIRTUALCABLEUNPLUG
+)
+
+
Index: format/app.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app.format	(working copy)
@@ -0,0 +1,385 @@
+
+memalloc(
+
+/* load code */
+1 mem_ucode_status
+1 mem_spid_tbuf				/* spid buf: 03 addr[23:16] addr[15:8] addr[7:0] */
+0 mem_iicd_tbuf				/* iicd buf: iic_adr addr[15:8] addr[7:0] iic_adr */
+1 mem_addr_hi
+1 mem_addr_mi
+1 mem_addr_lo
+1 mem_iicd_addr
+4 mem_spid_rbuf
+2 mem_ucode_buf
+2 mem_ucode_len
+2 mem_sched_addr
+2 mem_ucode_ptr
+16 mem_ucode_keybuf
+
+1 mem_spid2_tbuf
+1 mem_addr_hi2
+1 mem_addr_mi2
+1 mem_addr_lo2
+4 mem_spid2_rbuf
+1 mem_reconnect_flag
+1 mem_switch_fail_master_count
+1 mem_app_evt_timer_count
+)
+
+xmemalloc(
+1 mem_app_handshake_flag
+2 mem_sniff_param_interval
+2 mem_sniff_param_attempt
+2 mem_sniff_param_timeout
+
+/*App Callback Functons*/
+2 mem_cb_check_wakelock
+2 mem_cb_before_hibernate
+2 mem_cb_before_lpm
+2 mem_cb_le_process
+2 mem_cb_bt_process
+2 mem_cb_idle_process
+2 mem_cb_bb_event_process
+2 mem_cb_discovry_timeout
+2 mem_cb_att_write
+2 mem_cb_ble_transmit
+2 mem_cb_event_timer
+2 mem_cb_bt_set_mult
+2 mem_cb_spi_flash_write_complate
+2 mem_cb_spi2_flash_write_complate
+2 mem_cb_bt_slave_match
+
+
+2 mem_eeprom_base
+
+1 mem_unsniff2sniff_timer_count
+//lpm mode
+1 mem_wake_up_delay_timer
+
+1 mem_app_connection_options
+
+//
+2 mem_app_disconn_reason
+2 mem_app_disconn_reason_flag
+1 mem_xrecord_mode
+
+1 mem_eeprom_block_size
+1 mem_spi_init_clk
+1 mem_spi_init_delay_time
+1 mem_spi_ncs_gpio
+
+2 mem_nv_data_ptr
+1 mem_nv_data_number
+
+2 mem_queue_ptr
+
+1 mem_ui_led_struct_num
+2 mem_ui_led_struct_ptr
+
+//adc
+1 mem_adc_wait_count
+2 mem_3v_adc_io_data
+2 mem_3v_adc_hvin_data
+2 mem_2v_adc_vinlpm_data
+2 mem_1v_adc_io_data
+2 mem_5v_adc_hvin_data
+2 mem_3v_adc_vinlpm_data
+1 mem_app_adc_read_count
+1 mem_start_adc_clkn
+2 mem_reference_voltage
+1 mem_adc_config_flag
+1 mem_adc_channel
+2 mem_adc_current_value
+1 mem_adc_power_flag	//bit0:low power falg ; bit1:no power flag
+
+3 mem_spi_write_addr
+2 mem_spi_write_ptr
+2 mem_spi_write_len
+1 mem_spi_write_flash_sm
+3 mem_spi2_write_addr
+2 mem_spi2_write_ptr
+2 mem_spi2_write_len
+1 mem_spi2_write_flash_sm
+
+1 mem_spi_cs_gpio
+1 mem_spi_si_gpio
+1 mem_spi_so_gpio
+1 mem_spi_sclk_gpio
+1 mem_spi_wp_gpio
+1 mem_spi_hold_gpio
+1 mem_spi2_cs_gpio
+1 mem_spi2_si_gpio
+1 mem_spi2_so_gpio
+1 mem_spi2_sclk_gpio
+1 mem_spi2_wp_gpio
+1 mem_spi2_hold_gpio
+
+1 mem_eeprom_wp_gpio
+1 mem_eeprom_scl_gpio
+1 mem_eeprom_sda_gpio
+2 mem_kscan_ptr
+0 mem_key_num_ptr
+2 mem_keyscan_ptr
+2 mem_key_value_retention
+2 mem_power_param_ptr
+3 mem_efuse_header
+
+1 mem_seqi
+
+1 mem_dig_aon_vsel
+1 mem_syn_afc_cfg1
+1 mem_rf_ldo_cfg1
+1 mem_rc_cal
+
+ifdef AC_50HZ
+1 mem_ac_detect_gpio
+0 mem_ac_detect_control
+1 mem_ac_detect_div
+1 mem_ac_detect_window
+endif
+
+)
+//adc read
+(
+0 ADC_CONFIG_VINLPM
+1 ADC_CONFIG_HVIN
+2 ADC_CONFIG_GPIO
+)
+
+
+(
+0 QUEUE_OFFSET_EACH_SIZE
+1 QUEUE_OFFSET_LENGTH
+2 QUEUE_OFFSET_CURR_NUM
+3 QUEUE_OFFSET_READ_PTR
+4 QUEUE_OFFSET_WRITE_PTR
+5 QUEUE_OFFSET_ELE_INIT_ADDR
+)
+(
+//Flash Register
+0x05 FLASH_READ_SATUS
+
+// Flash Status Register
+0x00 FLASH_STATUS_WIP
+0X01 FLASH_STATUS_WEL
+0X02 FLASH_STATUS_BP0
+0X03 FLASH_STATUS_BP1
+
+//Flash Write Sm
+0X00 FLASH_SM_NO_BUYS
+0X01 FLASH_SM_START
+0X02 FLASH_SM_ERASE_SECTOR
+0X03 FLASH_SM_WAIT_ERASE_SECTOR
+0X04 FLASH_SM_WRITE_DATA
+0X05 FLASH_SM_WAIT_WRITE_DATA
+
+
+//Flash Command
+0x02 FLASH_COMMAND_WRITE_DATA
+0x03 FLASH_COMMAND_READ_DATA
+0x06 FLASH_COMMAND_WRITE_ENABLE
+0x20 FLASH_COMMAND_SECTOR_ERASE
+0xAB FLASH_COMMAND_RELEASE_FROM_POWERDOWN
+0xB9 FLASH_COMMAND_POWERDOWN
+
+)
+
+
+//efuse 
+(
+0x00 EFUSE_OFFSET_UCODE	//1B
+0X01 EFUSE_OFFSET_DEVICE_LOCK
+0x02 EFUSE_OFFSET_PERIPHERALS_LOCK
+0X03 EFUSE_OFFSET_OFFSET
+
+0x2b EFUSE_OFFSET_HCI_BOOT_CLKSEL	//bit7
+0x2b EFUSE_OFFSET_APP_VSEL	//bit6
+0x2b EFUSE_OFFSET_DIG_AON_VSEL	//bit5-4
+0x2b EFUSE_OFFSET_DEVICE_OPTION	//bit3-0
+0x2c EFUSE_OFFSET_XTAL_OFFSET	//0x813a
+0x2d EFUSE_OFFSET_XTAL_CNT	//0x813c
+0x2e EFUSE_OFFSET_AGC_TABLE	//2B
+0x30 EFUSE_OFFSET_ADC_PARAM
+0x31 EFUSE_OFFSET_AGC_SEL	//bit7 agc sel
+0x31 EFUSE_OFFSET_AGC_SEC_EN	//bit6 agc second en 0x8960[3]
+0x31 EFUSE_OFFSET_LDO_CFG1	//bit5-4:0x8a0d[2:0]
+0x31 EFUSE_OFFSET_TX_VCO_CURRENT //bit3-0:0x8a87[3:0]
+0x32 EFUSE_OFFSET_RC_CAL	//0x8a6c
+0x33 EFUSE_OFFSET_ADC		//9B
+0x3c EFUSE_OFFSET_KEY_ADDR	//4B
+
+//EFUSE_OFFSET_PERIPHERALS_LOCK
+0 EFUSE_SPI_LOCK_BIT
+1 EFUSE_SPI2_LOCK_BIT
+2 EFUSE_UART_LOCK_BIT
+3 EFUSE_UARTB_LOCK_BIT
+4 EFUSE_IIC_LOCK_BIT
+6 EFUSE_LE_LOCK_BIT
+7 EFUSE_BR_LOCK_BIT
+)
+
+/* data stored in eeprom */
+(
+0	eeprom_nv_ram
+
+)
+
+/*mem_app_handshake_flag*/
+(
+0 APP_HANDSHAKE_NULL
+1 APP_HANDSHAKE_DONE
+
+)
+/*mem_device_option*/
+(
+1 dvc_op_hci
+2 dvc_op_esl
+4 dvc_op_dongle
+5 dvc_op_test
+8 dvc_op_mouse
+9 dvc_op_shutter
+0x0a dvc_op_module
+0x0b dvc_op_ali_mesh
+0x0c dvc_op_hci_boot
+0x0d dvc_op_remote_car
+0x0e dvc_op_car
+0x0f dvc_op_antilost
+   
+)
+
+(
+3 UCODE_FLAG_ENC
+2 UCODE_FLAG_SKIP_EEP
+1 UCODE_FLAG_SKIP_FLASH
+0 UCODE_FLAG_HCI
+)
+
+
+(
+7 gpio_active_bit
+)
+(
+2 HID_HANDSHAKE_TIMEOUT
+
+)
+
+(
+1 APP_FLAG_RECONNECT
+)
+(
+5 LPM_WAKE_UP_DELAY_TIMER
+)
+
+
+//mem_app_disconn_reason
+//mem_app_disconn_reason_flag
+//bit map
+(
+2 APP_DISC_RSN_SIZE
+)
+(
+0 APP_DISC_BY_BUTTON
+1 APP_DISC_AFTER_PAIRING
+2 APP_DISC_AFTER_RECONN
+3 APP_DISC_AFTER_SNIFF
+4 APP_DISC_AFTER_SETUP_DONE
+5 APP_DISC_AFTER_HANDSHAKE
+6 APP_DISC_BT
+7 APP_DISC_BLE
+8 APP_DISC_L2CAP_REFUSED
+9 APP_DISC_SWITCH_FAIL
+)
+//eeprom init flag
+(
+0xaa55 EEPROM_INIT_FLAG
+)
+
+(
+1 KEY_CONF_STRUCT_LEN
+0 KEY_PIN_OFFSET
+)
+
+(
+12000000 PWM_12MHZ
+24000000 PWM_24MHZ
+33000 PWM_33KHZ
+)
+(
+0 POWER_OFF
+1 POWER_STARTING
+2 POWER_STANDBY
+)
+//power parameter offset(8 byte)
+(
+0 power_state_offset
+1 power_timer_offset
+2 power_off_timeout_offset
+3 power_starting_timeout_offset
+4 power_off_cb_offset
+6 power_starting_cb_offset
+8 power_standby_cb_offset
+10 ui_butten_up_cb_offset
+)
+
+//auth rom address
+(
+0x9000 mem_b_box
+0x9100 mem_e_box
+0x9200 mem_l_box
+0x9300 memk
+0x9400 mem_theta
+0x9420 mem_local_sig
+0x9fff mem_sim_slave
+//mouse
+0x9468 MOUSE_BT_SDP_ADDR
+0x9732 MOUSE_BLE_ATT_LIST_ADDR
+//dongle
+0x99A4 USB_KBDATA_VENDOR_DEFINE_ADDR
+0x99BF USB_KBDATA_ADDR
+0x99FF USB_MSDATA_ADDR
+0x9AA3 USB_DEVICEDATA_ADDR
+0x9AB6 USB_CONFDATA_ADDR
+//shutter
+0x9AF2 BLE_SHUTTER_GATT_LIST
+0x9C70 CLASSIC_SHUTTER_SDP_LIST
+0x9E57 BLE_SHUTTER_KEY_VALUE_LIST
+0x9E7F CLASSIC_SHUTTER_KEY_VALUE_LIST
+//car
+0x9EA7 BLE_CAR_ATT_LIST
+//tx power list
+//0x9F73 TX_POWER_LIST
+)
+
+(//NEC 61212
+9000 NEC61212_BOOT_CODE_START_TIME
+4500 NEC61212_BOOT_CODE_END_TIME
+
+9000 NEC61212_REPEAT_START_TIME
+2250 NEC61212_REPEAT_END_TIME
+
+560 NEC61212_DATA_BIT_1_START_TIME
+1690 NEC61212_DATA_BIT_1_END_TIME
+
+560 NEC61212_DATA_BIT_0_START_TIME
+560 NEC61212_DATA_BIT_0_END_TIME
+
+560 NEC61212_STOP_TIME
+
+42580 NEC61212_DATA2REPEAT_TIME
+98190 NEC61212_REPEAT2REPEAT_TIME
+
+0xffff NEC61212_TIMEOUT_TIME
+)
+
+
+(
+0 ADC_GPIO_4
+1 ADC_GPIO_5
+2 ADC_GPIO_6
+3 ADC_GPIO_7
+4 ADC_GPIO_9
+5 ADC_GPIO_10
+6 ADC_GPIO_11
+7 ADC_GPIO_12
+)
+
Index: format/app_antiLost.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_antiLost.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_antiLost.format	(working copy)
@@ -0,0 +1,204 @@
+xmemalloc antilost(
+// memblock for cover the variables portion at shutter.format
+2 mem_antl_lpm_interval
+2 mem_antl_adv_interval
+2 mem_antl_slow_adv_lpm_interval
+2 mem_antl_slow_adv_adv_interval
+0 mem_antl_led_style
+1 mem_antl_led_type
+1 mem_antl_led_blink_count
+1 mem_antl_led_gpio
+2 mem_antl_led_on_time
+2 mem_antl_led_off_time
+2 mem_antl_led_cb_on
+2 mem_antl_led_cb_off
+
+0 mem_antl_buzzer_style
+1 mem_antl_buzzer_type
+1 mem_antl_buzzer_blink_count
+1 mem_antl_buzzer_gpio
+2 mem_antl_buzzer_on_time
+2 mem_antl_buzzer_off_time
+2 mem_antl_buzzer_cb_on
+2 mem_antl_buzzer_cb_off
+
+0 mem_antl_fast_adv_led_style
+1 mem_antl_fast_adv_led_type
+1 mem_antl_fast_adv_led_blink_count
+1 mem_antl_fast_adv_led_gpio
+2 mem_antl_fast_adv_led_on_time
+2 mem_antl_fast_adv_led_off_time
+
+0 mem_antl_slow_adv_led_style
+1 mem_antl_slow_adv_led_type
+1 mem_antl_slow_adv_led_blink_count
+1 mem_antl_slow_adv_led_gpio
+2 mem_antl_slow_adv_led_on_time
+2 mem_antl_slow_adv_led_off_time
+
+0 mem_antl_power_starting_led_style
+1 mem_antl_power_starting_led_type
+1 mem_antl_power_starting_led_blink_count
+1 mem_antl_power_starting_led_gpio
+2 mem_antl_power_starting_led_on_time
+2 mem_antl_power_starting_led_off_time
+
+7 mem_antl_power_starting_buzzer_style
+
+0 mem_antl_power_off_led_style
+1 mem_antl_power_off_led_type
+1 mem_antl_power_off_led_link_count
+1 mem_antl_power_off_led_gpio
+2 mem_antl_power_off_led_on_time
+2 mem_antl_power_off_led_off_time
+
+0 mem_antl_power_off_buzzer_style
+1 mem_antl_power_off_buzzer_type
+1 mem_antl_power_off_buzzer_link_count
+1 mem_antl_power_off_buzzer_gpio
+2 mem_antl_power_off_buzzer_on_time
+2 mem_antl_power_off_buzzer_off_time
+
+7 mem_antl_alert_led_stlye
+
+0 mem_antl_alert_buzzer_stlye
+1 mem_antl_alert_buzzer_type
+1 mem_antl_alert_buzzer_blink_count
+1 mem_antl_alert_buzzer_gpio
+2 mem_antl_alert_buzzer_on_time
+2 mem_antl_alert_buzzer_off_time
+
+0 mem_antl_key_led_style
+1 mem_antl_key_led_type
+1 mem_antl_key_led_blink_count
+1 mem_antl_key_led_gpio
+2 mem_antl_key_led_on_time
+2 mem_antl_key_led_off_time
+
+7 mem_antl_key_buzzer_style
+
+1 mem_antl_queue_width
+1 mem_antl_queue_depth
+1 mem_antl_queue_curr_num
+1 mem_antl_queue_read_ptr
+1 mem_antl_queue_write_ptr
+80 mem_antl_queue_buff
+
+1 mem_antl_key_scan_enable
+1 mem_antl_led_num
+4 mem_antl_led_gpio_map
+
+0 mem_antl_power_param
+1 mem_antl_power_state
+1 mem_antl_power_timer
+1 mem_antl_power_off_timeout
+1 mem_antl_power_starting_timeout
+2 mem_antl_power_off_cb
+2 mem_antl_power_starting_cb
+2 mem_antl_power_standby_cb
+2 mem_event_button_up_cb
+
+1 mem_antl_key_num
+2 mem_cb_antl_key
+4 mem_antl_key_conf0
+
+15 mem_antl_key0_press
+15 mem_antl_key0_release
+
+///////
+1 mem_antl_conn_updata_procedure_state
+2 mem_client_characteristic_configuration_descriptor
+///////
+
+
+//100ms timer
+2 mem_adc_timer
+1 mem_antl_conn_update_timer
+1 mem_antl_send_updata_le_param_timer
+////
+
+2 mem_antl_le_sleep_timer
+2 mem_antl_fast_adv_timer
+2 mem_antl_fast_adv_timeout
+2 mem_antl_le_sleep_timeout
+1 mem_double_click_timer
+1 mem_butten_click_cnt
+
+//1 mem_dvc_seq
+/////////anti lost alarm state/////
+1 mem_antl_led_state
+1 mem_antl_buzzer_state
+1 mem_antl_key_state
+1 mem_antl_lost_mode
+1 mem_alarm_config
+1 mem_alarm_config_notfy_cnt
+
+6 mem_buzzer_pwm_conf
+
+
+/////////anti lost battery adc read////////
+2 mem_adc_timeout
+1 mem_voltage_remain_percent
+
+0 mem_battery_calculate_set
+2 mem_battery_full_voltage
+2 mem_battery_empty_voltage
+2 mem_battery_low_voltage
+2 mem_battery_current_voltage
+
+
+2 mem_rx_window_sniff_inc
+2 mem_interval_increment
+
+2 mem_antl_le_interval_min
+2 mem_antl_le_interval_max
+2 mem_antl_le_latency
+2 mem_antl_le_timeout
+2 mem_antl_le_unnormal_interval_min
+2 mem_antl_le_unnormal_interval_max
+2 mem_antl_le_unnormal_latency
+2 mem_antl_le_unnormal_timeout
+
+400 mem_AntiLost_le_att_list
+1 mem_lestate_update_param_flag
+1 mem_antilost_conn_battery_send_timer
+)
+
+//app new specific
+(
+0 CONN_PARAM_UPDATA_PROCEDURE_NO_INIT
+1 CONN_PARAM_UPDATA_PROCEDURE_STARTING
+2 CONN_PARAM_UPDATA_PROCEDURE_COMPLETE
+3 CONN_PARAM_UPDATA_PROCEDURE_FAILD
+)
+(
+0 NEW_SPEC_HEADER_OFFSET
+2 NEW_SPEC_OPCODE_OFFSET
+3 NEW_SPEC_DLEGTH_OFFSET  //data length offset
+5 NEW_SPEC_DADDR_OFFSET   //data address offset
+)
+(
+1 OPCODE1_BUTTEN_CLICK_ONCE
+2 OPCODE2_BUTTEN_DOUBLE_CLICK
+3 OPCODE3_ANTL_START_ALRAM
+4 OPCODE4_CURRENT_ALARM_STATE
+5 OPCODE5_BATTER_INFORMATION
+7 OPCODE7_ANTL_CONFIG_ALRAM
+)
+(
+0x0a NEW_SPEC_NOTIFY_HANDLE
+0x0b NEW_SPEC_NOTIFICATION_ENABLE_HANDLE
+0x0d NEW_SPEC_WRITE_HANDLE
+)
+//app new specific end
+
+//mem_anti_lost_mode
+(
+0x01 ANTI_LE_ALARM_ON
+0x00 ANTI_LE_ALARM_OFF
+)
+(
+0 NOTIFICATION_ENABLE_BIT
+1 INDICATION_ENABLE_BIT
+)
+
Index: format/app_car.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_car.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_car.format	(working copy)
@@ -0,0 +1,326 @@
+
+
+xmemalloc g24_rx_car(
+1 mem_car_hard_soft_switch
+1 mem_car_queue_each_size
+1 mem_car__queue_length
+
+1 mem_car_queue_curr_num
+1 mem_car_queue_read_ptr
+1 mem_car_queue_write_ptr
+120 mem_car_queue_ele
+
+20 mem_car_pop_queue_buff
+
+1 mem_car_led_num
+10 mem_car_led_map
+
+1 mem_car_style1_led_type
+1 mem_car_style1_blink_count
+1 mem_car_style1_struct_led_gpio
+2 mem_car_style1_on_time
+2 mem_car_style1_off_time
+2 mem_car_style1_cb_ledon
+2 mem_car_style1_cb_ledoff
+
+1 mem_car_style2_led_type
+1 mem_car_style2_blink_count
+1 mem_car_style2_struct_led_gpio
+2 mem_car_style2_on_time
+2 mem_car_style2_off_time
+2 mem_car_style2_cb_ledon
+2 mem_car_style2_cb_ledoff
+
+//////motor
+0 mem_le_receive_data
+2 mem_le_receive_packet_head
+1 mem_le_receive_cmd
+2 mem_le_receive_length
+10 mem_le_receive_payload
+1 mem_le_receive_checksum
+1 mem_motor1_status
+1 mem_motor1_speed
+1 mem_motor2_status
+1 mem_motor2_speed
+1 mem_motor3_status
+1 mem_motor3_speed
+
+0 mem_motor1_pwm_set
+1 mem_motor1_pwm_pin1_set
+1 mem_motor1_pwm_pin2_set
+1 mem_motor1_pwm_pin_set
+1 mem_motor1_pwm_channel_set
+3 mem_motor1_pwm_freq_set
+1 mem_motor1_pwm_dute_set
+0 mem_motor2_pwm_set
+1 mem_motor2_pwm_pin1_set
+1 mem_motor2_pwm_pin2_set
+1 mem_motor2_pwm_pin_set
+1 mem_motor2_pwm_channel_set
+3 mem_motor2_pwm_freq_set
+1 mem_motor2_pwm_dute_set
+0 mem_motor3_pwm_set
+1 mem_motor3_pwm_pin1_set
+1 mem_motor3_pwm_pin2_set
+1 mem_motor3_pwm_pin_set
+1 mem_motor3_pwm_channel_set
+3 mem_motor3_pwm_freq_set
+1 mem_motor3_pwm_dute_set
+
+1 mem_motor_select_p_n
+1 mem_car_motor_status
+1 mem_car_motor_speed
+0 mem_motor_pwm_set
+1 mem_motor_pwm_pin1_set
+1 mem_motor_pwm_pin2_set
+1 mem_motor_pwm_pin_set
+1 mem_motor_pwm_channel_set
+3 mem_motor_pwm_freq_set
+1 mem_motor_pwm_dute_set
+
+1 mem_ir_rx_gpio
+2 mem_ir_data
+2 mem_ir_rx_buf
+4 mem_ir_receive_clkn
+
+3 mem_ir_notify_data
+5 mem_ir_notify_data_head
+2 mem_ir_notify_data_payload
+1 mem_ir_notify_data_check_sum
+1 mem_car_ir_breakdown_check_timer
+1 mem_car_ir_breakdown_flag
+
+0 mem_car_led_control
+1 mem_car_led1_status
+1 mem_car_led2_status
+1 mem_car_led3_status
+1 mem_car_led4_status
+1 mem_car_led5_status
+1 mem_car_led6_status
+1 mem_car_led7_status
+1 mem_car_led8_status
+1 mem_car_led_control_timer
+1 mem_car_led_blink_status
+1 mem_car_led_no
+
+3 mem_car_info_request
+5 mem_car_info_request_head
+8 mem_car_info_request_payload
+1 mem_car_info_request_checksum
+
+0 mem_car_config_param
+1 mem_car_config_setting_flag
+1 mem_car_config_device_select
+1 mem_car_config_motor_layout
+1 mem_car_config_ir_enable
+1 mem_car_config_ir_rx_gpio
+1 mem_car_config_pairing_led_conn_status
+1 mem_car_config_pairing_led_gpio
+1 mem_car_config_led_num
+0 mem_car_config_blood_led_gpio
+1 mem_car_config_blood_led1_gpio
+1 mem_car_config_blood_led2_gpio
+1 mem_car_config_blood_led3_gpio
+1 mem_car_config_blood_led4_gpio
+1 mem_car_config_blood_led5_gpio
+1 mem_car_config_blood_led6_gpio
+1 mem_car_config_blood_led7_gpio
+1 mem_car_config_blood_led8_gpio
+1 mem_car_config_bat_notify_enable
+1 mem_car_config_low_voltage_led_gpio
+1 mem_car_config_low_voltage_percent
+1 mem_car_config_soft_switch_enable
+1 mem_car_config_soft_switch_gpio
+
+1 mem_car_notify_vdd_count
+1 mem_car_notify_vdd_timer
+1 mem_car_notify_vdd_value_last
+1 mem_car_notify_vdd_percent
+1 mem_car_working_flag
+1 mem_low_bat_flag
+
+3 mem_notify_bat_packet
+5 mem_notify_bat_head
+1 mem_notify_bat_payload
+1 mem_notify_bat_check_sum
+
+1 mem_vdd_notify_flag
+2 mem_car_current_vdd_value_temp
+2 mem_car_last_vdd_value
+
+0 mem_vdd_calculate_set
+2 mem_vdd_full_vol
+2 mem_vdd_empty_vol
+2 mem_vdd_low_vol
+2 mem_vdd_now_vol
+
+
+1 mem_car_24g_status
+2 mem_car_24g_no_data_timeout_count
+2 mem_car_24g_no_data_timeout_timer
+
+1 mem_car_24g_ir_receive_attack_count
+1 mem_car_24g_go_die_flag
+1 mem_car_attack_shake_timer
+1 mem_car_attack_shake_flag
+
+0 mem_car_soft_power
+1 mem_car_power_state
+1 mem_car_power_timer
+1 mem_car_power_off_timeout
+1 mem_car_power_starting_timeout
+2 mem_car_power_off_cb
+2 mem_car_power_starting_cb
+2 mem_car_power_standby_cb
+2 mem_car_ui_button_up_cb
+
+
+500 mem_car_le_att_list
+
+1 mem_car_moto1_blank_timer
+1 mem_car_moto2_blank_timer
+1 mem_car_moto3_blank_timer
+
+1 mem_car_motor_gpio_num
+0 mem_car_motor_gpio_map
+1 mem_car_motor_left_gpio
+1 mem_car_motor_right_gpio
+1 mem_car_motor_front_gpio
+1 mem_car_motor_back_gpio
+1 mem_car_gpio
+1 mem_car_app_send_speed
+
+2 mem_rssi_sum
+2 mem_check_rssi_high_count
+8 mem_rssi_data
+
+1 mem_car_24g_received_pac
+1 mem_car_24g_bind_enable_delay_count
+
+0 mem_car_keyscan
+1 mem_car_key_num
+2 mem_cb_car_keyscan
+
+2 mem_car_enter_lpm_timer_count
+2 mem_car_enter_lpm_timer
+1 mem_car_enter_lpm_flag
+
+1 mem_car_24g_ch_polling
+
+8 mem_car_rssi_noise_buffer
+8 mem_car_rssi_noise_car_buffer
+8 mem_car_rssi_noise_remote_buffer
+
+
+)
+
+(
+//20ms
+0x0020	FAST_ADV_INTERVAL_VALUE_CAR
+)
+
+(
+0x14 ATT_CAR_CONTROL_HANDLE
+0x14 ATT_SPEED_SET_HANDLE
+)
+
+
+(
+0 TURN_FRONT
+1 TURN_LEFT
+2 TURN_RIGHT
+0 MOTOR_STOP
+1 GO_FRONT
+2 GO_BACK
+0x6b5a LE_RECEIVE_PACKET_HEAD
+)
+
+(
+0 FLAG_IR_DISABLE
+1 FLAG_IR_ENABLE
+)
+
+(
+0 DEVICE_CAR
+1 DEVICE_TANK
+2 DEVICE_BATTLE_CAR
+3 DEVICE_BATTLE_TANK
+4 DEVICE_REMOTE
+)
+
+(
+0 F_B_MOTOR
+1 L_R_MOTOR
+2 F_B_BATTERY
+3 L_R_BATTERY
+)
+
+(
+0 CAR_WORK	   		//connect mode normal
+1 CAR_BIND			//code pair mode
+2 CAR_TEST			//test mode
+3 CAR_CODE			//PC_application
+4 CAR_PCBA			//PCBA_TEST
+5 CAR_DEBUG
+6 CAR_MODE_MAX
+7 CAR_SEARCH
+)
+
+(
+1 SPEED_LEVEL_1
+2 SPEED_LEVEL_2
+3 SPEED_LEVEL_3
+4 SPEED_LEVEL_4
+5 SPEED_LEVEL_5
+6 SPEED_LEVEL_6
+7 SPEED_LEVEL_7
+8 SPEED_LEVEL_8
+9 SPEED_LEVEL_9
+10 SPEED_LEVEL_10
+)
+
+(
+0 PWM0_DUTY_SETTING
+1 PWM1_DUTY_SETTING
+2 PWM2_DUTY_SETTING
+)
+
+(
+1 CAR_CMD_BATTERY
+2 CAR_CMD_OLD_CAR_CONTROL
+3 CAR_CMD_OLD_SPEED_CONTROL
+4 CAR_CMD_L_R_MOTOR_CONTROL
+5 CAR_CMD_F_B_MOTOR_CONTROL
+6 CAR_CMD_IR_CONTROL
+7 CAR_CMD_LED_CONTROL
+8 CAR_CMD_DEVICE_INFO
+)
+
+(
+0 CAR_REMOTE_CHECK_BUTTON
+1 CAR_REMOTE_CHECK_ROCKER
+)
+
+(
+0x11 CAR_NOTIFY_HANDLE
+)
+
+(
+0 LED_OFF
+1 LED_ON
+2 LED_BLINK
+0xFF LED_INVALID
+)
+
+(
+0xFF INVALID_PIN_NUM
+)
+
+
+(
+0 POWER_ON
+1 WORK_PAIRED
+2 WORK_SEARCH
+)
+
+
Index: format/app_dongle.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_dongle.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_dongle.format	(working copy)
@@ -0,0 +1,133 @@
+
+memalloc usb_dongle(
+256 mem_dg_rssi_noise_buffer
+256 mem_dg_rssi_noise_dg_buffer
+256 mem_dg_rssi_noise_ms_buffer
+256 mem_dg_rssi_noise_kb_buffer
+
+)
+
+
+xmemalloc g24_rx_dongle(
+1 mem_dg_kb_bind_flag
+8 mem_dg_kb_data_sta_data
+8 mem_dg_kb_data_last_data
+3 mem_dg_kb_multikey_sta_data
+3 mem_dg_kb_multikey_last_data
+3 mem_dg_kb_system_sta_data
+3 mem_dg_kb_system_last_data
+1 mem_dg_kb_blank_data_enable
+1 mem_dg_kb_mul_blank_data_enable
+1 mem_dg_ms_blank_data_enable
+
+1 mem_dg_sys_config
+9 mem_dg_usb_vid_pid
+1 mem_dg_usb_tx_interval
+30 mem_dg_usb_device_name
+)
+
+
+//eeprom address offset
+(
+0x5B DONGLE_KB_BIND_SUCCESS
+0x00 DONGLE_KB_BIND_EEPROM_OFFECT
+0x2A DONGLE_KB_BIND_EFUSE_OFFECT
+)
+
+(
+5 WORK_MODE_DELAY
+7 BIND_MODE_DELAY
+)
+
+(
+0 DONGLE_WORK	   		//connect mode normal
+1 DONGLE_BIND			//code pair mode
+2 DONGLE_TEST			//test mode
+3 DONGLE_CODE			//PC_application
+4 DONGLE_PCBA			//PCBA_TEST
+5 DONGLE_DEBUG
+6 DONGLE_MODE_MAX
+7 DONGLE_SEARCH
+0 CLEAR_INIT
+)
+
+
+(
+0xa0 COMMAND_MODE     //BYTE 0
+0x81 COM_MODE_BIND	//BYTE 1
+0x82 COM_MODE_TEST	//BYTE 1
+)
+(
+0xa1 COMMAND_BIND		//BYTE 0
+0x01 COM_BIND_GET		//1
+0x84 COM_BIND_EXIT		//1
+0xa7 COM_READ_MODE		//1
+)
+(
+0xa2 COMMAND_TEST	//BYTE 0
+0x81 COM_TEST_SC		//	进入单载波
+0x82 COM_TEST_CD		// fcc测试
+0x83 COM_TEST_DAT		// 数据测试
+0x84 COM_TEST_LOW_CH  //低频点
+0x85 COM_TEST_MID_CH	//中频点
+0x86 COM_TEST_HIG_CH	//高频点
+0x87 COM_TEST_SW_HIG	//自动切换频点为高 1mhz
+0x88 COIM_TEST_SW_LOW	//自动切换频点为低 1mhz
+0x89 COM_TEST_SW_STOP	//停止自动切换频点
+0x8a COM_TEST_POW_5		//设置输出功率5dbm
+0x8b COM_TEST_POW_0		//0dbm
+0x8c COM_TEST_POW_N5		//-5dbm
+0x8d COM_TEST_POW_N10		//-10dbm
+0x8e COM_TEST_EXIT			//退出测试模式
+)
+(
+0xa6 COMMAND_CURRENT_PROJECT
+0xa7 COMMAND_CURRENT_MODE
+0xa9 COMMAND_CURRENT_FW_VERSION
+0xb0 COMMAND_USER_DEFINED		//user defined cmd
+)
+
+(
+0x15 PRODUCT_ID
+0 FW_VERSION0
+0 FW_VERSION1
+1 FW_VERSION2
+7 FW_VERSION3
+)
+
+(
+8 TIMER_NODATA
+640 TIMER_NODATA_DELAY	//200ms
+
+11 TIMER_MS_BLANK
+384 TIMER_MS_BLANK_DELAY
+
+12 TIMER_KB_MUL_BLANK
+384 TIMER_KB_MUL_BLANK_DELAY
+
+14 TIMER_KB_BLANK
+384 TIMER_KB_BLANK_DELAY
+)
+
+(
+0 KB_NORMAL_REPORT_ID
+1 MS_REPORT_ID
+2 KB_SYSTEM_CONCTRL_REPORT_ID
+3 KB_MULTIKEY_REPORT_ID
+)
+
+
+(
+0x01 BIND_ACKPAYLOAD
+0x03 KB_LED_ACKPAYLOAD
+)
+
+//mem_dg_sys_config
+(
+7 DG_ENABLE_XTAL_24M
+6 DG_ENABLE_NEW_CHMAP
+5 DG_ENABLE_EEPROM
+//bit4-0
+//tx power
+)
+
Index: format/app_esl.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_esl.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_esl.format	(working copy)
@@ -0,0 +1,181 @@
+ifdef COMPILE_ESL
+
+memalloc esl(
+256 mem_uncom_the_first_two_buff
+//uncompress pic buffers
+2200 mem_uncom_dest
+0 mem_uncom_clear_everytime_start
+2 mem_uncom_dest_index
+1 mem_uncom_src_index
+1 mem_uncom_block_len
+1 mem_uncom_block_head
+2 mem_uncom_block_body_ptr
+0 mem_uncom_clear_everytime_end
+
+0 mem_uncom_clear_once_start
+1 mem_uncom_the_first_two_index
+1 mem_uncom_repetitive
+1 mem_uncom_left_len
+2 mem_uncom_current_len
+2 mem_uncom_total_len
+2 mem_uncom_src_end
+0 mem_uncom_clear_once_end
+)
+
+xmemalloc esl(
+//eink_log
+96 mem_eink_log_ring_buffer
+1 mem_eink_log_front
+1 mem_eink_log_end
+12 mem_eink_log_ring_buffer_flag
+1 mem_eink_log_pend
+1 mem_eink_log_draw_byte
+
+1 mem_eink_log_last_star
+0 mem_eink_log_last_info
+1 mem_eink_log_last_letter
+1 mem_eink_log_last_cmd
+1 mem_eink_log_last_ch
+1 mem_eink_log_last_rssi
+1 mem_eink_log_last_is_byte
+
+0 mem_eink_log_info
+1 mem_eink_log_letter
+1 mem_eink_log_cmd
+1 mem_eink_log_ch
+1 mem_eink_log_rssi
+1 mem_eink_log_is_byte
+
+20 mem_eink_log_hex2dec
+1 mem_eink_log_hex2dec_len
+1 mem_eink_log_hex2dec_ptr
+1 mem_eink_log_push_zero
+
+//uncompress
+1 mem_uncom_fliter_datalen
+1 mem_uncom_fliter_data_flag
+1 mem_uncom_image_att_flag
+62 mem_uncom_image_att_buf
+
+//eink_init
+1 mem_scl
+1 mem_sda
+1 mem_cs
+1 mem_dc
+1 mem_res
+1 mem_busy
+1 mem_pb1
+3 mem_eink_xy
+8 mem_eink_orig
+8 mem_eink_setxy
+6 mem_eink_display
+2 mem_eink_size
+60 mem_eink_init
+20 mem_eink_init_offset
+6 mem_eink_reg_red
+6 mem_eink_reg_blank
+368 mem_eink_font
+48 mem_code93
+1 mem_barcode_start
+20 mem_barcode
+1 mem_barcode_len
+
+2 mem_eink_head
+2 mem_image_ptr
+2 mem_rx_cnt
+1 mem_update_state
+2 mem_parse_cnt
+1 mem_esl_24g_current_ch
+1 mem_esl_24g_behavior
+4 mem_esl_24g_id
+32 mem_esl_24g_rxpayload
+1 mem_esl_24g_rssi_save
+2 mem_battery_vol
+
+1 mem_rssi_save
+1 mem_rssi_temp
+)
+
+(
+//chars: ascii
+0x20 CHAR_SPACE
+0x21 CHAR_EXCLAMATION
+0x22 CHAR_DITTO
+0x23 CHAR_POUND
+0x24 CHAR_DOLLAR
+0x25 CHAR_PERCENT
+0x26 CHAR_AMPERSAND
+0x27 CHAR_APOSTROPHE
+0x28 CHAR_OPENING_PARENTHESIS
+0x29 CHAR_CLOSING_PARENTHESIS
+0x2a CHAR_ASTERISK
+0x2b CHAR_PLUS
+0x2c CHAR_COMMA
+0x2d CHAR_MINUS
+0x2e CHAR_DOT
+0x2f CHAR_SLASH
+
+0x8b CHAR_AT
+
+//letter: ascii - 0x20
+0x61 LETTER_A
+0x62 LETTER_B
+0x63 LETTER_C
+0x64 LETTER_D
+0x65 LETTER_E
+0x66 LETTER_F
+0x67 LETTER_G
+0x68 LETTER_H
+0x69 LETTER_I
+0x6a LETTER_J
+0x6b LETTER_K
+0x6c LETTER_L
+0x6d LETTER_M
+0x6e LETTER_N
+0x6f LETTER_O
+0x70 LETTER_P
+0x71 LETTER_Q
+0x72 LETTER_R
+0x73 LETTER_S
+0x74 LETTER_T
+0x75 LETTER_U
+0x76 LETTER_V
+0x77 LETTER_W
+0x78 LETTER_X
+0x79 LETTER_Y
+0x7a LETTER_Z
+)
+
+/* endpoint eink log */
+(
+0x60 EINK_LOG_MAX
+0x108 EINK_LOG_XY_START
+
+//fail reason
+0x00 EINK_LOG_RX_LOST
+0x01 EINK_LOG_OLD_PAC
+0x02 EINK_LOG_RX_NULL
+)
+
+(
+32 UNCOM_SRC_LENGTH
+31 UNCOM_SRC_INDEX
+62 UNCOM_IMAGE_ATT_LENTH
+)
+
+(
+2 mark_24g_old_packet
+7 mark_eink_red
+13 mark_barcode_end
+)
+
+(
+7 STATE_DATA_FINISH
+)
+
+(
+37 barcode_dot
+)
+
+endif
+
Index: format/app_module.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_module.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_module.format	(working copy)
@@ -0,0 +1,289 @@
+
+memalloc module(
+	//ble
+	2 mem_module_le_rx_data_len
+	2 mem_module_le_rx_data_address
+	2 mem_module_le_rx_data_handle
+
+ifdef COMPILE_WECHAT
+	0 mem_wechat_tx_buffer
+	1 mem_wechat_tx_bMagicNumber
+	1 mem_wechat_tx_bVer
+	2 mem_wechat_tx_nLength
+	2 mem_wechat_tx_nCmdId
+	2 mem_wechat_tx_nSeq1
+	255 mem_wechat_tx_payload
+
+	0 mem_wechat_rx_buffer
+	1 mem_wechat_rx_bMagicNumber
+	1 mem_wechat_rx_bVer
+	2 mem_wechat_rx_nLength
+	2 mem_wechat_rx_nCmdId
+	2 mem_wechat_rx_nSeq
+	255 mem_wechat_rx_payload
+
+	255 mem_module_wechat_local_data_buffer
+
+endif
+)
+
+xmemalloc module(	
+	2 mem_soft_version_num
+	1 mem_module_wake_up_gpio
+	1 mem_module_state_gpio
+	1 mem_module_connect_state_gpio
+
+	2 mem_current_packet_length
+	1 mem_module_state
+	
+	1 mem_module_mcu_wake_pin
+	4 mem_module_mcu_wake_delay_us
+
+	1 mem_module_spp_lpm_mult
+	1 mem_module_le_lpm_mult	
+	1 mem_module_bluetooth_stauts_by_command
+
+	//uart
+	2 mem_module_uart_rx_buffer
+	2 mem_module_uart_rx_buffer_end
+	2 mem_module_uart_tx_buffer
+	2 mem_module_uart_tx_buffer_end
+	2 mem_module_uarta_baud_rate
+
+	//ADC
+	1 mem_module_read_vdd_flag
+	1 mem_module_read_vdd_count
+	1 mem_module_vdd_quotient
+	1 mem_module_vdd_remainder
+
+	//ble
+	1 mem_module_ble_data_uart_max_length
+
+	//flag
+	2 mem_module_flag
+
+	1 mem_module_hci_notify_len
+	2 mem_module_hci_notify_handle
+	2 mem_module_hci_nofiy_addr
+	1 mem_module_hci_notify_type
+
+	4 mem_last_transmite_clock
+
+ifdef COMPILE_WECHAT
+	1 mem_module_wechat_indication_handle
+	1 mem_module_wechat_write_handle
+	2 mem_module_wechat_tx_buffer_ptr
+	2 mem_module_wechat_rx_buffer_ptr
+	2 mem_module_wechat_rx_push_data_cb
+	2 mem_module_wechat_tx_nSeq
+	2 mem_module_wechat_tx_len
+	2 mem_module_wechat_tx_address
+	2 mem_module_wechat_rx_len
+	2 mem_module_wechat_rx_address
+	1 mem_module_wechat_receive_push_data
+endif
+	
+	300 mem_module_uuid_list
+	0 mem_module_uuid_list_end
+	600 mem_module_le_att_list
+	0 mem_module_le_att_list_end
+	0 mem_module_nv_data
+	34 mem_module_nv_data0
+	34 mem_module_nv_data1
+	34 mem_module_nv_data2
+	34 mem_module_nv_data3
+	34 mem_module_nv_data4
+	0 mem_module_nv_data_end
+)
+
+
+(//mem_module_flag
+//bit0~bit7 config module function
+0 MODULE_FLAG_UART_FLOW_CONTROL
+1 MODULE_FLAG_BLE_SEND_MTU23
+2 MODULE_FLAG_BLE_DATA_ENCRYPT
+
+//bit8~bit15 module states change
+8 MODULE_FLAG_BLE_DATA_FINISH
+9 MOUDLE_TASK_UNSNIFF
+10 MOUDLE_TASK_SNIFF
+
+)
+
+(
+34 NV_DATA_LEN
+-1 DECREASED_ONE
+)
+
+
+
+(
+	50 FLAG_MODULE_READ_VDD_COUNT
+)
+
+(
+	0x200 UART_AIR_CONTROL_THRESHOLD
+)
+
+(
+0x01 HCI_DISCARD_PACKET
+0x00 HCI_NOT_DISCARD_PACKET
+)
+
+
+
+(//Command
+0x00 HCI_CMD_SET_BT_ADDR_REQ
+0x01 HCI_CMD_SET_LE_ADDR_REQ
+0x02 HCI_CMD_SET_VISIBILITY_REQ
+0x03 HCI_CMD_SET_BT_NAME_REQ
+0x04 HCI_CMD_SET_LE_NAME_REQ
+0x05 HCI_CMD_SPP_DATA_REQ
+0x09 HCI_CMD_LE_DATA_REQ
+0x0b HCI_CMD_STATUS_IRQ
+0x0c HCI_CMD_SET_PAIRING_REQ
+0x0d HCI_CMD_SET_PINCODE_REQ
+0x0e HCI_CMD_SET_UARTCONTROL_REQ
+0x0f HCI_CMD_SET_UART_BAUD_REQ
+0x10 HCI_CMD_VERSION_REQ
+0x11 HCI_CMD_BT_DISCONNECT
+0x12 HCI_CMD_BLE_DISCONNECT
+0x13 HCI_CMD_DELETE_DEVICE
+0x14 HCI_CMD_CREATE_CONNECT
+0x15 HCI_CMD_SET_COD
+0x26 HCI_CMD_SET_NVRAM_REQ
+0x27 HCI_CMD_SLEEP
+0x28 HCI_CMD_CONFIRM_GKEY
+0x29 HCI_CMD_SET_CREDIT_GIVEN
+0x2a HCI_CMD_AUTO_ADV_SCAN
+0x2b HCI_CMD_POWER_REQ
+0x2c HCI_CMD_POWER_SET
+0x30 HCI_CMD_PASSKEY_ENTRY
+0x31 HCI_CMD_SET_GPIO
+0x32 HCI_CMD_READ_GPIO
+0x33 HCI_CMD_LE_SET_PAIRING
+0x34 HCI_CMD_LE_SET_ADV_DATA
+0x35 HCI_CMD_LE_SET_SCAN_DATA
+0x36 HCI_CMD_LE_SEND_CONN_UPDATE_REQ
+0x37 HCI_CMD_LE_SET_ADV_PARM
+0x38 HCI_CMD_LE_START_PAIRING
+0x40 HCI_CMD_SET_WAKE_GPIO
+0x42 HCI_CMD_SET_TX_POWER
+0x43 HCI_CMD_BOOT_VERSION_REQ
+0x48 HCI_CMD_LE_CONFIRM_GKEY
+0x49 HCI_CMD_REJECT_JUSTWORK
+0x51 HCI_CMD_RESET_CHIP_REQ
+
+0x61 HCI_CMD_LE_SET_FIXED_PASSKEY
+
+0x76 HCI_CMD_DELETE_CUSTOMIZE_SERVICE
+0x77 HCI_CMD_ADD_SERVICE_UUID
+0x78 HCI_CMD_ADD_CHARACTERISTIC_UUID
+0x7a HCI_CMD_PASSKEY_ENTRY_INPUT
+
+0x90 HCI_CMD_BLE_SET_PHY
+0x91 HCI_CMD_BLE_READ_CURRENT_PHY
+0x92 HCI_CMD_BLE_SET_DLE
+0x93 HCI_CMD_READ_CHIP_DATA
+0x94 HCI_CMD_WRITE_CHIP_DATA
+ifdef COMPILE_WECHAT
+0x95 HCI_CMD_WECHAT_SEND_DATA
+endif
+0xff HCI_CMD_CLOSE_LPM
+)
+
+(//event
+0x00 HCI_EVENT_SPP_CONN_REP
+0x01 HCI_EVENT_HID_CONN_REP
+0x02 HCI_EVENT_LE_CONN_REP
+0x03 HCI_EVENT_SPP_DIS_REP
+0x04 HCI_EVENT_HID_DIS_REP
+0x05 HCI_EVENT_LE_DIS_REP
+0x06 HCI_EVENT_CMD_RES
+0x07 HCI_EVENT_SPP_DATA_REP
+0x08 HCI_EVENT_LE_DATA_REP
+0x09 HCI_EVENT_STANDBY_REP
+
+0x0a HCI_EVENT_STATUS_RES
+
+0x0D HCI_EVENT_NVRAM_REP
+0x0e HCI_EVENT_GKEY
+0x0F HCI_EVENT_INVALID_PACKET
+0x10 HCI_EVENT_GET_PASSKEY
+0x11 HCI_EVENT_LE_TK
+0x12 HCI_EVENT_REMOTE_MTU
+0x14 HCI_EVENT_LE_PAIRING_STATE
+0X15 HCI_EVENT_LE_ENCRYPTION_STATE
+0x17 HCI_EVENT_LE_CONNECTION_UPDATE
+0x1d HCI_EVENT_LE_GKEY
+0x29 HCI_EVENT_UUID_HANDLE
+0x2b HCI_EVENT_LE_INPUT_GKEY
+
+0x40 HCI_BLE_UPDATE_PHY_EVENT
+ifdef COMPILE_WECHAT
+0x41 HCI_BLE_WECHAT_RECEIVE_PUSH_DATA
+endif
+)
+
+
+(//command HCI_CMD_SET_GPIO
+//byte 0
+0x00 HCI_CMD_CONFIG_GPIO_INPUT
+0x01 HCI_CMD_CONFIG_GPIO_OUTPUT
+//byte 1 input state
+0x00 GPIO_INPUT_PULLUP
+0x01 GPIO_INPUT_PULLDOWN
+0x02 GPIO_INPUT_HIGH_IMPEDANCE
+)
+
+
+
+(
+0x7e0 OTP_ADDR_RF_PARAM_FIX
+//struct of RF_PARAM_FIX
+// uint8       //length = param_pair_count * 2 
+// uint16     //param-pair-1
+// uint16     //param-pair-2
+// uint16     //param-pair-3
+// uint16     //param-pair-4
+// uint16     //param-pair-5
+// uint16     //param-pair-6
+// uint16     //param-pair-7
+)
+
+(
+0	BR_PAIRING_MODE_PINCODE
+1	BR_PAIRING_MODE_JUSTWORK
+2	BR_PAIRING_MODE_PASSKEY
+3	BR_PAIRING_MODE_NUMERIC
+
+0x81 BR_PAIRING_MODE_SECURE_CONNECT_JUSTWORK
+0x82 BR_PAIRING_MODE_SECURE_CONNECT_PASSKEY
+0x83 BR_PAIRING_MODE_SECURE_CONNECT_NUMERIC
+)
+
+
+(
+0x0001	FLAG_BT_PAIRING_SUCCESS
+0x0101	FLAG_BT_PAIRING_FAIL
+0x0080	FLAG_BLE_PAIRING_SUCCESS
+0x0180	FLAG_BLE_PAIRING_FAIL
+)
+
+
+(
+1	FLAG_EVENT_START_ENC
+0	FLAG_EVENT_PAUSE_ENC
+)
+
+(
+0 MOUDLE_STATE_BT_BIT
+1 MOUDLE_STATE_BLE_BIT
+)
+
+(
+5 BIT_OF_NOTIFY_AUTHENTICATED
+6 BIT_OF_READ_AUTHENTICATED
+7 BIT_OF_WRITE_AUTHENTICATED
+)
+
Index: format/app_mouse.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_mouse.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_mouse.format	(working copy)
@@ -0,0 +1,704 @@
+
+memalloc mouse(
+2 mem_init_cnt
+2 mem_data_pre
+2 mem_data_current
+3 mem_data_sum
+2 mem_data_value
+
+
+)
+//dpi eeprom addr
+
+
+xmemalloc g24_tx_mouse(
+// Mouse Work Area
+1 mem_mouse_key
+2 mem_mouse_x
+2 mem_mouse_y
+1 mem_mouse_z
+1 mem_mouse_tz
+1 mem_mouse_xy_h
+1 mem_mouse_key_last
+
+//mouse wheel
+1 mem_wheel_tb_old_pinlevel
+1 mem_wheel_tb_new_pinlevel
+1 mem_wheel_tog 
+1 mem_mouse_tz_data
+1 mem_mwheel_b_old_pinlevel
+1 mem_mwheel_b_new_pinlevel
+1 mem_mwheel_tog 
+1 mem_mouse_z_data
+1 mem_mouse_wheel_trigger
+1 mem_mouse_wheel_trigger_timer
+
+// adc
+//adc struct
+0 mem_mouse_vdd_calculate_set
+2 mem_mouse_vdd_full_vol
+2 mem_mouse_vdd_empty_vol
+2 mem_mouse_vdd_low_vol
+2 mem_mouse_vdd_now_vol
+
+2 mem_mouse_vdd_button_press_vol
+2 mem_mouse_vdd_switch_gnd_24g_vol
+2 mem_mouse_vdd_switch_gnd_full_vol
+2 mem_mouse_vdd_switch_gnd_shutdown_voltage
+2 mem_mouse_vdd_switch_gnd_low_voltage
+1 mem_adc_mux_status
+1 mem_adc_read_timer
+1 mem_adc_read_time_init
+1 mem_adc_low_volatage_led_timer_count
+1 mem_adc_low_volatage_led_blink_enable
+1 mem_mouse_adc_last_low_voltage_flag
+1 mem_mouse_adc_button_press_flag
+1 mem_adc_channel_gpio
+
+1 mem_adc_config_flag_init
+
+//efuse configured start		26byte
+2 mem_mouse_discovery_timeout
+2 mem_mouse_24g_pair_timeout_init
+1 mem_mouse_direct_timeout
+1 mem_mouse_24g_reconn_timeout_init
+1 mem_mouse_24g_pair_tx_power
+1 mem_rssi_dis_min_24g_init
+1 mem_rssi_dis_max_24g_init
+1 mem_rssi_hex_received_max_value_init
+1 mem_rssi_dis_min_ble_init
+1 mem_rssi_dis_max_ble_init
+1 mem_mouse_enable_flag
+1 mem_mouse_global_setup
+1 mem_mouse_global_setup1
+
+1 mem_bk_button_gpio
+1 mem_fw_button_gpio
+1 mem_dpi_button_gpio
+1 mem_matrix_public_gpio
+1 mem_sensor_motion_gpio
+1 mem_customer_key_gpio
+1 mem_whee_a_data_gpio
+1 mem_whee_b_data_gpio
+1 mem_config_device_24g_led_gpio
+1 mem_config_device_bt1_led_gpio
+1 mem_select_sensor_angle_gpio
+
+//efuse configured end
+
+1 mem_lbutton_gpio
+1 mem_rbutton_gpio
+1 mem_mbutton_gpio
+1 mem_config_select_device_button_gpio
+1 mem_whee_ta_data_gpio
+1 mem_whee_tb_data_gpio
+1 mem_device_switch_gpio
+1 mem_mouse_sensor_sclk_gpio
+1 mem_mouse_sensor_sdio_gpio
+1 mem_config_low_voltage_alarm_gpio
+1 mem_config_device_bt2_led_gpio	
+1 mem_dpi_led_gpio 
+
+
+1 mem_sensor_angle_default
+1 mem_sensor_angle_switch
+1 mem_config_sensor_dpi
+1 mem_config_sensor_type
+1 mem_config_sensor_angle
+
+
+// usb
+1 mem_wire_usb_interval
+1 mem_usb_addr
+1 mem_mouse_usb_vdd_status
+1 mem_mouse_usb_keyboard_flag
+
+
+//led struct
+1 mem_mouse_led_type
+1 mem_mouse_blink_count
+1 mem_mouse_struct_led_gpio
+2 mem_mouse_on_time
+2 mem_mouse_off_time
+2 mem_mouse_cb_ledon
+2 mem_mouse_cb_ledoff
+
+//three devices param
+//eeprom/flash
+0 mem_mouse_information_start
+1 mem_device_flag
+1 mem_device1_type
+6 mem_device1_addr
+16 mem_device1_link_key
+6 mem_device1_locall_addr
+
+1 mem_device2_type
+6 mem_device2_addr
+16 mem_device2_link_key
+6 mem_device2_locall_addr
+
+1 mem_device3_type
+0 mem_mouse_compare_addr_ff
+6 mem_device3_addr
+16 mem_device3_link_key
+6 mem_device3_locall_addr
+2 mem_store_flag
+1 mem_mouse_dpi
+4 mem_mouse_24g_addr
+2 mem_random_addr_increase_count
+31 mem_mouse_retention
+0 mem_mouse_information_end
+
+3 mem_flash_base
+4 mem_write_flash_head_temp
+1 mem_store_information_delay_timer
+1 mem_store_information_delay_timer_init
+
+//sensor param
+1 mem_sensor_id1
+1 mem_sensor_id2
+
+1 mem_sensor_shutter_hi
+1 mem_sensor_shutter_lo
+1 mem_sensor_smart_flag
+1 mem_sensor_squal_reg
+1 mem_sensor_iqc
+1 mem_mouse_move_flag
+
+1 mem_mouse_asm_flag
+2 mem_mouse_x_pre
+2 mem_mouse_y_pre
+1 mem_mouse_data_xtemp
+1 mem_mouse_data_ytemp
+
+0 mem_mouse_dpi_seting
+1 mem_320x_dpi_0
+1 mem_320x_dpi_1
+1 mem_320x_dpi_2
+1 mem_320x_dpi_3
+1 mem_3212_dpi_0
+1 mem_3212_dpi_1
+1 mem_3212_dpi_2
+1 mem_3212_dpi_3
+1 mem_ka8g2_dpi_0
+1 mem_ka8g2_dpi_1
+1 mem_ka8g2_dpi_2
+1 mem_ka8g2_dpi_3
+1 mem_mouse_cpi_count
+1 mem_mouse_dpi_button_state
+1 mem_mouse_dpi_long_press_flag
+
+10 mem_sensor_3212_init
+10 mem_sensor_3204_init
+10 mem_sensor_3205_init
+26 mem_sensor_32xx_init
+34 mem_sensor_32xx_init_1
+26 mem_sensor_8650_init
+30 mem_sensor_ka8ul_init
+16 mem_sensor_8009_init
+22 mem_sensor_ka8g2_init
+12 mem_sensor_p6520_init
+8 mem_sensor_poweron_init
+
+1 mem_sensor_reset_gpio	
+1 mem_mouse_clear_sensor_data_flag
+1 mem_bluetooth_125hz_cnt
+
+//no motion pin
+1 mem_mouse_long_mult_flag
+1 mem_mouse_current_mult_timer
+
+1 mem_reconn_times
+1 mem_reconn_times_init
+2 mem_mouse_no_data_timer
+1 mem_device_flag_temp
+8 mem_mouse_rssi_signal_buf				
+4 mem_btclk_sensor
+1 mem_mouse_bluetooth_fast_conn_flag
+2 mem_mouse_discovery_timer
+1 mem_mouse_bluetooth_reconnect_timeout
+1 mem_mouse_need_soft_reset
+
+// le
+1 mem_mouse_le_bb_connected_flag
+1 mem_mouse_le_reconnect_flag
+1 mem_mouse_send_secutiry_request_timer
+
+3 mem_mouse_le_lap_temp
+3 mem_le_adv_ind
+3 mem_le_adv_direct_ind
+20 mem_le_adv_swift_pair
+1 mem_le_data_len
+2 mem_le_keyboard_handle
+2 mem_le_multimedia_handle
+2 mem_le_systemctrl_handle
+2 mem_le_battery_level_handle
+1 mem_le_battery_level_percentage
+2 mem_le_battery_level_updata_timer_init
+2 mem_le_battery_level_updata_timer
+1 mem_mouse_le_conn_param_reject
+32 mem_le_tx_buffer0_omemalloc
+32 mem_le_tx_buffer1_omemalloc
+32 mem_le_tx_buffer2_omemalloc
+32 mem_le_tx_buffer3_omemalloc
+1 mem_le_connect_status_flag
+1 mem_le_start_encrypt_timer
+1 mem_mouse_direct_timer
+
+//bt
+7 mem_device_addr_temp
+1 mem_mouse_enter_sniff_count
+1 mem_mouse_bt_boot_mode
+5 mem_mouse_bt_boot_data
+1 mem_bt_send_max_slot_req_accept_after_switch
+1 mem_mouse_bt_send_first_package_timer
+1 mem_mouse_bt_send_first_package_flag
+1 mem_lmi_opcode_temp 
+1 mem_lpm_mult_init
+
+// mouse key
+1 mem_customer_key
+1 mem_customer_data_trigger
+1 mem_customer_data_trigger_last
+
+1 mem_mouse_lkey_press_status
+1 mem_mouse_rkey_press_status
+1 mem_mouse_mkey_press_status
+1 mem_mouse_bkkey_press_status
+1 mem_mouse_fwkey_press_status
+1 mem_mouse_dpikey_press_status
+1 mem_mouse_pbkey_press_status
+1 mem_mouse_customerkey_press_status
+1 mem_mouse_key_temp
+1 mem_mouse_key_status
+
+1 mem_mouse_matrix_key_cow_count
+1 mem_mouse_matrix_key_row_count
+1 mem_mouse_ghost_flag
+1 mem_bt_discovery_count
+1 mem_select_device_count
+1 mem_mouse_commbination_key
+1 mem_select_device_button_statue
+1 mem_commbination_key_statue
+1 mem_combination_ui_button_count
+
+// 2.4G
+1 mem_mouse_search_dongle_interval
+1 mem_mouse_search_dongle_ch
+1 mem_mouse_search_dongle_count
+1 mem_mouse_search_dongle_action
+1 mem_24g_enter_lpm_timer
+1 mem_mouse_24g_enter_lpm_enable
+
+//led
+1 mem_mouse_device_poweron_timer_count
+1 mem_mouse_dpi_led_delay_count
+1 mem_mouse_led_off_4_led
+1 mem_24g_device_led_status
+
+// mouse configured param
+8 mem_mouse_flag 
+1 mem_mouse_bluetooth_type
+1 mem_device_number
+2 mem_mouse_page_to
+1 mem_mouse_fast_direct_timeout
+2 mem_mouse_fast_page_to
+2 mem_mouse_24g_power_on_fast_conn_timer
+2 mem_mouse_24g_search_dongle_time_init
+2 mem_mouse_no_data_timeout
+
+1 mem_mouse_device_poweron_timer_count_init
+1 mem_mouse_dpi_led_delay_count_init
+2 mem_mouse_dpi_led_blink_time
+2 mem_mouse_disconvey_led_blink_time
+2 mem_mouse_low_v_led_blink_time
+2 mem_adc_low_volatage_led_blink_timer
+
+1 mem_mouse_commbination_key_bt
+1 mem_mouse_commbination_key_24g
+
+9 mem_customer_key_press
+9 mem_customer_key_release
+3 mem_mouse_set_high_impedance_bit_set
+
+1 mem_sensor_shutdown_flag
+
+//patch area
+1 mem_power_on_flag
+
+8 mem_ka8g2_sensor_poweron_init
+2 mem_24g_pair_count
+
+1 mem_mouse_logo_led_gpio
+2 mem_mouse_logo_led_on_time_init
+
+//ota area start
+1 mem_g24_ota_config_type     //rr
+2 mem_g24_ota_storage_size   //byte
+2 mem_g24_ota_config_addr
+
+1 mem_g24_ota_rtn_state
+1 mem_g24_ota_mode
+1 mem_g24_ota_sm
+1 mem_g24_ota_prepare_send_len
+31 mem_g24_ota_txbuf
+2 mem_g24_ota_rx_alllen
+2 mem_g24_ota_rx_sum
+1 mem_g24_ota_rx_data_count
+1 mem_g24_ota_reset_timer
+//ota area end
+
+1 mem_le_name_patch_len
+19 mem_le_name_patch
+
+1 mem_dpi_another_button_gpio
+1 mem_dpi_another_press_status
+1 mem_dpi_another_button_state
+1 mem_dpi_another_button_down_enable
+
+1 mem_mouse_key_temp_patch
+
+//voltage alarm led
+1 mem_voltage_alarm_led1
+1 mem_voltage_alarm_led2
+2 mem_mouse_vdd_full_compare_vol
+1 mem_mouse_logo_led_blink_flag
+1 mem_mouse_logo_led_blink_timer
+1 mem_mouse_logo_led_state
+)
+
+
+(
+//combination
+0x01 MOUSE_L_BUTTON
+0X02 MOUSE_R_BUTTON
+0x03 MOUSE_LR_BUTTON
+0X04 MOUSE_M_BUTTON
+0X05 MOUSE_LM_BUTTON
+0X06 MOUSE_RM_BUTTON
+0X07 MOUSE_LMR_BUTTON
+0x09 MOUSE_L_BK_BUTTON
+0x14 MOUSE_M_FW_BUTTON
+0X18 MOUSE_BK_FW_BUTTON
+//mouse default gpio
+0x1B MOUSE_DEFAULT_XA_GPIO
+0x1C MOUSE_DEFAULT_XB_GPIO
+
+//ui led blink
+0X00C8  LED_RECONNECT_BLINK //200
+0X0190  LED_DPI_BLINK //400
+0X03E8  LED_DPI_BLINK_FIXED    //1000
+0X03E8  LED_DISCOVERY_BLINK    //1000
+0XFF    LED_LONG_BLINK
+0x05	LED_SENSOR_BLINK_CNT
+//mode device number
+0x00 MODE_24G_DEVICE
+0x01 MODE_BT_DEVICE1
+0x02 MODE_BT_DEVICE2
+0x03 MODE_BT_DEVICE3
+//mouse  flag
+0X00 WRITE_REQ_ENABLE_FLAG
+0X01 LL_START_ENC_FLAG
+0X02 LL_PAIRING_SUCCESS_FLAG
+
+
+//mouse_function_flag
+0x08 MOUSE_FLAG_LEN
+//byte 1
+0x00 MOUSE_SELECT_DEVICE_FLAG
+0x01 MOUSE_24G_PAIRING_FLAG
+0x02 MOUSE_STORE_EEPROM_FLAG
+0x03 MOUSE_BT_CANNEL_RECONN_FLAG
+0x04 MOUSE_LOW_VOLTAGE_FLAG
+0x05 MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG
+0x06 MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG
+
+//byte 2
+0x08 MOUSE_ENABLE_BLE_RANDOM_ADDRE
+0x09 MOUSE_ENABLE_2K_EEPROM
+0x0a MOUSE_ENABLE_INIT_DELAY
+0x0b MOUSE_ENABLE_WAKEUP_FROM_POWER
+0x0c MOUSE_ENABLE_16M
+0x0d MOUSE_ENABLE_USB
+
+//byte 3
+0x10 MOUSE_ENABLE_SPI2
+0x11 MOUSE_ENABLE_24G
+0x12 MOUSE_ENABLE_FLASH
+0x13 MOUSE_ENABLE_EEPROM
+0x14 MOUSE_ENABLE_ADC
+0x15 MOUSE_ENABLE_KEYBOARD
+0x16 MOUSE_ENABLE_24G_SEARCH_DONGLE
+
+//byte 4
+0x18 MOUSE_ENABLE_24G_250Hz
+0x19 MOUSE_ENABLE_24G_500Hz
+0x1a MOUSE_ENABLE_24G_1000
+0x1b MOUSE_ENABLE_BT_125Hz
+0x1c MOUSE_ENABLE_DPI_LEVEL_4
+0x1d MOUSE_ENABLE_USB_250
+0x1e MOUSE_ENABLE_USB_500
+0x1f MOUSE_ENABLE_USB_1000
+
+//byte 5
+0x20 MOUSE_ENABLE_POWER_ON_LED
+0x21 MOUSE_ENABLE_LOW_VOLTAGE_LED
+0x22 MOUSE_ENABLE_LOW_VOLTAGE_USE_MODE_LED
+0x23 MOUSE_ENABLE_LOW_VOLTAGE_LED_BLINK_N_SECOND
+0x24 MOUSE_ENABLE_4_LED
+0x25 MOUSE_ENABLE_DPI_FOR_4_LED
+0x26 MOUSE_ENABLE_BT2_FOR_4_LED
+0x27 MOUSE_ENABLE_LOW_V_FOR_4_LED
+
+
+//byte 6
+0x28 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON
+0x29 MOUSE_ENABLE_SELECT_DEVICE_BY_PB_BUTTON
+0x2a MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_GPIO
+0x2b MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_ADC
+0x2c MOUSE_ENABLE_DPI_KEY_CONNECT_GND
+0x2d MOUSE_ENABLE_PB_BUTTON_CONNECT_GND
+0x2e MOUSE_ENABLE_DPI_KEY_CONNECT_ADC
+0x2f MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING
+//byte 7 
+0x30 MOUSE_ENABLE_AUTO_24G_PARING
+0x31 MOUSE_ENABLE_24G_POWER_ON_PAIRING
+0x32 MOUSE_ENABLE_COMMBINATION_KEY_BY_24G_PAIRING
+0x33 MOUSE_ENABLE_BT_RECONNECT_TIMEOUT_ENTER_DISCOVERY
+0x34 MOUSE_ENABLE_PB_BUTTON_SHORT_PRESS_ENTER_DISCOVERY
+0x35 MOUSE_ENABLE_COMMBINATION_KEY_BY_BT_DISCOVERY
+0x36 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY
+0x37 MOUSE_ENABLE_PB_BUTTON_LONG_PRESS_DISCONVERY
+
+//byte 8
+0x38 MOUSE_ENABLE_SMOOTHER
+0x39 MOUSE_ENABLE_XY_OFFSET
+0x3a MOUSE_ENABLE_24G_AUTO_PAIR_NERVER_BEEN_PAIRED
+0x3b MOUSE_ENABLE_LE_BATTERY_SERVICE_CANCEL
+0x3c MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL
+0x3d MOUSE_ENABLE_DOUBLE_DPI_KEY
+
+//mouse dpi level
+0x00 MOUSE_DPI_LEVEL1
+0x01 MOUSE_DPI_LEVEL2
+0x02 MOUSE_DPI_LEVEL3
+0x03 MOUSE_DPI_LEVEL4
+
+
+//mouse sensor angle
+0x00 MOUSE_6CLK_ANGLE
+0X01 MOUSE_9CLK_ANGLE
+0X02 MOUSE_12CLK_ANGLE
+0X03 MOUSE_3CLK_ANGLE
+
+
+
+0xFF GPIO_DISABLE
+
+//DPI button state 
+0x00 DPI_BUTTON_STATE_UP
+0x01 DPI_BUTTON_STATE_DOWN
+
+
+//PB button state 
+0x00 PB_BUTTON_STATE_UP
+0x01 PB_BUTTON_STATE_DOWN
+
+//Commbination_key state 
+0x00 COMMBINATION_KEY_STATE_UP
+0x01 COMMBINATION_KEY_STATE_DOWN
+
+
+//eeprom address offect
+0X00 MOUSE_INFO_EEPROM_OFFECT
+0x58 MOUSE_STORE_FLAG
+0X5A MOUSE_DPI_EEPROM_OFFECT	//1byte
+0X5B MOUSE_G24_ADDR_EEPROM_OFFECT	//4bytes
+0X5F MOUSE_RANDOM_ADDR_COUNT_EEPROM_OFFSET	//2bytes
+0X61 MOUSE_EEPROM_MODULE_INIT_FLAG
+
+// Sensor id number
+0x30 P32XX_ID1
+0x31 P3065_ID1
+0x02 P3212_ID2
+0xD1 P3205_TJ3T_ID2
+0XD2 P3204_TJ3L_ID2
+0x54 PKA8_ID2
+0x70 P3065_XY_ID2
+0x00 P3065_ID2
+0x5a P_MX8650
+0xD8 P8009_ID2
+0x50 P6520A_ID2
+0x58 PKA8G2_ID1
+0x59 PKA8G2_ID2
+
+
+//Sensor type
+0X00 P3205
+0X01 P3065
+0X02 P3204
+0X03 P3212
+0X04 P3065_XY
+0x05 MX8650
+0x06 P8009
+0x07 P6520
+0X08 KA8
+0X09 KA8_UL
+0X0a KA8_HD
+0X0b KA8G2
+
+
+//SENSOR REG
+0x00 PAN_REG_PID_L
+0x01 PAN_REG_PID_H
+0x02 PAN_REG_MOTION_STAUS
+0x03 PAN_REG_DELTA_X
+0x04 PAN_REG_DELTA_Y
+0x05 PAN_REG_OPRATION_MODE
+0x06 PAN_REG_CONFIG
+0x07 PAN_REG_IMAGE_QUALITY
+0x08 PAN_REG_OPRATION_STATE
+0x09 PAN_REG_WRITE_PROTECT
+0x0A PAN_REG_SLEEP_1
+0x0B PAN_REG_ENTER_TIME
+0x0C PAN_REG_SLEEP_2
+0x0D PAN_REG_IMAGE_THRESHOLD
+0x0E PAN_REG_IMAGE_RECGNITION
+
+
+0x06 MOUSE_DPI_ADDRESS
+0x05 MOUSE_P3610_DPI_ADDRESS
+0x0D MOUSE_P3212_DPI_XADDRESS
+0x0E MOUSE_P3212_DPI_YADDRESS
+
+)
+
+(
+0x01 ADV_FLAG_LIMITED_DISCOVERABLE
+0x04 ADV_FLAG_BREDR_NOT_SUPPORTED
+)
+
+(
+2 BIT_POWER_ON
+)
+//device option low 2
+(
+0 MODE_3_MOUSE
+1 MODE_4_MOUSE
+)
+
+
+(
+10 LE_LPM_DISABLE_TO
+1 LE_LPM_DISABLE
+0 LE_LPM_ENABLE
+
+12 LE_INTERVAL_15MS
+9 LE_INTERVAL_11_25MS//11.25ms
+7 LE_INTERVAL_8_75MS//8.75ms
+6 LE_INTERVAL_7_5MS//7.5ms
+12 CLASSIC_INTERVAL_7_5MS
+14 CLASSIC_INTERVAL_8_75MS
+18 CLASSIC_INTERVAL_11_25MS
+)
+
+(
+0x00 MOUSE_L_KEY
+0x01 MOUSE_R_KEY
+0x02 MOUSE_M_KEY
+0x03 MOUSE_BK_KEY
+0x04 MOUSE_FW_KEY
+0x05 MOUSE_DPI_KEY
+0x06 MOUSE_PB_KEY
+0x07 MOUSE_CUSTOMER_KEY
+
+0x00 MOUSE_DPI_ANOTHER_KEY
+)
+
+
+(
+0 G24_DISCONN_STATE
+1 G24_CONN_STATE
+
+8 G24_CH_NUMBER
+16 G24_CH_POLL_COUNT
+)
+
+(
+0 MOUSE_ADC_CHECK_BATTERY_ONLY
+1 MOUSE_ADC_CHECK_MULTIPLE
+2 MOUSE_ADC_CHECK_GPIO_MULTIPLE
+3 MOUSE_ADC_CHECK_VINLPM_MULTIPLE
+)
+
+
+(
+0x5a MOUSE_USB_INTERFACE_INSERT
+0xa5 MOUSE_USB_INTERFACE_REMOVE
+)
+
+(
+0x10 MOUSE_BLE_L2CAP_TXBUFF_SIZE
+)
+
+(
+0 MOUSE_ADC_ENABLE
+1 MOUSE_SEARCH_DONGLE_ENABLE
+2 MOUSE_24G_250HZ_ENABLE
+3 MOUSE_CLK_16M_ENABLE
+4 MOUSE_DPI_4_LEVEL_ENABLE
+5 MOUSE_KEYBOARD_ENABLE
+
+7 MOUSE_DEVICE_NUMBER_FLAG
+)
+
+
+//G24 ota
+(
+0x0001 G24_OTA_VERSION
+0x5a G24_OTA_DATA_HEADER
+
+0 G24_OTA_STORAGE_ERROR
+0x02 G24_OTA_STORAGE_EEPROM
+0x03 G24_OTA_STORAGE_OTP
+0x04 G24_OTA_STORAGE_FLASH
+
+0x00 G24_OTA_STATUS_SUCCESS
+0x01 G24_OTA_STATUS_FAIL
+
+0x01 G24_OTA_TARGET_DONGLE
+0x02 G24_OTA_TARGET_MOUSE
+0x03 G24_OTA_TARGET_DONGLE_MOUSE
+
+0x1 G24_OTA_CMD_VERSION
+0x2 G24_OTA_CMD_INFO
+0X3 G24_OTA_CMD_CONFIG
+0X4 G24_OTA_CMD_SET_CONFIG_END
+0X5 G24_OTA_CMD_DATA
+0X6 G24_OTA_CMD_RESET
+0xff G24_OTA_CMD_PING
+
+0x01 G24_OTA_SM_RX_VERSION
+0x02 G24_OTA_SM_TX_VERSION
+0x03 G24_OTA_SM_TX_VERSION_OK
+0X04 G24_OTA_SM_RX_INFO
+0X05 G24_OTA_SM_TX_INFO
+0X06 G24_OTA_SM_TX_INFO_OK
+0X07 G24_OTA_SM_RX_CONFIG
+0X08 G24_OTA_SM_TX_CONFIG
+0X09 G24_OTA_SM_TX_CONFIG_OK
+0X0A G24_OTA_SM_RX_SET_CONFIG_END
+0X0B G24_OTA_SM_TX_SET_CONFIG_END
+0X0C G24_OTA_SM_TX_SET_CONFIG_END_OK
+0X0D G24_OTA_SM_RX_DATA
+0X0E G24_OTA_SM_TX_DATA
+0X0F G24_OTA_SM_TX_DATA_OK
+0X10 G24_OTA_SM_RX_RESET
+0X11 G24_OTA_SM_TX_RESET
+0X12 G24_OTA_SM_TX_RESET_OK
+
+)
+
+
+
+
Index: format/app_remote_car.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_remote_car.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_remote_car.format	(working copy)
@@ -0,0 +1,159 @@
+
+xmemalloc g24_tx_remote(
+1 mem_remote_car_hard_soft_switch
+
+1 mem_remote_car_queue_each_size
+1 mem_remote_car_queue_length
+
+1 mem_remote_car_queue_curr_num
+1 mem_remote_car_queue_read_ptr
+1 mem_remote_car_queue_write_ptr
+90 mem_remote_car_queue_ele
+
+1 mem_remote_style_led_type
+1 mem_remote_style_blink_count
+1 mem_remote_style_struct_led_gpio
+2 mem_remote_style_on_time
+2 mem_remote_style_off_time
+2 mem_remote_style_cb_ledon
+2 mem_remote_style_cb_ledoff
+
+
+1 mem_remote_car_led_num
+8 mem_remote_car_led_map
+
+0 mem_remote_car_keyscan
+1 mem_remote_car_key_num
+2 mem_cb_remote_car_keyscan
+
+0 mem_remote_car_key_conf0
+1 mem_remote_car_key_conf0_pin
+0 mem_remote_car_key_conf1
+1 mem_remote_car_key_conf1_pin
+0 mem_remote_car_key_conf2
+1 mem_remote_car_key_conf2_pin
+0 mem_remote_car_key_conf3
+1 mem_remote_car_key_conf3_pin
+0 mem_remote_car_key_conf4
+1 mem_remote_car_key_conf4_pin
+0 mem_remote_car_key_conf5
+1 mem_remote_car_key_conf5_pin
+0 mem_remote_car_key_conf6
+1 mem_remote_car_key_conf6_pin
+
+
+//rocker
+1 mem_rocker_negative_flag
+1 mem_rocker_work_status
+2 mem_current_vdd_value_default_mid_x
+2 mem_current_vdd_value_default_mid_y
+2 mem_current_vdd_value_default_mid_temp
+2 mem_current_vdd_default_range
+2 mem_rocker_last_status
+0 mem_rocker_status
+1 mem_rocker_x_status
+1 mem_rocker_y_status
+
+0 mem_remote_car_config_param
+1 mem_remote_car_config_setting_flag
+1 mem_remote_car_config_key_map
+1 mem_remote_car_config_layout
+1 mem_remote_car_config_connect_led_gpio
+1 mem_remote_car_config_check_way
+1 mem_remote_car_config_soft_switch_enable
+1 mem_remote_car_config_soft_switch_gpio
+1 mem_remote_car_config_timeout_shutdown_enable
+
+0 mem_remote_car_24g_motor_packet
+1 mem_remote_car_24g_motor_packet_lenght
+2 mem_remote_car_24g_motor_send_packet_head
+1 mem_remote_car_24g_motor_send_cmd
+2 mem_remote_car_24g_motor_send_length
+0 mem_remote_car_24g_motor_send_payload
+2 mem_remote_car_24g_motor1_payload
+2 mem_remote_car_24g_motor2_payload
+2 mem_remote_car_24g_motor3_payload
+1 mem_remote_car_24g_motor_send_checksum
+
+0 mem_remote_car_24g_fire_packet
+1 mem_remote_car_24g_fire_packet_lenght
+2 mem_remote_car_24g_fire_send_packet_head
+1 mem_remote_car_24g_fire_send_cmd
+2 mem_remote_car_24g_fire_send_length
+2 mem_remote_car_24g_fire_send_payload
+1 mem_remote_car_24g_fire_send_checksum
+
+15 mem_remote_car_24g_tx_temp
+
+2 mem_remote_car_no_data_timeout
+2 mem_remote_car_no_data_timer
+
+0 mem_remote_car_soft_power
+1 mem_remote_car_power_state
+1 mem_remote_car_power_timer
+1 mem_remote_car_power_off_timeout
+1 mem_remote_car_power_starting_timeout
+2 mem_remote_car_power_off_cb
+2 mem_remote_car_power_starting_cb
+2 mem_remote_car_power_standby_cb
+
+1 mem_remote_key_status
+1 mem_remote_car_24g_status
+
+1 mem_remote_car_24g_auto_work_step
+1 mem_remote_car_24g_pair_success_flag
+1 mem_remote_car_empty_packet
+
+1 mem_remote_car_motor1_key0_press_state
+1 mem_remote_car_motor1_key1_press_state
+1 mem_remote_car_motor2_key2_press_state
+1 mem_remote_car_motor2_key3_press_state
+1 mem_remote_car_motor1_rel_state
+1 mem_remote_car_motor2_rel_state
+
+1 mem_remote_car_no_data_check
+)
+
+
+(
+// eeprom config
+0xb0 REMOTE_PARAM_EEPROM_CONFIG_ADDR
+//eeprom address offect
+0X00 REMOTE_INFO_EEPROM_OFFECT
+
+)
+
+
+(
+0x00 CONTROL_F_B_MOTOR
+0x02 CONTROL_L_R_MOTOR
+)
+
+(
+0x00 KEY_MAP_TEN
+0x01 KEY_MAP_LR
+)
+
+(
+0x00 CONTROL_F_B_TEN
+0x02 CONTROL_L_R_TEN
+0x03 CONTROL_L_R_LR
+)
+
+(
+0 KEY_CHECK
+1 ROCKER_CHECK
+)
+
+(
+1 MOTOR_POSITIVE
+2 MOTOR_NEGATIVE
+)
+
+(
+0 ROCKER_MIDDLE_KEY
+1 ROCKER_POSITIVE_KEY
+2 ROCKER_NEGATIVE_KEY
+)
+
+
Index: format/app_shutter.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_shutter.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/app_shutter.format	(working copy)
@@ -0,0 +1,242 @@
+
+
+xmemalloc shutter(
+
+////////////////////////////////////
+//shutter common config
+1 mem_shutter_bluetooth_type
+////////////////////////////////////
+
+2 mem_shutter_config_eeprom_offset_addr
+
+////////
+2 mem_shutter_config_eeprom_start_flag
+1 mem_shutter_config_user_size
+///////
+1 mem_shutter_config_label
+2 mem_shutter_config_otp_addr
+///////////////////////////////////
+
+////////////////////////////////////
+//classic shutter config
+1 mem_classic_shutter_cable_unplug_conut
+1 mem_classic_shutter_hid_disconn_count
+2 mem_classic_shutter_random_mac_offset_addr
+////////////////////////////////////
+
+////////////////////////////////////
+//ble shutter config
+1 mem_ble_shutter_enable_notify
+2 mem_ble_shutter_reconn_adv_interval
+2 mem_ble_shutter_discovery_adv_interval
+2 mem_ble_shutter_reconn_timeout
+2 mem_ble_shutter_reconn_timer
+2 mem_ble_shutter_reconn_blink_on_time
+2 mem_ble_shutter_reconn_blink_off_time
+2 mem_ble_shutter_discovery_blink_on_time
+2 mem_ble_shutter_discovery_blink_off_time
+
+2 mem_ble_shutter_interval_min
+2 mem_ble_shutter_interval_max
+2 mem_ble_shutter_latency
+2 mem_ble_shutter_timeout
+
+2 mem_ble_shutter_interval_min_new
+2 mem_ble_shutter_interval_max_new
+2 mem_ble_shutter_latency_new
+2 mem_ble_shutter_timeout_new
+
+//////////////////shutter sleep timeout//////////////////
+2 mem_classic_shutter_discovery_timeout
+2 mem_classic_shutter_connect_timeout
+2 mem_ble_shutter_discovery_timeout
+2 mem_ble_shutter_connect_timeout
+2 mem_shutter_sleep_timeout
+2 mem_shutter_sleep_timer
+
+/////////////////////////////////////////////////////////////////
+1 mem_shutter_hard_soft_switch_case
+1 mem_shutter_soft_switch_button_gpio
+1 mem_shutter_soft_switch_power_state
+1 mem_shutter_soft_switch_poweron_time
+1 mem_shutter_soft_switch_poweroff_time
+2 mem_shutter_soft_switch_poweron_callback_function
+2 mem_shutter_soft_switch_poweroff_callback_function
+
+
+0 mem_shutter_keyscan
+1 mem_shutter_key_num
+2 mem_cb_shutter_keycan
+1 mem_shutter_key_conf0
+1 mem_shutter_key_conf1
+1 mem_shutter_key_conf2
+1 mem_shutter_key_conf3
+1 mem_shutter_key_conf4
+1 mem_shutter_key_conf5
+1 mem_shutter_key_conf6
+1 mem_shutter_key_conf7
+
+
+5 mem_key0_press
+5 mem_key1_press
+5 mem_key2_press
+5 mem_key3_press
+5 mem_key4_press
+5 mem_key5_press
+5 mem_key6_press
+5 mem_key7_press
+
+5 mem_key0_release	
+5 mem_key1_release
+5 mem_key2_release
+5 mem_key3_release
+5 mem_key4_release
+5 mem_key5_release
+5 mem_key6_release
+5 mem_key7_release
+
+5 mem_ble_data_buffer1
+5 mem_ble_data_buffer2
+5 mem_ble_data_buffer3
+5 mem_ble_data_buffer4
+5 mem_ble_data_buffer5
+5 mem_ble_data_buffer6
+5 mem_ble_data_buffer7
+5 mem_ble_data_buffer8
+50 mem_ble_data_buffer9_58
+
+5 mem_classic_data_buffer
+
+5 mem_classic_data_buffer1
+5 mem_classic_data_buffer2
+5 mem_classic_data_buffer3
+5 mem_classic_data_buffer4
+5 mem_classic_data_buffer5
+5 mem_classic_data_buffer6
+5 mem_classic_data_buffer7
+5 mem_classic_data_buffer8
+50 mem_classic_data_buffer9_58
+
+1 mem_queue_each_size
+1 mem_queue_length
+1 mem_queue_curr_num
+1 mem_queue_read_ptr
+1 mem_queue_write_ptr
+32 mem_queue_ele
+
+
+170 mem_shutter_nv_data
+
+0 mem_shutter_led_struct_app_led
+1 mem_shutter_led_struct_app_led_type
+1 mem_shutter_led_struct_app_led_blink_count
+1 mem_shutter_led_struct_app_led_gpio
+2 mem_shutter_led_struct_app_led_on_time
+2 mem_shutter_led_struct_app_led_off_time
+2 mem_shutter_led_struct_app_led_on_callback
+2 mem_shutter_led_struct_app_led_off_callback
+
+0 mem_shutter_power_off_led_style
+1 mem_shutter_power_off_led_style_type
+1 mem_shutter_power_off_led_style_blink_count
+1 mem_shutter_power_off_led_style_gpio
+2 mem_shutter_power_off_led_style_on_time
+2 mem_shutter_power_off_led_style_off_time
+2 mem_shutter_power_off_led_style_on_callback
+2 mem_shutter_power_off_led_style_off_callback
+
+1 mem_shutter_soft_swtich_botton_down
+11 mem_shutter_soft_swtich_led_struct_temp
+1 mem_shutter_power_off_timeout
+1 mem_shutter_power_off_timer
+2 mem_shutter_key_conf0_temp
+1 mem_shutter_led_struct_app_led_gpio_temp
+1 mem_shutter_hard_soft_switch_case_temp
+1 mem_shutter_soft_switch_button_gpio_temp
+)
+
+
+
+
+(
+0 BLE_SHUTTER
+1 CLASSIC_SHUTTER
+)
+
+(
+0x0000 NVRAM_EEPROM_OFFSET
+)
+
+(
+0x1b3a SHUTTER_EEPROM_CONFIG_CRC
+)
+
+(
+5 MAX_QUEUE_NUM
+5 SHUTTER_BLE_DATA_BUFFER
+5 SHUTTER_CLASSIC_DATA_BUFFER
+)
+
+
+(
+0x13	GATT_CONSUMER_NOTIFY_HANDLE
+0x14	GATT_CONSUMER_WRITE_HANDLE
+0x17	GATT_KEYBOARD_NOTIFY_HANDLE
+0x18	GATT_KEYBOARD_WRITE_HANDLE
+)
+
+(
+//20ms
+0x0020	FAST_ADV_INTERVAL_VALUE
+//100ms
+0x00a0	SLOW_ADV_INTERVAL_VALUE
+)
+
+
+(
+0 ATT_BIT_NOTIFICATION
+1 ATT_BIT_INDICATION
+)
+///////////////////////////////////////////////////////////////////////////////////////
+
+(
+0 HARD_SWITCH
+1 SOFT_SWITCH
+)
+
+
+(
+1  FLAG_SHUTTER_HID_DISCONN_TIMEOUT
+5 FLAG_SHUTTER_CABLE_UNPLUG_TIMEOUT
+)
+
+(//Data Rom Buffer Addr
+382		BLE_GATT_LIST_SIZE
+487		BT_SDP_LIST_SIZE
+40		BLE_KEY_VALUE_LIST_SIZE
+40		BT_KEY_VALUE_LIST_SIZE
+)
+
+
+(//soft switch power state
+0		SS_STATE_POWER_UP
+1		SS_STATE_POWER_ON
+2		SS_STATE_POWER_OFF
+)
+
+(
+0		SS_POWER_STATE_OFFSET
+1		SS_POWER_ON_TIME
+2		SS_POWER_OFF_TIME
+3		SS_POWER_ON_CB
+5		SS_POWER_OFF_CB
+
+)
+
+(
+
+0x4FFE SIM_IIC_SCL_GPIO_NUM
+0x4FFF SIM_IIC_SDA_GPIO_NUM
+
+)
+
Index: format/ble_protocol_stack/le.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le.format	(working copy)
@@ -0,0 +1,437 @@
+
+memalloc(
+260 mem_le_rxbuf
+
+/* security temp */
+4 mem_le_mic
+4 mem_le_peer_mic
+//8 mem_le_skdm
+//8 mem_le_skds
+16 mem_le_mrand
+
+
+/* ========= le context =========== */
+1 mem_le_state
+1 mem_le_mode
+2 mem_le_tsniff
+4 mem_le_anchor
+6 mem_le_clk_offset
+2 mem_le_receive_window
+6 mem_le_plap
+1 mem_le_conn_handle
+1 mem_le_arq
+1 mem_le_ch
+1 mem_le_hop
+2 mem_le_event_count
+4 mem_le_supervision_timer
+2 mem_le_instant
+1 mem_le_channels
+1 mem_le_op
+
+	/* these 3 should NOT be seperated */
+4 mem_le_access
+3 mem_le_crcinit
+1 mem_le_window_size
+
+	/* these 3 should NOT be seperated */
+2 mem_le_slave_latency
+2 mem_le_superto
+5 mem_le_channel_map
+
+
+1 mem_le_rx_phy
+1 mem_le_tx_phy
+
+9 mem_le_update_new_param
+
+16 mem_le_sk
+
+1 mem_le_peer_sca
+1 mem_le_err_code
+1 mem_le_ll_pairing_fail_reason
+
+5 mem_le_context_reserve
+/* ========= le context ending =========== */
+
+/* test */
+1 mem_le_testtype
+1 mem_cmd_le_create_conn
+
+)
+
+amemalloc mem_le_update_new_param(
+//update connection parameter
+	0 mem_le_new_param
+	1 mem_le_new_transmitwindowsize
+	2 mem_le_new_transmitwindowoffset
+	2 mem_le_new_conninterval
+	2 mem_le_new_connslavelatency
+	2 mem_le_new_connsupervisiontimeout
+)
+
+amemalloc mem_le_update_new_param(
+//update map parameter
+	5 mem_le_new_map
+)
+
+amemalloc mem_le_update_new_param(
+//update phy parameter
+	1 mem_le_new_m2s_phy
+	1 mem_le_new_s2m_phy
+)
+
+amemalloc mem_le_rxbuf(
+//data channel PDU
+	1 mem_le_rxbuf_data_header
+	1 mem_le_rxbuf_data_length
+	255 mem_le_rxbuf_data_payload
+)
+
+amemalloc mem_le_rxbuf(
+//data channel LL control PDU
+	1 mem_le_rxbuf_data_ll_header
+	1 mem_le_rxbuf_data_ll_length
+	1 mem_le_rxbuf_data_ll_opcode
+	26 mem_le_rxbuf_data_ll_control_data
+)
+
+xmemalloc(
+2 mem_le_dsniff
+
+2 mem_le_conn_interval
+
+1 mem_le_txheader
+1 mem_le_txlen
+256 mem_le_txpayload
+
+//modified name
+1 mem_le_name_len
+30 mem_le_name
+
+
+/* smp related */
+
+16 mem_le_ltk
+1 mem_ltk_exists
+16 mem_le_rconfirm
+16 mem_le_srand
+1 mem_le_iat
+1 mem_le_rat
+1 mem_le_preq
+1 mem_le_preq_iocap
+1 mem_le_preq_oob
+1 mem_le_preq_auth
+1 mem_le_preq_max_keysize
+1 mem_le_preq_init_key_distribution
+1 mem_le_preq_resp_key_distribution
+1 mem_le_pres
+1 mem_le_pres_iocap
+1 mem_le_pres_oob
+1 mem_le_pres_auth
+1 mem_le_pres_max_keysize
+1 mem_le_pres_init_key_distribution
+1 mem_le_pres_resp_key_distribution
+
+/* att related */
+
+2 mem_le_notify_handle
+1 mem_le_search_uuid_length
+16 mem_le_search_uuid
+
+
+
+//START of LE conn parameter structure
+0 mem_le_conn_param
+1 mem_le_conn_peer_addr_type
+6 mem_le_conn_peer_addr
+1 mem_le_conn_own_addr_type
+2 mem_le_interval_min
+2 mem_le_interval_max
+2 mem_le_latency
+2 mem_le_timeout
+//START of LE conn parameter structure
+
+
+3 mem_le_lap
+1 mem_le_uap
+2 mem_le_nap
+
+
+2 mem_le_local_mtu
+2 mem_le_remote_mtu
+
+8 mem_le_skdm
+8 mem_le_skds
+
+2 mem_le_init_superto
+2 mem_ui_le_uuid_table
+
+1 mem_le_secure_connect_flag
+1 mem_le_secure_connect_state
+1 mem_le_sc_confirm_gkey_flag
+
+
+1 mem_le_pairing_state
+1 mem_le_enc_state
+1 mem_le_pairing_mode
+4 mem_le_tk
+2 mem_le_ediv
+8 mem_le_rand
+16 mem_le_irk
+
+//LE attribute list
+4 mem_le_transmit_window
+
+//ble General configuration 
+1 mem_le_configuration
+16 mem_le_fixed_ltk
+2 mem_le_pairing_handle
+
+
+1 mem_le_packet_llid
+
+//for continue
+2 mem_le_l2cap_size
+2 mem_le_packet_len_recved
+2 mem_le_payload_ptr
+
+
+//ble gatt signaling
+1 mem_le_signaling_identifier
+2 mem_le_l2cap_signaling_conn_param_update_rsp_result
+
+1 mem_le_md_count
+
+2 mem_ble_l2cap_tx_buff0_ptr
+2 mem_ble_l2cap_tx_buff_size_ptr
+)
+
+(//mem_le_T_IFS
+150 PARAM_T_IFS_150US
+20000 PARAM_20MS_INIT
+-11 PARAM_SYNC_TIME_DIFFERENCE
+40 PARAM_CODED_C1_TERM1_TIME_40US
+1666 PARAM_WINDOWN_SIZE
+//T_IFS = 150-modem(CRC time)
+)
+
+
+(
+0 DEFAULT_STATES
+1 IPHONE_LOST_LTK
+2 MODULE_LOST_LTK
+3 LTK_NOT_LOST
+)
+
+	//BLE ErrorCodes
+	(    
+	0x01 ERROR_UNKNOWN_HCI_COMMAND
+	0x02 ERROR_NO_CONNECTION
+	0x03 ERROR_HARDWARE_FAILURE
+	0x04 ERROR_PAGE_TIMEOUT
+	0x05 ERROR_AUTHENTICATION_FAILURE
+	0x06 ERROR_KEY_MISSING
+	0x07 ERROR_MEMORY_FULL
+	0x08 ERROR_CONNECTION_TIMEOUT
+	0x09 ERROR_MAX_CONNECTIONS
+	0x0A ERROR_MAX_SCO_CONNECTIONS
+	0x0B ERROR_MAX_ACL_CONNECTIONS
+	0x0C ERROR_COMMAND_DISALLOWED
+	0x0D ERROR_HOST_REJECT_LIMITED_RESOURCES
+	0x0E ERROR_HOST_REJECT_SECURITY_REASONS
+	0x0F ERROR_HOST_REJECT_REMOTE_IS_ONLY_PERSONAL
+	0x10 ERROR_HOST_TIMEOUT
+	0x11 ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE
+	0x12 ERROR_INVALID_HCI_COMMAND_PARAMETERS
+	0x13 ERROR_REMOTE_USER_TERMINATED_CONNECTION
+	0x14 ERROR_REMOTE_LOW_RESOURCES
+	0x15 ERROR_REMOTE_POWERING_OFF
+	0x16 ERROR_CONNECTION_TERMINATED_BY_LOCAL_HOST
+	0x17 ERROR_REPEATED_ATTEMPTS
+	0x18 ERROR_PAIRING_NOT_ALLOWED
+	0x19 ERROR_UNKNOWN_LMP_PDU
+	0x1A ERROR_UNSUPPORTED_REMOTE_FEATURE
+	0x1B ERROR_SCO_OFFSET_REJECTED
+	0x1C ERROR_SCO_INTERVAL_REJECTED
+	0x1D ERROR_SCO_AIR_MODE_REJECTED
+	0x1E ERROR_INVALID_LMP_PARAMETER
+	0x1F ERROR_UNSPECIFIED_ERROR
+	0x20 ERROR_UNSUPPORTED_LMP_PARAMETER_VALUE
+	0x21 ERROR_ROLE_CHANGE_NOT_ALLOWD
+	0x22 ERROR_LMP_RESPONSE_TIMEOUT
+	0x23 ERROR_ERROR_TRANSACTION_COLLISION
+	0x24 ERROR_LMP_PDU_NOT_ALLOWED
+	0x25 ERROR_ENCRYPTION_MODE_NOT_ACCEPTABLE
+	0x26 ERROR_UNIT_KEY_USED
+	0x27 ERROR_QOS_NOT_SUPPORTED
+	0x28 ERROR_INSTANT_PASSED
+	0x29 ERROR_PAIRING_W_UNIT_KEY_NOT_SUPPORTED
+	0x2a ERROR_DIFFERENT_TRANSACTION_COLLISION
+	0x2c ERROR_QOS_UNACCEPTABLE_PARAMETER
+	0x2d ERROR_QOS_REJECTED
+	0x2e ERROR_CHANNEL_CLASSIFICATION_NOT_SUPPORTED
+	0x2f ERROR_INSUFFICIENT_SECURITY
+	0x30 ERROR_PARAMETER_OUT_OF_MANDATORY_PANGE
+	0x32 ERROR_ROLE_SWITCH_PENDING
+	0x34 ERROR_RESERVED_SLOT_VIOLATION
+	0x35 ERROR_ROLE_SWITCH_FAILED
+	0x36 ERROR_EXTENDED_INQUIRY_RESPONSE_TOO_LARGE
+	0x37 ERROR_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST
+	0x38 ERROR_HOST_BUSY_PAIRING
+	0x3d ERROR_MIC_FAILURE
+	)
+
+
+	//modified_name
+	(
+	0X20 SPACE	
+	)
+	/* LE L2CAP CID */
+	(
+	0x0004 LE_L2CAP_CID_ATT
+	0x0005 LE_L2CAP_CID_SIGNAL
+	0x0006 LE_L2CAP_CID_SMP
+	)
+
+	//LE address type
+	(
+	0 LE_ADDR_TYPE_PUBLIC
+	1 LE_ADDR_TYPE_RANDOM
+	)
+	//LE address type bitmap
+	(
+	7 LE_RECEIVER_ADDR_BIT
+	6 LE_SENDER_ADDR_BIT
+	)
+	//LE SCAN TYPE
+	(
+	0x00 LE_SCAN_TYPE_PASSIVE //no SCAN_REQ shall be sent
+	0x01 LE_SCAN_TYPE_ACTIVE
+	)
+
+	//LE SCAN ENABLE
+	(
+	0x00 LE_SCAN_DISABLE
+	0x01 LE_SCAN_ENABLE
+	0x0101 LE_ACTIVE_SCAN_ENABLE
+	)
+
+	//LE FIND INFORMATION RESPONSE
+	//THE FORMAT OF THE INFORMATION DATA
+	(
+	0x01 UUID_SIZE_16BIT
+	0x02 UUID_SIZE_128BIT
+	)
+
+//	le_state_map 0-2 is reserved for state_inconn,state_insniff and state_sco
+(
+3 lestate_got_first_packet
+4 lestate_encryption
+5 lestate_update_param
+6 lestate_update_map
+7 lestate_update_phy
+)
+
+// 	le mode
+(
+0 lemode_idle
+1 lemode_slave
+3 lemode_master
+0x20 lemode_2m
+0x40 lemode_lr_s2
+0xc0 lemode_lr_s8
+)
+
+(
+0 llid0
+1 llid1
+2 nesn
+3 sn
+4 md
+5 wak
+6 txdat
+)
+
+(
+0x01 LLID_CONTINUE
+0x02 LLID_START
+0x03 LLID_LE_LL
+0x01 LLID_EMPTY
+)
+
+(
+4 LE_TX_BUFF_COUNT
+3 LE_TX_BUFF_UPDATE_LOOPCNT //LE_TX_BUFF_COUNT-1
+
+12 LE_MD_MAX_COUNT
+)
+
+
+(
+0 LE_INITATOR_LTK_BIT
+1 LE_INITATOR_IRK_BIT
+2 LE_INITATOR_CSRK_BIT
+)
+
+
+
+
+
+(
+0  LE_FIND_BY_TYPE_VAL_RES_NOT_FOUND
+1  LE_FIND_BY_TYPE_VAL_RES_FOUND_STARTING_HANDLE
+2  LE_FIND_BY_TYPE_VAL_RES_FOUND_ENDING_HANDLE
+
+)
+
+(
+0 MASTER_PUBLIC_ADDR
+1 MASTER_RANDOM_ADDR
+)
+
+(
+0x06 LE_ERR_PIN_OR_KEY_MISSING
+)
+
+(
+39 LE_CCM_DIRECTIONBIT
+)
+(
+36 BR_CCM_0_LENGTH_CONTINUATION
+37 BR_CCM_DIRECTIONBIT
+)
+
+(
+96000 TIMER_SMP_PAIRING_TIMEOUT //30S
+)
+
+
+
+//mem_le_enc_state
+(
+0 FLAG_LE_ENC_NULL
+1 FLAG_LE_RCV_ENC_START
+2 FLAG_LE_ENC_PAUSE
+3 FLAG_LE_RCV_START_ENC_RSP
+4 FLAG_LE_SEND_START_ENC_RSP
+5 FLAG_LE_SEND_START_ENC_REQ
+0xff FLAG_LE_ENC_END
+)
+
+(//mem_le_configuration
+//bit0:use fixed key , ble passkey pairing
+0 BIT_BLE_PASSKEY_FIXED_KEY
+//bit1:ble pairing use fixed long term key
+1 BIT_BLE_PAIRING_FIXED_LTK
+//bit2:ble transmit packet will set more data flag
+2 BIT_BLE_TRANSMIT_PACKET_BY_MD
+//bit3:master read handle, with requires an authenticated link
+3 BIT_BLE_READ_AUTH
+//bit4:master write handle, with requires an authenticated link
+4 BIT_BLE_WRITE_AUTH
+//bit5:cannot enter long sleep
+5 BIT_BLE_SHORT_MULT
+//bit6:DEAL baseband packet
+6 BIT_BLE_DEAL_BB_PACKET
+)
+
Index: format/ble_protocol_stack/le_advertising.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_advertising.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_advertising.format	(working copy)
@@ -0,0 +1,104 @@
+
+xmemalloc(
+// parameters
+1 mem_le_scan_enable
+2 mem_le_scan_interval
+2 mem_le_scan_window
+
+
+1 mem_le_adv_data_len
+31 mem_le_adv_data
+1 mem_le_scan_data_len
+31 mem_le_scan_data
+
+//START of LE adv parameter structure
+1 mem_le_adv_enable
+0 mem_le_adv_param
+2 mem_le_adv_interval
+1 mem_le_adv_type
+1 mem_le_adv_own_addr_type
+6 mem_le_adv_direct_addr
+1 mem_le_adv_channel_map
+//END of LE adv parameter structure
+
+//START of LE scan parameter structure
+0 mem_le_scan_params
+1 mem_le_scan_type
+1 mem_le_scan_own_addr_type
+//END of LE scan parameter structure
+)
+
+amemalloc mem_le_rxbuf(
+//advertising channel PDU
+	1 mem_le_rxbuf_adv_header
+	1 mem_le_rxbuf_adv_length
+	255 mem_le_rxbuf_adv_payload
+)
+
+amemalloc mem_le_rxbuf(
+//advertising channel PDU
+//Scan Req
+	1 mem_le_rxbuf_adv_scan_req_header
+	1 mem_le_rxbuf_adv_scan_req_length
+	6 mem_le_rxbuf_adv_scan_req_scan_address
+	6 mem_le_rxbuf_adv_scan_req_adv_address
+)
+
+amemalloc mem_le_rxbuf(
+//advertising channel PDU
+//Connect IND
+	1 mem_le_rxbuf_adv_connect_ind_header
+	1 mem_le_rxbuf_adv_connect_ind_length
+	6 mem_le_rxbuf_adv_connect_ind_init_address
+	6 mem_le_rxbuf_adv_connect_ind_adv_address
+	4 mem_le_rxbuf_adv_connect_ind_access_address
+	3 mem_le_rxbuf_adv_connect_ind_crc_init
+	1 mem_le_rxbuf_adv_connect_ind_win_size
+	2 mem_le_rxbuf_adv_connect_ind_win_offset
+	2 mem_le_rxbuf_adv_connect_ind_interval
+	2 mem_le_rxbuf_adv_connect_ind_latency
+	2 mem_le_rxbuf_adv_connect_ind_timeout
+	5 mem_le_rxbuf_adv_connect_ind_channel_map
+	1 mem_le_rxbuf_adv_connect_ind_hop_and_sca
+)
+
+(
+0x01	GAP_ADTYPE_FLAGS
+0x02	GAP_ADTYPE_16BIT_MORE
+0x03	GAP_ADTYPE_16BIT_COMPLETE
+0x04	GAP_ADTYPE_32BIT_MORE
+0x05	GAP_ADTYPE_32BIT_COMPLETE
+0x06	GAP_ADTYPE_128BIT_MORE
+0x07	GAP_ADTYPE_128BIT_COMPLETE
+0x08	GAP_ADTYPE_LOCAL_NAME_SHORT
+0x09	GAP_ADTYPE_LOCAL_NAME_COMPLETE
+0x0a	GAP_ADTYPE_POWER_LEVEL
+0x16	GAP_ADTYPE_SERVICE_DATA
+0x2a	GAP_ADTYPE_MESH_MESSAGE
+0x2b 	GAP_ADTYPE_MESH_BEACON
+0xff	GAP_ADTYPE_MANUFACTURER_SPECIFIC
+)
+
+/* advertising channel PDU type */
+(
+0 ADV_IND
+1 ADV_DIRECT_IND
+2 ADV_NONCONN_IND
+3 SCAN_REQ
+3 AUX_SCAN_REQ
+4 SCAN_RSP
+5 CONNECT_REQ
+5 AUX_CONNECT_REQ
+6 ADV_SCAN_IND
+)
+
+(
+0 BIT_ADV_CHANNEL_MAP_37
+1 BIT_ADV_CHANNEL_MAP_38
+2 BIT_ADV_CHANNEL_MAP_39
+)
+
+(
+0xa0 param_le_sca
+)
+
Index: format/ble_protocol_stack/le_l2cap_att.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_l2cap_att.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_l2cap_att.format	(working copy)
@@ -0,0 +1,194 @@
+
+xmemalloc(
+	1 mem_le_l2cap_att_states
+
+	/* should be together */
+	1 mem_le_att_opcode
+	2 mem_le_att_handle
+	1 mem_le_search_res
+
+)
+
+amemalloc mem_temp_block2(
+	2 mem_le_search_handle_start
+	2 mem_le_search_handle_end
+	0 mem_le_att_offset
+	1 mem_le_search_att_type_length
+	16 mem_le_search_att_type
+
+	1 mem_le_curr_att_len
+
+	2 mem_le_cur_attlist_start_ptr
+	2 mem_le_cur_handle_start
+	2 mem_le_cur_handle_end
+	1 mem_le_cur_uuid_length
+	16 mem_le_cur_uuid
+)
+
+
+amemalloc mem_le_rxbuf(
+//data channel ATT start PDU
+	1 mem_le_rxbuf_data_att_header
+	1 mem_le_rxbuf_data_att_length
+	2 mem_le_rxbuf_data_att_l2cap_length
+	2 mem_le_rxbuf_data_att_cid
+	1 mem_le_rxbuf_data_att_opcode
+	250 mem_le_rxbuf_data_att_payload
+)
+
+
+amemalloc mem_le_rxbuf(
+//data channel ATT continue PDU
+	1 mem_le_rxbuf_data_continue_header
+	1 mem_le_rxbuf_data_continue_length
+	255 mem_le_rxbuf_data_continue_payload
+)
+
+amemalloc mem_le_rxbuf(
+//data channel ATT write request PDU
+	1 mem_le_rxbuf_data_att_write_header
+	1 mem_le_rxbuf_data_att_write_length
+	2 mem_le_rxbuf_data_att_write_l2cap_length
+	2 mem_le_rxbuf_data_att_write_cid
+	1 mem_le_rxbuf_data_att_write_opcode
+	2 mem_le_rxbuf_data_att_write_handle
+	248 mem_le_rxbuf_data_att_write_payload
+)
+
+amemalloc mem_le_rxbuf(
+//data channel ATT prepare write request PDU
+	1 mem_le_rxbuf_data_prepare_att_write_header
+	1 mem_le_rxbuf_data_prepare_att_write_length
+	2 mem_le_rxbuf_data_prepare_att_write_l2cap_length
+	2 mem_le_rxbuf_data_prepare_att_write_cid
+	1 mem_le_rxbuf_data_prepare_att_write_opcode
+	2 mem_le_rxbuf_data_prepare_att_write_handle
+	2 mem_le_rxbuf_data_prepare_att_write_offset
+	246 mem_le_rxbuf_data_prepare_att_write_payload
+)
+
+(//bit of mem_le_l2cap_att_states
+0 BLE_L2CAP_SEND_INDICATION_PACKET
+0 BLE_L2CAP_RECV_CONFIRMATION_PACKET
+1 BLE_L2CAP_DEAL_WITH_CONTINUE_PACKET
+)
+
+(//bit map of att handle
+14 BIT_OF_ATT_HANDLE_READ_AUTHENTICATED
+15 BIT_OF_ATT_HANDLE_WRITE_AUTHENTICATED
+)
+
+
+
+(
+0 BIT_CHARACTERISTIC_BROADCAST
+1 BIT_CHARACTERISTIC_READ
+2 BIT_CHARACTERISTIC_WRITE_WITHOUT_RESPONSE
+3 BIT_CHARACTERISTIC_WRITE
+4 BIT_CHARACTERISTIC_NOTIFY
+5 BIT_CHARACTERISTIC_INDICATE
+6 BIT_CHARACTERISTIC_SIGNED_WRITE
+7 BIT_CHARACTERISTIC_EXTENDED_PROPERTIES
+)
+
+/* ATT OPCODE */
+(
+0x01 ATTOP_ERROR_RESPONSE
+0x02 ATTOP_EXCHANGE_MTU_REQUEST
+0x03 ATTOP_EXCHANGE_MTU_RESPONSE
+0x04 ATTOP_FIND_INFORMATION_REQUEST
+0x05 ATTOP_FIND_INFORMATION_RESPONSE
+0x06 ATTOP_FIND_BY_TYPE_VALUE_REQUEST
+0x07 ATTOP_FIND_BY_TYPE_VALUE_RESPONSE
+0x08 ATTOP_READ_BY_TYPE_REQUEST
+0x09 ATTOP_READ_BY_TYPE_RESPONSE
+0x0A ATTOP_READ_REQUEST
+0x0B ATTOP_READ_RESPONSE
+0x0C ATTOP_READ_BLOB_REQUEST
+0x0D ATTOP_READ_BLOB_RESPONSE
+0x0E ATTOP_READ_MULTIPLE_REQUEST
+0x0F ATTOP_READ_MULTIPLE_RESPONSE
+0x10 ATTOP_READ_BY_GROUP_TYPE_REQUEST
+0x11 ATTOP_READ_BY_GROUP_TYPE_RESPONSE
+0x12 ATTOP_WRITE_REQUEST
+0x13 ATTOP_WRITE_RESPONSE
+0x16 ATTOP_PREPARE_WRITE_REQUEST
+0x17 ATTOP_PREPARE_WRITE_RESPONSE
+0x18 ATTOP_EXECUTE_WRITE_REQUEST
+0x19 ATTOP_EXECUTE_WRITE_RESPONSE
+0x1B ATTOP_HANDLE_VALUE_NOTIFICATION
+0x1D ATTOP_HANDLE_VALUE_INDICATION
+0x1E ATTOP_HANDLE_VALUE_CONFIRMATION
+0x52 ATTOP_WRITE_COMMAND
+0xD2 ATTOP_SIGNED_WRITE_COMMAND
+0x1f ATTOP_CONTINUE
+0x9e EMPTY_LE_DATA_PRE
+0x9f EMPTY_LE_DATA
+)
+
+/* ATT error code */
+(
+0x01 ATT_ERR_INVALID_HANDLE
+0x02 ATT_ERR_READ_NOT_PERMITTED
+0x03 ATT_ERR_WRITE_NOT_PERMITTED
+0x04 ATT_ERR_INVALID_PDU
+0x05 ATT_ERR_INSUFFICIENT_AUTHENTICATION
+0x06 ATT_ERR_REQUEST_NOT_SUPPORTED
+0x07 ATT_ERR_INVALID_OFFSET
+0x08 ATT_ERR_INSUFFICIENT_AUTHORIZATION
+0x09 ATT_ERR_PREPARE_QUEUE_FULL
+0x0A ATT_ERR_ATTRIBUTE_NOT_FOUND
+0x0B ATT_ERR_ATTRIBUTE_NOT_LONG
+0x0C ATT_ERR_INSUFFICIENT_ENCRYPTION_KEY_SIZE
+0x0D ATT_ERR_INVALID_ATTRIBUTE_VALUE_LENGTH
+0x0E ATT_ERR_UNLIKELY_ERROR
+0x0F ATT_ERR_INSUFFICIENT_ENCRYPTION
+0x10 ATT_ERR_UNSUPPORTED_GROUP_TYPE
+0x11 ATT_ERR_INSUFFICIENT_RESOURCES
+)
+
+/* GATT Specifications*/
+(
+0X2900 CHARACTERTIC_EXTENDED_PROPERTIES
+0X2901 CHARACTERTIC_USER_DESCRIPTION
+0X2902 CLIENT_CHARACTERTIC_CONFIGURATION
+0X2903 SERVER_CHARACTERTIC_CONFIGURATION
+0X2904 CHARACTERTIC_PRESENTATION_FORMAT
+0X2905 CHARACTERTIC_AGGREGATE
+0X2906 VALID_RANGE
+0X2907 EXTERNAL_REPORT_REFERENCE
+0X2908 REPORT_REFERENCE
+0X290B ENVIR_SENSING_CONFIGURATION
+0X290C ENVIR_SENSING_MEASUREMENT
+0X290D ENVIR_SENSING_TRIGGER_SETTING
+)
+
+
+/*	SERVICE UUID	*/
+(
+0x1800 UUID_SERVICE_GENERIC_ACC
+0x1801 UUID_SERVICE_GENERIC_ATT
+0x180a UUID_SERVICE_DEVICE_INFO
+0x180f UUID_SERVICE_BATTERY
+0x1812 UUID_SERVICE_HIDS
+0x2800 UUID_GATT_PRIMARY_SERVICE
+0x2801 UUID_GATT_SECONDARY_SERVICE
+0X2802 UUID_GATT_INCLUDE
+0X2803 UUID_GATT_CHARACTERISTIC
+0X2A00 UUID_CHRCTR_DEVICE_NAME
+0X2A19 UUID_CHRCTR_BATTERY_LEVEL
+0X2A22 UUID_CHRCTR_KEYBOARD_INPUT
+0X2A23 UUID_CHRCTR_SYSTEM_ID 
+0X2A25 UUID_CHRCTR_SERIAL_NUMBER
+0X2A26 UUID_CHRCTR_FIRMWARE
+0X2A32 UUID_CHRCTR_KEYBOARD_OUTPUT
+0X2A33 UUID_CHRCTR_MOUSE_INPUT
+0X2A4A UUID_CHRCTR_HID_INFO
+0X2A4B UUID_CHRCTR_REPORT_MAP
+0X2A4C UUID_CHRCTR_HID_CTRL_POINT
+0X2A4D UUID_CHRCTR_REPORT
+0X2A4E UUID_CHRCTR_PROTOCOL_MODE
+)
+
+
+
Index: format/ble_protocol_stack/le_l2cap_att_wechat.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_l2cap_att_wechat.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_l2cap_att_wechat.format	(working copy)
@@ -0,0 +1,85 @@
+ifdef COMPILE_WECHAT
+
+amemalloc mem_temp_block2(
+	0 mem_wechat_initreq_base_request
+	2 mem_wechat_authreq_base_request
+	4 mem_wechat_authreq_protocol_version
+	2 mem_wechat_authreq_auth_protocol
+	2 mem_wechat_authreq_eam_mac_no_encrypt
+	2 mem_wechat_authreq_mac_address
+	6 mem_wechat_authreq_device_address
+
+	1 mem_wechat_indication_handle
+	1 mem_wechat_write_handle
+	2 mem_wechat_tx_buffer_ptr
+	2 mem_wechat_rx_buffer_ptr
+	2 mem_wechat_rx_push_data_cb
+	2 mem_wechat_tx_nSeq
+	2 mem_wechat_tx_len
+	2 mem_wechat_tx_address
+	2 mem_wechat_rx_len
+	2 mem_wechat_rx_address
+	1 mem_wechat_receive_push_data
+
+)
+
+xmemalloc(
+
+/*
+wechat Air sync protocol parse
+uint8_t indication handle
+uint8_t write handle
+
+*/
+2 mem_le_wechat_air_sync_ptr
+
+)
+
+(
+17 WECHAT_AIR_SYNC_STRUCT_SIZE
+)
+
+(
+0x0000 ECI_NONE
+0x1127 ECI_REQ_AUTH
+0x1227 ECI_REQ_SEND_DATA
+0x1327 ECI_REQ_INIT
+0x214E ECI_RESPONSE_AUTH
+0x224E ECI_RESPONSE_SEND_DATA
+0x234E ECI_RESPONSE_INIT
+0x3175 ECI_PUSH_RECEIVE_DATA
+0x3275 ECI_PUSH_SWITCH_VIEW
+0x3375 ECI_PUSH_SWITCH_BACKGROUD
+0x2F75 ECI_ERR_DECODE
+)
+
+(
+2 ECI_REQ_INIT_MESSAGE_LENGTH
+18 ECI_REQ_AUTH_MESSAGE_LENGTH
+)
+
+(
+0xFE WECHAT_HEAD_MAGIC_NUMBER
+0x01 WECAHT_HEAD_VERSION
+0x01FE WECHAT_RX_HEAD
+)
+
+(
+//push data
+0x0a 	TAG_RecvDataPush_BasePush
+0x12	TAG_RecvDataPush_Data
+0x18	TAG_RecvDataPush_Type
+)
+
+
+(
+0 WECHAT_PROTOCOL_MESSAGE_B_MAGIC_NUMBER
+1 WECHAT_PROTOCOL_MESSAGE_B_VER
+2 WECHAT_PROTOCOL_MESSAGE_N_LENGTH
+4 WECHAT_PROTOCOL_MESSAGE_N_CMD_ID
+6 WECHAT_PROTOCOL_MESSAGE_N_SEQ
+8 WECHAT_PROTOCOL_MESSAGE_PAYLOAD
+)
+
+endif
+
Index: format/ble_protocol_stack/le_l2cap_signalling.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_l2cap_signalling.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_l2cap_signalling.format	(working copy)
@@ -0,0 +1,14 @@
+
+/* L2CAP Signaling OPCODE */
+(
+0x12 L2CAP_CONNECTION_PARAMETER_UPDATE_REQUEST
+0x13 L2CAP_CONNECTION_PARAMETER_UPDATE_RESPONSE
+)
+
+(
+0x0000 BLE_SIGNALING_CONNECT_PARAMETER_UPDATE_ACCEPTED
+0x0001 BLE_SIGNALING_CONNECT_PARAMETER_UPDATE_REJECTED
+)
+
+
+
Index: format/ble_protocol_stack/le_l2cap_smp.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_l2cap_smp.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_l2cap_smp.format	(working copy)
@@ -0,0 +1,113 @@
+
+
+(
+0x00 LE_PAIRING_MODE_NONE
+0x01 LE_PAIRING_MODE_LAGACY_JUSTWORK
+0x02 LE_PAIRING_MODE_LAGACY_PASSKEY
+0x04 LE_PAIRING_MODE_LAGACY_PASSKEY_RES_INPUT
+0x81 LE_PAIRING_MODE_SECURE_CONNECT_JUSTWORK
+0x82 LE_PAIRING_MODE_SECURE_CONNECT_NUMERIC
+0x83 LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY
+0x84 LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT
+
+7 LE_PAIRING_MODE_SECURE_CONNECT_BIT
+)
+
+
+(
+0 FLAG_IOCAP_DISPLAYONLY
+1 FLAG_IOCAP_DISPLAYYESNO
+2 FLAG_IOCAP_KEYBOARDONLY
+3 FLAG_IOCAP_NOINPUTNOOUTPUT
+4 FLAG_IOCAP_KEYBOARDDISPLAY
+
+0x00 FLAG_OOB_DATA_FLAG_NO
+)
+
+(
+0x00 FLAG_LE_NO_BONDING_NO_MITM
+0x01 FLAG_LE_BONDING_NO_MITM
+0x04 FLAG_LE_NO_BONDING_MITM
+0x05 FLAG_LE_BONDING_MITM
+0x09 FLAG_LE_BONDING_NO_MITM_SECURE
+0x0D FLAG_LE_BONDING_MITM_SECURE
+
+2 LE_AUTH_MITM_BIT
+3 LE_AUTH_SECURE_CONNECTION_PAIRING_BIT
+)
+
+//mem_le_pairing_state
+(
+0 FLAG_LE_PAIRING_NULL
+1 FLAG_LE_PAIRING_START
+2 FLAG_LE_PAIRING_SEND_RECURITY_REQ
+3 FLAG_LE_PAIRING_RCV_PAIRING_REQ
+4 FLAG_LE_PAIRING_WAIT_STK_GENERATION
+5 FLAG_LE_PAIRING_RECEIVE_PAIRING_CONFIRM
+6 FLAG_LE_PAIRING_SEND_PAIRING_CONFIRM
+7 FLAG_LE_PAIRING_RECEIVE_PAIRING_RANDOM
+8 FLAG_LE_PAIRING_SEND_PAIRING_RANDOM
+9 FLAG_LE_PAIRING_AFTER_AUTH
+10 FLAG_LE_PAIRING_SEND_START_ENC_RSP
+11 FLAG_LE_PARING_SEND_ENC_INFORMATION
+12 FLAG_LE_PARING_SEND_MASTER_IDENTIFICATION 
+13 FLAG_LE_PARING_SEND_INDENTITY_INFORMATION
+0xff FLAG_LE_PAIRING_END
+)
+
+/* Security Manager Protocol Code */
+(
+0x01 SMP_PAIRING_REQUEST
+0x02 SMP_PAIRING_RESPONSE
+0x03 SMP_PAIRING_CONFIRM
+0x04 SMP_PAIRING_RANDOM
+0x05 SMP_PAIRING_FAILED
+0x06 SMP_ENCRYPTION_INFORMATION
+0x07 SMP_MASTER_IDENTIFICATION
+0x08 SMP_IDENTITY_INFORMATION
+0x09 SMP_IDENTITY_ADDRESS_INFORMATION
+0x0A SMP_SIGNING_INFORMATION
+0x0B SMP_SECURITY_REQUEST
+0x0c SMP_PAIRING_PUBLIC_KEY
+0x0d SMP_PAIRING_DHKEY_CHECK
+)
+
+(// pairing failed reason
+0x00 PAIRING_FAILED_RESERVED
+0X01 PAIRING_FAILED_PASSKEY_ENTRY_FAILED
+0X02 PAIRING_FAILED_OOB_NOT_AVAILABLE
+0X03 PAIRING_FAILED_AUTHENTICATION_REQUIRE
+0X04 PAIRING_FAILED_CONFIRM_VALUE_FAILED
+0X05 PAIRING_FAILED_PAIRING_NOT_SUPPORTED
+0X06 PAIRING_FAILED_ENCRYPTION_KEY_SIZE
+0X07 PAIRING_FAILED_COMMAND_NOT_SUPPORTED
+0X08 PAIRING_FAILED_UNSPECIFIED_REASON
+0X09 PAIRING_FAILED_REPEATED_ATTEMPTS
+0X0A PAIRING_FAILED_INVALID_PARAMETERS
+0X0B PAIRING_FAILED_DHKEY_CHECK_FAILED
+0X0C PAIRING_FAILED_NUMERIC_COMPARISON_FAILED
+0X0D PAIRING_FAILED_BR_EDR_PAIRING_IN_PROGRESS
+0X0E PAIRING_FAILED_KEY_DERIVATION_GENERATION_NOT_ALLOWED
+)
+
+/*LE secure connect state */
+(
+0x00 LE_SC_STAT_NULL
+0x01 LE_SC_STAT_RECEIVE_PUBLIC_KEY
+0x02 LE_SC_STAT_WAIT_SEND_PUBLIC_KEY
+0x03 LE_SC_STAT_SEND_PUBLIC_KEY
+0x04 LE_SC_STAT_RECEIVE_RANDOM
+0x05 LE_SC_STAT_SEND_RANDOM
+0x06 LE_SC_STAT_RECEIVE_DHKEY
+0x07 LE_SC_STAT_WAIT_CONFIRM_GKEY
+0x08 LE_SC_STAT_PASSKEY_WAIT_CONFIRM
+)
+
+
+(
+0 FLAG_LE_SC_CONFRIM_NULL
+1 FLAG_LE_SC_CONFRIM_GKEY_OK
+)
+
+
+
Index: format/ble_protocol_stack/le_ll.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_ll.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ble_protocol_stack/le_ll.format	(working copy)
@@ -0,0 +1,120 @@
+xmemalloc(
+8 mem_le_local_feature
+1 mem_le_tx_phys
+1 mem_le_rx_phys
+
+2 mem_remote_rx_max_octets
+2 mem_remote_rx_max_time
+2 mem_remote_tx_max_octets
+2 mem_remote_tx_max_time
+2 mem_local_rx_max_octets
+2 mem_local_rx_max_time
+2 mem_local_tx_max_octets
+2 mem_local_tx_max_time
+
+)
+
+/* LE control packet type */
+(
+0x00 LL_CONNECTION_UPDATE_IND
+0x01 LL_CHANNEL_MAP_IND
+0x02 LL_TERMINATE_IND
+0x03 LL_ENC_REQ
+0x04 LL_ENC_RSP
+0x05 LL_START_ENC_REQ
+0x06 LL_START_ENC_RSP
+0x07 LL_UNKNOWN_RSP
+0x08 LL_FEATURE_REQ
+0x09 LL_FEATURE_RSP
+0x0A LL_PAUSE_ENC_REQ
+0x0B LL_PAUSE_ENC_RSP
+0x0C LL_VERSION_IND
+0x0D LL_REJECT_IND
+0x0E LL_SLAVE_FEATURE_REQ
+0x0F LL_CONNECTION_PARAM_REQ
+0x10 LL_CONNECTION_PARAM_RSP
+0x11 LL_REJECT_IND_EXT
+0x12 LL_PING_REQ
+0x13 LL_PING_RSP
+0x14 LL_LENGTH_REQ
+0x15 LL_LENGTH_RSP
+0x16 LL_PHY_REQ
+0x17 LL_PHY_RSP
+0x18 LL_PHY_UPDATE_IND
+0x19 LL_MIN_USED_CHANNELS_IND
+0x1A LL_CTE_REQ
+0x1B LL_CTE_RSP
+0x1C LL_PERIODIC_SYNC_IND
+0x1D LL_CLOCK_ACCURACY_REQ
+0x1E LL_CLOCK_ACCURACY_RSP
+0x1F LL_CIS_REQ
+0x20 LL_CIS_RSP
+0x21 LL_CIS_IND
+0x22 LL_CIS_TERMINATE_IND
+0x23 LL_POWER_CONTROL_REQ
+0x24 LL_POWER_CONTROL_RSP
+0x25 LL_POWER_CHANGE_IND
+)
+
+
+
+(//bit map of mem_le_ll_feature
+//LL_FEATURE_REQ
+0 BIT_LL_FEATURE_LE_ENCRYPTION
+1 BIT_LL_FEATURE_CONNECTION_PARAMETERS_REQUEST_PROCEDURE
+2 BIT_LL_FEATURE_EXTENDED_REJECT_INDICATION
+3 BIT_LL_FEATURE_SLAVE_INITIATED_FEATURES_EXCHANGE
+4 BIT_LL_FEATURE_LE_PING
+5 BIT_LL_FEATURE_LE_DATA_PACKET_LENGTH_EXTENSION
+6 BIT_LL_FEATURE_LL_PRIVACY
+7 BIT_LL_FEATURE_EXTENDED_SCANNER_FILTER_POLICIES
+8 BIT_LL_FEATURE_LE_2M_PHY
+9 BIT_LL_FEATURE_STABLE_MODULATION_INDEX_TRANSMITTER
+10 BIT_LL_FEATURE_STABLE_MODULATION_INDEX_RECEIVER
+11 BIT_LL_FEATURE_LE_CODED_PHY
+12 BIT_LL_FEATURE_LE_EXTENDED_ADVERTISING
+13 BIT_LL_FEATURE_LE_PERIODIC_ADVERTISING
+14 BIT_LL_FEATURE_CHANNEL_SELECTION_ALGORITHM
+15 BIT_LL_FEATURE_LE_POWER_CLASS_1
+16 BIT_LL_FEATURE_MINIMUM_NUMBER_OF_USED_CHANNELS_PROCEDURE
+)
+(//function map of mem_le_ll_feature
+//LL_FEATURE_REQ
+0x1 FUN_LL_FEATURE_LE_ENCRYPTION
+0x2 FUN_LL_FEATURE_CONNECTION_PARAMETERS_REQUEST_PROCEDURE
+0x4 FUN_LL_FEATURE_EXTENDED_REJECT_INDICATION
+0x8 FUN_LL_FEATURE_SLAVE_INITIATED_FEATURES_EXCHANGE
+0x10 FUN_LL_FEATURE_LE_PING
+0x20 FUN_LL_FEATURE_LE_DATA_PACKET_LENGTH_EXTENSION
+0x40 FUN_LL_FEATURE_LL_PRIVACY
+0x80 FUN_LL_FEATURE_EXTENDED_SCANNER_FILTER_POLICIES
+0x100 FUN_LL_FEATURE_LE_2M_PHY
+0x200 FUN_LL_FEATURE_STABLE_MODULATION_INDEX_TRANSMITTER
+0x400 FUN_LL_FEATURE_STABLE_MODULATION_INDEX_RECEIVER
+0x800 FUN_LL_FEATURE_LE_CODED_PHY
+0x1000 FUN_LL_FEATURE_LE_EXTENDED_ADVERTISING
+0x2000 FUN_LL_FEATURE_LE_PERIODIC_ADVERTISING
+0x4000 FUN_LL_FEATURE_CHANNEL_SELECTION_ALGORITHM
+0x8000 FUN_LL_FEATURE_LE_POWER_CLASS_1
+0x10000 FUN_LL_FEATURE_MINIMUM_NUMBER_OF_USED_CHANNELS_PROCEDURE
+)
+
+(//bit of mem_le_tx_phys and mem_le_rx_phys
+0x00 BIT_LE_1M_PHY
+0x01 BIT_LE_2M_PHY
+0x02 BIT_LE_CODED_PHY
+
+0x02 BIT_LE_CODED_PHY_S2
+0x07 BIT_LE_CODED_PHY_S8
+)
+
+(//map of mem_le_tx_phys and mem_le_rx_phys
+0x01 FUN_TX_LL_1M_PHY
+0x02 FUN_TX_LL_2M_PHY
+0x04 FUN_TX_LL_CODED_PHY
+
+0x01 FUN_RX_LL_1M_PHY
+0x02 FUN_RX_LL_2M_PHY
+0x04 FUN_RX_LL_CODED_PHY
+)
+
Index: format/bt.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/bt.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/bt.format	(working copy)
@@ -0,0 +1,1094 @@
+
+	width = 32
+	const length = 12000
+
+	/* ========= memory ============== */
+memalloc(
+/* 00-0f most frequently used area  */
+1 mem_le_adv_transmit
+1 mem_le_adv_waitcnt
+1 mem_le_adv_rcv
+1 mem_le_req_rcv
+1 mem_le_scanrsp_rcv
+1 mem_le_conn_rcv
+
+1 mem_inquiryscan_waitcnt
+1 mem_inquiryscan_rcvcnt
+1 mem_pagescan_waitcnt
+1 mem_pagescan_rcvcnt
+1 mem_pagescan_rcvfhscnt
+1 mem_slave_rcvcnt
+1 mem_page_transmit
+1 mem_page_rcv
+1 mem_page_rcv_fhs
+1 mem_master_rcvcnt
+
+/* 10-1f debug area */
+1 mem_fhs_wait_counter
+1 mem_newconnto_counter
+1 mem_inquiry_transmit
+1 mem_inquiry_rcv
+1 mem_fw_ver
+1 mem_current_context
+1 mem_le_ch_mapped
+1 mem_last_freq
+1 mem_rssi
+1 mem_rssi_hex
+1 mem_rx_type
+2 mem_rx_hec_err
+2 mem_rx_crc_err
+2 mem_context_ptr
+8 mem_display
+8 mem_bcd
+
+		/* context swappable area */
+1 mem_state
+1 mem_mode
+2 mem_tsniff
+4 mem_sniff_anchor
+6 mem_clk_offset
+2 mem_rx_window
+3 mem_plap
+1 mem_puap
+2 mem_pnap
+1 mem_conn_handle
+1 mem_arq
+1 mem_lmp_to_send
+1 mem_lmi_opcode
+1 mem_lmo_reason
+1 mem_op
+1 mem_state_map
+4 mem_supervision_timer
+2 mem_supervision_to
+1 mem_name_offset
+1 mem_key_size
+1 mem_conn_sm
+12 mem_aco
+16 mem_kc
+1 mem_conn_timer
+1 mem_sniff_attempt
+1 mem_sniff_timeout
+2 mem_dsniff
+1 mem_amaddr
+1 mem_lmo_opcode1
+1 mem_lmi_opcode1
+1 mem_lmo_reason1
+1 mem_lmo_tid1
+1 mem_lmo_opcode2
+1 mem_lmi_opcode2
+1 mem_lmo_reason2
+1 mem_lmo_tid2
+8 mem_bt_context_reserve
+	/*context ending*/
+
+1 mem_current_sniff_attempt
+1 mem_current_sniff_timeout
+1 mem_nfreq_index_inq
+1 mem_nfreq_index_page
+1 mem_ninqy_index
+1 mem_fhs_misc
+
+
+
+/* lpo related */
+4 mem_subsniff_instant
+1 mem_subsniff_rate
+2 mem_subsniff_tcmax
+1 mem_subsniff_tsniff
+1 mem_lpm_adjust
+6 mem_sync_clke
+1 mem_lpm_current_mult
+4 mem_gpio_wakeup_low
+4 mem_gpio_wakeup_high
+
+
+//page
+1 mem_npage_index
+1 mem_page_mode
+4 mem_page_clk
+
+
+
+/*temp mem*/
+1 mem_temp_am_addr
+1 mem_temp_arq
+
+//
+2 mem_len
+4 mem_clkn_bt
+4 mem_clke_bt
+4 mem_dpll_clkn
+1 mem_connection_options
+
+1 mem_nameres_cnt
+2 mem_txptr
+2 mem_slot_offset
+
+//extm
+1 extm_fhs_misc
+1 extm_newconn_am_addr
+3 extm_class
+3 extm_lap
+1 extm_uap
+3 extm_nap
+
+21 mem_rxbuf
+
+//debug
+1 mem_debug_config
+1 mem_lch_code
+1 mem_fhs_am_addr
+1 mem_select_list_item
+0 mem_temp_reconn_record
+1 mem_record_bt_mode
+6 mem_temp_lap
+2 mem_list_item_ptr
+
+100 mem_eir
+
+
+2 mem_param_tx_setup
+2 mem_param_rf_setup
+2 mem_param_conn_access
+2 mem_param_clke_cal
+2 mem_param_pll_setup
+2 mem_param_rx_setup
+2 mem_param_dpll_start_delay
+2 mem_param_rt_rthalfslot
+2 mem_param_clke_cal_le_1m
+2 mem_param_clke_cal_le_2m
+2 mem_param_clke_cal_le_coded
+
+)
+
+memalloc iqcal (
+2 mem_vdk
+4 mem_vok
+6 mem_omega
+4 mem_b1
+4 mem_b2
+16 mem_u1
+16 mem_u2
+16 mem_q
+)
+
+memalloc test (
+/* test related */
+2 mem_tst_pktcnt_sync
+2 mem_tst_pktcnt_hec
+2 mem_tst_pktcnt_crc
+2 mem_tst_pktcnt_dmh
+3 mem_tmp_buffer_head
+80 mem_tmp_buffer
+
+
+1 mem_tester_emulate
+0 mem_temp_payload
+1 test_mode_scenario
+1 test_mode_hopping_mode
+1 test_mode_tx_freq
+1 test_mode_rx_freq
+1 test_mode_power_mode
+1 test_mode_poll_period
+1 test_mode_packet_type
+2 test_mode_data_length
+1 mem_test_mode_old_debug_config
+1 mem_tester_cnt
+
+)
+
+
+xmemalloc(
+/* patch enable 0x4000-0x403f  */
+
+1 mem_patch00
+1 mem_patch01
+1 mem_patch02
+1 mem_patch03
+1 mem_patch04
+1 mem_patch05
+1 mem_patch06
+1 mem_patch07
+1 mem_patch08
+1 mem_patch09
+1 mem_patch0a
+1 mem_patch0b
+1 mem_patch0c
+1 mem_patch0d
+1 mem_patch0e
+1 mem_patch0f
+1 mem_patch10
+1 mem_patch11
+1 mem_patch12
+1 mem_patch13
+1 mem_patch14
+1 mem_patch15
+1 mem_patch16
+1 mem_patch17
+1 mem_patch18
+1 mem_patch19
+1 mem_patch1a
+1 mem_patch1b
+1 mem_patch1c
+1 mem_patch1d
+1 mem_patch1e
+1 mem_patch1f
+1 mem_patch20
+1 mem_patch21
+1 mem_patch22
+1 mem_patch23
+1 mem_patch24
+1 mem_patch25
+1 mem_patch26
+1 mem_patch27
+1 mem_patch28
+1 mem_patch29
+1 mem_patch2a
+1 mem_patch2b
+1 mem_patch2c
+1 mem_patch2d
+1 mem_patch2e
+1 mem_patch2f
+1 mem_patch30
+1 mem_patch31
+1 mem_patch32
+1 mem_patch33
+1 mem_patch34
+1 mem_patch35
+1 mem_patch36
+1 mem_patch37
+1 mem_patch38
+1 mem_patch39
+1 mem_patch3a
+1 mem_patch3b
+1 mem_patch3c
+1 mem_patch3d
+1 mem_patch3e
+1 mem_patch3f
+
+	/* 3 device contexts  */
+88 mem_context
+1 mem_current_amaddr
+1 mem_lpm_mode
+1 mem_device_option
+1 mem_scan_mode
+4 mem_last_clkn
+
+	/* parameters */
+8 mem_features
+3 mem_lap
+1 mem_uap
+2 mem_nap
+1 mem_npage
+3 mem_glap
+3 mem_class
+2 mem_iscan_window
+2 mem_iscan_interval
+2 mem_pscan_window
+2 mem_pscan_interval
+2 mem_page_interval
+2 mem_page_window
+2 mem_page_to
+2 mem_inq_window
+1 mem_fcomp_div
+2 mem_rx_window_init
+2 mem_rx_window_sniff
+2 mem_rf_init_ptr
+
+	/* connection related */
+1 mem_last_type
+1 mem_last_type_esco
+1 mem_last_type_saved
+2 mem_retransmission_cnt
+4 mem_next_btclk
+
+1 mem_rf_rccal
+1 mem_handle_num
+1 mem_max_slot
+1 mem_eir_enable
+
+/* AFH related */
+4 mem_afh_instant
+2 mem_afh_error_total
+1 mem_afh_cfg
+1 mem_afh_new_mod
+5 mem_afh_map_lo
+5 mem_afh_map_hi
+1 mem_afh_used
+2 mem_afh_index
+11 mem_afh_map_new
+80 mem_afh_map
+4 mem_afh_timer
+10 mem_afh_classify_channel_map
+
+
+	/* lpm related */
+2 mem_lpm_wake_lock
+2 mem_lpm_interval
+1 mem_lpm_overhead
+1 mem_lpm_hibernate_switch
+1 mem_esco_addr
+1 mem_sniff_unint_lost
+1 mem_ptt
+4 mem_sleep_counter   //should be 0x41fc in REVC
+4 mem_sleep_counter_all
+6 mem_sleep_clkn
+3 mem_sniff_rcv
+3 mem_sniff_lost
+3 mem_clks_per_lpo
+
+1 mem_lpm_mult
+1 mem_lpm_mult_timeout
+1 mem_lpm_mult_cnt
+
+/* 8139-813b lpm_ctrl[31:12] */
+0 mem_lpm_config				
+1 mem_lpm_xtal_ib
+1 mem_lpm_ctrim
+1 mem_lpm_padding
+
+1 mem_lpm_xtalcnt
+1 mem_lpm_buckcnt
+1 mem_lpm_ldocnt
+1 mem_lpm_isogate
+1 mem_lpm_isogate_final
+4 mem_lpm_ctrl3
+20 mem_saved_gpio	// should be 0x421e in REVC
+3 mem_saved_gsel
+8 mem_saved_mark
+1 mem_saved_spidctrl
+2 mem_patch_ptr
+2 mem_patch_len
+
+32 mem_timers
+
+/*LINK KEY*/
+1 mem_link_key_exists
+16 mem_link_key
+
+
+/* HCI */
+1 mem_hci_cmd
+1 mem_hci_conn_handle
+3 mem_hci_plap
+1 mem_hci_puap
+2 mem_hci_pnap
+
+
+1 mem_loadcode_times
+1 mem_llid
+
+1 mem_tx_lch
+2 mem_tx_len
+
+1 mem_tx_power
+1 mem_modem_rssi
+1 mem_gain_fix
+3 mem_gain_table
+1 mem_gain_second_agc_en
+
+ifdef DEBUG_RF_INIT
+1 mem_rf_init_data
+endif
+1 mem_system_clk
+)
+
+(//mem_system_clk
+12 SYSTEM_CLK_12M
+24 SYSTEM_CLK_24M
+)
+
+(//bluetooth tx power
+0x00 TX_POWER_0DB
+0x03 TX_POWER_3DB
+0x05 TX_POWER_5DB
+0x06 TX_POWER_6DB
+0x07 TX_POWER_7DB
+0x0a TX_POWER_10DB
+
+0x83 TX_POWER_F3DB
+0x85 TX_POWER_F5DB
+0x94 TX_POWER_F20DB
+0x9e TX_POWER_F30DB
+)
+
+
+	/* context */
+(
+0x01 coffset_mode
+0x02 coffset_tsniff
+0x04 coffset_sniff_anchor
+0x08 coffset_clk_offset
+0x0e coffset_rx_window
+0x10 coffset_plap
+0x16 coffset_conn_handle
+0x17 coffset_arq
+	/* 3.0 only */
+0x18 coffset_lmp_to_send
+0x1b coffset_op
+0x1c coffset_state_map
+	/* le only */
+0x18 coffset_le_ch
+0x19 coffset_le_hop
+0x1a coffset_le_event_cnt
+0x1c coffset_le_supervision_timer
+0x20 coffset_le_instant
+0x22 coffset_le_channels
+0x23 coffset_le_op
+0x24 coffset_le_access
+0x28 coffset_le_crcinit
+0x2b coffset_le_window_size
+0x2c coffset_le_slave_latency
+0x2e coffset_le_slave_superto
+0x30 coffset_le_channel_map
+0x35 coffset_le_rx_phy
+0x36 coffset_le_tx_phy
+0x37 coffset_le_new_map
+0x37 coffset_le_new_m2s_phy
+0x38 coffset_le_new_s2m_phy
+0x37 coffest_le_new_transmitwindowsize
+0x38 coffest_le_new_transmitwindowoffset
+0x3a coffest_le_new_conninterval
+0x3c coffest_le_new_connslavelatency
+0x3e coffest_le_new_connsupervisiontimeout
+0x40 coffset_le_sk
+0x50 coffset_le_peer_sca
+0x53 coffset_le_transmit_window
+	
+88 context_size
+1 context_num
+)
+
+(
+0 lpm_flag_wake
+1 lpm_flag_loadcode
+)
+
+/* ========= parameters ============== */
+(
+0x0050 param_newconn_arq
+0x0007 param_esco_addr
+0x0010 param_conn_handle
+0x01f0 param_conn_handle_comp
+0x0020 param_newconnto
+0x0008 param_pagerespto
+0x0a00 param_snooze_setup_orig
+0x5353 param_snooze_ahead_orig
+0x00ff param_ninquiry
+0x2000 param_page_to
+0x0005 param_max_slot
+0x0010 param_sco_poll
+
+/* 24Mhz clock setting */
+ifdef CLK24M
+0x1c86 param_tx_setup
+0x0c00 param_rf_setup
+0x0c00 param_conn_access 
+0x1a00 param_rx_setup
+0x0776 param_clke_cal
+0x0a00 param_pll_setup
+4000 param_dpll_start_delay
+7500 param_halfclk
+60084 param_halfclk_neg
+-60084 param_halfclk_neg1
+else
+/* 12Mhz clock setting */
+0x0e43 param_tx_setup
+0x0600 param_rf_setup
+0x0600 param_conn_access 
+0x03bb param_clke_cal
+0x0500 param_pll_setup		// 120 is minimum
+0x0d00 param_rx_setup	// 114us before sync
+2000 param_dpll_start_delay
+3750 param_rt_rthalfslot
+
+480 param_clke_cal_le_1m	//preamble(1B) & access address(4B) time (1+4)*8*1 * 12
+288 	param_clke_cal_le_2m	//preamble(2B) & access address(4B) time (1+4)*8*1 * 12
+282 param_clke_cal_le_coded	//preamble(80us) & access address(256us)-312.5us(0.5slot)
+endif
+
+110 param_lpm_fix
+10 param_lpo_extra
+200 param_lpm_adjmax
+
+ifdef SIM
+20 param_hibernate_clks
+3 param_chgpump_delay
+else
+-1 param_hibernate_clks
+3000 param_chgpump_delay
+endif
+
+3 param_featrue_ssp
+0x0101 param_lmpext_ssp_enable
+30   param_sco_pktlen
+1     param_acl_pktcnt		/*buffer acl pkt cnt*/
+7     param_sco_pktcnt
+
+
+0x8fffff param_features0
+0x9d83fe param_features1  // not support afh
+0x8359     param_features2
+0x000033 param_unap
+0x001177 param_lap
+0x9e8b33 param_glap
+0x002540 param_class//0x180208 //0x002580//402500//240404
+0x000a04 param_lmp_version//0x0a04
+0x000a06 param_lmp_version0
+0x12e9 param_lmp_subversion
+0x0012 param_tisw
+0x0012 param_tpsw
+0x1000 param_tisi
+0x0800 param_tpsi
+0x0020 param_page_window
+0x0020 param_inq_window
+0x1c80 param_supervision_to
+39 param_fcomp_div
+2 param_fcomp_mul
+6     param_name_len
+0x535442 param_name
+0x344950 param_name1
+
+
+)
+
+/* ======= packet types  ========= */
+(
+0x0      type_null    
+0x1      type_poll   
+0x2      type_fhs    
+0x3      type_dm1    
+0x4      type_dh1    
+0x5      type_hv1    
+0x6      type_hv2    
+0x7      type_hv3    
+0x8      type_3dh1     
+0x9      type_aux1   
+0xa      type_dm3    
+0xb      type_dh3    
+0xe      type_dm5    
+0xf      type_dh5    
+0x10     type_id
+0x11     type_shutdown
+0x13     type_lmp
+)
+
+/* ========== flag[6] =============== */
+(
+0        always        /* always 1 */
+1        true          /* set/rstn by verify,compare,icompare (true) */
+2        positive      /* set/rstn by all alu operations (opcode = 0x03,0x13,0x0f,0x1f), if alu output >= 0 */
+3        timeout       /* read only, the timeout from timers */
+5        zero          /* set/rstn by all alu operations (opcode = 0x03,0x13,0x0f,0x1f), if alu output == 0 */
+6        crc_failed    /* level, cleared by hop_start */
+7        enable_white  /* outside mux decide whether to load bt_clk or response_X */
+8        enable_parity /* level */
+9        enable_crc    /* level */
+10       enable_hec    /* level */
+11       decode_fec1   /* level */
+12       decode_fec2   /* level */
+13       decode_fec0   /* level */
+14       encrypt       /* level */
+15       crc16       /* for caculate ccitt crc16 */
+16       swfine	/* =0 stop_watch count based on oneslot =1 on 1 clock */
+20       rqst_freq    /* pulse, to start calculating frequency */
+21       recalc        /* pulse, to recalculate the fhs_parity */
+22       init_encrypt  /* pulse, issued to initialize encrption */
+23       mhalfbnd    /* half slot boundary of clke_rt, or when clke_bt[0] toggles */
+24       sync          /* sync found as a result of correlation,set/rstn by correlate opcode */
+25       user10    /* user10 */
+26       kc_p_activate  /* pulse to recalc the kc_p */
+27       encode_fec1   /* level */
+28       encode_fec2   /* level */
+29       encode_fec0   /* level */
+30       packet_end    /* pulse */
+32       is_tx         /* level */
+33       is_rx         /* level */
+34       halfslot     /* pulse, read only, when clkn_bt[0] toggles */
+35       oneslot      /* pulse, read only, when clkn_bt[1] toggles */
+36       mslotbnd     /* pulse, read only, when clke_bt[1] toggles */
+37       expire       /* level, read only, when selected clock source exceed timeup value */
+38       meet         /* level, read only, when selected clock source meet timeup value */
+39       tx_clear     /* level, read only, indicate tx pipe is cleared */
+40       user         /* user0 */
+41       master        /* user1 */
+42       slave2         /* user2 */
+43       wake           /* user3 */
+44       user2        /* user4 */
+45       match         /* user5 */
+46       attempt        /* user6 */
+47       user3          /* user7 */
+48       clknt         /* user8 */
+49	   user7 	/* user9 */
+50       synchronize   /* synchronize lpo and regular version of the clock */
+51       lpo_edge  /* read only, 3 clocks after risling edge of lpo clock */
+52       blank         /* C0 only, means pdata == 0 */
+53       modone          /* set divide operation is done */
+54       le		/* bluetooth 4.0 LE enable */
+55       aes_ready	/* set when aes is ok */
+56       encode_fec3   /* level */
+57       dewhiten_code_calc   /* dewhiten code calculate */
+58       lr_s2en       /* long range s2 enable */
+60	   ble_coded_info	//1:s2 0:s8
+63       never         /* read only, always 0 */
+)
+
+default flag = always
+
+/* ========== reg[6] =============== */
+(
+0        mark   /* for keeping strobes, more permanent */
+1        type   /* save and verify during rx */     /* rw */
+2        temp   /* general purpose register, 64 bits */
+3        contu  /* contr uart */
+3	 contru	/*contr uart*/
+3	 contwu	/*contw uart*/
+4        am_addr      /* verify during rx, read and send during tx */ /* ro */
+5        contw        /* last mem_addr during write */
+6        contr        /* last mem_addr during read */
+7        queue    /* the index of qset*,qisolate* commands, ie, if queue = 3, qset/qisolate operate on bit3 */
+8        debug    /* can be wired out for observation */
+9        access   /* the 72 bit access word */
+10       contus   /* contw uart */
+11       timeup        /* when does certain counter expire */
+12       pwindow       /* bit 71-61 of pdata; because on rx, bits shifts in from 71 down */
+13       fhs_parity    /* re-gernated based on bt_adr( {nap,uap,lap} ) when recalc flag is pulsed */
+14       white_init    /* init value of the whitening */
+15       crc24_init        /* init crc24 lfsr, 24 bits */
+16       contue    /* set interrupts, 40 bits */
+17       rega          /* general purpose register, 32 bits */
+18       regb          /* general purpose register, 32 bits */
+19       regc          /* general purpose register, 17 bits */
+20       regab         /* concat of {rega,regb}, thus 64 bits */
+21       radio_ctrl   /* radio i/f direct i/o ctrl, check following "radio_ctrl" section */
+
+23       freq_index   /* 7 bit read only */
+24       regd    /* 32 bit regext[1,0] */
+25       clkn              /* {clkn_bt, clkn_rt} */
+26       clke              /* {clke_bt, clke_rt} */
+27       stop_watch		
+28       fhs_misc   /* SR, SP, pscan mode */
+29       fhs_class  /* class field in fhs */
+30       fhs0   /* read only, bit 0-71 of fhs word */
+31       fhs1   /* read only, bit 72-142 of fhs word */
+32       bt_adr /* r/w, the bt_addr to access gen and freq hopping, contain only lap and uap */
+33       bt_clk /* r/w, the bt_clk for freq hopping */
+34       clkn_bt  /* read only, native bluetooth clock, free running 3.2KHz  or controlled by RTHALFSLOT register */
+35       clkn_rt  /* read only, native realtime clock, free running 12MHz, count from 0-3749, or controlled by RTHALFSLOT register */
+36       freq_mode
+37       xin   /* x parameter, read only */
+38       N_tx_slot /* the N factor in equations for Xi,Xp,Xprm,Xprs */
+39 	   auxcnt
+40       clke_bt  /* r/w,  external bluetooth clock , free running 3.2KHz or controlled by RTHALFSLOT register */
+41       clke_rt  /* r/w,  external realtime clock, , free running 12MHz, count from 0-3749, or controlled by RTHALFSLOT register */
+42       branch_addr	/* last branch address */
+43       rege         /* 64bit regext[3,2] */
+44       lap
+45       uap
+46       nap         
+47       regext		/* r/w extended 12x32bit registers,  indexed by regext_index */
+48       alarm             /* r/w, lpo wake up time, this is also how lpo and current clock keep sync */
+49       lpo_time          /* read only, this is the value to be copied back to clkn/clke after wakeup */
+50       kc_ls             /* secret key,                71: 0 */
+51       kc_ms             /* secret key,               127:72 */
+52       g1l               /* encryption length                */
+53		mask3ff		/* for mask 0x3ff operation */
+54       aes_ctrl		
+55       regf			/* 64bit regext[5,4] */
+56       regext_index   /* index of regext */
+57	     loopcnt
+58      stack			/* current return address */
+59       stack_ptr		/* stack depth */
+61         pc /* direct goto */
+62       null              /* to nowhere */
+63       pdata /* the shift register */
+)
+default reg = pdata
+
+/* regext_index */
+(
+0 regidx_data
+4 regidx_key
+8 regidx_xor
+12 regidx_result
+)
+/* ========== radio_ctrl========= */
+(
+0 TXGFSK
+1 PSK
+2 PSK3M
+3 RESET
+)
+/* assign BPWR = radio_ctrl[0]; */
+/* assign PARAMP = radio_ctrl[1]; */
+/* assign XTALPU = radio_ctrl[2]; */
+/* assign SYNTHPU = radio_ctrl[3]; */
+/* assign TXPU = radio_ctrl[4]; */
+/* assign RXPU = radio_ctrl[5]; */
+/* assign SLCTRL = radio_ctrl[6]; */
+/* assign XTALSEL_MUX_SEL = radio_ctrl[7] */
+
+
+/* =========== destination[4] ============== */
+(
+0 bucket
+1 rxf
+2 back
+3 mod
+)
+default dest = bucket
+
+/* =========== source[4] ============= */
+(
+1 txf
+3 demod
+)
+default source = 0
+
+
+/* ============== mark ============= */
+(
+0  mark_fhs_eir  
+1  mark_rxbuf_inuse
+2  mark_tx_l2cap
+3  mark_switch_initiated
+4  mark_accept_switch
+5  mark_loopback
+7  mark_esco
+8  mark_esco_rxok
+9  mark_context
+10 mark_am_addr_broadcast
+11 mark_fhs_already_good
+12 mark_page_trainb
+13 mark_lpm_mult_enable
+14 mark_usb_first_resp
+15 mark_old_packet
+16 mark_longpacket
+17 mark_testmode
+18 mark_ar2
+28 mark_inquiry_on
+29 mark_inquiry_state
+30 mark_inquiry_trainb
+31 mark_periodical_diac
+32 mark_all_diac
+33 mark_slave_in_rand_accepted
+34 mark_reconn_recieve_switch
+35 mark_isstr
+36 mark_loadcode
+37 mark_ext_patch
+38 mark_24g
+39 mark_24g_rxmode
+40 mark_eeprom_size
+41 mark_ble_tx_md
+42 mark_ble_rx_md
+43 mark_otp_encrypt
+44 mark_temp
+45 mark_ble_2M
+46 mark_ble_lr_s8
+47 mark_ble_lr
+48 mark_ble_crc_fail
+49 mark_role_switch_receive_fhs
+50 mark_ble_encryption
+51 mark_first_packet
+52 mark_adc_enable
+)
+
+(
+1 reload_type_otp
+2 reload_type_spi
+3 reload_type_iic
+)
+
+
+/* ============== soft timers ============== */
+(
+0 le_adv_interval_timer
+1 inquiry_length_timer
+2 le_scan_interval_timer
+3 page_length_timer
+4 iscan_interval_timer
+5 pscan_interval_timer
+6 switch_wait_timer
+7 enpt_delay_timer
+8 page_interval_timer
+9 key_scan_timer
+10 smp_pairing_timer
+11  ui_led_blink   //led timer 可扩展
+12  ui_led_blink1
+13 ui_led_blink2
+
+//不使用mesh应用可以复用
+//Tiny Mesh 广播APP回复
+13 mesh_ble_adv_app
+//Tiny Mesh广播tmall回复
+14 mesh_ble_adv_tmall
+//Tiny Mesh relay
+15 mesh_ble_relay_timer
+
+)
+
+(
+1 hci_cmd_inquiry
+2 hci_cmd_inquiry_cancel
+3 hci_cmd_remote_name_req
+4 hci_cmd_remote_feature_req
+5 hci_cmd_create_conn
+6 hci_cmd_disconn
+7 hci_cmd_accept_conn
+8 hci_cmd_reject_conn
+9 hci_cmd_pair
+10 hci_cmd_nopair
+11 hci_cmd_linkkey
+12 hci_cmd_nokey
+13 hci_cmd_auth
+14 hci_cmd_stopencrypt
+15 hci_cmd_startencrypt
+16 hci_cmd_setup_sco
+17 hci_cmd_disconn_sco
+18 hci_cmd_in_sniff
+19 hci_cmd_exit_sniff
+20 hci_cmd_remote_version_req
+21 hci_cmd_remote_ext_features_req
+22 hci_cmd_io_cap
+23 hci_cmd_role_discovery
+24 hci_cmd_role_switch
+25 hci_cmd_accept_with_switch
+26 hci_cmd_detach
+27 hci_cmd_le_create_conn
+28 hci_cmd_accept_sco_conn
+29 hci_cmd_le_disconn
+30 hci_cmd_le_att_req
+80 hci_cmd_wait_remote_feature
+81 hci_cmd_wait_remote_ext_feature
+82 hci_cmd_wait_remote_name
+)
+
+
+
+/* ============== debug ============= */
+(
+0 debug_neg_skew
+1 debug_bitbucket
+2 debug_dont_clear_got_tx
+3 debug_scatter_enabled
+4 debug_tx_fixed_freq
+5 debug_rx_fixed_freq
+6 debug_tx_pattern
+)
+
+/* ============== tester_emulator ============= */
+(
+0 tester_fixed_flow
+1 tester_fixed_flow_polarity
+2 tester_change
+3 tester_exit
+4 tester_pattern_test
+5 tester_whitening_change
+6 tester_fixed_freq
+7 tester_no_whitening
+)
+
+/* ============== mode ==========*/
+(
+0 mode_le
+1 mode_master
+2 afh_enable
+3 afh_change
+4 first_seqnx
+)
+
+/* ============== state_map ==========*/
+(
+0 smap_lmptidinit
+1 smap_lmptid
+2 smap_encryption
+3 smap_name_res
+4 smap_name_req
+5 smap_edr
+6 smap_rxlmp
+7 smap_rxl2cap
+)
+(
+0 state_inconn
+1 state_insniff
+2 state_insco 
+3 state_inpage
+4 state_conn_comp
+5 state_init_seq
+6 state_combkey
+7 state_linkkey
+)
+(
+0 op_send_sres
+1 op_auth_req
+2 op_inrand_req
+3 op_disconn
+4 op_stop_enc
+5 op_start_enc
+6 op_txl2cap
+7 op_pkt_comp
+)
+
+
+/* ============== arq [3] ================ */
+(
+0 flow
+1 arqn
+2 seqn
+3 wack
+4 flowx              /* out */  /* not really in memory */
+5 arqnx              /* out */
+6 seqnx              /* out */
+7 bcast1             /* first broadcast received */
+)
+
+/* arq          {flow,arqn,seqn}, read/write */
+/* [0] flow r/w  acl full status of the other, store during rx, checked during tx */
+/* [1] arqn r/w  ack of the other during rx (ack tx fifo),                        */
+/* [2] seqn r/w  seqn of the other, check during rx                               */ 
+/* arqx         {flowx,arqnx,seqnx} */
+/* [0] flowx r/o flow back to the other, 1 alow send, 0 not to send, read only tx */
+/* [1] arqnx r/w ack to the other, set by rx, send back on tx                     */
+/* [2] seqnx r/w toggled by arqn, to be send during tx                            */ 
+
+ 
+/* AFH flags */
+(
+0 AFH_CFG_ON
+1 AFH_CFG_TIMER
+2 send_lmp_set_afh
+3 AFH_CFG_REPORT_MODE
+4 AFH_CFG_MASTER_SENT_REQ
+)
+
+/* LLID CODE */
+(	
+1 LLID_L2CAP_CONT
+2 LLID_L2CAP_START
+3 LLID_LMP
+)
+
+/* ============== master_state ==========*/
+(
+0  master_in_idle
+1  master_in_inquiry
+2  master_in_page
+10 master_in_becoming_slave
+15 master_in_conn
+)
+(
+0 newrev_feature_bettx
+1 newrev_feature_betplltx
+2 newrev_feature_skip_retransmit
+3 newrev_feature_init_radio_after_sleep
+4 newrev_feature_no_lpolog
+)
+/*************mem_pincode_state****************/
+(
+0 pincode_state_ilde
+1 pincode_state_wait_pincode
+2 pincode_state_pincode_ready
+)
+
+
+// lpm_write
+(
+1 lpmreg_sel_ctrl
+2 lpmreg_sel_ctrl2
+4 lpmreg_sel_gpiolow
+8 lpmreg_sel_gpiohigh
+16 lpmreg_sel_counter
+32 lpmreg_sel_ctrl3
+)
+
+// lpm_write2
+(
+0x02 lpmreg_sel_option
+)
+
+(
+8 lpmreg_spi_lock_bit
+9 lpmreg_spi2_lock_bit
+0x0a lpmreg_uart_lock_bit
+0x0b lpmreg_uartb_lock_bit
+0x0c lpmreg_iic_lock_bit
+0x0d lpmreg_rom_lock_bit
+0x0e lpmreg_ice_mode_bit
+
+0x01 lpmreg_spi_lock
+0x02 lpmreg_spi2_lock
+0x04 lpmreg_uart_lock
+0x08 lpmreg_uartb_lock
+0x10 lpmreg_iic_lock
+0x20 lpmreg_rom_lock
+0x40 lpmreg_ice_mode
+)
+
+
+
+//scan_mode
+(
+0 inq_scan_mode
+1 page_scan_mode
+2 page_inq_enable
+)
+//mem_neogotiation_state
+(
+ 0 default_neogotiation_state
+ 1 prarm_neogotiation
+)
+
+//mem_lpm_wake_lock
+(
+0 wake_lock_ble_rx
+1 wake_lock_ble_tx
+
+3 wake_lock_key_press
+4 wake_lock_ble_tx_patch
+5 wake_lock_uart_tx
+6 wake_lock_uart_rx
+7 wake_lock_button
+8 wake_lock_cmd
+9 wake_lock_app
+10 wake_lock_lmp_tx
+11 wake_lock_lmp_rx
+12 wake_lock_l2cap_tx
+13 wake_lock_l2cap_rx
+14 wake_lock_ipc_c512bt
+15 wake_lock_ipc_bt2c51
+
+)
+
+(//mem_fcomp_div
+0x18 XTAL_24M
+0x08 XTAL_16M
+)
+
+( //verion
+6 BLUETOOTH_CORE_SPECIFICATION_4_0
+7 BLUETOOTH_CORE_SPECIFICATION_4_1
+8 BLUETOOTH_CORE_SPECIFICATION_4_2
+9 BLUETOOTH_CORE_SPECIFICATION_5_0
+10 BLUETOOTH_CORE_SPECIFICATION_5_1
+)
+
+(
+0x050e COMPANY_ID_YICHIP
+)
+
+(
+0x33  REC_3_MODE
+0x34  REC_4_MODE
+0x35  REC_4_MODE_STATIC_ADDRESS
+0x36  REC_4_MODE_RANDOM_RESOLVABLE_PRIVATE_ADDRESS
+0x37  REC_4_MODE_RANDOM_NON_RESOLVABLE_PRIVATE_ADDRESS
+)
+
+
+//sniff UART_TX UART_RX
+(
+6 UART_WAKEUP_TX
+7 UART_WAKEUP_RX
+)
+
+
Index: format/command.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/command.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/command.format	(working copy)
@@ -0,0 +1,1379 @@
+
+/* Parse Command:
+TX: take bits from tx fifo, jam it into shift and a destination (rf,bucket)
+RX: take bits from demod,  jam it into shift and a destination (acl,sco,bucket) */
+
+/* Inject Command:
+TX: 0 into shift, send tail of shift into a destination (rf,bucket)
+RX: 0 into shift, send tail of shift into a destination (acl,sco,bucket) */
+
+format
+  ! 15 romdat
+  % d0
+  % d1
+  % d2
+  % d3
+  [8] d0
+  [8] d1
+  [8] d2
+  [8] d3
+end
+
+format
+  ! 15 enable   /* set flag to 1 */
+  % flag
+  [5] opcode
+  [6] 1
+  [6] flag
+  [6] null
+  [9] 0
+end
+ /* High 5 bytes of channel map */
+format
+  ! 15 pulse   /* set flag to 1 */
+  % flag
+  [5] opcode
+  [6] 1
+  [6] flag
+  [6] null
+  [9] 0
+end
+
+format
+  ! 15 disable   /* set flag to 0 */
+  % flag
+  [5] opcode
+  [6] 2
+  [6] flag
+  [6] null
+  [9] 0
+end
+
+format
+  ! 15 set0  /* set selected bit of reg to 0 */
+  % immediate
+  % reg
+  [5] opcode
+  [6] 9
+  [6] never
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 15 set1  /* set selected bit of reg to 1 */
+  % immediate
+  % reg
+  [5] opcode
+  [6] 9          /* alu op demux */
+  [6] always
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 15 setflag  /* set selected bit of the reg to the polarity of the flag */
+  % flag
+  % immediate
+  % reg
+  [5] opcode
+  [6] 9
+  [6] flag
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 15 nsetflag  /* set the selected bit of the reg to the opposite polarity of the flag */
+  % flag
+  % immediate
+  % reg
+  [5] opcode
+  [6] 0x29
+  [6] flag
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 15 setflip    /* invert the selected bit of the reg */
+  % immediate
+  % reg
+  [5] opcode
+  [6] 10            /* this is alu op */
+  [6] always
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 0x1f qset1      /* demux the lowest 4 bit of queue and OR it with regr into regw */
+  % reg             /* in short, set the bit in reg indexed by queue to 1 */
+  [5] opcode
+  [6] 9
+  [6] always
+  [6] reg
+  [9] 0
+end
+  
+format
+  ! 0x1f qset0      /* demux the lowest 4 bit of queue and AND it with regr into regw */
+  % reg             /* in short, set the bit in reg indexed by queue to 0 */
+  [5] opcode
+  [6] 9
+  [6] never
+  [6] reg
+  [9] 0
+end
+
+format 
+  ! 0x1f qsetflag   /* set the bit in reg index by queue to same as flag */
+  % flag
+  % reg
+  [5] opcode
+  [6] 9
+  [6] flag
+  [6] reg
+  [9] 0
+end
+
+format 
+  ! 0x1f nqsetflag   /* set the bit in the reg index by queue to opposite of flag */
+  % flag
+  % reg
+  [5] opcode
+  [6] 0x29
+  [6] flag
+  [6] reg
+  [9] 0
+end
+
+format
+  ! 0x1f qsetflip      /* flip the bit in reg index by queue */
+  % reg
+  [5] opcode
+  [6] 10
+  [6] always
+  [6] reg
+  [9] 0
+end
+
+format
+  ! 1 parse       /* take bits out of source (sco_tx,tx_buffer,rx-elas) into pdata and dest (sco_rx,rx_fifo,tx-elas) */
+  % source
+  % dest
+  % immediate
+  [5] opcode
+  [4] source      /* voice, data, demod */
+  [2] 0
+  [6] 0    
+  [2] 0           /* parse or inject */ 
+  [4] dest        /* acl, sco, mod, bucket */
+  [9] immediate   /* number of bits to parse off */
+end
+
+format
+  ! 1 inject      /* shift data from pdata into destination (tx-elas,rx_fifo,sco_rx) */
+  % destination
+  % immediate
+  [5] opcode
+  [4] 0
+  [2] 0
+  [6] 1
+  [2] 0
+  [4] destination /* acl,sco,mod,bucket */
+  [9] immediate   /* number of bits to be injected */
+end
+
+format
+  ! 1 iinject
+  % destination
+  % regr
+  [5] opcode
+  [6] regr       /* contain the number of bits to inject */
+  [6] 3
+  [2] 0
+  [4] destination /* acl,sco,mod,bucket */
+  [9] 0 
+end
+
+format
+  ! 1 stuff  /* automatic parse, stuff_counter decrement on every bit until hits zero */
+  % source
+  % destination
+  [5] opcode
+  [4] source
+  [2] 0
+  [6] 2
+  [2] 0
+  [4] destination
+  [9] 0
+end
+
+format    /* force immediate value into registers */
+  ! 3 force
+  % immediate
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 0    /* alu operation force */
+  [6] regw  /* destination register */
+  [9] immediate
+end
+
+format    /* force whatever is on shift_reg to regsiters */
+  ! 0x13 iforce
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 0    /* alu operation force */
+  [6] regw  /* destination register */
+  [9] 0
+end
+
+format    /* force immediate value into registers */
+  ! 3 increase
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 1    /* alu operation add */
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 3 pincrease
+  % immediate
+  [5] opcode
+  [6] -1  /* pdata */
+  [6] 1   /* alu add */
+  [6] -1  /* back to pdata */
+  [9] immediate
+end
+
+format    /* force immediate value into registers */
+  ! 3 and_into
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 2    /* alu operation and into */
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 3 and
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 2    /* alu operation and into */
+  [6] regw
+  [9] immediate
+end
+  
+format
+  ! 0x13 iand    /* pdata & regr -> regw */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 2    /* alu operation and into */
+  [6] regw
+  [9] 0
+end
+  
+
+format    /* and whatever is in shiftreg with reg */
+  ! 0x13 iand_into
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 2    /* alu operation and into */
+  [6] reg
+  [9] 0
+end
+
+format
+  ! 3 or_into
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 3    /* alu operation or into */
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 3 or
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 3    /* alu operation or into */
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 0x13 ior
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 3    /* alu operation or into */
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 0x13 ior_into
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 3    /* alu operation or into */
+  [6] reg
+  [9] 0
+end
+
+format
+  ! 3 skip_to   /* jump to location stored in reg */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 4   /* alu operation copy */
+  [6] rom_addr
+  [9] 0
+end
+
+format
+  ! 3 copy
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 4   /* alu operation copy */
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 deposit   /* copy the register content thru alu to shift register, not prealigned like preload */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 4   /* alu operation copy */
+  [6] -1  /* pdata */
+  [9] 0
+end
+
+format
+  ! 3 icopy     /* copy the shift register lsb content directly to register, not aligned */
+  % regw
+  [5] opcode
+  [6] -1  /* pdata */
+  [6]  4  /* alu copy */
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 add
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 1
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 0x13 iadd       /* regr + pdata -> regw */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 1
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 sub          /* immediate - regr -> regw */
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 12
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 0x13 isub       /* pdata - regr -> regw */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 12
+  [6] regw
+  [9] 0
+end
+
+
+format
+  ! 3 flip
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 5
+  [6] reg
+  [9] immediate
+end
+  
+format
+  ! 0x13 iflip  /* use shift register as immediate to do xor */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 5
+  [6] regw
+  [9] 0
+end
+  
+format
+  ! 3 xor
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 5
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 3 xor_into
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 5
+  [6] reg
+  [9] immediate
+end
+  
+format
+  ! 0x13 ixor  /* pdata xor regr and store result in regw */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 5
+  [6] regw
+  [9] 0
+end
+  
+format
+  ! 3 invert
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 8
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 pinvert    /* invert pdata into itself */
+  [5] opcode
+  [6] -1
+  [6] 8
+  [6] -1
+  [9] 0
+end
+
+format
+  ! 3 div                 /* regr div immediate div */
+  % reg
+  % immediate
+  [5] opcode
+  [6] reg
+  [6] 13                   /* generate diven pulse to div */
+  [6] null
+  [9] immediate
+end
+
+format
+  ! 0x13 idiv           /* pdata div regr data ready at most after 41 nops */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 13                   /* generate diven pulse to div */
+  [6] null
+  [9] 0
+end
+
+format
+  ! 0x13 idiv48           /* pdata div regr data 48bit */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 17                   /* generate diven pulse to div */
+  [6] null
+  [9] 0
+end
+
+format
+  ! 3 remainder            /* harvest div remainder */
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 14
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 quotient             /* harvest div quotient */
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 15
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 6
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift2
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 22
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift3
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 18
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift4
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 35
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift8
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 25
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift16
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 34
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift32
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 30
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 lshift
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 7
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 lshift2
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 23
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 lshift8
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 26
+  [6] regw
+  [9] 0
+end
+
+  
+format
+  ! 3 lshift3
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 19
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 lshift4
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 36
+  [6] regw
+  [9] 0
+end
+  
+
+format
+  ! 3 lshift16
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 32
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 random               /* random number into regw */
+  % reg
+  [5] opcode
+  [6] 0
+  [6] 20
+  [6] reg
+  [9] 0
+end
+
+format                     /* bit reverse within a byte */
+  ! 3 reverse
+  % reg
+  % regw
+  [5] opcode
+  [6] reg
+  [6] 27
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 priority    /* priority encode reg into regw, lsb is the top priority, ie, priority(8'b00010000) = 4 */
+  % reg
+  % regw
+  [5] opcode
+  [6] reg
+  [6] 21
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 7 setsect   /* set a section of pdata */
+  % section    /* 0 sets 17:0 of pdata with set_data, 1 sets 35:18, 2 sets 53:36, 3 sets 71:54 */
+  % set_data
+  [5] opcode
+  [7] 0
+  [2] section
+  [18] set_data
+end
+
+format
+  ! 10 preload   /* load stuff into pdata according to fhs format, check us.v */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 0
+  [6] -1
+  [9] 0
+end
+
+format  /* load register with pdata content, according to fhs format, check us.v */
+  ! 10 ialigned   /* all bits are in position */
+  % regw
+  [5] opcode
+  [6] -1
+  [6] 0
+  [6] regw
+  [9] 0
+end
+
+format  /* load register to another according to fhs format */
+  ! 10 aligned
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 0
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 4 branch
+  % addr
+  % flag
+  [5] opcode
+  [6] 1
+  [6] flag
+  [15] addr
+end
+
+format
+  ! 4 call
+  % addr
+  % flag
+  [5] opcode
+  [6] 2
+  [6] flag
+  [15] addr
+end
+
+format
+  ! 4 rtn
+  % flag
+  [5] opcode
+  [6] 3
+  [6] flag
+  [15] 0
+end
+
+format
+  ! 0x0d fetch          /* read from memory, data into pdata, address from immediate then mem_ptr */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 63
+  [1] addr
+  [1] 0
+  [4] num_bytes
+  [15] addr
+end
+
+format
+  ! 0x0d fetcht          /* read from memory, data into temp, address from immediate won't increment */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 2
+  [1] addr
+  [1] 1
+  [4] num_bytes
+  [15] addr
+end
+
+format
+  ! 0x1d ifetch         /* read from memory, data into pdata, address from regr then mem_ptr */
+  % num_bytes
+  % reg
+  [5] opcode
+  [6] 63
+  [2] 0
+  [4] num_bytes
+  [9] 0
+  [6] reg
+end
+
+format
+  ! 0x1d ifetcht         /* read from memory, data into temp, address from regr won't increment */
+  % num_bytes
+  % reg
+  [5] opcode
+  [6] 2
+  [2] 0
+  [4] num_bytes
+  [9] 0
+  [6] reg
+end
+
+format
+  ! 0x0c store          /* write to memory, data from pdata, address from immediate then mem_ptr */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 63
+  [1] addr
+  [1] 0
+  [4] num_bytes
+  [15] addr
+end
+
+format
+  ! 0x0c storet          /* write to memory, data from temp, address from immediate won't increment */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 2
+  [1] addr
+  [1] 1
+  [4] num_bytes
+  [15] addr
+end
+
+format
+  ! 0x1c istore        /* write pdata to memory, address from regaddr */
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] 63            
+  [2] 0
+  [4] num_bytes
+  [9] 0
+  [6] regaddr
+end
+
+format
+  ! 0x1c istoret        /* write temp to memory, address from regaddr */
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] 2            
+  [2] 0
+  [4] num_bytes
+  [9] 0
+  [6] regaddr
+end
+
+format
+  ! 0x0d crc         // read from memory, count from loopcnt, put crc result into pdata 
+  % addr
+  [5] opcode
+  [6] 63
+  [6] 0
+  [15] addr
+end
+
+format
+  ! 0x1d icrc         /* read from memory, address from reg, count from loopcnt, put crc result into pdata */
+  % reg
+  [5] opcode
+  [6] 63
+  [15] 0
+  [6] reg
+end
+
+
+format
+  ! 0x0c storer          /* write reg to memory, address from immediate then mem_ptr */
+  % reg
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] reg               
+  [1] addr
+  [1] 0
+  [4] num_bytes
+  [15] addr
+end
+
+
+format
+  ! 0x1c istorer        /* write regr to memory, address from regaddr */
+  % regr
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] regr            
+  [2] 0
+  [4] num_bytes
+  [9] 0
+  [6] regaddr
+end
+
+
+format
+  ! 0x0d fetchr          /* read reg from memory, address from immediate then mem_ptr */
+  % reg
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] reg               
+  [1] addr
+  [1] 0
+  [4] num_bytes
+  [15] addr
+end
+
+format
+  ! 0x1d ifetchr        /* read regr from memory, address from regaddr */
+  % regr
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] regr
+  [2] 0
+  [4] num_bytes
+  [9] 0
+  [6] regaddr
+end
+
+
+
+
+format
+  ! 0x0e jam
+  % immediate
+  % addr
+  [5] opcode
+  [3] 0
+  [16] addr
+  [8] immediate
+end
+
+format			/* 0x242... */
+  ! 4 nbranch
+  % addr
+  % flag
+  [5] opcode
+  [1] 1
+  [5] 1
+  [6] flag
+  [15] addr
+end
+
+format
+  ! 4 ncall
+  % addr
+  % flag
+  [5] opcode
+  [1] 1
+  [5] 2
+  [6] flag
+  [15] addr
+end
+
+format
+  ! 4 nrtn
+  % flag
+  [5] opcode
+  [1] 1
+  [5] 3
+  [6] flag
+  [15] 0
+end
+
+format
+  ! 4 nop
+  % addr  /* no-op for addr+2 clocks */
+  [5] opcode
+  [6] 0     
+  [6] 0     /* always */ 
+  [15] addr
+end
+
+format
+  ! 4 clear_stack
+  [5] opcode
+  [6] 4
+  [6] 0    /* always */
+  [15] 0
+end
+
+format
+  ! 6 until
+  % reg
+  % flag
+  [5] opcode
+  [6] reg
+  [6] flag
+  [6] 1
+  [9] 0
+end
+  
+format
+  ! 6 correlate   /* quit if 1. flag is true 2, regr time up 3, found sync,(cond_true) */
+  % reg          /* expire counter to check against */
+  % flag
+  [5] opcode
+  [6] reg
+  [6] flag
+  [6] 2           /* correlate */
+  [9] 0           
+end
+
+format
+  ! 5 compare   /* sets cond flag,  if reg equals immediate */
+  % immediate
+  % reg
+  % mask
+  [5] opcode
+  [6] reg
+  [3] 0
+  [9] mask
+  [9] immediate
+end
+
+format
+  ! 0x15 icompare   /* sets cond flag,  if reg equals pdata */
+  % mask
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 0
+  [9] mask
+  [9] 0
+end
+
+format   /* sets cond. flag, if reg equals LS half of shift reg with MS half of reg being mask */
+  ! 5 iverify
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 2
+  [18] 0
+end
+
+format
+  ! 0x15 qisolate1
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 3
+  [18] -1
+end
+
+format
+  ! 0x15 qisolate0
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 3
+  [18] 0
+end
+
+	/* REVAB bug: cannot access bit above 35 */
+format
+  ! 5 isolate1
+  % addr
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 3
+  [9] -1
+  [9] addr
+end
+
+format
+  ! 5 isolate0
+  % addr
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 3
+  [9] 0
+  [9] addr
+end
+
+format
+  ! 11 setarg
+  % immediate
+  [5] opcode
+  [27] immediate
+end
+
+format
+  ! 0x1b arg
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [21] immediate
+end
+
+  
+format
+  ! 0 sleep
+  [5] opcode
+  [27] 0
+end
+
+format
+  ! 0 snooze
+  [5] opcode
+  [6] -1
+  [21] 0
+end
+
+format
+  ! 0 revision
+  % rev_num
+  [5] opcode
+  [27] rev_num
+end
+
+format
+  ! 0x18 loop   /* branch when loopcnt is NOT zero, and decrease loopcnt */
+  % addr
+  [5] opcode
+  [4] 4
+  [8] 0
+  [15] addr
+end
+
+format
+  ! 0x18 beq   /* branch when pdata is equal to immediate */
+  % imme
+  % addr
+  [5] opcode
+  [4] 0
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 bne   /* branch when pdata is NOT equal to immediate */
+  % imme
+  % addr
+  [5] opcode
+  [4] 1
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 rtneq   /* return when pdata is equal to immediate */
+  % imme
+  [5] opcode
+  [4] 2
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 0x18 rtnne   /* return when pdata is NOT equal to immediate */
+  % imme
+  [5] opcode
+  [4] 3
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 0x18 bbit1   /* branch when pdata's imme bit is 1 */
+  % imme
+  % addr
+  [5] opcode
+  [4] 5
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 bbit0   /* branch when pdata's imme bit is 0 */
+  % imme
+  % addr
+  [5] opcode
+  [4] 6
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 rtnbit1   /* return when pdata's imme bit is 0 */
+  % imme
+  [5] opcode
+  [4] 7
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 0x18 rtnbit0   /* return when pdata's imme bit is 0 */
+  % imme
+  [5] opcode
+  [4] 8
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 8	bpatch
+  % imme
+  % addr
+  [5] opcode
+  [4] 9
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 8	bpatchx
+  % imme
+  % addr
+  [5] opcode
+  [4] 14
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 bmark1   /* branch when mark's imme bit is 1 */
+  % imme
+  % addr
+  [5] opcode
+  [4] 10
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 bmark0   /* branch when mark's imme bit is 0 */
+  % imme
+  % addr
+  [5] opcode
+  [4] 11
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 rtnmark1   /* return when mark's imme bit is 0 */
+  % imme
+  [5] opcode
+  [4] 12
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 0x18 rtnmark0   /* return when mark's imme bit is 0 */
+  % imme
+  [5] opcode
+  [4] 13
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 3 mul32                  /* immediate mult regr */ 
+  % regr
+  % immediate                                  
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 31           
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 0x13 imul32           /* pdata mult regr 32x32=64bit */  
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 31                   
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 0x13 imults           /* pdata mult regr 32x32=64bit, signed */  
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 16
+  [6] regw
+  [9] 0
+end
+
+
+format
+  ! 3 byteswap
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 33
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 shasx          /* SHA256 Sx operation, immediate is Sx */
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 28
+  [6] regw
+  [9] immediate
+end
+
+
+format
+  ! 0x13 regexrot 	/* regext[0] <- regext[7], regext[1] <- regext[0], regext[2] <- regext[1] ... */
+  [5] opcode
+  [6] 0
+  [6] 29
+  [6] null
+  [9] 0
+end
+
Index: format/debug.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/debug.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/debug.format	(working copy)
@@ -0,0 +1,6 @@
+xmemalloc(
+
+1 mem_rf_debug_rx_gpio
+1 mem_rf_debug_tx_gpio
+)
+
Index: format/g24_protocol_stack/24g.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g.format	(working copy)
@@ -0,0 +1,65 @@
+
+xmemalloc g24(
+34 mem_24g_rxbuf
+32 mem_24g_txbuf
+36 mem_24g_txpayload
+32 mem_24g_rxpayload
+1 mem_24g_rxdata_length
+1 mem_24g_pid
+1 mem_24g_no_ack
+3 mem_24g_sta_crc
+3 mem_24g_last_crc
+1 mem_24g_sta_pid
+1 mem_24g_last_pid
+1 mem_24g_datalen
+1 mem_24g_data_type
+1 mem_24g_txlen
+2 mem_24g_rx_window
+1 mem_24g_ch
+1 mem_24g_current_ch_number
+4 mem_24g_addr
+4 mem_24g_ch_map1
+4 mem_24g_ch_map2
+4 mem_24g_ch_map3
+4 mem_24g_ch_map4
+4 mem_24g_tx_btclk
+1 mem_24g_interval
+1 mem_24g_interval_min
+1 mem_24g_interval_max
+2 mem_24g_syncword
+1 mem_24g_syncword_crc8
+1 mem_24g_get_syncword_crc8
+1 mem_24g_pair_switch
+8 mem_24g_enter_hibernate
+
+1 mem_24g_rx_phy
+1 mem_24g_tx_phy
+
+1 mem_24g_ch_map_update
+4 mem_24g_ch_update_map1
+4 mem_24g_ch_update_map2
+4 mem_24g_ch_update_map3
+4 mem_24g_ch_update_map4
+
+)
+
+
+xmemalloc g24_tx(
+1 mem_rssi_hex_received
+
+)
+
+
+
+(//mem_24g_data_type
+1 TYPE_MS
+2 TYPE_KB
+0x07 bits_data
+//0-2 data type
+3 bit_abort
+4 bit_hop
+5 bit_sync
+//6-7 channel offset
+)
+
+
Index: format/g24_protocol_stack/24g_pair.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_pair.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_pair.format	(working copy)
@@ -0,0 +1,51 @@
+
+
+xmemalloc g24(
+4 mem_24g_pair_addr
+1 mem_24g_pair_ch
+1 mem_24g_pair_tx_power
+
+)
+
+xmemalloc g24_tx(
+1 mem_24g_pair_sm
+1 mem_24g_pair_no_ack
+2 mem_24g_pair_timeout_init
+2 mem_24g_pair_timeout
+
+)
+
+xmemalloc g24_rx(
+1 mem_24g_device1_bind_step
+1 mem_24g_device2_bind_step
+1 mem_24g_bind_device_status
+8 mem_24g_bind_payload
+
+)
+
+(//mem_24g_pair_sm
+0 STATE_24G_PAIRING_NULL
+1 STATE_24G_PAIRING_1
+2 STATE_24G_PAIRING_2
+3 STATE_24G_PAIRING_3
+4 STATE_24G_PAIRING_4
+0X11 STATE_24G_PAIRING_1_WAITING_ACK
+0X12 STATE_24G_PAIRING_2_WAITING_ACK
+0X13 STATE_24G_PAIRING_3_WAITING_ACK
+0X14 STATE_24G_PAIRING_4_WAITING_ACK
+0XFF STATE_24G_PAIRING_SUCCESS
+)
+
+(
+0x01 DATATYPE_DEVICE1	//mouse
+0x02 DATATYPE_DEVICE2	//keyboard
+0xaa DATATYPE_BIND		//bind step 1
+0x55 DATATYPE_CONFIG	//bind step 2
+0x22 DATATYPE_OK		//bind step 3
+0xff DATATYPE_ATTEMP	//reconn
+0xaf DATATYPE_OTA
+)
+
+(
+5 BIND_MODE_CONTINUE
+)
Index: format/g24_protocol_stack/24g_receiver.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_receiver.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_receiver.format	(working copy)
@@ -0,0 +1,42 @@
+
+
+xmemalloc g24_rx(
+2 mem_cb_24g_receive_process
+2 mem_cb_24g_ackpayload
+2 mem_cb_24g_data_device1
+2 mem_cb_24g_data_device2
+34 mem_24g_rxdata_temp
+1 mem_24g_abort_packet
+4 mem_24g_hop_btclk
+1 mem_24g_hop_interval
+1 mem_24g_pair_mode
+1 mem_24g_ackpayload_enable
+1 mem_24g_hop_packet
+1 mem_24g_mode_switch
+1 mem_24g_nodata_timer_enable
+
+1 mem_24g_mode_init
+1 mem_24g_work_mode
+1 mem_24g_time_slice
+1 mem_24g_self_last_ch
+1 mem_24g_self_ch_number
+1 mem_24g_self_config_ch_once
+1 mem_24g_device1_last_ch
+1 mem_24g_device1_ch_number
+1 mem_24g_device1_config_ch_once
+1 mem_24g_device2_last_ch
+1 mem_24g_device2_ch_number
+1 mem_24g_device2_config_ch_once
+1 mem_24g_led_status
+1 mem_24g_bind_mode_continue
+
+1 mem_tx_power_temp
+
+)
+
+
+(
+0 bit_ack_24g
+)
+
+
Index: format/g24_protocol_stack/24g_reconn.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_reconn.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_reconn.format	(working copy)
@@ -0,0 +1,29 @@
+xmemalloc g24_tx(
+2 mem_24g_reconn_timeout_init
+2 mem_24g_reconn_timeout
+2 mem_24g_reconn_count
+1 mem_24g_reconn_type
+1 mem_24g_fast_conn_enable
+4 mem_24g_fast_conn_addr
+4 mem_24g_receiver_addr
+1 mem_24g_fast_conn_temp_ch
+1 mem_24g_receiver_temp_ch
+1 mem_24g_device_temp_ch
+
+)
+
+xmemalloc g24_rx(
+4 mem_24g_transmitter_addr
+4 mem_24g_device1_addr
+4 mem_24g_device2_addr
+
+)
+
+(//mem_24g_reconn_type
+0 DEFAULT_24G_DEVICE
+1 FAST_CONN_AND_RECEIVER
+2 FAST_CONN_AND_3_0_ADDR
+3 RECEIVER_AND_3_0_ADDR
+4 PAIR_AND_3_0_ADDR
+)
+
Index: format/g24_protocol_stack/24g_rssi.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_rssi.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_rssi.format	(working copy)
@@ -0,0 +1,40 @@
+
+xmemalloc g24(
+1 mem_rssi_buff_index
+)
+
+
+xmemalloc g24_tx(
+1 mem_rssi_signal_index
+2 mem_rssi_signal_buf_ptr
+
+)
+
+
+xmemalloc g24_rx(
+1 mem_rssi_noise_avg
+1 mem_rssi_noise_index
+
+1 mem_rssi_noise_self_avg
+1 mem_rssi_noise_device1_avg
+1 mem_rssi_noise_device2_avg
+1 mem_rssi_noise_self_index
+1 mem_rssi_noise_device1_index
+1 mem_rssi_noise_device2_index
+
+2 mem_rssi_noise_buffer_ptr
+2 mem_rssi_noise_self_buffer_ptr
+2 mem_rssi_noise_device1_buffer_ptr
+2 mem_rssi_noise_device2_buffer_ptr
+
+)
+
+
+
+(
+0x50 RSSI_THRESH_NOISE
+)
+
+
+
+
Index: format/g24_protocol_stack/24g_transmitter.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_transmitter.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_transmitter.format	(working copy)
@@ -0,0 +1,65 @@
+
+
+xmemalloc g24_tx(
+2 mem_cb_24g_transmit_data
+2 mem_cb_24g_search_receiver
+2 mem_cb_24g_lpm_before
+
+1 mem_24g_conn_sm
+
+1 mem_24g_ensure
+2 mem_24g_txfail_cnt
+1 mem_24g_attempt_fail_flag
+
+1 mem_24g_retry
+1 mem_24g_abort_pac
+1 mem_24g_max_retry
+4 mem_24g_device_addr
+3 mem_24g_short_sleep_set
+8 mem_24g_long_sleep_set
+4 mem_24g_long_sleep_set1
+
+1 mem_24g_pac_index
+1 mem_24g_transmit_by_interrupt
+2 mem_24g_transmit_by_interrupt_exit_count
+2 mem_24g_transmit_by_interrupt_exit_count_init
+2 mem_24g_long_sleep_param_update_timer_init
+2 mem_24g_long_sleep_param_update_timer
+
+1 mem_24g_fast_hop_count
+)
+
+(
+1 NO_ACK_24G
+0 WITH_ACK_24G
+)
+
+(//mem_24g_conn_sm
+0 STATE_24G_STOP
+0 STATE_24G_START
+1 STATE_24G_PAIR
+2 STATE_24G_RECONN
+3 STATE_24G_OTA
+)
+
+(//mem_24g_transmit_by_interrupt
+1 G24_TX_TIMER_INT_ENABLE
+0 G24_TX_TIMER_INT_DISABLE
+)
+
+
+(
+1 OFFSET_DATA_TYPE
+2 OFFSET_LR_DATA_TYPE
+)
+
+(
+0x017700 G24_LONG_SLEEP_STEP1	//8ms
+0x36ee80 G24_LONG_SLEEP_STEP2	//300ms
+0x124f80 G24_LONG_SLEEP_STEP3	//100ms
+63500 G24_8MS_INTERVAL_PARAM		//8ms
+12210 G24_4MS_INTERVAL_PARAM
+)
+
+
+
Index: format/g24_protocol_stack/24g_txpower_ctrl.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_txpower_ctrl.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/g24_protocol_stack/24g_txpower_ctrl.format	(working copy)
@@ -0,0 +1,20 @@
+
+xmemalloc g24_tx(
+1 mem_rssi_avg_received
+1 mem_power_ctrl_level
+1 mem_power_ctrl_pac_succ_cnt
+1 mem_power_ctrl_pac_succ_cnt_init
+
+1 mem_rssi_dis_min_24g
+1 mem_rssi_dis_max_24g
+1 mem_rssi_hex_received_max_value
+
+1 mem_rssi_dis_min_ble
+1 mem_rssi_dis_max_ble
+)
+
+
+(
+50 POWER_CTRL_DECRS_THRESHOLD
+)
+
Index: format/hci.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/hci.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/hci.format	(working copy)
@@ -0,0 +1,520 @@
+
+
+memalloc hci_boot(
+2 mem_hci_opcode_ocf
+1 mem_hci_opcode_ogf
+
+//event head
+1 mem_hci_event_head_type
+1 mem_hci_event_head_event_code
+1 mem_hci_event_para_total_length
+
+//command complete
+1 mem_hci_command_complete_num_hci_command_packet
+0 mem_hci_command_complete_command_opcode
+2 mem_hci_opcode
+0 mem_hci_command_complete_return_parameter
+1 mem_hci_command_complete_return_parameter_status
+0 mem_hci_command_complete_return_parameter_chip_id
+
+)
+
+xmemalloc hci_boot(
+1 mem_hci_uart_tx_gpio
+1 mem_hci_uart_rx_gpio
+1 mem_hci_uart_rts_gpio
+1 mem_hci_uart_cts_gpio
+1 mem_hci_pwm_12mhz_gpio
+)
+
+(
+0x0d HCI_UART_TX_GPIO_NUM
+0x0e HCI_UART_RX_GPIO_NUM
+0x09 HCI_UART_RTS_GPIO_NUM
+0x0a HCI_UART_CTS_GPIO_NUM
+0x0c HCI_PMW_12MHZ_GPIO_NUM
+)
+
+(
+0x00 COMMAND_SUCCEEDED
+0x01 COMMAND_UNKNOWN
+0x0c COMMAND_DISALLOWED
+)
+
+//HCI H4 Packet TYPE
+(
+0x01 HCI_H4_TYPE_CMD
+0x02 HCI_H4_TYPE_ACL
+0x04 HCI_H4_TYPE_EVENT
+)
+
+(
+0x00 BT_ACL_START_NO_FLUSH
+0x01 BT_ACL_CONT
+0x02 BT_ACL_START
+)
+
+// HCI command opcode group field values
+(
+0x01 HCI_OGF_LINK_CONTROL
+0x02 HCI_OGF_LINK_POLICY
+0x03 HCI_OGF_CONTROLLER_AND_BASEBAND
+0x04 HCI_OGF_INFOMATIONAL_PARAM
+0x05 HCI_OGF_STATUS_PARAM
+0x06 HCI_OGF_TEST
+0x08 HCI_OGF_LE_CONTROLLER
+0x3f HCI_OGF_VENDOR_SPECIFIC_DEBUG
+)
+
+// HCI link control opcode command field values, OGF=1
+(
+0x01 HCI_INQUIRY 
+0x02 HCI_INQUIRY_CANCEL 
+0x03 HCI_PERIODIC_INQUIRY_MODE 
+0x04 HCI_EXIT_PERIODIC_INQUIRY_MODE 
+0x05 HCI_CREATE_CONNECTION 
+0x06 HCI_DISCONNECT 
+0x07 HCI_ADD_SCO_CONNECTION 
+0x08 HCI_CREATE_CONNECTION_CANCEL
+0x09 HCI_ACCEPT_CONNECTION 
+0x0A HCI_REJECT_CONNECTION 
+0x0B HCI_LINK_KEY_REQUEST_REPLY 
+0x0C HCI_LINK_KEY_REQUEST_NEGATIVE_REPLY 
+0x0D HCI_PIN_CODE_REQUEST_REPLY 
+0x0E HCI_PIN_CODE_REQUEST_NEGATIVE_REPLY 
+0x0F HCI_CHANGE_CONNECTION_PACKET_TYPE 
+0x11 HCI_AUTHENTICATION_REQUESTED 
+0x13 HCI_SET_CONNECTION_ENCRYPTION 
+0x15 HCI_CHANGE_CONNECTION_LINK_KEY 
+0x17 HCI_MASTER_LINK_KEY 
+0x19 HCI_REMOTE_NAME_REQUEST 
+0x1A HCI_REMOTE_NAME_REQUEST_CANCEL
+0x1B HCI_READ_REMOTE_SUPPORTED_FEATURES 
+0x1C HCI_READ_REMOTE_EXT_FEATURES 
+0x1D HCI_READ_REMOTE_VERSION_INFORMATION 
+0x1F HCI_READ_CLOCK_OFFSET 
+0x20 HCI_READ_LMP_HANDLE
+0x28 HCI_SETUP_SCO_CONNECTION
+0x29 HCI_ACCEPT_SCO_CONNECTION
+0x2A HCI_REJECT_SCO_CONNECTION
+0x2B HCI_IO_CAP_REQUEST_REPLY
+0x2C HCI_USER_CONFIRMATION_REQUEST_REPLY
+0x2D HCI_USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY
+0x2E HCI_USER_PASSKEY_REQUEST_REPLY
+0x2F HCI_USER_PASSKEY_REQUEST_NEGATIVE_REPLY
+0x30 HCI_REMOTE_OOB_DATA_REQUEST_REPLY
+0x33 HCI_REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY
+0x34 HCI_IO_CAPABILITY_REQUEST_NEGATIVE_REPLY
+0x35 HCI_CREATE_PHYSICAL_LINK
+0x36 HCI_ACCEPT_PHYSICAL_LINK
+0x37 HCI_DISCONNECT_PHYSICAL_LINK
+0x38 HCI_CREATE_LOGICAL_LINK
+0x39 HCI_ACCEPT_LOGICAL_LINK
+0x3A HCI_DISCONNECT_LOGICAL_LINK
+0x3B HCI_LOGICAL_LINK_CANCEL
+0x3C HCI_FLOW_SPEC_MODIFY
+0x3D HCI_ENHANCED_SETUP_SYNCHRONOUS_CONNECTION
+0x3E HCI_ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION_REQUEST
+0x3F HCI_TRUNCATED_PAGE
+0x40 HCI_TRUNCATED_PAGE_CANCEL
+0x41 HCI_SET_CONNECTIONLESS_SLAVE_BROADCAST
+0x42 HCI_SET_CONNECTIONLESS_SLAVE_BROADCAST_RECEIVE
+0x43 HCI_START_SYNCHRONIZATION_TRAIN
+0x44 HCI_RECEIVE_SYNCHRONIZATION_TRAIN
+0x45 HCI_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY
+)
+
+
+// HCI link policy commands OCF value, OGF=2
+(
+0x01 HCI_HOLD_MODE 
+0x03 HCI_SNIFF_MODE 
+0x04 HCI_EXIT_SNIFF_MODE 
+0x05 HCI_PARK_MODE 
+0x06 HCI_EXIT_PARK_MODE 
+0x07 HCI_QOS_SETUP 
+0x09 HCI_ROLE_DISCOVERY 
+0x0B HCI_SWITCH_ROLE 
+0x0C HCI_READ_LINK_POLICY_SETTINGS 
+0x0D HCI_WRITE_LINK_POLICY_SETTINGS 
+0x0e HCI_READ_DEFAULT_LINK_POLICY_SETTINGS
+0x0f HCI_WRITE_DEFAULT_LINK_POLICY_SETTINGS
+0x10 HCI_FLOW_SPECIFICATION
+0x11 HCI_SNIFF_SUBRATING
+)
+
+// HCI host controller and baseband commands OCF values, OGF=3
+(
+0x01 HCI_SET_EVENT_MASK 
+0x03 HCI_RESET 
+0x05 HCI_SET_EVENT_FILTER 
+0x08 HCI_FLUSH 
+0x09 HCI_READ_PIN_TYPE 
+0x0A HCI_WRITE_PIN_TYPE 
+0x0B HCI_CREATE_NEW_UNIT_KEY 
+0x0D HCI_READ_STORED_LINK_KEY 
+0x11 HCI_WRITE_STORED_LINK_KEY 
+0x12 HCI_DELETE_STORED_LINK_KEY 
+0x13 HCI_WRITE_LOCAL_NAME 
+0x14 HCI_READ_LOCAL_NAME 
+0x15 HCI_READ_CONN_ACCEPT_TIMEOUT 
+0x16 HCI_WRITE_CONN_ACCEPT_TIMEOUT 
+0x17 HCI_READ_PAGE_TIMEOUT 
+0x18 HCI_WRITE_PAGE_TIMEOUT 
+0x19 HCI_READ_SCAN_ENABLE 
+0x1A HCI_WRITE_SCAN_ENABLE 
+0x1B HCI_READ_PAGE_SCAN_ACTIVITY 
+0x1C HCI_WRITE_PAGE_SCAN_ACTIVITY 
+0x1D HCI_READ_INQUIRY_SCAN_ACTIVITY 
+0x1E HCI_WRITE_INQUIRY_SCAN_ACTIVITY 
+0x1F HCI_READ_AUTHENTICATION_ENABLE 
+0x20 HCI_WRITE_AUTHENTICATION_ENABLE 
+0x21 HCI_READ_ENCRYPTION_MODE 
+0x22 HCI_WRITE_ENCRYPTION_MODE 
+0x23 HCI_READ_CLASS_OF_DEVICE 
+0x24 HCI_WRITE_CLASS_OF_DEVICE 
+0x25 HCI_READ_VOICE_SETTING 
+0x26 HCI_WRITE_VOICE_SETTING 
+0x27 HCI_READ_AUTOMATIC_FLUSH_TIMEOUT 
+0x28 HCI_WRITE_AUTOMATIC_FLUSH_TIMEOUT 
+0x29 HCI_READ_NUM_BROADCAST_RETRANSMISSIONS 
+0x2A HCI_WRITE_NUM_BROADCAST_RETRANSMISSIONS 
+0x2B HCI_READ_HOLD_MODE_ACTIVITY 
+0x2C HCI_WRITE_HOLD_MODE_ACTIVITY 
+0x2D HCI_READ_TRANSMIT_POWER_LEVEL 
+0x2E HCI_READ_SCO_FLOW_CONTROL_ENABLE 
+0x2F HCI_WRITE_SCO_FLOW_CONTROL_ENABLE 
+0x31 HCI_SET_CONTROLLER_TO_HOST_FLOW_CONTROL 
+0x33 HCI_HOST_BUFFER_SIZE 
+0x35 HCI_HOST_NUM_COMPLETED_PACKETS 
+0x36 HCI_READ_LINK_SUPERVISION_TIMEOUT 
+0x37 HCI_WRITE_LINK_SUPERVISION_TIMEOUT 
+0x38 HCI_READ_NUMBER_OF_SUPPORTED_IAC 
+0x39 HCI_READ_CURRENT_IAC_LAP 
+0x3A HCI_WRITE_CURRENT_IAC_LAP 
+0x3B HCI_READ_PAGE_SCAN_PERIOD_MODE 
+0x3C HCI_WRITE_PAGE_SCAN_PERIOD_MODE 
+0x3D HCI_READ_PAGE_SCAN_MODE 
+0x3E HCI_WRITE_PAGE_SCAN_MODE 
+0x3F HCI_SET_AFH_CHANNEL_CLASSIFICATION 
+
+
+0x42 HCI_READ_INQUIRY_SCAN_TYPE 
+0x43 HCI_WRITE_INQUIRY_SCAN_TYPE 
+0x44 HCI_READ_INQUIRY_MODE 
+0x45 HCI_WRITE_INQUIRY_MODE 
+0x46 HCI_READ_PAGE_SCAN_TYPE 
+0x47 HCI_WRITE_PAGE_SCAN_TYPE 
+
+0x48 HCI_READ_AFH_CHANNEL_ACCESSMENT_MODE 
+0x49 HCI_WRITE_AFH_CHANNEL_ACCESSMENT_MODE 
+0x51 HCI_READ_EXTENDED_INQUIRY_RESPONSE
+0x52 HCI_WRITE_EXTENDED_INQUIRY_RESPONSE
+0x53 HCI_REFRESH_ENCRYPTION_KEY
+0x55 HCI_READ_SIMPLE_PAIRING_MODE
+0x56 HCI_WRITE_SIMPLE_PAIRING_MODE
+0x57 HCI_READ_LOCAL_OOB_DATA
+0x58 HCI_READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL
+0x59 HCI_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL
+0x60 HCI_SEND_KEYPRESS_NOTIFICATION
+0x5A HCI_READ_DEFAULT_ERRONEOUS_DATA_REPORTING
+0x5B HCI_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING
+0x5F HCI_ENHANCED_FLUSH
+0x61 HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT
+0x62 HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT
+0x63 HCI_SET_EVENT_MASK_PAGE_2
+0x64 HCI_READ_LOCATION_DATA
+0x65 HCI_WRITE_LOCATION_DATA
+0x66 HCI_READ_FLOW_CONTROL_MODE
+0x67 HCI_WRITE_FLOW_CONTROL_MODE
+0x68 HCI_READ_ENHANCE_TRANSMIT_POWER_LEVEL
+0x69 HCI_READ_BEST_EFFORT_FLUSH_TIMEOUT
+0x6A HCI_WRITE_BEST_EFFORT_FLUSH_TIMEOUT
+0x6B HCI_SHORT_RANGE_MODE
+0x6C HCI_READ_LE_HOST_SUPPORT
+0x6D HCI_WRITE_LE_HOST_SUPPORT
+0x6E HCI_SET_MWS_CHANNEL_PARAMETERS
+0x6F HCI_SET_EXTERNAL_FRAME_CONFIGURATION
+0x70 HCI_SET_MWS_SIGNALING
+0x71 HCI_SET_MWS_TRANSPORT_LAYER
+0x72 HCI_SET_MWS_SCAN_FREQUENCY_TABLE
+0x73 HCI_SET_MWS_PATTERN_CONFIGURATION
+0x74 HCI_SET_RESERVED_LT_ADDR
+0x75 HCI_DELETE_RESERVED_LT_ADDR
+0x76 HCI_SET_CONNECTIONLESS_SLAVE_BROADCAST_DATA
+0x77 HCI_READ_SYNCHRONIZATION_TRAIN_PARAMETERS
+0x78 HCI_WRITE_SYNCHRONIZATION_TRAIN_PARAMETERS
+0x79 HCI_READ_SECURE_CONNECTIONS_HOST_SUPPORT
+0x7A HCI_WRITE_SECURE_CONNECTIONS_HOST_SUPPORT
+0x7B HCI_READ_AUTHENTICATED_PAYLOAD_TIMEOUT
+0x7C HCI_WRITE_AUTHENTICATED_PAYLOAD_TIMEOUT
+0x7D HCI_READ_LOCAL_OOB_EXTENDED_DATA
+0x7E HCI_READ_EXTENDED_PAGE_TIMEOUT
+0x7F HCI_WRITE_EXTENDED_PAGE_TIMEOUT
+0x80 HCI_READ_EXTENDED_INQUIRY_LENGTH
+0x81 HCI_WRITE_EXTENDED_INQUIRY_LENGTH
+)
+
+
+// HCI informational parameters OCF values, OGF=4
+(
+0x01 HCI_READ_LOCAL_VERSION_INFORMATION 
+0x02 HCI_READ_LOCAL_SUPPORTED_COMMANDS
+0x03 HCI_READ_LOCAL_SUPPORTED_FEATURES 
+0x04 HCI_READ_LOCAL_EXT_FEATURES 
+0x05 HCI_READ_BUFFER_SIZE 
+0x07 HCI_READ_COUNTRY_CODE 
+0x09 HCI_READ_BD_ADDR 
+0x0A HCI_REJECT_CONNECTION_REQUEST
+0x0B HCI_READ_LOCAL_SUPPORTED_CODECS
+)
+
+// HCI status parameters OCF values, OGF=5
+(
+0x01 HCI_READ_FAILED_CONTACT_COUNTER 
+0x02 HCI_RESET_FAILED_CONTACT_COUNTER 
+0x03 HCI_GET_LINK_QUALITY 
+0x05 HCI_READ_RSSI 
+0x06 HCI_READ_AFH_CHANNEL_MAP
+0x07 HCI_READ_BD_CLOCK
+0x08 HCI_READ_ENCRYPTION_KEY_SIZE
+0x09 HCI_READ_LOCAL_AMP_INFO
+0x0A HCI_READ_LOCAL_AMP_ASSOC
+0x0B HCI_WRITE_REMOTE_AMP_ASSOC
+0x0C HCI_GET_MWS_TRANSPORT_LAYER_CONFIGURATION
+0x0D HCI_SET_TRIGGERED_CLOCK_CAPTURE
+)
+
+// HCI testing command OCF values, OGF=6
+(
+0x01 HCI_READ_LOOPBACK_MODE 
+0x02 HCI_WRITE_LOOPBACK_MODE 
+0x03 HCI_ENABLE_DEVICE_UNDER_TEST_MODE 
+0x04 HCI_WRITE_SIMPLE_PAIRING_DEBUG_MODE
+0x07 HCI_ENABLE_AMP_RECEIVER_REPORTS
+0x08 HCI_AMP_TEST_END
+0x09 HCI_AMP_TEST
+0x0A HCI_WRITE_SECURE_CONNECTIONS_TEST_MODE
+)
+
+// HCI vendor specific command OCF values -OGF=3F
+(
+0x01 HCI_WRITE_BD_ADDR 
+0x02 HCI_READ_INQUIRY_RESPONSE_TIMEOUT 
+0x03 HCI_WRITE_INQUIRY_RESPONSE_TIMEOUT 
+0x04 HCI_READ_PAGE_SCAN_REPETITION_MODE 
+0x05 HCI_WRITE_PAGE_SCAN_REPETITION_MODE 
+0x06 HCI_READ_PAGE_RESPONSE_TIMEOUT 
+0x07 HCI_WRITE_PAGE_RESPONSE_TIMEOUT 
+0x08 HCI_READ_NEW_CONNECTION_TIMEOUT 
+0x09 HCI_WRITE_NEW_CONNECTION_TIMEOUT 
+0x0a HCI_INITIALIZE_BASEBAND 
+0x0b HCI_WRITE_LOCAL_SUPPORTED_FEATURES 
+0x0c HCI_WRITE_PARK_PARAMETERS 
+0x0d HCI_READ_PARK_PARAMETERS 
+0x0e HCI_WRITE_QUALITY_OF_SERVICE 
+0x0f HCI_NOT_USED 
+0x10 HCI_MODIFY_BEACON_PARAMETERS 
+0x11 HCI_UNPARK_USING_PM_ADDR 
+0x12 HCI_WRITE_HOPPING_CHANNELS 
+0x13 HCI_SLEEP_FOREVER_MODE 
+0x14 HCI_WRITE_AUTO_PAGE_SCAN_ENABLE 
+0x15 HCI_READ_AUTO_PAGE_SCAN_ENABLE 
+0x16 HCI_SET_ENCRYPTION_KEY_SIZE 
+0x17 HCI_INVALIDATE_FLASH_AND_REBOOT 
+0x18 HCI_UPDATE_UART_BAUD_RATE 
+0x19 HCI_WRITE_GPIO_1_4_AS_OUTPUT 
+0x1A HCI_WRITE_GPIO_2_LED 
+0x1B HCI_SET_TESTMODE_TYPE 
+0x1C HCI_WRITE_SCO_PCM_INT_PARAM 
+0x1D HCI_READ_SCO_PCM_INT_PARAM 
+0x1E HCI_WRITE_PCM_DATA_FORMAT_PARAM 
+0x1F HCI_READ_PCM_DATA_FORMAT_PARAM 
+0x20 HCI_WRITE_COMFORT_NOISE_PARAM 
+0x21 HCI_READ_COMFORT_NOISE_PARAM 
+0x22 HCI_WRITE_SCO_TS 
+0x23 HCI_READ_SCO_TS 
+0x24 HCI_WRITE_PCM_LOOPBACK_MODE 
+0x25 HCI_READ_PCM_LOOPBACK_MODE 
+0x26 HCI_SET_TRANSMIT_POWER 
+0x27 HCI_SET_SLEEPMODE_PARAM 
+0x28 HCI_READ_SLEEPMODE_PARAM 
+0x29 HCI_SLEEPMODE_CMD 
+0x2A HCI_DELAY_PERIPHERAL_SCO_STARTUP 
+0x2B HCI_WRITE_RECEIVE_ONLY 
+0x2C HCI_WRITE_RATE_CONTROL 
+0x2D HCI_TX_UNMOD_CARRIER 
+0x2E HCI_DOWNLOAD_MINIDRIVER 
+0x2F HCI_CRYSTAL_PPM 
+0x30 HCI_SET_POWER_AMP_BIAS 
+0x31 HCI_SET_HAM_BEHAVIOR 
+0x32 HCI_SET_AFH_BEHAVIOR 
+0x33 HCI_READ_USER_DEFINED_NVRAM 
+0x34 HCI_ENABLE_RADIO 
+0x35 HCI_READ_DIAGNOSTIC_INFO 
+0x36 HCI_GET_HID_DEVICE_LIST 
+0x37 HCI_ADD_HID_DEVICE 
+0x38 HCI_READ_APP_FW_CONFIG_VERSION 
+0x39 HCI_DELETE_HID_DEVICE 
+0x3B HCI_ENABLE_USB_HID_EMULATION 
+// 0x3A available
+// 0x3B available
+0x3C HCI_SEND_LMPDU 
+0x3D HCI_AUTO_PAIR_REQ 
+0x3E HCI_READ_VS_EXTENSION 
+0x3F HCI_WRITE_VS_EXTENSION 
+
+0x77 HCI_OPCODE_FC77
+0x79 HCI_OPCODE_FC79
+0xC4 HCI_DOWNLOAD_PATCH
+0xCC HCI_OPCODE_FCCC
+
+0x00 HCI_VENDOR_CMD_RESET
+0x01 HCI_VENDOR_CMD_CHIPID
+0x02 HCI_VENDOR_CMD_BAUD
+0x03 HCI_VENDOR_CMD_PATCH
+0x04 HCI_VENDOR_CMD_PATCH_DONE
+0x05 HCI_VENDOR_CMD_ECHO
+0x06 HCI_VENDOR_CMD_BDADDR
+
+0x07 HCI_VENDOR_CMD_ENTER_LPM
+0x08 HCI_VENDOR_CMD_COMMU_READY
+
+0x10 HCI_VENDOR_CMD_MEM
+0x11 HCI_VENDOR_CMD_EEP
+
+0X12 HCI_VENDOR_CMD_PATCH_SEC_INIT
+0X13 HCI_VENDOR_CMD_PATCH_SEC
+0x14 HCI_VENDOR_CMD_SET_FLOW_CONTROL
+)
+
+//HCI LE controller command OCF values, OGF=8
+(
+0x01 HCI_LE_SET_EVENT_MASK
+0x02 HCI_LE_READ_BUFFER_SIZE
+0x03 HCI_LE_READ_LOCAL_SUPPORTED_FEATURES
+0x05 HCI_LE_SET_RANDOM_ADDRESS
+0x06 HCI_LE_SET_ADVERTISING_PARAMETERS
+0x07 HCI_LE_READ_ADVERTISING_CHANNEL_TX_POWER
+0x08 HCI_LE_SET_ADVERTISING_DATA
+0x09 HCI_LE_SET_SCAN_RESPONSE_DATA
+0x0A HCI_LE_SET_ADVERTISE_ENABLE
+0x0B HCI_LE_SET_SCAN_PARAMETERS
+0x0C HCI_LE_SET_SCAN_ENABLE
+0x0D HCI_LE_CREATE_CONNECTION
+0x0E HCI_LE_CREATE_CONNECTION_CANCEL
+0x0F HCI_LE_READ_WHITE_LIST_SIZE
+0x10 HCI_LE_CLEAR_WHITE_LIST
+0x11 HCI_LE_ADD_DEVICE_TO_WHITE_LIST
+0x12 HCI_LE_REMOVE_DEVICE_FROM_WHITE_LIST
+0x13 HCI_LE_CONNECTION_UPDATE
+0x14 HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION
+0x15 HCI_LE_READ_CHANNEL_MAP
+0x16 HCI_LE_READ_REMOTE_USED_FEATURES
+0x17 HCI_LE_ENCRYPT
+0x18 HCI_LE_RAND
+0x19 HCI_LE_START_ENCRYPTION
+0x1A HCI_LE_LONG_TERM_KEY_REQUEST_REPLY
+0x1B HCI_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY
+0x1C HCI_LE_READ_SUPPORTED_STATES
+0x1D HCI_LE_RECEIVER_TEST
+0x1E HCI_LE_TRANSMITTER_TEST
+0x1F HCI_LE_TEST_END
+0x20 HCI_LE_REMOTE_CONNECTION_PARAMETER_REQUEST_REPLY
+0x21 HCI_LE_REMOTE_CONNECTION_PARAMETER_REQUEST_NEGATIVE_REPLY
+)
+// HCI event code
+(
+0x01 HCI_EVENT_INQUIRY_COMPLETE
+0x02 HCI_EVENT_INQUIRY_RESULT
+0x03 HCI_EVENT_CONNECTION_COMPLETE
+0x04 HCI_EVENT_CONNECTION_REQUEST
+0x05 HCI_EVENT_DISCONNECTION_COMPLETE
+0x06 HCI_EVENT_AUTHENTICATION_COMPLETE
+0x07 HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE
+0x08 HCI_EVENT_ENCRYPTION_CHANGE_COMPLETE
+0x09 HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE
+0x0A HCI_EVENT_MASTER_LINK_KEY_COMPLETE
+0x0B HCI_EVENT_READ_REMOTE_FEATURES_COMPLETE
+0x0C HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE
+0x0D HCI_EVENT_QOS_SETUP_COMPLETE
+0x0E HCI_EVENT_COMMAND_COMPLETE
+0x0F HCI_EVENT_COMMAND_STATUS
+0x10 HCI_EVENT_HARDWARE_ERROR
+0x11 HCI_EVENT_FLUSH_OCCURRED
+0x12 HCI_EVENT_ROLE_CHANGE
+0x13 HCI_EVENT_NUM_COMPLETED_PACKETS
+0x14 HCI_EVENT_MODE_CHANGE
+0x15 HCI_EVENT_RETURN_LINK_KEYS
+0x16 HCI_EVENT_PIN_CODE_REQUEST
+0x17 HCI_EVENT_LINK_KEY_REQUEST
+0x18 HCI_EVENT_LINK_KEY_NOTIFICATION
+0x19 HCI_EVENT_LOOPBACK_COMMAND
+0x1A HCI_EVENT_DATA_BUFFER_OVERFLOW
+0x1B HCI_EVENT_MAX_SLOTS_CHANGE
+0x1C HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE
+0x1D HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED
+0x1E HCI_EVENT_QOS_VIOLATION
+0x1F HCI_EVENT_PAGE_SCAN_MODE_CHANGE
+0x20 HCI_EVENT_PAGE_SCAN_REPETITION_MODE_CHANGE
+0x21 HCI_EVENT_FLOW_SPECIFICATION_COMPLETE
+0x22 HCI_EVENT_INQUIRY_RESULT_WITHRSSI
+0x23 HCI_EVENT_READ_REMOTE_EXT_FEATURES_COMPLETE
+0x2C HCI_EVENT_SCO_CONNECTION_COMPLETE
+0x2D HCI_EVENT_SCO_CONNECTION_CHANGED
+0x2E HCI_EVENT_SNIFF_SUBRATING
+0x2F HCI_EVENT_EXT_INQUIRY_RESULT
+0x30 HCI_EVENT_ENCRYPT_KEY_REFRESH_COMPLETE
+0x31 HCI_EVENT_IO_CAP_REQ
+0x32 HCI_EVENT_IO_CAP_RESPONSE
+0x33 HCI_EVENT_USER_CONFIRMATION_REQUEST
+0x34 HCI_EVENT_UESR_PASSKEY_REQUEST
+0x35 HCI_EVENT_REMOTE_OOB_DATA_REQUEST
+0x36 HCI_EVENT_SIMPLE_PAIRING_COMPLETE
+0x38 HCI_EVENT_LINK_SUPERVISION_TIMEOUT_CHANGED
+0x39 HCI_EVENT_ENHANCED_FLUSH_COMPLETE
+0x3B HCI_EVENT_USER_PASSKEY_NOTIFICATION
+0x3C HCI_EVENT_KEYPRESS_NOTIFICATION
+0x3D HCI_EVENT_REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION 
+0x3E HCI_EVENT_LE_META_EVENT
+0x40 HCI_EVENT_PHYSICAL_LINK_COMPLETE
+0x41 HCI_EVENT_CHANNEL_SELECTED
+0x42 HCI_EVENT_DISCONNECTION_PHYSICAL_LINK_COMPLETE
+0x43 HCI_EVENT_PHYSICAL_LINK_LOSS_EARLY_WARNING
+0x44 HCI_EVENT_PHYSICAL_LINK_RECOVERY
+0x45 HCI_EVENT_LOGICAL_LINK_COMPLETE
+0x46 HCI_EVENT_DISCONNECTION_LOGICAL_LINK_COMPLETE
+0x47 HCI_EVENT_FLOW_SPEC_MODIFY_COMPLETE
+0x48 HCI_EVENT_NUMBER_OF_COMPLETED_DATA_BLOCKS
+0x49 HCI_EVENT_AMP_START_TEST
+0x4A HCI_EVENT_AMP_TEST_END
+0x4B HCI_EVENT_AMP_RECEIVER_REPORT
+0x4C HCI_EVENT_SHORT_RANGE_MODE_CHANGE_COMPLETE
+0x4D HCI_EVENT_AMP_STATUS_CHANGE
+0x4E HCI_EVENT_TRIGGERED_CLOCK_CAPTURE
+0x4F HCI_EVENT_SYNCHRONIZATION_TRAIN_COMPLETE
+0x50 HCI_EVENT_SYNCHRONIZATION_TRAIN_RECEIVED
+0x51 HCI_EVENT_CONNECTIONLESS_SLAVE_BROADCAST_RECEIVE
+0x52 HCI_EVENT_CONNECTIONLESS_SLAVE_BROADCAST_TIMEOUT
+0x53 HCI_EVENT_TRUNCATED_PAGE_COMPLETE
+0x54 HCI_EVENT_SLAVE_PAGE_RESPONSE_TIMEOUT
+0x55 HCI_EVENT_CONNECTIONLESS_SLAVE_BROADCAST_CHANNEL_MAP_CHANGE
+0x56 HCI_EVENT_INQUIRY_RESPONSE_NOTIFICATION
+0x57 HCI_EVENT_AUTHENTICATED_PAYLOAD_TIMEOUT_EXPIRED
+
+0xFE HCI_EVENT_LOGO_TESTING
+0xFF HCI_EVENT_VENDOR_SPECIFIC
+)
+(
+0x01 HCI_VENDOR_EVENT_COMMU_READY
+)
+//HCI LE SUBEVENT CODE
+(
+0x01 HCI_LE_SUBEVENT_CONN_COMPLETE
+0x02 HCI_LE_SUBEVENT_ADV_REPORT
+0x03 HCI_LE_SUBEVENT_CONN_UPDATE_COMPLETE
+0x04 HCI_LE_SUBEVENT_REMOTE_FEATURE_COMPLETE
+0x05 HCI_LE_SUBEVENT_LTK_REQUEST
+0x06 HCI_LE_SUBEVENT_REMOTE_CONN_PARAM_REQ
+)
+
Index: format/kscan_peipherals.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/kscan_peipherals.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/kscan_peipherals.format	(working copy)
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+//0 mem_kscan_head_ptr
+//1 mem_col_num
+//1 mem_row_num
+//4 mem_col_conf_pin
+//4 mem_row_conf_pin
+//1 mem_row_count
+//1 mem_count_shift
+//2 mem_kscan_value_temp
+//2 mem_kscan_lastvalue
+//2 mem_kscan_value
+//4 mem_btclk_kscan
+//1 mem_btclk_kscan_interval
+
+
+0x00 KEYSCAN_OFFECT_COL_NUM
+0x01 KEYSCAN_OFFECT_ROW_NUM
+0x02 KEYSCAN_OFFECT_COL_CONF_PIN
+0x06 KEYSCAN_OFFECT_ROW_CONF_PIN
+
+0x0a KEYSCAN_OFFECT_ROW_COUNT
+0x0b KEYSCAN_OFFECT_SHIFT_COUNT
+
+0X0C KEYSCAN_OFFECT_VALUE_TEMP
+0X0E KEYSCAN_OFFECT_LASVALUE
+0X10 KEYSCAN_OFFECT_VALUE
+0x12 KEYSCAN_OFFECT_BTCLK
+0x16 KEYSCAN_OFFECT_BTCLK_INTERVAL
+
+
Index: format/l2cap.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/l2cap.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/l2cap.format	(working copy)
@@ -0,0 +1,443 @@
+
+memalloc(
+0 mem_l2cap_mem_start
+// L2CAP RX 
+2 mem_l2cap_rxbuff1_len
+2 mem_l2cap_rxbuff2_len
+2 mem_l2cap_rxbuff_new
+1 mem_l2cap_rxbuff_inuse
+2 mem_l2cap_payload_ptr
+2 mem_l2cap_rx_pkt_length
+2 mem_l2cap_rx_cid
+1 mem_l2cap_rx_done
+
+
+
+// L2CAP TX Signal channel
+2 mem_l2cap_signal_tx_buff_ptr
+2 mem_l2cap_signal_tx_payload_ptr
+2 mem_l2cap_signal_tx_length
+// L2CAP TX SDP channel
+2 mem_sdp_tx_buff_ptr
+2 mem_sdp_tx_payload_ptr
+2 mem_sdp_tx_pkt_length
+// L2CAP TX RFCOMM channel
+2 mem_rfcomm_tx_buff_ptr
+2 mem_rfcomm_tx_payload_ptr
+2 mem_rfcomm_tx_pkt_length
+
+
+
+//L2CAP Util
+
+2 memL2CAP_T1
+
+1 mem_CONTROL_tasks
+1 mem_send_config_req
+
+
+1 mem_config_identifier
+2 mem_config_req_dest_CID
+1 mem_rfcomm_malloc_fail_flag
+
+//L2CAP STATE MACHINE
+1 mem_message_to_uppersm
+1 mem_upper_sm_remote_page
+1 mem_upper_sm_reconn
+1 mem_upper_sm_ss
+
+
+64 mem_tx_malloc_log
+0 mem_l2cap_mem_end
+
+
+2 mem_scid
+2 mem_cmd_length
+2 mem_tt2
+2 mem_tt3
+2 mem_id
+2 mem_psm
+
+
+4 mem_l2cap_sdpres_delay_time
+)
+
+xmemalloc(
+0 mem_l2cap_xmem_start
+//*******************L2CAP TX MULTI-PACKET*********************//
+2 mem_l2cap_tx_multi_offset //0 means single packet
+
+//*******************CHANNEL ID*********************//
+2 mem_sdp_remote_cid
+2 mem_rfcomm_remote_cid
+2 mem_hid_ctrl_remote_cid
+2 mem_hid_int_remote_cid
+//*******************CHANNEL STATE*********************//
+1 mem_sdp_state
+1 mem_rfcomm_state
+1 mem_hid_control_state
+1 mem_hid_interrupt_state
+1 mem_spp_state
+1 mem_ML2CAP_comm_id
+
+//*******************L2CAP malloc********************//
+1 mem_used_map
+0 mem_tx_fifo0
+1 mem_tx_fifo0_map
+2 mem_tx_fifo0_ptr
+0 mem_tx_fifo1
+1 mem_tx_fifo1_map
+2 mem_tx_fifo1_ptr
+0 mem_tx_fifo2
+1 mem_tx_fifo2_map
+2 mem_tx_fifo2_ptr
+0 mem_tx_fifo3
+1 mem_tx_fifo3_map
+2 mem_tx_fifo3_ptr
+0 mem_tx_fifo_end
+256 mem_l2cap_lpm_txbuf
+//*******************MISC*********************//
+1 mem_l2cap_flow_ctrl_flag
+1 mem_l2cap_pending_item
+1 mem_l2cap_rcv_hidtype
+0 mem_l2cap_xmem_end
+
+)
+
+
+//mem_l2cap_lpm_txbuf
+(
+256 l2cap_lpm_txbuf_len
+)
+
+(
+4 L2CAP_TX_FIFO_SIZE
+8 L2CAP_TX_BUFF_CNT
+
+)
+(
+0x0002 L2CAP_SIG_EXT_FEATRUE
+0x0003 L2CAP_SIG_FIX_FEATRUE
+)
+
+
+(
+0 HS_IDLE
+1 AG_INIT_CALL
+2 HS_INIT_CALL
+)
+(
+0 M_ACL_LINK_ABSENT
+1 M_ACL_LINK_EXIST
+)
+
+(
+0 L2CAP_INUSE_BUFF1
+1 L2CAP_INUSE_BUFF2
+)
+/* upper layer interface w/ lower layer */
+(
+1 MAX_NUM_LINKS_ALLOWED
+1 MAX_NUM_SCO_ALLOWED
+1 ACL_LINK_PRESENT
+0 ACL_LINK_ABSENT
+)
+(
+1 L2CAP_RX_DONE 
+0 L2CAP_RX_CLEAR
+)
+/* Scheduler */
+(
+0 L2CAP_DISCONNECT_INTERRUPT
+1 RFCOMM_wants_service
+2 L2CAP_sig_Tx_buff_full
+3 RFCOMM_Tx_buff_full
+4 SDP_Tx_buff_full
+5 got_complete_L2CAP_pkt	
+6 L2CAP_init_Config_Req
+7 L2CAP_DISCONNECT_CONTROL
+)
+
+/* mem_CONTROL_tasks2 */
+(
+0 UI_NEED_SERVICE
+)
+/* L2CAP logic channel identifiers (2 bytes) p.261 */
+(
+0x0001 L2CAP_signal_channel
+0x0050 L2CAP_SDP_channel
+0x0051 L2CAP_RFCOMM_channel
+0x0052 L2CAP_HID_Control_channel   
+0x0053 L2CAP_HID_Interrupt_channel
+0x0077 L2CAP_AVDTP_signal_channel		//------avdtp
+0x0078 L2CAP_AVDTP_media_channel
+0x0079 L2CAP_AVDTP_report_channel
+0x0080 L2CAP_AVDTP_recovery_channel
+0x00dd L2CAP_AVCTP_Control_channel
+)
+/* L2CAP signalling command codes (1 byte) p.284 */
+(
+0x00 reserved
+0x01 signal_cmd_reject
+0x02 signal_connect_req
+0x03 signal_connect_rsp
+0x04 signal_config_req
+0x05 signal_config_rsp
+0x06 signal_disconnect_req
+0x07 signal_disconnect_rsp
+0x08 signal_echo_req
+0x09 signal_echo_rsp
+0x0a signal_info_req
+0x0b signal_info_rsp
+)
+/* L2CAP signal_command_reject reason code (2 bytes), p.285 */
+(
+0x0000 cmd_not_understood
+0x0001 signalling_MTU_exceeded
+0x0002 invalid_CID_in_req
+)
+/* L2CAP PSM values used in signal_connect_req (2 bytes), p.286 */
+(
+0x0001 PSM_SDP
+0x0003 PSM_RFCOMM
+0x0005 PSM_TCS
+0x0011 PSM_HID_control
+0x0013 PSM_HID_interrupt
+0x0017 PSM_AVCTP
+0x0019 PSM_AVDTP
+)
+/* L2CAP connection response result code (2 bytes), p.288 */
+(
+0x0000 L2CAP_connect_successful
+0x0001 L2CAP_connect_pending
+0x0002 L2CAP_connect_refused_PSM_unsupported
+0x0003 L2CAP_connect_refused_security_block
+0x0004 L2CAP_connect_refused_no_resources
+)
+/* L2CAP connection status values (2 bytes), p.288 */
+(
+0x0000 L2CAP_no_info_available
+0x0001 L2CAP_authentication_pending
+0x0002 L2CAP_authorization_pending
+)
+/* L2CAP configuration response result code (2 bytes), p.292 */
+(
+0x0000 L2CAP_config_success
+0x0001 L2CAP_config_failure_bad_parameters
+0x0002 L2CAP_config_failure_no_reason
+0x0003 L2CAP_config_failure_unknown_options
+)
+/* L2CAP constant definitions */
+(
+128 L2CAP_Rx_buff_size
+48  L2CAP_signal_Tx_buff_size
+128 SDP_Tx_buff_size
+128 RFCOMM_Tx_buff_size
+1 AM_ADDRESS
+3 DM1TYPE
+4 DH1TYPE
+11 DH3TYPE
+8 DVTYPE
+0 channel_state_closed
+1 channel_state_config
+2 channel_state_open
+0x0030 L2CAP_config_MTU_SDP
+0xffff L2CAP_config_ftimeout_SDP
+0x03e3 L2CAP_config_MTU_RFCOMM
+0xffff L2CAP_config_ftimeout_RFCOMM
+260 l2cap_max_pkt_len
+)
+
+(
+0 FAILURE
+1 SUCCESS
+2 IN_PROGRESS
+)
+(
+0x00	IDLE
+0x01	WAIT_4_BB_PAGE
+0x02	WAIT_4_LMP_CONN
+0x03	WAIT_4_SCO_CONN
+0x04	WAIT_4_SCO_KILLED
+)
+
+/*mem_master_mss*/
+(
+0 STOP_ENC
+1 SEND_SWITCH_REQ
+)
+(
+0 HF_HS_READY
+1 HF_AG_READY
+)
+/* mem_hf_state */
+(
+0 HF_STATE_WAITING_RFCOMM_CONN
+1 HF_STATE_HF_SEND_FEATURE
+2 HF_STATE_WAITING_AG_FEATURE_OK
+3 HF_STATE_HF_SEND_INDICATORS
+4 HF_STATE_WAITING_AG_INDICATORS_OK
+5 HF_STATE_HF_SEND_CURR_STATUS
+6 HF_STATE_WAITING_AG_STATUS_OK
+7 HF_STATE_HF_SEND_UPDATE_STATUS
+8 HF_STATE_WAITING_AG_UPDATE_STATUS_OK
+9 HF_STATE_CONNECTED
+0x0a HF_STATE_HF_SEND_RECEIVE_INFO
+0x0b HF_STATE_WAITING_AG_INFO
+0x0c HF_STATE_HF_SEND_AT_CLIP
+0x0d HF_STATE_WAITING_AT_CLIP
+0x0e HF_STATE_HF_SEND_AT_CCWA
+0x0f HF_STATE_WAITING_AT_CCWA
+)
+/*mem_hf_call_state*/
+(
+0 HF_CALL_STATE_INACTIVE
+1 HF_CALL_STATE_SETUP
+2 HF_CALL_STATE_ACTIVE 
+)
+/* mem_pairing_state bit definition */
+(
+0 PAIR_INQUIRY_START
+1 PAIR_INQUIRY_TIME_OUT
+2 PAIR_INQUIRY_FAILED
+3 PAIR_INQUIRY_SUCCESS
+4 PAIR_READY_CONN
+5 PAIR_WAIT_CANCEL_RESPONSE
+6 PAIR_CONN_SUCCESS
+7 PAIR_WAIT_DETACH
+)  
+
+/* mem_pairing_mode bit definition */
+(
+0 FORCE_AUTHENTICATION
+)
+/* mem_hid_protecol_type */
+(
+0 PROTECOL_BOOT /*default*/
+1 PROTECOL_REPORT
+)
+
+/* mem_upper_sm_reconn */
+(
+1 UPPERSM_SEND_SDP_CONN_REQ
+2 UPPERSM_SEND_SDP_CFG_REQ
+3 UPPERSM_SEND_SDP_HF_SS
+4 UPPERSM_SEND_SDP_DISC_REQ
+5 UPPERSM_SEND_RFCOMM_CONN_REQ
+6 UPPERSM_SEND_RFCOMM_CFG_REQ
+7 UPPERSM_SEND_SABM_CMD
+8 UPPERSM_SEND_DISC
+9 UPPERSM_SEND_WAIT
+10 UPPERSM_SEND_HID_CONTROL_CONN_REQ
+11 UPPERSM_SEND_HID_CONTROL_CFG_REQ
+12 UPPERSM_SEND_HID_INTERRUPT_CONN_REQ
+13 UPPERSM_SEND_HID_INTERRUPT_CFG_REQ
+14 UPPERSM_SEND_SDP_HS_SS
+15 UPPERSM_SEND_SDP_PBAP_SS
+16 UPPERSM_SEND_SDP_AVTARG_SS
+)
+/* mem_upper_sm_remote_page */
+(
+1 UPPERSM_RP_SEND_SDP_CONN_REQ
+2 UPPERSM_RP_SEND_SDP_CFG_REQ
+3 UPPERSM_RP_SEND_SDP_HF_SS
+4 UPPERSM_RP_SEND_SDP_HS_SS
+5 UPPERSM_RP_SEND_SDP_PBAP_SS
+6 UPPERSM_RP_SEND_SDP_AVTARG_SS
+7 UPPERSM_RP_SEND_SDP_DISC_REQ
+8 UPPERSM_RP_SEND_AVCTP_CONN_REQ
+9 UPPERSM_RP_SEND_AVCTP_CFG_REQ
+)
+
+/* mem_ML2CAP_flag */
+(
+0 MSCHEDULER_HID_CONTROL_CONN_DONE
+1 MSCHEDULER_HID_INTERRUPT_CONN_DONE
+2 MSCHEDULER_HID_CONTROL_CFG_REQ_DONE
+3 MSCHEDULER_HID_CONTROL_CFG_RSP_DONE
+4 MSCHEDULER_HID_INTERRUPT_CFG_REQ_DONE
+5 MSCHEDULER_HID_INTERRUPT_CFG_RSP_DONE
+6 MSCHEDULER_HID_CONTROL_DISC_DONE
+7 MSCHEDULER_HID_INTERRUPT_DISC_DONE
+)
+/*    ui event    --add by lj*/
+(
+0x00 UI_DATA_EVNET_NONE
+0x01 UI_DATA_EVNET_HID
+0x02 UI_DATA_EVNET_AVDTP_S
+0x03 UI_DATA_EVNET_AVDTP_M
+0x04 UI_DATA_EVNET_AVCTP
+0x05 UI_DATA_EVNET_HS
+0x06 UI_DATA_EVNET_HF
+0x07 UI_DATA_EVNET_SPP
+0x08 UI_DATA_EVNET_OBEX
+)
+/*    ui ack --add by lj*/
+(
+0x00 UI_DATA_TX_NONE
+0x01 UI_DATA_TX_HID
+0x02 UI_DATA_TX_AVDTP_S
+0x03 UI_DATA_TX_AVDTP_M
+0x04 UI_DATA_TX_AVCTP
+0x05 UI_DATA_TX_HS
+0x06 UI_DATA_TX_HF
+0x07 UI_DATA_TX_SPP
+0x08 UI_DATA_TX_OBEX
+0x10 ACL_TX_L2CAP_SIGNAL
+0x11 ACL_TX_SDP
+0x12 ACL_TX_RFCOMM
+
+)
+
+(
+0 L2CAP_SDP_interface_conn
+1 L2CAP_SDP_interface_cfg
+)
+
+(                                   
+0 L2CAP_CHANNEL_STATE_CONN_REQ      
+1 L2CAP_CHANNEL_STATE_CONN_RES      
+2 L2CAP_CHANNEL_STATE_SND_CFG_REQ   
+3 L2CAP_CHANNEL_STATE_SND_CFG_RES   
+4 L2CAP_CHANNEL_STATE_RCV_CFG_REQ   
+5 L2CAP_CHANNEL_STATE_RCV_CFG_RES
+6 L2CAP_CHANNEL_RFCOMM_ONLY_SABM
+7 L2CAP_CHANNEL_RFCOMM_ONLY_UA
+6 L2CAP_CHANNEL_AVDTP_SIGNAL_INIT //set avdtp init complete
+6 L2CAP_CHANNEL_HID_HANDSHAKE_DONE
+0x3f L2CAP_CHANNEL_SETUP_COMPLETE
+0x7f L2CAP_CHANNEL_AVDTP_SIGNAL_COMPLETE
+0xff L2CAP_CHANNEL_RFCOMM_DLCI0_OPENED
+)                                     
+
+/*  AVDTP---lj*/
+(
+0 L2CAP_AVDTP_SIGNAL_CONNECT
+1 L2CAP_AVDTP_SIGNAL_CONFIG
+2 L2CAP_AVDTP_MEDIA_CONNECT
+3 L2CAP_AVDTP_MEDIA_CONFIG
+4 L2CAP_AVDTP_REPORT_CONNECT
+5 L2CAP_AVDTP_REPORT_CONFIG
+6 L2CAP_AVDTP_RECOVERY_CONNECT
+7 L2CAP_AVDTP_RECOVERY_CONFIG
+)
+/*  AVCTP---lj*/
+(
+0 L2CAP_AVCTP_SIGNAL_CONNECT
+1 L2CAP_AVCTP_SIGNAL_CONFIG
+)
+
+127 L2CAP_SIGNAL_MALLOC_SIZE
+
+//1 mem_rfcomm_malloc_fail_flag
+(
+0 RFCOMM_MALLOC_SUCCEED
+1 RFCOMM_MALLOC_FAIL
+)
+
+//mem_l2cap_flow_ctrl_flag
+(
+0 L2CAP_FLOW_CTRL_DISABLE
+1 L2CAP_FLOW_CTRL_ENABLE
+)
+
Index: format/lmp.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/lmp.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/lmp.format	(working copy)
@@ -0,0 +1,249 @@
+
+memalloc(
+
+1 mem_lmo_header_length
+1 mem_lmo_header_opcode
+17 mem_lmo_payload
+1 mem_lmi_accepted_opcode
+1 mem_disconn_reason_send
+1 mem_tx_fixed_freq
+1 mem_rx_fixed_freq
+1 mem_ext_features_page
+2 mem_lmpext_ssp_enable
+1 mem_remote_sppcap
+
+1 mem_lmp_conn_state
+2 mem_soft_timer
+1 mem_pincode_state
+
+1 mem_sres_tid
+1 mem_accptsco_tid
+
+1 mem_wait_encryption
+
+16 mem_sniff_payload
+4 mem_aurand_send_delay_time
+)
+
+xmemalloc(
+1 mem_lmo_header_opcode_x
+1 mem_lmp_version
+2 mem_lmp_compid
+2 mem_lmp_subversion
+1 mem_local_name_length
+3 mem_local_name
+64 mem_local_name2
+1 mem_local_name_end
+1 mem_unsniff2sniff_timer
+1 mem_switch_flag
+1 mem_classic_bt_flag
+1 mem_encapsulated_major_type
+1 mem_encapsulated_minor_type
+1 mem_encapsulated_len
+1 mem_remote_br_sc_support
+)
+
+	(
+	//bit flag:mem_classic_bt_flag
+	0 FLAG_SSP_REJECT_JUSTWORK
+	1 SHORT_MULT_FLAG
+	)
+	
+	(
+	//bit map
+	0 pair_state_inrand
+	1 pair_state_inrand_acpt
+	2 pair_state_send_comb
+	3 pair_state_recv_comb
+	4 pair_state_send_aurand
+	5 pair_state_recv_sres
+	6 pair_state_recv_aurand
+	7 pair_state_send_sres	
+	)
+	/* LMP opcodes */
+	(
+	1 LMP_NAME_REQ 
+	2 LMP_NAME_RES 
+	3 LMP_ACCEPTED 
+	4 LMP_NOT_ACCEPTED 
+	5 LMP_CLKOFFSET_REQ 
+	6 LMP_CLKOFFSET_RES 
+	7 LMP_DETACH 
+	8 LMP_IN_RAND 
+	9 LMP_COMB_KEY 
+	10 LMP_UNIT_KEY 
+	11 LMP_AU_RAND 
+	12 LMP_SRES 
+	13 LMP_TEMP_RAND 
+	14 LMP_TEMP_KEY 
+	15 LMP_ENCRYPTION_MODE_REQ 
+	16 LMP_ENCRYPTION_KEY_SIZE_REQ 
+	17 LMP_START_ENCRYPTION_REQ 
+	18 LMP_STOP_ENCRYPTION_REQ 
+	19 LMP_SWITCH_REQ 
+	20 LMP_HOLD
+	21 LMP_HOLD_REQ
+	23 LMP_SNIFF_REQ 
+	24 LMP_UNSNIFF_REQ 
+	26 LMP_PARK_REQ 
+	27 LMP_SET_BROADCAST_SCAN_WINDOW 
+	28 LMP_MODIFY_BEACON 
+	29 LMP_UNPARK_BD_ADDR_REQ 
+	30 LMP_UNPARK_PM_ADDR_REQ 
+	31 LMP_INCR_POWER_REQ 
+	32 LMP_DECR_POWER_REQ 
+	33 LMP_MAX_POWER 
+	34 LMP_MIN_POWER 
+	35 LMP_AUTO_RATE 
+	36 LMP_PREFERRED_RATE 
+	37 LMP_VERSION_REQ 
+	38 LMP_VERSION_RES 
+	39 LMP_FEATURES_REQ 
+	40 LMP_FEATURES_RES 
+	41 LMP_QUALITY_OF_SERVICE 
+	42 LMP_QUALITY_OF_SERVICE_REQ 
+	43 LMP_SCO_LINK_REQ 
+	44 LMP_REMOVE_SCO_LINK_REQ 
+	45 LMP_MAX_SLOT 
+	46 LMP_MAX_SLOT_REQ 
+	47 LMP_TIMING_ACCURACY_REQ 
+	48 LMP_TIMING_ACCURACY_RES 
+	49 LMP_SETUP_COMPLETE 
+	50 LMP_USE_SEMI_PERMANENT_KEY 
+	51 LMP_HOST_CONNECTION_REQ 
+	52 LMP_SLOT_OFFSET 
+	53 LMP_PAGE_MODE_REQ 
+	54 LMP_PAGE_SCAN_MODE_REQ 
+	55 LMP_SUPERVISION_TIMEOUT 
+	56 LMP_TEST_ACTIVATE
+	57 LMP_TEST_CONTROL
+	58 LMP_ENC_KEY_SIZE_MASK_REQ
+	59 LMP_ENC_KEY_SIZE_MASK_RES
+	60 LMP_SET_AFH
+
+	/* simple pairing support */
+	61 LMP_ENCAPSULATED_HEADER
+	62 LMP_ENCAPSULATED_PAYLOAD
+	63 LMP_SIMPLE_PAIRING_CONFIRM
+	64 LMP_SIMPLE_PAIRING_NUMBER
+	65 LMP_DHKEY_CHECK
+	127 LMP_ESCAPE
+	127 LMP_ESCAPE_4   /* add 2bytes LMP header support  */   
+	)
+	/* LMP EXT opcodes, ORed with bit 7 to make difference to nonEXT */
+	(
+	129 LMP_EXT_ACCEPTED
+	130 LMP_NOT_ACCEPTED_EXT
+	131 LMP_EXT_FEATURES_REQ
+	132 LMP_EXT_FEATURES_RES
+	139 LMP_PACKET_TYPE_TABLE_REQ
+	140 LMP_EXT_ESCO_LINK_REQ
+	141 LMP_EXT_REMOVE_ESCO_REQ
+	144 LMP_EXT_CHN_CLASSIFICATION_REQ
+	145 LMP_EXT_CHN_CLASSIFICATION
+	149 LMP_SNIFF_SUBRATING_REQ
+	150 LMP_SNIFF_SUBRATING_RES
+	151 LMP_PAUSE_ENCRYPTION_REQ
+	152 LMP_RESUME_ENCRYPTION_REQ
+	153 LMP_IO_CAP_REQ
+	154 LMP_IO_CAP_RES
+	161 LMP_PING_REQ
+	162 LMP_PING_RES
+	)
+	/* LMP reason codes */
+	(
+	0x05 AUTHENTICATION_FAILURE_ERROR
+	0x06 KEY_MISSING
+	0x0b ACL_CONNECTION_ALREADY_EXISTS
+	0x13 OTHER_END_TERMINATED
+	0x15 ABOUT_TO_POEWR_OFF
+	0x16 LOCAL_HOST
+	0x18 PAIRING_NOT_ALLOWED
+	0x19 UNKNOWN_LMP_PDU
+	0x1A UNSUPPORTED_LMP_FEATURE 
+	0x1F UNSPECIFIED_ERROR
+	0x20 UNSUPPORTED_PARAMETERS
+	0x21 SWITCH_NOT_ALLOWED
+	0x23 TRANSACTION_COLLISION
+	0x24 PDU_NOT_ALLOWED
+	0x25 ENCRYPTION_MODE_NOT_ACCEPTABLE
+	0x2e NOT_SUPPORT_CHN_CLASSIFICATION
+	0x37 NOT_SUPPORT_SSP
+	)
+
+	/* test mode scenarios */
+	(
+	0 PAUSE_TEST_MODE
+	1 ZERO_PATTERN
+	2 ONE_PATTERN
+	3 ALT_PATTERN
+	4 PSEUDORANDOM
+	5 CLOSED_LOOP_BACK_ACL
+	6 CLOSED_LOOP_BACK_SCO
+	7 ACL_WITHOUT_WHITENING
+	8 SCO_WITHOUT_WHITENING
+	9 ALT2_PATTERN
+	255 EXIT_TEST_MODE
+	)
+	/* test mode hoppig modes */
+	(
+	0 FIXED_FREQ
+	1 NORMAL_HOP
+	)
+
+	/* mem_lmp_tid indicates which type of LMP will be sent */
+	(
+	0 TID_NORM_REPLY
+	1 TID_NORM_SEND
+	2 TID_ONE
+	3 TID_ZERO
+	4 TID_PAIRING
+	5 TID_ENCRYPTION
+	6 TID_VARIABLE
+	7 TID_RX
+	)
+
+	/* ============== lmp status ==========*/
+	(
+	0 lmp_incoming
+	1 lmp_outgoing
+	2 lmp_reject_msg
+	3 lmp_clear_msg
+	4 upper_reject_msg
+	5 upper_clear_msg
+	)
+
+(
+0x2ee00 TIMER_ONE_MINUTE //96000*2
+80 TIMER_SWITCH_WAITE
+12 TIMER_ENPT_WAITE
+)
+
+(
+0 SWITCH_FLAG_INIT
+1 SWITCH_FLAG_ACCEPT
+2 SWITCH_FLAG_NOT_ACCEPT
+)
+(
+0 NULL_ENCRYP
+1 DONE_ENCRYP
+)
+
+
+(
+3 LMP_FEATURES_EXT_PAGE1_SC_HOST_BIT
+)
+
+(
+8 LMP_FEATURES_EXT_PAGE2_SC_CONTROLLER_BIT
+)
+
+
+//mem_remote_br_sc_support
+(
+0 REMOTE_BR_SC_HOST_BIT
+1 REMOTE_BR_SC_CONTROLLER_BIT
+)
+  
+
+
Index: format/memblocks.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/memblocks.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/memblocks.format	(working copy)
@@ -0,0 +1,54 @@
+//
+//
+//Large memory blocks defined in this file.
+//Blocks Shall be defined with absolute address.
+//Blocks' length Shall be specified in comment following Blocks' names.
+//Different blocks MAY be overlap.
+//Blocks defined in this file Shall NOT be overlap with variable in memmap.format.
+
+// USB C51 exchange area
+(
+0xff0 mem_mcmd
+0xff1 mem_mouse_data
+)
+
+//l2cap RX buffers
+(
+0x1000 mem_le_l2cap_buf		//0x400
+0x1000 mem_l2cap_rxbuff1		//0x400
+0x1400 mem_l2cap_rxbuff2		//0x400
+//end address:0x17ff
+)
+//l2cap TX buffers
+(
+0x1800 mem_tx_buff0		//128
+0x0080 mem_bt_l2cap_tx_buff_size
+0x1400 mem_ble_tx_buff0
+0x0100 mem_ble_l2cap_tx_buff_size
+)
+
+(
+0x1800 mem_le_tx_buffer0
+0x1900 mem_le_tx_buffer1
+0x1a00 mem_le_tx_buffer2
+0x1b00 mem_le_tx_buffer3
+//end addr:0x1dff
+)
+
+
+//uart buffer
+(
+0x1800 mem_h5rx_buf//0x400
+0x1bff mem_h5rx_buf_end
+0x1c00 mem_h5tx_buf
+0x1fff mem_h5tx_buf_end
+)
+
+
+(
+0x1800 mem_ir_record
+0x1c      mem_ir_record_max
+)
+
+0x4c00 mem_savelist
+
Index: format/mesh_protocol_stack/mesh_access_layer.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_access_layer.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_access_layer.format	(working copy)
@@ -0,0 +1,348 @@
+
+memalloc ali_mesh(
+	1 mem_mesh_receive_model_message_payload_len
+	1 mem_mesh_receive_model_message_payload_opcode
+	23 mem_mesh_receive_model_message_payload
+
+	1 mem_mesh_access_layer_payload_len
+	0 mem_mesh_access_layer_payload
+	50 mem_mesh_access_payload
+	50 mem_mesh_access_payload_padding	//为了透传模块预留
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	3 mem_mesh_NETKeyindex_and_APPKeyindex
+	16 mem_mesh_receive_application_key
+)
+
+
+(//status codes
+0 STATUS_CODE_SUCCESS
+)
+
+
+// ali vendor message
+(
+0xD0 VENDOR_MESSAGE_ATTR_GET
+0xD1 VENDOR_MESSAGE_ATTR_SET
+0xD2 VENDOR_MESSAGE_ATTR_SET_UNACKNOWLEDGED
+0xD3 VENDOR_MESSAGE_ATTR_STATUS
+0xD4 VENDOR_MESSAGE_ATTR_INDICATION
+0xD5 VENDOR_MESSAGE_ATTR_CONFIRMATION
+0xCF VENDOR_MESSAGE_TRANSPARENT_MSG
+)
+
+
+
+(//configuration message and health message opcode
+0x80 MESH_CONFIGURATION_AND_HEALTH_MESSAGE_OPCODE_HEADER
+
+0x00 MESH_MESSAGE_OPCODE_CONFIG_APPKEY_ADD
+0x01 MESH_MESSAGE_OPCODE_CONFIG_APPKEY_UPDATE
+0x02 MESH_MESSAGE_OPCODE_CONFIG_COMPOSITION_DATA_STATUS
+0x03 MESH_MESSAGE_OPCODE_CONFIG_CONFIG_MODEL_PUBLICATION_SET
+0x04 MESH_MESSAGE_OPCODE_HEALTH_CURRENT_STATUS
+0x05 MESH_MESSAGE_OPCODE_HEALTH_FAULT_STATUS
+0x06 MESH_MESSAGE_OPCODE_CONFIG_HEARTBEAT_PUBLICATION_STATUS
+0x00 MESH_MESSAGE_OPCODE_CONFIG_APPKEY_DELETE_NO_HEAD
+0x01 MESH_MESSAGE_OPCODE_CONFIG_APPKEY_GET_NO_HEAD
+0x02 MESH_MESSAGE_OPCODE_CONFIG_APPKEY_LIST_NO_HEAD
+0x03 MESH_MESSAGE_OPCODE_CONFIG_APPKEY_STATUS_NO_HEAD
+0x04 MESH_MESSAGE_OPCODE_HEALTH_ATTENTION_GET_NO_HEAD
+0x05 MESH_MESSAGE_OPCODE_HEALTH_ATTENTION_SET_NO_HEAD
+0x06 MESH_MESSAGE_OPCODE_HEALTH_ATTENTION_SET_UNACKNOWLEDGED_NO_HEAD
+0x07 MESH_MESSAGE_OPCODE_HEALTH_ATTENTION_STATUS_NO_HEAD
+0x08 MESH_MESSAGE_OPCODE_CONFIG_COMPOSITION_DATA_GET_NO_HEAD
+0x09 MESH_MESSAGE_OPCODE_CONFIG_BEACON_GET_NO_HEAD
+0x0A MESH_MESSAGE_OPCODE_CONFIG_BEACON_SET_NO_HEAD
+0x0B MESH_MESSAGE_OPCODE_CONFIG_BEACON_STATUS_NO_HEAD
+0x0C MESH_MESSAGE_OPCODE_CONFIG_DEFAULT_TTL_GET_NO_HEAD
+0x0D MESH_MESSAGE_OPCODE_CONFIG_DEFAULT_TTL_SET_NO_HEAD
+0x0E MESH_MESSAGE_OPCODE_CONFIG_DEFAULT_TTL_STATUS_NO_HEAD
+0x0F MESH_MESSAGE_OPCODE_CONFIG_FRIEND_GET_NO_HEAD
+0x10 MESH_MESSAGE_OPCODE_CONFIG_FRIEND_SET_NO_HEAD
+0x11 MESH_MESSAGE_OPCODE_CONFIG_FRIEND_STATUS_NO_HEAD
+0x12 MESH_MESSAGE_OPCODE_CONFIG_GATT_PROXY_GET_NO_HEAD
+0x13 MESH_MESSAGE_OPCODE_CONFIG_GATT_PROXY_SET_NO_HEAD
+0x14 MESH_MESSAGE_OPCODE_CONFIG_GATT_PROXY_STATUS_NO_HEAD
+0x15 MESH_MESSAGE_OPCODE_CONFIG_KEY_REFRESH_PHASE_GET_NO_HEAD
+0x16 MESH_MESSAGE_OPCODE_CONFIG_KEY_REFRESH_PHASE_SET_NO_HEAD
+0x17 MESH_MESSAGE_OPCODE_CONFIG_KEY_REFRESH_PHASE_STATUS_NO_HEAD
+0x18 MESH_MESSAGE_OPCODE_CONFIG_MODEL_PUBLICATION_GET_NO_HEAD
+0x19 MESH_MESSAGE_OPCODE_CONFIG_MODEL_PUBLICATION_STATUS_NO_HEAD
+0x1A MESH_MESSAGE_OPCODE_CONFIG_MODEL_PUBLICATION_VIRTUAL_ADDRESS_SET_NO_HEAD
+0x1B MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_ADD_NO_HEAD
+0x1C MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_DELETE_NO_HEAD
+0x1D MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_DELETE_ALL_NO_HEAD
+0x1E MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_OVERWRITE_NO_HEAD
+0x1F MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_STATUS_NO_HEAD
+0x20 MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_VIRTUAL_ADDRESS_ADD_NO_HEAD
+0x21 MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_VIRTUAL_ADDRESS_DELETE_NO_HEAD
+0x22 MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_VIRTUAL_ADDRESS_OVERWRITE_NO_HEAD
+0x23 MESH_MESSAGE_OPCODE_CONFIG_NETWORK_TRANSMIT_GET_NO_HEAD
+0x24 MESH_MESSAGE_OPCODE_CONFIG_NETWORK_TRANSMIT_SET_NO_HEAD
+0x25 MESH_MESSAGE_OPCODE_CONFIG_NETWORK_TRANSMIT_STATUS_NO_HEAD
+0x26 MESH_MESSAGE_OPCODE_CONFIG_RELAY_GET_NO_HEAD
+0x27 MESH_MESSAGE_OPCODE_CONFIG_RELAY_SET_NO_HEAD
+0x28 MESH_MESSAGE_OPCODE_CONFIG_RELAY_STATUS_NO_HEAD
+0x29 MESH_MESSAGE_OPCODE_CONFIG_SIG_MODEL_SUBSCRIPTION_GET_NO_HEAD
+0x2A MESH_MESSAGE_OPCODE_CONFIG_SIG_MODEL_SUBSCRIPTION_LIST_NO_HEAD
+0x2B MESH_MESSAGE_OPCODE_CONFIG_VENDOR_MODEL_SUBSCRIPTION_GET_NO_HEAD
+0x2C MESH_MESSAGE_OPCODE_CONFIG_VENDOR_MODEL_SUBSCRIPTION_LIST_NO_HEAD
+0x2D MESH_MESSAGE_OPCODE_CONFIG_LOW_POWER_NODE_POLLTIMEOUT_GET_NO_HEAD
+0x2E MESH_MESSAGE_OPCODE_CONFIG_LOW_POWER_NODE_POLLTIMEOUT_STATUS_NO_HEAD
+0x2F MESH_MESSAGE_OPCODE_HEALTH_FAULT_CLEAR_NO_HEAD
+0x30 MESH_MESSAGE_OPCODE_HEALTH_FAULT_CLEAR_UNACKNOWLEDGED_NO_HEAD
+0x31 MESH_MESSAGE_OPCODE_HEALTH_FAULT_GET_NO_HEAD
+0x32 MESH_MESSAGE_OPCODE_HEALTH_FAULT_TEST_NO_HEAD
+0x33 MESH_MESSAGE_OPCODE_HEALTH_FAULT_TEST_UNACKNOWLEDGED_NO_HEAD
+0x34 MESH_MESSAGE_OPCODE_HEALTH_PERIOD_GET_NO_HEAD
+0x35 MESH_MESSAGE_OPCODE_HEALTH_PERIOD_SET_NO_HEAD
+0x36 MESH_MESSAGE_OPCODE_HEALTH_PERIOD_SET_UNACKNOWLEDGED_NO_HEAD
+0x37 MESH_MESSAGE_OPCODE_HEALTH_PERIOD_STATUS_NO_HEAD
+0x38 MESH_MESSAGE_OPCODE_CONFIG_HEARTBEAT_PUBLICATION_GET_NO_HEAD
+0x39 MESH_MESSAGE_OPCODE_CONFIG_HEARTBEAT_PUBLICATION_SET_NO_HEAD
+0x3A MESH_MESSAGE_OPCODE_CONFIG_HEARTBEAT_SUBSCRIPTION_GET_NO_HEAD
+0x3B MESH_MESSAGE_OPCODE_CONFIG_HEARTBEAT_SUBSCRIPTION_SET_NO_HEAD
+0x3C MESH_MESSAGE_OPCODE_CONFIG_HEARTBEAT_SUBSCRIPTION_STATUS_NO_HEAD
+0x3D MESH_MESSAGE_OPCODE_CONFIG_MODEL_APP_BIND_NO_HEAD
+0x3E MESH_MESSAGE_OPCODE_CONFIG_MODEL_APP_STATUS_NO_HEAD
+0x3F MESH_MESSAGE_OPCODE_CONFIG_MODEL_APP_UNBIND_NO_HEAD
+0x40 MESH_MESSAGE_OPCODE_CONFIG_NETKEY_ADD_NO_HEAD
+0x41 MESH_MESSAGE_OPCODE_CONFIG_NETKEY_DELETE_NO_HEAD
+0x42 MESH_MESSAGE_OPCODE_CONFIG_NETKEY_GET_NO_HEAD
+0x43 MESH_MESSAGE_OPCODE_CONFIG_NETKEY_LIST_NO_HEAD
+0x44 MESH_MESSAGE_OPCODE_CONFIG_NETKEY_STATUS_NO_HEAD
+0x45 MESH_MESSAGE_OPCODE_CONFIG_NETKEY_UPDATE_NO_HEAD
+0x46 MESH_MESSAGE_OPCODE_CONFIG_NODE_IDENTITY_GET_NO_HEAD
+0x47 MESH_MESSAGE_OPCODE_CONFIG_NODE_IDENTITY_SET_NO_HEAD
+0x48 MESH_MESSAGE_OPCODE_CONFIG_NODE_IDENTITY_STATUS_NO_HEAD
+0x49 MESH_MESSAGE_OPCODE_CONFIG_NODE_RESET_NO_HEAD
+0x4A MESH_MESSAGE_OPCODE_CONFIG_NODE_RESET_STATUS_NO_HEAD
+0x4B MESH_MESSAGE_OPCODE_CONFIG_SIG_MODEL_APP_GET_NO_HEAD
+0x4C MESH_MESSAGE_OPCODE_CONFIG_SIG_MODEL_APP_LIST_NO_HEAD
+0x4D MESH_MESSAGE_OPCODE_CONFIG_VENDOR_MODEL_APP_GET_NO_HEAD
+0x4E MESH_MESSAGE_OPCODE_CONFIG_VENDOR_MODEL_APP_LIST_NO_HEAD
+)
+
+(//Modle message opcode
+0x82 MESH_MODULE_MESSAGE_OPCODE_HEADER
+
+0x01 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONOFF_GET_NO_HEAD
+0x02 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONOFF_SET_NO_HEAD
+0x03 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONOFF_SET_UNACKNOWLEDGED_NO_HEAD
+0x04 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONOFF_STATUS_NO_HEAD
+0x05 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LEVEL_GET_NO_HEAD
+0x06 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LEVEL_SET_NO_HEAD
+0x07 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LEVEL_SET_UNACKNOWLEDGED_NO_HEAD
+0x08 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LEVEL_STATUS_NO_HEAD
+0x09 MESH_MODULE_MESSAGE_OPCODE_GENERIC_DELTA_SET_NO_HEAD
+0x0A MESH_MODULE_MESSAGE_OPCODE_GENERIC_DELTA_SET_UNACKNOWLEDGED_NO_HEAD
+0x0B MESH_MODULE_MESSAGE_OPCODE_GENERIC_MOVE_SET_NO_HEAD
+0x0C MESH_MODULE_MESSAGE_OPCODE_GENERIC_MOVE_SET_UNACKNOWLEDGED_NO_HEAD
+0x0D MESH_MODULE_MESSAGE_OPCODE_GENERIC_DEFAULT_TRANSITION_TIME_GET_NO_HEAD
+0x0E MESH_MODULE_MESSAGE_OPCODE_GENERIC_DEFAULT_TRANSITION_TIME_SET_NO_HEAD
+0x0F MESH_MODULE_MESSAGE_OPCODE_GENERIC_DEFAULT_TRANSITION_TIME_SET_UNACKNOWLEDGED_NO_HEAD
+0x10 MESH_MODULE_MESSAGE_OPCODE_GENERIC_DEFAULT_TRANSITION_TIME_STATUS_NO_HEAD
+0x11 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONPOWERUP_GET_NO_HEAD
+0x12 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONPOWERUP_STATUS_NO_HEAD
+0x13 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONPOWERUP_SET_NO_HEAD
+0x14 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONPOWERUP_SET_UNACKNOWLEDGED_NO_HEAD
+0x15 MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_LEVEL_GET_NO_HEAD
+0x16 MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_LEVEL_SET_NO_HEAD
+0x17 MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_LEVEL_SET_UNACKNOWLEDGED_NO_HEAD
+0x18 MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_LEVEL_STATUS_NO_HEAD
+0x19 MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_LAST_GET_NO_HEAD
+0x1A MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_LAST_STATUS_NO_HEAD
+0x1B MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_DEFAULT_GET_NO_HEAD
+0x1C MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_DEFAULT_STATUS_NO_HEAD
+0x1D MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_RANGE_GET_NO_HEAD
+0x1E MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_RANGE_STATUS_NO_HEAD
+0x1F MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_DEFAULT_SET_NO_HEAD
+0x20 MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_DEFAULT_SET_UNACKNOWLEDGED_NO_HEAD
+0x21 MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_RANGE_SET_NO_HEAD
+0x22 MESH_MODULE_MESSAGE_OPCODE_GENERIC_POWER_RANGE_SET_UNACKNOWLEDGED_NO_HEAD
+0x23 MESH_MODULE_MESSAGE_OPCODE_GENERIC_BATTERY_GET_NO_HEAD
+0x24 MESH_MODULE_MESSAGE_OPCODE_GENERIC_BATTERY_STATUS_NO_HEAD
+0x25 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LOCATION_GLOBAL_GET_NO_HEAD
+0x40 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LOCATION_GLOBAL_STATUS
+0x26 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LOCATION_LOCAL_GET_NO_HEAD
+0x27 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LOCATION_LOCAL_STATUS_NO_HEAD
+0x41 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LOCATION_GLOBAL_SET
+0x42 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LOCATION_GLOBAL_SET_UNACKNOWLEDGED
+0x28 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LOCATION_LOCAL_SET_NO_HEAD
+0x29 MESH_MODULE_MESSAGE_OPCODE_GENERIC_LOCATION_LOCAL_SET_UNACKNOWLEDGED_NO_HEAD
+0x2A MESH_MODULE_MESSAGE_OPCODE_GENERIC_MANUFACTURER_PROPERTIES_GET_NO_HEAD
+0x43 MESH_MODULE_MESSAGE_OPCODE_GENERIC_MANUFACTURER_PROPERTIES_STATUS
+0x2B MESH_MODULE_MESSAGE_OPCODE_GENERIC_MANUFACTURER_PROPERTY_GET_NO_HEAD
+0x44 MESH_MODULE_MESSAGE_OPCODE_GENERIC_MANUFACTURER_PROPERTY_SET
+0x45 MESH_MODULE_MESSAGE_OPCODE_GENERIC_MANUFACTURER_PROPERTY_SET_UNACKNOWLEDGED
+0x46 MESH_MODULE_MESSAGE_OPCODE_GENERIC_MANUFACTURER_PROPERTY_STATUS
+0x2C MESH_MODULE_MESSAGE_OPCODE_GENERIC_ADMIN_PROPERTIES_GET_NO_HEAD
+0x47 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ADMIN_PROPERTIES_STATUS
+0x2D MESH_MODULE_MESSAGE_OPCODE_GENERIC_ADMIN_PROPERTY_GET_NO_HEAD
+0x48 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ADMIN_PROPERTY_SET
+0x49 MESH_MODULE_MESSAGE_OPCODE_GENERIC_ADMIN_PROPERTY_SET_UNACKNOWLEDGED
+0x4A MESH_MODULE_MESSAGE_OPCODE_GENERIC_ADMIN_PROPERTY_STATUS
+0x2E MESH_MODULE_MESSAGE_OPCODE_GENERIC_USER_PROPERTIES_GET_NO_HEAD
+0x4B MESH_MODULE_MESSAGE_OPCODE_GENERIC_USER_PROPERTIES_STATUS
+0x2F MESH_MODULE_MESSAGE_OPCODE_GENERIC_USER_PROPERTY_GET_NO_HEAD
+0x4C MESH_MODULE_MESSAGE_OPCODE_GENERIC_USER_PROPERTY_SET
+0x4D MESH_MODULE_MESSAGE_OPCODE_GENERIC_USER_PROPERTY_SET_UNACKNOWLEDGED
+0x4E MESH_MODULE_MESSAGE_OPCODE_GENERIC_USER_PROPERTY_STATUS
+0x4F MESH_MODULE_MESSAGE_OPCODE_GENERIC_CLIENT_PROPERTIES_GET
+0x50 MESH_MODULE_MESSAGE_OPCODE_GENERIC_CLIENT_PROPERTIES_STATUS
+0x30 MESH_MODULE_MESSAGE_OPCODE_SENSOR_DESCRIPTOR_GET_NO_HEAD
+0x51 MESH_MODULE_MESSAGE_OPCODE_SENSOR_DESCRIPTOR_STATUS
+0x31 MESH_MODULE_MESSAGE_OPCODE_SENSOR_GET_NO_HEAD
+0x52 MESH_MODULE_MESSAGE_OPCODE_SENSOR_STATUS
+0x32 MESH_MODULE_MESSAGE_OPCODE_SENSOR_COLUMN_GET_NO_HEAD
+0x53 MESH_MODULE_MESSAGE_OPCODE_SENSOR_COLUMN_STATUS
+0x33 MESH_MODULE_MESSAGE_OPCODE_SENSOR_SERIES_GET_NO_HEAD
+0x54 MESH_MODULE_MESSAGE_OPCODE_SENSOR_SERIES_STATUS
+0x34 MESH_MODULE_MESSAGE_OPCODE_SENSOR_CADENCE_GET_NO_HEAD
+0x55 MESH_MODULE_MESSAGE_OPCODE_SENSOR_CADENCE_SET
+0x56 MESH_MODULE_MESSAGE_OPCODE_SENSOR_CADENCE_SET_UNACKNOWLEDGED
+0x57 MESH_MODULE_MESSAGE_OPCODE_SENSOR_CADENCE_STATUS
+0x35 MESH_MODULE_MESSAGE_OPCODE_SENSOR_SETTINGS_GET_NO_HEAD
+0x58 MESH_MODULE_MESSAGE_OPCODE_SENSOR_SETTINGS_STATUS
+0x36 MESH_MODULE_MESSAGE_OPCODE_SENSOR_SETTING_GET_NO_HEAD
+0x59 MESH_MODULE_MESSAGE_OPCODE_SENSOR_SETTING_SET
+0x5A MESH_MODULE_MESSAGE_OPCODE_SENSOR_SETTING_SET_UNACKNOWLEDGED
+0x5B MESH_MODULE_MESSAGE_OPCODE_SENSOR_SETTING_STATUS
+0x37 MESH_MODULE_MESSAGE_OPCODE_TIME_GET_NO_HEAD
+0x5C MESH_MODULE_MESSAGE_OPCODE_TIME_SET
+0x5D MESH_MODULE_MESSAGE_OPCODE_TIME_STATUS
+0x38 MESH_MODULE_MESSAGE_OPCODE_TIME_ROLE_GET_NO_HEAD
+0x39 MESH_MODULE_MESSAGE_OPCODE_TIME_ROLE_SET_NO_HEAD
+0x3A MESH_MODULE_MESSAGE_OPCODE_TIME_ROLE_STATUS_NO_HEAD
+0x3B MESH_MODULE_MESSAGE_OPCODE_TIME_ZONE_GET_NO_HEAD
+0x3C MESH_MODULE_MESSAGE_OPCODE_TIME_ZONE_SET_NO_HEAD
+0x3D MESH_MODULE_MESSAGE_OPCODE_TIME_ZONE_STATUS_NO_HEAD
+0x3E MESH_MODULE_MESSAGE_OPCODE_TAI_UTC_DELTA_GET_NO_HEAD
+0x3F MESH_MODULE_MESSAGE_OPCODE_TAI_UTC_DELTA_SET_NO_HEAD
+0x40 MESH_MODULE_MESSAGE_OPCODE_TAI_UTC_DELTA_STATUS_NO_HEAD
+0x41 MESH_MODULE_MESSAGE_OPCODE_SCENE_GET_NO_HEAD
+0x42 MESH_MODULE_MESSAGE_OPCODE_SCENE_RECALL_NO_HEAD
+0x43 MESH_MODULE_MESSAGE_OPCODE_SCENE_RECALL_UNACKNOWLEDGED_NO_HEAD
+0x5E MESH_MODULE_MESSAGE_OPCODE_SCENE_STATUS
+0x44 MESH_MODULE_MESSAGE_OPCODE_SCENE_REGISTER_GET_NO_HEAD
+0x45 MESH_MODULE_MESSAGE_OPCODE_SCENE_REGISTER_STATUS_NO_HEAD
+0x46 MESH_MODULE_MESSAGE_OPCODE_SCENE_STORE_NO_HEAD
+0x47 MESH_MODULE_MESSAGE_OPCODE_SCENE_STORE_UNACKNOWLEDGED_NO_HEAD
+0x9E MESH_MODULE_MESSAGE_OPCODE_SCENE_DELETE_NO_HEAD
+0x9F MESH_MODULE_MESSAGE_OPCODE_SCENE_DELETE_UNACKNOWLEDGED_NO_HEAD
+0x48 MESH_MODULE_MESSAGE_OPCODE_SCHEDULER_ACTION_GET_NO_HEAD
+0x5F MESH_MODULE_MESSAGE_OPCODE_SCHEDULER_ACTION_STATUS
+0x49 MESH_MODULE_MESSAGE_OPCODE_SCHEDULER_GET_NO_HEAD
+0x4A MESH_MODULE_MESSAGE_OPCODE_SCHEDULER_STATUS_NO_HEAD
+0x60 MESH_MODULE_MESSAGE_OPCODE_SCHEDULER_ACTION_SET
+0x61 MESH_MODULE_MESSAGE_OPCODE_SCHEDULER_ACTION_SET_UNACKNOWLEDGED
+0x4B MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_LIGHT_LIGHTNESS_GET_NO_HEAD
+0x4C MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_SET_NO_HEAD
+0x4D MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_SET_UNACKNOWLEDGED_NO_HEAD
+0x4E MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_STATUS_NO_HEAD
+0x4F MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_LINEAR_GET_NO_HEAD
+0x50 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_LINEAR_SET_NO_HEAD
+0x51 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_LINEAR_SET_UNACKNOWLEDGED_NO_HEAD
+0x52 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_LINEAR_STATUS_NO_HEAD
+0x53 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_LAST_GET_NO_HEAD
+0x54 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_LAST_STATUS_NO_HEAD
+0x55 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_DEFAULT_GET_NO_HEAD
+0x56 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_DEFAULT_STATUS_NO_HEAD
+0x57 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_RANGE_GET_NO_HEAD
+0x58 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_RANGE_STATUS_NO_HEAD
+0x59 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_DEFAULT_SET_NO_HEAD
+0x5A MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_DEFAULT_SET_UNACKNOWLEDGED_NO_HEAD
+0x5B MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_RANGE_SET_NO_HEAD
+0x5C MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_RANGE_SET_UNACKNOWLEDGED_NO_HEAD
+0x5D MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_GET_NO_HEAD
+0x5E MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_SET_NO_HEAD
+0x5F MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_SET_UNACKNOWLEDGED_NO_HEAD
+0x60 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_STATUS_NO_HEAD
+0x61 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_TEMPERATURE_GET_NO_HEAD
+0x62 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_TEMPERATURE_RANGE_GET_NO_HEAD
+0x63 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_TEMPERATURE_RANGE_STATUS_NO_HEAD
+0x64 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_TEMPERATURE_SET_NO_HEAD
+0x65 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_TEMPERATURE_SET_UNACKNOWLEDGED_NO_HEAD
+0x66 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_TEMPERATURE_STATUS_NO_HEAD
+0x67 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_DEFAULT_GET_NO_HEAD
+0x68 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_DEFAULT_STATUS_NO_HEAD
+0x69 MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_DEFAULT_SET_NO_HEAD
+0x6A MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_DEFAULT_SET_UNACKNOWLEDGED_NO_HEAD
+0x6B MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_TEMPERATURE_RANGE_SET_NO_HEAD
+0x6C MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_TEMPERATURE_RANGE_SET_UNACKNOWLEDGED_NO_HEAD
+0x6D MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_GET_NO_HEAD
+0x6E MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_HUE_GET_NO_HEAD
+0x6F MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_HUE_SET_NO_HEAD
+0x70 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_HUE_SET_UNACKNOWLEDGED_NO_HEAD
+0x71 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_HUE_STATUS_NO_HEAD
+0x72 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_SATURATION_GET_NO_HEAD
+0x73 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_SATURATION_SET_NO_HEAD
+0x74 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_SATURATION_SET_UNACKNOWLEDGED_NO_HEAD
+0x75 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_SATURATION_STATUS_NO_HEAD
+0x76 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_SET_NO_HEAD
+0x77 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_SET_UNACKNOWLEDGED_NO_HEAD
+0x78 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_STATUS_NO_HEAD
+0x79 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_TARGET_GET_NO_HEAD
+0x7A MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_TARGET_STATUS_NO_HEAD
+0x7B MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_DEFAULT_GET_NO_HEAD
+0x7C MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_DEFAULT_STATUS_NO_HEAD
+0x7D MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_RANGE_GET_NO_HEAD
+0x7E MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_RANGE_STATUS_NO_HEAD
+0x7F MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_DEFAULT_SET_NO_HEAD
+0x80 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_DEFAULT_SET_UNACKNOWLEDGED_NO_HEAD
+0x81 MESH_MODULE_MESSAGE_OPCODE_LIGHT_HSL_RANGE_SET_NO_HEAD
+0x83 MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_GET_NO_HEAD
+0x84 MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_SET_NO_HEAD
+0x85 MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_SET_UNACKNOWLEDGED_NO_HEAD
+0x86 MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_STATUS_NO_HEAD
+0x87 MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_TARGET_GET_NO_HEAD
+0x88 MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_TARGET_STATUS_NO_HEAD
+0x89 MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_DEFAULT_GET_NO_HEAD
+0x8A MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_DEFAULT_STATUS_NO_HEAD
+0x8B MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_RANGE_GET_NO_HEAD
+0x8C MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_RANGE_STATUS_NO_HEAD
+0x8D MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_DEFAULT_SET_NO_HEAD
+0x8E MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_DEFAULT_SET_UNACKNOWLEDGED_NO_HEAD
+0x8F MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_RANGE_SET_NO_HEAD
+0x90 MESH_MODULE_MESSAGE_OPCODE_LIGHT_XYL_RANGE_SET_UNACKNOWLEDGED_NO_HEAD
+0x91 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_MODE_GET_NO_HEAD
+0x92 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_MODE_SET_NO_HEAD
+0x93 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_MODE_SET_UNACKNOWLEDGED_NO_HEAD
+0x94 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_MODE_STATUS_NO_HEAD
+0x95 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_OM_GET_NO_HEAD
+0x96 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_OM_SET_NO_HEAD
+0x97 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_OM_SET_UNACKNOWLEDGED_NO_HEAD
+0x98 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_OM_STATUS_NO_HEAD
+0x99 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_LIGHT_ONOFF_GET_NO_HEAD
+0x9A MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_LIGHT_ONOFF_SET_NO_HEAD
+0x9B MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_LIGHT_ONOFF_SET_UNACKNOWLEDGED_NO_HEAD
+0x9C MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_LIGHT_ONOFF_STATUS_NO_HEAD
+0x9D MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_PROPERTY_GET_NO_HEAD
+0x62 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_PROPERTY_SET
+0x63 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_PROPERTY_SET_UNACKNOWLEDGED
+0x64 MESH_MODULE_MESSAGE_OPCODE_LIGHT_LC_PROPERTY_STATUS)
+
+// status code
+(
+0x00 MESH_SUCCESS
+0x01 MESH_INVALID_ADDRESS
+0x02 MESH_INVALID_MODEL
+0x03 MESH_INVALID_APPKEYINDEX
+0x04 MESH_INVALID_NETKEYINDEX
+0x05 MESH_INSUFFICIENT_RESOURCES
+0x06 MESH_KEYINDEX_ALREAD_STORED
+0x07 MESH_INVALID_PUBLISH_PARAMETERS
+0x08 MESH_NOT_A_SUBSCRIBE_MODEL
+0x09 MESH_STORAGE_FAILURE
+0x0a MESH_FEATURE_NOT_SUPPORTED
+0x0b MESH_CANNOT_UPDATE
+0x0c MESH_CANNOT_REMOVE
+0x0d MESH_CANNOT_BIND
+0x0e MESH_TEMPORARILY_UNABLE_TO_CHANGE_STATE
+0x0f MESH_CANNOT_SET
+0x10 MESH_UNSPECIFIED_ERROR
+0x11 MESH_INVALID_BINDING
+)
+
Index: format/mesh_protocol_stack/mesh_ali_vendor_message.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_ali_vendor_message.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_ali_vendor_message.format	(working copy)
@@ -0,0 +1,149 @@
+
+xmemalloc ali_mesh(
+	1 mem_mesh_vendor_mesh_receive_tid
+	1 mem_mesh_vendor_mesh_send_tid
+
+	4 mem_mesh_vendor_timer_current_time
+	4 mem_system_time
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	2 mem_mesh_vendor_message_cid
+	1 mem_mesh_vendor_message_tid
+	2 mem_mesh_vendor_message_attr_type
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_header
+	0 mem_mesh_vendor_attr_parameter
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_delay_close_time_header
+	2 mem_mesh_vendor_delay_close_time
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_night_light_onoff_header
+	1 mem_mesh_vendor_night_light_onoff
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_color_header
+	2 mem_mesh_vendor_color_lightness
+	2 mem_mesh_vendor_color_hue
+	2 mem_mesh_vendor_color_saturation
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_back_light_onoff_header
+	1 mem_mesh_vendor_back_light_onoff
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_main_light_onoff_header
+	1 mem_mesh_vendor_main_light_onoff
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_standby_brightness_header
+	2 mem_mesh_vendor_standby_brightness
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_current_time_header
+	4 mem_mesh_vendor_message_current_time
+)
+
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_timer_header
+	1 mem_mesh_vendor_timer_timing_index
+	0 mem_mesh_vendor_timer_timing_index1
+	4 mem_mesh_vendor_timer_timing_time
+	2 mem_mesh_vendor_timer_timing_attr_type
+	1 mem_mesh_vendor_timer_timing_attr_para
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	5 mem_mesh_vendor_message_timer_cyclic_header
+	1 mem_mesh_vendor_timer_timing_index_cyclic
+	2 mem_mesh_vendor_timer_timing_time_cyclic
+	1 mem_mesh_vendor_timer_timing_weekdays_cyclic
+	2 mem_mesh_vendor_timer_timing_attr_type_cyclic
+	1 mem_mesh_vendor_timer_timing_attr_para_cyclic
+	1 mem_mesh_vendor_timer_timing_cyclic_flag
+)
+
+amemalloc mem_mesh_access_layer_payload(
+	//ali mesh vendor struct
+	1 mem_mesh_access_layer_payload_vendor_command
+	2 mem_mesh_access_layer_payload_vendor_CID
+	1 mem_mesh_access_layer_payload_vendor_tid
+	2 mem_mesh_access_layer_payload_vendor_attr_type
+	1 mem_mesh_access_layer_payload_vendor_attr_parameter
+)
+
+
+(
+0x00F0 VENDOR_MESSAGE_TMALL_DST
+)
+
+(// vendor model attribute
+0x0123 VENDOR_ATTR_COLOR_SERVER
+0x0100 VENDOR_ATTR_GENERIC_ONOFF_SERVER
+0x0121 VENDOR_ATTR_LIGHTNESS_LEVEL_SERVER
+0x0122 VENDOR_ATTR_COLOR_TEMPERATURE_SERVER
+0x0534 VENDOR_ATTR_MAIN_LIGHT_SERVER
+0x0533 VENDOR_ATTR_BACKGROUND_LIGHT_ONOFF_SERVER
+0xf004 VENDOR_ATTR_SCENE_SERVER
+)
+
+(//Timer opcode
+0x01A8 VENDOR_MESSAGE_OPCODE_COMPANY_ID
+//时间
+0xF01F VENDOR_MESSAGE_ATTR_TYPE_TIME
+//时区
+0xF01E VENDOR_MESSAGE_ATTR_TYPE_TIME_ZONE
+//对时
+0xF01D VENDOR_MESSAGE_ATTR_TYPE_ON_TIME
+//定时
+0xF010 VENDOR_MESSAGE_ATTR_TYPE_TIMING
+//周期定时
+0xF011 VENDOR_MESSAGE_ATTR_TYPE_CYCLE_TIMING
+//删除定时
+0xF012 VENDOR_MESSAGE_ATTR_TYPE_DELETE_TIMING
+
+//颜色
+0x0123 VENDOR_MESSAGE_ATTR_TYPE_COLOR
+//主灯
+0x0534 VENDOR_MESSAGE_ATTR_TYPE_MAIN_LIGHT
+//背光灯
+0x0533 VENDOR_MESSAGE_ATTR_TYPE_BACKGROUND_LIGHT
+)
+
+(//天猫event事件表
+//设备发生的事件，比如上电或者定时完成
+0xF009 VENDOR_ATTR_TYPE_EVENT_TRIGGER
+
+//天猫设备上电
+0x03 VENDOR_MESSAGE_EVENT_DEVICE_POWER_ON
+//天猫定时完成
+0x11 VENDOR_MESSAGE_EVENT_FINISH_TIMING
+)
+
+(
+0x80 VENDOR_MESSAGE_SEND_TID_MIN
+0xC0 VENDOR_MESSAGE_SEND_TID_MAX
+)
+
+(
+0x59 TIMER_CYCLICAL_FALG
+60 SECONDS_OF_MIN
+345600 SECONDS_OF_FOUR_DAYS
+604800 SECONDS_OF_WEEK
+86400 SECONDS_OF_DAY
+0x01e0 EIGHT_HOURS_TIME_ZONE_OFFSET
+
+)
+
Index: format/mesh_protocol_stack/mesh_bearer_layer.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_bearer_layer.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_bearer_layer.format	(working copy)
@@ -0,0 +1,10 @@
+
+memalloc ali_mesh(
+	0 mem_mesh_queue_ele_temp
+	1 mem_mesh_queue_ele_duration
+	1 mem_mesh_queue_ele_gatt_msg_id
+	1 mem_mesh_queue_ele_len
+	31 mem_mesh_queue_ele_payload
+	1 mem_mesh_queue_ele_padding
+)
+
Index: format/mesh_protocol_stack/mesh_ble_core_advertising.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_ble_core_advertising.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_ble_core_advertising.format	(working copy)
@@ -0,0 +1,26 @@
+
+memalloc ali_mesh(
+	39 mem_le_txheader_mesh_temp
+	
+)
+
+xmemalloc ali_mesh(
+
+	
+	1 mem_mesh_adv_data_len
+	31 mem_mesh_adv_data
+
+	1 mem_mesh_adv_scan_channel
+)
+
+
+(
+6 ADV_PACKET_MIN_LENGTH
+37 ADV_PACKET_MAX_LENGTH
+
+1 AD_TYPE_MIN_LENGTH
+30 AD_TYPE_MAX_LENGTH
+)
+
+
+
Index: format/mesh_protocol_stack/mesh_chip_peripherals.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_chip_peripherals.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_chip_peripherals.format	(working copy)
@@ -0,0 +1,34 @@
+
+
+amemalloc mem_temp_block0(
+	64 mem_mesh_subscription_eep_temp
+)
+
+(//transport mic cache parameter
+10 TRANSPORT_MIC_CACHE_SPACE_NUM
+4 TRANSPORT_MIC_CACHE_SPACE_SIZE
+//总长度少一个space
+36 TRANSPORT_MIC_CACHE_TOTAL_SIZE
+)
+
+(
+0x00 MESH_EEP_THREE_TUPLE_OFFSET
+0x1a MESH_EEP_NETWORK_KEY_OFFSET
+0x2d MESH_EEP_APPLICATION_KEY_OFFSET
+0x3d MESH_EEP_DEVICE_KEY_OFFSET
+0x4d MESH_EEP_RESET_COUNT_OFFSET
+0x4e MESH_EEP_SEQ_OFFSET
+0x51 MESH_EEP_SUBSCRIPTION_OFFSET
+)
+
+(
+0x1a MESH_EEP_THREE_TUPLE_LENGTH
+0x13 MESH_EEP_NETWORK_KEY_LENGTH
+0x10 MESH_EEP_APPLICATION_KEY_LENGTH
+0x10 MESH_EEP_DEVICE_KEY_LENGTH
+0x01 MESH_EEP_RESET_COUNT_LENGTH
+0x03 MESH_EEP_SEQ_LENGTH
+0x10 MESH_EEP_SUBSCRIPTION_LENGTH
+0x40 MESH_EEP_SUBSCRIPTION_TOTAL_LENGTH
+)
+
Index: format/mesh_protocol_stack/mesh_control_ble_advertising.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_control_ble_advertising.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_control_ble_advertising.format	(working copy)
@@ -0,0 +1,57 @@
+
+
+xmemalloc ali_mesh(
+	1 mem_mesh_advertising_unprovisioned_device_beacon_switch
+	//未配网广播间隔
+	2 mem_mesh_advertising_unprovisioned_device_beacon_timer
+
+	//广播生存周期
+	1 mem_mesh_advertising_unprovisioned_device_beacon_duration
+	//广播周期之间的间隔
+	1 mem_mesh_advertising_unprovisioned_device_beacon_interval
+
+)
+
+(//mem_mesh_advertising_unprovisioned_device_beacon_switch
+0 DEVICE_BEACON_OFF
+1 DEVICE_BEACON_ON
+)
+
+(
+//未配网广播超时10min
+0x1770	ADV_UNPROVISIONED_DEVICE_BEACON_TIMEOUT
+//未配网广播间隔500ms
+5		ADV_UNPROVISIONED_DEVICE_BEACON_INTERVAL
+//未配网广播时长120ms=20ms*6
+6		ADV_UNPROVISIONED_DEVICE_BEACON_DURATION
+
+//静默广播超时:无
+0		ADV_SILENCE_DEVICE_BEACON_TIMEOUT
+//静默广播间隔60s
+600		ADV_SILENCE_DEVICE_BEACON_INTERVAL
+//静默广播时长120ms=20ms*6
+6		ADV_SILENCE_DEVICE_BEACON_DURATION
+
+
+//配网后广播间隔
+0x54		ADV_PAIRING_MESH_MESSAGE_INTERVAL
+//配网后广播时长
+20		ADV_PAIRING_MESH_MESSAGE_DURATION
+
+10		ADV_RELAY_MESH_MESSAGE_DURATION
+)
+
+(
+0x12 MAX_APP_MSSAGE_PAYLOAD_LENGTH
+7 BIT_OF_APP_PACKAGE_NUM
+6 BIT_OF_ADV_IN_OFF
+)
+
+(
+//mesh 回复APP广播间隔24*0.625ms = 15ms
+0x15 MESH_ADV_APP_MESSAGE_INTERVAL
+//mesh回复tmall广播间隔32*0.625ms = 20ms
+0x1d MESH_ADV_TMALL_MESSAGE_INTERVAL
+)
+
+
Index: format/mesh_protocol_stack/mesh_encrypt_function.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_encrypt_function.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_encrypt_function.format	(working copy)
@@ -0,0 +1,105 @@
+memalloc ali_mesh(
+	// sha256
+	0 mem_mesh_sha256_chunk_start
+	64 mem_mesh_sha256_chunk1
+	64 mem_mesh_sha256_chunk2
+	64 mem_mesh_sha256_chunk3
+	64 mem_mesh_sha256_chunk4
+
+	//obfuscation network PDU Header
+	0 mem_mesh_Privacy_Plaintext
+	5 mem_mesh_Privacy_Plaintext_Zero_String
+	4 mem_mesh_Privacy_Plaintext_IV_Index
+	0 mem_mesh_Privacy_Plaintext_Privacy_Random
+	2 mem_mesh_Privacy_Plaintext_Privacy_Random_EncDST
+	5 mem_mesh_Privacy_Plaintext_Privacy_Random_EncTransportPDU_or_NetMIC
+	16 mem_mesh_PECB
+
+	//basic function
+	//aes-ccm
+	2 mem_nonce_ptr
+	1 mem_ccm_data_len
+	2 mem_ccm_data_ptr
+	8 mem_ccm_mic
+	1 mem_ccm_type
+
+
+)
+
+xmemalloc ali_mesh(
+
+	0 mem_mesh_calc_ConfirmationCloud_data
+	8 mem_mesh_ConfirmationCloud_RandomB
+	8 mem_mesh_ConfirmationCloud_RandomA
+	16 mem_mesh_AuthValueProv
+	16 mem_mesh_ConfirmationCloud
+
+
+	//provisioning random  / provisioning_confirmation
+	0 mem_mesh_ConfirmationDevice
+	0 mem_mesh_calc_ConfirmationDevice_data
+	8 mem_mesh_provisioning_random_A
+	8 mem_mesh_provisioning_random_B
+	16 mem_mesh_AuthValueDevice
+
+	16 mem_mesh_Device_Key
+
+
+// CMAC Key
+	16 mem_mesh_Confirmationkey
+
+	//sha256 init data
+	15 mem_mesh_sha256_ConfirmationKey_ascii
+	10 mem_mesh_sha256_SessionKey_ascii
+	9 mem_mesh_sha256_DeviceKey_ascii
+
+	//sha256
+	1 mem_mesh_sha256_load_first_data_flag
+
+	8 mem_mesh_sha256_data_len_byte
+	8 mem_mesh_sha256_data_len_bit
+	2 mem_mesh_sha256_data_end_addr
+	2 mem_mesh_sha256_data_len_addr
+	1 mem_mesh_sha256_chunk_count
+	2 mem_mesh_sha256_chunk_data_ptr
+	2 mem_mesh_sha256_chunk_ptr
+
+
+	//function K2
+	//f2 input
+	1 mem_k2_P_len
+	16 mem_k2_P
+	16 mem_k2_N
+	//f2 init data
+	16 mem_k2_SALT
+	//f2 output
+	16 mem_k2_T
+	0 mem_k2_T0
+	16 mem_k2_T1
+	1 mem_k2_NID
+	16 mem_k2_T3
+	16 mem_k2_T2
+
+
+	//k4 function
+	16 mem_k4_SALT
+	16 mem_k4_T
+	16 mem_k4_id6_01
+	16 mem_k4_k4N
+	1 mem_mesh_transport_AID
+
+
+)
+
+(
+0x2c COMMA
+-4 DECREASED_FOUR
+
+)
+
+(
+0x19 MIC_SIZE_64BIT
+0x09 MIC_SIZE_32BIT
+)
+
+
Index: format/mesh_protocol_stack/mesh_fast_pairing.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_fast_pairing.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_fast_pairing.format	(working copy)
@@ -0,0 +1,180 @@
+memalloc ali_mesh(
+
+	16 mem_mesh_Device_UUID
+	
+	1 mem_mesh_receive_VID
+
+)
+
+
+xmemalloc ali_mesh(
+
+	// provisioning flag 标志是否入网
+	1 mem_mesh_provisioned_flag
+
+	//入网时的状态机
+	1 mem_mesh_Provisioning_State_Flag
+	
+	1 mem_mesh_Device_PID
+	1 mem_mesh_UUID_FeatureFlag
+	2 mem_mesh_PDU_RFU
+	2 mem_mesh_OOB_information
+
+	//Provisioning_Data
+	0 mem_mesh_Encrypt_Provisioning_Data
+	2 mem_mesh_provisioning_data_Mac_addr
+	1 mem_mesh_KeyFresh_and_Update_flag
+	16 mem_mesh_Network_Key
+	1 mem_mesh_last_IV_Index_byte
+	2 mem_mesh_Unicast_Address
+
+	4 mem_mesh_adv_last_time
+	2 mem_mesh_send_packet_timeout
+
+	1 mem_mesh_gatt_package_send_msg_id
+
+)
+
+
+(
+33 GATT_RECEIVE_MSG_BUFFER_SIZE
+)
+
+xmemalloc ali_mesh(
+//GATT 协议
+	1 mem_mesh_gatt_receive_msg_timer
+	//fast pairing 
+	//APP control 
+
+	GATT_RECEIVE_MSG_BUFFER_SIZE mem_mesh_gatt_packet_receive_msg_buffer1
+	GATT_RECEIVE_MSG_BUFFER_SIZE mem_mesh_gatt_packet_receive_msg_buffer2
+
+)
+
+amemalloc mem_mesh_queue_ele_temp(
+	2 mem_mesh_gatt_package_receive_msg_buffer_ptr
+	0 mem_mesh_gatt_package_receive_msg_buffer_temp
+	2 mem_mesh_gatt_package_receive_msg_id
+	0 mem_mesh_gatt_package_receive_MAC
+	1 mem_mesh_gatt_package_receive_msg_num
+	1 mem_mesh_gatt_package_receive_msg_total_length
+	29 mem_mesh_gatt_package_receive_msg_payload
+)
+
+amemalloc mem_mesh_Device_UUID(
+	2 mem_mesh_receive_service_uuid_company_id
+	1 mem_mesh_receive_service_uuid_vid
+	1 mem_mesh_receive_service_uuid_provisioning_type
+	2 mem_mesh_receive_service_uuid_mac
+	1 mem_mesh_receive_service_uuid_msg_id
+	1 mem_mesh_receive_service_uuid_package_num
+	1 mem_mesh_receive_service_uuid_length
+	7 mem_mesh_receive_service_uuid_payload_data
+)
+
+amemalloc mem_mesh_Device_UUID(
+	2 mem_mesh_receive_service_uuid_ios_data_company_id
+	1 mem_mesh_receive_service_uuid_ios_data_vid
+	1 mem_mesh_receive_service_uuid_ios_data_provisioning_type
+	1 mem_mesh_receive_service_uuid_ios_data_NID
+	1 mem_mesh_receive_service_uuid_ios_data_msg_id
+	1 mem_mesh_receive_service_uuid_ios_data_package_num
+	1 mem_mesh_receive_service_uuid_ios_data_length
+	8 mem_mesh_receive_service_uuid_ios_data_payload_data
+)
+
+
+(//mem_mesh_provisioned_flag
+0 PAIRED_STATUS
+1 UNPROVISIONED_BEACON_STATUS
+2 PAIRING_STATUS
+3 SILENCE_BEACON_STATUS
+4 RECEIVED_CONFIG_APPKEY_ADD
+)
+
+(//mem_mesh_UUID_FeatureFlag
+0 BIT_SILENCE_ADV_FLAG
+)
+
+//mem Beacon Tmall Length
+(
+0x01 UNPROVISIONED_ADLEN_LENGTH
+0x01 UNPROVISIONED_ADTYPE_LENGTH
+0x01 UNPROVISIONED_DEVICE_BEACON_LENGTH
+0x10 UNPROVISIONED_DEVICE_UUID_LENGTH
+0x02 UNPROVISIONED_OOB_INFORMATION_LENGTH
+)
+
+// mem Beacon Type
+(
+0x00 UNPROVISIONED_DEVICE_BEACON
+0x01 SECURE_NETWORK_BEACON
+0x1827 MESH_PROVISIONING_UUID
+)
+
+// Provisioning Type
+(
+0x00 PROVISIONING_RANDOM
+0x01 PROVISIONING_CONFIRMATION
+0x02 PROVISIONING_DATA
+0x03 PROVISIONING_COMPLETE
+0x04 PROVISIONING_CONFIG
+0x05 PROVISIONING_CONFIG_ACK
+0x06 PROVISIONING_IOS_DATA
+0x07 PROVISIONING_SEND_IOS_DATA
+)
+
+(//mem_mesh_Provisioning_State_Flag
+// FLAG bit1:Provisioning Confirmation
+1 RECEIVE_PROVISIONING_RANDOM
+2 RECEIVE_PROVISIONING_DATA
+)
+
+
+(//provisioning packet info size
+3 PROVISIONING_PACKET_LENGTH_FLAGS
+6 PROVISIONING_PACKET_LENGTH_AD_TYPE_COMPANY_ID_VID_PROVISIONING_TYPE
+5 PROVISIONING_PACKET_AD_TYPE_COMPANY_ID_VID_PROVISIONING_TYPE
+1 PROVISIONING_PACKET_LENGTH
+1 PROVISIONING_PACKET_AD_TYPE
+2 PROVISIONING_PACKET_COMPANY_ID
+1 PROVISIONING_PACKET_VID
+1 PROVISIONING_PACKET_PROVISIONING_TYPE
+//provisioning random
+2 PROVISIONING_PACKET_RANDOM_MAC
+8 PROVISIONING_PACKET_RANDOM_RANDOM_A
+8 PROVISIONING_PACKET_RANDOM_RANDOM_B
+//provisioning confirmation
+2 PROVISIONING_PACKET_CONFIRMATION_MAC
+16 PROVISIONING_PACKET_CONFIRMATION_DEVICE
+//provisioning complete
+6 PROVISIONING_PACKET_COMPLETE_MAC
+
+2 PROVISIONING_CONFIG_ACK_MAC
+1 PROVISIONING_CONFIG_ACK_FIELD
+
+)
+
+(
+0x01 PROVISIONING_CONFIG_ACK_NOTE
+)
+
+(//gatt package struct
+0 GATT_PACKAGE_MSG_ID
+1 GATT_PACKAGE_PACKAGE_NUM
+2 GATT_PACKAGE_LENGTH
+3 GATT_PACKAGE_PAYLOAD
+)
+
+(
+0x12 MAX_LENGTH_PRIVISIONING_CONTROL_MSG_ANDROID
+0x08 MAX_LENGTH_PRIVISIONING_CONTROL_MSG_IOS
+0x07 MAX_LENGTH_PRIVISIONING_PAIRING_MSG_IOS
+)
+
+(
+4 MAX_GATT_PACKAGE_NUM
+50 GATT_RECEIVE_TIMEOUT
+)
+
+
Index: format/mesh_protocol_stack/mesh_health_message.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_health_message.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_health_message.format	(working copy)
@@ -0,0 +1,16 @@
+
+amemalloc mem_mesh_receive_model_message_payload(
+	1 mem_mesh_configuration_health_message_opcode
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	1 mem_mesh_configuration_health_message_opcode_config_model_subscription
+	2 mem_mesh_subscription_element_address
+	2 mem_mesh_subscription_value_address
+	2 mem_mesh_subscription_model_identifier
+)
+
+(
+8 SUBSCRIPTION_MAX_COUNT
+)
+
Index: format/mesh_protocol_stack/mesh_init.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_init.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_init.format	(working copy)
@@ -0,0 +1,182 @@
+memalloc ali_mesh(
+	2 mem_mesh_mic_cache_ptr
+)
+
+
+xmemalloc ali_mesh(
+	// three tuple 阿里云平台分配的三元组
+	4 mem_mesh_three_tuple_ProductID
+	6 mem_mesh_three_tuple_MAC
+	16 mem_mesh_three_tuple_secret
+
+	//ble 核心协议栈，scan到数据的回调
+	2 mem_mesh_cb_receive_advertising
+
+	//alarm寄存器不能修改
+	//mesh核心规范接收到任何TMALL指令
+	2 mem_mesh_cb_receive_access_message
+
+	//接收到配置application key指令(可以认为入网成功)
+	2 mem_mesh_cb_receive_config_appkey_add
+
+	//各种原因配网失败回调
+	2 mem_mesh_cb_pairing_fail
+
+	2 mem_mesh_cb_generic_onoff_get
+	2 mem_mesh_cb_generic_onoff_set
+	2 mem_mesh_cb_scene_recall
+	2 mem_mesh_cb_light_lightness_set
+	2 mem_mesh_cb_light_lightness_get
+	2 mem_mesh_cb_light_ctl_set
+
+	2 mem_mesh_cb_main_light_onoff_set
+	2 mem_mesh_cb_background_onoff_set
+	2 mem_mesh_cb_color_set
+
+	//relay 的功能回调
+	2 mem_mesh_cb_network_relay
+
+	//模块复位的回调，需要3s之后复位
+	2 mem_mesh_cb_receive_node_reset
+
+	//seq改变时的回调，需要存到对应的存储器中
+	2 mem_mesh_cb_seq_changed
+
+	2 mem_mesh_cb_subscriptuion_list_changed
+
+	//Timer 定时器改变时，需要存到对应的存储器中
+	2 mem_mesh_cb_vendor_timing_changed
+	
+
+	2 mem_mesh_core_feature
+
+	1 mem_mesh_element_number
+	2 mem_mesh_element_device_ptr
+	2 mem_mesh_element_device_length
+
+)
+
+(//typedef struct of mem_mesh_element_device
+0 ELEMENT_DEVICE_GROUP_ADDR
+2 ELEMENT_DEVICE_QUEUE_BUFFER_PTR
+4 ELEMENT_DEVICE_VENDOR_TIME_PTR
+6 ELEMENT_DEVICE_SUBSCRIPTION_LABEL
+22 ELEMENT_DEVICE_UPPER_ADV_FLAG
+23 ELEMENT_DEVICE_UPPER_QUEUE_PTR
+25 ELEMENT_DEVICE_TRAN_PACKAGE_TID
+26 ELEMENT_DEVICE_TRAN_PACKAGE_TYPE
+27 SIZEOF_ELEMENT_DEVICE
+
+)
+
+
+xmemalloc ali_mesh_element(
+	0 mem_mesh_element_device
+	2 mem_mesh_element_device_group_addr
+	2 mem_mesh_element_device_queue_buffer_ptr
+	2 mem_mesh_element_device_timing_ptr
+	16 mem_mesh_element_device_element_subscription_label
+	1 mem_mesh_element_upper_adv_flag
+	2 mem_mesh_element_upper_queue_buffer_ptr
+	1 mem_mesh_element_tran_package_tid
+	1 mem_mesh_element_tran_package_type
+
+	SIZEOF_ELEMENT_DEVICE mem_mesh_element_device1
+	SIZEOF_ELEMENT_DEVICE mem_mesh_element_device2
+)
+
+xmemalloc ali_mesh_element(
+	1 mem_mesh_element_device_queue_each_size
+	1 mem_mesh_element_device_queue_length
+	1 mem_mesh_element_device_queue_current_num
+	1 mem_mesh_element_device_queue_read_ptr
+	1 mem_mesh_element_device_queue_write_ptr
+	136 mem_mesh_element_device_queue_ele
+
+	1 mem_mesh_element_device_upper_queue_each_size
+	1 mem_mesh_element_device_upper_queue_length
+	1 mem_mesh_element_device_upper_queue_current_num
+	1 mem_mesh_element_device_upper_queue_read_ptr
+	1 mem_mesh_element_device_upper_queue_write_ptr
+	//元素长度为47
+	188 mem_mesh_element_device_upper_queue_ele
+
+)
+
+(
+320 MESH_TIMER_BUFFER_SIZE
+)
+
+/*
+xmemalloc ali_mesh_element_timer(
+	MESH_TIMER_BUFFER_SIZE mem_mesh_element_timing
+	MESH_TIMER_BUFFER_SIZE mem_mesh_element_timing1
+	MESH_TIMER_BUFFER_SIZE mem_mesh_element_timing2
+)
+*/
+
+(//bit map of mem_mesh_core_feature
+0 MESH_FEATURE_LOG
+1 MESH_FEATURE_DISABLE_RELAY
+2 MESH_FEATURE_DISABLE_SUBSCRIPTION
+)
+
+(//taobao id
+0x01a8	COMPANY_IDENTIFIERS_ALIBABA
+0x0d	ALI_MESH_VID_NUMBER
+0x0da801 COMPANY_ID_ALIBABA_AND_VID
+0x0ea801 COMPANY_ID_ALIBABA_AND_VID_GATT
+)
+
+
+(
+0x00 MESH_CODE_INIT
+0x01 MESH_RECEIVE_PROVISIONING_PACKET
+0x02 MESH_RECEIVE_PROVISIONING_RANDOM_PACKET
+0x03 MESH_SEND_PROVISIONING_CONFIRMATION_PACKET
+0x04 MESH_RECEIVE_PROVISIONING_DATA_PACKET
+0x05 MESH_SEND_PROVISIONING_COMPLETE_PACKET
+0x06 MESH_RECEIVE_PROVISIONING_FAILED_PACKET
+
+0x10 MESH_ENCRYPT_SHA256_FUNCTION_INPUT
+0x11 MESH_ENCRYPT_SHA256_FUNCTION_RESULT
+0x12 MESH_ENCRYPT_AES_CMAC_FUNCTION_INPUT_M
+0x13 MESH_ENCRYPT_AES_CMAC_FUNCTION_INPUT_K
+0x14 MESH_ENCRYPT_AES_CMAC_FUNCTION_RESULT
+
+0x20 MESH_NETWORK_RECEIVE_PACKET
+0x21 MESH_NETWORK_RELAY_PACKET
+
+0x30 MESH_LOWER_RECEIVE_PACKET
+0x40 MESH_UPPER_RECEIVE_PACKET
+0x41 MESH_UPPER_SEND_PACKET
+
+0x50 MESH_ACCESS_RECEIVE_MESSAGE
+
+
+0xF0 MESH_MESSAGE_GENERIC_ONOFF_SET
+0xF1 MESH_MESSAGE_SET_LIGHT_LIGHTNESS
+0xF2 MESH_MESSAGE_SET_CTL
+)
+
+(//LUA LOG 
+0xAA LUA_LOG_PACKET_HEADER
+0x03 LUA_LOG_PAKCET_TYPE
+0xBB LUA_LOG_PACKET_TRAIL
+)
+
+(//logging level
+0 LOGGING_DEBUG
+1 LOGGING_INFO
+2 LOGGING_WARNING
+3 LOGGING_ERROR
+4 LOGGING_CRITICAL
+)
+
+(
+0x1c00 mem_mesh_uart_log_rx_buff
+0x1c01 mem_mesh_uart_log_rx_buff_end
+0x1c02 mem_mesh_uart_log_tx_buff
+0x1fff mem_mesh_uart_log_tx_buff_end
+)
+
Index: format/mesh_protocol_stack/mesh_lower_transport_layer.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_lower_transport_layer.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_lower_transport_layer.format	(working copy)
@@ -0,0 +1,51 @@
+memalloc ali_mesh(
+	1 mem_mesh_lower_transport_layer_payload_len
+
+)
+
+xmemalloc ali_mesh(
+	//current segmented access message head
+	1 mem_mesh_segmented_access_message_SZMIC
+	2 mem_mesh_segmented_access_message_SeqZero
+	1 mem_mesh_segmented_access_message_SegO
+	1 mem_mesh_segmented_access_message_SegN
+
+	4 mem_mesh_segmented_access_message_BlockAck
+	1 mem_mesh_segmented_access_message_receive_finish
+	1 mem_mesh_segmented_access_message_current_length
+
+
+	36 mem_mesh_segmented_access_message_Segment
+)
+
+amemalloc mem_mesh_send_access_lower_transport_layer(
+	//bit7 is SEQ 0=Unsegment Message
+	//bit6 is AKF
+	//bit5-bit0 is AID
+	1 mem_mesh_unsegmented_access_lower_transport_layer_head
+	11 mem_mesh_unsegmented_access_lower_transport_layer_parameters
+	4 mem_mesh_unsegmented_access_lower_transport_layer_mic
+)
+
+amemalloc mem_mesh_send_access_lower_transport_layer(
+	//bit7 is SEQ 1=segment Message
+	//bit6 is AKF
+	//bit5-bit0 is AID
+	1 mem_mesh_segmented_access_lower_transport_layer_head
+	//bit23 is SZMIC size of transMIC
+	//bit22-bit10 is SeqZero Least significant bits of SeqAuth
+	//bit9-bit5 is SegO Segment offset number
+	//bit4-bit0 is SegN Last Segment number
+	3 mem_mesh_segmented_access_lower_transport_layer_SZMIC_SeqZero_SegO_SegN
+	8 mem_mesh_segmented_access_lower_transport_layer_parameters
+	4 mem_mesh_segmented_access_lower_transport_layer_mic
+)
+
+(
+7 TRANSPORT_HEAD_BIT_SEG
+6 TRANSPORT_HEAD_BIT_AKF
+05 TRANSPORT_HEAD_BIT_AID
+7 BIT_CTL
+)
+
+
Index: format/mesh_protocol_stack/mesh_model_layer.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_model_layer.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_model_layer.format	(working copy)
@@ -0,0 +1,70 @@
+
+
+xmemalloc ali_mesh(
+	2 mem_mesh_last_CTL_Temperature
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	1 mem_mesh_module_message_opcode
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	//generic OnOff Set
+	1 mem_mesh_module_message_opcode_onoff_set
+	1 mem_mesh_generic_onoff_set_payload_OnOff
+	1 mem_mesh_generic_onoff_set_payload_TID
+	1 mem_mesh_generic_onoff_set_payload_Transition_Time
+	1 mem_mesh_generic_onoff_set_payload_Delay
+
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	//Scene recall 模式设置
+	1 mem_mesh_module_message_opcode_scene_recall
+	2 mem_mesh_scene_recall_payload_scene_number
+	1 mem_mesh_scene_recall_payload_TID
+	1 mem_mesh_scene_recall_payload_Transition_Time
+	1 mem_mesh_scene_recall_payload_Delay
+
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	//light lightness
+	1 mem_mesh_module_message_opcode_set_light_lightness
+	2 mem_mesh_light_lightness_set_payload_lightness
+	1 mem_mesh_light_lightness_set_payload_TID
+	1 mem_mesh_light_lightness_set_payload_Transition_Time
+	1 mem_mesh_light_lightness_set_payload_Delay
+	1 mem_mesh_light_lightness_calc_lightness
+)
+
+amemalloc mem_mesh_receive_model_message_payload(
+	//light CTL
+	1 mem_mesh_module_message_opcode_set_light_ctl
+	2 mem_mesh_CTL_Lightness
+	2 mem_mesh_CTL_Temperature
+	2 mem_mesh_CTL_Delta_UV
+	1 mem_mesh_CTL_lightness_TID
+	1 mem_mesh_CTL_lightness_Transition_Time
+	1 mem_mesh_CTL_lightness_Delay	
+	1 mem_mesh_CTL_calc_lightness
+	1 mem_mesh_CTL_calc_temperature
+
+)
+
+(//Generic OnOff
+0x00 GENERIC_ONOFF_CMD_OFF
+0x01 GENERIC_ONOFF_CMD_ON
+)
+
+(//LIGHTNESS
+0xFFFF ALI_MESH_LIGHTNESS_MAX
+0x0064 ALI_MESH_LIGHTNESS_LEVEL
+)
+
+(//TEMPERATURE
+0x4E20 ALI_MESH_TEMPERATURE_MAX
+0x0320 ALI_MESH_TEMPERATURE_MIN
+0x0064 ALI_MESH_TEMPERATURE_LEVEL
+)
+
Index: format/mesh_protocol_stack/mesh_more_element_check.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_more_element_check.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_more_element_check.format	(working copy)
@@ -0,0 +1,17 @@
+
+memalloc ali_mesh(
+	2 mem_mesh_loopcnt_tmep
+	2 mem_mesh_rega_temp
+	2 mem_mesh_regb_temp
+	2 mem_mesh_regc_temp
+	2 mem_mesh_alarm_temp
+	
+)
+
+
+
+xmemalloc ali_mesh(
+	1 mem_mesh_receive_group_address
+	1 mem_mesh_receive_element_number
+)
+
Index: format/mesh_protocol_stack/mesh_network_layer.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_network_layer.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_network_layer.format	(working copy)
@@ -0,0 +1,112 @@
+
+
+memalloc ali_mesh(
+	1 mem_mesh_message_Transport_NetMIC_length
+
+	1 mem_mesh_message_NID
+	1 mem_mesh_message_TTL
+	3 mem_mesh_message_SEQ
+	2 mem_mesh_message_SRC
+	2 mem_mesh_message_DST
+	0 mem_mesh_message_Transport_NetMIC
+	1 mem_mesh_message_Transport_Head
+	//unsegmented access message
+	0 mem_mesh_message_Transport_unsegmented_access_messagePDU
+	//segmented access message
+	0 mem_mesh_message_Transport_segmented_access_messagePDU
+	3 mem_mesh_message_segment_access_SZMIC_SeqZero_SegO_SegN
+	0 mem_mesh_message_Transport_segmented_access_messagePDU_Segment
+	16 mem_mesh_message_Transport_NetMIC_end
+
+	13 mem_mesh_nonce_struct
+
+	2 mem_mesh_send_message_DST
+	3 mem_mesh_last_message_SEQ
+	1 mem_mesh_network_packet_type
+
+)
+
+xmemalloc ali_mesh(
+	4 mem_mesh_IV_Index
+
+
+
+// mesh SRC/SEQ  cache
+	0 mem_mesh_TMALL_cache_start
+	2 mem_mesh_TMALL_SRC1
+	3 mem_mesh_TMALL_SEQ1
+	45 mem_mesh_TMALL_cache
+	0 mem_mesh_TMALL_cache_end
+
+	0 mem_mesh_transport_message_mic_cache
+	4 mem_mesh_transport_message_mic_cache_buff1
+	36 mem_mesh_transport_message_mic_cache_buff2_10
+
+	0 mem_mesh_network_relay_queue
+	1 mem_mesh_network_relay_queue_each_size
+	1 mem_mesh_network_relay_queue_length
+	1 mem_mesh_network_relay_queue_current_num
+	1 mem_mesh_network_relay_queue_read_ptr
+	1 mem_mesh_network_relay_queue_write_ptr
+	136 mem_mesh_network_relay_queue_ele
+
+)
+
+amemalloc mem_le_txheader_mesh_temp(
+	1 mem_mesh_network_packet_type_temp
+	29 mem_mesh_message_NID_temp
+)
+
+amemalloc mem_k2_T2(
+	16 mem_k2_EncryptionKey
+)
+
+amemalloc mem_k2_T3(
+	16 mem_k2_PrivacyKey
+)
+
+amemalloc mem_mesh_nonce_struct(
+	//DST and TransportPDU encryption
+	0 mem_mesh_Network_Nonce
+	1 mem_mesh_Network_Nonce_nonce_type
+	1 mem_mesh_Network_Nonce_CTL_and_TTL
+	3 mem_mesh_Network_Nonce_SEQ
+	2 mem_mesh_Network_Nonce_SRC
+	2 mem_mesh_Network_Nonce_Pad	//0x0000
+	4 mem_mesh_Network_Nonce_IV_Index
+
+)
+
+(//nonce type
+0x00 NETWORK_NONCE
+0x01 APPLICATION_NONCE
+0x02 DEVICE_NONCE
+0x03 PROXY_NONCE
+)
+
+
+(
+0x00c0 GROUP_ADDRESS_0XC000_little_endian
+0xffcf GROUP_ADDRESS_0XCFFF_little_endian
+0x02c0 GROUP_ADDRESS_0XC002_little_endian
+0x07c0 GROUP_ADDRESS_0XC007_little_endian
+0x01c0 GROUP_ADDRESS_0XC001_little_endian
+0xffff GROUP_ADDRESS_0XFFFF_little_endian
+)
+
+
+(//SRC SEQ cache parameter
+10 CACHE_SPACE_NUM
+5 CACHE_SPACE_SIZE
+)
+
+(
+12 MESH_NETWORK_PACKET_MIN_LENGTH
+30 MESH_NETWORK_PACKET_MAX_LENGTH
+)
+
+(
+0 MESH_MESSAGE_TMALL
+1 MESH_MESSAGE_APP
+)
+
Index: format/mesh_protocol_stack/mesh_upper_transport_layer.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_upper_transport_layer.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/mesh_protocol_stack/mesh_upper_transport_layer.format	(working copy)
@@ -0,0 +1,129 @@
+
+memalloc ali_mesh(
+	2 mem_mesh_upper_transport_layer_payload_ptr
+	1 mem_mesh_segmented_upper_transport_layer_payload_len
+	2 mem_mesh_segmented_lower_transport_layer_SegZero
+	1 mem_mesh_segmented_lower_transport_layer_SegO
+	1 mem_mesh_segmented_lower_transport_layer_SegN
+	1 mem_mesh_segmented_last_packet_upper_teansport_payload_len
+
+	0 mem_mesh_upper_tran_layer_queue_temp
+	1 mem_mesh_upper_tran_layer_temp_packet_flag
+	2 mem_mesh_upper_tran_layer_temp_packet_transmit_delay
+	1 mem_mesh_upper_tran_layer_temp_packet_TID
+	1 mem_mesh_upper_tran_layer_temp_packet_header_IVI_NID
+	1 mem_mesh_upper_tran_layer_temp_packet_header_CTL_TTL
+	3 mem_mesh_upper_tran_layer_temp_packet_header_SEQ
+	2 mem_mesh_upper_tran_layer_temp_packet_header_SRC
+	2 mem_mesh_upper_tran_layer_temp_packet_header_DST
+	1 mem_mesh_upper_tran_layer_temp_packet_length
+	108 mem_mesh_upper_tran_layer_temp_packet_payload
+
+)
+
+xmemalloc ali_mesh(
+	16 mem_mesh_application_key
+	1 mem_mesh_ASZMIC
+
+	0 mem_mesh_access_message_mic_cache
+	4 mem_mesh_access_message_mic_cache_buff1
+	36 mem_mesh_access_message_mic_cache_buff2_10
+
+	3 mem_mesh_send_message_SEQ
+
+	2 mem_mesh_send_message_SRC
+
+	1 mem_mesh_send_message_TTL
+
+	//Upper transport access PDU
+	1 mem_mesh_send_upper_layer_IVI_and_NID
+	1 mem_mesh_send_upper_layer_CTL_and_TTL
+	3 mem_mesh_send_upper_layer_SEQ
+	2 mem_mesh_send_upper_layer_SRC
+	2 mem_mesh_send_upper_layer_DST
+	16 mem_mesh_send_access_lower_transport_layer
+	4 mem_mesh_send_network_layer_NetMIC
+
+)
+
+
+amemalloc mem_mesh_nonce_struct(
+	//application payload encryption
+	0 mem_mesh_Application_Nonce
+	1 mem_mesh_Application_Nonce_Nonce_Type
+	//bit7 is ASZMIC
+	1 mem_mesh_Application_Nonce_ASZMIC_and_Pad	//
+	3 mem_mesh_Application_Nonce_SEQ
+	2 mem_mesh_Application_Nonce_SRC
+	2 mem_mesh_Application_Nonce_DST
+	4 mem_mesh_Application_Nonce_IV_Index
+)
+
+amemalloc mem_mesh_nonce_struct(
+	//application payload encryption
+	0 mem_mesh_Device_Nonce
+	1 mem_mesh_Device_Nonce_Nonce_Type
+	1 mem_mesh_Device_Nonce_ASZMIC_and_Pad	//
+	3 mem_mesh_Device_Nonce_SEQ
+	2 mem_mesh_Device_Nonce_SRC
+	2 mem_mesh_Device_Nonce_DST
+	4 mem_mesh_Device_Nonce_IV_Index
+)
+
+amemalloc mem_mesh_access_layer_payload_len(
+	1 mem_mesh_upper_transport_layer_payload_len
+)
+
+amemalloc mem_mesh_upper_tran_layer_temp_packet_payload(
+//unsegment access message
+	0 mem_mesh_upper_tran_layer_temp_pakcet_AKF_AID
+	1 mem_mesh_upper_tran_layer_temp_unsegmented_pakcet_AKF_AID
+	4 mem_mesh_upper_tran_layer_temp_unsegmented_packet_fill
+	0 mem_mesh_upper_tran_layer_temp_pakcet_upper_tran_access_pdu
+	15 mem_mesh_upper_tran_layer_temp_unsegmented_pakcet_upper_tran_access_pdu
+)
+
+amemalloc mem_mesh_upper_tran_layer_temp_packet_payload(
+//segment access message
+	1 mem_mesh_upper_tran_layer_temp_segmented_pakcet_AKF_AID
+	2 mem_mesh_upper_tran_layer_temp_segmented_pakcet_SeqZero
+	1 mem_mesh_upper_tran_layer_temp_segmented_pakcet_SegO
+	1 mem_mesh_upper_tran_layer_temp_segmented_pakcet_SegN
+	104 mem_mesh_upper_tran_layer_temp_segmented_pakcet_upper_tran_access_pdu
+)
+
+
+
+(
+15 UNSEGMENTED_ACCESS_MESSAGE_MAX_UPPER_TRANSPORT_ACCESS_PDU_LEN
+12 SEGMENTED_ACCESS_MESSAGE_UNINT_PDU_LEN
+)
+
+(//bit of mem_mesh_upper_tran_layer_temp_packet_flag
+6 BIT_UPPER_FLAG_APP_CONTROL
+5 BIT_UPPER_FLAG_VENDOR_INDICATION
+4 BIT_UPPER_FLAG_RETRANSMIT
+//BIT3-0
+0x0f DATA_UPPER_FLAG_MAX_RETRY_COUNT
+
+2 UPPER_RETRY_COUNT_STATUS
+1 UPPER_RETRY_COUNT_INDICATION
+)
+
+(
+0 NULL_PACKET_ADVERTISING
+1 PACKET_IN_BEARER
+2 PACKET_IN_ADVERTING
+3 PACKET_RECEIVE_INDICATION
+)
+
+(
+1 UPPER_TRAN_TMALL_MESSAGE
+2 UPPER_TRAN_APP_MESSAGE
+3 UPPER_TRAN_TMALL_AND_APP
+
+0 BIT_UPPER_TRAN_TMALL_MESSAGE
+1 BIT_UPPER_TRAN_APP_MESSAGE
+)
+
+
Index: format/meter.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/meter.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/meter.format	(working copy)
@@ -0,0 +1,24 @@
+omemalloc (
+3 mem_dummy
+1 mem_seq
+1 mem_context_cnt
+1 mem_context_map
+768 mem_context_new
+1 mem_att_cmd_len
+15 mem_att_cmd
+1 mem_att_resp_handle
+1 mem_att_resp_len
+30 mem_att_resp
+600 mem_meter_att_list
+)
+
+(
+7 context_num_new_m1
+8 context_num_new
+96 context_size_new
+)
+
+(
+0x4040 mem_anchor_array
+)
+
Index: format/patch.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/patch.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/patch.format	(working copy)
@@ -0,0 +1,516 @@
+
+(
+	  0 patch00_0
+	  1 patch00_1
+	  2 patch00_2
+	  3 patch00_3
+	  4 patch00_4
+	  5 patch00_5
+	  6 patch00_6
+	  7 patch00_7
+	  8 patch01_0
+	  9 patch01_1
+	 10 patch01_2
+	 11 patch01_3
+	 12 patch01_4
+	 13 patch01_5
+	 14 patch01_6
+	 15 patch01_7
+	 16 patch02_0
+	 17 patch02_1
+	 18 patch02_2
+	 19 patch02_3
+	 20 patch02_4
+	 21 patch02_5
+	 22 patch02_6
+	 23 patch02_7
+	 24 patch03_0
+	 25 patch03_1
+	 26 patch03_2
+	 27 patch03_3
+	 28 patch03_4
+	 29 patch03_5
+	 30 patch03_6
+	 31 patch03_7
+	 32 patch04_0
+	 33 patch04_1
+	 34 patch04_2
+	 35 patch04_3
+	 36 patch04_4
+	 37 patch04_5
+	 38 patch04_6
+	 39 patch04_7
+	 40 patch05_0
+	 41 patch05_1
+	 42 patch05_2
+	 43 patch05_3
+	 44 patch05_4
+	 45 patch05_5
+	 46 patch05_6
+	 47 patch05_7
+	 48 patch06_0
+	 49 patch06_1
+	 50 patch06_2
+	 51 patch06_3
+	 52 patch06_4
+	 53 patch06_5
+	 54 patch06_6
+	 55 patch06_7
+	 56 patch07_0
+	 57 patch07_1
+	 58 patch07_2
+	 59 patch07_3
+	 60 patch07_4
+	 61 patch07_5
+	 62 patch07_6
+	 63 patch07_7
+	 64 patch08_0
+	 65 patch08_1
+	 66 patch08_2
+	 67 patch08_3
+	 68 patch08_4
+	 69 patch08_5
+	 70 patch08_6
+	 71 patch08_7
+	 72 patch09_0
+	 73 patch09_1
+	 74 patch09_2
+	 75 patch09_3
+	 76 patch09_4
+	 77 patch09_5
+	 78 patch09_6
+	 79 patch09_7
+	 80 patch0a_0
+	 81 patch0a_1
+	 82 patch0a_2
+	 83 patch0a_3
+	 84 patch0a_4
+	 85 patch0a_5
+	 86 patch0a_6
+	 87 patch0a_7
+	 88 patch0b_0
+	 89 patch0b_1
+	 90 patch0b_2
+	 91 patch0b_3
+	 92 patch0b_4
+	 93 patch0b_5
+	 94 patch0b_6
+	 95 patch0b_7
+	 96 patch0c_0
+	 97 patch0c_1
+	 98 patch0c_2
+	 99 patch0c_3
+	100 patch0c_4
+	101 patch0c_5
+	102 patch0c_6
+	103 patch0c_7
+	104 patch0d_0
+	105 patch0d_1
+	106 patch0d_2
+	107 patch0d_3
+	108 patch0d_4
+	109 patch0d_5
+	110 patch0d_6
+	111 patch0d_7
+	112 patch0e_0
+	113 patch0e_1
+	114 patch0e_2
+	115 patch0e_3
+	116 patch0e_4
+	117 patch0e_5
+	118 patch0e_6
+	119 patch0e_7
+	120 patch0f_0
+	121 patch0f_1
+	122 patch0f_2
+	123 patch0f_3
+	124 patch0f_4
+	125 patch0f_5
+	126 patch0f_6
+	127 patch0f_7
+	128 patch10_0
+	129 patch10_1
+	130 patch10_2
+	131 patch10_3
+	132 patch10_4
+	133 patch10_5
+	134 patch10_6
+	135 patch10_7
+	136 patch11_0
+	137 patch11_1
+	138 patch11_2
+	139 patch11_3
+	140 patch11_4
+	141 patch11_5
+	142 patch11_6
+	143 patch11_7
+	144 patch12_0
+	145 patch12_1
+	146 patch12_2
+	147 patch12_3
+	148 patch12_4
+	149 patch12_5
+	150 patch12_6
+	151 patch12_7
+	152 patch13_0
+	153 patch13_1
+	154 patch13_2
+	155 patch13_3
+	156 patch13_4
+	157 patch13_5
+	158 patch13_6
+	159 patch13_7
+	160 patch14_0
+	161 patch14_1
+	162 patch14_2
+	163 patch14_3
+	164 patch14_4
+	165 patch14_5
+	166 patch14_6
+	167 patch14_7
+	168 patch15_0
+	169 patch15_1
+	170 patch15_2
+	171 patch15_3
+	172 patch15_4
+	173 patch15_5
+	174 patch15_6
+	175 patch15_7
+	176 patch16_0
+	177 patch16_1
+	178 patch16_2
+	179 patch16_3
+	180 patch16_4
+	181 patch16_5
+	182 patch16_6
+	183 patch16_7
+	184 patch17_0
+	185 patch17_1
+	186 patch17_2
+	187 patch17_3
+	188 patch17_4
+	189 patch17_5
+	190 patch17_6
+	191 patch17_7
+	192 patch18_0
+	193 patch18_1
+	194 patch18_2
+	195 patch18_3
+	196 patch18_4
+	197 patch18_5
+	198 patch18_6
+	199 patch18_7
+	200 patch19_0
+	201 patch19_1
+	202 patch19_2
+	203 patch19_3
+	204 patch19_4
+	205 patch19_5
+	206 patch19_6
+	207 patch19_7
+	208 patch1a_0
+	209 patch1a_1
+	210 patch1a_2
+	211 patch1a_3
+	212 patch1a_4
+	213 patch1a_5
+	214 patch1a_6
+	215 patch1a_7
+	216 patch1b_0
+	217 patch1b_1
+	218 patch1b_2
+	219 patch1b_3
+	220 patch1b_4
+	221 patch1b_5
+	222 patch1b_6
+	223 patch1b_7
+	224 patch1c_0
+	225 patch1c_1
+	226 patch1c_2
+	227 patch1c_3
+	228 patch1c_4
+	229 patch1c_5
+	230 patch1c_6
+	231 patch1c_7
+	232 patch1d_0
+	233 patch1d_1
+	234 patch1d_2
+	235 patch1d_3
+	236 patch1d_4
+	237 patch1d_5
+	238 patch1d_6
+	239 patch1d_7
+	240 patch1e_0
+	241 patch1e_1
+	242 patch1e_2
+	243 patch1e_3
+	244 patch1e_4
+	245 patch1e_5
+	246 patch1e_6
+	247 patch1e_7
+	248 patch1f_0
+	249 patch1f_1
+	250 patch1f_2
+	251 patch1f_3
+	252 patch1f_4
+	253 patch1f_5
+	254 patch1f_6
+	255 patch1f_7
+	  0 patch20_0
+	  1 patch20_1
+	  2 patch20_2
+	  3 patch20_3
+	  4 patch20_4
+	  5 patch20_5
+	  6 patch20_6
+	  7 patch20_7
+	  8 patch21_0
+	  9 patch21_1
+	 10 patch21_2
+	 11 patch21_3
+	 12 patch21_4
+	 13 patch21_5
+	 14 patch21_6
+	 15 patch21_7
+	 16 patch22_0
+	 17 patch22_1
+	 18 patch22_2
+	 19 patch22_3
+	 20 patch22_4
+	 21 patch22_5
+	 22 patch22_6
+	 23 patch22_7
+	 24 patch23_0
+	 25 patch23_1
+	 26 patch23_2
+	 27 patch23_3
+	 28 patch23_4
+	 29 patch23_5
+	 30 patch23_6
+	 31 patch23_7
+	 32 patch24_0
+	 33 patch24_1
+	 34 patch24_2
+	 35 patch24_3
+	 36 patch24_4
+	 37 patch24_5
+	 38 patch24_6
+	 39 patch24_7
+	 40 patch25_0
+	 41 patch25_1
+	 42 patch25_2
+	 43 patch25_3
+	 44 patch25_4
+	 45 patch25_5
+	 46 patch25_6
+	 47 patch25_7
+	 48 patch26_0
+	 49 patch26_1
+	 50 patch26_2
+	 51 patch26_3
+	 52 patch26_4
+	 53 patch26_5
+	 54 patch26_6
+	 55 patch26_7
+	 56 patch27_0
+	 57 patch27_1
+	 58 patch27_2
+	 59 patch27_3
+	 60 patch27_4
+	 61 patch27_5
+	 62 patch27_6
+	 63 patch27_7
+	 64 patch28_0
+	 65 patch28_1
+	 66 patch28_2
+	 67 patch28_3
+	 68 patch28_4
+	 69 patch28_5
+	 70 patch28_6
+	 71 patch28_7
+	 72 patch29_0
+	 73 patch29_1
+	 74 patch29_2
+	 75 patch29_3
+	 76 patch29_4
+	 77 patch29_5
+	 78 patch29_6
+	 79 patch29_7
+	 80 patch2a_0
+	 81 patch2a_1
+	 82 patch2a_2
+	 83 patch2a_3
+	 84 patch2a_4
+	 85 patch2a_5
+	 86 patch2a_6
+	 87 patch2a_7
+	 88 patch2b_0
+	 89 patch2b_1
+	 90 patch2b_2
+	 91 patch2b_3
+	 92 patch2b_4
+	 93 patch2b_5
+	 94 patch2b_6
+	 95 patch2b_7
+	 96 patch2c_0
+	 97 patch2c_1
+	 98 patch2c_2
+	 99 patch2c_3
+	100 patch2c_4
+	101 patch2c_5
+	102 patch2c_6
+	103 patch2c_7
+	104 patch2d_0
+	105 patch2d_1
+	106 patch2d_2
+	107 patch2d_3
+	108 patch2d_4
+	109 patch2d_5
+	110 patch2d_6
+	111 patch2d_7
+	112 patch2e_0
+	113 patch2e_1
+	114 patch2e_2
+	115 patch2e_3
+	116 patch2e_4
+	117 patch2e_5
+	118 patch2e_6
+	119 patch2e_7
+	120 patch2f_0
+	121 patch2f_1
+	122 patch2f_2
+	123 patch2f_3
+	124 patch2f_4
+	125 patch2f_5
+	126 patch2f_6
+	127 patch2f_7
+	128 patch30_0
+	129 patch30_1
+	130 patch30_2
+	131 patch30_3
+	132 patch30_4
+	133 patch30_5
+	134 patch30_6
+	135 patch30_7
+	136 patch31_0
+	137 patch31_1
+	138 patch31_2
+	139 patch31_3
+	140 patch31_4
+	141 patch31_5
+	142 patch31_6
+	143 patch31_7
+	144 patch32_0
+	145 patch32_1
+	146 patch32_2
+	147 patch32_3
+	148 patch32_4
+	149 patch32_5
+	150 patch32_6
+	151 patch32_7
+	152 patch33_0
+	153 patch33_1
+	154 patch33_2
+	155 patch33_3
+	156 patch33_4
+	157 patch33_5
+	158 patch33_6
+	159 patch33_7
+	160 patch34_0
+	161 patch34_1
+	162 patch34_2
+	163 patch34_3
+	164 patch34_4
+	165 patch34_5
+	166 patch34_6
+	167 patch34_7
+	168 patch35_0
+	169 patch35_1
+	170 patch35_2
+	171 patch35_3
+	172 patch35_4
+	173 patch35_5
+	174 patch35_6
+	175 patch35_7
+	176 patch36_0
+	177 patch36_1
+	178 patch36_2
+	179 patch36_3
+	180 patch36_4
+	181 patch36_5
+	182 patch36_6
+	183 patch36_7
+	184 patch37_0
+	185 patch37_1
+	186 patch37_2
+	187 patch37_3
+	188 patch37_4
+	189 patch37_5
+	190 patch37_6
+	191 patch37_7
+	192 patch38_0
+	193 patch38_1
+	194 patch38_2
+	195 patch38_3
+	196 patch38_4
+	197 patch38_5
+	198 patch38_6
+	199 patch38_7
+	200 patch39_0
+	201 patch39_1
+	202 patch39_2
+	203 patch39_3
+	204 patch39_4
+	205 patch39_5
+	206 patch39_6
+	207 patch39_7
+	208 patch3a_0
+	209 patch3a_1
+	210 patch3a_2
+	211 patch3a_3
+	212 patch3a_4
+	213 patch3a_5
+	214 patch3a_6
+	215 patch3a_7
+	216 patch3b_0
+	217 patch3b_1
+	218 patch3b_2
+	219 patch3b_3
+	220 patch3b_4
+	221 patch3b_5
+	222 patch3b_6
+	223 patch3b_7
+	224 patch3c_0
+	225 patch3c_1
+	226 patch3c_2
+	227 patch3c_3
+	228 patch3c_4
+	229 patch3c_5
+	230 patch3c_6
+	231 patch3c_7
+	232 patch3d_0
+	233 patch3d_1
+	234 patch3d_2
+	235 patch3d_3
+	236 patch3d_4
+	237 patch3d_5
+	238 patch3d_6
+	239 patch3d_7
+	240 patch3e_0
+	241 patch3e_1
+	242 patch3e_2
+	243 patch3e_3
+	244 patch3e_4
+	245 patch3e_5
+	246 patch3e_6
+	247 patch3e_7
+	248 patch3f_0
+	249 patch3f_1
+	250 patch3f_2
+	251 patch3f_3
+	252 patch3f_4
+	253 patch3f_5
+	254 patch3f_6
+	255 patch3f_7
+
+)
Index: format/regs.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/regs.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/regs.format	(working copy)
@@ -0,0 +1,548 @@
+(
+	0x8000 core_chipid
+	0x8003 core_kick
+	0x8004 core_write_wdt
+	0x8005 core_lpm_wr
+	0x8006 core_misc_ctrl
+	0x8007 core_efuse_rdata
+	0x800a core_ccm_ctrl
+	0x800b core_write_wdt2
+	0x8010 core_reset
+	0x8011 core_encrypt
+	0x8012 core_lpm_wr2
+	0x8013 core_mpu_s0_saddr
+	0x8015 core_mpu_s0_eaddr
+	0x8017 core_mpu_s1_saddr
+	0x8019 core_mpu_s1_eaddr
+	0x8022 core_ucode_hi
+	0x8023 core_ucode_ctrl
+	0x8024 core_ucode_low
+	0x8025 core_ucode_data
+
+	0x8040 core_halfslot
+	0x8042 core_clksel
+	0x8043 core_uart_clksel
+	0x8043 core_config
+	0x8044 core_xtal_stable_time
+	0x8045 core_efuse_addr
+	0x8046 core_bist_ctrl
+	0x8047 core_efuse_ctrl
+	0x8048 core_ac_ctrl
+	0x804a core_ac_saddr
+	0x804c core_lpm_reg
+	0x804f core_lpm_isogate
+	0x8050 core_clkoff
+	0x8052 core_uart_baud
+	0x8053 core_sum_en
+	0x8054 core_uart_rsaddr
+	0x8056 core_uart_readdr
+	0x8058 core_uart_rrptr
+	0x805a core_uart_tsaddr
+	0x805c core_uart_teaddr
+	0x805e core_uart_twptr
+	0x8060 core_uart_ctrl
+	0x8061 core_uartb_ctrl
+	0x8062 core_uartb_baud
+	0x8064 core_uartb_rsaddr
+	0x8066 core_uartb_readdr
+	0x8068 core_uartb_rrptr
+	0x806a core_uartb_tsaddr
+	0x806c core_uartb_teaddr
+	0x806e core_uartb_twptr
+	0x8070 core_gpio_conf
+	0x8084 core_pwm_en
+	0x8085 core_aes_en
+	0x8086 core_spid_ctrl
+	0x8087 core_spid_delay
+	0x8088 core_spid_txlen
+	0x808a core_spid_txaddr
+	0x808c core_spid_rxaddr
+	0x808e core_spid_rxlen
+	0x8090 core_iicd_ctrl
+	0x8091 core_iicd_scl_low
+	0x8092 core_iicd_scl_high
+	0x8093 core_iicd_start_setup
+	0x8094 core_iicd_start_hold
+	0x8095 core_iicd_stop_setup
+	0x8096 core_iicd_data_setup
+	0x8097 core_iicd_data_hold
+	0x8098 core_iicd_txlen
+	0x809a core_iicd_txaddr
+	0x809c core_iicd_rxaddr
+	0x809e core_iicd_rxlen
+	0x80a0 core_pwm_pcnt0
+	0x80a2 core_pwm_ncnt0
+	0x80a4 core_pwm_pcnt1
+	0x80a6 core_pwm_ncnt1
+	0x80a8 core_pwm_pcnt2
+	0x80aa core_pwm_ncnt2
+	0x80ac core_pwm_pcnt3
+	0x80ae core_pwm_ncnt3
+	0x80b0 core_pwm_pcnt4
+	0x80b2 core_pwm_ncnt4
+	0x80b4 core_pwm_pcnt5
+	0x80b6 core_pwm_ncnt5
+	0x80b8 core_pwm_pcnt6
+	0x80ba core_pwm_ncnt6
+	0x80bc core_pwm_pcnt7
+	0x80be core_pwm_ncnt7
+	0x80c0 core_spid2_ctrl
+	0x80c1 core_spid2_delay
+	0x80c2 core_spid2_txlen
+	0x80c4 core_spid2_txaddr
+	0x80c6 core_spid2_rxaddr
+	0x80c8 core_spid2_rxlen
+	0x80ca core_nec_start_addr
+	0x80cc core_nec_end_addr
+	0x80ce core_nec_rptr
+	0x80d0 core_nec_control
+	0x80d1 core_ccm_input_playload_addr
+	0x80d3 core_ccm_output_playload_addr
+	0x80d5 core_ccm_aad0
+	0x80d6 core_ccm_aad1
+	0x80d7 core_ccm_aad2
+	0x80d8 core_pwm_init
+	0x80d9 core_ac_buf_len
+	0x80da core_ccm_inptr
+	0x80dc core_sum_ctrl
+	0x80dd core_pwm_srst
+	0x8108 core_misc_status
+	0x8109 core_qdec_cntx
+	0x810a core_watchdog_cnt
+	0x810b core_uart_status
+	0x810c core_uart_rbaud
+	0x810e core_uart_txitems
+	0x8110 core_uart_trptr
+	0x8112 core_uart_rxitems
+	0x8114 core_uart_rdptr
+	0x8116 core_uart_rwptr
+	0x8118 core_debug_baud
+	0x811a core_ccm_outptr
+	0x811c core_gpio_in
+	0x811d core_gpio_in1
+	0x8120 core_ucode_flag
+	0x8121 core_peripheral_lock
+	0x8122 core_nec_wptr
+	0x8124 core_current_efuse_addr
+	0x8126 core_spid2_remain
+	0x8128 core_spid_remain
+	0x812a core_iicd_remain
+	0x812c core_dma_status
+	0x812d core_perf_status
+	0x812e core_adc_in
+	0x8130 core_nec_rxitem
+	0x8134 core_lpm_ctrl2
+	0x8138 core_lpm_ctrl
+	0x813c core_lpm_xtalcnt
+	0x813d core_lpm_buckcnt
+	0x813e core_lpm_ldocnt
+	0x813f core_lpm_latch
+	0x8140 core_gpio_wakeup_low
+	0x8144 core_gpio_wakeup_high
+	0x8149 core_clk_counter
+	0x8150 core_adc_sum
+	0x8152 core_uartb_status
+	0x8152 core_uartb_rbaud
+	0x8154 core_uartb_txitems
+	0x8156 core_uartb_trptr
+	0x8158 core_uartb_rxitems
+	0x815a core_uartb_rdptr
+	0x815c core_uartb_rwptr
+
+	0x8203 core_ice_ctrl
+	0x8204 core_ice_status
+	0x8205 core_ice_break0
+	0x8207 core_ice_break1
+  
+	0x8280 core_docd_ctrl
+	0x8288 core_docd_paddr
+	0x828a core_docd_pdata
+
+	0x8900 modem_en
+	0x8938 mod_value_scale1
+	0x8960 core_rf_rx_agc_ctrl
+	0x8961 core_rf_rx_gain_fix
+	0x89a0 modem_rssi
+	0x89a1 modem_wb_pow
+	0x89a2 modem_nb_pow
+	0x89a3 modem_gain
+	0x89a4 modem_status
+
+	0x89f0 fpga_rf_gain
+	0x89f1 fpga_rf_gain_ctrl
+	0x89f2 fpga_uart_ctrl
+	0x89f3 fpga_uart_wdata
+	0x89f4 fpga_uart_rdata
+	0x89f5 fpga_uart_status
+
+	0x8921 core_rx_ctrl1
+	0x8a00 core_clkpll_ctrl0              
+	0x8a01 core_clkpll_ctrl1              
+	0x8a02 core_clkpll_ctrl2              
+	0x8a03 core_clkpll_cfg0               
+	0x8a04 core_clkpll_cfg1               
+	0x8a05 core_clkpll_cfg2               
+	0x8a06 core_clkpll_cfg3               
+	0x8a07 core_clkpll_cfg4               
+	0x8a08 core_clkpll_cfg5               
+	0x8a09 core_clkpll_cfg6               
+	0x8a0a core_rf_ldo_en0                
+	0x8a0b core_rf_ldo_en1                
+	0x8a0c core_rf_ldo_cfg0               
+	0x8a0d core_rf_ldo_cfg1               
+	0x8a0e core_rf_ldo_cfg2               
+	0x8a0f core_rf_ldo_cfg3               
+	0x8a10 core_rf_ldo_cfg4               
+	0x8a11 core_rf_ldo_cfg5               
+	0x8a12 core_rf_ldo_cfg6               
+	0x8a13 core_rf_ldo_cfg7               
+	0x8a14 core_rf_ldo_cfg8               
+	0x8a15 core_rf_ldo_cfg9               
+	0x8a16 core_syn_en                    
+	0x8a17 core_rx_en0                    
+	0x8a18 core_rx_en1                    
+	0x8a19 core_tx_en0                    
+	0x8a1a core_tx_en1                    
+	0x8a1b core_force_ctrl                
+	0x8a1c core_rx_lna_gc_gc0             
+	0x8a1d core_rx_lna_gc_gc1             
+	0x8a1e core_rx_lna_gc_gc2             
+	0x8a1f core_rx_lna_gc_gc3             
+	0x8a20 core_rx_lna_gc_gc4             
+	0x8a21 core_rx_lna_gc_gc5             
+	0x8a22 core_rx_lna_gc_gc6             
+	0x8a23 core_rx_lna_gc_gc7             
+	0x8a24 core_rx_lna_gc_gc8             
+	0x8a25 core_rx_lna_hg_isel_gc6        
+	0x8a26 core_rx_lna_hg_isel_gc7        
+	0x8a27 core_rx_lna_hg_isel_gc8        
+	0x8a28 core_rx_lna_lg_isel_gc0        
+	0x8a29 core_rx_lna_lg_isel_gc1        
+	0x8a2a core_rx_lna_lg_isel_gc2        
+	0x8a2b core_rx_lna_lg_isel_gc3        
+	0x8a2c core_rx_lna_lg_isel_gc4        
+	0x8a2d core_rx_lna_lg_isel_gc5        
+	0x8a2e core_rx_bq_gc_gc0              
+	0x8a2f core_rx_bq_gc_gc1              
+	0x8a30 core_rx_bq_gc_gc2              
+	0x8a31 core_rx_bq_gc_gc3              
+	0x8a32 core_rx_bq_gc_gc4              
+	0x8a33 core_rx_bq_gc_gc5              
+	0x8a34 core_rx_bq_gc_gc6              
+	0x8a35 core_rx_bq_gc_gc7              
+	0x8a36 core_rx_bq_gc_gc8              
+	0x8a37 core_rx_gain_force             
+	0x8a38 core_rx_lna_isel_force         
+	0x8a39 core_tx_pwr_ctrl0              
+	0x8a3a core_tx_pwr_ctrl1              
+	0x8a3b core_tx_pwr_ctrl2              
+	0x8a3c core_tx_pwr_ctrl3              
+	0x8a3d core_syn_top_ctrl              
+	0x8a3e core_syn_mmd_cp_ctrl           
+	0x8a3f core_syn_divr_int              
+	0x8a40 core_syn_divr_frac2            
+	0x8a41 core_syn_divr_frac1            
+	0x8a42 core_syn_divr_frac0            
+	0x8a43 core_syn_cal_ctrl              
+	0x8a44 core_rx_tiai_dcoc_gc0          
+	0x8a45 core_rx_tiaq_dcoc_gc0          
+	0x8a46 core_rx_tiai_dcoc_gc1          
+	0x8a47 core_rx_tiaq_dcoc_gc1          
+	0x8a48 core_rx_tiai_dcoc_gc2          
+	0x8a49 core_rx_tiaq_dcoc_gc2          
+	0x8a4a core_rx_tiai_dcoc_gc3          
+	0x8a4b core_rx_tiaq_dcoc_gc3          
+	0x8a4c core_rx_tiai_dcoc_gc4          
+	0x8a4d core_rx_tiaq_dcoc_gc4          
+	0x8a4e core_rx_tiai_dcoc_gc5          
+	0x8a4f core_rx_tiaq_dcoc_gc5          
+	0x8a50 core_rx_tiai_dcoc_gc6          
+	0x8a51 core_rx_tiaq_dcoc_gc6          
+	0x8a52 core_rx_tiai_dcoc_gc7          
+	0x8a53 core_rx_tiaq_dcoc_gc7          
+	0x8a54 core_rx_tiai_dcoc_gc8          
+	0x8a55 core_rx_tiaq_dcoc_gc8          
+	0x8a56 core_rx_bq_daci_gc0            
+	0x8a57 core_rx_bq_dacq_gc0            
+	0x8a58 core_rx_bq_daci_gc1            
+	0x8a59 core_rx_bq_dacq_gc1            
+	0x8a5a core_rx_bq_daci_gc2            
+	0x8a5b core_rx_bq_dacq_gc2            
+	0x8a5c core_rx_bq_daci_gc3            
+	0x8a5d core_rx_bq_dacq_gc3            
+	0x8a5e core_rx_bq_daci_gc4            
+	0x8a5f core_rx_bq_dacq_gc4            
+	0x8a60 core_rx_bq_daci_gc5            
+	0x8a61 core_rx_bq_dacq_gc5            
+	0x8a62 core_rx_bq_daci_gc6            
+	0x8a63 core_rx_bq_dacq_gc6            
+	0x8a64 core_rx_bq_daci_gc7            
+	0x8a65 core_rx_bq_dacq_gc7            
+	0x8a66 core_rx_bq_daci_gc8            
+	0x8a67 core_rx_bq_dacq_gc8            
+	0x8a68 core_rx_tiai_dcoc_force        
+	0x8a69 core_rx_tiaq_dcoc_force        
+	0x8a6a core_rx_bq_daci_force          
+	0x8a6b core_rx_bq_dacq_force          
+	0x8a6c core_rx_bq_bw_cal              
+	0x8a6d core_rx_bq_cfg0                
+	0x8a6e core_rx_bq_cfg1                
+	0x8a6f core_rx_bq_cfg2                
+	0x8a70 core_rx_bq_cfg3                
+	0x8a71 core_rx_bq_cfg4                
+	0x8a72 core_rx_lna_cfg0               
+	0x8a73 core_rx_lna_cfg1               
+	0x8a74 core_rx_lna_cfg2               
+	0x8a75 core_rx_lna_cfg3               
+	0x8a76 core_rx_mixer_cfg0             
+	0x8a77 core_rx_mixer_cfg1             
+	0x8a78 core_rx_mixer_cfg2             
+	0x8a79 core_rx_adc_clk_cfg            
+	0x8a7a core_rx_iqadc_cfg              
+	0x8a7b core_rx_rssiadc_cfg            
+	0x8a7c core_syn_state0                
+	0x8a7d core_syn_state1                
+	0x8a7e core_syn_bias_cfg              
+	0x8a7f core_syn_cdb_cfg0              
+	0x8a80 core_syn_cdb_cfg1              
+	0x8a81 core_syn_cdb_cfg2              
+	0x8a82 core_syn_cdb_cfg3              
+	0x8a83 core_syn_pfd_lkd_cfg           
+	0x8a84 core_syn_cp_lpf_cfg            
+	0x8a85 core_syn_loopdiv_dsm_cfg       
+	0x8a86 core_syn_afc_cfg0              
+	0x8a87 core_syn_afc_cfg1              
+	0x8a88 core_syn_afc_cfg2              
+	0x8a89 core_syn_afc_cfg3              
+	0x8a8a core_syn_aac_cfg0              
+	0x8a8b core_syn_aac_cfg1              
+	0x8a8c core_logen_process_cal0        
+	0x8a8d core_logen_process_cal1        
+	0x8a8e core_logen_process_cal2        
+	0x8a8f core_logen_process_cal3        
+	0x8a90 core_logen_process_cal4        
+	0x8a91 core_logen_process_cal5        
+	0x8a92 core_logen_process_cal6        
+	0x8a93 core_logen_process_cal7        
+	0x8a94 core_logen_process_cal8        
+	0x8a95 core_logen_process_ca9         
+	0x8a96 core_logen_process_ca10        
+	0x8a97 core_gpadc_ctrl                
+	0x8a98 core_tx_abb_cfg                
+	0x8a99 core_tx_mixer_cfg0             
+	0x8a9a core_tx_mixer_cfg1             
+	0x8a9b core_tx_mixer_cfg2             
+	0x8a9c core_tx_pa_cfg                 
+	0x8a9d core_syn_tst_ctrl              
+	0x8a9e core_ana_test_control0         
+	0x8a9f core_ana_test_control1         
+
+
+	0x8c00 core_usb_config
+	0x8c01 core_usb_int_mask
+	0x8c02 core_usb_addr
+	0x8c03 core_usb_rx_saddr
+	0x8c05 core_usb_rx_eaddr
+	0x8c07 core_usb_rxptr
+	0x8c09 core_usb_tx_saddr0
+	0x8c0b core_usb_tx_saddr1
+	0x8c0d core_usb_tx_saddr2
+	0x8c0f core_usb_tx_saddr3
+	0x8c11 core_usb_hmode
+	0x8c18 core_usb_trig
+	0x8c19 core_usb_stall
+	0x8c1a core_usb_clear		//7bit reset   
+	0x8c20 core_usb_rx_wptr
+	0x8c22 core_usb_stall_status
+	0x8c23 core_usb_status
+	0x8c24 core_usb_txbusy
+	0x8c25 core_usb_sof_cntl
+	0x8c26 core_usb_sof_cnth
+	
+)
+
+
+(
+4 rx_freq_offset
+2 tx_freq_offset
+)
+
+(
+/* bit difinitions */
+  4 whiteoff_bit
+  6 clksel_rc
+  1 clksel_dpll_24M
+  5 clksel_dpll
+  4 clksel_xtal
+  5 adc_rccal
+  0 bpf_rccal
+  1 demod_clkoff
+)
+
+(
+  2 reload_code
+  3 gpio_latch
+  4 enable_retmem
+  7 cold_wake
+  0xef isogate_mask
+  0xe0 cs_mask
+)
+
+
+// misc ctrl
+(
+  0x01 spid2_start
+  0x02 spid_start
+  0x04 iicd_start
+  0x08 lock_otp
+  0x10 x_sethi
+  0x20 y_sethi
+  0x40 z_sethi
+  0x80 ccnt_start
+)
+// dma status bit
+(
+  0 otpd_crcok
+  1 otpd_done
+  2 spid_crcok
+  3 spid_done
+  4 iicd_crcok
+  5 iicd_done
+  6 iicd_ack
+)
+
+//bit map of core_uart_status
+(
+1 UART_STATUS_TX_BUSY
+2 UART_STATUS_RX_FIFO_EMPTY
+3 UART_STATUS_RX_FIFO_FULL
+4 UARTB_STATUS_TX_BUSY
+5 UARTB_STATUS_RX_FIFO_EMPTY
+6 UARTB_STATUS_RX_FIFO_FULL
+)
+
+(//core_uart_clksel
+0 UART_CLOCK_SELECT_BIT
+0xFE UART_CLOCK_SELECT_CRYSTAL
+0x01 UART_CLOCK_SELECT_DPLL
+
+24000000 uart_clock_freq_24M
+48000000 uart_clock_freq_48M
+)
+
+
+(//bit map of core_uart_ctrl
+0 BIT_UART_CONTROL_ENABLE
+1 BIT_UART_CONTROL_PARITY
+2 BIT_UART_CONTROL_DATA_LENGTH
+3 BIT_UART_CONTROL_STOP_BIT_SIZE
+4 BIT_UART_CONTROL_FLOW_CONTROL
+5 BIT_UART_CONTROL_7816_SMART_CARD_PROTOCOL
+6 BIT_UART_CONTROL_HALF_DUPLEX_SINGLE_LINE_UART
+7 BIT_UART_CONTROL_RATE_BAUD_SETTING
+)
+(//FUN of core_uart_ctrl
+0x01 FUN_UART_CONTROL_ENABLE
+0x06 FUN_UART_CONTROL_PARITY_ODD
+0x04 FUN_UART_CONTROL_PARITY_EVEN
+0x08 FUN_UART_CONTROL_STOP_2BIT
+0x00 FUN_UART_CONTROL_STOP_1BIT
+0x10 FUN_UART_CONTROL_FLOW_CONTROL_ENABLE
+0x20 FUN_UART_CONTROL_7816_SMART_CARD_PROTOCOL
+0x40 FUN_UART_CONTROL_HALF_DUPLEX_SINGLE_LINE_UART
+0x80 FUN_UART_CONTROL_SETTING_RATE_BAUD
+)
+
+(//bit map of core_nec_control
+0x00 BIT_NEC_ENABLE
+0x01 BIT_NEC_CLK_DIVIDE_NUM
+)
+
+(//FUN  of core_nec_control
+0x01 FUN_NEC_ENABLE
+0x30 FUN_NEC_CLK_DIVIDE_24	//24M , 
+)
+
+0x8b uart_ctrl_default //BCSP
+0x81 uart_ctrl_h4 //H4
+0x81 uart_ctrl_normal
+0x91 uart_ctrl_5line
+0x81 uart_ctrl_57600
+2 uart_baud_len
+0x00 uartclk_crystal
+0x01 uartclk_dpll
+0x1a0 uart_baud_115200
+0xbb uart_baud_256000
+0x340 uart_baud_57600
+0x34 uart_baud_921600
+0x9c4 uart_baud_9600
+
+//core_clkoff
+(
+	0 CLOCK_OFF_AUTH_ROM
+	1 CLOCK_OFF_UC_ROM
+	2 CLOCK_OFF_DEBUG_UART
+	3 CLOCK_OFF_SCHED_RAM
+	4 CLOCK_OFF_TRANCE_FIFO
+	5 CLOCK_OFF_CORDIC
+	6 CLOCK_OFF_OTPD
+	7 CLOCK_OFF_I2C
+	8 CLICK_OFF_8051
+	9 CLOCK_OFF_KEYSCAN
+	0x0a CLOCK_OFF_USB
+	0x0b CLOCK_OFF_QDECODER
+	0x0c CLOCK_OFF_SPI
+	0x0d CLOCK_OFF_PWM
+	0x0e CLOCK_OFF_UARTB
+	0x0f CLOCK_OFF_UART
+)
+
+// gpio config types
+(
+  0 gpcfg_input
+  2 gpcfg_qspi_ncs
+  3 gpcfg_qspi_sck
+  4 gpcfg_qspi_io0
+  5 gpcfg_qspi_io1
+  6 gpcfg_qspi_io2
+  7 gpcfg_qspi_io3
+  8 gpcfg_uart_txd
+  9 gpcfg_uart_rxd
+  10 gpcfg_uart_rts
+  11 gpcfg_uart_cts
+  12 gpcfg_uartb_txd
+  13 gpcfg_uartb_rxd
+  14 gpcfg_uartb_rts
+  15 gpcfg_uartb_cts
+  16 gpcfg_pwm_out0
+  17 gpcfg_pwm_out1
+  18 gpcfg_pwm_out2
+  19 gpcfg_pwm_out3
+  20 gpcfg_pwm_out4
+  21 gpcfg_pwm_out5
+  22 gpcfg_pwm_out6
+  23 gpcfg_pwm_out7
+  24 gpcfg_nec_input
+  25 gpcfg_ac_input
+  31 gpcfg_spid_miso
+  32 gpcfg_spid_ncs
+  33 gpcfg_spid_sck
+  34 gpcfg_spid_mosi
+  35 gpcfg_spid_sdio
+  
+  39 gpcfg_spid2_miso
+  40 gpcfg_spid2_ncs
+  41 gpcfg_spid2_sck
+  42 gpcfg_spid2_mosi
+  43 gpcfg_spid2_sdio
+  44 gpcfg_iic_scl
+  45 gpcfg_iic_sda
+  62 gpcfg_output_low
+  63 gpcfg_output_high
+  
+  0x00 gpcfg_high_impedance
+  0x40 gpcfg_pullup
+  0x80 gpcfg_pulldown
+  0xc0 gpcfg_no_ie
+)
+
Index: format/rfcomm.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/rfcomm.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/rfcomm.format	(working copy)
@@ -0,0 +1,391 @@
+/*****************************************************************************/
+/* RCS HEADER -- DO NOT ERASE                                                */
+/* $Author: Administrator $                                                           */
+/* $Id: bt_rfcomm_format.upper,v 1.1 2009-09-28 04:06:17 Administrator Exp $ */
+/* Orisil Technology                                                      */
+/*****************************************************************************/
+
+/**********/
+/* memory */
+/**********/
+
+memalloc(
+1 memRemoteRPNBitRate
+1 memRemotePRNDataBits
+1 memRemotePRNStopBit
+1 memRemotePRNParity
+1 memRemotePRNFlowControl
+1 memRemotePRNXon
+1 memRemotePRNXoff
+
+
+3 mem_mod2div_temp
+2 mem_contw_temp
+2 mem_attrib_list
+
+//rfcomm head
+1 mem_current_adss
+1 mem_current_channel
+1 mem_current_frame_type
+1 mem_current_fcs
+2 mem_current_length
+2 mem_rfcomm_uih_payload_ptr
+
+//rfcomm uih
+1 mem_uih_cmd_type
+2 mem_uih_length
+2 mem_param_payload_ptr
+
+
+//rfcomm modem status
+1 mem_ms_param
+
+//rfcomm pn
+1 mem_pn_credit_flow_type_info
+1 mem_pn_priority
+1 mem_pn_acknowledg_timer
+1 mem_pn_max_retrans
+
+1 mem_rfcomm_send_adss
+1 mem_rfcomm_send_frame_type
+1 mem_rfcomm_send_fcs
+1 mem_rfcomm_send_offset
+
+)
+
+xmemalloc(
+1 mem_pn_dlci
+2 mem_pn_max_frame_size
+
+1 memFCStemp1
+1 memFCStemp2
+1 memFCStemp3
+
+1 mem_rfcomm_initiator
+
+1 mem_remote_spp_channel
+
+1 mem_HIUfcs_SPP
+1 mem_HIUfcs_SPP_WCredits
+
+1 mem_rfcomm_send_more_pkt
+
+1 mem_remote_credits
+1 mem_credit_given
+
+//rfcomm modem status
+1 mem_ms_channel
+
+1 mem_rfcomm_credit_flag
+
+2 mem_rfcomm_max_frame_size
+1 mem_rfcomm_credit_init_data
+
+2 mem_cb_receive_spp_data
+
+2 mem_nl_rx_data_src
+2 mem_nl_rx_len_all
+)
+
+
+(
+0 CREDIT_DISABLE
+1 CREDIT_ENABLE
+)
+
+
+/************************************************************************/
+  
+
+ 
+/************/
+/* constant */
+/************/
+
+/* RFCOMM state for Headset (memRFCOMM_State) */ 
+  (
+    0 RFCOMM_IDLE           /* before the responsor HS receive SABM            */
+    1 RFCOMM_W4_DLCI0_OPEN
+    2 RFCOMM_W4_DLCI0_CLOSE
+    3 RFCOMM_START_DLCI0    /* After respond SABM frame (DLCI=0)               */
+    4 RFCOMM_W4_DLCI_OPEN
+    5 RFCOMM_W4_DLCI_CLOSE
+    6 RFCOMM_DLCI_OPENED    
+   
+  )
+  
+/* RFCOMM timer constants   */
+  (
+    1000  RFCOMM_T1         /* Used by SABM and DISC frames,100*20ms = 20s     */     
+    1000  RFCOMM_T2         /* Used by commands send in UIH on DLCI0,          */
+    300   RFCOMM_T3_RINGON  /* 6s for ring fade time                           */
+  
+  )
+
+/* Command Type */
+  (
+    0x3F RSP_RX_SABM        /*responsor expect SABM from initiator             */
+    0x3F INI_TX_SABM
+	
+    0x73 RSP_TX_UA          /*responsor send out UA command                    */
+    0x73 UA_WFBIT_SET	    /* UA control field with F bit set                 */
+	
+    0xEF RSP_RX_UIH         /*responsor expect UIH from initiator              */
+
+    0xEF RSP_TX_UIH         /*responsor send UIH to initiator                  */
+     
+    0x1F RSP_TX_DM          /*responsor send DM to initiator                   */
+    0x1F DM_WFBIT_SET       /* DM control field with F bit set                 */
+    0x0F DM_WFBIT_CLEAR     /* DM control field with F bit clear               */
+
+    0x53 RSP_RX_DISC        /*responsor expect DISC from initiator             */
+    0x53 INI_TX_DISC	    /*initiator send DISC control type command         */
+     
+    0xFF RSP_RX_UIH_WDATA   /*UIH data with credit flow control info           */
+    
+    
+  )
+
+/* Multiplexor commands and responses frames */
+  (
+    0x83 PN_COMMAND           /* Bit 0 EA C/R Type = 000001         */
+    0x81 PN_RESPONSOR         /* Bit 0 EA C/R Type = 000001         */
+    
+    0xE3 MSC_COMMAND          /* Bit 0 EA C/R Type = 000111         */
+    0xE1 MSC_RESPONSOR
+ 
+    0x13 NSC_COMMAND          /* Bit 0 EA C/R Type = 001000         */
+    0x11 NSC_RESPONSOR        /* Bit 0 EA C/R Type = 001000         */
+
+    0x23 TEST_COMMAND         /* Bit 0 EA C/R Type = 000111         */
+    0x21 TEST_RESPONSOR 
+    
+    0x93 RPN_COMMAND          /* Bit 0 EA C/R Type = 001001         */
+    0x91 RPN_RESPONSOR 
+    
+    0x53 RLS_COMMAND          /* Bit 0 EA C/R Type = 001010         */
+    0x51 RLS_RESPONSOR 
+
+    0xA3 FCON_COMMAND         /* Bit 0 EA C/R Type = 000101         */
+    0xA1 FCON_RESPONSOR 
+    
+    0x63 FCOFF_COMMAND        /* Bit 0 EA C/R Type = 000110         */
+    0x61 FCOFF_RESPONSOR 
+    	
+    0x03 RLS_OVERRUN
+    0x05 RLS_PARITY_ERROR
+    0x09 RLS_FRAMING_ERROR
+  )
+
+/* memLocalCredit */
+  (
+    0x01 RFCOMM_CREDIT
+  )
+
+  (
+  	0x007f RFCOMM_MAX_FRAME_SIZE
+  )
+
+/* UIH received Data length */
+  (
+    0  LENGTH_ZERO
+    
+    6  LENGTH_OK
+    7  LENGTH_HOT
+    8  LENGTH_RING
+    9  LENGTH_ERROR
+    9  LENGTH_AGVOL_ONEBYTE
+    10 LENGTH_AGVOL_TWOBYTE
+    10 LENGTH_VOL_ONEBYTE
+    11 LENGTH_VOL_TWOBYTE
+    12 LENGTH_BRSF
+    13 LENGTH_PLUS_CIEV
+    15 LENGTH_INBANDRING
+    14 LENGTH_CIEV_CALL
+    17 LENGTH_CRING
+    20 LENGTH_BRSF_OK
+    24 LENGTH_CIND0
+    28 LENGTH_CIEV_TWO
+    32 LENGTH_CIND_OK
+    59 LENGTH_CIND_OK2
+    100 LENGTH_DISCARD
+  )
+  
+/************/
+/* flags    */
+/************/
+  
+/* memRFCOMM_L2CAP_Interface */
+  (
+    0 RFCOMM_TX_W4BUF_FLAG    /* Wait for Tx buffer empty flag */
+    1 RFCOMM_CLOSE_LINK_FLAG
+  )
+  
+
+    
+/* memRemoteMSC		*/
+  (
+    0 MSC_EA_BIT
+    1 MSC_FC_BIT
+    2 MSC_RTC_BIT
+    3 MSC_RTR_BIT
+    6 MSC_IC_BIT
+    7 MSC_DV_BIT
+  )
+
+/* memRemoteRLS         */
+  (
+    0x0C OVERRUN_ERROR
+    0x0A PARITY_ERROR
+    0x09 FRAMING_RERROR
+  )
+  
+/* memRemoteRPNBitRate  */
+  (
+    0x00 BITS2400
+    0x01 BITS4800
+    0x02 BITS7200
+    0x03 BITS9600
+    0x04 BITS19200
+    0x05 BITS38400
+    0x06 BITS57600
+    0x07 BITS115200
+    0x08 BITS230400
+  )
+  
+/* memRemotePRNDataBits	*/
+  (
+    0x00 DATABITS5
+    0x01 DATABITS6
+    0x02 DATABITS7
+    0x03 DATABITS8
+  )
+  
+/* memRemotePRNStopBit	*/
+  (
+    0    ONESTOP
+    1    ONEHALFSTOP
+  )
+  
+/* memRemotePRNParity   */
+  (
+    0    ODDPARITY
+    1    EVENPARITY
+    2    MARKPARITY
+    3    SPACEPARITY
+    
+    7    PARITY_ENABLE_BIT
+  )
+
+/* RPN bit mask(in)     */
+  (
+     0   BIT_RATE_MASK_BIT
+     1   DATA_BITS_MASK_BIT
+     2   STOP_BITS_MASK_BIT
+     3   PARITY_MASK_BIT
+     4   PARITY_TYPE_MASK_BIT
+     5   XON_CHAR_MASK_BIT
+     6   XOFF_CHAR_MASK_BIT
+  )
+  
+/* RPN bit mask(in) 2    */
+  (
+     0   XON_XOFF_INPUT_MASK_BIT
+     1   XON_XOFF_OUTPUT_MASK_BIT
+     2	 RTR_INPUT_MASK_BIT
+     3   RTR_OUTPUT_MASK_BIT
+     4   RTC_INPUT_MASK_BIT
+     5   RTC_OUTPUT_MASK_BIT
+
+  )
+
+/* memRFCOMM_Request	*/
+  (
+    0 SEND_MSC_CMD_REQ_FLAG
+    1 SEND_AT_CKPD_REQ_FLAG
+    2 SEND_RING_REQ_FLAG
+    3 SEND_SABM_CMD
+  )
+  
+/* memRFCOMM_Misc_Flag  */
+  (
+    0 MSC_CDM_ALREADY_SEND_FLAG
+    1 CREDIT_FLOW_USED_FLAG
+    2 DONT_EMBEDDED_CREDIT_FLAG 
+    3 MSC_EXCHANGE_DONE_FLAG
+    4 FLOW_CONTROL_FCOFF_BIT            /* set when receive FCoff, clear when FCon   */
+  )
+  
+/* memRemoteMSC		*/
+  (
+    1 FLOW_CONTROL_FC_BIT		/* received MSC FC bits                      */
+  
+  )
+/* Address filed        */
+  (
+    0 ADDR_EA_BIT
+    1 ADDR_CR_BIT
+    2 ADDR_D_BIT
+  )
+//should be same as descripted in SDP
+(
+    1 SPP_SLAVE_CHANNEL
+    7 OBEX_SERVER_CHANNEL
+    8 HF_SERVER_CHANNEL 
+    9 HS_SERVER_CHANNEL
+)
+/* memRFCOMM_Flag */
+(
+	0 USING_HF_PROFILE
+	1 USING_HS_PROFILE
+	2 USING_SPP_PROFILE
+)
+/*RFCOMM Frame Type*/
+(
+	0x3f RFCOMM_FRAME_TYPE_SABM
+	0x73 RFCOMM_FRAME_TYPE_UA
+	0xEF RFCOMM_FRAME_TYPE_UIH
+	0xFF RFCOMM_FRAME_TYPE_UIH_CREDITS
+	0x53 RFCOMM_FRAME_TYPE_DISCONN
+)
+/*RFCOMM UIH CMD TYPE*/
+(
+	0x41 UIH_PARAM_NEG_CMD
+	0x40 UIH_PARAM_NEG_RES
+	0x49 UIH_PARAM_CMD_REMOVE_PORT
+	0x71 UIH_MODEM_STATUS_CMD
+	0x70 UIH_MODEM_STATUS_RES
+)
+
+/*bits in rfcomm address*/
+(
+	0 RFCOMM_ADDRESS_EXT_LEN
+	1 RFCOMM_ADDRESS_CR
+	2 RFCOMM_ADDRESS_DERECTION
+
+
+)
+
+	(                                   
+	0 RFCOMM_CHANNEL_STATE_PN_CMD
+	1 RFCOMM_CHANNEL_STATE_PN_RES
+	2 RFCOMM_CHANNEL_STATE_SABM
+	3 RFCOMM_CHANNEL_STATE_UA
+	4 RFCOMM_CHANNEL_STATE_SND_MS_CMD
+	5 RFCOMM_CHANNEL_STATE_RCV_MS_CMD
+	6 RFCOMM_CHANNEL_STATE_SND_MS_RES
+	7 RFCOMM_CHANNEL_STATE_RCV_MS_RES
+	0xff RFCOMM_CHANNEL_SETUP_COMPLETE
+	) 
+
+	/*mem_rfcomm_send_more_pkt*/
+	(
+	1 MORE_PKT_MSC_CMD_HF
+	2 MORE_PKT_MSC_CMD_HS
+	3 MORE_PKT_MSC_CMD_SPP
+	4 MORE_PKT_MSC_CMD_OBEX
+	)
+
+	(
+	127 RFCOMM_MALLOC_SIZE
+	)
\ No newline at end of file
Index: format/sdp.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/sdp.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/sdp.format	(working copy)
@@ -0,0 +1,70 @@
+
+memalloc(
+0 mem_sdp_mem_start
+8 mem_sdp_uuid_search_ptr
+2 mem_sdp_continue_byte
+1 mem_sdp_pduid
+2 mem_sdp_transactionid
+2 mem_sdp_transactionid_local
+2 mem_sdp_attribute_maxbyte
+2 mem_sdp_record_maxcnt
+4 mem_sdp_record_handle
+1 mem_sdp_LACAP_found
+1 mem_sdp_RFCOMM_found
+0 mem_sdp_handle_list
+32 mem_sdp_attrib_list
+2 mem_sdp_error_code
+2 mem_sdp_all_length
+1 mem_handle_humber
+2 mem_search_uuid
+0 mem_sdp_mem_end
+)
+xmemalloc(
+2 mem_ui_uuid_table
+22 mem_all_uuid_16bits
+34 mem_all_uuid_128bits
+2 mem_sdp_l2capch_ptr
+)
+(
+0 AGORHS_SERVICE
+1 GENAUDIO_SERVICE
+2 HANDSFREE_SERVICE
+)
+(
+0 ATTRIBUTEID_0000
+1 ATTRIBUTEID_0001
+2 ATTRIBUTEID_0004
+3 ATTRIBUTEID_0009
+4 ATTRIBUTEID_0100
+5 ATTRIBUTEID_0302
+6 ATTRIBUTEID_0006
+7 ATTRIBUTEID_0311
+)
+
+(
+0x01 SDP_ERROR_RES
+0x02 SDP_SEARCH_REQ
+0x03 SDP_SEARCH_RES
+0x04 SDP_ATTRIBUTE_REQ
+0x05 SDP_ATTRIBUTE_RES
+0x06 SDP_SEARCHATTRIB_REQ
+0x07 SDP_SEARCHATTRIB_RES
+)
+0x2600 sdp_max_amount
+250 SDP_MALLOC_SIZE
+0x6e sdp_tid_spp //any number
+
+(
+0x1f11 SDP_UUID_HS_AUDIO_GATEWAY
+)
+
+(
+0X09 SDP_ATTRIBUTE_ID
+0x0a SDP_ATTRIBUTE_RANGE
+)
+
+(//mem_sdp_handle_list
+7 SDP_MAX_HANDLE_NUMBER
+)
+
+ 
Index: format/security.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/security.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/security.format	(working copy)
@@ -0,0 +1,108 @@
+
+memalloc (
+
+
+16 mem_random_number
+16 mem_round_key
+16 mem_kinit
+
+16 mem_input_store
+16 mem_x
+15 mem_y
+1 mem_y15
+17 mem_key_store
+1 mem_key_store_end
+2 memp_ar_key
+2 memp_ar_input
+10 mem_ar_hround
+
+
+1 mem_ec_infinite
+2 mem_ec_loopc
+1 mem_aes_cmac_data_length
+
+0 memdat
+/* ecc calculation */
+
+24 mem_ax
+24  mem_ay
+24  mem_az
+24 mem_bx
+0 mem_ax_256 //32 bytes
+24 mem_by
+8 mem_bz
+16 mem_ay_256 // 32 bytes
+16 mem_cx
+8 mem_az_256 // 32 bytes
+23 mem_cy
+1 mem_cy5
+0 mem_bx_256 // 32 bytes
+24 mem_cz
+8  mem_k
+16 mem_by_256 // 31 bytes
+16 mem_align
+
+0 mem_bz_256  //32 bytes
+0 mem_tmp1
+24 memahbak
+8 mem_tmp5
+0 mem_cx_256  //32 bytes
+16 memahsave
+16  mem_tmp2
+0 mem_cy_256  // 32 bytes
+0  memahsave_end 
+1  mem_addr_padding 
+7   mem_addr_value         /* 12 bytes     */ 
+0 mem_tmp3
+5 mem_t1
+3  mem_addr_value_end   
+15 mem_addr_iocap_end
+1 mem_cy5_256 // 1 byte
+0 mem_cz_256 // 32 bytes
+0 mem_tmp0
+8 mem_t0
+16 mem_tmp0a
+8  mem_t2
+16 mem_k_256 //32 bytes
+16 mem_t3
+8  mem_tmp1_256 //32 bytes
+24 mem_t7
+
+
+32 mem_tmp5_256
+32  mem_tmp2_256
+0 mem_tmp3_256
+32 mem_t1_256
+0 mem_tmp0_256
+32 mem_t0_256
+32 mem_t2_256
+32 mem_t3_256
+32 mem_t7_256
+
+24 mem_p		
+24 mem_a
+24 mem_b
+24 mem_gx
+24 mem_gy
+32 memh0
+
+
+32 mem_p_256		
+32 mem_a_256
+32 mem_gx_256
+32 mem_gy_256
+16 mem_le_slat
+
+)
+
+xmemalloc(
+5 mem_ccm_pcnt_tx
+5 mem_ccm_pcnt_rx
+4 mem_ccm_last_mic
+0 mem_ccm_iv
+4 mem_ccm_ivm
+4 mem_ccm_ivs
+2 mem_ccm_len
+2 mem_ccm_rx_ptr
+)
+
Index: format/simple_pairing.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/simple_pairing.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/simple_pairing.format	(working copy)
@@ -0,0 +1,212 @@
+/* simple pairing page */
+
+memalloc(
+
+//4 mem_hci_ssp_mode
+0 mem_sp_state_start
+1 mem_sp_state
+1 mem_master_sp_state
+1 mem_sp_flag
+1 mem_master_sp_flag
+1 mem_sp_calc
+1 mem_sp_dh_ready
+1 mem_sp_localsm
+1 mem_pairing_auth
+
+1 mem_sp_local_key_send_count
+1 mem_sp_remote_key_recv_count
+1 mem_sp_remote_key_invalid
+1 mem_sp_dhkey_invalid
+4 mem_gkey
+0 mem_sp_state_end
+
+8 mem_le_pubkey_remote_x_256
+0 mem_sp_pubkey_remote
+24 mem_sp_pubkey_remote_x
+0 mem_sp_pubkey_remote_x_end
+8 mem_le_pubkey_remote_y_256
+24 mem_sp_pubkey_remote_y
+
+8 mem_le_dhkey_256
+24 mem_sp_dhkey
+0 mem_sp_dhkey_end
+
+16 mem_sp_random_local
+0 mem_sp_random_local_end
+16 mem_sp_random_remote
+0 mem_sp_random_remote_end
+0 memresult
+0 mem_sp_calc_result
+4 memh
+4 memg
+4 memf
+4 meme
+0 mem_sp_calc_result_high
+4 memd
+4 memc
+4 memb
+4 mema
+16 mem_sp_check_result
+16 mem_sp_confirm_remote
+16 mem_sp_prarm_stack
+)
+
+xmemalloc(
+1 mem_sc_only_mode
+1 mem_sp_debug_mode
+1 mem_secure_connections_enable
+1 mem_sp_local_key_invalid
+1 mem_sc_calc
+1 mem_sc_local_key_invalid
+
+
+32 mem_sc_private_key_256
+32 mem_sc_pubkey_local_x_256
+32 mem_sc_pubkey_local_y_256
+
+24 mem_sp_private_key
+0 mem_sp_pubkey_local
+24 mem_sp_pubkey_local_x
+0 mem_sp_pubkey_local_x_end
+24 mem_sp_pubkey_local_y
+
+1 mem_ssp_enable
+1 mem_lmp_io_cap_payload_iocap
+1 mem_lmp_io_cap_payload_oob_auth_data
+1 mem_lmp_io_cap_payload_auth_req
+
+0 mem_sp_state_xmem
+3 mem_sp_iocap_remote
+1 mem_flag_mode_ssp_pin
+1 mem_ssp_mode_flag
+1 mem_authentication_passkey_times
+1 mem_passkey_1bit
+1 mem_flag_pairing_state
+0 mem_sp_state_xmem_end
+)
+/* simple pairing status flag */
+(
+  0x00   SP_FLAG_STANDBY
+  0x01   SP_FLAG_COMMIT
+  0x02   LE_SP_FLAG_COMMIT_256
+
+)
+
+/* simple pairing calc flag */
+(
+  0x00   SP_CALC_STANDBY
+  0x01   SP_CALC_PUBKEY
+  0x02   SP_CALC_DHKEY
+  0x03   SP_CALC_PUBKEY_256
+  0x04   SP_CALC_DHKEY_256
+)
+
+/* simple pairing state */
+(
+  0x00   SP_STAT_NULL
+  0x01   SP_STAT_KEY_RECV
+  0x02   SP_STAT_KEY_GENERATE
+  0x03   SP_STAT_KEY_SEND
+  0x04   SP_STAT_COMMIT_CALC
+  0x05   SP_STAT_COMMIT_SEND
+  0x06   SP_STAT_RANDOM_RECV
+  0x07   SP_STAT_RANDOM_SEND
+  0x08   SP_STAT_CONFIRM_RECV
+  0x09   SP_STAT_CONFIRM_CHECK
+  0x0A   SP_STAT_CONFIRM_CALC
+  0x0B   SP_STAT_CONFIRM_SEND
+  0x0C   SP_STAT_LINK_KEY_CALC
+  0x0F   SP_STAT_DONE
+  0x10   SP_STAT_FEATURE_EXT_SEND
+  0x11   SP_STAT_GKEY_CALC
+  /*simple pairing master only*/
+  0x12   SP_MASTER_STAT_START_SKIP
+  0x13   SP_MASTER_STAT_START_DONE
+  0x14   SP_STAT_COMMITMENT_COMPARE
+  0x15   SP_STATE_END
+)
+
+
+/* simple paring invalid flag */
+(
+  0x00   SP_KEY_INVALID
+  0x01   SP_KEY_VALID
+  0x03   SP_KEY_VALID_256
+
+)
+
+/* encapsulated defination for P-256 key */
+(
+  0x01  ENCAPSULATED_MAJOR_TYPE
+  0x02  ENCAPSULATED_MINOR_TYPE_P256
+  0x40  ENCAPSULATED_LEN_P256
+)
+/* encapsulated defination for P-192 key */
+(
+  0x01  ENCAPSULATED_MAJOR_TYPE_P192
+  0x01  ENCAPSULATED_MINOR_TYPE_P192
+  0x30  ENCAPSULATED_LEN_P192
+)
+
+/* bluetooth 2.1 support flag */
+(
+  0x00  SIMPLE_PAIRING_ENABLE
+  0x01  ENCRYPTION_PAUSE_ENABLE
+  0x02  EXTENDED_INQUIRY_RESPOSE_ENABLE
+  0x03  SNIFF_SUBRATING_ENABLE
+)
+
+/*mem_sp_localsm*/
+(
+  0x00 DEFAULT_STATEMACHINE
+  0x01 LOCAL_STATEMACHINE
+)
+
+(
+ 0x00 DEFALT_PAIRING_AUTH
+ 0x01 PAIRING_AUTH
+)
+
+//mem_secure_connections_enable
+(
+0 SECURE_CONNECTIONS_LE_BIT
+1 SECURE_CONNECTIONS_BR_BIT
+)
+
+(
+1 SSP_MODE_SSP_PIN_FLAG
+2 SSP_MODE_PASSKEY_ENTRY_FLAG
+3 SSP_MODE_JUST_WORK_FLAG
+)
+
+(
+7 FLAG_MODE_SSP_PIN_REVICEVE_COMPARISON_BIT
+6 FLAG_MODE_SSP_PIN_RECIEVE_DHKEY_BIT
+0 FLAG_MODE_SSP_PIN_COMPARISON_RESULT_BIT
+)
+(
+1 FLAG_PAIRING_STATE_PAIRING
+0 FLAG_PAIRING_STATE_NOT_PAIRING
+)
+(//LMP_IO_CAP_REQ & LMP_IO_CAP_RES
+//IO capability
+0x00 IO_CAPABILITY_DISPLAY_ONLY
+0x01 IO_CAPABILITY_DISPLAY_YESNO
+0x02 IO_CAPABILITY_KEYBOARD_ONLY
+0x03 IO_CAPABILITY_NO_INPUT_NO_OUTPUT
+
+//oob data Present
+0x00 OOB_DATA_PRESENT_NOT_PRESENT
+0x01 OOB_DATA_PRESENT_P192_DATA
+0x02 OOB_DATA_PRESENT_P256_DATA
+0x03 OOB_DATA_PRESENT_P192_P256_DATA
+// authentication requirements
+0x00 AUTH_REQ_MITM_PROTECTION_NOT_REQUIRED_NO_BONDING
+0x01 AUTH_REQ_MITM_PROTECTION_REQUIRED_NO_BONDING
+0x02 AUTH_REQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING
+0x03 AUTH_REQ_MITM_PROTECTION_REQUIRED_DEDICATED_BONDING
+0x04 AUTH_REQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING
+0x05 AUTH_REQ_MITM_PROTECTION_REQUIRED_GENERAL_BONDING
+)
+
+  
Index: format/ui.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ui.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/ui.format	(working copy)
@@ -0,0 +1,451 @@
+/*****************************************************************************/
+/* RCS HEADER -- DO NOT ERASE                                                */
+/* $Author: Administrator $                                                           */
+/* $Id: bt_ui_format.upper,v 1.1 2009-09-28 04:06:17 Administrator Exp $     */
+/************************************************************************/
+
+
+	/* ========= memory ============== */
+memalloc(
+2 mem_UI_data_txbuff_length
+
+1 mem_ipc_skip_continue_proc
+0 mem_ui_timer_temp  //length 4
+4 mem_ipc_rega_temp
+) 
+
+xmemalloc(
+//UI Work area
+1 mem_ipc_lock_bt
+1 mem_ipc_lock_c51
+8 mem_ipc_fifo_bt2c51
+8 mem_ipc_fifo_c512bt
+
+1 mem_ui_button_timer
+1 mem_ui_button_last_state
+4 mem_ui_timer_last_btclk
+2 mem_discovery_timeout_timer_count
+1 mem_hid_handshake_timer_count
+1 memui_reconnect_mode
+2 mem_ui_state_map
+
+//UI Config area
+1 mem_ui_profile_supported
+1 mem_ui_button_timeout
+1 mem_ui_button_gpio
+2 mem_discovery_timeout
+1 mem_pin_length
+16 mem_pin
+
+)
+/************/
+/* constant */
+/************/
+
+//mem_ui_state_map
+(
+0 UI_STATE_BT_CONNECTED
+1 UI_STATE_BT_SETUP_COMPLETE
+2 UI_STATE_BT_HID_CONN
+3 UI_STATE_BT_HID_HANDSHAKE
+4 UI_STATE_BT_SPP_CONN
+5 UI_STATE_BT_SNIFF
+6 UI_STATE_BT_DISCOVERY
+7 UI_STATE_BT_RECONNECT
+8 UI_STATE_BT_SLAVE_ROLE
+9 UI_STATE_BLE_CONNECTED
+10 UI_STATE_BLE_WRITE_RCV
+11 UI_STATE_BLE_ADV
+12 UI_STATE_BTN_DOWN
+)
+
+(
+1 UI_STATE_SPP_NL_AUTO_DISCOVER
+
+)
+
+/* UI state for Headset (memui_HS_State) */ 
+   (
+    0 UI_HEADSET_DISCONNECT
+    1 UI_HEADSET_IDLE                   /* before the responsor HS receive SABM      */
+    2 UI_HEADSET_W4CONNECT
+    3 UI_HEADSET_RINGING
+    4 UI_HEADSET_CONNECTED
+    5 UI_HEADSET_PARING
+  )
+/* memui_BB_State */
+(
+  0 UI_BB_OFF
+  1 UI_BB_IDLE
+  2 UI_BB_DISCOVERY
+  3 UI_BB_CONNECTED_ACTIVE_NO_SCO
+  4 UI_BB_CONNECTED_ACTIVE_WITH_SCO
+  5 UI_BB_CONNECTED_ACTIVE_WAIT_SNIFF
+  6 UI_BB_CONNECTED_SNIFF
+  7 UI_BB_RECONNECT
+  8 UI_BB_CONNECTED_SNIFF_WITH_SCO
+)
+
+/************/
+/* flags    */
+/************/
+  
+/* memui_Misc_Flags */
+  (
+    5 NO_IDLE_TURN_OFF
+    7 ANSWER_RING_FLAG               /* 1 Answer,0 no*/
+  )
+
+/* mem_UI_SCH_Interface */
+  (
+    0  UI_HS_PAIRING 
+    2  UI_REQ_CLOSE_RFCOMM
+    3  UI_LINK_LOST
+    4  UI_REQ_OPEN_SCO
+    6  UI_REQ_CLOSE_SCO
+  )
+  
+/* memui_PassOverKey */
+  (
+    0  ANSWER_RING_BIT
+    0  AG_SEND_RING_BIT
+    1  VOL_UP_BIT
+    2  VOL_DOWN_BIT
+    3  INI_CALL_BIT
+    4  DAIL_LAST_CALL
+    5  END_CALL_BIT
+    6  NOKIA_VOICE_ACTIVE 
+    7  REJECT_CALL_BIT
+  )
+  
+/* memui_reconnect_mode */
+(
+  0 NO_RECONNECTION
+  1 RECONNECT_HID
+  2 RECONNECT_HF
+  3 RECONNECT_HS
+  4 RECONNECT_HID_HF
+  5 RECONNECT_HID_HS
+)
+/* memui_Commands */
+(
+0 BT_CMD_STANDBY
+1 BT_CMD_START_DISCOVERY
+2 BT_CMD_STOP_DISCOVERY
+3 BT_CMD_RECONNECT
+4 BT_CMD_DISCONNECT
+5 BT_CMD_ENTER_SNIFF
+6 BT_CMD_EXIT_SNIFF
+7 BT_CMD_ENTER_SNIFF_SUBRATING
+8 BT_CMD_EXIT_SNIFF_SUBRATING
+9 BT_CMD_SNIFF_TEST
+10 BT_CMD_SET_PIN_CODE
+11 BT_CMD_START_INQUIRY
+12 BT_CMD_STOP_INQUIRY
+13 BT_CMD_START_ADV
+14 BT_CMD_STOP_ADV
+15 BT_CMD_START_DIRECT_ADV
+16 BT_CMD_STOP_DIRECT_ADV
+17 BT_CMD_LE_DISCONNECT
+18 BT_CMD_LE_UPDATE_CONN
+19 BT_CMD_LED_OFF
+20 BT_CMD_LED_ON
+21 BT_CMD_LED_BLINK
+22 BT_CMD_LE_START_CONN
+23 BT_CMD_LE_START_SCAN
+24 BT_CMD_LE_STOP_SCAN
+25 BT_CMD_ENTER_HIBERNATE
+27 BT_CMD_LE_SMP_SECURITY_REQUEST
+29 BT_CMD_ROLE_SWITCH
+30 BT_CMD_BB_RECONN_CANCEL
+31 BT_CMD_STORE_RECONN_INFO_LE
+32 BT_CMD_STORE_RECONN_INFO_BT
+33 BT_CMD_DHKEY_NOT_ACCEPT
+34 BT_CMD_START_24G
+35 BT_CMD_STOP_24G
+36 BT_CMD_PAIR_24G
+37 BT_CMD_STORE_RECONN_INFO
+)
+
+(
+0x00 BT_EVT_NULL
+0x01 BT_EVT_BB_CONNECTED
+0x02 BT_EVT_BB_DISCONNECTED
+0x03 BT_EVT_RECONN_STARTED
+0x04 BT_EVT_RECONN_FAILED
+0x05 BT_EVT_SETUP_COMPLETE
+0x06 BT_EVT_HID_CONNECTED
+0x07 BT_EVT_HID_DISCONNECTED
+0x08 BT_EVT_SPP_CONNECTED
+0x09 BT_EVT_SPP_DISCONNECTED
+0x0A BT_EVT_PINCODE_REQ
+0x0B BT_EVT_ENTER_SNIFF
+0x0C BT_EVT_EXIT_SNIFF
+0x0D BT_EVT_ENTER_SNIFF_SUB
+0x0E BT_EVT_EXIT_SNIFF_SUB
+0x0F BT_EVT_DISCOVERY_STOPED
+0x10 BT_EVT_BUTTON_LONG_PRESSED
+0x12 BT_EVT_HID_HANDSHAKE
+0X13 BT_EVT_RECONN_PAGE_TIMEOUT
+0x14 BT_EVT_LE_CONNECTED
+0X15 BT_EVT_LE_DISCONNECTED
+0x16 BT_EVT_ML2CAP_CONN_REFUSED
+0x17 BT_EVT_BUTTON_ENTER_HIBERNATE
+0x18 BT_EVT_LINKKEY_GENERATE
+0x19 BT_EVT_SWITCH_NOT_ACCEPT
+0x20 BT_EVT_SWITCH_ACCEPT
+0x21 BT_EVT_SNIFF_NOT_ACCEPT
+0x22 BT_EVT_SNIFF_ACCEPT
+0x23 BT_EVT_UNSNIFF_ACCEPT
+0x24 BT_EVT_UNSNIFF_NOT_ACCEPT
+0x25 BT_EVT_BUTTON_ADJUST_DPI
+0x26 BT_EVT_SEND_UNSNIFF_ACCEPT
+0x27 BT_EVT_VIRTUAL_CABLE_UNPLUG
+0x28 BT_EVT_LE_WRITE_REQUEST
+0x29 BT_EVT_LE_ENC_INFO
+0x2a BT_EVT_SWITCH_FAIL_MASTER
+0x2b BT_EVT_SWITCH_SUCCESS_MASTER
+0x2c BT_EVT_BUTTON_DOWN
+0x2d BT_EVT_BUTTON_UP
+0x2e BT_EVT_REMOTE_UNSNIFF
+0x30 BT_EVT_LE_PAIRING_FAIL
+0x31 BT_EVT_LE_PAIRING_SUCCESS
+0x32 BT_EVT_LE_START_ENC
+0X33 BT_EVT_LE_PAUSE_ENC
+0X34 BT_EVT_LE_TK_GENERATE
+0x35 BT_EVT_BT_GKEY_GENERATE
+0x36 BT_EVT_BT_GET_PASSKEY
+0x37 BT_EVT_BT_PAIRING_FAIL
+0x38 BT_EVT_BT_PAIRING_SUCCESS
+0x39 BT_EVT_24G_PAIRING_COMPLETE
+0x3a BT_EVT_24G_ATTEMPT_FAIL
+0x3b BT_EVT_LE_GKEY_GENERATE
+0x3c BT_EVT_24G_ATTEMPT_SUCCESS
+0x3d BT_EVT_STORE_NVRAM
+0x3e BT_EVT_LE_PAIRING_COMPLETE
+0x3F BT_EVT_LE_RECONNECT_COMPLETE
+0x40 BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP
+0x41 BT_EVT_LE_LTK_LOST
+0x42 BT_EVT_LE_UPDATE_PHY
+0x43 BT_EVT_LE_GET_PASSKEY
+0x44 BT_EVT_LE_PARSE_CONN_PARAM_ACCEPTED
+)
+//switch
+(
+0 OFF
+1 ON
+)
+/* memui_mem_lock */
+(
+    0 MEM_UNLOCK
+    1 MEM_LOCK
+)
+/* memui_flag0 */
+(
+    0 UI_USER_DATA_FLAG
+    1 UI_WII_WAITING_SLEEP
+    2 UI_KEYBOARD_SNIFF_SKIP
+)
+/* mem_master_type */
+(
+    0 MTYPE_HID_DEFAULT
+    1 MTYPE_HID_SSP
+    2 MTYPE_SPP
+)
+
+	(	
+	0x01 RECIEVE_SDP_CONN_RES
+	0x02 RECIEVE_SDP_CFG_REQ
+	0x03 RECIEVE_SDP_CFG_RES
+	0x04 RECIEVE_RFCOMM_CONN_RES
+	0x05 RECIEVE_RFCOMM_CFG_REQ
+	0x06 RECIEVE_RFCOMM_CFG_RES
+	0x07 RECIEVE_HID_CTRL_CONN_RES
+	0x08 RECIEVE_HID_CTRL_CFG_REQ
+	0x09 RECIEVE_HID_CTRL_CFG_RES
+	0x0A RECIEVE_HID_INT_CONN_RES
+	0x0B RECIEVE_HID_INT_CFG_REQ
+	0x0C RECIEVE_HID_INT_CFG_RES
+	0x0D RECIEVE_AVCTP_CONN_RES
+	0x0E RECIEVE_AVCTP_CFG_REQ
+	0x0F RECIEVE_AVCTP_CFG_RES
+	0x10 RECIEVE_AVDTP_SIGNAL_CONN_RES
+	0x11 RECIEVE_AVDTP_SIGNAL_CFG_REQ
+	0x12 RECIEVE_AVDTP_SIGNAL_CFG_RES
+	0x13 RECIEVE_AVDTP_MEDIA_CONN_RES
+	0x14 RECIEVE_AVDTP_MEDIA_CFG_REQ
+	0x15 RECIEVE_AVDTP_MEDIA_CFG_RES
+	0x16 RECIEVE_SS_REASULT_HS                  
+	0x17 RECIEVE_SS_REASULT_HF                  
+	0x18 RECIEVE_SS_REASULT_AVTARG		          
+	0x19 RECIEVE_SS_REASULT_OBEX		            
+	0x1A RECIEVE_DLCI0_UA
+	0x1B RECIEVE_HS_PARAM_NEG_RES
+	0x1C RECIEVE_HS_UA
+	0x1D RECIEVE_HS_MODEM_STATUS_RES
+	0x1E RECIEVE_HS_MODEm_STATUS_CMD
+	0x1F RECIEVE_HF_PARAM_NEG_RES   
+	0x20 RECIEVE_HF_UA              
+	0x21 RECIEVE_HF_MODEM_STATUS_RES
+	0x22 RECIEVE_HF_MODEm_STATUS_CMD 
+	0x23 RECIEVE_OBEX_PARAM_NEG_RES     
+	0x24 RECIEVE_OBEX_UA              
+	0x25 RECIEVE_OBEX_MODEM_STATUS_RES
+	0x26 RECIEVE_OBEX_MODEm_STATUS_CMD    
+	0x27 RECIEVE_SPP_PARAM_NEG_RES   
+	0x28 RECIEVE_SPP_UA              
+	0x29 RECIEVE_SPP_MODEM_STATUS_RES
+	0x2A RECIEVE_SPP_MODEm_STATUS_CMD
+	0x2b RECIEVE_SDP_DISCONN_RES
+	)
+
+
+
+	(
+	0 UPPERSM_RP_IDLE
+	1 UPPERSM_RP_SDP_CONN
+	2 UPPERSM_RP_SDP_CONN_WAIT
+	3 UPPERSM_RP_SDP_CFG
+	4 UPPERSM_RP_SDP_CFG_WAIT
+	5 UPPERSM_RP_SS_AVTARG
+	6 UPPERSM_RP_SS_AVTARG_WAIT
+	7 UPPERSM_RP_SS_OBEX
+	8 UPPERSM_RP_SS_OBEX_WAIT
+	9 UPPERSM_RP_SDP_DISCONN
+	10 UPPERSM_RP_SDP_DISCONN_WAIT
+	11 UPPERSM_RP_AVDTP_CONN_WAIT
+	12 UPPERSM_RP_AVCTP_CONN
+	13 UPPERSM_RP_AVCTP_CONN_WAIT
+	14 UPPERSM_RP_AVCTP_CFG
+	15 UPPERSM_RP_AVCTP_CFG_WAIT
+	16 UPPERSM_RP_OBEX_CMD_PN
+	17 UPPERSM_RP_OBEX_CMD_PN_WAIT
+	18 UPPERSM_RP_OBEX_SABM
+	19 UPPERSM_RP_OBEX_SABM_WAIT
+	20 UPPERSM_RP_OBEX_CMD_MS
+	21 UPPERSM_RP_OBEX_CMD_MS_WAIT
+	)
+	(		/*mem_upper_sm_reconn*/
+	0 UPPERSM_RECONN_IDLE		
+	1 UPPERSM_RECONN_SDP_CONN		
+	2 UPPERSM_RECONN_SDP_CONN_WAIT		
+	3 UPPERSM_RECONN_SDP_CFG		
+	4 UPPERSM_RECONN_SDP_CFG_WAIT		
+	5 UPPERSM_RECONN_SS_HS
+	6 UPPERSM_RECONN_SS_HS_WAIT
+	7 UPPERSM_RECONN_SS_HF
+	8 UPPERSM_RECONN_SS_HF_WAIT
+	9 UPPERSM_RECONN_SS_AVTARG		
+	10 UPPERSM_RECONN_SS_AVTARG_WAIT		    
+	11 UPPERSM_RECONN_SS_OBEX		            
+	12 UPPERSM_RECONN_SS_OBEX_WAIT		      
+	13 UPPERSM_RECONN_SDP_DISCONN		        
+	14 UPPERSM_RECONN_SDP_DISCONN_WAIT      
+	15 UPPERSM_RECONN_HID_CTRL_CONN		      
+	16 UPPERSM_RECONN_HID_CTRL_CONN_WAIT		
+	17 UPPERSM_RECONN_HID_CTRL_CFG		      
+	18 UPPERSM_RECONN_HID_CTRL_CFG_WAIT     
+	19 UPPERSM_RECONN_HID_INT_CONN		      
+	20 UPPERSM_RECONN_HID_INT_CONN_WAIT		  
+	21 UPPERSM_RECONN_HID_INT_CFG		        
+	22 UPPERSM_RECONN_HID_INT_CFG_WAIT      
+	23 UPPERSM_RECONN_RFCOMM_CONN		        
+	24 UPPERSM_RECONN_RFCOMM_CONN_WAIT		  
+	25 UPPERSM_RECONN_RFCOMM_CFG		        
+	26 UPPERSM_RECONN_RFCOMM_CFG_WAIT       
+	27 UPPERSM_RECONN_RFCOMM_SABM		        
+	28 UPPERSM_RECONN_RFCOMM_SABM_WAIT		  
+	29 UPPERSM_RECONN_SPP_CMD_PN		        
+	30 UPPERSM_RECONN_SPP_CMD_PN_WAIT		    
+	31 UPPERSM_RECONN_SPP_SABM		          
+	32 UPPERSM_RECONN_SPP_SABM_WAIT		      
+	33 UPPERSM_RECONN_SPP_CMD_MS		        
+	34 UPPERSM_RECONN_SPP_CMD_MS_WAIT       
+	35 UPPERSM_RECONN_HF_CMD_PN		          
+	36 UPPERSM_RECONN_HF_CMD_PN_WAIT		    
+	37 UPPERSM_RECONN_HF_SABM		            
+	38 UPPERSM_RECONN_HF_SABM_WAIT		      
+	39 UPPERSM_RECONN_HF_CMD_MS		          
+	40 UPPERSM_RECONN_HF_CMD_MS_WAIT        
+	41 UPPERSM_RECONN_AVDTPs_CONN		        
+	42 UPPERSM_RECONN_AVDTPs_CONN_WAIT		  
+	43 UPPERSM_RECONN_AVDTPs_CFG		        
+	44 UPPERSM_RECONN_AVDTPs_CFG_WAIT       
+	45 UPPERSM_RECONN_AVDTPm_CONN		        
+	46 UPPERSM_RECONN_AVDTPm_CONN_WAIT		  
+	47 UPPERSM_RECONN_AVDTPm_CFG		        
+	48 UPPERSM_RECONN_AVDTPm_CFG_WAIT       
+	49 UPPERSM_RECONN_AVCTP_CONN		        
+	50 UPPERSM_RECONN_AVCTP_CONN_WAIT		    
+	51 UPPERSM_RECONN_AVCTP_CFG		          
+	52 UPPERSM_RECONN_AVCTP_CFG_WAIT		    
+	53 UPPERSM_RECONN_OBEX_CMD_PN		        
+	54 UPPERSM_RECONN_OBEX_CMD_PN_WAIT		  
+	55 UPPERSM_RECONN_OBEX_SABM		          
+	56 UPPERSM_RECONN_OBEX_SABM_WAIT		    
+	57 UPPERSM_RECONN_OBEX_CMD_MS		        
+	58 UPPERSM_RECONN_OBEX_CMD_MS_WAIT     
+	59 UPPERSM_RECONN_SS_SPP
+	60 UPPERSM_RECONN_SS_SPP_WAIT
+	)
+	(/*mem_UI_profile_supported*/
+	0 support_HID
+	1 support_A2DP
+	2 support_AVRCP
+	3 support_HF
+	4 support_HS
+	5 support_PBAP
+	6 support_SPP
+	)
+	/*mem_upper_sm_ss*/
+	(
+	0 UPPERSM_SS_HS
+	1 UPPERSM_SS_HF
+	2 UPPERSM_SS_AVTARG
+	3 UPPERSM_SS_OBEX
+	)
+
+	(
+	160 UI_HUNDRED_MILLISECOND_TIME
+	0XFF UI_BUTTON_GPIO_DISABLE
+	)
+	(
+	0x01 UI_BB_INCONNECT
+	0x10 UI_BB_DISCONNECT
+	)
+(
+0x00 UI_BUTTON_STATE_DOWN
+0x01 UI_BUTTON_STATE_UP
+)
+
+//mem_ipc_skip_continue_proc
+(
+	0 IPC_CONTINUE_PROCESS
+	1 IPC_SKIP_CONTINUE_PROCESS
+)
+
+
+(//led style struct 
+0 		LED_OFFSET_LED_TYPE
+1 		LED_OFFSET_BLINK_COUNT
+2		LED_OFFSET_LED_GPIO
+3		LED_OFFSET_ON_TIME
+5		LED_OFFSET_OFF_TIME
+7 		LED_OFFSET_CB_LEDON
+9		LED_OFFSET_CB_LEDOFF
+11		LED_OFFSET_LENGTH
+)
+
+(//LED state
+0 UI_LED_STATE_BLINK_STOP
+1 UI_LED_STATE_BLINK_START
+2 UI_LED_STATE_LIGHTING
+3 UI_LED_STATE_DARKING
+4 UI_LED_STATE_BLINK_LIGHTING
+5 UI_LED_STATE_BLINK_DARKING
+
+0xFF LED_INFINITE_FLASH_NUM
+
+)
+
+
Index: format/usb.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/usb.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/usb.format	(working copy)
@@ -0,0 +1,254 @@
+memalloc usb(
+1 mem_usb_status
+1 mem_usb_fifo_empty
+2 mem_usb_read_len
+65 mem_usb_txbuf
+10 mem_usb_txbuf1
+10 mem_usb_txbuf2
+64 mem_usb_rxbuf
+1 mem_usb_rxbuf_end
+2 mem_bufptr
+1 mem_remain
+2 mem_hidreportdesc_kb
+2 mem_hidreportdesc_m
+19 mem_devicedesc
+60 mem_confdesc
+5 mem_string0
+30 mem_string1
+30 mem_string2
+30 mem_string3
+2 mem_cb_usb_config
+
+1 mem_usb_tx_interval
+9 mem_usb_vid_pid
+2 mem_usb_zero_packet
+2 mem_usb_ones_packet
+2 mem_usb_two_packet
+1 mem_usb0_state
+1 mem_usb_offline_check_gpio
+
+0 mem_usb_clear_mem_start
+0 mem_usb_setup
+1 mem_usb_setup_bmRequestType
+1 mem_usb_setup_bRequest
+1 mem_usb_setup_bValue
+1 mem_usb_setup_bValueH
+2 mem_usb_setup_wIndex
+1 mem_usb_setup_bLength
+1 mem_usb_setup_bLengthH
+64 mem_usb0_set_report_data
+64 mem_usb0_get_report_data
+2 mem_usb_setup_bValue_temp
+1 mem_usb0_get_set_report
+1 mem_usb0_data_ready_report
+1 mem_usb_tx_win_enable
+1 mem_usb_tx_mac_enable
+1 mem_usb_idle_flag
+1 mem_usb_idle_rate
+1 mem_usb_get_protocol_flag
+1 mem_usb_set_protocol_status
+1 mem_usb_set_protocol_value
+1 mem_usb_state
+1 mem_usb_remote_wakeup
+1 mem_usb_clear_remote_wakeup
+1 mem_sdsystem_wakeup_flag
+1 mem_usb_ep0_stall_status
+1 mem_usb_ep1_stall_status
+1 mem_usb_ep2_stall_status
+1 mem_usb_ep3_stall_status
+2 mem_dsc_info_data_pointer
+1 mem_dsc_info_len
+1 mem_usb_ep1_data
+1 mem_usb_ep2_data
+1 mem_usb_tx_enable
+1 mem_usb_device_enumeration_endflag
+1 mem_usb_wakestate_onetime_flag
+1 mem_usb_mac_wakeup_trig
+1 mem_usb_set_high_addr_flag
+1 mem_usb_clear_halt
+16 mem_usb_mouse_data
+16 mem_usb_kb_data
+16 mem_usb_kb_multikey
+16 mem_usb_kb_system
+2 mem_usb_test_cnt
+10 mem_usb_test_kb
+0 mem_usb_clear_mem_end
+
+)
+
+//class type
+(
+0x00 STANDARD_REQ
+0x01 CLASS_REQ
+0x02 MANUFACTURER_REQ
+)
+//Standard Request Codes
+(
+0x00 GET_STATUS                // Code for Get Status
+0x01 CLEAR_FEATURE             // Code for Clear Feature
+0x03 SET_FEATURE              // Code for Set Feature
+0x05 SET_ADDRESS              // Code for Set Address
+0x06 GET_DESCRIPTOR           // Code for Get Descriptor
+0x07 SET_DESCRIPTOR           // Code for Set Descriptor(not used)
+0x08 GET_CONFIGURATION        // Code for Get Configuration
+0x09 SET_CONFIGURATION        // Code for Set Configuration
+0x0A GET_INTERFACE            // Code for Get Interface
+0x0B SET_INTERFACE            // Code for Set Interface
+0x0C SYNCH_FRAME              // Code for Synch Frame(not used)
+)
+//Standard Descriptor Types
+(
+0x01 DSC_DEVICE               // Device Descriptor
+0x02 DSC_CONFIG               // Configuration Descriptor
+0x03 DSC_STRING               // String Descriptor
+0x04 DSC_INTERFACE            // Interface Descriptor
+0x05 DSC_ENDPOINT             // Endpoint Descriptor
+)
+//HID Descriptor Types
+(
+0x21 DSC_HID			      // HID Class Descriptor
+0x22 DSC_HID_REPORT			  // HID Report Descriptor
+)
+//Define bmRequestType bitmaps
+(
+0x80 IN_DEVICE                // Request made to device,
+                              // direction is IN
+0x00 OUT_DEVICE               // Request made to device,
+                              // direction is OUT
+0x81 IN_INTERFACE             // Request made to interface,
+                              // direction is IN
+0x01 OUT_INTERFACE            // Request made to interface,
+                              // direction is OUT
+0x82 IN_ENDPOINT              // Request made to endpoint,
+                              // direction is IN
+0x02 OUT_ENDPOINT             // Request made to endpoint,
+)
+//HID Request Codes
+(
+0x01 GET_REPORT 		       // Code for Get Report
+0x02 GET_IDLE				   // Code for Get Idle
+0x03 GET_PROTOCOL			   // Code for Get Protocol
+0x09 SET_REPORT				   // Code for Set Report
+0x0A SET_IDLE				   // Code for Set Idle
+0x0B SET_PROTOCOL			   // Code for Set Protocol
+0xF2 HID_REPORT_ID           
+64 EP0_PACKET_SIZE         
+6 EP1_PACKET_SIZE         
+16 HID_REPORT_SIZE         
+0x001B HID_REPORT_DESCRIPTOR_SIZE    
+)
+//math cordic
+(
+0 TYPE_SIN		
+1 TYPE_ATAN	
+2 TYPE_MULT	
+3 TYPE_DIV		
+4 TYPE_ASIN	
+5 TYPE_SQRT	
+6 TYPE_COS		
+7 TYPE_TAN		 
+)
+   
+(
+0 DFIFO0_IN_EMPTY
+1 DFIFO1_IN_EMPTY
+2 DFIFO2_IN_EMPTY
+3 DFIFO3_IN_EMPTY
+4 DFIFO0_OUT_EMPTY
+5 DFIFO1_OUT_EMPTY
+6 DFIFO2_OUT_EMPTY
+7 DFIFO3_OUT_EMPTY
+)
+
+(
+)
+
+(
+0 USB_STATUS_SETUP
+1 USB_STATUS_SUSPEND
+2 USB_STATUS_NAK
+3 USB_STATUS_RESET
+4 USB_STATUS_ACK
+5 USB_STATUS_RXREADY
+6 USB_STATUS_TXEMPTY
+6 USB_STATUS_RXEMPTY
+)
+
+(
+1 USB_GOT_REPORT_REQ
+2 USB_CONNECTED
+3 USB_SLEEP
+4 USB_RESUME
+5 USB_SETIDLE_1
+)
+
+(
+0x10 USB_EP1_KB
+0x20 USB_EP2_MS
+0x21 USB_EP2_MULTIKEY
+0x22 USB_EP2_SYSTEMKEY
+0x01 MAC_BOOT_MODE
+0x02 R_KEY
+0x03 LR_KEY
+)
+
+
+(
+0x01ba PC_GET_REPORT
+0x02ba PC_SET_REPORT
+0x0200 PC_SET_REPORT_bValue
+0x0000 PC_SET_REPORT_wIndex
+0x0001 PC_SET_REPORT_bLength
+0xba PC_REPORT_ID
+
+0x01 PC_GET_DATA
+0x00 PC_GET_NONDATA
+)
+
+(
+//--------------------------------------------------
+// Define device states
+0x00 DEV_ATTACHED	// Device is in Attached State
+0x01 DEV_POWERED	// Device is in Powered State
+0x02 DEV_DEFAULT		// Device is in Default State
+0x03 DEV_ADDRESS	// Device is in Addressed State
+0x04 DEV_CONFIGURED	// Device is in Configured State
+0x05 DEV_SUSPENDED	// Device is in Suspended State
+)
+
+(
+// Define wIndex bitmaps
+0x81 IN_EP1                    // Index values used by Set and Clear
+0x01 OUT_EP1                   // commands for Endpoint_Halt
+0x82 IN_EP2              
+0x02 OUT_EP2             
+0x83 IN_EP3              
+0x03 OUT_EP3             
+)
+
+(
+0 EP0_STALL
+1 EP1_IN_STALL
+2 EP1_OUT_STALL
+3 EP2_IN_STALL
+4 EP2_OUT_STALL
+5 EP3_IN_STALL
+6 EP3_OUT_STALL
+)
+
+(
+// Define wValue bitmaps for Standard Feature Selectors
+0x00 ENDPOINT_HALT             // Endpoint_Halt feature selector
+0x01 DEVICE_REMOTE_WAKEUP      // Remote wakeup feature(not used)
+0x00 BOOT_PROTOCOL
+0x01 REPORT_PROTOCOL
+0x01 USB_MAX_NUM_CFG
+)
+
+(
+0 TIMER_NAK
+640 TIMER_NAK_DELAY
+15 TIMER_WAKEUP
+5000 TIMER_WAKEUP_DELAY
+)
+
Index: format/utility.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/utility.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/utility.format	(working copy)
@@ -0,0 +1,191 @@
+
+memalloc(
+
+/*
+    temp parameter
+*/
+2 mem_hold_contr
+2 mem_hold_contw
+1 mem_fifo_temp
+
+8 mem_pdatatemp
+8 mem_temp //8 bytes
+4 mem_timeup // 4 bytes
+4 mem_rega //4 bytes
+4 mem_regb //4 bytes
+3 mem_regc //3 bytes
+2 mem_contr //2 bytes
+2 mem_contw //2 bytes
+2 mem_contus
+2 mem_contue
+2 mem_contu
+2 mem_queue
+2 mem_loopcnt
+
+
+1 mem_wakup_from_power_flag
+4 mem_saved_gpio_in
+
+0 mem_module_rx_error_data_buffer
+0 mem_shutter_random_mac_data_temp
+0 mem_shutter_config_data_temp
+0 mem_le_adv_channel_map_temp
+0 mem_le_data_len_temp	//1byte
+0 mem_tx_fifo_map_temp
+0 mem_rpn_dlci		//1byte
+0 mem_event_cmd_response_content	//2byte
+0 mem_le_prand		//16byte
+0 mem_AES_CMAC_k	 //16 bytes
+0 mem_regext_index 	//1 bytes
+1 mem_temp_block0
+0 mem_le_data_temp	//15bytes
+15 mem_temp_block1
+0 mem_le_aes_128	//16byte
+0 mem_regext   //64 bytes
+0 mem_AES_CMAC_k1  //16 bytes
+16 mem_temp_block2
+0 mem_AES_CMAC_k2  //16 bytes
+16 mem_temp_block3
+0 mem_AES_CMAC_temp  // 16 bytes
+16 mem_temp_block4
+0 mem_AES_CMAC_M_last // 16 bytes
+1 mem_module_uart_cmd
+1 mem_module_uart_opcode
+1 mem_module_uart_len
+1 mem_module_temp_nl_discard_packet
+12 mem_temp_block5
+0 mem_le_mackey //16 bytes
+0 mem_app_receive_temp
+2 mem_key_value_temp
+2 mem_key_value
+1 mem_key_value_temp1
+1 mem_key_value_temp2
+1 mem_key_value_temp3
+1 mem_key_value_temp4
+1 mem_key_value_temp5
+1 mem_key_value_temp6
+6 mem_temp_block6
+
+3 mem_scale_ratio
+3 mem_xcnt
+2 mem_scale_ratio_temp
+)
+
+
+(
+/*mem_util_timer_flag0_7*/
+    0   UTIL_TIMER_0_USED
+    1   UTIL_TIMER_1_USED
+    2   UTIL_TIMER_2_USED
+    3   UTIL_TIMER_3_USED
+    4   UTIL_TIMER_4_USED
+    5   UTIL_TIMER_5_USED
+    6   UTIL_TIMER_6_USED
+    7   UTIL_TIMER_7_USED
+/*mem_util_timer_flag8_15*/
+    0   UTIL_TIMER_8_USED
+    1   UTIL_TIMER_9_USED
+    2   UTIL_TIMER_10_USED
+    3   UTIL_TIMER_11_USED
+    4   UTIL_TIMER_12_USED
+    5   UTIL_TIMER_13_USED
+    6   UTIL_TIMER_14_USED
+    7   UTIL_TIMER_15_USED
+)
+
+/* 24g */
+(
+6 dlen_24g
+14 plen_24g
+90 blen_tx_24g
+106 blen_rx_24g
+42 blen_txack_24g
+58 blen_rxack_24g
+0xaaf08e acc_24g
+0x15c4 crc_data_3byte
+0xbb81 crc_data_6byte
+0x4160 crc_ack
+)
+
+//util fifo param
+(
+
+8 UTIL_FIFO_LEN
+-1 UTIL_FIFO_OFFSET
+)
+
+
+(
+	0xAA DEBUGLOG_HEAD
+	0x00 DEBUGLOG_TYPE
+	0x04 DEBUGLOG_LEN
+	0xBB DEBUGLOG_TAIL
+)
+
+(
+	0x1000 DEBUGLOG_DTYPE_CALLBACK
+	0x1001 DEBUGLOG_DTYPE_EVENT
+	0x1002 DEBUGLOG_DTYPE_CMD
+	0x1003 DEBUGLOG_DTYPE_STATUS
+	0x1004 DEBUGLOG_DTYPE_MISC
+	0x1005 DEBUGLOG_DTYPE_PARSE_LMP
+	0x1006 DEBUGLOG_DTYPE_SEND_LMP
+	0x1007 DEBUGLOG_DTYPE_CONN_SM
+	0x1008 DEBUGLOG_DTYPE_UPPER_SM
+)
+
+//DEBUGLOG_DTYPE_CALLBACK
+(
+	0x0000 CALLBACK_24G_DATA
+	0x0001 CALLBACK_LE_PROCESS
+	0x0002 CALLBACK_BT_PROCESS
+	0x0003 CALLBACK_BEFORE_LPM
+	0x0004 CALLBACK_BB_EVENT_PROCESS
+	0x0005 CALLBACK_IDLE_PROCESS
+	0x0006 CALLBACK_BEFORE_HIBERNATE
+	0x0007 CALLBACK_ATT_WRITE
+	0x0008 CALLBACK_EVENT_TIMER
+	0x0009 CALLBACK_SLAVE_LOOP
+	0x000a CALLBACK_SDP_PROCESS
+)
+
+//DEBUGLOG_DTYPE_EVENT
+//(
+
+//)
+
+//DEBUGLOG_DTYPE_CMD
+//(
+
+//)
+
+//DEBUGLOG_DTYPE_STATUS
+(
+	0x0000 STATUS_CODE_WAKE
+	0x0001 STATUS_LPM_WAKE
+	0x0002 STATUS_INQUIRY_SCAN
+	0x0003 STATUS_SEND_EIR
+	0x0004 STATUS_PAGE_SCAN
+	0x0005 STATUS_PAGE_SCAN_RECV_ID_PACK
+	0x0006 STATUS_PAGE_SCAN_WAIT_FHS
+	0x0007 STATUS_PAGE_SCAN_CONNECTED
+	0x0008 STATUS_START_DISCOVER
+	0x0009 STATUS_STOP_DISCOVER
+)
+//DEBUG_DTYPE_MISC
+(
+	0x0000 MISC_LE_RETRANSMIT
+	0x0001 MISC_LOST_MOUSEDATA
+	0x0002 MISC_TXPOWER_0
+	0x0003 MISC_TXPOWER_1
+	0x0004 MISC_TXPOWER_2
+	0x0005 MISC_BT_RETRANSMIT
+	0x0006 MISC_BT_UPPER_SM_ERR
+	0x0007 MISC_BT_CONN_SM_ERR
+)
+
+//mem_creat_mouse_flag
+(
+	0x55 CREAT_MOUSE_DATA_OK
+	0x00 CREAT_MOUSE_DATA_FAIL
+
Index: format/var.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/var.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/format/var.format	(working copy)
@@ -0,0 +1,442 @@
+/************************************************************************/
+/* RCS HEADER -- DO NOT ERASE                                           */
+/* $Author: Administrator $                                                     */
+/* $Id: bt_var.osi,v 1.1 2009-09-28 04:06:18 Administrator Exp $   */
+/* Orisil Technology                                                 */
+/************************************************************************/
+
+
+/* packet types */
+(
+  0x02 FHS_PACKET 
+  0x03 DM1_PACKET 
+  0x03 DM1_LMP_PACKET 
+  0x04 DH1_PACKET 
+  0x05 HV1_PACKET 
+  0x06 HV2_PACKET 
+  0x07 HV3_PACKET 
+  0x08 DV_PACKET 
+  0x09 AUX1_PACKET 
+  0x0a DM3_PACKET 
+  0x0b DH3_PACKET 
+  0x0e DM5_PACKET 
+  0x0f DH5_PACKET 
+)
+
+
+/* mem_lmp_respond */
+(
+  0 RESPOND_TO_ALL
+  1 PASS_EVERYTHING
+  2 PASS_ONLY_UNKNOWNS
+  3 RESPOND_TO_LMPS
+)
+/* SCO algorithm defines */
+(
+  0 ULAW
+  1 ALAW
+  2 CVSD
+)
+/* encryption modes */
+(
+  0 NO_ENCRYPTION
+  1 PT_PT_ENCRYPTION
+  2 PT_BROADCAST_ENCRYPTION
+)
+
+/* bits used in mem_lmp_state1 variable */
+(
+  0 LMP_STATE_DETACH
+  1 LMP_STATE_HOLD
+  2 LMP_STATE_SNIFF
+  3 LMP_STATE_PARK
+  4 LMP_STATE_WAIT_SCO_CREATE
+  5 LMP_STATE_WAIT_SCO_KILL
+  6 LMP_STATE_SCO3
+  7 LMP_STATE_WAIT_SCO_START
+)
+/* mem_lmp_state2 */
+(
+  0 LMP_WAIT_FOR_SNIFF_ACCEPT
+  1 LMP_WAIT_FOR_PARK_ACCEPT
+  2 LMP_SEND_UNPARK_ACCEPTED
+  3 LMP_SEND_ENCRYPTION_START
+  4 LMP_SEND_ENCRYPTION_STOP
+  5 MESSAGE_QUEUE
+  7 LMP_STATE_WAIT_BEACON
+)
+/* mem_lmp_state3 */
+(
+ 0 INQUIRY_STATE_CHECK
+ 1 HOST_DELAY_MESSAGE
+ 2 VARIABLE_DELAY
+ 3 TEST_MODE_START_LOOPBACK
+ 4 TEST_MODE_START_PATTERN
+ 5 PARSE_TEST_CONTROL_MESSAGE
+ 6 H_AUTH_SEND_COMB_KEY
+)
+/* mem_rx_status */
+(
+  0 FROM_MASTER
+)
+/* mem_ms_flag */
+(
+  0 MS_RECEIVE_SWITCH_REQ
+  1 MS_SEND_SETUP_COMPLATE
+)
+/* mem_conn_sm */
+(
+  0 CONN_SM_STANDBY
+  1 CONN_SM_WAIT_PAGE
+  2 CONN_SM_SEND_FEATURES
+  3 CONN_SM_WAIT_FEATURES_RES
+  4 CONN_SM_SEND_CONN_REQ
+  5 CONN_SM_WAIT_CONN_ACCEPT
+  6 CONN_SM_AUTH_PAIR
+  7 CONN_SM_AUTH_PAIR_WAIT
+  8 CONN_SM_WAIT_MUTAL_AUTH
+  9 CONN_SM_ENCRYPT
+  0xa CONN_SM_ENCRYPT_WAIT
+  0xb CONN_SM_ENCRYPT_WAIT_CLEAR
+  0xc CONN_SM_SEND_SETUP_COMPLETE
+  0xd CONN_SM_WAIT_SETUP_COMPLETE 
+  0xe CONN_SM_SEND_SWITCH
+  0xf CONN_SM_DETACH_DELAY
+  0x10 CONN_SM_WAIT_SWITCH_AFTER_HOST_CONNECTION
+  0x11 CONN_SM_DELAY_RESTART_CONNECTION
+  0x12 CONN_SM_SEND_VERSION
+  0X13 CONN_SM_WAIT_VERSION
+  0x14 CONN_SM_SEND_FEATURES_EXT
+  0x15 CONN_SM_WAIT_FEATURES_EXT
+  0x16 CONN_SM_PAIRING
+  0x17 CONN_SM_AUTH
+  0x18 CONN_SM_PAIRING_WAIT
+  0x19 CONN_SM_AUTH_WAIT
+  0x1a CONN_SM_DONE
+  0x1b CONN_SM_WAIT_DONE
+)
+
+/* btStateConn1 */
+(
+  0 CONN_STANDBY
+  1 CONN_MASTER_SEND_CONN_REQ
+  2 CONN_MASTER_WAIT_FOR_CONN_ACCEPTED
+  3 CONN_MASTER_AUTH
+  4 CONN_MASTER_WAIT_FOR_FEATURES
+  5 CONN_MASTER_WAIT_FOR_SETUP_COMPLETE
+  6 CONN_MASTER_WAIT_FOR_MAX_SLOT
+  7 CONN_SLAVE_CONN_REQUESTED
+  8 CONN_SLAVE_WAIT_FOR_SETUP_COMPLETE
+  9 CONN_SLAVE_AUTH
+  10 CONN_USING_HOST_OPCODE
+  11 CONN_SLAVE_AUTH_WAIT
+  12 CONN_SLAVE_ENCRYPT_WAIT
+)
+
+/* mem_lmp_conn_state */
+(
+  0 RECEIVED_CONN_REQ
+  1 SENT_CONN_REQ
+  2 RECEIVED_SETUP_COMPLETE
+  3 SENT_SETUP_COMPLETE
+  4 HOST_CONNECTION_MADE
+  6 INIT_COMPLETE
+  7 SNIFF_NEGOTIATE
+)
+/* btStateAuth1 */
+(
+  0 WAIT_FOR_KINIT
+  1 WAIT_FOR_LKA
+  2 WAIT_FOR_LKB
+  3 WAIT_FOR_SRES
+  4 EXAMINE_RECEIVED_SRES
+  5 SEND_AU_RAND
+  6 WAIT_FOR_KC
+  7 DELAYED_ENCRYPT_RESPONSE
+)
+/* btStateAuth2 */
+(
+  0 SENT_SRES
+  1 RECEIVED_IN_RAND
+  2 SENT_AU_RAND
+  3 AUTHENTICATION_FAILED
+  4 AUTHENTICATION_PASSED
+  5 STARTED_AUTH
+  6 SENT_COMB_KEY
+  7 SENT_IN_RAND
+)
+/* btStateAuth3 */
+(
+  0 RECEIVED_AU_RAND
+  1 RECEIVED_SRES
+  2 MUTUALLY_AUTHENTICATE
+)
+/* btStateHost */
+(
+  0 H_AUTH_STARTED
+  2 H_ENCRYPTION_MODE_REQ_PT
+  3 H_ENCRYPTION_KEY_SIZE
+  4 H_ENCRYPTION_START
+  5 H_ENCRYPTION_STOP
+  6 H_AUTH_SECOND_TRY
+)
+/* btStateEncrypt2 */
+(
+  0 RECEIVED_ENCRYPT_MODE_REQ_PT
+  1 RECEIVED_ENCRYPT_KEY_SIZE
+  2 RECEIVED_ENCRYPT_START
+  3 RECEIVED_ENCRYPT_STOP
+  4 STARTED_ENCRYPT_START
+)
+/* mem_ms_state */
+(
+  0x00 MS_STANDBY
+  0x11 M_MINIT_1
+  0x12 M_MINIT_2
+  0x20 M_SINIT_0
+  0x30 S_MINIT_0
+  0x31 S_MINIT_1
+  0x32 S_MINIT_2
+  0x41 S_SINIT_1
+  0x42 S_SINIT_2
+  0x43 S_SINIT_3
+)
+/* mem_test_mode */
+(
+  0 TEST_MODE_ALLOWED
+  1 TEST_MODE_ACTIVE
+)
+/* values for mem_tester_emulate */
+(
+  0x00 NO_TEST_MODE
+  0x00 CONTINUOUS_TRANSMIT
+  0x10 TRANSMIT_TEST
+  0x08 LOOPBACK
+)
+
+/* mem_tx_misc */
+(
+  1 SEND_TX_ADDR
+)
+/* BBHWREG_page_stat */
+(
+  5 PAGE_MODE_END
+)
+/* host_return_parameters_status codes */
+(
+  0x00 HOST_RETURN_SUCCESS
+  0x01 HOST_RETURN_SLAVE_CANT_ISSUE
+  0x02 HOST_RETURN_NO_CONNECTION
+  0x04 HOST_RETURN_PAGE_TIMEOUT
+  0x05 HOST_RETURN_INQUIRY_TIMEOUT
+  0x08 HOST_RETURN_CONNECTION_TIMEOUT
+  0x09 HOST_RETURN_MAX_NUM_CONNECTIONS
+  0x0a HOST_RETURN_MAX_NUM_SCO
+  0x0b HOST_RETURN_MAX_NUM_ACL
+  0x0c HOST_RETURN_SECURITY_REASONS
+  0x10 HOST_RETURN_HOST_TIMEOUT
+  0x11 HOST_RETURN_UNSUPPORTED_FEATURE_PARAMETER
+  0x13 HOST_RETURN_OTHER_END_USER
+  0x14 HOST_RETURN_OTHER_END_LOW_RESOURCE
+  0x15 HOST_RETURN_OTHER_END_POWER_OFF
+  0x16 HOST_RETURN_LOCAL_HOST
+  0x18 HOST_RETURN_PAIRING_NOT_ALLOWED
+  0x19 HOST_RETURN_UNKNOWN_PDU
+  0x1a HOST_RETURN_UNSUPPORTED_REMOTE_FEATURE
+  0x1d HOST_RETURN_SCO_AIR_MODE_REJECTED
+  0x20 HOST_RETURN_UNSUPPORTED_LMP_VALUE
+  0x21 HOST_RETURN_AUTHENTICATION_FAILURE
+  0x22 HOST_RETURN_CHANGED_EXISTING_SCO
+  0x23 HOST_RETURN_HOST_REJECTED
+  0x24 HOST_RETURN_UNSPECIFIED_ERROR
+  0x25 HOST_RESET
+  0x26 HOST_RETURN_BAD_HANDLE
+
+  0x00 HOST_RETURN_ACCEPT_COMMAND
+  0x01 HOST_RETURN_REJECT_COMMAND
+)
+/* host_present */
+(
+  0 HOST_IS_PRESENT
+  1 BCI_IS_PRESENT
+  2 DONT_INIT_RADIO
+)
+/* mem_master_state */
+(
+  0 MASTER_STATE_STANDBY
+  1 MASTER_INQUIRY
+)
+/* misc */
+(
+  92 SECOND_SWITCH_REQ
+  93 SLAVE_DELAY_DETACH
+  94 MASTER_DELAY_DETACH
+  95 UNSNIFF_DELAY_DETACH
+  0 WE_STARTED_AS_MASTER
+  1 WE_STARTED_AS_SLAVE
+)
+/* mem_host_commands */
+(
+  0x01 HOST_INQUIRY
+  0x02 HOST_INQUIRY_CANCEL
+  0x03 HOST_CREATE_CONNECTION
+  0x04 HOST_DISCONNECT_CONNECTION
+  0x05 HOST_ADD_SCO_REQUEST
+  0x06 HOST_REMOTE_NAME_REQUEST
+  0x07 HOST_WRITE_SUPPORTED_FEATURES
+  0x08 HOST_SET_TX_LEVEL
+  0x09 HOST_SET_RX_LEVEL
+  0x0a HOST_SNIFF_REQUEST
+  0x0b HOST_UNSNIFF_REQUEST
+  0x0c HOST_WRITE_LINK_SUPERVISION_TIMEOUT
+  0x0e HOST_WRITE_SCAN_ENABLE
+  0x0f HOST_READ_AUDIO_QUALITY
+  0x10 HOST_ENABLE_DEVICE_UNDER_TEST
+  0x14 HOST_BUTTON_CONFIGURE
+  0x15 HOST_SET_LOW_BATTERY_LEVEL
+  0x16 HOST_WRITE_LOCAL_NAME
+  0x17 HOST_WRITE_LOCAL_PIN
+  0x18 HOST_KILL_SCO_REQUEST
+  0x19 HOST_QOS_REQ
+
+  0x1a HOST_FEATURES_REQUEST
+  0x1b HOST_VERSION_REQUEST
+  0x1c HOST_TIMING_REQUEST
+  0x1d HOST_CLK_OFFSET_REQUEST
+  0x1e HOST_AUTHENTICATE
+  0x1f HOST_START_ENCRYPTION
+  0x20 HOST_STOP_ENCRYPTION
+  0x21 HOST_HOLD_REQUEST
+  0x22 HOST_HOLD_FORCE
+  0x23 HOST_PARK_REQUEST
+  0x24 HOST_MOD_BEACON
+  0x25 HOST_SET_BROADCAST_SCAN_WINDOW
+  0x26 HOST_UNPARK_PM_REQUEST
+  0x27 HOST_UNPARK_BD_REQUEST
+  0x28 HOST_SLAVE_REQUEST_UNPARK
+  0x29 HOST_DECREASE_POWER_REQUEST
+  0x2a HOST_INCREASE_POWER_REQUEST
+  0x2b HOST_SEND_PREFERRED_RATE
+  0x2c HOST_MAX_SLOT_REQ
+  0x2d HOST_MAX_SLOT_FORCE
+  0x2e HOST_PAGE_MODE_REQUEST
+  0x2f HOST_PAGE_SCAN_MODE_REQUEST
+  0x30 HOST_MASTER_SLAVE_SWITCH
+  0x31 HOST_SEND_AUTO_RATE
+  0x32 HOST_PAGE_CANCEL
+  0x33 HOST_CHANGE_LINK_KEY
+  0x34 HOST_RADIO_READ
+  0x35 HOST_RADIO_WRITE
+  0x36 HOST_REMOTE_SLAVE_INIT_UNPARK_REQUESTED
+
+  0x40 HOST_REMOTE_CONNECTION_REQUESTED
+  0x41 HOST_REMOTE_DETACH
+  0x42 HOST_REMOTE_SCO_CREATE_REQUESTED
+  0x43 HOST_REMOTE_SCO_KILL_REQUESTED
+  0x44 HOST_REMOTE_PARK_REQUESTED
+  0x45 HOST_REMOTE_UNPARK_REQUESTED
+  0x46 HOST_REMOTE_SNIFF_REQUESTED
+  0x47 HOST_REMOTE_UNSNIFF_REQUESTED
+  0x48 HOST_REMOTE_HOLD_REQUESTED
+  0x49 HOST_REMOTE_AUTHENTICATION
+  0x4a HOST_REMOTE_START_ENCRYPTION_REQUESTED
+  0x4b HOST_REMOTE_STOP_ENCRYPTION_REQUESTED
+  0x4c HOST_MODE_CHANGE_EVENT
+  0x4d HOST_REMOTE_TEST_ACTIVATE
+  0x4e HOST_REMOTE_TEST_CONTROL
+  0x4f HOST_REMOTE_TIMING_REQUEST
+)
+/* BCI interface (not used if not compiled in ) */
+(
+  0x01 BCI_INQUIRY
+  0x02 BCI_INQUIRY_CANCEL
+  0x03 BCI_CREATE_CONNECTION
+  0x04 BCI_DISCONNECT
+  0x05 BCI_ADD_SCO_CONNECTION
+  0x06 BCI_REMOTE_NAME_REQUEST
+  0x07 BCI_WRITE_SUPPORTED_FEATURES
+  0x08 BCI_SET_TX_POWER_LEVEL
+  0x09 BCI_SET_RX_POWER_LEVEL
+  0x0a BCI_SNIFF_MODE
+  0x0b BCI_EXIT_SNIFF_MODE
+  0x0c BCI_WRITE_LINK_SUPERVISION_TIMEOUT
+  0x0d BCI_WRITE_PAGE_TIMEOUT
+  0x0e BCI_WRITE_SCAN_ENABLE
+  0x0f BCI_GET_AUDIO_QUALITY
+  0x10 BCI_ENABLE_DEVICE_UNDER_TEST
+  0x11 BCI_SEND_DATA
+  0x12 BCI_REGISTER_SERVICE_RECORD
+  0x13 BCI_SERVICE_SEARCH_ATTRIB_REQ
+  0x14 BCI_BUTTON_CONFIGURE
+  0x15 BCI_SET_LOW_BATTERY_LEVEL
+  0x16 BCI_WRITE_LOCAL_NAME
+  0x17 BCI_WRITE_LOCAL_PIN
+  0x18 BCI_REMOVE_SCO_CONNECTION
+  0x19 BCI_QUALITY_OF_SERVICE
+  0x40 BCI_REMOTE_CONNECTION_REQUEST
+  0x41 BCI_REMOTE_DETACH
+  0x42 BCI_REMOTE_ADD_SCO_REQUEST
+  0x43 BCI_REMOTE_REMOVE_SCO_REQUEST
+  0x44 BCI_REMOTE_PARK_REQUEST
+  0x45 BCI_REMOTE_UNPARK_REQUEST
+  0x46 BCI_REMOTE_SNIFF_REQUEST
+  0x47 BCI_REMOTE_UNSNIFF_REQUEST
+  0x48 BCI_REMOTE_HOLD_REQUEST
+  0x49 BCI_REMOTE_AUTHENTICATION_PAIRING_REQUEST
+  0x4a BCI_REMOTE_START_ENCRYPTION_REQUEST
+  0x4b BCI_REMOTE_STOP_ENCRYPTION_REQUEST
+  0x4c BCI_MODE_CHANGE_EVENT
+)
+/* mode changes */
+(
+  0 MODE_CHANGE_ACTIVE
+  1 MODE_CHANGE_SNIFFING
+  2 MODE_CHANGE_PARKED
+  3 MODE_CHANGE_HOLDING
+  4 MODE_CHANGE_SCO_ADDED
+  5 MODE_CHANGE_SCO_REMOVED
+  6 MODE_CHANGE_ACL_CONNECTION
+  7 MODE_CHANGE_DISCONNECT
+  8 MODE_CHANGE_SCO_CHANGED
+  9 MODE_CHANGE_ENCRYPTING
+  10 MODE_CHANGE_NOT_ENCRYPTING
+  11 MODE_CHANGE_BUTTON_UP
+  12 MODE_CHANGE_BUTTON_DOWN
+  13 MODE_CHANGE_BATTERY_LOW
+  14 MODE_CHANGE_RESET
+  15 MODE_CHANGE_INQUIRY_CANCELED_RMTCMD
+  16 MODE_ACTIVE_MSSWITCH_PASSED
+  17 MODE_ACTIVE_MSSWITCH_FAILED
+)
+/* mem_battery - low nibble is level information, upper nibble is status info */
+(
+  6 BATTERY_CHECK_LEVEL
+  7 BATTERY_SENT_STATUS
+)
+/* mem_radio_version */
+(
+  0x02 RADIO_2001
+  0x12 RADIO_2002
+  0x32 RADIO_2002_DDM
+  0x42 RADIO_1008A1
+  0x52 RADIO_1018A0
+)
+/* mem_slave_initiated_conn */
+(
+  0 SLAVE_INIT_AUTHENTICATION
+  1 SLAVE_INIT_ENCRYPTION
+  2 SLAVE_INIT_MASTER_SLAVE_SWITCH
+)
+/* connection_options */
+(
+  0 CONNECTION_AUTH
+  1 CONNECTION_ENCRYPT
+  2 CONNECTION_SWITCH
+  3 CONNECTION_ACL
+  4 CONNECTION_FEATURE_EXT
+)
+/* mem_debug_config */
+(
+  7 AA_INSERTION
+)
+
Index: output/create_exen.pl
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/create_exen.pl	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/create_exen.pl	(working copy)
@@ -0,0 +1,274 @@
+
+#input 1: otp size (kb)
+#input 2: flash size (kb)
+#input 3: eeprom size (kb)
+use strict;
+
+my $memmap = "memmap.format";
+my $inputeeprom = "eeprom.dat";
+my $inputeeprom2 = "eeprom.dat";
+my $outputflash = "flash.dat";
+my $outputotp = "otp.dat";
+my @config_type = ("aa\n","55\n","05\n","00\n","ff\n","ff\n","00\n","00\n","00\n","00\n","00\n");
+my @file_end = ("55\n","aa\n","aa\n","55\n"); #crc header
+my $f_storage_size = 0;
+my $f_config_addr = 0;
+my $f_config_type = 0;
+my $i;
+my $crcoffset=0;
+
+if(@ARGV < 3 ) {
+	printf "create  input error!\n";
+	exit;
+}
+
+
+open(MEMMAP, "$memmap") or die "can't open $memmap: $!";
+my @lines = <MEMMAP>;
+my $length = @lines;
+
+my $conlen = @config_type;		
+
+
+for($i=0;$i<$length;$i+=1){
+	my @string = split(' ', $lines[$i]);
+	my $length_s = @string ;
+	if( $string[1] =~ /mem_g24_ota_config_type/ ){
+#		print "$string[1] $string[0] \n";
+#		print @config_type;	
+		$config_type[5] = substr($string[0],2,2)."\n";
+		$config_type[4] = substr($string[0],4,2)."\n";
+#		print $config_type[4];
+#		print $config_type[5];
+#		$f_config_type = hex(substr($string[0],2,4)); 
+		$f_config_type = hex($string[0]); 
+#		print $f_config_type;
+	}	
+
+	if( $string[1] =~ /mem_g24_ota_storage_size/){
+#		print "$string[1] $string[0] \n";
+		$f_storage_size = hex($string[0]); 
+#		print $f_storage_size;
+	}
+	
+	if( $string[1]  =~ /mem_g24_ota_config_addr/){
+#		print "$string[1] $string[0] \n";
+		$f_config_addr = hex($string[0]); 
+#		print $f_config_addr;
+	}	
+}
+close(MEMMAP);
+
+
+if($f_storage_size-$f_config_type ==1 && $f_config_addr- $f_storage_size ==2 )
+{}
+else
+{	die "mem_g24_ota_config_type mem_g24_ota_storage_size  mem_g24_ota_config_addr error $!";}
+
+
+
+open(EEPROM, "$inputeeprom") or die "can't open $inputeeprom: $!";
+my @eeprom = <EEPROM>;
+my $eepromlen = @eeprom; 
+close(EEPROM);
+
+my $count ;
+my $countIn;
+my $searchRes;
+my $existsum=0;
+my $sum = 0;
+my $sum_config_type = 0;
+my $sum_flash ;
+my $sum_otp;
+my $sum_eeprom;
+
+for($i=0;$i<$eepromlen;$i++){
+	if ($searchRes == 0)
+	{ 
+		$sum_config_type = 0;
+		for( $count=0;$count<6;$count++){
+			if ($eeprom[$i+$count] ne $config_type[$count]) #  $config_type[$count]
+			{
+				last;		
+			}
+#			printf  "%x  %x\n",$count,hex($config_type[$count]);
+		}
+		if($count == 6)
+		{
+			$searchRes = 1;
+			$sum_config_type = hex($eeprom[$i+$count]) + hex($eeprom[$i+$count+1]) +
+								hex($eeprom[$i+$count+2]) + hex($eeprom[$i+$count+3]) + hex($eeprom[$i+$count+4]);
+#			printf  "%x yesyes \n",$sum_config_type ;	
+			last;
+		}
+	}	
+}
+
+
+
+
+if($searchRes==1){
+
+	$i += $count;
+	$eeprom[$i+3] =	sprintf "%02x\n",($eepromlen+1 & 0xff);
+	$eeprom[$i+4] = sprintf "%02x\n",($eepromlen+1 >> 8 )& 0xff;
+	
+	
+	my @flash = @eeprom;
+	my @otp = @eeprom;
+	$flash[$i] = "04\n";
+	$otp[$i] = "03\n";
+	$eeprom[$i] = "02\n";
+	$otp[$i+1] =  sprintf "%02x\n",(($ARGV[0]) & 0xff);
+	$otp[$i+2] = sprintf "%02x\n",($ARGV[0]) >> 8 ;	
+	$flash[$i+1] =  sprintf "%02x\n",(($ARGV[1]) & 0xff);
+	$flash[$i+2] = sprintf "%02x\n",($ARGV[1]) >> 8 ;	
+	$eeprom[$i+1] =  sprintf "%02x\n",(($ARGV[2]) & 0xff);
+	$eeprom[$i+2] = sprintf "%02x\n",($ARGV[2]) >> 8 ;	
+
+	
+	
+	my $regLen = @file_end;
+	for( $count=0;$count<$regLen;$count++){
+		if($file_end[ $count] != $eeprom[$eepromlen-4-$regLen+$count])
+		{	last;}
+	}
+	if ($count == $regLen){
+		$existsum=1;
+		$crcoffset=6;
+		$sum = hex($eeprom[$eepromlen-4]) + (hex($eeprom[$eepromlen-3])<<8);
+#		printf  "   %x sum \n",($sum<$sum_config_type);
+		if($sum>=$sum_config_type){
+			$sum -= $sum_config_type;		
+		}else{	
+			$sum = ($sum + 0x10000- $sum_config_type) &0xffff;	
+		}
+	#	($sum>=$sum_config_type)? $sum -= $sum_config_type:$sum -= $sum_config_type; #$sum += 0x10000- $sum_config_type;
+		$sum_flash = $sum + hex($flash[$i])+ hex($flash[$i+1]) + hex($flash[$i+2]) + hex($eeprom[$i+3]) + hex($eeprom[$i+4]) ;
+		$sum_otp =  $sum+ hex($otp[$i]) + hex($otp[$i+1]) + hex($otp[$i+2]) + hex($eeprom[$i+3]) + hex($eeprom[$i+4]) ;
+		$sum_eeprom = $sum+ hex($eeprom[$i])+  hex($eeprom[$i+1]) + hex($eeprom[$i+2]) + hex($eeprom[$i+3]) + hex($eeprom[$i+4]) ;
+#		printf  "   %x sum \n",$sum ;	
+		}else{
+	}	
+
+	open(EEPROMOUT, ">$inputeeprom2") or die "can't open $inputeeprom: $!";
+	open(OTPOUT, ">$outputotp") or die "can't open $outputotp: $!";
+	open(FLASHOUT, ">$outputflash") or die "can't open $outputflash: $!";
+	$regLen = @config_type;
+
+	for( $count=0;$count<$eepromlen-2-2;$count++){
+		print FLASHOUT $flash[$count];
+		print EEPROMOUT $eeprom[$count];
+		print OTPOUT $otp[$count];
+	}	
+	
+	printf FLASHOUT "%02x\n%02x\n",($sum_flash & 0xff), (($sum_flash >> 8) & 0xff);
+	printf EEPROMOUT "%02x\n%02x\n",($sum_eeprom & 0xff), (($sum_eeprom >> 8) & 0xff);
+	printf OTPOUT "%02x\n%02x\n",($sum_otp & 0xff), (($sum_otp >> 8) & 0xff);	
+	
+	close(FLASHOUT);
+	close(EEPROMOUT);
+	close(OTPOUT);
+	
+}else
+{
+	$config_type[9] = sprintf "%02x\n",(($eepromlen+1+$conlen) & 0xff);
+	$config_type[10] = sprintf "%02x\n",(($eepromlen+1+$conlen) >> 8) ;
+	
+	my $regLen = @file_end;
+	for( $count=0;$count<$regLen;$count++){
+		if($file_end[ $count] != $eeprom[$eepromlen-4-$regLen+$count])
+		{	last;}
+	}
+
+	if ($count == $regLen){
+		$existsum=1;
+		$crcoffset=6;
+		$sum = hex($eeprom[$eepromlen-4]) + (hex($eeprom[$eepromlen-3])<<8);
+#		printf  "%x sum \n",$sum ;	
+	}else{
+	}
+
+	open(EEPROMOUT, ">$inputeeprom2") or die "can't open $inputeeprom: $!";
+	open(OTPOUT, ">$outputotp") or die "can't open $outputotp: $!";
+	open(FLASHOUT, ">$outputflash") or die "can't open $outputflash: $!";
+	$regLen = @config_type;
+
+	for( $count=0;$count<$eepromlen-2-$crcoffset;$count++){
+		print FLASHOUT $eeprom[$count];
+		print EEPROMOUT $eeprom[$count];
+		print OTPOUT $eeprom[$count];
+	}	
+
+	my @config_type_eeprom =  @config_type;
+	my @config_type_flash =  @config_type;
+	my @config_type_otp =  @config_type;
+	$config_type_eeprom[6] = "02\n";
+	$config_type_otp[6] =  "03\n";
+	$config_type_flash[6] =  "04\n";
+	$config_type_otp[7] =  sprintf "%02x\n",(($ARGV[0]) & 0xff);
+	$config_type_otp[8] = sprintf "%02x\n",($ARGV[0]) >> 8 ;	
+	$config_type_flash[7] =  sprintf "%02x\n",(($ARGV[1]) & 0xff);
+	$config_type_flash[8] = sprintf "%02x\n",($ARGV[1]) >> 8 ;	
+	$config_type_eeprom[7] =  sprintf "%02x\n",(($ARGV[2]) & 0xff);
+	$config_type_eeprom[8] = sprintf "%02x\n",($ARGV[2]) >> 8 ;
+	
+
+	$sum_flash = $sum ;
+	$sum_otp =  $sum;
+	$sum_eeprom = $sum;
+	{
+		for($i=0;$i<$regLen;$i++,$count++){	
+			print FLASHOUT $config_type_flash[$i];
+			print EEPROMOUT $config_type_eeprom[$i];
+			print OTPOUT $config_type_otp[$i];
+			$eeprom[$count] =  $config_type[$i];
+			$sum_flash += hex($config_type_flash[$i]);
+			$sum_eeprom += hex($config_type_eeprom[$i]);
+			$sum_otp += hex($config_type_otp[$i]);	
+#	print  $config_type_eeprom[$i], " yesyes \n",;	
+		}
+	}
+
+	if($existsum  ){
+		for($i=0;$i<@file_end;$i++,$count++){	
+			print FLASHOUT $file_end[$i];
+			print EEPROMOUT $file_end[$i];
+			print OTPOUT $file_end[$i];
+			$eeprom[$count] =  $file_end[$i];		
+		}
+	printf FLASHOUT "%02x\n%02x\n",($sum_flash & 0xff), (($sum_flash >> 8) & 0xff);
+	printf EEPROMOUT "%02x\n%02x\n",($sum_eeprom & 0xff), (($sum_eeprom >> 8) & 0xff);
+	printf OTPOUT "%02x\n%02x\n",($sum_otp & 0xff), (($sum_otp >> 8) & 0xff);	
+	}
+
+
+	close(FLASHOUT);
+	close(EEPROMOUT);
+	close(OTPOUT);
+}
+
+crc($outputflash);
+crc($inputeeprom2);
+crc($outputotp);
+
+
+sub crc{
+	open(FILEOUT, "+<$_[0]") or die "can't open $_[0]: $!";
+	my @file = <FILEOUT>;
+	my $filelen = @file;
+	my $crc = 0xffff;
+	for($i=2;$i<$filelen;$i++){   
+		$crc  = ($crc >> 8) | ($crc << 8);
+		$crc ^= hex($file[$i]) & 0xff;
+		$crc ^= ($crc & 0xff) >> 4;
+		$crc ^= $crc << 12;
+		$crc ^= ($crc & 0xff) << 5;
+		$crc &= 0xffff;
+	}	
+	printf FILEOUT "%02x\n%02x\n", (($crc >> 8) & 0xff),($crc & 0xff);
+	close(FILEOUT);
+}
+
+
+
Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/eeprom.dat	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/eeprom.dat	(working copy)
@@ -0,0 +1,8192 @@
+00
+02
+aa
+55
+1a
+16
+c2
+84
+00
+18
+c0
+00
+00
+23
+c0
+01
+80
+27
+c0
+41
+80
+40
+c0
+45
+80
+97
+c0
+4f
+80
+a4
+c0
+57
+00
+a6
+c0
+58
+00
+8b
+c0
+61
+82
+5c
+c0
+63
+81
+6b
+c0
+64
+81
+71
+c0
+65
+01
+a5
+c0
+66
+00
+71
+c0
+67
+03
+4d
+c0
+67
+83
+f0
+c0
+68
+02
+6b
+c0
+68
+83
+78
+c0
+6a
+03
+5e
+c0
+6b
+01
+d0
+c0
+6c
+82
+7c
+c0
+6d
+02
+f1
+c0
+6f
+03
+b3
+c0
+74
+02
+ff
+20
+20
+13
+7c
+c0
+19
+80
+51
+c0
+1a
+00
+56
+c0
+43
+82
+fb
+c0
+50
+83
+13
+c0
+60
+03
+1d
+c0
+6e
+82
+4b
+c0
+71
+02
+26
+c0
+74
+82
+2e
+c0
+75
+01
+34
+c0
+76
+03
+44
+20
+20
+13
+7c
+20
+80
+00
+00
+20
+40
+30
+f3
+20
+40
+3b
+fd
+20
+20
+08
+04
+20
+40
+70
+6c
+20
+40
+75
+97
+20
+40
+6e
+a7
+20
+40
+1b
+93
+20
+40
+08
+3a
+20
+40
+31
+08
+20
+40
+08
+92
+20
+40
+0b
+08
+20
+40
+0b
+7b
+20
+40
+08
+23
+20
+40
+21
+d3
+20
+40
+00
+34
+20
+20
+08
+13
+20
+40
+14
+65
+6f
+e1
+c1
+74
+20
+7a
+00
+00
+6f
+e0
+c0
+99
+20
+7a
+00
+00
+6f
+e0
+c7
+64
+20
+3a
+00
+3d
+6f
+e0
+c6
+b9
+20
+7a
+00
+00
+6f
+e0
+c6
+ba
+24
+7a
+00
+00
+20
+20
+14
+ea
+70
+89
+00
+05
+20
+00
+00
+02
+70
+89
+00
+00
+6f
+e0
+c0
+c5
+c0
+0c
+11
+68
+70
+8a
+87
+29
+20
+20
+11
+7d
+20
+40
+5b
+94
+20
+40
+04
+60
+20
+34
+00
+4b
+20
+60
+00
+00
+da
+60
+5d
+e2
+6f
+e1
+4b
+f3
+1f
+e0
+fe
+03
+1f
+f0
+fe
+00
+67
+e1
+02
+e4
+20
+20
+5b
+3f
+da
+20
+09
+9e
+d8
+40
+00
+0c
+58
+00
+00
+30
+20
+40
+5e
+63
+20
+20
+60
+bf
+6a
+50
+8a
+12
+70
+8a
+12
+3d
+70
+8a
+11
+aa
+70
+8a
+0a
+0c
+6f
+f0
+8a
+09
+79
+20
+7e
+07
+67
+f0
+8a
+09
+70
+8a
+0b
+04
+20
+00
+00
+3c
+70
+8a
+16
+00
+70
+8a
+17
+06
+20
+40
+61
+1a
+67
+f0
+8a
+97
+70
+80
+dc
+03
+20
+00
+00
+3c
+6f
+f0
+80
+53
+79
+20
+7e
+07
+67
+f0
+80
+53
+20
+00
+03
+e8
+6f
+f1
+01
+50
+67
+e1
+44
+a2
+6f
+f0
+80
+53
+79
+3f
+fe
+07
+67
+f0
+80
+53
+70
+8a
+97
+00
+62
+50
+8a
+12
+20
+60
+00
+00
+6f
+e0
+cb
+aa
+24
+7a
+00
+00
+20
+40
+00
+56
+70
+48
+f6
+00
+20
+40
+61
+25
+67
+e1
+48
+e9
+20
+40
+00
+79
+20
+20
+3e
+be
+6f
+e1
+48
+e9
+68
+49
+4c
+39
+98
+46
+04
+00
+20
+21
+00
+87
+68
+49
+48
+e5
+98
+46
+04
+00
+20
+21
+00
+81
+20
+20
+00
+83
+20
+40
+00
+89
+20
+20
+00
+85
+68
+48
+cc
+38
+20
+40
+60
+65
+68
+48
+cc
+37
+20
+20
+60
+65
+68
+48
+cc
+37
+20
+40
+60
+69
+68
+48
+cc
+38
+20
+20
+60
+69
+6f
+e0
+83
+0d
+20
+7a
+00
+00
+1f
+e0
+ff
+ff
+67
+e0
+83
+0d
+20
+40
+77
+c5
+20
+40
+31
+e3
+20
+40
+31
+a4
+20
+40
+31
+aa
+20
+40
+5c
+dc
+6f
+e1
+44
+6f
+20
+40
+7e
+05
+20
+20
+00
+8b
+70
+8a
+8b
+e6
+20
+40
+12
+6a
+20
+40
+12
+71
+20
+40
+12
+77
+70
+8a
+6d
+09
+70
+8a
+03
+05
+70
+8a
+7a
+94
+70
+8a
+0e
+0b
+70
+8a
+0f
+05
+70
+8a
+83
+90
+70
+8a
+85
+00
+70
+89
+21
+40
+20
+20
+12
+5d
+70
+00
+80
+00
+20
+20
+13
+b7
+24
+55
+80
+47
+24
+55
+80
+b2
+20
+40
+6d
+f3
+20
+40
+00
+dd
+20
+40
+41
+a7
+20
+75
+80
+00
+20
+40
+40
+8e
+20
+40
+3d
+8a
+20
+40
+47
+28
+20
+40
+00
+ed
+20
+40
+03
+70
+20
+20
+3b
+c9
+6f
+e4
+4c
+1f
+20
+7a
+00
+00
+6f
+e0
+cc
+1e
+1f
+e2
+22
+00
+1f
+e6
+7c
+0b
+24
+21
+00
+c4
+d8
+c0
+4c
+1f
+d8
+a0
+4a
+db
+1a
+22
+72
+00
+20
+40
+7d
+5f
+d8
+c0
+4c
+1f
+d8
+a0
+44
+0a
+1a
+22
+72
+00
+20
+40
+7d
+5f
+d8
+c0
+4c
+1f
+d8
+a0
+42
+f8
+1a
+22
+72
+00
+20
+20
+7d
+5f
+20
+40
+00
+da
+6f
+e0
+cc
+1e
+1f
+e0
+fe
+01
+67
+e0
+ca
+d2
+70
+4a
+d3
+09
+d8
+c0
+4c
+1f
+d8
+a0
+4a
+d4
+1a
+22
+72
+00
+20
+40
+7d
+5f
+6f
+e0
+cc
+1e
+1f
+e0
+fe
+01
+67
+e0
+c4
+08
+70
+44
+09
+09
+d8
+c0
+4c
+1f
+d8
+a0
+44
+0a
+1a
+22
+72
+00
+20
+40
+7d
+5f
+d8
+c0
+4c
+1e
+d8
+a0
+42
+f7
+1a
+22
+72
+00
+1f
+20
+f2
+01
+20
+20
+7d
+5f
+d8
+a0
+4a
+d2
+df
+20
+00
+14
+20
+20
+7d
+26
+20
+75
+80
+00
+20
+40
+26
+07
+20
+40
+22
+ff
+20
+40
+3f
+1e
+20
+40
+3d
+13
+20
+40
+00
+e7
+6f
+e4
+4b
+ab
+c3
+0c
+3b
+f5
+20
+40
+00
+ea
+20
+20
+3b
+f5
+58
+00
+e2
+90
+67
+e1
+c8
+ad
+20
+60
+00
+00
+58
+00
+17
+70
+67
+e1
+c8
+ad
+20
+60
+00
+00
+58
+00
+00
+f2
+67
+e1
+48
+9b
+58
+00
+01
+0e
+67
+e1
+48
+9d
+20
+20
+3b
+d3
+c6
+93
+00
+00
+6f
+e0
+cb
+f6
+24
+3a
+05
+19
+20
+40
+3f
+70
+24
+74
+00
+00
+6f
+e4
+4b
+ab
+c3
+0a
+80
+fb
+6f
+e0
+cb
+8b
+24
+3a
+48
+84
+20
+40
+42
+cb
+6f
+e0
+c8
+36
+c2
+80
+81
+0a
+68
+48
+c7
+c7
+6f
+e0
+c8
+d0
+98
+41
+fe
+00
+67
+e0
+c8
+d0
+68
+48
+c7
+cc
+6f
+e0
+c8
+d5
+98
+40
+fe
+00
+67
+e0
+c8
+d5
+68
+48
+c7
+cd
+6f
+e0
+c8
+d6
+98
+40
+fe
+00
+67
+e0
+c8
+d6
+70
+48
+36
+01
+da
+20
+00
+07
+da
+40
+48
+d0
+20
+20
+26
+e1
+6f
+e4
+4b
+ab
+c4
+0b
+00
+00
+6f
+e0
+ca
+ae
+20
+7a
+00
+00
+6f
+e0
+c8
+a7
+20
+7a
+00
+00
+6f
+e0
+cb
+a1
+1f
+e0
+fe
+01
+1f
+e1
+7e
+03
+67
+e0
+cb
+a1
+24
+7a
+00
+00
+70
+4b
+a2
+00
+6f
+e0
+cb
+a2
+1f
+e0
+fe
+01
+67
+e0
+cb
+a2
+1f
+e6
+7c
+08
+24
+21
+01
+24
+20
+40
+25
+9a
+20
+40
+26
+5b
+24
+2c
+01
+2a
+24
+37
+81
+2a
+20
+40
+48
+b5
+20
+40
+25
+97
+6f
+e0
+cb
+a3
+1f
+e0
+fe
+01
+67
+e0
+cb
+a3
+c0
+08
+01
+2c
+20
+60
+00
+00
+20
+40
+22
+cb
+20
+20
+01
+1a
+70
+4b
+a3
+00
+6f
+e0
+cb
+a4
+c3
+80
+00
+00
+79
+20
+7e
+00
+67
+e0
+cb
+a4
+6f
+e1
+4b
+bc
+67
+e1
+4a
+b2
+20
+20
+03
+70
+20
+40
+26
+31
+24
+34
+01
+b7
+20
+40
+01
+43
+20
+40
+26
+ee
+6f
+e0
+cb
+e1
+24
+3a
+01
+3e
+6f
+e4
+48
+b0
+67
+e4
+48
+5c
+6f
+e1
+48
+c2
+67
+e1
+48
+c4
+20
+40
+26
+bb
+24
+74
+00
+00
+20
+40
+7f
+dc
+6f
+e1
+c8
+ad
+20
+20
+26
+b8
+70
+48
+a6
+00
+69
+61
+01
+5f
+34
+73
+02
+00
+20
+40
+26
+5b
+6f
+e0
+c8
+2c
+c0
+00
+a6
+51
+24
+2c
+01
+5c
+24
+37
+81
+5c
+20
+40
+26
+72
+20
+40
+04
+21
+20
+40
+01
+4f
+20
+20
+26
+51
+6f
+e0
+cb
+e1
+24
+5a
+01
+53
+70
+4b
+e1
+00
+20
+60
+00
+00
+20
+40
+41
+aa
+6f
+e4
+4b
+ab
+c4
+1e
+00
+00
+6f
+e0
+c9
+13
+d8
+40
+00
+40
+20
+40
+60
+93
+6f
+e0
+c9
+14
+d8
+40
+00
+40
+20
+20
+60
+93
+6f
+e0
+c8
+a7
+24
+7a
+00
+00
+6f
+e1
+48
+a3
+1f
+e0
+fe
+01
+67
+e1
+48
+a3
+6f
+e0
+c8
+a4
+c2
+80
+a6
+79
+20
+40
+26
+7e
+20
+40
+01
+66
+20
+20
+01
+44
+6f
+e0
+c8
+a4
+1f
+e6
+7c
+00
+20
+61
+00
+00
+df
+20
+00
+28
+20
+20
+7d
+13
+58
+00
+00
+06
+20
+40
+5b
+0d
+c2
+81
+be
+23
+20
+40
+03
+69
+20
+40
+03
+70
+20
+20
+3e
+23
+20
+40
+42
+e9
+20
+40
+7f
+dc
+20
+40
+02
+b1
+20
+40
+40
+15
+68
+48
+c9
+10
+20
+40
+60
+69
+68
+48
+c9
+10
+20
+40
+60
+42
+6f
+e0
+c9
+20
+d8
+40
+00
+3f
+20
+40
+60
+93
+d8
+40
+00
+03
+20
+40
+3f
+56
+20
+40
+3e
+40
+20
+40
+60
+82
+d8
+40
+00
+13
+20
+40
+3f
+56
+20
+40
+01
+85
+20
+40
+01
+92
+20
+20
+01
+99
+6f
+e1
+cb
+de
+67
+e1
+89
+5c
+df
+20
+00
+14
+d8
+40
+00
+00
+6f
+e1
+89
+5c
+2f
+ef
+fe
+00
+20
+40
+e0
+7f
+6f
+e1
+89
+5c
+1f
+e3
+7e
+00
+67
+e1
+89
+5c
+18
+40
+84
+01
+c2
+00
+01
+89
+20
+60
+00
+00
+6f
+e4
+4b
+ab
+c4
+0a
+00
+00
+6f
+e0
+c8
+fd
+c1
+81
+00
+00
+6f
+e0
+c8
+fc
+d8
+40
+00
+c0
+20
+20
+60
+93
+6f
+e4
+4b
+ab
+c4
+1e
+00
+00
+68
+48
+c9
+13
+20
+40
+60
+42
+68
+48
+c9
+14
+20
+40
+60
+42
+6f
+e0
+c9
+13
+d8
+40
+00
+80
+20
+40
+60
+93
+6f
+e0
+c9
+14
+d8
+40
+00
+80
+20
+20
+60
+93
+68
+48
+c9
+13
+20
+40
+60
+50
+68
+48
+c9
+14
+20
+40
+60
+50
+20
+40
+3f
+88
+6f
+e0
+c9
+1f
+d8
+40
+00
+3f
+20
+40
+60
+93
+20
+20
+3e
+44
+70
+48
+a5
+00
+20
+40
+26
+52
+5f
+ff
+ff
+ff
+67
+e2
+48
+5c
+58
+00
+00
+00
+67
+e3
+c8
+d0
+70
+4b
+e1
+01
+20
+40
+03
+70
+20
+20
+01
+bc
+6f
+e0
+c8
+a7
+20
+5a
+01
+c2
+6f
+e0
+c8
+bd
+c1
+00
+80
+00
+20
+40
+26
+9f
+20
+40
+26
+bb
+24
+74
+00
+00
+6f
+e0
+cb
+e1
+24
+5a
+3e
+33
+6f
+e2
+48
+5c
+20
+20
+26
+b8
+70
+48
+36
+01
+70
+48
+a7
+01
+20
+40
+26
+42
+67
+e0
+c7
+c6
+58
+00
+00
+00
+67
+e3
+c7
+c7
+6f
+e2
+48
+a9
+67
+e2
+47
+ce
+70
+48
+35
+0c
+6f
+e0
+c8
+36
+79
+20
+7e
+03
+67
+e0
+c8
+36
+20
+40
+22
+91
+20
+20
+01
+36
+1a
+62
+7e
+00
+c0
+00
+81
+da
+c0
+1e
+02
+00
+c0
+1c
+81
+fd
+c0
+1d
+02
+07
+c0
+19
+01
+e9
+c0
+22
+01
+f0
+c0
+0a
+81
+df
+c0
+0a
+01
+dd
+20
+20
+43
+36
+20
+40
+02
+9b
+20
+40
+45
+44
+20
+20
+43
+fa
+20
+40
+02
+9b
+20
+20
+43
+50
+58
+00
+00
+00
+67
+e1
+4a
+f2
+70
+4a
+c6
+00
+58
+00
+00
+06
+67
+e1
+43
+72
+67
+e1
+43
+74
+6f
+e4
+4b
+ab
+c2
+8d
+c3
+66
+58
+00
+00
+07
+20
+20
+43
+64
+6f
+e0
+ca
+c7
+c0
+00
+81
+ed
+70
+4b
+76
+14
+20
+20
+43
+73
+20
+40
+43
+6c
+70
+4b
+76
+05
+20
+20
+43
+73
+6f
+e0
+82
+c1
+1f
+e6
+7c
+0c
+24
+21
+43
+84
+67
+e1
+43
+72
+67
+e1
+43
+74
+6f
+e0
+82
+c3
+20
+3a
+43
+9a
+68
+48
+cb
+8a
+98
+46
+7c
+00
+20
+21
+43
+9a
+6f
+e0
+82
+c3
+67
+e0
+cb
+8a
+20
+20
+43
+86
+20
+40
+02
+9b
+20
+40
+45
+44
+20
+20
+48
+57
+6f
+e2
+48
+3c
+67
+e2
+48
+91
+67
+e2
+49
+93
+20
+40
+25
+7e
+20
+40
+48
+c6
+20
+40
+45
+44
+20
+20
+48
+4e
+6f
+e0
+c8
+a5
+24
+3a
+01
+ae
+6f
+e0
+c8
+8b
+c0
+01
+02
+0e
+c0
+02
+02
+19
+c0
+01
+82
+1e
+20
+20
+48
+39
+6f
+e4
+4b
+ab
+c2
+97
+c8
+11
+c2
+98
+48
+11
+c3
+1d
+48
+06
+6f
+e2
+49
+93
+68
+4a
+49
+74
+98
+46
+7c
+00
+20
+22
+82
+17
+20
+20
+48
+06
+70
+48
+8b
+00
+20
+20
+48
+27
+6f
+e4
+4b
+ab
+c3
+17
+82
+23
+6f
+e0
+cb
+b4
+c0
+00
+82
+23
+20
+20
+48
+1a
+6f
+e4
+4b
+ab
+c3
+17
+82
+23
+c2
+89
+82
+23
+c2
+89
+02
+23
+20
+20
+48
+12
+6f
+e4
+4b
+ab
+c3
+1e
+48
+39
+20
+20
+01
+ae
+70
+48
+8b
+00
+6f
+e1
+4b
+eb
+1f
+e0
+fe
+01
+67
+e1
+4b
+eb
+6f
+e0
+cb
+eb
+1f
+e1
+7e
+ff
+c0
+00
+23
+41
+20
+60
+00
+00
+6f
+e1
+48
+89
+d8
+40
+01
+f8
+98
+41
+7e
+00
+20
+3a
+02
+36
+6f
+e1
+48
+89
+1f
+e0
+fe
+01
+67
+e1
+48
+89
+20
+60
+00
+00
+20
+40
+25
+9a
+20
+40
+26
+5b
+24
+2c
+02
+3c
+24
+37
+82
+3c
+20
+40
+26
+72
+20
+20
+25
+86
+6f
+e0
+c8
+8c
+20
+3a
+22
+cb
+6f
+e1
+48
+89
+1f
+e0
+fe
+01
+67
+e1
+48
+89
+6f
+e0
+c8
+8a
+2f
+ef
+fe
+01
+6f
+e0
+c8
+8b
+c0
+00
+a5
+ad
+c0
+01
+25
+af
+c0
+01
+a5
+b1
+c0
+02
+02
+49
+20
+20
+25
+6e
+20
+20
+a5
+75
+20
+20
+23
+39
+c6
+1a
+00
+00
+c5
+13
+a4
+0e
+c6
+93
+00
+00
+6f
+e0
+c8
+a1
+c2
+81
+84
+2b
+c2
+80
+a3
+40
+c2
+81
+25
+80
+6f
+e0
+c8
+bd
+c0
+00
+82
+55
+20
+20
+26
+21
+20
+40
+22
+ea
+24
+34
+02
+4d
+20
+40
+26
+db
+6f
+e1
+48
+be
+1f
+e0
+fe
+01
+67
+e1
+48
+be
+20
+20
+26
+21
+6f
+e4
+4b
+ab
+c2
+97
+c8
+0a
+6f
+e0
+c9
+38
+c0
+00
+02
+61
+20
+20
+3d
+57
+6f
+e4
+4b
+ab
+c3
+08
+c8
+03
+20
+40
+3d
+65
+20
+34
+48
+06
+6f
+e4
+4b
+ab
+c2
+98
+48
+0c
+c3
+18
+c8
+0c
+20
+40
+41
+10
+1a
+21
+7e
+07
+20
+20
+47
+ff
+20
+40
+40
+8f
+20
+40
+02
+6e
+20
+20
+40
+98
+6f
+e0
+c9
+23
+c1
+7f
+80
+00
+6f
+e1
+4a
+c2
+24
+7a
+00
+00
+6f
+e1
+48
+83
+24
+7a
+00
+00
+6f
+e1
+48
+87
+24
+7a
+00
+00
+6f
+e0
+cb
+a7
+24
+7a
+00
+00
+6f
+e0
+cb
+c1
+20
+3a
+02
+ba
+67
+e0
+cb
+a8
+20
+60
+00
+00
+20
+40
+3e
+9b
+20
+40
+49
+56
+20
+40
+23
+2b
+20
+40
+25
+56
+20
+40
+47
+cd
+20
+40
+48
+be
+20
+40
+02
+b7
+20
+40
+40
+7c
+20
+40
+44
+cc
+20
+40
+02
+cf
+20
+40
+44
+ff
+20
+40
+45
+04
+20
+40
+45
+12
+20
+40
+02
+e6
+20
+40
+45
+15
+20
+40
+45
+2a
+20
+40
+45
+2d
+20
+40
+45
+32
+20
+40
+45
+35
+20
+40
+40
+22
+20
+40
+45
+47
+20
+40
+02
+a7
+20
+40
+02
+9e
+20
+40
+02
+e9
+20
+20
+02
+95
+da
+60
+4c
+1d
+da
+40
+5d
+8c
+20
+20
+31
+8a
+70
+4c
+3c
+05
+70
+4c
+3b
+01
+20
+60
+00
+00
+70
+4c
+3c
+00
+70
+4c
+3b
+00
+20
+60
+00
+00
+6f
+e0
+cc
+3b
+20
+7a
+00
+00
+da
+60
+4c
+3c
+da
+40
+02
+a3
+20
+20
+31
+8a
+70
+4c
+3c
+05
+6f
+e0
+cc
+3d
+c0
+00
+82
+b1
+20
+20
+02
+b4
+6f
+e0
+cb
+ed
+c1
+7f
+80
+00
+6f
+e1
+4a
+b2
+20
+7a
+00
+00
+6f
+e1
+4b
+be
+68
+49
+4a
+b2
+98
+46
+04
+00
+6f
+e1
+4b
+ee
+98
+46
+7e
+00
+20
+21
+02
+b4
+70
+4c
+3d
+00
+68
+48
+cb
+ed
+20
+20
+60
+65
+70
+4c
+3d
+01
+68
+48
+cb
+ed
+20
+40
+60
+69
+da
+60
+4b
+a8
+da
+40
+02
+ba
+20
+20
+31
+8a
+6f
+e0
+c9
+27
+c0
+01
+c8
+f2
+c0
+05
+c8
+f2
+6f
+e0
+c9
+23
+67
+e0
+c9
+2f
+6f
+e1
+4b
+c2
+67
+e1
+49
+30
+67
+e1
+49
+32
+da
+20
+00
+00
+68
+48
+c9
+92
+18
+40
+84
+02
+18
+46
+7c
+03
+20
+41
+02
+c9
+24
+41
+02
+cd
+20
+20
+48
+ff
+6f
+e4
+4b
+ab
+c4
+0e
+00
+00
+18
+40
+84
+01
+20
+60
+00
+00
+18
+40
+85
+fd
+20
+60
+00
+00
+6f
+e0
+c9
+38
+c0
+00
+02
+d5
+6f
+e4
+4b
+ab
+c4
+1a
+80
+00
+68
+48
+cb
+ca
+20
+20
+02
+d8
+6f
+e4
+4b
+ab
+c4
+19
+00
+00
+68
+48
+cb
+cb
+60
+48
+cb
+9d
+20
+40
+41
+15
+1f
+e1
+7e
+07
+68
+48
+cb
+9d
+98
+46
+7c
+00
+20
+22
+82
+df
+20
+20
+44
+eb
+20
+40
+02
+e4
+6f
+e0
+cb
+9f
+c1
+00
+80
+00
+70
+4b
+9f
+01
+20
+60
+00
+00
+da
+40
+02
+17
+20
+20
+44
+f7
+6f
+e4
+4b
+ab
+c3
+9d
+80
+00
+20
+20
+45
+1f
+6f
+e0
+c9
+2a
+c3
+83
+80
+00
+da
+60
+4a
+b2
+da
+40
+02
+ee
+20
+20
+31
+91
+6f
+e0
+c9
+38
+c0
+00
+01
+ae
+20
+20
+43
+1b
+6f
+e1
+47
+8c
+2f
+ef
+fe
+0b
+20
+40
+c5
+81
+6f
+e1
+47
+8c
+2f
+ef
+fe
+07
+20
+40
+c3
+22
+58
+00
+00
+00
+67
+e1
+4a
+f2
+20
+40
+02
+98
+20
+20
+45
+54
+6f
+e0
+cb
+e2
+24
+5a
+78
+61
+70
+4b
+e2
+00
+20
+20
+78
+51
+6f
+e1
+03
+15
+1f
+e2
+0c
+00
+ef
+e0
+80
+06
+67
+e0
+c5
+f5
+1f
+e1
+04
+0f
+1f
+f1
+fe
+00
+c0
+04
+83
+07
+20
+20
+4d
+93
+da
+20
+00
+01
+20
+40
+4d
+c0
+6f
+e1
+44
+dc
+e7
+e1
+00
+05
+58
+00
+00
+00
+e7
+e0
+80
+05
+70
+09
+50
+01
+6f
+e0
+c4
+e2
+79
+20
+7e
+06
+67
+e0
+c4
+e2
+70
+09
+5b
+12
+20
+20
+78
+71
+6f
+e0
+c3
+dd
+1f
+e0
+fe
+01
+67
+e0
+c3
+dd
+c0
+06
+16
+5a
+20
+40
+19
+1b
+20
+40
+19
+6a
+6f
+e0
+82
+bd
+20
+40
+16
+8b
+20
+40
+18
+38
+20
+20
+16
+55
+ef
+e1
+00
+06
+c0
+02
+03
+20
+20
+20
+19
+e4
+ef
+e1
+80
+06
+67
+e1
+c4
+36
+c0
+05
+03
+25
+c0
+09
+03
+34
+20
+20
+1c
+d3
+6f
+e4
+4b
+ab
+c3
+1d
+9d
+e7
+20
+40
+1e
+8d
+68
+49
+44
+37
+6f
+e0
+c3
+c0
+c2
+81
+83
+2f
+6f
+e1
+44
+37
+c0
+18
+1e
+c8
+68
+49
+44
+37
+20
+20
+1d
+eb
+6f
+e1
+43
+d1
+98
+46
+7c
+00
+24
+22
+83
+2b
+24
+34
+03
+2b
+20
+20
+1e
+10
+18
+c2
+22
+00
+6f
+e1
+43
+d4
+1f
+e0
+a5
+fd
+20
+40
+1a
+25
+6f
+e0
+ca
+c1
+c0
+7f
+9e
+73
+6f
+e0
+ca
+c7
+20
+3a
+1e
+73
+6f
+e0
+cb
+75
+c2
+80
+9e
+73
+58
+00
+00
+1a
+68
+49
+44
+37
+98
+46
+7c
+00
+24
+22
+9e
+73
+70
+02
+d8
+05
+20
+20
+1e
+c9
+6f
+e0
+cb
+aa
+24
+5a
+26
+e1
+78
+34
+7c
+00
+20
+40
+14
+65
+6f
+e1
+c1
+74
+20
+3a
+7e
+56
+6f
+e0
+c0
+99
+20
+3a
+7e
+56
+20
+20
+26
+c4
+78
+54
+7c
+00
+58
+00
+00
+00
+67
+e3
+48
+d1
+20
+40
+42
+40
+20
+40
+40
+8e
+20
+40
+3f
+7e
+20
+40
+3f
+83
+20
+40
+40
+dc
+6f
+e0
+c8
+d0
+1f
+e1
+7e
+1f
+67
+e0
+c8
+d0
+24
+34
+47
+28
+20
+40
+03
+5b
+20
+20
+45
+44
+6f
+e0
+c9
+27
+c1
+01
+80
+00
+20
+20
+47
+1a
+20
+40
+3f
+65
+6f
+e0
+c9
+27
+c0
+05
+83
+65
+20
+40
+42
+32
+da
+60
+4a
+a3
+20
+40
+42
+2b
+20
+20
+40
+8e
+20
+40
+03
+6c
+da
+60
+4b
+e3
+20
+40
+42
+2b
+20
+20
+40
+8e
+6f
+e0
+c9
+27
+c0
+05
+83
+6c
+20
+20
+42
+32
+58
+00
+97
+06
+20
+40
+5b
+0c
+20
+00
+2e
+e0
+20
+60
+00
+00
+20
+40
+41
+a7
+20
+40
+3f
+65
+6f
+e0
+c9
+27
+c0
+05
+83
+76
+58
+00
+08
+06
+20
+20
+5b
+0c
+58
+00
+1f
+06
+20
+20
+5b
+0c
+6f
+e0
+cb
+e1
+24
+5a
+41
+21
+da
+20
+00
+00
+20
+40
+03
+81
+20
+40
+03
+86
+20
+40
+03
+8b
+20
+40
+03
+95
+20
+40
+03
+a2
+20
+20
+41
+1e
+6f
+e0
+c9
+18
+20
+40
+03
+af
+20
+40
+41
+24
+68
+48
+c9
+18
+20
+20
+3f
+56
+6f
+e0
+c9
+19
+20
+40
+03
+af
+20
+40
+41
+2a
+68
+48
+c9
+19
+20
+20
+3f
+56
+70
+4b
+96
+02
+6f
+e0
+cb
+90
+1f
+e2
+26
+00
+6f
+e0
+c9
+1a
+20
+40
+03
+b1
+68
+48
+c9
+1a
+20
+40
+41
+95
+67
+e0
+cb
+90
+68
+48
+c9
+1a
+20
+20
+3f
+56
+6f
+e0
+c9
+0d
+c1
+7f
+80
+00
+70
+4b
+96
+03
+6f
+e0
+cb
+91
+1f
+e2
+26
+00
+68
+48
+c9
+0d
+6f
+e0
+c9
+10
+c0
+7f
+83
+9e
+20
+20
+41
+3e
+6f
+e0
+c9
+0d
+20
+40
+03
+b1
+68
+48
+c9
+0d
+20
+20
+41
+4b
+6f
+e0
+c9
+0e
+c1
+7f
+80
+00
+70
+4b
+96
+04
+6f
+e0
+cb
+92
+1f
+e2
+26
+00
+68
+48
+c9
+0e
+6f
+e0
+c9
+10
+c0
+7f
+83
+ab
+20
+20
+41
+57
+6f
+e0
+c9
+0e
+20
+40
+03
+b1
+68
+48
+c9
+0e
+20
+20
+41
+64
+d8
+40
+00
+3f
+20
+20
+60
+93
+d8
+40
+00
+3e
+20
+20
+60
+93
+20
+40
+49
+90
+20
+40
+79
+36
+20
+40
+03
+b8
+20
+40
+03
+cc
+20
+20
+46
+4f
+6f
+e4
+4b
+ab
+c2
+97
+40
+36
+6f
+e0
+c9
+0f
+c1
+7f
+80
+00
+da
+20
+00
+00
+70
+4b
+96
+05
+68
+48
+c9
+0f
+20
+40
+03
+c1
+20
+20
+40
+2f
+6f
+e4
+4b
+ab
+c2
+96
+40
+48
+6f
+e0
+cb
+93
+1f
+e2
+26
+00
+6f
+e0
+c9
+10
+c0
+7f
+83
+c8
+20
+20
+40
+3f
+6f
+e0
+c9
+0f
+20
+40
+03
+b1
+68
+48
+c9
+0f
+20
+20
+41
+95
+6f
+e4
+4b
+ab
+c4
+1e
+80
+00
+6f
+e0
+cc
+32
+20
+40
+03
+af
+20
+40
+03
+d3
+68
+48
+cc
+32
+20
+20
+3f
+56
+70
+4c
+36
+00
+68
+48
+cc
+32
+6f
+e0
+cc
+33
+20
+40
+03
+e2
+67
+e0
+cc
+33
+6f
+e0
+cc
+35
+20
+3a
+03
+de
+6f
+e0
+cc
+34
+c1
+00
+80
+00
+70
+4c
+34
+01
+20
+20
+40
+69
+6f
+e0
+cc
+34
+c1
+00
+00
+00
+70
+4c
+34
+00
+20
+60
+00
+00
+1f
+e3
+fe
+00
+1f
+e2
+24
+00
+20
+40
+60
+59
+79
+20
+a4
+00
+1a
+41
+7e
+07
+68
+48
+cc
+36
+18
+42
+0e
+00
+c0
+03
+83
+ec
+c0
+00
+03
+ee
+20
+60
+00
+00
+70
+4c
+35
+01
+20
+60
+00
+00
+70
+4c
+35
+00
+20
+60
+00
+00
+20
+40
+40
+72
+20
+74
+00
+00
+6f
+e0
+c9
+92
+1f
+e2
+04
+00
+6f
+e4
+4b
+ab
+c2
+9e
+83
+fc
+18
+42
+7e
+00
+1f
+e0
+fe
+01
+1f
+e1
+7e
+03
+67
+e0
+c9
+92
+20
+40
+40
+95
+20
+20
+45
+ee
+6f
+e0
+cc
+35
+24
+3a
+04
+07
+6f
+e4
+4b
+ab
+c2
+8e
+04
+04
+18
+42
+7e
+00
+c1
+01
+00
+00
+1f
+e0
+fe
+01
+20
+20
+03
+f9
+18
+42
+7e
+00
+c1
+01
+80
+00
+20
+20
+04
+02
+18
+42
+7e
+00
+c1
+00
+00
+00
+1f
+e0
+ff
+ff
+20
+20
+03
+f9
+6f
+e0
+cb
+f6
+20
+7a
+00
+00
+6f
+e0
+cb
+f7
+c0
+01
+04
+17
+c0
+02
+84
+19
+c0
+04
+04
+1b
+c0
+05
+84
+1d
+c0
+07
+04
+1f
+c0
+08
+84
+15
+20
+60
+00
+00
+70
+4b
+f7
+12
+20
+60
+00
+00
+70
+4b
+f7
+03
+20
+60
+00
+00
+70
+4b
+f7
+06
+20
+60
+00
+00
+70
+4b
+f7
+09
+20
+60
+00
+00
+70
+4b
+f7
+0c
+20
+60
+00
+00
+70
+4b
+f7
+0f
+20
+60
+00
+00
+6f
+e0
+c8
+2a
+20
+3a
+04
+0b
+1f
+e2
+24
+00
+70
+48
+2a
+00
+6f
+e0
+c8
+0a
+c0
+57
+84
+33
+20
+60
+00
+00
+70
+4b
+f6
+01
+70
+40
+99
+00
+20
+20
+05
+13
+20
+60
+00
+00
+70
+47
+c6
+af
+20
+40
+22
+91
+20
+40
+26
+5b
+24
+6c
+00
+00
+24
+77
+80
+00
+20
+40
+25
+97
+20
+20
+26
+72
+6f
+e0
+c8
+0a
+c1
+d7
+80
+00
+ef
+e0
+80
+06
+e8
+40
+80
+06
+18
+46
+7c
+02
+24
+22
+93
+7a
+c0
+00
+84
+42
+c0
+01
+04
+45
+c0
+01
+84
+47
+c0
+02
+04
+49
+c0
+02
+84
+a1
+c0
+03
+04
+c7
+c0
+7f
+84
+41
+20
+20
+13
+7a
+20
+60
+00
+00
+20
+40
+04
+28
+70
+4b
+f7
+01
+20
+60
+00
+00
+70
+4b
+f7
+04
+20
+60
+00
+00
+70
+4b
+f7
+07
+20
+60
+00
+00
+70
+4b
+f7
+0a
+ef
+e1
+00
+06
+e8
+41
+00
+06
+6a
+21
+4c
+18
+9a
+26
+7c
+00
+24
+22
+84
+bf
+6f
+e1
+4c
+1a
+98
+46
+7c
+00
+24
+22
+84
+bf
+20
+40
+04
+55
+24
+34
+04
+bf
+20
+20
+04
+bd
+20
+40
+04
+60
+24
+74
+00
+00
+6f
+e1
+4c
+1a
+9e
+06
+7c
+00
+24
+22
+fe
+56
+68
+49
+09
+e8
+6f
+e1
+4c
+18
+1f
+e0
+ff
+fb
+98
+46
+7c
+00
+24
+22
+fe
+56
+20
+20
+7e
+54
+6f
+e1
+4b
+f3
+1f
+f0
+fe
+00
+67
+e1
+02
+e4
+d8
+40
+00
+03
+da
+20
+09
+d2
+20
+40
+5d
+e2
+6f
+e0
+89
+d2
+c0
+ad
+7e
+56
+e8
+41
+00
+06
+60
+49
+09
+5c
+60
+49
+09
+e8
+6f
+e0
+89
+d2
+dd
+60
+ff
+ff
+d8
+40
+00
+00
+d8
+c0
+09
+d2
+df
+20
+00
+03
+20
+40
+04
+d7
+18
+42
+60
+00
+6f
+e1
+4b
+f3
+1f
+e0
+ee
+03
+20
+40
+04
+84
+1e
+f0
+fe
+00
+67
+e1
+02
+e4
+d8
+40
+00
+02
+da
+20
+09
+d2
+20
+40
+5d
+e2
+6f
+e1
+09
+d2
+9d
+66
+7c
+00
+24
+22
+fe
+56
+6f
+e0
+89
+d2
+9e
+00
+e0
+00
+ef
+e0
+80
+06
+9e
+00
+e0
+00
+58
+00
+ff
+ff
+9e
+01
+60
+00
+20
+20
+7e
+54
+6f
+e1
+09
+5c
+20
+7a
+00
+00
+1f
+e2
+04
+00
+1f
+e6
+7c
+10
+20
+21
+04
+9f
+1f
+e0
+ff
+f0
+d8
+40
+00
+10
+67
+e1
+09
+5c
+18
+42
+5e
+00
+1e
+e2
+7e
+00
+1f
+f0
+fe
+00
+67
+e1
+02
+e4
+da
+20
+09
+d2
+20
+40
+5d
+e2
+1e
+e2
+7e
+00
+9d
+e0
+ee
+00
+1d
+e2
+72
+00
+1d
+62
+7e
+00
+d8
+c0
+09
+d2
+ef
+e0
+00
+06
+1f
+e2
+56
+00
+1d
+e2
+72
+00
+d8
+c0
+09
+d2
+1e
+02
+04
+00
+20
+40
+04
+d7
+18
+42
+60
+00
+20
+20
+04
+84
+58
+00
+00
+00
+20
+20
+04
+8b
+70
+4b
+f7
+0d
+ef
+e0
+80
+06
+18
+c2
+22
+00
+68
+48
+cc
+1c
+98
+46
+7c
+00
+20
+22
+84
+bd
+20
+40
+04
+ce
+24
+34
+04
+bf
+1a
+46
+7c
+04
+20
+21
+04
+bf
+1a
+40
+a5
+fc
+62
+41
+09
+59
+62
+21
+09
+57
+20
+40
+5d
+d3
+20
+40
+04
+c1
+20
+40
+5d
+da
+6a
+41
+09
+59
+6a
+21
+09
+57
+6f
+e1
+4c
+18
+9a
+40
+fe
+00
+67
+e1
+4c
+18
+1a
+42
+72
+00
+d8
+40
+00
+00
+1a
+22
+0c
+00
+20
+40
+04
+d7
+6f
+e1
+4c
+1a
+98
+40
+fe
+00
+67
+e1
+4c
+1a
+70
+4b
+f5
+00
+20
+60
+00
+00
+70
+4b
+f5
+01
+20
+60
+00
+00
+6f
+e1
+4b
+f3
+20
+7a
+00
+00
+68
+49
+4c
+18
+98
+40
+fe
+00
+1a
+42
+04
+00
+20
+20
+5e
+04
+6f
+e0
+cb
+f7
+c1
+08
+00
+00
+c1
+08
+80
+00
+c1
+09
+00
+00
+70
+4c
+1d
+05
+70
+4b
+f7
+10
+20
+60
+00
+00
+68
+48
+cc
+1c
+67
+e0
+cc
+1c
+c0
+00
+04
+d4
+98
+46
+7e
+00
+c0
+00
+fe
+54
+20
+20
+7e
+56
+18
+46
+7c
+ff
+20
+22
+fe
+54
+20
+20
+7e
+56
+ef
+e0
+80
+06
+98
+40
+84
+00
+c2
+00
+04
+d7
+20
+60
+00
+00
+58
+00
+ff
+ff
+ef
+e0
+00
+06
+20
+60
+00
+00
+6f
+20
+c8
+2a
+1f
+26
+7c
+02
+20
+21
+7e
+56
+df
+e0
+48
+0a
+9f
+20
+8c
+00
+18
+c0
+8d
+fe
+e8
+41
+00
+06
+d8
+c0
+48
+0a
+20
+40
+04
+db
+98
+46
+7c
+00
+20
+22
+fe
+54
+20
+20
+7e
+56
+ef
+e0
+80
+06
+c0
+ad
+05
+03
+1a
+22
+02
+00
+68
+49
+00
+06
+18
+46
+7c
+03
+20
+21
+05
+03
+18
+c0
+8c
+02
+ef
+20
+80
+06
+1f
+26
+7c
+00
+24
+22
+85
+03
+1f
+22
+7e
+00
+98
+c0
+8c
+00
+18
+42
+7e
+00
+1f
+20
+f2
+03
+9f
+26
+04
+00
+24
+22
+84
+ee
+e8
+41
+00
+06
+1a
+20
+8c
+01
+ef
+e1
+00
+06
+1f
+e0
+f2
+02
+1a
+20
+8c
+01
+20
+40
+04
+db
+98
+46
+7c
+00
+24
+22
+85
+03
+20
+20
+7e
+54
+20
+20
+7e
+56
+6f
+e1
+4b
+f3
+1f
+e2
+0c
+00
+20
+40
+04
+ea
+24
+34
+05
+0f
+6a
+21
+4b
+f3
+1a
+20
+8c
+01
+ef
+e1
+00
+06
+1f
+e0
+fe
+05
+9a
+20
+fe
+00
+67
+e1
+4b
+f3
+20
+20
+05
+04
+6f
+e1
+4b
+f1
+68
+49
+4b
+f3
+98
+46
+7e
+00
+20
+60
+00
+00
+58
+00
+00
+00
+67
+e1
+4c
+18
+67
+e1
+4c
+1a
+67
+e0
+cc
+1c
+67
+e0
+cb
+f7
+20
+60
+00
+00
+20
+40
+7e
+56
+6f
+e0
+cb
+f7
+c0
+00
+85
+22
+c0
+02
+05
+2c
+c0
+03
+85
+4b
+c0
+05
+05
+71
+c0
+06
+85
+66
+c0
+08
+05
+4f
+20
+20
+05
+7a
+70
+47
+c6
+af
+70
+47
+c7
+01
+70
+47
+c8
+00
+70
+47
+c9
+02
+58
+00
+00
+01
+67
+e1
+47
+ca
+70
+48
+36
+01
+70
+48
+35
+06
+70
+4b
+f7
+02
+20
+60
+00
+00
+70
+47
+c6
+af
+70
+47
+c7
+02
+70
+47
+c8
+00
+70
+47
+c9
+02
+6f
+f1
+00
+00
+67
+e1
+47
+ca
+58
+00
+66
+61
+e7
+e1
+00
+05
+58
+00
+00
+01
+e7
+e3
+00
+05
+58
+00
+00
+00
+e7
+e1
+00
+05
+e7
+e1
+00
+05
+20
+40
+05
+53
+e7
+e0
+80
+05
+58
+00
+00
+00
+e7
+e0
+80
+05
+68
+49
+4b
+f3
+e0
+41
+00
+05
+6f
+e1
+4b
+f1
+1f
+ed
+7e
+00
+1f
+e3
+7e
+00
+98
+46
+7e
+00
+24
+21
+05
+49
+e7
+e1
+00
+05
+70
+48
+35
+18
+70
+48
+36
+01
+70
+4b
+f7
+05
+20
+60
+00
+00
+58
+00
+00
+00
+20
+20
+05
+44
+70
+4b
+f7
+08
+70
+47
+c7
+03
+70
+48
+35
+04
+20
+20
+05
+5c
+70
+4b
+f7
+11
+70
+47
+c7
+06
+70
+48
+35
+04
+20
+20
+05
+5c
+6f
+e4
+4b
+ab
+c2
+89
+85
+58
+c2
+89
+05
+5a
+58
+00
+00
+00
+20
+60
+00
+00
+58
+00
+00
+02
+20
+60
+00
+00
+58
+00
+00
+04
+20
+60
+00
+00
+70
+48
+36
+01
+70
+47
+c6
+af
+70
+47
+c8
+00
+70
+47
+c9
+02
+20
+60
+00
+00
+70
+47
+c8
+01
+70
+48
+36
+01
+70
+47
+c6
+af
+70
+47
+c9
+02
+20
+60
+00
+00
+70
+4b
+f7
+0f
+70
+47
+c7
+05
+6f
+e0
+cc
+1c
+67
+e0
+c7
+ca
+70
+48
+35
+05
+70
+48
+36
+01
+70
+47
+c6
+af
+6f
+e0
+cb
+f5
+67
+e0
+c7
+c8
+70
+47
+c9
+02
+20
+60
+00
+00
+70
+4b
+f7
+0c
+70
+47
+c7
+04
+70
+48
+35
+04
+70
+48
+36
+01
+70
+47
+c6
+af
+6f
+e0
+cb
+f5
+67
+e0
+c7
+c8
+70
+47
+c9
+02
+20
+60
+00
+00
+70
+47
+c6
+af
+70
+47
+c7
+ff
+70
+47
+c8
+00
+70
+47
+c9
+02
+70
+48
+36
+01
+70
+48
+35
+04
+20
+60
+00
+00
+1f
+e2
+22
+00
+70
+4b
+f8
+00
+70
+48
+36
+01
+da
+40
+4b
+f9
+20
+60
+00
+00
+1e
+86
+aa
+55
+40
+00
+00
+40
+09
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+08
+08
+00
+80
+00
+40
+01
+00
+88
+d6
+53
+46
+00
+01
+00
+00
+00
+00
+00
+00
+00
+00
+18
+00
+00
+00
+00
+00
+00
+00
+00
+00
+80
+00
+00
+00
+02
+00
+00
+00
+01
+00
+00
+20
+04
+16
+00
+00
+aa
+55
+01
+00
+9a
+40
+08
+aa
+55
+03
+00
+7a
+41
+88
+1f
+ce
+aa
+55
+01
+00
+c5
+40
+18
+aa
+55
+01
+00
+ef
+41
+ff
+aa
+55
+02
+00
+ca
+40
+ef
+41
+aa
+55
+01
+00
+7d
+41
+70
+aa
+55
+01
+00
+d0
+44
+00
+aa
+55
+01
+00
+ea
+41
+ff
+aa
+55
+01
+00
+ee
+41
+00
+aa
+55
+08
+00
+ab
+4b
+14
+09
+5a
+00
+03
+04
+09
+03
+aa
+55
+0c
+00
+fe
+48
+b0
+04
+58
+02
+64
+64
+94
+85
+90
+63
+75
+80
+aa
+55
+03
+00
+0d
+49
+ff
+ff
+0d
+aa
+55
+01
+00
+32
+4c
+ff
+aa
+55
+17
+00
+10
+49
+ff
+ff
+ff
+04
+05
+ff
+ff
+08
+0c
+0d
+0c
+ff
+ff
+ff
+0a
+07
+06
+ff
+ff
+ff
+02
+00
+00
+aa
+55
+03
+00
+ed
+4b
+0b
+58
+02
+aa
+55
+01
+00
+3c
+4c
+05
+aa
+55
+01
+00
+58
+0b
+ff
+aa
+55
+12
+00
+cc
+4b
+00
+05
+00
+04
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+aa
+55
+01
+00
+99
+40
+01
+aa
+55
+02
+00
+b3
+4b
+03
+02
+aa
+55
+08
+00
+38
+49
+00
+34
+ff
+ff
+ff
+ff
+ff
+ff
+aa
+55
+07
+00
+56
+49
+34
+ff
+ff
+ff
+ff
+ff
+ff
+aa
+55
+17
+00
+73
+49
+33
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+aa
+55
+13
+00
+b5
+4b
+00
+40
+0a
+60
+06
+0a
+00
+64
+00
+70
+17
+14
+0a
+90
+01
+e8
+03
+90
+01
+aa
+55
+02
+00
+ca
+4b
+07
+06
+aa
+55
+01
+00
+c0
+49
+02
+aa
+55
+04
+00
+37
+4c
+03
+08
+3e
+01
+aa
+55
+01
+00
+fd
+48
+00
+aa
+55
+01
+00
+a1
+44
+05
+aa
+55
+06
+00
+e3
+48
+47
+01
+23
+01
+30
+01
+aa
+55
+0a
+00
+eb
+48
+10
+00
+52
+00
+35
+00
+21
+00
+25
+00
+aa
+55
+01
+00
+f7
+48
+0a
+aa
+55
+02
+00
+c8
+4b
+64
+00
+aa
+55
+03
+00
+de
+4b
+00
+00
+00
+aa
+55
+01
+00
+ab
+4a
+ff
+aa
+55
+01
+00
+e2
+4b
+01
+aa
+55
+01
+00
+77
+41
+20
+aa
+55
+01
+00
+8a
+4b
+20
+aa
+55
+01
+00
+7d
+44
+06
+aa
+55
+06
+00
+a8
+40
+15
+a0
+c8
+12
+23
+51
+aa
+55
+0c
+00
+fc
+45
+0b
+42
+54
+33
+2e
+30
+20
+4d
+6f
+75
+73
+65
+aa
+55
+05
+00
+55
+44
+0e
+00
+01
+00
+02
+aa
+55
+01
+00
+41
+46
+0a
+aa
+55
+01
+00
+64
+47
+01
+aa
+55
+01
+00
+78
+46
+00
+aa
+55
+01
+00
+5f
+41
+00
+aa
+55
+03
+00
+65
+47
+03
+00
+04
+aa
+55
+01
+00
+8e
+47
+01
+aa
+55
+01
+00
+d8
+40
+01
+aa
+55
+0c
+00
+e7
+43
+1f
+02
+01
+05
+03
+03
+12
+18
+03
+19
+c2
+03
+aa
+55
+14
+00
+d2
+4a
+06
+ff
+06
+00
+03
+00
+80
+0c
+09
+42
+54
+35
+2e
+32
+20
+4d
+6f
+75
+73
+65
+aa
+55
+0e
+00
+07
+44
+1f
+0c
+09
+42
+54
+35
+2e
+32
+20
+4d
+6f
+75
+73
+65
+aa
+55
+0c
+00
+f7
+42
+0b
+42
+54
+35
+2e
+32
+20
+4d
+6f
+75
+73
+65
+aa
+55
+0c
+00
+1e
+4c
+0b
+42
+54
+35
+2e
+32
+20
+4d
+6f
+75
+73
+65
+aa
+55
+08
+00
+72
+43
+07
+00
+07
+00
+20
+00
+2c
+01
+aa
+55
+06
+00
+cc
+4a
+03
+12
+18
+ff
+00
+00
+aa
+55
+04
+00
+28
+44
+00
+00
+00
+00
+aa
+55
+01
+00
+32
+44
+07
+aa
+55
+08
+00
+4c
+44
+fb
+00
+48
+08
+fb
+00
+48
+08
+aa
+55
+06
+00
+7a
+43
+8e
+b1
+3a
+0e
+8e
+ed
+aa
+55
+02
+00
+e7
+4a
+15
+00
+aa
+55
+02
+00
+57
+43
+19
+00
+aa
+55
+06
+00
+e9
+4a
+1d
+00
+21
+00
+30
+00
+aa
+55
+02
+00
+d1
+43
+2d
+00
+aa
+55
+01
+00
+f0
+4a
+96
+aa
+55
+01
+00
+86
+44
+ff
+aa
+55
+01
+00
+90
+47
+ff
+aa
+55
+01
+00
+8f
+47
+1e
+aa
+55
+0c
+00
+d0
+49
+03
+04
+01
+02
+20
+2a
+3f
+15
+14
+1b
+11
+0e
+aa
+55
+b2
+00
+df
+49
+09
+5a
+26
+34
+19
+04
+09
+00
+ff
+ff
+09
+5a
+0d
+f0
+1d
+e3
+7d
+d2
+ff
+ff
+09
+5a
+0d
+10
+1d
+ed
+7d
+80
+ff
+ff
+1b
+35
+28
+b4
+29
+46
+2a
+96
+2b
+8c
+2c
+6e
+2d
+64
+38
+5f
+39
+0f
+3a
+32
+3b
+47
+42
+10
+ff
+ff
+54
+2e
+55
+f2
+61
+f4
+63
+70
+75
+52
+76
+41
+77
+ed
+78
+23
+79
+46
+7a
+e5
+7c
+48
+7e
+77
+7f
+01
+0b
+00
+7f
+00
+09
+00
+ff
+ff
+09
+5a
+ff
+27
+ab
+40
+be
+d1
+a0
+41
+a1
+12
+a5
+84
+a7
+ff
+b5
+d0
+b6
+00
+ff
+00
+09
+00
+ff
+ff
+09
+5a
+0d
+10
+0e
+c5
+5b
+9a
+10
+38
+11
+42
+28
+28
+41
+23
+49
+39
+4a
+b0
+4b
+a0
+4c
+90
+4d
+70
+09
+00
+ff
+ff
+09
+5a
+06
+02
+09
+69
+0d
+48
+0e
+9f
+0f
+ba
+09
+00
+ff
+ff
+09
+a5
+46
+34
+60
+07
+69
+04
+7d
+20
+7e
+00
+09
+00
+ff
+ff
+aa
+55
+08
+00
+a3
+4a
+09
+5a
+0b
+f3
+09
+00
+ff
+ff
+aa
+55
+08
+00
+e3
+4b
+09
+a5
+0b
+f3
+09
+00
+ff
+ff
+aa
+55
+02
+00
+8d
+44
+2d
+49
+aa
+55
+01
+00
+8c
+44
+01
+aa
+55
+01
+00
+65
+48
+01
+aa
+55
+01
+00
+64
+48
+01
+aa
+55
+01
+00
+36
+48
+01
+aa
+55
+01
+00
+a8
+48
+06
+aa
+55
+02
+00
+38
+48
+c0
+12
+aa
+55
+03
+00
+54
+48
+19
+19
+1c
+aa
+55
+10
+00
+40
+48
+00
+13
+2c
+42
+06
+15
+36
+48
+0f
+1a
+3a
+4c
+11
+23
+31
+4d
+aa
+55
+01
+00
+5b
+48
+00
+aa
+55
+05
+00
+77
+48
+20
+15
+10
+05
+4e
+aa
+55
+05
+00
+8c
+48
+01
+0f
+0f
+0f
+0f
+aa
+55
+06
+00
+ad
+48
+0c
+f8
+00
+00
+77
+01
+aa
+55
+03
+00
+5c
+48
+00
+48
+60
+aa
+55
+01
+00
+7d
+48
+07
+aa
+55
+02
+00
+99
+48
+b5
+4a
+aa
+55
+01
+00
+ca
+48
+80
+aa
+55
+02
+00
+c2
+48
+14
+00
+aa
+55
+02
+00
+c0
+48
+50
+00
+aa
+55
+03
+00
+b8
+48
+00
+a6
+0e
+aa
+55
+03
+00
+b8
+49
+00
+50
+00
+aa
+55
+02
+00
+79
+44
+80
+1f
+aa
+55
+01
+00
+83
+44
+80
+aa
+55
+01
+00
+e8
+41
+01
+aa
+55
+05
+00
+f0
+4b
+02
+40
+00
+0d
+1b
+48
+71
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+79
+64
Index: output/flash.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/flash.dat	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/flash.dat	(working copy)
@@ -0,0 +1,8192 @@
+00
+02
+aa
+55
+1a
+16
+c2
+84
+00
+18
+c0
+00
+00
+23
+c0
+01
+80
+27
+c0
+41
+80
+40
+c0
+45
+80
+97
+c0
+4f
+80
+a4
+c0
+57
+00
+a6
+c0
+58
+00
+8b
+c0
+61
+82
+5c
+c0
+63
+81
+6b
+c0
+64
+81
+71
+c0
+65
+01
+a5
+c0
+66
+00
+71
+c0
+67
+03
+4d
+c0
+67
+83
+f0
+c0
+68
+02
+6b
+c0
+68
+83
+78
+c0
+6a
+03
+5e
+c0
+6b
+01
+d0
+c0
+6c
+82
+7c
+c0
+6d
+02
+f1
+c0
+6f
+03
+b3
+c0
+74
+02
+ff
+20
+20
+13
+7c
+c0
+19
+80
+51
+c0
+1a
+00
+56
+c0
+43
+82
+fb
+c0
+50
+83
+13
+c0
+60
+03
+1d
+c0
+6e
+82
+4b
+c0
+71
+02
+26
+c0
+74
+82
+2e
+c0
+75
+01
+34
+c0
+76
+03
+44
+20
+20
+13
+7c
+20
+80
+00
+00
+20
+40
+30
+f3
+20
+40
+3b
+fd
+20
+20
+08
+04
+20
+40
+70
+6c
+20
+40
+75
+97
+20
+40
+6e
+a7
+20
+40
+1b
+93
+20
+40
+08
+3a
+20
+40
+31
+08
+20
+40
+08
+92
+20
+40
+0b
+08
+20
+40
+0b
+7b
+20
+40
+08
+23
+20
+40
+21
+d3
+20
+40
+00
+34
+20
+20
+08
+13
+20
+40
+14
+65
+6f
+e1
+c1
+74
+20
+7a
+00
+00
+6f
+e0
+c0
+99
+20
+7a
+00
+00
+6f
+e0
+c7
+64
+20
+3a
+00
+3d
+6f
+e0
+c6
+b9
+20
+7a
+00
+00
+6f
+e0
+c6
+ba
+24
+7a
+00
+00
+20
+20
+14
+ea
+70
+89
+00
+05
+20
+00
+00
+02
+70
+89
+00
+00
+6f
+e0
+c0
+c5
+c0
+0c
+11
+68
+70
+8a
+87
+29
+20
+20
+11
+7d
+20
+40
+5b
+94
+20
+40
+04
+60
+20
+34
+00
+4b
+20
+60
+00
+00
+da
+60
+5d
+e2
+6f
+e1
+4b
+f3
+1f
+e0
+fe
+03
+1f
+f0
+fe
+00
+67
+e1
+02
+e4
+20
+20
+5b
+3f
+da
+20
+09
+9e
+d8
+40
+00
+0c
+58
+00
+00
+30
+20
+40
+5e
+63
+20
+20
+60
+bf
+6a
+50
+8a
+12
+70
+8a
+12
+3d
+70
+8a
+11
+aa
+70
+8a
+0a
+0c
+6f
+f0
+8a
+09
+79
+20
+7e
+07
+67
+f0
+8a
+09
+70
+8a
+0b
+04
+20
+00
+00
+3c
+70
+8a
+16
+00
+70
+8a
+17
+06
+20
+40
+61
+1a
+67
+f0
+8a
+97
+70
+80
+dc
+03
+20
+00
+00
+3c
+6f
+f0
+80
+53
+79
+20
+7e
+07
+67
+f0
+80
+53
+20
+00
+03
+e8
+6f
+f1
+01
+50
+67
+e1
+44
+a2
+6f
+f0
+80
+53
+79
+3f
+fe
+07
+67
+f0
+80
+53
+70
+8a
+97
+00
+62
+50
+8a
+12
+20
+60
+00
+00
+6f
+e0
+cb
+aa
+24
+7a
+00
+00
+20
+40
+00
+56
+70
+48
+f6
+00
+20
+40
+61
+25
+67
+e1
+48
+e9
+20
+40
+00
+79
+20
+20
+3e
+be
+6f
+e1
+48
+e9
+68
+49
+4c
+39
+98
+46
+04
+00
+20
+21
+00
+87
+68
+49
+48
+e5
+98
+46
+04
+00
+20
+21
+00
+81
+20
+20
+00
+83
+20
+40
+00
+89
+20
+20
+00
+85
+68
+48
+cc
+38
+20
+40
+60
+65
+68
+48
+cc
+37
+20
+20
+60
+65
+68
+48
+cc
+37
+20
+40
+60
+69
+68
+48
+cc
+38
+20
+20
+60
+69
+6f
+e0
+83
+0d
+20
+7a
+00
+00
+1f
+e0
+ff
+ff
+67
+e0
+83
+0d
+20
+40
+77
+c5
+20
+40
+31
+e3
+20
+40
+31
+a4
+20
+40
+31
+aa
+20
+40
+5c
+dc
+6f
+e1
+44
+6f
+20
+40
+7e
+05
+20
+20
+00
+8b
+70
+8a
+8b
+e6
+20
+40
+12
+6a
+20
+40
+12
+71
+20
+40
+12
+77
+70
+8a
+6d
+09
+70
+8a
+03
+05
+70
+8a
+7a
+94
+70
+8a
+0e
+0b
+70
+8a
+0f
+05
+70
+8a
+83
+90
+70
+8a
+85
+00
+70
+89
+21
+40
+20
+20
+12
+5d
+70
+00
+80
+00
+20
+20
+13
+b7
+24
+55
+80
+47
+24
+55
+80
+b2
+20
+40
+6d
+f3
+20
+40
+00
+dd
+20
+40
+41
+a7
+20
+75
+80
+00
+20
+40
+40
+8e
+20
+40
+3d
+8a
+20
+40
+47
+28
+20
+40
+00
+ed
+20
+40
+03
+70
+20
+20
+3b
+c9
+6f
+e4
+4c
+1f
+20
+7a
+00
+00
+6f
+e0
+cc
+1e
+1f
+e2
+22
+00
+1f
+e6
+7c
+0b
+24
+21
+00
+c4
+d8
+c0
+4c
+1f
+d8
+a0
+4a
+db
+1a
+22
+72
+00
+20
+40
+7d
+5f
+d8
+c0
+4c
+1f
+d8
+a0
+44
+0a
+1a
+22
+72
+00
+20
+40
+7d
+5f
+d8
+c0
+4c
+1f
+d8
+a0
+42
+f8
+1a
+22
+72
+00
+20
+20
+7d
+5f
+20
+40
+00
+da
+6f
+e0
+cc
+1e
+1f
+e0
+fe
+01
+67
+e0
+ca
+d2
+70
+4a
+d3
+09
+d8
+c0
+4c
+1f
+d8
+a0
+4a
+d4
+1a
+22
+72
+00
+20
+40
+7d
+5f
+6f
+e0
+cc
+1e
+1f
+e0
+fe
+01
+67
+e0
+c4
+08
+70
+44
+09
+09
+d8
+c0
+4c
+1f
+d8
+a0
+44
+0a
+1a
+22
+72
+00
+20
+40
+7d
+5f
+d8
+c0
+4c
+1e
+d8
+a0
+42
+f7
+1a
+22
+72
+00
+1f
+20
+f2
+01
+20
+20
+7d
+5f
+d8
+a0
+4a
+d2
+df
+20
+00
+14
+20
+20
+7d
+26
+20
+75
+80
+00
+20
+40
+26
+07
+20
+40
+22
+ff
+20
+40
+3f
+1e
+20
+40
+3d
+13
+20
+40
+00
+e7
+6f
+e4
+4b
+ab
+c3
+0c
+3b
+f5
+20
+40
+00
+ea
+20
+20
+3b
+f5
+58
+00
+e2
+90
+67
+e1
+c8
+ad
+20
+60
+00
+00
+58
+00
+17
+70
+67
+e1
+c8
+ad
+20
+60
+00
+00
+58
+00
+00
+f2
+67
+e1
+48
+9b
+58
+00
+01
+0e
+67
+e1
+48
+9d
+20
+20
+3b
+d3
+c6
+93
+00
+00
+6f
+e0
+cb
+f6
+24
+3a
+05
+19
+20
+40
+3f
+70
+24
+74
+00
+00
+6f
+e4
+4b
+ab
+c3
+0a
+80
+fb
+6f
+e0
+cb
+8b
+24
+3a
+48
+84
+20
+40
+42
+cb
+6f
+e0
+c8
+36
+c2
+80
+81
+0a
+68
+48
+c7
+c7
+6f
+e0
+c8
+d0
+98
+41
+fe
+00
+67
+e0
+c8
+d0
+68
+48
+c7
+cc
+6f
+e0
+c8
+d5
+98
+40
+fe
+00
+67
+e0
+c8
+d5
+68
+48
+c7
+cd
+6f
+e0
+c8
+d6
+98
+40
+fe
+00
+67
+e0
+c8
+d6
+70
+48
+36
+01
+da
+20
+00
+07
+da
+40
+48
+d0
+20
+20
+26
+e1
+6f
+e4
+4b
+ab
+c4
+0b
+00
+00
+6f
+e0
+ca
+ae
+20
+7a
+00
+00
+6f
+e0
+c8
+a7
+20
+7a
+00
+00
+6f
+e0
+cb
+a1
+1f
+e0
+fe
+01
+1f
+e1
+7e
+03
+67
+e0
+cb
+a1
+24
+7a
+00
+00
+70
+4b
+a2
+00
+6f
+e0
+cb
+a2
+1f
+e0
+fe
+01
+67
+e0
+cb
+a2
+1f
+e6
+7c
+08
+24
+21
+01
+24
+20
+40
+25
+9a
+20
+40
+26
+5b
+24
+2c
+01
+2a
+24
+37
+81
+2a
+20
+40
+48
+b5
+20
+40
+25
+97
+6f
+e0
+cb
+a3
+1f
+e0
+fe
+01
+67
+e0
+cb
+a3
+c0
+08
+01
+2c
+20
+60
+00
+00
+20
+40
+22
+cb
+20
+20
+01
+1a
+70
+4b
+a3
+00
+6f
+e0
+cb
+a4
+c3
+80
+00
+00
+79
+20
+7e
+00
+67
+e0
+cb
+a4
+6f
+e1
+4b
+bc
+67
+e1
+4a
+b2
+20
+20
+03
+70
+20
+40
+26
+31
+24
+34
+01
+b7
+20
+40
+01
+43
+20
+40
+26
+ee
+6f
+e0
+cb
+e1
+24
+3a
+01
+3e
+6f
+e4
+48
+b0
+67
+e4
+48
+5c
+6f
+e1
+48
+c2
+67
+e1
+48
+c4
+20
+40
+26
+bb
+24
+74
+00
+00
+20
+40
+7f
+dc
+6f
+e1
+c8
+ad
+20
+20
+26
+b8
+70
+48
+a6
+00
+69
+61
+01
+5f
+34
+73
+02
+00
+20
+40
+26
+5b
+6f
+e0
+c8
+2c
+c0
+00
+a6
+51
+24
+2c
+01
+5c
+24
+37
+81
+5c
+20
+40
+26
+72
+20
+40
+04
+21
+20
+40
+01
+4f
+20
+20
+26
+51
+6f
+e0
+cb
+e1
+24
+5a
+01
+53
+70
+4b
+e1
+00
+20
+60
+00
+00
+20
+40
+41
+aa
+6f
+e4
+4b
+ab
+c4
+1e
+00
+00
+6f
+e0
+c9
+13
+d8
+40
+00
+40
+20
+40
+60
+93
+6f
+e0
+c9
+14
+d8
+40
+00
+40
+20
+20
+60
+93
+6f
+e0
+c8
+a7
+24
+7a
+00
+00
+6f
+e1
+48
+a3
+1f
+e0
+fe
+01
+67
+e1
+48
+a3
+6f
+e0
+c8
+a4
+c2
+80
+a6
+79
+20
+40
+26
+7e
+20
+40
+01
+66
+20
+20
+01
+44
+6f
+e0
+c8
+a4
+1f
+e6
+7c
+00
+20
+61
+00
+00
+df
+20
+00
+28
+20
+20
+7d
+13
+58
+00
+00
+06
+20
+40
+5b
+0d
+c2
+81
+be
+23
+20
+40
+03
+69
+20
+40
+03
+70
+20
+20
+3e
+23
+20
+40
+42
+e9
+20
+40
+7f
+dc
+20
+40
+02
+b1
+20
+40
+40
+15
+68
+48
+c9
+10
+20
+40
+60
+69
+68
+48
+c9
+10
+20
+40
+60
+42
+6f
+e0
+c9
+20
+d8
+40
+00
+3f
+20
+40
+60
+93
+d8
+40
+00
+03
+20
+40
+3f
+56
+20
+40
+3e
+40
+20
+40
+60
+82
+d8
+40
+00
+13
+20
+40
+3f
+56
+20
+40
+01
+85
+20
+40
+01
+92
+20
+20
+01
+99
+6f
+e1
+cb
+de
+67
+e1
+89
+5c
+df
+20
+00
+14
+d8
+40
+00
+00
+6f
+e1
+89
+5c
+2f
+ef
+fe
+00
+20
+40
+e0
+7f
+6f
+e1
+89
+5c
+1f
+e3
+7e
+00
+67
+e1
+89
+5c
+18
+40
+84
+01
+c2
+00
+01
+89
+20
+60
+00
+00
+6f
+e4
+4b
+ab
+c4
+0a
+00
+00
+6f
+e0
+c8
+fd
+c1
+81
+00
+00
+6f
+e0
+c8
+fc
+d8
+40
+00
+c0
+20
+20
+60
+93
+6f
+e4
+4b
+ab
+c4
+1e
+00
+00
+68
+48
+c9
+13
+20
+40
+60
+42
+68
+48
+c9
+14
+20
+40
+60
+42
+6f
+e0
+c9
+13
+d8
+40
+00
+80
+20
+40
+60
+93
+6f
+e0
+c9
+14
+d8
+40
+00
+80
+20
+20
+60
+93
+68
+48
+c9
+13
+20
+40
+60
+50
+68
+48
+c9
+14
+20
+40
+60
+50
+20
+40
+3f
+88
+6f
+e0
+c9
+1f
+d8
+40
+00
+3f
+20
+40
+60
+93
+20
+20
+3e
+44
+70
+48
+a5
+00
+20
+40
+26
+52
+5f
+ff
+ff
+ff
+67
+e2
+48
+5c
+58
+00
+00
+00
+67
+e3
+c8
+d0
+70
+4b
+e1
+01
+20
+40
+03
+70
+20
+20
+01
+bc
+6f
+e0
+c8
+a7
+20
+5a
+01
+c2
+6f
+e0
+c8
+bd
+c1
+00
+80
+00
+20
+40
+26
+9f
+20
+40
+26
+bb
+24
+74
+00
+00
+6f
+e0
+cb
+e1
+24
+5a
+3e
+33
+6f
+e2
+48
+5c
+20
+20
+26
+b8
+70
+48
+36
+01
+70
+48
+a7
+01
+20
+40
+26
+42
+67
+e0
+c7
+c6
+58
+00
+00
+00
+67
+e3
+c7
+c7
+6f
+e2
+48
+a9
+67
+e2
+47
+ce
+70
+48
+35
+0c
+6f
+e0
+c8
+36
+79
+20
+7e
+03
+67
+e0
+c8
+36
+20
+40
+22
+91
+20
+20
+01
+36
+1a
+62
+7e
+00
+c0
+00
+81
+da
+c0
+1e
+02
+00
+c0
+1c
+81
+fd
+c0
+1d
+02
+07
+c0
+19
+01
+e9
+c0
+22
+01
+f0
+c0
+0a
+81
+df
+c0
+0a
+01
+dd
+20
+20
+43
+36
+20
+40
+02
+9b
+20
+40
+45
+44
+20
+20
+43
+fa
+20
+40
+02
+9b
+20
+20
+43
+50
+58
+00
+00
+00
+67
+e1
+4a
+f2
+70
+4a
+c6
+00
+58
+00
+00
+06
+67
+e1
+43
+72
+67
+e1
+43
+74
+6f
+e4
+4b
+ab
+c2
+8d
+c3
+66
+58
+00
+00
+07
+20
+20
+43
+64
+6f
+e0
+ca
+c7
+c0
+00
+81
+ed
+70
+4b
+76
+14
+20
+20
+43
+73
+20
+40
+43
+6c
+70
+4b
+76
+05
+20
+20
+43
+73
+6f
+e0
+82
+c1
+1f
+e6
+7c
+0c
+24
+21
+43
+84
+67
+e1
+43
+72
+67
+e1
+43
+74
+6f
+e0
+82
+c3
+20
+3a
+43
+9a
+68
+48
+cb
+8a
+98
+46
+7c
+00
+20
+21
+43
+9a
+6f
+e0
+82
+c3
+67
+e0
+cb
+8a
+20
+20
+43
+86
+20
+40
+02
+9b
+20
+40
+45
+44
+20
+20
+48
+57
+6f
+e2
+48
+3c
+67
+e2
+48
+91
+67
+e2
+49
+93
+20
+40
+25
+7e
+20
+40
+48
+c6
+20
+40
+45
+44
+20
+20
+48
+4e
+6f
+e0
+c8
+a5
+24
+3a
+01
+ae
+6f
+e0
+c8
+8b
+c0
+01
+02
+0e
+c0
+02
+02
+19
+c0
+01
+82
+1e
+20
+20
+48
+39
+6f
+e4
+4b
+ab
+c2
+97
+c8
+11
+c2
+98
+48
+11
+c3
+1d
+48
+06
+6f
+e2
+49
+93
+68
+4a
+49
+74
+98
+46
+7c
+00
+20
+22
+82
+17
+20
+20
+48
+06
+70
+48
+8b
+00
+20
+20
+48
+27
+6f
+e4
+4b
+ab
+c3
+17
+82
+23
+6f
+e0
+cb
+b4
+c0
+00
+82
+23
+20
+20
+48
+1a
+6f
+e4
+4b
+ab
+c3
+17
+82
+23
+c2
+89
+82
+23
+c2
+89
+02
+23
+20
+20
+48
+12
+6f
+e4
+4b
+ab
+c3
+1e
+48
+39
+20
+20
+01
+ae
+70
+48
+8b
+00
+6f
+e1
+4b
+eb
+1f
+e0
+fe
+01
+67
+e1
+4b
+eb
+6f
+e0
+cb
+eb
+1f
+e1
+7e
+ff
+c0
+00
+23
+41
+20
+60
+00
+00
+6f
+e1
+48
+89
+d8
+40
+01
+f8
+98
+41
+7e
+00
+20
+3a
+02
+36
+6f
+e1
+48
+89
+1f
+e0
+fe
+01
+67
+e1
+48
+89
+20
+60
+00
+00
+20
+40
+25
+9a
+20
+40
+26
+5b
+24
+2c
+02
+3c
+24
+37
+82
+3c
+20
+40
+26
+72
+20
+20
+25
+86
+6f
+e0
+c8
+8c
+20
+3a
+22
+cb
+6f
+e1
+48
+89
+1f
+e0
+fe
+01
+67
+e1
+48
+89
+6f
+e0
+c8
+8a
+2f
+ef
+fe
+01
+6f
+e0
+c8
+8b
+c0
+00
+a5
+ad
+c0
+01
+25
+af
+c0
+01
+a5
+b1
+c0
+02
+02
+49
+20
+20
+25
+6e
+20
+20
+a5
+75
+20
+20
+23
+39
+c6
+1a
+00
+00
+c5
+13
+a4
+0e
+c6
+93
+00
+00
+6f
+e0
+c8
+a1
+c2
+81
+84
+2b
+c2
+80
+a3
+40
+c2
+81
+25
+80
+6f
+e0
+c8
+bd
+c0
+00
+82
+55
+20
+20
+26
+21
+20
+40
+22
+ea
+24
+34
+02
+4d
+20
+40
+26
+db
+6f
+e1
+48
+be
+1f
+e0
+fe
+01
+67
+e1
+48
+be
+20
+20
+26
+21
+6f
+e4
+4b
+ab
+c2
+97
+c8
+0a
+6f
+e0
+c9
+38
+c0
+00
+02
+61
+20
+20
+3d
+57
+6f
+e4
+4b
+ab
+c3
+08
+c8
+03
+20
+40
+3d
+65
+20
+34
+48
+06
+6f
+e4
+4b
+ab
+c2
+98
+48
+0c
+c3
+18
+c8
+0c
+20
+40
+41
+10
+1a
+21
+7e
+07
+20
+20
+47
+ff
+20
+40
+40
+8f
+20
+40
+02
+6e
+20
+20
+40
+98
+6f
+e0
+c9
+23
+c1
+7f
+80
+00
+6f
+e1
+4a
+c2
+24
+7a
+00
+00
+6f
+e1
+48
+83
+24
+7a
+00
+00
+6f
+e1
+48
+87
+24
+7a
+00
+00
+6f
+e0
+cb
+a7
+24
+7a
+00
+00
+6f
+e0
+cb
+c1
+20
+3a
+02
+ba
+67
+e0
+cb
+a8
+20
+60
+00
+00
+20
+40
+3e
+9b
+20
+40
+49
+56
+20
+40
+23
+2b
+20
+40
+25
+56
+20
+40
+47
+cd
+20
+40
+48
+be
+20
+40
+02
+b7
+20
+40
+40
+7c
+20
+40
+44
+cc
+20
+40
+02
+cf
+20
+40
+44
+ff
+20
+40
+45
+04
+20
+40
+45
+12
+20
+40
+02
+e6
+20
+40
+45
+15
+20
+40
+45
+2a
+20
+40
+45
+2d
+20
+40
+45
+32
+20
+40
+45
+35
+20
+40
+40
+22
+20
+40
+45
+47
+20
+40
+02
+a7
+20
+40
+02
+9e
+20
+40
+02
+e9
+20
+20
+02
+95
+da
+60
+4c
+1d
+da
+40
+5d
+8c
+20
+20
+31
+8a
+70
+4c
+3c
+05
+70
+4c
+3b
+01
+20
+60
+00
+00
+70
+4c
+3c
+00
+70
+4c
+3b
+00
+20
+60
+00
+00
+6f
+e0
+cc
+3b
+20
+7a
+00
+00
+da
+60
+4c
+3c
+da
+40
+02
+a3
+20
+20
+31
+8a
+70
+4c
+3c
+05
+6f
+e0
+cc
+3d
+c0
+00
+82
+b1
+20
+20
+02
+b4
+6f
+e0
+cb
+ed
+c1
+7f
+80
+00
+6f
+e1
+4a
+b2
+20
+7a
+00
+00
+6f
+e1
+4b
+be
+68
+49
+4a
+b2
+98
+46
+04
+00
+6f
+e1
+4b
+ee
+98
+46
+7e
+00
+20
+21
+02
+b4
+70
+4c
+3d
+00
+68
+48
+cb
+ed
+20
+20
+60
+65
+70
+4c
+3d
+01
+68
+48
+cb
+ed
+20
+40
+60
+69
+da
+60
+4b
+a8
+da
+40
+02
+ba
+20
+20
+31
+8a
+6f
+e0
+c9
+27
+c0
+01
+c8
+f2
+c0
+05
+c8
+f2
+6f
+e0
+c9
+23
+67
+e0
+c9
+2f
+6f
+e1
+4b
+c2
+67
+e1
+49
+30
+67
+e1
+49
+32
+da
+20
+00
+00
+68
+48
+c9
+92
+18
+40
+84
+02
+18
+46
+7c
+03
+20
+41
+02
+c9
+24
+41
+02
+cd
+20
+20
+48
+ff
+6f
+e4
+4b
+ab
+c4
+0e
+00
+00
+18
+40
+84
+01
+20
+60
+00
+00
+18
+40
+85
+fd
+20
+60
+00
+00
+6f
+e0
+c9
+38
+c0
+00
+02
+d5
+6f
+e4
+4b
+ab
+c4
+1a
+80
+00
+68
+48
+cb
+ca
+20
+20
+02
+d8
+6f
+e4
+4b
+ab
+c4
+19
+00
+00
+68
+48
+cb
+cb
+60
+48
+cb
+9d
+20
+40
+41
+15
+1f
+e1
+7e
+07
+68
+48
+cb
+9d
+98
+46
+7c
+00
+20
+22
+82
+df
+20
+20
+44
+eb
+20
+40
+02
+e4
+6f
+e0
+cb
+9f
+c1
+00
+80
+00
+70
+4b
+9f
+01
+20
+60
+00
+00
+da
+40
+02
+17
+20
+20
+44
+f7
+6f
+e4
+4b
+ab
+c3
+9d
+80
+00
+20
+20
+45
+1f
+6f
+e0
+c9
+2a
+c3
+83
+80
+00
+da
+60
+4a
+b2
+da
+40
+02
+ee
+20
+20
+31
+91
+6f
+e0
+c9
+38
+c0
+00
+01
+ae
+20
+20
+43
+1b
+6f
+e1
+47
+8c
+2f
+ef
+fe
+0b
+20
+40
+c5
+81
+6f
+e1
+47
+8c
+2f
+ef
+fe
+07
+20
+40
+c3
+22
+58
+00
+00
+00
+67
+e1
+4a
+f2
+20
+40
+02
+98
+20
+20
+45
+54
+6f
+e0
+cb
+e2
+24
+5a
+78
+61
+70
+4b
+e2
+00
+20
+20
+78
+51
+6f
+e1
+03
+15
+1f
+e2
+0c
+00
+ef
+e0
+80
+06
+67
+e0
+c5
+f5
+1f
+e1
+04
+0f
+1f
+f1
+fe
+00
+c0
+04
+83
+07
+20
+20
+4d
+93
+da
+20
+00
+01
+20
+40
+4d
+c0
+6f
+e1
+44
+dc
+e7
+e1
+00
+05
+58
+00
+00
+00
+e7
+e0
+80
+05
+70
+09
+50
+01
+6f
+e0
+c4
+e2
+79
+20
+7e
+06
+67
+e0
+c4
+e2
+70
+09
+5b
+12
+20
+20
+78
+71
+6f
+e0
+c3
+dd
+1f
+e0
+fe
+01
+67
+e0
+c3
+dd
+c0
+06
+16
+5a
+20
+40
+19
+1b
+20
+40
+19
+6a
+6f
+e0
+82
+bd
+20
+40
+16
+8b
+20
+40
+18
+38
+20
+20
+16
+55
+ef
+e1
+00
+06
+c0
+02
+03
+20
+20
+20
+19
+e4
+ef
+e1
+80
+06
+67
+e1
+c4
+36
+c0
+05
+03
+25
+c0
+09
+03
+34
+20
+20
+1c
+d3
+6f
+e4
+4b
+ab
+c3
+1d
+9d
+e7
+20
+40
+1e
+8d
+68
+49
+44
+37
+6f
+e0
+c3
+c0
+c2
+81
+83
+2f
+6f
+e1
+44
+37
+c0
+18
+1e
+c8
+68
+49
+44
+37
+20
+20
+1d
+eb
+6f
+e1
+43
+d1
+98
+46
+7c
+00
+24
+22
+83
+2b
+24
+34
+03
+2b
+20
+20
+1e
+10
+18
+c2
+22
+00
+6f
+e1
+43
+d4
+1f
+e0
+a5
+fd
+20
+40
+1a
+25
+6f
+e0
+ca
+c1
+c0
+7f
+9e
+73
+6f
+e0
+ca
+c7
+20
+3a
+1e
+73
+6f
+e0
+cb
+75
+c2
+80
+9e
+73
+58
+00
+00
+1a
+68
+49
+44
+37
+98
+46
+7c
+00
+24
+22
+9e
+73
+70
+02
+d8
+05
+20
+20
+1e
+c9
+6f
+e0
+cb
+aa
+24
+5a
+26
+e1
+78
+34
+7c
+00
+20
+40
+14
+65
+6f
+e1
+c1
+74
+20
+3a
+7e
+56
+6f
+e0
+c0
+99
+20
+3a
+7e
+56
+20
+20
+26
+c4
+78
+54
+7c
+00
+58
+00
+00
+00
+67
+e3
+48
+d1
+20
+40
+42
+40
+20
+40
+40
+8e
+20
+40
+3f
+7e
+20
+40
+3f
+83
+20
+40
+40
+dc
+6f
+e0
+c8
+d0
+1f
+e1
+7e
+1f
+67
+e0
+c8
+d0
+24
+34
+47
+28
+20
+40
+03
+5b
+20
+20
+45
+44
+6f
+e0
+c9
+27
+c1
+01
+80
+00
+20
+20
+47
+1a
+20
+40
+3f
+65
+6f
+e0
+c9
+27
+c0
+05
+83
+65
+20
+40
+42
+32
+da
+60
+4a
+a3
+20
+40
+42
+2b
+20
+20
+40
+8e
+20
+40
+03
+6c
+da
+60
+4b
+e3
+20
+40
+42
+2b
+20
+20
+40
+8e
+6f
+e0
+c9
+27
+c0
+05
+83
+6c
+20
+20
+42
+32
+58
+00
+97
+06
+20
+40
+5b
+0c
+20
+00
+2e
+e0
+20
+60
+00
+00
+20
+40
+41
+a7
+20
+40
+3f
+65
+6f
+e0
+c9
+27
+c0
+05
+83
+76
+58
+00
+08
+06
+20
+20
+5b
+0c
+58
+00
+1f
+06
+20
+20
+5b
+0c
+6f
+e0
+cb
+e1
+24
+5a
+41
+21
+da
+20
+00
+00
+20
+40
+03
+81
+20
+40
+03
+86
+20
+40
+03
+8b
+20
+40
+03
+95
+20
+40
+03
+a2
+20
+20
+41
+1e
+6f
+e0
+c9
+18
+20
+40
+03
+af
+20
+40
+41
+24
+68
+48
+c9
+18
+20
+20
+3f
+56
+6f
+e0
+c9
+19
+20
+40
+03
+af
+20
+40
+41
+2a
+68
+48
+c9
+19
+20
+20
+3f
+56
+70
+4b
+96
+02
+6f
+e0
+cb
+90
+1f
+e2
+26
+00
+6f
+e0
+c9
+1a
+20
+40
+03
+b1
+68
+48
+c9
+1a
+20
+40
+41
+95
+67
+e0
+cb
+90
+68
+48
+c9
+1a
+20
+20
+3f
+56
+6f
+e0
+c9
+0d
+c1
+7f
+80
+00
+70
+4b
+96
+03
+6f
+e0
+cb
+91
+1f
+e2
+26
+00
+68
+48
+c9
+0d
+6f
+e0
+c9
+10
+c0
+7f
+83
+9e
+20
+20
+41
+3e
+6f
+e0
+c9
+0d
+20
+40
+03
+b1
+68
+48
+c9
+0d
+20
+20
+41
+4b
+6f
+e0
+c9
+0e
+c1
+7f
+80
+00
+70
+4b
+96
+04
+6f
+e0
+cb
+92
+1f
+e2
+26
+00
+68
+48
+c9
+0e
+6f
+e0
+c9
+10
+c0
+7f
+83
+ab
+20
+20
+41
+57
+6f
+e0
+c9
+0e
+20
+40
+03
+b1
+68
+48
+c9
+0e
+20
+20
+41
+64
+d8
+40
+00
+3f
+20
+20
+60
+93
+d8
+40
+00
+3e
+20
+20
+60
+93
+20
+40
+49
+90
+20
+40
+79
+36
+20
+40
+03
+b8
+20
+40
+03
+cc
+20
+20
+46
+4f
+6f
+e4
+4b
+ab
+c2
+97
+40
+36
+6f
+e0
+c9
+0f
+c1
+7f
+80
+00
+da
+20
+00
+00
+70
+4b
+96
+05
+68
+48
+c9
+0f
+20
+40
+03
+c1
+20
+20
+40
+2f
+6f
+e4
+4b
+ab
+c2
+96
+40
+48
+6f
+e0
+cb
+93
+1f
+e2
+26
+00
+6f
+e0
+c9
+10
+c0
+7f
+83
+c8
+20
+20
+40
+3f
+6f
+e0
+c9
+0f
+20
+40
+03
+b1
+68
+48
+c9
+0f
+20
+20
+41
+95
+6f
+e4
+4b
+ab
+c4
+1e
+80
+00
+6f
+e0
+cc
+32
+20
+40
+03
+af
+20
+40
+03
+d3
+68
+48
+cc
+32
+20
+20
+3f
+56
+70
+4c
+36
+00
+68
+48
+cc
+32
+6f
+e0
+cc
+33
+20
+40
+03
+e2
+67
+e0
+cc
+33
+6f
+e0
+cc
+35
+20
+3a
+03
+de
+6f
+e0
+cc
+34
+c1
+00
+80
+00
+70
+4c
+34
+01
+20
+20
+40
+69
+6f
+e0
+cc
+34
+c1
+00
+00
+00
+70
+4c
+34
+00
+20
+60
+00
+00
+1f
+e3
+fe
+00
+1f
+e2
+24
+00
+20
+40
+60
+59
+79
+20
+a4
+00
+1a
+41
+7e
+07
+68
+48
+cc
+36
+18
+42
+0e
+00
+c0
+03
+83
+ec
+c0
+00
+03
+ee
+20
+60
+00
+00
+70
+4c
+35
+01
+20
+60
+00
+00
+70
+4c
+35
+00
+20
+60
+00
+00
+20
+40
+40
+72
+20
+74
+00
+00
+6f
+e0
+c9
+92
+1f
+e2
+04
+00
+6f
+e4
+4b
+ab
+c2
+9e
+83
+fc
+18
+42
+7e
+00
+1f
+e0
+fe
+01
+1f
+e1
+7e
+03
+67
+e0
+c9
+92
+20
+40
+40
+95
+20
+20
+45
+ee
+6f
+e0
+cc
+35
+24
+3a
+04
+07
+6f
+e4
+4b
+ab
+c2
+8e
+04
+04
+18
+42
+7e
+00
+c1
+01
+00
+00
+1f
+e0
+fe
+01
+20
+20
+03
+f9
+18
+42
+7e
+00
+c1
+01
+80
+00
+20
+20
+04
+02
+18
+42
+7e
+00
+c1
+00
+00
+00
+1f
+e0
+ff
+ff
+20
+20
+03
+f9
+6f
+e0
+cb
+f6
+20
+7a
+00
+00
+6f
+e0
+cb
+f7
+c0
+01
+04
+17
+c0
+02
+84
+19
+c0
+04
+04
+1b
+c0
+05
+84
+1d
+c0
+07
+04
+1f
+c0
+08
+84
+15
+20
+60
+00
+00
+70
+4b
+f7
+12
+20
+60
+00
+00
+70
+4b
+f7
+03
+20
+60
+00
+00
+70
+4b
+f7
+06
+20
+60
+00
+00
+70
+4b
+f7
+09
+20
+60
+00
+00
+70
+4b
+f7
+0c
+20
+60
+00
+00
+70
+4b
+f7
+0f
+20
+60
+00
+00
+6f
+e0
+c8
+2a
+20
+3a
+04
+0b
+1f
+e2
+24
+00
+70
+48
+2a
+00
+6f
+e0
+c8
+0a
+c0
+57
+84
+33
+20
+60
+00
+00
+70
+4b
+f6
+01
+70
+40
+99
+00
+20
+20
+05
+13
+20
+60
+00
+00
+70
+47
+c6
+af
+20
+40
+22
+91
+20
+40
+26
+5b
+24
+6c
+00
+00
+24
+77
+80
+00
+20
+40
+25
+97
+20
+20
+26
+72
+6f
+e0
+c8
+0a
+c1
+d7
+80
+00
+ef
+e0
+80
+06
+e8
+40
+80
+06
+18
+46
+7c
+02
+24
+22
+93
+7a
+c0
+00
+84
+42
+c0
+01
+04
+45
+c0
+01
+84
+47
+c0
+02
+04
+49
+c0
+02
+84
+a1
+c0
+03
+04
+c7
+c0
+7f
+84
+41
+20
+20
+13
+7a
+20
+60
+00
+00
+20
+40
+04
+28
+70
+4b
+f7
+01
+20
+60
+00
+00
+70
+4b
+f7
+04
+20
+60
+00
+00
+70
+4b
+f7
+07
+20
+60
+00
+00
+70
+4b
+f7
+0a
+ef
+e1
+00
+06
+e8
+41
+00
+06
+6a
+21
+4c
+18
+9a
+26
+7c
+00
+24
+22
+84
+bf
+6f
+e1
+4c
+1a
+98
+46
+7c
+00
+24
+22
+84
+bf
+20
+40
+04
+55
+24
+34
+04
+bf
+20
+20
+04
+bd
+20
+40
+04
+60
+24
+74
+00
+00
+6f
+e1
+4c
+1a
+9e
+06
+7c
+00
+24
+22
+fe
+56
+68
+49
+09
+e8
+6f
+e1
+4c
+18
+1f
+e0
+ff
+fb
+98
+46
+7c
+00
+24
+22
+fe
+56
+20
+20
+7e
+54
+6f
+e1
+4b
+f3
+1f
+f0
+fe
+00
+67
+e1
+02
+e4
+d8
+40
+00
+03
+da
+20
+09
+d2
+20
+40
+5d
+e2
+6f
+e0
+89
+d2
+c0
+ad
+7e
+56
+e8
+41
+00
+06
+60
+49
+09
+5c
+60
+49
+09
+e8
+6f
+e0
+89
+d2
+dd
+60
+ff
+ff
+d8
+40
+00
+00
+d8
+c0
+09
+d2
+df
+20
+00
+03
+20
+40
+04
+d7
+18
+42
+60
+00
+6f
+e1
+4b
+f3
+1f
+e0
+ee
+03
+20
+40
+04
+84
+1e
+f0
+fe
+00
+67
+e1
+02
+e4
+d8
+40
+00
+02
+da
+20
+09
+d2
+20
+40
+5d
+e2
+6f
+e1
+09
+d2
+9d
+66
+7c
+00
+24
+22
+fe
+56
+6f
+e0
+89
+d2
+9e
+00
+e0
+00
+ef
+e0
+80
+06
+9e
+00
+e0
+00
+58
+00
+ff
+ff
+9e
+01
+60
+00
+20
+20
+7e
+54
+6f
+e1
+09
+5c
+20
+7a
+00
+00
+1f
+e2
+04
+00
+1f
+e6
+7c
+10
+20
+21
+04
+9f
+1f
+e0
+ff
+f0
+d8
+40
+00
+10
+67
+e1
+09
+5c
+18
+42
+5e
+00
+1e
+e2
+7e
+00
+1f
+f0
+fe
+00
+67
+e1
+02
+e4
+da
+20
+09
+d2
+20
+40
+5d
+e2
+1e
+e2
+7e
+00
+9d
+e0
+ee
+00
+1d
+e2
+72
+00
+1d
+62
+7e
+00
+d8
+c0
+09
+d2
+ef
+e0
+00
+06
+1f
+e2
+56
+00
+1d
+e2
+72
+00
+d8
+c0
+09
+d2
+1e
+02
+04
+00
+20
+40
+04
+d7
+18
+42
+60
+00
+20
+20
+04
+84
+58
+00
+00
+00
+20
+20
+04
+8b
+70
+4b
+f7
+0d
+ef
+e0
+80
+06
+18
+c2
+22
+00
+68
+48
+cc
+1c
+98
+46
+7c
+00
+20
+22
+84
+bd
+20
+40
+04
+ce
+24
+34
+04
+bf
+1a
+46
+7c
+04
+20
+21
+04
+bf
+1a
+40
+a5
+fc
+62
+41
+09
+59
+62
+21
+09
+57
+20
+40
+5d
+d3
+20
+40
+04
+c1
+20
+40
+5d
+da
+6a
+41
+09
+59
+6a
+21
+09
+57
+6f
+e1
+4c
+18
+9a
+40
+fe
+00
+67
+e1
+4c
+18
+1a
+42
+72
+00
+d8
+40
+00
+00
+1a
+22
+0c
+00
+20
+40
+04
+d7
+6f
+e1
+4c
+1a
+98
+40
+fe
+00
+67
+e1
+4c
+1a
+70
+4b
+f5
+00
+20
+60
+00
+00
+70
+4b
+f5
+01
+20
+60
+00
+00
+6f
+e1
+4b
+f3
+20
+7a
+00
+00
+68
+49
+4c
+18
+98
+40
+fe
+00
+1a
+42
+04
+00
+20
+20
+5e
+04
+6f
+e0
+cb
+f7
+c1
+08
+00
+00
+c1
+08
+80
+00
+c1
+09
+00
+00
+70
+4c
+1d
+05
+70
+4b
+f7
+10
+20
+60
+00
+00
+68
+48
+cc
+1c
+67
+e0
+cc
+1c
+c0
+00
+04
+d4
+98
+46
+7e
+00
+c0
+00
+fe
+54
+20
+20
+7e
+56
+18
+46
+7c
+ff
+20
+22
+fe
+54
+20
+20
+7e
+56
+ef
+e0
+80
+06
+98
+40
+84
+00
+c2
+00
+04
+d7
+20
+60
+00
+00
+58
+00
+ff
+ff
+ef
+e0
+00
+06
+20
+60
+00
+00
+6f
+20
+c8
+2a
+1f
+26
+7c
+02
+20
+21
+7e
+56
+df
+e0
+48
+0a
+9f
+20
+8c
+00
+18
+c0
+8d
+fe
+e8
+41
+00
+06
+d8
+c0
+48
+0a
+20
+40
+04
+db
+98
+46
+7c
+00
+20
+22
+fe
+54
+20
+20
+7e
+56
+ef
+e0
+80
+06
+c0
+ad
+05
+03
+1a
+22
+02
+00
+68
+49
+00
+06
+18
+46
+7c
+03
+20
+21
+05
+03
+18
+c0
+8c
+02
+ef
+20
+80
+06
+1f
+26
+7c
+00
+24
+22
+85
+03
+1f
+22
+7e
+00
+98
+c0
+8c
+00
+18
+42
+7e
+00
+1f
+20
+f2
+03
+9f
+26
+04
+00
+24
+22
+84
+ee
+e8
+41
+00
+06
+1a
+20
+8c
+01
+ef
+e1
+00
+06
+1f
+e0
+f2
+02
+1a
+20
+8c
+01
+20
+40
+04
+db
+98
+46
+7c
+00
+24
+22
+85
+03
+20
+20
+7e
+54
+20
+20
+7e
+56
+6f
+e1
+4b
+f3
+1f
+e2
+0c
+00
+20
+40
+04
+ea
+24
+34
+05
+0f
+6a
+21
+4b
+f3
+1a
+20
+8c
+01
+ef
+e1
+00
+06
+1f
+e0
+fe
+05
+9a
+20
+fe
+00
+67
+e1
+4b
+f3
+20
+20
+05
+04
+6f
+e1
+4b
+f1
+68
+49
+4b
+f3
+98
+46
+7e
+00
+20
+60
+00
+00
+58
+00
+00
+00
+67
+e1
+4c
+18
+67
+e1
+4c
+1a
+67
+e0
+cc
+1c
+67
+e0
+cb
+f7
+20
+60
+00
+00
+20
+40
+7e
+56
+6f
+e0
+cb
+f7
+c0
+00
+85
+22
+c0
+02
+05
+2c
+c0
+03
+85
+4b
+c0
+05
+05
+71
+c0
+06
+85
+66
+c0
+08
+05
+4f
+20
+20
+05
+7a
+70
+47
+c6
+af
+70
+47
+c7
+01
+70
+47
+c8
+00
+70
+47
+c9
+02
+58
+00
+00
+01
+67
+e1
+47
+ca
+70
+48
+36
+01
+70
+48
+35
+06
+70
+4b
+f7
+02
+20
+60
+00
+00
+70
+47
+c6
+af
+70
+47
+c7
+02
+70
+47
+c8
+00
+70
+47
+c9
+02
+6f
+f1
+00
+00
+67
+e1
+47
+ca
+58
+00
+66
+61
+e7
+e1
+00
+05
+58
+00
+00
+01
+e7
+e3
+00
+05
+58
+00
+00
+00
+e7
+e1
+00
+05
+e7
+e1
+00
+05
+20
+40
+05
+53
+e7
+e0
+80
+05
+58
+00
+00
+00
+e7
+e0
+80
+05
+68
+49
+4b
+f3
+e0
+41
+00
+05
+6f
+e1
+4b
+f1
+1f
+ed
+7e
+00
+1f
+e3
+7e
+00
+98
+46
+7e
+00
+24
+21
+05
+49
+e7
+e1
+00
+05
+70
+48
+35
+18
+70
+48
+36
+01
+70
+4b
+f7
+05
+20
+60
+00
+00
+58
+00
+00
+00
+20
+20
+05
+44
+70
+4b
+f7
+08
+70
+47
+c7
+03
+70
+48
+35
+04
+20
+20
+05
+5c
+70
+4b
+f7
+11
+70
+47
+c7
+06
+70
+48
+35
+04
+20
+20
+05
+5c
+6f
+e4
+4b
+ab
+c2
+89
+85
+58
+c2
+89
+05
+5a
+58
+00
+00
+00
+20
+60
+00
+00
+58
+00
+00
+02
+20
+60
+00
+00
+58
+00
+00
+04
+20
+60
+00
+00
+70
+48
+36
+01
+70
+47
+c6
+af
+70
+47
+c8
+00
+70
+47
+c9
+02
+20
+60
+00
+00
+70
+47
+c8
+01
+70
+48
+36
+01
+70
+47
+c6
+af
+70
+47
+c9
+02
+20
+60
+00
+00
+70
+4b
+f7
+0f
+70
+47
+c7
+05
+6f
+e0
+cc
+1c
+67
+e0
+c7
+ca
+70
+48
+35
+05
+70
+48
+36
+01
+70
+47
+c6
+af
+6f
+e0
+cb
+f5
+67
+e0
+c7
+c8
+70
+47
+c9
+02
+20
+60
+00
+00
+70
+4b
+f7
+0c
+70
+47
+c7
+04
+70
+48
+35
+04
+70
+48
+36
+01
+70
+47
+c6
+af
+6f
+e0
+cb
+f5
+67
+e0
+c7
+c8
+70
+47
+c9
+02
+20
+60
+00
+00
+70
+47
+c6
+af
+70
+47
+c7
+ff
+70
+47
+c8
+00
+70
+47
+c9
+02
+70
+48
+36
+01
+70
+48
+35
+04
+20
+60
+00
+00
+1f
+e2
+22
+00
+70
+4b
+f8
+00
+70
+48
+36
+01
+da
+40
+4b
+f9
+20
+60
+00
+00
+1e
+86
+aa
+55
+40
+00
+00
+40
+09
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+08
+08
+00
+80
+00
+40
+01
+00
+88
+d6
+53
+46
+00
+01
+00
+00
+00
+00
+00
+00
+00
+00
+18
+00
+00
+00
+00
+00
+00
+00
+00
+00
+80
+00
+00
+00
+02
+00
+00
+00
+01
+00
+00
+20
+04
+16
+00
+00
+aa
+55
+01
+00
+9a
+40
+08
+aa
+55
+03
+00
+7a
+41
+88
+1f
+ce
+aa
+55
+01
+00
+c5
+40
+18
+aa
+55
+01
+00
+ef
+41
+ff
+aa
+55
+02
+00
+ca
+40
+ef
+41
+aa
+55
+01
+00
+7d
+41
+70
+aa
+55
+01
+00
+d0
+44
+00
+aa
+55
+01
+00
+ea
+41
+ff
+aa
+55
+01
+00
+ee
+41
+00
+aa
+55
+08
+00
+ab
+4b
+14
+09
+5a
+00
+03
+04
+09
+03
+aa
+55
+0c
+00
+fe
+48
+b0
+04
+58
+02
+64
+64
+94
+85
+90
+63
+75
+80
+aa
+55
+03
+00
+0d
+49
+ff
+ff
+0d
+aa
+55
+01
+00
+32
+4c
+ff
+aa
+55
+17
+00
+10
+49
+ff
+ff
+ff
+04
+05
+ff
+ff
+08
+0c
+0d
+0c
+ff
+ff
+ff
+0a
+07
+06
+ff
+ff
+ff
+02
+00
+00
+aa
+55
+03
+00
+ed
+4b
+0b
+58
+02
+aa
+55
+01
+00
+3c
+4c
+05
+aa
+55
+01
+00
+58
+0b
+ff
+aa
+55
+12
+00
+cc
+4b
+00
+05
+00
+04
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+aa
+55
+01
+00
+99
+40
+01
+aa
+55
+02
+00
+b3
+4b
+03
+02
+aa
+55
+08
+00
+38
+49
+00
+34
+ff
+ff
+ff
+ff
+ff
+ff
+aa
+55
+07
+00
+56
+49
+34
+ff
+ff
+ff
+ff
+ff
+ff
+aa
+55
+17
+00
+73
+49
+33
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+aa
+55
+13
+00
+b5
+4b
+00
+40
+0a
+60
+06
+0a
+00
+64
+00
+70
+17
+14
+0a
+90
+01
+e8
+03
+90
+01
+aa
+55
+02
+00
+ca
+4b
+07
+06
+aa
+55
+01
+00
+c0
+49
+02
+aa
+55
+04
+00
+37
+4c
+03
+08
+3e
+01
+aa
+55
+01
+00
+fd
+48
+00
+aa
+55
+01
+00
+a1
+44
+05
+aa
+55
+06
+00
+e3
+48
+47
+01
+23
+01
+30
+01
+aa
+55
+0a
+00
+eb
+48
+10
+00
+52
+00
+35
+00
+21
+00
+25
+00
+aa
+55
+01
+00
+f7
+48
+0a
+aa
+55
+02
+00
+c8
+4b
+64
+00
+aa
+55
+03
+00
+de
+4b
+00
+00
+00
+aa
+55
+01
+00
+ab
+4a
+ff
+aa
+55
+01
+00
+e2
+4b
+01
+aa
+55
+01
+00
+77
+41
+20
+aa
+55
+01
+00
+8a
+4b
+20
+aa
+55
+01
+00
+7d
+44
+06
+aa
+55
+06
+00
+a8
+40
+15
+a0
+c8
+12
+23
+51
+aa
+55
+0c
+00
+fc
+45
+0b
+42
+54
+33
+2e
+30
+20
+4d
+6f
+75
+73
+65
+aa
+55
+05
+00
+55
+44
+0e
+00
+01
+00
+02
+aa
+55
+01
+00
+41
+46
+0a
+aa
+55
+01
+00
+64
+47
+01
+aa
+55
+01
+00
+78
+46
+00
+aa
+55
+01
+00
+5f
+41
+00
+aa
+55
+03
+00
+65
+47
+03
+00
+04
+aa
+55
+01
+00
+8e
+47
+01
+aa
+55
+01
+00
+d8
+40
+01
+aa
+55
+0c
+00
+e7
+43
+1f
+02
+01
+05
+03
+03
+12
+18
+03
+19
+c2
+03
+aa
+55
+14
+00
+d2
+4a
+06
+ff
+06
+00
+03
+00
+80
+0c
+09
+42
+54
+35
+2e
+32
+20
+4d
+6f
+75
+73
+65
+aa
+55
+0e
+00
+07
+44
+1f
+0c
+09
+42
+54
+35
+2e
+32
+20
+4d
+6f
+75
+73
+65
+aa
+55
+0c
+00
+f7
+42
+0b
+42
+54
+35
+2e
+32
+20
+4d
+6f
+75
+73
+65
+aa
+55
+0c
+00
+1e
+4c
+0b
+42
+54
+35
+2e
+32
+20
+4d
+6f
+75
+73
+65
+aa
+55
+08
+00
+72
+43
+07
+00
+07
+00
+20
+00
+2c
+01
+aa
+55
+06
+00
+cc
+4a
+03
+12
+18
+ff
+00
+00
+aa
+55
+04
+00
+28
+44
+00
+00
+00
+00
+aa
+55
+01
+00
+32
+44
+07
+aa
+55
+08
+00
+4c
+44
+fb
+00
+48
+08
+fb
+00
+48
+08
+aa
+55
+06
+00
+7a
+43
+8e
+b1
+3a
+0e
+8e
+ed
+aa
+55
+02
+00
+e7
+4a
+15
+00
+aa
+55
+02
+00
+57
+43
+19
+00
+aa
+55
+06
+00
+e9
+4a
+1d
+00
+21
+00
+30
+00
+aa
+55
+02
+00
+d1
+43
+2d
+00
+aa
+55
+01
+00
+f0
+4a
+96
+aa
+55
+01
+00
+86
+44
+ff
+aa
+55
+01
+00
+90
+47
+ff
+aa
+55
+01
+00
+8f
+47
+1e
+aa
+55
+0c
+00
+d0
+49
+03
+04
+01
+02
+20
+2a
+3f
+15
+14
+1b
+11
+0e
+aa
+55
+b2
+00
+df
+49
+09
+5a
+26
+34
+19
+04
+09
+00
+ff
+ff
+09
+5a
+0d
+f0
+1d
+e3
+7d
+d2
+ff
+ff
+09
+5a
+0d
+10
+1d
+ed
+7d
+80
+ff
+ff
+1b
+35
+28
+b4
+29
+46
+2a
+96
+2b
+8c
+2c
+6e
+2d
+64
+38
+5f
+39
+0f
+3a
+32
+3b
+47
+42
+10
+ff
+ff
+54
+2e
+55
+f2
+61
+f4
+63
+70
+75
+52
+76
+41
+77
+ed
+78
+23
+79
+46
+7a
+e5
+7c
+48
+7e
+77
+7f
+01
+0b
+00
+7f
+00
+09
+00
+ff
+ff
+09
+5a
+ff
+27
+ab
+40
+be
+d1
+a0
+41
+a1
+12
+a5
+84
+a7
+ff
+b5
+d0
+b6
+00
+ff
+00
+09
+00
+ff
+ff
+09
+5a
+0d
+10
+0e
+c5
+5b
+9a
+10
+38
+11
+42
+28
+28
+41
+23
+49
+39
+4a
+b0
+4b
+a0
+4c
+90
+4d
+70
+09
+00
+ff
+ff
+09
+5a
+06
+02
+09
+69
+0d
+48
+0e
+9f
+0f
+ba
+09
+00
+ff
+ff
+09
+a5
+46
+34
+60
+07
+69
+04
+7d
+20
+7e
+00
+09
+00
+ff
+ff
+aa
+55
+08
+00
+a3
+4a
+09
+5a
+0b
+f3
+09
+00
+ff
+ff
+aa
+55
+08
+00
+e3
+4b
+09
+a5
+0b
+f3
+09
+00
+ff
+ff
+aa
+55
+02
+00
+8d
+44
+2d
+49
+aa
+55
+01
+00
+8c
+44
+01
+aa
+55
+01
+00
+65
+48
+01
+aa
+55
+01
+00
+64
+48
+01
+aa
+55
+01
+00
+36
+48
+01
+aa
+55
+01
+00
+a8
+48
+06
+aa
+55
+02
+00
+38
+48
+c0
+12
+aa
+55
+03
+00
+54
+48
+19
+19
+1c
+aa
+55
+10
+00
+40
+48
+00
+13
+2c
+42
+06
+15
+36
+48
+0f
+1a
+3a
+4c
+11
+23
+31
+4d
+aa
+55
+01
+00
+5b
+48
+00
+aa
+55
+05
+00
+77
+48
+20
+15
+10
+05
+4e
+aa
+55
+05
+00
+8c
+48
+01
+0f
+0f
+0f
+0f
+aa
+55
+06
+00
+ad
+48
+0c
+f8
+00
+00
+77
+01
+aa
+55
+03
+00
+5c
+48
+00
+48
+60
+aa
+55
+01
+00
+7d
+48
+07
+aa
+55
+02
+00
+99
+48
+b5
+4a
+aa
+55
+01
+00
+ca
+48
+80
+aa
+55
+02
+00
+c2
+48
+14
+00
+aa
+55
+02
+00
+c0
+48
+50
+00
+aa
+55
+03
+00
+b8
+48
+00
+a6
+0e
+aa
+55
+03
+00
+b8
+49
+00
+50
+00
+aa
+55
+02
+00
+79
+44
+80
+1f
+aa
+55
+01
+00
+83
+44
+80
+aa
+55
+01
+00
+e8
+41
+01
+aa
+55
+05
+00
+f0
+4b
+02
+40
+00
+0d
+1b
+48
+71
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+79
+64
Index: output/memmap.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/memmap.format	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/memmap.format	(working copy)
@@ -0,0 +1,2496 @@
+0x0000 mem_le_adv_transmit
+0x0001 mem_le_adv_waitcnt
+0x0002 mem_le_adv_rcv
+0x0003 mem_le_req_rcv
+0x0004 mem_le_scanrsp_rcv
+0x0005 mem_le_conn_rcv
+0x0006 mem_inquiryscan_waitcnt
+0x0007 mem_inquiryscan_rcvcnt
+0x0008 mem_pagescan_waitcnt
+0x0009 mem_pagescan_rcvcnt
+0x000a mem_pagescan_rcvfhscnt
+0x000b mem_slave_rcvcnt
+0x000c mem_page_transmit
+0x000d mem_page_rcv
+0x000e mem_page_rcv_fhs
+0x000f mem_master_rcvcnt
+0x0010 mem_fhs_wait_counter
+0x0011 mem_newconnto_counter
+0x0012 mem_inquiry_transmit
+0x0013 mem_inquiry_rcv
+0x0014 mem_fw_ver
+0x0015 mem_current_context
+0x0016 mem_le_ch_mapped
+0x0017 mem_last_freq
+0x0018 mem_rssi
+0x0019 mem_rssi_hex
+0x001a mem_rx_type
+0x001b mem_rx_hec_err
+0x001d mem_rx_crc_err
+0x001f mem_context_ptr
+0x0021 mem_display
+0x0029 mem_bcd
+0x0031 mem_state
+0x0032 mem_mode
+0x0033 mem_tsniff
+0x0035 mem_sniff_anchor
+0x0039 mem_clk_offset
+0x003f mem_rx_window
+0x0041 mem_plap
+0x0044 mem_puap
+0x0045 mem_pnap
+0x0047 mem_conn_handle
+0x0048 mem_arq
+0x0049 mem_lmp_to_send
+0x004a mem_lmi_opcode
+0x004b mem_lmo_reason
+0x004c mem_op
+0x004d mem_state_map
+0x004e mem_supervision_timer
+0x0052 mem_supervision_to
+0x0054 mem_name_offset
+0x0055 mem_key_size
+0x0056 mem_conn_sm
+0x0057 mem_aco
+0x0063 mem_kc
+0x0073 mem_conn_timer
+0x0074 mem_sniff_attempt
+0x0075 mem_sniff_timeout
+0x0076 mem_dsniff
+0x0078 mem_amaddr
+0x0079 mem_lmo_opcode1
+0x007a mem_lmi_opcode1
+0x007b mem_lmo_reason1
+0x007c mem_lmo_tid1
+0x007d mem_lmo_opcode2
+0x007e mem_lmi_opcode2
+0x007f mem_lmo_reason2
+0x0080 mem_lmo_tid2
+0x0081 mem_bt_context_reserve
+0x0089 mem_current_sniff_attempt
+0x008a mem_current_sniff_timeout
+0x008b mem_nfreq_index_inq
+0x008c mem_nfreq_index_page
+0x008d mem_ninqy_index
+0x008e mem_fhs_misc
+0x008f mem_subsniff_instant
+0x0093 mem_subsniff_rate
+0x0094 mem_subsniff_tcmax
+0x0096 mem_subsniff_tsniff
+0x0097 mem_lpm_adjust
+0x0098 mem_sync_clke
+0x009e mem_lpm_current_mult
+0x009f mem_gpio_wakeup_low
+0x00a3 mem_gpio_wakeup_high
+0x00a7 mem_npage_index
+0x00a8 mem_page_mode
+0x00a9 mem_page_clk
+0x00ad mem_temp_am_addr
+0x00ae mem_temp_arq
+0x00af mem_len
+0x00b1 mem_clkn_bt
+0x00b5 mem_clke_bt
+0x00b9 mem_dpll_clkn
+0x00bd mem_connection_options
+0x00be mem_nameres_cnt
+0x00bf mem_txptr
+0x00c1 mem_slot_offset
+0x00c3 extm_fhs_misc
+0x00c4 extm_newconn_am_addr
+0x00c5 extm_class
+0x00c8 extm_lap
+0x00cb extm_uap
+0x00cc extm_nap
+0x00cf mem_rxbuf
+0x00e4 mem_debug_config
+0x00e5 mem_lch_code
+0x00e6 mem_fhs_am_addr
+0x00e7 mem_select_list_item
+0x00e8 mem_temp_reconn_record
+0x00e8 mem_record_bt_mode
+0x00e9 mem_temp_lap
+0x00ef mem_list_item_ptr
+0x00f1 mem_eir
+0x0155 mem_param_tx_setup
+0x0157 mem_param_rf_setup
+0x0159 mem_param_conn_access
+0x015b mem_param_clke_cal
+0x015d mem_param_pll_setup
+0x015f mem_param_rx_setup
+0x0161 mem_param_dpll_start_delay
+0x0163 mem_param_rt_rthalfslot
+0x0165 mem_param_clke_cal_le_1m
+0x0167 mem_param_clke_cal_le_2m
+0x0169 mem_param_clke_cal_le_coded
+0x016b mem_le_rxbuf
+0x026f mem_le_mic
+0x0273 mem_le_peer_mic
+0x0277 mem_le_mrand
+0x0287 mem_le_state
+0x0288 mem_le_mode
+0x0289 mem_le_tsniff
+0x028b mem_le_anchor
+0x028f mem_le_clk_offset
+0x0295 mem_le_receive_window
+0x0297 mem_le_plap
+0x029d mem_le_conn_handle
+0x029e mem_le_arq
+0x029f mem_le_ch
+0x02a0 mem_le_hop
+0x02a1 mem_le_event_count
+0x02a3 mem_le_supervision_timer
+0x02a7 mem_le_instant
+0x02a9 mem_le_channels
+0x02aa mem_le_op
+0x02ab mem_le_access
+0x02af mem_le_crcinit
+0x02b2 mem_le_window_size
+0x02b3 mem_le_slave_latency
+0x02b5 mem_le_superto
+0x02b7 mem_le_channel_map
+0x02bc mem_le_rx_phy
+0x02bd mem_le_tx_phy
+0x02be mem_le_update_new_param
+0x02c7 mem_le_sk
+0x02d7 mem_le_peer_sca
+0x02d8 mem_le_err_code
+0x02d9 mem_le_ll_pairing_fail_reason
+0x02da mem_le_context_reserve
+0x02df mem_le_testtype
+0x02e0 mem_cmd_le_create_conn
+0x02e1 mem_ucode_status
+0x02e2 mem_spid_tbuf
+0x02e3 mem_iicd_tbuf
+0x02e3 mem_addr_hi
+0x02e4 mem_addr_mi
+0x02e5 mem_addr_lo
+0x02e6 mem_iicd_addr
+0x02e7 mem_spid_rbuf
+0x02eb mem_ucode_buf
+0x02ed mem_ucode_len
+0x02ef mem_sched_addr
+0x02f1 mem_ucode_ptr
+0x02f3 mem_ucode_keybuf
+0x0303 mem_spid2_tbuf
+0x0304 mem_addr_hi2
+0x0305 mem_addr_mi2
+0x0306 mem_addr_lo2
+0x0307 mem_spid2_rbuf
+0x030b mem_reconnect_flag
+0x030c mem_switch_fail_master_count
+0x030d mem_app_evt_timer_count
+0x030e mem_l2cap_mem_start
+0x030e mem_l2cap_rxbuff1_len
+0x0310 mem_l2cap_rxbuff2_len
+0x0312 mem_l2cap_rxbuff_new
+0x0314 mem_l2cap_rxbuff_inuse
+0x0315 mem_l2cap_payload_ptr
+0x0317 mem_l2cap_rx_pkt_length
+0x0319 mem_l2cap_rx_cid
+0x031b mem_l2cap_rx_done
+0x031c mem_l2cap_signal_tx_buff_ptr
+0x031e mem_l2cap_signal_tx_payload_ptr
+0x0320 mem_l2cap_signal_tx_length
+0x0322 mem_sdp_tx_buff_ptr
+0x0324 mem_sdp_tx_payload_ptr
+0x0326 mem_sdp_tx_pkt_length
+0x0328 mem_rfcomm_tx_buff_ptr
+0x032a mem_rfcomm_tx_payload_ptr
+0x032c mem_rfcomm_tx_pkt_length
+0x032e memL2CAP_T1
+0x0330 mem_CONTROL_tasks
+0x0331 mem_send_config_req
+0x0332 mem_config_identifier
+0x0333 mem_config_req_dest_CID
+0x0335 mem_rfcomm_malloc_fail_flag
+0x0336 mem_message_to_uppersm
+0x0337 mem_upper_sm_remote_page
+0x0338 mem_upper_sm_reconn
+0x0339 mem_upper_sm_ss
+0x033a mem_tx_malloc_log
+0x037a mem_l2cap_mem_end
+0x037a mem_scid
+0x037c mem_cmd_length
+0x037e mem_tt2
+0x0380 mem_tt3
+0x0382 mem_id
+0x0384 mem_psm
+0x0386 mem_l2cap_sdpres_delay_time
+0x038a mem_lmo_header_length
+0x038b mem_lmo_header_opcode
+0x038c mem_lmo_payload
+0x039d mem_lmi_accepted_opcode
+0x039e mem_disconn_reason_send
+0x039f mem_tx_fixed_freq
+0x03a0 mem_rx_fixed_freq
+0x03a1 mem_ext_features_page
+0x03a2 mem_lmpext_ssp_enable
+0x03a4 mem_remote_sppcap
+0x03a5 mem_lmp_conn_state
+0x03a6 mem_soft_timer
+0x03a8 mem_pincode_state
+0x03a9 mem_sres_tid
+0x03aa mem_accptsco_tid
+0x03ab mem_wait_encryption
+0x03ac mem_sniff_payload
+0x03bc mem_aurand_send_delay_time
+0x03c0 memRemoteRPNBitRate
+0x03c1 memRemotePRNDataBits
+0x03c2 memRemotePRNStopBit
+0x03c3 memRemotePRNParity
+0x03c4 memRemotePRNFlowControl
+0x03c5 memRemotePRNXon
+0x03c6 memRemotePRNXoff
+0x03c7 mem_mod2div_temp
+0x03ca mem_contw_temp
+0x03cc mem_attrib_list
+0x03ce mem_current_adss
+0x03cf mem_current_channel
+0x03d0 mem_current_frame_type
+0x03d1 mem_current_fcs
+0x03d2 mem_current_length
+0x03d4 mem_rfcomm_uih_payload_ptr
+0x03d6 mem_uih_cmd_type
+0x03d7 mem_uih_length
+0x03d9 mem_param_payload_ptr
+0x03db mem_ms_param
+0x03dc mem_pn_credit_flow_type_info
+0x03dd mem_pn_priority
+0x03de mem_pn_acknowledg_timer
+0x03df mem_pn_max_retrans
+0x03e0 mem_rfcomm_send_adss
+0x03e1 mem_rfcomm_send_frame_type
+0x03e2 mem_rfcomm_send_fcs
+0x03e3 mem_rfcomm_send_offset
+0x03e4 mem_sdp_mem_start
+0x03e4 mem_sdp_uuid_search_ptr
+0x03ec mem_sdp_continue_byte
+0x03ee mem_sdp_pduid
+0x03ef mem_sdp_transactionid
+0x03f1 mem_sdp_transactionid_local
+0x03f3 mem_sdp_attribute_maxbyte
+0x03f5 mem_sdp_record_maxcnt
+0x03f7 mem_sdp_record_handle
+0x03fb mem_sdp_LACAP_found
+0x03fc mem_sdp_RFCOMM_found
+0x03fd mem_sdp_handle_list
+0x03fd mem_sdp_attrib_list
+0x041d mem_sdp_error_code
+0x041f mem_sdp_all_length
+0x0421 mem_handle_humber
+0x0422 mem_search_uuid
+0x0424 mem_sdp_mem_end
+0x0424 mem_random_number
+0x0434 mem_round_key
+0x0444 mem_kinit
+0x0454 mem_input_store
+0x0464 mem_x
+0x0474 mem_y
+0x0483 mem_y15
+0x0484 mem_key_store
+0x0495 mem_key_store_end
+0x0496 memp_ar_key
+0x0498 memp_ar_input
+0x049a mem_ar_hround
+0x04a4 mem_ec_infinite
+0x04a5 mem_ec_loopc
+0x04a7 mem_aes_cmac_data_length
+0x04a8 memdat
+0x04a8 mem_ax
+0x04c0 mem_ay
+0x04d8 mem_az
+0x04f0 mem_bx
+0x0508 mem_ax_256//32 bytes
+0x0508 mem_by
+0x0520 mem_bz
+0x0528 mem_ay_256// 32 bytes
+0x0538 mem_cx
+0x0548 mem_az_256// 32 bytes
+0x0550 mem_cy
+0x0567 mem_cy5
+0x0568 mem_bx_256// 32 bytes
+0x0568 mem_cz
+0x0580 mem_k
+0x0588 mem_by_256// 31 bytes
+0x0598 mem_align
+0x05a8 mem_bz_256//32 bytes
+0x05a8 mem_tmp1
+0x05a8 memahbak
+0x05c0 mem_tmp5
+0x05c8 mem_cx_256//32 bytes
+0x05c8 memahsave
+0x05d8 mem_tmp2
+0x05e8 mem_cy_256// 32 bytes
+0x05e8 memahsave_end
+0x05e8 mem_addr_padding
+0x05e9 mem_addr_value
+0x05f0 mem_tmp3
+0x05f0 mem_t1
+0x05f5 mem_addr_value_end
+0x05f8 mem_addr_iocap_end
+0x0607 mem_cy5_256// 1 byte
+0x0608 mem_cz_256// 32 bytes
+0x0608 mem_tmp0
+0x0608 mem_t0
+0x0610 mem_tmp0a
+0x0620 mem_t2
+0x0628 mem_k_256//32 bytes
+0x0638 mem_t3
+0x0648 mem_tmp1_256//32 bytes
+0x0650 mem_t7
+0x0668 mem_tmp5_256
+0x0688 mem_tmp2_256
+0x06a8 mem_tmp3_256
+0x06a8 mem_t1_256
+0x06c8 mem_tmp0_256
+0x06c8 mem_t0_256
+0x06e8 mem_t2_256
+0x0708 mem_t3_256
+0x0728 mem_t7_256
+0x0748 mem_p
+0x0760 mem_a
+0x0778 mem_b
+0x0790 mem_gx
+0x07a8 mem_gy
+0x07c0 memh0
+0x07e0 mem_p_256
+0x0800 mem_a_256
+0x0820 mem_gx_256
+0x0840 mem_gy_256
+0x0860 mem_le_slat
+0x0870 mem_sp_state_start
+0x0870 mem_sp_state
+0x0871 mem_master_sp_state
+0x0872 mem_sp_flag
+0x0873 mem_master_sp_flag
+0x0874 mem_sp_calc
+0x0875 mem_sp_dh_ready
+0x0876 mem_sp_localsm
+0x0877 mem_pairing_auth
+0x0878 mem_sp_local_key_send_count
+0x0879 mem_sp_remote_key_recv_count
+0x087a mem_sp_remote_key_invalid
+0x087b mem_sp_dhkey_invalid
+0x087c mem_gkey
+0x0880 mem_sp_state_end
+0x0880 mem_le_pubkey_remote_x_256
+0x0888 mem_sp_pubkey_remote
+0x0888 mem_sp_pubkey_remote_x
+0x08a0 mem_sp_pubkey_remote_x_end
+0x08a0 mem_le_pubkey_remote_y_256
+0x08a8 mem_sp_pubkey_remote_y
+0x08c0 mem_le_dhkey_256
+0x08c8 mem_sp_dhkey
+0x08e0 mem_sp_dhkey_end
+0x08e0 mem_sp_random_local
+0x08f0 mem_sp_random_local_end
+0x08f0 mem_sp_random_remote
+0x0900 mem_sp_random_remote_end
+0x0900 memresult
+0x0900 mem_sp_calc_result
+0x0900 memh
+0x0904 memg
+0x0908 memf
+0x090c meme
+0x0910 mem_sp_calc_result_high
+0x0910 memd
+0x0914 memc
+0x0918 memb
+0x091c mema
+0x0920 mem_sp_check_result
+0x0930 mem_sp_confirm_remote
+0x0940 mem_sp_prarm_stack
+0x0950 mem_UI_data_txbuff_length
+0x0952 mem_ipc_skip_continue_proc
+0x0953 mem_ui_timer_temp//length 4
+0x0953 mem_ipc_rega_temp
+0x0957 mem_hold_contr
+0x0959 mem_hold_contw
+0x095b mem_fifo_temp
+0x095c mem_pdatatemp
+0x0964 mem_temp//8 bytes
+0x096c mem_timeup// 4 bytes
+0x0970 mem_rega//4 bytes
+0x0974 mem_regb//4 bytes
+0x0978 mem_regc//3 bytes
+0x097b mem_contr//2 bytes
+0x097d mem_contw//2 bytes
+0x097f mem_contus
+0x0981 mem_contue
+0x0983 mem_contu
+0x0985 mem_queue
+0x0987 mem_loopcnt
+0x0989 mem_wakup_from_power_flag
+0x098a mem_saved_gpio_in
+0x098e mem_module_rx_error_data_buffer
+0x098e mem_shutter_random_mac_data_temp
+0x098e mem_shutter_config_data_temp
+0x098e mem_le_adv_channel_map_temp
+0x098e mem_le_data_len_temp//1byte
+0x098e mem_tx_fifo_map_temp
+0x098e mem_rpn_dlci//1byte
+0x098e mem_event_cmd_response_content//2byte
+0x098e mem_le_prand//16byte
+0x098e mem_AES_CMAC_k//16 bytes
+0x098e mem_regext_index//1 bytes
+0x098e mem_temp_block0
+0x098f mem_le_data_temp//15bytes
+0x098f mem_temp_block1
+0x099e mem_le_aes_128//16byte
+0x099e mem_regext//64 bytes
+0x099e mem_AES_CMAC_k1//16 bytes
+0x099e mem_temp_block2
+0x09ae mem_AES_CMAC_k2//16 bytes
+0x09ae mem_temp_block3
+0x09be mem_AES_CMAC_temp// 16 bytes
+0x09be mem_temp_block4
+0x09ce mem_AES_CMAC_M_last// 16 bytes
+0x09ce mem_module_uart_cmd
+0x09cf mem_module_uart_opcode
+0x09d0 mem_module_uart_len
+0x09d1 mem_module_temp_nl_discard_packet
+0x09d2 mem_temp_block5
+0x09de mem_le_mackey//16 bytes
+0x09de mem_app_receive_temp
+0x09de mem_key_value_temp
+0x09e0 mem_key_value
+0x09e2 mem_key_value_temp1
+0x09e3 mem_key_value_temp2
+0x09e4 mem_key_value_temp3
+0x09e5 mem_key_value_temp4
+0x09e6 mem_key_value_temp5
+0x09e7 mem_key_value_temp6
+0x09e8 mem_temp_block6
+0x09ee mem_scale_ratio
+0x09f1 mem_xcnt
+0x09f4 mem_scale_ratio_temp
+0x09f6 mem_mesh_receive_model_message_payload_len
+0x09f7 mem_mesh_receive_model_message_payload_opcode
+0x09f8 mem_mesh_receive_model_message_payload
+0x0a0f mem_mesh_access_layer_payload_len
+0x0a10 mem_mesh_access_layer_payload
+0x0a10 mem_mesh_access_payload
+0x0a42 mem_mesh_access_payload_padding//为了透传模块预留
+0x0a74 mem_mesh_queue_ele_temp
+0x0a74 mem_mesh_queue_ele_duration
+0x0a75 mem_mesh_queue_ele_gatt_msg_id
+0x0a76 mem_mesh_queue_ele_len
+0x0a77 mem_mesh_queue_ele_payload
+0x0a96 mem_mesh_queue_ele_padding
+0x0a97 mem_le_txheader_mesh_temp
+0x0abe mem_mesh_sha256_chunk_start
+0x0abe mem_mesh_sha256_chunk1
+0x0afe mem_mesh_sha256_chunk2
+0x0b3e mem_mesh_sha256_chunk3
+0x0b7e mem_mesh_sha256_chunk4
+0x0bbe mem_mesh_Privacy_Plaintext
+0x0bbe mem_mesh_Privacy_Plaintext_Zero_String
+0x0bc3 mem_mesh_Privacy_Plaintext_IV_Index
+0x0bc7 mem_mesh_Privacy_Plaintext_Privacy_Random
+0x0bc7 mem_mesh_Privacy_Plaintext_Privacy_Random_EncDST
+0x0bc9 mem_mesh_Privacy_Plaintext_Privacy_Random_EncTransportPDU_or_NetMIC
+0x0bce mem_mesh_PECB
+0x0bde mem_nonce_ptr
+0x0be0 mem_ccm_data_len
+0x0be1 mem_ccm_data_ptr
+0x0be3 mem_ccm_mic
+0x0beb mem_ccm_type
+0x0bec mem_mesh_Device_UUID
+0x0bfc mem_mesh_receive_VID
+0x0bfd mem_mesh_mic_cache_ptr
+0x0bff mem_mesh_lower_transport_layer_payload_len
+0x0c00 mem_mesh_loopcnt_tmep
+0x0c02 mem_mesh_rega_temp
+0x0c04 mem_mesh_regb_temp
+0x0c06 mem_mesh_regc_temp
+0x0c08 mem_mesh_alarm_temp
+0x0c0a mem_mesh_message_Transport_NetMIC_length
+0x0c0b mem_mesh_message_NID
+0x0c0c mem_mesh_message_TTL
+0x0c0d mem_mesh_message_SEQ
+0x0c10 mem_mesh_message_SRC
+0x0c12 mem_mesh_message_DST
+0x0c14 mem_mesh_message_Transport_NetMIC
+0x0c14 mem_mesh_message_Transport_Head
+0x0c15 mem_mesh_message_Transport_unsegmented_access_messagePDU
+0x0c15 mem_mesh_message_Transport_segmented_access_messagePDU
+0x0c15 mem_mesh_message_segment_access_SZMIC_SeqZero_SegO_SegN
+0x0c18 mem_mesh_message_Transport_segmented_access_messagePDU_Segment
+0x0c18 mem_mesh_message_Transport_NetMIC_end
+0x0c28 mem_mesh_nonce_struct
+0x0c35 mem_mesh_send_message_DST
+0x0c37 mem_mesh_last_message_SEQ
+0x0c3a mem_mesh_network_packet_type
+0x0c3b mem_mesh_upper_transport_layer_payload_ptr
+0x0c3d mem_mesh_segmented_upper_transport_layer_payload_len
+0x0c3e mem_mesh_segmented_lower_transport_layer_SegZero
+0x0c40 mem_mesh_segmented_lower_transport_layer_SegO
+0x0c41 mem_mesh_segmented_lower_transport_layer_SegN
+0x0c42 mem_mesh_segmented_last_packet_upper_teansport_payload_len
+0x0c43 mem_mesh_upper_tran_layer_queue_temp
+0x0c43 mem_mesh_upper_tran_layer_temp_packet_flag
+0x0c44 mem_mesh_upper_tran_layer_temp_packet_transmit_delay
+0x0c46 mem_mesh_upper_tran_layer_temp_packet_TID
+0x0c47 mem_mesh_upper_tran_layer_temp_packet_header_IVI_NID
+0x0c48 mem_mesh_upper_tran_layer_temp_packet_header_CTL_TTL
+0x0c49 mem_mesh_upper_tran_layer_temp_packet_header_SEQ
+0x0c4c mem_mesh_upper_tran_layer_temp_packet_header_SRC
+0x0c4e mem_mesh_upper_tran_layer_temp_packet_header_DST
+0x0c50 mem_mesh_upper_tran_layer_temp_packet_length
+0x0c51 mem_mesh_upper_tran_layer_temp_packet_payload
+0x09f6 mem_hci_opcode_ocf
+0x09f8 mem_hci_opcode_ogf
+0x09f9 mem_hci_event_head_type
+0x09fa mem_hci_event_head_event_code
+0x09fb mem_hci_event_para_total_length
+0x09fc mem_hci_command_complete_num_hci_command_packet
+0x09fd mem_hci_command_complete_command_opcode
+0x09fd mem_hci_opcode
+0x09ff mem_hci_command_complete_return_parameter
+0x09ff mem_hci_command_complete_return_parameter_status
+0x0a00 mem_hci_command_complete_return_parameter_chip_id
+0x09f6 mem_vdk
+0x09f8 mem_vok
+0x09fc mem_omega
+0x0a02 mem_b1
+0x0a06 mem_b2
+0x0a0a mem_u1
+0x0a1a mem_u2
+0x0a2a mem_q
+0x09f6 mem_module_le_rx_data_len
+0x09f8 mem_module_le_rx_data_address
+0x09fa mem_module_le_rx_data_handle
+0x09f6 mem_init_cnt
+0x09f8 mem_data_pre
+0x09fa mem_data_current
+0x09fc mem_data_sum
+0x09ff mem_data_value
+0x09f6 mem_tst_pktcnt_sync
+0x09f8 mem_tst_pktcnt_hec
+0x09fa mem_tst_pktcnt_crc
+0x09fc mem_tst_pktcnt_dmh
+0x09fe mem_tmp_buffer_head
+0x0a01 mem_tmp_buffer
+0x0a51 mem_tester_emulate
+0x0a52 mem_temp_payload
+0x0a52 test_mode_scenario
+0x0a53 test_mode_hopping_mode
+0x0a54 test_mode_tx_freq
+0x0a55 test_mode_rx_freq
+0x0a56 test_mode_power_mode
+0x0a57 test_mode_poll_period
+0x0a58 test_mode_packet_type
+0x0a59 test_mode_data_length
+0x0a5b mem_test_mode_old_debug_config
+0x0a5c mem_tester_cnt
+0x09f6 mem_usb_status
+0x09f7 mem_usb_fifo_empty
+0x09f8 mem_usb_read_len
+0x09fa mem_usb_txbuf
+0x0a3b mem_usb_txbuf1
+0x0a45 mem_usb_txbuf2
+0x0a4f mem_usb_rxbuf
+0x0a8f mem_usb_rxbuf_end
+0x0a90 mem_bufptr
+0x0a92 mem_remain
+0x0a93 mem_hidreportdesc_kb
+0x0a95 mem_hidreportdesc_m
+0x0a97 mem_devicedesc
+0x0aaa mem_confdesc
+0x0ae6 mem_string0
+0x0aeb mem_string1
+0x0b09 mem_string2
+0x0b27 mem_string3
+0x0b45 mem_cb_usb_config
+0x0b47 mem_usb_tx_interval
+0x0b48 mem_usb_vid_pid
+0x0b51 mem_usb_zero_packet
+0x0b53 mem_usb_ones_packet
+0x0b55 mem_usb_two_packet
+0x0b57 mem_usb0_state
+0x0b58 mem_usb_offline_check_gpio
+0x0b59 mem_usb_clear_mem_start
+0x0b59 mem_usb_setup
+0x0b59 mem_usb_setup_bmRequestType
+0x0b5a mem_usb_setup_bRequest
+0x0b5b mem_usb_setup_bValue
+0x0b5c mem_usb_setup_bValueH
+0x0b5d mem_usb_setup_wIndex
+0x0b5f mem_usb_setup_bLength
+0x0b60 mem_usb_setup_bLengthH
+0x0b61 mem_usb0_set_report_data
+0x0ba1 mem_usb0_get_report_data
+0x0be1 mem_usb_setup_bValue_temp
+0x0be3 mem_usb0_get_set_report
+0x0be4 mem_usb0_data_ready_report
+0x0be5 mem_usb_tx_win_enable
+0x0be6 mem_usb_tx_mac_enable
+0x0be7 mem_usb_idle_flag
+0x0be8 mem_usb_idle_rate
+0x0be9 mem_usb_get_protocol_flag
+0x0bea mem_usb_set_protocol_status
+0x0beb mem_usb_set_protocol_value
+0x0bec mem_usb_state
+0x0bed mem_usb_remote_wakeup
+0x0bee mem_usb_clear_remote_wakeup
+0x0bef mem_sdsystem_wakeup_flag
+0x0bf0 mem_usb_ep0_stall_status
+0x0bf1 mem_usb_ep1_stall_status
+0x0bf2 mem_usb_ep2_stall_status
+0x0bf3 mem_usb_ep3_stall_status
+0x0bf4 mem_dsc_info_data_pointer
+0x0bf6 mem_dsc_info_len
+0x0bf7 mem_usb_ep1_data
+0x0bf8 mem_usb_ep2_data
+0x0bf9 mem_usb_tx_enable
+0x0bfa mem_usb_device_enumeration_endflag
+0x0bfb mem_usb_wakestate_onetime_flag
+0x0bfc mem_usb_mac_wakeup_trig
+0x0bfd mem_usb_set_high_addr_flag
+0x0bfe mem_usb_clear_halt
+0x0bff mem_usb_mouse_data
+0x0c0f mem_usb_kb_data
+0x0c1f mem_usb_kb_multikey
+0x0c2f mem_usb_kb_system
+0x0c3f mem_usb_test_cnt
+0x0c41 mem_usb_test_kb
+0x0c4b mem_usb_clear_mem_end
+0x0c4b mem_dg_rssi_noise_buffer
+0x0d4b mem_dg_rssi_noise_dg_buffer
+0x0e4b mem_dg_rssi_noise_ms_buffer
+0x0f4b mem_dg_rssi_noise_kb_buffer
+
+0x02be mem_le_new_param
+0x02be mem_le_new_transmitwindowsize
+0x02bf mem_le_new_transmitwindowoffset
+0x02c1 mem_le_new_conninterval
+0x02c3 mem_le_new_connslavelatency
+0x02c5 mem_le_new_connsupervisiontimeout
+0x02be mem_le_new_map
+0x02be mem_le_new_m2s_phy
+0x02bf mem_le_new_s2m_phy
+0x016b mem_le_rxbuf_data_header
+0x016c mem_le_rxbuf_data_length
+0x016d mem_le_rxbuf_data_payload
+0x016b mem_le_rxbuf_data_ll_header
+0x016c mem_le_rxbuf_data_ll_length
+0x016d mem_le_rxbuf_data_ll_opcode
+0x016e mem_le_rxbuf_data_ll_control_data
+0x016b mem_le_rxbuf_adv_header
+0x016c mem_le_rxbuf_adv_length
+0x016d mem_le_rxbuf_adv_payload
+0x016b mem_le_rxbuf_adv_scan_req_header
+0x016c mem_le_rxbuf_adv_scan_req_length
+0x016d mem_le_rxbuf_adv_scan_req_scan_address
+0x0173 mem_le_rxbuf_adv_scan_req_adv_address
+0x016b mem_le_rxbuf_adv_connect_ind_header
+0x016c mem_le_rxbuf_adv_connect_ind_length
+0x016d mem_le_rxbuf_adv_connect_ind_init_address
+0x0173 mem_le_rxbuf_adv_connect_ind_adv_address
+0x0179 mem_le_rxbuf_adv_connect_ind_access_address
+0x017d mem_le_rxbuf_adv_connect_ind_crc_init
+0x0180 mem_le_rxbuf_adv_connect_ind_win_size
+0x0181 mem_le_rxbuf_adv_connect_ind_win_offset
+0x0183 mem_le_rxbuf_adv_connect_ind_interval
+0x0185 mem_le_rxbuf_adv_connect_ind_latency
+0x0187 mem_le_rxbuf_adv_connect_ind_timeout
+0x0189 mem_le_rxbuf_adv_connect_ind_channel_map
+0x018e mem_le_rxbuf_adv_connect_ind_hop_and_sca
+0x099e mem_le_search_handle_start
+0x09a0 mem_le_search_handle_end
+0x09a2 mem_le_att_offset
+0x09a2 mem_le_search_att_type_length
+0x09a3 mem_le_search_att_type
+0x09b3 mem_le_curr_att_len
+0x09b4 mem_le_cur_attlist_start_ptr
+0x09b6 mem_le_cur_handle_start
+0x09b8 mem_le_cur_handle_end
+0x09ba mem_le_cur_uuid_length
+0x09bb mem_le_cur_uuid
+0x016b mem_le_rxbuf_data_att_header
+0x016c mem_le_rxbuf_data_att_length
+0x016d mem_le_rxbuf_data_att_l2cap_length
+0x016f mem_le_rxbuf_data_att_cid
+0x0171 mem_le_rxbuf_data_att_opcode
+0x0172 mem_le_rxbuf_data_att_payload
+0x016b mem_le_rxbuf_data_continue_header
+0x016c mem_le_rxbuf_data_continue_length
+0x016d mem_le_rxbuf_data_continue_payload
+0x016b mem_le_rxbuf_data_att_write_header
+0x016c mem_le_rxbuf_data_att_write_length
+0x016d mem_le_rxbuf_data_att_write_l2cap_length
+0x016f mem_le_rxbuf_data_att_write_cid
+0x0171 mem_le_rxbuf_data_att_write_opcode
+0x0172 mem_le_rxbuf_data_att_write_handle
+0x0174 mem_le_rxbuf_data_att_write_payload
+0x016b mem_le_rxbuf_data_prepare_att_write_header
+0x016c mem_le_rxbuf_data_prepare_att_write_length
+0x016d mem_le_rxbuf_data_prepare_att_write_l2cap_length
+0x016f mem_le_rxbuf_data_prepare_att_write_cid
+0x0171 mem_le_rxbuf_data_prepare_att_write_opcode
+0x0172 mem_le_rxbuf_data_prepare_att_write_handle
+0x0174 mem_le_rxbuf_data_prepare_att_write_offset
+0x0176 mem_le_rxbuf_data_prepare_att_write_payload
+0x09f8 mem_mesh_NETKeyindex_and_APPKeyindex
+0x09fb mem_mesh_receive_application_key
+0x09f8 mem_mesh_vendor_message_cid
+0x09fa mem_mesh_vendor_message_tid
+0x09fb mem_mesh_vendor_message_attr_type
+0x09f8 mem_mesh_vendor_message_header
+0x09fd mem_mesh_vendor_attr_parameter
+0x09f8 mem_mesh_vendor_message_delay_close_time_header
+0x09fd mem_mesh_vendor_delay_close_time
+0x09f8 mem_mesh_vendor_message_night_light_onoff_header
+0x09fd mem_mesh_vendor_night_light_onoff
+0x09f8 mem_mesh_vendor_message_color_header
+0x09fd mem_mesh_vendor_color_lightness
+0x09ff mem_mesh_vendor_color_hue
+0x0a01 mem_mesh_vendor_color_saturation
+0x09f8 mem_mesh_vendor_message_back_light_onoff_header
+0x09fd mem_mesh_vendor_back_light_onoff
+0x09f8 mem_mesh_vendor_message_main_light_onoff_header
+0x09fd mem_mesh_vendor_main_light_onoff
+0x09f8 mem_mesh_vendor_message_standby_brightness_header
+0x09fd mem_mesh_vendor_standby_brightness
+0x09f8 mem_mesh_vendor_message_current_time_header
+0x09fd mem_mesh_vendor_message_current_time
+0x09f8 mem_mesh_vendor_message_timer_header
+0x09fd mem_mesh_vendor_timer_timing_index
+0x09fe mem_mesh_vendor_timer_timing_index1
+0x09fe mem_mesh_vendor_timer_timing_time
+0x0a02 mem_mesh_vendor_timer_timing_attr_type
+0x0a04 mem_mesh_vendor_timer_timing_attr_para
+0x09f8 mem_mesh_vendor_message_timer_cyclic_header
+0x09fd mem_mesh_vendor_timer_timing_index_cyclic
+0x09fe mem_mesh_vendor_timer_timing_time_cyclic
+0x0a00 mem_mesh_vendor_timer_timing_weekdays_cyclic
+0x0a01 mem_mesh_vendor_timer_timing_attr_type_cyclic
+0x0a03 mem_mesh_vendor_timer_timing_attr_para_cyclic
+0x0a04 mem_mesh_vendor_timer_timing_cyclic_flag
+0x0a10 mem_mesh_access_layer_payload_vendor_command
+0x0a11 mem_mesh_access_layer_payload_vendor_CID
+0x0a13 mem_mesh_access_layer_payload_vendor_tid
+0x0a14 mem_mesh_access_layer_payload_vendor_attr_type
+0x0a16 mem_mesh_access_layer_payload_vendor_attr_parameter
+0x098e mem_mesh_subscription_eep_temp
+0x0a74 mem_mesh_gatt_package_receive_msg_buffer_ptr
+0x0a76 mem_mesh_gatt_package_receive_msg_buffer_temp
+0x0a76 mem_mesh_gatt_package_receive_msg_id
+0x0a78 mem_mesh_gatt_package_receive_MAC
+0x0a78 mem_mesh_gatt_package_receive_msg_num
+0x0a79 mem_mesh_gatt_package_receive_msg_total_length
+0x0a7a mem_mesh_gatt_package_receive_msg_payload
+0x0bec mem_mesh_receive_service_uuid_company_id
+0x0bee mem_mesh_receive_service_uuid_vid
+0x0bef mem_mesh_receive_service_uuid_provisioning_type
+0x0bf0 mem_mesh_receive_service_uuid_mac
+0x0bf2 mem_mesh_receive_service_uuid_msg_id
+0x0bf3 mem_mesh_receive_service_uuid_package_num
+0x0bf4 mem_mesh_receive_service_uuid_length
+0x0bf5 mem_mesh_receive_service_uuid_payload_data
+0x0bec mem_mesh_receive_service_uuid_ios_data_company_id
+0x0bee mem_mesh_receive_service_uuid_ios_data_vid
+0x0bef mem_mesh_receive_service_uuid_ios_data_provisioning_type
+0x0bf0 mem_mesh_receive_service_uuid_ios_data_NID
+0x0bf1 mem_mesh_receive_service_uuid_ios_data_msg_id
+0x0bf2 mem_mesh_receive_service_uuid_ios_data_package_num
+0x0bf3 mem_mesh_receive_service_uuid_ios_data_length
+0x0bf4 mem_mesh_receive_service_uuid_ios_data_payload_data
+0x09f8 mem_mesh_configuration_health_message_opcode
+0x09f8 mem_mesh_configuration_health_message_opcode_config_model_subscription
+0x09f9 mem_mesh_subscription_element_address
+0x09fb mem_mesh_subscription_value_address
+0x09fd mem_mesh_subscription_model_identifier
+0x09f8 mem_mesh_module_message_opcode
+0x09f8 mem_mesh_module_message_opcode_onoff_set
+0x09f9 mem_mesh_generic_onoff_set_payload_OnOff
+0x09fa mem_mesh_generic_onoff_set_payload_TID
+0x09fb mem_mesh_generic_onoff_set_payload_Transition_Time
+0x09fc mem_mesh_generic_onoff_set_payload_Delay
+0x09f8 mem_mesh_module_message_opcode_scene_recall
+0x09f9 mem_mesh_scene_recall_payload_scene_number
+0x09fb mem_mesh_scene_recall_payload_TID
+0x09fc mem_mesh_scene_recall_payload_Transition_Time
+0x09fd mem_mesh_scene_recall_payload_Delay
+0x09f8 mem_mesh_module_message_opcode_set_light_lightness
+0x09f9 mem_mesh_light_lightness_set_payload_lightness
+0x09fb mem_mesh_light_lightness_set_payload_TID
+0x09fc mem_mesh_light_lightness_set_payload_Transition_Time
+0x09fd mem_mesh_light_lightness_set_payload_Delay
+0x09fe mem_mesh_light_lightness_calc_lightness
+0x09f8 mem_mesh_module_message_opcode_set_light_ctl
+0x09f9 mem_mesh_CTL_Lightness
+0x09fb mem_mesh_CTL_Temperature
+0x09fd mem_mesh_CTL_Delta_UV
+0x09ff mem_mesh_CTL_lightness_TID
+0x0a00 mem_mesh_CTL_lightness_Transition_Time
+0x0a01 mem_mesh_CTL_lightness_Delay
+0x0a02 mem_mesh_CTL_calc_lightness
+0x0a03 mem_mesh_CTL_calc_temperature
+0x0a97 mem_mesh_network_packet_type_temp
+0x0a98 mem_mesh_message_NID_temp
+0x0c28 mem_mesh_Network_Nonce
+0x0c28 mem_mesh_Network_Nonce_nonce_type
+0x0c29 mem_mesh_Network_Nonce_CTL_and_TTL
+0x0c2a mem_mesh_Network_Nonce_SEQ
+0x0c2d mem_mesh_Network_Nonce_SRC
+0x0c2f mem_mesh_Network_Nonce_Pad//0x0000
+0x0c31 mem_mesh_Network_Nonce_IV_Index
+0x0c28 mem_mesh_Application_Nonce
+0x0c28 mem_mesh_Application_Nonce_Nonce_Type
+0x0c29 mem_mesh_Application_Nonce_ASZMIC_and_Pad//
+0x0c2a mem_mesh_Application_Nonce_SEQ
+0x0c2d mem_mesh_Application_Nonce_SRC
+0x0c2f mem_mesh_Application_Nonce_DST
+0x0c31 mem_mesh_Application_Nonce_IV_Index
+0x0c28 mem_mesh_Device_Nonce
+0x0c28 mem_mesh_Device_Nonce_Nonce_Type
+0x0c29 mem_mesh_Device_Nonce_ASZMIC_and_Pad//
+0x0c2a mem_mesh_Device_Nonce_SEQ
+0x0c2d mem_mesh_Device_Nonce_SRC
+0x0c2f mem_mesh_Device_Nonce_DST
+0x0c31 mem_mesh_Device_Nonce_IV_Index
+0x0a0f mem_mesh_upper_transport_layer_payload_len
+0x0c51 mem_mesh_upper_tran_layer_temp_pakcet_AKF_AID
+0x0c51 mem_mesh_upper_tran_layer_temp_unsegmented_pakcet_AKF_AID
+0x0c52 mem_mesh_upper_tran_layer_temp_unsegmented_packet_fill
+0x0c56 mem_mesh_upper_tran_layer_temp_pakcet_upper_tran_access_pdu
+0x0c56 mem_mesh_upper_tran_layer_temp_unsegmented_pakcet_upper_tran_access_pdu
+0x0c51 mem_mesh_upper_tran_layer_temp_segmented_pakcet_AKF_AID
+0x0c52 mem_mesh_upper_tran_layer_temp_segmented_pakcet_SeqZero
+0x0c54 mem_mesh_upper_tran_layer_temp_segmented_pakcet_SegO
+0x0c55 mem_mesh_upper_tran_layer_temp_segmented_pakcet_SegN
+0x0c56 mem_mesh_upper_tran_layer_temp_segmented_pakcet_upper_tran_access_pdu
+0x4000 mem_patch00
+0x4001 mem_patch01
+0x4002 mem_patch02
+0x4003 mem_patch03
+0x4004 mem_patch04
+0x4005 mem_patch05
+0x4006 mem_patch06
+0x4007 mem_patch07
+0x4008 mem_patch08
+0x4009 mem_patch09
+0x400a mem_patch0a
+0x400b mem_patch0b
+0x400c mem_patch0c
+0x400d mem_patch0d
+0x400e mem_patch0e
+0x400f mem_patch0f
+0x4010 mem_patch10
+0x4011 mem_patch11
+0x4012 mem_patch12
+0x4013 mem_patch13
+0x4014 mem_patch14
+0x4015 mem_patch15
+0x4016 mem_patch16
+0x4017 mem_patch17
+0x4018 mem_patch18
+0x4019 mem_patch19
+0x401a mem_patch1a
+0x401b mem_patch1b
+0x401c mem_patch1c
+0x401d mem_patch1d
+0x401e mem_patch1e
+0x401f mem_patch1f
+0x4020 mem_patch20
+0x4021 mem_patch21
+0x4022 mem_patch22
+0x4023 mem_patch23
+0x4024 mem_patch24
+0x4025 mem_patch25
+0x4026 mem_patch26
+0x4027 mem_patch27
+0x4028 mem_patch28
+0x4029 mem_patch29
+0x402a mem_patch2a
+0x402b mem_patch2b
+0x402c mem_patch2c
+0x402d mem_patch2d
+0x402e mem_patch2e
+0x402f mem_patch2f
+0x4030 mem_patch30
+0x4031 mem_patch31
+0x4032 mem_patch32
+0x4033 mem_patch33
+0x4034 mem_patch34
+0x4035 mem_patch35
+0x4036 mem_patch36
+0x4037 mem_patch37
+0x4038 mem_patch38
+0x4039 mem_patch39
+0x403a mem_patch3a
+0x403b mem_patch3b
+0x403c mem_patch3c
+0x403d mem_patch3d
+0x403e mem_patch3e
+0x403f mem_patch3f
+0x4040 mem_context
+0x4098 mem_current_amaddr
+0x4099 mem_lpm_mode
+0x409a mem_device_option
+0x409b mem_scan_mode
+0x409c mem_last_clkn
+0x40a0 mem_features
+0x40a8 mem_lap
+0x40ab mem_uap
+0x40ac mem_nap
+0x40ae mem_npage
+0x40af mem_glap
+0x40b2 mem_class
+0x40b5 mem_iscan_window
+0x40b7 mem_iscan_interval
+0x40b9 mem_pscan_window
+0x40bb mem_pscan_interval
+0x40bd mem_page_interval
+0x40bf mem_page_window
+0x40c1 mem_page_to
+0x40c3 mem_inq_window
+0x40c5 mem_fcomp_div
+0x40c6 mem_rx_window_init
+0x40c8 mem_rx_window_sniff
+0x40ca mem_rf_init_ptr
+0x40cc mem_last_type
+0x40cd mem_last_type_esco
+0x40ce mem_last_type_saved
+0x40cf mem_retransmission_cnt
+0x40d1 mem_next_btclk
+0x40d5 mem_rf_rccal
+0x40d6 mem_handle_num
+0x40d7 mem_max_slot
+0x40d8 mem_eir_enable
+0x40d9 mem_afh_instant
+0x40dd mem_afh_error_total
+0x40df mem_afh_cfg
+0x40e0 mem_afh_new_mod
+0x40e1 mem_afh_map_lo
+0x40e6 mem_afh_map_hi
+0x40eb mem_afh_used
+0x40ec mem_afh_index
+0x40ee mem_afh_map_new
+0x40f9 mem_afh_map
+0x4149 mem_afh_timer
+0x414d mem_afh_classify_channel_map
+0x4157 mem_lpm_wake_lock
+0x4159 mem_lpm_interval
+0x415b mem_lpm_overhead
+0x415c mem_lpm_hibernate_switch
+0x415d mem_esco_addr
+0x415e mem_sniff_unint_lost
+0x415f mem_ptt
+0x4160 mem_sleep_counter//should be 0x41fc in REVC
+0x4164 mem_sleep_counter_all
+0x4168 mem_sleep_clkn
+0x416e mem_sniff_rcv
+0x4171 mem_sniff_lost
+0x4174 mem_clks_per_lpo
+0x4177 mem_lpm_mult
+0x4178 mem_lpm_mult_timeout
+0x4179 mem_lpm_mult_cnt
+0x417a mem_lpm_config
+0x417a mem_lpm_xtal_ib
+0x417b mem_lpm_ctrim
+0x417c mem_lpm_padding
+0x417d mem_lpm_xtalcnt
+0x417e mem_lpm_buckcnt
+0x417f mem_lpm_ldocnt
+0x4180 mem_lpm_isogate
+0x4181 mem_lpm_isogate_final
+0x4182 mem_lpm_ctrl3
+0x4186 mem_saved_gpio// should be 0x421e in REVC
+0x419a mem_saved_gsel
+0x419d mem_saved_mark
+0x41a5 mem_saved_spidctrl
+0x41a6 mem_patch_ptr
+0x41a8 mem_patch_len
+0x41aa mem_timers
+0x41ca mem_link_key_exists
+0x41cb mem_link_key
+0x41db mem_hci_cmd
+0x41dc mem_hci_conn_handle
+0x41dd mem_hci_plap
+0x41e0 mem_hci_puap
+0x41e1 mem_hci_pnap
+0x41e3 mem_loadcode_times
+0x41e4 mem_llid
+0x41e5 mem_tx_lch
+0x41e6 mem_tx_len
+0x41e8 mem_tx_power
+0x41e9 mem_modem_rssi
+0x41ea mem_gain_fix
+0x41eb mem_gain_table
+0x41ee mem_gain_second_agc_en
+0x41ef mem_rf_init_data
+0x41f0 mem_system_clk
+0x41f1 mem_le_dsniff
+0x41f3 mem_le_conn_interval
+0x41f5 mem_le_txheader
+0x41f6 mem_le_txlen
+0x41f7 mem_le_txpayload
+0x42f7 mem_le_name_len
+0x42f8 mem_le_name
+0x4316 mem_le_ltk
+0x4326 mem_ltk_exists
+0x4327 mem_le_rconfirm
+0x4337 mem_le_srand
+0x4347 mem_le_iat
+0x4348 mem_le_rat
+0x4349 mem_le_preq
+0x434a mem_le_preq_iocap
+0x434b mem_le_preq_oob
+0x434c mem_le_preq_auth
+0x434d mem_le_preq_max_keysize
+0x434e mem_le_preq_init_key_distribution
+0x434f mem_le_preq_resp_key_distribution
+0x4350 mem_le_pres
+0x4351 mem_le_pres_iocap
+0x4352 mem_le_pres_oob
+0x4353 mem_le_pres_auth
+0x4354 mem_le_pres_max_keysize
+0x4355 mem_le_pres_init_key_distribution
+0x4356 mem_le_pres_resp_key_distribution
+0x4357 mem_le_notify_handle
+0x4359 mem_le_search_uuid_length
+0x435a mem_le_search_uuid
+0x436a mem_le_conn_param
+0x436a mem_le_conn_peer_addr_type
+0x436b mem_le_conn_peer_addr
+0x4371 mem_le_conn_own_addr_type
+0x4372 mem_le_interval_min
+0x4374 mem_le_interval_max
+0x4376 mem_le_latency
+0x4378 mem_le_timeout
+0x437a mem_le_lap
+0x437d mem_le_uap
+0x437e mem_le_nap
+0x4380 mem_le_local_mtu
+0x4382 mem_le_remote_mtu
+0x4384 mem_le_skdm
+0x438c mem_le_skds
+0x4394 mem_le_init_superto
+0x4396 mem_ui_le_uuid_table
+0x4398 mem_le_secure_connect_flag
+0x4399 mem_le_secure_connect_state
+0x439a mem_le_sc_confirm_gkey_flag
+0x439b mem_le_pairing_state
+0x439c mem_le_enc_state
+0x439d mem_le_pairing_mode
+0x439e mem_le_tk
+0x43a2 mem_le_ediv
+0x43a4 mem_le_rand
+0x43ac mem_le_irk
+0x43bc mem_le_transmit_window
+0x43c0 mem_le_configuration
+0x43c1 mem_le_fixed_ltk
+0x43d1 mem_le_pairing_handle
+0x43d3 mem_le_packet_llid
+0x43d4 mem_le_l2cap_size
+0x43d6 mem_le_packet_len_recved
+0x43d8 mem_le_payload_ptr
+0x43da mem_le_signaling_identifier
+0x43db mem_le_l2cap_signaling_conn_param_update_rsp_result
+0x43dd mem_le_md_count
+0x43de mem_ble_l2cap_tx_buff0_ptr
+0x43e0 mem_ble_l2cap_tx_buff_size_ptr
+0x43e2 mem_le_scan_enable
+0x43e3 mem_le_scan_interval
+0x43e5 mem_le_scan_window
+0x43e7 mem_le_adv_data_len
+0x43e8 mem_le_adv_data
+0x4407 mem_le_scan_data_len
+0x4408 mem_le_scan_data
+0x4427 mem_le_adv_enable
+0x4428 mem_le_adv_param
+0x4428 mem_le_adv_interval
+0x442a mem_le_adv_type
+0x442b mem_le_adv_own_addr_type
+0x442c mem_le_adv_direct_addr
+0x4432 mem_le_adv_channel_map
+0x4433 mem_le_scan_params
+0x4433 mem_le_scan_type
+0x4434 mem_le_scan_own_addr_type
+0x4435 mem_le_l2cap_att_states
+0x4436 mem_le_att_opcode
+0x4437 mem_le_att_handle
+0x4439 mem_le_search_res
+0x443a mem_le_local_feature
+0x4442 mem_le_tx_phys
+0x4443 mem_le_rx_phys
+0x4444 mem_remote_rx_max_octets
+0x4446 mem_remote_rx_max_time
+0x4448 mem_remote_tx_max_octets
+0x444a mem_remote_tx_max_time
+0x444c mem_local_rx_max_octets
+0x444e mem_local_rx_max_time
+0x4450 mem_local_tx_max_octets
+0x4452 mem_local_tx_max_time
+0x4454 mem_app_handshake_flag
+0x4455 mem_sniff_param_interval
+0x4457 mem_sniff_param_attempt
+0x4459 mem_sniff_param_timeout
+0x445b mem_cb_check_wakelock
+0x445d mem_cb_before_hibernate
+0x445f mem_cb_before_lpm
+0x4461 mem_cb_le_process
+0x4463 mem_cb_bt_process
+0x4465 mem_cb_idle_process
+0x4467 mem_cb_bb_event_process
+0x4469 mem_cb_discovry_timeout
+0x446b mem_cb_att_write
+0x446d mem_cb_ble_transmit
+0x446f mem_cb_event_timer
+0x4471 mem_cb_bt_set_mult
+0x4473 mem_cb_spi_flash_write_complate
+0x4475 mem_cb_spi2_flash_write_complate
+0x4477 mem_cb_bt_slave_match
+0x4479 mem_eeprom_base
+0x447b mem_unsniff2sniff_timer_count
+0x447c mem_wake_up_delay_timer
+0x447d mem_app_connection_options
+0x447e mem_app_disconn_reason
+0x4480 mem_app_disconn_reason_flag
+0x4482 mem_xrecord_mode
+0x4483 mem_eeprom_block_size
+0x4484 mem_spi_init_clk
+0x4485 mem_spi_init_delay_time
+0x4486 mem_spi_ncs_gpio
+0x4487 mem_nv_data_ptr
+0x4489 mem_nv_data_number
+0x448a mem_queue_ptr
+0x448c mem_ui_led_struct_num
+0x448d mem_ui_led_struct_ptr
+0x448f mem_adc_wait_count
+0x4490 mem_3v_adc_io_data
+0x4492 mem_3v_adc_hvin_data
+0x4494 mem_2v_adc_vinlpm_data
+0x4496 mem_1v_adc_io_data
+0x4498 mem_5v_adc_hvin_data
+0x449a mem_3v_adc_vinlpm_data
+0x449c mem_app_adc_read_count
+0x449d mem_start_adc_clkn
+0x449e mem_reference_voltage
+0x44a0 mem_adc_config_flag
+0x44a1 mem_adc_channel
+0x44a2 mem_adc_current_value
+0x44a4 mem_adc_power_flag//bit0:low power falg ; bit1:no power flag
+0x44a5 mem_spi_write_addr
+0x44a8 mem_spi_write_ptr
+0x44aa mem_spi_write_len
+0x44ac mem_spi_write_flash_sm
+0x44ad mem_spi2_write_addr
+0x44b0 mem_spi2_write_ptr
+0x44b2 mem_spi2_write_len
+0x44b4 mem_spi2_write_flash_sm
+0x44b5 mem_spi_cs_gpio
+0x44b6 mem_spi_si_gpio
+0x44b7 mem_spi_so_gpio
+0x44b8 mem_spi_sclk_gpio
+0x44b9 mem_spi_wp_gpio
+0x44ba mem_spi_hold_gpio
+0x44bb mem_spi2_cs_gpio
+0x44bc mem_spi2_si_gpio
+0x44bd mem_spi2_so_gpio
+0x44be mem_spi2_sclk_gpio
+0x44bf mem_spi2_wp_gpio
+0x44c0 mem_spi2_hold_gpio
+0x44c1 mem_eeprom_wp_gpio
+0x44c2 mem_eeprom_scl_gpio
+0x44c3 mem_eeprom_sda_gpio
+0x44c4 mem_kscan_ptr
+0x44c6 mem_key_num_ptr
+0x44c6 mem_keyscan_ptr
+0x44c8 mem_key_value_retention
+0x44ca mem_power_param_ptr
+0x44cc mem_efuse_header
+0x44cf mem_seqi
+0x44d0 mem_dig_aon_vsel
+0x44d1 mem_syn_afc_cfg1
+0x44d2 mem_rf_ldo_cfg1
+0x44d3 mem_rc_cal
+0x44d4 mem_rf_debug_rx_gpio
+0x44d5 mem_rf_debug_tx_gpio
+0x44d6 mem_l2cap_xmem_start
+0x44d6 mem_l2cap_tx_multi_offset//0 means single packet
+0x44d8 mem_sdp_remote_cid
+0x44da mem_rfcomm_remote_cid
+0x44dc mem_hid_ctrl_remote_cid
+0x44de mem_hid_int_remote_cid
+0x44e0 mem_sdp_state
+0x44e1 mem_rfcomm_state
+0x44e2 mem_hid_control_state
+0x44e3 mem_hid_interrupt_state
+0x44e4 mem_spp_state
+0x44e5 mem_ML2CAP_comm_id
+0x44e6 mem_used_map
+0x44e7 mem_tx_fifo0
+0x44e7 mem_tx_fifo0_map
+0x44e8 mem_tx_fifo0_ptr
+0x44ea mem_tx_fifo1
+0x44ea mem_tx_fifo1_map
+0x44eb mem_tx_fifo1_ptr
+0x44ed mem_tx_fifo2
+0x44ed mem_tx_fifo2_map
+0x44ee mem_tx_fifo2_ptr
+0x44f0 mem_tx_fifo3
+0x44f0 mem_tx_fifo3_map
+0x44f1 mem_tx_fifo3_ptr
+0x44f3 mem_tx_fifo_end
+0x44f3 mem_l2cap_lpm_txbuf
+0x45f3 mem_l2cap_flow_ctrl_flag
+0x45f4 mem_l2cap_pending_item
+0x45f5 mem_l2cap_rcv_hidtype
+0x45f6 mem_l2cap_xmem_end
+0x45f6 mem_lmo_header_opcode_x
+0x45f7 mem_lmp_version
+0x45f8 mem_lmp_compid
+0x45fa mem_lmp_subversion
+0x45fc mem_local_name_length
+0x45fd mem_local_name
+0x4600 mem_local_name2
+0x4640 mem_local_name_end
+0x4641 mem_unsniff2sniff_timer
+0x4642 mem_switch_flag
+0x4643 mem_classic_bt_flag
+0x4644 mem_encapsulated_major_type
+0x4645 mem_encapsulated_minor_type
+0x4646 mem_encapsulated_len
+0x4647 mem_remote_br_sc_support
+0x4648 mem_pn_dlci
+0x4649 mem_pn_max_frame_size
+0x464b memFCStemp1
+0x464c memFCStemp2
+0x464d memFCStemp3
+0x464e mem_rfcomm_initiator
+0x464f mem_remote_spp_channel
+0x4650 mem_HIUfcs_SPP
+0x4651 mem_HIUfcs_SPP_WCredits
+0x4652 mem_rfcomm_send_more_pkt
+0x4653 mem_remote_credits
+0x4654 mem_credit_given
+0x4655 mem_ms_channel
+0x4656 mem_rfcomm_credit_flag
+0x4657 mem_rfcomm_max_frame_size
+0x4659 mem_rfcomm_credit_init_data
+0x465a mem_cb_receive_spp_data
+0x465c mem_nl_rx_data_src
+0x465e mem_nl_rx_len_all
+0x4660 mem_ui_uuid_table
+0x4662 mem_all_uuid_16bits
+0x4678 mem_all_uuid_128bits
+0x469a mem_sdp_l2capch_ptr
+0x469c mem_ccm_pcnt_tx
+0x46a1 mem_ccm_pcnt_rx
+0x46a6 mem_ccm_last_mic
+0x46aa mem_ccm_iv
+0x46aa mem_ccm_ivm
+0x46ae mem_ccm_ivs
+0x46b2 mem_ccm_len
+0x46b4 mem_ccm_rx_ptr
+0x46b6 mem_sc_only_mode
+0x46b7 mem_sp_debug_mode
+0x46b8 mem_secure_connections_enable
+0x46b9 mem_sp_local_key_invalid
+0x46ba mem_sc_calc
+0x46bb mem_sc_local_key_invalid
+0x46bc mem_sc_private_key_256
+0x46dc mem_sc_pubkey_local_x_256
+0x46fc mem_sc_pubkey_local_y_256
+0x471c mem_sp_private_key
+0x4734 mem_sp_pubkey_local
+0x4734 mem_sp_pubkey_local_x
+0x474c mem_sp_pubkey_local_x_end
+0x474c mem_sp_pubkey_local_y
+0x4764 mem_ssp_enable
+0x4765 mem_lmp_io_cap_payload_iocap
+0x4766 mem_lmp_io_cap_payload_oob_auth_data
+0x4767 mem_lmp_io_cap_payload_auth_req
+0x4768 mem_sp_state_xmem
+0x4768 mem_sp_iocap_remote
+0x476b mem_flag_mode_ssp_pin
+0x476c mem_ssp_mode_flag
+0x476d mem_authentication_passkey_times
+0x476e mem_passkey_1bit
+0x476f mem_flag_pairing_state
+0x4770 mem_sp_state_xmem_end
+0x4770 mem_ipc_lock_bt
+0x4771 mem_ipc_lock_c51
+0x4772 mem_ipc_fifo_bt2c51
+0x477a mem_ipc_fifo_c512bt
+0x4782 mem_ui_button_timer
+0x4783 mem_ui_button_last_state
+0x4784 mem_ui_timer_last_btclk
+0x4788 mem_discovery_timeout_timer_count
+0x478a mem_hid_handshake_timer_count
+0x478b memui_reconnect_mode
+0x478c mem_ui_state_map
+0x478e mem_ui_profile_supported
+0x478f mem_ui_button_timeout
+0x4790 mem_ui_button_gpio
+0x4791 mem_discovery_timeout
+0x4793 mem_pin_length
+0x4794 mem_pin
+0x47a4 mem_dummy
+0x47a7 mem_seq
+0x47a8 mem_context_cnt
+0x47a9 mem_context_map
+0x47aa mem_context_new
+0x4aaa mem_att_cmd_len
+0x4aab mem_att_cmd
+0x4aba mem_att_resp_handle
+0x4abb mem_att_resp_len
+0x4abc mem_att_resp
+0x4ada mem_meter_att_list
+0x47a4 mem_mesh_vendor_mesh_receive_tid
+0x47a5 mem_mesh_vendor_mesh_send_tid
+0x47a6 mem_mesh_vendor_timer_current_time
+0x47aa mem_system_time
+0x47ae mem_mesh_adv_data_len
+0x47af mem_mesh_adv_data
+0x47ce mem_mesh_adv_scan_channel
+0x47cf mem_mesh_advertising_unprovisioned_device_beacon_switch
+0x47d0 mem_mesh_advertising_unprovisioned_device_beacon_timer
+0x47d2 mem_mesh_advertising_unprovisioned_device_beacon_duration
+0x47d3 mem_mesh_advertising_unprovisioned_device_beacon_interval
+0x47d4 mem_mesh_calc_ConfirmationCloud_data
+0x47d4 mem_mesh_ConfirmationCloud_RandomB
+0x47dc mem_mesh_ConfirmationCloud_RandomA
+0x47e4 mem_mesh_AuthValueProv
+0x47f4 mem_mesh_ConfirmationCloud
+0x4804 mem_mesh_ConfirmationDevice
+0x4804 mem_mesh_calc_ConfirmationDevice_data
+0x4804 mem_mesh_provisioning_random_A
+0x480c mem_mesh_provisioning_random_B
+0x4814 mem_mesh_AuthValueDevice
+0x4824 mem_mesh_Device_Key
+0x4834 mem_mesh_Confirmationkey
+0x4844 mem_mesh_sha256_ConfirmationKey_ascii
+0x4853 mem_mesh_sha256_SessionKey_ascii
+0x485d mem_mesh_sha256_DeviceKey_ascii
+0x4866 mem_mesh_sha256_load_first_data_flag
+0x4867 mem_mesh_sha256_data_len_byte
+0x486f mem_mesh_sha256_data_len_bit
+0x4877 mem_mesh_sha256_data_end_addr
+0x4879 mem_mesh_sha256_data_len_addr
+0x487b mem_mesh_sha256_chunk_count
+0x487c mem_mesh_sha256_chunk_data_ptr
+0x487e mem_mesh_sha256_chunk_ptr
+0x4880 mem_k2_P_len
+0x4881 mem_k2_P
+0x4891 mem_k2_N
+0x48a1 mem_k2_SALT
+0x48b1 mem_k2_T
+0x48c1 mem_k2_T0
+0x48c1 mem_k2_T1
+0x48d1 mem_k2_NID
+0x48d2 mem_k2_T3
+0x48e2 mem_k2_T2
+0x48f2 mem_k4_SALT
+0x4902 mem_k4_T
+0x4912 mem_k4_id6_01
+0x4922 mem_k4_k4N
+0x4932 mem_mesh_transport_AID
+0x4933 mem_mesh_provisioned_flag
+0x4934 mem_mesh_Provisioning_State_Flag
+0x4935 mem_mesh_Device_PID
+0x4936 mem_mesh_UUID_FeatureFlag
+0x4937 mem_mesh_PDU_RFU
+0x4939 mem_mesh_OOB_information
+0x493b mem_mesh_Encrypt_Provisioning_Data
+0x493b mem_mesh_provisioning_data_Mac_addr
+0x493d mem_mesh_KeyFresh_and_Update_flag
+0x493e mem_mesh_Network_Key
+0x494e mem_mesh_last_IV_Index_byte
+0x494f mem_mesh_Unicast_Address
+0x4951 mem_mesh_adv_last_time
+0x4955 mem_mesh_send_packet_timeout
+0x4957 mem_mesh_gatt_package_send_msg_id
+0x4958 mem_mesh_gatt_receive_msg_timer
+0x4959 mem_mesh_gatt_packet_receive_msg_buffer1
+0x497a mem_mesh_gatt_packet_receive_msg_buffer2
+0x499b mem_mesh_three_tuple_ProductID
+0x499f mem_mesh_three_tuple_MAC
+0x49a5 mem_mesh_three_tuple_secret
+0x49b5 mem_mesh_cb_receive_advertising
+0x49b7 mem_mesh_cb_receive_access_message
+0x49b9 mem_mesh_cb_receive_config_appkey_add
+0x49bb mem_mesh_cb_pairing_fail
+0x49bd mem_mesh_cb_generic_onoff_get
+0x49bf mem_mesh_cb_generic_onoff_set
+0x49c1 mem_mesh_cb_scene_recall
+0x49c3 mem_mesh_cb_light_lightness_set
+0x49c5 mem_mesh_cb_light_lightness_get
+0x49c7 mem_mesh_cb_light_ctl_set
+0x49c9 mem_mesh_cb_main_light_onoff_set
+0x49cb mem_mesh_cb_background_onoff_set
+0x49cd mem_mesh_cb_color_set
+0x49cf mem_mesh_cb_network_relay
+0x49d1 mem_mesh_cb_receive_node_reset
+0x49d3 mem_mesh_cb_seq_changed
+0x49d5 mem_mesh_cb_subscriptuion_list_changed
+0x49d7 mem_mesh_cb_vendor_timing_changed
+0x49d9 mem_mesh_core_feature
+0x49db mem_mesh_element_number
+0x49dc mem_mesh_element_device_ptr
+0x49de mem_mesh_element_device_length
+0x49e0 mem_mesh_segmented_access_message_SZMIC
+0x49e1 mem_mesh_segmented_access_message_SeqZero
+0x49e3 mem_mesh_segmented_access_message_SegO
+0x49e4 mem_mesh_segmented_access_message_SegN
+0x49e5 mem_mesh_segmented_access_message_BlockAck
+0x49e9 mem_mesh_segmented_access_message_receive_finish
+0x49ea mem_mesh_segmented_access_message_current_length
+0x49eb mem_mesh_segmented_access_message_Segment
+0x4a0f mem_mesh_last_CTL_Temperature
+0x4a11 mem_mesh_receive_group_address
+0x4a12 mem_mesh_receive_element_number
+0x4a13 mem_mesh_IV_Index
+0x4a17 mem_mesh_TMALL_cache_start
+0x4a17 mem_mesh_TMALL_SRC1
+0x4a19 mem_mesh_TMALL_SEQ1
+0x4a1c mem_mesh_TMALL_cache
+0x4a49 mem_mesh_TMALL_cache_end
+0x4a49 mem_mesh_transport_message_mic_cache
+0x4a49 mem_mesh_transport_message_mic_cache_buff1
+0x4a4d mem_mesh_transport_message_mic_cache_buff2_10
+0x4a71 mem_mesh_network_relay_queue
+0x4a71 mem_mesh_network_relay_queue_each_size
+0x4a72 mem_mesh_network_relay_queue_length
+0x4a73 mem_mesh_network_relay_queue_current_num
+0x4a74 mem_mesh_network_relay_queue_read_ptr
+0x4a75 mem_mesh_network_relay_queue_write_ptr
+0x4a76 mem_mesh_network_relay_queue_ele
+0x4afe mem_mesh_application_key
+0x4b0e mem_mesh_ASZMIC
+0x4b0f mem_mesh_access_message_mic_cache
+0x4b0f mem_mesh_access_message_mic_cache_buff1
+0x4b13 mem_mesh_access_message_mic_cache_buff2_10
+0x4b37 mem_mesh_send_message_SEQ
+0x4b3a mem_mesh_send_message_SRC
+0x4b3c mem_mesh_send_message_TTL
+0x4b3d mem_mesh_send_upper_layer_IVI_and_NID
+0x4b3e mem_mesh_send_upper_layer_CTL_and_TTL
+0x4b3f mem_mesh_send_upper_layer_SEQ
+0x4b42 mem_mesh_send_upper_layer_SRC
+0x4b44 mem_mesh_send_upper_layer_DST
+0x4b46 mem_mesh_send_access_lower_transport_layer
+0x4b56 mem_mesh_send_network_layer_NetMIC
+0x4b5a mem_mesh_element_device
+0x4b5a mem_mesh_element_device_group_addr
+0x4b5c mem_mesh_element_device_queue_buffer_ptr
+0x4b5e mem_mesh_element_device_timing_ptr
+0x4b60 mem_mesh_element_device_element_subscription_label
+0x4b70 mem_mesh_element_upper_adv_flag
+0x4b71 mem_mesh_element_upper_queue_buffer_ptr
+0x4b73 mem_mesh_element_tran_package_tid
+0x4b74 mem_mesh_element_tran_package_type
+0x4b75 mem_mesh_element_device1
+0x4b90 mem_mesh_element_device2
+0x4bab mem_mesh_element_device_queue_each_size
+0x4bac mem_mesh_element_device_queue_length
+0x4bad mem_mesh_element_device_queue_current_num
+0x4bae mem_mesh_element_device_queue_read_ptr
+0x4baf mem_mesh_element_device_queue_write_ptr
+0x4bb0 mem_mesh_element_device_queue_ele
+0x4c38 mem_mesh_element_device_upper_queue_each_size
+0x4c39 mem_mesh_element_device_upper_queue_length
+0x4c3a mem_mesh_element_device_upper_queue_current_num
+0x4c3b mem_mesh_element_device_upper_queue_read_ptr
+0x4c3c mem_mesh_element_device_upper_queue_write_ptr
+0x4c3d mem_mesh_element_device_upper_queue_ele
+0x47a4 mem_antl_lpm_interval
+0x47a6 mem_antl_adv_interval
+0x47a8 mem_antl_slow_adv_lpm_interval
+0x47aa mem_antl_slow_adv_adv_interval
+0x47ac mem_antl_led_style
+0x47ac mem_antl_led_type
+0x47ad mem_antl_led_blink_count
+0x47ae mem_antl_led_gpio
+0x47af mem_antl_led_on_time
+0x47b1 mem_antl_led_off_time
+0x47b3 mem_antl_led_cb_on
+0x47b5 mem_antl_led_cb_off
+0x47b7 mem_antl_buzzer_style
+0x47b7 mem_antl_buzzer_type
+0x47b8 mem_antl_buzzer_blink_count
+0x47b9 mem_antl_buzzer_gpio
+0x47ba mem_antl_buzzer_on_time
+0x47bc mem_antl_buzzer_off_time
+0x47be mem_antl_buzzer_cb_on
+0x47c0 mem_antl_buzzer_cb_off
+0x47c2 mem_antl_fast_adv_led_style
+0x47c2 mem_antl_fast_adv_led_type
+0x47c3 mem_antl_fast_adv_led_blink_count
+0x47c4 mem_antl_fast_adv_led_gpio
+0x47c5 mem_antl_fast_adv_led_on_time
+0x47c7 mem_antl_fast_adv_led_off_time
+0x47c9 mem_antl_slow_adv_led_style
+0x47c9 mem_antl_slow_adv_led_type
+0x47ca mem_antl_slow_adv_led_blink_count
+0x47cb mem_antl_slow_adv_led_gpio
+0x47cc mem_antl_slow_adv_led_on_time
+0x47ce mem_antl_slow_adv_led_off_time
+0x47d0 mem_antl_power_starting_led_style
+0x47d0 mem_antl_power_starting_led_type
+0x47d1 mem_antl_power_starting_led_blink_count
+0x47d2 mem_antl_power_starting_led_gpio
+0x47d3 mem_antl_power_starting_led_on_time
+0x47d5 mem_antl_power_starting_led_off_time
+0x47d7 mem_antl_power_starting_buzzer_style
+0x47de mem_antl_power_off_led_style
+0x47de mem_antl_power_off_led_type
+0x47df mem_antl_power_off_led_link_count
+0x47e0 mem_antl_power_off_led_gpio
+0x47e1 mem_antl_power_off_led_on_time
+0x47e3 mem_antl_power_off_led_off_time
+0x47e5 mem_antl_power_off_buzzer_style
+0x47e5 mem_antl_power_off_buzzer_type
+0x47e6 mem_antl_power_off_buzzer_link_count
+0x47e7 mem_antl_power_off_buzzer_gpio
+0x47e8 mem_antl_power_off_buzzer_on_time
+0x47ea mem_antl_power_off_buzzer_off_time
+0x47ec mem_antl_alert_led_stlye
+0x47f3 mem_antl_alert_buzzer_stlye
+0x47f3 mem_antl_alert_buzzer_type
+0x47f4 mem_antl_alert_buzzer_blink_count
+0x47f5 mem_antl_alert_buzzer_gpio
+0x47f6 mem_antl_alert_buzzer_on_time
+0x47f8 mem_antl_alert_buzzer_off_time
+0x47fa mem_antl_key_led_style
+0x47fa mem_antl_key_led_type
+0x47fb mem_antl_key_led_blink_count
+0x47fc mem_antl_key_led_gpio
+0x47fd mem_antl_key_led_on_time
+0x47ff mem_antl_key_led_off_time
+0x4801 mem_antl_key_buzzer_style
+0x4808 mem_antl_queue_width
+0x4809 mem_antl_queue_depth
+0x480a mem_antl_queue_curr_num
+0x480b mem_antl_queue_read_ptr
+0x480c mem_antl_queue_write_ptr
+0x480d mem_antl_queue_buff
+0x485d mem_antl_key_scan_enable
+0x485e mem_antl_led_num
+0x485f mem_antl_led_gpio_map
+0x4863 mem_antl_power_param
+0x4863 mem_antl_power_state
+0x4864 mem_antl_power_timer
+0x4865 mem_antl_power_off_timeout
+0x4866 mem_antl_power_starting_timeout
+0x4867 mem_antl_power_off_cb
+0x4869 mem_antl_power_starting_cb
+0x486b mem_antl_power_standby_cb
+0x486d mem_event_button_up_cb
+0x486f mem_antl_key_num
+0x4870 mem_cb_antl_key
+0x4872 mem_antl_key_conf0
+0x4876 mem_antl_key0_press
+0x4885 mem_antl_key0_release
+0x4894 mem_antl_conn_updata_procedure_state
+0x4895 mem_client_characteristic_configuration_descriptor
+0x4897 mem_adc_timer
+0x4899 mem_antl_conn_update_timer
+0x489a mem_antl_send_updata_le_param_timer
+0x489b mem_antl_le_sleep_timer
+0x489d mem_antl_fast_adv_timer
+0x489f mem_antl_fast_adv_timeout
+0x48a1 mem_antl_le_sleep_timeout
+0x48a3 mem_double_click_timer
+0x48a4 mem_butten_click_cnt
+0x48a5 mem_antl_led_state
+0x48a6 mem_antl_buzzer_state
+0x48a7 mem_antl_key_state
+0x48a8 mem_antl_lost_mode
+0x48a9 mem_alarm_config
+0x48aa mem_alarm_config_notfy_cnt
+0x48ab mem_buzzer_pwm_conf
+0x48b1 mem_adc_timeout
+0x48b3 mem_voltage_remain_percent
+0x48b4 mem_battery_calculate_set
+0x48b4 mem_battery_full_voltage
+0x48b6 mem_battery_empty_voltage
+0x48b8 mem_battery_low_voltage
+0x48ba mem_battery_current_voltage
+0x48bc mem_rx_window_sniff_inc
+0x48be mem_interval_increment
+0x48c0 mem_antl_le_interval_min
+0x48c2 mem_antl_le_interval_max
+0x48c4 mem_antl_le_latency
+0x48c6 mem_antl_le_timeout
+0x48c8 mem_antl_le_unnormal_interval_min
+0x48ca mem_antl_le_unnormal_interval_max
+0x48cc mem_antl_le_unnormal_latency
+0x48ce mem_antl_le_unnormal_timeout
+0x48d0 mem_AntiLost_le_att_list
+0x4a60 mem_lestate_update_param_flag
+0x4a61 mem_antilost_conn_battery_send_timer
+0x47a4 mem_24g_rxbuf
+0x47c6 mem_24g_txbuf
+0x47e6 mem_24g_txpayload
+0x480a mem_24g_rxpayload
+0x482a mem_24g_rxdata_length
+0x482b mem_24g_pid
+0x482c mem_24g_no_ack
+0x482d mem_24g_sta_crc
+0x4830 mem_24g_last_crc
+0x4833 mem_24g_sta_pid
+0x4834 mem_24g_last_pid
+0x4835 mem_24g_datalen
+0x4836 mem_24g_data_type
+0x4837 mem_24g_txlen
+0x4838 mem_24g_rx_window
+0x483a mem_24g_ch
+0x483b mem_24g_current_ch_number
+0x483c mem_24g_addr
+0x4840 mem_24g_ch_map1
+0x4844 mem_24g_ch_map2
+0x4848 mem_24g_ch_map3
+0x484c mem_24g_ch_map4
+0x4850 mem_24g_tx_btclk
+0x4854 mem_24g_interval
+0x4855 mem_24g_interval_min
+0x4856 mem_24g_interval_max
+0x4857 mem_24g_syncword
+0x4859 mem_24g_syncword_crc8
+0x485a mem_24g_get_syncword_crc8
+0x485b mem_24g_pair_switch
+0x485c mem_24g_enter_hibernate
+0x4864 mem_24g_rx_phy
+0x4865 mem_24g_tx_phy
+0x4866 mem_24g_ch_map_update
+0x4867 mem_24g_ch_update_map1
+0x486b mem_24g_ch_update_map2
+0x486f mem_24g_ch_update_map3
+0x4873 mem_24g_ch_update_map4
+0x4877 mem_24g_pair_addr
+0x487b mem_24g_pair_ch
+0x487c mem_24g_pair_tx_power
+0x487d mem_rssi_buff_index
+0x487e mem_24g_device1_bind_step
+0x487f mem_24g_device2_bind_step
+0x4880 mem_24g_bind_device_status
+0x4881 mem_24g_bind_payload
+0x4889 mem_cb_24g_receive_process
+0x488b mem_cb_24g_ackpayload
+0x488d mem_cb_24g_data_device1
+0x488f mem_cb_24g_data_device2
+0x4891 mem_24g_rxdata_temp
+0x48b3 mem_24g_abort_packet
+0x48b4 mem_24g_hop_btclk
+0x48b8 mem_24g_hop_interval
+0x48b9 mem_24g_pair_mode
+0x48ba mem_24g_ackpayload_enable
+0x48bb mem_24g_hop_packet
+0x48bc mem_24g_mode_switch
+0x48bd mem_24g_nodata_timer_enable
+0x48be mem_24g_mode_init
+0x48bf mem_24g_work_mode
+0x48c0 mem_24g_time_slice
+0x48c1 mem_24g_self_last_ch
+0x48c2 mem_24g_self_ch_number
+0x48c3 mem_24g_self_config_ch_once
+0x48c4 mem_24g_device1_last_ch
+0x48c5 mem_24g_device1_ch_number
+0x48c6 mem_24g_device1_config_ch_once
+0x48c7 mem_24g_device2_last_ch
+0x48c8 mem_24g_device2_ch_number
+0x48c9 mem_24g_device2_config_ch_once
+0x48ca mem_24g_led_status
+0x48cb mem_24g_bind_mode_continue
+0x48cc mem_tx_power_temp
+0x48cd mem_24g_transmitter_addr
+0x48d1 mem_24g_device1_addr
+0x48d5 mem_24g_device2_addr
+0x48d9 mem_rssi_noise_avg
+0x48da mem_rssi_noise_index
+0x48db mem_rssi_noise_self_avg
+0x48dc mem_rssi_noise_device1_avg
+0x48dd mem_rssi_noise_device2_avg
+0x48de mem_rssi_noise_self_index
+0x48df mem_rssi_noise_device1_index
+0x48e0 mem_rssi_noise_device2_index
+0x48e1 mem_rssi_noise_buffer_ptr
+0x48e3 mem_rssi_noise_self_buffer_ptr
+0x48e5 mem_rssi_noise_device1_buffer_ptr
+0x48e7 mem_rssi_noise_device2_buffer_ptr
+0x48e9 mem_car_hard_soft_switch
+0x48ea mem_car_queue_each_size
+0x48eb mem_car__queue_length
+0x48ec mem_car_queue_curr_num
+0x48ed mem_car_queue_read_ptr
+0x48ee mem_car_queue_write_ptr
+0x48ef mem_car_queue_ele
+0x4967 mem_car_pop_queue_buff
+0x497b mem_car_led_num
+0x497c mem_car_led_map
+0x4986 mem_car_style1_led_type
+0x4987 mem_car_style1_blink_count
+0x4988 mem_car_style1_struct_led_gpio
+0x4989 mem_car_style1_on_time
+0x498b mem_car_style1_off_time
+0x498d mem_car_style1_cb_ledon
+0x498f mem_car_style1_cb_ledoff
+0x4991 mem_car_style2_led_type
+0x4992 mem_car_style2_blink_count
+0x4993 mem_car_style2_struct_led_gpio
+0x4994 mem_car_style2_on_time
+0x4996 mem_car_style2_off_time
+0x4998 mem_car_style2_cb_ledon
+0x499a mem_car_style2_cb_ledoff
+0x499c mem_le_receive_data
+0x499c mem_le_receive_packet_head
+0x499e mem_le_receive_cmd
+0x499f mem_le_receive_length
+0x49a1 mem_le_receive_payload
+0x49ab mem_le_receive_checksum
+0x49ac mem_motor1_status
+0x49ad mem_motor1_speed
+0x49ae mem_motor2_status
+0x49af mem_motor2_speed
+0x49b0 mem_motor3_status
+0x49b1 mem_motor3_speed
+0x49b2 mem_motor1_pwm_set
+0x49b2 mem_motor1_pwm_pin1_set
+0x49b3 mem_motor1_pwm_pin2_set
+0x49b4 mem_motor1_pwm_pin_set
+0x49b5 mem_motor1_pwm_channel_set
+0x49b6 mem_motor1_pwm_freq_set
+0x49b9 mem_motor1_pwm_dute_set
+0x49ba mem_motor2_pwm_set
+0x49ba mem_motor2_pwm_pin1_set
+0x49bb mem_motor2_pwm_pin2_set
+0x49bc mem_motor2_pwm_pin_set
+0x49bd mem_motor2_pwm_channel_set
+0x49be mem_motor2_pwm_freq_set
+0x49c1 mem_motor2_pwm_dute_set
+0x49c2 mem_motor3_pwm_set
+0x49c2 mem_motor3_pwm_pin1_set
+0x49c3 mem_motor3_pwm_pin2_set
+0x49c4 mem_motor3_pwm_pin_set
+0x49c5 mem_motor3_pwm_channel_set
+0x49c6 mem_motor3_pwm_freq_set
+0x49c9 mem_motor3_pwm_dute_set
+0x49ca mem_motor_select_p_n
+0x49cb mem_car_motor_status
+0x49cc mem_car_motor_speed
+0x49cd mem_motor_pwm_set
+0x49cd mem_motor_pwm_pin1_set
+0x49ce mem_motor_pwm_pin2_set
+0x49cf mem_motor_pwm_pin_set
+0x49d0 mem_motor_pwm_channel_set
+0x49d1 mem_motor_pwm_freq_set
+0x49d4 mem_motor_pwm_dute_set
+0x49d5 mem_ir_rx_gpio
+0x49d6 mem_ir_data
+0x49d8 mem_ir_rx_buf
+0x49da mem_ir_receive_clkn
+0x49de mem_ir_notify_data
+0x49e1 mem_ir_notify_data_head
+0x49e6 mem_ir_notify_data_payload
+0x49e8 mem_ir_notify_data_check_sum
+0x49e9 mem_car_ir_breakdown_check_timer
+0x49ea mem_car_ir_breakdown_flag
+0x49eb mem_car_led_control
+0x49eb mem_car_led1_status
+0x49ec mem_car_led2_status
+0x49ed mem_car_led3_status
+0x49ee mem_car_led4_status
+0x49ef mem_car_led5_status
+0x49f0 mem_car_led6_status
+0x49f1 mem_car_led7_status
+0x49f2 mem_car_led8_status
+0x49f3 mem_car_led_control_timer
+0x49f4 mem_car_led_blink_status
+0x49f5 mem_car_led_no
+0x49f6 mem_car_info_request
+0x49f9 mem_car_info_request_head
+0x49fe mem_car_info_request_payload
+0x4a06 mem_car_info_request_checksum
+0x4a07 mem_car_config_param
+0x4a07 mem_car_config_setting_flag
+0x4a08 mem_car_config_device_select
+0x4a09 mem_car_config_motor_layout
+0x4a0a mem_car_config_ir_enable
+0x4a0b mem_car_config_ir_rx_gpio
+0x4a0c mem_car_config_pairing_led_conn_status
+0x4a0d mem_car_config_pairing_led_gpio
+0x4a0e mem_car_config_led_num
+0x4a0f mem_car_config_blood_led_gpio
+0x4a0f mem_car_config_blood_led1_gpio
+0x4a10 mem_car_config_blood_led2_gpio
+0x4a11 mem_car_config_blood_led3_gpio
+0x4a12 mem_car_config_blood_led4_gpio
+0x4a13 mem_car_config_blood_led5_gpio
+0x4a14 mem_car_config_blood_led6_gpio
+0x4a15 mem_car_config_blood_led7_gpio
+0x4a16 mem_car_config_blood_led8_gpio
+0x4a17 mem_car_config_bat_notify_enable
+0x4a18 mem_car_config_low_voltage_led_gpio
+0x4a19 mem_car_config_low_voltage_percent
+0x4a1a mem_car_config_soft_switch_enable
+0x4a1b mem_car_config_soft_switch_gpio
+0x4a1c mem_car_notify_vdd_count
+0x4a1d mem_car_notify_vdd_timer
+0x4a1e mem_car_notify_vdd_value_last
+0x4a1f mem_car_notify_vdd_percent
+0x4a20 mem_car_working_flag
+0x4a21 mem_low_bat_flag
+0x4a22 mem_notify_bat_packet
+0x4a25 mem_notify_bat_head
+0x4a2a mem_notify_bat_payload
+0x4a2b mem_notify_bat_check_sum
+0x4a2c mem_vdd_notify_flag
+0x4a2d mem_car_current_vdd_value_temp
+0x4a2f mem_car_last_vdd_value
+0x4a31 mem_vdd_calculate_set
+0x4a31 mem_vdd_full_vol
+0x4a33 mem_vdd_empty_vol
+0x4a35 mem_vdd_low_vol
+0x4a37 mem_vdd_now_vol
+0x4a39 mem_car_24g_status
+0x4a3a mem_car_24g_no_data_timeout_count
+0x4a3c mem_car_24g_no_data_timeout_timer
+0x4a3e mem_car_24g_ir_receive_attack_count
+0x4a3f mem_car_24g_go_die_flag
+0x4a40 mem_car_attack_shake_timer
+0x4a41 mem_car_attack_shake_flag
+0x4a42 mem_car_soft_power
+0x4a42 mem_car_power_state
+0x4a43 mem_car_power_timer
+0x4a44 mem_car_power_off_timeout
+0x4a45 mem_car_power_starting_timeout
+0x4a46 mem_car_power_off_cb
+0x4a48 mem_car_power_starting_cb
+0x4a4a mem_car_power_standby_cb
+0x4a4c mem_car_ui_button_up_cb
+0x4a4e mem_car_le_att_list
+0x4c42 mem_car_moto1_blank_timer
+0x4c43 mem_car_moto2_blank_timer
+0x4c44 mem_car_moto3_blank_timer
+0x4c45 mem_car_motor_gpio_num
+0x4c46 mem_car_motor_gpio_map
+0x4c46 mem_car_motor_left_gpio
+0x4c47 mem_car_motor_right_gpio
+0x4c48 mem_car_motor_front_gpio
+0x4c49 mem_car_motor_back_gpio
+0x4c4a mem_car_gpio
+0x4c4b mem_car_app_send_speed
+0x4c4c mem_rssi_sum
+0x4c4e mem_check_rssi_high_count
+0x4c50 mem_rssi_data
+0x4c58 mem_car_24g_received_pac
+0x4c59 mem_car_24g_bind_enable_delay_count
+0x4c5a mem_car_keyscan
+0x4c5a mem_car_key_num
+0x4c5b mem_cb_car_keyscan
+0x4c5d mem_car_enter_lpm_timer_count
+0x4c5f mem_car_enter_lpm_timer
+0x4c61 mem_car_enter_lpm_flag
+0x4c62 mem_car_24g_ch_polling
+0x4c63 mem_car_rssi_noise_buffer
+0x4c6b mem_car_rssi_noise_car_buffer
+0x4c73 mem_car_rssi_noise_remote_buffer
+0x48e9 mem_dg_kb_bind_flag
+0x48ea mem_dg_kb_data_sta_data
+0x48f2 mem_dg_kb_data_last_data
+0x48fa mem_dg_kb_multikey_sta_data
+0x48fd mem_dg_kb_multikey_last_data
+0x4900 mem_dg_kb_system_sta_data
+0x4903 mem_dg_kb_system_last_data
+0x4906 mem_dg_kb_blank_data_enable
+0x4907 mem_dg_kb_mul_blank_data_enable
+0x4908 mem_dg_ms_blank_data_enable
+0x4909 mem_dg_sys_config
+0x490a mem_dg_usb_vid_pid
+0x4913 mem_dg_usb_tx_interval
+0x4914 mem_dg_usb_device_name
+0x487e mem_rssi_hex_received
+0x487f mem_24g_pair_sm
+0x4880 mem_24g_pair_no_ack
+0x4881 mem_24g_pair_timeout_init
+0x4883 mem_24g_pair_timeout
+0x4885 mem_24g_reconn_timeout_init
+0x4887 mem_24g_reconn_timeout
+0x4889 mem_24g_reconn_count
+0x488b mem_24g_reconn_type
+0x488c mem_24g_fast_conn_enable
+0x488d mem_24g_fast_conn_addr
+0x4891 mem_24g_receiver_addr
+0x4895 mem_24g_fast_conn_temp_ch
+0x4896 mem_24g_receiver_temp_ch
+0x4897 mem_24g_device_temp_ch
+0x4898 mem_rssi_signal_index
+0x4899 mem_rssi_signal_buf_ptr
+0x489b mem_cb_24g_transmit_data
+0x489d mem_cb_24g_search_receiver
+0x489f mem_cb_24g_lpm_before
+0x48a1 mem_24g_conn_sm
+0x48a2 mem_24g_ensure
+0x48a3 mem_24g_txfail_cnt
+0x48a5 mem_24g_attempt_fail_flag
+0x48a6 mem_24g_retry
+0x48a7 mem_24g_abort_pac
+0x48a8 mem_24g_max_retry
+0x48a9 mem_24g_device_addr
+0x48ad mem_24g_short_sleep_set
+0x48b0 mem_24g_long_sleep_set
+0x48b8 mem_24g_long_sleep_set1
+0x48bc mem_24g_pac_index
+0x48bd mem_24g_transmit_by_interrupt
+0x48be mem_24g_transmit_by_interrupt_exit_count
+0x48c0 mem_24g_transmit_by_interrupt_exit_count_init
+0x48c2 mem_24g_long_sleep_param_update_timer_init
+0x48c4 mem_24g_long_sleep_param_update_timer
+0x48c6 mem_24g_fast_hop_count
+0x48c7 mem_rssi_avg_received
+0x48c8 mem_power_ctrl_level
+0x48c9 mem_power_ctrl_pac_succ_cnt
+0x48ca mem_power_ctrl_pac_succ_cnt_init
+0x48cb mem_rssi_dis_min_24g
+0x48cc mem_rssi_dis_max_24g
+0x48cd mem_rssi_hex_received_max_value
+0x48ce mem_rssi_dis_min_ble
+0x48cf mem_rssi_dis_max_ble
+0x48d0 mem_mouse_key
+0x48d1 mem_mouse_x
+0x48d3 mem_mouse_y
+0x48d5 mem_mouse_z
+0x48d6 mem_mouse_tz
+0x48d7 mem_mouse_xy_h
+0x48d8 mem_mouse_key_last
+0x48d9 mem_wheel_tb_old_pinlevel
+0x48da mem_wheel_tb_new_pinlevel
+0x48db mem_wheel_tog
+0x48dc mem_mouse_tz_data
+0x48dd mem_mwheel_b_old_pinlevel
+0x48de mem_mwheel_b_new_pinlevel
+0x48df mem_mwheel_tog
+0x48e0 mem_mouse_z_data
+0x48e1 mem_mouse_wheel_trigger
+0x48e2 mem_mouse_wheel_trigger_timer
+0x48e3 mem_mouse_vdd_calculate_set
+0x48e3 mem_mouse_vdd_full_vol
+0x48e5 mem_mouse_vdd_empty_vol
+0x48e7 mem_mouse_vdd_low_vol
+0x48e9 mem_mouse_vdd_now_vol
+0x48eb mem_mouse_vdd_button_press_vol
+0x48ed mem_mouse_vdd_switch_gnd_24g_vol
+0x48ef mem_mouse_vdd_switch_gnd_full_vol
+0x48f1 mem_mouse_vdd_switch_gnd_shutdown_voltage
+0x48f3 mem_mouse_vdd_switch_gnd_low_voltage
+0x48f5 mem_adc_mux_status
+0x48f6 mem_adc_read_timer
+0x48f7 mem_adc_read_time_init
+0x48f8 mem_adc_low_volatage_led_timer_count
+0x48f9 mem_adc_low_volatage_led_blink_enable
+0x48fa mem_mouse_adc_last_low_voltage_flag
+0x48fb mem_mouse_adc_button_press_flag
+0x48fc mem_adc_channel_gpio
+0x48fd mem_adc_config_flag_init
+0x48fe mem_mouse_discovery_timeout
+0x4900 mem_mouse_24g_pair_timeout_init
+0x4902 mem_mouse_direct_timeout
+0x4903 mem_mouse_24g_reconn_timeout_init
+0x4904 mem_mouse_24g_pair_tx_power
+0x4905 mem_rssi_dis_min_24g_init
+0x4906 mem_rssi_dis_max_24g_init
+0x4907 mem_rssi_hex_received_max_value_init
+0x4908 mem_rssi_dis_min_ble_init
+0x4909 mem_rssi_dis_max_ble_init
+0x490a mem_mouse_enable_flag
+0x490b mem_mouse_global_setup
+0x490c mem_mouse_global_setup1
+0x490d mem_bk_button_gpio
+0x490e mem_fw_button_gpio
+0x490f mem_dpi_button_gpio
+0x4910 mem_matrix_public_gpio
+0x4911 mem_sensor_motion_gpio
+0x4912 mem_customer_key_gpio
+0x4913 mem_whee_a_data_gpio
+0x4914 mem_whee_b_data_gpio
+0x4915 mem_config_device_24g_led_gpio
+0x4916 mem_config_device_bt1_led_gpio
+0x4917 mem_select_sensor_angle_gpio
+0x4918 mem_lbutton_gpio
+0x4919 mem_rbutton_gpio
+0x491a mem_mbutton_gpio
+0x491b mem_config_select_device_button_gpio
+0x491c mem_whee_ta_data_gpio
+0x491d mem_whee_tb_data_gpio
+0x491e mem_device_switch_gpio
+0x491f mem_mouse_sensor_sclk_gpio
+0x4920 mem_mouse_sensor_sdio_gpio
+0x4921 mem_config_low_voltage_alarm_gpio
+0x4922 mem_config_device_bt2_led_gpio
+0x4923 mem_dpi_led_gpio
+0x4924 mem_sensor_angle_default
+0x4925 mem_sensor_angle_switch
+0x4926 mem_config_sensor_dpi
+0x4927 mem_config_sensor_type
+0x4928 mem_config_sensor_angle
+0x4929 mem_wire_usb_interval
+0x492a mem_usb_addr
+0x492b mem_mouse_usb_vdd_status
+0x492c mem_mouse_usb_keyboard_flag
+0x492d mem_mouse_led_type
+0x492e mem_mouse_blink_count
+0x492f mem_mouse_struct_led_gpio
+0x4930 mem_mouse_on_time
+0x4932 mem_mouse_off_time
+0x4934 mem_mouse_cb_ledon
+0x4936 mem_mouse_cb_ledoff
+0x4938 mem_mouse_information_start
+0x4938 mem_device_flag
+0x4939 mem_device1_type
+0x493a mem_device1_addr
+0x4940 mem_device1_link_key
+0x4950 mem_device1_locall_addr
+0x4956 mem_device2_type
+0x4957 mem_device2_addr
+0x495d mem_device2_link_key
+0x496d mem_device2_locall_addr
+0x4973 mem_device3_type
+0x4974 mem_mouse_compare_addr_ff
+0x4974 mem_device3_addr
+0x497a mem_device3_link_key
+0x498a mem_device3_locall_addr
+0x4990 mem_store_flag
+0x4992 mem_mouse_dpi
+0x4993 mem_mouse_24g_addr
+0x4997 mem_random_addr_increase_count
+0x4999 mem_mouse_retention
+0x49b8 mem_mouse_information_end
+0x49b8 mem_flash_base
+0x49bb mem_write_flash_head_temp
+0x49bf mem_store_information_delay_timer
+0x49c0 mem_store_information_delay_timer_init
+0x49c1 mem_sensor_id1
+0x49c2 mem_sensor_id2
+0x49c3 mem_sensor_shutter_hi
+0x49c4 mem_sensor_shutter_lo
+0x49c5 mem_sensor_smart_flag
+0x49c6 mem_sensor_squal_reg
+0x49c7 mem_sensor_iqc
+0x49c8 mem_mouse_move_flag
+0x49c9 mem_mouse_asm_flag
+0x49ca mem_mouse_x_pre
+0x49cc mem_mouse_y_pre
+0x49ce mem_mouse_data_xtemp
+0x49cf mem_mouse_data_ytemp
+0x49d0 mem_mouse_dpi_seting
+0x49d0 mem_320x_dpi_0
+0x49d1 mem_320x_dpi_1
+0x49d2 mem_320x_dpi_2
+0x49d3 mem_320x_dpi_3
+0x49d4 mem_3212_dpi_0
+0x49d5 mem_3212_dpi_1
+0x49d6 mem_3212_dpi_2
+0x49d7 mem_3212_dpi_3
+0x49d8 mem_ka8g2_dpi_0
+0x49d9 mem_ka8g2_dpi_1
+0x49da mem_ka8g2_dpi_2
+0x49db mem_ka8g2_dpi_3
+0x49dc mem_mouse_cpi_count
+0x49dd mem_mouse_dpi_button_state
+0x49de mem_mouse_dpi_long_press_flag
+0x49df mem_sensor_3212_init
+0x49e9 mem_sensor_3204_init
+0x49f3 mem_sensor_3205_init
+0x49fd mem_sensor_32xx_init
+0x4a17 mem_sensor_32xx_init_1
+0x4a39 mem_sensor_8650_init
+0x4a53 mem_sensor_ka8ul_init
+0x4a71 mem_sensor_8009_init
+0x4a81 mem_sensor_ka8g2_init
+0x4a97 mem_sensor_p6520_init
+0x4aa3 mem_sensor_poweron_init
+0x4aab mem_sensor_reset_gpio
+0x4aac mem_mouse_clear_sensor_data_flag
+0x4aad mem_bluetooth_125hz_cnt
+0x4aae mem_mouse_long_mult_flag
+0x4aaf mem_mouse_current_mult_timer
+0x4ab0 mem_reconn_times
+0x4ab1 mem_reconn_times_init
+0x4ab2 mem_mouse_no_data_timer
+0x4ab4 mem_device_flag_temp
+0x4ab5 mem_mouse_rssi_signal_buf
+0x4abd mem_btclk_sensor
+0x4ac1 mem_mouse_bluetooth_fast_conn_flag
+0x4ac2 mem_mouse_discovery_timer
+0x4ac4 mem_mouse_bluetooth_reconnect_timeout
+0x4ac5 mem_mouse_need_soft_reset
+0x4ac6 mem_mouse_le_bb_connected_flag
+0x4ac7 mem_mouse_le_reconnect_flag
+0x4ac8 mem_mouse_send_secutiry_request_timer
+0x4ac9 mem_mouse_le_lap_temp
+0x4acc mem_le_adv_ind
+0x4acf mem_le_adv_direct_ind
+0x4ad2 mem_le_adv_swift_pair
+0x4ae6 mem_le_data_len
+0x4ae7 mem_le_keyboard_handle
+0x4ae9 mem_le_multimedia_handle
+0x4aeb mem_le_systemctrl_handle
+0x4aed mem_le_battery_level_handle
+0x4aef mem_le_battery_level_percentage
+0x4af0 mem_le_battery_level_updata_timer_init
+0x4af2 mem_le_battery_level_updata_timer
+0x4af4 mem_mouse_le_conn_param_reject
+0x4af5 mem_le_tx_buffer0_omemalloc
+0x4b15 mem_le_tx_buffer1_omemalloc
+0x4b35 mem_le_tx_buffer2_omemalloc
+0x4b55 mem_le_tx_buffer3_omemalloc
+0x4b75 mem_le_connect_status_flag
+0x4b76 mem_le_start_encrypt_timer
+0x4b77 mem_mouse_direct_timer
+0x4b78 mem_device_addr_temp
+0x4b7f mem_mouse_enter_sniff_count
+0x4b80 mem_mouse_bt_boot_mode
+0x4b81 mem_mouse_bt_boot_data
+0x4b86 mem_bt_send_max_slot_req_accept_after_switch
+0x4b87 mem_mouse_bt_send_first_package_timer
+0x4b88 mem_mouse_bt_send_first_package_flag
+0x4b89 mem_lmi_opcode_temp
+0x4b8a mem_lpm_mult_init
+0x4b8b mem_customer_key
+0x4b8c mem_customer_data_trigger
+0x4b8d mem_customer_data_trigger_last
+0x4b8e mem_mouse_lkey_press_status
+0x4b8f mem_mouse_rkey_press_status
+0x4b90 mem_mouse_mkey_press_status
+0x4b91 mem_mouse_bkkey_press_status
+0x4b92 mem_mouse_fwkey_press_status
+0x4b93 mem_mouse_dpikey_press_status
+0x4b94 mem_mouse_pbkey_press_status
+0x4b95 mem_mouse_customerkey_press_status
+0x4b96 mem_mouse_key_temp
+0x4b97 mem_mouse_key_status
+0x4b98 mem_mouse_matrix_key_cow_count
+0x4b99 mem_mouse_matrix_key_row_count
+0x4b9a mem_mouse_ghost_flag
+0x4b9b mem_bt_discovery_count
+0x4b9c mem_select_device_count
+0x4b9d mem_mouse_commbination_key
+0x4b9e mem_select_device_button_statue
+0x4b9f mem_commbination_key_statue
+0x4ba0 mem_combination_ui_button_count
+0x4ba1 mem_mouse_search_dongle_interval
+0x4ba2 mem_mouse_search_dongle_ch
+0x4ba3 mem_mouse_search_dongle_count
+0x4ba4 mem_mouse_search_dongle_action
+0x4ba5 mem_24g_enter_lpm_timer
+0x4ba6 mem_mouse_24g_enter_lpm_enable
+0x4ba7 mem_mouse_device_poweron_timer_count
+0x4ba8 mem_mouse_dpi_led_delay_count
+0x4ba9 mem_mouse_led_off_4_led
+0x4baa mem_24g_device_led_status
+0x4bab mem_mouse_flag
+0x4bb3 mem_mouse_bluetooth_type
+0x4bb4 mem_device_number
+0x4bb5 mem_mouse_page_to
+0x4bb7 mem_mouse_fast_direct_timeout
+0x4bb8 mem_mouse_fast_page_to
+0x4bba mem_mouse_24g_power_on_fast_conn_timer
+0x4bbc mem_mouse_24g_search_dongle_time_init
+0x4bbe mem_mouse_no_data_timeout
+0x4bc0 mem_mouse_device_poweron_timer_count_init
+0x4bc1 mem_mouse_dpi_led_delay_count_init
+0x4bc2 mem_mouse_dpi_led_blink_time
+0x4bc4 mem_mouse_disconvey_led_blink_time
+0x4bc6 mem_mouse_low_v_led_blink_time
+0x4bc8 mem_adc_low_volatage_led_blink_timer
+0x4bca mem_mouse_commbination_key_bt
+0x4bcb mem_mouse_commbination_key_24g
+0x4bcc mem_customer_key_press
+0x4bd5 mem_customer_key_release
+0x4bde mem_mouse_set_high_impedance_bit_set
+0x4be1 mem_sensor_shutdown_flag
+0x4be2 mem_power_on_flag
+0x4be3 mem_ka8g2_sensor_poweron_init
+0x4beb mem_24g_pair_count
+0x4bed mem_mouse_logo_led_gpio
+0x4bee mem_mouse_logo_led_on_time_init
+0x4bf0 mem_g24_ota_config_type//rr
+0x4bf1 mem_g24_ota_storage_size//byte
+0x4bf3 mem_g24_ota_config_addr
+0x4bf5 mem_g24_ota_rtn_state
+0x4bf6 mem_g24_ota_mode
+0x4bf7 mem_g24_ota_sm
+0x4bf8 mem_g24_ota_prepare_send_len
+0x4bf9 mem_g24_ota_txbuf
+0x4c18 mem_g24_ota_rx_alllen
+0x4c1a mem_g24_ota_rx_sum
+0x4c1c mem_g24_ota_rx_data_count
+0x4c1d mem_g24_ota_reset_timer
+0x4c1e mem_le_name_patch_len
+0x4c1f mem_le_name_patch
+0x4c32 mem_dpi_another_button_gpio
+0x4c33 mem_dpi_another_press_status
+0x4c34 mem_dpi_another_button_state
+0x4c35 mem_dpi_another_button_down_enable
+0x4c36 mem_mouse_key_temp_patch
+0x4c37 mem_voltage_alarm_led1
+0x4c38 mem_voltage_alarm_led2
+0x4c39 mem_mouse_vdd_full_compare_vol
+0x4c3b mem_mouse_logo_led_blink_flag
+0x4c3c mem_mouse_logo_led_blink_timer
+0x4c3d mem_mouse_logo_led_state
+0x48d0 mem_remote_car_hard_soft_switch
+0x48d1 mem_remote_car_queue_each_size
+0x48d2 mem_remote_car_queue_length
+0x48d3 mem_remote_car_queue_curr_num
+0x48d4 mem_remote_car_queue_read_ptr
+0x48d5 mem_remote_car_queue_write_ptr
+0x48d6 mem_remote_car_queue_ele
+0x4930 mem_remote_style_led_type
+0x4931 mem_remote_style_blink_count
+0x4932 mem_remote_style_struct_led_gpio
+0x4933 mem_remote_style_on_time
+0x4935 mem_remote_style_off_time
+0x4937 mem_remote_style_cb_ledon
+0x4939 mem_remote_style_cb_ledoff
+0x493b mem_remote_car_led_num
+0x493c mem_remote_car_led_map
+0x4944 mem_remote_car_keyscan
+0x4944 mem_remote_car_key_num
+0x4945 mem_cb_remote_car_keyscan
+0x4947 mem_remote_car_key_conf0
+0x4947 mem_remote_car_key_conf0_pin
+0x4948 mem_remote_car_key_conf1
+0x4948 mem_remote_car_key_conf1_pin
+0x4949 mem_remote_car_key_conf2
+0x4949 mem_remote_car_key_conf2_pin
+0x494a mem_remote_car_key_conf3
+0x494a mem_remote_car_key_conf3_pin
+0x494b mem_remote_car_key_conf4
+0x494b mem_remote_car_key_conf4_pin
+0x494c mem_remote_car_key_conf5
+0x494c mem_remote_car_key_conf5_pin
+0x494d mem_remote_car_key_conf6
+0x494d mem_remote_car_key_conf6_pin
+0x494e mem_rocker_negative_flag
+0x494f mem_rocker_work_status
+0x4950 mem_current_vdd_value_default_mid_x
+0x4952 mem_current_vdd_value_default_mid_y
+0x4954 mem_current_vdd_value_default_mid_temp
+0x4956 mem_current_vdd_default_range
+0x4958 mem_rocker_last_status
+0x495a mem_rocker_status
+0x495a mem_rocker_x_status
+0x495b mem_rocker_y_status
+0x495c mem_remote_car_config_param
+0x495c mem_remote_car_config_setting_flag
+0x495d mem_remote_car_config_key_map
+0x495e mem_remote_car_config_layout
+0x495f mem_remote_car_config_connect_led_gpio
+0x4960 mem_remote_car_config_check_way
+0x4961 mem_remote_car_config_soft_switch_enable
+0x4962 mem_remote_car_config_soft_switch_gpio
+0x4963 mem_remote_car_config_timeout_shutdown_enable
+0x4964 mem_remote_car_24g_motor_packet
+0x4964 mem_remote_car_24g_motor_packet_lenght
+0x4965 mem_remote_car_24g_motor_send_packet_head
+0x4967 mem_remote_car_24g_motor_send_cmd
+0x4968 mem_remote_car_24g_motor_send_length
+0x496a mem_remote_car_24g_motor_send_payload
+0x496a mem_remote_car_24g_motor1_payload
+0x496c mem_remote_car_24g_motor2_payload
+0x496e mem_remote_car_24g_motor3_payload
+0x4970 mem_remote_car_24g_motor_send_checksum
+0x4971 mem_remote_car_24g_fire_packet
+0x4971 mem_remote_car_24g_fire_packet_lenght
+0x4972 mem_remote_car_24g_fire_send_packet_head
+0x4974 mem_remote_car_24g_fire_send_cmd
+0x4975 mem_remote_car_24g_fire_send_length
+0x4977 mem_remote_car_24g_fire_send_payload
+0x4979 mem_remote_car_24g_fire_send_checksum
+0x497a mem_remote_car_24g_tx_temp
+0x4989 mem_remote_car_no_data_timeout
+0x498b mem_remote_car_no_data_timer
+0x498d mem_remote_car_soft_power
+0x498d mem_remote_car_power_state
+0x498e mem_remote_car_power_timer
+0x498f mem_remote_car_power_off_timeout
+0x4990 mem_remote_car_power_starting_timeout
+0x4991 mem_remote_car_power_off_cb
+0x4993 mem_remote_car_power_starting_cb
+0x4995 mem_remote_car_power_standby_cb
+0x4997 mem_remote_key_status
+0x4998 mem_remote_car_24g_status
+0x4999 mem_remote_car_24g_auto_work_step
+0x499a mem_remote_car_24g_pair_success_flag
+0x499b mem_remote_car_empty_packet
+0x499c mem_remote_car_motor1_key0_press_state
+0x499d mem_remote_car_motor1_key1_press_state
+0x499e mem_remote_car_motor2_key2_press_state
+0x499f mem_remote_car_motor2_key3_press_state
+0x49a0 mem_remote_car_motor1_rel_state
+0x49a1 mem_remote_car_motor2_rel_state
+0x49a2 mem_remote_car_no_data_check
+0x47a4 mem_hci_uart_tx_gpio
+0x47a5 mem_hci_uart_rx_gpio
+0x47a6 mem_hci_uart_rts_gpio
+0x47a7 mem_hci_uart_cts_gpio
+0x47a8 mem_hci_pwm_12mhz_gpio
+0x47a4 mem_soft_version_num
+0x47a6 mem_module_wake_up_gpio
+0x47a7 mem_module_state_gpio
+0x47a8 mem_module_connect_state_gpio
+0x47a9 mem_current_packet_length
+0x47ab mem_module_state
+0x47ac mem_module_mcu_wake_pin
+0x47ad mem_module_mcu_wake_delay_us
+0x47b1 mem_module_spp_lpm_mult
+0x47b2 mem_module_le_lpm_mult
+0x47b3 mem_module_bluetooth_stauts_by_command
+0x47b4 mem_module_uart_rx_buffer
+0x47b6 mem_module_uart_rx_buffer_end
+0x47b8 mem_module_uart_tx_buffer
+0x47ba mem_module_uart_tx_buffer_end
+0x47bc mem_module_uarta_baud_rate
+0x47be mem_module_read_vdd_flag
+0x47bf mem_module_read_vdd_count
+0x47c0 mem_module_vdd_quotient
+0x47c1 mem_module_vdd_remainder
+0x47c2 mem_module_ble_data_uart_max_length
+0x47c3 mem_module_flag
+0x47c5 mem_module_hci_notify_len
+0x47c6 mem_module_hci_notify_handle
+0x47c8 mem_module_hci_nofiy_addr
+0x47ca mem_module_hci_notify_type
+0x47cb mem_last_transmite_clock
+0x47cf mem_module_uuid_list
+0x48fb mem_module_uuid_list_end
+0x48fb mem_module_le_att_list
+0x4b53 mem_module_le_att_list_end
+0x4b53 mem_module_nv_data
+0x4b53 mem_module_nv_data0
+0x4b75 mem_module_nv_data1
+0x4b97 mem_module_nv_data2
+0x4bb9 mem_module_nv_data3
+0x4bdb mem_module_nv_data4
+0x4bfd mem_module_nv_data_end
+0x47a4 mem_shutter_bluetooth_type
+0x47a5 mem_shutter_config_eeprom_offset_addr
+0x47a7 mem_shutter_config_eeprom_start_flag
+0x47a9 mem_shutter_config_user_size
+0x47aa mem_shutter_config_label
+0x47ab mem_shutter_config_otp_addr
+0x47ad mem_classic_shutter_cable_unplug_conut
+0x47ae mem_classic_shutter_hid_disconn_count
+0x47af mem_classic_shutter_random_mac_offset_addr
+0x47b1 mem_ble_shutter_enable_notify
+0x47b2 mem_ble_shutter_reconn_adv_interval
+0x47b4 mem_ble_shutter_discovery_adv_interval
+0x47b6 mem_ble_shutter_reconn_timeout
+0x47b8 mem_ble_shutter_reconn_timer
+0x47ba mem_ble_shutter_reconn_blink_on_time
+0x47bc mem_ble_shutter_reconn_blink_off_time
+0x47be mem_ble_shutter_discovery_blink_on_time
+0x47c0 mem_ble_shutter_discovery_blink_off_time
+0x47c2 mem_ble_shutter_interval_min
+0x47c4 mem_ble_shutter_interval_max
+0x47c6 mem_ble_shutter_latency
+0x47c8 mem_ble_shutter_timeout
+0x47ca mem_ble_shutter_interval_min_new
+0x47cc mem_ble_shutter_interval_max_new
+0x47ce mem_ble_shutter_latency_new
+0x47d0 mem_ble_shutter_timeout_new
+0x47d2 mem_classic_shutter_discovery_timeout
+0x47d4 mem_classic_shutter_connect_timeout
+0x47d6 mem_ble_shutter_discovery_timeout
+0x47d8 mem_ble_shutter_connect_timeout
+0x47da mem_shutter_sleep_timeout
+0x47dc mem_shutter_sleep_timer
+0x47de mem_shutter_hard_soft_switch_case
+0x47df mem_shutter_soft_switch_button_gpio
+0x47e0 mem_shutter_soft_switch_power_state
+0x47e1 mem_shutter_soft_switch_poweron_time
+0x47e2 mem_shutter_soft_switch_poweroff_time
+0x47e3 mem_shutter_soft_switch_poweron_callback_function
+0x47e5 mem_shutter_soft_switch_poweroff_callback_function
+0x47e7 mem_shutter_keyscan
+0x47e7 mem_shutter_key_num
+0x47e8 mem_cb_shutter_keycan
+0x47ea mem_shutter_key_conf0
+0x47eb mem_shutter_key_conf1
+0x47ec mem_shutter_key_conf2
+0x47ed mem_shutter_key_conf3
+0x47ee mem_shutter_key_conf4
+0x47ef mem_shutter_key_conf5
+0x47f0 mem_shutter_key_conf6
+0x47f1 mem_shutter_key_conf7
+0x47f2 mem_key0_press
+0x47f7 mem_key1_press
+0x47fc mem_key2_press
+0x4801 mem_key3_press
+0x4806 mem_key4_press
+0x480b mem_key5_press
+0x4810 mem_key6_press
+0x4815 mem_key7_press
+0x481a mem_key0_release
+0x481f mem_key1_release
+0x4824 mem_key2_release
+0x4829 mem_key3_release
+0x482e mem_key4_release
+0x4833 mem_key5_release
+0x4838 mem_key6_release
+0x483d mem_key7_release
+0x4842 mem_ble_data_buffer1
+0x4847 mem_ble_data_buffer2
+0x484c mem_ble_data_buffer3
+0x4851 mem_ble_data_buffer4
+0x4856 mem_ble_data_buffer5
+0x485b mem_ble_data_buffer6
+0x4860 mem_ble_data_buffer7
+0x4865 mem_ble_data_buffer8
+0x486a mem_ble_data_buffer9_58
+0x489c mem_classic_data_buffer
+0x48a1 mem_classic_data_buffer1
+0x48a6 mem_classic_data_buffer2
+0x48ab mem_classic_data_buffer3
+0x48b0 mem_classic_data_buffer4
+0x48b5 mem_classic_data_buffer5
+0x48ba mem_classic_data_buffer6
+0x48bf mem_classic_data_buffer7
+0x48c4 mem_classic_data_buffer8
+0x48c9 mem_classic_data_buffer9_58
+0x48fb mem_queue_each_size
+0x48fc mem_queue_length
+0x48fd mem_queue_curr_num
+0x48fe mem_queue_read_ptr
+0x48ff mem_queue_write_ptr
+0x4900 mem_queue_ele
+0x4920 mem_shutter_nv_data
+0x49ca mem_shutter_led_struct_app_led
+0x49ca mem_shutter_led_struct_app_led_type
+0x49cb mem_shutter_led_struct_app_led_blink_count
+0x49cc mem_shutter_led_struct_app_led_gpio
+0x49cd mem_shutter_led_struct_app_led_on_time
+0x49cf mem_shutter_led_struct_app_led_off_time
+0x49d1 mem_shutter_led_struct_app_led_on_callback
+0x49d3 mem_shutter_led_struct_app_led_off_callback
+0x49d5 mem_shutter_power_off_led_style
+0x49d5 mem_shutter_power_off_led_style_type
+0x49d6 mem_shutter_power_off_led_style_blink_count
+0x49d7 mem_shutter_power_off_led_style_gpio
+0x49d8 mem_shutter_power_off_led_style_on_time
+0x49da mem_shutter_power_off_led_style_off_time
+0x49dc mem_shutter_power_off_led_style_on_callback
+0x49de mem_shutter_power_off_led_style_off_callback
+0x49e0 mem_shutter_soft_swtich_botton_down
+0x49e1 mem_shutter_soft_swtich_led_struct_temp
+0x49ec mem_shutter_power_off_timeout
+0x49ed mem_shutter_power_off_timer
+0x49ee mem_shutter_key_conf0_temp
+0x49f0 mem_shutter_led_struct_app_led_gpio_temp
+0x49f1 mem_shutter_hard_soft_switch_case_temp
+0x49f2 mem_shutter_soft_switch_button_gpio_temp
+
+0x4b46 mem_mesh_unsegmented_access_lower_transport_layer_head
+0x4b47 mem_mesh_unsegmented_access_lower_transport_layer_parameters
+0x4b52 mem_mesh_unsegmented_access_lower_transport_layer_mic
+0x4b46 mem_mesh_segmented_access_lower_transport_layer_head
+0x4b47 mem_mesh_segmented_access_lower_transport_layer_SZMIC_SeqZero_SegO_SegN
+0x4b4a mem_mesh_segmented_access_lower_transport_layer_parameters
+0x4b52 mem_mesh_segmented_access_lower_transport_layer_mic
+0x48e2 mem_k2_EncryptionKey
+0x48d2 mem_k2_PrivacyKey
Index: output/romcode.rom
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/romcode.rom	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/output/romcode.rom	(working copy)
@@ -0,0 +1,30720 @@
+20401410
+44804000
+20800000
+204030f3
+2040124a
+20405d96
+20401384
+20404dc7
+4480c000
+204062bb
+20405381
+204077b4
+204030dc
+2455e0b9
+44814000
+2055b0ea
+20406ea4
+20406ec6
+205594b5
+4481c000
+2040706c
+20407597
+20406ea7
+20401b92
+2040083a
+20403107
+44824000
+20400891
+20400b07
+20400b7a
+20400822
+204021d1
+204014dd
+20200813
+c61a0000
+20400828
+c6848000
+793f8009
+20400a32
+202016b2
+4482c000
+20400a6d
+24228831
+20400a19
+1a208c01
+efe08006
+c280161f
+c280896b
+20200be0
+20400a3a
+1f227c00
+20628000
+20400a19
+6fe08031
+c28188d5
+6fe08032
+c280896b
+20200be0
+6fe0c1db
+207a0000
+c000884a
+c001084f
+c0018852
+c0028857
+c00d8847
+20400a66
+20628000
+20400a69
+20628000
+7041db00
+20600000
+7002e01b
+7041db00
+20600000
+7920001c
+793f801e
+70008dff
+70008b1f
+20200845
+793f801c
+18003600
+20200845
+20400a69
+20628000
+18000401
+7000be05
+2020085e
+44834000
+6fe341dd
+20000001
+70478b01
+70005603
+2020085d
+18000425
+4483c000
+6fe080a8
+203a0864
+1fe9fe00
+1ff27e00
+1fe0ffff
+67e0c0ae
+67e080a7
+70008c1f
+793f800c
+20400a4a
+24228885
+2040135d
+67e08078
+6048807d
+6fe341dd
+67e30041
+44844001
+20407d73
+18007e00
+2841fe01
+7d20fe05
+79207e03
+67e08031
+70095b03
+20407871
+18007e00
+7920fe04
+67e0804d
+58000000
+79207e01
+67e08032
+7834fc00
+20400a32
+7854fc00
+18000e03
+6fe140c1
+20407d66
+20200845
+4484c001
+6fe341dd
+67e30041
+2841fe01
+2020888b
+20200845
+d8a00a01
+df200008
+20407d17
+70095b04
+20407871
+20200845
+c61a0000
+c68e0000
+18000e01
+20407d74
+7d3a001c
+243a0898
+20600000
+44854001
+684940c3
+18000e04
+20400f44
+20740000
+204010fa
+18004800
+20618000
+793f800b
+793f8000
+1c40c201
+280ffe1e
+7920c802
+2c200400
+242088c1
+4485c001
+6fe08012
+1fe0fe01
+67e08012
+2040112e
+20401128
+20401148
+2040133e
+20401343
+20401351
+20400e80
+204008b4
+2020089f
+44864001
+6fe0808b
+1fe0ffff
+67e0808b
+20610000
+70008b1f
+6fe0808d
+1fe0ffff
+67e0808d
+20610000
+7940001e
+70008dff
+20600000
+4486c001
+2040112e
+20401122
+20401148
+20401348
+204012d3
+204012f9
+202c08cb
+204008b4
+202008a2
+44874001
+2040127d
+20401359
+20400d47
+793f8001
+c6858000
+6fe08013
+1fe0fe01
+67e08013
+20600000
+4487c001
+7834fc00
+78387c00
+6fe140bd
+203a08dd
+18000e08
+20407d74
+247a0000
+44884002
+684940bf
+18000e28
+20400f44
+20340916
+18000e03
+20407d74
+243a08f2
+6fe0804d
+c28208e8
+202008eb
+d8a00a01
+df200008
+20407d17
+4488c002
+70003100
+20405382
+70478b00
+70095b13
+20407871
+20200916
+44894002
+18001600
+34730200
+6fe080a9
+1fe0ffff
+9c42fe00
+2fe00600
+242088f2
+18827e00
+67e080e6
+18004c00
+18004800
+4489c002
+20218916
+20401132
+69610157
+34730200
+448a4002
+6fe200a9
+98004200
+1fe0fe01
+67e200a9
+280ffe0c
+7920c802
+2c200400
+2420892a
+6fe0800c
+1fe0fe01
+67e0800c
+20401128
+2040133e
+20401343
+20401351
+20400e80
+2040091c
+202008fe
+448ac002
+7854fc00
+6fe140bd
+207a0000
+18000e08
+20207d66
+448b4002
+6fe0808c
+1fe0ffff
+67e0808c
+20610000
+70008c1f
+6fe080a7
+1fe0ffff
+67e080a7
+20610000
+7940000c
+6fe0c0ae
+67e080a7
+20600000
+448bc002
+20401122
+20401348
+204012d3
+204012f9
+202c0932
+2040091c
+20200903
+20400e80
+6fe0800d
+1fe0fe01
+67e0800d
+18003600
+6fe200a9
+448c4003
+2040133c
+20401132
+1cc0cc01
+1c2143fd
+1c8149fc
+20401128
+2040133e
+20401343
+20401351
+1c427e00
+67e200b1
+18000800
+18000202
+20401359
+20400f8e
+448cc003
+2040133a
+1c21c202
+1c8149fc
+20401122
+20401348
+204012d3
+204012f9
+204c0e80
+202c0957
+6fe08010
+203a08fe
+1fe0ffff
+67e08010
+20200938
+448d4003
+6fe0800e
+1fe0fe01
+67e0800e
+20400c46
+79200033
+20400b01
+202c0963
+793f8033
+20400c66
+243a095c
+202008fe
+448dc003
+793f8033
+6fe08031
+793ffe03
+67e08031
+20400c51
+7854fc00
+20600000
+448e4003
+7834fc00
+78387c00
+204009e5
+20740000
+2040133c
+1c40c201
+20401138
+18004803
+20406579
+20400c9a
+20401128
+2040133e
+20401343
+20401351
+20400f8a
+448ec003
+20405394
+20400af3
+24368984
+20401376
+20400f50
+6fe0800f
+1fe0fe01
+67e0800f
+448f4003
+20406561
+2040098f
+24748000
+20400f20
+243a098c
+7854fc00
+20600000
+20400c9a
+20400ae9
+2020097b
+20368992
+2040136d
+202109a0
+204009ab
+243409a0
+6fe0804d
+c4020000
+c3818000
+6fe0804c
+c3818000
+204009b2
+247a0000
+6fe080be
+1fe0ffff
+67e080be
+247a0000
+202056f7
+448fc003
+20400c6e
+7854fc00
+6fe0804d
+c28209a6
+20600000
+6fe0804d
+c3818000
+d8a00a01
+df200008
+20207d17
+44904004
+78347c00
+6fe0804c
+c4018000
+204009b2
+247a0000
+20207e56
+6fe08073
+1fe0ffff
+67e08073
+20600000
+4490c004
+6fe08031
+c28389bf
+6fe08877
+203a09bf
+70087700
+70095b18
+20407871
+202009bf
+44914004
+20400a63
+6fe08031
+79207e07
+67e08031
+7041ca01
+6fe08056
+c08b09c7
+20600000
+70087701
+6fe08031
+793ffe07
+67e08031
+20600000
+4491c004
+78547c00
+6fe10033
+d840ffff
+98467c00
+24628000
+6fe20035
+203809d7
+9d067e00
+202009d8
+9c467e00
+1fe67c04
+24610000
+18007e00
+67e10033
+20207e54
+1fe20400
+604a0035
+44924004
+70464201
+5800ffff
+67e10033
+70007401
+20600000
+4492c004
+204009cd
+24740000
+78547c00
+70001120
+793f800b
+793f8031
+2040133c
+20400af5
+c50589fa
+20400c66
+243a09ec
+c5188a04
+44934004
+78547c00
+1c427e00
+67e240d1
+78387c00
+7834fc00
+70095b2a
+20207871
+4493c004
+2040133a
+d8200010
+20400aeb
+79200031
+793f800b
+6fe08078
+98000800
+70001102
+202009ec
+6fe200b5
+1fe0fe08
+67e200b5
+78587c00
+7854fc00
+20401039
+20400c46
+44944005
+20400c8d
+20368a11
+20400c66
+243a0a0b
+202009f2
+6fe08032
+793ffe01
+67e08032
+20401376
+20401061
+78347c00
+70095b2b
+20207871
+4494c005
+79200009
+1a227e00
+67e1001f
+18007258
+d8a00287
+1a208c01
+efe08006
+1a220c00
+c2807d5f
+d8a00031
+20407d5f
+78577c00
+6fe08078
+98000800
+70008901
+20348a2b
+70008901
+6fe08031
+c4008000
+6fe08074
+67e08089
+6fe08075
+67e0808a
+20600000
+44954005
+6fe1001f
+98000a00
+18007258
+d8c00287
+203b7d5f
+d8c00031
+20207d5f
+df200001
+68488015
+18408401
+2841fe01
+24208a40
+d8400000
+60488015
+184ffe58
+da204040
+9a20a200
+efe08011
+c2808a48
+c3800000
+c3818000
+c2000a3c
+20600000
+4495c005
+da600a79
+20400a70
+24628000
+1a227e00
+67e1001f
+18007c00
+20600000
+20400f4d
+20208a5a
+6fe1001f
+1fe08a17
+6fe08048
+e7e08005
+da600ab9
+20200a70
+6fe08048
+2feffe03
+20208a5f
+18007c01
+20600000
+18007c00
+20600000
+da600ab6
+20200a70
+6849001f
+da600ade
+20200a70
+6848c1dc
+da600a84
+20200a70
+44964005
+684b41dd
+da600a7d
+20200a70
+da600a8a
+20200a70
+da600ad5
+4496c005
+da204040
+df200001
+efe08011
+1a627a00
+1a20a258
+c2000a73
+18007c01
+20600000
+c2800a75
+c2818a75
+18007c00
+20600000
+c2818a7f
+c3000a75
+1a208c10
+efe30006
+98467c00
+20628000
+20200a75
+c3000a75
+1a208c16
+efe08006
+98467c00
+20628000
+20200a75
+c3008a75
+20400ac2
+20400aa6
+98467e00
+1fe0fe01
+20210aa0
+18c22400
+67e48964
+6fe0c6ba
+243a0a98
+6fe48964
+1a420c00
+1fe0fe05
+20200a9b
+6fe48964
+1a420c00
+1fe0fe14
+24210a75
+18424200
+20400ace
+18007c00
+20600000
+98002400
+1a208c02
+efe10006
+203a0a9c
+20400ace
+20200a8b
+1ff11600
+196c9600
+20228ab0
+29601e0f
+24608000
+18511600
+196c9600
+24628000
+7920041c
+20600000
+18511600
+196c9600
+29601e0f
+24608000
+79207e1c
+20600000
+c3000a75
+18007c00
+20600000
+c3000a75
+1a208c01
+efe08006
+c2800a75
+1a208c17
+efe08006
+c3018a75
+18007c00
+20600000
+1a208c01
+e8408006
+1c427e00
+284ffe01
+1a208c04
+e8420006
+20608000
+1a208c08
+efe30006
+20401077
+1d027e00
+20600000
+1a208c02
+1a208a04
+efe10006
+98409600
+19627e00
+e7e20005
+20201705
+c3008a75
+20400ac2
+9b60fe00
+9b60fe00
+98e0fe00
+98467c00
+24210a75
+18007c00
+20600000
+c3000a75
+18427e00
+9a267c00
+203f0a75
+1a208c01
+efe08006
+c2800a75
+efe08011
+793ffe07
+e7e08011
+20200a75
+44974005
+2040133c
+1c40c201
+20401138
+18004803
+20401128
+2040133e
+20401343
+20401351
+20200f8a
+4497c005
+2040133a
+1c40c201
+20401138
+18004803
+20401122
+20400c3b
+204012d8
+20401348
+204012d3
+204012f9
+246c0000
+2040127d
+20200d44
+44984006
+6fe080e6
+98000800
+18000201
+20400ae9
+20200af3
+c61a0000
+6fe0c09b
+c4000000
+18000e04
+20407d74
+247a0000
+684940b5
+18000e04
+20400f44
+20740000
+20400b18
+18000e04
+6fe140b7
+242c7d66
+180a7e00
+9ea17e00
+20207d66
+4498c006
+7000e600
+78587c00
+78577c00
+204010fa
+1c4143fc
+18004801
+2040112e
+20401122
+7940001d
+6fe08006
+1fe0fe01
+67e08006
+20401148
+204012d3
+20401300
+246c0000
+44994006
+18003600
+2040114f
+6fe08007
+1fe0fe01
+67e08007
+2040112e
+2040133a
+1c21c202
+18004801
+20401128
+20401148
+2040133e
+2040134c
+1c427e00
+67e200b1
+20401351
+18000202
+18000800
+20401359
+20400f8e
+20400b42
+1c2143fd
+1cc0cc01
+20600000
+4499c006
+6fe0c0d8
+207a0000
+d8a000f1
+6fe0c5fc
+1fe27200
+1fe0fe01
+e7e08005
+18a20400
+1fe0fe01
+67e141e6
+18420a00
+58000009
+e7e08005
+d8c045fd
+20407d5f
+da604678
+df200004
+20400b64
+da604662
+df200001
+20400b64
+1800020a
+7041e502
+580000f1
+67e100bf
+2040133a
+20401128
+2040133e
+2040134c
+20401351
+20401359
+20400f8e
+20600000
+18a20400
+1a620c00
+efe08006
+207a0000
+1fe3fe00
+c2000b68
+1fe22200
+1fe0fe02
+1fe20e00
+6fe141e6
+98e0fe00
+67e141e6
+18420a00
+1a227e00
+1fe0fe01
+e7e08005
+1a620c00
+efe08006
+efe08006
+e7e08005
+1a227200
+20207d5f
+c61a0000
+6fe0c09b
+c4008000
+18000e05
+20407d74
+247a0000
+684940b9
+18000e28
+20400f44
+20740000
+18000800
+70001008
+793f800b
+20400b8b
+18000e05
+6fe140bb
+20207d66
+449a4006
+78587c00
+204010fa
+6fe08008
+1fe0fe01
+67e08008
+18004c00
+20401138
+1c40c201
+18004802
+449ac006
+20401122
+204012d3
+20401300
+246c0000
+2040114f
+6fe08009
+1fe0fe01
+67e08009
+18003600
+2040133a
+1c21c202
+18004801
+20401128
+2040133e
+2040134c
+20401351
+20400e80
+18000800
+69610157
+35330200
+1d01d003
+1c2143fd
+449b4006
+1cc0cc01
+20401122
+204012d3
+204012f3
+242c0bb5
+20401359
+20400d47
+c5058bbc
+449bc006
+6fe08010
+207a0000
+1fe0ffff
+67e08010
+2040133c
+20200bac
+449c4007
+793fd001
+79205000
+6fe0800a
+1fe0fe01
+67e0800a
+2040133a
+1c21c202
+20401128
+2040133e
+2040134c
+20401351
+20400e80
+2d000603
+20208bcd
+37cb8200
+20200bc9
+6fe200b5
+1fe1fe03
+1fe25000
+449cc007
+6fe300c8
+67e30041
+20400c46
+20400c8d
+20368bd9
+20400c66
+243a0bd4
+20600000
+449d4007
+20400c51
+20400a4a
+24628000
+70003200
+20401061
+20200a32
+449dc007
+20401073
+20400c05
+20740000
+449e4007
+20406561
+20400d3c
+24368bf4
+6fe14477
+20407e05
+20401376
+20406579
+20400c9a
+20400f7f
+20400f50
+20405394
+6fe0800b
+1fe0fe01
+67e0800b
+20401061
+449ec007
+20401527
+2040136d
+20210bfd
+204009ab
+24340bfd
+20400f20
+243a0be4
+20600000
+449f4007
+700a5100
+7000e400
+20400c6e
+793f8011
+20407e1d
+6fe08031
+20600000
+204009cd
+24740000
+18820400
+2040135d
+67e080e6
+18420800
+70001120
+449fc007
+2040133c
+18000202
+20400f77
+1c427e00
+67e200b1
+20400f8a
+2040133a
+7837fc00
+20400d1d
+202c0c1e
+2040114f
+20400c66
+243a0c0c
+c6820000
+70007d34
+79200003
+20600000
+78387c00
+20400c46
+204010fa
+44a04008
+20400b01
+202c0c2a
+20400c66
+243a0c21
+78587c00
+1d027e00
+67e240d1
+20600000
+7834fc00
+c5820c30
+793f8004
+70007d03
+70007e33
+20405a1d
+18827e00
+67e08078
+18007e00
+67e30039
+6fe08032
+79207e01
+67e08032
+20401376
+7854fc00
+78347c00
+20600000
+44a0c008
+7856fc00
+793f8005
+793f800a
+793f8010
+793f800f
+6fe08048
+793ffe05
+79207e04
+67e08048
+20600000
+44a14008
+70001120
+70004850
+6fe140c6
+67e1003f
+1c427e00
+67e240d1
+20780000
+1d027e00
+67e240d1
+20600000
+44a1c008
+20405390
+20400c6a
+67e08047
+58000000
+67e1030e
+58001c80
+67e10052
+6fe08031
+79207e00
+67e08031
+70004c00
+70004d00
+70009e00
+20201376
+44a24008
+18007e00
+67e441cb
+e7e40005
+204009c9
+20200a63
+6fe08011
+1fe0ffff
+67e08011
+20600000
+6fe0c0d6
+1fe0fe01
+67e0c0d6
+20600000
+44a2c008
+6fe0c1db
+c0018c73
+6fe08049
+c0808c77
+20404d88
+24228c77
+204009a8
+7041db00
+44a34008
+204031cc
+20400f16
+70095b02
+20407871
+20405382
+20404dc8
+20406ecc
+6fe08031
+793ffe00
+67e08031
+70478b00
+6fe0804d
+2fe18000
+20208c87
+793f8001
+6fe08048
+c3018c89
+6fe0804c
+c4030000
+793f8002
+20600000
+44a3c008
+6fe080c4
+207a0000
+1fe20800
+20400d3c
+24768000
+18000200
+20400f7f
+18827e00
+67e08078
+18007e00
+67e080c4
+20600000
+44a44009
+6fe08031
+c3010ca7
+18000207
+c5838ca6
+20400f4d
+24208ca7
+20370ca7
+20400ce8
+58000002
+67e140cf
+20600000
+24770000
+44a4c009
+20400a52
+24228cb8
+6fe08048
+c3018cc1
+c5028cc5
+6fe080e4
+c2830ccb
+6fe140cf
+1fe0ffff
+67e140cf
+203a0cb6
+6fe0c0cc
+98000200
+20600000
+44a54009
+20400ebb
+20400f4d
+20208cc1
+204056fb
+20340ccf
+6fe0804c
+c2830cdb
+c5028cc5
+6fe080e4
+c2830ccb
+18000201
+20748000
+18000200
+20600000
+44a5c009
+6fe0801a
+98000200
+c1808000
+18000200
+20600000
+6fe08a58
+1fe1020f
+79200005
+20600000
+18000213
+20400ce8
+20400de1
+207a0000
+7041e403
+6fe0838a
+1fe17ff8
+1fe97e00
+67e146b2
+1fe22200
+da60038b
+20206c9b
+20400cf1
+20400ce8
+20400de1
+207a0000
+6fe0c1e5
+1fe17e03
+67e0c1e4
+6fe141e6
+1fe22200
+67e146b2
+6fe100bf
+1fe22600
+20206c9b
+44a64009
+68488048
+79200403
+60488048
+18227e00
+67e0c0cc
+5800ffff
+67e140cf
+20600000
+44a6c009
+6fe0804d
+2feffe05
+6fe141e6
+20208d07
+18000203
+1fe67c11
+20610000
+18000204
+1fe67c1b
+20610000
+1800020a
+1fe67c79
+20610000
+1800020b
+1fe67cb7
+20610000
+1800020e
+1fe67ce0
+20610000
+1800020f
+20600000
+18000203
+1fe67c11
+20610000
+18000204
+1fe67c36
+20610000
+1800020a
+d840016f
+98467c00
+24610000
+1800020e
+d84002a7
+98467c00
+24610000
+1800020f
+20600000
+6fe08031
+c3008d1c
+6fe10033
+203a0d1c
+24370d1e
+2040133c
+1d00c201
+78287c00
+6fe1003f
+1fe37e00
+6849015d
+9840fe00
+20401311
+20401140
+18004803
+20401122
+20400c3b
+204012d8
+44a74009
+6fe1003f
+1fe37e00
+20401311
+204012d3
+7826fc00
+6fe1003f
+6849015b
+9840b600
+37c18400
+1b420400
+604b0098
+7846fc00
+246c0000
+6fe1015b
+1fe25200
+1c225000
+20359473
+20600000
+44a7c009
+20400d17
+242c114f
+2040127d
+c5888d44
+6fe109f6
+1fe0fe01
+67e109f6
+20404caf
+1c230400
+18419c40
+44a8400a
+7823fc00
+78257c00
+7825fc00
+09800003
+198cfe00
+67e080ad
+09800004
+08008007
+19827e00
+67e0801a
+09800003
+198cfe00
+67e080ae
+6fe0801a
+1fe67c03
+20210d5c
+c0038d5c
+6fe0804d
+2feffe05
+7920aa01
+44a8c00a
+09800008
+7845fc00
+78457c00
+20230e63
+c5888d65
+6fe109f8
+1fe0fe01
+67e109f8
+44a9400a
+6fe080ad
+2fe00e00
+7920800a
+20208d73
+a8800e00
+20208d71
+c5838e80
+6fe08048
+793ffe05
+79207e04
+67e08048
+20404cb2
+7836fc00
+44a9c00a
+6fe0801a
+1fe20200
+c5050d82
+684880ae
+6fe08048
+793ffe00
+284ffe00
+7920fe00
+284ffe01
+7920fe01
+67e08048
+284c0001
+20208d82
+20400ebb
+44aa400a
+d8400000
+20401309
+18217e0f
+c0008d9e
+c0000e80
+c0010e8c
+684880ae
+6fe08048
+a8400800
+24208d90
+c5850d8f
+c3038d90
+7920000f
+44aac00a
+18227e00
+c0018da0
+c0020da4
+c0040da3
+d8400004
+20401309
+c0050d9f
+c0058da2
+d8400008
+20401309
+c0070d9f
+c0078da2
+20600000
+20200e80
+79200010
+78267c00
+20200da5
+79200010
+79202a02
+7826fc00
+44ab400a
+c5198e80
+c5008e80
+2aac0001
+20208db2
+7843fc00
+7826fc00
+78467c00
+1c409602
+34530400
+242c0e6f
+79200010
+7823fc00
+44abc00a
+78277c00
+7824fc00
+09800003
+198cfe00
+67e080e5
+09800005
+c5080dbd
+19897200
+1f297200
+20200dc0
+09800005
+19837200
+09800003
+44ac400b
+1f227e00
+67e100af
+203a0dd8
+20400de1
+203a0dc8
+1f20f204
+1f227e00
+9ea67c00
+20210e6f
+44acc00b
+793f8000
+6fe080e5
+1fe17e03
+d8a000cf
+c0018de6
+c5088dd6
+6fe080e5
+1fe17e03
+c0010deb
+c0008dff
+20200e6f
+d8a01000
+20200e10
+20400de1
+203a0e14
+58000000
+67e146b2
+09800020
+1fef7e00
+1fecfe00
+67e20273
+20200e14
+6fe0804d
+c3017e60
+6fe0c645
+c0817e60
+20207e5e
+6fe100af
+1fe67c11
+24210e6f
+c5078e50
+20200e10
+44ad400b
+c5078e50
+6fe100af
+d84002e0
+98467c00
+20210e6f
+6fe08314
+c3000df5
+c3008dfa
+20200e80
+70031201
+6fe1030e
+c0800e80
+d8a01000
+20200e10
+70031202
+6fe10310
+c0800e80
+d8a01400
+20200e10
+44adc00b
+c5078e50
+6fe100af
+d84002e0
+98467c00
+20210e6f
+6fe08312
+c0008e09
+c0010e0d
+20200e80
+d8a01000
+6fe1030e
+98a08a00
+20200e10
+d8a01400
+6fe10310
+98a08a00
+09800008
+19897e00
+e7e08005
+c2000e10
+44ae400b
+09800010
+20230e69
+20400de1
+20407e58
+245a6ccc
+24360e70
+20404cae
+6fe0c5f3
+c0008e70
+c5088e3d
+c5078e7d
+6fe080e5
+2fe00603
+20208e3d
+6fe100af
+203a0e3d
+44aec00b
+6fe08312
+c0008e2a
+c0010e34
+2020137a
+6fe1030e
+684900af
+9840fe00
+67e1030e
+207a0000
+68491000
+18408404
+98467c00
+20428f6f
+20200e3d
+6fe10310
+684900af
+9840fe00
+67e10310
+207a0000
+68491400
+18408404
+98467c00
+20428f73
+44af400b
+6848804d
+6fe080e5
+2fe00603
+79208406
+7d208407
+6048804d
+24208e46
+79200001
+c5888e50
+284ffe06
+20208e50
+6fe109fa
+1fe0fe01
+67e109fa
+79200005
+793f8407
+793f8001
+6048804d
+44afc00b
+20400de1
+245a6cf3
+684880ae
+6fe08048
+79207e05
+284ffe02
+7920fe02
+280ffe0a
+7920fe07
+67e08048
+6fe100af
+243a0e80
+6fe0804d
+793ffe07
+67e0804d
+6fe080e5
+2fe00e01
+20200e80
+44b0400c
+7856fc00
+6fe1001b
+1fe0fe01
+67e1001b
+20200e80
+6fe1001d
+1fe0fe01
+67e1001d
+20400e71
+c5888e6f
+79200005
+20200e80
+20200e69
+44b0c00c
+6fe080e5
+2fe00603
+24208e79
+6848804d
+793f8406
+6048804d
+20600000
+6848804d
+793f8407
+6048804d
+20600000
+6fe08048
+79207e05
+67e08048
+44b1400c
+784efc00
+784e7c00
+7846fc00
+78467c00
+7844fc00
+78477c00
+7843fc00
+2030914f
+37d38200
+20000064
+2020114f
+44b1c00c
+7824fc00
+78267c00
+09800048
+2feffe3a
+79208000
+1c020400
+57e04000
+57e03c00
+782afc00
+380bffff
+380cffff
+20000020
+29a80000
+1d827e00
+67e180c8
+1da27e00
+67e080cb
+18424000
+20208ea1
+20200e6f
+44b2400c
+09800048
+57e03e00
+57e00800
+57e05c00
+57e02400
+18007e00
+09800010
+20230e6f
+20404cae
+5ffffffc
+9a417e00
+67e200b5
+1ba27e00
+67e180c5
+1b827e00
+67e080c3
+18827e00
+67e080c4
+1dc27e00
+67e100cc
+1c227e00
+08008220
+28201e02
+7920800b
+20200e80
+44b2c00c
+6fe08048
+c4018000
+793ffe03
+79407e06
+67e08048
+20400de1
+245a6cb9
+6fe0c0cc
+c0098ed2
+c1038000
+6fe0804c
+c4030000
+793ffe06
+79207e07
+67e0804c
+793f8002
+6fe144d6
+247a0000
+6fe0804c
+793ffe07
+67e0804c
+202052e0
+44b3400c
+6fe0c5f6
+1fe37e00
+c0088ee5
+c0090eef
+c00c0f16
+c03f8edd
+c1818000
+6fe0838c
+c0088ee0
+20600000
+6fe0838c
+79207e07
+20600000
+20748000
+6fe08031
+c3820000
+70007d31
+20600000
+44b3c00c
+6fe0804d
+79207e02
+67e0804d
+70801101
+18007e00
+67e2c6a1
+79207e25
+67e2c69c
+20600000
+44b4400d
+6fe0804d
+793ffe02
+67e0804d
+70801100
+20600000
+44b4c00d
+1c40a203
+20348ef9
+1d00a203
+68490033
+1a227e00
+793ffe1b
+9846fc00
+6fe10076
+20407def
+18072600
+9a667e00
+20210f03
+9840fe00
+9a20fe00
+67e20035
+70464200
+6fe08031
+79207e01
+67e08031
+6fe08074
+67e08089
+58000000
+67e1c16e
+67e1c171
+67e0c15e
+70095b0b
+20407871
+6fe140c8
+67e1003f
+24748000
+18808fff
+20600000
+44b5400d
+6fe08031
+c4008000
+793ffe01
+67e08031
+6fe140c6
+67e1003f
+7855fc00
+70095b0c
+20207871
+44b5c00d
+78377c00
+6fe08031
+c2808f2d
+c6088000
+6fe08048
+c3818000
+6fe08049
+247a0000
+6fe0804c
+c3830000
+18007e00
+20600000
+c3010f37
+6fe08089
+c0010f33
+6fe08048
+c2818f40
+c5840f40
+24348f40
+6fe08049
+243a0f40
+20200f2b
+6fe08089
+c0808f40
+6fe0808a
+203a0f40
+1fe0ffff
+67e0808a
+6fe08048
+c3818000
+24768000
+6fe08089
+1fe0ffff
+67e08089
+20600000
+44b6400d
+78487c00
+18423600
+20400a6f
+78547c00
+24628000
+18003600
+78347c00
+20600000
+6fe0c15d
+a881fe00
+20600000
+44b6c00d
+793f8001
+70031b00
+6fe08314
+207a0000
+2feffe00
+d8c01000
+2040cdd6
+44b7400d
+6fe0831b
+c0008f63
+70031b00
+6fe08314
+c4008000
+d8c01400
+20404dd6
+6fe0831b
+c0008f69
+20600000
+6fe08314
+793ffe00
+67e08314
+58000000
+67e1030e
+20600000
+6fe08314
+793ffe01
+67e08314
+58000000
+67e10310
+20600000
+6fe08314
+79207e00
+67e08314
+20600000
+6fe08314
+79207e01
+67e08314
+20600000
+44b7c00d
+1d00c201
+20401140
+18004803
+20401128
+2040133e
+2040134c
+20201351
+44b8400e
+2040133a
+1d027e00
+684a40d1
+98467e00
+c1808000
+28203e00
+24208f89
+6fe0801a
+207a0000
+20400f77
+28203e10
+20208e80
+1c230400
+18419c40
+44b8c00e
+7823fc00
+78257c00
+782dfc00
+793f8010
+18827e00
+08008603
+18227e00
+08008604
+6fe08048
+08008004
+08008603
+78247c00
+08008608
+784dfc00
+78447c00
+78457c00
+793faa02
+d8400000
+20401309
+44b9400e
+18217e1f
+c0098fd2
+c0000e80
+c0008e80
+c0010fb3
+c0018fe1
+c0020fe7
+c0040fe6
+d8400004
+20401309
+c0050fe3
+c0058fe9
+d8400008
+20401309
+c0078fe9
+20200fe3
+44b9c00e
+6fe080e6
+1fe20800
+6fe0808e
+1fe23800
+6fe1c0b2
+1fe23a00
+6fe140ac
+1fe25c00
+7824fc00
+782e7c00
+1c022200
+20401138
+782afc00
+20000020
+1c221600
+6fe200b1
+1fe24200
+53c07e00
+79207e3a
+08008648
+53e07e00
+08008648
+19624200
+1a224000
+78247c00
+08008610
+78447c00
+20200e80
+78477c00
+20200fd6
+44ba400e
+20400de1
+243a0fd0
+78277c00
+7824fc00
+782e7c00
+6fe0838a
+1fe105f8
+d8c0038a
+18408408
+18497200
+efe08006
+08008608
+c2000fdd
+20201013
+782e7c00
+20200fec
+782e7c00
+79200010
+20200fec
+79202a02
+782efc00
+20200fec
+79202a02
+782efc00
+79200010
+44bac00e
+6fe0804d
+c3029001
+18267c03
+20211001
+78477c00
+784e7c00
+782efc00
+7843fc00
+79202a01
+2aaffe02
+20208ffb
+580abeee
+08008614
+20200fff
+585faeba
+08008618
+58000012
+08008606
+7823fc00
+79200010
+78277c00
+7824fc00
+c5029021
+6fe0c1e5
+08008603
+6fe141e6
+98007200
+c508100b
+08008605
+2020100c
+0800860d
+1f227e00
+203a1013
+6fe100bf
+98000c00
+efe08006
+08008608
+c2001010
+44bb400e
+20400de1
+203a1018
+6fe2026f
+08008620
+78247c00
+08008610
+78447c00
+20400ce8
+6fe0804d
+c3028e80
+18007e00
+08008606
+20200e80
+44bbc00e
+c5081029
+6fe080e5
+08008603
+6fe080af
+98002600
+08008605
+2020102e
+6fe080e5
+08008603
+6fe100af
+98002600
+0800860d
+d8c01000
+1a627c00
+20229035
+efe08006
+08008608
+1a60a7ff
+2020102f
+6fe109fc
+1fe0fe01
+67e109fc
+20201013
+6fe200b5
+1fe0a207
+6fe100c1
+243a103f
+1a20a3fd
+20201047
+1feffe0c
+68590040
+18408401
+98467e00
+24211046
+1a20a3ff
+20201042
+1fe67e00
+37d18200
+2c400600
+24209047
+98005200
+1a225000
+98005200
+20600000
+44bc400f
+37d10200
+1b427e00
+98000c00
+1ff17e00
+9c467200
+1f217203
+24229058
+18007e00
+2020105c
+68490163
+18007e00
+9840fe00
+c200105a
+98c0fe00
+1fe6fc0c
+20407dec
+67e100c1
+20600000
+44bcc00f
+1b427e00
+1b220400
+98467c00
+7d217e2c
+98460400
+6fe10163
+284c000f
+2020906f
+18426000
+d8410000
+6fe10163
+98467e00
+9e008400
+604b028f
+207b0000
+604b0039
+20600000
+78587c00
+6fe3028f
+203b1077
+6fe30039
+9b20e000
+1e00e00a
+6fe10163
+9e067e00
+2fec000f
+20209083
+58010000
+6b010163
+9b067e00
+9e00e000
+1e023400
+20600000
+18007c00
+20201081
+203b10ad
+58402c17
+67e189ee
+19317e00
+1fe90400
+df200030
+58000000
+67e189f1
+18437e00
+9842fe00
+1fe17e03
+c3009092
+1fe0ffff
+d8a009f1
+98a08a00
+efe08005
+1fe0fe01
+e7e08005
+18430400
+c200108d
+da2009f3
+da4009ee
+da600000
+df200003
+efe08011
+e8408012
+984ffe00
+9a60a600
+1a20a3ff
+1a40a401
+c200109d
+6fe089ef
+1fed7e00
+1ff27e00
+9a66fc00
+20407def
+1807fe00
+67f10938
+67e109f4
+20600000
+6fe109f4
+67f10938
+20600000
+58402d19
+67e189ee
+192f7e00
+1fe90400
+df200020
+2020108b
+44bd400f
+20401161
+1c227e00
+1fe17f80
+2c800e03
+242090bf
+1fe97e00
+9ae0fe00
+202010c0
+1ae27e00
+1fe6fc4f
+782afc00
+20407def
+18072200
+1a2085d8
+202110c8
+1a238400
+202010ca
+18438400
+18408401
+44bdc00f
+6fe08032
+c30190db
+6fe240d9
+9c267c00
+202110db
+204010fa
+6fe0c0e0
+207a0000
+6fe08032
+79207e02
+67e08032
+6fe2c0ee
+67e2c0e1
+efe28006
+67e2c0e6
+204010ff
+6fe08032
+c4010000
+2c2ffe01
+202090f7
+18492200
+18410e07
+580040e1
+9a20a200
+efe08011
+afec0000
+202090e8
+18427e00
+202010f4
+6fe0c0eb
+98002400
+1c227e00
+1fe17f80
+1fe97e00
+9ae0fe00
+9a46fc00
+580040f9
+20407def
+18072200
+9a208c00
+efe08006
+67e0c0ec
+98000400
+20600000
+6fe0c0ec
+98000400
+20600000
+6fe08032
+793ffe02
+793ffe03
+67e08032
+20600000
+44be400f
+d8a040f9
+1800720a
+20407d17
+d8a040f9
+18002600
+18000e02
+6fe2c0e1
+98000400
+28e1fe02
+2020910b
+18430400
+284c0000
+2020910f
+1a627e00
+e7e08005
+184b0400
+1a60a602
+2a61fc28
+24209118
+6fe2c0e6
+98000400
+28e1fe02
+20209118
+18430400
+1a667c4e
+2021110b
+18002601
+18e08fff
+24229106
+da2040f9
+18a27e00
+9a267e00
+67e0c0eb
+20600000
+44bec00f
+204010b6
+6fe080e4
+c3029127
+684883a0
+2020118f
+44bf400f
+204010b6
+6fe080e4
+c302112d
+6848839f
+20201205
+18005a00
+6fe1c0af
+98005800
+20600000
+44bfc00f
+6fe0c1e0
+1fe25a00
+6fe1c1dd
+1fe25800
+20600000
+44c04010
+6fe140ac
+1fe25c00
+6fe0c0ab
+1fe25a00
+6fe1c0a8
+1fe25800
+20600000
+44c0c010
+6fe10045
+1fe25c00
+6fe08044
+1fe25a00
+6fe18041
+1fe25800
+20600000
+c510114b
+c68e8000
+c68f8000
+1d815900
+782afc00
+20000020
+20600000
+44c14010
+20404cad
+18002a08
+18002a00
+7850fc00
+78507c00
+782f7c00
+70890005
+20000002
+70890000
+20401161
+708a1600
+708a0a10
+6ff08a09
+793ffe07
+67f08a09
+708a0b00
+2020129c
+44c1c010
+70890005
+20000002
+70890000
+6fe0c0c5
+c00c1168
+c004117d
+708a10aa
+708a11aa
+708a1215
+708a0a78
+6ff08a09
+79207e07
+67f08a09
+708a0b04
+2000003c
+708a167a
+708a1700
+708a1800
+708a1900
+708a1a00
+708a112a
+708a0a78
+6ff08a09
+793ffe07
+67f08a09
+708a4300
+20600000
+708a8be6
+708a10aa
+708a11aa
+708a1215
+708a0a78
+6ff08a09
+79207e07
+67f08a09
+708a0b04
+2000003c
+708a163a
+708a1700
+708a1800
+708a1900
+708a1a00
+708a112a
+708a0a38
+20201178
+44c24010
+6fe0c0c5
+1fe67c18
+2042919a
+244291a0
+60488017
+1840fe00
+c5169198
+1840fe01
+204011c5
+20201085
+708a4300
+708a3d04
+708a3e00
+708a8403
+708a8940
+20600000
+708a4330
+708a3d06
+708a3e00
+708a8420
+708a8915
+20600000
+44c2c010
+20404ca7
+6fe0c1ea
+c07f91af
+d8c041eb
+98c08c00
+efe08006
+67f08961
+70896027
+6848c1ee
+6ff08960
+9841fe00
+67f08960
+708a10aa
+708a112a
+708a1213
+708a0a7f
+6ff08a09
+793ffe07
+67f08a09
+2000003c
+708a171f
+708a18f8
+708a1918
+708a1000
+708a1120
+2000000a
+70890004
+20000002
+7089000c
+20600000
+44c34010
+d8c00960
+98c0fe00
+6848c0c5
+202011d4
+44c3c010
+6fe0c0c5
+1fe67c18
+204291f7
+244291fe
+58000960
+9a20fe00
+1fe3fe00
+6848c0c5
+184f8403
+18438400
+9846fc00
+20407def
+1807fe00
+67f08a3f
+18077e00
+1ff07e00
+1fed7e00
+9846fc00
+20407def
+1807fe00
+67f08a42
+1fecfe00
+67f08a41
+1fecfe00
+67f08a40
+68588a43
+184104f0
+60588a43
+2000000c
+6fe0c0c5
+c00c11eb
+c00411f1
+1841840c
+60588a43
+2000000c
+18418403
+60588a43
+20600000
+1841843c
+60588a43
+2000000c
+18418433
+60588a43
+20600000
+708a4300
+708a3d12
+708a3e00
+708a8403
+708a8ba6
+708a8940
+20600000
+708a4330
+708a3d15
+708a3e00
+708a8420
+708a8ba6
+708a8915
+20600000
+44c44011
+708a3d12
+60488017
+1840a202
+204011ca
+200003c0
+44c4c011
+708a10aa
+708a112a
+708a1210
+708a0a7f
+6ff08a09
+793ffe07
+67f08a09
+708a0b07
+2000003c
+708a190d
+708a1af9
+708a1000
+708a1120
+2000000a
+70890001
+20000002
+70890003
+44c54011
+6fe0c1e8
+c001922d
+c0029232
+c0031235
+c0039238
+c005123b
+c041923e
+c0429241
+c04a1244
+c04f1247
+708a396a
+708a3a07
+708a14a3
+708a1507
+20600000
+708a3966
+708a3a0b
+708a14aa
+708a150a
+20600000
+708a396c
+708a3a0d
+2020122f
+708a396b
+708a3a0f
+2020122f
+708a39a7
+708a3a0f
+2020122f
+708a39b6
+708a3a0f
+2020122f
+708a3968
+708a3a05
+2020122a
+708a3960
+708a3a05
+2020122a
+708a3953
+708a3a01
+2020122a
+708a394c
+708a3a00
+2020122a
+70804206
+6fe140ca
+c307124b
+98000c00
+d8408a00
+efe08006
+c07f9255
+98418a00
+efe08006
+e7e08005
+2020124f
+44c5c011
+708a8be6
+2040126a
+20401271
+20401277
+708a6d09
+708a0305
+708a7a94
+6fe0c0c5
+c0841260
+708a0834
+708a01ff
+20000064
+708a020e
+708a0003
+20401228
+708a9a2b
+708a9b13
+70804205
+7041f00c
+202016b2
+6fe0c4d1
+203a126f
+1fe1fe20
+67f08a87
+20600000
+708a8729
+20600000
+6fe0c4d2
+203a1275
+67f08a0d
+20600000
+708a0d00
+20600000
+6fe0c4d3
+203a127b
+67f08a6c
+20600000
+708a6cd3
+20600000
+44c64011
+70001920
+6ff089a0
+67e0c1e9
+1fe67cfc
+24610000
+1fe67c7f
+20610000
+6ff089a3
+1fe1040f
+18438400
+1ff1fe00
+98408400
+184f8403
+6fe0c1e9
+1fe67eff
+9840fe00
+1fe0fffb
+67e08019
+20600000
+6fe08019
+20401295
+67e08018
+20600000
+1fe17eff
+1fe6fc0a
+20407dec
+1ff27e00
+18070400
+9841fe00
+20600000
+6fe0c1ea
+c17f8000
+242c12c2
+6fe0c1e9
+1fe67cf0
+242112c6
+1fe67c7f
+202112c6
+6a308961
+6fe0c1ea
+c1000000
+d8c041eb
+98c08c00
+efe08006
+9a267c00
+24628000
+18c08dfe
+e8408006
+1851fe00
+1a31a400
+9a462400
+18417e0f
+1a21220f
+9a262200
+1a23fe00
+9a40a400
+1a4fa403
+6848c1e9
+18417e80
+207a0000
+58000100
+98460400
+1a427e00
+98467e00
+20610000
+1fe17eff
+c17f8000
+c17f0000
+6fe0c1ea
+c00092cb
+c00112cd
+202012cb
+6fe0c1ea
+c00012cd
+c00092c9
+7041ea02
+20600000
+7041ea00
+20600000
+7041ea01
+20600000
+58000f0f
+20201591
+5800080f
+20201591
+44c6c011
+78507c00
+7830fc00
+782b7c00
+202011a6
+44c74011
+20400de1
+243a12e8
+6fe0804d
+2feffe02
+7920fe00
+67f08011
+d8c00063
+efe48006
+98006400
+efe38006
+98006600
+6fe08055
+1fe0e9ff
+782d7c00
+20600000
+70801100
+20600000
+1b427e00
+67e30098
+7846fc00
+242c114f
+6fe1015b
+1fe25200
+1d00d001
+1d0151fc
+20600000
+7826fc00
+37cb8400
+202c12ea
+2d000402
+242092f4
+202012ea
+44c7c011
+69610159
+7826fc00
+34730400
+7846fc00
+242c114f
+20600000
+44c84012
+7826fc00
+37c18400
+7846fc00
+242c114f
+6fe1015b
+1fe25200
+1d0151fc
+20600000
+44c8c012
+98002200
+1c227e00
+98409600
+19627e00
+67e240d1
+1a227e00
+20600000
+1fe20400
+44c94012
+18427e00
+20407db1
+1c307e00
+79207e2c
+20407d97
+793ffe2c
+20401365
+20407d97
+20740000
+20407da4
+98003600
+37c18200
+20600000
+44c9c012
+20381325
+35330200
+1d020400
+20201328
+20371327
+34730200
+1c420400
+20341334
+28400601
+24209320
+44ca4012
+6fe08031
+c4000000
+6fe240d1
+98467e00
+24610000
+1fe67cff
+20211320
+20600000
+28400603
+24209320
+2020132b
+44cac012
+69610157
+20201320
+78547c00
+20201337
+78347c00
+20201337
+44cb4012
+204012d8
+7850fc00
+78307c00
+20600000
+44cbc012
+69610155
+34730200
+782b7c00
+20600000
+44cc4013
+6961015f
+34730200
+20600000
+44ccc013
+69610155
+35330200
+782b7c00
+20600000
+44cd4013
+20404cb5
+51207e00
+782efc00
+79202a00
+08008648
+784efc00
+20600000
+1ca20400
+18418460
+18421c00
+20600000
+44cdc013
+6fe0c098
+1fe0fe01
+c0839362
+18007e01
+67e0c098
+98000800
+20600000
+1b220400
+20748000
+1b420400
+20600000
+1c427e00
+20748000
+1d027e00
+20600000
+44ce4013
+684a004e
+20401369
+98461600
+19627e00
+68490052
+18438400
+98467e00
+20600000
+44cec013
+20401369
+67e2004e
+20600000
+44cf4013
+2020137a
+2020137c
+207a0000
+1fe37e00
+1fe0fffd
+1fe0ffff
+24229380
+18007e00
+20600000
+df200010
+d8a00000
+20407d17
+d8a00287
+df20000a
+20407d17
+70087400
+70095b00
+7002df00
+7000e400
+7003a500
+7000bd00
+700a5100
+700a5c00
+589e8b33
+67e1c0af
+70008e60
+7040d705
+70001402
+58000e43
+67e10155
+58000600
+67e10157
+58000600
+67e10159
+58000d00
+67e1015f
+580003bb
+67e1015b
+58000500
+67e1015d
+580007d0
+67e10161
+58000ea6
+67e10163
+580001e0
+67e10165
+58000120
+67e10167
+5800011a
+67e10169
+58001400
+67e143de
+58000100
+67e143e0
+20406dfb
+58000880
+d8a00870
+98a67200
+20407d26
+44cfc013
+20758000
+7045f709
+5800050e
+67e145f8
+58000008
+67e145fa
+7044cf7f
+58000024
+67e140b5
+67e140b9
+58000200
+67e140b7
+67e140bb
+58000020
+67e140c3
+67e140bf
+58002000
+67e140c1
+58000480
+67e140c6
+58000c00
+67e140c8
+58000c3f
+67e1417e
+58000333
+e7e10005
+5824109d
+67e1c183
+20407fdc
+58000000
+67e141e6
+1c437e00
+67e2409c
+20600000
+70804206
+70804201
+2000000a
+58001d4a
+67f10040
+20600000
+580013e4
+67e14463
+580013e4
+67e14465
+20600000
+6fe08031
+c30093ea
+7920000d
+6fe3416e
+67e345fd
+20600000
+6fe08a51
+c4010000
+6fe08a5c
+1fe0fe01
+67e08a5c
+c1828000
+700a5c00
+6fe08a51
+793ffe02
+67e08a51
+c281940b
+2feffe07
+2040fe19
+2440fe1d
+6fe08a58
+2fe06020
+6fe0804d
+7920fe05
+67e0804d
+6fe08a51
+684880e4
+2feffe04
+79208406
+2feffe06
+79208404
+79208405
+604880e4
+6fe08a54
+67e0839f
+6fe08a55
+67e083a0
+79200011
+20600000
+793f8011
+700a5100
+6fe08a5b
+67e080e4
+20207e1d
+5800ee21
+67f10050
+6ff2011c
+67e2098a
+6ff0813b
+67e08989
+6ff0813e
+c301db6a
+7835fc00
+c3039421
+7855fc00
+1ce27e00
+243a1421
+6ff0813b
+c2811421
+d85fffff
+202014b0
+6ff20134
+67f2004c
+6ff08135
+1fe17ee0
+67f0804d
+204015af
+6ff1813c
+67f1804c
+efe08006
+1fe1feef
+e7e08005
+2040159c
+6ff0804f
+79207e04
+67f0804f
+2040159c
+20559453
+6ff0804e
+793ffe03
+67f0804e
+2040159c
+2435db6a
+2040143b
+c6958000
+70800608
+20600000
+6fe1c4cc
+207a0000
+67e18a01
+20205c49
+6fe0c4d0
+c0009447
+c001144b
+c001944f
+6fe0c183
+1fe17ee0
+67e0c183
+20600000
+6fe0c183
+1fe17ee0
+1fe1fe1d
+20201445
+6fe0c183
+1fe17ee0
+1fe1fe1b
+20201445
+6fe0c183
+1fe17ee0
+1fe1fe17
+20201445
+6fe0c1a5
+67f08086
+d8c04186
+d8a08070
+20407d01
+6fe4419d
+98000000
+6ff40140
+67e4009f
+20205c05
+18027e00
+67e4419d
+d8c08070
+d8a04186
+20407d01
+6ff08086
+67e0c1a5
+202015b1
+6ff08085
+1ff1fe00
+243a146e
+6fe1c174
+247a0000
+6ff08085
+1fe1fec0
+67f08085
+70800680
+6ff0812d
+c4008000
+6ff18149
+67e1c174
+20600000
+44d04014
+1b427e00
+20407d95
+684a4164
+18467cff
+20610000
+1fed7e00
+1ff27e00
+9846fc00
+20407dec
+d84000c8
+20407dfa
+67e08097
+24341482
+1fe67e00
+6849c174
+9840fe00
+67e1c174
+58000000
+67e24164
+20600000
+6fe0c17c
+79207e02
+67e0c17c
+20201490
+d85fffff
+6fe0c17b
+793ffe07
+67e0c17b
+44d0c014
+204015b1
+6fe0c15c
+67e0c181
+6fe0c17f
+79207e07
+67e0c17f
+44d14014
+204012cf
+6fe24164
+9840fe00
+67e24164
+2040145d
+2040143f
+6fe24182
+1fe22400
+6fe2c17d
+67f2004c
+1fef2200
+37d98200
+1b227e00
+67e34168
+70800502
+37d98200
+37d98200
+1a227e00
+67f0804f
+70800502
+37d98200
+37d98200
+6252004c
+70800520
+37d98200
+37d98200
+605a004c
+70800510
+37df8200
+44d1c014
+58000000
+1ce27c00
+202294c0
+6ff0813c
+6858813d
+98467c00
+202114be
+18427e00
+9ce67e00
+1fe0fe01
+1fe0fe0a
+37d98200
+9e20fe00
+684a4160
+9840fe00
+6849c174
+984ffe00
+1fecfe00
+1ff1fe00
+1fe0fe6e
+68490163
+9846fc00
+20407dec
+1ff07e00
+18070400
+9841fe00
+684b4168
+20407d8a
+18423200
+6fe34048
+20401077
+1b427e00
+67e3095c
+1ce27e00
+e7e08005
+6ff0811d
+1fe1fef0
+e7e08005
+20600000
+44d24014
+20401465
+6fe1c174
+207a0000
+6fe0c099
+207a0000
+6fe0c764
+203a14e7
+6fe0c6b9
+207a0000
+6fe0c6ba
+247a0000
+c61a0000
+da600ab9
+20400a70
+20628000
+204015c2
+247a0000
+6fe0c040
+2fe00e03
+24209514
+6fe14042
+207a0000
+20758000
+44d2c014
+6848809e
+6fe14042
+984ffe00
+18518400
+184b0400
+98467e00
+684a4044
+9840fe00
+6848c15b
+98467e00
+1ff06000
+44d34014
+6fe1404e
+1fe37e00
+20407db1
+1e027e00
+20407d97
+1b420400
+20407d95
+20740000
+20407daa
+44d3c014
+6fe0c17d
+98467c00
+20211485
+604a4160
+20403143
+2040534e
+684a4160
+20201497
+44d44015
+6fe0c040
+c3800000
+c3818000
+6fe0c764
+203a151c
+6fe0c6b9
+207a0000
+6fe0c427
+243a1520
+6fe0c09b
+207a0000
+6fe14159
+207a0000
+6848c15b
+98467e00
+d8401d4c
+984ffe00
+2020150a
+44d4c015
+7855fc00
+6fe08031
+c4008000
+24369549
+20401544
+6fe140c8
+67e1003f
+6fe08048
+c2819557
+c5869557
+204052f7
+243a1557
+6fe0c643
+c2809557
+6fe14471
+20407e05
+243a1557
+70009e00
+c5869557
+6fe0c179
+203a155b
+1fe0ffff
+67e0c179
+20600000
+d8e00001
+202057e4
+d8e00001
+202057e8
+70415e00
+6fe1c16e
+1fe0fe01
+67e1c16e
+20600000
+44d54015
+684940c8
+18430400
+6fe1003f
+9840fe00
+67e1003f
+70009e00
+6fe1c171
+1fe0fe01
+67e1c171
+6fe0c15e
+1fe0fe01
+67e0c15e
+20600000
+70009e00
+6fe0c178
+67e0c179
+20600000
+6848c177
+6048809e
+20600000
+44d5c015
+6fe0c17d
+247a0000
+70804206
+58000f0c
+20401591
+58030d40
+2040137d
+37d98200
+1e226000
+204012cf
+70804204
+2000000a
+37d98200
+1e227e00
+9e067e00
+1fe0fe30
+d84000ff
+20407dfa
+67e0c17d
+20007530
+20007530
+20007530
+20600000
+6fe0c17d
+247a0000
+708044ff
+70804206
+204012cf
+580003e8
+9e20e000
+07e00000
+1e227e00
+20002ee0
+20002ee0
+20002ee0
+20002ee0
+20002ee0
+20002ee0
+20002ee0
+20002ee0
+20002ee0
+9e067e00
+1fe0fe30
+d84000ff
+20407dfa
+67e0c17d
+20007530
+20007530
+20007530
+20600000
+d8a00fff
+98a10a00
+6fe0c17a
+1fe17ef0
+1fed7e00
+98a1fe00
+67f1004c
+efe10006
+e7e10005
+58000001
+2020159d
+58000002
+37d98200
+67f08005
+37d98200
+37d98200
+20600000
+70418200
+6ff20134
+67f2004c
+6ff08134
+1fe17ec1
+67f0804c
+202015af
+7041823e
+6ff20134
+67f2004c
+6ff08134
+1fe1fe3e
+67f0804c
+58000020
+2020159d
+44d64015
+6fe2009f
+67f2004c
+58000004
+2040159d
+6fe200a3
+67f2004c
+58000008
+2020159d
+6fe14157
+f9207e00
+67e14157
+20600000
+6fe14157
+f93ffe00
+67e14157
+20600000
+44d6c015
+20403141
+6fe14157
+1fe22200
+6fe0804d
+2feffe06
+7920a20b
+6fe08079
+6848807d
+9840fe00
+68488049
+9840fe00
+7d3a220a
+6fe1c4f0
+7d3a2201
+6fe1030e
+68490310
+9840fe00
+7d3a220d
+6fe44772
+7d3a220f
+6fe4477a
+7d3a220e
+6fe0c1db
+7d3a2208
+6fe0c09a
+2fe1fe0a
+204095e1
+1a227e00
+67e14157
+20600000
+6ff10112
+7d3a2206
+6ff1010e
+7d3a2205
+20600000
+6ff20138
+793ffe1b
+67f2004c
+2040159a
+2020137a
+6ff2013c
+793ffe14
+67f2004c
+2020159c
+474dc033
+7855fc00
+70029d01
+70028703
+70029e01
+5fffffff
+67e102a1
+18007e00
+67e0829f
+67e082aa
+67e1c16e
+67e1c171
+20401955
+7041f501
+7041f600
+7002bc01
+7002bd01
+70443500
+20201a30
+474e4033
+7834fc00
+70028803
+70443701
+70099e01
+5800ffff
+67e109a0
+18007e00
+67e2c6a1
+79207e27
+67e2c69c
+202015ef
+474ec033
+7854fc00
+58000017
+67e14382
+1fe0fe04
+67e14444
+70028801
+70442700
+70009e00
+2040167a
+6fe102b5
+67e14394
+6fe10289
+1feffe05
+1ff1fe00
+67e102b5
+202015ef
+474f4033
+204016a5
+6fe08287
+2feffe04
+79208032
+2040310f
+6fe08288
+c2809628
+2020163a
+474fc033
+7834fc00
+20401a27
+20211637
+204016f6
+2040196a
+7856fc00
+20401828
+24768000
+6fe08005
+1fe0fe01
+67e08005
+2040191b
+7854fc00
+20600000
+2040166e
+7854fc00
+20600000
+47504034
+7043dd00
+793f8030
+20407597
+204020b7
+78577c00
+20401a27
+2021166e
+6fe082bc
+2040168b
+204016f6
+2040174e
+242c1660
+2040167e
+2036964b
+c518164b
+2020165a
+4750c034
+6fe0c3dd
+1fe0fe01
+67e0c3dd
+c006165a
+2040191b
+2040196a
+6fe082bd
+2040168b
+20401836
+204019cd
+6fe1446d
+20407e05
+20401663
+20341668
+47514034
+2040207d
+20402074
+20407887
+6fe082aa
+c281966e
+4751c034
+20401afa
+20201061
+78547c00
+c5157e54
+c514fe54
+c5187e54
+20600000
+47524034
+78377c00
+2040182c
+2036964b
+c518164b
+2020165a
+4752c034
+20401675
+204031d1
+2040167a
+204020c5
+70095b15
+20207871
+d8a044e6
+20407d1b
+70029d00
+70028800
+70028700
+47534034
+70439c00
+70439b00
+20206ecc
+4753c034
+6fe08005
+1fe0fe01
+67e08005
+6fe08287
+c3818000
+79207e03
+67e08287
+6fe14394
+67e102b5
+58000000
+67e243bc
+20600000
+1fe20400
+47544035
+18427e00
+c28016a5
+c2809694
+c30116a5
+c28396a2
+c281169a
+202016a5
+204016a5
+7920002d
+793f802f
+70890103
+70892084
+20600000
+204016a5
+7920002f
+793f802e
+70890105
+70892080
+70893020
+7089340a
+20600000
+2040169a
+7920002e
+20600000
+4754c035
+783b7c00
+793f802d
+793f802f
+70890101
+70892080
+708925a7
+70893003
+70893358
+7089340a
+70893740
+708a6d09
+20600000
+47554035
+785b7c00
+793f8032
+70890100
+70892080
+708925a3
+70893003
+70893368
+70893409
+70893728
+708a6d09
+20600000
+7844fc00
+7843fc00
+6fe182af
+98001e00
+6fe08016
+1fed8400
+79200401
+18431c00
+20600000
+204016d0
+2040118f
+6fe1015d
+2040137d
+202011a6
+2036920b
+c518120b
+204016d0
+20201205
+4755c035
+20401161
+6fe082df
+243a16e3
+6fe08016
+1fe67c24
+202116dd
+18000400
+c1128000
+18000418
+c1130000
+1800044e
+20600000
+1fe67c0a
+202116e0
+1fe0fe01
+1fe3fe00
+1fe08402
+20600000
+6fe08016
+1fe38400
+20600000
+d84001f4
+207a0000
+d84000fa
+c1008000
+d8400096
+c1010000
+d8400064
+c1018000
+d840004b
+c1020000
+d8400032
+c1028000
+d8400028
+c1030000
+d8400014
+20600000
+47564035
+78287c00
+6fe202ab
+98001200
+204010b0
+2040172c
+58000200
+20349700
+6fe10295
+1fe37e00
+6849015d
+9840fe00
+20401311
+1b427e00
+20600000
+4756c035
+20407cd0
+67210987
+1a208c01
+efe08006
+c4000000
+1a208a1a
+efe10005
+1fe0fe01
+e7e10005
+20401898
+204018bd
+204018c6
+20401716
+20407cde
+6f210987
+20600000
+1a208c19
+efe08006
+1a208a18
+e8408005
+9840fe00
+1fe67c24
+2021171e
+1fe0ffdb
+e7e08005
+20600000
+1a208c30
+efe28006
+18000400
+18007225
+c3001726
+18408401
+1fe37e00
+c2001724
+1840ffff
+1a208a22
+e7e08005
+20600000
+47574035
+6fe0829f
+98000e00
+684a82b7
+a84fffff
+20209741
+6fe082a9
+98e67e00
+20211737
+1fe60fff
+20201732
+18e27200
+18000e00
+a84fffff
+2020973c
+1f20f201
+1f227e00
+203a1741
+18e08e01
+1f20f3ff
+20201739
+18e27e00
+67e08016
+20600000
+20349747
+37c18200
+20600000
+d9600ea0
+34730200
+20600000
+78487c00
+6fe143e5
+1fe21600
+20201754
+4757c035
+204017b8
+78287c00
+6fe10295
+684a43bc
+98409600
+204016c7
+47584036
+204016be
+c597975c
+783cfc00
+2000001e
+204016be
+19699600
+7856fc00
+7826fc00
+7830fc00
+78507c00
+19623600
+37c18400
+20371765
+1b420400
+604b0098
+242c17f3
+4758c036
+78287c00
+db604eab
+6fe0c1f0
+9b6fb600
+20404caf
+20371772
+204017f7
+6fe08287
+c3019772
+684b0098
+20559473
+2040127d
+7823fc00
+7824fc00
+09800008
+19897e00
+67e0816b
+09800008
+19897e00
+67e0816c
+1fe27200
+20229797
+c5191783
+09800008
+19897e00
+e7e08005
+c200177e
+20201797
+18a22400
+20401914
+6a20816c
+1a20a3fc
+242117eb
+204017bd
+1a420a00
+d8400000
+6f20816c
+1f20f3fc
+20229795
+09800008
+19897e00
+e7e08005
+18408401
+18417c0f
+204297da
+c200178e
+204017e2
+1a420a00
+47594036
+09800018
+1fef7e00
+1ff17e00
+e7e18005
+78287c00
+20401805
+202317ef
+c59917a9
+6fe0816c
+203a17a9
+1fe0fffc
+67e0816c
+20406d53
+6ff08108
+c30397eb
+1800700c
+65e20273
+20404cae
+7836fc00
+793f8030
+20406d55
+6fe082bc
+7d3e7e07
+67e082bc
+4759c036
+68488017
+1840a202
+c51697b5
+1840a202
+7846fc00
+20401161
+202011ca
+c6990000
+20406dc7
+1800700c
+20406dcc
+20206dcb
+7080d500
+7080d601
+6fe0816b
+1fe17e03
+67f080d7
+5800016d
+67f100d1
+67f100d3
+6a20816c
+1a20a3fc
+684ac6a1
+280ffe0f
+204097d0
+20406c61
+58000000
+67f100da
+70800a06
+70800a07
+20600000
+18467c00
+202297d5
+184085ff
+79200427
+20600000
+58ffffff
+1ff07e00
+d840ffff
+98418400
+20600000
+18a22400
+6fe0816c
+1fe0fffc
+98467c00
+20628000
+605900da
+1a420a00
+20600000
+09800020
+1fef7e00
+1fecfe00
+e7e20005
+18a22400
+18007000
+1fe25e00
+605900da
+20600000
+202017f5
+20401805
+20400e80
+202017a9
+20404cb0
+c51817f3
+79200030
+202017ac
+793f8030
+202017f5
+20406d55
+20200e80
+c51797fd
+c5169801
+6fe10165
+1fe25200
+1c225000
+20600000
+6fe10169
+1fe25200
+1c20d001
+20600000
+6fe10167
+1fe25200
+1c225000
+20600000
+6fe0816c
+1fe08405
+18498400
+6fe082bc
+c517980c
+c280180e
+c280980f
+203e1811
+20201814
+20201819
+18430400
+20201819
+18408403
+18438400
+20201816
+18408403
+18498400
+58000028
+98408400
+20201819
+6fe0c1f0
+984f8400
+da204e20
+9a2ffe00
+98460400
+1b627e00
+98463600
+20600000
+20401838
+68488017
+2040118f
+204011a6
+78287c00
+d960157c
+20201755
+475a4036
+6fe082bd
+2040168b
+20401838
+6fe082bc
+2040168b
+68488017
+2040118f
+204011a6
+78287c00
+d960157c
+c5979755
+d9602134
+20201755
+20401838
+20200e80
+475ac036
+204016be
+204016cc
+20404cb5
+79202a00
+782efc00
+78307c00
+7850fc00
+20401744
+785d7c00
+c517987a
+c516988c
+19317e00
+1fecfe00
+1ff1fe00
+08008628
+7823fc00
+7824fc00
+475b4036
+6fe0c1f5
+08008608
+efe08006
+1fe27200
+08008608
+1f267c00
+20229859
+6ff0800a
+203a1855
+c519186f
+d8c041f7
+efe08006
+08008608
+c2001856
+78247c00
+08008618
+78447c00
+c5979860
+7843fc00
+58000000
+08008603
+37d38200
+20000064
+784efc00
+785c7c00
+20401161
+20404cb3
+6fe0c1f5
+1fe17e03
+c1818000
+6fe0c39c
+c0011955
+c1828000
+6fe0c1f7
+c0029950
+20600000
+1f20f3fc
+1f220400
+20406d40
+d8c041f7
+efe08006
+08008608
+c2001873
+20406d45
+1de27e00
+08008620
+20201859
+df20000a
+5800003c
+08008608
+c200187b
+784efc00
+783c7c00
+19317e00
+1ff17e00
+1ff1fe00
+08008620
+c5171889
+58000001
+08008605
+783d7c00
+20201848
+58000000
+08008605
+20201848
+6fe0c1f0
+1fe37200
+20000002
+c200188e
+19317e00
+1fecfe00
+1ff18400
+18427e00
+08008608
+18427e00
+08008628
+20201848
+da60189c
+da4018b0
+d8e00005
+202018f4
+1a208c04
+e8420006
+1a208c37
+efe08006
+1a208a2b
+e7e08005
+efe10006
+1febfe00
+98409600
+1a208a04
+19627e00
+e7e20005
+efe10006
+1febfe00
+1a208a02
+e7e10005
+efe20006
+1a208a2c
+e7e20005
+20201a33
+efe08011
+793ffe03
+e7e08011
+6fe102b5
+67e14394
+62210970
+70095b44
+20407871
+6a210970
+1a208c2e
+efe10006
+67e14394
+20600000
+da600000
+da4018c1
+d8e00006
+202018f4
+1a208c37
+efe28006
+1a208a30
+e7e28005
+20201720
+da600000
+da4018ca
+d8e00007
+202018f4
+1a208c37
+efe08006
+204018d7
+e7e08005
+1a208c38
+efe08006
+204018e5
+e7e08005
+62210970
+70095b42
+20407871
+6a210970
+20600000
+205a18df
+1a208a35
+24748000
+6848c442
+284ffe07
+7920fe07
+1a208a36
+20600000
+1a208c35
+efe08006
+24748000
+1a208c36
+efe08006
+20600000
+205a18ee
+6848c442
+284ffe07
+7920fe07
+1a208a36
+24748000
+793ffe07
+1a208a35
+20600000
+1a208c36
+efe08006
+24748000
+1a208c35
+efe08006
+20600000
+efe08011
+afec0000
+20608000
+1a208c1a
+e8410006
+1a208c20
+efe10006
+98467e00
+20229903
+24211908
+1fe67c01
+20229901
+20600000
+1a627e00
+20207e05
+efe08011
+f93ffe00
+e7e08011
+1a427e00
+20207e05
+1a208c1a
+efe10006
+1a208c20
+efe10006
+98467e00
+d840ffff
+98467c00
+20229903
+d840f000
+98467c00
+24211903
+20600000
+6848829e
+6fe0816b
+1fe37e00
+9842fe00
+2feffe02
+7920800f
+20600000
+475bc036
+20401a30
+c6180000
+20401942
+6fe0816b
+2feffe04
+7920802a
+1fe37e00
+9842fe00
+2feffe02
+7920800f
+c6078000
+6fe0816c
+203a1934
+6fe08287
+c3021934
+684a0273
+6fe246a6
+98467c00
+2022937a
+604a46a6
+6fe2c6a1
+1fe0fe01
+79207e27
+67e2c6a1
+6848829e
+79400402
+6048829e
+6fe0c3c0
+c4030000
+475c4037
+6fe0816c
+207a0000
+6fe0816b
+2fe00601
+20209f2a
+2fe00602
+20209f18
+20600000
+475cc037
+6848829e
+284c0005
+20608000
+6fe0816b
+1fe3fe00
+9842fe00
+c4018000
+793f8405
+79400403
+6048829e
+28400603
+24608000
+20600000
+6fe08287
+79207e04
+67e08287
+79200032
+20600000
+475d4037
+70439c00
+dfe00000
+67e246a6
+67e2c69c
+79207e27
+67e2c6a1
+6fe08287
+793ffe04
+67e08287
+793f8032
+20600000
+da200001
+6fe0816b
+c3830000
+da200000
+20600000
+18c20a00
+68494444
+18a20c00
+20600000
+475dc037
+6fe0829e
+c3828000
+2040198b
+20401b60
+203a19af
+efe10006
+e8410006
+18422200
+9a267e00
+20401966
+20407e4a
+1fe20400
+e8208006
+1a227e00
+98c0fe00
+67e1097b
+2040199f
+204019b1
+20401b60
+efe10006
+1fe22200
+18c22600
+e8410006
+18422400
+9a467e00
+20401966
+20407e4a
+9a40fe00
+e7e10013
+9a267c00
+24628000
+20201b79
+20401992
+c6148000
+6fe0c3c0
+c301199d
+20401b63
+203a199d
+2020199b
+20401b60
+203a199d
+efe10006
+e8410006
+98462200
+20401966
+18427e00
+9a267c00
+2021199d
+79200029
+20600000
+793f8029
+20600000
+1a227e00
+207a0000
+d8200001
+20600000
+475e4037
+18408401
+20401a62
+18c08dfe
+efe10006
+d8402902
+98467c00
+24628000
+18c08c01
+18c22200
+efe08006
+20600000
+18000400
+18000201
+475ec037
+6048c1f6
+6848829e
+79200405
+18417efc
+9821fe00
+67e0829e
+1fe17e1f
+280ffe29
+7920fe04
+67e0c1f5
+6fe0c1f5
+28200601
+242099c1
+6fe0c1f6
+207a0000
+c51919c7
+6f20c1f6
+6fe1097b
+1fe20c00
+d8a041f7
+20207d52
+20406dc7
+20206d27
+d8e00000
+202015ba
+d8e00000
+202015be
+475f4037
+c6078000
+c6180000
+6fe0816b
+1fe17e03
+67e0c3d3
+6fe0816c
+207a0000
+5800016d
+67e143d8
+475fc037
+6fe0c3d3
+c001a10b
+204019e7
+243419c9
+204019cb
+58000000
+67e143d6
+6fe143d8
+1fe08c02
+47604038
+efe10006
+c0021cd1
+c0031f8c
+c0029f4e
+20600000
+6fe0c3d3
+c00119f6
+c0009a0d
+20600000
+20407e54
+d8400004
+9fe67c00
+20628000
+d8400005
+9fe67c00
+20628000
+d8400006
+9fe67c00
+20628000
+20207e56
+6fe143d8
+1fe20c00
+efe10006
+67e143d4
+efe10006
+204019eb
+24740000
+6848816c
+604943d6
+6fe143d4
+1fe0fe04
+98467c00
+2022fe54
+6f20816c
+d8a01000
+6fe143d8
+1fe20c00
+20407d52
+20207e56
+20407e54
+6fe143d6
+247a0000
+20207e56
+20401a09
+24740000
+6fe143d6
+d8a01000
+98a0a200
+6848816c
+9840fe00
+67e143d6
+6f20816c
+1a220a00
+6fe143d8
+1fe20c00
+20407d52
+58001000
+67e143d8
+6fe143d4
+1fe0fe04
+684943d6
+98467c00
+2022fe54
+20207e56
+20407ceb
+d8a04359
+20201f12
+6fe1446b
+20207e05
+684a02a3
+20401369
+98461600
+19627e00
+684902b5
+18520400
+18438400
+98467e00
+20600000
+20401369
+67e202a3
+20600000
+4760c038
+1a208c50
+efe08006
+204016e6
+1a208c02
+efe10006
+984ffe00
+68490163
+984ffe00
+d84f4240
+9846fc00
+d8400682
+6fe0c1f0
+984f8400
+1a208c2b
+efe08006
+984ffe00
+9840fe00
+67e243bc
+6fe140c8
+20407def
+18078400
+9840fe00
+1a208a0e
+e7e10005
+20600000
+47614038
+6fe1099e
+98002400
+6fe109a0
+98002600
+6fe14396
+98000c00
+78347c00
+20600000
+efe10006
+1fe17eff
+207a0000
+9a467c00
+24610000
+9a667c00
+20628000
+20211a60
+18007c01
+20600000
+18007e00
+20600000
+20401a65
+20229a72
+20600000
+4761c038
+6fe14396
+98000c00
+efe10006
+1fe17eff
+207a0000
+98467c00
+20628000
+efe08006
+98c08c00
+efe08006
+98c08c00
+20201a68
+efe08006
+98c08c00
+20600000
+47624038
+6fe14396
+98000c00
+efe10006
+1fe17eff
+207a0000
+efe08006
+98c08c00
+18c08dfe
+efe10006
+98467c00
+20628000
+efe08006
+98c08c00
+20201a78
+6fe14396
+98000c00
+efe10006
+1fe17eff
+207a0000
+1fe08401
+efe08006
+98c08c00
+efe08006
+98c08c00
+18c20a00
+20201a86
+6fe109b4
+20201a94
+4762c038
+6fe14396
+98000c00
+efe10006
+1fe17eff
+203a1a9f
+98467c00
+20229aa0
+efe08006
+98c08c00
+efe08006
+98c08c00
+20201a95
+20207e5e
+efe08006
+67e089ba
+1fe27200
+d8a009bb
+20407d52
+efe08006
+67e089b3
+20407ceb
+20207e60
+47634038
+20401aac
+20201abe
+d8402a00
+20401a75
+207a0000
+efe08006
+18c20a00
+6848c2f7
+18427200
+98467c00
+24211abb
+98460400
+d8c042f8
+20407d52
+18427200
+24429af6
+20600000
+1fe27200
+d8c042f8
+20207d52
+da604407
+da2043e8
+20401acb
+58000000
+79347e00
+67e0895c
+da604427
+da204408
+20401acb
+20740000
+6fe0895c
+203a137a
+20600000
+4763c038
+20407e54
+20407d2c
+da400000
+d8a0098f
+20401ae5
+6fe0c2f7
+1fe08401
+9a40a200
+1a20a202
+1a267c1f
+24211ae3
+e0408005
+d8400009
+e0408005
+98007200
+20407d52
+1a222400
+1a427e00
+67e0898e
+d8c0098e
+5fffffe0
+9a608a00
+20207d0a
+20407e56
+20201add
+efe08011
+207a0000
+1fe0fe01
+e8408006
+18467c09
+20229af4
+9a40a400
+1a220c00
+98007200
+20407d52
+18c22200
+1a227e00
+9a667c00
+20610000
+20201ae5
+9a20a200
+20201af0
+58000020
+e7e08005
+c2001af6
+20600000
+47644039
+7855fc00
+20371afe
+24369b0c
+20401544
+6fe140c8
+67e10295
+24369557
+c5079557
+6fe0816c
+243a1557
+6fe0c1f6
+243a1557
+6fe0c3c0
+c2829557
+6fe08287
+c2829557
+20201536
+684940c8
+18430400
+6fe10295
+9840fe00
+67e10295
+2020154f
+d8e00000
+20201b2a
+d8e00000
+20201b2e
+d8e00001
+20201b2a
+d8e00001
+20201b2e
+d8e00002
+20201b2a
+d8e00002
+20201b2e
+d8e00003
+20201b2a
+d8e00003
+20201b2e
+d8e00004
+20201b2a
+d8e00004
+20201b2e
+d8e00005
+20201b2a
+d8e00005
+20201b2e
+6fe0c3c0
+f9207e00
+67e0c3c0
+20600000
+6fe0c3c0
+f93ffe00
+67e0c3c0
+20600000
+58112233
+67e1c3c1
+58445566
+e7e18005
+58778899
+e7e18005
+58001122
+e7e18005
+58334455
+e7e18005
+58000066
+e7e08005
+20600000
+59000302
+67e24350
+58010010
+67e1c354
+70439d01
+20600000
+da200000
+d8200001
+20201b56
+d8200003
+20401b56
+1a427e00
+e7e08005
+20600000
+18000202
+1a20a204
+20401b56
+1a20a3fc
+1a227e00
+e7e10005
+1a427e00
+e7e10005
+20600000
+1a20a205
+204052a1
+1a20a3fb
+1a227e00
+e7e10005
+58000000
+e7e10005
+18227e00
+e7e08005
+20600000
+204052db
+1fe20c00
+20600000
+6fe144ee
+20600000
+20401b68
+1fe20c00
+20600000
+6fe144f1
+20600000
+20401b60
+18c08c05
+20600000
+20401b60
+18c08c09
+20600000
+20401b65
+18c08c09
+20600000
+20401b65
+18c08c05
+20600000
+202052f1
+202052f4
+202052f7
+202052e0
+67e4444c
+20201b8c
+184122ff
+20401b80
+184ca200
+20201b86
+6220c442
+2a2ffe01
+20409b88
+2a2ffe02
+20409b8a
+20600000
+6220c443
+20201b81
+d8e00008
+20201b8e
+d8e0000b
+20201b8e
+d8e00005
+20201b8e
+6fe4443a
+f9207e00
+67e4443a
+20600000
+c61a0000
+7002bc01
+7002bd01
+204016a5
+20401b99
+20401c17
+202016b2
+4764c039
+6fe0c3e2
+c1808000
+d8e00002
+20407d74
+247a0000
+6fe143e3
+684943e5
+98467e00
+d8e00002
+20407d66
+7854fc00
+20401c38
+20401bb8
+24768000
+47654039
+6fe3016d
+67e30297
+6fe08002
+1fe0fe01
+67e08002
+20401bbf
+20748000
+20401c5f
+24768000
+6fe08004
+1fe0fe01
+67e08004
+6fe48173
+67e48a01
+20600000
+4765c039
+20401caa
+2040174a
+6fe08001
+1fe0fe01
+67e08001
+20600000
+47664039
+6fe082e0
+c18d8000
+6fe30297
+684b436b
+98467c00
+24628000
+20400a4a
+24628000
+20401bcf
+20401602
+7041db00
+7002d700
+7043e200
+7002e000
+20200a32
+4766c039
+18007fff
+38080001
+67e282b7
+da200287
+20401720
+18007204
+d8a002ab
+20405a32
+6fe14378
+67e102b5
+180a7e00
+1fe17e0f
+1fe67c04
+20211bda
+67e082a0
+67e085a8
+47674039
+684941f3
+60490289
+18422600
+1c40fe07
+9a66fc00
+20407def
+18072200
+9a267e00
+9a60fe00
+684941f1
+9840fe00
+67e2028b
+9c462200
+1a20a3fa
+da402205
+6fe0c371
+7d3a2406
+6fe0c36a
+7d3a2407
+1a427e00
+67e141f5
+6fe3437a
+e7e30005
+6fe30297
+e7e30005
+6fe202ab
+e7e20005
+180a7e00
+e7e10005
+180a7e00
+e7e08005
+18007e02
+e7e08005
+1a2b7e00
+e7e10005
+1a6b7e00
+e7e10005
+4767c039
+58000000
+e7e10005
+6fe14378
+e7e10005
+6fe282b7
+e7e28005
+6fe082a0
+d84000a0
+9841fe00
+e7e08005
+20401836
+580041f5
+1fe08c12
+efe18006
+67e182af
+20600000
+70001624
+70098e00
+6fe0c427
+207a0000
+d8e00000
+20407d74
+247a0000
+4768403a
+78287c00
+20401c38
+20401caa
+20401c41
+24369c2b
+6fe08003
+1fe0fe01
+67e08003
+6fe0816b
+1fe17e0f
+c0019c70
+c0029c82
+4768c03a
+6fe0898e
+6848c432
+98467c00
+24229c19
+180a7e00
+d84001ff
+98417e00
+1fe0fefa
+20407d0e
+d8e00000
+6fe14428
+20207d66
+4769403a
+7854fc00
+588e89be
+1fed7e00
+1fe1fed6
+98001200
+58555555
+67e182af
+202010b0
+4769c03a
+6fe0c42a
+6848c42b
+18520400
+184b8400
+98408400
+6048c1f5
+c0009c52
+6848c3e7
+1840fe06
+67e0c1f6
+6fe3437a
+67e341f7
+18427200
+d8c043e8
+20407d52
+20201c58
+5800000c
+67e0c1f6
+6fe3437a
+67e341f7
+6fe341dd
+e7e30005
+476a403a
+6fe08000
+1fe0fe01
+67e08000
+db600708
+7856fc00
+20201821
+476ac03a
+6fe0c433
+c1808000
+6fe08000
+1fe0fe01
+67e08000
+d8400c03
+6fe0c434
+7d3a0406
+1a227e00
+7d3a0407
+604941f5
+6fe3437a
+e7e30005
+6fe30297
+e7e30005
+20201821
+6fe30173
+684b437a
+98467c00
+24628000
+d8400004
+6fe0c42b
+7d3a0406
+6048c1f5
+6848c407
+1840fe06
+67e0c1f6
+6fe3437a
+67e341f7
+d8c04408
+18427200
+20407d52
+20401836
+20201c2b
+6fe30173
+684b437a
+98467c00
+24628000
+20401961
+6220c36a
+6fe3016d
+67e30297
+6fe40179
+67e402ab
+68490181
+476b403a
+184b8400
+6fe10183
+1febfe00
+67e10289
+67e2028b
+98467e00
+1fe0d1fe
+6fe48185
+67e482b3
+6fe0818e
+1fe1041f
+604882a0
+1ff18400
+18430400
+604882d7
+da200287
+20401a33
+da200287
+20401720
+2040160e
+20400a4a
+24628000
+476bc03a
+20401061
+20401f6b
+70095b14
+20407871
+20200a32
+476c403b
+6fe08016
+c0129cb0
+c0131cb6
+c0139cbc
+20201cbc
+6848c432
+284ffe01
+20209cc7
+284ffe02
+20209ccc
+20201cc2
+6848c432
+284ffe02
+20209ccc
+284ffe00
+20209cc2
+20201cc7
+6848c432
+284ffe00
+20209cc2
+284ffe01
+20209cc7
+20201ccc
+70001625
+6fe0898e
+79207e00
+67e0898e
+20600000
+70001626
+6fe0898e
+79207e01
+67e0898e
+20600000
+70001627
+6fe0898e
+79207e02
+67e0898e
+20600000
+efe18006
+67e1c436
+c0011ce8
+c0019cf0
+c0021cf3
+c0031d1c
+c0041d69
+c0051de7
+c0061e16
+c0081e2c
+c0091e6f
+c00b1e93
+c00c1ea6
+c00f1eab
+c0291eaf
+20600000
+18002203
+20401ed4
+58000002
+e7e08005
+6fe14380
+e7e10005
+20600000
+20401cf0
+18002203
+20401ed4
+58000003
+e7e08005
+6fe14380
+e7e10005
+20600000
+1fecfe00
+67e14382
+20600000
+20401f03
+20407e54
+20201cf6
+d9600003
+20401a4d
+20401a56
+203a1d1a
+24211d17
+18c08dfe
+20407ceb
+20407ce2
+24341d0a
+20407cd0
+20407e56
+6162096c
+18002214
+20401ed4
+6962096c
+20407cde
+58000005
+e7e08005
+58000001
+e7e08005
+20407ce5
+efe10006
+1fe17eff
+e7e10005
+efe08006
+1fe27200
+20407d5f
+20407ce8
+196097ff
+20229d1a
+efe08006
+98c08c00
+20201cf8
+efe08006
+98c08c00
+20201d14
+20341ec8
+20201ef7
+20401f03
+efe10006
+67e1435a
+20407ceb
+d8a009a2
+6fe143d4
+1fe0fff9
+20401f14
+20201d2f
+78547c00
+6849099e
+6fe109a0
+98467c00
+24211d2c
+18427e00
+c1800000
+78347c00
+7002d801
+20201ec9
+20401d25
+20740000
+6849435a
+58002800
+98467c00
+20229d36
+20201ec8
+70443900
+6849099e
+60490964
+20401a92
+243a1ec8
+68490964
+20401a92
+243a1d4f
+18c22200
+6fe089b3
+1fe27200
+684889a2
+98467c00
+24229d4b
+da4009a3
+20407df1
+20229d52
+6fe109bb
+6849435a
+98467c00
+20229d5a
+6fe10964
+1fe0fe01
+67e10964
+20201d3b
+6fe0c439
+c0009d5a
+20201ec8
+6fe109bb
+6849435a
+98467c00
+24229d4b
+70443901
+68490964
+604909b6
+20201d4b
+6fe0c439
+c0001d4b
+70443902
+68490964
+184085ff
+604909b8
+da200005
+20401ed4
+58000007
+e7e08005
+6fe109b6
+e7e10005
+6fe109b8
+e7e10005
+20600000
+20401f03
+20401f10
+20201d6c
+6849099e
+60490964
+20401a4d
+20401a65
+18c08dfe
+18c27e00
+67e109b4
+684909a3
+58002a00
+98467c00
+20229dd3
+58002803
+98467c00
+24229dbf
+d9600002
+20401eda
+24211d9c
+68490964
+20401a90
+243a1d9c
+20401ede
+24229d9a
+24341d9e
+78547c00
+da200014
+20401ed4
+58000009
+e7e08005
+18a26000
+18a08a01
+20401dac
+20401ed6
+20401a90
+20401db3
+6fe089ba
+1fe0a205
+e2208030
+1a267c07
+2442fe58
+2042fe5a
+20401f08
+9a26fc00
+20407def
+18079600
+196097ff
+20229d9c
+20401ed6
+20201d7b
+20341ec8
+20201ef7
+20401ee9
+20401ed6
+20401a90
+20401e5d
+243a1d9c
+20407ce2
+6fe10964
+1fe0ffff
+e7e10005
+20401ef3
+20401db3
+196097ff
+20229d9c
+20201d9a
+6fe10964
+e7e10005
+6fe089b3
+1fe27200
+20407ce5
+20407d52
+20207ce8
+20407ce2
+6fe10964
+e7e10005
+20407ce8
+6fe089ba
+1fe27200
+20407ce2
+20407ce5
+9f260c00
+18c08dff
+20407d52
+20207ce8
+20401a75
+203a1ec8
+18c22600
+18c08dfb
+efe10006
+67e10964
+da200014
+20401ed4
+58000009
+e7e08005
+efe08013
+1fe27200
+1fe0fe02
+e7e08005
+6fe10964
+e7e10005
+1a608c01
+20407d52
+20407ce8
+20201ef7
+d8402a00
+20401a75
+207a0000
+18c08dfb
+efe10006
+67e10964
+da200014
+20401ed4
+58000009
+e7e08005
+6fe0c2f7
+1fe27200
+1fe0fe02
+e7e08005
+6fe10964
+e7e10005
+d8c042f8
+20407d52
+20407ce8
+20201ef7
+20401e8d
+68494437
+6fe0c3c0
+c2819e0c
+20401a65
+24229ec8
+20541e12
+20740000
+20401a72
+18c08dfe
+efe10006
+d8402a00
+98467c00
+20229e02
+efe08006
+1fe67c16
+20211df9
+18007e16
+1fe22600
+20407ceb
+1a60a201
+20401ed4
+5800000b
+e7e08005
+1a627200
+20407ce5
+20207d5f
+20407ceb
+6fe0c2f7
+1fe0a201
+20401ed4
+5800000b
+e7e08005
+6fe0c2f7
+1fe27200
+d8c042f8
+20207d5f
+6fe143d1
+98467c00
+24229deb
+24341deb
+7002d805
+20201ec9
+18c08dfe
+efe10006
+c2871e10
+20207e56
+efe10006
+67e109a2
+da200014
+20401ed4
+5800000d
+e7e08005
+6fe109a2
+98002200
+68494437
+20401a62
+203a1ec8
+efe08006
+9a267200
+24211ec8
+1f267c16
+20211e27
+18007216
+1a227e00
+98c08c00
+20407d52
+20407ce8
+20201ef7
+20401f03
+20401f10
+20201e2f
+d9600002
+6849099e
+60490964
+20401a65
+18c08dfe
+18c27e00
+67e109b4
+20401eda
+24211e65
+68490964
+20401a90
+243a1e68
+20401ede
+24229e5b
+19627e00
+c0001e68
+24341e51
+78547c00
+da200014
+20401ed4
+58000011
+e7e08005
+6fe089b3
+1fe0a204
+e2208005
+20407ce8
+1a267c06
+2442fe58
+2042fe5a
+20401f08
+9a26fc00
+20407def
+18079600
+20201e57
+20401e5f
+243a1e68
+6fe10964
+1fe0ffff
+67e109b8
+20401eee
+6fe10964
+67e109b6
+20401ee9
+196097ff
+20401ed6
+20201e36
+6fe089ba
+20201e60
+6fe089b3
+20361e63
+1fe0fffe
+20600000
+1fe0fff0
+20600000
+6fe10964
+67e109b8
+20201e6c
+6fe10964
+1fe0ffff
+67e109b8
+20201e6c
+20341ec8
+20401eee
+20201ef7
+18c22200
+6fe143d4
+1fe0a5fd
+20401a25
+20401e8d
+68494437
+20401a65
+24229e8b
+20541e87
+20740000
+6fe0c3c0
+c3021e82
+68494437
+6fe143d1
+98467c00
+24229e82
+20401e8d
+24341e82
+20201e10
+18002201
+20401ed4
+58000013
+e7e08005
+20600000
+18c08dfe
+efe10006
+c2879e10
+20207e56
+7002d801
+20201ec9
+20407e56
+6fe0c39d
+c1000000
+6fe0c040
+c3820000
+20207e54
+18c0a202
+6fe143d4
+1fe0a5fb
+20401a25
+20201e98
+6fe143d4
+1fe22200
+20401ed4
+58000017
+e7e08005
+6fe14437
+e7e10005
+6fe143d4
+1fe0f3fb
+6fe143d8
+1fe08c07
+efe10006
+e7e10005
+20207d52
+18002201
+20401ed4
+58000019
+e7e08005
+20600000
+6fe0c435
+793ffe00
+67e0c435
+20600000
+18c22200
+6fe143d4
+1fe0a5fd
+20201a25
+18422600
+1a20a203
+20401ed4
+1a20a3fd
+5800001b
+e7e08005
+1a620400
+e0410005
+20600000
+6fe0c435
+79207e00
+67e0c435
+18422600
+1a20a203
+20401ed4
+1a20a3fd
+5800001d
+e7e08005
+1a620400
+e0410005
+20600000
+7002d80a
+18002205
+20401ed4
+58000001
+e7e08005
+6fe0c436
+e7e08005
+6fe14437
+e7e10005
+6fe082d8
+e7e08005
+20600000
+18002404
+20201b4d
+68490964
+18408401
+60490964
+20600000
+68490964
+6fe109a0
+98467c00
+20600000
+684889a2
+da2009a3
+6fe089ba
+1fe27200
+98467c00
+24628000
+da4009bb
+20207df1
+6848c359
+da20435a
+20201ee0
+6fe089b3
+67e08a01
+1fe27200
+20407ce5
+20207d52
+20407ce2
+6fe109b6
+e7e10005
+6fe109b8
+e7e10005
+6fe08a01
+1fe27200
+20407d52
+20207ce8
+20407ce2
+20401b70
+18a27e00
+98c62200
+20401b73
+1a227e00
+e7e10006
+1a20a204
+20401b65
+1a227e00
+e7e08006
+20600000
+1fecfe00
+67e1099e
+efe10006
+67e109a0
+20600000
+6fe14382
+1fe0fffe
+68494380
+184085fe
+20407e4a
+d84000f0
+20407e4a
+20600000
+20407ceb
+d8a009a2
+6fe143d4
+1fe0fffb
+e7e08005
+1fe27200
+20407ce5
+20207d52
+6fe1016f
+c1820000
+6fe0c435
+79207e01
+67e0c435
+6fe18171
+67e1c436
+7920000f
+c0091f33
+c0291f38
+c00c1ea6
+c0011ce8
+c00f1eab
+793f800f
+6fe0c435
+793ffe01
+67e0c435
+20600000
+6fe0c435
+c4008000
+7920000f
+20401f42
+20401f48
+20541f26
+6fe0c436
+c0091e73
+20600000
+20401f38
+20201f35
+20401f48
+24740000
+20201e73
+20401f3b
+da200174
+20201a25
+6fe0816c
+1fe0a5f9
+1fe0fffc
+67e143d6
+6849016d
+604943d4
+20600000
+6a40816c
+6fe143d6
+9a408400
+604943d6
+da20016d
+20201a25
+20407e56
+6fe143d6
+684943d4
+98467c00
+24628000
+20207e54
+efe08006
+e8408006
+e8410006
+c0099f53
+20600000
+efe10006
+67e143db
+70095b40
+20207871
+da20000c
+da600012
+20401f5f
+58000008
+e7e10005
+6fe44372
+e7e40005
+20600000
+20401f67
+da400005
+20401b4d
+1a627e00
+e7e08005
+6fe0c3da
+e7e08005
+20600000
+6fe0c3da
+1fe0fe01
+67e0c3da
+c1800000
+7043da01
+20600000
+6fe0c39d
+c0001f7c
+c0009f7f
+c0011f81
+c0409f75
+c0411f77
+c0419f7a
+20600000
+7043530d
+20201f7d
+7043530d
+70435101
+20600000
+7043530d
+20201f82
+70435300
+70435103
+20600000
+70435305
+20201f7d
+70435305
+70435100
+20600000
+6fe0c6b8
+79207e00
+67e0c6b8
+20600000
+6fe0c6b8
+793ffe00
+67e0c6b8
+20600000
+efe08006
+c0009fa0
+c0019fc7
+c0021fe8
+c0029ff5
+c003a05d
+c0042049
+c004a059
+c005205d
+c005a05d
+c006205e
+c006a063
+20600000
+18002202
+20402109
+5800000b
+e7e08005
+6fe0c353
+e7e08005
+20600000
+67e0c349
+efe30006
+e7e30005
+6fe0c39d
+c0001ffa
+20401fc2
+6fe0c6b6
+203a1fac
+6fe0c34c
+c301b20f
+6fe0c39d
+c303b20f
+70439b03
+6fe0c34a
+c0001fb4
+c0009fb4
+c0019fb4
+6fe0c39d
+c0011fb7
+c1418000
+dfe00000
+67e2439e
+20600000
+6fe0c3c0
+c2801fc0
+da20439e
+1a220a00
+df200003
+20405a32
+6fe143a0
+1fe17e07
+67e143a0
+70095b34
+20207871
+18002207
+20402109
+6fe3c350
+e7e38005
+20600000
+70439b05
+d8a04327
+20407d0c
+6fe0c39d
+c0419fcf
+c0021fd2
+c0421fd4
+20201fd7
+70439802
+70439908
+20600000
+70095b43
+20207871
+6fe2439e
+203a1fd2
+20201fcf
+70439b06
+6fe0c39d
+c2839fe0
+20406c52
+18002211
+20402109
+58000003
+e7e08005
+20206dd1
+d8a04337
+20405a31
+20406a7b
+18002211
+20402109
+58000003
+e7e08005
+20206ab7
+18c22200
+6fe0c39d
+c2839ffc
+1a220c00
+20406c4a
+2022a011
+7002d904
+18002202
+20402109
+58000005
+e7e08005
+6fe082d9
+e7e08005
+18000e0a
+20407d65
+70439b00
+70095b30
+20207871
+7002d905
+20201fef
+d8a00277
+1a220c00
+20407d0c
+6fe0c39d
+c041a008
+c0422008
+20406a05
+20402016
+6fe0c39d
+c1c10000
+70095b3b
+20207871
+20406a70
+d8a009be
+20406ab7
+da2009be
+da404327
+df200010
+20407df1
+24229fee
+20202016
+20406c46
+70095b31
+20407871
+70432601
+70439b09
+18002211
+20402109
+58000004
+e7e08005
+d8c04337
+20207d0c
+18002211
+20402109
+58000006
+e7e08005
+6fe0c3c0
+c280a024
+d8c04316
+20207d0c
+d8c043c1
+20207d0c
+d8a043a2
+1800720a
+20405a32
+1800220b
+20402109
+58000007
+e7e08005
+6fe143a2
+e7e10005
+6fe443a4
+e7e40005
+20600000
+18002211
+20402109
+58000008
+e7e08005
+58000000
+e7e40005
+e7e40005
+20600000
+18002208
+20402109
+58000009
+e7e08005
+6fe0c371
+e7e08005
+6fe3437a
+e7e30005
+20600000
+7002d908
+20201fef
+6fe0c355
+6848c355
+98417e00
+20600000
+d8a043ac
+20407d0c
+20402045
+2fec0001
+2020a043
+6fe0c09a
+c1850000
+20402053
+24740000
+2020321d
+20407e56
+6fe0c36a
+c1000000
+6fe0c34e
+c4008000
+20207e54
+20402045
+2fec0001
+2020a043
+20600000
+20600000
+d8a00880
+20407cff
+70439802
+70439901
+20600000
+d8a00930
+20407d0c
+70439906
+70439802
+20600000
+18002241
+20402109
+5800000c
+e7e08005
+d8c046dc
+20207cff
+20406a1c
+18002211
+20402109
+5800000d
+e7e08005
+20206ab7
+6fe0c39b
+c17f8000
+d8400003
+98467c00
+24610000
+d8e0000a
+20407d74
+247a0000
+20202043
+476cc03b
+20401b77
+247a0000
+6fe0c39b
+c000208a
+c000a090
+c001208a
+c001a092
+c004a096
+c005a0a6
+c00620a8
+c006a0af
+20600000
+6fe0c39c
+c1820000
+70439cff
+70439bff
+70095b3f
+20207871
+70439b02
+20201f99
+70439b04
+58017700
+d8e0000a
+20207d66
+6fe0c39c
+c0022099
+20600000
+6fe0c39d
+c283a0a4
+70439b0b
+2040201c
+70095b29
+20407871
+6fe0c09a
+c1850000
+20402053
+20740000
+2020321d
+70439b0c
+2020209d
+70439b0c
+20202026
+6fe0c34f
+6848c356
+98417e00
+2fec0001
+2020a0b1
+70439b0d
+20202032
+2040203a
+202020b1
+18000e0a
+20407d65
+70439cff
+70439bff
+70095b3e
+20207871
+476d403b
+6fe0c39d
+c4038000
+6fe0c398
+c1810000
+70439800
+6fe0c399
+c000a0ff
+c0012106
+c001a0f7
+c00320dc
+c003a0d3
+c00420c9
+20600000
+70439800
+70439900
+70439a00
+20600000
+6fe0c76d
+1fe20e00
+1fe0fe01
+67e0c76d
+6fe2439e
+afefffff
+58000080
+7920fe00
+67e0c76e
+202020fb
+6fe0c39a
+70439a00
+c000a0d8
+70439802
+20600000
+70095b31
+20407871
+70439b09
+2020206e
+6fe0887b
+c001a0e0
+70439802
+20600000
+20406a43
+6fe0c39d
+c041a0e5
+c04220e5
+20401fb4
+20406a30
+da2009be
+da400930
+df200010
+20407df1
+2022a0ed
+7002d90b
+20201fef
+20406eed
+2422a0eb
+70432601
+6fe0c39d
+c040a0d8
+c041a0d8
+c04220d8
+70439802
+70439907
+20600000
+6fe0c39d
+c041a0fc
+c04220fc
+70476e00
+20201fd7
+70476d00
+c1420000
+20201fb7
+70439802
+6fe0c6bb
+c001a103
+20600000
+70439902
+70087b00
+20207581
+70439802
+70439903
+20202068
+18002406
+20201b4d
+6fe0816d
+c0002122
+c000a12a
+c0012132
+c001a136
+c0022155
+c002a15a
+c003215e
+c003a163
+c0042164
+c004a165
+c0052166
+c005a16a
+c006216b
+c006a16d
+c009216e
+c009a16f
+c00a2170
+c00aa172
+c00b217d
+c00c217e
+6a60816d
+202021a1
+efe48006
+67e482be
+efe10006
+67e102a7
+6fe08287
+79207e05
+67e08287
+20600000
+efe28006
+67e282be
+efe10006
+67e102a7
+6fe08287
+79207e06
+67e08287
+20600000
+58000014
+67e102b5
+67e14394
+20600000
+efe40006
+67e443a4
+efe10006
+67e143a2
+efe40006
+67e44384
+efe20006
+67e246aa
+2040218e
+476dc03b
+6fe0c39b
+c004a148
+6fe0c3c0
+c280a14b
+6fe0c489
+245a6016
+6fe0c326
+c0002150
+70439c01
+2040219c
+20206c58
+70432601
+d8c043c1
+d8a04316
+20407d0c
+20202148
+476e403b
+70439c00
+70439b00
+70095b41
+20207871
+efe40006
+67e4438c
+efe20006
+67e246ae
+20206c58
+6fe08287
+79207e04
+67e08287
+20600000
+20748000
+70095b32
+20407871
+70439c04
+2020219f
+20600000
+202021a6
+20600000
+70439c02
+204021ad
+70095b33
+20207871
+20600000
+20748000
+202021af
+20600000
+202021bb
+20600000
+20402172
+202021bf
+efe40006
+67e44444
+6fe14444
+68494450
+20407e4a
+67e14444
+6fe14448
+6849444c
+20407e4a
+67e14448
+20600000
+202021c5
+efe10006
+67e102be
+efe10006
+67e102a7
+207a0000
+6fe08287
+79207e07
+67e08287
+20600000
+da600013
+da200002
+da400002
+20401b48
+1a627e00
+e7e08005
+20600000
+d8a0438c
+18007208
+20405a32
+d8a046ae
+18007204
+20405a32
+da20000d
+da400004
+20401b48
+6fe4438c
+e7e40005
+6fe246ae
+e7e20005
+20600000
+70439c05
+da400005
+202021cf
+da400006
+202021cf
+da200002
+da400007
+20401b48
+e2608005
+20600000
+da200009
+da400009
+20401b48
+6fe4443a
+1fe1fe01
+e7e40005
+20600000
+da40000b
+202021cf
+da200006
+da40000c
+20401b48
+6fe2c5f7
+e7e28005
+20600000
+da200002
+da40000d
+20401b48
+58000006
+e7e08005
+20600000
+da400013
+202021cf
+da400014
+202021c0
+da400015
+da200009
+20401b48
+6fe4444c
+e7e40005
+20600000
+da200003
+da400017
+20401b48
+6fe0c442
+1fe17e07
+e7e08005
+6fe0c443
+1fe17e07
+e7e08005
+20600000
+da200001
+20201b48
+476ec03b
+c61a0000
+c513a40e
+2020261b
+7844fc00
+7843fc00
+58555555
+98001e00
+6fe0c83a
+202016c3
+476f403b
+6fe0c864
+2040168b
+6fe2483c
+98001200
+204010b0
+20401161
+6848c83a
+204016c8
+204021d5
+c597a1e9
+783cfc00
+2000001e
+204021d5
+7857fc00
+7826fc00
+7830fc00
+78507c00
+78287c00
+6fe14838
+98003600
+37c18400
+242c223d
+20404caf
+c517a1f6
+7846fc00
+7825fc00
+7823fc00
+7824fc00
+2040223a
+67e0c85a
+6848c859
+98467c00
+2422a23f
+476fc03b
+7858fc00
+280ffe2f
+2040a22c
+2038a23f
+2040223a
+67e0c7a4
+c513a209
+6fe0c7a4
+6848c836
+a8400e00
+2420a23f
+2040223a
+280ffe2f
+2040a235
+e7e08005
+1fe97e00
+1fe67c1f
+2421223f
+1fe27200
+2022a215
+2040223a
+e7e08005
+c2002212
+c513a21a
+18a22200
+2040223a
+67e0c87e
+1a220a00
+09800018
+1fef7e00
+1ff17e00
+e7e18005
+7845fc00
+280ffe27
+2040a5de
+2023223f
+20404cae
+7837fc00
+204017b0
+4770403c
+c6138000
+6fe0c87e
+6848c8cd
+98467c00
+20417e4c
+202025e2
+2040223a
+1fe67c01
+20217e5c
+1fe0fffe
+c513a233
+203a7e5c
+1fe0ffff
+67e08964
+20600000
+1fe17e07
+68488964
+18498400
+9841fe00
+20600000
+09800008
+19897e00
+20600000
+280ffe27
+2040a5fa
+204016b2
+784dfc00
+7845fc00
+20200e80
+20401161
+6848c83a
+20201205
+4770c03c
+6fe0c865
+2040168b
+6fe2483c
+98001200
+204021d5
+20402243
+79202a00
+782efc00
+78307c00
+7850fc00
+20404cb5
+785d7c00
+c517a273
+c516a285
+19317e00
+1fecfe00
+1ff1fe00
+08008628
+c517a25c
+784efc00
+782dfc00
+7823fc00
+7824fc00
+6fe0c837
+98007200
+d8c047e6
+efe08006
+08008608
+c2002261
+78247c00
+08008618
+78447c00
+c597a26b
+7843fc00
+58000000
+08008603
+37d38200
+20000064
+785d7c00
+784efc00
+784dfc00
+785c7c00
+20401161
+20204cb3
+df20000a
+5800003c
+08008608
+c2002274
+784efc00
+783c7c00
+19317e00
+1ff17e00
+1ff1fe00
+08008620
+c5172282
+58000001
+08008605
+783d7c00
+20202259
+58000000
+08008605
+20202259
+6fe0c1f0
+1fe37200
+20000002
+c2002287
+19317e00
+1fecfe00
+1ff18400
+18427e00
+08008608
+18427e00
+08008628
+20202259
+6fe0c865
+c28122b0
+6fe0c835
+1fe0fe03
+67e0c837
+6fe0c859
+67e0c7e6
+6fe0c836
+e7e08005
+6fe0c835
+1fe9fe00
+6848c82b
+18410403
+18438400
+9841fe00
+6848c82c
+9840fe00
+e7e08005
+6fe0c835
+98007200
+d8c047c6
+20407d5f
+c6938000
+6fe08019
+e7e08005
+6fe0c865
+c3810000
+6fe0c837
+1fe0fe01
+67e0c837
+20600000
+6fe0c835
+1fe0fe04
+c593a2b4
+1fe0fe01
+67e0c837
+6fe0c859
+67e0c7e6
+6fe0c837
+1fe0fffe
+e7e08005
+6fe0c836
+e7e08005
+58000000
+2020229b
+6fe0c7a5
+1fe97e00
+67e0c82a
+1fe0fe01
+d8c047a5
+98c08c00
+efe18006
+67e1c82d
+6fe0c7a5
+1fe37e00
+1fe17e03
+67e0c833
+20600000
+6848c83b
+204022cf
+6048c83b
+20600000
+204022d3
+18408401
+18410403
+20600000
+6fe0c83c
+1fe17e03
+1fefa204
+58004840
+9a20fe00
+98408c00
+efe08006
+67e0c83a
+20600000
+67e2483c
+da200000
+df200004
+d8c0483c
+efe08006
+9a20a200
+c20022e0
+1a227e00
+67e14857
+6fe0c857
+6848c858
+9840fe00
+67e0c859
+20600000
+20407e56
+684a4850
+1c427e00
+98467c00
+244122f9
+1fe22400
+6fe24850
+6848c854
+98408400
+1a427e00
+98467c00
+24610000
+793ffe1c
+67e24850
+20207e54
+20628000
+79207e1c
+20600000
+58000000
+67e24850
+20600000
+38001300
+3805908b
+380b6150
+380c3d20
+67e4c840
+38003a1a
+3804c453
+3808d312
+380c0001
+e7e38005
+6fe0c866
+207a0000
+d8c04867
+d8a04840
+20207d0c
+584e001e
+67e1c868
+58032303
+e7e18005
+58250642
+e7e18005
+58094c06
+e7e18005
+583c0927
+e7e18005
+70486601
+20600000
+d8407530
+c513a320
+d84012c0
+6fe0c864
+c3012320
+d8402ee0
+60494838
+20600000
+70486401
+70486501
+20600000
+70487b4e
+58101520
+67e1c877
+58000005
+e7e08005
+20600000
+da604883
+da40267c
+20203191
+79200026
+6fe0c8a1
+793ffe02
+79207e01
+67e0c8a1
+58000000
+67e14887
+6fe14881
+67e14883
+70488000
+2040236c
+70482b00
+6fe0c87b
+67e0c83a
+6fe0c87c
+67e0c1e8
+6fe24877
+202022dc
+4771403c
+6fe0c87f
+c07fa38e
+c000a348
+c001234a
+c001a350
+c0022356
+20600000
+7047c6ff
+20202357
+6fe0c85b
+203a234e
+6fe248a9
+204022dc
+7047c6aa
+20202357
+7047c655
+6fe0c85b
+203a2357
+6fe24891
+67e247c8
+20202359
+7047c622
+6fe248a9
+67e247c8
+6fe0c836
+1fe17e07
+67e0c7c7
+7047cc00
+70483507
+20402291
+2040265b
+246c0000
+24778000
+20402597
+20402672
+4771c03c
+6fe0c87f
+c17f8000
+c000a371
+c0012373
+c001a379
+c0022381
+20600000
+70487f02
+6fe0c85b
+207a0000
+70487f01
+20600000
+70487f02
+20202657
+6fe0c85b
+203a2377
+6fe2480c
+67e24891
+70487f03
+20202657
+6fe0c85b
+203a237f
+6fe2480c
+684a48a9
+98467c00
+24628000
+70487f04
+20202657
+6fe0c85b
+203a2387
+6fe2480c
+684a4891
+98467c00
+24628000
+70487fff
+70095b39
+20407871
+58000000
+67e14883
+6fe2480c
+204022dc
+6fe0c8a1
+793ffe01
+67e0c8a1
+20202657
+7048bf01
+7048be00
+20600000
+6fe0c8be
+c3808000
+79207e01
+67e0c8be
+58000000
+67e1c87e
+67e248cd
+7048ba01
+20202339
+7048ba01
+70483508
+d8c04881
+d8a047c6
+20207d06
+20402427
+204021db
+2437a427
+204023b0
+243423ae
+20402455
+6fe0c85b
+207a0000
+6fe248cd
+207a0000
+202022dc
+20402427
+2020223f
+7048cb05
+20407e56
+d8c047a4
+d8a04891
+20407d06
+4772403c
+6fe0c893
+c05523bc
+c02aa3c9
+c01123e6
+c07fa5b5
+20202427
+6fe0c894
+c000a3c0
+c00123c6
+20600000
+70487e01
+70488101
+70488280
+6fe340a8
+67e34883
+20207e54
+70487f01
+70488102
+202023c2
+6fe0c85b
+203a23cf
+6fe24895
+684a40a8
+98467c00
+24628000
+6fe0c894
+c000a3d3
+c00123de
+20600000
+6fe0c87e
+c000a3d6
+20600000
+70487e02
+6fe0c85b
+203a23c1
+70488101
+70488280
+6fe248cd
+67e24883
+20207e54
+6fe0c87f
+c000a3e1
+20600000
+70487f02
+6fe0c85b
+203a23c7
+70488102
+202023da
+6fe0c85b
+203a23ec
+6fe24895
+684a48cd
+98467c00
+24628000
+6fe0c894
+c000a3f0
+c00123fa
+20600000
+6fe0c87e
+c00123f3
+20600000
+204023c1
+6fe0c880
+1fe1fe01
+67e0c880
+58000000
+67e1487e
+20600000
+6fe0c87f
+c08023fd
+20600000
+204023c7
+6fe0c880
+1fe1fe02
+67e0c880
+204023f7
+6fe0c09a
+c1820000
+6fe0c8e9
+c12d8000
+7048e95b
+20403657
+20205d8c
+79200027
+6fe0c1e8
+67e0c8cc
+2040231a
+202025ed
+6fe14889
+20207e05
+70483500
+6fe0c8ba
+207a0000
+6fe1488b
+20207e05
+20402452
+2437a427
+20402444
+24342427
+6fe0c82a
+203a2427
+1fe0fe02
+98007200
+d8c047a4
+d8a04891
+20407d5f
+7048bc00
+6fe0c8b9
+205a245f
+6fe0c893
+c000a42a
+c0012438
+c07fa5b5
+d8a047a4
+df200042
+20207d26
+20402553
+6fe0c8b3
+6848c891
+284ffe03
+7920fe00
+67e0c8b3
+c000a43d
+6fe0c8bb
+6848c891
+284ffe04
+7920fe00
+67e0c8bb
+6fe1488d
+20207e05
+6848c891
+284ffe03
+2020a442
+6fe1488f
+20207e05
+6fe0c09a
+1fe67c0e
+2042b476
+6fe2489b
+202025bc
+6fe2489b
+202025c1
+20407e56
+6fe0c833
+6848c834
+98467c00
+2442fe54
+6fe0c833
+67e0c834
+6fe1c82d
+6849c830
+98467c00
+2442fe54
+6fe1c82d
+67e1c830
+20600000
+20402427
+204021db
+24778000
+6fe0c7a4
+67e0c836
+204022be
+6fe0c7a5
+2feffe00
+2020a45e
+20402410
+20402291
+20402246
+2020223f
+7048bd01
+58000280
+d8e00008
+20207d66
+7048bc01
+7048c000
+704854ff
+202022fc
+4772c03c
+6fe0c8bc
+207a0000
+204022ea
+24740000
+20402474
+6fe0c8c0
+1fe0fe01
+1fe17e01
+67e0c8c0
+c0002479
+c000a47c
+20600000
+6fe0c8cb
+207a0000
+1fe0ffff
+67e0c8cb
+20600000
+6fe0c8cb
+247a0000
+2020248d
+6fe0c8cb
+247a0000
+20202392
+6fe0c8be
+c3800000
+79207e00
+67e0c8be
+6fe0c8cc
+67e0c1e8
+7048ba00
+700bf900
+7048b301
+70482b00
+6fe240a8
+204022dc
+204022cb
+20202427
+7048ba00
+7048bf00
+7048be00
+20600000
+6fe0c8bf
+c1800000
+2040247f
+2040253e
+20202415
+4773403c
+6fe0c8bf
+c1808000
+20402395
+204023a3
+6fe0c8b9
+247a0000
+6fe0c880
+207a0000
+7048bc00
+2040248d
+2040245f
+202022fc
+6fe0c8be
+c3838000
+79207e07
+67e0c8be
+7048c000
+7048ba01
+58000000
+67e1c8de
+67e3c8c3
+2040252e
+24628000
+6fe0c83b
+67e0c8c2
+6fe0c83a
+67e0c8c1
+20600000
+4773c03c
+6fe0c8bf
+c1838000
+204024a3
+204024d7
+20402452
+2437a427
+2040252e
+2042a417
+7048bf00
+6fe0c8be
+79207e00
+67e0c8be
+6fe0c8ba
+1fe67c02
+2442a52c
+20402427
+2040245f
+2040252e
+2022a4d0
+6fe2483c
+684a48d5
+98467c00
+2022a4d3
+6fe2483c
+684a48d1
+98467c00
+2022a4d5
+20600000
+6fe0c8c2
+67e0c83b
+20600000
+6fe0c8c8
+202024d1
+6fe0c8c5
+202024d1
+6fe0c8c0
+1fe0fe01
+1fe17e03
+67e0c8c0
+c00024fa
+c000a514
+c00124e0
+c001a514
+20600000
+204023c1
+6fe248d1
+203a24d7
+204022dc
+6fe0c8c6
+205a24f5
+6fe0c8c4
+67e0c83a
+6848c8df
+6a2148e5
+204025c3
+6048c8df
+204025cb
+6048c8dc
+18467c50
+24610000
+6848c8c5
+204022cf
+6048c8c5
+67e0c8c4
+20600000
+7048c601
+d8400000
+204022d3
+67e0c8c4
+20600000
+204023c7
+6fe248d5
+203a24d7
+204022dc
+6fe0c8c9
+205a250f
+6fe0c8c7
+67e0c83a
+6848c8e0
+6a2148e7
+204025c3
+6048c8e0
+204025cb
+6048c8dd
+18467c50
+24610000
+6848c8c8
+204022cf
+6048c8c8
+67e0c8c7
+20600000
+7048c901
+d8400000
+204022d3
+67e0c8c7
+20600000
+204023c1
+6fe240a8
+204022dc
+6fe0c8c3
+205a2528
+6fe0c8c1
+67e0c83a
+6848c8de
+6a2148e3
+204025c3
+6048c8de
+204025cb
+6048c8db
+18467c50
+24610000
+6848c8c2
+204022cf
+6048c8c2
+67e0c8c1
+20600000
+7048c301
+6fe0c8c1
+67e0c83a
+20600000
+7048ba00
+20600000
+6fe2483c
+684a40a8
+98467c00
+20600000
+6fe0c8ba
+c1010000
+6fe0c8bd
+207a0000
+d8e00008
+20407d74
+247a0000
+7048bd00
+7048cb00
+7048bf07
+7048be00
+20202427
+6fe0c8b3
+c000a601
+6fe0c8bb
+c000a551
+684a48b4
+1c427e00
+98467c00
+244122f9
+1fe22400
+6fe248b4
+6848c8b8
+98408400
+1a427e00
+98467c00
+24610000
+793ffe1c
+67e248b4
+7048b301
+202022cb
+7048bb00
+202022cb
+1c427e00
+67e248b4
+20600000
+da604887
+da40267c
+20203191
+4774403d
+79200026
+6fe0c8a1
+793ffe01
+79207e02
+67e0c8a1
+6fe0c88c
+203a256e
+6fe0c88b
+c000a566
+c0012566
+c001a575
+c0022575
+6fe0c87c
+67e0c1e8
+6848c895
+6048c83b
+6fe2488d
+2040257e
+6048c895
+20600000
+7041e803
+6848c896
+6048c83b
+6fe24891
+2040257e
+6048c896
+20600000
+7041e803
+6848c897
+6048c83b
+6fe248a9
+2040257e
+6048c897
+20600000
+6fe2480c
+67e24891
+204022dc
+202022cb
+4774c03d
+2040259a
+2040265b
+242c25a1
+2437a5a1
+20402672
+6fe0c8a1
+793ffe02
+67e0c8a1
+58000000
+67e14883
+67e14889
+67e14887
+6fe24877
+684a483c
+98467c00
+2022a32e
+6fe248a9
+684a483c
+98467c00
+2042a57c
+70095b3c
+20407871
+df200004
+d8a047c6
+20207d17
+7047c6ff
+6fe0c836
+67e0c7c7
+6fe248a9
+67e247c8
+70483506
+20202291
+6fe0c88c
+203a22cb
+6fe14889
+1fe0fe01
+67e14889
+2feffe03
+6fe0c88b
+c000a5ad
+c00125af
+c001a5b1
+c00225b3
+2020256e
+2020a56e
+20202566
+2020a575
+20202566
+2020a575
+2020256e
+2020a339
+20202575
+6fe0c894
+c000a5b9
+c00125be
+20600000
+20407e54
+6fe24895
+67e248cd
+67e248d1
+20600000
+20407e54
+6fe24895
+67e248cd
+67e248d5
+20600000
+1a227e00
+98408a00
+6fe08018
+e7e08005
+18408401
+6fe0c87d
+98410400
+20600000
+6fe0c87d
+1fe0fe01
+67e10987
+1fe27200
+1a220c00
+dfe00000
+e8408006
+9840fe00
+c20025d1
+68490987
+9846fc00
+20407def
+18078400
+c6138000
+18427e00
+c6930000
+20401295
+1fe20400
+20600000
+2040127d
+20201291
+6fe14899
+202025f4
+1fe22200
+6848c898
+6fe14899
+98408a00
+1a227e00
+e7e08005
+18408401
+6fe0c87d
+98410400
+6048c898
+20600000
+6fe148e1
+204025f4
+6fe148e3
+204025f4
+6fe148e5
+204025f4
+6fe148e7
+207a0000
+1fe20a00
+6fe0c87d
+1fe0fe01
+1fe27200
+20207d26
+204025de
+207a0000
+6848c8da
+6a2148e1
+204025c3
+6048c8da
+20600000
+6a2148e1
+204025cb
+6048c8d9
+18467c50
+24610000
+202022cb
+6fe240a8
+67e248a9
+2040231a
+202025e0
+58002fb2
+67e1c8ad
+58100c0c
+67e1c854
+5800bb80
+67e1c8b0
+7048c605
+20600000
+5800f80c
+67e1c8ad
+581c1919
+67e1c854
+58017700
+67e1c8b0
+7048c60b
+20600000
+c6930000
+6fe0c8a1
+c280a340
+c2812580
+6fe0c8bd
+c000a6c6
+4775403d
+20402631
+243426a1
+20402646
+204026ee
+6fe0c09a
+c00447ef
+6fe448b0
+67e4485c
+6fe148c2
+67e148c4
+204026bb
+24740000
+20407fdc
+6fe1c8ad
+2020150a
+20402634
+24740000
+20202291
+6fe1489b
+20407e05
+2034263a
+6fe3c7c7
+207a0000
+20207e54
+7048a700
+1a20fe01
+67e0c835
+20402642
+67e0c7c6
+1a420c00
+1a227200
+20207d5f
+6fe0c836
+1fe17e07
+67e0c836
+20600000
+7048a600
+6961015f
+34730200
+2040265b
+6fe0c82c
+c000a651
+242c2669
+2437a669
+20402672
+6fe0c09a
+c00447eb
+20402720
+20402597
+6fe0c82b
+1fe0fe01
+67e0c82b
+20402694
+58000000
+67e0c8a2
+67e148a3
+20600000
+7857fc00
+20402246
+6fe0c82c
+c000a23f
+18002a00
+6fe2483c
+98001200
+204010b0
+68488017
+2040118f
+204011a6
+204021e4
+2057a23f
+20600000
+6fe0c8a7
+247a0000
+6fe148a3
+1fe0fe01
+67e148a3
+6fe0c8a4
+c2822679
+2040267e
+20202647
+204022be
+6fe0c82a
+207a0000
+98007200
+d8c047a6
+d8a0480a
+20207d5f
+58000000
+67e148a3
+7048a501
+70095b3a
+20207871
+4775c03d
+6848c8a6
+6fe0c8c6
+98467c00
+2421269c
+18408401
+6048c8a6
+6fe0c8c6
+c002a68b
+6fe0c8a6
+c0032696
+c0062696
+20600000
+6fe0c8a6
+c001a696
+c0032696
+20600000
+c517a692
+67e0c7e7
+20600000
+67e0c7e8
+20600000
+6fe0c836
+c4020000
+6fe0c836
+793ffe04
+67e0c836
+2040268f
+20402724
+202022cb
+20402714
+20402724
+202022cb
+6fe1489d
+20207e05
+6fe0c8a7
+205a26a7
+6fe0c8bd
+c1008000
+2040269f
+202026b5
+70483601
+7048a701
+20402642
+67e0c7c6
+58000000
+67e3c7c7
+6fe248a9
+67e247ce
+7048350c
+6fe0c836
+79207e03
+67e0c836
+20402291
+20202624
+204026bb
+24740000
+6fe4485c
+20407daa
+604a4160
+20201497
+4776403d
+78347c00
+20401465
+6fe1c174
+203a7e56
+6fe0c099
+203a7e56
+6fe0c8bd
+c000fe56
+6fe1489f
+20207e05
+204022ea
+24740000
+204026db
+6fe148be
+1fe0fe01
+67e148be
+684948c0
+98467c00
+2042a6d0
+20202621
+7048bd00
+58000000
+67e148be
+58000064
+67e148c0
+7048bc00
+6fe0c855
+67e0c854
+20600000
+6fe0c856
+202026d7
+6fe0c8bc
+1fe0fe01
+67e0c8bc
+c00226d9
+c002a6d5
+20600000
+7048bd01
+58000000
+67e148be
+20600000
+df200002
+d8c0483c
+20407e54
+5800ffff
+e8410006
+98467c00
+2442fe56
+c20026e9
+20600000
+4776c03d
+6fe1478c
+c3858000
+c3838000
+c3830000
+6a214899
+204025cb
+6048c8c7
+6fe0c8cc
+c51326f9
+6fe0c8cf
+98467c00
+24212713
+6fe0c8c9
+1fe67c02
+24212701
+6fe0c8c9
+c0002714
+20600000
+6fe0c8c9
+6848c8ca
+98467c00
+24628000
+7048c900
+6848c8c7
+6fe0c8cb
+c513270a
+6fe0c8ce
+98467c00
+24610000
+6fe0c8c8
+c000271b
+1fe0ffff
+67e0c8c8
+c000271b
+7041e800
+20600000
+7048c900
+6fe0c8c8
+c0012719
+1fe0fe01
+67e0c8c8
+c000a711
+7041e806
+20600000
+7041e885
+20600000
+7048c801
+7048c900
+20600000
+6fe0c8c9
+1fe0fe01
+67e0c8c9
+20600000
+6fe0c8c9
+1fe67c02
+2441272c
+6fe0c8c9
+c1000000
+1fe0ffff
+67e0c8c9
+20600000
+7048c903
+20600000
+6fe08be0
+67e089f6
+1e020c00
+20407d0b
+20402785
+6fe149b7
+20207e05
+6fe089f7
+c000273d
+c0402d68
+c0412e5e
+c068a789
+c06827a2
+c06aa7a2
+20600000
+d8c009fb
+d8a04afe
+20407d0c
+70493300
+20402ae5
+20402757
+20402748
+2040274d
+70493300
+6fe149b9
+20207e05
+6fe08c3a
+70493304
+c1008000
+70493300
+20600000
+58000080
+67e08a10
+58000003
+e7e08005
+58000000
+e7e08005
+6fe189f8
+e7e18005
+700a0f06
+20202ff2
+6fe149d9
+c3810000
+20402de1
+1a20a606
+5fffffff
+e7e40013
+e7e40005
+efe10011
+e7e10013
+1a427e00
+9a20a200
+c200275a
+6fe149d5
+20207e05
+58000082
+67e08a10
+58000004
+e7e08005
+6fe089f9
+e7e08005
+700a0f03
+20202ff2
+58000082
+67e08a10
+5800004e
+e7e08005
+6fe109f9
+e7e10005
+700a0f04
+20202ff2
+58000082
+67e08a10
+58000060
+e7e08005
+6fe209f9
+e7e20005
+700a0f06
+20202ff2
+5800005e
+67e08a10
+58000000
+e7e08005
+6fe109f9
+e7e10005
+700a0f04
+20202ff2
+6f208be0
+1e022200
+da400050
+202029db
+204027a3
+24740000
+6fe109fb
+d840f01f
+98467c00
+2022a7b7
+d840f010
+98467c00
+2022a7bb
+d840f011
+98467c00
+2022a7c4
+d840f012
+98467c00
+2022a7cd
+d8400534
+98467c00
+2022a7ae
+d8400533
+98467c00
+2022a7b1
+d8400123
+98467c00
+2022a7b4
+20600000
+20600000
+20407e56
+6fe109f8
+d84001a8
+98467c00
+24628000
+6848c7a4
+6fe089fa
+98467c00
+20628000
+67e0c7a4
+20207e54
+2040281f
+6fe149c9
+20207e05
+2040281f
+6fe149cb
+20207e05
+20402819
+6fe149cd
+20207e05
+2040281b
+6fe209fd
+67e247a6
+20202850
+20402815
+204027e6
+207a0000
+6fe089fd
+204027e2
+684c09fd
+e0440005
+6fe149d7
+20207e05
+20402817
+204027e6
+207a0000
+700a0459
+6fe089fd
+204027e2
+6fe409fd
+e7e40005
+202027c2
+204027df
+204027e6
+207a0000
+6fe089fd
+207a0000
+204027e2
+d8400000
+e0408005
+6fe089f6
+1fe67c08
+2042a7d9
+202027c2
+204027e6
+6fe089fe
+204027e2
+d8400000
+e0408005
+20600000
+6fe089f6
+c003a81f
+2020281d
+1fe0ffff
+1fe9fe00
+98a08a00
+20600000
+20402de1
+1a20a204
+6fe0ca12
+9a4ffe00
+9a20a200
+efe10011
+1fe20a00
+20600000
+580000d3
+67e08a10
+580001a8
+e7e10005
+6fe0c7a4
+e7e08005
+e0410005
+20600000
+d8e00000
+d8400003
+da20f009
+20202827
+da200100
+20202827
+d8e00000
+da20f004
+2020282c
+d8e00000
+da200534
+20202827
+d8e00000
+da200533
+20202827
+d8e00000
+20402e94
+da200121
+2020282c
+d8e00000
+20402ea2
+da200122
+2020282c
+18438400
+18418411
+da20f009
+2020282c
+20402833
+5800f009
+e7e10005
+20600000
+df200008
+20202821
+df200008
+20202821
+df200006
+20202821
+df200004
+20202821
+df200002
+20202821
+df200001
+20202821
+1f20fe06
+67e08a0f
+204027ee
+d8c009fd
+20407d5f
+20202ff2
+20402833
+e2210005
+e0408005
+700a0f07
+20202831
+20402833
+e2210005
+e0410005
+700a0f08
+20202831
+20402ef8
+20202ff2
+6fe0c932
+67e08c14
+580000f0
+67e10c35
+6fe0c7a5
+1fe0fe01
+67e0c7a5
+c0602842
+580000d4
+67e08a10
+580001a8
+e7e10005
+6fe0c7a5
+e7e08005
+20600000
+7047a580
+20600000
+1c420400
+6fe247aa
+98467c00
+20412856
+2040285d
+98467c00
+20610000
+20402851
+6fe247a6
+1fe0fe01
+67e247a6
+20202861
+1c427e00
+67e247aa
+6fe0c7ad
+1fe17e0f
+67e0c7ad
+20600000
+20628000
+1fe22400
+58100000
+1fed7e00
+98408400
+1a427e00
+20600000
+df200014
+1fe0fea0
+c200285e
+20600000
+20402de1
+1a20a204
+704a1200
+20402eee
+efe10011
+203a2869
+1fe26000
+20402873
+20402ef3
+6fe0ca12
+1fe0fe01
+67e0ca12
+6848c9db
+98467e00
+20628000
+1a427e00
+9a20a200
+20202864
+df200028
+1f227e00
+67e08c00
+efe08030
+245a287d
+1e00e008
+6fe08c00
+1fe27200
+c2002874
+20600000
+e8440030
+604c09fd
+6fe08a04
+c02ca897
+684a47a6
+6fe209fe
+98467c00
+6fe08a04
+2022a887
+20600000
+67e089f9
+6fe149bf
+20407e05
+1e027e00
+67e10c08
+68e0ca12
+e8408030
+2040280d
+684889f9
+68e0ca12
+204027fa
+6fe10c08
+1fe26000
+58000000
+e7e08030
+202027c2
+6fe247a6
+d840003c
+9846fc00
+20407def
+18077e00
+247a0000
+6fe247a6
+d8454600
+98467e00
+d8493a80
+9846fc00
+20407def
+18077e00
+d8415180
+9846fc00
+20407def
+18072200
+18078e00
+58000000
+f9207e00
+68488a00
+98417e00
+207a0000
+1a227e00
+d840003c
+9846fc00
+20407def
+18078400
+580001e0
+98408400
+6fe109fe
+98467c00
+24628000
+6fe08a03
+20202887
+4777403d
+700a7414
+6fe0c957
+67e08a75
+6fe08bff
+1fe0fe0b
+1fe0f3fe
+67e08a76
+1fe0ffff
+e7e08005
+5800002a
+e7e08005
+d8c04b3d
+20407d52
+6a210c02
+204028cb
+2020793f
+1a208c02
+efe10006
+67e1448a
+da200a74
+20600000
+da6028d2
+20202dec
+1a208c16
+efe08006
+c1808000
+58000002
+1a208a16
+e7e08005
+20202a09
+204028e7
+1840fe0d
+67e0c7ae
+204028fe
+1840fe09
+e7e08005
+580000ff
+e7e08005
+6fe40bec
+e7e40005
+1a220c00
+18427200
+20407d5f
+20202943
+580ea801
+67e18bec
+58000007
+67e08bef
+6fe0c8d1
+67e08bf0
+6fe08a75
+67e08bf1
+6fe08a74
+2feffe07
+204028f5
+67e08bf2
+60488bf3
+20600000
+da200a79
+d8400012
+58000021
+24608000
+da200a8b
+68488a76
+184085ee
+58000022
+20600000
+d8a047af
+58000002
+e7e08005
+58000001
+e7e08005
+58000002
+e7e08005
+20600000
+d8401827
+58000003
+e7e08005
+58000003
+e7e08005
+e0410005
+20600000
+2020290e
+204016a5
+20401c38
+20402918
+24768000
+6fe08002
+1fe0fe01
+67e08002
+6fe149b5
+20407e05
+202016b2
+2040291a
+2020174a
+6fe0c7ce
+1fe0fe01
+67e0c7ce
+67e08016
+c1940000
+7047ce25
+70001625
+20600000
+6fe0816b
+1fe17e0f
+c0002927
+c0012927
+20600000
+e8408006
+18467c06
+20610000
+18467c25
+24610000
+1840a3fa
+18c0a406
+e8408012
+18467c01
+20610000
+18467c1e
+24610000
+18427e00
+207a0000
+4777c03d
+efe08006
+c07fac3d
+c0152f06
+c003acb5
+1840fe01
+9a267c00
+20610000
+9a40a400
+18467fff
+9a20a200
+1a227e00
+207a0000
+2020292e
+6fe08000
+1fe0fe01
+67e08000
+4778403e
+204016a5
+df200027
+d8c041f5
+d8a00a97
+20407d52
+70001625
+db600708
+7856fc00
+20401c38
+2040295f
+180a7e00
+d84001ff
+98417e00
+1fe0fe64
+20407d0e
+6fe08016
+1fe0fe01
+67e08016
+c094294f
+df200027
+d8a041f5
+d8c00a97
+20407d52
+202016b2
+d8400002
+6048c1f5
+6848c7ae
+1840fe06
+67e0c1f6
+6fe3437a
+67e341f7
+18427200
+d8c047af
+20407d52
+20201836
+4778c03e
+68490be1
+6fe08be0
+18420c00
+da2048f2
+de004902
+20402b88
+20407e56
+1a627e00
+9e008c00
+684a4902
+6fe10bfd
+1fe22200
+df20000a
+efe20011
+203a2985
+98467c00
+20628000
+1a20a204
+c2002978
+6fe10bfd
+1fe20a00
+1fe08c04
+df200024
+20407d52
+e0420005
+20207e54
+e0420011
+20207e54
+2040298e
+20402992
+20402999
+2040299d
+204029a1
+204029a5
+202029a9
+d840001a
+da20499b
+da400000
+20205ddc
+d8400013
+da20493e
+da40001a
+20405ddc
+6fe0c94e
+67e0ca16
+20600000
+d8400010
+da204afe
+da40002d
+20205ddc
+d8400010
+da204824
+da40003d
+20205ddc
+20600000
+d8400001
+da40004d
+20205ddc
+d8400003
+da204b37
+da40004e
+20205ddc
+6fe149d9
+c3810000
+d8400040
+da20098e
+da400051
+20405ddc
+20402de1
+d8c0098e
+1a20a206
+1a220a00
+20407d0c
+1a427e00
+9a20a200
+c20029b2
+20600000
+204029bb
+204029bf
+202029c3
+d8400013
+da20493e
+da40001a
+20205e02
+d8400010
+da204afe
+da40002d
+20205e02
+d8400010
+da204824
+da40003d
+20205e02
+d8400003
+da204b37
+da40004e
+20205e02
+204029d0
+d8400040
+da20098e
+da400051
+20205e02
+20402de1
+d8a0098e
+1a20a206
+1a220c00
+20407d0c
+1a427e00
+9a20a200
+c20029d3
+20600000
+d8400000
+202029e3
+d8400001
+202029e3
+d8400002
+202029e3
+d8400003
+202029e3
+d8400004
+202029e3
+4779403e
+20407cc8
+20405f11
+580000aa
+e7e08003
+58000003
+e7e08003
+1f20fe04
+e7e08003
+e0410003
+e2410003
+1a220c00
+20405f1f
+580000bb
+e7e08003
+20405f15
+20207cd4
+204029fb
+d84e1000
+20405eca
+20405ed7
+d8400081
+60588061
+20600000
+58001c00
+67e1095c
+58001c01
+e7e10005
+58001c02
+e7e10005
+58001fff
+e7e10005
+6fe4095c
+20205eb2
+20402a15
+20202a0d
+20402a72
+20202a68
+7047cf01
+20600000
+7047cf00
+20600000
+da402a11
+da200015
+d8e0000d
+20202a5d
+6fe0c933
+c1800000
+da602a19
+20202dec
+da402a26
+da20001d
+d8e0000e
+20202a5d
+1a208c1a
+efe08006
+c4008000
+204028cb
+20407967
+24740000
+6fe08a76
+1fe0fffe
+67e08a76
+6fe08a74
+79407e07
+e7e08012
+202028d9
+6fe0c933
+c0002a2a
+c0012a5b
+20202a4a
+da602a2c
+20202dec
+204028cb
+20407967
+24740000
+6fe08a74
+1fe0ffff
+e7e08012
+c2832a3d
+1fe17e3f
+205a2a44
+6a210c02
+1a208c1a
+efe08006
+c4000000
+d8a047ae
+d8c00a76
+20407d0a
+20202943
+1fe17e3f
+247a0000
+6a210c02
+1a208a16
+58000000
+e7e08005
+2020793a
+da200a74
+20407956
+20407985
+247a0000
+700a7454
+2020793f
+20402c16
+20402c22
+20402c30
+20402a53
+24628000
+6fe0c933
+c001aa57
+c000aa59
+20600000
+6fe0c7d2
+1fe0ffff
+67e0c7d2
+20600000
+7047d358
+20202a0b
+7047d306
+20202a0b
+20402c93
+20202943
+180a7e00
+1fe17e07
+9a20a200
+6fe0c7cf
+c1808000
+20407d74
+247a0000
+1a227e00
+20407d66
+1a427e00
+20207e05
+da6047d0
+da402a6b
+20203191
+6fe0c933
+c1808000
+6fe0c936
+79207e00
+67e0c936
+70493303
+20202a7b
+da6047d3
+da402a75
+2020318a
+6fe0c933
+c001aa7b
+c000aa79
+20600000
+7047d206
+20202a09
+7047d206
+20202a09
+20402a83
+20402a8b
+20402a90
+20402a95
+20402a9d
+20202aa1
+20402aae
+d8c04844
+df20000f
+20402b0e
+20402b28
+d8c00900
+d8a04834
+20207d0c
+20402ab1
+20402b28
+d8c00900
+d8a047e4
+20207d0c
+20402ab1
+20402b28
+d8c00900
+d8a04814
+20207d0c
+6fe44804
+67e447dc
+6fe4480c
+67e447d4
+d8c047d4
+da204834
+de0047f4
+20202b76
+d8c04804
+da204834
+de004804
+20202b76
+d8c047f4
+df200010
+20402b0b
+d8c0485d
+df200009
+20402b0e
+20402b28
+d8c00900
+d8a04824
+20207d0c
+20402aaf
+d8c04804
+20202b0a
+20402aac
+d8c0480c
+20202b0a
+d8c0499b
+df200004
+20402b11
+d8c0499f
+df200006
+20402b11
+d8c049a5
+df200010
+20202b0b
+20402ac6
+da20493b
+da400900
+df20000b
+efe10011
+e8410012
+9842fe00
+e7e10011
+1a20a202
+1a40a402
+c2002abe
+20600000
+d8c047f4
+df200010
+20402b0b
+d8c04853
+df20000a
+20402b0e
+20202b28
+d8c0493e
+d8a04891
+20407d0c
+d8c04891
+da2048a1
+de0048b1
+20402b78
+de0048c1
+da400001
+58000000
+20402b7a
+6fe0c8d0
+1fe17e7f
+67e0c8d1
+de0048e2
+da400002
+58000010
+da2048c1
+20402b7a
+de0048d2
+da400003
+58000010
+da2048e2
+20202b7a
+d8c04afe
+da2048f2
+de004902
+20402b78
+d8c04912
+da204902
+de004922
+58000004
+20402b88
+6fe0c931
+1fe17e3f
+79207e06
+67e0c932
+20600000
+da204b3e
+6fe3cb44
+20202af8
+da200c0c
+6fe38c12
+67e38bc7
+58000000
+67e28bbe
+20402b01
+6fe30bce
+e8430011
+9842fe00
+e7e30011
+20600000
+6fe24a13
+67e20bc3
+d8c048d2
+20406dbe
+d8c00bbe
+20406dc0
+20406d59
+d8a00bce
+20206dd1
+df200008
+20402b18
+20402b67
+20202b15
+20402b18
+20407d5f
+20202b15
+20402b18
+20402b67
+5800002c
+e7e08005
+18a27e00
+67e14877
+20600000
+18c20400
+1f222200
+6fe14877
+1fe20a00
+6fe0c866
+205a2b21
+18420c00
+1a227200
+20600000
+70486601
+20402b25
+d8a00abe
+20600000
+df200020
+d8a00abe
+20207d17
+20402b45
+da400010
+da200abe
+6f244867
+204029d9
+20402b60
+58000abe
+67e1487e
+2040729b
+6fe1487e
+1fe20c00
+d8a004a8
+20407cff
+204072a2
+6fe1487e
+1fe0fe40
+67e1487e
+6fe0c87b
+1fe0ffff
+67e0c87b
+243a2b31
+204072de
+da200900
+df200020
+20407d37
+da400011
+da200900
+df200020
+202029d9
+70486600
+6fe14877
+1fe20a00
+d8400080
+e0408005
+d8400abe
+98467e00
+67e44867
+1fe98400
+604c486f
+1ff1a600
+1a6b2600
+1fe17e3f
+1fe67c37
+24412b5e
+1a60fe01
+67e0c87b
+1fefa240
+1ff22600
+1a60a7ff
+58000aba
+9a20a200
+6fe2486f
+e7e20011
+20600000
+1a60a601
+20600000
+da200abe
+df200004
+20407d37
+1a20a202
+1a60a7ff
+2422ab61
+20600000
+efe08006
+1ff18400
+20402b70
+e0408005
+1fe1040f
+20402b70
+e0408005
+c2002b67
+20600000
+18467c09
+20212b74
+18408457
+20600000
+18408430
+20600000
+58000020
+20202b88
+58000010
+20202b88
+6848c880
+18408401
+98408400
+604884a7
+1a220c00
+1fe27200
+20407d52
+6848c880
+18427200
+20407d5f
+1a427e00
+e7e08005
+da2048b1
+20202b8b
+67e084a7
+1fe27200
+20407d52
+1a220c00
+d8a0098e
+20407d0c
+da400012
+da2004a8
+6f2084a7
+204029d9
+da400013
+da20098e
+df200010
+204029d9
+20406a86
+1e020a00
+20406dd1
+da400014
+1e022200
+df200010
+202029d9
+68488beb
+20202ba0
+18000401
+18007000
+6fe10bde
+1fe20c00
+efe18006
+1fed7e00
+9841de00
+1f00f001
+efe20006
+1fe25e00
+1f00f001
+efe20006
+1fe25e00
+1f00f001
+1a30de00
+1df05e00
+efe10006
+9de1de00
+20600000
+6fe08be0
+1fe22200
+20402b9d
+20406d59
+1800700c
+1de27e00
+1a227200
+68490be1
+18420c00
+20406da8
+20206c88
+700beb19
+20202bc1
+700beb09
+20202bc1
+67e08be0
+60490be1
+4779c03e
+20402bb2
+18007008
+98005e00
+1800700d
+1de27e00
+18007009
+98005e00
+18002200
+18422600
+20402b9f
+20406d5f
+20402c00
+604c0be3
+6fe08be0
+1fe22400
+20402c08
+68488be0
+6fe10be1
+9840a200
+684c0be3
+e0420011
+6fe08beb
+1fe67e09
+207a0000
+e0440011
+20600000
+700beb19
+20202be2
+700beb09
+20202be2
+67e08be0
+60490be1
+18422600
+1fe22400
+9a608c00
+477a403e
+efe40006
+18007008
+98005e00
+18007009
+1fef7e00
+98005e00
+18002200
+20402b9f
+20406d5f
+20402c00
+604c0be3
+20402c08
+20402bb2
+20402c00
+6fe08beb
+c00cabfd
+604a0be7
+6fe20be3
+684a0be7
+98467e00
+20600000
+6fe40be3
+98467e00
+20600000
+1800700c
+1de27e00
+1800700d
+1de20400
+18500400
+18500400
+98418400
+20600000
+1a20a201
+20402b9f
+1a620c00
+20406dbc
+20406d5f
+20406dd8
+1a60a610
+1a40a5f0
+20212c08
+20600000
+70493301
+70493400
+7047cf01
+20600000
+580001a8
+67e10bec
+6fe0c935
+e7e08005
+6fe2499b
+20407d4c
+e7e20005
+6fe3437a
+e7e30005
+6fe1c936
+e7e18005
+20600000
+20402c24
+20202943
+7047ae15
+58000014
+67e0c7af
+5800002b
+e7e08005
+58000000
+e7e08005
+d8c00bec
+20407d0c
+6fe14939
+e7e10005
+20600000
+20402c32
+20202943
+7047ae1d
+204028fe
+20402906
+20402c37
+20202c2b
+58000015
+e7e08005
+58000016
+e7e08005
+e0410005
+20600000
+1840f3ff
+20402d01
+24740000
+efe08006
+c0002c45
+c0012c60
+c0032c7f
+20600000
+20402c52
+24740000
+20402a7d
+20402c4a
+20202ca9
+d8400012
+20402c81
+58000001
+e7e08005
+6fe149a3
+e7e10005
+d8c04804
+20207d0c
+20407e56
+e8410006
+d8a04804
+20407d0c
+6fe149a3
+98467c00
+24628000
+6fe0c934
+c3808000
+79207e01
+67e0c934
+70493302
+20402ca5
+20207e54
+18c22200
+6fe0c933
+c1000000
+6fe0c934
+c4008000
+c3810000
+1a220c00
+df200016
+d8a0493b
+20407d5f
+20402aba
+6849493b
+6fe149a3
+98467c00
+24628000
+20402cad
+6fe0c934
+79207e02
+67e0c934
+20402acd
+6fe0c94e
+67e0ca16
+20402c78
+20202cb1
+d8400006
+20402c81
+58000003
+e7e08005
+6fe3499f
+e7e30005
+20600000
+da400012
+20202ceb
+477ac03e
+20402c9f
+58008fff
+67e14955
+20402a09
+1840fe09
+67e0c7ae
+204028fe
+1840fe05
+e7e08005
+580000ff
+e7e08005
+580001a8
+1ff0fe00
+e7e10005
+6fe08bfc
+e7e08005
+20600000
+6fe24951
+243a2c96
+20202c9f
+1c427e00
+684a4951
+98460400
+6fe14955
+98467c00
+20610000
+20402a0b
+6fe149bb
+20207e05
+1c427e00
+67e24951
+20600000
+18c0a3fd
+da400001
+202029d9
+df200001
+da400002
+da204934
+202029db
+6f20c7ae
+da400003
+da2047af
+202029db
+df200001
+da400004
+da204934
+202029db
+6f20c7ae
+da400005
+da2047af
+202029db
+20402cf9
+24740000
+6fe08bef
+c0032ce9
+6fe0c933
+c1000000
+c1018000
+6fe10bf0
+684949a3
+98467c00
+24628000
+da200bf2
+da400007
+20402d0b
+20740000
+477b403e
+6fe08bef
+c0002cca
+c0012cce
+c0022cdd
+20600000
+6fe149a3
+67e10a78
+d8c00a78
+20202c45
+6fe0c933
+c1000000
+6fe0c934
+c4008000
+c3810000
+d8c00a7a
+df200014
+d8a0493d
+20407d5f
+20402ac6
+da20493d
+da400900
+df20000a
+20402abe
+20202c6f
+6fe0c933
+c1808000
+70493302
+d8400003
+20402c81
+58000005
+e7e08005
+6fe149a3
+e7e10005
+58000001
+e7e08005
+20600000
+d8c00bf0
+da400008
+477bc03e
+efe08006
+18c22200
+6848c8d1
+98467c00
+24628000
+20402c9f
+20402d0b
+20740000
+700c3a01
+68488a79
+18408401
+d8c00a7a
+20202f07
+d8a00bec
+20407d0c
+da200bec
+df200010
+20407d37
+df200010
+d8c00bec
+20202d01
+20407e56
+e8410006
+580001a8
+1ff0fe00
+98467c00
+24628000
+efe08006
+67e08bfc
+20407e54
+20202ca2
+477c403f
+20402d44
+20202d0e
+1a208c01
+e8408006
+1851fe00
+c000ad3e
+1fe67c04
+24217e54
+1fe27200
+20402d34
+18410e0f
+98e67c00
+2042ad2d
+18e08fff
+6fe08a78
+afefffff
+2020fe54
+f9207e00
+67e08a78
+1a208c02
+efe08006
+1fe27200
+1a427e00
+98effe00
+d8a00a7a
+98a08a00
+20407d52
+6fe08a78
+9a667c00
+2442fe54
+2422ad39
+20402d65
+20207e56
+1fe0ffff
+9a4ffe00
+1a208c02
+e8408006
+9840fe00
+67e08a79
+20600000
+da600000
+1f208fff
+f9202600
+c2002d35
+20600000
+6fe10a74
+1fe20a00
+d8c00a76
+df200021
+20207d52
+efe08006
+1fe27200
+67e08a79
+d8a00a7a
+20407d5f
+20207e56
+70495832
+20402d53
+68494959
+98467c00
+2022ad57
+18467c00
+2022ad57
+6849497a
+98467c00
+2022ad5a
+18467c00
+2022ad5a
+20402d65
+20402d53
+20202d57
+efe08011
+207a0000
+79207e08
+20600000
+67e14959
+58004959
+20202d5d
+67e1497a
+5800497a
+20202d5d
+67e10a74
+1fe20c00
+d8a00a76
+df200021
+20207d52
+da604958
+da402d65
+2020318a
+d8a04959
+df200042
+20207d26
+6fe089f8
+c024ad6d
+c00dad76
+c00e2d7d
+20600000
+20402d70
+6fe149d1
+20207e05
+58000080
+67e08a10
+5800004a
+e7e08005
+700a0f02
+20202ff2
+20402d9b
+6fe149d9
+c3810000
+20402da5
+20402dae
+6fe149d5
+20207e05
+20402d9b
+6fe149d9
+c3810000
+20402da5
+684909fb
+184cfe00
+1ff1fe00
+c0062d8b
+20402d90
+24740000
+58000000
+e7e10011
+6fe149d5
+20207e05
+5fffffff
+e7e40011
+e7e40005
+6fe149d5
+20207e05
+df200008
+efe10011
+da40ffff
+9a467c00
+2022fe54
+98467c00
+2022fe54
+1a20a202
+c2002d91
+20407e56
+20600000
+58000080
+67e08a10
+5800001f
+e7e08005
+58000000
+e7e08005
+6fe309f9
+e7e30005
+700a0f09
+20202ff2
+20402de1
+1a20a206
+6fe109f9
+6849494f
+18508400
+98467e00
+9a4ffe00
+9a20a200
+20600000
+684909fb
+df200008
+efe10011
+203a2db8
+da40ffff
+9a467c00
+2022adb8
+1a20a202
+c2002db0
+20600000
+18508400
+e0410011
+20600000
+20406dfb
+58002922
+67e149b5
+58002de5
+67e14465
+58002f68
+67e149cf
+580029b8
+67e149b9
+580029cb
+67e149d5
+580029c7
+67e149d3
+58002dea
+67e1446f
+58002735
+67e149b7
+20758000
+7047ce24
+20402842
+477cc03f
+204029f4
+20402df5
+da20493e
+da400000
+df200001
+204029db
+20402987
+20402ddd
+6fe0c93e
+c07fac12
+20402ae5
+20402acd
+202027f6
+6fe3499f
+20407d46
+67e3437a
+20600000
+6f20c9db
+6a2149dc
+6a4149de
+20600000
+20402844
+20402a05
+20403018
+204028d0
+2020290d
+20402a07
+20202d62
+20402de1
+20402eee
+1a627e00
+20407e05
+20402ef3
+1a427e00
+9a20a200
+c2002ded
+20600000
+7080700c
+7080734d
+7080722c
+7080712d
+7080743e
+20205dbf
+477d403f
+6fe08c14
+c283ae00
+704b0e00
+20202fb6
+20402e05
+20402e22
+20740000
+20402e32
+20202e3e
+df200003
+da200c15
+20407d37
+6fe18c15
+1fe1041f
+6048c9e4
+1ff1fe00
+1fe37e00
+1fe1041f
+6048c9e3
+1ff1fe00
+1fe37e00
+da201fff
+9a210400
+1fe22400
+6fe149e1
+98467c00
+2442ae1e
+604949e1
+1a4cfe00
+1ff1fe00
+1fe37e00
+67e0c9e0
+67e0cb0e
+20600000
+58000000
+67e249e5
+7049ea00
+20600000
+20407e56
+6fe0c9e3
+1fe20e00
+6fe249e5
+afefffff
+2020fe54
+f9207e00
+67e249e5
+6848c9e4
+1840f201
+1f208fff
+afefffff
+24608000
+c2002e2c
+7049e901
+20600000
+6fe08c0a
+1fe0fffa
+1fe27200
+6848c9ea
+98408400
+6048c9ea
+d8a049eb
+6fe0c9e3
+1feffe0c
+98a08a00
+d8c00c18
+20207d5f
+6fe0c9e9
+c1000000
+58000000
+67e2c9e5
+68490c0e
+18508400
+5800e000
+98410400
+6fe149e1
+9841fe00
+1ff0fe00
+67e10c0e
+20202fc0
+6fe08a0f
+1fe08401
+1fe27200
+60488bff
+6fe08c14
+793ffe07
+67e0cb46
+d8c00a10
+20407d52
+20202f9e
+1a208404
+1a227200
+60488bff
+d8a04b4a
+20407d52
+6fe08c14
+79207e07
+67e0cb46
+20202f9e
+6fe089f8
+c000ae65
+c0012e6b
+c0212e70
+c0262e73
+c02f2e79
+20600000
+da602e67
+20202edd
+6fe149bd
+20407e05
+67e089f9
+20202765
+da602e6d
+20202edd
+20402765
+6fe149bf
+20207e05
+2040277d
+6fe149c1
+20207e05
+6fe109f9
+20402e88
+67e089fe
+2040276d
+6fe149c3
+20207e05
+6fe14a0f
+684909fb
+98467c00
+20628000
+6fe109fb
+20402e9a
+67e08a03
+6fe109fb
+67e14a0f
+6fe149c5
+20407e05
+604909f9
+20402775
+6fe149c7
+20207e05
+207a0000
+1feffe64
+d840ffff
+9846fc00
+20407def
+18070400
+184c8400
+1807fe00
+18467cff
+24628000
+1fe0fe01
+20600000
+dfe0ffff
+984ffe00
+1fe6fc64
+20407def
+18078400
+20600000
+d8400320
+98462200
+20402ea9
+1a227e00
+9846fc00
+20407def
+1807fe00
+20600000
+18422200
+20402ea9
+1a227e00
+984ffe00
+d8400320
+98408400
+20600000
+58004e20
+d8400320
+98467e00
+1fe6fc64
+20407def
+18078400
+20600000
+d8e00000
+6f20c9db
+20407e56
+6fe1494f
+98467c00
+2022aebc
+1ff0fe00
+1fe0fe01
+1ff0fe00
+18e08e01
+c2002eb4
+20600000
+704a1100
+60e0ca12
+20402ef8
+20207e54
+d8e00000
+da600000
+20402de1
+20407e56
+6fe149d9
+c3012ed3
+efe10011
+98467c00
+2042aed1
+1a427e00
+9a20a200
+18e08e01
+c2002ec4
+1a627e00
+207a0000
+67e0ca11
+20207e54
+f9202600
+20600000
+1a208c06
+de000008
+efe10006
+98467c00
+2022aedb
+1e00e1ff
+2022aec9
+20202ed5
+20402ed1
+20202ec9
+d8e00000
+6fe0ca11
+203a2ee9
+1fe22400
+6f20c9db
+60e0ca12
+aa4fffff
+2040aee9
+68e0ca12
+18e08e01
+c2002ee2
+20600000
+20402eee
+20402ef8
+1a627e00
+20407e05
+20202ef3
+67210c00
+62210c02
+62410c04
+62610c06
+20600000
+6f210c00
+6a210c02
+6a410c04
+6a610c06
+20600000
+477dc03f
+6fe1494f
+1ff0fe00
+98e0fe00
+1ff0fe00
+67e14b3a
+20402de1
+18e27e00
+9a4ffe00
+9a20a200
+1a208c17
+efe10006
+67e1448a
+20600000
+700c3a00
+18467c0c
+20610000
+18467c1e
+24610000
+477e403f
+20402f60
+20402f2e
+24740000
+20402af6
+20402f57
+6fe08c0a
+d8400c12
+20402be0
+24628000
+477ec03f
+68490c12
+20402eb0
+20342f3b
+df20001d
+d8a00a98
+d8c00c0b
+20407d5f
+20402f24
+df20001d
+d8c00a98
+d8a00c0b
+20407d5f
+6fe149cf
+20207e05
+20402ec0
+20342f3b
+704a11ff
+5800ffcf
+98467c00
+2022af3b
+5800ffff
+98467c00
+2022af3b
+20600000
+20407e56
+68488c0b
+1851fe00
+1fe97e00
+6a20ca16
+1a212201
+9a267c00
+24628000
+1841047f
+6fe0c8d1
+98467c00
+24628000
+20207e54
+da204a17
+df20000a
+68490c10
+efe10011
+203a2f45
+98467c00
+2022af46
+1a20a205
+c2002f3d
+da204a17
+e0410011
+60490c35
+1a20a602
+efe18013
+67e18c37
+20202f4b
+20402f54
+6fe18c37
+68498c0d
+98467c00
+20610000
+e0418013
+20402f54
+20402fb1
+20202dfb
+da200c0d
+df200003
+20207d37
+20402f5a
+d8c048e2
+20206dbe
+d8a00c28
+58000000
+e7e08005
+6fe30c0c
+e7e40005
+20202fac
+1840fff4
+67e08c0a
+df20001d
+d8a00c0b
+20407d26
+1840f3ff
+d8a00c0b
+20207d52
+20402f79
+24740000
+20402f8e
+700a740a
+6fe08c0a
+1fe0840d
+60488a76
+184085ff
+e0408005
+5800002a
+e7e08005
+1840f3ff
+6fe38c0b
+d8c00c0b
+20407d5f
+da200a74
+2020793f
+20407e56
+6fe08c3a
+c1008000
+6fe149d9
+c3808000
+6fe0c933
+c1800000
+68490c10
+20402eb0
+24740000
+20402f93
+24740000
+20402f96
+6fe08c0c
+207a0000
+1fe0ffff
+207a0000
+67e08c0c
+58004a71
+67e1448a
+20207e54
+20402f57
+6fe08c0a
+d8400c12
+20402bbf
+20202af6
+58004a49
+67e10bfd
+2020296a
+df200002
+da200c12
+da400021
+204029db
+6f208be0
+6a210be1
+da400021
+202029d9
+477f403f
+20402fa2
+20402fab
+202028ba
+6fe08bff
+1fe0a202
+1fe0fe04
+67e08bff
+d8404b44
+20202fa8
+20402f57
+1a227e00
+20202bbf
+20202af3
+6fe24a13
+e7e20005
+18a0fff3
+67e10bde
+20600000
+6fe08c0a
+1fe0f20b
+da200c0b
+da400020
+202029d9
+c3032fb9
+20402fdf
+20202fbb
+20402fec
+20202fbb
+6fe08c0a
+1fe0fff9
+de000c15
+20407e56
+20202fcd
+6fe08c14
+c3032fc4
+20402fdf
+20202fc6
+20402fec
+20202fc6
+6fe0cb0e
+245a7e54
+205a7e56
+6fe0c9ea
+1fe0fffc
+7049ea00
+de0049eb
+1e020400
+20402fd9
+24628000
+df200001
+da200be0
+da400040
+204029db
+20402fdc
+24740000
+6fe10be1
+1fe26000
+2020272e
+24342be0
+1fe0fffc
+20202bde
+58004b0f
+67e10bfd
+2020296a
+20402fe2
+d8c04afe
+20206dbe
+d8a00c28
+58000001
+e7e08005
+6fe0cb0e
+d8400000
+7d3a0407
+e0408005
+6fe38c0d
+e7e38005
+20202fac
+20402fef
+d8c04824
+20206dbe
+d8a00c28
+58000002
+20202fe4
+477fc03f
+204030d7
+204030d8
+204030a7
+20402ffb
+20740000
+20403010
+da200c43
+2020793f
+20407e56
+d8400002
+6fe0c933
+98408400
+6fe08c3a
+1fe67c01
+79228406
+60488c43
+6fe4cb3d
+67e48c47
+6fe08a10
+c1ea0000
+6fe0c933
+c0807e54
+6fe08a13
+67e08c46
+6fe08c43
+1fe0fe01
+79207e05
+67e08c43
+20600000
+6fe08a0f
+1fe27200
+67e08c50
+6fe08c14
+67e08c51
+d8a00c56
+d8c00a10
+20207d5f
+da60301a
+20202dec
+1a208c16
+efe08006
+247a0000
+efe10006
+67e1448a
+da200c43
+20407967
+24740000
+6a210c02
+68488c43
+18417e0f
+203a3056
+1a208a16
+58000001
+e7e08005
+20403040
+68488c43
+20403046
+1a208a19
+e7e08005
+79200404
+184085ff
+e0408012
+68488c43
+284ffe04
+2420b05b
+68488c50
+60488a0f
+18427200
+d8a00a10
+d8c00c56
+20407d5f
+18467c0f
+2421303d
+20202e4b
+6fe20c52
+67e20c3e
+2020307c
+6fe08c51
+67e08c14
+6fe48c47
+67e4cb3d
+67e48c0b
+20600000
+58000003
+20403053
+6fe08c46
+284ffe05
+20608000
+58000001
+20403053
+58000000
+284ffe06
+24608000
+58000002
+20403053
+20207e60
+1a208a1a
+e7e08005
+20600000
+58000000
+1a208a19
+e7e08005
+da200c43
+20207956
+2040309f
+204030b3
+6fe4cb3d
+67e48c47
+20403074
+58000000
+67e0cb0e
+20403095
+68488a0f
+60488c50
+18427200
+d8c00a10
+d8a00c56
+20407d5f
+18467c0f
+2421306e
+da200c44
+20407976
+20202e4b
+204030bb
+6fe20c3e
+67e20c52
+da200c44
+20407976
+2020307c
+6fe08c50
+1fe27200
+67e08a0f
+6fe08c51
+67e08c14
+d8c00c56
+d8a00a10
+20207d5f
+204030c8
+58000a10
+67e10c3b
+20403040
+2040309f
+204030b3
+68488a0f
+5800000c
+20407e4a
+1fe22200
+18427e00
+9a267e00
+67e08a0f
+6fe10c3b
+1fe20c00
+9a208400
+60490c3b
+20402e55
+6fe08a0f
+207a0000
+6fe08c40
+1fe0fe01
+67e08c40
+204030c8
+2020307f
+6fe08c14
+c3033099
+20402fdf
+2020309a
+20402fec
+6fe08a0f
+1fe08404
+60488a0f
+d8400a10
+20202bbf
+6fe1cb37
+1fe0fe01
+67e1cb37
+6fe0c957
+1fe0fe01
+67e0c957
+6fe149d3
+20207e05
+6fe0ca16
+1ff27e00
+1fe9fe00
+6848c8d1
+9841fe00
+67e0cb3d
+6fe0cb3c
+67e0cb3e
+6fe14b3a
+67e14b42
+6fe10c35
+67e14b44
+6fe1cb37
+67e1cb3f
+da204b3f
+df200003
+20407d37
+6fe44b3e
+67e40c0c
+20600000
+6fe08a0f
+1fe6fc0c
+20407def
+18078400
+18077e00
+205a30d5
+60488c41
+700c4000
+6fe1cb37
+d8401fff
+98417e00
+67e10c3e
+20600000
+6fe10c3e
+1ff27e00
+1fe3fe00
+68488c40
+9841fe00
+1ff27e00
+1fe3fe00
+68488c41
+9841fe00
+67e1cb47
+df200003
+da204b47
+20207d37
+184085ff
+20600000
+20600000
+da200a10
+6f208a0f
+da400041
+202029db
+44d74015
+6fe0c09a
+203a30dc
+c0023620
+c007b247
+c004cad6
+c0053764
+c00733e2
+c006c9c0
+c0064cba
+c005adbb
+c00293df
+c0043bc1
+20600000
+700a5100
+7000e400
+7000e500
+58000000
+67e28870
+6fe0c09a
+203a30ea
+c005378d
+20600000
+20758000
+20405c15
+20405c1e
+20405c24
+20405c29
+20405c2f
+20405c33
+6fe0c09a
+c004cc15
+c002362c
+c0043c02
+c006ca90
+20600000
+7041efff
+580041ef
+67e140ca
+704790ff
+70417a88
+70417cce
+20600000
+204060dc
+204077b9
+20407887
+20403111
+6fe14465
+20207e05
+6fe14463
+20207e05
+6fe14461
+20207e05
+44d7c015
+da204772
+20407e31
+207a0000
+1fe22600
+2040311a
+2020313f
+da600000
+20600000
+c000b12c
+c0083173
+c002b150
+c0093157
+c003316f
+c00231b1
+c00131b6
+c009b1b1
+c00a3166
+c00ab16a
+c001b149
+c005b15b
+c0063162
+c00b3177
+c00c3145
+c0153135
+c015b133
+20600000
+6fe1478c
+79207e00
+67e1478c
+6fe14480
+793ffe00
+67e14480
+202078c9
+70030c00
+20600000
+6fe0830c
+1fe0fe01
+67e0830c
+1fe67c01
+202131ec
+70030c00
+6fe14480
+79207e09
+67e14480
+202031f6
+6fe14467
+20207e05
+6fe1445b
+20207e05
+6fe1445f
+20207e05
+6fe14480
+79207e01
+67e14480
+2020321f
+6fe1478c
+79207e07
+67e1478c
+6fe14480
+79207e02
+67e14480
+20600000
+6fe1478c
+79207e01
+67e1478c
+6fe14480
+79207e04
+67e14480
+20600000
+6fe1478c
+79207e03
+67e1478c
+20600000
+6fe1478c
+79207e05
+67e1478c
+6fe14480
+79207e03
+67e14480
+20600000
+6fe1478c
+793ffe05
+67e1478c
+20600000
+6fe1478c
+79207e09
+67e1478c
+20600000
+70443500
+6fe1478c
+793ffe09
+67e1478c
+20203225
+6fe1478c
+79207e02
+67e1478c
+20600000
+6fe14480
+79207e00
+67e14480
+20600000
+6fe14480
+79207e08
+67e14480
+202031f6
+67e0830d
+44d84016
+6fe0830d
+207a0000
+1fe0ffff
+67e0830d
+204077c5
+204031e3
+204031a4
+204031aa
+20405cdc
+204060d9
+6fe1446f
+20407e05
+2020317c
+efe08013
+207a0000
+1fe0ffff
+e7e08013
+247a0000
+1a427e00
+20207e05
+efe10013
+207a0000
+1fe0ffff
+e7e10013
+247a0000
+1a427e00
+20207e05
+684944ca
+1840a601
+da40319c
+2020318a
+2040323b
+c000b19f
+20203217
+58000002
+e7e08013
+1840a408
+efe10012
+20207e05
+da60447b
+da4031a7
+2020318a
+20400a61
+2022b21b
+20600000
+da604788
+da4031ad
+20203191
+204031fd
+20403215
+6fe14469
+20207e05
+204031c9
+6fe1478c
+793ffe07
+67e1478c
+20600000
+70447b00
+6fe1478c
+c283b1bb
+2fec0001
+2040b118
+44d8c016
+6fe1478c
+793ffe00
+793ffe01
+793ffe02
+793ffe03
+793ffe07
+67e1478c
+20203225
+204031c6
+20203217
+58000000
+67e1447e
+20600000
+58000000
+67e14480
+20600000
+6fe14480
+67e1447e
+58000000
+67e14480
+20600000
+6fe14480
+79207e07
+67e1447e
+58000000
+67e14480
+20600000
+6fe0c78c
+2feffe05
+20600000
+6fe0c641
+67e0c47b
+20600000
+d8e00009
+202015ba
+d8e00009
+202015be
+70447c05
+202031dd
+da60447c
+da4031df
+2020318a
+7045f301
+20600000
+7045f300
+20600000
+70095b0a
+2020787a
+70095b1d
+2020787a
+44d94016
+6fe0c47d
+67e080bd
+70030b01
+70095b03
+2020787a
+70095b1e
+2020787a
+70095b04
+2020787a
+6fe14791
+67e14788
+20403211
+70095b01
+2020787a
+58000000
+67e14788
+70095b02
+2020787a
+70095b0f
+2020787a
+70095b10
+2020787a
+70095b0e
+2020787a
+70095b0d
+2020787a
+70095b17
+2020787a
+70095b18
+2020787a
+70095b16
+2020787a
+70095b11
+2020787a
+70095b15
+2020787a
+70095b14
+2020787a
+70095b13
+2020787a
+70095b19
+2020787a
+70095b06
+2020787a
+70095b05
+2020787a
+70095b1f
+2020787a
+70095b20
+2020787a
+70095b25
+2020787a
+7920000d
+20600000
+793f800d
+20600000
+2040323b
+c0013231
+58000001
+e7e08013
+1840a203
+1840a406
+e8408011
+1a60a601
+e0408013
+202031a2
+58000000
+e7e08013
+6fe1478c
+c304b237
+20402187
+2040320f
+684944ca
+1840a202
+1840a404
+2020322d
+684944ca
+1840a600
+efe08013
+20600000
+2040323b
+c0803242
+20203217
+1840a40a
+202031a2
+58000002
+67e0c78a
+20600000
+20758000
+58003276
+67e1445d
+58006197
+67e1445f
+58003319
+67e14465
+58003318
+67e14461
+58003291
+67e14467
+580032ce
+67e1446f
+58003278
+67e1446d
+58003283
+67e1445b
+58003325
+67e1446b
+44d9c016
+204033be
+20403274
+20406172
+204033d0
+204077f0
+204077bb
+5800332f
+67e14870
+58003320
+67e14867
+5800331c
+67e14869
+5800327f
+67e1486b
+580033c5
+67e147b3
+580033c7
+67e147b5
+580033cc
+67e147be
+580033c9
+67e147c0
+6fe1478c
+c3860000
+20203217
+7045f707
+20600000
+204033a9
+20203217
+20401b77
+247a0000
+da2009d2
+20407956
+24740000
+d8c009d2
+20204c0d
+6fe148a1
+67e1489b
+70485d01
+202033b2
+6fe0c8a7
+c000b28c
+6fe1478c
+c304b28c
+6fe0c8a8
+c000b1dd
+6fe0c80a
+243a31dd
+202031df
+6fe0c8a5
+6848c8a6
+9841fe00
+c000b1dd
+202031df
+1a627e00
+c016b23f
+c0083227
+c00a3303
+c00ab30c
+c0203299
+c02232a3
+20600000
+2040329f
+6fe143db
+c000b2a9
+70489402
+7048993c
+20600000
+6fe08287
+c3828000
+704a6001
+20600000
+6fe0ca60
+207a0000
+704a6000
+6fe102c3
+203a32be
+20600000
+6fe14376
+203a32bc
+70489401
+684948be
+6fe14372
+9840fe00
+67e14372
+1fe22200
+6fe14374
+9840fe00
+67e14374
+9a20fe00
+1fe30400
+6fe148ca
+9846fc00
+20407dec
+67e14376
+70489a01
+20600000
+70489403
+20600000
+70417700
+70489a00
+6fe102c1
+684948c8
+98467c00
+79212200
+6fe148ca
+684902c1
+98467e00
+79212201
+2a200603
+20608000
+6fe448c8
+67e44372
+70489a01
+20600000
+20403198
+204032dd
+204032e2
+204032f9
+204032ee
+204032e8
+204032d6
+202032fd
+da604a61
+da4032d9
+2020318a
+204033d2
+204033d2
+204033d2
+202033dc
+da6048a3
+da4032e0
+2020318a
+7048a400
+20600000
+da60489d
+da4032e5
+20203191
+da6047c9
+da4047a8
+202033b4
+da604899
+da4032eb
+2020318a
+6fe14376
+67e0c177
+20600000
+da60489a
+da4032f1
+2020318a
+6fe08287
+2fe0c000
+2420b2f7
+70489401
+20403223
+20201f57
+70489a01
+20600000
+da60489b
+da4032fc
+20203191
+20203227
+da604897
+da403300
+20203191
+6fe148b1
+67e14897
+202033d2
+6fe148b1
+67e14897
+58000000
+67e1489d
+67e1489b
+20403380
+204033a9
+70417700
+20203205
+58000000
+67e24897
+67e1c894
+67e143db
+7048aa01
+6fe148a1
+67e1489b
+2040793a
+6fe0c863
+c1000000
+204033b2
+20203392
+2020332c
+6fe0c863
+c1810000
+2020332c
+da6047d7
+204033a5
+da6047d0
+202033a7
+70442700
+da6047e5
+204033a5
+da6047de
+2020331f
+6fe0c436
+c0093328
+20600000
+6fe14437
+c006b35a
+c005b395
+20600000
+6fe0c85d
+207a0000
+202061a3
+1a227e00
+203a3334
+18e27e00
+c0003337
+20600000
+18e27e00
+c000333f
+20600000
+7048a701
+da604801
+204033a5
+da6047fa
+204033a7
+6fe1478c
+c304b356
+20203345
+7048a700
+20203341
+6fe0c8a4
+c1808000
+7048a305
+20600000
+6fe0c8a4
+1fe0fe01
+67e0c8a4
+c000b34b
+c001334f
+20600000
+20403380
+70487b01
+da604876
+20203368
+7048a400
+70487b02
+da604876
+20403368
+6fe0c8a8
+c000b375
+20600000
+6fe148a1
+67e1489b
+20403380
+202033b2
+44da4016
+204034f3
+efe08011
+c001b360
+c003b364
+20600000
+6fe0c8a8
+c0003375
+c000b380
+20600000
+efe08012
+c000b388
+c000338d
+20600000
+44dac016
+6fe0c895
+2feffe00
+24608000
+1a608c06
+efe10006
+1ff0fe00
+1fe0f205
+1a608c03
+204034e7
+e7e08006
+1a622200
+2020793f
+6fe0c863
+207a0000
+7048a801
+da6047f3
+204033a5
+da6047ec
+204033a7
+70488a04
+70488d01
+da604885
+20203368
+6fe0c8a8
+207a0000
+7048a800
+204033a9
+70488a04
+70488d00
+da604885
+20203368
+7048a901
+70488a07
+70488d01
+da604885
+20203368
+7048a900
+70488a07
+70488d00
+da604885
+20203368
+6fe0c8a9
+207a0000
+20203375
+efe10011
+67e14895
+2feffe00
+24608000
+6fe0c8aa
+207a0000
+7048aa00
+6fe448c0
+67e44372
+704a6103
+70488a07
+70489a1e
+6fe0c8a9
+67e0c88d
+da604885
+20203368
+da200001
+202033a8
+da200000
+202033af
+da200000
+20407801
+da200001
+20407801
+6fe148ab
+20206216
+204077ec
+df200007
+2020780e
+da6047c2
+da4047a4
+204033b9
+204033a7
+6fe1489f
+67e1489d
+20203207
+efe10012
+67e14159
+efe10006
+67e14428
+20600000
+da200000
+204061d1
+6fe348ab
+67e3095c
+204061f8
+6fe148ab
+20206216
+7048a501
+20600000
+7048a500
+20600000
+7048a600
+6fe148ab
+20206216
+7048a601
+6fe348ab
+67e3095c
+202061f8
+7044a000
+20600000
+20406125
+67e148ba
+da2048b4
+20406152
+67e0c8b3
+58000065
+c00033e1
+1fe67c64
+242133df
+67e0c88d
+70488a05
+da604885
+20203368
+70488d64
+202033dc
+20203227
+20758000
+20406df3
+580035da
+67e14889
+5800239e
+67e1488b
+5800360c
+67e1488d
+5800345e
+67e1445d
+58003460
+67e1445f
+58003217
+67e14469
+58003462
+67e14465
+58003483
+67e14467
+580031dd
+67e1445b
+580034ed
+67e1446b
+580034ad
+67e1446f
+44db4016
+20403444
+20403470
+2040793a
+70417702
+704c5800
+6fe0ca1a
+67e0c8e9
+c000340d
+6fe0ca1b
+67e0c790
+70442700
+204077bb
+204077c5
+704a4201
+6fe1478c
+c3860000
+20203217
+2020342b
+704a4202
+70442701
+58000020
+20404c09
+d8a042ff
+6fe0c37a
+1fe104f0
+18518400
+20403425
+e0408005
+1fe1040f
+20403425
+e0408005
+20401aac
+6848c2f7
+18427200
+d8a043ea
+d8c042f8
+20407d5f
+6848c2f7
+18427200
+d8a0440a
+d8c042f8
+20207d5f
+18467c09
+20213429
+18408437
+20600000
+18408430
+20600000
+6fe0ca0f
+c0ffb43d
+6fe0ca0d
+c0ffb440
+6fe0ca18
+c0ffb442
+6fe0c97b
+1fe27200
+5800497c
+1fe22200
+1a220c00
+efe08006
+18c22200
+c07fb43b
+1fe20400
+20406069
+c2003435
+20600000
+6fe44a0f
+67e4497e
+2020342d
+67e0c97c
+2020342f
+67e0c97d
+20203431
+204035d6
+da200000
+204061d1
+2040342b
+20403478
+2040345c
+2020344b
+6fe0cc45
+1fe27200
+58004c46
+1fe22200
+1a220c00
+efe08006
+18c22200
+c07fb456
+1fe20400
+67e0cc4a
+20403458
+c200344f
+20600000
+6fe0cc4a
+c17f8000
+98000400
+20206069
+704a1e64
+20600000
+2040609d
+20206197
+20206197
+202061a3
+2040347a
+20403465
+20203461
+6fe1478c
+c3848000
+6fe0cc58
+c000b46a
+20600000
+6fe0ca39
+c1008000
+704a3901
+20403474
+20403476
+2020348d
+6fe14c5d
+67e14c5f
+704c6100
+20600000
+58000000
+20203471
+da200000
+20207801
+da200000
+20207806
+6fe1478c
+c4048000
+20401b77
+247a0000
+da204967
+20407956
+24740000
+d8c04967
+20204c0d
+1a627e00
+c016b23f
+c0083227
+c00a3489
+c00ab493
+20600000
+20403474
+20403476
+793f8027
+2020348f
+6fe14a3a
+67e14a3c
+704a1d14
+70409900
+20403205
+20203223
+79200027
+20403470
+2040358a
+2040357e
+58000000
+67e2c9eb
+58000004
+20406216
+58000005
+20406216
+58000014
+20406216
+58000015
+20406216
+58000016
+20406216
+58000007
+20406216
+2040793a
+7049ad0a
+7049af0a
+7049b10a
+70417702
+58000020
+20404c09
+20203207
+2040352b
+2040352e
+20403531
+20403198
+204034c3
+204034bd
+204034b5
+202034b8
+da604c59
+da400000
+2020318a
+da604c5f
+da4034bb
+20203191
+704c6101
+20600000
+da604a3c
+da4034c0
+20203191
+704a3902
+704c5800
+20203497
+6fe0ca17
+207a0000
+da604a1d
+da4034c8
+2020318a
+6fe0ca1c
+67e0ca1d
+6fe0ca20
+247a0000
+20406125
+67e14a37
+da204a31
+20406152
+6848ca1e
+98467c00
+202134d5
+67e0ca1e
+1fe20400
+6048ca1f
+6fe0ca19
+98467c00
+204134e0
+6048ca2a
+df200006
+d8c04a25
+204034e7
+67e0ca2b
+da204a22
+2020793f
+6fe0ca21
+247a0000
+704a2101
+da200001
+20207806
+da200001
+20207801
+da200000
+efe08006
+9a20a200
+c20034e8
+1a217eff
+20600000
+6fe0c436
+c00934f0
+20600000
+6fe14437
+c00a3507
+20600000
+44dbc016
+efe28011
+67e289de
+6fe109de
+d8406b5a
+98467c00
+24628000
+6fe109e1
+1ff0fe00
+67e109e1
+1fe27200
+1a20a205
+1a220c00
+d8a009e3
+20407d5f
+efe08006
+67e089ed
+da2009e0
+da4009e3
+20600000
+58000000
+67e2c9a1
+67e2c9a6
+204034f3
+1a420c00
+d8a049a1
+df20000a
+20407d5f
+44dc4017
+efe08011
+c001353a
+c001b54f
+c0023556
+c002b556
+c00335c6
+c003b5c7
+c00435ca
+20600000
+20403507
+6fe089e0
+c002351e
+c002b51e
+20600000
+6fe0c9a1
+245a3525
+6fe0c9a3
+245a3527
+6fe0c9a5
+245a3529
+20600000
+704c4205
+20600000
+704c4305
+20600000
+704c4405
+20600000
+da604c42
+da403534
+2020318a
+da604c43
+da403536
+2020318a
+da604c44
+da403538
+2020318a
+7049a100
+20203556
+7049a300
+20203556
+7049a500
+20203556
+6fe0c9a1
+67e0c9ac
+6fe0c9a2
+67e0c9ae
+20203560
+6fe0c9a1
+67e0c9ae
+2020356e
+6fe0c9ad
+20403547
+6fe0c9a2
+67e0c9ac
+2020356c
+c001354b
+c001b54d
+67e0c9ad
+20600000
+7049ad05
+20600000
+7049ad0a
+20600000
+6fe0c9a1
+20403547
+6fe0c9ad
+204035ba
+204035bd
+70095d00
+2020620a
+6fe0ca3f
+247a0000
+6fe349a1
+67e349ac
+6fe0c9ad
+6848c9af
+98417e00
+6848c9b1
+98417e00
+205a3572
+44dcc017
+6fe1478c
+2feffe09
+2440b470
+2040356c
+2040356e
+20203567
+6fe0c9ac
+6848c9ae
+9840fe00
+243a790b
+20207909
+d8c049ac
+20203574
+d8c049ae
+20203579
+d8c049b0
+20203596
+704a2000
+20600000
+efe08006
+c000357e
+c000b582
+c0013586
+20600000
+efe08006
+c000358a
+c001358e
+c000b592
+20600000
+6848cc46
+20406065
+6848cc47
+20206065
+6848cc46
+20406069
+6848cc47
+20206065
+6848cc46
+20406065
+6848cc47
+20206069
+6848cc48
+20406065
+6848cc49
+20206065
+6848cc48
+20406069
+6848cc49
+20206065
+6848cc48
+20406065
+6848cc49
+20206069
+44dd4017
+efe08006
+c00035a3
+c000b59c
+c001359e
+20600000
+7049ca00
+2020359f
+7049ca01
+efe08006
+67e0c9cc
+efe40012
+202035a8
+efe08012
+20406216
+1a40a401
+efe08012
+20206216
+67e449cd
+704a2001
+6fe0c9ca
+c00035b6
+6fe0c9ce
+67e0c9cf
+6fe0c9cd
+20406216
+6fe0c9cc
+204035ba
+67e0c9d4
+6fe349cf
+67e3095c
+202061f8
+6fe0c9cd
+67e0c9cf
+6fe0c9ce
+202035af
+1feffe05
+1fe0fe32
+20600000
+d8402ee0
+984ffe00
+1fe6fc64
+20407def
+18078400
+18422200
+58002ee0
+98462400
+20600000
+20600000
+6fe449a1
+67e449eb
+20600000
+6fe0ca08
+67e0c9fe
+6fe0ca09
+67e0c9ff
+6fe0ca0a
+67e0ca00
+df20000d
+d8c049f9
+204034e7
+67e0ca06
+da2049f6
+2020793f
+58000000
+67e44881
+20402409
+20202463
+204035de
+204035e6
+204035f5
+20203613
+20402467
+6fe0c8bf
+c1808000
+6fe0cc59
+243a248d
+6fe0ca39
+c001248d
+20600000
+6fe0c8bf
+c1800000
+20402491
+2037b5f3
+6fe0cc61
+207a0000
+6fe0cc62
+1fe0fe01
+67e0cc62
+c00235f3
+204022cb
+20402415
+2437b5ea
+704c6200
+20600000
+6fe0c8bf
+c1808000
+20402395
+20403609
+204023a3
+6fe0c880
+243a3602
+20402532
+6fe0c8bd
+207a0000
+58000000
+67e248d1
+20600000
+7048bc00
+da200000
+20407801
+2040248d
+204022fc
+6fe240a8
+202022dc
+6fe248d1
+207a0000
+202022dc
+6fe1478c
+c3848000
+6fe14a3a
+67e14a3c
+704c5801
+da204894
+20203519
+6fe0cc61
+207a0000
+2040361b
+24740000
+6fe1c85c
+20407daa
+604a4160
+20201497
+78347c00
+20401465
+6fe1c174
+203a7e56
+20203460
+5800364e
+67e14889
+58003701
+67e1488d
+58003712
+67e1488f
+580036f5
+67e1488b
+5800365b
+67e10b45
+20403653
+2020799d
+20403649
+6fe0c909
+2feffe05
+2020b633
+6fe0c909
+2feffe06
+2040a30e
+6fe0c909
+1fe17e1f
+67e0c1e8
+20403100
+70487dff
+58000c4b
+67e148e1
+58000d4b
+67e148e3
+58000e4b
+67e148e5
+58000f4b
+67e148e7
+20402322
+20402409
+20402325
+204022ff
+6fe0c913
+67e08b47
+6fe4c90a
+67e48b48
+20600000
+7040c518
+6fe0c909
+c4038000
+7040c508
+20600000
+6fe0c8b9
+c00036e6
+c000b682
+c007b67e
+20600000
+d8400001
+da2048e9
+5800002a
+20205e63
+df200001
+da2048e9
+d840002a
+20205e75
+6fe0c8e9
+c0adb661
+7048e95b
+6ff21aac
+79207e1d
+67e20aa0
+20403678
+204079f0
+20403665
+2020366e
+6fe08b48
+207a0000
+6fe0c8e9
+c02db66c
+6fe20b49
+67e20aa0
+20600000
+6fe20b4d
+2020366a
+6fe0c8e9
+c02db674
+580099a4
+67e10a93
+700ac41a
+20600000
+580099bf
+67e10a93
+700ac43f
+20600000
+6fe0c914
+207a0000
+d8c04914
+d8a00b09
+df20001e
+20207d5f
+2040248d
+204036ed
+204036b4
+2020367f
+2040248d
+204036ed
+20402496
+204036b4
+20203683
+2040368a
+20403699
+202036a8
+6fe0c908
+207a0000
+d8e0000b
+20407d74
+247a0000
+70490800
+58000001
+67e08bff
+58000000
+e7e38005
+700bf820
+6fe08bf9
+79207e02
+67e08bf9
+20600000
+6fe0c906
+207a0000
+d8e0000e
+20407d74
+247a0000
+70490600
+d8a00c0f
+df200002
+20407d17
+700c0f00
+700bf710
+6fe08bf9
+79207e01
+67e08bf9
+20600000
+6fe0c907
+207a0000
+d8e0000c
+20407d74
+247a0000
+70490700
+d8a00c1f
+df200002
+20407d17
+700c1f03
+700bf821
+20203695
+44ddc017
+20407991
+6fe08be3
+207a0000
+700be300
+6fe10be1
+d84002ba
+98467c00
+24628000
+6fe08b61
+c1dd0000
+6fe08b62
+c05036c7
+c050b6cd
+c05336d9
+c053b6db
+c054b6e1
+700be400
+20600000
+6fe08b63
+c040b6ca
+202036c5
+20402392
+700be401
+20600000
+6fe08b63
+c000b6d2
+c04236d5
+c053b6d7
+202036c5
+6fe0c880
+67e08ba2
+202036cb
+2040248e
+202036d2
+700ba2a1
+202036cb
+700ba215
+202036cb
+6fe0c8bf
+c00036df
+c000b6d7
+20600000
+700ba2a0
+202036cb
+700ba200
+700ba300
+700ba401
+700ba507
+202036cb
+20402463
+20402467
+204036ed
+20402496
+204024b3
+204036b4
+202036e7
+44de4017
+6fe0c8bf
+c1800000
+20402491
+20403687
+6fe0c8b9
+247a0000
+20202532
+6fe0c8ba
+c000a39e
+c001b6f9
+20600000
+6fe0c7a6
+c000a39e
+c07fa39e
+700be500
+70483501
+6fe0c8ca
+67e0c7c6
+20600000
+58000001
+67e08bff
+6fe3c894
+e7e38005
+6fe0c894
+245a370a
+6fe0c894
+205a370e
+20203694
+70490801
+58000180
+d8e0000b
+20207d66
+70490800
+58000000
+d8e0000b
+20207d66
+6fe0c894
+c0003717
+c001374a
+c001b732
+20202427
+6fe0c896
+67e0c8ba
+70489600
+d8a00c0f
+d8c04895
+df200008
+20407d5f
+6fe40c0f
+245a372a
+6fe40c0f
+205a372e
+6fe40c0f
+67e448ea
+684c48f2
+98467c00
+2442b6a3
+6fe448ea
+67e448f2
+20202427
+70490601
+58000180
+d8e0000e
+20207d66
+70490600
+58000000
+d8e0000e
+20207d66
+d8a00c1f
+d8c04894
+df200003
+20407d5f
+6fe10c20
+245a3742
+6fe10c20
+205a3746
+6fe18c1f
+67e1c8fa
+6849c8fd
+98467c00
+2442b6b2
+6fe1c8fa
+67e1c8fd
+20202427
+70490701
+58000180
+d8e0000c
+20207d66
+70490700
+58000000
+d8e0000c
+20207d66
+d8a00c2f
+d8c04894
+df200002
+20407d5f
+6fe10c2f
+245a375a
+6fe10c2f
+205a375e
+6fe10c2f
+67e14900
+68494903
+98467c00
+2442b762
+6fe14900
+67e14903
+20202427
+70490701
+58000180
+d8e0000c
+20207d66
+70490700
+58000000
+d8e0000c
+20207d66
+700bf822
+20203695
+20758000
+20401aa9
+580037ab
+67e14465
+58003798
+67e14463
+580037af
+67e14467
+58003794
+67e1445b
+580038e8
+67e1446d
+58003ae1
+67e1465a
+58003b84
+67e1446b
+58003b9b
+67e1446f
+204037a8
+44dec017
+2040377b
+2040378f
+20203af7
+6ff08060
+793ffe00
+67f08060
+6fe447b4
+20405eb0
+6fe147bc
+20405ec4
+20405ed7
+70807d08
+70807e49
+7080790a
+70807a0b
+d8400081
+6fe147c3
+2feffe00
+79208404
+60588060
+20600000
+204037a8
+2020377b
+6848c7a8
+20406069
+20403812
+6848c7a6
+20206050
+6848c7a6
+20406059
+2420b1df
+202031dd
+2040379a
+20203baa
+6fe0c78c
+c30237a8
+58003eff
+684a47cb
+98408400
+1c427e00
+98467c00
+24610000
+6fe1478c
+c282b7a8
+6fe147c3
+c3850000
+20403bad
+2040321b
+1c427e00
+67e247cb
+20600000
+20403baa
+204052f1
+247a0000
+20203817
+1a627e00
+c000b7ff
+c00137ce
+c0023802
+c002b7ef
+c00437d5
+c004b7dc
+c00537f5
+c005b7e1
+c00637ed
+c009b802
+c00a37fb
+c00ab7f1
+c010b7f6
+c011b7f7
+c01237fa
+c0183b3f
+c018bb41
+c0193b4f
+c019bb4d
+c01a3b39
+c01abb22
+c01b3b37
+c01bbb43
+c01c3b45
+c01dbb22
+c01ebb19
+c020b804
+c0213806
+c021bb37
+20600000
+204037a8
+6fe0c76f
+245a3b43
+20403802
+6fe1478c
+c4020000
+202037dc
+6fe1478c
+79207e04
+67e1478c
+6fe0c7b1
+67e0c177
+20403812
+20203acc
+6fe1478c
+c4020000
+793ffe04
+67e1478c
+20203ad0
+204037a8
+6fe14042
+1fe37e00
+68494455
+98467c00
+2422b7e8
+20203223
+6fe147c3
+c3848000
+6ff10112
+245a3bb1
+20203219
+20403baf
+20203225
+204037a8
+20203809
+20401b1c
+7047c500
+20403802
+20203ad2
+202031ea
+20203baf
+6fe147c3
+c304b21b
+20203bb3
+20203bb3
+20403809
+6fe0c7b2
+67e0c177
+20203ace
+70476b00
+20403baf
+20203bb3
+2040387f
+20203807
+204021b5
+20201f99
+20203b65
+6848c7a8
+20206069
+2040380b
+20203812
+6fe0c7ab
+2feffe00
+2040b1fd
+6fe0c7ab
+2feffe01
+2040b205
+20600000
+6848c7a8
+20206065
+6fe0c656
+c1000000
+202064df
+6ff0810b
+c2813814
+20405ef7
+efe08003
+c080b82d
+6ff10112
+1fe67c02
+20610000
+efe08003
+67e089cf
+e8408003
+18622200
+604889d0
+18408403
+6ff10112
+98460400
+24610000
+7009d101
+2040383b
+6fe089d1
+c1000000
+20203836
+20407d12
+20403b28
+20203830
+44df4017
+20405ef7
+6ff10112
+207a0000
+98608600
+2020383a
+20405ef7
+18608602
+efe08003
+98608600
+20205f03
+44dfc017
+6fe089cf
+c000386d
+c000b872
+c0013877
+c001b88c
+c0023896
+c002b89a
+c004b8bc
+c005b910
+c0063911
+c006b935
+c0073938
+c007b940
+c0083948
+c008b94c
+c0093950
+c00ab954
+c0133959
+c014395e
+c014b96e
+c0153977
+c015b9aa
+c01639b0
+c01839b7
+c018b9c1
+c01939d2
+c019b9dd
+c01a3a0a
+c01aba0d
+c01b3a16
+c01bba1f
+c01c3a22
+c0203a2a
+c0213a34
+c0243a39
+c024ba44
+c028ba4a
+c030ba4e
+c03b3a5d
+c03bba63
+c03c3a68
+c03d3a9e
+c0483aac
+c048bab1
+c0493ab5
+c049baba
+c04a3abe
+c07fbac4
+20203ac6
+6fe089d0
+c0833ac6
+efe30003
+67e340a8
+20203ac9
+6fe089d0
+c0833ac6
+efe30003
+67e3437a
+20203ac9
+6fe089d0
+c080bac6
+e8408003
+6048c7b3
+20403ac9
+6fe1478c
+c3848000
+c3800000
+6fe0c7ab
+2feffe00
+2420b885
+6848c7b3
+18417e03
+67e0c09b
+6fe0c7ab
+2feffe01
+24608000
+6848c7b3
+284ffe02
+2020b207
+20203205
+6fe089d0
+1fe67c43
+24213ac6
+67e0c5fc
+df200008
+20407d17
+6f2089d0
+d8a045fd
+20405f39
+20203ac9
+dfe0001f
+d8a042f7
+20403a10
+20201aa9
+6fe0c78c
+c3023ac6
+204031d7
+2020b8aa
+7009d100
+204037a8
+6fe0c653
+207a0000
+6fe1465e
+243a38a8
+6fe089d0
+67e1465e
+67e1465c
+6061465c
+204038ac
+20206504
+7009d100
+20203b95
+204038b2
+6fe1465e
+684947a9
+98467e00
+67e1465e
+20600000
+6fe1465e
+68494657
+20407e4a
+68494649
+20407e4a
+67e147a9
+20600000
+7009d101
+7009cf05
+20203ac9
+6fe1478c
+c304bac6
+2040390d
+20343ac6
+7009d100
+6fe147c3
+c28438e1
+6fe0c7c5
+247a0000
+7009d101
+efe10003
+67e147c6
+606147c8
+6fe089d0
+1fe0fffe
+24213ac6
+2022bac6
+67e0c7c5
+684947c6
+184085ff
+20401a65
+203a38e4
+e8420006
+59280302
+98467c00
+2422b8e4
+efe08006
+67e0c7ca
+1fe17e30
+203a38e4
+7009d100
+20401b1a
+204038e8
+204038e8
+204038e8
+6fe147c3
+c4040000
+7009d101
+20403bb7
+20203ac9
+7047c500
+7009d101
+20403bb7
+20203ac6
+6fe0c7c5
+207a0000
+20401b77
+247a0000
+20403908
+44e04018
+6fe0c435
+c3800000
+1840fffd
+d84000fb
+20407e4a
+6848c7c5
+20407e4a
+1fe22200
+18427e00
+9a267e00
+67e0c7c5
+20403903
+6fe147c8
+1fe20600
+1a227200
+20405f39
+18627e00
+67e147c8
+6fe0c7c5
+247a0000
+20203bb5
+684947c6
+6fe0c7ca
+c2829ebc
+c2821eb3
+20600000
+d8400017
+6fe147c3
+c3808000
+68494382
+20600000
+6fe147c3
+c2811e8d
+20207e56
+20203afb
+efe08003
+c040b91e
+c0413920
+c041b922
+1fe22200
+20406ebb
+20407544
+1a227e00
+c0003924
+c000b927
+c0013931
+c001b933
+20203ac6
+20406eb7
+20203927
+20406eb7
+20203931
+20406eb7
+20203933
+20406ec2
+70476400
+20203ac9
+58000003
+67e0c76c
+67e0c765
+58000000
+67e0c766
+58000004
+67e0c767
+204057ae
+70476401
+20203ac9
+58000002
+20203928
+58000001
+20203928
+dfe00010
+d8a04793
+20203a10
+efe08003
+6848c7c3
+7d3a0400
+6048c7c3
+68588060
+7d3a0404
+60588060
+20203ac9
+6f2089d0
+20407db8
+20405ecc
+67e147bc
+20403ac9
+20407e07
+6fe147bc
+20205ec4
+da200002
+da4047a4
+d8400000
+20203ad4
+6fe1478c
+c3003ac6
+20403ac9
+202031f6
+6fe1478c
+c304bac6
+20403ac9
+2020320f
+6fe089d0
+c081bac6
+efe18003
+67e1c0b2
+20203ac9
+6f2089d0
+6fe14487
+1fe20a00
+20405f39
+20203ac9
+6fe1478c
+c284ba39
+c3003ac6
+efe08003
+6848c76b
+793a0400
+79200407
+6048c76b
+20403ac9
+6fe0c76b
+c283396a
+20600000
+c2805686
+70476b00
+70095b21
+2020787a
+6fe0c78c
+c4020000
+6fe0c656
+c1000000
+efe08003
+6848c654
+98408400
+6048c654
+20600000
+df200040
+d8a043e7
+20407d26
+58000000
+67e08974
+1a220600
+18627e00
+67e10978
+204039a5
+6fe08974
+68488964
+18408401
+9840fe00
+67e08974
+1fe67c1f
+24213991
+6848c3e7
+580043e8
+9840fe00
+67e1097d
+68488964
+18408401
+6fe0c3e7
+9840fe00
+67e0c3e7
+2020399a
+6848c407
+58004408
+9840fe00
+67e1097d
+68488964
+18408401
+6fe0c407
+9840fe00
+67e0c407
+6fe1097d
+1fe20a00
+6fe10978
+1fe20600
+18427200
+20405f39
+6fe089d0
+68488974
+98467c00
+2422b97d
+20203ac9
+efe08003
+67e08964
+efe08003
+67e08970
+20600000
+d8400000
+da200002
+6fe147c0
+67e1098e
+da40098e
+20203ad4
+6fe089d0
+c080bac6
+efe08003
+67e0c7be
+58000000
+67e147c0
+20203ac9
+6fe089d0
+c0823ac6
+6fe1478c
+c284ba9e
+efe20003
+67e24794
+70479304
+70476d00
+20403ac9
+20205606
+6fe089d0
+c081bac6
+efe08003
+c00039c7
+c000b9cd
+20203ac6
+20403ac9
+e8408003
+efe08003
+c001607f
+7d3a0407
+20206050
+20403ac9
+e8408003
+efe08003
+203a6069
+20206065
+6fe089d0
+c080bac6
+e8408003
+20406059
+58000000
+7d20fe00
+da200001
+67e1098e
+da40098e
+d8400000
+20203ad4
+efe08003
+1fe20400
+c040b9ec
+c04139f0
+c041b9f5
+c04239f9
+67e0c39d
+20407544
+20401f88
+6fe0c39d
+c00039fd
+c000ba00
+c0013a02
+c0023a04
+20203ac6
+6048c39d
+20401f84
+7043530d
+202039fe
+6048c39d
+20401f84
+7043530d
+70435101
+20203ac9
+6048c39d
+20401f84
+7043530d
+20203a08
+6048c39d
+20401f84
+7043530d
+20203a06
+70435300
+70435103
+20203ac9
+70435301
+202039fe
+70435305
+20203a08
+70435305
+20203a06
+70435102
+20203ac9
+70435100
+20203ac9
+dfe0001f
+d8a043e7
+20203a10
+dfe0001f
+d8a04407
+20203a10
+6f2089d0
+9f267c00
+24213ac6
+e7208005
+20405f39
+20203ac9
+6fe1478c
+c304bac6
+6fe089d0
+c0843ac6
+efe40003
+67e44372
+70095b12
+2040787a
+20203ac9
+efe10003
+67e14428
+20203ac9
+6fe0c39d
+203a3ac6
+6fe0c39b
+c0803ac6
+6fe0c39c
+c0803ac6
+20407927
+20203ac9
+6fe089d0
+c082bac6
+efe08003
+67e0c7ac
+efe20003
+67e247ad
+6848c7ac
+20406069
+20403b82
+20203ac9
+6fe089d0
+c080bac6
+efe08003
+67e0c1e8
+20203ac9
+efe08003
+c000ba42
+6fe0c399
+c001ba40
+c0033a40
+c003ba40
+20203ac6
+70439a01
+20203ac9
+20401fee
+20203ac9
+6fe089d0
+c080bac6
+20403ac9
+efe08003
+203a57e2
+202057e0
+20403ac9
+20407e07
+70801001
+2020137c
+6fe089d0
+c0003ac6
+efe08003
+203a3a5b
+6fe089d0
+c082bac6
+efe20003
+d84f4240
+98467c00
+20213ac6
+67e2439e
+20401b12
+20203ac9
+20401b14
+20203ac9
+e8410003
+20401a65
+18c08bfe
+58000000
+e7e10005
+20203ac9
+20403a6c
+20403a9a
+58000000
+e7e10005
+20203b5c
+efe08003
+20403a70
+20403a77
+20203b5c
+20403a97
+58280002
+e7e18005
+20600000
+67e0895c
+20403a97
+59280302
+e7e20005
+6fe0895c
+e7e18005
+20600000
+20401a84
+efe08003
+1fe1721f
+1fe22200
+2a2ffe07
+7920840f
+2a2ffe06
+7920840e
+e0410005
+1f227e00
+e7e08005
+20405f4d
+20403a9a
+58000000
+e7e10005
+184104ff
+184085ff
+20401a65
+18c08c04
+efe08006
+c2823a8f
+c282ba8f
+18408401
+20600000
+20401a84
+2a2ffe05
+7920840f
+e0410005
+5a290202
+e7e40005
+184085ff
+20600000
+20401a84
+e0410005
+20600000
+efe08003
+1fe27200
+e7e08005
+20205f4d
+6fe0c39b
+c082bac6
+6fe0c39d
+c0023aaa
+c0423aa4
+20203ac6
+70439802
+70439908
+20203aa7
+efe20003
+67e2439e
+20203ac9
+20403aa7
+20201fd7
+6fe089d0
+c0813ac6
+e8410003
+20401b7c
+20203ac9
+d8400000
+da200002
+da404075
+20203ad4
+6fe089d0
+c0843ac6
+efe40003
+20401b7a
+20203ac9
+ea208003
+ea410003
+d8400000
+20203ad4
+6f2089d0
+1f20f3fe
+efe10003
+1fe20a00
+20405f39
+20203ac9
+70409900
+20203ac9
+d8400001
+da200000
+20203ad4
+d8400000
+da200000
+20203ad4
+7009cf00
+20203af8
+7009cf02
+20203af8
+7009cf03
+20203af8
+7009cf05
+20203af8
+6fe089cf
+1fe22600
+7009cf06
+58000002
+9a20fe00
+20403b6b
+1a627e00
+e7e08003
+e0408003
+1a227200
+1a420c00
+20405f33
+20203b75
+204037a8
+7009cf07
+6fe083d2
+207a0000
+20403b6b
+6fe083d2
+1fe27200
+6fe103d4
+1fe20c00
+20405f1f
+20203b75
+7009cf08
+1f20fe02
+20403b6b
+6fe109fa
+e7e10003
+6fe109f8
+1fe20c00
+20405f1f
+18c27e00
+67e109f8
+20203b75
+7009cf09
+58000000
+20403b6b
+20203b75
+7009cf0a
+58000001
+20403b6b
+20403b0c
+6fe1478c
+d8e00002
+afefffff
+79208403
+d8e00009
+afefffff
+79208405
+6fe0c78c
+d8e00004
+afefffff
+79208404
+e0408003
+20203b75
+d8400000
+6fe0c09b
+d8e00000
+afefffff
+79208400
+d8e00001
+afefffff
+79208401
+6fe0c427
+d8e00000
+afefffff
+79208402
+20600000
+7009cf0d
+6fe0c489
+1feffe22
+1fe27200
+20403b6b
+6fe14487
+1fe20c00
+20405f1f
+20203b75
+7009cf0e
+58000004
+20403b6b
+6fe2087c
+e7e20003
+20203b75
+7009cf0f
+6ff10112
+d8400040
+20407e4a
+1fe22200
+1fe27200
+20405ef7
+d8a0098e
+20405f39
+1a227e00
+1a227200
+20403b6b
+d8c0098e
+20405f1f
+20203b75
+7009cf10
+20203af8
+7009cf11
+58000004
+20403b6b
+6fe2439e
+e7e20003
+20203b75
+da200180
+20203b46
+da200080
+20203b46
+da200101
+20203b46
+da200001
+70476b00
+7009cf14
+58000002
+20403b6b
+1a227e00
+e7e10003
+20203b75
+da600000
+20203b50
+da600001
+7009cf15
+58000001
+20403b6b
+1a627e00
+e7e08003
+20203b75
+7009cf1d
+58000004
+20403b6b
+6fe2087c
+e7e20003
+20203b75
+60490964
+7009cf29
+58000002
+20403b6b
+68490964
+e0410003
+20203b75
+7009cf2b
+20203af8
+7009cf40
+58000002
+20403b6b
+6fe14075
+e7e10003
+20203b75
+7009ce02
+67e089d0
+604c0964
+44e0c018
+20403b77
+684c0964
+20405f0f
+6fe189ce
+e7e18003
+20600000
+44e14018
+20205f13
+20403b80
+20608000
+20403b7e
+6fe247ad
+1feb7e00
+207a0000
+20207d0e
+6848c7ac
+20206069
+6848c7ac
+20206074
+6848c7ac
+20206065
+622109f8
+624109f6
+6fe14437
+67e109fa
+2040390d
+20740000
+684909f6
+6fe0c7c2
+20407e4a
+1fe27200
+18427e00
+9f267e00
+67e109f6
+20403aec
+6fe109f6
+207a0000
+20203b8a
+6fe147c3
+c3848000
+20403bb1
+20203219
+70417702
+20600000
+6fe0c7be
+207a0000
+6fe0c7bf
+207a0000
+1fe0ffff
+67e0c7bf
+247a0000
+7047bf32
+20406125
+1fe6fc64
+20407dec
+18070400
+67e0c7c0
+6048c7c1
+20600000
+20407e21
+202131e6
+202031e8
+d8e0000a
+20203bbd
+d8e0000a
+20203bb9
+d8e00009
+20203bbd
+d8e00009
+20203bb9
+d8e00008
+20203bbd
+d8e00008
+20203bb9
+6fe147c3
+f93ffe00
+67e147c3
+20600000
+6fe147c3
+f9207e00
+67e147c3
+20600000
+20403bf0
+204041a7
+2040408e
+20758000
+20403d8a
+20404728
+20403bcf
+2040423c
+6fe0c92a
+c3838000
+6fe1478c
+c2864553
+204046a0
+20203d52
+58004866
+67e1489b
+5800488f
+67e1489d
+58003e40
+67e1489f
+5800439f
+67e14461
+58004457
+67e14463
+58003e3b
+67e1445f
+58004334
+67e14467
+5800464b
+67e14465
+58003e25
+67e1445d
+58004388
+67e1446b
+580044b5
+67e1446f
+58003f69
+67e14473
+58003e13
+67e1445b
+580049a8
+67e1446d
+580049aa
+67e14477
+580049bd
+67e14471
+20600000
+20758000
+20402607
+204022ff
+20403f1e
+20403d13
+20401b16
+20401b3f
+20401b32
+20401b1e
+6fe44bab
+c289c635
+c28945f6
+20600000
+7040c508
+6fe44bab
+c3860000
+7040c518
+20600000
+700b58ff
+704790ff
+70478f1e
+5800492d
+67e1448d
+70448c01
+58004ab5
+67e14899
+70483601
+6fe148fe
+67e14791
+6fe14900
+67e14881
+6fe0c903
+67e14885
+6fe2c905
+67e2c8cb
+6fe0c904
+67e0c87c
+6fe44bab
+247a0000
+58020800
+67e1cbab
+58800700
+e7e18005
+58000300
+e7e10005
+70409901
+6fe0c90a
+2feffe00
+2040c6e6
+6fe0c90a
+2feffe02
+2040c6e8
+6fe0c90a
+2feffe01
+2040c6ea
+6fe0c90a
+2feffe03
+2040c6ec
+6fe0c90a
+2feffe04
+2040c6ee
+6fe0c90a
+2feffe05
+2040c6f8
+6fe0c866
+245a230e
+20403bfd
+6fe0c90b
+1fe10407
+6048c4a1
+1fe97e00
+1fe10401
+6048c866
+1fe37e00
+1fe10403
+6048c8fd
+1feb7e00
+1fe17e03
+204047d4
+6fe0c90c
+1fe10403
+6048c924
+1feb7e00
+1fe10403
+6048c925
+1feb7e00
+1fe17e03
+67e0c926
+67e0c992
+1feb7e00
+1fe17e03
+67e0cbb4
+580b0c0a
+67e1c918
+58ffffff
+e7e18005
+580607ff
+e7e18005
+58ffffff
+e7e18005
+7048f70a
+58000064
+67e14bc8
+20403e7b
+58001770
+67e14bbe
+704bc014
+58000190
+67e14bc6
+67e14bc2
+580003e8
+67e14bc4
+70487d07
+7048ca7d
+7041e800
+70488c01
+58000f0f
+67e1488d
+67e1488f
+6fe140a8
+67e140ac
+d8a0437a
+d8c040a8
+df200006
+20407e68
+704b8a20
+70493934
+6fe3437a
+67e34950
+704bb302
+7043e71f
+58050102
+67e1c3e8
+58120303
+e7e18005
+58190318
+e7e18005
+580003c2
+e7e10005
+5806ff06
+67e1cad2
+58000300
+e7e18005
+58090c80
+e7e18005
+58355442
+e7e18005
+5820322e
+e7e18005
+58756f4d
+e7e18005
+58006573
+e7e10005
+7044071f
+d8c04ad9
+d8a04408
+df20000d
+20407d5f
+6fe0c408
+1fe0ffff
+67e0c2f7
+d8c0440a
+d8a042f8
+df20000b
+20407d5f
+58070007
+67e1c372
+58002000
+e7e18005
+5800012c
+e7e10005
+58181203
+67e1cacc
+580000ff
+67e1cacf
+380000fb
+3806c212
+3808800f
+380c0021
+67e4444c
+70443207
+58000015
+67e14ae7
+58000019
+67e14357
+5800001d
+67e14ae9
+58000021
+67e14aeb
+58000030
+67e14aed
+58000022
+67e143d1
+704af096
+70493800
+20402322
+20402325
+58604800
+67e1c85c
+5800012c
+67e148c2
+58000050
+67e148c0
+58000005
+67e14bba
+58000708
+67e14bbc
+58010403
+67e1c9d0
+582a2002
+e7e18005
+5822153f
+e7e18005
+58114433
+e7e18005
+58265a09
+67e1c9df
+58041934
+e7e18005
+58000009
+e7e10005
+5800ffff
+e7e10005
+580d5a09
+67e1c9f3
+58ed1d10
+e7e18005
+5800807d
+e7e10005
+5800ffff
+e7e10005
+58ff5a09
+67e1ca39
+5840ab27
+e7e18005
+58a0d1be
+e7e18005
+5812a141
+e7e18005
+58a784a5
+e7e18005
+58d0b5ff
+e7e18005
+58ff00b6
+e7e18005
+58000900
+e7e18005
+5800ffff
+e7e10005
+580d5a09
+67e1ca53
+58c50e10
+e7e18005
+58109a5b
+e7e18005
+58421138
+e7e18005
+58412828
+e7e18005
+58394923
+e7e18005
+584bb04a
+e7e18005
+58904ca0
+e7e18005
+5809704d
+e7e18005
+58ffff00
+e7e18005
+5846a509
+67e1ca81
+58101934
+e7e18005
+58690760
+e7e18005
+58207d04
+e7e18005
+5809007e
+e7e18005
+58220d00
+e7e18005
+58ff220e
+e7e18005
+704a96ff
+580b5a09
+67e1caa3
+580009f3
+e7e18005
+5800ffff
+e7e10005
+20203100
+58009468
+67e14660
+58009732
+67e14396
+58002580
+67e1c0b2
+70417803
+70415b08
+704b9e00
+704b9e00
+704b9f00
+58000200
+67e14159
+70438017
+70438217
+58000a77
+67e14484
+38000306
+38044440
+38090000
+380c4408
+67e4c662
+38001224
+38044000
+38080000
+e7e28005
+3803ffff
+3806fe23
+380999d9
+380c020d
+67e440a0
+58004af5
+67e143de
+58000010
+67e143e0
+2040490e
+204048c6
+20403e8e
+6fe44bab
+c30dbd3f
+7044550c
+58000006
+67e14372
+67e14374
+20402613
+6fe44bab
+c30c3d43
+2040260b
+6fe0c938
+67e0cab4
+6fe1c37d
+67e1cac9
+6fe0c8fd
+1fe17efe
+67e0c8fd
+67e0c4a0
+58000000
+67e3c8d0
+6fe0c78f
+67e0cb9b
+67e0cb9c
+20401aa9
+202042a0
+44e1c018
+6fe44bab
+c297c80a
+6fe0c938
+c00047f6
+20403d65
+243442eb
+44e24018
+da204939
+6fe0c938
+1fe0ffff
+1feffe1d
+9a20a200
+efe08011
+67e0c482
+6fe0c482
+c019bd6f
+c01a3d7b
+20204553
+44e2c018
+78547c00
+6fe44bab
+c305bd6c
+6fe08989
+c3013d6c
+78347c00
+6fe0cab1
+67e0cab0
+20600000
+68494bb8
+6fe0cac1
+c07fbd73
+68494bb5
+604940c1
+6fe341dd
+203a31f8
+70447d17
+6fe0c764
+243a31ee
+70447d04
+202031ee
+704ac701
+6848cbb7
+6fe0cac1
+c07fbd80
+6848c902
+6048cb77
+20403225
+6fe1cacf
+67e1c3ec
+204043e8
+58000004
+e7e08006
+d8c04408
+204043ef
+202078ee
+6fe44bab
+c4068000
+58003d90
+67e10b45
+70492ba5
+20203dc1
+20403d93
+20403d98
+20203da8
+70492c00
+6fe44bab
+c40a8000
+70492c5b
+20600000
+6fe44bab
+c28ebd9f
+c28f3da2
+c28fbda5
+70492919
+700b4708
+20600000
+7049290c
+700b4704
+20600000
+70492906
+700b4702
+20600000
+70492903
+700b4701
+20600000
+204079f0
+20403dab
+20203db0
+6fe08b48
+207a0000
+6fe0c92c
+c02db66c
+20203669
+6fe0c92c
+2020366f
+6ff08c02
+c303bdb6
+c283bdb9
+20600000
+6fe0c92a
+c4038000
+20205d8c
+6fe0c92a
+c3838000
+204047f2
+20204316
+6fe44bab
+c4068000
+20407991
+20203dc1
+44e34018
+68488b58
+20406059
+2020bdc6
+20203dcd
+6fe0c92b
+c1528000
+70492ba5
+700bfa00
+7009f600
+700bec00
+20203bcb
+6fe0c92b
+c12d0000
+70492b5a
+204047f2
+20404316
+2040490e
+2020799d
+6fe44bab
+c4068000
+20403db2
+6ff08c02
+67e0c92a
+c4038000
+20403e0b
+6fe24abd
+6848c929
+98408400
+1c427e00
+98467c00
+24610000
+67e24abd
+20403f70
+24740000
+6ff08c02
+c4038000
+6fe44bab
+c30abdea
+6fe0cb8b
+c000bdf0
+20403694
+58000001
+67e08bff
+6fe3c8d0
+e7e38005
+20600000
+6fe0cb8c
+203a3dfb
+6fe44bcd
+67e4095c
+6fe0cbcc
+c001bdfd
+c0013e04
+204036a2
+6fe4095c
+67e40c0f
+20600000
+6fe44bd6
+20203df3
+20403695
+700bf821
+58000003
+67e08c1f
+6fe1095c
+e7e10005
+20600000
+20403695
+700bf822
+58000002
+67e08c2f
+6fe0895c
+e7e08005
+20600000
+684a4abd
+1c427e00
+98467c00
+24413e10
+20600000
+58000000
+67e24abd
+20600000
+c51331dd
+6fe0caac
+203a31dd
+6fe0caf4
+c000b1dd
+6fe144d8
+243a31dd
+6fe0c8e1
+243a31dd
+202031df
+6fe0c902
+67e0cac4
+20600000
+44e3c018
+20404232
+2040423c
+20403e33
+20203217
+44e44019
+78347c00
+6ff20138
+79347e1a
+67f2004c
+2040159a
+20406df7
+2040490e
+20404015
+20403e33
+2040462d
+2040609d
+6848c911
+20206042
+44e4c019
+204042e9
+20407fdc
+20403e40
+20406082
+d8400013
+20403f56
+20203f58
+c6130000
+20403e40
+6fe0809e
+247a0000
+20206042
+44e54019
+20403f88
+6848c91f
+20406069
+20405b04
+6848c918
+20406036
+6848c919
+20406036
+6848c91a
+20406036
+6848c90d
+20406036
+6848c90e
+20406036
+6848c90f
+20406036
+6848c91b
+20406036
+6848c912
+20406036
+6848c913
+20406032
+6848c914
+20406032
+6848c91c
+20406032
+6848c91d
+20406032
+6848c911
+20206036
+6fe1478c
+c284be64
+6fe1478c
+c2803e67
+20600000
+1a227e00
+243a1b26
+20201b28
+1a227e00
+243a1540
+20201542
+6fe0c4a0
+c1810000
+44e5c019
+6848c4a1
+18467c03
+20213e78
+18408405
+6048c8fc
+18422200
+20406098
+c01fc954
+20404952
+1a220400
+2020607f
+18408404
+6048c8fc
+20203e72
+6fe0c8fd
+c0013e84
+c0003e89
+7048fd00
+582c0172
+67e1c8e3
+58014001
+e7e18005
+20600000
+585d0099
+67e1c8e3
+58007100
+e7e18005
+20600000
+58c8012c
+67e1c8e3
+5800dc00
+e7e18005
+20600000
+6fe44bab
+c40a0000
+7048f501
+c3970000
+c3958000
+7048f500
+20600000
+6fe0c8f6
+1fe0fe01
+67e0c8f6
+6848c8f7
+98467c00
+20600000
+6fe44bab
+c40a0000
+20403e6a
+6fe0c8f5
+203a3eb2
+6fe0c4a0
+c0013ea7
+7048f503
+20403e95
+20213ea9
+20403eae
+20203eb8
+7048f502
+20203eb8
+20403e6c
+7044a002
+6fe0cbaa
+245a3eae
+20203eb8
+7048f600
+6fe0c8fd
+67e0c4a0
+20600000
+6fe0c4a0
+c0813eb6
+6fe0cbaa
+247a0000
+20403e95
+24610000
+44e64019
+6fe0cbaa
+247a0000
+7048f600
+20406125
+67e148e9
+6fe0c4a0
+c0813ec6
+684948e9
+184ffe08
+1fe6fc0a
+20407dec
+9840fe00
+67e148e9
+da2048e3
+20403ed8
+6fe0c4a4
+c2813f1a
+c280bf1c
+c3003ed0
+7048fa01
+20203ece
+d8e00004
+202046f0
+d8e00004
+204046f4
+7048f80c
+6fe0c8fa
+207a0000
+7048fa00
+6848c921
+2020492b
+44e6c019
+efe40011
+67e4095c
+6fe0c8f5
+c0003ef0
+c0013edf
+c001bf0f
+6fe44bab
+c3173ee5
+6fe10962
+684948eb
+98467c00
+24213f12
+6fe44bab
+c315bef0
+7048fb00
+6fe10962
+684948ed
+98467c00
+24213eee
+204046a9
+20203ef0
+204046ad
+20203ef0
+20403f16
+2040616e
+20406166
+6fe10962
+6849095e
+98467c00
+2441616a
+68490960
+98467c00
+24416162
+6fe10962
+6849095c
+98467c00
+20213f0b
+6849095e
+98467e00
+24213f0d
+203a3f0d
+1fefa264
+6fe1095c
+6849095e
+98460400
+1a227e00
+9846fc00
+20407dec
+67e0caef
+20600000
+704aef64
+20600000
+704aef00
+20600000
+6fe0c4a0
+c0013edf
+20203ef0
+6848c4a4
+79200402
+6048c4a4
+20600000
+6848c4a4
+793f8402
+6048c4a4
+20600000
+7048fb01
+20600000
+2040490e
+20203e20
+6848c4c1
+20406069
+204079b4
+6848c918
+20403f56
+6848c919
+20403f56
+6848c91a
+20403f56
+6848c90d
+20403f56
+6848c90e
+20403f56
+6848c90f
+20403f56
+6848c910
+20403f56
+6848c91b
+20403f56
+6848c912
+20403f56
+6848c913
+20403f56
+6848c914
+20403f56
+6848c91c
+20403f56
+6848c91d
+20403f56
+6848c911
+20403f56
+6848c91e
+20403f56
+6848caab
+20406069
+6848c921
+20406069
+6848c915
+20406069
+6848c916
+20406069
+6848c922
+20406069
+6848c923
+20406069
+6848c917
+20203f56
+18467cff
+20628000
+18410e7f
+6ff2011c
+afefffff
+2020bf56
+20203f54
+79200407
+20206050
+793f8407
+20206050
+6fe1cbde
+67e1895c
+df200014
+d8400000
+6fe1895c
+2feffe00
+2040e07f
+6fe1895c
+1fe3fe00
+67e1895c
+18408401
+c2003f5c
+20600000
+20403f6a
+70448473
+20403f69
+20205b08
+20205cb5
+6fe0c91f
+d8400021
+20406093
+6fe0c920
+d8400023
+20206093
+44e74019
+78547c00
+58000000
+67e348d1
+20404240
+20403f7e
+20403f83
+204040dc
+6fe0c8d0
+1fe17e1f
+67e0c8d0
+24344728
+2040471a
+20204544
+6fe0c8e0
+207a0000
+67e0c8d5
+7048e000
+20207e54
+6fe0c8dc
+207a0000
+67e0c8d6
+7048dc00
+20207e54
+20403f95
+20403fd1
+6fe0c8da
+6848c8d9
+67e0c8d9
+98467c00
+2422b1e1
+6fe0c8de
+6848c8dd
+67e0c8dd
+98467c00
+2422b1e1
+20600000
+6fe0c91c
+c17f8000
+da200000
+6848c91c
+20406059
+7920a200
+6848c91d
+20406059
+7920a201
+1a227e00
+67e0c8da
+c000bfa5
+c0013fa9
+6fe0c8db
+c283bfb5
+20600000
+6fe0c8d9
+c0003fad
+c001bfaf
+20600000
+6fe0c8d9
+c0003fb1
+c001bfb3
+20600000
+7048db82
+20600000
+7048db81
+20600000
+7048db80
+20600000
+7048db83
+20600000
+6fe0c8db
+793ffe07
+67e0c8db
+c0003fbd
+c000bfc0
+c0013fc3
+c001bfc6
+20600000
+6fe0c8da
+c001bfc9
+20600000
+6fe0c8da
+c0003fc9
+20600000
+6fe0c8da
+c001bfcd
+20600000
+6fe0c8da
+c0003fcd
+20600000
+6fe0c8dc
+1fe0fe01
+67e0c8dc
+20600000
+6fe0c8dc
+1fe0ffff
+67e0c8dc
+20600000
+6fe0c913
+c17f8000
+da200000
+6848c913
+20406059
+7920a200
+6848c914
+20406059
+7920a201
+1a227e00
+67e0c8de
+c000bfe1
+c0013fe5
+6fe0c8df
+c283bff1
+20600000
+6fe0c8dd
+c0003fe9
+c001bfeb
+20600000
+6fe0c8dd
+c0003fed
+c001bfef
+20600000
+7048df82
+20600000
+7048df81
+20600000
+7048df80
+20600000
+7048df83
+20600000
+6fe0c8df
+793ffe07
+67e0c8df
+c0003ff9
+c000bffc
+c0013fff
+c001c002
+20600000
+6fe0c8de
+c001c005
+20600000
+6fe0c8de
+c0004005
+20600000
+6fe0c8de
+c001c009
+20600000
+6fe0c8de
+c0004009
+20600000
+6fe0c8e0
+1fe0fe01
+67e0c8e0
+20600000
+6fe0c8e0
+1fe0ffff
+67e0c8e0
+20600000
+6848c913
+20406032
+6848c914
+20406032
+6848c91c
+20406032
+6848c91d
+20206032
+6848c913
+20403f4d
+6848c914
+20403f4d
+6848c91c
+20403f4d
+6848c91d
+20203f4d
+6fe148d5
+207a0000
+7048e101
+7048e20a
+20600000
+da6048e2
+da404025
+2020318a
+7048e100
+20600000
+6fe44bab
+c2974036
+6fe0c90f
+c17f8000
+da200000
+704b9605
+6848c90f
+20404039
+67e0cb93
+6fe0c910
+c07fc042
+20404168
+1a227e00
+c282c052
+20204059
+6fe0c8fb
+203a4059
+20204052
+6fe44bab
+c2964048
+6fe0cb93
+1fe22600
+6fe0c910
+c07fc195
+6fe0cb9a
+243a4045
+2020404a
+6848c90f
+20403f56
+20204033
+7049dd00
+704b9300
+20600000
+6fe0cb93
+20204187
+20406059
+6848c910
+2020c048
+6848c910
+20406069
+6848c90f
+6fe0cb93
+20204187
+6fe0c9dd
+c1008000
+7049dd01
+6fe44bab
+c3940000
+c39b0000
+20204069
+6fe0c9dd
+c1000000
+7049dd00
+6fe44bab
+c2944060
+c29b4060
+20600000
+6fe0c9de
+243a4064
+6fe0cb9c
+245a4069
+7049de00
+6fe0c78f
+67e0cb9c
+67e0cb9b
+20600000
+44e7c019
+20404072
+20740000
+6fe0c992
+1fe0fe01
+1fe17e03
+67e0c992
+20404095
+202045ee
+78547c00
+6fe44bab
+c3960000
+c3970000
+6fe0cb8e
+207a0000
+6fe0cb8f
+207a0000
+78347c00
+20600000
+6fe44bab
+c2944080
+c29b4087
+20600000
+6fe0c9dd
+c1808000
+da604b9c
+da404085
+2020318a
+7049de01
+202046b5
+6fe0c9dd
+c1808000
+da604b9b
+da40408c
+2020318a
+7049de01
+202044d4
+20204098
+6fe44bab
+c38e0000
+6fe0c992
+c1818000
+70499200
+20600000
+44e8401a
+2040408f
+204048e1
+6fe0c927
+c001c0bb
+c005c0cf
+6fe0c992
+c00040a2
+c000c0a0
+c00140a4
+c001c0a6
+6848c9d1
+202040a8
+6848c9d0
+202040a8
+6848c9d2
+202040a8
+6848c9d3
+202040a8
+6fe0c927
+c00240b7
+c002c0b7
+c00440b9
+c003c0b9
+c00340b7
+6048c9dc
+58000006
+20405b0d
+1fe104f8
+6fe0c9dc
+9840fe00
+1fed7e00
+1fe0fe06
+20205b0c
+184085ff
+202040ae
+18408402
+202040ae
+6fe0c992
+c00040c2
+c000c0c0
+c00140c4
+c001c0c6
+6fe0c9d5
+202040c7
+6fe0c9d4
+202040c7
+6fe0c9d6
+202040c7
+6fe0c9d7
+67e0c9dc
+1fed7e00
+1fe22200
+1fe0fe0d
+20405b0c
+1a227e00
+1fe0fe0e
+20205b0c
+6fe0c992
+c00040d6
+c000c0d4
+c00140d8
+c001c0da
+6fe0c9d9
+202040c7
+6fe0c9d8
+202040c7
+6fe0c9da
+202040c7
+6fe0c9db
+202040c7
+20404115
+204040ed
+20403e5f
+204040e8
+1a227e00
+6848c8d8
+67e0c8d8
+67e0c8d0
+9842fe00
+1fe67c00
+20628000
+20207e54
+c6930000
+1a227e00
+207a0000
+67e0c8d0
+20207e54
+704b9800
+704b9900
+704b9a00
+1fe20400
+204040fd
+20404100
+20404103
+20404106
+6fe0cb99
+207a0000
+6fe0cb98
+207a0000
+704b9a01
+6fe0c8d8
+1fe22200
+20600000
+18417e09
+c004c10e
+20600000
+18417e14
+c00a410e
+20600000
+18417e18
+c00c410c
+20600000
+18417e07
+c001c10c
+c002c10c
+c003410c
+c003c10c
+20600000
+704b9901
+20600000
+704b9801
+20600000
+20404121
+20404115
+58000000
+67e1cb8e
+20600000
+44e8c01a
+6fe0cbe1
+245a4121
+da200000
+20404124
+2040412a
+20404130
+20404136
+2040414f
+2040416a
+1a227e00
+20600000
+58030303
+67e1cb8e
+20600000
+704b9600
+6848c918
+6fe0cb8e
+20404187
+67e0cb8e
+20600000
+704b9601
+6848c919
+6fe0cb8f
+20404187
+67e0cb8f
+20600000
+704b9602
+6848c91a
+6fe0cb90
+20404187
+67e0cb90
+20600000
+6fe0c90d
+c17f8000
+704b9603
+6fe0cb91
+1fe22600
+6848c90d
+6fe0c910
+c07fc14b
+20406059
+2020c147
+6848c910
+20406069
+6848c90d
+6fe0cb91
+20404187
+67e0cb91
+20204168
+6848c910
+6fe0cb91
+20404187
+20204145
+20404195
+67e0cb91
+6848c90d
+20203f56
+6fe0c90e
+c17f8000
+704b9604
+6fe0cb92
+1fe22600
+6848c90e
+6fe0c910
+c07fc164
+20406059
+2020c160
+6848c910
+20406069
+6848c90e
+6fe0cb92
+20404187
+67e0cb92
+20204168
+6848c910
+6fe0cb92
+20404187
+2020415e
+20404195
+67e0cb92
+6848c90e
+20203f56
+6848c910
+20203f56
+704b8b00
+6fe44bab
+c40a8000
+6fe0c912
+c17f8000
+704b9607
+6848c912
+6fe0cb95
+20404187
+67e0cb95
+1a227e00
+c283c17a
+2040417d
+6fe0cb8c
+67e0cb8d
+20600000
+704b8c01
+20404180
+20204177
+704b8c00
+6fe0cb8d
+207a0000
+704b8b01
+20600000
+20406059
+6848cb96
+18420e00
+2020c193
+20204191
+1fe3fe00
+1fe22400
+20406059
+7920a400
+1a417e07
+6848cb96
+18420e00
+c003c193
+c0004191
+20600000
+f93fa200
+20600000
+f9202200
+20600000
+44e9401a
+1a627e00
+67e0cb97
+1fe3fe00
+1fe22400
+18422600
+20403f54
+1a620400
+20406059
+7d20a400
+204041a1
+2020418b
+6848cb97
+18410401
+1a417e01
+98467c00
+2422c32f
+20600000
+44e9c01a
+20403f65
+20758000
+20404236
+204041b5
+c01841bc
+c018c217
+c02c4220
+204041b2
+20001af4
+202041ab
+6fe0c91f
+20405af7
+20203f6a
+58000001
+20405b0d
+67e0c9c2
+58000000
+20405b0d
+67e0c9c1
+20600000
+6fe0c9c2
+c02d41c5
+c06c41cb
+c068c1da
+c06941e3
+c00141ea
+c02a41ed
+c0284214
+202041ab
+70492705
+20404232
+20407d12
+da604a39
+2040422b
+2020408e
+58000016
+20405b0d
+1fe67cbd
+2422c1a7
+58000019
+20405b0d
+1fe67c55
+2422c1a7
+5800001b
+20405b0d
+1fe67c1d
+2422c1a7
+70492706
+da604a71
+2020422b
+70492700
+da6049f3
+2040422b
+da6049fd
+2040422b
+58000943
+20405b0c
+da604a17
+2020422b
+70492702
+da6049e9
+2040422b
+da6049fd
+2040422b
+da604a17
+2020422b
+70492703
+da6049df
+2020422b
+20404229
+58009a5b
+20405b0c
+5800000d
+20405b0d
+1fe67c12
+2022c201
+1fe67c0a
+2422c204
+5800000e
+20405b0d
+1fe67ce5
+2422c1ab
+58000010
+20405b0d
+1fe67ca5
+2022c201
+20404211
+70492708
+20600000
+70492709
+da604a53
+2020422b
+1fe67c10
+2422c1ab
+5800000e
+20405b0d
+1fe67cc5
+2422c1ab
+58000010
+20405b0d
+1fe67c38
+2422c1ab
+20404211
+7049270a
+20600000
+5800005b
+20405b0c
+20204227
+70492707
+da604a97
+2020422b
+20404236
+6fe0c9c2
+c038421e
+c000421c
+202041ab
+70492701
+20600000
+70492704
+20600000
+20404236
+6fe0c9c2
+c02cc224
+202041bc
+7049270b
+da604a81
+2020422b
+58000009
+20205b0c
+58005a09
+20205b0c
+efe10013
+d840ffff
+98467c00
+20628000
+20405b0c
+1a60a602
+2020422b
+58008006
+20405b0c
+20002ee0
+20600000
+44ea401a
+20403f65
+20404232
+da604aa3
+2040422b
+2020408e
+204041a7
+20403f65
+58000806
+20205b0c
+6fe0c4ac
+c1800000
+6fe0c927
+c000424c
+c000c24c
+c004424c
+c001424c
+c001c270
+c002424c
+c0034295
+c005c28e
+2020424c
+204042c4
+78547c00
+6fe0c911
+c07fc253
+6848c911
+20406059
+24608000
+58000000
+20405b0d
+c0984266
+58000002
+20405b0d
+c4038000
+204042db
+6fe0c8d1
+204042d3
+67e148d1
+6fe0c8d3
+204042d3
+67e148d3
+6fe0c928
+c0004268
+c000c26a
+c001426c
+c001c26e
+20600000
+c018c256
+202041b2
+204042ad
+202042e2
+204042b5
+202042e2
+204042b1
+202042e2
+204042bd
+202042e2
+204042c4
+6fe0c911
+c07fc276
+6848c911
+20406059
+24608000
+58000000
+20405b0d
+c09841b2
+58000002
+20405b0d
+c4038000
+204042db
+2040428c
+67e0c8d7
+1ff1fe00
+204042d7
+67e0c8d2
+6fe0c8d7
+1fe17e0f
+204042d7
+67e0c8d4
+6fe0c928
+c00042ad
+c000c2b5
+c00142b1
+c001c2bd
+20600000
+58000012
+20205b0d
+204042c4
+6fe0c911
+c07fc294
+6848c911
+20406059
+24608000
+20204279
+204042c4
+78547c00
+58000002
+20405b0d
+c4038000
+58000008
+20405b0d
+203a4259
+58000000
+67e348d1
+20600000
+6fe0c924
+67e0c928
+6fe0c917
+c17f8000
+6848c917
+20403f56
+6848c917
+20406059
+2040c2aa
+20203f54
+6fe0c925
+67e0c928
+20600000
+6fe148d1
+1fe67e00
+67e148d1
+20207e54
+6fe148d3
+1fe67e00
+67e148d3
+20207e54
+6fe148d3
+1fe67e00
+67e148d3
+6fe148d1
+1fe67e00
+67e148d1
+204042bf
+20207e54
+204042bf
+20207e54
+6fe148d3
+684948d1
+67e148d1
+604948d3
+20600000
+6fe0c9c8
+205a42db
+7049c801
+20600000
+704aac01
+20401b1a
+202041a7
+6fe0c911
+c1ff8000
+6fe0caae
+c1808000
+58000000
+67e0caae
+67e248d1
+202042ca
+c4038000
+d840ff00
+9841fe00
+20600000
+c4018000
+d84000f0
+9841fe00
+20600000
+dfe00003
+20405b0d
+67e148d1
+dfe00004
+20405b0d
+67e148d3
+20600000
+6848c920
+20406059
+20608000
+5800000a
+20405b0d
+200003e8
+202042e2
+58008100
+20205b0c
+704ac1ff
+6fe0cbb3
+c280c2ef
+c28042f4
+70448234
+580f0f0f
+67e1c37a
+67e1c37d
+20203d61
+70448233
+d8c04974
+204045c8
+20203d61
+44eac01a
+204045bd
+20404314
+6fe0c938
+c000c2ff
+c0014301
+20600000
+6fe3493a
+20204302
+6fe34957
+684b4974
+98467c00
+2022c553
+20203d59
+20404314
+6fe0c5fc
+1fe0fe03
+1fe22200
+20404dc0
+6fe144de
+e7e10005
+580004a1
+e7e10005
+6fe0c5fc
+1fe0fe01
+1fe27200
+d8c045fc
+20207d5f
+704ac15a
+20600000
+6fe1478c
+c283c322
+c284b20f
+c28031f6
+20204576
+58000000
+67e14ab2
+6fe1478c
+c284b20f
+6fe1478c
+c28031f6
+20600000
+204046de
+20207931
+6fe44bab
+c40d8000
+2434432c
+6fe0caad
+1fe0fe01
+1fe17e0f
+67e0caad
+247a0000
+704aad00
+78547c00
+20600000
+6fe0c911
+c1ff8000
+70417700
+704aaf1e
+20600000
+44eb401a
+1a627e00
+c00a4350
+c000c3fa
+c00ac35f
+c00143fe
+c002c421
+c008454e
+c0094424
+c0033244
+c0024432
+c009c432
+c00cb1ec
+c015c43d
+c010c443
+c005444a
+c01731da
+c018c36a
+c014c36c
+c019436e
+c01f4379
+c020437a
+c013c44c
+c01cc857
+c01d4833
+c01e484e
+c0224390
+20600000
+704aae00
+204042ca
+704ac601
+20404822
+6fe0cac7
+243a4357
+704ac814
+6fe14480
+793ffe00
+67e14480
+704b7700
+6fe14af0
+67e14af2
+20404544
+20204576
+704ac600
+58000006
+6fe44bab
+c28dc364
+58000007
+67e14372
+67e14374
+704af400
+704aac00
+20401b1c
+202043fe
+d8e00002
+20204375
+70095b12
+2020787a
+6fe0cac7
+c000c371
+20204373
+2040436c
+704b7614
+d8e00001
+20204375
+6fe0cb75
+f9207e00
+67e0cb75
+20600000
+2020321d
+6fe143db
+c1000000
+6fe08289
+1feb7e00
+1fe67c0c
+20610000
+58000009
+67e14372
+67e14374
+2040436c
+704af401
+20600000
+704af400
+20600000
+6fe0cac7
+247a0000
+6fe0c437
+1fe67e22
+24628000
+704b7600
+d8e00000
+20204375
+6fe082c1
+1fe67c0c
+24214384
+6fe082c3
+6848cb8a
+98467c00
+2021439a
+6fe082c3
+67e0c177
+20204386
+6fe0cb8a
+67e0c177
+20204386
+704b7500
+20600000
+44ebc01a
+20401b77
+247a0000
+6fe0cac1
+c07fc3a7
+6fe0cb75
+1fe17e03
+c1818000
+6fe0caac
+205a42c8
+6fe44bab
+c280c3d1
+c28043d1
+c282c3d1
+c28343d1
+20403f70
+20404324
+24740000
+2040432f
+204042cb
+2040401d
+6fe44bab
+c30ac3b8
+6fe0cb8b
+c000c3b9
+202043d3
+6fe0cb8c
+203a43c3
+6fe44bcd
+67e4095c
+6fe0cbcc
+c001c3c5
+c00143c8
+704ae608
+68494ae7
+202043d8
+6fe44bd6
+202043bc
+704ae603
+68494ae9
+202043d8
+704ae602
+68494aeb
+202043d8
+da200001
+68494aed
+20401eb3
+6fe0caef
+e7e08005
+20600000
+58000000
+67e3c8d0
+704ae607
+6fe3c8d0
+67e3895c
+68494357
+202043d8
+6fe0cae6
+1fe22200
+20401eb3
+6848cae6
+18427200
+d8c0095c
+20207d5f
+704ac700
+6fe1cacc
+67e1c3ec
+204043e8
+58000005
+e7e08006
+d8c04ad2
+204043ef
+202078ee
+da2043e8
+efe08011
+207a0000
+98c0a200
+efe08006
+c1008000
+202043e9
+d8a043f3
+df200013
+20407d5f
+20201abe
+5800000c
+67e14455
+6fe44bab
+c38d8000
+5800000e
+67e14455
+20600000
+704aae00
+204042ca
+20404822
+20204576
+704b7f00
+704b8800
+204043f3
+20404409
+6fe1447e
+c283c410
+c28031c6
+c280c414
+c2814417
+c281c417
+20204553
+58000000
+67e448d9
+e7e20005
+7049c800
+70445400
+70432600
+20600000
+2040439d
+6fe1447e
+c28031c6
+20203e20
+c282c417
+c281c417
+20204553
+6fe1478c
+c2864553
+204031c6
+20404110
+204044dc
+6fe0cb9f
+c000be1d
+6fe0cac4
+247a0000
+20203e20
+20600000
+704b8704
+20600000
+70445401
+20403223
+2040321f
+58000000
+67e14788
+67e0c78a
+20404422
+2020321b
+704b8000
+6fe0c5f5
+2feffe00
+20608000
+704b8001
+20600000
+6fe0cac1
+c07fc2f8
+6fe1478c
+c3860000
+c3830000
+c3858000
+6fe44bab
+c3828000
+c299c553
+c297c81f
+20203e20
+6fe0cb7f
+c1810000
+704b7f00
+204043f3
+20404422
+2020321b
+6fe0cb7f
+c1010000
+1fe0fe01
+67e0cb7f
+70445512
+20404422
+2020321b
+20405af1
+202031ea
+58000001
+67e30041
+7000e833
+2020458d
+5fffffff
+67e30041
+7000e833
+704ac1ff
+204045a2
+704939ff
+202045ee
+44ec401b
+20770000
+6fe0c454
+207a0000
+204052f4
+247a0000
+6fe0cac1
+c07fc306
+6fe0caac
+205a42c8
+6fe44bab
+c280c48e
+c280448e
+c282c48e
+c283448e
+20403f70
+20404324
+24740000
+2040432f
+204042cb
+2040401d
+6fe0cb80
+c000c47d
+6fe0cb88
+207a0000
+6fe44bab
+c30ac474
+6fe0cb8b
+c000c491
+da200009
+20404dc0
+6fe144de
+e7e10005
+580002a1
+e7e10005
+6fe3c8d0
+e7e38005
+20600000
+6fe0c8d0
+67e0cb81
+6fe0c8d1
+e7e08005
+6fe0c8d3
+e7e08005
+6fe148d5
+e7e10005
+da200007
+20404dc0
+6fe144de
+e7e10005
+580002a1
+e7e10005
+6fe2cb81
+e7e28005
+20600000
+58000000
+67e3c8d0
+20204474
+6fe0cb8c
+203a44b3
+6fe44bcd
+67e4095c
+6fe0cbcc
+c001c4a1
+c00144aa
+da20000a
+20404dc0
+6fe144de
+e7e10005
+580001a1
+e7e10005
+6fe4095c
+e7e40005
+20600000
+da200004
+20404dc0
+6fe144de
+e7e10005
+580003a1
+e7e10005
+6fe1095c
+e7e10005
+20600000
+da200003
+20404dc0
+6fe144de
+e7e10005
+580004a1
+e7e10005
+6fe0895c
+e7e08005
+20600000
+6fe44bd6
+20204494
+44ecc01b
+20403e9b
+20404956
+2040232b
+20402556
+204047cd
+204048be
+204048ef
+2040407c
+204044cc
+204044dc
+204044ff
+20404504
+20404512
+2040451f
+20404515
+2040452a
+2040452d
+20404532
+20404535
+20404022
+20404547
+2020453c
+6fe44bab
+c29bc4cf
+20600000
+6fe0cb9e
+c1808000
+da604b9b
+da4044d4
+2020318a
+6fe0c938
+c1000000
+6fe44bab
+c3830000
+d8e00006
+204046f0
+20403173
+2020454e
+6fe0c938
+c00044e2
+6fe44bab
+c41a8000
+6848cbca
+202044e5
+6fe44bab
+c4190000
+6848cbcb
+6048cb9d
+20404115
+1fe17e07
+6848cb9d
+98467c00
+2022c4f1
+6fe0c78f
+67e0cba0
+6fe0cb9f
+c1000000
+704b9f00
+20600000
+204044f6
+6fe0cb9f
+c1008000
+704b9f01
+20207931
+da404827
+da604ba0
+6fe0c938
+c000318a
+da4044d4
+2040318a
+6fe0cba0
+c000c6e2
+20600000
+da604ac2
+da404502
+20203191
+20404576
+20203e20
+da604b77
+da40450a
+20403191
+6fe0cb77
+c000b203
+20600000
+6fe0cac1
+c07fc2f8
+6fe0cab0
+243a470e
+6fe44bab
+c299c553
+c297c81f
+20203e20
+da604b76
+da40438e
+2020318a
+6fe0cac6
+207a0000
+da604ac8
+da40451a
+2020318a
+6fe0cac7
+247a0000
+6fe0c39b
+c1800000
+20202090
+da604af2
+da404522
+2020318a
+6fe14af0
+67e14af2
+202043cb
+6fe0cb75
+c3810000
+2040436c
+d8e00000
+20204375
+da60478a
+da404424
+2020318a
+da604b87
+da404530
+2020318a
+704b8801
+20600000
+da604ac4
+da403e20
+2020318a
+da604aaf
+da404538
+2020318a
+6fe0cb8a
+67e0c177
+704aae01
+20600000
+6fe0c92a
+c3838000
+da604ab2
+da404541
+20203191
+6fe0c938
+c00047e1
+2020431b
+6fe14bbe
+67e14ab2
+20600000
+da6049bf
+da40454a
+2020318a
+204045f1
+6fe0cac5
+243a46c0
+20600000
+280ffe26
+2040c7f2
+2040431b
+2040439d
+20204553
+44ed401b
+20404314
+6fe1478c
+c285c55f
+6fe44bab
+c304455f
+68494997
+18408401
+60494997
+6049437b
+180a7e00
+67e0c37a
+6fe1cac9
+67e1c37d
+20403225
+6fe14791
+67e14ac2
+7000bd06
+58000000
+67e14ab2
+67e0cb77
+67e0cac4
+67e0cba7
+67e0caac
+d8e00002
+204046f0
+204046e4
+6fe0cbb3
+2feffe01
+2040c3df
+6fe0cbb3
+2feffe00
+2040f8c4
+2040498e
+202048cc
+44edc01b
+d8e00006
+204046f4
+704ac400
+6fe0cbb3
+2feffe01
+2040c581
+6fe0cbb3
+2feffe00
+2040c583
+20204912
+704b7700
+202078f4
+58000000
+67e14ac2
+202078c9
+44ee401b
+6fe44bab
+c4010000
+204048c6
+d8e00002
+204046f4
+2040458f
+204045a2
+202045ee
+6fe080e8
+c01a4593
+c019c596
+20600000
+67e0cb78
+6fe30297
+20204598
+67e0cb78
+6fe30041
+67e34b79
+6fe3cb78
+d8c04939
+df200003
+e8438006
+98467c00
+2022c5b7
+18c08c16
+c200459c
+20600000
+da204939
+6fe0c938
+1fe0ffff
+1feffe1d
+9a20a200
+6fe080e8
+e7e08011
+c01a45ac
+c019c5b3
+20600000
+6fe30297
+e7e30005
+d8c04316
+20407d0c
+6fe3437a
+e7e30005
+20600000
+6fe30041
+e7e30005
+d8c041cb
+20207d0c
+18c08dfa
+18c20a00
+684b4b79
+18408403
+e0430005
+20600000
+da204939
+6fe0c938
+c1000000
+1fe0ffff
+1feffe1d
+9a20a200
+efe08011
+67e0c482
+c019c5c8
+c01a45cd
+20600000
+efe30006
+67e341dd
+d8a041cb
+20407d0c
+2020602c
+efe30006
+67e341dd
+d8a04316
+20407d0c
+efe30006
+67e3437a
+20600000
+6fe14990
+d840aa55
+98467c00
+2022c5e2
+60494990
+204045e7
+6fe0cab4
+67e0c938
+6fe0c926
+67e0c992
+6fe2488d
+67e24891
+67e2483c
+20600000
+204045bd
+6fe24993
+67e24891
+67e2483c
+20600000
+6fe3437a
+67e34950
+1fe0ff00
+67e3496d
+1fe0ff00
+67e3498a
+20600000
+6fe0c9c0
+67e0c9bf
+20600000
+44eec01b
+6fe44bab
+c289c63f
+c2894603
+20600000
+20405d10
+2040460a
+204045fd
+20405d33
+20404611
+204045d4
+20203f65
+580049b8
+d8404938
+98460400
+6fe1c9b8
+da204938
+20600000
+20405d10
+2040460a
+2040461f
+204045fd
+20404622
+20404611
+20203f65
+700964ab
+204061d7
+20405d15
+da2049bb
+68488964
+20404613
+202061d7
+700964b9
+2020460b
+e0408011
+1ff10400
+e0408005
+1fec8400
+e0408005
+e7e08005
+1a227e00
+67f1008a
+58000000
+67f1008e
+70800602
+20205ccf
+6fe1c9b8
+67e1c4a5
+20205ceb
+1fe22600
+1a227e00
+1fe0fffc
+1fe22400
+efe20012
+67e249bb
+1a627e00
+20405d22
+6fe249bb
+e7e20012
+20600000
+6fe44bab
+c4090000
+20404611
+20405b08
+6848c4b5
+20406065
+6848c4ba
+20203f54
+20405da5
+6fe44bab
+2feffe09
+2440ddbf
+2040463b
+202045d4
+d8400080
+da204938
+da400000
+20205ddc
+d8400080
+da204938
+da400000
+20205dce
+d8400001
+da204992
+da40005a
+20205dce
+d8400001
+da204992
+da40005a
+20205ddc
+44ef401b
+20404990
+20407936
+20404027
+20404655
+204046a0
+204046d6
+20403dbd
+20403f88
+20203dd4
+6fe44bab
+c294c65a
+c29bc65a
+20600000
+704b9403
+6fe0c91b
+c17f8000
+da200000
+704b9606
+6848c91b
+2040466a
+67e0cb94
+6fe0c910
+c07fc667
+20404168
+1a227e00
+c283468b
+20204680
+6848c91b
+20403f56
+20204664
+6fe44bab
+c296c676
+6fe0cb94
+1fe22600
+6fe0c910
+c07fc195
+6fe0cb9a
+243a4673
+20204678
+704b9e00
+704b9400
+20600000
+6fe0cb94
+20204187
+20406059
+6848c910
+2020c676
+6848c910
+20406069
+6848c91b
+6fe0cb94
+20204187
+6fe0cb9e
+c1000000
+704b9e00
+6fe44bab
+c39a0000
+6fe0cb9b
+1fe67c14
+244146b5
+6fe0c78f
+67e0cb9b
+20600000
+20404697
+20740000
+6fe0cb9e
+c1008000
+704b9e01
+6fe44bab
+c29a44d4
+6fe0cb77
+207a0000
+6fe0c902
+67e0cb77
+20600000
+78547c00
+6fe44bab
+c3968000
+6fe0cb8e
+207a0000
+6fe0cb8f
+207a0000
+78347c00
+20600000
+6fe44bab
+c29546a4
+c295be9b
+20600000
+6848c91e
+20403f56
+6848c91e
+20406059
+2020c6ad
+6fe0c938
+c1008000
+70493801
+20204316
+6fe44bab
+c315c6b1
+6fe348ef
+67e348e3
+6fe0c938
+c1000000
+70493800
+202047f2
+44efc01b
+6fe0cbb4
+c1008000
+204046c2
+6048c938
+7041ca00
+204046da
+20404316
+204046dc
+704ac501
+202045ee
+204046da
+20205d8c
+6848c938
+18408401
+6fe44bab
+c288c6c9
+18467c02
+244146d0
+20600000
+6fe0cbb4
+1fe0ffff
+98467c00
+244146ce
+20600000
+d8400000
+20600000
+d8400001
+20600000
+d8400001
+da204938
+da400000
+20205dce
+6fe44bab
+c41a0000
+2040465a
+20600000
+d8e00000
+202046f0
+d8e00000
+202046f4
+d8e00003
+202046f0
+d8e00003
+202046f4
+d8e00005
+202046f0
+d8e00005
+202046f4
+d8e00014
+202046f0
+d8e00018
+202046f0
+d8e00016
+202046f0
+d8e0000c
+202046f0
+d8e0001c
+202046f0
+6fe44bab
+f9207e00
+67e44bab
+20600000
+6fe44bab
+f93ffe00
+67e44bab
+20600000
+d8e00015
+204046f0
+58000000
+67e44bcc
+67e44bd5
+6fe0c90a
+1fe17ec0
+c0204705
+c0404707
+c060470c
+58070008
+67e44bcd
+20600000
+58040005
+20204703
+58022303
+67e44bcc
+58000003
+67e44bd5
+20600000
+5800cd03
+20204708
+44f0401c
+6fe0cab0
+1fe0ffff
+67e0cab0
+6848c938
+18467c01
+2442c6c2
+6048c938
+7041ca00
+204046d2
+204045a2
+20203d59
+6fe44bab
+c41c0000
+6fe248d1
+207a0000
+204047bd
+58000003
+204047b3
+205a47af
+245a47b1
+58000002
+204047b8
+205a47af
+6fe0c9c9
+c000c72d
+6fe44bab
+c41c0000
+df200005
+d8a049c9
+20207d26
+20404741
+6fe149ca
+67e109f8
+6fe148d1
+67e109fa
+20404779
+6fe109f8
+67e149ca
+6fe109fa
+67e148d1
+6fe149cc
+67e109f8
+6fe148d3
+67e109fa
+20404781
+6fe109f8
+67e149cc
+6fe109fa
+67e148d3
+20600000
+6fe44bab
+c41c8000
+6fe149ca
+67e109ff
+20404754
+67e149ca
+6fe148d1
+67e109ff
+20404762
+67e148d1
+6fe149cc
+67e109ff
+20404754
+67e149cc
+6fe148d3
+67e109ff
+20404762
+67e148d3
+20600000
+6fe08a00
+203a4757
+2020475c
+6fe089ff
+2040476f
+67e089ff
+6fe109ff
+20600000
+6fe089ff
+204047ab
+2040476f
+205a7e5e
+204047a7
+2020475a
+6fe08a00
+203a4765
+20204769
+6fe089ff
+20404774
+67e089ff
+2020475a
+6fe089ff
+204047ab
+20404774
+205a7e5e
+204047a7
+2020475a
+1feffe04
+1fe6fc05
+20407def
+1807fe00
+20600000
+1feffe0c
+1fe6fc0a
+20407def
+1807fe00
+20600000
+6fe109f8
+684909fa
+9840fe00
+6848c9ce
+9840fe00
+1fe10401
+6048c9ce
+20204789
+6fe109f8
+684909fa
+9840fe00
+6848c9cf
+9840fe00
+1fe10401
+6048c9cf
+20204789
+67e189fc
+2feffe10
+2020c793
+6fe089fd
+c07fc79a
+6fe089fc
+1fe37e00
+67e109f8
+67e109fa
+20600000
+6fe089fd
+c0004797
+6fe189fc
+2020478f
+7009fe00
+6fe089fc
+2020478f
+6fe089fc
+204047a5
+67e089f8
+67e089fa
+203a47a3
+580000ff
+67e089f9
+67e089fb
+20600000
+58000000
+202047a0
+204047ab
+1fe37e00
+204047ac
+1fe67e00
+67e089ff
+20600000
+1fe67e00
+67e08970
+6fe08970
+20600000
+7049c900
+20600000
+7049c901
+20600000
+9a267c00
+24217e5e
+9a467c00
+24217e5e
+20207e60
+9a267c00
+24610000
+9a467c00
+24610000
+20207e60
+6fe148d1
+204047c4
+1fe22200
+6fe148d3
+204047c4
+1fe22400
+20600000
+67e109fa
+6fe089fb
+c07fc7ca
+6fe089fa
+1fe17eff
+20600000
+6fe109fa
+1fe67e00
+202047c8
+da6048c4
+da4047d0
+2020318a
+6fe248b8
+67e2485c
+704aae01
+20600000
+c00047db
+c000c7dd
+c00147d8
+c001c7df
+580ea600
+67e248b8
+20600000
+5805e740
+202047d9
+580927c0
+202047d9
+58124f80
+202047d9
+7048a500
+20402652
+5fffffff
+67e2485c
+58000000
+67e3c8d0
+704be101
+2040423c
+20403e33
+202026b5
+6fe0cbe1
+245a41aa
+704be100
+20202651
+6fe0cbe1
+243a262c
+20202628
+793f8026
+7048a100
+d8e00001
+202046f4
+6fe44bab
+c308c803
+20403d65
+20344806
+6fe44bab
+c298480c
+c318c80c
+20404110
+1fe17e07
+6848cbcb
+98467c00
+2022c827
+2020480c
+6fe0cab0
+243a470e
+20600000
+6fe14885
+67e14887
+70488b03
+20202559
+20403d65
+20344816
+70493800
+6fe14bba
+67e14887
+70488b02
+20202559
+204048cc
+6fe14881
+67e14887
+70488b04
+20202559
+6fe0c938
+c0004806
+20404314
+2020481a
+204047f2
+2040490e
+70493801
+204045bd
+20203d59
+20403d65
+20343e20
+20204553
+20403d65
+20740000
+6fe44bab
+c297c5ee
+20600000
+d8e00001
+204046f0
+58000000
+67e14887
+20404576
+2040498e
+204048cc
+70483601
+6fe44bab
+c30aa32e
+70483602
+2020232e
+6fe0c8a5
+243a47e1
+6fe0c88b
+c0014840
+c0024844
+c001c849
+20404912
+204047f2
+6fe0cab0
+243a470e
+6fe0c938
+c0003e20
+20600000
+6fe44bab
+c297c811
+c2984811
+20204806
+6fe44bab
+c317c839
+6fe0cbb4
+c000c839
+2020481a
+6fe44bab
+c317c839
+c289c839
+c2894839
+20204812
+204042ca
+704aae00
+7048a100
+70488b00
+6fe24891
+6fe2488d
+98467c00
+20628000
+20204822
+d8e00001
+204046f4
+204048c6
+58000000
+67e14883
+67e14887
+67e0c8a1
+67e0c9c8
+67e0c88b
+204042ca
+204042db
+6fe2483c
+67e24891
+67e24993
+202045ee
+c6930000
+20403f70
+24740000
+6fe44bab
+c30ac86d
+6fe0cb8b
+243a4884
+204042cb
+6fe0c836
+c280c87c
+6848c7c7
+6fe0c8d0
+9841fe00
+67e0c8d0
+6848c7cc
+6fe0c8d5
+9840fe00
+67e0c8d5
+6848c7cd
+6fe0c8d6
+9840fe00
+67e0c8d6
+70483601
+da200007
+da4048d0
+6fe44bab
+c28c26e1
+6fe148d5
+207a0000
+202026e1
+70483602
+da200009
+6fe0cb8c
+243a488a
+da404bd5
+20600000
+da404bcc
+20600000
+58000000
+67e1cba4
+20600000
+6fe44bab
+c40b0000
+6fe0caae
+207a0000
+6fe0c8a7
+207a0000
+6fe0cba1
+1fe0fe01
+1fe17e03
+67e0cba1
+247a0000
+704ba200
+6fe0cba2
+1fe0fe01
+67e0cba2
+1fe67c08
+242148a5
+2040259a
+2040265b
+242c48ab
+2437c8ab
+204048b5
+20402597
+6fe0cba3
+1fe0fe01
+67e0cba3
+c00848ad
+20600000
+204022cb
+2020489b
+704ba300
+6fe0cba4
+c3800000
+79207e00
+67e0cba4
+6fe14bbc
+67e14ab2
+2020423c
+6fe0c8a7
+203a488c
+704ba300
+6fe0cba4
+c4000000
+793ffe00
+67e0cba4
+20404544
+202041aa
+6fe44bab
+c4100000
+6fe0cba7
+207a0000
+1fe0ffff
+67e0cba7
+203a4912
+20204920
+6fe44bab
+c4100000
+2040498e
+6fe0cbc0
+67e0cba7
+20600000
+704ba700
+6fe14bc4
+67e14930
+67e14932
+6fe0c938
+c00048d5
+c000c8d7
+c00148d9
+20600000
+6fe0c915
+202048da
+6fe0c916
+202048da
+6fe0c922
+67e08964
+20404912
+6fe08964
+67e0c92f
+da200000
+70492d01
+20207806
+6fe0c923
+c17f8000
+6fe14ac2
+247a0000
+6fe14883
+247a0000
+6fe14887
+247a0000
+6fe0cba7
+247a0000
+6fe0cbc1
+203a48f2
+67e0cba8
+20600000
+da604ba8
+da4048f2
+2020318a
+6fe0c923
+67e0c92f
+6fe14bc2
+67e14930
+67e14932
+da200000
+6848c992
+18408401
+6fe44bab
+c30e48ff
+18408401
+18467c04
+24414902
+6048c92e
+70492d01
+20600000
+d8400001
+20600000
+78547c00
+6fe0c923
+6848c92f
+98467c00
+24628000
+6fe0c92e
+207a0000
+7048f900
+78347c00
+20600000
+2040491e
+20404917
+2040491a
+2020491c
+6fe0c938
+c0004917
+c000c91a
+c001491c
+20600000
+704baa00
+6848c915
+2020492b
+6848c916
+2020492b
+6848c922
+2020492b
+6848c923
+2020492b
+6fe0c938
+c0004925
+c000c927
+c0014929
+20600000
+6848c915
+2020492f
+6848c916
+2020492f
+6848c922
+2020492f
+44f0c01c
+6048c92f
+da200000
+20207801
+44f1401c
+6048c92f
+da200000
+202077fc
+6fe0c915
+98467c00
+2042c952
+6fe44bab
+c3126065
+20404943
+20404947
+2040494b
+6fe0cba9
+203a6065
+704ba900
+2020607f
+6fe0c915
+98467c00
+2042c954
+20206069
+6fe44bab
+c4130000
+6fe0c922
+2020494e
+6fe44bab
+c4128000
+6fe0c923
+2020494e
+6fe44bab
+c4138000
+6fe0c921
+98467c00
+24628000
+704ba901
+20600000
+704baa00
+20600000
+704baa01
+20600000
+6fe14ac2
+247a0000
+6fe14883
+247a0000
+6fe14887
+247a0000
+6fe0cba7
+247a0000
+20404904
+20740000
+6fe44bab
+c4108000
+c4020000
+c291c97c
+6fe0c8f8
+1fe0fe01
+67e0c8f8
+1fe67c14
+2441496e
+c0014970
+c0024976
+c0034970
+c0044976
+20600000
+7048f801
+20204976
+6fe44bab
+c2914920
+6fe0c921
+c17f8000
+6848c921
+2020492f
+6fe44bab
+c2914912
+6fe0c921
+c17f8000
+6848c921
+2020492b
+6fe14bbe
+68494ab2
+98460400
+6fe14bc8
+98467c00
+2421498e
+6fe0c8f9
+247a0000
+7048f901
+20204986
+6fe14bc6
+67e14930
+67e14932
+6fe44bab
+c29148d0
+6fe0c921
+c17f8000
+202048da
+7048f900
+20204976
+6fe44bab
+c4108000
+c4020000
+c291c9a2
+6fe0c8f8
+1fe67c0a
+2021499e
+6fe0c938
+c000499b
+70409901
+20600000
+6fe44bab
+c38c0000
+202026d0
+6fe0c938
+c00026e1
+70409900
+20600000
+6fe0c8f9
+243a499e
+20204997
+20401291
+6fe08018
+202025e2
+204049a5
+202026ee
+204049a5
+6fe08031
+2feffe00
+24608000
+6fe08048
+2feffe03
+2040a724
+2440a720
+202026ee
+6fe0cb75
+2fe00603
+2420fe5e
+20403223
+20207e60
+204052f7
+247a0000
+70008901
+70008a00
+20207e60
+6fe1478c
+c284c9b3
+202049b8
+20758000
+20406172
+58004a74
+67e1489b
+58004a03
+67e1489f
+580049fe
+67e1445d
+58004a3e
+67e14465
+58004a40
+67e14467
+58004a59
+67e1446f
+580049f3
+67e14991
+580049e3
+67e14995
+44f1c01c
+20405dbc
+204049fa
+2040793a
+6fe0c961
+67e0c8d0
+c00049e2
+6fe0c962
+67e0c790
+204049f3
+204077bb
+204077c5
+70498d01
+6fe1478c
+c3860000
+20203217
+70498d02
+204049f3
+da200000
+20407806
+204049ef
+20405ddc
+204026e5
+2034232e
+6fe2483c
+67e24891
+6fe14885
+67e14887
+20202559
+d8400004
+da20483c
+da400000
+20600000
+44f2401c
+6fe0c95f
+c0ffc9f8
+6848c93c
+20206069
+67e0c93c
+202049f6
+20402607
+6fe14989
+67e1498b
+20600000
+20404a03
+6fe0c932
+79207e07
+d840003f
+20206092
+2040609f
+20206197
+204061a3
+20404a16
+20404a09
+20204a24
+6fe0c998
+c1808000
+6fe2499c
+203a4a10
+7049a200
+78347c00
+2020790b
+6fe0c9a2
+c17f8000
+1fe0fe01
+67e0c9a2
+78547c00
+20207909
+684944c8
+18417e01
+18430400
+67e0c99c
+18417e01
+18430400
+67e0c99d
+18417e01
+18430400
+67e0c99e
+18417e01
+18430400
+67e0c99f
+20600000
+44f2c01c
+20404a34
+20404a39
+20404a2a
+24740000
+20204a70
+6fe0c998
+c1808000
+6fe0c9a2
+207a0000
+1fe67c01
+24610000
+6fe14885
+67e14887
+78347c00
+20600000
+6fe0c99c
+243a4a64
+6fe0c99d
+243a4a66
+20204a6c
+6fe0c99e
+243a4a68
+6fe0c99f
+243a4a6a
+20204a6e
+20404a4e
+20204a05
+1a627e00
+c016b23f
+c0083227
+c01cca48
+c01e4a4a
+c01d4a47
+20600000
+20202597
+204049ef
+20405dce
+7048a100
+70499901
+70499a01
+20600000
+6fe0c999
+c1000000
+6fe0c998
+c1008000
+70499801
+da200000
+20207801
+da200000
+20407801
+204049f3
+20203217
+20403198
+2040232b
+20402556
+20204a5d
+6fe0c963
+207a0000
+6fe0c4c8
+243a49fb
+da60498b
+da404a55
+20203191
+70496a01
+20600000
+70496a02
+20600000
+70496c01
+20600000
+70496c02
+20600000
+70496a00
+20600000
+70496c00
+20600000
+da204964
+2020793f
+da204971
+2020793f
+6fe0c99a
+c000ca7e
+da20497a
+20407956
+24344a83
+d8c0497a
+efe08006
+1fe22200
+da40497b
+20600000
+70499a00
+78347c00
+da200001
+da40499b
+20600000
+6fe0c97d
+c0024a87
+c002ca87
+20600000
+6fe0c980
+243a4a8e
+6fe0c982
+243a4a8e
+6fe0c984
+243a4a8e
+20600000
+78347c00
+20204a79
+70478f14
+70478301
+5800060f
+67e148d1
+580048d1
+67e1448a
+70409901
+70415b06
+70417802
+7048d000
+58004930
+67e1448d
+70448c01
+704931ff
+58000296
+67e14933
+5800073a
+67e14935
+5800498d
+67e144ca
+58000c0c
+67e1498f
+58004944
+67e144c6
+70496100
+70495fff
+704962ff
+70495d00
+70495e00
+70496000
+70496301
+58004e55
+67e14950
+67e14952
+58000007
+67e14956
+7044a002
+38035a0c
+3804011a
+38080060
+380c0028
+67e4c964
+3802000a
+38040002
+e7e20005
+38035a08
+3804019a
+38080000
+380c0000
+67e4c971
+58000064
+67e14989
+7041e800
+70483601
+7048a806
+70485b01
+70488c00
+2040231a
+20402613
+204022ff
+20402325
+58000708
+67e14881
+58000050
+67e14885
+580a7700
+67e1c8b0
+58604800
+67e1c85c
+20203100
+20758000
+20406df3
+58004b5b
+67e1445d
+58004b59
+67e1445f
+58003217
+67e14469
+58004b57
+67e14465
+58004b06
+67e14467
+58004b00
+67e1445b
+58004bc8
+67e1446b
+58004b3d
+67e1446f
+58004ba3
+67e147e8
+58004bdf
+67e147e3
+58004be0
+67e147e5
+20404afb
+20401aa9
+20404bcb
+20406172
+2040793a
+204077f0
+44f3401c
+20404bd8
+6fe0c7de
+c0004afd
+6fe0c7df
+67e0c790
+20204be7
+7045f707
+20600000
+704790ff
+7047e001
+20204b76
+6fe0c7e0
+c00131dd
+20405301
+6fe0c4e6
+243a31dd
+202031df
+1a627e00
+c00a4b0f
+c00acb13
+c01fcb16
+c0204b1c
+c0084b22
+c0164b23
+c016cb2e
+20600000
+20404b5d
+58000000
+67e147b8
+20203215
+2040793a
+7047b100
+20204b76
+2040793a
+7047b101
+6fe447c2
+67e44372
+20403223
+20201f57
+6fe143db
+c1000000
+6fe447ca
+207a0000
+67e44372
+20201f57
+20204bf8
+6fe0c7de
+c1000000
+6fe0c7e0
+c1808000
+20404b29
+20203213
+7049e001
+df20000b
+d8a049e1
+d8c049ca
+20207d5f
+6fe0c7de
+c1000000
+6fe0c7e0
+c000cb33
+20204bf4
+6fe0c9e0
+c1808000
+7049e000
+6fe1478c
+c2803215
+c284b215
+df20000b
+d8c049e1
+d8a049ca
+20207d5f
+20404b40
+20404b47
+20204b52
+da6047dc
+da404b43
+20203191
+7047e002
+20403215
+20404b87
+20204be4
+da6049ed
+da404b4a
+2020318a
+6fe1478c
+c284cbe4
+c2804be4
+6fe0c9ca
+c000cbe4
+c0024be4
+c002cbe4
+20203217
+6fe0c7e0
+c1808000
+da6047b8
+da404b64
+20203191
+20404bb4
+202061a3
+2040609f
+20206197
+2040609f
+20206df7
+6fe0c7a4
+c2804b60
+20600000
+6fe147d8
+67e147da
+67e147dc
+20203205
+6fe0c7e0
+c1808000
+6fe0c7a4
+c2804b69
+20600000
+6fe1478c
+c3848000
+6fe147d6
+67e147da
+67e147dc
+6fe147b4
+20404c09
+20403211
+6fe247be
+67e249cd
+6fe1478c
+c3858000
+20203207
+6fe0c7e0
+c1808000
+6fe0c7a4
+c2804b7b
+20600000
+6fe147b8
+684947b6
+604947b8
+247a0000
+6fe147b2
+20404c09
+20403211
+6fe247ba
+67e249cd
+6fe1478c
+c3858000
+20203207
+6fe1478c
+c284b20f
+20204b5d
+20407e56
+6fe1478c
+c284cb8e
+20600000
+6fe0c7b1
+207a0000
+20207e54
+20407e56
+6fe1478c
+c3800000
+c3848000
+20207e54
+6fe0c7a4
+c2804b99
+20600000
+20204b76
+78567c00
+6fe147da
+67e147dc
+20404b91
+20344b96
+20404b8a
+24740000
+78367c00
+20600000
+20404b9a
+24760000
+1a227e00
+203a4baa
+20403213
+da6047f2
+20204bac
+20403215
+da60481a
+dfe00005
+98effe00
+9a60a600
+efe08013
+207a0000
+20404bc0
+1a60a601
+20204baf
+6fe1478c
+c284cbb7
+20600000
+20401b77
+247a0000
+20404bc3
+24740000
+1fe0ffff
+1feffe05
+d8404842
+98408c00
+20204c0d
+67e0895c
+da20095c
+2020793f
+da20095c
+20407956
+24740000
+6fe0895c
+20600000
+6fe14437
+c00c4b16
+20600000
+58000002
+67e0c9ec
+58200008
+67e247c2
+592c0005
+e7e20005
+70438017
+5800001b
+67e143d1
+20401b16
+20401b32
+20401b3f
+20201b1e
+df200028
+d8a04842
+d8c09e57
+20207d52
+df20017e
+d8c09af2
+20207d52
+20204b76
+da200000
+da6049d5
+2040780c
+20404b87
+6fe0c9ec
+67e0c9ed
+20600000
+58000000
+20404bef
+70478301
+204077bb
+204077c5
+6fe1478c
+c3860000
+20203217
+684944ca
+e7e08002
+efe08005
+67e0c78f
+20600000
+6fe144ca
+efe0803f
+c1800000
+20203217
+684944ca
+efe08002
+c000cc03
+58000001
+684944ca
+e7e08002
+18408c02
+efe08006
+e7e0800f
+efe10006
+20207e05
+58000002
+20404bef
+18408c05
+efe10006
+203a3217
+20207e05
+67e14159
+1fe0fffc
+67e14428
+20600000
+efe08006
+1fe22200
+e8410006
+20407ceb
+20401eb3
+1a227200
+20407ce5
+20207d5f
+6fe149ee
+67e147ea
+6fe0c9f0
+67e0c9cc
+67e0c9d7
+6fe0c9f1
+67e0c7de
+6fe0c9f2
+67e0c7df
+7047a401
+58000030
+67e147af
+58000000
+67e147a5
+58000001
+67e147f2
+67e147f7
+58000006
+67e1481a
+67e1481f
+58000007
+67e147fc
+58000008
+67e14824
+580047e0
+67e144ca
+58201400
+67e1c7e0
+70409901
+58000100
+67e14159
+70415b08
+70417705
+70417802
+58000030
+67e14455
+58000001
+e7e10005
+7046410a
+58000096
+67e147ba
+e7e10005
+58000296
+67e147be
+e7e10005
+38000010
+38048008
+380ac000
+380c0004
+67e447ca
+70448c01
+580049ca
+67e1448d
+58000000
+67e149ca
+380001a0
+38040068
+38080000
+380c0000
+67e449cd
+58000301
+67e149d5
+380001a0
+380400e8
+38080000
+380c0000
+67e449d8
+5800000e
+67e147b2
+58000140
+67e147b4
+67e14428
+58000050
+67e147b6
+70443207
+70442700
+380000fb
+3806c212
+3808800f
+380c0021
+67e4444c
+3800ff00
+38043fc0
+38080ff0
+380c03fc
+67e447d2
+580048fb
+67e1448a
+58002001
+67e148fb
+7043e71f
+38010102
+380480c1
+38098120
+380c640c
+67e4c3e8
+380003c1
+e7e10005
+7044071f
+3802090d
+38074c15
+380a8532
+380dd1d5
+67e4c408
+38026574
+3804001c
+e7e18005
+580047e7
+67e144c6
+7047e702
+70447d17
+58004920
+67e14487
+70448905
+58002540
+67e140b2
+58040003
+67e1c765
+70476c03
+70476401
+70478e01
+70415f00
+3803ffff
+3806fe23
+380999d9
+380c020d
+67e440a0
+58009af2
+67e14396
+7040d801
+38010306
+38040004
+38082010
+380c9040
+67e4c662
+38020011
+38040044
+e7e28005
+70467800
+58009c70
+67e14660
+7040c518
+20203100
+6fe0c4d4
+d840003e
+20206092
+6fe0c4d4
+d840003f
+20206092
+20404ca7
+20404ca4
+20204ca7
+20404cab
+20204ca4
+20204cab
+20404cab
+20204cad
+20204ca4
+6fe0c4d5
+20204ca5
+6fe0c4d5
+20204ca8
+20404cb3
+20404cb5
+20204cb3
+20800000
+20404cc4
+20404cce
+20404ce2
+20404d01
+20404d05
+7009fc01
+7009f904
+20404d10
+20204cc2
+6fe08a2c
+c283cccc
+708a01ff
+20000064
+708a020e
+708a0003
+70804205
+20600000
+70804204
+20600000
+20404cd2
+20404cd6
+20404cda
+20204cde
+6fe0c7a4
+247a0000
+7047a40d
+20600000
+6fe0c7a5
+247a0000
+7047a50e
+20600000
+6fe0c7a6
+247a0000
+7047a609
+20600000
+6fe0c7a7
+247a0000
+7047a70a
+20600000
+58001800
+67e1095c
+58001bff
+e7e10005
+58001c00
+e7e10005
+58001fff
+e7e10005
+6fe4095c
+20405eb0
+6fe08a2c
+2feffe07
+2040ded7
+2440dedb
+d841c200
+20405ec8
+6fe0c7a4
+d8400008
+20406093
+6fe0c7a5
+d8400049
+20406093
+6fe0c7a6
+d840000a
+20406093
+6fe0c7a7
+d840000b
+20406093
+d8400081
+60588060
+20207e02
+6fe0c7a8
+247a0000
+7047a80c
+20600000
+6fe0c7a8
+d8400010
+20406093
+da200040
+204061d1
+da200000
+da400000
+58000000
+2040620a
+d8e00000
+2020621d
+6ff10112
+1fe0a3fc
+24610000
+20405ef7
+efe08003
+c000cd18
+20407d12
+20205f07
+efe10003
+67e109fd
+d84003ff
+98410400
+604909f6
+1feb7e00
+1fecfe00
+67e089f8
+efe08003
+1fe0ffff
+9a267c00
+20610000
+20404d26
+20204d81
+6fe089f8
+c01fcd29
+20204d6d
+44f3c01c
+6fe089f6
+c0004d6c
+c000cd34
+c0014d39
+c001cd47
+c0024d51
+c002cd6c
+c0084d62
+c00a4d68
+20204d6c
+7009ff00
+6ff10000
+67e10a00
+df200003
+20204d74
+efe10003
+67f10052
+20600000
+efe08003
+1fe20400
+67f08024
+efe08003
+98408400
+79207e07
+67f08023
+efe08003
+98408400
+1fe27200
+20600000
+20404d3c
+efe08003
+67f08025
+98408400
+c2004d48
+184104ff
+efe08003
+98467c00
+2422cd60
+20204d6c
+df200020
+d8a04000
+d8400000
+efe08003
+e7e08005
+98408400
+c2004d54
+184104ff
+efe08003
+98467c00
+2422cd60
+70802300
+20404d6c
+20407e07
+20200801
+70802300
+20204d6d
+efe08003
+1fe27200
+efe10003
+1fe20a00
+20405f4d
+20204d6c
+6ff08060
+79207e04
+67f08060
+20204d6c
+20204d71
+7009ff01
+20204d72
+7009ff0c
+20204d72
+7009ff00
+df200001
+20204d74
+7009fa0e
+1f20fe03
+67e089fb
+20404d7d
+6fe189fc
+e7e18003
+d8c009ff
+20405f33
+20205f13
+20405f0f
+6fe189f9
+e7e18003
+20600000
+20405ef7
+18608603
+efe08003
+98608600
+20205f03
+7041db00
+20600000
+6fe341dd
+684b0041
+98467c00
+20600000
+44f4401d
+6fe10315
+1fe20c00
+efe08006
+67e0c5f5
+1fe1040f
+1ff1fe00
+c004cdad
+c003cdad
+c0054dbc
+c002cda5
+c000cd99
+20600000
+18427e00
+c002cd9d
+c001cda4
+20600000
+70095b27
+20407871
+6fe0c09a
+c1840000
+18427e00
+c002c44c
+20600000
+20600000
+20404dbc
+da200001
+20404dc0
+6fe144dc
+e7e10005
+58000000
+e7e08005
+20600000
+da200001
+20404dc0
+6fe144dc
+e7e10005
+58000000
+e7e08005
+70095001
+6fe0c4e2
+79207e06
+67e0c4e2
+70095b12
+20407871
+6fe0c09a
+c1840000
+2020442c
+efe08006
+c000cdbf
+20600000
+20600000
+2040529d
+1a220400
+60488950
+1fe20a00
+1a227e00
+e7e10005
+20600000
+2035cdcc
+580045f6
+d8a044d6
+98a67200
+20407d26
+44f4c01d
+58000424
+d8a003e4
+98a67200
+20407d26
+5800037a
+d8a0030e
+98a67200
+20407d26
+2020536b
+44f5401d
+18c20400
+18420c00
+efe10006
+67e10317
+efe10006
+67e10319
+18c27e00
+67e10315
+6fe0c78b
+c0004de2
+2020514d
+6fe10317
+203a4e5a
+44f5c01d
+6fe08319
+c000cdf8
+c0284e3a
+c028ce53
+c0294e51
+c029ce51
+20204e5a
+44f6401d
+20405301
+6fe0c4e6
+c0007e60
+c000fe60
+c0017e60
+c001fe60
+c040fe60
+c0607e60
+c0407e60
+c0207e60
+20600000
+20404dec
+247a0000
+2040530b
+20404e5f
+68490320
+203a4e59
+20405314
+6fe10320
+e7e10005
+18007e01
+e7e10005
+20204e5a
+6fe0c5f4
+207a0000
+1fe22200
+44f6c01d
+6fe20386
+d8400100
+98408400
+1c427e00
+98467c00
+24610000
+7045f400
+1a227e00
+c0284e12
+2020137a
+d9000000
+2040530b
+20404ed8
+20405316
+20407cee
+20404f0b
+20405314
+5800000c
+e7e10005
+18007e01
+e7e10005
+20204e5a
+44f7401d
+6fe10326
+1fe0fe04
+20407eb6
+1fe08401
+d8c044f0
+efe18006
+207a0000
+67e1898e
+6fe0898e
+1fe22200
+20404e2d
+1a427e00
+67e0c4f0
+20600000
+d8e00000
+da400000
+18e67c07
+24610000
+aa2fffff
+2020ce34
+20204e38
+18427e00
+203a4e38
+f9202400
+184085ff
+18e08e01
+20204e2f
+204052f7
+247a0000
+20404dec
+247a0000
+20405318
+20406df3
+204066c7
+20406df7
+20404e1e
+20204e4a
+204052f7
+247a0000
+20405318
+20406df3
+204066c7
+20406df7
+20405321
+6fe10326
+203a4e59
+e7e10005
+6fe144d8
+e7e10005
+20204e5a
+20404d8c
+20204e5a
+44f7c01d
+70033500
+20406341
+6fe08335
+c1008000
+20204e5a
+204052e7
+58000000
+67e10317
+67e10319
+70031b01
+20600000
+44f8401e
+20405316
+18002400
+6fe10317
+1fe22600
+6fe10315
+98000c00
+20404e6e
+1a627e00
+1a60a7fc
+1fe0fffc
+243a4e66
+1a427e00
+67e10320
+20600000
+44f8c01e
+efe08006
+c000cea7
+c0014eaf
+c001cf33
+c0024f63
+c002d000
+c0035029
+c003d079
+c00450ae
+c004d0be
+c0054e7d
+c005d0bf
+204050c0
+20600000
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+5800000b
+e7e08005
+18e27e00
+e7e08005
+efe10006
+c0014e8b
+c001ce91
+20600000
+58020008
+e7e30005
+58000280
+e7e20005
+18007e0c
+20204e96
+5803000c
+e7e30005
+58000006
+e7e40005
+18007e10
+9a40a400
+20204e7c
+efe08006
+1fe20e00
+efe10006
+1fe22200
+efe10006
+67e10964
+1a627e00
+9a262600
+20405316
+5800000b
+e7e08005
+18e27e00
+e7e08005
+6fe10964
+20204e88
+efe08006
+1fe20e00
+efe10006
+1fe22200
+98c08c00
+1a627e00
+9a262600
+20204e7c
+20407cee
+20407cf3
+d9000000
+efe08006
+1fe20e00
+efe10006
+1fe22200
+efe10006
+1fe20400
+efe10006
+1fe21600
+44f9401e
+18427e00
+c000cec2
+c001cee4
+c008cef0
+c009cefb
+204050c0
+20204f32
+20407cee
+d8400050
+6fe144d8
+243a4f2c
+19627e00
+67e144d8
+1c427e00
+67e20386
+20404ecc
+20204f07
+60490384
+19627e00
+67e1037a
+1a227e00
+67e1037c
+1a427e00
+67e1037e
+1a627e00
+67e10380
+18e27e00
+67e10382
+20600000
+68490384
+6fe1037a
+1fe21600
+6fe1037c
+1fe22200
+6fe1037e
+1fe22400
+6fe10380
+1fe22600
+6fe10382
+1fe20e00
+20600000
+20407cee
+58000051
+d8400051
+6fe144da
+243a4f2c
+19627e00
+67e144da
+6fe0c4e1
+79207e00
+79207e01
+67e0c4e1
+20204f0f
+20407cee
+d8400052
+6fe144dc
+243a4f2c
+19627e00
+67e144dc
+6fe0c4e2
+79207e00
+79207e01
+67e0c4e2
+20204f0f
+20407cee
+1b427e00
+d8400053
+6fe144de
+243a4f2c
+19627e00
+67e144de
+6fe0c4e3
+79207e00
+79207e01
+67e0c4e3
+20204f0f
+58000001
+67e1032e
+7045f450
+20204f11
+6fe0c4e0
+79207e00
+79207e01
+67e0c4e0
+58000000
+67e1032e
+44f9c01e
+20407cf3
+58000003
+e7e08005
+18e27e00
+e7e08005
+58000008
+e7e10005
+18427e00
+e7e10005
+19627e00
+e7e10005
+6fe1032e
+c000cf27
+290c0000
+2020cf22
+58000004
+e7e10005
+18007e00
+e7e10005
+5800000c
+20204f2e
+e7e10005
+18007e02
+e7e10005
+5800000c
+20204f2e
+79201000
+20204f0f
+9a40a400
+1a627e00
+9a262600
+20204f32
+20204e7c
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe10006
+1fe21600
+efe10006
+1fe20400
+44fa401e
+58000050
+98467c00
+2022cf4b
+58000051
+98467c00
+2022cf51
+58000052
+98467c00
+2022cf5d
+58000053
+98467c00
+2022cf57
+20600000
+19627e00
+67e144d8
+6fe0c4e0
+79207e01
+67e0c4e0
+20204e7c
+19627e00
+67e144da
+6fe0c4e1
+79207e01
+67e0c4e1
+20600000
+19627e00
+67e144dc
+6fe0c4e3
+79207e01
+67e0c4e3
+20600000
+19627e00
+67e144de
+6fe0c4e2
+79207e01
+67e0c4e2
+20600000
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe10006
+1fe20400
+18422200
+44fac01e
+58000050
+98467c00
+2022cf7a
+58000051
+98467c00
+2022cf98
+58000052
+98467c00
+2022cf84
+58000053
+98467c00
+2022cf8e
+202050c0
+18a21600
+6fe0c4e0
+79207e04
+79207e03
+67e0c4e0
+19620a00
+d9600050
+6fe144d8
+1fe20400
+20204fa1
+18a21600
+6fe0c4e2
+79207e04
+79207e03
+67e0c4e2
+19620a00
+d9600052
+6fe144dc
+1fe20400
+20204fa1
+18a21600
+6fe0c4e3
+79207e04
+79207e03
+67e0c4e3
+19620a00
+d9600053
+6fe144de
+1fe20400
+20204fa1
+18a21600
+6fe0c4e1
+79207e04
+79207e03
+67e0c4e1
+19620a00
+d9600051
+6fe144da
+1fe20400
+44fb401e
+58000005
+e7e08005
+18e27e00
+e7e08005
+58000006
+e7e10005
+18427e00
+e7e10005
+18007e00
+e7e10005
+18007e00
+e7e10005
+18007e0a
+9a40a400
+60490333
+18e27e00
+67e08332
+18007e50
+a961fe00
+2020cfb7
+1fe0fe01
+20600000
+78547c00
+c3810000
+c4000000
+c4008000
+79207e02
+18c20a00
+18a08bff
+e7e08005
+78347c00
+20600000
+6fe0c4e0
+20404fb8
+24344fc9
+70033150
+6fe144d8
+67e10333
+20204fdd
+6fe0c4e1
+20404fb8
+24344fd0
+70033151
+6fe144da
+67e10333
+20204fdd
+6fe0c4e2
+20404fb8
+24344fd7
+70033152
+6fe144dc
+67e10333
+20204fdd
+6fe0c4e3
+20404fb8
+24740000
+70033153
+6fe144de
+67e10333
+44fbc01e
+20405297
+2040530b
+18002400
+20405316
+18007e04
+e7e08005
+6fe0c4e5
+e7e08005
+58000008
+e7e10005
+6fe10333
+e7e10005
+58000000
+e7e10005
+18007e01
+e7e08005
+18007e02
+e7e08005
+6fe08331
+c028cff5
+58000030
+e7e10005
+20204ff7
+580003e3
+e7e10005
+d840000c
+60490320
+20405314
+6fe10320
+e7e10005
+18007e01
+e7e10005
+70033100
+20204e7c
+18c08c01
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe10006
+1fe22200
+44fc401f
+58000050
+9a267c00
+2022d018
+58000051
+9a267c00
+2022d01c
+58000052
+9a267c00
+2022d020
+58000053
+9a267c00
+2022d024
+18c08c02
+efe10006
+98007c00
+20204e7c
+6fe0c4e0
+79207e05
+67e0c4e0
+20204e7c
+6fe0c4e1
+79207e05
+67e0c4e1
+20204e7c
+6fe0c4e2
+79207e05
+67e0c4e2
+20204e7c
+6fe0c4e3
+79207e05
+67e0c4e3
+70095b06
+20207871
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe10006
+1fe22200
+efe10006
+1fe21600
+1a220400
+20407cee
+44fcc01f
+58000050
+98467c00
+2022d050
+58000051
+98467c00
+2022d060
+58000052
+98467c00
+2022d044
+58000053
+98467c00
+2022d04a
+204050c0
+20205075
+19620400
+6fe144dc
+98467c00
+2022d056
+204050c0
+20205075
+19620400
+6fe144de
+98467c00
+2022d058
+204050c0
+20205075
+19620400
+6fe144d8
+98467c00
+2022d05c
+204050c0
+20205075
+204050d7
+20205068
+204050dd
+6fe144dc
+203a5068
+20205068
+204050d2
+6fe08339
+243a5068
+20205068
+19620400
+6fe144da
+98467c00
+2022d066
+204050c0
+20205075
+204050cd
+20205068
+20407cf3
+58000007
+e7e08005
+18e27e00
+e7e08005
+58000004
+e7e10005
+1a227e00
+e7e10005
+19627e00
+e7e10005
+18007e08
+20205077
+20407cf3
+20205077
+9a40a400
+20204e7c
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe10006
+1fe21600
+efe10006
+1fe20400
+20407cee
+44fd401f
+58000050
+98467c00
+2022d093
+58000051
+98467c00
+2022d099
+58000052
+98467c00
+2022d09f
+58000053
+98467c00
+2022d0a5
+204050c0
+202050ad
+18422200
+19620400
+6fe144d8
+98467c00
+2042d0d2
+202050ab
+18422200
+19620400
+6fe144da
+98467c00
+2042d0cd
+202050ab
+18422200
+19620400
+6fe144dc
+98467c00
+2042d0d7
+202050ab
+18422200
+19620400
+6fe144de
+98467c00
+2042d0dd
+202050ab
+20407cf3
+20204e7c
+20204e7c
+efe08006
+1fe20e00
+efe10006
+1fe22200
+98c08c00
+58000009
+e7e08005
+18e27e00
+e7e08005
+18007e00
+e7e10005
+18007e04
+9a40a400
+1a627e00
+9a262600
+20204e7c
+20204e7c
+20204e7c
+18002400
+20405316
+58000001
+e7e08005
+18e27e00
+e7e08005
+58000002
+e7e10005
+58000000
+e7e10005
+1a40a406
+da600004
+20204e7c
+58000000
+67e1032c
+67e144da
+7044e100
+20600000
+58000000
+67e10326
+67e144d8
+7044e000
+20600000
+58000000
+67e144dc
+7044e200
+6fe0c4e3
+c00050e3
+20600000
+58000000
+67e144de
+7044e300
+6fe0c4e2
+c00050e3
+20600000
+70095b07
+20207871
+6fe08330
+793ffe00
+67e08330
+6fe144de
+207a0000
+2040530b
+6fe144de
+1fe22200
+18002453
+202050f8
+6fe08330
+793ffe07
+67e08330
+6fe144dc
+207a0000
+2040530b
+6fe144dc
+1fe22200
+18002452
+20405297
+20405316
+18007e06
+e7e08005
+6fe0c4e5
+e7e08005
+58000004
+e7e10005
+1a227e00
+e7e10005
+1a427e00
+e7e10005
+18000408
+2020513c
+44fdc01f
+20405297
+20405316
+58000002
+e7e08005
+6fe0c4e5
+e7e08005
+58000004
+e7e10005
+18427e00
+e7e10005
+19627e00
+e7e10005
+d8400008
+2020513c
+44fe401f
+20405297
+20405316
+58000004
+e7e08005
+6fe0c4e5
+e7e08005
+58000008
+e7e10005
+18427e00
+e7e10005
+58000000
+e7e10005
+58000001
+e7e08005
+58000002
+e7e08005
+580003e3
+e7e10005
+d840000c
+2020513c
+44fec01f
+20405297
+20405316
+58000006
+e7e08005
+6fe0c4e5
+1fe0fe01
+18a22200
+67e0c4e5
+1a220a00
+e7e08005
+58000004
+e7e10005
+18427e00
+e7e10005
+19627e00
+e7e10005
+d8400008
+60490320
+18427e00
+203a52e7
+20405314
+6fe10320
+e7e10005
+18007e01
+e7e10005
+20600000
+6fe10326
+203a137a
+20405321
+6fe10326
+e7e10005
+6fe144d8
+e7e10005
+20600000
+6fe10317
+203a4e5a
+44ff401f
+6fe08319
+c000d157
+c0284e44
+c028ce53
+c0294e51
+c029ce51
+20204e5a
+2040530b
+18002400
+20405316
+1fe20a00
+6fe10317
+1fe22600
+6fe10315
+98000c00
+20405165
+1a60a7fc
+2422d15f
+1a420400
+2040513c
+20204e5a
+efe08006
+c0015170
+c000d173
+c001d17d
+c002d1b9
+c00251eb
+c003d270
+c003523e
+c00450ae
+c0054e98
+2020528b
+20407cee
+20407cf3
+20204eaf
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe08006
+1a20a3ff
+2422d179
+20600000
+efe08006
+1fe20e00
+efe10006
+1fe22200
+efe10006
+1fe21600
+efe10006
+1fe20400
+efe10006
+1fe67c00
+2022d18f
+c001518b
+c002518b
+2020518d
+70095b16
+20407871
+efe10006
+202051b6
+20407cee
+44ffc01f
+58000050
+98467c00
+2022d19e
+58000051
+98467c00
+2022d1a4
+58000053
+98467c00
+2022d1b0
+58000052
+98467c00
+2022d1aa
+202051b6
+19627e00
+67e144d8
+6fe0c4e0
+79207e01
+67e0c4e0
+202051b5
+19627e00
+67e144da
+6fe0c4e1
+79207e01
+67e0c4e1
+202051b5
+19627e00
+67e144dc
+6fe0c4e2
+79207e01
+67e0c4e2
+202051b5
+19627e00
+67e144de
+6fe0c4e3
+79207e01
+67e0c4e3
+20407cf3
+1a627e00
+9a262600
+20600000
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe10006
+1fe21600
+efe10006
+efe10006
+243a51e5
+20407cee
+19620400
+47004020
+58000050
+98467c00
+2022d1d3
+58000051
+98467c00
+2022d1d7
+58000052
+98467c00
+2022d1db
+58000053
+98467c00
+2022d1df
+6fe0c4e0
+79207e05
+67e0c4e0
+20600000
+6fe0c4e1
+79207e05
+67e0c4e1
+20600000
+6fe0c4e2
+79207e05
+67e0c4e2
+20600000
+6fe0c4e3
+79207e05
+67e0c4e3
+70095b06
+20207871
+20407cf3
+1a20a3fa
+2022d1ea
+18c08c01
+1a20a3ff
+202051e6
+20600000
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe10006
+18c08c02
+1fe20400
+58000005
+e7e08005
+18e27e00
+e7e08005
+1a20a202
+1a227e00
+e7e10005
+20407cee
+4700c020
+58000050
+98467c00
+2022d20a
+58000051
+98467c00
+2022d21b
+58000052
+98467c00
+2022d221
+58000053
+98467c00
+2022d227
+2020522c
+6fe0c4e0
+79207e04
+79207e03
+67e0c4e0
+c2815218
+68488330
+79200406
+60488330
+18e27e00
+1fe0fe01
+67e08332
+6fe0c4e0
+79207e02
+67e0c4e0
+6fe144d8
+67e10333
+2020522c
+6fe0c4e1
+79207e04
+79207e03
+67e0c4e1
+6fe144da
+2020522c
+6fe0c4e2
+79207e04
+79207e03
+67e0c4e2
+6fe144dc
+2020522c
+6fe0c4e3
+79207e04
+79207e03
+67e0c4e3
+6fe144de
+1fe21600
+20407cf3
+19627e00
+e7e10005
+18007e00
+e7e10005
+18007e00
+e7e10005
+18007e0a
+9a40a400
+1a20a3fa
+2022d23d
+efe08006
+e7e08005
+1a40a401
+1a20a3ff
+20205237
+20600000
+efe08006
+1fe20e00
+efe10006
+1fe22200
+1a627e00
+9a262600
+efe10006
+1fe22200
+efe10006
+1fe21600
+20407cee
+47014020
+58000050
+1a220400
+98467c00
+2022d257
+58000052
+1a220400
+98467c00
+2022d25c
+58000053
+1a220400
+98467c00
+2022d25e
+20205260
+58000000
+67e10326
+67e144d8
+67e0c4e0
+20205262
+204050d7
+20205262
+204050dd
+20205262
+58000000
+67e1032c
+20407cf3
+58000007
+e7e08005
+18e27e00
+e7e08005
+58000004
+e7e10005
+1a227e00
+e7e10005
+19627e00
+e7e10005
+18007e08
+9a40a400
+20600000
+efe08006
+1fe20e00
+efe10006
+1fe22200
+efe10006
+1fe21600
+efe10006
+1fe20400
+20407cee
+4701c020
+6fe0c4e5
+a8e1fe00
+2420d287
+58000050
+98467c00
+2022d284
+58000051
+98467c00
+2022d287
+20205287
+7044d800
+7044e000
+20205287
+20407cf3
+1a627e00
+9a262600
+20600000
+58000001
+e7e08005
+efe08006
+e7e08005
+58000002
+e7e10005
+58000000
+e7e10005
+58000006
+9a40a400
+18002604
+20600000
+6fe0c4e5
+1fe0fe01
+c080529b
+1fe0fe01
+67e0c4e5
+20600000
+db001800
+dd600080
+20407e54
+202052a5
+6b0143de
+6d6143e0
+20407e56
+202052a5
+47024020
+204052f1
+243a137a
+20405301
+df200008
+6848c4e6
+1f260e08
+a84fffff
+2020d2b2
+204052b9
+242152b2
+204052cf
+202052b6
+1d627e00
+9b00b000
+c20052aa
+2020137a
+1b027e00
+1b020a00
+20600000
+4702c020
+1f260e08
+d8400000
+d9600000
+18e27e00
+c00452ca
+6fe0c4e6
+afefffff
+2020d2ca
+f9201600
+1d627e00
+98408400
+18e08e01
+1a227e00
+98467c00
+2022d2ca
+202152bd
+18427e00
+9a267c00
+24628000
+f9201600
+20600000
+47034020
+204052f1
+243a137a
+204052f7
+203a52d8
+6fe4c4ea
+67e4c4e7
+58000000
+e7e18005
+6160c4f0
+630144f1
+20600000
+4703c020
+204052fa
+18c08c01
+efe10006
+20600000
+47044021
+204052fa
+18c20a00
+18c20400
+58000000
+e7e18005
+20600000
+4704c021
+204052f7
+203a137a
+6fe1c4ed
+67e1c4f0
+6fe1c4ea
+67e1c4ed
+6fe1c4e7
+67e1c4ea
+20600000
+47054021
+6fe1c4e7
+20600000
+4705c021
+6fe1c4ea
+20600000
+47064021
+6fe1c4f0
+20600000
+204052f7
+203a52ff
+d8c044e7
+efe18006
+203a52fd
+18c08dfd
+20600000
+4706c021
+df200004
+d8c044e7
+d8400000
+efe18006
+1fe17eff
+98418400
+c2005305
+6048c4e6
+20600000
+47074021
+da20007f
+2040529d
+67e1031c
+1fe0fe04
+67e1031e
+58000000
+67e10320
+20600000
+6fe1031c
+20205335
+6fe1031e
+20205335
+4707c021
+da2000fa
+2040529d
+67e10322
+1fe0fe04
+67e10324
+58000000
+67e10326
+20600000
+6fe10322
+20205335
+6fe10324
+20205335
+47084022
+20407cc8
+70033501
+204052f1
+247a0000
+da20007f
+2040529d
+67e10328
+1fe0fe04
+67e1032a
+58000000
+67e1032c
+70033500
+20207cd4
+6fe10328
+20205335
+203a137a
+1fe20a00
+20600000
+4708c022
+da400000
+da2044e7
+1a20a3fe
+1a20a202
+580044f3
+9a267c00
+2022d348
+efe08011
+1a20a201
+203a533c
+e8410011
+efe10002
+9a40a400
+1a40a404
+2020533c
+1a427e00
+20600000
+d8e0000c
+202015ba
+d8e0000c
+202015be
+47094022
+20405301
+6fe0c4e6
+207a0000
+20405338
+d8400100
+98467c00
+2021534a
+2040534c
+d8a044f3
+da2044e7
+580044f3
+9a267c00
+20628000
+efe08011
+1a20a201
+243a5362
+e7e10005
+1a20a202
+20205359
+efe10011
+1a20a202
+1fe20c00
+efe10006
+e7e10005
+1fe27200
+1f20f202
+20407d5f
+20205359
+4709c022
+20405301
+6fe0c4e6
+207a0000
+da2044e8
+1a20a3fd
+d8c044f3
+1a20a203
+580044f4
+9a267c00
+20628000
+efe10006
+203a5372
+1fe0fe04
+1fe27200
+18c22400
+efe10011
+1fe20a00
+1a420c00
+18c08dfe
+20407d5f
+20205372
+20758000
+470a4022
+58000000
+67e08049
+67e08056
+67e08079
+67e0807d
+67e0c15d
+67e080bd
+67e08877
+67e1c644
+67e0c647
+70464200
+70030c00
+7003ab00
+70087700
+70087600
+7003a500
+20600000
+470ac022
+2054da24
+2454da28
+204059e1
+247a0000
+6fe0804d
+c4030000
+793ffe06
+793f8001
+67e0804d
+6fe080cf
+6848804d
+2feffe00
+79208401
+6048804d
+18410402
+60488080
+6848804d
+1fe37e00
+67e0807e
+470b4022
+6fe0807e
+c03fd3f6
+c001d462
+c0025473
+c01e53e9
+c002d3e5
+c007d699
+c00854d8
+c011d4f7
+c01cd6b2
+c01c56ad
+c018d4dd
+c01bd579
+c013d575
+c019d572
+c012d577
+c01354f3
+c003d4ec
+c016d4e3
+c01754e4
+c000d56e
+c0015559
+c01456a4
+c004d54f
+c005d516
+c00454f8
+c0065528
+c00fd4ef
+c01054f1
+c010d593
+c0115593
+c01ad594
+c01b5595
+c0125593
+c01a5596
+c00bd59f
+c008d5b9
+c00955c6
+c009d5c8
+c006d5d8
+c00755d8
+c017d573
+c01855d8
+c00555d8
+c00c55d9
+c01955d8
+c01ed5de
+c01f5627
+c01fd620
+c020566a
+c020d67b
+c0035698
+c01d53e7
+c01553e3
+c014d3e4
+70007f19
+70007d04
+20600000
+202054ed
+20600000
+70007d06
+20600000
+70007d3b
+20600000
+6fe200d0
+1fe3fe00
+67e240d9
+6fe080d4
+67e0c0e0
+6fe280d5
+67e2c0ee
+6fe280da
+e7e28005
+6fe08032
+79207e03
+67e08032
+20600000
+470bc022
+6fe080d0
+79207e07
+67e0807e
+c040d41b
+c0415420
+c04ad57a
+c04b5593
+c045d588
+c041d436
+c0425458
+c048540d
+c04bd42f
+c04c5434
+c04cd410
+c04d5413
+c050d40b
+c1420000
+70007d82
+70007f19
+20600000
+70007da2
+20600000
+70007d82
+70007f2e
+20600000
+20405415
+70007d9a
+20600000
+20405415
+20205419
+d8a04768
+6fe180d1
+e7e18005
+20600000
+2020f068
+20600000
+6fe080d2
+79207e07
+67e0839d
+c045d425
+20600000
+6fe080d2
+79207e07
+67e0839d
+c045d429
+20600000
+6fe0c15f
+6848804d
+7d3a0405
+6048804d
+6fe08031
+c4028000
+793ffe05
+67e08031
+70007d31
+20600000
+2434d432
+70007d12
+20205a10
+70007d97
+20600000
+20405a10
+202056ef
+efe08006
+67e083a1
+c000d43b
+c0015440
+20600000
+70007d84
+18c08c01
+efe08006
+c281d452
+20205455
+70007d84
+18c08c01
+efe10006
+c2845445
+2020544e
+6fe0c647
+79207e01
+20405450
+6fe0c647
+c1818000
+6fe0c6b8
+c4008000
+70464502
+20600000
+6fe0c647
+793ffe01
+67e0c647
+20600000
+6fe0c647
+79207e00
+20205450
+6fe0c647
+793ffe00
+20205450
+684880d3
+18410401
+604883a4
+6fe0c1db
+c0a8d45e
+7041db00
+6fe08056
+c18a8000
+70005604
+20205a40
+470c4023
+6fe080d0
+67e0839d
+c019d489
+c0045498
+c007d49f
+c00854a5
+c008d4a6
+c00954ae
+c00c54c7
+c00bd4ca
+c009d480
+c01ed5f3
+c01f5654
+c02055f5
+c020d612
+20600000
+470cc023
+6fe080d0
+67e0839d
+c000d4be
+c019d493
+c005d4af
+c00454b5
+c009d483
+c02054bf
+c020d4c2
+c00c54c5
+c00bd4d6
+20600000
+70095b20
+20407871
+202009df
+70095b19
+20407871
+70464202
+58000050
+d8e00006
+20207d66
+6fe083a5
+79207e00
+67e083a5
+70095b01
+20407871
+70007d8b
+6fe08056
+c082d393
+70005606
+20600000
+70039e0b
+70007d07
+70005600
+2020d393
+20600000
+6fe0c1ca
+247a0000
+20400c60
+204056ed
+20748000
+79200021
+20600000
+24748000
+70007d10
+6fe0804d
+c4010000
+70007d12
+20600000
+202056ef
+2040574b
+6fe08031
+c3820000
+70007d31
+6fe08056
+c1850000
+7000560b
+20600000
+20600000
+6fe0c09a
+1fe67c08
+2042be1d
+70007d07
+70039e13
+20600000
+6fe080d1
+c00354bb
+c18c0000
+70039e18
+70007d07
+20600000
+70039e06
+70007d07
+20600000
+20600000
+70087000
+70007d07
+20205393
+70087000
+70007d07
+20205393
+70095b24
+20207871
+70095b23
+20407871
+20200f16
+70095b22
+20407871
+58000000
+67e10076
+6fe14455
+1fe3fe00
+67e10033
+6fe0c457
+67e08074
+6fe0c459
+67e08075
+20200ef5
+70095b21
+20207871
+684880d0
+18467c06
+2021568e
+60488055
+202054ed
+6fe083a5
+79207e02
+67e083a5
+c3818000
+70007d31
+20205393
+20600000
+6fe0c0d7
+684880d0
+98467c00
+202154ed
+70007d04
+70007f1f
+70007e2e
+20600000
+20205862
+70007d03
+20600000
+70007d21
+20600000
+70007d22
+20600000
+6fe08056
+c1098000
+70005602
+20600000
+20600000
+6fe0c6b6
+243a5501
+204056ea
+7003a801
+70095b0a
+20407871
+20405a18
+2420d6f2
+2434d505
+70007d04
+70007e08
+70007f23
+20600000
+6fe0804c
+79207e02
+67e0804c
+20600000
+6848804d
+7d3a0401
+6048804d
+20600000
+6fe08080
+1fe37e00
+1fe17e01
+20600000
+6fe0c489
+207a0000
+6fe08877
+205a6009
+20600000
+20405511
+2040550d
+67e083a9
+6fe0c645
+c0015523
+204056ea
+70007d0c
+6fe0c1ca
+247a0000
+6fe08031
+c3830000
+70007f06
+202053e1
+70007d0b
+d8a008f0
+d8c000d0
+20407d0c
+2020551d
+6fe0c645
+c0015538
+da200041
+20406b3e
+684a0454
+6fe200d0
+98467c00
+2022d533
+70007d07
+70039e05
+20600000
+20406c3c
+20405541
+6fe0c764
+203a5613
+20600000
+6fe200d0
+684a091c
+98467c00
+2022d53d
+20205530
+20405541
+6fe0c6b8
+c280d613
+20600000
+204009b6
+6fe0804c
+2feffe01
+793ffe01
+67e0804c
+6fe08056
+c00cd54a
+c00c554a
+20600000
+6fe08877
+c1800000
+6fe0804d
+c3810000
+20205ad7
+da2000d0
+da400444
+d8a00424
+20406c08
+da200041
+20405a36
+70007d0b
+6fe08031
+c30356ed
+20600000
+6fe100af
+1fe0f3fd
+684880d0
+58000a01
+98408a00
+d8c000d2
+20407d5f
+68488054
+6fe080d1
+98467e00
+1fe67c0e
+20215569
+1840fe0e
+67e08054
+70007d01
+20600000
+6fe0804d
+79207e03
+67e0804d
+c28256f7
+20600000
+6fe080d0
+67e0807e
+70007d02
+20600000
+202054ed
+70007d30
+20600000
+70007d28
+20600000
+70007d26
+20600000
+20600000
+6fe10033
+98000400
+6fe080d1
+67e08093
+984f8400
+6fe100d2
+1fe3fe00
+67e10094
+6fe200d4
+1fe3fe00
+67e2008f
+18427e00
+67e10096
+20600000
+6848c15f
+6fe080d1
+9842fc00
+2422d408
+2feffe00
+6fe0804d
+7920fe05
+67e0804d
+70007d81
+70007e8b
+20600000
+20600000
+202054ed
+202054ed
+6fe100d0
+67e100c1
+20600000
+6fe100d3
+6848c177
+984ffe00
+d8400640
+98467c00
+20600000
+6fe100d5
+203a568e
+20405599
+2021568e
+6fe0c09a
+1fe67c0a
+2042bb99
+6fe08031
+c280d68e
+6fe100d1
+1fe3fe00
+67e10076
+6fe100d3
+1fe3fe00
+67e10033
+6fe100d5
+67e08074
+98000400
+6fe100d7
+67e08075
+98467c00
+242155b6
+67e08074
+70007d03
+70007e17
+20600000
+6fe0c645
+c00155bf
+204054ed
+204056ea
+20406b41
+20200ee5
+204054ed
+20400ee5
+204074cc
+d8a00063
+d8c00910
+df200010
+20207e68
+204054ed
+20200eef
+6fe200d0
+1fe3fe00
+2034d5d2
+6848c1ca
+243a55cf
+70007e13
+2020568e
+70007d34
+70005600
+202009dd
+204009dd
+79200022
+6fe080bd
+793ffe02
+67e080bd
+202054ed
+20600000
+70007d03
+70007e18
+70095b2e
+20407871
+20200f16
+70087900
+6fe080d0
+67e0c644
+c080d68e
+684880d1
+6048c645
+6fe0c6b6
+203a55e8
+18467c02
+2422d530
+6fe080d2
+c02055ec
+c01855ec
+2020568e
+67e0c646
+20405a21
+2020d5f0
+70087001
+70007d03
+70007e3d
+20205393
+70007d3e
+20600000
+6fe0c76c
+c000d5fc
+c0015600
+20405a21
+20608000
+70087008
+20600000
+204072f2
+70095b35
+20407871
+202055f8
+20405a21
+20608000
+6fe0c76d
+c009d610
+1fe0fe01
+67e0c76d
+70087201
+70087004
+6fe0c76d
+1fe20e00
+6fe34794
+afefffff
+58000080
+7920fe00
+67e0c76e
+20600000
+70087008
+20600000
+20405618
+6fe0c76f
+207a0000
+70476f00
+70095b38
+20207871
+20405a21
+2440f2fc
+2040f30c
+20405a21
+20608000
+7008700c
+70087201
+20600000
+d8a00930
+d8c000d0
+20407d0c
+6fe0c76c
+c1010000
+20207068
+20600000
+6fe0c645
+c000d63d
+c001562b
+2020568e
+6fe08871
+c003d62f
+6fe08870
+c080d68e
+6fe08879
+1fe60a30
+2421568e
+d8a00880
+98a08a00
+6fe400d0
+e7e40005
+6fe400d8
+e7e40005
+6fe08879
+1fe0fe10
+67e08879
+c0a054ed
+2020564e
+6fe08871
+c003d641
+6fe08870
+c080d68e
+6fe08879
+1fe60a20
+2421568e
+d8a00888
+98a08a00
+6fe400d0
+e7e40005
+6fe400d8
+e7e40005
+6fe08879
+1fe0fe10
+67e08879
+c09854ed
+20405a21
+2020d4ed
+70087a01
+70087002
+70087201
+202054ed
+6fe0c645
+c000d658
+c001565c
+20600000
+6fe08878
+c0185660
+70007d3e
+20600000
+6fe08878
+c0205660
+70007d3e
+20600000
+20405a21
+2020d669
+6fe0c76c
+c0015667
+70087201
+70087004
+20205393
+70095b36
+20207871
+20205393
+6fe08871
+c003d66e
+6fe08870
+c083568e
+d8a008f0
+6fe400d0
+e7e40005
+6fe400d8
+e7e40005
+20405a21
+2020d678
+70087007
+70087201
+202054ed
+70087104
+20207068
+2020568e
+6fe08871
+c005d67f
+6fe08870
+c084568e
+d8a00920
+d8c000d0
+20407d0c
+20405a21
+2020d68b
+6fe0c76c
+c000d690
+70476b00
+70087009
+70087201
+70007e41
+20205393
+70087109
+70087301
+20205393
+70007f24
+202053e1
+6fe0c76b
+c283d695
+79207e06
+67e0c76b
+20600000
+c2805686
+70476b00
+2020568e
+20205393
+6fe080bd
+793ffe01
+67e080bd
+204054ed
+24748000
+6fe080d0
+6848804c
+793a0404
+7d3a0405
+6048804c
+20600000
+684c00d0
+6fe08056
+c1818000
+6fe080bd
+c30256ab
+70005614
+20600000
+70005604
+20600000
+6fe080e4
+67e08a5b
+70007d03
+70007e38
+20600000
+70007d03
+70007e39
+18007209
+d8c000d0
+d8a00a52
+efe08006
+1fe2fe55
+e7e08005
+c20056b7
+6fe08a52
+68488a51
+793f8407
+793f8404
+c07fd6cb
+c00056e4
+c002d6d8
+c003d6d7
+c00356d8
+c00456d7
+c000d6d0
+c00156d0
+c001d6d0
+c004d6d0
+c00256d0
+20600000
+6fe08a51
+79207e03
+79207e02
+67e08a51
+20600000
+79200404
+7000e505
+6fe10a59
+98007200
+67e100af
+d8a000cf
+20407dd3
+79200407
+79200402
+18007e00
+67e0800b
+67e109fa
+67e109fc
+67e109f8
+67e109f6
+6fe08a53
+2fe1fe00
+79208406
+60488a51
+20600000
+793f8011
+700a5100
+6fe080e4
+793ffe06
+67e080e4
+20600000
+d8c000d0
+d8a00424
+20207d0c
+70007d09
+20600000
+24748000
+70007d11
+20600000
+da2040a8
+20406b0b
+70007d03
+70007e08
+20600000
+7000730a
+70007d07
+70039e16
+20600000
+470d4023
+78547c00
+204059e6
+6fe08049
+207a0000
+c283d730
+c000d87a
+c00157fb
+c001d73c
+c0025752
+c013d8e6
+c014581f
+c018580b
+c012d8e1
+c013581a
+c018d8ce
+c01bd875
+c019d867
+c0045968
+c004d95e
+c005d973
+c0065980
+c007d86d
+c00859b6
+c008d9ac
+c003d85d
+c0155889
+c005588a
+c00fd8c7
+c0035810
+c010d86a
+c016d8bd
+c01758c2
+c011586a
+c01a588b
+c009d8a0
+c00bd8af
+c00959b3
+c017d8b5
+c00c58ba
+c01ed909
+c01f5911
+c01fd92c
+c0205936
+c020d94b
+c011d95a
+c01dd955
+c002d95b
+c014d95c
+c01c595d
+c01cd880
+2020137a
+20600000
+c040d75f
+c041d824
+c042578e
+c0415768
+c045d831
+c04bd859
+c04cd7ec
+c04d57bb
+c04ad7f1
+c04b57f2
+c051578b
+2020137a
+18007e02
+204059bc
+6fe0804a
+e7e08005
+204059cb
+470dc023
+6fe0804a
+c0045772
+c007d776
+c0085781
+c00bd751
+c019d784
+c020d78a
+c008d74b
+20600000
+6fe08056
+207a0000
+7000561b
+5800000c
+d8e00007
+20207d66
+20200ef5
+18007e03
+204059bc
+6fe0804a
+c005d75a
+e7e08005
+6fe0804b
+e7e08005
+202059cb
+e7e08005
+6fe0804b
+e7e08005
+d84003a9
+20205a07
+18000e04
+204059c4
+5800007f
+e7e08005
+6fe0804a
+793ffe07
+e7e08005
+6fe0804a
+202059cb
+18000e05
+204059c4
+5800007f
+e7e08005
+6fe0804a
+793ffe07
+e7e08005
+6fe0804b
+e7e08005
+202059cb
+20400c60
+20405a18
+20608000
+202056ed
+6fe0804c
+c282d77d
+c4020000
+70007d12
+793ffe04
+20405a10
+2020577f
+70007d10
+793ffe05
+67e0804c
+20600000
+20405a21
+2020d6ef
+20600000
+70007d8b
+6fe083a5
+79207e00
+67e083a5
+70095b01
+20207871
+20600000
+18000e02
+204059c4
+202059d4
+1fe22200
+204057a4
+6fe083a1
+c000d794
+c001579c
+20600000
+1a227e00
+18000e0c
+204059c4
+58000001
+e7e08005
+6fe103a2
+e7e48005
+202059d4
+1a227e00
+18000e0c
+204059c4
+58000002
+e7e08005
+58010002
+e7e48005
+202059d4
+6fe0c764
+203a57a8
+204057ae
+202057b5
+6fe0c0a6
+793ffe03
+67e0c0a6
+58000001
+67e103a2
+20206ecc
+470e4023
+6fe0c0a6
+79207e03
+67e0c0a6
+58000101
+67e103a2
+20600000
+6fe0c6b8
+c280d7b8
+20600000
+58000902
+67e103a2
+20600000
+18000e05
+204059c4
+6fe1c765
+e7e18005
+204059d4
+70476f01
+6fe0c765
+c000d7cc
+c00157c6
+c001d7d2
+20600000
+6fe0c768
+c00057de
+c000d7de
+c00157de
+c001d7d8
+20600000
+6fe0c768
+c00057d8
+c000d7dc
+c00157de
+c001d7d8
+20600000
+6fe0c768
+c00057d8
+c000d7d8
+c00157d8
+c001d7d8
+20600000
+70476c03
+6fe0c643
+c28031f6
+20600000
+70476c01
+20600000
+70476c02
+20600000
+d8e00000
+202057e4
+d8e00000
+202057e8
+6fe0c643
+f9207e00
+67e0c643
+20600000
+6fe0c643
+f93ffe00
+67e0c643
+20600000
+18000e05
+204059c4
+6fe1c765
+e7e18005
+202059d6
+20600000
+18000e09
+204059c4
+6fe08093
+e7e08005
+6fe10094
+e7e10005
+6fe2008f
+e7e20005
+202059d4
+18007e11
+204059bc
+6fe0804a
+1fe20400
+c0005803
+c0075803
+c00e5803
+20600000
+e7e08005
+6fe0c5fc
+e7e08005
+df20000e
+580045fd
+98408c00
+20407d5f
+202059d4
+18007e03
+204059bc
+58000114
+e7e10005
+202059d4
+18007e03
+204059bc
+6fe200b5
+9c467e00
+2034d816
+1fe67e00
+1feb7e00
+793ffe0f
+e7e10005
+202059d4
+18007e06
+204059bc
+6fe2c5f7
+e7e28005
+202059d4
+18007e09
+204059bc
+6fe440a0
+e7e40005
+202059d4
+204057a4
+6fe08049
+18000e0c
+204059c4
+58000001
+e7e08005
+6fe103a2
+e7e10005
+58000000
+e7e18005
+58000000
+e7e20005
+202059d6
+18000e03
+204059c4
+6fe0c15f
+e7e08005
+78547c00
+204059d6
+24740000
+24748000
+6fe0c0df
+c4000000
+2040583d
+20205847
+7040df03
+58000000
+67e24149
+d8a040e1
+2040584b
+d8a040ee
+2040584b
+d8a0414d
+2040584b
+20205852
+d8a040ee
+2040584b
+20405852
+20205855
+58ffffff
+e7e18005
+e7e18005
+e7e18005
+5800007f
+e7e08005
+20600000
+58000000
+67e140dd
+20600000
+6fe0c0df
+79207e02
+67e0c0df
+20600000
+18000e02
+204059c4
+2434d9d4
+202059d6
+18007e02
+204059bc
+6fe0839e
+e7e08005
+204059d6
+6fe0804c
+79207e03
+67e0804c
+70007332
+20600000
+18007e01
+204059bc
+202059d6
+18007e01
+204059bc
+202059d4
+18007e02
+204059bc
+6fe0804d
+2fec0002
+7920fe00
+1fe17e01
+e7e08005
+202059d6
+18007e03
+204059bc
+6fe10052
+e7e10005
+202059d6
+700073fa
+18007e02
+204059bc
+6fe08054
+e7e08005
+202059d6
+18007e0a
+204059bc
+d8c00a52
+18007209
+efe08006
+1fe2fe55
+e7e08005
+c2005884
+202059d6
+202059d6
+202059d6
+20748000
+2040104e
+18007e09
+204059bc
+6fe100c1
+e7e10005
+6fe1c0a8
+e7e18005
+6fe0c0ab
+e7e08005
+6fe140ac
+e7e10005
+c581d89c
+793f8003
+204059d6
+70007d13
+20600000
+204059d4
+70007d03
+70007e13
+20600000
+d8400200
+2034d8a4
+1d027e00
+202058a5
+1c427e00
+1c227e00
+9840fe00
+1fe17ffc
+67e20035
+18007e05
+204059bc
+6fe20035
+1fe37e00
+e7e20005
+202059d6
+18007e0a
+204059bc
+d8c003ac
+efe48006
+e7e48005
+202059d6
+18007e03
+204059bc
+58000114
+e7e10005
+202059d6
+18007e01
+204059bc
+202059d6
+18007e02
+204059bc
+6fe0c0d7
+e7e08005
+202059d6
+18007e02
+204059bc
+58000005
+e7e08005
+202059d6
+18007e02
+204059bc
+58000000
+e7e08005
+202059d6
+70007d2e
+20600000
+6fe0c09a
+1fe67c0a
+2042d8cc
+6fe08031
+79207e04
+67e08031
+1c427e00
+67e203bc
+6fe083a5
+c281d8df
+79207e03
+67e083a5
+70095b05
+20407871
+18007e01
+204059bc
+202059d6
+70004900
+20600000
+18007e06
+204059bc
+6fe2c5f7
+e7e28005
+202059d6
+18007e09
+204059bc
+6fe440a0
+e7e40005
+202059d6
+70087301
+6fe0c6b9
+c1808000
+70087113
+20600000
+20405a14
+70007d99
+70087103
+20600000
+20405a14
+70007d3d
+70087107
+20600000
+da200910
+da400930
+df200010
+20407df1
+2022d901
+70087100
+2040706a
+70007e40
+2020568e
+7008710a
+20407068
+70007e40
+202054ed
+70007d40
+20600000
+70007d3d
+20600000
+70087800
+18007e04
+204059bc
+6fe1c644
+e7e18005
+20405a21
+2020d9d6
+202059d4
+6fe0c645
+c0015915
+c000d91a
+20600000
+18007e11
+204059bc
+6fe08878
+d8c046dc
+2020591e
+18007e11
+204059bc
+6fe08878
+d8c04734
+98c08c00
+efe40006
+e7e40005
+efe40006
+e7e40005
+6fe08878
+1fe0fe10
+67e08878
+20405a21
+2020d9d6
+202059d4
+70087006
+70007d3f
+20600000
+18007e11
+204059bc
+d8c00910
+efe40006
+e7e40005
+efe40006
+e7e40005
+202059d4
+70007d40
+20600000
+20405a21
+2040ef7e
+18007e11
+204059bc
+d8c008e0
+efe40006
+e7e40005
+efe40006
+e7e40005
+20405a21
+2420d9d4
+2020d9d6
+7008710f
+20405a14
+70007d0b
+20405a2c
+2020efcc
+20206fd6
+20405a10
+70007d41
+20600000
+18007e11
+204059bc
+d8c00910
+efe40006
+e7e40005
+efe40006
+e7e40005
+20405a21
+2420d9d4
+2020d9d6
+18007e03
+204059bc
+5800fffe
+e7e10005
+202059d4
+202059d6
+202059d6
+202059d6
+202059d6
+20405a30
+da2040a8
+20405a36
+18007e11
+204059bc
+da200444
+da400424
+20406c08
+2434d9cb
+202059d1
+20405a30
+da200041
+20406b0b
+18007e11
+204059bc
+d8c00424
+20407d0c
+6fe08056
+c00cd9d6
+c00c59d6
+202059d1
+6fe0c645
+c001597e
+6fe08877
+203a597b
+20405a21
+2040da14
+2440da10
+2020597c
+20405a14
+20405a30
+2020596b
+70007d0c
+20205977
+6fe0c645
+c001599a
+da2040a8
+20406b3e
+18007e05
+204059bc
+6fe20454
+e7e20005
+d84003a9
+20405a07
+20406c3c
+20405a21
+2020d991
+7003ab01
+6fe08877
+207a0000
+70007d0b
+6fe0c1ca
+207a0000
+20405a21
+2420d996
+20600000
+c6908000
+793f8021
+70007d0f
+20600000
+204074f4
+20407519
+18007e05
+204059bc
+6fe20918
+e7e20005
+d84003a9
+20405a07
+204059a9
+20405a21
+2020d991
+7003ab01
+6fe08877
+207a0000
+20205991
+6fe40910
+67e446aa
+20600000
+20405a30
+20406b41
+18007e11
+204059bc
+d8c00424
+20407d0c
+202059d1
+18007e01
+204059bc
+202059d1
+18007e02
+204059bc
+18007e10
+e7e08005
+67e08055
+202059d1
+1fe9fe00
+1fe1fe07
+67e0838a
+df200011
+d8a0038c
+20407d26
+d8a0038c
+20600000
+1fe1227f
+7000497f
+18e27e00
+204059bc
+1a227e00
+e7e08005
+20600000
+6fe08049
+1fe3fe00
+6848804d
+284ffe01
+7920fe00
+202059db
+6848804d
+18410401
+202059d7
+18000400
+202059d7
+18000401
+6fe08049
+1fe3fe00
+7934fe00
+9842fe00
+67e0838b
+67e0c5f6
+70004900
+204059ec
+78347c00
+20600000
+6fe0807d
+207a0000
+204059e6
+6fe0807d
+20600000
+470ec023
+6fe08049
+203a59ec
+6fe08079
+247a0000
+202059f6
+6fe08079
+203a59fc
+6fe18079
+67e18049
+6848807c
+6fe0804d
+793ffe01
+9841fe00
+67e0804d
+70007900
+6fe0807d
+207a0000
+6fe2007d
+67e20079
+70007d00
+20600000
+6fe0807d
+207a0000
+6fe1807d
+67e18049
+68488080
+6fe0804d
+793ffe01
+9841fe00
+67e0804d
+70007d00
+20600000
+470f4023
+6fe0804d
+1fe22600
+efe08002
+20405509
+204059cb
+1a627e00
+67e0804d
+20600000
+6848804d
+793f8400
+6048804d
+20600000
+6848804d
+79200400
+6048804d
+20600000
+7d34fe01
+6848804d
+9842fe00
+2feffe01
+20600000
+6fe0804d
+7934fe01
+67e0804d
+20600000
+6fe08876
+2fe0fe01
+20600000
+6fe08876
+79207e07
+67e08876
+20600000
+6fe08876
+793ffe07
+67e08876
+20600000
+6fe08876
+2feffe07
+67e08876
+20600000
+d8a00424
+18007210
+180a7e00
+e7e08005
+c2005a32
+20600000
+20406b0f
+da2041cb
+da400454
+efe40011
+68488031
+7d3a0406
+60488031
+1a220a00
+20406c08
+202009c8
+470fc023
+204059e1
+247a0000
+6fe08056
+207a0000
+c0025a94
+c002da9a
+c0015a8b
+c001daa2
+c0075a8e
+c0035abe
+c003dad6
+c004dad7
+c0055ae0
+c005dae4
+c0065aac
+c006daaf
+c007dab5
+c0095a7e
+c009daa2
+c0085a81
+c00a5a7b
+c00adaa2
+c00b5a75
+c00c5a7a
+c00bda6e
+c00cda74
+c00d5a5f
+c00dda69
+70005600
+20600000
+6fe083a5
+c4010000
+c4018000
+70005600
+20405a65
+202065a5
+6fe080bd
+c4008000
+7000560a
+20600000
+d8e00007
+20407d74
+247a0000
+7000561a
+20600000
+6fe080bd
+793ffe00
+67e080bd
+70005619
+70007d0b
+20600000
+20600000
+6fe083a8
+c1810000
+20405ae6
+70005618
+20600000
+20600000
+70005615
+70007d83
+20600000
+70005613
+70007d25
+20600000
+6fe0c642
+c1000000
+c000da89
+d8e00006
+20407d74
+247a0000
+70464200
+20205aa3
+20748000
+20205abe
+70005603
+70007d27
+20600000
+70007d13
+79200003
+70005605
+580001ff
+67e103a6
+20600000
+70005605
+580000ff
+67e103a6
+793f8022
+70007d33
+20205390
+c6110000
+6fe103a6
+1fe0ffff
+2022daa0
+67e103a6
+20600000
+7000560e
+20600000
+20600000
+6fe083a5
+c4018000
+c4010000
+6fe080bd
+793ffe02
+67e080bd
+70007d13
+70005610
+20600000
+7000560d
+70007d31
+20600000
+6fe083a5
+c4010000
+70005600
+20600000
+70005606
+20600000
+6fe103a6
+1fe0ffff
+203a5aba
+67e103a6
+20600000
+70007d07
+70039e16
+70005600
+20600000
+6fe080bd
+c2815aa3
+c2805ac3
+7000561a
+20600000
+6fe0c1ca
+203a5acf
+6fe083a5
+c4018000
+c4010000
+6fe203bc
+d8400064
+98408400
+1c427e00
+98467c00
+24610000
+20205a6e
+70005616
+70479304
+58003030
+67e14794
+e7e10005
+7003a802
+20205a75
+20600000
+6fe080bd
+c280dadb
+7000561a
+20600000
+6fe080bd
+793ffe01
+67e080bd
+70007d0f
+20600000
+6fe083ab
+207a0000
+70005600
+20205adb
+7000560c
+20600000
+6fe0804c
+c2815aeb
+20405a14
+70007d08
+20204d86
+6fe0804c
+793ffe02
+67e0804c
+204056f2
+20405a1d
+20204d86
+58000004
+67e0c793
+58003030
+e7e10005
+e7e10005
+20600000
+47104024
+1fe17eff
+d8a08070
+98a08a00
+18a22200
+d840003e
+e0408005
+20405b04
+2000001e
+1a220a00
+d840003f
+e0408005
+20205b08
+6ff08085
+1fe17efb
+67f08085
+20600000
+6ff08085
+1fe1fe04
+67f08085
+20600000
+20205cbf
+20205cc6
+6ff08085
+1fe17efd
+67f08085
+20600000
+24345b16
+6ff08085
+1fe1fe02
+67f08085
+18427c00
+2022db19
+1a627a00
+2fcc0000
+20205be7
+18000404
+da2002eb
+20405b0e
+20405b16
+da2055aa
+6fe102eb
+e8410006
+9a267c00
+20600000
+d8400002
+da2002f1
+20405b16
+6fe102f1
+67e102e4
+20545b2b
+20600000
+d8400010
+da2002f3
+20405b0e
+20405b16
+d8c002f3
+df200010
+20406db2
+20406d62
+20406dcb
+20206d5c
+7856fc00
+20405b1b
+24628000
+7836fc00
+70802380
+70802200
+70802400
+da208025
+20405b12
+70802300
+d8400006
+20405b1c
+24628000
+efe10006
+98002200
+20405b16
+20205b3f
+6fe08a04
+d8c00a01
+98c08c00
+70802380
+70802200
+70802400
+da208025
+ef208006
+1f267c00
+2442db58
+70802300
+efe08006
+207a0000
+1fe27200
+ea410006
+1a420a00
+20407d61
+20205b51
+efe08006
+e7e08011
+c2005b58
+20600000
+20407e02
+58001000
+67e102e4
+da605de2
+df200002
+20405b1b
+24628000
+6fe102e4
+1ff0fe00
+9840fe00
+1ff0fe00
+67e102e4
+c2005b61
+20205b3f
+20407e02
+70805025
+58000000
+da200a01
+d8400040
+20405e63
+20405bb8
+20405c12
+78547c00
+6fe08a01
+c301db7c
+70800608
+7920002b
+18007004
+20406dcc
+18007004
+6de20a3d
+78347c00
+6fe20a01
+203a5b81
+67e1c4cc
+20405c49
+20405b46
+7041e300
+6fe08a01
+c2815b9c
+20405be0
+20405b94
+20405dbf
+20405bda
+2436db8c
+6fe082e1
+c3005b82
+20205baa
+20405dbc
+6fe08a01
+c2815b9c
+20405bda
+2436db9c
+6fe082e1
+c3005b82
+20205baa
+6fe0c4c3
+6848c4c2
+98467c00
+2422dda5
+7044c102
+7044c201
+7044c300
+20205da5
+7041e300
+20405be0
+6fe08a01
+c280dbaa
+20405d10
+200000c8
+20405d1e
+20000064
+da605d52
+20405b24
+20405b35
+2436dbaa
+6fe082e1
+c3005b9d
+6fe08a01
+c3005bae
+20405bae
+20204cba
+58000000
+67e20a3d
+18007004
+20406dcc
+70805021
+20600000
+1ff18400
+1fe17e0f
+9842fe00
+20600000
+6fe20a01
+207a0000
+6fe08a01
+20405bb4
+c087dbe6
+6fe08a02
+20405bb4
+c087dbe6
+6fe08a01
+e8408006
+9840fe00
+e8408006
+9840fe00
+e8408006
+9840a200
+dfe00a01
+98408c00
+1a227e00
+ef208006
+9f20fe00
+20407e62
+20405bd3
+e8408006
+1fe17eff
+98467c00
+2422dbe6
+20600000
+ef208006
+1f267c00
+20628000
+9f20fe00
+1f20f202
+20407e62
+20205bd3
+58000000
+67e102e4
+da605de2
+20405d8e
+20405b24
+20205b35
+6fe0c1e3
+1fe0fe01
+1fe67c03
+24215be6
+67e0c1e3
+20600000
+20205c94
+6fe082e1
+1fe3fe00
+7920fe00
+2a2c000f
+20608000
+67e082e1
+20600000
+6ff08085
+c4008000
+20205bf4
+6ff0812c
+afefffff
+20608000
+6ff08108
+c300dbf1
+20406d5c
+20205bf1
+1f220400
+604941a8
+70802380
+70802200
+70802400
+67e141a6
+98000a00
+1f2bf200
+6ff08025
+e7e08005
+c2005c00
+70802300
+20600000
+6fe141a6
+207a0000
+70802380
+70802200
+70802400
+684941a8
+184bf200
+98000c00
+efe08006
+67f08025
+c2005c0d
+70802300
+20600000
+6fe08a2c
+c28315a9
+202015a2
+6fe08a2c
+1fe17e0f
+207a0000
+67e0c09a
+6fe08a2d
+67e0c17b
+6fe08a2e
+67e0c17d
+20600000
+6fe08a2c
+1fe17e30
+1ff1fe00
+207a0000
+67e0c4d0
+20600000
+6fe08a32
+1fe17e0f
+207a0000
+67e0c4d1
+20600000
+6fe08a32
+1fe17e30
+1ff1fe00
+207a0000
+67e0c4d2
+20600000
+6fe08a33
+207a0000
+67e0c4d3
+20600000
+6fe08a32
+c283dc3c
+7041eb88
+7041ec66
+7041ed44
+6fe10a2f
+207a0000
+67e141ec
+20600000
+7041eaff
+6fe08a32
+1fe17e40
+1fe97e00
+67e0c1ee
+20600000
+70800273
+37d98200
+37d98200
+6ff10120
+793ffe0d
+67f1004c
+20205caf
+6fe08a02
+1fe17e0f
+c0055c57
+c000dc57
+c0025c5a
+c002dc5f
+c0045c61
+c004dc66
+c005dc6b
+c0065c57
+c006dc6e
+c0075c73
+c007dc78
+20600000
+20405c42
+20405c7d
+20205c9e
+20405c42
+dfe03764
+d8404c03
+20405c83
+20205c9e
+20405c42
+20205c9e
+20405c42
+dfe03247
+d8403bbd
+20405c83
+20205c9e
+20405c42
+dfe03247
+d8404a8e
+20405c83
+20205c9e
+20405c42
+20405c86
+20205c9e
+20405c42
+dfe03247
+d84049a2
+20405c83
+20205c9e
+20405c42
+dfe03620
+d8404c03
+20405c83
+20205c9e
+20405c42
+dfe033e2
+d8404c03
+20405c83
+20205c9e
+dfe0272e
+d84030d7
+20205c83
+20405c42
+dfe03764
+d8403bbd
+67f10013
+60590015
+20600000
+dfe03247
+d8404c03
+20205c83
+dfe05394
+d8405aeb
+20205c8e
+dfe01cd1
+d84021cf
+67f10017
+60590019
+20600000
+dfe021d5
+d840272c
+20205c8e
+20405c89
+dfe01cd1
+d84021cf
+20205c83
+6fe08a03
+1fe17ec0
+c0605c94
+c2835c8c
+c283dc89
+20600000
+20405c98
+6fe08a03
+1fe1221f
+6fe08a01
+1fe17e0f
+68488a02
+1841040f
+18520400
+9841fe00
+1a2d2200
+9a21fe00
+79207e0d
+79207e0e
+67f2004c
+20405caf
+70801108
+20600000
+58000002
+37d98200
+67f08012
+37d98200
+37d98200
+20600000
+4710c024
+6fe0c484
+67f08086
+6fe0c485
+67f08087
+580002e2
+67f1008a
+580002e7
+67f1008c
+20205b04
+79207e07
+67e102e2
+47114024
+70808802
+70808e00
+70800602
+20205ccf
+18000401
+67e082e2
+4711c024
+70808801
+6059008e
+70800602
+20405ccf
+6fe082e7
+20600000
+6fe140dd
+1fe0fe01
+67e140dd
+6ff0812c
+c301dccf
+20600000
+78547c00
+1fe22400
+6fe0c4ac
+c1800000
+78347c00
+1a427e00
+20205ce3
+6fe0c4ac
+c000dce3
+c0015ce9
+c001dcf1
+c0025cf5
+c002dcfb
+20600000
+67e1c4a5
+1a227e00
+67e144a8
+604944aa
+7044ac02
+20205d10
+20405d10
+7044ac03
+20405d15
+da2002e2
+70808804
+6fe1c4a5
+d8400020
+20205d26
+20405d10
+20405d49
+7044ac04
+20600000
+20405d10
+7044ac05
+20405d15
+20405d08
+20405d22
+20205d03
+20405d10
+20405d15
+58000005
+20405cc6
+c3800000
+7044ac00
+6fe14473
+20207e05
+6fe20964
+684944a8
+184085fc
+e7e20002
+20600000
+684944a8
+18422200
+184085fc
+efe20002
+67e20964
+684944aa
+6fe1c4a5
+20600000
+20405d74
+20405b04
+58000000
+67e202e2
+20600000
+7002e206
+58000000
+67f1008e
+58000001
+67f10088
+580002e2
+67f1008a
+70800602
+20205ccf
+7002e2ab
+20205d16
+7002e2b9
+20205d16
+18408404
+60590088
+d8400002
+1a20a3fc
+e0408011
+1ff10400
+e0408005
+1fec8400
+e0408005
+e7e08005
+1a227e00
+67f1008a
+58000000
+67f1008e
+70800602
+20405ccf
+20205d49
+6059008e
+1ff10400
+604882e3
+1fec8400
+604882e4
+67e082e5
+58000004
+67f10088
+7002e203
+580002e2
+67f1008a
+1a227e00
+67f1008c
+6ff08086
+2a2c000f
+7920fe06
+67f08086
+70800602
+6ff0812c
+c283dd45
+d8e00003
+20205ccf
+580007d0
+2040137d
+20405d15
+580002e7
+67f1008c
+58000005
+20405cc6
+c2805d49
+20600000
+6059008e
+58000004
+67f10088
+7002e203
+580002e2
+67f1008a
+1a227e00
+67f1008c
+6ff08086
+2a2c000f
+7920fe06
+67f08086
+70800602
+6ff0812c
+c283dd5f
+d8e00003
+20405bee
+20405ccf
+2feffe02
+20405be7
+6fe082e3
+1ff02400
+6fe082e4
+1fed7e00
+9a41a400
+6fe082e5
+9a41fe00
+9840fe00
+67e082e5
+1fecfe00
+67e082e4
+1fecfe00
+67e082e3
+20600000
+6fe0c4b5
+6848c4b7
+98467c00
+2422dd79
+20405d85
+6fe0c4b5
+d8400020
+20406093
+6fe0c4b8
+d8400021
+20406093
+6fe0c4b6
+d8400022
+20406093
+6fe0c4b7
+d840001f
+20206093
+7044b50e
+7044b60d
+7044b710
+7044b80f
+7044b911
+7044ba12
+20600000
+70801001
+20600000
+70809105
+70809207
+70809307
+70809407
+70809507
+70809605
+70809700
+20600000
+7080910c
+7080920d
+7080930d
+7080940d
+7080950d
+7080960c
+70809700
+20600000
+20405dd3
+6fe0c4c2
+d840006c
+20406093
+6fe0c4c3
+d840006d
+20206093
+20405dda
+20205d9f
+6ff0812c
+c302dda7
+20600000
+67e082e6
+580002e6
+67f1009a
+58000001
+67f10098
+6059009e
+6231009c
+70809001
+70800604
+20205da7
+58000000
+67f1009e
+67f1009c
+60590098
+6231009a
+70809001
+70800604
+20205da7
+79200028
+70448308
+20600000
+793f8028
+70448320
+20600000
+6fe0c479
+9a40fe00
+67e082e4
+20205dc9
+6fe102e4
+1ff0fe00
+67e082e4
+58000003
+67f10098
+7002e3a0
+7002e5a1
+20205de8
+60490964
+20405dd3
+68490964
+20405e02
+20205dda
+6fe0c4c1
+c17f8000
+c3035dd8
+580249f0
+2040137d
+6848c4c1
+20206069
+6848c4c1
+20206065
+47124024
+c5145dc2
+6fe14479
+9a40fe00
+1ff0fe00
+67e102e4
+4712c024
+c5145dc6
+58000004
+67f10098
+7002e3a0
+7002e6a1
+580002e3
+67f1009a
+6059009e
+6231009c
+58000002
+2a2c000f
+7920fe00
+67f08090
+70800604
+d8e00005
+20405bee
+20405da7
+2feffe04
+20405be7
+c5145dfd
+6fe102e4
+1ff0fe00
+9840fe00
+1ff0fe00
+67e102e4
+20600000
+6fe082e4
+9840fe00
+1ff0fe00
+67e102e4
+20600000
+6fe14479
+9a40fe00
+67e1095c
+47134024
+60490964
+6221097b
+20405e17
+68490974
+6a21097b
+6fe1095c
+20405e38
+6fe10974
+6849097b
+98408400
+6049097b
+6849095c
+98408400
+6049095c
+6fe10964
+243a5e08
+20600000
+4713c024
+6fe0c483
+1fe0ffff
+6849095c
+9841fe00
+1fe0fe01
+67e18978
+6fe10964
+9840fe00
+68498978
+98467e00
+24215e29
+67e10964
+6fe18978
+6849095c
+98467e00
+67e10974
+20600000
+6fe10964
+67e10974
+58000000
+67e10964
+20600000
+1a427e00
+18408402
+60590098
+1a20a3fe
+e8418011
+18422400
+d84000a0
+e0408011
+e7e08005
+20205e45
+1fe22400
+47144025
+c5145e2e
+1a427e00
+18408403
+60590098
+1a20a3fd
+e8418011
+18422400
+d84000a0
+e0408011
+1ff0fe00
+e7e10005
+6231009a
+58000000
+67f1009e
+70809001
+70800604
+20405da7
+e2418011
+4714c025
+7002e600
+58000001
+67f10098
+7002e3a0
+580002e3
+67f1009a
+58000000
+67f1009e
+67f1009c
+58000003
+67f08090
+70800604
+20405da7
+6ff0812c
+c4030000
+200005dc
+6fe082e6
+1fe0fe01
+67e082e6
+1fe67c28
+24610000
+20205e4e
+18427200
+1fe20400
+47154025
+18498400
+20405e96
+70804780
+70804786
+60590045
+18408408
+70804787
+6ff08007
+e7e08011
+1a20a201
+c2005e69
+70804786
+70804780
+70804700
+20205e9e
+20405e8e
+70804780
+18498400
+1a220c00
+efe08006
+da400008
+1fe17c01
+2442deaa
+1fe37e00
+18408401
+1a40a5ff
+2422de7b
+c2005e79
+70804780
+70804700
+20205e9e
+6ff08a0a
+79207e01
+67f08a0a
+200000c8
+6ff08a0b
+79207e00
+67f08a0b
+200007d0
+20600000
+20405e85
+6ff08a0b
+793ffe05
+79207e04
+79207e03
+67f08a0b
+200001f4
+20600000
+20405e85
+6ff08a0b
+79207e05
+79207e04
+793ffe03
+67f08a0b
+200001f4
+20600000
+4715c025
+6ff08a0b
+793ffe05
+793ffe04
+793ffe03
+793ffe00
+67f08a0b
+200000c8
+6ff08a0a
+793ffe01
+67f08a0a
+20600000
+70804780
+2000000a
+60590045
+70804781
+2000006e
+20600000
+20407e54
+20205eb4
+20407e56
+20205eb4
+1ff10400
+20545ee7
+24545eeb
+1fef7e00
+1ff10400
+20545edf
+24545ee3
+24345ec0
+6ff10050
+793ffe0f
+67f10050
+20600000
+6ff10050
+793ffe0e
+67f10050
+20600000
+67f10052
+20600000
+67f10062
+20600000
+20405ecc
+20205ec4
+20405ecc
+20205ec6
+20405ed1
+9846fc00
+20407def
+1807fe00
+20600000
+6ff08043
+c3005ed5
+5adc6c00
+20600000
+596e3600
+20600000
+6ff08043
+1fe17efe
+67f08043
+20600000
+6ff08043
+1fe1fe01
+67f08043
+20600000
+67f1005a
+67f1005e
+6059005c
+20600000
+67f1006a
+67f1006e
+6059006c
+20600000
+67f10054
+67f10058
+60590056
+20600000
+67f10064
+67f10068
+60590066
+20600000
+6951005a
+6a11005c
+6871005e
+20600000
+6951006a
+6a11006c
+6871006e
+20600000
+69510054
+6a110056
+68710058
+20600000
+69510064
+6a110066
+68710068
+20600000
+6071005e
+20600000
+6071006e
+20600000
+60710058
+20600000
+60710068
+20600000
+20405ef7
+6ff10112
+98608600
+20205f03
+20405efb
+6ff10158
+98608600
+20205f05
+20405f17
+20205eef
+20405f17
+20205ef3
+20405eff
+20205f1b
+20405f01
+20205f1b
+60610983
+61410981
+6201097f
+20600000
+68610983
+69410981
+6a01097f
+20600000
+1f227e00
+207a0000
+1f20f3f8
+20415f2d
+20628000
+20215f21
+1f20f208
+1f20f3fc
+20415f30
+20628000
+20215f26
+1f20f204
+20205f33
+20405f2d
+efe40006
+e7e40003
+20600000
+efe20006
+e7e20003
+20600000
+1f227e00
+207a0000
+efe08006
+e7e08003
+c2005f35
+20600000
+1f227e00
+207a0000
+1f20f3f8
+20415f47
+20628000
+20215f3b
+1f20f208
+1f20f3fc
+20415f4a
+20628000
+20215f40
+1f20f204
+20205f4d
+20405f47
+efe40003
+e7e40005
+20600000
+efe20003
+e7e20005
+20600000
+1f227e00
+207a0000
+efe08003
+e7e08005
+c2005f4f
+20600000
+70095b3d
+20207871
+47164025
+6fe0c489
+207a0000
+20405ffa
+2042e000
+20407e5a
+20405f89
+6fe0c489
+1fe22600
+68494487
+604900ef
+1a627e00
+203a5f53
+1a60a7ff
+18422200
+efe08011
+684880e7
+98467c00
+2042df70
+20215f6c
+efe08011
+1fe0fe01
+e7e08011
+684900ef
+18408422
+604900ef
+20205f60
+58000000
+e7e08011
+6fe080e8
+e7e08005
+c099df7e
+da4041cb
+efe30006
+e7e40005
+58000000
+e7e40005
+1a420c00
+20407d0c
+18007c01
+20600000
+c01b5f82
+c01bdf86
+da404316
+20205f76
+d8c043ac
+20407d0c
+d8c04316
+20205f7b
+d8c043a4
+20407d0c
+20205f84
+20407e56
+6fe0c489
+207a0000
+4716c025
+6fe1478c
+c2805fac
+c4048000
+6fe0c36a
+c0005fa5
+6fe0829c
+2fe180c0
+2020df98
+2fe18040
+2020dfaa
+20205f9f
+20365f9c
+6fe0c34e
+c300dfa5
+20205f9f
+20405fa5
+20740000
+20205f9f
+6fe0c39d
+c283dfa2
+20205fa8
+6fe30297
+67e443a4
+20205fa8
+7000e835
+6fe30297
+20205fae
+7000e837
+20205fae
+7000e836
+20205fae
+7000e833
+6fe30041
+67e300e9
+6fe14487
+e840803f
+1fe0fe01
+67e100ef
+604880e7
+6fe0c489
+1fe22600
+6fe100ef
+1fe22200
+20405fc6
+20740000
+684900ef
+18408422
+604900ef
+184085ff
+efe08002
+67e080e7
+1a60a7ff
+2422dfb6
+6fe0c489
+1fe0ffff
+67e080e7
+20600000
+6fe080e8
+c099dfcd
+da4000e8
+df200007
+20407df1
+2022fe54
+20600000
+c01b5fd0
+c01bdfeb
+20205fc8
+e8408011
+98467c00
+24628000
+d8a0098e
+df200010
+20407d26
+6fe1829a
+67e1898e
+20405fe2
+6fe109ab
+1ff0fe00
+1fed0400
+efe08006
+9840fe00
+68498297
+98467c00
+2022fe54
+20600000
+d8c0098e
+20406dc0
+efe08011
+20406dc1
+18006c38
+18006c00
+20406d57
+d8a0099e
+20206dd1
+e8408011
+98467c00
+24628000
+18c22200
+18c0a608
+da4043a4
+df200008
+20407df1
+2022fe54
+1a622200
+da4043ac
+df200008
+20407df1
+2022fe54
+20600000
+6fe14487
+e840803f
+1fe0fe22
+efe0803f
+98467c00
+20600000
+6fe0c489
+1fe27200
+68494487
+58000000
+e7e08002
+18408422
+1fe0fe01
+c2006004
+20600000
+47174025
+20407e58
+20405f89
+6fe08031
+79347e06
+67e08031
+24346014
+1a208c0a
+d8a041cb
+20407d0c
+2020602c
+7041ca00
+20600000
+6fe4c3a2
+203a6023
+20407e58
+20405f89
+24346023
+6fe100ef
+1fe08c01
+d8a043ac
+20407d0c
+d8a04316
+20407d0c
+70432601
+20600000
+70432600
+20600000
+7000e834
+20206028
+7000e833
+6fe0c09a
+c0055f55
+c0044586
+20600000
+6fe441cb
+684c41d3
+9841fe00
+207a0000
+7041ca01
+20600000
+4717c025
+79200407
+20406059
+7d208407
+47184026
+18467cff
+20628000
+284c0007
+18410e1f
+6fe2009f
+f920fe00
+67e2009f
+6fe200a3
+fd20fe00
+67e200a3
+20600000
+4718c026
+18467cff
+20628000
+284c0007
+18410e1f
+6fe2009f
+f93ffe00
+67e2009f
+6fe200a3
+f93ffe00
+67e200a3
+20600000
+20406042
+20206053
+18467cff
+20628000
+2455e036
+2040608b
+58000000
+284ffe07
+7d20fe06
+7920fe07
+2020607d
+d8a0811c
+18410e07
+18497e00
+1fe17e03
+98a08a00
+efe08005
+284ffe07
+2020e063
+afec0000
+20600000
+afefffff
+20600000
+18467cff
+20628000
+2fcffe07
+2020606c
+18467cff
+20628000
+2fcc0007
+58000000
+7d20fe07
+98428400
+2040608b
+5800003f
+284ffe07
+7920fe00
+2020607d
+2040608b
+efe08005
+c2806079
+284c0007
+20600000
+284c0007
+20600000
+2040608b
+580000c0
+e7e08005
+20600000
+2040608b
+58000000
+2020607d
+d8c08070
+df200013
+efe08006
+243a6089
+58000080
+18c08bff
+e7e08005
+c2006084
+20600000
+18417e3f
+d8a08070
+98a08a00
+20600000
+1fe104ff
+1fecfe00
+20206093
+c4038000
+1fe17e3f
+d8a08070
+98a08a00
+e0408005
+20600000
+1841043f
+58008070
+98408c00
+efe08006
+20600000
+47194026
+20600000
+df200014
+d8c08070
+18c20a00
+efe08006
+c00160b3
+c001e0b3
+c00260b3
+c002e0b3
+c00360b3
+c003e0b3
+c00fe0b3
+c01060b3
+c010e0b3
+c01160b3
+c011e0b3
+c01660b3
+c016e0b3
+c00060b3
+c20060a1
+20600000
+58000040
+e7e08005
+202060b1
+58000080
+e7e08005
+202060b1
+4719c026
+da20099e
+d840000c
+58000030
+20405e63
+20406102
+204060d5
+6fe409a1
+203a60cc
+d8c009a1
+d8a04490
+df200003
+efe18006
+1ff20400
+e0410005
+1fec8400
+e0410005
+c20060c5
+20600000
+5800469a
+67e14490
+5800ab77
+67e14496
+580073d0
+67e1449a
+58009658
+67e14494
+20600000
+6fe0899e
+247a0000
+70448f0c
+20600000
+da60449c
+da406102
+2020318a
+c69a0000
+1c417eff
+6848c49d
+20407cf8
+6fe0c48f
+9a267c00
+20610000
+6ff10150
+67e144a2
+793f8034
+70449c32
+6ff08053
+793ffe07
+67f08053
+708a9700
+20600000
+c3008a75
+1a208c01
+efe08006
+c28060f6
+1a208c02
+efe10006
+d840ffff
+98467c00
+2022fe52
+20200a75
+efe08011
+c301fe52
+c282fe52
+c2837e52
+c283fe52
+1a208c1a
+efe10006
+1fe67c07
+20217e52
+20200a75
+70449c01
+20600000
+471a4026
+da6060ec
+20400a70
+2022e100
+708a11aa
+708a0a0c
+6ff08a09
+79207e07
+67f08a09
+708a0b04
+2000003c
+708a1600
+708a1706
+2040611a
+67f08a97
+7080dc03
+2000003c
+6ff08053
+79207e07
+67f08053
+79200034
+1c427e00
+67e0c49d
+20600000
+6fe0c4a0
+c0006121
+c000e123
+6fe0c4a1
+1fe9fe00
+1fe1fe07
+20600000
+58000057
+20600000
+5800004f
+20600000
+471ac026
+6fe0c4a0
+c000612b
+c000e131
+c0016137
+20600000
+58000064
+67e1449e
+6849449a
+6fe14494
+da60012c
+2020613c
+580000c8
+67e1449e
+68494498
+6fe14492
+da6001f4
+2020613c
+580000c8
+67e1449e
+68494490
+6fe14496
+da60012c
+98462200
+6fe144a2
+98467e00
+24216149
+6849449e
+984fa400
+1a627e00
+9a2ffe00
+9a467e00
+9a26fc00
+20407def
+1807fe00
+20600000
+18427e00
+684944a2
+98467e00
+6849449e
+984fa400
+1a627e00
+9a2ffe00
+9a40fe00
+20206145
+efe40011
+67e4095c
+6fe1095c
+6849095e
+98462200
+6fe10962
+98462400
+68490960
+98467c00
+24416162
+1a4ffe64
+9a26fc00
+20407def
+1807fe00
+205a616a
+20600000
+6fe0c4a4
+79207e00
+67e0c4a4
+20600000
+6fe0c4a4
+793ffe00
+67e0c4a4
+20600000
+6848c4a4
+79200401
+6048c4a4
+20600000
+6848c4a4
+793f8401
+6048c4a4
+20600000
+6fe144c6
+efe0803f
+207a0000
+1fe27200
+6fe144c6
+1fe0fe03
+1fe22200
+e8408011
+20406050
+1a20a201
+c2006179
+20600000
+6fe144c6
+1fe0fe03
+1fe22200
+18002400
+58000000
+67e109de
+e8408011
+20406059
+471b4026
+6fe109de
+1a420e00
+f920fe00
+67e109de
+1a20a201
+1a40a401
+6fe144c6
+efe0803f
+9a42fc00
+2422e184
+6fe109de
+684944c8
+9842fc00
+20628000
+78347c00
+20600000
+6fe144c6
+efe0803f
+207a0000
+1fe27200
+6fe144c6
+1fe0fe03
+1fe22200
+e8408011
+20406032
+1a20a201
+c200619e
+20600000
+d8e00009
+20407d74
+247a0000
+58000020
+d8e00009
+20407d66
+78547c00
+20406197
+471bc026
+6fe144c6
+efe0803f
+207a0000
+2040617e
+243477ea
+204077e8
+78547c00
+6fe109de
+67e109e5
+7009e700
+18000e00
+6fe144c8
+1fe30400
+604944c8
+1fe17e01
+684909e5
+18412201
+18430400
+604909e5
+9a22fc00
+2442e1cc
+6fe144c6
+efe0803f
+684889e7
+18408401
+604889e7
+18420e00
+98e2fc00
+2422e1b7
+6fe109de
+67e144c8
+20600000
+471c4027
+6fe144c6
+1fe0fe01
+efe1003f
+20207e05
+6ff08042
+9a21fe00
+67f08042
+6ff10050
+793ffe0d
+67f10050
+20000064
+20600000
+6ff08042
+c28361de
+c283e1e0
+58b71b00
+20600000
+596e3600
+20600000
+580080e8
+20600000
+6fe0895d
+c28261e6
+c30261ed
+20600000
+78347c00
+1fe10e0f
+204061f4
+1807a400
+18427e00
+9a462200
+20600000
+78547c00
+1fe10e0f
+204061f4
+1807a200
+18427e00
+9a262400
+20600000
+6ff080d8
+f9347e00
+67f080d8
+20600000
+6849895e
+204061d9
+9846fc00
+20407def
+18078400
+6fe08961
+984ffe00
+1fe6fc64
+20407def
+204061e2
+6fe0895d
+2040620a
+6fe0895c
+6848895d
+1841040f
+184d0400
+9841fe00
+20206213
+1fe17e0f
+d8a080a0
+1feffe04
+98a08a00
+1a227e00
+e7e10005
+1a427e00
+e7e10005
+20600000
+78347c00
+20406228
+20206218
+78547c00
+20406223
+18427e00
+1fed7e00
+18e08410
+9841fe00
+2040608f
+6ff08084
+70808400
+200004b0
+f9347e00
+67f08084
+20600000
+1fe20400
+1fecfe00
+1fe20e00
+20600000
+78547c00
+20406223
+6ff080dd
+fd347e00
+67f080dd
+20206218
+d8402710
+984ffe00
+d841312d
+9846fc00
+20407def
+18078400
+58000800
+98467e00
+1fe20400
+1841040f
+6058800b
+1fe20400
+18518400
+60588004
+20600000
+78347c00
+2020623f
+78547c00
+6ff08043
+79347e03
+67f08043
+20600000
+d8400031
+67f200ca
+67f100ce
+605880d0
+20600000
+6ff10130
+20600000
+687100ce
+695100ca
+6a1100cc
+20600000
+607100ce
+20600000
+20407e54
+dd600000
+20406248
+c0016292
+1fe67c04
+20610000
+2040624a
+e8410003
+5800a654
+2040629b
+24216280
+1b020400
+58017f8e
+2040629b
+24216280
+1b020400
+58002328
+2040629b
+20216277
+e8410003
+58001194
+2040629b
+20216277
+20406248
+1fe67c85
+20610000
+df200020
+e8410003
+58000230
+2040629b
+20216277
+e8410003
+5800069a
+2040629b
+2421627c
+1b020400
+58000230
+2040629b
+2421627d
+1b020400
+5800ffff
+98467c00
+2022e297
+2020624e
+79205620
+1d635600
+c200626b
+2020628b
+20406248
+1fe67c07
+20610000
+e8410003
+58002328
+2040629b
+20216277
+e8410003
+580008ca
+2040629b
+20216277
+e8410003
+58000230
+2040629b
+20216277
+2040624e
+1a627e00
+20207e05
+2040624a
+e8410003
+5800ffff
+98467c00
+24628000
+2040624e
+20407e56
+1a627e00
+20207e05
+da40000a
+18423000
+9a4fa400
+18438400
+98462200
+244162a4
+1a2ffe64
+9a467c00
+20600000
+1a262200
+20600000
+7041f018
+70804201
+58001d4b
+67f10040
+df20000b
+da200155
+efe10011
+1fe3fe00
+e7e10011
+1a20a202
+c20062ac
+20600000
+1b63b600
+20600000
+70804204
+7041f00c
+58000ea5
+67f10040
+20600000
+70804205
+202062b5
+20758000
+70465200
+7003c003
+7003c103
+7003c511
+7003c613
+58000000
+67e183c2
+67e0c4e4
+70478b00
+58000000
+67e0c4e4
+67e0c64f
+67e0c648
+6fe0c656
+c000e2cd
+70465450
+20600000
+70465400
+20600000
+18418402
+20600000
+18427e00
+1fedfe00
+67e0c64d
+18007e3f
+1fedfe00
+67e0c64c
+18007e01
+1fedfe00
+67e0c64b
+20406307
+18427e00
+20600000
+1fedfe00
+67e0c64d
+18007e73
+1fedfe00
+67e0c64c
+18007e01
+1fedfe00
+67e0c64b
+20206307
+6fe0c64e
+203a62ea
+58000070
+20600000
+580000aa
+20600000
+1fedfe00
+67e0c64d
+18007eef
+204062fb
+684903ca
+18420a00
+e7e08005
+18a20400
+604903ca
+18007eff
+204062fb
+684903ca
+18420a00
+e7e08005
+20600000
+1fedfe00
+67e0c64c
+6fe1464c
+1fed7e00
+67e183c7
+da200107
+da40000f
+20406314
+1fe2fed7
+1fe47e00
+1fedfe00
+20600000
+6fe1c64b
+67e183c7
+da200107
+da40000f
+20406314
+1fed7e00
+da400007
+20406314
+1fe2fe2b
+1fe47e00
+1fedfe00
+1fe20400
+20600000
+da600000
+1a427200
+20407cbd
+1fe20400
+18427e00
+1a63a600
+c304631d
+9a228400
+1a60a601
+18438400
+6fe183c7
+1a40a5ff
+2a41feff
+2020e327
+1a427200
+20407cbd
+2feffe00
+79208400
+20206318
+18437e00
+20600000
+6848c648
+184b8400
+79200400
+6fe0c64e
+245a62cf
+604883e0
+20600000
+18438400
+6fe0c64e
+793a0400
+20600000
+684883cf
+7003d1d7
+2040646d
+6fe0c4e1
+79207e06
+79207e07
+67e0c4e1
+70464e00
+2020644e
+6fe0c4e1
+79207e07
+67e0c4e1
+2020644e
+471cc027
+6fe0c78b
+c0006345
+20206403
+6fe10315
+1fe20c00
+2040636f
+6fe083cf
+c000634b
+202063cf
+471d4027
+6fe083d0
+c01fe334
+c039e33d
+c077e352
+c029e3fb
+20600000
+6fe103d4
+1fe20c00
+2040637a
+6fe083d6
+c020e35c
+c0206364
+c038e39d
+c03863a9
+c024e3b4
+2020644e
+20406366
+2020635e
+6fe0c4e4
+79207e00
+79207e01
+67e0c4e4
+20406497
+2020644e
+20406366
+2020644e
+20406382
+2020638e
+20406382
+efe08006
+1fe97e00
+67e0c655
+efe08006
+67e083db
+20600000
+efe08006
+67e083ce
+1fe97e00
+67e083cf
+efe08006
+67e083d0
+20406385
+604903d2
+18c27e00
+67e103d4
+20600000
+efe08006
+1fe37e00
+67e083d6
+20406385
+604903d7
+18c27e00
+67e103d9
+20600000
+6fe103d9
+1fe20c00
+20600000
+efe08006
+1fe20400
+18430400
+c3800000
+efe08006
+1fe9fe00
+1ff27e00
+98408400
+20600000
+efe08006
+67e0c648
+efe08006
+67e083dc
+efe08006
+67e083dd
+efe08006
+67e083de
+efe10006
+67e14649
+efe08006
+67e083df
+efe08006
+67e0c653
+20600000
+20406368
+2020639f
+6fe0c4e4
+79207e05
+79207e06
+67e0c4e4
+6848c648
+184b8400
+18418403
+204064c8
+70465203
+2020644e
+70095b08
+20407871
+20406368
+6fe0c655
+1fe67c01
+2022e3b0
+2020137a
+6fe0c4e4
+79207e07
+67e0c4e4
+2020644e
+20406382
+efe08006
+67e0898e
+20405325
+20405333
+5800000e
+e7e10005
+6fe144da
+e7e10005
+6fe0c64e
+1fe3fe00
+79207e00
+e7e08005
+471dc027
+580015ef
+e7e10005
+58001191
+e7e10005
+6fe0898e
+e7e08005
+58000007
+e7e28005
+58000001
+e7e10005
+204062e6
+e7e08005
+20600000
+202063d0
+471e4027
+6fe083d0
+c039e3d8
+c01fe3dc
+c077e3f6
+c07fe3ee
+c029e3fd
+20600000
+6fe0c4e4
+79207e03
+67e0c4e4
+2020644e
+6fe0c4e4
+79207e03
+79207e02
+67e0c4e4
+6fe083ce
+204062dd
+67e083d1
+2040646d
+6fe083ce
+1feb7e00
+67e0c648
+1febfe00
+793ffe01
+79207e00
+d8404650
+604903ca
+204062ec
+2020644e
+6fe103d4
+1fe20c00
+1fe0fe01
+67e103d4
+efe08006
+6848c653
+9840fe00
+67e0c653
+204064f9
+20406329
+204064df
+20406502
+2020644e
+70095b09
+20407871
+204062c5
+6fe083ce
+204062dd
+67e083d1
+2040646d
+2020644e
+6fe10315
+1fe20c00
+2040636f
+6fe083cf
+c0006409
+2020643d
+471ec027
+6fe083d0
+c01fe334
+c039e33d
+c077e40f
+2020644e
+6fe103d4
+1fe20c00
+2040637a
+6fe083d6
+c020e418
+c0206418
+c038e423
+c0386433
+2020644e
+20406366
+6fe0c648
+1fe37e00
+6848c64f
+98467c00
+2022e41f
+2020137a
+6fe0c4e4
+79207e01
+67e0c4e4
+2020644e
+20406368
+6fe0c655
+6848c64f
+98467c00
+2022e42a
+2020137a
+2020644e
+6fe0c4e4
+79207e05
+79207e06
+67e0c4e4
+6848c648
+184b8400
+18418403
+204064c8
+2020644e
+20406368
+6fe0c655
+6848c64f
+98467c00
+2022e439
+2020137a
+6fe0c4e4
+79207e07
+67e0c4e4
+2020644e
+6fe083cf
+6848c64f
+98467c00
+2022e443
+2020137a
+2020644e
+6fe083d0
+c039e448
+c077e3f6
+c07fe3ee
+c029e44d
+6fe0c4e4
+79207e03
+67e0c4e4
+2020644e
+2020644c
+202063fd
+20600000
+6fe0c652
+207a0000
+c001e453
+2020137a
+70465200
+20405325
+d8400001
+6848c648
+184b8400
+18418403
+da2000aa
+204064b3
+20405333
+18a20c00
+efe10006
+203a137a
+20600000
+20405333
+58000004
+e7e10005
+6fe144da
+e7e10005
+6fe083ce
+e7e08005
+471f4027
+5800013f
+e7e10005
+6fe083d1
+e7e08005
+20600000
+20405325
+20405333
+58000004
+e7e10005
+6fe144da
+e7e10005
+6fe083ce
+e7e08005
+471fc027
+58000173
+e7e10005
+6fe083d1
+e7e08005
+20600000
+20405333
+5800000e
+e7e10005
+6fe144da
+e7e10005
+6fe0c64e
+1fe3fe00
+79207e00
+e7e08005
+47204028
+580015ef
+e7e10005
+58001183
+e7e10005
+18427e00
+e7e08005
+580000f0
+e7e18005
+5800007f
+e7e10005
+58000000
+e7e08005
+58000001
+e7e08005
+204062e6
+e7e08005
+70465410
+20600000
+20405325
+20405333
+5800000e
+e7e10005
+6fe144da
+e7e10005
+6fe0c64e
+1fe3fe00
+79207e00
+e7e08005
+4720c028
+580015ef
+e7e10005
+58001181
+e7e10005
+6fe0c648
+e7e08005
+580000e0
+e7e18005
+6fe14657
+e7e10005
+58000000
+e7e08005
+6fe0c659
+e7e08005
+204062e6
+e7e08005
+20600000
+20405333
+58000008
+e7e10005
+6fe144da
+e7e10005
+6fe0c64e
+1fe3fe00
+79207e00
+e7e08005
+47214028
+580009ef
+e7e10005
+580005e3
+e7e10005
+18427e00
+e7e08005
+5800008d
+e7e08005
+204062e6
+e7e08005
+20600000
+20405325
+20405333
+58000008
+e7e10005
+6fe144da
+e7e10005
+18421600
+6fe0c64e
+1fe3fe00
+79207e00
+e7e08005
+4721c028
+580009ef
+e7e10005
+580005e1
+e7e10005
+19627e00
+e7e08005
+5800008d
+e7e08005
+204062e6
+e7e08005
+20600000
+47224028
+6fe0c654
+207a0000
+6ff10112
+247a0000
+1a227e00
+67e0895d
+6048895c
+204052f1
+247a0000
+20405325
+20405333
+58000005
+e7e10005
+6fe144da
+e7e10005
+6fe083e0
+e7e08005
+580001ff
+e7e10005
+6fe0c654
+e7e08005
+6fe0c651
+e7e08005
+70465400
+20600000
+4722c028
+6fe0c656
+c1008000
+6fe103d2
+207a0000
+6fe0c654
+1fe0fe01
+67e0c654
+20600000
+6fe1465a
+20207e05
+47234028
+6fe0c653
+207a0000
+1fe0ffff
+67e0c653
+6fe14649
+684947a9
+98467c00
+2021650e
+67e147a9
+6fe0c654
+203a6516
+7003e301
+6fe0c651
+67e083e2
+580000ff
+67e083e1
+2020651b
+7003e300
+6fe0c650
+67e083e2
+580000ef
+67e083e1
+4723c028
+6fe147a9
+1fe67c7f
+20216522
+6fe083e3
+1fe0fe01
+67e083e3
+20406329
+6fe147a9
+1fe0fe08
+684883e3
+9840a200
+2040529d
+67e10328
+1fe0fe04
+67e1032a
+1fe20a00
+6fe083e0
+e7e08005
+6fe083e1
+e7e08005
+2040654c
+2040655d
+47244029
+6fe1465c
+1fe20600
+6fe147a9
+1fe27200
+20405f39
+18a20400
+18627e00
+67e1465c
+18420a00
+6fe083e2
+e7e08005
+6fe10328
+1fe20a00
+6fe147a9
+684883e3
+9840fe00
+1fe0fe04
+e7e10005
+6fe144da
+e7e10005
+70465400
+6fe1465e
+c00038b9
+7009d100
+20600000
+4724c029
+6fe147a9
+1fe67c7f
+24216554
+1fe3fe00
+79207e00
+e7e08005
+20600000
+6fe147a9
+1fe97e00
+1ff18400
+1fe17e7f
+1fe3fe00
+793ffe00
+e7e08005
+e0408005
+20600000
+6fe0c654
+207a0000
+e7e08005
+20600000
+47254029
+20407887
+20403111
+20405a40
+4725c029
+2040706c
+20407045
+20407056
+204052f1
+247a0000
+20404e04
+204052f1
+247a0000
+47264029
+204065ab
+20404fc2
+2040644f
+20406575
+4726c029
+2020310d
+6fe08330
+c28050e5
+c283d0ef
+20600000
+47274029
+204052f7
+207a0000
+6fe0804c
+c3830000
+204052db
+67e100bf
+1fe20c00
+efe10006
+1fe0fe04
+67e141e6
+7041e506
+4727c029
+6fe144d6
+203a6594
+6fe0804c
+c4038000
+793ffe07
+67e0804c
+7041e505
+684944d6
+6fe100bf
+9840fe00
+67e100bf
+6fe141e6
+98467e00
+67e141e6
+6fe141e6
+203a137a
+d8400104
+98467e00
+2022e59f
+2421659f
+604941e6
+6fe144d6
+9840fe00
+67e144d6
+202065a1
+58000000
+67e144d6
+6fe0804c
+79207e06
+67e0804c
+20600000
+6fe0c78e
+c28065a9
+70033801
+20600000
+7003380f
+20600000
+6fe0c78b
+243a65b1
+6fe08337
+207a0000
+70033700
+20600000
+4728402a
+6fe08338
+207a0000
+c000e5d1
+c001662a
+c001e5d7
+c002662e
+c01de5e1
+c01e6631
+c006e5e6
+c0076636
+c007e5e9
+c008663c
+c008e5ef
+c0096640
+c009e5f5
+c00a6644
+c00ae5fb
+c00b6648
+c00be601
+c00c664d
+c00ce607
+c00d6651
+c00de60d
+c00e6655
+c00ee613
+c00f665a
+c00fe619
+c010665e
+c010e624
+c0116662
+20600000
+2040666d
+70033802
+6fe0c4e0
+79207e00
+67e0c4e0
+20600000
+70033804
+6fe0c4e0
+c3810000
+70033803
+20406674
+70033804
+6fe0c4e0
+79207e02
+67e0c4e0
+20600000
+204052f7
+247a0000
+20406683
+7003383c
+20600000
+20406679
+7003380e
+20600000
+20406693
+70033810
+6fe0c4e2
+79207e00
+67e0c4e2
+20600000
+2040669a
+70033812
+6fe0c4e2
+79207e02
+67e0c4e2
+20600000
+2040669f
+70033814
+6fe0c4e3
+79207e00
+67e0c4e3
+20600000
+204066a6
+70033816
+6fe0c4e3
+79207e02
+67e0c4e3
+20600000
+20406687
+70033818
+6fe0c4e1
+79207e00
+67e0c4e1
+20600000
+2040668e
+7003381a
+6fe0c4e1
+79207e02
+67e0c4e1
+20600000
+204066ab
+7003381c
+6fe0c4e1
+79207e06
+67e0c4e1
+20600000
+204066b2
+6fe0c4e4
+79207e00
+67e0c4e4
+7003381e
+20600000
+204066b8
+6fe0c4e4
+79207e02
+67e0c4e4
+70033820
+6fe0c64f
+1fe9fe00
+1fe1fe03
+d8404650
+604903ca
+202062ec
+204066c2
+6fe0c4e4
+79207e04
+67e0c4e4
+70033822
+20600000
+6fe0c4e0
+c4008000
+70033803
+202065b1
+6fe0c4e0
+c19f8000
+7003383b
+6fe08336
+c18b8000
+70033600
+7003380d
+202065b1
+6fe0c4e0
+247a0000
+6fe0c78e
+c2806665
+c2836667
+2020666b
+6fe0c4e2
+c4008000
+70033811
+202065b1
+6fe0c4e2
+c19f8000
+70033813
+202065b1
+6fe0c4e3
+c4008000
+70033815
+202065b1
+6fe0c4e3
+c19f8000
+6fe0c78e
+c2836667
+2020666b
+6fe0c4e1
+c4008000
+70033819
+202065b1
+6fe0c4e1
+c19f8000
+7003381b
+202065b1
+6fe0c4e1
+c1ff8000
+6fe0c78e
+c2836669
+2020666b
+6fe0c4e4
+c4008000
+7003381f
+202065b1
+6fe0c4e4
+c4018000
+70033821
+202065b1
+6fe0c4e4
+c1ff8000
+2020666b
+7003380f
+202065b1
+70033817
+202065b1
+7003381d
+202065b1
+70033800
+20600000
+4728c02a
+2040530b
+58000001
+1fe20400
+58000050
+1fe21600
+20205106
+4729402a
+2040530b
+6fe144d8
+1fe20400
+20205115
+4729c02a
+2040530b
+6fe144d8
+1fe20400
+d9600050
+2040512a
+6fe0c4e0
+793ffe05
+67e0c4e0
+20600000
+472a402a
+20405318
+204069ee
+20205145
+472ac02a
+2040530b
+58000003
+1fe20400
+58000051
+1fe21600
+20205106
+472b402a
+2040530b
+6fe144da
+1fe20400
+20205115
+472bc02a
+2040530b
+58000011
+1fe20400
+58000052
+1fe21600
+20205106
+472c402b
+2040530b
+6fe144dc
+1fe20400
+20205115
+472cc02b
+2040530b
+58000013
+1fe20400
+58000053
+1fe21600
+20205106
+472d402b
+2040530b
+6fe144de
+1fe20400
+20205115
+472dc02b
+20405325
+7003ce03
+7003d11c
+20406460
+70464e01
+20600000
+472e402b
+20405325
+6848c64f
+20406330
+6048c648
+2020647b
+472ec02b
+20405325
+6848c648
+2040632a
+204062d1
+67e083d1
+6848c648
+2040632a
+604883ce
+20206460
+472f402b
+20405325
+6848c648
+2040632a
+202064b3
+472fc02b
+6fe10315
+98000c00
+efe08006
+1fe22400
+67e083ee
+efe10006
+67e103ef
+efe08006
+1fed1600
+efe08006
+99609600
+4730402c
+18c20400
+df200004
+d8a003fd
+20407d17
+18420c00
+1a427e00
+c000e870
+c00166e2
+c001e870
+c002670a
+c002e870
+c00367b8
+c003e870
+20206877
+4730c02c
+20406886
+2841fe01
+2020e8f6
+2841feff
+2020e87a
+efe10006
+67e103f5
+196097fe
+196097ff
+2422e874
+d96003e4
+efe1000b
+207a0000
+20406938
+20405323
+18007e03
+e7e08005
+6fe103ef
+e7e10005
+18ebfe00
+1fe0fe05
+1fe0a605
+1ff0fe00
+e7e10005
+18e27e00
+1ff0fe00
+e7e10005
+e7e10005
+d8c003fd
+18e27200
+2022e705
+efe20006
+e7e20005
+c2006702
+18007e00
+e7e08005
+1a627e00
+67e10326
+20600000
+4731402c
+efe20006
+67e203f7
+196097fc
+204067e4
+67e103f3
+196097fe
+204068de
+2022e87a
+2a21fe05
+2020e718
+d8a003fd
+18000e00
+20206727
+efe08006
+c085687a
+efe10006
+243a6725
+efe08006
+c0ffe723
+efe08006
+c0ffe721
+2020676e
+18c08dfb
+20206715
+18c08dfc
+20206715
+18c08dfd
+20206715
+efe08006
+c004e73c
+c005672a
+efe10006
+e7e10005
+18e08e01
+1ff0a400
+efe10006
+1ff0fe00
+1a40a401
+9a467c00
+24216739
+1fe22600
+1a50fe00
+e7e10005
+18e08e01
+1a627e00
+20206730
+196097fb
+1a20a3fb
+20206741
+efe10006
+e7e10005
+18e08e01
+196097fd
+1a20a3fd
+2421687a
+2422e727
+196097ff
+2422e87a
+20405323
+18a08a0a
+da2003fd
+18e27e00
+203a675b
+efe10011
+203a675b
+98002400
+6fe203f7
+98000400
+2040699d
+18c27e00
+203a6758
+18c08dfd
+efe18006
+e7e18005
+20406911
+98007200
+20407d5f
+1a20a202
+18e08fff
+20206748
+da200005
+2040683a
+6fe10326
+c005e8f9
+20206850
+efe08006
+c0006764
+c000e766
+c0016769
+196097ff
+2020676c
+efe08006
+196097fe
+2020676c
+efe10006
+1ff0fe00
+196097fd
+67e103ec
+20600000
+196097fb
+20406760
+2422e874
+684a03f7
+20406967
+2422e871
+18c22200
+20405323
+1a220c00
+18a08a03
+18c21600
+20406918
+1fe22200
+6fe103ec
+1fe22400
+1a227e00
+9a462400
+6fe103f3
+9a467c00
+2421679d
+78547c00
+6fe103ec
+203a6790
+99608c00
+1a40a403
+1a427200
+1f227e00
+1fe0fe03
+1ff0fe00
+e7e10005
+1f227e00
+1ff0fe00
+e7e10005
+202067ab
+1a20f206
+20346794
+1f30fe00
+20206797
+1f227e00
+1fe0fe02
+1ff0fe00
+e7e10005
+1f20f3fd
+1f30fe00
+e7e10005
+19620c00
+202067ab
+78347c00
+6fe103f3
+1fe22200
+1a227200
+6fe103ec
+203a6790
+99608c00
+1a227e00
+1fe0fe05
+1ff0fe00
+e7e10005
+1a227e00
+1ff0fe00
+e7e10005
+20407d5f
+243467b4
+18007e02
+e7e08005
+18c27e00
+99667e00
+1ff0fe00
+e7e10005
+202067b6
+18007e00
+e7e08005
+da200005
+20206866
+4731c02c
+20406886
+2841feff
+2020e87a
+204067e4
+67e103f3
+196097fe
+204068de
+d8a003fd
+18000e00
+efe08006
+c00567ec
+efe10006
+e7e10005
+18e08e01
+196097fd
+1a20a3fd
+2421687a
+2422e7c2
+196097ff
+2422e87a
+20405323
+18a08a0d
+6fe103e4
+98002600
+da2003fd
+efe10011
+203a67df
+98002400
+2040697c
+203a67dd
+18c08dfd
+efe18006
+e7e18005
+20406911
+98007200
+20407d5f
+1a20a202
+202067d2
+20406839
+6fe10326
+c00768fc
+20406850
+20206850
+efe10006
+1ff0fe00
+1fe0fffd
+d84000c8
+98467c00
+24610000
+580000c8
+20600000
+18c08c04
+196097fb
+1a20a3fb
+2422e87a
+20406760
+2422e874
+d96003e4
+20406938
+18e27e00
+203a68fc
+67e08421
+1a427e00
+67e1041f
+d8e00000
+da200000
+20405323
+18a08a0a
+20406822
+2434137a
+18c21600
+1fe22600
+9a20a200
+6fe103ec
+1fe22400
+203a682b
+1a227e00
+9a462400
+2022e81d
+2421681d
+6fe103f3
+9a467c00
+2022e814
+24216814
+1a427200
+20406817
+6fe08421
+18e08e01
+98e67c00
+2022e839
+20206856
+1fe27200
+20406817
+20206856
+18a08bfd
+1f220400
+1a627e00
+9a467e00
+99608c00
+20207d5f
+6fe08421
+18e08e01
+98e67c00
+20628000
+202067fd
+20407e56
+d8c003fd
+18ebfe00
+98c08c00
+e8420006
+20406967
+24628000
+20406911
+20207e54
+6fe103f3
+9a267c00
+24216845
+1a227200
+1f220400
+19620c00
+20407d5f
+6fe1041f
+9a267c00
+2022e837
+20406856
+2020684a
+20406839
+2020684a
+da200007
+18007e00
+e7e08005
+20406866
+68490326
+184085fb
+1850fe00
+e7e10005
+184085fd
+1850fe00
+e7e10005
+20600000
+1fe27200
+1f220400
+19620c00
+20407d5f
+20406856
+58000036
+e7e08005
+6fe1041f
+1ff0fe00
+e7e10005
+20600000
+58000036
+e7e08005
+184085fd
+1850fe00
+e7e10005
+20600000
+da200007
+58000002
+e7e08005
+6fe103ec
+98408400
+1850fe00
+e7e10005
+20406866
+68490326
+184085fb
+1850fe00
+e7e10005
+184085fb
+1850fe00
+e7e10005
+20600000
+6fe10324
+98a67e00
+1fe67e00
+67e10326
+20405323
+1a227e00
+e7e08005
+6fe103ef
+e7e10005
+20600000
+20600000
+58000200
+67e1041d
+2020687c
+58000400
+67e1041d
+2020687c
+58000600
+67e1041d
+2020687c
+58000300
+67e1041d
+20405323
+e7e08005
+6fe103ef
+e7e10005
+58000200
+e7e10005
+6fe1041d
+e7e10005
+70032607
+20600000
+da400000
+18000400
+d8a003e4
+204068de
+2022e8dc
+1a40a401
+efe08006
+1a20a3ff
+196097ff
+2fe1f018
+2420e8dc
+2fe00e04
+2420e8a9
+18000401
+efe08006
+1a20a3ff
+196097ff
+c080689d
+efe08006
+1a20a3ff
+196097ff
+c00068ae
+202068a0
+18c08c01
+1a20a3ff
+196097ff
+18c08c02
+1a20a3fe
+196097fe
+2841fe00
+2020e8d6
+18c08c0c
+1a20a3f4
+196097f4
+202068d6
+2fe00e02
+2420e8ac
+20206894
+2fe00e01
+2420e8dc
+1a20a3fe
+196097fe
+efe10006
+1a467c04
+2022e8b4
+e7e10005
+2841fe00
+2020e8d6
+18c20400
+efe08006
+c08068cf
+efe08006
+c08068cf
+efe08006
+c08868cf
+efe08006
+c08068cf
+efe08006
+c0c068cf
+efe08006
+c08068cf
+efe08006
+c08068cf
+efe08006
+c0c068cf
+efe08006
+c0afe8cf
+efe08006
+c0cde8cf
+efe08006
+c09a68cf
+efe08006
+c07de8d4
+18420c00
+18c08c0c
+18000e00
+18000400
+202068d4
+196097f4
+1a20a3f4
+18000400
+2a21fe00
+2420e88b
+18007e00
+e7e10005
+20600000
+d84000ff
+20600000
+4733402c
+efe08006
+196097ff
+2fe1f030
+2420e8f4
+2fe00e07
+2020e8ed
+2fe00e06
+2020e8ef
+2fe00e05
+2420e8f4
+efe08006
+1fe22200
+196097ff
+202068f2
+18c08c02
+196097fe
+efe10006
+1ff0a200
+196097fe
+18007e01
+20600000
+18007e00
+20600000
+58000003
+67e083ee
+202068fe
+58000005
+67e083ee
+202068fe
+58000007
+67e083ee
+20405323
+6fe083ee
+1fe22400
+e7e08005
+6fe103ef
+e7e10005
+58000500
+e7e10005
+2a41fe05
+2020e90d
+2a41fe07
+2020e90d
+58000000
+e7e28005
+2020690f
+58350200
+e7e28005
+7003260a
+20600000
+20407ce8
+20407ceb
+20406918
+20407ce2
+20407ce5
+18427e00
+20600000
+efe08006
+1fe17207
+1fe97e00
+c0806922
+18007e01
+18000401
+20600000
+20407cc2
+1fe08401
+20600000
+1f227e00
+1fe67c04
+2021691f
+c002e929
+c003692c
+c003e930
+20600000
+efe08006
+1fe08402
+20600000
+efe10006
+1ff0fe00
+1fe08403
+20600000
+efe10006
+1ff0fe00
+e8410006
+18508400
+18500400
+9840fe00
+1fe08405
+20600000
+4733c02c
+18000e00
+da400000
+d8a003fd
+efe1000b
+207a0000
+20406943
+18e27e00
+c1038000
+19609602
+2020693c
+98002600
+6fe14660
+98000c00
+18e27e00
+c1038000
+78547c00
+efe08006
+207a0000
+98007200
+efe10006
+9a667c00
+2422e950
+78347c00
+c200694c
+e8420006
+18c22200
+24346963
+d8c003fd
+df200007
+efe20006
+203a695c
+98467c00
+2022e963
+c2006956
+20600000
+e0420005
+18e08e01
+1a220c00
+20406911
+9a40a400
+98c08c00
+20206946
+1a220c00
+20406918
+98c08c00
+20206946
+4734402d
+6fe14660
+98000c00
+efe08006
+203a7e50
+1fe3fe00
+98c08c00
+efe20006
+98467c00
+20628000
+18a27e00
+67e1097d
+604c0964
+20406918
+98c08c00
+18c27e00
+6849097d
+18420a00
+684c0964
+1fe20c00
+2020696a
+4734c02d
+6fe14660
+98000c00
+efe08006
+203a699a
+98007200
+efe10006
+9a667c00
+2022e98a
+c2006982
+18c08c04
+20406918
+98c08c00
+2020697f
+1f20f3ff
+1f23fe00
+98c08c00
+18c08c04
+20406918
+98c09600
+18c08c01
+efe10006
+9a467c00
+2022fe5e
+20406911
+98c08c00
+19627e00
+98c67c00
+2022e99a
+20206990
+18000c00
+18007e00
+20600000
+4735402d
+6fe14660
+98000c00
+efe08006
+203a69b6
+1fe3fe00
+98c08c00
+efe20006
+98467c00
+2022e9aa
+20406918
+98c08c00
+202069a0
+20406918
+98c09600
+18c08c01
+efe10006
+9a467c00
+20628000
+20406911
+98c08c00
+19627e00
+98c67c00
+2022e9b6
+202069ac
+18000c00
+20600000
+da400400
+204069aa
+da400300
+204069c3
+24740000
+1a267c03
+20217e56
+efe08006
+c0847e56
+efe08006
+20600000
+4735c02d
+20406918
+1fe22200
+efe08006
+1fe17207
+1fe97e00
+1fe67c03
+2022e9df
+1f227e00
+c002e9d6
+c00369d9
+c003e9dc
+18c08dff
+20406918
+98c08c00
+1a227e00
+98462200
+2022fe56
+202069c6
+1a20a3fe
+18c08c01
+202069c6
+1a20a3fd
+18c08c02
+202069c6
+1a20a3fb
+18c08c04
+202069c6
+1a20a3ff
+1f227e00
+c000e9e8
+c00169e6
+c00269e5
+20207e56
+1a20a3f4
+efe10006
+1a20a3fe
+efe10006
+9a467c00
+2022fe54
+1a20a3fe
+2022fe56
+202069c6
+20405323
+1fe20a00
+58000006
+e7e08005
+5800006e
+e7e10005
+58000f00
+e7e10005
+581a0535
+e7e18005
+58000111
+1ff07e00
+e7e20005
+58002600
+e7e10005
+58000335
+e7e10005
+58000009
+e7e10005
+58000004
+e7e10005
+70032614
+20600000
+4736402d
+7004a750
+d8a004a8
+d8c04337
+20407d0c
+d8c046dc
+20407d0a
+d8c00880
+20407d0a
+20406ac0
+d8c00277
+20406abb
+20406a86
+d8a009be
+20406ab7
+580f4240
+1fe22200
+6fe209be
+9a26fc00
+20407def
+18077e00
+67e2087c
+20600000
+7004a741
+d8a004a8
+20406a6b
+20406a66
+6fe1c351
+e7e18005
+20406a2c
+d8c00277
+20407d0c
+d8c04337
+20407d0c
+20406ac0
+d8c009de
+d8a0098e
+20407d0c
+20206a86
+6fe2439e
+e7e20005
+20407d1f
+20207d1c
+4736c02d
+7004a741
+d8a004a8
+20406a66
+20406a6b
+6fe1c34a
+e7e18005
+20406a2c
+d8c04337
+20407d0c
+d8c00277
+20407d0c
+20406ac0
+d8c009de
+d8a0098e
+20407d0c
+20406a86
+d8a009be
+20206ab7
+7004a720
+d8c008c0
+d8a004a8
+20407d0a
+20406ac0
+d8c00860
+20406abb
+20406a86
+d8a0098e
+20406dd1
+d8400001
+20406a55
+d8a04316
+20406ab7
+d8400000
+20406a55
+d8a009de
+20206dd1
+4737402d
+7004a735
+58000100
+67e104a8
+20406a66
+20406a6b
+d8c04337
+20407d0c
+d8c00277
+20407d0c
+58006c65
+e7e10005
+58006274
+e7e10005
+e0408005
+20406ac0
+20206a86
+6fe3437a
+e7e30005
+6fe0c371
+e7e08005
+20600000
+6fe30297
+e7e30005
+6fe0c36a
+e7e08005
+20600000
+7004a741
+6fe0c76e
+67e084a8
+d8c046dc
+20407d0a
+d8c00880
+20407d0a
+20406ac0
+d8c00277
+20406abb
+20206a86
+7004a741
+6fe0c76e
+67e084a8
+d8c00880
+20407d0a
+d8c046dc
+20407d0a
+20406ac0
+d8c04337
+20406abb
+20206a86
+4737c02d
+20406ad5
+6fe084a7
+1fe20400
+1fe0fe0f
+1ff1fe00
+1fe22400
+203a6a98
+18417e0f
+243a6a9b
+da60099e
+dfe004a8
+1fe0fff0
+9840a200
+d8a009ce
+df200004
+20407d2f
+20206aa6
+da400001
+da200000
+20206a9c
+1841220f
+dfe004a8
+9840fe00
+9a260c00
+d8a009be
+20406afb
+da6009ae
+da2009be
+d8a009ce
+df200004
+20407d2f
+20406dcb
+20406d62
+d8c004a8
+1a40a5ff
+1a427e00
+203a6aaf
+20406dc0
+20406d5c
+20206aa9
+d8a009be
+20406dd1
+d8c009ce
+20406dc0
+20406d62
+d8c009be
+20406dc0
+20206d5c
+18a22200
+20406dd1
+df200010
+20207d37
+d8a0098e
+20407d0c
+df200010
+da20098e
+20207d37
+6fe084a7
+1fe27200
+da2004a8
+20207d37
+efe08011
+1fe3fe00
+2a6ffe00
+7920fe00
+2feffe08
+7920a600
+e7e08011
+1a20a3ff
+c2006ac4
+20600000
+da20099e
+1a20a20f
+18007210
+18002600
+20206ac4
+da2009ae
+20206acf
+d8c0098e
+20406dbe
+18007008
+20406dcc
+20406dcb
+20406d59
+d8a0099e
+20406dd1
+4738402e
+6fe0899e
+2feffe07
+2420eae6
+20406ace
+da60099e
+d8a0099e
+20406af0
+20206ae7
+20406ace
+d8c0099e
+d8a009ae
+20407d0c
+6fe089ae
+2feffe07
+2420ead3
+20406ad3
+da6009ae
+d8a009ae
+df200003
+d8400000
+20406af7
+1a60a604
+c2006af1
+d8408700
+18500400
+efe20013
+9842fe00
+e7e20005
+20600000
+4738c02e
+df200010
+dfe00000
+9a267c00
+2022eb06
+20216b09
+e8408006
+e0408005
+1fe0fe01
+c2006afe
+20600000
+d8400080
+e0408005
+20206b03
+d8400000
+20206b07
+20406b1e
+d8c00454
+d8a00444
+20207d0c
+78547c00
+20406c15
+d8c00424
+d8a00464
+1800720f
+20407d5f
+efe08006
+1fe2fe06
+e7e08005
+58000474
+67e10498
+58000464
+67e10496
+79200012
+20206b5e
+6848c793
+18002410
+1840a606
+1a667c10
+20216b24
+18002610
+d8a00464
+d8c04794
+18427200
+78547c00
+efe08006
+e7e08005
+1a40a5ff
+2022eb32
+c2006b28
+20346b25
+78347c00
+18007206
+1a220c00
+20206b28
+d8c00424
+d8a00474
+20407d0c
+6fe08483
+9a62fe00
+67e08483
+58000474
+67e10498
+58000464
+67e10496
+79200012
+20206b5e
+78547c00
+20406c15
+20206b48
+da200057
+78347c00
+20406c15
+20406b48
+d8c00454
+d8a00063
+20207d0c
+58000424
+67e10498
+580041cb
+67e10496
+793f8012
+20406b5e
+da200454
+da400424
+d8a00464
+20406c08
+da200464
+da400474
+1a420a00
+78347c00
+20406c06
+20406c20
+58000474
+67e10498
+58000464
+67e10496
+79200012
+20206b5e
+70049a00
+6fe10496
+98000c00
+d8a00484
+20407d0c
+6fe10498
+98000c00
+d8a00454
+20407d0c
+20406b85
+78547c00
+c5896b6f
+6fe0849a
+c0826b6f
+6fe10498
+98002400
+20406bb7
+20406bb6
+20406bc9
+6fe0849a
+1fe0fe01
+67e0849a
+20406b85
+78347c00
+20406bb6
+20406bd8
+20406be7
+20406bd8
+20406be7
+20406bd8
+20406be7
+20406bd8
+6fe0849a
+1fe0fe01
+67e0849a
+c0886b67
+20406b85
+78547c00
+20206bb6
+6fe0849a
+d8c00484
+203a6bac
+98002400
+18007211
+18c20a00
+efe08006
+1fe98400
+1feb7e00
+1fe97e00
+9841fe00
+e7e08005
+c2006b8b
+58000484
+9a408c00
+18007210
+d8a00434
+efe08006
+e7e08005
+28c1fe95
+2420eb9b
+18c08def
+c2006b96
+18002200
+1a40a7ff
+1a6ba600
+1a6ba600
+20406df3
+58009000
+9a60a600
+d8a00434
+18007210
+e8408013
+efe08005
+9840fe00
+e7e08005
+1a60a601
+c2006ba5
+20206df7
+18007210
+18000400
+efe08006
+98428400
+c2006bae
+18427e00
+e7e08006
+d8c00484
+d8a00434
+20207d0c
+da400434
+18007210
+da200454
+1a220a00
+e8408011
+efe08012
+9842e000
+1f212603
+24346bc0
+1a62a603
+1a662601
+20216bc3
+9840e000
+1e027e00
+e7e08005
+1a20a201
+1a40a401
+c2006bba
+20600000
+20406df3
+18007210
+da200454
+efe08011
+d8c09100
+1f212603
+1a667c01
+20216bd2
+d8c09200
+98c08c00
+efe08006
+e7e08011
+1a20a201
+c2006bcc
+20206df7
+18007208
+d8c00454
+18c20a00
+efe08006
+98002200
+efe08006
+98002400
+1a23fe00
+9a40fe00
+e7e08005
+1a227e00
+9a40fe00
+e7e08005
+c2006bdb
+20600000
+588ae42c
+98000400
+18007207
+20406bf6
+580d751b
+98000400
+18007205
+20406bf6
+6fe08463
+98002200
+6fe08457
+67e08463
+1a227e00
+67e08457
+20600000
+1841240f
+18417e0f
+d8a00454
+98a08a00
+efe08005
+98002600
+1a227e00
+e7e08005
+1a622200
+18518400
+c2006bf7
+58000454
+9a408a00
+1a227e00
+e7e08005
+20600000
+78347c00
+20206c09
+78547c00
+18007210
+e8408011
+efe08012
+20346c0f
+9842fe00
+20206c10
+9840fe00
+e7e08005
+1a20a201
+1a40a401
+c2006c0a
+20600000
+d8a00474
+efe30011
+e7e30005
+20346c1b
+efe30011
+20206c1c
+efe30006
+e7e30005
+efe20011
+e7e20005
+20600000
+d8c041cb
+d8a00464
+d8400000
+588395a7
+20406c41
+58b3c1df
+20406c41
+5800e5e9
+20406c42
+18422800
+78547c00
+20406c2f
+1a820400
+78347c00
+20206c2f
+18007208
+efe08006
+2f200201
+20346c36
+2020ec37
+9840fe00
+20206c38
+2020ec34
+9842fe00
+e7e08005
+184c8400
+c2006c30
+20600000
+6fe30458
+67e30057
+efe30006
+e7e30005
+20600000
+184d0400
+18500400
+98418400
+20600000
+20206c45
+4739402e
+20406d65
+d8a04316
+20206dd1
+d8a04337
+2034ec4d
+d8a00277
+18c22200
+20407d0c
+20406d7a
+d8c04327
+20206dea
+da200277
+2034ec55
+da204337
+1a220a00
+20405a31
+20206d7a
+d8c04384
+20406dc0
+d8c04316
+20406dc1
+18006c38
+18006c00
+20406d57
+d8a002c7
+20206dd1
+18007008
+18007e49
+20206c68
+18007e49
+20206c67
+18007e01
+18007000
+184d5e00
+9de1de00
+1f00f001
+184cde00
+1df15e00
+6fe146aa
+1ff07e00
+9de1de00
+1f00f001
+ede20006
+1f00f001
+efe10006
+1a30de00
+1df05e00
+9de1de00
+1f00f001
+20600000
+1a608c01
+efe08006
+98002200
+20406c64
+20406d59
+18007000
+efe08013
+1fe17e03
+1ff05e00
+79205e08
+20406dc9
+20406d5c
+1a227200
+1a608c02
+20406da8
+20406db2
+20406d5c
+1f227e00
+203a6c8d
+20206c88
+1800700c
+1de27e00
+67e2026f
+20600000
+1a20a201
+20406c66
+1a620c00
+20406dbc
+20406d5f
+20406dd8
+1a60a610
+1a40a5f0
+20216c91
+20600000
+20406d4c
+4739c02e
+d8c00063
+20406dbe
+7080d500
+18217e0f
+1fe9fe00
+9881fe00
+67f080d6
+6fe0c1e4
+67f080d7
+627100d1
+627100d3
+6a2146b2
+684ac69c
+20406cbd
+20406c61
+70800a02
+70800a03
+6fe146b2
+67f100da
+1fe0fe04
+67e146b2
+1a627e00
+9a20a200
+20406d53
+df00000c
+e5e20011
+65e2026f
+20600000
+6fe2c69c
+1fe0fe01
+67e2c69c
+20206cc3
+6fe0c1e4
+c1808000
+6fe146b2
+247a0000
+79200424
+20600000
+6fe0c6a0
+1fe17e0f
+1fe1fe20
+67e0c6a0
+20600000
+6fe0c6a5
+1fe17e0f
+67e0c6a5
+20600000
+18a27e00
+684900af
+18408404
+98467e00
+67e146b4
+67f100d1
+67f100d3
+20407e5a
+20406d4c
+d8c00063
+20406dbe
+7080d500
+6fe0801a
+1fe17e0f
+1fe9fe00
+9881fe00
+67f080d6
+6fe080e5
+1fe17e03
+67e0c1e4
+67f080d7
+6a2100af
+622146b2
+6fe146b4
+9a208c00
+18007000
+ede20006
+65e20273
+684ac6a1
+20406cbd
+20406c61
+70800a06
+70800a07
+6fe100af
+67f100da
+20406d53
+6ff08108
+c4038000
+20207e58
+c6078000
+684a0273
+604a46a6
+6fe2c6a1
+1fe0fe01
+67e2c6a1
+20206cc8
+20406d4c
+7080d500
+7080d601
+6fe0816b
+1fe17e03
+67f080d7
+5800016d
+67f100d1
+67f100d3
+6a20816c
+1a20a3fc
+24217e5e
+6220816c
+5800016d
+9a208c00
+18007000
+ede20006
+65e20273
+684ac6a1
+20406c61
+70800a06
+70800a07
+6fe0816c
+67f100da
+20406d53
+6ff08108
+c303fe5e
+684a0273
+6fe246a6
+98467e00
+207a0000
+604a46a6
+6fe2c6a1
+1fe0fe01
+79207e27
+67e2c6a1
+18007e00
+20600000
+20406d27
+580041f7
+9a20a200
+20406d53
+df00000c
+e5e20011
+20600000
+20406d4c
+473a402e
+7080d500
+7080d601
+6fe0c1f5
+1fe17e03
+67f080d7
+6fe1097b
+67f100d1
+580041f7
+67f100d3
+6a20c1f6
+684ac69c
+20406c61
+70800a02
+70800a03
+6fe0c1f6
+67f100da
+1fe0fe04
+67e0c1f6
+6fe2c69c
+1fe0fe01
+793ffe27
+67e2c69c
+20600000
+6ff1011a
+98467c00
+20628000
+247a0000
+20206d40
+6ff08108
+c303137a
+580041f7
+98408a00
+df00000c
+e5e20005
+20206d55
+473ac02e
+1800700c
+20406dcc
+20406dcb
+58000000
+67f100da
+20600000
+6ff08108
+c3036d53
+70800a00
+20600000
+243bed57
+20600000
+18006c30
+18006c00
+20206d57
+18006c32
+18006c02
+20206d57
+18006c34
+18006c04
+20206d57
+18006c01
+18006c00
+20600000
+18007000
+6fe20277
+98005e00
+1f00f001
+efe20006
+98005e00
+1f00f001
+6fe24337
+98005e00
+1f00f001
+efe20006
+98005e00
+1f00f001
+20406dcc
+1f00f1fc
+6fe2439e
+1fe25e00
+1f00f004
+18006c38
+18006c08
+20206d57
+473b402e
+6fe3437a
+684b0297
+2034ed80
+6fe30297
+684b437a
+18007008
+18425e00
+1f00f001
+184f5e00
+1ff07e00
+9de1de00
+1f00f001
+1fef5e00
+1f00f001
+18005e00
+18007e00
+6fe0c36a
+6848c42b
+2434ed90
+6fe0c371
+6848c36a
+67e0c347
+6048c348
+18007000
+da404347
+18007204
+efe20011
+e8420012
+9842de00
+1f00f001
+1a20a204
+1a40a404
+c2006d95
+20406dcc
+1f00f1fc
+6fe2439e
+1fe25e00
+1f00f004
+18006c38
+18006c0c
+20406d57
+20406dcb
+18006c3a
+18006c08
+20206d57
+2f200600
+20608000
+18c27e00
+9f208a00
+18007e00
+e7e08005
+1f20f201
+2f200600
+20608000
+20206dad
+18007000
+1f227e00
+203a6db7
+efe20006
+1f20f3fc
+98005e00
+1f00f001
+2f001e04
+20608000
+20206db3
+18007008
+20206dc1
+18007004
+20206dc1
+18007000
+18007204
+efe20006
+98005e00
+1f00f001
+c2006dc2
+20600000
+d8c002c7
+20206dbe
+18007204
+20206dce
+18007000
+18007204
+18005e00
+1f00f001
+c2006dcd
+20600000
+1800700c
+18007204
+1de27e00
+e7e20005
+1f00f001
+c2006dd3
+20600000
+1800700c
+1a620a00
+1a40f201
+1f267c0f
+20216dde
+18007210
+1de27e00
+1f267c03
+20216de6
+e7e20005
+1f20f3fc
+20628000
+1f00f001
+20206dde
+e7e08005
+1fecfe00
+c2006de6
+20600000
+1800700c
+18007204
+efe20006
+9de67c00
+24628000
+1f00f001
+c2006dec
+18007c00
+20600000
+6ff08050
+793ffe00
+67f08050
+20600000
+6ff08050
+79207e00
+67f08050
+20600000
+d8a00748
+3803ffff
+3807ffff
+380bffff
+380ffbff
+e7e48005
+3803ffff
+3807ffff
+380bffff
+380fffff
+e7e48005
+3803ffff
+3807ffff
+380bcfff
+380fffff
+e7e48005
+3803ffff
+3807ffff
+380bffef
+380fffff
+e7e48005
+3803ffff
+3807ffff
+380bffff
+380fffff
+e7e48005
+3803ffff
+38066c7f
+3808146b
+380f7bb3
+e7e48005
+3801feb8
+38050c12
+380ab722
+380e9fa6
+e7e48005
+3800e70f
+38056720
+3808519e
+380d9084
+e7e48005
+38031012
+380760bf
+380bf0af
+380c03d3
+e7e48005
+3803a188
+38043ad0
+380bcbf2
+380e43d9
+e7e48005
+3802b030
+38076a03
+38091188
+380de520
+e7e48005
+3803a11e
+3804fe5d
+3808dd57
+380dac93
+e7e48005
+380011ed
+380618c4
+38088da7
+380e57ff
+e7e48005
+3803192b
+38074641
+3809be0c
+380f66ad
+e7e48005
+38001f83
+38055a23
+380bf9b0
+380c3949
+e7e48005
+38013a51
+380553fd
+380b372a
+380cf1bb
+e7e48005
+3803ae85
+3805eed9
+38089e66
+380c01a8
+e7e40005
+20600000
+d8a007e0
+3803ffff
+3807ffff
+380bffff
+380fffff
+e7e48005
+3803ffff
+3804003f
+38080000
+380c0000
+e7e48005
+38000000
+38040000
+38081000
+380c0000
+e7e48005
+3803ff00
+3807ffff
+380bffcf
+380fffff
+e7e48005
+3803ffff
+3807ffff
+380bffff
+380c03ff
+e7e48005
+38000000
+38040000
+38080000
+380c0000
+e7e48005
+38010000
+38040000
+380bf000
+380fffff
+e7e48005
+380296ff
+38062630
+380b945d
+380fd284
+e7e48005
+380333a0
+38044b7a
+380837d8
+380fc9dc
+e7e48005
+3803a440
+3805b958
+380b8bce
+380d091f
+e7e48005
+3802e12c
+3805f47c
+380b56b1
+380efd47
+e7e48005
+38006837
+3806ed90
+3809ecec
+380dacc5
+e7e48005
+38023357
+38058af3
+3808f9e1
+380d29f0
+e7e48005
+3802e7eb
+3807e6e3
+380be1a7
+380d0b8b
+e7e48005
+38024fe3
+380420ef
+3809b5a6
+380cdc2f
+e7e48005
+38013860
+3806bd69
+3808391a
+380db222
+e7e48005
+20600000
+6fe0c764
+243a6ebf
+20207541
+473bc02e
+6fe0c764
+207a0000
+6fe0c6b9
+c1808000
+6fe0c6b8
+207a0000
+6fe0c6bb
+c1018000
+6fe1478c
+c2806eb5
+6fe0c6ba
+c0007541
+20600000
+7046ba00
+20600000
+6fe0c6b8
+79207e01
+67e0c6b8
+20600000
+6fe0c6b8
+793ffe01
+67e0c6b8
+20600000
+473c402f
+6fe0c764
+243a6ffb
+20406ecc
+7046b900
+70087400
+20600000
+6fe0c764
+207a0000
+6fe0c6b9
+c1008000
+2040706c
+20206ec6
+473cc02f
+58000880
+d8a00870
+98a67200
+20407d26
+58004770
+d8a04768
+98a67200
+20207d26
+70087201
+6fe0c645
+c0016eda
+c000eee5
+20600000
+6fe0c6bb
+c001eedd
+20207562
+20407581
+6fe08871
+247a0000
+70087003
+20600000
+6fe0c6b9
+c000f01a
+2020137a
+6fe0c6b9
+c000eee8
+20206ffb
+2040701a
+6fe08871
+247a0000
+70087003
+20600000
+20406f08
+da2008a0
+d8a00728
+20407761
+da200880
+d8a006e8
+20407761
+da2006e8
+da400880
+d8a006e8
+204076c9
+da200800
+da400880
+d8a00708
+204076c9
+da200708
+da4006e8
+d8a006e8
+20407765
+da2006c8
+da4006e8
+d8a006c8
+20407765
+df200020
+da200728
+da4006c8
+20207df1
+da200840
+d8a006c8
+20407761
+da200820
+d8a006e8
+20407761
+da2006e8
+da400820
+d8a006e8
+204076c9
+da200800
+da400820
+d8a00708
+204076c9
+da200708
+da4006e8
+d8a006e8
+20407765
+da2006c8
+da4006e8
+d8a006c8
+2020777e
+20406f39
+da2008a8
+d8a00728
+20407138
+da200888
+d8a006e8
+20407138
+da2006e8
+da400888
+d8a006e8
+20407116
+da200760
+da400888
+d8a00708
+20407116
+da200708
+da4006e8
+d8a006e8
+204070e5
+da2006c8
+da4006e8
+d8a006c8
+204070e5
+df200018
+da200728
+da4006c8
+20207df1
+da2007a8
+d8a006c8
+20407138
+da200790
+d8a006e8
+20407138
+da2006e8
+da400790
+d8a006e8
+20407116
+da200760
+da400790
+d8a00708
+20407116
+da200708
+da4006e8
+d8a006e8
+204070e5
+da2006c8
+da4006e8
+d8a006c8
+202070e8
+6fe0c645
+c0016f53
+c000ef63
+20600000
+6fe0c6ba
+c0806f81
+20406f7e
+d8a00940
+580008f0
+e7e10005
+580046fc
+e7e10005
+580008a0
+e7e10005
+2040742a
+6fe08871
+c0026f7b
+70087201
+70087005
+20600000
+6fe08874
+c0806f81
+20406f7e
+d8a00940
+580008f0
+e7e10005
+5800474c
+e7e10005
+580008a0
+e7e10005
+20206f75
+d8a00940
+58000900
+e7e10005
+580008a0
+e7e10005
+5800474c
+e7e10005
+20407351
+6fe08871
+c0026f7b
+70087201
+70087005
+20600000
+70087114
+20406ee2
+20207068
+d8a008e0
+18000e08
+20207032
+70087201
+20600000
+6fe0c645
+c0016f89
+c000ef8c
+70087009
+70087201
+20600000
+6fe0887b
+c081ef86
+20206f8e
+6fe0887b
+c080ef86
+d8a005e9
+6fe340a8
+e7e30005
+6fe30041
+e7e30005
+6fe1c768
+e7e18005
+20407449
+da200910
+da400920
+18000e04
+20407037
+2420efa7
+20406f9e
+70007e41
+20205a1d
+6fe08871
+c004efa4
+7008700a
+70087201
+70007d03
+20600000
+70007d03
+70087115
+20207068
+6fe08871
+c004efad
+70087000
+70007d04
+70007f05
+20600000
+70007d04
+70087100
+20600000
+6fe0c645
+c0016fb4
+c000efb8
+20600000
+6fe0887b
+c001efbc
+7008710a
+20207068
+6fe08875
+c000efbc
+7008710a
+20207068
+d8a005e9
+6fe30041
+e7e30005
+6fe340a8
+e7e30005
+6fe1c765
+e7e18005
+2040748c
+6fe08871
+c0056fc9
+7008700b
+70087201
+20600000
+7008710b
+70087301
+20600000
+d8a00940
+6fe30041
+e7e30005
+6fe340a8
+e7e30005
+580008f0
+e7e10005
+58000900
+e7e10005
+20206fe0
+7008700f
+d8a00940
+6fe340a8
+e7e30005
+6fe30041
+e7e30005
+58000900
+e7e10005
+580008f0
+e7e10005
+d8a005e9
+6fe30940
+e7e30005
+6fe30946
+e7e30005
+204074a0
+7041ca01
+d8a041cb
+d8c00910
+20407d0c
+202009c8
+d8a0471c
+380118ff
+3807fd29
+3809ed2e
+380cad89
+e7e48005
+38030c14
+380475b3
+380805df
+380f709c
+e7e48005
+3802918d
+380457e1
+38080079
+e7e30005
+20600000
+473d402f
+6fe0c6b9
+c1800000
+6fe08874
+c1800000
+d8a0471c
+18000e0b
+20407032
+180a7e00
+1fe37e00
+e7e10005
+6fe0c6b7
+245a6feb
+d8a00580
+d8c0471c
+20407d0b
+d8a004a8
+d8c00790
+20407d09
+d8a004d8
+20407d16
+7004d801
+2040740e
+70087401
+20600000
+d8a04734
+d8c004f0
+20407d09
+7046b901
+70087400
+20600000
+473dc02f
+6fe0887b
+c1800000
+6fe08874
+c1800000
+d8a00580
+d8c0471c
+20407d0b
+d8a004a8
+d8c00888
+20407d09
+d8a004d8
+20407d16
+7004d801
+2040740e
+70087402
+20600000
+70087501
+d8a008c8
+d8c004f0
+20407d0b
+70087b01
+70087400
+20600000
+18e08fff
+24610000
+180a7e00
+e7e10005
+20207032
+18e08fff
+24217043
+efe20011
+1fe20400
+efe20012
+9842fe00
+2422f041
+1a20a204
+1a40a404
+20207037
+7840fc00
+20600000
+7820fc00
+20600000
+473e402f
+6fe08872
+207a0000
+204059e1
+247a0000
+70087200
+6fe08870
+c001d907
+c002d929
+c003d934
+c005d949
+c0016ed5
+c0026f4f
+c004ef83
+c0056fb0
+c0066fd6
+20600000
+473ec02f
+6fe08873
+207a0000
+204059e1
+247a0000
+70087300
+6fe08871
+c00958eb
+c009d8f0
+c001d8f4
+c0026f6e
+c00a58f8
+c003d905
+c0056fb0
+c005d948
+c004ef83
+c00ad942
+20600000
+70087301
+20600000
+70087300
+20600000
+473f402f
+6fe0c764
+207a0000
+6fe08874
+207a0000
+1fe0fe80
+67e08874
+c3838000
+6fe084a5
+203a7077
+20207419
+20407263
+6fe08874
+c000f014
+c001702b
+20600000
+1fe10e07
+1fe97e00
+98c08c00
+efe08006
+afec0000
+20600000
+20407d0b
+20407d0b
+20207d0b
+efe40006
+247a0000
+efe40006
+247a0000
+efe40006
+20600000
+efe20011
+98000400
+efe20012
+98467c00
+24628000
+1a20a204
+1a40a404
+c200708b
+20600000
+18007206
+1a20a214
+1a40a414
+efe20012
+98000400
+efe20011
+98467e00
+24610000
+247a0000
+1a20a3fc
+1a40a5fc
+c2007097
+20600000
+18007206
+18002600
+efe20011
+98000400
+efe20012
+9840fe00
+9a60fe00
+e7e20005
+2feffe20
+7920a600
+1a20a204
+1a40a404
+c20070a3
+20600000
+18007206
+18002600
+efe20012
+98000400
+efe20011
+98467e00
+9a667e00
+e7e20005
+2feffe20
+7920a600
+1a20a204
+1a40a404
+c20070b1
+20600000
+18007206
+1a20a214
+18002600
+efe20011
+2feffe00
+7920a601
+1fe37e00
+2a6ffe00
+7920fe1f
+e7e20011
+1a20a3fc
+1a632600
+c20070c0
+20600000
+18007206
+18002600
+efe20011
+2feffe1f
+7920a601
+1fe3fe00
+2a6ffe00
+7920fe00
+e7e20011
+1a20a204
+1a632600
+c20070cd
+20600000
+204070cb
+2a6ffe00
+2020f0e1
+da400748
+1a222600
+1a20a3e8
+20407094
+24610000
+1a622200
+1a20a3e8
+da400748
+1a220a00
+202070af
+204070a1
+18a22200
+202070d9
+204070af
+2a6c0000
+20608000
+da400748
+18a0a3e8
+1a220a00
+202070a1
+18a21600
+1a226000
+da4005d8
+1a420a00
+1a208c18
+efe40006
+e7e40005
+e7e40005
+18007e00
+e7e40005
+19620a00
+204070e5
+da4005d8
+1a420a00
+18007e00
+e7e40005
+1e008c20
+efe40006
+e7e40005
+e7e40005
+19622200
+1a220a00
+204070e5
+da4005d8
+1a420a00
+1e008c28
+efe40006
+e7e40005
+e7e40005
+e7e40005
+19622200
+1a220a00
+202070e5
+18007206
+efe20006
+98005e00
+1f00f001
+c2007111
+20600000
+18a21600
+d8a005a8
+20407d16
+d8a005a8
+1a220c00
+18007000
+20407110
+1a420c00
+20407110
+18002400
+18000400
+18002606
+efe20005
+98002200
+1a427000
+1de27e00
+1a627000
+9deffe00
+9a20fe00
+9840fe00
+e7e20005
+1fef0400
+1a60a601
+2a61fe0c
+2420f122
+18427e00
+e7e20005
+18a08be8
+1a40a401
+2a41fe06
+2420f120
+da2005a8
+19620a00
+202070ef
+1a222400
+20207116
+1a226000
+1e022200
+efe08011
+2feffe00
+20608000
+204070bd
+efe08012
+2fec0000
+2020f14a
+da200748
+1a420a00
+204070a1
+efe08012
+9a60fe00
+e7e08012
+1a40a5e8
+1a40a218
+18007207
+204070bf
+2020713b
+18a21600
+d8a00608
+20407d16
+18007e00
+67e205c0
+67e20620
+70060801
+d8a005a8
+20407d16
+d8c00748
+d8a005d8
+20407d0b
+1a220c00
+d8a005f0
+20407d0b
+d8c005f0
+20407085
+203a7186
+da2005f0
+da400608
+2040713a
+da2005d8
+da4005a8
+2040713a
+da2005f0
+da4005d8
+20407094
+20217178
+da2005d8
+da4005f0
+1a220a00
+204070af
+da200608
+da4005a8
+1a420a00
+204070a1
+efe08011
+9a60a600
+efe08012
+9a60fe00
+e7e08012
+2020715d
+da2005f0
+da4005d8
+1a220a00
+204070af
+da2005a8
+da400608
+1a420a00
+204070a1
+efe08011
+9a60a600
+efe08012
+9a60fe00
+e7e08012
+2020715d
+d8a00608
+20407d16
+6fe085c0
+67e08608
+67e08610
+da200608
+da4005a8
+1a420a00
+204070e5
+da200748
+da4005a8
+19620a00
+202070e8
+da200568
+d8a00620
+20407138
+da200620
+d8a00638
+20407138
+da200760
+da400638
+d8a00638
+20407116
+da200538
+d8a00620
+20407138
+d8c00620
+d8a005f0
+20407d0b
+da2005f0
+204070d8
+da200620
+da4005f0
+d8a00620
+204070e5
+da200620
+da400638
+d8a00620
+204070e5
+d8c00538
+d8a005f0
+20407d0b
+da200550
+d8a00638
+20407138
+da2005f0
+204070d8
+da2005f0
+204070d8
+da2005f0
+da400638
+d8a005f0
+20407116
+da200638
+d8a00608
+20407138
+da200608
+204070d8
+da200608
+204070d8
+da200608
+204070d8
+d8c00550
+d8a00638
+20407d0b
+da200638
+204070d8
+da200638
+da400568
+d8a00568
+20407116
+da200620
+d8a00638
+20407138
+da200638
+da4005f0
+d8a00638
+204070e8
+da200638
+da4005f0
+d8a00538
+204070e8
+da2005f0
+da400538
+d8a00638
+204070e8
+da200638
+da400620
+d8a00638
+20407116
+da200638
+da400608
+d8a00550
+202070e8
+da2004d8
+d8a00650
+20407138
+da200538
+da400650
+d8a00608
+20407116
+da2004d8
+da400650
+d8a00650
+20407116
+da200550
+da400650
+d8a005f0
+20407116
+da200568
+d8a00650
+20407138
+da2004a8
+da400650
+d8a00620
+20407116
+da200568
+da400650
+d8a00650
+20407116
+da2004c0
+da400650
+d8a00638
+20407116
+da200608
+da400620
+d8a00650
+204070e8
+da200608
+da400620
+d8a00608
+204070e5
+da2005f0
+da400638
+d8a00620
+204070e8
+da2005f0
+da400638
+d8a005f0
+204070e5
+da2005f0
+da400650
+d8a005f0
+20407116
+da200568
+da4004d8
+d8a00638
+20407116
+da200638
+da400650
+d8a00568
+20407116
+da200650
+d8a00650
+20407138
+da200650
+da400608
+d8a00638
+20407116
+da200650
+da4005f0
+d8a005f0
+20407116
+da200620
+d8a00538
+20407138
+da200538
+da400638
+d8a00538
+204070e8
+d8c00538
+d8a00650
+20407d0b
+da200650
+204070d8
+da200638
+da400650
+d8a00638
+204070e8
+da200638
+da400620
+d8a00620
+20407116
+da200620
+da4005f0
+d8a00550
+204070e8
+da200550
+da400748
+d8a00550
+18002600
+6fe08550
+2feffe00
+2040f0a1
+1a626000
+da200550
+204070bd
+6fe08567
+2e0ffe00
+7920fe07
+67e08567
+20600000
+6fe084a5
+1fe0ffff
+24610000
+67e084a5
+6fe084a4
+205a7193
+6fe084a5
+d8c00580
+2040707c
+2020f250
+6fe084a4
+243a725e
+204071e4
+20207250
+7004a400
+d8c004a8
+d8a00538
+20407082
+20207250
+da200568
+d8a00638
+2040714e
+da200638
+d8a005f0
+20407138
+da200538
+da4005f0
+d8a004f0
+20407116
+da200638
+da4005f0
+d8a00620
+20407116
+da200550
+da400620
+d8a00508
+20207116
+efe20006
+18002204
+18a08a03
+e7e08005
+1fecfe00
+18a08bfe
+1a20a3ff
+2422f278
+18a08a05
+c2007275
+20600000
+18ebfe00
+99608c00
+efe20006
+20600000
+18006010
+d96004a8
+1e008ff9
+20407280
+98000400
+1e008ff0
+20407280
+98408400
+1e008ffe
+20407280
+1fee7e01
+98408400
+1e008ff1
+20407280
+1fee7e00
+98408400
+1e0bfe00
+99608a00
+e0420005
+1e00e001
+2e01fe40
+2420f286
+20600000
+d8c007c0
+18007007
+efe20006
+98005e00
+1f00f1ff
+2021729d
+20600000
+473fc02f
+20407284
+d8a005a8
+18007000
+1de27e00
+e7e20005
+1f00f001
+2f01fe08
+2420f2a6
+20406df3
+d9609300
+de0004a8
+18007240
+e8420030
+efe2000b
+19609604
+1e00e004
+9840fe00
+18007007
+9de08400
+18007004
+1dee7e03
+98408400
+18007005
+1de27e00
+18007006
+9de2fe00
+18007004
+9de17e00
+18007006
+9de2fe00
+98408400
+18007007
+18425e00
+18007003
+1de27e00
+9840de00
+18007000
+1de27e00
+18007001
+9de10400
+9de1fe00
+18007002
+9de17e00
+98418400
+18007000
+1dee7e02
+9840fe00
+18007007
+9de0de00
+980efc00
+c20072af
+d8c005a8
+18007000
+efe20006
+9de0de00
+1f00f001
+2f01fe08
+2420f2d8
+20206df7
+d8a00900
+18007007
+1de27e00
+e7e20005
+1f00f1ff
+202172e0
+20600000
+d8a004a8
+18c08dfc
+1f262210
+efe20006
+9842fe00
+e7e20005
+18c08df8
+c20072e8
+1a227200
+18427e00
+e7e20005
+c20072ef
+20600000
+6fe0c645
+c00172f9
+c000f2f6
+20600000
+204072fe
+204072de
+20207324
+20407338
+204072de
+20207324
+204072fe
+20207324
+d8c008a0
+d8a004a8
+18007206
+20407422
+d8c0474c
+18007206
+20407422
+d8c00900
+20407421
+2040729b
+204072a2
+d8c008f0
+d8a004a8
+2020731b
+d8c0474c
+d8a004a8
+18007206
+20407422
+d8c008a0
+18007206
+20407422
+d8c008f0
+20407421
+2040729b
+204072a2
+d8c00900
+d8a004a8
+2040731b
+20207324
+20407421
+58800000
+1fed7e00
+e7e20005
+18007205
+20407d17
+58000280
+e7e20005
+202072a2
+6fe20900
+da2003e8
+9a26fc00
+20407def
+18077e00
+67e2087c
+1807fe00
+da2003e8
+9a26fc00
+20407def
+18077e00
+da2003e8
+9a2ffe00
+684a087c
+9840fe00
+67e2087c
+20600000
+20407338
+204072de
+20207324
+d8c008a0
+d8a004a8
+18007208
+20407422
+d8c046fc
+18007208
+20407422
+2040729b
+204072a2
+d8c00900
+d8a004a8
+20407421
+d8c008f0
+20207346
+20407421
+58800000
+1fed7e00
+e7e20005
+18007203
+20407d17
+58000300
+e7e20005
+202072a2
+70476e00
+20207353
+6fe0c76c
+c081734f
+47404030
+58363636
+1fed0400
+18418436
+6fe10940
+1fe20c00
+18007204
+204072e5
+2040729b
+204072a2
+6fe10942
+1fe20c00
+d8a004a8
+18007206
+20407422
+6fe10944
+1fe20c00
+18007206
+20407422
+58800000
+e7e18005
+6fe0c76e
+e7e08005
+18007e00
+e7e40005
+58000388
+e7e20005
+204072a2
+204072de
+d8c00900
+d8a005c8
+20407d0a
+585c5c5c
+1fed0400
+1841845c
+6fe10940
+1fe20c00
+18007204
+204072e5
+2040729b
+204072a2
+d8c005e8
+d8a004a8
+18007208
+20407422
+58800000
+1fed7e00
+e7e20005
+20407d16
+58000300
+e7e20005
+204072a2
+202072de
+58363636
+1fed0400
+18418436
+d8c008e0
+18007206
+204072e5
+2040729b
+204072a2
+6fe1094c
+1fe20c00
+d8a004a8
+20407421
+6fe1094e
+1fe20c00
+20407421
+5862746c
+1fed7e00
+1fe1fe6b
+e7e20005
+d8c005f5
+18007203
+20407422
+58800000
+1fed7e00
+e7e20005
+18007e00
+e7e40005
+58000380
+e7e20005
+204072a2
+204072de
+d8c00900
+d8a005c8
+20407d0a
+585c5c5c
+1fed0400
+1841845c
+d8c008e0
+18007206
+204072e5
+2040729b
+204072a2
+d8c005e8
+d8a004a8
+18007208
+20407422
+58800000
+1fed7e00
+e7e20005
+20407d16
+58000300
+e7e20005
+204072a2
+202072de
+6fe0c76c
+c08173cf
+4740c030
+58363636
+1fed0400
+18418436
+d8c008e0
+18007206
+204072e5
+2040729b
+204072a2
+d8c00900
+d8a004a8
+20407421
+d8c008f0
+20407421
+202073e4
+58000000
+67e24794
+202073c0
+58000000
+67e24794
+202073d7
+6fe0c76c
+c08173d2
+58363636
+1fed0400
+18418436
+d8c008e0
+18007206
+204072e5
+2040729b
+204072a2
+d8c008f0
+d8a004a8
+20407421
+d8c00900
+20407421
+58000000
+e7e40005
+e7e20005
+6fe24794
+e7e20005
+18a20400
+7005e880
+18420a00
+d8c005f8
+20407421
+204072a2
+d8a004a8
+18007207
+20407d17
+e7e20005
+580003f8
+e7e20005
+204072a2
+204072de
+d8c00900
+d8a005c8
+20407d0a
+585c5c5c
+1fed0400
+1841845c
+d8c008e0
+18007206
+204072e5
+2040729b
+204072a2
+d8c005e8
+d8a004a8
+18007208
+20407422
+58800000
+1fed7e00
+e7e20005
+20407d16
+58000300
+e7e20005
+204072a2
+202072de
+7004a5c0
+6fe084a5
+207a0000
+1fe0ffff
+67e084a5
+d8c00580
+2040707c
+2020f40f
+d8c004a8
+d8a00538
+20207082
+20407193
+6fe084a5
+1fe0ffff
+67e084a5
+d8c00580
+2040707c
+20608000
+202071e4
+18007204
+18c08dfc
+efe20006
+e7e20005
+18c08df8
+c2007423
+20600000
+70476e00
+2020742c
+6fe0c76c
+c0817428
+58363636
+1fed0400
+18418436
+6fe10940
+1fe20c00
+18007204
+204072e5
+2040729b
+204072a2
+6fe10942
+1fe20c00
+d8a004a8
+18007208
+20407422
+6fe10944
+1fe20c00
+18007208
+20407422
+204072a2
+d8a004a8
+58800000
+e7e18005
+6fe0c76e
+e7e08005
+df200007
+20407d17
+58000408
+e7e20005
+2020736e
+6fe0c645
+c001744d
+c000f3be
+20600000
+6fe0c76c
+c0817486
+58363636
+1fed0400
+18418436
+d8c008e0
+18007208
+204072e5
+2040729b
+204072a2
+d8c00900
+d8a004a8
+20407421
+d8c008f0
+20407421
+58000000
+e7e40005
+e7e20005
+6fe24794
+e7e20005
+18a20400
+7005e880
+18420a00
+d8c005f8
+20407421
+204072a2
+d8a004a8
+18007207
+20407d17
+e7e20005
+580003f8
+e7e20005
+204072a2
+204072de
+d8c00900
+d8a005c8
+20407d0a
+585c5c5c
+1fed0400
+1841845c
+d8c008e0
+18007208
+204072e5
+2040729b
+204072a2
+d8c005e8
+d8a004a8
+18007208
+20407422
+58800000
+1fed7e00
+e7e20005
+20407d16
+58000300
+e7e20005
+204072a2
+202072de
+58000000
+67e24794
+2020744f
+58000000
+67e24794
+20207492
+6fe0c645
+c0017490
+c000f3d5
+20600000
+6fe0c76c
+c0817489
+58363636
+1fed0400
+18418436
+d8c008e0
+18007208
+204072e5
+2040729b
+204072a2
+d8c008f0
+d8a004a8
+20407421
+d8c00900
+20407421
+2020745c
+6fe0c645
+c00174a4
+c000f388
+20600000
+58363636
+1fed0400
+18418436
+d8c008e0
+18007208
+204072e5
+2040729b
+204072a2
+6fe1094c
+1fe20c00
+d8a004a8
+20407421
+6fe1094e
+1fe20c00
+20407421
+5862746c
+1fed7e00
+1fe1fe6b
+e7e20005
+d8c005f5
+18007203
+20407422
+58800000
+1fed7e00
+e7e20005
+18007e00
+e7e40005
+58000380
+e7e20005
+204072a2
+204072de
+d8c00900
+d8a005c8
+20407d0a
+585c5c5c
+1fed0400
+1841845c
+d8c008e0
+18007208
+20207477
+6fe340a8
+67e305e9
+6fe30041
+e7e30005
+58363636
+1fed0400
+18418436
+d8c041db
+18007204
+204072e5
+2040729b
+204072a2
+58627461
+1fed7e00
+1fe1fe6b
+67e204a8
+d8c005f5
+18007203
+20407422
+d8c046b2
+df200002
+20407422
+58800000
+1fed7e00
+e7e20005
+df200004
+20407d17
+580002c0
+e7e20005
+204072a2
+204072de
+d8c00900
+d8a005c8
+20407d0a
+585c5c5c
+1fed0400
+1841845c
+d8c041db
+18007204
+20207477
+6fe340a8
+67e305e9
+6fe30041
+e7e30005
+58363636
+1fed0400
+18418436
+d8c041db
+18007204
+204072e5
+2040729b
+204072a2
+58627464
+1fed7e00
+1fe1fe6b
+67e204a8
+d8c005f5
+18007203
+20407422
+58800000
+1fed7e00
+e7e20005
+df200005
+20407d17
+58000280
+e7e20005
+204072a2
+204072de
+d8c00900
+d8a005c8
+20407d0a
+585c5c5c
+1fed0400
+1841845c
+d8c041db
+18007204
+20207477
+d8c00910
+d8a00454
+20407d0c
+58000900
+67e10940
+58000434
+e7e10005
+58363636
+1fed0400
+18418436
+d8c00464
+18007204
+204072e5
+2040729b
+204072a2
+d8a004a8
+6fe10940
+1fe20c00
+20407421
+6fe10942
+1fe20c00
+20407421
+58800000
+1fed7e00
+e7e20005
+df200003
+20407d17
+58000300
+e7e20005
+204072a2
+204072de
+d8c00900
+d8a005c8
+20407d0a
+585c5c5c
+1fed0400
+1841845c
+d8c00464
+18007204
+20207477
+47414030
+6fe0c6b8
+243a7562
+7046ba00
+7046bb00
+20600000
+6fe0c6b8
+207a0000
+6fe0c6bb
+c1018000
+20407597
+20207547
+d8a046bc
+38001abd
+3805b34f
+38099b8a
+380e6562
+e7e48005
+380340b7
+38041efa
+3808aff6
+380cfd41
+e7e48005
+3803d210
+38066cf8
+380b874c
+380f157c
+e7e48005
+3802d4a3
+3807d27d
+38080003
+e7e28005
+20600000
+6fe0c6bb
+c1800000
+6fe0c6ba
+c1800000
+20406e52
+d8a046bc
+18000e0f
+20407032
+180a7e00
+1fe37e00
+e7e10005
+6fe0c6b7
+245a754d
+d8a00628
+d8c046bc
+20407d0a
+d8a00508
+d8c00820
+20407cff
+d8a00548
+20407d22
+70054801
+204075af
+7046ba03
+20600000
+d8a046dc
+d8c00568
+20407cff
+7046bb03
+7046ba00
+20600000
+6fe0887b
+c1800000
+6fe0c6ba
+c1800000
+d8a00628
+d8c046bc
+20407d0a
+d8a00508
+d8c00880
+20407cff
+d8a00548
+20407d22
+70054801
+204075af
+7046ba04
+20600000
+d8a008c0
+d8c00568
+20407d0a
+70087b03
+7046ba00
+20600000
+6fe0c6b8
+207a0000
+6fe0c6ba
+207a0000
+1fe0fe80
+67e0c6ba
+c3838000
+6fe104a5
+203a75a1
+202075a7
+4741c030
+204075bc
+6fe0c6ba
+c001f57b
+c0027591
+20600000
+204075ce
+6fe104a5
+1fe0ffff
+67e104a5
+d8c00628
+2040707c
+20608000
+2020761f
+47424030
+58000100
+67e104a5
+6fe104a5
+207a0000
+1fe0ffff
+67e104a5
+d8c00628
+2040707c
+2020f5b2
+d8c00508
+d8a005c8
+20207cfe
+da200608
+d8a00708
+2040768b
+da200708
+d8a006a8
+20407761
+da2005c8
+da4006a8
+d8a00568
+204076c9
+da200708
+da4006a8
+d8a006e8
+204076c9
+da2005e8
+da4006e8
+d8a00588
+202076c9
+da200608
+d8a006e8
+20407761
+da2006e8
+d8a00708
+20407761
+da200800
+da400708
+d8a00708
+204076c9
+da2005c8
+d8a006e8
+20407761
+d8c006e8
+d8a006a8
+20407d0a
+da2006a8
+20407768
+da2006e8
+da4006a8
+d8a006e8
+20407765
+da2006e8
+da400708
+d8a006e8
+20407765
+d8c005c8
+d8a006a8
+20407d0a
+da2005e8
+d8a00708
+20407761
+da2006a8
+20407768
+da2006a8
+20407768
+da2006a8
+da400708
+d8a006a8
+204076c9
+da200708
+d8a006c8
+20407761
+da2006c8
+20407768
+da2006c8
+20407768
+da2006c8
+20407768
+d8c005e8
+d8a00708
+20407d0a
+da200708
+20407768
+da200708
+da400608
+d8a00608
+204076c9
+da2006e8
+d8a00708
+20407761
+da200708
+da4006a8
+d8a00708
+2040777e
+da200708
+da4006a8
+d8a005c8
+2040777e
+da2006a8
+da4005c8
+d8a00708
+2040777e
+da200708
+da4006e8
+d8a00708
+204076c9
+da200708
+da4006c8
+d8a005e8
+2020777e
+da200548
+d8a00728
+20407761
+da2005c8
+da400728
+d8a006c8
+204076c9
+da200548
+da400728
+d8a00728
+204076c9
+da2005e8
+da400728
+d8a006a8
+204076c9
+da200608
+d8a00728
+20407761
+da200508
+da400728
+d8a006e8
+204076c9
+da200608
+da400728
+d8a00728
+204076c9
+da200528
+da400728
+d8a00708
+204076c9
+da4006c8
+da2006e8
+d8a00728
+2040777e
+da2006c8
+da4006e8
+d8a006c8
+20407765
+da4006a8
+da200708
+d8a006e8
+2040777e
+da2006a8
+da400708
+d8a006a8
+20407765
+da2006a8
+da400728
+d8a006a8
+204076c9
+da200608
+da400548
+d8a00708
+204076c9
+da200708
+da400728
+d8a00608
+204076c9
+da200728
+d8a00728
+20407761
+da200728
+da4006c8
+d8a00708
+204076c9
+da200728
+da4006a8
+d8a006a8
+204076c9
+da2006e8
+d8a005c8
+20407761
+da2005c8
+da400708
+d8a005c8
+2040777e
+d8c005c8
+d8a00728
+20407d0a
+da200728
+20407768
+da200708
+da400728
+d8a00708
+2040777e
+da200708
+da4006e8
+d8a006e8
+204076c9
+da2006e8
+da4006a8
+d8a005e8
+2040777e
+da2005e8
+da4007e0
+d8a005e8
+18002600
+6fe085e8
+2feffe00
+2040f763
+1a626000
+da2005e8
+20407793
+6fe08607
+2e0ffe00
+7920fe07
+67e08607
+20600000
+18a21600
+d8a006c8
+20407d22
+18007e00
+67e206e8
+7006c801
+d8a00648
+20407d24
+d8c007e0
+d8a00688
+20407d0a
+1a220c00
+d8a006a8
+20407d0a
+d8c006a8
+2040779d
+203a76c2
+da2006a8
+da4006c8
+204077a0
+da200688
+da400648
+204077a0
+da2006a8
+da400688
+20407799
+202176b4
+da200688
+da4006a8
+1a220a00
+20407791
+da2006c8
+da400648
+1a420a00
+20407763
+efe08011
+9a60a600
+efe08012
+9a60fe00
+e7e08012
+20207699
+da2006a8
+da400688
+1a220a00
+20407791
+da200648
+da4006c8
+1a420a00
+20407763
+efe08011
+9a60a600
+efe08012
+9a60fe00
+e7e08012
+20207699
+da200648
+19620a00
+204076f2
+da2007e0
+19622400
+19620a00
+2020777e
+18a21600
+18007000
+d8a00648
+20407d24
+d8a0099e
+20407d24
+1a220c00
+70099e00
+58000000
+2040775b
+1a420c00
+2040775f
+18000e00
+d8a00648
+d840099e
+18e22400
+1a4bfe00
+9840a400
+18000400
+18002600
+efe20005
+98002200
+efe20012
+1a627000
+9deffe00
+9a20fe00
+9840fe00
+e7e20005
+1fef0400
+1a60a601
+2a61fe08
+2420f6dd
+18427e00
+e7e20005
+18a08be0
+18e08e01
+28e1fe08
+2420f6d7
+da200648
+19620a00
+202076f2
+4742c030
+18a21600
+1a226000
+da400688
+1a420a00
+20407d1f
+e7e40005
+1a208c2c
+20407d06
+20407d02
+1a422200
+20407768
+da400688
+1e022200
+19620a00
+20407765
+da400688
+1a420a00
+20407d1f
+e7e40005
+1e008c30
+20407d0c
+20407d1f
+1a422200
+20407768
+da400688
+19622200
+1a220a00
+20407765
+da400688
+1a420a00
+1e008c20
+20407d02
+20407d1f
+e7e40005
+1e008c38
+20407d06
+19622200
+1a220a00
+20407765
+da400688
+1a420a00
+1e008c24
+20407d02
+1e008c34
+20407d02
+1e008c34
+20407d03
+1e008c20
+20407d03
+19622200
+1a220a00
+20407765
+da400688
+1a420a00
+1e008c2c
+20407d02
+20407d1f
+e7e40005
+1e008c20
+20407d03
+1e008c28
+20407d03
+19622200
+1a220a00
+2040777e
+da400688
+1a420a00
+1e008c30
+20407d06
+20407d06
+18007e00
+e7e40005
+1e008c24
+20407d03
+1e008c2c
+20407d03
+19622200
+1a220a00
+2040777e
+da400688
+1a420a00
+1e008c34
+20407d02
+1e008c20
+20407d02
+20407d1f
+1e008c30
+20407d03
+19622200
+1a220a00
+2040777e
+da400688
+1a420a00
+1e008c38
+20407d06
+20407d1f
+1e008c24
+20407d02
+20407d1f
+1e008c34
+20407d03
+19622200
+1a220a00
+2020777e
+18007220
+d8a0099e
+98a08a00
+20207d5f
+18007208
+20207111
+1a222400
+202076c9
+18007208
+202070a2
+20407763
+18a22200
+20207769
+20407796
+2a6ffe00
+2020f772
+da4007e0
+1a222600
+1a20a3e0
+20407799
+24610000
+1a622200
+2020777a
+2040777a
+1a222600
+1a20a3e0
+da4007e0
+20407799
+24610000
+1a622200
+2020777a
+1a20a3e0
+da4007e0
+1a220a00
+20207791
+20407791
+2020f788
+18a0a3e0
+da4007e0
+20407799
+24610000
+da4007e0
+18a0a3e0
+1a220a00
+20207791
+18a0a3e0
+da4007e0
+1a220a00
+20407763
+20608000
+18a0a3e0
+da4007e0
+1a220a00
+20207763
+18007208
+202070b0
+18007208
+1a20a21c
+202070bf
+18007208
+18002600
+202070cd
+18007208
+1a20a21c
+1a40a41c
+20207097
+efe40006
+247a0000
+20207085
+1a226000
+1e022200
+efe08011
+2feffe00
+20608000
+20407793
+efe08012
+2fec0000
+2020f7b0
+da2007e0
+1a420a00
+20407763
+efe08012
+9a60fe00
+e7e08012
+1a40a5e0
+1a40a220
+18007209
+204070bf
+202077a1
+204015eb
+20758000
+204077bb
+20407861
+202077f0
+20407811
+20207850
+6fe0c790
+c17f8000
+98000400
+20406069
+6848c790
+20406065
+20000064
+6848c790
+20406050
+202077c5
+47434030
+6fe0c790
+c17f8000
+1fe20400
+20406059
+2420f7d7
+204077e1
+6fe1478c
+79207e0c
+67e1478c
+6fe0c783
+c1000000
+70478300
+6fe0c78f
+67e0c782
+204077e8
+70095b2c
+20207871
+6fe1478c
+793ffe0c
+67e1478c
+6fe0c783
+c1008000
+70478301
+70478200
+204077ea
+70095b2d
+20207871
+6fe0c782
+207a0000
+1fe0ffff
+67e0c782
+247a0000
+70095b10
+20207871
+d8e00007
+202015ba
+d8e00007
+202015be
+6fe1448d
+1a2fa40b
+9a40a400
+20600000
+6fe0c48c
+207a0000
+1fe27200
+6fe1448d
+1fe22400
+1a40a602
+e8408013
+20406069
+2040781a
+1a40a40b
+c20077f5
+20600000
+204077ec
+58000002
+e7e08012
+2040784a
+2020781f
+204077ec
+58000003
+e7e08012
+2040784a
+2020781a
+204077ec
+58000001
+e7e08012
+580000ff
+e7e08005
+2020781a
+204077ec
+df20000b
+1a620c00
+1a420a00
+20207d52
+6fe0c48c
+207a0000
+da200000
+20407824
+1a20a201
+6fe0c48c
+9a267c00
+20628000
+20207814
+1a40a602
+e8408013
+6fe0c09a
+c0044933
+20206065
+1a40a602
+e8408013
+6fe0c09a
+c004493f
+20206069
+1a208e0b
+20407d74
+247a0000
+204077ec
+efe08012
+c001781f
+c001f81a
+c000781a
+c002f838
+2040781f
+1a40a607
+20407cc8
+efe10013
+20407e05
+20407cd4
+58000005
+e7e08012
+1a40a603
+efe10013
+20207848
+2040781a
+1a40a609
+20407cc8
+efe10013
+20407e05
+20407cd4
+1a40a601
+efe08013
+c07ff844
+1fe0ffff
+e7e08013
+203a7801
+58000004
+e7e08012
+1a40a605
+efe10013
+1a208e0b
+20207d66
+58000000
+20207848
+58001000
+1ff07e00
+9a40a400
+20600000
+4743c030
+da200000
+684a4784
+1c422400
+1a427e00
+98467c00
+2441784c
+1a427e00
+184084a0
+184084a0
+98467c00
+24217864
+1a20a201
+1a217e0f
+243a7857
+da200000
+2040786a
+1c427e00
+67e24784
+20600000
+1a227e00
+207a0000
+18408560
+18408560
+793f841c
+604a4784
+2020317b
+70477001
+6fe0c771
+243a786c
+20600000
+70477000
+20600000
+47444031
+2040786b
+1a227e00
+67e20953
+da204772
+20407e25
+6fe20953
+1fe22200
+2020786f
+4744c031
+2040786b
+1a227e00
+67e20953
+da20477a
+20407e25
+6fe20953
+1fe22200
+2020786f
+58000000
+67e4477a
+67e44772
+20600000
+47454031
+6fe0c1db
+247a0000
+da20477a
+20407e3d
+207a0000
+70095200
+20407892
+6fe08952
+203a7887
+20600000
+2040786b
+da20477a
+20407e31
+1fe20400
+2040786f
+4745c031
+18427e00
+207a0000
+c000f8c4
+c00178c9
+c001f8cf
+c006f8ee
+c00778f4
+c007f8f9
+c00878ff
+c009f909
+c00a790b
+c00af90d
+c00b7917
+c00bf91a
+c00c791c
+c00cf91f
+c00f7931
+67e0895b
+204059e1
+243a78c2
+6fe0895b
+c584f8bd
+47464031
+6fe0895b
+c00278d1
+c002f8d4
+c00378df
+c00578e1
+c008f904
+c00df927
+c0097908
+c00ef928
+c00fe025
+c0106027
+c010f933
+c012df55
+20600000
+67e0895b
+20400a61
+2022f8c2
+20400a69
+24628000
+70095201
+2020787a
+6fe1478c
+79207e06
+67e1478c
+70409b03
+20600000
+70478a00
+70409b00
+6fe1478c
+793ffe06
+67e1478c
+20600000
+7041db05
+20600000
+70007d07
+70039e13
+20600000
+70007d17
+d8a003ac
+58000000
+2d0ffe1b
+7920fe01
+e7e08005
+58000000
+e7e10005
+6fe34455
+e7e30005
+20600000
+70007d18
+20600000
+7003a802
+6fe0804c
+c28178e7
+20405a14
+70007d08
+20600000
+793ffe02
+67e0804c
+204056f2
+58000000
+7934fe01
+67e08080
+20600000
+70442701
+70442a00
+6fe1478c
+79207e0b
+67e1478c
+20600000
+6fe1478c
+793ffe0b
+67e1478c
+70442700
+20600000
+70442701
+70442a01
+6fe1478c
+79207e0b
+67e1478c
+20600000
+6fe1478c
+793ffe0b
+67e1478c
+70442700
+20600000
+58000014
+67e102b5
+67e14394
+20202187
+20201f57
+da200000
+20207801
+da200000
+202077fc
+da200000
+204077ec
+efe08012
+c000f914
+c0027914
+c002f914
+20207806
+efe08006
+c17f8000
+20207806
+7043e201
+7041db1b
+20600000
+7043e201
+20600000
+7043e200
+7041db00
+20600000
+6fe1445d
+20407e05
+6fe0c790
+c07ff925
+1fe20400
+20406050
+20407883
+2020148c
+20201f99
+70007d34
+79200003
+24748000
+70464200
+70007d13
+6fe080bd
+793ffe02
+67e080bd
+20600000
+18000e03
+20207d65
+20405a1d
+70007e41
+2020568e
+6fe0c78c
+c4060000
+c4038000
+20207931
+6fe1448a
+1fe08a02
+58000000
+e7e18005
+20600000
+20407e56
+20407989
+207a0000
+6fe1448a
+1fe0a402
+e8408012
+18408401
+e0408012
+e840803f
+18427200
+1fe0a404
+efe08012
+984ffe00
+98c08a00
+1a220c00
+20407d5f
+2040798d
+1fe0ffff
+e8408012
+18408401
+98410400
+e0408012
+20207e54
+20407e56
+20407985
+207a0000
+6fe1448a
+1fe0a402
+e8408012
+184085ff
+e0408012
+e840803f
+18427200
+1fe0a403
+efe08012
+984ffe00
+98c08c00
+18c08c01
+1a220a00
+2020794e
+20407e56
+20407985
+207a0000
+6fe1448a
+e840803f
+18427200
+1fe0a403
+efe08012
+984ffe00
+98c08c00
+18c08c01
+18c22400
+1a220a00
+20407d5f
+20207e54
+20407e56
+20407985
+207a0000
+6fe1448a
+e840803f
+18427200
+1fe0a403
+efe08012
+984ffe00
+98c08c00
+18c08a02
+1a220c00
+1f20f3ff
+20407d5f
+20207e54
+6fe1448a
+1fe08c02
+efe08006
+20600000
+2040798d
+e8408006
+98467e00
+20600000
+6fe1448a
+1fe08c01
+efe08006
+20600000
+4746c031
+6ff08c23
+2feffe03
+2040f99d
+6ff08c23
+67f08c23
+67e089f6
+204079fd
+20407a25
+20407c0e
+20407c56
+202079f5
+47474031
+20406df3
+204079bc
+708c0000
+20002710
+708c18c0
+6ff10050
+793ffe0a
+67f10050
+708c1100
+708c003c
+58000a4f
+67f10c03
+67f10c07
+58000a8f
+67f10c05
+708c1104
+708c0200
+708c23ff
+58000c4b
+d8a00b59
+98a67200
+20207d26
+68488b58
+20206050
+6fe08bfa
+207a0000
+68488b58
+20406059
+2020f99d
+20600000
+700b5702
+58000000
+67e08a92
+67e10b51
+1fe0fe01
+67e10b53
+1fe0fe01
+67e10b55
+d8a00ae6
+58030404
+e7e18005
+58000409
+e7e10005
+d8a00aeb
+38015906
+380610d2
+38090494
+380c0001
+e7e48005
+d8a00b09
+3801570f
+38055c9a
+380a56c6
+380dcdcd
+e7e48005
+38014420
+38065d99
+380a5636
+380c0001
+e7e38005
+d8a00b27
+3801620a
+38040c8c
+380b0333
+380cc0c0
+e7e48005
+38003130
+e7e10005
+580099a4
+67e10a93
+580099ff
+67e10a95
+d8c09aa3
+d8a00a97
+df200013
+20407d5f
+d8c09ab6
+d8a00aaa
+df20003c
+20407d5f
+6fe10b45
+20207e05
+6fe08b47
+207a0000
+67e08acc
+67e08ae5
+20600000
+d8e00000
+20407d74
+247a0000
+6fe08bfb
+247a0000
+6fe08bfa
+245a7cac
+20600000
+6fe089f6
+c2817a00
+20600000
+20407a05
+20407d73
+58000280
+d8e00000
+20207d66
+6fe08bec
+c0817a0a
+700bfb00
+700bfc00
+20600000
+6fe08bfe
+207a0000
+700bfe00
+700bec02
+700bfa01
+20600000
+6fe089f6
+c2807a30
+20600000
+6ff08c24
+c3830000
+69510c03
+6a110c05
+68710c07
+efe10003
+1fec8400
+18518400
+d8c00fff
+98c17200
+1f222200
+efe08003
+e7e08005
+c2007a1e
+60710c07
+622109f8
+20600000
+20600000
+4747c031
+6fe089f6
+c4028000
+d8a00b59
+20407a13
+18427e00
+c0007a2d
+20207a24
+6fe089f8
+1fe67c07
+20610000
+47484032
+793f8023
+6fe08b59
+1fe17e80
+c0407a37
+c0007a3f
+2020137a
+6fe08b59
+1ff1fe00
+1fe37e00
+1fe17e03
+c0007a47
+c000fa4d
+c0017a52
+2020137a
+6fe08b59
+1ff1fe00
+1fe37e00
+1fe17e03
+c0007a53
+c000fa5b
+c0017a60
+2020137a
+6fe08b5a
+c0047a67
+c0037a7d
+c0057ac2
+c0007ad4
+20207a61
+6fe08b5a
+c0017b09
+c000fb0d
+c001fb1e
+20207a61
+20207a61
+6fe08b5a
+c000fb28
+c001fb57
+c002fb81
+c004fb9a
+c005fbb5
+c003fa61
+20207a61
+6fe08b5a
+c0057bc6
+c004fbd8
+c005fbf5
+20207a61
+20207a61
+6ff08c19
+79207e00
+67f08c19
+20207a65
+708c1810
+20600000
+6fe08b59
+c0c07a61
+6fe08b5d
+c0807a61
+6fe08b5e
+c0807a61
+6fe08b5f
+c080fa61
+6fe08b60
+c0807a61
+6fe08b5b
+c0807a61
+6fe08b5c
+c0807a61
+6fe08b57
+c0027a79
+c001fa7b
+20207a61
+da400001
+20207aee
+da400001
+20207aec
+4748c032
+6fe08b5c
+c000fa90
+c0017aa9
+c001faac
+c010fa85
+c0117aba
+20207a61
+700be900
+6fe08b5d
+c0007a8a
+c000fa8d
+20207a61
+6a408abd
+da200abd
+20207c04
+6a408ad6
+da200ad6
+20207c04
+6fe08bfd
+245a7aa1
+58000a97
+68488a97
+67e10bf4
+60488bf6
+6fe08b5f
+98467c00
+24217a9f
+6fe08bf6
+98002400
+6fe10bf4
+1fe0fe01
+98002200
+20207c04
+6fe08b5f
+20207a9a
+6ff08c02
+245a7aa5
+700bfd00
+20600000
+6ff08c02
+79207e07
+67f08c02
+20600000
+58000aaa
+68488aaa
+20207a94
+6fe08b5b
+1fe67c03
+24217a61
+6fe08b5b
+da200ae6
+c0007c02
+79200023
+da200aeb
+c000fc02
+da200b09
+c0017c02
+da200b27
+c001fc02
+20600000
+6fe10b5d
+c000fabe
+6a210a93
+20207c02
+700bfa01
+700bec01
+6a210a95
+20207c02
+6fe08b57
+c0827a61
+6fe08b59
+c0c0fa61
+6fe08b5b
+c0807a61
+6fe08b5c
+c0807a61
+6fe08b5f
+c080fa61
+6fe08b60
+c0807a61
+6fe08b5d
+c0807a61
+6fe08b5e
+c0807a61
+da400001
+20207aec
+6fe08b57
+c0017a61
+6fe08b5b
+c0807a61
+6fe08b5c
+c0807a61
+6fe08b5f
+c0817a61
+6fe08b60
+c0807a61
+6fe08b5e
+c0807a61
+6fe08b59
+c0407ae7
+c040faf2
+c0417af6
+20207a61
+700bef01
+20207af0
+6fe08b5d
+c0807a61
+da400002
+6fe08bed
+c000fae5
+da200b51
+20207c04
+da200b53
+20207c04
+da200b55
+20207c04
+6fe08b57
+c0827a61
+da400002
+20207aec
+6fe08b57
+c0827a61
+6fe08b5d
+c040fb03
+c0417b05
+c041fb07
+1fe17e7f
+c0007aff
+20207a61
+6fe08bf0
+da400002
+c000faee
+20207aec
+6fe08bf1
+20207b00
+6fe08bf2
+20207b00
+6fe08bf3
+20207b00
+700be701
+da200be8
+da400001
+20207c04
+6fe10b5b
+d84001ba
+98467c00
+2422fa61
+6fe08be4
+243a7b1b
+700ba100
+6fe08b5f
+98002400
+da200ba1
+20407c04
+d8a00ba1
+df200008
+20207d17
+700be400
+700ba101
+20207b14
+6fe08b5f
+c080fa61
+700be901
+da400001
+6fe08beb
+c0007b26
+c000fb27
+20207aec
+20207aee
+20207aec
+6fe08b57
+c0827a61
+6fe08b5f
+c0807a61
+6fe08b60
+c0807a61
+6fe08b5c
+c0807a61
+6fe08b5e
+c0807a61
+6fe08b59
+c0007b37
+c000fb44
+c0017b45
+20207a61
+6fe08b5b
+c080fa61
+6ff08c00
+793ffe07
+67f08c00
+700bed00
+700bee01
+6fe08bef
+203a7a65
+700bef00
+700bee00
+700bec02
+20207a65
+20207a61
+6fe08b5b
+c0807a61
+6fe08b5d
+c040fb50
+c0417b53
+c041fb55
+1fe17e7f
+c0007b4e
+20207a61
+700bf000
+20207a65
+700bf100
+700bfe01
+20207a65
+700bf200
+20207b51
+700bf300
+20207b51
+6fe08b5f
+c0807a61
+6fe08b60
+c0807a61
+6fe08b59
+c0007b60
+c000fb6d
+c0017b6e
+20207a61
+6fe08b5b
+c080fa61
+6ff08c00
+79207e07
+67f08c00
+700bed01
+700bec03
+700be500
+20407a65
+20407d73
+58001388
+d8e0000f
+20207d66
+20207a61
+6fe08b5b
+c0807a61
+6fe08b5c
+c0807a61
+6fe08b5d
+c040fb7b
+c0417b7d
+c041fb7f
+1fe17e7f
+c0007b79
+20207a61
+700bf001
+20207a65
+700bf101
+20207a65
+700bf201
+20207a65
+700bf301
+20207a65
+6fe08b59
+c0807a61
+6fe08b5d
+c0807a61
+6fe08b5e
+c0807a61
+6fe08b5f
+c0807a61
+6fe08b60
+c0807a61
+6fe08b5c
+c0807a61
+6fe08b5b
+1fe17e80
+c0807a61
+6fe08b5b
+c0807b98
+700b5702
+6fe08b5b
+67f08c02
+20407a65
+700bfd01
+20600000
+700b5703
+20207b93
+6fe08b57
+c0017a61
+6fe08b59
+c0807a61
+6fe08b5d
+c0807a61
+6fe08b5e
+c0807a61
+6fe08b5f
+c0807a61
+6fe08b60
+c0807a61
+6fe08b5c
+c0807a61
+6fe08b5b
+1fe67c01
+24217a61
+6fe08b57
+c001fbaf
+c0027baf
+20207a61
+6fe08b5b
+c0007bb3
+700b5704
+20207a65
+700b5703
+20207a65
+6fe08b57
+c0827a61
+6fe08b59
+c080fa61
+6fe08b5b
+c0807a61
+6fe08b5c
+c0807a61
+6fe08b5f
+c0807a61
+6fe08b60
+c0807a61
+6fe08b5d
+c0807a61
+6fe08b5e
+c0807a61
+20207a65
+47494032
+700be701
+6fe08b5c
+67e08be8
+6fe08b5d
+1fe67c01
+2042fbd4
+6fe08bec
+c0827a65
+700bec02
+20407a65
+20007530
+20007530
+20600000
+700bfa01
+700bee00
+700bec04
+20600000
+d8a00b61
+20407a13
+700be301
+20407be7
+6fe10b5b
+67e10be1
+20407a65
+6fe0c09a
+c1820000
+6fe08be5
+207a0000
+6fe08b61
+67e0c8ca
+7048ba03
+20600000
+6fe10b5b
+d8400200
+98467c00
+24628000
+6fe10b5d
+d8400000
+98467c00
+24628000
+6fe10b5f
+d8400001
+98467c00
+24628000
+700be501
+20600000
+6fe08b5f
+c0807a61
+6fe08b5b
+c0007bfb
+c000fbfe
+20207a61
+700bea00
+700beb01
+20207a65
+700be601
+700bea01
+700beb00
+20207a65
+ea408011
+1a20a201
+4749c032
+7920000e
+c591fc09
+1a40a401
+1a43a400
+62210a90
+62408a92
+20207c0e
+d8e00000
+20207c4e
+474a4032
+6ff08c24
+c3800000
+6fe08a92
+207a0000
+1fe27200
+98000400
+6fe10b5f
+1fe67c40
+20217c1c
+1f267c40
+20217c20
+18007240
+20207c20
+9f267c00
+20217c20
+98007200
+67e08a92
+6fe08a92
+9f267e00
+67e08a92
+1f20ffff
+67e089fa
+c591fc32
+1fe37e00
+1f20ffff
+67e089fa
+c5877c32
+793f800e
+e0408005
+58000003
+e7e08005
+1f20f3ff
+1f227e00
+2422fc32
+1f20f201
+6fe10a90
+1fe20c00
+efe08006
+e7e08005
+c591fc39
+58000000
+e7e08005
+c2007c34
+18c27e00
+67e10a90
+580009fa
+67f10c09
+d8e00000
+20407c4e
+6fe08a92
+247a0000
+6fe08bec
+c1808000
+700bec02
+20600000
+d8e00001
+da200a3b
+62310c0b
+1f20ffff
+e7e08011
+efe08006
+e7e08005
+c2007c4b
+58000000
+f9207e00
+67f08c18
+20600000
+d8e00002
+da200a45
+62310c0d
+20207c49
+474ac032
+6fe08bf9
+207a0000
+6fe08bfa
+203a7c7a
+6fe08bec
+c001fcb4
+c0817c7a
+6fe08bee
+243a7c7a
+20407c62
+20207c6d
+6ff08c24
+c3808000
+6fe08bf9
+c4008000
+6fe08bf9
+793ffe01
+67e08bf9
+6fe08bf7
+207a0000
+c0087c9c
+2020137a
+6ff08c24
+c3810000
+6fe08bf9
+c4010000
+6fe08bf9
+793ffe02
+67e08bf9
+6fe08bf8
+207a0000
+c0107c7d
+c010fc98
+c0117ca0
+2020137a
+d8a00bff
+df200008
+20207d17
+6fe08be7
+68488be9
+98417e00
+203a7c94
+68488bea
+9840fe00
+c000fc85
+20207c94
+700bf800
+6fe08c00
+c0017c95
+c001fc95
+6fe08c00
+67e08bff
+6fe08c01
+e7e08005
+6fe08c03
+e7e08005
+6fe08c05
+e7e08005
+df200004
+d8c00bff
+20207c52
+700bf800
+df200008
+d8c00bff
+20207c52
+700bf800
+df200003
+d8c00c1f
+20207c52
+700bf700
+df200008
+d8c00c0f
+20207c46
+700bf800
+df200002
+d8c00c2f
+20207c52
+6fe08bec
+c0017ca7
+20600000
+6ff08c00
+79207e07
+67f08c00
+700bfc01
+20600000
+6fe08bec
+c1018000
+c0017cb0
+20600000
+6fe08bfc
+207a0000
+700bfb01
+20207cb7
+d8e0000f
+20407d74
+247a0000
+6ff08c00
+c4038000
+708c00fc
+20007530
+708c003c
+20600000
+1f267c00
+20628000
+1fe37e00
+c2007cbf
+20600000
+18007e01
+1f267c00
+20628000
+1fe3fe00
+c2007cc5
+20600000
+60a1097d
+604c0964
+6162096c
+20407cd0
+60c1097b
+67210987
+60e10985
+20600000
+62220970
+62420974
+62618978
+20600000
+6fe1097d
+98000a00
+684c0964
+6962096c
+20407cde
+6f210987
+68e10985
+6fe1097b
+98000c00
+20600000
+6a220970
+6a420974
+6a618978
+20600000
+6fe1097d
+1fe20a00
+20600000
+6fe1097b
+1fe20c00
+20600000
+18a27e00
+67e1097d
+20600000
+18c27e00
+67e1097b
+20600000
+18a27e00
+67e10959
+18c27e00
+67e10957
+20600000
+6fe10959
+1fe20a00
+6fe10957
+1fe20c00
+20600000
+98462200
+20610000
+da200100
+9a20fe00
+98462200
+20600000
+20407d0a
+20407d0a
+20207d0a
+20407d06
+20407d06
+efe20006
+e7e20005
+20600000
+efe40006
+e7e40005
+20600000
+20407d0c
+20407d06
+20407d06
+20407d06
+20207d06
+1fe0ffff
+20000026
+243a7d0e
+20600000
+df20000a
+20002ee0
+c2007d13
+20600000
+18007203
+18007e00
+e7e40005
+c2007d18
+20600000
+20407d1c
+18007e00
+e7e40005
+20600000
+18007e00
+e7e20005
+20600000
+18007204
+20207d17
+18007208
+20207d17
+1f227e00
+207a0000
+58000000
+e7e08005
+c2007d29
+20600000
+df200020
+d8a0098e
+20207d26
+efe20013
+e8420011
+9842fe00
+e7e20005
+1a20a204
+1a60a604
+c2007d2f
+20600000
+474b4032
+1f227e00
+1fe67c01
+20610000
+9a20a400
+1a40a5ff
+1f237200
+e8408011
+efe08012
+e7e08011
+e0408012
+1a40a5ff
+1a20a201
+c2007d3e
+20600000
+1fef0400
+20407d4c
+18508400
+1ff07e00
+9841fe00
+20600000
+1ff10c00
+18d08c00
+1ff0fe00
+1ff07e00
+98c1fe00
+20600000
+1f227e00
+207a0000
+1f20f3f8
+20417d06
+20628000
+20217d54
+1f20f208
+1f20f3fc
+20417d03
+20628000
+20217d59
+1f20f204
+20207d5f
+1f227e00
+207a0000
+efe08006
+e7e08005
+c2007d61
+20600000
+58000000
+1c430400
+604a409c
+d8a041aa
+98000400
+18e3fe00
+98a08a00
+e0410005
+474bc032
+20600000
+d9600800
+19701600
+9960fe00
+20600000
+d8e00000
+474c4033
+684a409c
+1c437e00
+67e2409c
+98467c00
+24417d6f
+98461600
+19620400
+d8c041aa
+18c20a00
+df200010
+efe10006
+98467e00
+20217d83
+18007e00
+e7e10005
+c2007d7f
+d8c041aa
+18e3fe00
+98c08c00
+efe10006
+20600000
+98408400
+18427200
+6fe10163
+9f267e00
+20610000
+1fe67e00
+18510400
+18408401
+18500400
+98418400
+20600000
+20407d97
+20207da4
+78547c00
+98467e00
+20217d9c
+78347c00
+1fe67e00
+c4078000
+1fe22800
+d8410000
+6fe10163
+98467e00
+9a80fe00
+793ffe40
+20600000
+68490163
+98000c00
+1ff17e00
+984ffe00
+98c0fe00
+20600000
+1fed7e00
+1ff27e00
+6849c174
+9846fc00
+20407def
+18078400
+20600000
+68490163
+9846fc00
+20407dec
+1ff07e00
+18070400
+98418400
+20600000
+d8400000
+18422800
+efe08003
+20407dc4
+1a820400
+20407dfe
+da40000a
+9a4ffe00
+9840fe00
+1fe20400
+c2007db9
+20600000
+d840003a
+98467c00
+24217dcd
+d8400061
+98467c00
+20217dd0
+d8400037
+98467e00
+20600000
+d8400030
+98467e00
+20600000
+d8400057
+98467e00
+20600000
+18426000
+580001ff
+18002400
+1fe92200
+1a232200
+9a22a200
+2a2ffe00
+7920fe09
+18430400
+2feffe00
+79208407
+1fe37e00
+1a40a401
+2a400e00
+2420fdd6
+e0408005
+c2007dd6
+1e020400
+20600000
+58000000
+1f222200
+e8410006
+9840fe00
+c2007de8
+9a26fc00
+20407def
+1807fe00
+20600000
+207a8000
+20207def
+efe08011
+e8408012
+98467c00
+24628000
+1a20a201
+1a40a401
+c2007df1
+18007c00
+20600000
+98467c00
+24610000
+18427e00
+20600000
+9840fe00
+98460400
+98467e00
+20600000
+df200200
+d8a04000
+20207d17
+207a0000
+1fe27a00
+6ff1010e
+243a7e07
+20600000
+70820301
+20600000
+67f10205
+6ff08203
+79207e04
+67f08203
+20600000
+67f10207
+6ff08203
+79207e06
+67f08203
+20600000
+67f10205
+70820330
+20600000
+6ff08043
+79207e04
+67f08043
+20600000
+6ff08043
+793ffe04
+67f08043
+20600000
+6ff1010e
+d8400200
+98467c00
+20600000
+474cc033
+e8440011
+18417eff
+243a7e2b
+184cfe00
+e7e40011
+1a20a207
+efe08011
+243a137a
+6fe0895b
+e7e08011
+20600000
+474d4033
+df200008
+efe40011
+207a0000
+efe08011
+243a7e3a
+1a20a201
+c2007e35
+2020137a
+d8400000
+e0408011
+20600000
+efe40011
+20600000
+efe08011
+20600000
+efe10011
+20600000
+d8400000
+6fe08006
+c2007e44
+18408401
+c2007e44
+18427e00
+20600000
+98467c00
+24610000
+18427e00
+20600000
+18007dff
+20600000
+18007c01
+20600000
+18007c00
+20600000
+78347c00
+20600000
+78547c00
+20600000
+78367c00
+20600000
+78567c00
+20600000
+7838fc00
+20600000
+58000001
+20600000
+58000000
+20600000
+1f267c00
+20628000
+e8408006
+9840fe00
+c2007e64
+20600000
+1f227e00
+207a0000
+18c27e00
+9f20fe00
+1fe0ffff
+1fe20c00
+efe08006
+18c08dfe
+e7e08005
+c2007e6e
+20600000
+19622400
+da609420
+18007224
+18005600
+18006e00
+20407e88
+52207e00
+9d60d600
+50407e00
+9ee0ee00
+1a40a404
+1a60a602
+c2007e78
+55607e00
+d8400024
+20407ed4
+e7e20005
+56e07e00
+20407ed4
+e7e20005
+20600000
+edc10012
+eb808013
+20407eb9
+98482200
+eb808006
+20347e8f
+1b863800
+1a408c02
+edc10006
+20407eb9
+98483000
+52207e00
+9b062200
+edc10012
+55c07e00
+98483000
+edc10006
+eb808013
+20407eb9
+98480400
+53007e00
+98408400
+20600000
+efe20012
+ea220013
+9a285600
+ea220006
+52206e00
+1a408c04
+efe20006
+9a280400
+55607e00
+98465600
+efe20012
+9ee86e00
+efe20006
+ea220013
+9a287e00
+9ee0ee00
+20600000
+1ff07e00
+1feb7e00
+20600000
+1fed7e00
+20207eb1
+9feffe00
+1ff1fe00
+1fe97e00
+20600000
+55c07e00
+53800400
+20600000
+c40f8000
+18000400
+79200420
+184085ff
+9842fe00
+1fe0fe01
+20600000
+98002200
+db000000
+7920301e
+da400000
+df200010
+1b027e00
+9a40fe00
+1a432400
+9a267e00
+2022fece
+20217ed1
+1fe62200
+1b027e00
+9a41a400
+1b0b3000
+c2007ec8
+20600000
+793f802c
+c31ffed8
+7920002c
+1fe67e00
+284c003f
+2020fedc
+7940002c
+18460400
+9846fc00
+20407dec
+c6960000
+1fe67e00
+20600000
+20407ee7
+20407eea
+20407eec
+20407efb
+20407f0a
+20207f17
+78347c00
+d8a00a01
+20207e73
+78547c00
+20207e73
+6fe20a01
+684a0a09
+9840fe00
+20407ebc
+98000400
+984fd600
+6fe20a05
+684a0a0d
+98467e00
+20407ebc
+98000400
+984ffe00
+9d60fe00
+67e40a11
+20600000
+da400a01
+da600a09
+20407e9f
+55607e00
+1fe67e00
+1ff07e00
+1febfe00
+684c0a11
+9848fc00
+da210000
+20407dec
+9a20fe00
+20407ec3
+1a425600
+20600000
+184f7e00
+9a4fa200
+1a427e00
+984f8400
+1a307e00
+1ff07e00
+98408400
+56e07e00
+1fe67e00
+1ff07e00
+1fe3fe00
+9848fc00
+20207dec
+1fe32600
+9fef8400
+58010000
+98467e00
+20407ec3
+1a427e00
+9d6f8400
+58000000
+79207e1c
+9848fc00
+20407def
+18078400
+58001000
+98466e00
+20600000
+20407f2c
+20407f30
+20407f37
+20407f3e
+20407f4d
+20207f58
+6fe089f6
+20407eb5
+67e089f8
+20600000
+98002600
+9fef8400
+efe08006
+20407eb5
+e7e08005
+9a60a200
+20600000
+9feffe00
+9840a400
+1a227e00
+9a2f8400
+1a43fe00
+98460400
+20600000
+58400000
+9846fc00
+20407dec
+67e109fc
+1a307e00
+1feb7e00
+9846fc00
+20407dec
+e7e10005
+1a4d7e00
+1fe37e00
+9846fc00
+20407dec
+e7e10005
+20600000
+1a707e00
+1feb7e00
+9a46fc00
+20407dec
+67e10a02
+6fe089f6
+20407eb3
+9a26fc00
+20407dec
+e7e10005
+20600000
+6fe089f9
+20407eb0
+9a46fc00
+20407dec
+67e10a06
+6fe089f7
+20407eb3
+9a26fc00
+20407dec
+e7e10005
+20600000
+d8a00a2a
+df200002
+20407d17
+d8e00004
+20407f83
+20407f86
+20407f89
+20407f92
+20407f98
+20407f9e
+20407fa4
+20407faa
+19609620
+18e08fff
+2422ff67
+6fe20a2a
+d8c00100
+98c0d600
+6fe20a2e
+9fe80400
+58010000
+98467e00
+20407ec3
+1a427e00
+9d680400
+58000000
+79207e1c
+20407ed4
+d8401000
+98467e00
+1fe67e00
+20600000
+19620c00
+df200008
+20207de6
+98002400
+df200008
+20207de6
+9a40a600
+684889f9
+984f8400
+6fe089f8
+9a4ffe00
+9840fe00
+1ff1fe00
+1fe92200
+20600000
+6fe109fe
+9a6f8400
+6fe109fc
+9a2ffe00
+98462400
+20600000
+6fe109fe
+9a2f8400
+efe10006
+9a6ffe00
+98462200
+20600000
+6fe089f8
+20407fc5
+9a20ee00
+19622600
+d8a00a0a
+20207fc8
+6fe089f9
+20407fc5
+9a20ee00
+1960a610
+d8a00a1a
+20207fc8
+52406e00
+6a410a02
+6a610a06
+da200a0a
+ddc00a1a
+d8a00a2a
+20407fb6
+20407fb6
+6a410a04
+6a610a08
+20407fb6
+20207fb6
+efe20011
+18c22200
+9a485600
+efe2002e
+18c25c00
+9a687e00
+9d60fe00
+1fed7e00
+1ee20400
+20407ed4
+ed620005
+9d667e00
+1fe63000
+e3020005
+20600000
+9a480400
+50407e00
+20207eb6
+d9000004
+ddc09400
+dd600000
+df200008
+efe10013
+18c22600
+9ee67e00
+eb80802e
+18c25c00
+53800400
+98487e00
+9d60d600
+c2007fcc
+1d6cfe00
+1fe37e00
+e7e20005
+1a60a7f0
+190091ff
+2422ffca
+20600000
+58000000
+79207e13
+67e4009f
+20600000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000839
Index: program/app.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app.prog	(working copy)
@@ -0,0 +1,591 @@
+app_init:
+	bpatch patch15_6,mem_patch15
+	fetch 1,mem_device_option
+	branch app_init,blank				/* wait ram to be initialized */
+	beq dvc_op_dongle,dongle_init
+	beq dvc_op_antilost,antilost_init
+	beq dvc_op_shutter,shutter_init
+	beq dvc_op_module,module_init
+	beq dvc_op_car,car_init
+	beq dvc_op_remote_car,remote_car_init
+	beq dvc_op_hci_boot,hci_init
+	beq dvc_op_ali_mesh,ali_mesh_init
+	beq dvc_op_test,test_init
+	beq dvc_op_mouse,mouse_init
+	rtn
+	
+app_lpm_init:
+	jam 0,mem_tester_emulate
+	jam 0,mem_debug_config
+	jam 0, mem_lch_code
+	setarg 0
+	store 5,mem_sp_state_start
+	fetch 1,mem_device_option
+	branch app_lpm_init,blank				/* wait ram to be initialized */
+	beq dvc_op_module,module_lpm_init
+app_lpm_init0:
+	rtn
+
+app_param_init:
+	rtn wake
+	call app_read_efuse_sys_config
+	call app_read_efuse_dig_aon_vsel
+	call app_read_efuse_syn_afc_cfg1
+	call app_read_efuse_rf_ldo_cfg1
+	call app_read_efuse_rc_cal
+	call app_read_efuse_agc
+	fetch 1,mem_device_option
+	beq dvc_op_shutter,shutter_default_init
+	beq dvc_op_dongle,dongle_default_init
+	beq dvc_op_mouse,mouse_default_init
+	beq dvc_op_remote_car,remote_car_default_init
+	rtn
+
+app_sys_param_init:	
+	jam 0xff,mem_rf_init_data
+	setarg mem_rf_init_data
+	store 2,mem_rf_init_ptr
+	//sys init
+	jam 0xff,mem_ui_button_gpio
+	jam 0x88,mem_lpm_xtal_ib
+	jam 0xce,mem_lpm_padding
+	rtn
+
+
+	
+app_process_idle:
+	call idle_read_adc_wait
+	call ui_dispatch
+	call check_51cmd
+	call app_process_bb_event
+	fetch 2,mem_cb_idle_process
+	branch callback_func
+	
+app_process_bt:
+	fetch 2,mem_cb_bt_process
+	branch callback_func
+	
+app_process_ble:
+	fetch 2,mem_cb_le_process
+	branch callback_func
+
+app_process_bb_event:
+	bpatch patch15_7,mem_patch15
+	//return if c51 need to process bb event
+	arg mem_ipc_fifo_bt2c51,rega
+	call fifo_out
+	rtn blank
+	//reaching here mains c51 cannot get bb event.
+	copy pdata,regc
+	call app_event_normal_process
+	branch app_process_bb_event_priority
+	
+app_discard_event:
+	arg 0,regc
+	rtn
+
+//************************************************//
+//*APP BB EVENT NORMAL PROCESS**//
+//************************************************//
+app_event_normal_process:
+	beq BT_EVT_BB_CONNECTED,app_evt_bt_conn
+	beq BT_EVT_BUTTON_LONG_PRESSED,app_evt_button_long_pressed
+	beq BT_EVT_SETUP_COMPLETE,app_evt_setup_complete
+	beq BT_EVT_HID_HANDSHAKE,app_evt_hid_handshake
+	beq BT_EVT_HID_CONNECTED,app_bb_event_hid_connected
+	beq BT_EVT_RECONN_FAILED,app_bb_event_reconn_failed
+	beq BT_EVT_BB_DISCONNECTED,app_bb_event_bb_disconn
+	beq BT_EVT_RECONN_PAGE_TIMEOUT,app_bb_event_reconn_failed	
+	beq BT_EVT_LE_CONNECTED,app_le_event_bb_connected
+	beq BT_EVT_LE_DISCONNECTED,app_le_event_bb_disconn
+	beq BT_EVT_RECONN_STARTED,app_event_reconn_start
+	beq BT_EVT_ENTER_SNIFF,app_event_enter_sniff
+	beq BT_EVT_EXIT_SNIFF,app_event_exit_sniff
+	
+	beq BT_EVT_ML2CAP_CONN_REFUSED,app_event_ml2cap_conn_refused
+	beq BT_EVT_LINKKEY_GENERATE,app_event_linkkey_generate
+	beq BT_EVT_SWITCH_FAIL_MASTER,app_event_switch_fail_master
+	beq BT_EVT_SWITCH_SUCCESS_MASTER,app_event_switch_success
+	rtn
+
+
+app_evt_bt_conn:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_CONNECTED,pdata
+	store 2,mem_ui_state_map
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set0 APP_DISC_BY_BUTTON ,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	branch check_51cmd_stop_discovery
+
+app_event_switch_success:
+	jam 0,mem_switch_fail_master_count
+	rtn	
+
+app_event_switch_fail_master:
+	fetch 1,mem_switch_fail_master_count
+	increase 1,pdata
+	store 1,mem_switch_fail_master_count
+	sub pdata,1,null
+	branch app_bt_role_switch,positive
+	jam 0,mem_switch_fail_master_count
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_SWITCH_FAIL,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	branch app_bt_disconnect
+	
+app_process_bb_event_priority:
+	fetch 2,mem_cb_bb_event_process
+	branch callback_func
+
+app_check_wake_lock:
+	fetch 2,mem_cb_check_wakelock
+	branch callback_func
+	
+app_will_enter_lpm:
+	fetch 2,mem_cb_before_lpm
+	branch callback_func
+
+app_event_linkkey_generate:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_AFTER_PAIRING ,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	branch app_bt_store_reconn_info
+	
+app_event_reconn_start:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_RECONNECT,pdata
+	store 2,mem_ui_state_map
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_AFTER_RECONN,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+app_evt_setup_complete:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_SETUP_COMPLETE,pdata
+	store 2,mem_ui_state_map
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_AFTER_SETUP_DONE,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+app_evt_hid_handshake:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_HID_HANDSHAKE,pdata
+	store 2,mem_ui_state_map
+	rtn
+	
+app_event_enter_sniff:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_SNIFF,pdata
+	store 2,mem_ui_state_map
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_AFTER_SNIFF,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+	
+app_event_exit_sniff:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_SNIFF,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+app_le_event_bb_connected:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BLE_CONNECTED,pdata
+	store 2,mem_ui_state_map
+	rtn
+	
+app_le_event_bb_disconn:
+	jam 0,mem_le_l2cap_att_states
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BLE_CONNECTED,pdata
+	store 2,mem_ui_state_map
+	branch app_lpm_mult_disable
+	
+app_bb_event_hid_connected:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_HID_CONN,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+app_evt_button_long_pressed:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_BY_BUTTON,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+	
+app_event_ml2cap_conn_refused:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_L2CAP_REFUSED,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	branch  app_bt_disconnect
+
+
+app_evt_timer:
+	store 1,mem_app_evt_timer_count
+app_evt_100ms_loop:
+	bpatch patch16_0,mem_patch16
+	fetch 1,mem_app_evt_timer_count
+	rtn blank
+	increase -1,pdata
+	store 1,mem_app_evt_timer_count
+	call ui_button_polling
+	call app_lpm_wake_auto_lock_timer
+	call app_unsniff_delay_timer
+	call app_discovery_timer
+	call flash_write_spi_sm_timer
+ifdef SPI2	
+	call flash_write_spi2_sm_timer
+endif	
+	call adc_wait_timer
+	fetch 2,mem_cb_event_timer
+	call callback_func
+	branch app_evt_100ms_loop
+
+
+//regc:timer addr
+//regb:timer up call back fuction
+timer_single_step:
+	ifetch 1,regc
+	rtn blank
+	pincrease -1
+	istore 1,regc
+	nrtn blank
+	copy regb,pdata
+	branch callback_func
+
+//regc:timer addr
+//regb:timer up call back fuction
+timer_single_step_2B:
+	ifetch 2,regc
+	rtn blank
+	pincrease -1
+	istore 2,regc
+	nrtn blank
+	copy regb,pdata
+	branch callback_func
+	
+app_power_timer:
+	fetcht 2,mem_power_param_ptr
+	add temp,power_timer_offset,regc
+	arg app_power_timer_timeout,regb
+	branch timer_single_step
+	
+app_power_timer_timeout:
+	call app_got_power_state_common
+	beq POWER_STARTING,app_enter_power_stanby_state
+app_enter_power_off_state:
+	branch app_enter_hibernate
+app_enter_power_stanby_state:
+	setarg POWER_STANDBY
+	istore 1,regc
+	add temp,power_standby_cb_offset,regb
+app_power_cb_common:
+	ifetch 2,regb
+	branch callback_func
+
+app_unsniff_delay_timer:
+	arg mem_unsniff2sniff_timer_count,regc
+	arg app_unsniff_delay_timeout,regb
+	branch timer_single_step
+	
+app_unsniff_delay_timeout:
+	call context_check_idle
+	branch app_bt_enter_sniff,zero
+	rtn
+
+
+app_discovery_timer:
+	arg mem_discovery_timeout_timer_count,regc
+	arg app_discovery_timeout,regb
+	branch timer_single_step_2B
+	
+app_discovery_timeout:
+	call app_bt_stop_discovery
+	call app_led_off
+	fetch 2,mem_cb_discovry_timeout
+	branch callback_func
+
+	
+app_bb_event_reconn_failed:
+	call app_disconn_reason_flag_clear
+app_clear_reconnect_flag:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_RECONNECT,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+app_bb_event_bb_disconn:
+	jam 0,mem_unsniff2sniff_timer_count
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_RECONNECT,app_bb_event_bb_reconn_disconn
+	isolate0 UI_STATE_BT_SETUP_COMPLETE,pdata
+ 	call app_discard_event,true
+app_bb_event_bb_reconn_disconn:
+	bpatch patch16_1,mem_patch16
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_CONNECTED,pdata
+	set0 UI_STATE_BT_SETUP_COMPLETE,pdata
+	set0 UI_STATE_BT_HID_CONN,pdata
+	set0 UI_STATE_BT_HID_HANDSHAKE,pdata
+	set0 UI_STATE_BT_RECONNECT,pdata
+	store 2,mem_ui_state_map
+	branch app_lpm_mult_disable
+	
+app_bb_hibernate:
+	call app_disconn_reason_clear
+	branch app_enter_hibernate
+
+	
+app_disconn_reason_clear:
+	setarg 0
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason
+	rtn
+app_disconn_reason_flag_clear:
+	setarg 0
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+app_disconn_reason_collect_bt:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason
+	setarg 0
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+	
+app_disconn_reason_collect_ble:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_BLE,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason
+	setarg 0
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+	
+//************************************************//
+//********APP SHARED FUNCSIONS*******//
+//************************************************//
+
+
+app_check_sniff:
+	fetch 1,mem_ui_state_map
+	isolate1 UI_STATE_BT_SNIFF,pdata
+	rtn
+
+//*****************************************//
+//*****************API********************//
+//*****************************************//
+app_start_auto_sniff:
+	fetch 1,mem_unsniff2sniff_timer
+	store 1,mem_unsniff2sniff_timer_count
+	rtn
+	
+app_get_lpm_wake_lock:
+	arg wake_lock_app,queue
+	branch lpm_get_wake_lock
+
+app_put_lpm_wake_lock:
+	arg wake_lock_app,queue
+	branch lpm_put_wake_lock
+	
+app_lpm_wake_auto_lock:
+	jam  LPM_WAKE_UP_DELAY_TIMER,mem_wake_up_delay_timer
+	branch app_get_lpm_wake_lock
+	
+app_lpm_wake_auto_lock_timer:
+	arg mem_wake_up_delay_timer,regc
+	arg app_put_lpm_wake_lock,regb
+	branch timer_single_step
+
+app_l2cap_flow_control_enable:
+	jam L2CAP_FLOW_CTRL_ENABLE,mem_l2cap_flow_ctrl_flag
+	rtn
+
+app_l2cap_flow_control_disable:
+	jam L2CAP_FLOW_CTRL_DISABLE,mem_l2cap_flow_ctrl_flag
+	rtn
+	
+app_bt_set_pincode:
+	jam BT_CMD_SET_PIN_CODE,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_bt_role_switch:
+	jam BT_CMD_ROLE_SWITCH,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_bt_start_reconnect:
+	bpatch patch16_2,mem_patch16
+	fetch 1,mem_app_connection_options
+	store 1,mem_connection_options
+	jam APP_FLAG_RECONNECT,mem_reconnect_flag
+	jam BT_CMD_RECONNECT,mem_fifo_temp
+	branch ui_ipc_send_cmd	
+	
+app_bt_reconnect_cancel:
+	jam BT_CMD_BB_RECONN_CANCEL,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_bt_disconnect:
+	jam BT_CMD_DISCONNECT,mem_fifo_temp
+	branch ui_ipc_send_cmd	
+
+app_bt_start_discovery_short:
+	fetch 2,mem_discovery_timeout
+	store 2,mem_discovery_timeout_timer_count
+app_bt_start_discovery_led_blink:
+	call app_led_start_blink
+app_bt_start_discovery:
+	jam BT_CMD_START_DISCOVERY,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_bt_stop_discovery:
+	setarg 0
+	store 2,mem_discovery_timeout_timer_count
+	jam BT_CMD_STOP_DISCOVERY,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_start_direct_adv:
+	jam BT_CMD_START_DIRECT_ADV,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_ble_stop_direct_adv:
+	jam BT_CMD_STOP_DIRECT_ADV,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_stop_adv:
+	jam BT_CMD_STOP_ADV,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_start_adv:	
+	jam BT_CMD_START_ADV,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_start_scan:
+	jam BT_CMD_LE_START_SCAN,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_stop_scan:
+	jam BT_CMD_LE_STOP_SCAN,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_start_conn:
+	jam BT_CMD_LE_START_CONN,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_disconnect:
+	jam BT_CMD_LE_DISCONNECT,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_led_start_blink:	
+	jam BT_CMD_LED_BLINK,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_led_on:
+	jam BT_CMD_LED_ON,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_led_stop_blink:
+app_led_off:
+	jam BT_CMD_LED_OFF,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_enter_hibernate:
+	jam BT_CMD_ENTER_HIBERNATE,mem_fifo_temp 
+	branch ui_ipc_send_cmd
+	
+app_bt_sniff_exit:
+	jam BT_CMD_EXIT_SNIFF,mem_fifo_temp
+	branch  ui_ipc_send_cmd
+	
+app_bt_enter_sniff:
+	jam BT_CMD_ENTER_SNIFF,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_ble_store_reconn_info:
+	jam BT_CMD_STORE_RECONN_INFO_LE,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_bt_store_reconn_info:
+	jam BT_CMD_STORE_RECONN_INFO_BT,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_store_reconn_info:
+	jam BT_CMD_STORE_RECONN_INFO,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_lpm_mult_enable:
+	set1 mark_lpm_mult_enable,mark
+	rtn
+
+app_lpm_mult_disable:
+	set0 mark_lpm_mult_enable,mark
+	rtn
+
+
+/*
+
+mem_power_param struct
+{
+	usigned char     mem_power_state
+	usigned char     mem_power_timer
+	usigned char	 mem_power_off_timeout
+	usigned char	 mem_power_starting_timeout
+	usigned long	 mem_power_off_cb
+	usigned long	 mem_power_starting_cb
+	usigned long	 mem_power_standby_cb
+	usigned long 	 mem_ui_butten_up_cb
+}
+    	functions:power state switching by mem_app_power_timer timeout or by button_long_pressed event
+    	(power off -> power starting->power standby->power off) and power timer initialization 
+ input parameters:mem_power_param_ptr should be point to the variable(mem_power_param) address where the input parameters stored in with its format
+output parameters:switched power state will be stored in variable mem_power_state*/
+app_button_long_pressed:
+	call app_got_power_state_common
+	beq POWER_STANDBY,app_power_shutting_down
+app_power_starting:
+	setarg POWER_STARTING
+	istore 1,regc
+	add temp,power_starting_timeout_offset,rega
+	add temp,power_starting_cb_offset,regb
+app_power_common:
+	ifetcht 1,rega
+	increase 1,regc
+	istoret 1,regc
+	branch app_power_cb_common
+	
+app_power_shutting_down:
+	setarg POWER_OFF
+	istore 1,regc
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,app_power_off_end
+	call le_send_terminate_ind_user_terminated
+	call app_ble_disconnect
+app_power_off_end:
+	fetcht 2,mem_power_param_ptr
+	add temp,power_off_timeout_offset,rega
+	add temp,power_off_cb_offset,regb
+	branch app_power_common
+	
+app_got_power_state_common:
+	fetcht 2,mem_power_param_ptr
+	add temp,power_state_offset,regc
+	ifetch 1,regc
+	rtn
+
+app_event_button_up:
+	call app_got_power_state_common
+	bne POWER_OFF,app_power_release
+	branch app_enter_hibernate
+app_power_release:
+	add temp,ui_butten_up_cb_offset,regb
+	branch app_power_cb_common
+
+
+app_hid_connected:
+	setarg HID_HANDSHAKE_TIMEOUT
+	store 1,mem_hid_handshake_timer_count
+	rtn
+
+
Index: program/app_antiLost.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_antiLost.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_antiLost.prog	(working copy)
@@ -0,0 +1,592 @@
+ifdef COMPILE_ANTILOST
+antilost_init:
+	rtn wake	
+	setarg antilost_le_before_hibernate
+	store 2,mem_cb_before_hibernate
+	setarg keyscan_process_lpm_before
+	store 2,mem_cb_before_lpm
+	setarg antilost_idle_process	//
+	store 2,mem_cb_idle_process
+	setarg antilost_le_conn_process	//
+	store 2,mem_cb_le_process
+	setarg antilost_bb_event_process 
+	store 2,mem_cb_bb_event_process
+	setarg antilost_le_bb_event_timer
+	store 2,mem_cb_event_timer
+	setarg antilost_le_notification
+	store 2,mem_cb_ble_transmit
+	setarg antilost_lpm_lock_process
+	store 2,mem_cb_check_wakelock
+	setarg antilost_le_receive_data_process
+	store 2,mem_cb_att_write
+	bpatch patch16_3,mem_patch16
+	
+	call antilost_buzzer_pwm_init
+	call antilost_set_ble_version
+	call keyscan_key_init
+	call antilost_adc_init
+	call ui_led_init_global
+	call ui_button_init
+	setarg antilost_key_up_down
+	store 2,mem_cb_antl_key
+	setarg antilost_power_off_cb
+	store 2,mem_antl_power_off_cb
+	setarg antilost_power_starting_cb
+	store 2,mem_antl_power_starting_cb
+	setarg antilost_power_standby_cb
+	store 2,mem_antl_power_standby_cb
+	setarg antilost_led_on_cb
+	store 2,mem_antl_led_cb_on
+	setarg antilost_led_off_cb
+	store 2,mem_antl_led_cb_off
+	setarg antilost_buzzer_on
+	store 2,mem_antl_buzzer_cb_on
+	setarg antilost_buzzer_off
+	store 2,mem_antl_buzzer_cb_off
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BTN_DOWN
+	branch app_enter_hibernate
+
+antilost_set_ble_version:
+	//set ble version  4.1 
+	jam 7,mem_lmp_version
+	rtn
+
+
+antilost_le_before_hibernate:
+	call antilost_led_buzzer_stop_blink
+	branch  app_enter_hibernate
+
+antilost_le_notification:
+	call le_fifo_check_nearly_full
+	nrtn blank
+	arg mem_temp_block5,rega
+	call queue_pop
+	nrtn user
+	arg mem_temp_block5,contr
+	branch le_send_notify_from_list
+
+antilost_power_standby_cb:
+	fetch 2,mem_antl_le_sleep_timeout
+	store 2,mem_antl_le_sleep_timer
+	jam 1,mem_antl_key_scan_enable
+	branch antilost_fast_adv_start
+	
+antilost_lpm_lock_process:
+	fetch 1,mem_antl_key_state
+	beq 1,antilost_lpm_ctrl_for_led_buzzer
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,antilost_lpm_ctrl_for_led_buzzer
+	fetch 1,mem_antl_lost_mode
+	beq 1,app_get_lpm_wake_lock
+	fetch 1, mem_antl_queue_curr_num
+	nbranch app_get_lpm_wake_lock,blank 
+	branch app_put_lpm_wake_lock
+	
+antilost_lpm_ctrl_for_led_buzzer:
+	fetch 1,mem_antl_led_state
+	fetcht 1,mem_antl_buzzer_state
+	ior temp,pdata
+	beq 1,app_get_lpm_wake_lock
+	branch app_put_lpm_wake_lock
+
+antilost_bb_event_process:
+	copy regc,pdata
+	beq BT_EVT_BUTTON_UP,app_event_button_up
+	beq BT_EVT_BUTTON_LONG_PRESSED,app_button_long_pressed
+	beq BT_EVT_LE_CONNECTED,antilost_le_process_conn
+	beq BT_EVT_LE_DISCONNECTED,antilost_le_process_discon
+	beq BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP,antilost_le_conn_param_update_rsp_recieved
+	beq BT_EVT_LE_PARSE_CONN_PARAM_ACCEPTED,antilost_le_conn_param_accepted
+	rtn
+antilost_le_conn_param_update_rsp_recieved:
+	call antilost_le_conn_param_updata_judge
+	fetch 2,mem_le_l2cap_signaling_conn_param_update_rsp_result
+	beq BLE_SIGNALING_CONNECT_PARAMETER_UPDATE_REJECTED,antilost_le_conn_param_rejected
+antilost_le_conn_param_updata_procedure_sucsess:
+	jam CONN_PARAM_UPDATA_PROCEDURE_COMPLETE,mem_antl_conn_updata_procedure_state
+	jam 60,mem_antl_conn_update_timer
+	rtn
+antilost_le_conn_param_updata_judge:
+	fetch 1,mem_le_state
+	rtnbit1 lestate_update_param
+	jam 1,mem_lestate_update_param_flag
+	rtn
+
+	
+antilost_le_conn_param_accepted:
+	fetch 1,mem_lestate_update_param_flag
+	rtn blank
+	jam 0,mem_lestate_update_param_flag
+	fetch 2,mem_le_new_connslavelatency
+	branch antilost_master_nonsupport_latency,blank
+	rtn
+
+antilost_le_conn_param_rejected:
+	fetch 2,mem_le_latency
+	branch antilost_conn_param_updata_procedure_faild,blank
+antilost_conn_param_retransimiting:
+	jam CONN_PARAM_UPDATA_PROCEDURE_STARTING,mem_antl_conn_updata_procedure_state
+	fetcht 2,mem_interval_increment
+	fetch 2,mem_le_interval_min
+	iadd temp,pdata
+	store 2,mem_le_interval_min
+	copy pdata,rega
+	fetch 2,mem_le_interval_max
+	iadd temp,pdata
+	store 2,mem_le_interval_max
+	iadd rega,pdata
+	rshift pdata,temp
+	fetch 2,mem_antl_le_unnormal_interval_max
+	idiv temp
+	call get_div_result
+	store 2,mem_le_latency
+	jam 1,mem_antl_send_updata_le_param_timer
+	rtn
+antilost_conn_param_updata_procedure_faild:
+	jam CONN_PARAM_UPDATA_PROCEDURE_FAILD,mem_antl_conn_updata_procedure_state
+	rtn
+
+antilost_master_nonsupport_latency:
+	jam 0,mem_lpm_mult
+	jam 0,mem_antl_send_updata_le_param_timer
+	fetch 2,mem_le_new_conninterval	//interval from master
+	fetcht 2,mem_antl_le_unnormal_interval_min
+	isub temp,null
+	setflag positive,0,rega 
+	fetch 2,mem_antl_le_unnormal_interval_max //local intervalmax
+	fetcht 2,mem_le_new_conninterval//interval form master
+	isub temp,pdata
+	setflag positive,1,rega
+	compare	0x03,rega,0x03
+	rtn true //return if the new conn_interval in range through conn_interval_min to conn_interval_max already
+	fetch 8,mem_antl_le_unnormal_interval_min
+	store 8,mem_le_interval_min
+	jam 1,mem_antl_send_updata_le_param_timer
+	rtn                               
+
+
+antilost_le_bb_event_timer:
+	call app_power_timer
+	call antilost_double_click_timer
+	call antilost_le_fast_adv_timer
+	call antilost_le_sleep_timer
+	call antilost_app_updata_le_param_timer
+	call antilost_conn_update_timer
+	call antilost_conn_battery_send_timer
+	branch antilost_adc_check_timer
+
+antilost_conn_battery_send_timer:
+	arg mem_antilost_conn_battery_send_timer,regc
+	arg antilost_conn_battery_send,regb
+	branch timer_single_step
+antilost_conn_battery_send:
+	call antilost_battery_process
+	call antilost_battery_process
+	call antilost_battery_process
+	branch antilost_battery_calculate_end //send twice to combat the failure of reception first time
+
+	
+antilost_double_click_timer:
+	arg mem_double_click_timer,regc
+	arg antilost_double_click_timeout,regb
+	branch timer_single_step
+antilost_double_click_timeout:
+	jam 0,mem_butten_click_cnt
+	rtn
+antilost_le_fast_adv_timer:
+	arg mem_antl_fast_adv_timer,regc
+	arg antilost_le_fast_adv_timeout,regb
+	branch timer_single_step_2B
+antilost_le_fast_adv_timeout:
+	arg mem_antl_slow_adv_led_style,regc
+	arg mem_antl_slow_adv_lpm_interval,regb
+	branch antilost_adv_start_common
+	
+
+antilost_conn_update_timer:
+	arg mem_antl_conn_update_timer,regc
+	arg antilost_conn_update_timer_time_out,regb
+	branch timer_single_step
+	
+antilost_conn_update_timer_time_out:
+	fetch 2,mem_le_latency
+	store 1,mem_lpm_mult
+	rtn
+antilost_app_updata_le_param_timer:
+	arg mem_antl_send_updata_le_param_timer,regc
+	arg antilost_app_updata_le_param_timeout,regb
+	branch timer_single_step
+antilost_app_updata_le_param_timeout:
+	fetch 1,mem_le_state
+	compare 0,pdata,0x60
+	nbranch antilost_wait_for_updata_param_instant_expire,true
+	jam CONN_PARAM_UPDATA_PROCEDURE_STARTING,mem_antl_conn_updata_procedure_state
+	call  app_lpm_mult_enable
+	branch le_l2cap_tx_update_req	
+antilost_wait_for_updata_param_instant_expire:
+	jam 1,mem_antl_send_updata_le_param_timer
+	rtn
+	
+antilost_le_sleep_timer:
+	arg mem_antl_le_sleep_timer,regc
+	arg antilost_le_sleep_timer_timeout,regb
+	branch timer_single_step_2B
+
+
+antilost_le_sleep_timer_timeout:
+	branch app_button_long_pressed
+
+antilost_adc_check_timer:
+	arg mem_adc_timer,regc
+	arg antilost_adc_check_timer_timeout,regb
+	branch timer_single_step_2B
+antilost_adc_check_timer_timeout:
+	fetch 2,mem_adc_timeout
+	store 2,mem_adc_timer
+	branch antilost_battery_process
+
+
+antilost_le_process_conn:
+	fetch 2,mem_adc_timeout
+	store 2,mem_adc_timer
+	setarg 0
+	store 2,mem_antl_fast_adv_timer
+	store 2,mem_antl_le_sleep_timer
+	call antilost_alert_off
+	call antilost_led_buzzer_stop_blink
+	jam 0,mem_lpm_mult
+	branch app_ble_stop_adv
+	                                                      
+
+antilost_le_process_discon:
+	setarg 0
+	store 4,mem_adc_timer
+	store 3,mem_antl_conn_updata_procedure_state
+	store 2,mem_le_l2cap_signaling_conn_param_update_rsp_result
+	
+	jam 1,mem_alarm_config_notfy_cnt
+	fetch 2,mem_antl_le_sleep_timeout
+	store 2,mem_antl_le_sleep_timer
+	call queue_init
+	fetch 1,mem_antl_power_state
+	rtneq POWER_OFF
+	call antilost_fast_adv_start
+	branch antilost_on_off_alarm_after_disconn
+
+
+antilost_le_conn_process:
+//bpatch
+	branch antilost_key_process
+
+antilost_idle_process:
+
+	fetch 1,mem_antl_power_state
+	rtnne POWER_STANDBY
+	branch antilost_key_process
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////SOFT WTICH////////
+antilost_power_starting_cb:
+	arg mem_antl_power_starting_buzzer_style,regc
+	call antilost_buzzer_configuration
+	arg mem_antl_power_starting_led_style,regc
+antilost_power_common:
+	branch antilost_led_configuration
+
+antilost_power_off_cb:
+	jam OFF,mem_le_adv_enable
+	arg mem_antl_power_off_buzzer_style,regc
+	call antilost_buzzer_configuration
+	arg mem_antl_power_off_led_style,regc
+	branch antilost_power_common
+	
+antilost_le_receive_data_process:
+	fetch 1,mem_le_att_opcode
+	beq ATTOP_WRITE_REQUEST,antilost_le_parse_att_write_request
+	rtn
+antilost_le_parse_att_write_request:
+	fetch 2,mem_le_att_handle
+//	beq  ATT_WRITE_REQUEST_HANDLE,antilost_key_data_send
+	beq NEW_SPEC_WRITE_HANDLE,antilost_cmd_parse_for_application
+	beq NEW_SPEC_NOTIFICATION_ENABLE_HANDLE,antilost_notify_alarm_config_first_time
+	rtn
+/////////////////////////////////////////////////////////
+
+
+/////////key scan
+antilost_key_process:
+	fetch 1,mem_antl_key_scan_enable
+	rtn blank
+	branch keyscan_key_process
+
+	//queue = key index
+	//rega =1 press, =0 release
+antilost_key_up_down:
+	copy rega,pdata
+	branch antilost_key_is_up,blank
+antilost_key_is_down:
+	copy queue,pdata
+	beq 0,antilost_key0_down
+	rtn
+antilost_key_is_up:
+	copy queue,pdata
+	beq 0,antilost_key0_up
+	rtn
+
+antilost_key0_down:
+	jam 1,mem_antl_key_state
+	arg mem_antl_key_buzzer_style,regc
+	call antilost_buzzer_configuration
+	arg mem_antl_key_led_style,regc
+	call antilost_led_configuration
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,antilost_butten_down_while_disconn
+	branch antilost_butten_down_after_conn
+	
+antilost_key0_up:
+	jam 0,mem_antl_key_state
+	branch antilost_double_click_timer_init
+
+//////////////process for double-click
+
+antilost_double_click_timer_init:
+	fetch 1,mem_butten_click_cnt
+	rtnne 1
+	jam 5,mem_double_click_timer
+	rtn
+
+antilost_butten_down_after_conn:
+	fetch 1,mem_butten_click_cnt
+	pincrease 1
+	store 1,mem_butten_click_cnt
+	beq 1,antilost_click_once
+	beq 2,antilost_click_twice
+	rtn
+antilost_click_once:
+	call antilost_alert_off
+	jam OPCODE1_BUTTEN_CLICK_ONCE,mem_antl_key0_press+5//5 represent opcode offset
+	arg mem_antl_key0_press,regc
+	branch antilost_prepare_data_and_send
+antilost_click_twice:
+	jam 0,mem_butten_click_cnt
+	jam OPCODE2_BUTTEN_DOUBLE_CLICK,mem_antl_key0_press+5
+	arg mem_antl_key0_press,regc
+	call antilost_prepare_data_and_send
+	fetch 1,mem_antl_lost_mode
+	beq 1,antilost_alert_on
+	rtn   //rtn should be retaind
+	
+antilost_butten_down_while_disconn:
+	fetch 2,mem_antl_le_sleep_timeout
+	store 2,mem_antl_le_sleep_timer
+	call antilost_alert_off
+	branch antilost_fast_adv_start
+	
+///////////////////////NEW App Spcecific///////
+antilost_cmd_parse_for_application:
+	bpatch patch16_4,mem_patch16
+	call le_app_receive_data
+	ifetch 1,rega
+	beq OPCODE3_ANTL_START_ALRAM,antilost_on_of_alram
+	beq OPCODE7_ANTL_CONFIG_ALRAM,antilost_configuration_for_alram
+	rtn
+
+antilost_on_of_alram:
+	fetch 1,mem_antl_lost_mode
+	beq ANTI_LE_ALARM_OFF,antilost_alert_on
+	beq ANTI_LE_ALARM_ON,antilost_alert_off
+	rtn
+
+antilost_configuration_for_alram:
+	ifetch 1,regb
+	beq 1,antilost_set_start_alarm_after_disconn
+	beq 0,antilost_set_no_alarm_after_disconn
+	rtn
+/////////////////check////////////////////////
+
+/*input: 1)package data addr in regc
+output:no
+function:calculate check_out value and send data*/
+//mem_temp_block5
+antilost_prepare_data_and_send:
+	bpatch patch16_5,mem_patch16
+	fetch 1,mem_client_characteristic_configuration_descriptor
+	isolate1 NOTIFICATION_ENABLE_BIT,pdata
+	nrtn true
+	add regc,6,contr
+	ifetch 2,contr
+	byteswap pdata,pdata
+	add pdata,5,loopcnt
+	add regc,3,contr
+	call calc_check_sum_start
+	istore 1,contr
+	copy regc,rega
+	branch queue_push
+
+/////////////////NEW APP SPECIFIC check end////////////////////
+
+
+/////////alarm//////////////////////////////
+antilost_alert_on:
+	fetch 1,mem_antl_power_state
+	rtn blank
+	jam 1,mem_antl_lost_mode
+	arg mem_antl_alert_buzzer_stlye,regc
+	call antilost_buzzer_configuration
+	arg mem_antl_alert_led_stlye,regc
+	call antilost_led_configuration
+	jam OPCODE4_CURRENT_ALARM_STATE,mem_antl_key0_release+5//5 represent opcode offset
+	jam 1,mem_antl_key0_release+8 //8 represent data offset,digit 1 represent alarm is on at present
+	arg mem_antl_key0_release,regc
+	branch antilost_prepare_data_and_send
+antilost_alert_off:
+	fetch 1,mem_antl_lost_mode
+	rtn blank
+	jam 0,mem_antl_lost_mode
+	call antilost_led_buzzer_stop_blink
+	jam OPCODE4_CURRENT_ALARM_STATE,mem_antl_key0_release+5//5 represent opcode offset
+	jam 0,mem_antl_key0_release+8 //8 represent data offset,digit 0 represent alarm is off at present
+	arg mem_antl_key0_release,regc
+	branch antilost_prepare_data_and_send
+
+antilost_set_start_alarm_after_disconn:
+	jam 1,mem_alarm_config
+	jam OPCODE7_ANTL_CONFIG_ALRAM,mem_antl_key0_release+5
+	jam 1,mem_antl_key0_release+8
+	arg mem_antl_key0_release,regc
+	branch antilost_prepare_data_and_send
+antilost_set_no_alarm_after_disconn:
+	jam 0,mem_alarm_config
+	jam OPCODE7_ANTL_CONFIG_ALRAM,mem_antl_key0_release+5
+	jam 0,mem_antl_key0_release+8
+	arg mem_antl_key0_release,regc
+	branch antilost_prepare_data_and_send
+antilost_on_off_alarm_after_disconn:
+	fetch 1,mem_alarm_config
+	rtn blank
+	branch antilost_alert_on
+	
+antilost_notify_alarm_config_first_time:
+	ifetch 2,rega
+	store 2,mem_client_characteristic_configuration_descriptor
+	isolate1 NOTIFICATION_ENABLE_BIT,pdata
+	nrtn true
+	fetch 1,mem_alarm_config_notfy_cnt
+	rtn blank
+	jam 0,mem_alarm_config_notfy_cnt
+	fetch 8,mem_antl_le_interval_min
+	store 8,mem_le_interval_min
+	jam 3,mem_antilost_conn_battery_send_timer
+	jam OPCODE7_ANTL_CONFIG_ALRAM,mem_antl_key0_release+5
+	jam 30,mem_antl_send_updata_le_param_timer
+	fetch 1,mem_alarm_config
+	store 1,mem_antl_key0_release+8
+	arg mem_antl_key0_release,regc
+	branch antilost_prepare_data_and_send
+
+//////////////alarm end//////////////////////////
+//sytle address in regc
+antilost_buzzer_configuration:
+	arg 1,rega
+	branch antilost_configuration_common
+antilost_led_configuration:
+	arg 0,rega
+antilost_configuration_common:
+	branch antilost_led_buzzer_style_configuration
+	
+antilost_led_buzzer_stop_blink:
+	arg 0,rega
+	call ui_led_blink_stop_global
+	arg 1,rega
+	call ui_led_blink_stop_global
+	fetch 2,mem_buzzer_pwm_conf
+	branch pwm_disable
+	
+antilost_led_buzzer_style_configuration:
+	call calc_curr_struct_prt
+	arg 7,loopcnt
+	branch ui_led_set_style_global+2
+
+
+
+antilost_fast_adv_start:
+	arg mem_antl_fast_adv_led_style,regc
+	arg mem_antl_lpm_interval,regb
+antilost_adv_start_common:
+	call antilost_adv_interval_lpm_interval_set
+	call antilost_led_configuration
+	fetch 2,mem_antl_fast_adv_timeout
+	store 2,mem_antl_fast_adv_timer
+	branch app_ble_start_adv
+	
+antilost_adv_interval_lpm_interval_set:
+	ifetch 2,regb
+	store 2,mem_lpm_interval
+	ifetch 2,contr
+	store 2,mem_le_adv_interval
+	rtn
+///////////////beep////////////
+antilost_buzzer_pwm_init:
+	arg 0,rega //sys clk 12mhz
+	call pwm_init
+	fetch 6,mem_buzzer_pwm_conf
+	store 6,mem_pdatatemp
+	call pwm_out_set
+	fetch 2,mem_buzzer_pwm_conf
+	branch pwm_disable
+	
+antilost_led_on_cb:
+	jam 1,mem_antl_led_state
+	rtn	
+antilost_led_off_cb:
+	jam 0,mem_antl_led_state
+	rtn
+
+
+
+antilost_buzzer_off:
+	jam 0,mem_antl_buzzer_state
+	fetch 2,mem_buzzer_pwm_conf
+	branch pwm_disable
+	
+antilost_buzzer_on:
+	jam 1,mem_antl_buzzer_state
+	fetch 6,mem_buzzer_pwm_conf
+	store 6,mem_pdatatemp
+	branch pwm_out_set
+
+////////////////beep end///////////////////////////
+/////////////adc start////////////////////////
+antilost_adc_init:
+	jam 0,mem_adc_config_flag
+	rtn
+	
+antilost_battery_process:
+	call vdd_calculate_by_mode
+	store 2,mem_battery_current_voltage
+	arg mem_battery_calculate_set,rega
+	call adc_bat_percent_lowpower_out
+	store 1,mem_voltage_remain_percent //for debug
+	setarg 0x65
+	beq 0,antilost_low_battery
+	sub pdata,0x64,null
+	nbranch antilost_full_battery,positive
+	store 1,mem_antl_key0_release+8
+antilost_battery_calculate_end:
+	jam OPCODE5_BATTER_INFORMATION,mem_antl_key0_release+5
+	arg mem_antl_key0_release,regc
+	branch antilost_prepare_data_and_send
+antilost_full_battery:
+	jam 100,mem_antl_key0_release+8
+	branch antilost_battery_calculate_end
+
+antilost_low_battery:
+	branch app_button_long_pressed
+else
+antilost_init:
+	rtn
+endif
+
+
Index: program/app_car.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_car.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_car.prog	(working copy)
@@ -0,0 +1,803 @@
+ifdef COMPILE_CAR
+
+car_init:
+	rtn wake
+	call enable_authrom
+	setarg car_g24_receive_process
+	store 2,mem_cb_24g_receive_process
+	
+	setarg g24_bind_ackpayload_prep
+	store 2,mem_cb_24g_ackpayload
+	
+	setarg car_g24_cb_data_device1
+	store 2,mem_cb_24g_data_device1
+
+	setarg car_le_before_hibernate
+	store 2,mem_cb_before_hibernate
+	
+	setarg car_le_process_lpm_before
+	store 2,mem_cb_before_lpm	
+	
+	setarg app_enter_hibernate
+	store 2,mem_cb_discovry_timeout
+	
+	setarg car_scale_process_idle	
+	store 2,mem_cb_idle_process	
+	
+	setarg car_scale_process_bb_event 
+	store 2,mem_cb_bb_event_process	
+	
+	setarg app_get_lpm_wake_lock
+	store 2,mem_cb_check_wakelock
+	
+	setarg car_le_receive_data
+	store 2,mem_cb_att_write
+	
+	setarg car_le_bb_event_timer
+	store 2,mem_cb_event_timer
+	
+	bpatch patch16_6,mem_patch16
+	call car_init_environment
+	call car_lpm_timer_enable
+	call queue_init
+	jam 2,mem_lpm_mult
+	jam POWER_ON,mem_car_24g_received_pac
+	fetch 1,mem_car_config_soft_switch_enable
+	store 1,mem_car_hard_soft_switch
+	beq HARD_SWITCH, car_hard_switch_power_on_signal
+	fetch 1,mem_car_config_soft_switch_gpio
+	store 1,mem_ui_button_gpio
+	jam OFF,mem_le_adv_enable
+car_soft_switch_power_on_init:
+	call ui_button_init
+	call ui_button_polling
+	jam POWER_STARTING,mem_car_power_state
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BTN_DOWN
+ 	branch app_enter_hibernate
+
+car_power_off_signal:	
+	branch car_ui_led_init
+	
+car_hard_switch_power_on_signal:
+	jam POWER_STANDBY,mem_car_power_state
+car_soft_switch_power_on_signal:
+	jam ON,mem_le_adv_enable
+	setarg FAST_ADV_INTERVAL_VALUE_CAR
+	call shutter_ble_adv_interval_set
+car_le_modified_name_adv:
+	arg mem_le_name+7,contw
+	fetch 1,mem_le_lap
+car_name_loop:
+	and pdata,0xF0,temp
+	rshift4 temp,temp
+	call car_hex_to_ascii
+	istoret 1, contw
+	and pdata,0x0F,temp
+	call car_hex_to_ascii
+	istoret 1, contw
+	call le_modified_name_att_list
+	fetcht 1,mem_le_name_len
+	copy temp,loopcnt
+	arg mem_le_adv_data+2,contw
+	arg mem_le_name,contr
+	call memcpy
+car_le_modified_name_scan:
+	fetcht 1,mem_le_name_len
+	copy temp,loopcnt
+	arg mem_le_scan_data+2,contw
+	arg mem_le_name,contr
+	branch memcpy
+car_hex_to_ascii:
+	sub temp,9,null
+	branch car_hex_num,positive
+	add temp,55,temp
+	rtn
+car_hex_num:	
+	add temp,48,temp
+	rtn
+
+car_ui_led_init:
+	fetch 1,mem_car_config_blood_led1_gpio
+	bne INVALID_PIN_NUM,car_blood_led_gpio_set
+car_ui_led_init_1:
+	fetch 1,mem_car_config_pairing_led_gpio
+	bne INVALID_PIN_NUM,car_pairing_led_gpio_set
+car_ui_led_init_2:
+	fetch 1,mem_car_config_low_voltage_led_gpio
+	bne INVALID_PIN_NUM,car_low_voltage_led_gpio_set
+car_ui_led_init_3:
+	fetch 1, mem_car_led_num
+	copy pdata,loopcnt
+	setarg mem_car_led_map
+	copy pdata,rega
+car_in_lp1:
+	copy rega,contr
+	ifetch 1,contr
+	copy contr,rega
+	beq INVALID_PIN_NUM,car_in_lp1_end
+	copy pdata,temp
+	call gpio_config_output
+car_in_lp1_end:
+	loop car_in_lp1
+car_ui_led_init_end:
+	rtn
+car_blood_led_gpio_set:
+	fetch 8,mem_car_config_blood_led1_gpio
+	store 8,mem_car_led_map+2
+	branch car_ui_led_init_1
+car_pairing_led_gpio_set:
+	store 1,mem_car_led_map
+	branch car_ui_led_init_2
+car_low_voltage_led_gpio_set:
+	store 1,mem_car_led_map+1
+	branch car_ui_led_init_3
+
+car_init_environment:
+	
+	call car_g24_init
+	arg 0,rega
+	call pwm_init
+	call car_ui_led_init
+	call car_start_blink
+	call car_init_adc_hvin
+	branch car_motor_init
+
+car_motor_init:
+	fetch 1, mem_car_motor_gpio_num
+	copy pdata,loopcnt
+	setarg mem_car_motor_gpio_map
+	copy pdata,rega
+p_in_lp1:
+	copy rega,contr
+	ifetch 1,contr
+	copy contr,rega
+	beq INVALID_PIN_NUM,p_in_lp1_end
+	copy pdata,temp
+	store 1, mem_car_gpio
+	call car_ui_gpio_init
+p_in_lp1_end:
+	loop p_in_lp1
+p_car_ui_led_init_end:
+	rtn
+
+car_ui_gpio_init:
+	fetch 1,mem_car_gpio
+	rtneq UI_BUTTON_GPIO_DISABLE
+	iforce temp
+	branch gpio_config_output
+
+	
+car_init_adc_hvin:
+	jam 100,mem_car_notify_vdd_value_last
+	rtn
+	
+car_le_before_hibernate:
+	call gpio_set_before_lpm_common
+	branch keyscan_process_lpm_before
+
+car_le_process_lpm_before:
+	branch keyscan_process_lpm_before
+
+car_key_scan_process:
+	branch keyscan_key_process
+
+car_scale_process_idle:
+	call car_le_send_packet
+	call car_g24_status_process
+	branch car_key_scan_process
+
+car_g24_status_process:
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_CONNECTED
+	fetch 1,mem_car_24g_received_pac
+	beq WORK_PAIRED,car_g24_connected_event
+	rtn
+car_g24_connected_event:
+	fetch 1,mem_car_24g_status
+	rtneq WORK_PAIRED
+	jam WORK_PAIRED,mem_car_24g_status
+	call car_lpm_timer_disable
+	call car_stop_blink
+	branch car_g24_connected
+
+car_lpm_timer_enable:
+	fetch 2,mem_car_enter_lpm_timer_count	
+	store 2,mem_car_enter_lpm_timer
+	jam 0,mem_car_enter_lpm_flag
+	rtn
+
+	
+car_lpm_timer_disable:
+	setarg 0
+	branch car_lpm_timer_enable+1
+
+
+car_stop_blink:
+	arg 0,rega
+	branch ui_led_blink_stop_global
+	
+	
+car_start_blink:
+	arg 0,rega
+	branch ui_led_blink_start_global
+	
+
+
+
+
+car_le_send_packet:
+	fetch 2,mem_ui_state_map
+	rtnbit0 UI_STATE_BLE_CONNECTED
+	call le_fifo_check_nearly_full
+	nrtn blank
+	arg mem_car_pop_queue_buff,rega
+	call queue_pop
+	nrtn user
+	arg mem_car_pop_queue_buff,contr
+	branch le_send_notify_from_list
+ 
+car_scale_process_bb_event:
+	copy regc,pdata
+	beq BT_EVT_BUTTON_UP,app_event_button_up
+	beq BT_EVT_BUTTON_LONG_PRESSED,app_button_long_pressed
+	beq BT_EVT_LE_CONNECTED,car_scale_event_le_conn
+	beq BT_EVT_LE_DISCONNECTED,car_scale_event_le_discon
+	rtn
+
+car_scale_event_le_conn:
+	call car_lpm_timer_disable
+	call car_stop_blink
+	set0 mark_24g_rxmode,mark
+	branch car_scale_process_conn
+car_g24_connected:
+	fetch 2,mem_car_24g_no_data_timeout_count
+	store 2,mem_car_24g_no_data_timeout_timer
+car_scale_process_conn:
+	jam 0x14,mem_car_notify_vdd_timer
+	jam 0,mem_lpm_mode
+	call app_ble_stop_adv
+	branch app_lpm_mult_enable
+
+
+car_scale_event_le_discon:
+	set1 mark_24g_rxmode,mark
+	call car_lpm_timer_enable
+	call car_fb_motor_stop
+	call car_lr_motor_stop
+car_g24_disconnect:
+	setarg 0
+	store 5,mem_car_led_control
+	setarg 4
+	call pwm_disable
+	setarg 5
+	call pwm_disable
+	setarg 20
+	call pwm_disable
+	setarg 21
+	call pwm_disable
+	setarg 22
+	call pwm_disable
+	setarg 7
+	call pwm_disable
+	call queue_init
+	jam 10,mem_motor1_speed
+	jam 10,mem_motor2_speed
+	jam 10,mem_motor3_speed
+//	jam 1,mem_lpm_mode
+	jam 2,mem_lpm_mult
+	setarg FAST_ADV_INTERVAL_VALUE_CAR
+	call shutter_ble_adv_interval_set
+	branch app_ble_start_adv
+
+car_le_bb_event_timer:
+	call car_moto1_blank_data_timer
+	call car_moto2_blank_data_timer
+	call car_moto3_blank_data_timer
+	call app_power_timer
+	call car_notify_vdd_timer
+	call car_24g_no_data_timeout_timer
+	call car_24g_bind_enable_timer
+	branch car_enter_lpm_timer
+
+car_24g_bind_enable_timer:
+	arg mem_car_24g_bind_enable_delay_count,regc
+	arg 0,regb
+	branch timer_single_step
+
+car_enter_lpm_timer:
+	arg mem_car_enter_lpm_timer,regc
+	arg car_enter_lpm_enable,regb
+	branch timer_single_step_2B
+car_enter_lpm_enable:
+	jam 1,mem_car_enter_lpm_flag
+	rtn
+	
+car_24g_no_data_timeout_timer:
+	arg mem_car_24g_no_data_timeout_timer,regc
+	arg car_24g_no_data_timer_timeout,regb
+	branch timer_single_step_2B
+car_24g_no_data_timer_timeout:
+	jam WORK_SEARCH,mem_car_24g_status
+	jam POWER_ON,mem_car_24g_received_pac
+	branch car_g24_disconnect
+
+car_notify_vdd_timer:
+	fetch 1,mem_car_config_bat_notify_enable
+	rtn blank
+	arg mem_car_notify_vdd_timer,regc
+	arg car_notify_vdd,regb
+	branch timer_single_step
+car_notify_vdd:
+	fetch 1,mem_car_notify_vdd_count
+	store 1,mem_car_notify_vdd_timer
+ 	fetch 1,mem_car_working_flag
+ 	nrtn blank
+car_read_hvin:
+	call vdd_calculate_by_mode
+	store 2,mem_vdd_now_vol
+	arg mem_vdd_calculate_set,rega
+	call adc_bat_percent_lowpower_out
+	fetcht 1,mem_car_notify_vdd_value_last
+	isub temp,null
+	branch car_notify_vdd_next2,positive
+	store 1,mem_car_notify_vdd_value_last
+	copy pdata,temp
+car_notify_vdd_next2:
+	storet 1,mem_car_notify_vdd_percent
+	fetch 1,mem_car_config_low_voltage_percent
+	isub temp,null
+	call car_enter_low_bat,positive
+	storet 1,mem_notify_bat_payload 
+	arg 6,loopcnt
+	arg mem_notify_bat_head,contr
+	call calc_check_sum_start
+	store 1,mem_notify_bat_check_sum
+	arg mem_notify_bat_packet,rega
+	branch queue_push
+car_enter_low_bat:
+	fetch 1,mem_low_bat_flag
+	nrtn blank
+	jam 1,mem_low_bat_flag
+	arg 1,rega
+	branch ui_led_blink_start_global
+car_low_bat_led_off:
+	arg 1,rega
+	branch ui_led_blink_stop_global
+
+////////////////////////check sum////////////////////////
+//loopcnt = sum number,contr = ptr
+calc_check_sum_start:
+	arg 0,rega
+calc_check_sum_loop:
+	ifetch 1,contr
+	iadd rega,rega
+	loop calc_check_sum_loop
+calc_check_sum_and:
+	and rega,0xff,pdata
+	rtn
+
+car_le_receive_data:	
+	fetch 1,mem_le_att_opcode
+	beq ATTOP_WRITE_REQUEST,car_le_parse_att_write_request
+	rtn
+car_le_parse_att_write_request:
+	fetch 2,mem_le_att_handle
+	beq ATT_CAR_CONTROL_HANDLE,car_control_le_receive
+	rtn
+
+/*
+*	typedef struct
+*	{
+*		2byte	packet_head				(mem_app_receive_temp)
+*		1byte	packet_cmd				(mem_app_receive_temp+2)
+*		2byte	packet_payload_length	(mem_app_receive_temp+3)
+*		10byte	packet_payload			(mem_app_receive_temp+5)
+*		1byte	packet_check_sum		(mem_app_receive_temp+15)
+*	}
+*/
+le_app_receive_data:
+	bpatch patch16_7,mem_patch16
+	ifetch 5,rega
+	store 5,mem_app_receive_temp
+	fetch 2,mem_app_receive_temp
+	arg LE_RECEIVE_PACKET_HEAD,temp
+	isub temp,null
+	nrtn zero
+	fetch 2,mem_app_receive_temp+3
+	byteswap pdata,pdata
+	store 2,mem_app_receive_temp+3
+	copy pdata,loopcnt
+	increase 5,rega
+	copy rega,contr
+	arg mem_app_receive_temp+5,contw
+	call memcpy
+	ifetch 1,contr
+	store 1,mem_app_receive_temp+15
+	arg mem_app_receive_temp+2,rega
+	arg mem_app_receive_temp+5,regb
+	rtn
+
+car_control_le_receive:
+	setarg 0
+	store 5,mem_le_receive_payload
+	store 5,mem_le_receive_payload+5
+	call le_app_receive_data
+	copy regb,contr
+	arg mem_le_receive_payload,contw
+	arg 10,loopcnt
+	call memcpy
+car_receive_cmd_select:
+	bpatch patch17_0,mem_patch17
+	ifetch 1,rega
+	beq CAR_CMD_OLD_CAR_CONTROL,car_drive_old
+	beq CAR_CMD_OLD_SPEED_CONTROL,car_speed_set_old
+	beq CAR_CMD_L_R_MOTOR_CONTROL,car_motor_control
+	beq CAR_CMD_F_B_MOTOR_CONTROL,car_motor_control
+	beq CAR_CMD_IR_CONTROL,car_ir_data_rx_from_app
+	beq CAR_CMD_LED_CONTROL,car_led_control_receive
+	beq CAR_CMD_DEVICE_INFO,car_info_request
+	rtn
+
+car_24g_receive_data:
+	call car_control_le_receive
+	fetch 1,mem_app_receive_temp+2	//cmd
+	beq CAR_CMD_L_R_MOTOR_CONTROL,car_24g_receive_data_next
+	beq CAR_CMD_F_B_MOTOR_CONTROL,car_24g_receive_data_next
+	rtn
+car_24g_receive_data_next:
+	fetch 1,mem_le_receive_payload	//moto1
+	ncall car_moto1_enable_blank_data_timer,blank
+	fetch 1,mem_le_receive_payload+2	//moto2
+	ncall car_moto2_enable_blank_data_timer,blank
+	fetch 1,mem_le_receive_payload+4	//moto3
+	ncall car_moto3_enable_blank_data_timer,blank
+	rtn
+
+car_moto1_enable_blank_data_timer:
+	jam 5,mem_car_moto1_blank_timer
+	rtn
+car_moto2_enable_blank_data_timer:
+	jam 5,mem_car_moto2_blank_timer
+	rtn
+car_moto3_enable_blank_data_timer:
+	jam 5,mem_car_moto3_blank_timer
+	rtn
+
+car_moto1_blank_data_timer:
+	arg mem_car_moto1_blank_timer,regc
+	arg car_moto1_blank_data,regb
+	branch timer_single_step
+car_moto2_blank_data_timer:	
+	arg mem_car_moto2_blank_timer,regc
+	arg car_moto2_blank_data,regb
+	branch timer_single_step
+car_moto3_blank_data_timer:		
+	arg mem_car_moto3_blank_timer,regc
+	arg car_moto3_blank_data,regb
+	branch timer_single_step
+
+car_moto1_blank_data:
+	jam 0,mem_le_receive_payload
+	branch car_motor_control
+car_moto2_blank_data:
+	jam 0,mem_le_receive_payload+2
+	branch car_motor_control
+car_moto3_blank_data:
+	jam 0,mem_le_receive_payload+4
+	branch car_motor_control
+	
+	
+///////////////////////Motor//////////////////////////////////////////
+
+car_drive_old:	
+	fetch 1,mem_le_receive_payload
+	store 1,mem_motor1_status
+	fetch 1,mem_le_receive_payload+1
+	store 1,mem_motor2_status
+	branch car_motor_control_common
+
+
+	
+car_left_right_control_old:
+	fetch 1,mem_le_receive_payload
+	store 1,mem_motor2_status
+	branch car_motor2_control
+car_front_back_control_old:
+	fetch 1,mem_motor1_speed
+	call car_reset_old_speed
+	fetch 1,mem_le_receive_payload+1
+	store 1,mem_motor1_status
+	branch car_motor1_control
+car_reset_old_speed:
+	beq SPEED_LEVEL_2,car_reset_old_speed2
+	beq SPEED_LEVEL_3,car_reset_old_speed3
+	store 1,mem_motor1_speed
+	rtn
+car_reset_old_speed2:
+	jam SPEED_LEVEL_5,mem_motor1_speed
+	rtn
+car_reset_old_speed3:
+	jam SPEED_LEVEL_10,mem_motor1_speed
+	rtn
+car_speed_set_old:
+	fetch 1,mem_le_receive_payload
+	call car_reset_old_speed
+	fetch 1,mem_motor1_speed
+	call car_motor_speed_duty_setting
+	call car_motor_speed_duty_transform
+	jam 0x00,mem_pdatatemp+1	//pwm channel0
+	branch pwm_duty_cycle_set
+
+car_motor_control:
+	fetch 1,mem_car_24g_go_die_flag
+	nrtn blank
+	fetch 6,mem_le_receive_payload
+	store 6,mem_motor1_status
+	fetch 1,mem_motor1_speed
+	fetcht 1,mem_motor2_speed
+	iand temp,pdata
+	fetcht 1,mem_motor3_speed
+	iand temp,pdata
+	call car_motor_working_flag,blank	
+car_motor_control_common:
+	bpatch patch17_1,mem_patch17
+	fetch 2,mem_ui_state_map
+	isolate1 UI_STATE_BLE_CONNECTED,pdata
+	ncall car_lpm_timer_enable,true
+	call car_motor1_control
+	call car_motor2_control
+	branch car_conn_led_state
+
+car_conn_led_state:
+	fetch 1,mem_motor1_status
+	fetcht 1,mem_motor2_status
+	iadd temp,pdata
+	nbranch check_51cmd_led_on,blank
+	branch check_51cmd_led_off	
+
+car_motor1_control:
+	arg mem_motor1_status,contr
+	branch car_motor1_status_select
+car_motor2_control:
+	arg mem_motor2_status,contr
+	branch car_motor2_status_select
+car_motor3_control:
+	arg mem_motor3_status,contr
+	branch car_motor_status_select
+car_motor_working_flag:
+	jam 0,mem_car_working_flag
+	rtn
+
+car_motor1_status_select:
+	ifetch 1,contr
+	beq TURN_FRONT,car_lr_motor_stop
+	beq TURN_LEFT,car_lr_motor_left
+	beq TURN_RIGHT,car_lr_motor_right
+	rtn
+car_motor2_status_select:
+	ifetch 1,contr
+	beq MOTOR_STOP,car_fb_motor_stop
+	beq GO_BACK,car_fb_motor_front
+	beq GO_FRONT,car_fb_motor_back
+	rtn
+
+car_lr_motor_stop:
+	fetcht 1,mem_car_motor_left_gpio
+	call gpio_out_inactive
+	fetcht 1,mem_car_motor_right_gpio
+	branch gpio_out_inactive
+car_lr_motor_left:
+	fetcht 1,mem_car_motor_left_gpio
+	call gpio_out_active
+	fetcht 1,mem_car_motor_right_gpio
+	branch gpio_out_inactive
+car_lr_motor_right:
+	fetcht 1,mem_car_motor_left_gpio
+	call gpio_out_inactive
+	fetcht 1,mem_car_motor_right_gpio
+	branch gpio_out_active
+car_fb_motor_stop:
+	fetcht 1,mem_car_motor_front_gpio
+	call gpio_out_inactive
+	fetcht 1,mem_car_motor_back_gpio
+	branch gpio_out_inactive
+car_fb_motor_front:
+	fetcht 1,mem_car_motor_front_gpio
+	call gpio_out_active
+	fetcht 1,mem_car_motor_back_gpio
+	branch gpio_out_inactive
+car_fb_motor_back:
+	fetcht 1,mem_car_motor_front_gpio
+	call gpio_out_inactive
+	fetcht 1,mem_car_motor_back_gpio
+	branch gpio_out_active
+
+	
+
+
+car_motor_status_select:
+	bpatch patch17_2,mem_patch17
+	ifetch 1,contr
+	beq MOTOR_STOP,car_motor_stop
+	beq GO_FRONT,car_motor_positive
+	beq GO_BACK,car_motor_negative
+	rtn
+car_motor_positive:
+	jam 0,mem_motor_select_p_n
+	branch car_motor_negative+1
+car_motor_negative:
+	jam 1,mem_motor_select_p_n
+	ifetch 1,contr
+	store 1,mem_car_motor_speed
+	ifetch 8,regb
+	branch car_motor_work
+
+car_motor_stop:
+	ifetch 1,regb
+	call pwm_disable
+	increase 1,regb
+	ifetch 1,regb
+	branch pwm_disable
+car_motor_work:
+	store 8,mem_motor_pwm_pin1_set
+	jam 1,mem_car_working_flag
+	fetch 1,mem_motor_select_p_n
+	beq 0,car_motor_select_positive
+car_motor_select_negative:
+	fetch 1,mem_motor_pwm_pin2_set
+	store 1,mem_motor_pwm_pin_set
+	fetch 1,mem_motor_pwm_pin1_set
+car_motor_work_next:
+	call pwm_disable
+	fetch 1,mem_car_motor_speed
+	call car_motor_speed_duty_setting
+	store 1,mem_motor_pwm_dute_set
+	fetch 6,mem_motor_pwm_pin_set
+	store 6,mem_pdatatemp
+	branch pwm_out_set
+car_motor_select_positive:
+	fetch 1,mem_motor_pwm_pin1_set
+	store 1,mem_motor_pwm_pin_set
+	fetch 1,mem_motor_pwm_pin2_set
+	branch car_motor_work_next
+
+car_motor_speed_duty_setting:
+	mul32 pdata,5,pdata
+	add pdata,50,pdata
+	rtn
+car_motor_speed_duty_transform:
+	arg 12000,temp
+	imul32 temp,pdata
+	div pdata,100
+	call wait_div_end
+	quotient temp
+	copy temp,rega
+	setarg 12000
+	isub temp,regb
+	rtn
+
+car_ir_data_rx_from_app:
+	rtn
+
+car_led_control_receive:
+	fetch 8,mem_le_receive_payload
+	store 8,mem_car_led_control
+	rtn
+
+car_info_request:
+	fetch 1,mem_car_config_device_select
+	store 1,mem_car_info_request_payload
+	fetch 1,mem_car_config_motor_layout
+	store 1,mem_car_info_request_payload+1
+	fetch 1,mem_car_config_ir_enable
+	store 1,mem_car_info_request_payload+2
+	arg 13,loopcnt
+	arg mem_car_info_request_head,contr
+	call calc_check_sum_start
+	store 1,mem_car_info_request_checksum
+	arg mem_car_info_request,rega
+	branch queue_push
+
+
+/************************************G24 CAR RX FUNC START**************************************/
+car_g24_init:
+	setarg 0
+	store 8,mem_24g_bind_payload
+	call g24_receive_init
+	branch g24_mode_switch_init
+
+car_g24_receive_process:
+	call car_g24_mode_switch
+	call car_g24_work_mode
+	call car_g24_bind_mode
+	branch car_g24_lpm_dipatch
+
+car_g24_mode_switch:
+	call g24_mode_switch
+car_g24_bind_mode_enable:
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_BIND
+	fetch 1,mem_car_24g_bind_enable_delay_count	//after power on 10s,enable bind
+	nbranch g24_switch_work_mode,blank
+	fetch 1,mem_car_24g_status	//after paired,disable bind mode
+	beq WORK_SEARCH,g24_switch_work_mode
+	rtn
+
+car_g24_work_mode:
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_WORK
+	call g24_work_mode_start
+	branch car_g24_ch_polling_clear,user3
+car_g24_receive_ch_polling:
+	fetch 1,mem_car_enter_lpm_flag
+	rtn blank
+	fetch 1,mem_car_24g_ch_polling
+	increase 1,pdata
+	store 1,mem_car_24g_ch_polling
+	beq 4,car_g24_ch_polling_clear
+	call g24_ch
+	call g24_receive_packet_start
+	nbranch car_g24_receive_ch_polling,user3
+car_g24_ch_polling_clear:
+	jam 0,mem_car_24g_ch_polling
+	rtn
+
+car_g24_bind_mode:
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_BIND
+	call g24_bind_init
+	call car_g24_bind_device_addr
+	call g24_bind_data_process
+	fetch 1,mem_24g_bind_device_status
+	nbranch car_g24_bind_mode_exit,blank
+	call g24_nodata_process
+	fetch 1,mem_24g_nodata_timer_enable
+	rtn blank
+	setarg 0
+	store 4,mem_24g_device1_addr
+	rtn
+
+car_g24_bind_mode_exit:
+	jam 0,mem_24g_mode_switch
+	arg 0,rega
+	call ui_led_off_global
+	call g24_switch_work_mode
+	call g24_timer_init
+	fetch 4,mem_lap
+	branch g24_update_addr_and_synccrc8
+	
+car_g24_bind_device_addr:
+	fetch 4,mem_24g_device1_addr
+	rtn blank
+	branch g24_update_addr_and_synccrc8
+
+car_g24_cb_data_device1:
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_CONNECTED
+	fetch 2,mem_car_24g_no_data_timeout_count
+	store 2,mem_car_24g_no_data_timeout_timer
+	jam WORK_PAIRED,mem_car_24g_received_pac
+	arg mem_24g_rxdata_temp+3,rega
+	branch car_24g_receive_data
+
+car_g24_lpm_dipatch:
+	fetch 1,mem_car_enter_lpm_flag
+	rtn blank
+	call car_g24_lpm_wait
+	nrtn user
+	fetch 3,mem_24g_enter_hibernate	//about 1000ms
+	call clk2lpo
+	storet 4,mem_sleep_counter
+  	branch lpm_sleep
+car_g24_lpm_wait:
+	enable user
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	branch disable_user,blank
+	branch car_le_process_lpm_before
+
+endif
+
+
+
Index: program/app_dongle.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_dongle.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_dongle.prog	(working copy)
@@ -0,0 +1,449 @@
+ifdef COMPILE_DONGLE
+
+dongle_init:
+	setarg dongle_dispatch
+	store 2,mem_cb_24g_receive_process
+	setarg dongle_g24_mouse
+	store 2,mem_cb_24g_data_device1
+	setarg dongle_g24_kb
+	store 2,mem_cb_24g_data_device2
+	setarg dongle_ackpayload_prep
+	store 2,mem_cb_24g_ackpayload
+
+	setarg dongle_usb_config
+	store 2,mem_cb_usb_config
+
+	call dongle_read_kb_bind_status
+	branch usb_init
+
+
+dongle_default_init:
+	//sys init
+	call dongle_xtal_select
+	fetch 1,mem_dg_sys_config
+	isolate1 DG_ENABLE_EEPROM,pdata
+	branch dongle_default_no_eeprom,true
+	fetch 1,mem_dg_sys_config
+	isolate1 DG_ENABLE_NEW_CHMAP,pdata
+	call g24_chamap_param_update,true
+dongle_default_no_eeprom:	
+	fetch 1,mem_dg_sys_config
+	and_into 0x1f,pdata	//bit4-0
+	store 1,mem_tx_power
+	call app_sys_param_init
+	//24g init
+	jam 0xff,mem_rssi_buff_index
+	setarg mem_dg_rssi_noise_buffer
+	store 2,mem_rssi_noise_buffer_ptr
+	setarg mem_dg_rssi_noise_dg_buffer
+	store 2,mem_rssi_noise_self_buffer_ptr
+	setarg mem_dg_rssi_noise_ms_buffer
+	store 2,mem_rssi_noise_device1_buffer_ptr
+	setarg mem_dg_rssi_noise_kb_buffer
+	store 2,mem_rssi_noise_device2_buffer_ptr
+	call g24_enable_1M
+	call g24_receive_init
+	call g24_pair_param_init
+	call g24_chmap_param_init
+	//usb init
+	fetch 1,mem_dg_usb_tx_interval
+	store 1,mem_usb_tx_interval
+	fetch 9,mem_dg_usb_vid_pid
+	store 9,mem_usb_vid_pid
+	rtn
+	
+dongle_xtal_select:
+	jam XTAL_24M,mem_fcomp_div
+	fetch 1,mem_dg_sys_config
+	rtnbit0 DG_ENABLE_XTAL_24M
+	jam XTAL_16M,mem_fcomp_div
+	rtn
+
+dongle_dispatch:
+	fetch 1,mem_24g_pair_mode
+	beq 0x00,dongle_auto_bind
+	beq 0x01,dongle_pc_bind
+	beq 0x0f,dongle_all_powerful
+	rtn
+
+
+dongle_read_kb_bind_status:
+	arg 1,temp
+	arg mem_dg_kb_bind_flag,rega
+	setarg DONGLE_KB_BIND_EFUSE_OFFECT
+	branch efuse_read_data
+
+dongle_write_kb_bind_status:
+	arg 1,loopcnt
+	arg mem_dg_kb_bind_flag,rega
+	arg DONGLE_KB_BIND_EFUSE_OFFECT,temp
+	branch efuse_program
+
+dongle_usb_config:
+	fetch 1,mem_dg_kb_bind_flag
+	bne DONGLE_KB_BIND_SUCCESS,dongle_usb_config_param
+	jam DONGLE_KB_BIND_SUCCESS,mem_dg_kb_bind_flag
+	fetch 4,USB_DEVICEDATA_ADDR+9
+	set1 29,pdata
+	store 4,mem_devicedesc+9
+dongle_usb_config_param:
+	call dongle_usb_device_name
+	call usb_tx_interval_config
+	call dongle_usb_vid_pid_config
+	branch dongle_usb_hid_icon_config
+
+dongle_usb_vid_pid_config:
+	fetch 1,mem_usb_vid_pid
+	rtn blank
+	fetch 1,mem_dg_kb_bind_flag
+	beq DONGLE_KB_BIND_SUCCESS,dongle_usb_vid_pid_for_suit
+dongle_usb_vid_pid_for_mouse_only_auto_pair:	
+	fetch 4,mem_usb_vid_pid+1
+dongle_usb_vid_pid_store:	
+	store 4,mem_devicedesc+9
+	rtn
+dongle_usb_vid_pid_for_suit:
+	fetch 4,mem_usb_vid_pid+5
+	branch dongle_usb_vid_pid_store
+
+dongle_usb_hid_icon_config:
+	fetch 1,mem_dg_kb_bind_flag
+	beq DONGLE_KB_BIND_SUCCESS,dongle_usb_kb_hidreportdesc
+	setarg USB_KBDATA_VENDOR_DEFINE_ADDR
+	store 2,mem_hidreportdesc_kb
+	jam 0x1a,mem_confdesc+26//hid_descriptor--keyboard length
+	rtn
+dongle_usb_kb_hidreportdesc:
+	setarg USB_KBDATA_ADDR
+	store 2,mem_hidreportdesc_kb
+	jam 0x3f,mem_confdesc+26//hid_descriptor--keyboard length	
+	rtn
+
+dongle_usb_device_name:
+	fetch 1,mem_dg_usb_device_name
+	rtn blank
+	arg mem_dg_usb_device_name,contr
+	arg mem_string2,contw
+	arg 30,loopcnt
+	branch memcpy
+
+
+dongle_all_powerful:
+	call g24_switch_work_mode
+dongle_all_powerful_loop:
+	call dongle_work_mode_auto
+	call dongle_usb_dispatch
+	branch dongle_all_powerful_loop
+
+dongle_pc_bind:
+	call g24_switch_work_mode
+dongle_pc_bind_loop:	
+	call dongle_work_mode_auto
+	call g24_bind_mode_auto
+	call dongle_usb_dispatch
+	branch dongle_pc_bind_loop
+
+dongle_g24_blank_data_process:
+	call dongle_g24_ms_blank_data
+	call dongle_g24_kb_blank_data
+	branch dongle_g24_kb_mul_blank_data
+
+dongle_g24_ms_blank_data:
+	fetch 1,mem_dg_ms_blank_data_enable
+	rtn blank
+	arg TIMER_MS_BLANK,queue
+	call timer_check
+	nrtn blank
+	jam 0,mem_dg_ms_blank_data_enable
+	setarg MS_REPORT_ID
+	store 1,mem_usb_mouse_data
+	setarg 0
+	istore 7,contw
+dongle_usb_tx_ms_data:
+	jam USB_EP2_MS,mem_usb_ep2_data
+dongle_usb_tx_enable_ep2:
+	fetch 1,mem_usb_tx_enable
+	set1 2,pdata
+	store 1,mem_usb_tx_enable
+	rtn
+
+dongle_g24_kb_blank_data:
+	fetch 1,mem_dg_kb_blank_data_enable
+	rtn blank
+	arg TIMER_KB_BLANK,queue
+	call timer_check
+	nrtn blank
+	jam 0,mem_dg_kb_blank_data_enable
+	arg mem_usb_kb_data,contw
+	arg 2,loopcnt
+	call memset0
+dongle_usb_tx_kb_data:	
+	jam KB_NORMAL_REPORT_ID,mem_usb_kb_data
+dongle_usb_tx_enable_ep1:
+	jam USB_EP1_KB,mem_usb_ep1_data
+	fetch 1,mem_usb_tx_enable
+	set1 1,pdata
+	store 1,mem_usb_tx_enable
+	rtn
+
+dongle_g24_kb_mul_blank_data:
+	fetch 1,mem_dg_kb_mul_blank_data_enable
+	rtn blank
+	arg TIMER_KB_MUL_BLANK,queue
+	call timer_check
+	nrtn blank
+	jam 0,mem_dg_kb_mul_blank_data_enable
+	arg mem_usb_kb_multikey,contw
+	arg 2,loopcnt
+	call memset0
+	jam KB_MULTIKEY_REPORT_ID,mem_usb_kb_multikey
+dongle_usb_tx_multikey_data:
+	jam USB_EP2_MULTIKEY,mem_usb_ep2_data
+	branch dongle_usb_tx_enable_ep2
+
+dongle_usb_dispatch:
+	bpatch patch17_3,mem_patch17
+	call usb_isr
+	fetch 1,mem_usb0_get_set_report
+	rtn blank
+	jam 0,mem_usb0_get_set_report
+	fetch 2,mem_usb_setup_bValue_temp
+	arg PC_SET_REPORT,temp
+	isub temp,null
+	nrtn zero
+	//get usb host command
+	fetch 1,mem_usb0_set_report_data
+	rtnne PC_REPORT_ID
+	fetch 1,mem_usb0_set_report_data+1
+	beq COMMAND_MODE,dongle_dispose_cmd_mode
+	beq COMMAND_BIND,dongle_dispose_cmd_bind
+	beq COMMAND_CURRENT_PROJECT,dongle_dispose_cmd_current_project
+	beq COMMAND_CURRENT_MODE,dongle_dispose_cmd_current_mode
+	beq COMMAND_CURRENT_FW_VERSION,dongle_dispose_cmd_current_fw_version
+//	beq COMMAND_USER_DEFINED,dongle_dispose_cmd_user_defined
+dongle_usb0_data_ready_report_set0:
+	jam 0,mem_usb0_data_ready_report
+	rtn
+
+dongle_dispose_cmd_mode:
+	fetch 1,mem_usb0_set_report_data+2
+	beq COM_MODE_BIND,dongle_enter_bind_mode
+	branch dongle_usb0_data_ready_report_set0
+dongle_enter_bind_mode:
+	call g24_bind_mode_enable
+dongle_usb0_data_ready_report_set1:
+	jam 1,mem_usb0_data_ready_report
+	rtn
+
+dongle_dispose_cmd_bind:
+	fetch 1,mem_usb0_set_report_data+2
+	beq COM_BIND_GET,dongle_dispose_cmd_get_bind
+	beq COM_BIND_EXIT,dongle_dispose_cmd_exit_bind
+	beq COM_READ_MODE,dongle_dispose_cmd_read_mode
+	branch dongle_usb0_data_ready_report_set0
+dongle_dispose_cmd_get_bind:
+	fetch 1,mem_24g_bind_device_status
+	store 1,mem_usb0_get_report_data+1
+	branch dongle_usb0_data_ready_report_set1
+dongle_dispose_cmd_exit_bind:
+	call g24_work_mode_enable
+	branch dongle_dispose_cmd_get_bind
+dongle_dispose_cmd_read_mode:
+dongle_dispose_in_bind_mode:
+	jam COMMAND_BIND,mem_usb0_get_report_data+1
+	branch dongle_usb0_data_ready_report_set1	
+
+dongle_dispose_cmd_current_project:
+	jam PRODUCT_ID,mem_usb0_get_report_data+1
+	branch dongle_usb0_data_ready_report_set1
+
+dongle_dispose_cmd_current_mode:
+	fetch 1,mem_24g_work_mode
+	beq DONGLE_WORK,dongle_dispose_in_work_mode
+	beq DONGLE_BIND,dongle_dispose_in_bind_mode
+	rtn
+dongle_dispose_in_work_mode:
+	jam COMMAND_MODE,mem_usb0_get_report_data+1
+	branch dongle_usb0_data_ready_report_set1
+	
+dongle_dispose_cmd_current_fw_version:
+	jam FW_VERSION0,mem_usb0_get_report_data+1
+	jam FW_VERSION1,mem_usb0_get_report_data+2
+	jam FW_VERSION2,mem_usb0_get_report_data+3
+	jam FW_VERSION3,mem_usb0_get_report_data+4
+	branch dongle_usb0_data_ready_report_set1
+
+//dongle_dispose_cmd_user_defined:
+//	call g24_ackpayload_disable
+//	fetch 1,mem_usb0_set_report_data+2
+//	beq 0xff,soft_reset_chip
+//	rtn
+
+dongle_auto_bind:
+	call g24_mode_switch_init
+dongle_auto_bind_loop:
+	call g24_mode_switch
+	call dongle_work_mode_auto
+	call g24_bind_mode_auto
+	call g24_search_mode_auto
+	call dongle_usb_dispatch
+	branch dongle_auto_bind_loop
+
+dongle_work_mode_auto:
+	bpatch patch17_4,mem_patch17
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_WORK
+	call g24_work_mode_start
+	call dongle_g24_blank_data_process
+	fetch 1,mem_24g_pair_mode
+	nrtn blank
+	branch g24_nodata_process
+
+dongle_ackpayload_prep:
+	fetch 1,mem_24g_ackpayload_enable
+	beq BIND_ACKPAYLOAD,g24_bind_ackpayload_prep
+	beq KB_LED_ACKPAYLOAD,dongle_g24_kb_led_ackpayload_prep
+	rtn
+
+dongle_g24_kb_led_ackpayload_prep:
+	fetch 1,mem_24g_rxbuf+2
+	beq DATATYPE_DEVICE1,g24_bind_ackpayload_prep
+	beq DATATYPE_ATTEMP,g24_bind_ackpayload_prep
+	jam 0,mem_usb_tx_win_enable
+	jam 0x01,mem_24g_datalen
+	fetch 1,mem_24g_led_status
+	store 1,mem_24g_txbuf
+	rtn
+
+dongle_g24_mouse:
+	setarg MS_REPORT_ID
+	store 1,mem_usb_mouse_data	//report id
+	fetch 7,mem_24g_rxdata_temp+3	//key
+	istore 7,contw
+	fetch 1,mem_24g_rxdata_temp+3	//key
+	ncall dongle_g24_ms_enable_blank_data_forcibly,blank//get kb data
+	fetch 1,mem_24g_rxdata_temp+3	//key
+	call dongle_g24_ms_disable_blank_data_forcibly,blank
+	branch dongle_usb_tx_ms_data
+
+dongle_g24_ms_enable_blank_data_forcibly:
+	jam 1,mem_dg_ms_blank_data_enable
+	setarg TIMER_MS_BLANK_DELAY
+	arg TIMER_MS_BLANK,queue
+	branch timer_init
+
+dongle_g24_ms_disable_blank_data_forcibly:
+	jam 0,mem_dg_ms_blank_data_enable
+	setarg 0
+	arg TIMER_MS_BLANK,queue
+	branch timer_init
+
+dongle_g24_kb:
+	fetch 1,mem_24g_rxdata_temp+3
+	beq 0,dongle_g24_kb_type0	//normal key
+	beq 2,dongle_g24_kb_type2	//system key
+	beq 3,dongle_g24_kb_type3	//multikey
+	branch g24_rx_interrupt_clear
+
+dongle_g24_kb_type0:
+	fetch 1,mem_24g_rxdata_temp+5
+	store 1,mem_24g_ackpayload_enable
+	jam 0,mem_24g_rxdata_temp+5
+	arg mem_usb_kb_data,contw
+	arg mem_24g_rxdata_temp+4,contr
+	arg 8,loopcnt
+	call memcpy
+	fetch 8,mem_usb_kb_data
+	ncall dongle_g24_kb_enable_blank_data_forcibly,blank//get kb data
+	fetch 8,mem_usb_kb_data	
+	call dongle_g24_kb_disable_blank_data_forcibly,blank
+	fetch 8,mem_usb_kb_data
+	store 8,mem_dg_kb_data_sta_data
+	fetcht 8,mem_dg_kb_data_last_data
+	isub temp,null
+	ncall dongle_usb_tx_enable_ep1,zero
+	fetch 8,mem_dg_kb_data_sta_data
+	store 8,mem_dg_kb_data_last_data
+	branch g24_rx_interrupt_clear
+
+dongle_g24_kb_enable_blank_data_forcibly:
+	jam 1,mem_dg_kb_blank_data_enable
+	setarg TIMER_KB_BLANK_DELAY
+	arg TIMER_KB_BLANK,queue
+	branch timer_init
+
+dongle_g24_kb_disable_blank_data_forcibly:
+	jam 0,mem_dg_kb_blank_data_enable
+	setarg 0
+	arg TIMER_KB_BLANK,queue
+	branch timer_init
+
+dongle_g24_kb_type3:
+	arg mem_usb_kb_multikey,contw
+	arg mem_24g_rxdata_temp+3,contr
+	arg 3,loopcnt
+	call memcpy
+	fetch 2,mem_usb_kb_multikey+1
+	ncall dongle_g24_kb_mul_enable_blank_data_forcibly,blank//get multikey data
+	fetch 2,mem_usb_kb_multikey+1
+	call dongle_g24_kb_mul_disable_blank_data_forcibly,blank
+	fetch 3,mem_usb_kb_multikey
+	store 3,mem_dg_kb_multikey_sta_data
+	fetcht 3,mem_dg_kb_multikey_last_data
+	isub temp,null
+	ncall dongle_usb_tx_multikey_data,zero
+	fetch 3,mem_dg_kb_multikey_sta_data
+	store 3,mem_dg_kb_multikey_last_data
+	branch g24_rx_interrupt_clear
+
+dongle_g24_kb_mul_enable_blank_data_forcibly:
+	jam 1,mem_dg_kb_mul_blank_data_enable
+	setarg TIMER_KB_MUL_BLANK_DELAY
+	arg TIMER_KB_MUL_BLANK,queue
+	branch timer_init
+	
+dongle_g24_kb_mul_disable_blank_data_forcibly:
+	jam 0,mem_dg_kb_mul_blank_data_enable
+	setarg 0
+	arg TIMER_KB_MUL_BLANK,queue
+	branch timer_init
+
+dongle_g24_kb_type2:
+	arg mem_usb_kb_system,contw
+	arg mem_24g_rxdata_temp+3,contr
+	arg 2,loopcnt
+	call memcpy
+	fetch 2,mem_usb_kb_system
+	ncall dongle_g24_kb_sys_enable_blank_data_forcibly,blank
+	fetch 2,mem_usb_kb_system
+	call dongle_g24_kb_sys_disable_blank_data_forcibly,blank
+	fetch 2,mem_usb_kb_system
+	store 2,mem_dg_kb_system_sta_data
+	fetcht 2,mem_dg_kb_system_last_data
+	isub temp,null
+	ncall dongle_usb_tx_sys_data,zero
+	fetch 2,mem_dg_kb_system_sta_data
+	store 2,mem_dg_kb_system_last_data
+	branch g24_rx_interrupt_clear
+
+dongle_g24_kb_sys_enable_blank_data_forcibly:
+	jam 1,mem_dg_kb_mul_blank_data_enable
+	setarg TIMER_KB_MUL_BLANK_DELAY
+	arg TIMER_KB_MUL_BLANK,queue
+	branch timer_init
+dongle_g24_kb_sys_disable_blank_data_forcibly:
+	jam 0,mem_dg_kb_mul_blank_data_enable
+	setarg 0
+	arg TIMER_KB_MUL_BLANK,queue
+	branch timer_init
+
+dongle_usb_tx_sys_data:
+	jam USB_EP2_SYSTEMKEY,mem_usb_ep2_data
+	branch dongle_usb_tx_enable_ep2
+
+	
+
+
+endif
+
+
Index: program/app_esl.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_esl.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_esl.prog	(working copy)
@@ -0,0 +1,887 @@
+
+ifdef COMPILE_ESL
+/**************************************INFO LOG FUNC0******************************************/
+eink_log_push_2Bdec:
+	arg 2,debug
+	call eink_log_hex2dec
+	jam 0,mem_eink_log_hex2dec_ptr
+eink_log_push_2Bdec_loop:
+	setarg mem_eink_log_hex2dec
+	fetcht 1,mem_eink_log_hex2dec_ptr
+	iadd temp,contr
+	ifetch 1,contr
+	and_into 0xf,pdata
+	call eink_log_num
+	fetch 1,mem_eink_log_hex2dec_ptr
+	increase 1,pdata
+	store 1,mem_eink_log_hex2dec_ptr
+	fetch 1,mem_eink_log_hex2dec_len
+	increase -1,pdata
+	store 1,mem_eink_log_hex2dec_len
+	nbranch eink_log_push_2Bdec_loop,blank
+	rtn
+
+eink_log_push:
+	fetch 1,mem_eink_log_last_letter	//if(last_letter != letter)
+	fetcht 1,mem_eink_log_letter
+	isub temp,null
+	nbranch eink_log_push_real,zero
+
+	fetch 1,mem_eink_log_last_cmd	//if(last_cmd != cmd)
+	fetcht 1,mem_eink_log_cmd
+	isub temp,null
+	nbranch eink_log_push_real,zero
+	
+	fetch 1,mem_eink_log_last_ch	//if(last_ch != ch)
+	fetcht 1,mem_eink_log_ch
+	isub temp,null
+	nbranch eink_log_push_real,zero
+	
+	fetch 1,mem_eink_log_last_star
+	rtneq CHAR_ASTERISK					//if(last_star == '*')    *:0x2A
+	setarg CHAR_ASTERISK
+	call eink_log_font
+	jam CHAR_ASTERISK,mem_eink_log_last_star
+	rtn
+	
+eink_log_push_real:
+	fetch 1,mem_eink_log_letter
+	call eink_log_font
+
+	fetch 1,mem_eink_log_cmd
+	call eink_log_num
+
+	call eink_log_minus
+
+	fetch 1,mem_eink_log_ch
+	call eink_log_num
+
+	call eink_log_minus
+
+	fetch 1,mem_eink_log_rssi
+	call eink_log_num
+
+	fetch 5,mem_eink_log_info
+	store 5,mem_eink_log_last_info
+	jam 0,mem_eink_log_last_star
+	rtn
+	
+
+/* print 1 byte of pdata to ring buffer screen log*/
+eink_log:
+	compare CHAR_ASTERISK,pdata,0xFF     //if(last_star == '*') *:0x2A
+	ncall eink_log_clear_last,true
+
+	copy pdata,regc
+	fetch 1,mem_eink_log_front
+	copy pdata,rega						//front -> rega
+	fetch 1,mem_eink_log_end				
+	copy pdata,regb						//end -> regb
+       
+	increase 1,rega						//front =+ 1
+	div rega,EINK_LOG_MAX				// front%20
+	call wait_div_end
+	remainder temp						//temp = front%30
+	copy temp,pdata
+	icompare 0xFF,regb					//if( front%30 == end)
+	branch eink_log_full,true
+	branch eink_log_not_full
+
+eink_log_num:
+	jam 1,mem_eink_log_is_byte		//set is  byte
+	branch eink_log
+eink_log_font:
+	jam 0,mem_eink_log_is_byte		//set is not byte
+	branch eink_log
+
+eink_log_clear_last:
+	jam 0,mem_eink_log_last_star
+	jam 0,mem_eink_log_last_letter
+	jam 0,mem_eink_log_last_cmd
+	jam 0,mem_eink_log_last_ch
+	rtn
+
+eink_log_full:
+	fetch 1,mem_eink_log_front				//ringbuf[front] = cmd;
+	arg mem_eink_log_ring_buffer,rega
+	iadd rega,rega
+	copy regc,pdata
+	istore 1,rega
+	call eink_log_set_byte_flag					//modify is-byte flag
+		
+	fetch 1,mem_eink_log_front				//front = (front + 1)%BUF_LEN;
+	increase 1,pdata
+	div pdata,EINK_LOG_MAX
+	call wait_div_end
+	remainder temp
+	storet 1,mem_eink_log_front
+
+	fetch 1, mem_eink_log_end					//end = (end + 1)%BUF_LEN;
+	increase 1,pdata
+	div pdata,EINK_LOG_MAX
+	call wait_div_end
+	remainder temp
+	storet 1,mem_eink_log_end
+	rtn
+
+eink_log_not_full:
+	fetch 1,mem_eink_log_front				//ringbuf[front] = cmd;
+	arg mem_eink_log_ring_buffer,rega
+	iadd rega,rega
+	copy regc,pdata
+	istore 1,rega
+	call eink_log_set_byte_flag					//modify is-byte flag
+
+	fetch 1,mem_eink_log_front				//front = (front + 1)%BUF_LEN;
+	increase 1, pdata
+	div pdata,EINK_LOG_MAX
+	call wait_div_end
+	remainder temp
+	storet 1,mem_eink_log_front
+	rtn
+
+eink_log_set_byte_flag:
+ 	fetch 1,mem_eink_log_front				//modify is-byte flag
+ 	div pdata,8
+ 	call wait_div_end
+ 	quotient pdata
+ 	remainder temp
+	arg mem_eink_log_ring_buffer_flag,regc
+	iadd regc,regc
+	ifetch 1,regc                       //now regc is flag byte addr
+	copy pdata,rega                //now pdata and rega is flag byte data
+
+	fetch 1,mem_eink_log_is_byte		//modify bit of is-byte 
+	call eink_log_set_flag_font,blank
+	ncall eink_log_set_flag_byte,blank
+
+	copy rega,pdata					//save back to mem
+ 	istore 1,regc
+	rtn
+
+eink_log_set_flag_font:
+	copy temp,queue
+	disable user
+	qsetflag user,rega
+	rtn
+eink_log_set_flag_byte:
+ 	copy temp,queue
+ 	enable user
+	qsetflag user,rega
+ 	rtn
+
+//rega:src buff
+//debug:length
+eink_log_hex2dec:
+	arg mem_eink_log_hex2dec,regc
+eink_log_calc_loop:
+	call eink_log_hex2dec_Rptr
+	call bcd2
+	call eink_log_hex2dec_Rcnt
+	disable user
+eink_log_bcd_loop:
+	ifetch 1,regb
+	and_into 0x1f,pdata
+	branch eink_log_do_store,user
+	branch eink_log_skip_prefix,blank
+eink_log_do_store:
+	and_into 0xf,pdata
+	call eink_store_barcode
+	enable user
+eink_log_skip_prefix:
+	increase 1,regb
+	loop eink_log_bcd_loop
+	deposit regc
+	arg mem_eink_log_hex2dec,contr
+	isub contr,pdata
+	store 1,mem_eink_log_hex2dec_len
+	copy pdata,loopcnt
+	arg mem_eink_log_hex2dec,contw
+eink_display_dec_loop:
+	arg 0x2e,temp
+	ifetch 1,contw
+	add pdata,0x30,temp
+	istoret 1,contw
+	loop eink_display_dec_loop
+	rtn
+
+eink_store_barcode:
+	istore 1,regc
+	increase 1,regc
+	rtn	
+
+eink_log_hex2dec_Rptr:
+	copy debug,pdata
+	beq 1,rega_read_1byte
+	beq 2,rega_read_2bytes
+	rtn
+rega_read_1byte:
+	ifetch 1,rega
+	rtn
+rega_read_2bytes:
+	ifetch 2,rega
+	rtn
+
+eink_log_hex2dec_Rcnt:
+	copy debug,pdata
+	beq 1,bcd_read_1byte
+	beq 2,bcd_read_2bytes
+	rtn
+bcd_read_1byte:
+	arg 3,loopcnt
+	arg mem_bcd+5,regb
+	rtn
+bcd_read_2bytes:
+	arg 5,loopcnt
+	arg mem_bcd+3,regb	
+	rtn
+
+eink_log_break:
+	setarg LETTER_B					//'B'
+	call eink_log_font
+	arg mem_parse_cnt,rega
+	call eink_log_push_2Bdec
+	call eink_log_minus				//'-'
+	fetch 1,mem_esl_24g_current_ch
+	call eink_log_num
+	call eink_log_minus				//'-'
+	fetch 1,mem_esl_24g_behavior
+	branch eink_log_num
+
+eink_log_supervision_timeout:
+	call eink_log_break
+eink_log_fail:
+	setarg LETTER_F					//'F'
+	call eink_log_font
+	fetch 2,mem_rx_cnt
+	branch eink_log_fail_rx_null,blank
+	isolate1 mark_24g_old_packet,mark
+	branch eink_log_fail_old_pac,true
+eink_log_fail_rx_lost:	
+	setarg EINK_LOG_RX_LOST
+	branch eink_log_num	
+eink_log_fail_rx_null:
+	setarg EINK_LOG_RX_NULL
+	branch eink_log_num
+eink_log_fail_old_pac:
+	setarg EINK_LOG_OLD_PAC
+	branch eink_log_num
+
+
+eink_log_minus:
+	setarg CHAR_MINUS
+	branch eink_log_font
+
+eink_log_s:
+	setarg LETTER_S					//'S'
+	branch eink_log_font
+
+eink_set_orig:
+	arg mem_eink_orig,regb
+	branch eink_wr_seq
+
+eink_init_seq:
+	arg mem_eink_init_offset,regb
+	call eink_wr_seq
+	arg mem_eink_init,regb
+eink_wr_seq:
+	ifetch 8,regb
+	rtneq 0xff
+	and pdata,0xff,regc
+	call eink_spid_cmd
+	add regc,2,pdata
+	iadd regb,regb
+	branch eink_wr_seq
+
+	// pdata[7:0] data length pdata [15:8] command pdata[63:16] data
+eink_spid_cmd:
+	and pdata,0xff,rega
+	rshift8 pdata,pdata
+	store 7,mem_spid_tbuf
+eink_spid_data:
+	setarg mem_spid_tbuf
+	call eink_spid_buf
+	call start_spid
+eink_spid_end:
+	fetcht 1,mem_cs
+	branch gpio_out_inactive
+
+
+	// pdata: tx buffer, rega is data length	
+eink_spid_buf:
+	store 2,core_spid_txaddr
+	fetcht 1,mem_cs
+	call gpio_out_active
+	fetcht 1,mem_dc
+	call gpio_out_active
+	setarg 1
+	store 2,core_spid_txlen
+	call start_spid
+	fetcht 1,mem_dc
+	call gpio_out_inactive
+	deposit rega
+	branch eink_spid_end,blank
+	store 2,core_spid_txlen
+	fetch 2,core_spid_txaddr
+	increase 1,pdata
+	store 2,core_spid_txaddr
+	rtn
+
+start_spid:
+	jam spid_start,core_misc_ctrl
+	branch wait_spid_done
+
+
+/**********************************RLE UNCOMPRESS FUNC***********************************/
+uncompress_init:
+	jam 0,mem_uncom_image_att_flag
+	jam 0,mem_uncom_fliter_data_flag
+	arg 0x20,loopcnt
+	arg mem_uncom_the_first_two_buff,contw
+	call memset0
+	setarg mem_uncom_clear_once_end
+	arg mem_uncom_clear_once_start,contw
+	isub contw,loopcnt
+	call clear_mem
+	setarg mem_esl_24g_rxpayload
+	arg UNCOM_SRC_INDEX,temp
+	iadd temp,pdata
+	store 2,mem_uncom_src_end
+uncompress_mem_clear_everytime:
+	setarg mem_uncom_clear_everytime_end
+	arg mem_uncom_clear_everytime_start,contw
+	isub contw,loopcnt
+	branch clear_mem
+
+uncompress_dispatch:
+	//fetch 1,mem_uncom_image_att_flag
+	//beq 0,umcompress_image_att
+	fetch 1,mem_uncom_fliter_data_flag
+	beq 1,uncompress_fliter_redundant_data
+	call uncompress_start
+	fetch 2,mem_uncom_current_len
+	rtn blank
+	call uncompress_image
+	branch wait_spid_done  //should wait spi write data finish
+	
+uncompress_fliter_redundant_data:
+	jam 0,mem_uncom_fliter_data_flag
+	call uncompress_start
+	fetchr loopcnt,1,mem_uncom_current_len
+	arg mem_uncom_the_first_two_buff,contw
+	arg mem_uncom_dest+1,contr
+	call memcpy
+	/******************reuse temp********************/	
+	fetch 2,mem_uncom_total_len
+	fetcht 1,mem_uncom_fliter_datalen
+	isub temp,pdata
+	store 2,mem_uncom_total_len
+	fetch 2,mem_uncom_current_len
+	isub temp,pdata
+	store 2,mem_uncom_current_len
+	fetchr loopcnt,1,mem_uncom_current_len
+	setarg mem_uncom_the_first_two_buff
+	iadd temp,contr
+	arg mem_uncom_dest+1,contw
+	call memcpy
+	/******************reuse temp********************/	
+	branch uncompress_image
+
+
+umcompress_image_att:
+	call uncompress_start
+	setarg mem_uncom_the_first_two_buff
+	fetcht 1,mem_uncom_the_first_two_index
+	iadd temp,contw
+	fetchr loopcnt,1,mem_uncom_current_len
+	arg mem_uncom_dest+1,contr
+	call memcpy
+	fetch 1,mem_uncom_the_first_two_index
+	branch umcompress_image_att_index,blank
+	jam 1,mem_uncom_image_att_flag
+	fetch 2,mem_uncom_total_len
+	pincrease -62	//UNCOM_IMAGE_ATT_LENTH
+	store 2,mem_uncom_total_len
+	store 2,mem_uncom_current_len
+	arg mem_uncom_the_first_two_buff,contr
+	arg mem_uncom_image_att_buf,contw
+	arg UNCOM_IMAGE_ATT_LENTH,loopcnt
+	call memcpy
+	fetchr loopcnt,1,mem_uncom_current_len
+	arg mem_uncom_the_first_two_buff+UNCOM_IMAGE_ATT_LENTH,contr
+	arg mem_uncom_dest+1,contw
+	call memcpy
+	branch uncompress_image
+
+
+umcompress_image_att_index:
+	fetch 1,mem_uncom_current_len
+	store 1,mem_uncom_the_first_two_index
+	rtn
+
+uncompress_start:
+	setarg 0
+	store 3,mem_uncom_dest_index
+	call uncompress_left_check
+	fetch 1,mem_uncom_src_index
+	beq UNCOM_SRC_LENGTH,uncompress_end
+uncompress_loop:
+	call uncompress_read_head
+	fetch 1,mem_uncom_block_head
+	branch uncompress_end,blank
+	bbit1 7,uncompress_original
+uncompress_repetition:
+	jam 1,mem_uncom_repetitive
+	fetcht 2,mem_uncom_block_body_ptr
+	fetch 2,mem_uncom_src_end
+	isub temp,null
+	nbranch repetition_overflow,positive
+	fetchr rega,1,mem_uncom_block_len
+	call uncompress_repetition_memcpy
+	fetch 1,mem_uncom_src_index
+	sub pdata,UNCOM_SRC_INDEX,null
+	branch uncompress_loop,positive
+uncompress_repetition_end:
+uncompress_original_end:
+	jam 0,mem_uncom_repetitive
+	jam 0,mem_uncom_left_len
+uncompress_end:
+	fetch 2,mem_uncom_dest_index
+	store 2,mem_uncom_current_len
+	rtn
+
+repetition_overflow:
+	fetch 1,mem_uncom_block_len
+	store 1,mem_uncom_left_len
+	branch uncompress_end
+
+uncompress_original:
+	jam 2,mem_uncom_repetitive
+	fetcht 2,mem_uncom_block_body_ptr
+	fetch 2,mem_uncom_src_end
+	isub temp,null
+	nbranch original_overflow_head_left,positive
+
+	fetch 1,mem_uncom_block_len
+	iadd temp,temp
+	fetch 2,mem_uncom_src_end
+	isub temp,temp
+	nbranch original_overflow_body_left,positive
+
+	fetchr rega,1,mem_uncom_block_len
+	call uncompress_original_memcpy
+	fetch 1,mem_uncom_src_index
+	sub pdata,UNCOM_SRC_INDEX,null
+	branch uncompress_loop,positive
+	branch uncompress_original_end
+
+original_overflow_head_left:
+	fetch 1,mem_uncom_block_len
+	store 1,mem_uncom_left_len
+	branch uncompress_end
+
+original_overflow_body_left:
+	sub temp,0,temp
+	increase -1,temp
+	storet 1,mem_uncom_left_len
+	fetch 1,mem_uncom_block_len
+	isub temp,pdata
+	store 1,mem_uncom_block_len
+	fetchr rega,1,mem_uncom_block_len
+	call uncompress_original_memcpy
+	branch uncompress_end
+
+uncompress_left_check:
+	fetch 1,mem_uncom_left_len
+	rtn blank
+	fetch 1,mem_uncom_repetitive
+	beq 2,uncompress_left_original
+uncompress_left_repetition:
+	fetchr rega,1,mem_uncom_left_len
+uncompress_repetition_memcpy:
+	copy rega,loopcnt
+	call uncompress_dest_contw
+repetition_memcpy_loop:
+	call uncompress_src_contr
+	ifetch 1,contr
+	istore 1,contw
+	loop repetition_memcpy_loop
+	call uncompress_src_index_add_one
+	/******************reuse temp********************/
+	copy rega,temp
+	call uncompress_dest_index_add_len
+	branch uncompress_total_len_add_len
+	/******************reuse temp********************/
+
+uncompress_left_original:
+	fetch 1,mem_uncom_left_len
+	sub pdata,UNCOM_SRC_INDEX,null
+	nbranch uncompress_left_original_continue,positive
+	fetchr rega,1,mem_uncom_left_len
+uncompress_original_memcpy:
+	copy rega,loopcnt
+	call uncompress_dest_contw
+	call uncompress_src_contr
+	call memcpy
+	/******************reuse temp********************/
+	copy rega,temp
+	call uncompress_src_index_add_len
+	call uncompress_dest_index_add_len
+	branch uncompress_total_len_add_len
+	/******************reuse temp********************/
+
+uncompress_left_original_continue:
+	fetch 1,mem_uncom_left_len
+	increase -32,pdata	//24g data len
+	store 1,mem_uncom_left_len
+	arg 32,rega			//24g data len
+	branch uncompress_original_memcpy
+
+uncompress_read_head:
+	call uncompress_src_contr
+	ifetch 1,contr
+	store 1,mem_uncom_block_head
+	and_into 0x7f,pdata
+	store 1,mem_uncom_block_len
+	copy contr,pdata
+	store 2,mem_uncom_block_body_ptr
+uncompress_src_index_add_one:
+	fetch 1,mem_uncom_src_index
+	increase 1,pdata
+	store 1,mem_uncom_src_index
+	rtn
+
+uncompress_src_contr:
+	setarg mem_esl_24g_rxpayload
+	fetcht 1,mem_uncom_src_index
+	iadd temp,contr
+	rtn
+
+uncompress_dest_contw:
+	setarg mem_uncom_dest
+	pincrease 1
+	fetcht 2,mem_uncom_dest_index
+	iadd temp,contw
+	rtn
+
+uncompress_src_index_add_len:
+	fetch 1,mem_uncom_src_index
+	iadd temp,pdata
+	store 1,mem_uncom_src_index
+	rtn
+
+uncompress_total_len_add_len:
+	fetch 2,mem_uncom_total_len
+	iadd temp,pdata
+	store 2,mem_uncom_total_len
+	rtn
+
+uncompress_dest_index_add_len:
+	fetch 2,mem_uncom_dest_index
+	iadd temp,pdata
+	store 2,mem_uncom_dest_index
+	rtn
+
+
+uncompress_eink_type:
+	jam 0x24,mem_uncom_dest
+	rtnmark0 mark_eink_red
+	jam 0x26,mem_uncom_dest
+	rtn	
+
+uncompress_image:
+	setarg mem_uncom_dest
+	store 2,mem_eink_head
+	fetch 2,mem_image_ptr
+	call eink_set_orig,blank
+	call uncompress_eink_type
+	fetcht 2,mem_uncom_current_len
+	copy temp,rega
+	fetch 2,mem_image_ptr
+	copy pdata,regb
+	iadd temp,pdata
+	store 2,mem_image_ptr
+	fetcht 2,mem_eink_size
+	isub temp,pdata
+	nbranch esl_write_full,positive
+	bmark1 mark_eink_red,uncompress_image_red
+uncompress_image_black:
+	store 2,mem_uncom_current_len	//red ram length
+	fetch 2,mem_eink_size
+	isub regb,rega		//black ram left length
+	fetch 2,mem_uncom_current_len
+	branch uncompress_image_black_end,blank
+	call esl_write_ram
+	call wait_spid_done	//wait write eink ram done
+	fetch 2,mem_uncom_current_len
+	fetcht 1,mem_uncom_fliter_datalen
+	isub temp,pdata
+	store 2,mem_uncom_current_len
+	copy pdata,loopcnt
+	setarg mem_uncom_dest+1
+	fetcht 1,mem_uncom_fliter_datalen
+	iadd temp,pdata
+	iadd rega,contr
+	arg mem_uncom_dest+1,contw
+	call memcpy
+	branch uncompress_image
+
+uncompress_image_red:
+	copy rega,pdata
+	fetcht 1,mem_uncom_fliter_datalen
+	isub temp,rega
+	branch esl_write_ram
+
+uncompress_image_black_end:
+	jam 1,mem_uncom_fliter_data_flag
+	branch esl_write_ram
+
+
+esl_write_ram:
+	bmark1 mark_eink_red,lost_last_packet
+esl_write_ram_start:
+	call image_ptr_clear
+	set1 mark_eink_red,mark
+esl_write_full:	
+	fetch 2,mem_eink_head
+	call eink_spid_buf
+	jam spid_start,core_misc_ctrl
+	rtn
+	
+image_ptr_clear:
+	setarg 0
+	store 2,mem_image_ptr
+	rtn	
+	
+lost_last_packet:
+	call esl_write_ram_start
+	jam STATE_DATA_FINISH,mem_update_state
+	rtn
+	
+bcd2:
+	store 8,mem_pdatatemp
+	force 0x20,pdata
+	force 8,loopcnt
+	arg mem_bcd,contw
+lpo_clear:	
+	istore 1,contw
+	loop lpo_clear
+	arg mem_bcd,contw
+	increase 7,contw
+	fetch 8,mem_pdatatemp
+bcd_loop:
+	div pdata,10
+	call wait_div_end
+	remainder pdata
+	or_into 0x30,pdata
+	istore 1,contw
+	increase -2,contw
+	quotient pdata
+	rtn blank
+	branch bcd_loop
+
+
+/**************************************INFO DISPALY FUNC******************************************/
+eink_chksum:
+	ifetch 1,rega
+	imul32 temp,pdata
+	iadd regb,regb
+	increase 1,temp
+	increase -1,rega
+	setarg mem_barcode_start
+	isub rega,null
+	nbranch eink_chksum,zero
+	div regb,47
+	call wait_div_end
+	remainder pdata
+	branch eink_store_barcode
+	// pdata: 0-9, 37=dot, 47=start/stop
+eink_display_barcode_byte:
+	arg mem_code93,contr
+	iadd contr,contr
+	ifetchr debug,1,contr
+	arg 7,queue
+eink_display_barcode_byte_loop:
+	call eink_setxy
+	qisolate1 debug
+	call eink_display_barcode_x
+	increase -1,queue
+	branch eink_display_barcode_byte_loop,positive
+	call eink_setxy
+	isolate1 0,null
+eink_display_barcode_x:
+	setarg 0x100
+	iadd timeup,timeup
+	setarg 0
+	branch eink_display_barcode_blank,true
+	setarg -1
+eink_display_barcode_blank:
+	store 4,mem_spid_tbuf+1
+	jam 0x24,mem_spid_tbuf
+	arg 4,rega
+	branch eink_spid_data
+	
+eink_clear_loop:
+	arg 32,rega
+	call eink_spid_data
+	increase -32,regb
+	branch eink_clear_loop,positive
+	rtn
+	
+eink_log_battery_vol:
+	arg 2,debug
+	arg mem_battery_vol,rega
+	call eink_log_hex2dec
+	fetch 2,mem_eink_log_hex2dec+1
+	store 2,mem_eink_log_hex2dec+2
+	jam CHAR_DOT,mem_eink_log_hex2dec+1
+	jam 4,mem_eink_log_hex2dec_len	//'2.78'
+	branch eink_display_dec+1
+
+eink_log_broadcast_rssi:
+	fetch 1,mem_rssi_save	//broadcast
+	sub pdata,95,pdata
+	ncall enable_blank,positive
+	store 1,mem_rssi_temp
+	arg 1,debug
+	arg mem_rssi_temp,rega
+	branch eink_display_dec
+eink_log_unicast_rssi:
+	fetch 1,mem_esl_24g_rssi_save	//unicast
+	branch eink_log_broadcast_rssi+1
+eink_log_push_zero:
+	arg 1,debug
+	arg mem_eink_log_push_zero,rega
+	branch eink_display_dec
+
+eink_display_dec:
+	call eink_log_hex2dec
+	fetchr loopcnt,1,mem_eink_log_hex2dec_len
+	arg mem_eink_log_hex2dec,alarm
+	branch eink_display_str
+
+
+	// timeup is yx 24 bit
+eink_setxy:
+	and timeup,0xff,pdata
+	store 1,mem_eink_setxy+2
+	fetch 2,mem_eink_xy+1
+	rshift8 timeup,temp
+	isub temp,pdata
+	store 2,mem_eink_setxy+5
+	arg mem_eink_setxy,regb
+	branch eink_wr_seq
+
+eink_display_dot:
+	setarg CHAR_DOT
+	branch eink_display_font
+
+eink_display_comma:
+	setarg CHAR_COMMA
+	call eink_display_font
+	setarg 0x300
+	iadd timeup,timeup
+	rtn
+
+eink_display_space:
+	setarg CHAR_SPACE
+	branch eink_display_font
+	
+
+	// alarm points to bytes, loopcnt is length
+eink_display_str:
+	ifetch 1,alarm
+	call eink_display_font
+	increase 1,alarm
+	loop eink_display_str
+	rtn
+	// pdata:0-ff
+eink_display_byte:
+	and pdata,0xf,type
+	rshift4 pdata,pdata
+	call eink_display_hex
+	deposit type
+
+	// pdata:0-f
+eink_display_hex:
+	pincrease 0x30
+	sub pdata,0x39,null
+	branch eink_display_font,positive
+	pincrease 0x27
+
+	// pdata:char 0-9 for digit, > 65 for A-Z, timeup is yx
+eink_display_font:
+	arg 3,debug
+	beq 0x20,eink_display_font_space
+	beq 0x2e,eink_display_font_dot
+	beq 0x2c,eink_display_font_comma
+	arg 8,debug
+	beq 0x40,eink_display_font_at
+	beq 0x3e,eink_display_font_greater
+	beq 0x25,eink_display_font_percent
+	arg 6,debug
+	beq 0x3a,eink_display_font_colon
+	beq 0x2d,eink_display_font_minus
+	beq 0x2a,eink_display_font_asterisk
+	beq 0x23,eink_display_font_pound
+	sub pdata,0x39,null
+	branch eink_display_digit,positive
+	increase -97,pdata
+	arg 8,debug
+	branch eink_display_cont
+eink_display_font_percent:
+	setarg 45
+	branch eink_display_cont
+eink_display_font_asterisk:
+	setarg 44
+	branch eink_display_cont
+eink_display_font_greater:
+	setarg 43
+	branch eink_display_cont
+eink_display_font_at:
+	setarg 42
+	branch eink_display_cont
+eink_display_font_comma:
+	setarg 41
+	branch eink_display_cont
+eink_display_font_dot:
+	setarg 40
+	branch eink_display_cont
+eink_display_font_space:
+	setarg 39
+	branch eink_display_cont
+eink_display_font_pound:
+	setarg 38
+	branch eink_display_cont
+eink_display_font_colon:
+	setarg 37
+	branch eink_display_cont
+eink_display_font_minus:
+	setarg 36
+	arg 5,debug
+	branch eink_display_cont
+eink_display_digit:
+	increase -22,pdata
+eink_display_cont:
+	lshift3 pdata,pdata
+	arg mem_eink_font,temp
+	iadd temp,regext
+eink_display_font_loop:
+	call eink_setxy
+	ifetch 1,regext
+	pinvert
+	store 1,mem_spid_tbuf+1
+	jam 0x24,mem_spid_tbuf
+	arg 1,rega
+	call eink_spid_data
+	setarg 0x100
+	iadd timeup,timeup
+	increase 1,regext
+	increase -1,debug
+	nbranch eink_display_font_loop,zero
+	rtn
+
+
+
+endif
+
Index: program/app_module.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_module.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_module.prog	(working copy)
@@ -0,0 +1,1794 @@
+
+ifdef COMPILE_MODULE
+
+
+
+
+module_init:	
+	rtn wake
+	call le_modified_name
+	setarg module_process_idle
+	store 2,mem_cb_idle_process
+	setarg module_bt_conn_process
+	store 2,mem_cb_bt_process
+	setarg module_process_bb_event
+	store 2,mem_cb_bb_event_process
+	setarg module_lpm_lock
+	store 2,mem_cb_check_wakelock
+	setarg module_hci_cmd_transmit_le_notify
+	store 2,mem_cb_ble_transmit
+	setarg module_hci_event_receive_spp_data
+	store 2,mem_cb_receive_spp_data
+	setarg module_le_receive_data
+	store 2,mem_cb_att_write
+	setarg module_bb_event_timer
+	store 2,mem_cb_event_timer
+
+ifdef COMPILE_WECHAT
+	setarg module_wechat_rx_push_data
+	store 2,mem_module_wechat_rx_push_data_cb
+endif
+	call module_spp_clear_last_transmite_clock
+	bpatch patch17_5,mem_patch17
+	call module_lpm_uart_init
+	call module_gpio_init
+	branch module_hci_event_enter_standby_mode
+
+/*
+	function name:uart init by mem
+	input:
+		mem_module_uart_rx_buffer、mem_module_uart_rx_buffer_end
+		mem_module_uart_tx_buffer、mem_module_uart_tx_buffer_end
+		mem_module_uarta_baud_rate
+		bit0 of mem_module_flag
+*/
+module_lpm_uart_init:
+	fetch 1,core_uart_ctrl
+	set0 BIT_UART_CONTROL_ENABLE,pdata
+	store 1,core_uart_ctrl
+	fetch 8,mem_module_uart_rx_buffer
+	call uarta_init_dma_mem
+	fetch uart_baud_len,mem_module_uarta_baud_rate
+	call uarta_init_baud_rate
+	call uart_clock_select_main_freq_crystal
+	jam gpcfg_uart_txd,core_gpio_conf+HCI_UART_TX_GPIO_NUM
+	jam gpcfg_uart_rxd|gpcfg_pullup,core_gpio_conf+HCI_UART_RX_GPIO_NUM
+	jam gpcfg_uart_rts,core_gpio_conf+HCI_UART_RTS_GPIO_NUM
+	jam gpcfg_uart_cts,core_gpio_conf+HCI_UART_CTS_GPIO_NUM
+
+	arg FUN_UART_CONTROL_ENABLE|FUN_UART_CONTROL_SETTING_RATE_BAUD,temp
+	fetch 2,mem_module_flag
+	isolate1 MODULE_FLAG_UART_FLOW_CONTROL,pdata
+	setflag true,BIT_UART_CONTROL_FLOW_CONTROL,temp
+	storet 1,core_uart_ctrl
+	rtn
+
+/*
+	function:init uart & spp clock by lpm wake
+*/
+module_lpm_init:
+	call module_spp_clear_last_transmite_clock
+	branch module_lpm_uart_init
+
+
+
+/*
+	function name:module_gpio_init
+	init connect state & lpm wake up
+*/
+module_gpio_init:
+	fetcht 1,mem_module_connect_state_gpio
+	call gpio_config_output
+	call module_set_conn_pin_low
+	fetcht 1,mem_module_wake_up_gpio
+	branch gpio_config_input
+
+module_lpm_lock:
+	fetcht 1,mem_module_wake_up_gpio
+	call gpio_get_bit
+	nbranch app_put_lpm_wake_lock,true
+	branch app_get_lpm_wake_lock
+
+
+/*
+	function name:BT connect process callback
+	check sniff timer & check uart Tx buffer from SPP Credit
+*/
+module_bt_conn_process:
+	call module_spp_enter_sniff
+	branch module_control_air_flow
+
+module_spp_enter_sniff:
+	fetch 1,mem_ui_state_map
+	bbit0 UI_STATE_BT_SPP_CONN,module_spp_clear_last_transmite_clock
+	setarg 0x3eff
+	fetcht 4,mem_last_transmite_clock
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_SNIFF,module_spp_clear_last_transmite_clock
+	fetch 2,mem_module_flag
+	rtnbit1 MOUDLE_TASK_SNIFF
+	call module_set_sniff_task_flag
+	call app_bt_enter_sniff
+module_spp_clear_last_transmite_clock:
+	copy clkn_bt,pdata
+	store 4,mem_last_transmite_clock
+	rtn
+
+/*
+	function name:chip idle process callback
+	check uart Tx buffer from SPP Credit&check l2cap fifo&check uart rx data
+*/
+module_process_idle:
+	call module_control_air_flow
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	branch module_process_check_hci_command_complete
+
+	
+module_process_bb_event:
+	copy regc,pdata
+	beq BT_EVT_BB_CONNECTED,module_process_bb_conn
+	beq BT_EVT_BB_DISCONNECTED,module_process_bb_event_disconned
+	beq BT_EVT_RECONN_FAILED,module_process_reconn_fail
+	beq BT_EVT_SETUP_COMPLETE,module_process_setup_complete
+	beq BT_EVT_SPP_CONNECTED,module_process_spp_connected
+	beq BT_EVT_SPP_DISCONNECTED,module_process_spp_disconnected
+	beq BT_EVT_PINCODE_REQ,module_process_evt_pincode_req
+	beq BT_EVT_ENTER_SNIFF,module_process_enter_sniff
+	beq BT_EVT_EXIT_SNIFF,module_process_exit_sniff
+	beq BT_EVT_RECONN_PAGE_TIMEOUT,module_process_page_time_out
+	beq BT_EVT_LE_CONNECTED,module_process_le_conn
+	beq BT_EVT_LE_DISCONNECTED,module_process_bb_even_le_disconn
+	beq BT_EVT_SNIFF_NOT_ACCEPT,module_process_sniff_not_accept
+	beq BT_EVT_UNSNIFF_ACCEPT,module_process_unsniff_accept
+	beq BT_EVT_UNSNIFF_NOT_ACCEPT,module_process_unsniff_not_accept
+	beq BT_EVT_LE_PAIRING_FAIL,module_hci_event_le_pairing_fail
+	beq BT_EVT_LE_PAIRING_SUCCESS,module_hci_event_le_pairing_success
+	beq BT_EVT_LE_START_ENC,module_hci_event_start_enc
+	beq BT_EVT_LE_PAUSE_ENC,module_hci_event_pause_enc
+	beq BT_EVT_LE_TK_GENERATE,module_hci_event_le_tk
+	beq BT_EVT_BT_GKEY_GENERATE,module_hci_event_gkey_generate
+	beq BT_EVT_BT_GET_PASSKEY,module_hci_event_passkey_entry_mode
+	beq BT_EVT_BT_PAIRING_FAIL,module_hci_event_bt_pairing_fail	
+	beq BT_EVT_BT_PAIRING_SUCCESS,module_hci_event_bt_pairing_success
+ifdef SECURE_CONNECTION	
+	beq BT_EVT_LE_GKEY_GENERATE,module_hci_event_gkey_generate
+endif
+	beq BT_EVT_STORE_NVRAM,module_hci_event_store_device
+	beq BT_EVT_LE_LTK_LOST,module_process_ble_ltk_lost
+	beq BT_EVT_LE_UPDATE_PHY,module_process_ble_update_phy
+	beq BT_EVT_LE_GET_PASSKEY,module_hci_event_passkey_entry_mode
+	rtn
+
+	
+module_process_bb_event_disconned:
+	call module_spp_clear_last_transmite_clock
+	fetch 1,mem_flag_pairing_state
+	ncall module_hci_event_bt_pairing_fail,blank
+	call module_disconn_start
+	fetch 2,mem_ui_state_map
+	rtnbit0 UI_STATE_BT_SPP_CONN
+	branch  module_spp_disconnected
+
+module_process_spp_connected:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_SPP_CONN,pdata
+	store 2,mem_ui_state_map
+	fetch 1,mem_module_spp_lpm_mult
+	store 1,mem_lpm_mult
+	call module_set_conn_pin_low
+	branch module_hci_event_spp_connect
+
+module_process_spp_disconnected:
+//	branch module_spp_disconnected
+module_spp_disconnected:
+	fetch 2,mem_ui_state_map
+	rtnbit0 UI_STATE_BT_SPP_CONN
+	set0 UI_STATE_BT_SPP_CONN ,pdata
+	store 2,mem_ui_state_map
+	branch module_hci_event_spp_disconnect
+
+
+module_process_enter_sniff:
+
+module_sniff_param_check:
+	call module_spp_clear_last_transmite_clock
+	//fetch 1,mem_context
+	//rtnbit0 state_insniff
+	fetch 2,mem_context+coffset_tsniff
+	rshift pdata,pdata
+	fetcht 2,mem_sniff_param_interval
+	isub temp,null
+	nbranch module_sniff_param_check_unsniff,zero
+	branch app_lpm_mult_enable
+module_sniff_param_check_unsniff:
+	fetch 2,mem_module_flag
+	rtnbit1 MOUDLE_TASK_UNSNIFF
+	fetch 2,core_uart_rxitems    //*
+	ncall module_set_unsniff_task_flag,blank    //*加这两句话
+	branch app_bt_sniff_exit
+
+module_process_exit_sniff:
+	call module_clear_sniff_task_flag
+	branch app_lpm_mult_disable
+ 	
+module_process_setup_complete:
+	call module_spp_clear_last_transmite_clock
+	branch module_conn_start
+	
+module_process_bb_even_le_disconn:
+	call le_clr_config_more_data
+	jam 0,mem_module_hci_notify_len
+	call module_disconn_start
+	branch module_hci_event_le_disconnect
+
+module_process_evt_pincode_req:
+	branch  app_bt_set_pincode
+	
+
+module_process_sniff_not_accept:
+	branch module_clear_sniff_task_flag
+
+
+module_process_unsniff_accept:
+	fetch 2,mem_module_flag
+	bbit0 MOUDLE_TASK_UNSNIFF,app_bt_enter_sniff
+	branch module_clear_unsniff_task_flag
+
+	
+module_process_unsniff_not_accept:
+	branch module_clear_unsniff_task_flag
+
+	
+module_process_le_conn:
+//	call le_send_att_exchange_mtu_requset
+	call module_conn_start
+	fetch 1,mem_module_le_lpm_mult
+	store 1,mem_lpm_mult
+	branch module_hci_event_le_connect
+
+
+module_process_bb_conn:
+	jam 0,mem_flag_mode_ssp_pin
+	call module_clear_sniff_task_flag
+	branch module_clear_unsniff_task_flag
+
+module_process_page_time_out:
+module_process_reconn_fail:
+module_disconn_start:
+	call module_start_adv_discovery_by_command
+	branch module_set_conn_pin_high
+
+
+module_process_ble_ltk_lost:
+	call le_send_reject_ind
+	branch le_send_smp_security_request
+
+module_process_ble_update_phy:
+	branch module_hci_event_le_update_phy
+
+
+module_set_conn_pin_high:
+	fetcht 1,mem_module_connect_state_gpio
+	branch gpio_out_active
+
+module_conn_start:
+	call module_stop_adv_discovery
+	branch module_set_conn_pin_low
+	
+module_stop_adv_discovery:
+	fetch 1,mem_module_state
+	isolate1 MOUDLE_STATE_BT_BIT,pdata
+	call app_bt_stop_discovery,true
+	fetch 1,mem_module_state
+	isolate1 MOUDLE_STATE_BLE_BIT,pdata
+	call app_ble_stop_adv,true
+	rtn
+module_set_conn_pin_low:
+	fetcht 1,mem_module_connect_state_gpio
+	branch gpio_out_inactive
+
+module_process_with_credit:
+	fetch 1,mem_rfcomm_credit_flag
+	rtneq CREDIT_DISABLE
+	branch rfcomm_send_uih_without_payload
+
+/*
+	function name:check hci command complete
+	hci command format:
+	typedef struct HciFormat
+	{
+		uint8_t HciType;
+		uint8_t HciOpcode;
+		uint8_t HciPayloadLen;
+		uint8_t HciPayload[HciPayloadLen];
+	}
+*/
+module_process_check_hci_command_complete:
+	fetch 1,core_uart_status
+	bbit1 UART_STATUS_RX_FIFO_EMPTY,module_process_with_credit  //rx no data
+	call uarta_prepare_rx
+	ifetch 1,contru
+	bne 0x01,module_hci_in_excp	//HciType != 0x01
+	fetch 2,core_uart_rxitems
+	sub pdata,2,null
+	rtn positive
+	ifetch 1,contru
+	store 1,mem_module_uart_opcode
+	ifetcht 1,contru
+	copy contru,rega
+	storet 1,mem_module_uart_len
+	add temp,3,temp
+	fetch 2,core_uart_rxitems
+	isub temp,temp
+	nrtn positive
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call module_hci_cmd_control
+	fetch 1,mem_module_temp_nl_discard_packet
+	rtneq HCI_NOT_DISCARD_PACKET
+	branch module_hci_dicard_packet //discard this packet
+
+module_hci_in_excp:
+	call delay_10ms
+	call module_hci_event_invalid_packet
+	branch module_hci_release_except
+
+
+module_hci_release_except:
+	bpatch patch17_6,mem_patch17
+	call uarta_prepare_rx
+	fetch 2,core_uart_rxitems
+	rtn blank
+	iadd contru,contru
+	branch module_hci_dicard_bytes
+
+module_hci_dicard_packet:
+	call uarta_prepare_rx
+	increase 2,contu
+	ifetch 1,contu
+	iadd contu,contu
+module_hci_dicard_bytes:
+	branch uarta_rxdone
+	
+/*********************HCI CONTROL*********************/
+module_hci_cmd_control:
+	bpatch patch17_7,mem_patch17
+	fetch 1,mem_module_uart_opcode
+	beq HCI_CMD_SET_BT_ADDR_REQ,module_hci_cmd_set_bt_addr
+	beq HCI_CMD_SET_LE_ADDR_REQ,module_hci_cmd_set_le_addr
+	beq HCI_CMD_SET_VISIBILITY_REQ,module_hci_cmd_set_visibility	
+	beq HCI_CMD_SET_BT_NAME_REQ,module_hci_cmd_set_bt_name
+	beq HCI_CMD_SET_LE_NAME_REQ,module_hci_cmd_set_le_name
+	beq HCI_CMD_SPP_DATA_REQ,module_hci_cmd_receive_spp_data
+	beq HCI_CMD_LE_DATA_REQ,module_hci_cmd_receive_le_data
+	beq HCI_CMD_STATUS_IRQ,module_hci_cmd_inquire_status
+	beq HCI_CMD_SET_PAIRING_REQ,module_hci_cmd_set_pairing_mode
+	beq HCI_CMD_SET_PINCODE_REQ,module_hci_cmd_set_pincode	
+	beq HCI_CMD_SET_UARTCONTROL_REQ,module_hci_cmd_set_uart_control_mode
+	beq HCI_CMD_SET_UART_BAUD_REQ,module_hci_cmd_set_uart_baud
+	beq HCI_CMD_VERSION_REQ,module_hci_cmd_version_request
+	beq HCI_CMD_BT_DISCONNECT,module_hci_cmd_bt_disconnect
+	beq HCI_CMD_BLE_DISCONNECT,module_hci_cmd_ble_disconnect
+	beq HCI_CMD_SET_COD,module_hci_cmd_set_cod
+	beq HCI_CMD_SET_NVRAM_REQ,module_hci_cmd_set_nvram
+	beq HCI_CMD_CONFIRM_GKEY,module_hci_cmd_confirm_gkey
+	beq HCI_CMD_SET_CREDIT_GIVEN,module_hci_cmd_set_credit_given
+	beq HCI_CMD_AUTO_ADV_SCAN,module_hci_cmd_auto_adv
+	beq HCI_CMD_POWER_REQ,module_hci_cmd_power_request
+	beq HCI_CMD_POWER_SET,module_hci_cmd_power_set
+	beq HCI_CMD_PASSKEY_ENTRY,module_hci_cmd_passkey_entry
+	beq HCI_CMD_SET_GPIO,module_hci_cmd_set_gpio
+	beq HCI_CMD_READ_GPIO,module_hci_cmd_read_gpio
+	beq HCI_CMD_LE_SET_PAIRING,module_hci_cmd_le_set_pairing_mode
+	beq HCI_CMD_LE_SET_ADV_DATA,module_hci_cmd_le_set_adv_data
+	beq HCI_CMD_LE_SET_SCAN_DATA,module_hci_cmd_le_set_scan_data
+	beq HCI_CMD_LE_SEND_CONN_UPDATE_REQ,module_hci_cmd_le_send_conn_update_req
+	beq HCI_CMD_LE_SET_ADV_PARM,module_hci_cmd_set_le_adv_parameter
+	beq HCI_CMD_LE_START_PAIRING,module_hci_cmd_le_start_pairing
+	beq HCI_CMD_SET_WAKE_GPIO,module_hci_cmd_set_wake_gpio
+	beq HCI_CMD_SET_TX_POWER,module_hci_cmd_set_tx_power
+	beq HCI_CMD_LE_CONFIRM_GKEY,module_hci_cmd_le_confirm_gkey
+	beq HCI_CMD_REJECT_JUSTWORK,module_hci_cmd_set_reject_justwork_flag
+	beq HCI_CMD_RESET_CHIP_REQ,module_hci_cmd_reset_chip
+	beq HCI_CMD_LE_SET_FIXED_PASSKEY,module_hci_cmd_le_set_fixed_passkey
+	beq HCI_CMD_DELETE_CUSTOMIZE_SERVICE,module_hci_cmd_delete_customize_service
+	beq HCI_CMD_ADD_SERVICE_UUID,module_hci_cmd_add_service_uuid
+	beq HCI_CMD_ADD_CHARACTERISTIC_UUID,module_hci_cmd_add_characteristic_uuid
+	beq HCI_CMD_PASSKEY_ENTRY_INPUT,module_hci_cmd_le_passkey_entry_input
+	beq HCI_CMD_BLE_SET_PHY,module_hci_cmd_ble_set_phy
+	beq HCI_CMD_BLE_READ_CURRENT_PHY,module_hci_cmd_ble_read_current_phy
+	beq HCI_CMD_BLE_SET_DLE,module_hci_cmd_ble_set_dle
+	beq HCI_CMD_READ_CHIP_DATA,module_hci_cmd_read_chip_data
+	beq HCI_CMD_WRITE_CHIP_DATA,module_hci_cmd_write_chip_data
+ifdef COMPILE_WECHAT
+	beq HCI_CMD_WECHAT_SEND_DATA,module_hci_cmd_wechat_send_data
+endif
+	beq HCI_CMD_CLOSE_LPM,module_hci_cmd_close_lpm
+	branch  module_hci_event_receive_invalid_cmd
+
+/*********************HCI COMMAND*********************/
+
+//command opcode 0x00
+module_hci_cmd_set_bt_addr:
+	fetch 1,mem_module_uart_len
+	bne 6,module_hci_event_receive_invalid_cmd
+	ifetch 6,contru
+	store 6,mem_lap
+	branch module_hci_event_receive_valid_cmd
+
+//command opcode 0x01
+module_hci_cmd_set_le_addr:
+	fetch 1,mem_module_uart_len
+	bne 6,module_hci_event_receive_invalid_cmd
+	ifetch 6,contru
+	store 6,mem_le_lap
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x02
+module_hci_cmd_set_visibility:
+	fetch 1,mem_module_uart_len
+	bne 1,module_hci_event_receive_invalid_cmd
+	ifetcht 1,contru
+	storet 1,mem_module_bluetooth_stauts_by_command
+	call module_hci_event_receive_valid_cmd
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_CONNECTED
+	rtnbit1 UI_STATE_BT_CONNECTED
+module_start_adv_discovery_by_command:
+	fetch 1,mem_module_state
+	isolate1 MOUDLE_STATE_BT_BIT,pdata
+	nbranch moudle_start_adv_by_command,true
+	fetcht 1,mem_module_bluetooth_stauts_by_command
+	and temp,0x03,pdata
+	store 1,mem_scan_mode
+moudle_start_adv_by_command:
+	fetch 1,mem_module_state
+	isolate1 MOUDLE_STATE_BLE_BIT,pdata
+	nrtn true
+	fetcht 1,mem_module_bluetooth_stauts_by_command
+	isolate1 2,temp
+	branch app_ble_start_adv,true
+	branch app_ble_stop_adv
+
+
+//command opcode 0x03
+module_hci_cmd_set_bt_name:
+	fetch 1,mem_module_uart_len
+	sub pdata,67,null
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	store 1,mem_local_name_length
+	arg 8,loopcnt
+	call memset0
+	fetchr loopcnt,1,mem_module_uart_len
+	arg mem_local_name,contw
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x04
+module_hci_cmd_set_le_name:
+	arg 31,pdata
+	arg mem_le_name_len,contw
+	call module_hci_cmd_receive_store_mem
+	branch le_modified_name
+
+
+//command opcode 0x05
+module_hci_cmd_receive_spp_data:
+	fetch 1,mem_ui_state_map
+	bbit0 UI_STATE_BT_SPP_CONN,module_hci_event_receive_invalid_cmd
+	call app_check_sniff
+	branch module_hci_cmd_spp_exit_sniff,true
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call module_spp_clear_last_transmite_clock
+	fetch 1,mem_remote_credits
+	rtn blank
+	fetch 2,mem_nl_rx_len_all
+	nbranch module_hci_cmd_pass_init_ng_rx_len_all,blank
+	fetch 1,mem_module_uart_len
+	store 2,mem_nl_rx_len_all
+
+	store 2,mem_nl_rx_data_src
+	storer contru,2,mem_nl_rx_data_src
+module_hci_cmd_pass_init_ng_rx_len_all:
+	call module_hci_cmd_get_current_packet_len_and_remain_len
+	branch spp_tx_rfcomm_packet
+	
+module_hci_cmd_spp_exit_sniff:
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	branch module_exit_sniff
+
+module_hci_cmd_get_current_packet_len_and_remain_len:
+	call module_hci_cmd_get_current_patcket_len
+	fetch 2,mem_nl_rx_len_all
+	fetcht 2,mem_current_packet_length
+	isub temp,pdata
+	store 2,mem_nl_rx_len_all
+	rtn
+
+module_hci_cmd_get_current_patcket_len:
+	fetch 2,mem_nl_rx_len_all
+	fetcht 2,mem_rfcomm_max_frame_size	//接收最大能力?
+	call not_greater_than
+	fetcht 2,mem_pn_max_frame_size		//发送最大能力?
+	call not_greater_than
+	store 2,mem_current_packet_length
+	rtn
+
+module_hci_command_tx_spp_tx_complete:
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	jam HCI_CMD_SPP_DATA_REQ,mem_module_uart_opcode
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x09
+module_hci_cmd_receive_le_data:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+	call module_check_ble_encrypt_state
+	branch module_hci_event_receive_invalid_cmd,user
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	fetch 2,mem_module_flag
+	bbit1 MODULE_FLAG_BLE_DATA_FINISH,module_hci_cmd_receive_le_data_finish
+	fetch 1,mem_module_hci_notify_len
+	nrtn blank
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	ifetch 2,contru		//handle
+	store 2,mem_module_hci_notify_handle
+	storer contru,2,mem_module_hci_nofiy_addr
+	fetch 1,mem_module_uart_len
+	pincrease -2
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	branch module_hci_event_receive_invalid_cmd,zero
+	store 1,mem_module_hci_notify_len
+	fetcht 2,mem_module_hci_notify_handle
+	increase -1,temp
+	call le_att_get_handle_ptr2
+	branch module_hci_cmd_transmit_handle_error,blank
+	ifetcht 4,contr		//flag
+	setarg 0x01280302
+	isub temp,null
+	nbranch module_hci_cmd_transmit_handle_error,zero
+	ifetch 1,contr
+	store 1,mem_module_hci_notify_type
+	and_into 0x30,pdata
+	branch module_hci_cmd_transmit_handle_error,blank
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call le_set_config_more_data
+	call module_hci_cmd_transmit_le_notify
+	call module_hci_cmd_transmit_le_notify
+	call module_hci_cmd_transmit_le_notify
+	fetch 2,mem_module_flag
+	rtnbit0 MODULE_FLAG_BLE_DATA_FINISH
+module_hci_cmd_receive_le_data_finish:
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	call module_clear_le_tx_data_flag
+	branch module_hci_event_receive_valid_cmd
+
+module_hci_cmd_transmit_handle_error:
+	jam 0,mem_module_hci_notify_len
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	call module_clear_le_tx_data_flag
+	branch module_hci_event_receive_invalid_cmd
+
+module_hci_cmd_transmit_le_notify:
+	fetch 1,mem_module_hci_notify_len
+	rtn blank
+	call le_fifo_check_nearly_full
+	nrtn blank				//no fifo
+	call module_get_le_remote_mtu
+	bpatch patch18_0,mem_patch18
+	fetch 1,mem_le_l2cap_att_states
+	rtnbit1 BLE_L2CAP_RECV_CONFIRMATION_PACKET
+	add temp,-3,pdata		//sub handle and opcode
+	arg 251,temp
+	call not_greater_than
+	fetcht 1,mem_module_hci_notify_len
+	call not_greater_than
+	copy pdata,rega
+	copy temp,pdata
+	isub rega,pdata
+	store 1,mem_module_hci_notify_len
+	call module_hci_cmd_transmit_le_notify_malloc_l2cap
+	fetch 2,mem_module_hci_nofiy_addr
+	copy pdata,contru
+	copy rega,loopcnt
+	call uart_copy_rx_bytes_fast
+	copy contru,pdata
+	store 2,mem_module_hci_nofiy_addr
+	fetch 1,mem_module_hci_notify_len
+	nrtn blank
+	branch module_set_le_tx_data_flag
+
+module_hci_cmd_transmit_le_notify_malloc_l2cap:
+	fetcht 2,mem_module_hci_notify_handle
+	fetch 1,mem_module_hci_notify_type
+	bbit1 BIT_CHARACTERISTIC_INDICATE,le_att_malloc_tx_indication
+	bbit1 BIT_CHARACTERISTIC_NOTIFY,le_att_malloc_tx_notify
+	rtn
+
+
+//output: temp is master mtu
+module_get_le_remote_mtu:
+	arg 0x17,temp
+	fetch 2,mem_module_flag
+	rtnbit1 MODULE_FLAG_BLE_SEND_MTU23
+	fetcht 2,mem_le_remote_mtu
+	rtn
+
+module_check_ble_encrypt_state:
+	fetch 2,mem_module_flag
+	bbit1 MODULE_FLAG_BLE_DATA_ENCRYPT,le_check_encrypt_state
+	branch disable_user
+	
+
+//command opcode 0x0b
+module_hci_cmd_inquire_status:
+	branch module_hci_event_status_res
+
+
+//command opcode 0x0c
+module_hci_cmd_set_pairing_mode:
+	ifetch 1,contru
+	beq BR_PAIRING_MODE_SECURE_CONNECT_JUSTWORK,module_hci_pairing_just_work_sc
+	beq BR_PAIRING_MODE_SECURE_CONNECT_PASSKEY,module_hci_pairing_passkey_sc
+	beq BR_PAIRING_MODE_SECURE_CONNECT_NUMERIC,module_hci_pairing_numeric_comparison_sc
+
+	copy pdata,rega
+	call sp_br_secure_connection_disable
+	call sc_reset
+	copy rega,pdata
+	beq BR_PAIRING_MODE_PINCODE,module_hci_pairing_pincode_mode
+	beq BR_PAIRING_MODE_JUSTWORK,module_hci_pairing_just_work_mode
+	beq BR_PAIRING_MODE_PASSKEY,module_hci_pairing_passkey
+	beq BR_PAIRING_MODE_NUMERIC,module_hci_pairing_numeric_comparison
+	branch module_hci_event_receive_invalid_cmd
+
+module_hci_pairing_just_work_sc:
+	call sp_br_secure_connection_enable
+	branch module_hci_pairing_just_work_mode
+	
+module_hci_pairing_passkey_sc:
+	call sp_br_secure_connection_enable
+	branch module_hci_pairing_passkey
+
+module_hci_pairing_numeric_comparison_sc:
+	call sp_br_secure_connection_enable
+	branch module_hci_pairing_numeric_comparison
+	
+module_hci_pairing_pincode_mode:
+	call sp_reset
+	jam 0,mem_ssp_enable
+	branch module_hci_event_receive_valid_cmd
+	
+module_hci_pairing_just_work_mode:
+	setarg IO_CAPABILITY_NO_INPUT_NO_OUTPUT
+module_hci_sspairing_mode:
+	store 1,mem_ssp_mode_flag
+	store 1,mem_lmp_io_cap_payload_iocap
+	setarg OOB_DATA_PRESENT_NOT_PRESENT
+	store 1,mem_lmp_io_cap_payload_oob_auth_data
+	setarg AUTH_REQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING
+	store 1,mem_lmp_io_cap_payload_auth_req
+	call ssp_enable
+	jam 1,mem_ssp_enable
+	branch module_hci_event_receive_valid_cmd
+module_hci_pairing_passkey:
+	setarg IO_CAPABILITY_KEYBOARD_ONLY
+	branch module_hci_sspairing_mode
+
+module_hci_pairing_numeric_comparison:
+	setarg IO_CAPABILITY_DISPLAY_YESNO
+	branch module_hci_sspairing_mode
+
+
+//command opcode 0x0d
+module_hci_cmd_set_pincode:
+	arg 16,pdata
+	arg mem_pin_length,contw
+	branch module_hci_cmd_receive_store_mem
+
+
+//command opcode 0x0e
+module_hci_cmd_set_uart_control_mode:
+	ifetch 1,contru
+	fetcht 1,mem_module_flag
+	nsetflag blank,MODULE_FLAG_UART_FLOW_CONTROL,temp
+	storet 1,mem_module_flag
+	fetcht 1,core_uart_ctrl
+	nsetflag blank,BIT_UART_CONTROL_FLOW_CONTROL,temp
+	storet 1,core_uart_ctrl
+ 	branch module_hci_event_receive_valid_cmd
+
+ 	
+//command opcode 0x0f
+module_hci_cmd_set_uart_baud:
+	fetchr loopcnt,1,mem_module_uart_len
+	call string2dec_from_uart
+	call uart_calc_baud_rate_config
+	store uart_baud_len,mem_module_uarta_baud_rate
+	call module_hci_event_receive_valid_cmd
+	call wait_uarttx
+	fetch uart_baud_len,mem_module_uarta_baud_rate
+	branch uarta_init_baud_rate
+
+
+//command opcode 0x10
+module_hci_cmd_version_request:
+	arg 2,rega
+	arg mem_soft_version_num,regb
+	arg 0,temp
+	branch module_hci_event_set_cmd
+
+
+//command opcode 0x11
+module_hci_cmd_bt_disconnect:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BT_CONNECTED,module_hci_event_receive_invalid_cmd
+module_hci_cmd_bt_disconnect_doing:
+	call module_hci_event_receive_valid_cmd
+	branch app_bt_disconnect
+
+	
+//command opcode 0x12
+module_hci_cmd_ble_disconnect:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+module_hci_cmd_ble_disconnect_doing:
+	call module_hci_event_receive_valid_cmd
+	branch app_ble_disconnect
+
+
+//command opcode 0x15
+module_hci_cmd_set_cod:
+	fetch 1,mem_module_uart_len
+	bne 3,module_hci_event_receive_invalid_cmd
+	ifetch 3,contru
+	store 3,mem_class
+	branch module_hci_event_receive_valid_cmd
+	
+
+//command opcode 0x26
+module_hci_cmd_set_nvram:
+	fetchr loopcnt,1,mem_module_uart_len
+	fetch 2,mem_nv_data_ptr
+	icopy contw
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x28
+module_hci_cmd_confirm_gkey:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,module_hci_cmd_le_confirm_gkey
+	bbit0 UI_STATE_BT_CONNECTED,module_hci_event_receive_invalid_cmd	
+	ifetch 1,contru
+	fetcht 1,mem_flag_mode_ssp_pin
+	setflag blank,FLAG_MODE_SSP_PIN_COMPARISON_RESULT_BIT,temp
+	set1 FLAG_MODE_SSP_PIN_REVICEVE_COMPARISON_BIT ,temp
+	storet 1,mem_flag_mode_ssp_pin
+
+	call module_hci_event_receive_valid_cmd
+
+	fetch 1,mem_flag_mode_ssp_pin
+	bbit1 FLAG_MODE_SSP_PIN_RECIEVE_DHKEY_BIT,module_hci_cmd_spp_number_comparison_result_is1
+	rtn
+
+module_hci_cmd_spp_number_comparison_result_is1:
+	bbit1 FLAG_MODE_SSP_PIN_COMPARISON_RESULT_BIT,number_comparison_successed
+	jam 0,mem_flag_mode_ssp_pin
+	jam BT_CMD_DHKEY_NOT_ACCEPT,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+
+//command opcode 0x29
+module_hci_cmd_set_credit_given:
+	fetch 1,mem_ui_state_map
+	rtnbit0 UI_STATE_BT_SPP_CONN
+	fetch 1,mem_rfcomm_credit_flag
+	rtneq CREDIT_DISABLE
+	ifetch 1,contru
+	fetcht 1,mem_credit_given
+	iadd temp,temp
+	storet 1,mem_credit_given
+	rtn
+
+
+//command opcode 0x2a
+module_hci_cmd_auto_adv:
+	arg 0x40,loopcnt
+	arg mem_le_adv_data_len,contw
+	call clear_mem
+	setarg 0
+	store 1,mem_regb
+	copy rega,contru
+module_hci_cmd_auto_adv_loop:
+	copy contru,pdata
+	store 2,mem_regc
+	call module_hci_cmd_auto_adv_adv_analys
+
+	fetch 1,mem_regb
+	fetcht 1,mem_temp
+	increase 1,temp
+	iadd temp,pdata
+	store 1,mem_regb
+
+	sub pdata,31,null
+	nbranch module_hci_cmd_auto_adv_store_scan,positive
+module_hci_cmd_auto_adv_store_adv:
+	fetcht 1,mem_le_adv_data_len
+	setarg mem_le_adv_data
+	iadd temp,pdata
+	store 2,mem_contw
+	fetcht 1,mem_temp
+	increase 1,temp
+	fetch 1,mem_le_adv_data_len
+	iadd temp,pdata
+	store 1,mem_le_adv_data_len
+	branch module_hci_cmd_auto_adv_store_common
+module_hci_cmd_auto_adv_store_scan:
+	fetcht 1,mem_le_scan_data_len
+	setarg mem_le_scan_data
+	iadd temp,pdata
+	store 2,mem_contw
+	fetcht 1,mem_temp
+	increase 1,temp
+	fetch 1,mem_le_scan_data_len
+	iadd temp,pdata
+	store 1,mem_le_scan_data_len
+module_hci_cmd_auto_adv_store_common:
+	fetch 2,mem_contw
+	copy pdata,contw
+	fetch 2,mem_regc
+	copy pdata,contru
+
+	copy temp,loopcnt
+	call uart_copy_rx_bytes_fast
+
+	fetch 1,mem_module_uart_len
+	fetcht 1,mem_regb
+	isub temp,null
+	nbranch  module_hci_cmd_auto_adv_loop,zero
+	branch module_hci_event_receive_valid_cmd
+
+//block of adv len in mem_temp
+module_hci_cmd_auto_adv_adv_analys:
+	ifetch 1,contru
+	store 1,mem_temp
+	ifetch 1,contru
+	store 1,mem_rega
+	rtn
+
+
+//command opcode 0x2b
+module_hci_cmd_power_request:
+	arg 0,temp
+	arg 2,rega
+	fetch 2,mem_module_vdd_quotient
+	store 2,mem_event_cmd_response_content
+	arg mem_event_cmd_response_content,regb
+	branch module_hci_event_set_cmd
+
+
+//command opcode 0x2c
+module_hci_cmd_power_set:
+	fetch 1,mem_module_uart_len
+	bne 1,module_hci_event_receive_invalid_cmd
+	ifetch 1,contru
+	store 1,mem_module_read_vdd_flag
+	setarg 0x00
+	store 2,mem_module_vdd_quotient
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x30
+module_hci_cmd_passkey_entry:
+	fetch 1,mem_module_uart_len
+	bne 4,module_hci_event_receive_invalid_cmd
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,module_hci_cmd_le_passkey_entry_input
+	ifetch 4,contru
+	store 4,mem_pin
+	jam 4,mem_pin_length
+	jam 0,mem_authentication_passkey_times
+	call module_hci_event_receive_valid_cmd
+	branch authentication_passkey
+
+
+//command opcode 0x31
+module_hci_cmd_set_gpio:
+	fetch 1,mem_module_uart_len
+	bne 3,module_hci_event_receive_invalid_cmd
+	ifetch 1,contru
+	beq HCI_CMD_CONFIG_GPIO_INPUT,module_set_gpio_input
+	beq HCI_CMD_CONFIG_GPIO_OUTPUT,module_set_gpio_output
+	branch module_hci_event_receive_invalid_cmd
+
+module_set_gpio_input:
+	call module_hci_event_receive_valid_cmd
+	ifetcht 1,contru
+	ifetch 1,contru
+	beq GPIO_INPUT_HIGH_IMPEDANCE,gpio_set_high_impedance
+	nsetflag blank,7,temp
+	branch gpio_config_input
+
+module_set_gpio_output:
+	call module_hci_event_receive_valid_cmd
+	ifetcht 1,contru
+	ifetch 1,contru	
+	branch gpio_out_active,blank
+	branch gpio_out_inactive
+
+
+//command opcode 0x32
+module_hci_cmd_read_gpio:
+	fetch 1,mem_module_uart_len
+	bne 1,module_hci_event_receive_invalid_cmd
+	ifetcht 1,contru
+	call gpio_get_bit
+	setarg 0x0
+	nsetflag true,0,pdata
+	arg 1,rega
+	store 2,mem_event_cmd_response_content
+	arg mem_event_cmd_response_content,regb
+	arg 0,temp
+	branch module_hci_event_set_cmd
+
+
+//command opcode 0x33
+module_hci_cmd_le_set_pairing_mode:
+	ifetch 1,contru
+	copy pdata,temp
+ifdef SECURE_CONNECTION
+	beq LE_PAIRING_MODE_SECURE_CONNECT_JUSTWORK,module_le_set_pairing_mode_secure_justwork
+	beq LE_PAIRING_MODE_SECURE_CONNECT_NUMERIC,module_le_set_pairing_mode_secure_numeric
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,module_le_set_pairing_mode_secure_passkey
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT,module_le_set_pairing_mode_secure_passkey_res_input
+endif
+	store 1,mem_le_pairing_mode
+	call sc_reset
+	call le_secure_connection_disable
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_NONE, module_le_set_no_pairing
+	beq LE_PAIRING_MODE_LAGACY_JUSTWORK,module_le_set_pairing_mode_lagacy_just_work
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY,module_le_set_pairing_mode_lagacy_passkey
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY_RES_INPUT,module_le_set_pairing_mode_lagacy_passkey_res_input
+	branch module_hci_event_receive_invalid_cmd
+		
+ifdef SECURE_CONNECTION	
+module_le_set_pairing_mode_secure_justwork:
+	storet 1,mem_le_pairing_mode
+	call le_secure_connection_enable
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch module_le_set_noinputnooutput
+module_le_set_pairing_mode_secure_numeric:
+	storet 1,mem_le_pairing_mode
+	call le_secure_connection_enable
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	jam FLAG_IOCAP_DISPLAYYESNO,mem_le_pres_iocap
+	branch module_hci_event_receive_valid_cmd	
+module_le_set_pairing_mode_secure_passkey:	
+	storet 1,mem_le_pairing_mode
+	call le_secure_connection_enable
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch module_le_set_displayonly
+module_le_set_pairing_mode_secure_passkey_res_input:
+	storet 1,mem_le_pairing_mode
+	call le_secure_connection_enable
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch module_le_set_keboadonly
+
+endif
+
+module_le_set_no_pairing:
+	jam FLAG_LE_NO_BONDING_NO_MITM,mem_le_pres_auth
+module_le_set_noinputnooutput:	
+	jam FLAG_IOCAP_NOINPUTNOOUTPUT,mem_le_pres_iocap
+	branch module_hci_event_receive_valid_cmd	
+module_le_set_pairing_mode_lagacy_just_work:
+	jam FLAG_LE_BONDING_NO_MITM,mem_le_pres_auth
+	branch module_le_set_noinputnooutput
+module_le_set_pairing_mode_lagacy_passkey:
+	jam FLAG_LE_BONDING_MITM,mem_le_pres_auth
+	branch module_le_set_displayonly
+module_le_set_pairing_mode_lagacy_passkey_res_input:
+	jam FLAG_LE_BONDING_MITM,mem_le_pres_auth
+	branch module_le_set_keboadonly
+module_le_set_keboadonly:	
+	jam FLAG_IOCAP_KEYBOARDONLY,mem_le_pres_iocap
+	branch module_hci_event_receive_valid_cmd	
+module_le_set_displayonly:	
+	jam FLAG_IOCAP_DISPLAYONLY,mem_le_pres_iocap
+	branch module_hci_event_receive_valid_cmd	
+
+
+//command opcode 0x34
+module_hci_cmd_le_set_adv_data:
+	arg 31,pdata
+	arg mem_le_adv_data_len,contw
+	branch module_hci_cmd_receive_store_mem
+
+
+//command opcode 0x35
+module_hci_cmd_le_set_scan_data:
+	arg 31,pdata
+	arg mem_le_scan_data_len,contw
+	branch module_hci_cmd_receive_store_mem
+
+/*
+	input:contw is store mem ptr
+	pdata is max length
+*/
+module_hci_cmd_receive_store_mem:
+	fetchr loopcnt,1,mem_module_uart_len
+	isub loopcnt,null
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	istorer loopcnt,1,contw
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd	
+
+	
+//command opcode 0x36
+module_hci_cmd_le_send_conn_update_req:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+	fetch 1,mem_module_uart_len
+	bne 0x08,module_hci_event_receive_invalid_cmd
+	ifetch 8,contru
+	store 8,mem_le_interval_min
+	jam BT_CMD_LE_UPDATE_CONN,mem_fifo_temp
+	call  ui_ipc_send_cmd
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x37
+module_hci_cmd_set_le_adv_parameter:
+	ifetch 2,contru
+	store 2,mem_le_adv_interval
+	branch module_hci_event_receive_valid_cmd
+	
+	
+//command opcode 0x38
+module_hci_cmd_le_start_pairing:
+	fetch 1,mem_le_pairing_mode
+	branch module_hci_event_receive_invalid_cmd,blank
+	fetch 1,mem_le_pairing_state
+	bne FLAG_LE_PAIRING_NULL,module_hci_event_receive_invalid_cmd
+	fetch 1,mem_le_enc_state
+	bne FLAG_LE_ENC_NULL,module_hci_event_receive_invalid_cmd
+	call check_51cmd_le_smp_sec_req
+	branch module_hci_event_receive_valid_cmd	
+
+
+//command opcode 0x40
+module_hci_cmd_set_wake_gpio:
+	fetch 1,mem_module_uart_len
+	bne 5,module_hci_event_receive_invalid_cmd
+	ifetch 1,contru
+	store 1,mem_module_mcu_wake_pin
+	ifetch 4,contru
+	store 4, mem_module_mcu_wake_delay_us
+	fetcht 1,mem_module_mcu_wake_pin
+	call gpio_config_output
+	call module_set_mcu_wake_pin_low
+	branch module_hci_event_receive_valid_cmd
+	
+
+//command opcode 0x42
+module_hci_cmd_set_tx_power:
+	fetch 1,mem_module_uart_len
+	bne 0x01,module_hci_event_receive_invalid_cmd
+	ifetch 1,contru
+	store 1,mem_tx_power
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x48
+module_hci_cmd_le_confirm_gkey:
+	ifetch 1,contru
+	beq 0x01,module_hci_cmd_le_confirm_gkey_fail
+	fetch 1,mem_le_secure_connect_state
+	beq LE_SC_STAT_SEND_PUBLIC_KEY,module_hci_cmd_le_confirm_gkey_ok
+	beq LE_SC_STAT_RECEIVE_DHKEY,module_hci_cmd_le_confirm_gkey_ok
+	beq LE_SC_STAT_WAIT_CONFIRM_GKEY,module_hci_cmd_le_confirm_gkey_ok
+	branch module_hci_event_receive_invalid_cmd		
+module_hci_cmd_le_confirm_gkey_ok:
+	jam FLAG_LE_SC_CONFRIM_GKEY_OK,mem_le_sc_confirm_gkey_flag
+	branch module_hci_event_receive_valid_cmd	
+	
+module_hci_cmd_le_confirm_gkey_fail:
+	call le_send_pairing_confirm_value_failed
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x49
+module_hci_cmd_set_reject_justwork_flag:
+	fetch 1,mem_module_uart_len
+	bne 0x01,module_hci_event_receive_invalid_cmd
+	call module_hci_event_receive_valid_cmd
+	ifetch 1,contru
+	branch classic_bt_clr_reject_justwork_flag,blank
+	branch classic_bt_set_reject_justwork_flag
+
+
+//command opcode 0x51
+module_hci_cmd_reset_chip:
+	call module_hci_event_receive_valid_cmd
+	call wait_uarttx
+	jam 0x01,core_reset // rest YC1021
+	branch loop
+
+
+//command opcode 0x61
+module_hci_cmd_le_set_fixed_passkey:
+	fetch 1,mem_module_uart_len
+	beq 0,module_hci_event_receive_invalid_cmd
+	ifetch 1,contru
+	branch module_hci_cmd_le_set_random_passkey,blank
+	fetch 1,mem_module_uart_len
+	bne 5,module_hci_event_receive_invalid_cmd
+	ifetch 4,contru
+	arg 1000000,temp
+	isub temp,null
+	branch module_hci_event_receive_invalid_cmd,positive
+	store 4,mem_le_tk
+	call le_set_config_fixed_tk
+	branch module_hci_event_receive_valid_cmd
+
+module_hci_cmd_le_set_random_passkey:
+	call le_clr_config_fixed_tk
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x76
+module_hci_cmd_delete_customize_service:
+	ifetcht 2,contru
+	call le_att_get_handle_ptr2
+	add contr,-2,contw
+	setarg 0x0000
+	istore 2,contw
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x77
+module_hci_cmd_add_service_uuid:
+	call module_hci_cmd_add_service_uuid_set_uuid
+	call uart_copy_rx_bytes_len_data
+	setarg 0x0000
+	istore 2,contw
+	branch module_hci_event_uuid_handle
+
+
+
+//command opcode 0x78
+module_hci_cmd_add_characteristic_uuid:
+	ifetch 1,contru	//Characteristic
+	call module_hci_cmd_add_characteristic_uuid_set_handle
+	call module_hci_cmd_add_characteristic_uuid_set_uuid
+	branch module_hci_event_uuid_handle
+
+
+module_hci_cmd_add_service_uuid_set_uuid:
+	call le_att_creat_new_handle
+	setarg 0x280002
+	istore 3,contw
+	rtn
+
+
+module_hci_cmd_add_characteristic_uuid_set_handle:
+	store 1,mem_pdatatemp
+	call le_att_creat_new_handle
+	setarg 0x01280302
+	istore 4,contw
+	fetch 1,mem_pdatatemp
+	istore 3,contw
+	rtn
+
+
+module_hci_cmd_add_characteristic_uuid_set_uuid:
+	call le_att_get_last_handle
+	ifetch 1,contru
+	and pdata,0x1f,loopcnt
+	copy pdata,rega
+	isolate1 BIT_OF_WRITE_AUTHENTICATED,rega
+	setflag true,BIT_OF_ATT_HANDLE_WRITE_AUTHENTICATED,temp
+	isolate1 BIT_OF_READ_AUTHENTICATED,rega
+	setflag true,BIT_OF_ATT_HANDLE_READ_AUTHENTICATED,temp
+	istoret 2,contw
+	copy loopcnt,pdata
+	istore 1,contw
+	call uart_copy_rx_bytes
+	call uart_copy_rx_bytes_len_data		//data
+	setarg 0
+	istore 2,contw
+	and temp,0xff,temp
+	increase -1,temp
+	call le_att_get_handle_ptr2
+	add contr,4,contr
+	ifetch 1,contr		//characteristic data
+	bbit1 BIT_CHARACTERISTIC_NOTIFY,module_hci_cmd_add_characteristic_uuid_set_ccc_uuid
+	bbit1 BIT_CHARACTERISTIC_INDICATE,module_hci_cmd_add_characteristic_uuid_set_ccc_uuid
+	increase 1,temp
+	rtn
+
+
+module_hci_cmd_add_characteristic_uuid_set_ccc_uuid:
+	call le_att_get_last_handle
+	isolate1 BIT_OF_NOTIFY_AUTHENTICATED,rega
+	setflag true,BIT_OF_ATT_HANDLE_WRITE_AUTHENTICATED,temp
+	istoret 2,contw
+	setarg 0x02290202
+	istore 8,contw
+	increase -1,temp
+	rtn
+
+
+le_att_creat_new_handle:
+	call le_att_get_last_handle
+	istoret 2,contw
+	rtn
+
+
+uart_copy_rx_bytes_len_data:
+	ifetch 1,contru
+	copy pdata,loopcnt
+	istore 1,contw
+	branch uart_copy_rx_bytes
+
+
+//command opcode 0x7a
+module_hci_cmd_le_passkey_entry_input:
+	fetch 1,mem_le_pairing_state
+	bne FLAG_LE_PAIRING_RECEIVE_PAIRING_CONFIRM,module_hci_event_receive_invalid_cmd
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY_RES_INPUT,module_hci_cmd_passkey_entry_res_input
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT,module_hci_cmd_passkey_entry_sc_res_input
+	branch module_hci_event_receive_invalid_cmd
+
+module_hci_cmd_passkey_entry_sc_res_input:
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_PASSKEY_WAIT_CONFIRM,mem_le_secure_connect_state	
+	branch module_hci_cmd_receive_ble_passkey
+
+module_hci_cmd_receive_ble_passkey:
+	ifetch 4,contru
+	store 4,mem_le_tk
+	branch module_hci_event_receive_valid_cmd
+	
+module_hci_cmd_passkey_entry_res_input:
+	call module_hci_cmd_receive_ble_passkey
+	branch le_send_smp_pairing_confirm
+
+
+
+//command opcode 0x90
+module_hci_cmd_ble_set_phy:
+	fetch 1,mem_module_uart_len
+	bne 2,module_hci_event_receive_invalid_cmd
+	ifetcht 2,contru
+	call le_set_phys
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x91
+module_hci_cmd_ble_read_current_phy:
+	arg 0,temp
+	arg 2,rega
+	arg mem_context+coffset_le_rx_phy,regb
+	branch module_hci_event_set_cmd
+
+
+//command opcode 0x92
+module_hci_cmd_ble_set_dle:
+	fetch 1,mem_module_uart_len
+	bne 8,module_hci_event_receive_invalid_cmd
+	ifetch 8,contru
+	call le_set_dle
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x93
+module_hci_cmd_read_chip_data:
+	ifetchr rega,1,contru
+	ifetchr regb,2,contru
+	arg 0,temp
+	branch module_hci_event_set_cmd
+
+
+//command opcode 0x94
+module_hci_cmd_write_chip_data:
+	fetchr loopcnt,1,mem_module_uart_len
+	increase -2,loopcnt
+	ifetch 2,contru
+	copy pdata,contw
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+ifdef COMPILE_WECHAT
+//command opcode 0x95
+module_hci_cmd_wechat_send_data:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+	fetchr loopcnt,1,mem_module_uart_len
+	arg mem_module_wechat_local_data_buffer,contw
+	call uart_copy_rx_bytes_fast
+	fetchr regb,1,mem_module_uart_len
+	arg mem_module_wechat_local_data_buffer,rega
+	call wechat_air_sync_send_wechat_packet
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	rtn user
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	branch module_hci_event_receive_valid_cmd
+endif
+
+
+//command opcode 0xff
+module_hci_cmd_close_lpm:
+	jam 0,mem_lpm_mode
+	branch module_hci_event_receive_valid_cmd
+	
+
+/*********************HCI EVENT*********************/
+
+module_hci_event_receive_invalid_cmd:
+	arg 1,temp
+	arg 0,rega
+	branch module_hci_event_set_cmd
+
+
+module_hci_event_receive_valid_cmd:
+	arg 0,temp
+	arg 0,rega
+	branch module_hci_event_set_cmd
+
+
+//event opcode 0x00
+module_hci_event_spp_connect:
+	jam  HCI_EVENT_SPP_CONN_REP,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x02
+module_hci_event_le_connect:
+	jam  HCI_EVENT_LE_CONN_REP,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x03
+module_hci_event_spp_disconnect:
+	jam  HCI_EVENT_SPP_DIS_REP,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x05
+module_hci_event_le_disconnect:
+	jam  HCI_EVENT_LE_DIS_REP,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x06
+//input:
+//	temp: success 0; fail 1
+//	rega:Response Content length
+//	regb:Response Content address
+module_hci_event_set_cmd:
+	fetch 1,mem_module_uart_opcode
+	copy pdata,regc
+	jam  HCI_EVENT_CMD_RES,mem_module_uart_opcode
+	setarg 2
+	iadd rega,pdata
+	call module_hci_prepare_tx
+	copy regc,pdata
+	istore 1,contwu
+	istoret 1,contwu
+	copy rega,loopcnt
+	copy regb,contr
+	call uart_copy_tx_bytes
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x07
+module_hci_event_receive_spp_data:
+//	call p_nl_clear_last_transmite_clock
+	call module_spp_clear_last_transmite_clock
+	jam HCI_EVENT_SPP_DATA_REP,mem_module_uart_opcode
+	fetch 1,mem_current_length
+	rtn blank
+	call module_hci_prepare_tx
+	fetch 1,mem_current_length
+	copy pdata,loopcnt
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	call uart_copy_tx_bytes_fast
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x08
+//loopcnt pdata is data length
+module_hci_event_receive_le_data:
+	jam HCI_EVENT_LE_DATA_REP,mem_module_uart_opcode
+	add loopcnt,2,pdata
+	call module_hci_prepare_tx
+	fetch 2,mem_module_le_rx_data_handle // Attribute handle
+	istore 2,contwu
+	fetch 2,mem_module_le_rx_data_address
+	icopy contr
+	call uart_copy_tx_bytes_fast
+	copy contr,pdata
+	store 2,mem_module_le_rx_data_address
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x09
+module_hci_event_enter_standby_mode:
+	jam HCI_EVENT_STANDBY_REP,mem_module_uart_opcode
+module_hci_event_enter_standby_mode_len0:
+	setarg 0
+	call module_hci_prepare_tx
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x0a
+module_hci_event_status_res:
+	jam HCI_EVENT_STATUS_RES,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	
+	call module_hci_read_bt_status
+	
+	fetch 2,mem_ui_state_map	
+	arg UI_STATE_BT_HID_CONN,queue
+	qisolate1 pdata
+	setflag true,3,temp
+
+	arg UI_STATE_BLE_CONNECTED,queue
+	qisolate1 pdata
+	setflag true,5,temp	
+	
+	fetch 1,mem_ui_state_map
+	arg UI_STATE_BT_SPP_CONN,queue
+	qisolate1 pdata
+	setflag true,4,temp	
+	
+	istoret 1,contwu
+	branch module_hci_transmit_tx
+
+//	temp: bit0 3.0 inquiry;bit1 3.0 scan;bit2 ble adv;
+
+module_hci_read_bt_status:
+	arg 0,temp
+	fetch 1,mem_scan_mode
+	arg inq_scan_mode,queue
+	qisolate1 pdata
+	setflag true,0,temp
+	arg page_scan_mode,queue
+	qisolate1 pdata
+	setflag true,1,temp	
+
+	fetch 1,mem_le_adv_enable
+	arg 0,queue
+	qisolate1 pdata
+	setflag true,2,temp	
+	rtn
+
+
+//event opcode 0x0d
+module_hci_event_store_device:
+	jam HCI_EVENT_NVRAM_REP,mem_module_uart_opcode
+	fetch 1,mem_nv_data_number
+	mul32 pdata,34,pdata
+	icopy loopcnt
+	call module_hci_prepare_tx
+	fetch 2,mem_nv_data_ptr
+	icopy contr
+	call uart_copy_tx_bytes_fast
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x0e
+module_hci_event_gkey_generate:
+	jam HCI_EVENT_GKEY,mem_module_uart_opcode
+	setarg 4
+	call module_hci_prepare_tx
+	fetch 4,mem_gkey
+	istore 4,contwu
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x0f
+module_hci_event_invalid_packet:
+	jam HCI_EVENT_INVALID_PACKET,mem_module_uart_opcode
+	fetch 2,core_uart_rxitems
+	arg 0x40,temp
+	call not_greater_than
+	copy pdata,rega
+	copy pdata,loopcnt
+	call uarta_prepare_rx
+	arg mem_module_rx_error_data_buffer,contw
+	call uart_copy_rx_bytes_fast
+	copy rega,pdata
+	copy rega,loopcnt
+	call module_hci_prepare_tx
+	arg mem_module_rx_error_data_buffer,contr
+	call uart_copy_tx_bytes_fast
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x10
+module_hci_event_passkey_entry_mode:
+	jam  HCI_EVENT_GET_PASSKEY,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x11
+module_hci_event_le_tk:
+	jam HCI_EVENT_LE_TK,mem_module_uart_opcode
+	setarg 4
+	call module_hci_prepare_tx
+	fetch 4,mem_le_tk
+	istore 4,contwu
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x14
+module_hci_event_le_pairing_fail:
+	arg FLAG_BLE_PAIRING_FAIL,rega
+	branch module_hci_event_pairing_completed
+
+module_hci_event_le_pairing_success:
+	arg FLAG_BLE_PAIRING_SUCCESS,rega
+	branch module_hci_event_pairing_completed
+
+module_hci_event_bt_pairing_fail:
+	arg FLAG_BT_PAIRING_FAIL,rega
+	branch module_hci_event_pairing_completed
+
+module_hci_event_bt_pairing_success:
+	arg FLAG_BT_PAIRING_SUCCESS,rega
+
+module_hci_event_pairing_completed:
+	jam 0,mem_flag_mode_ssp_pin
+	jam HCI_EVENT_LE_PAIRING_STATE,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx
+	copy rega,pdata
+	istore 2,contwu
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x15
+module_hci_event_pause_enc:
+	arg FLAG_EVENT_PAUSE_ENC,regc
+	branch module_hci_event_enc
+
+module_hci_event_start_enc:
+	arg FLAG_EVENT_START_ENC,regc
+
+module_hci_event_enc:
+	jam HCI_EVENT_LE_ENCRYPTION_STATE,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	copy regc,pdata
+	istore 1,contwu
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x1d
+module_hci_event_le_gkey:
+	jam HCI_EVENT_LE_GKEY,mem_module_uart_opcode
+	setarg 4
+	call module_hci_prepare_tx
+	fetch 4,mem_gkey
+	istore 4,contwu
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x29
+//input:temp uuid number
+module_hci_event_uuid_handle:
+	storet 2,mem_temp
+	jam HCI_EVENT_UUID_HANDLE,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx
+	fetcht 2,mem_temp
+	istoret 2,contwu
+	branch module_hci_transmit_tx
+
+
+//event opcode 0x2B
+module_hci_event_le_input_passkey:
+	jam HCI_EVENT_LE_INPUT_GKEY,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x40
+module_hci_event_le_update_phy:
+	jam HCI_BLE_UPDATE_PHY_EVENT,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx
+	fetch 2,mem_context+coffset_le_rx_phy
+	istore 2,contwu
+	branch module_hci_transmit_tx
+
+ifdef COMPILE_WECHAT
+//event opcode 0x41
+module_wechat_rx_push_data:
+module_hci_event_ble_wechat_receive_push_data:
+	call wechat_air_sync_check_push_data_struct
+	nrtn user
+	jam HCI_BLE_WECHAT_RECEIVE_PUSH_DATA,mem_module_uart_opcode
+	copy loopcnt,pdata
+	call module_hci_prepare_tx
+	copy regc,contr
+	call uart_copy_tx_bytes_fast
+	branch module_hci_transmit_tx
+endif
+	
+
+//****************************************************************//
+	//module_hci_prepare_tx
+	//function:write hci packet header
+	//input: pdata-----packet length  (1byte)
+	//input: mem_uart_opcode------opcode (1byte)
+	//output:contwu --- pointer to packet payload
+	//use reg: contwu,pdata
+//****************************************************************//	
+module_hci_prepare_tx:
+	jam 0x02,mem_module_uart_cmd
+	store 1,mem_module_uart_len
+	storet 8,mem_temp
+	bpatch patch18_1,mem_patch18
+	call module_set_mcu_wake_pin_high_delay
+	fetcht 8,mem_temp
+	call uarta_prepare_tx_register_push
+	fetch 3,mem_module_uart_cmd
+	istore 3,contwu
+	rtn
+
+module_hci_transmit_tx:
+	bpatch patch18_2,mem_patch18
+	branch uarta_send_register_pop
+
+module_set_mcu_wake_pin_high_delay:
+	call module_check_mcu_wake_pin_high
+	rtn true
+module_set_mcu_wake_pin_h_delay:
+	call module_set_mcu_wake_pin_high
+	fetch 4,mem_module_mcu_wake_delay_us
+	rshift2 pdata,pdata
+	rtn blank
+	branch delay
+
+module_set_mcu_wake_pin_high:
+	//call ice_break
+	fetcht 1,mem_module_mcu_wake_pin
+	branch gpio_out_active
+
+module_check_mcu_wake_pin_high:
+	fetcht 1,mem_module_mcu_wake_pin
+	branch gpio_check_active
+
+module_set_mcu_wake_pin_low:
+	fetcht 1,mem_module_mcu_wake_pin
+	branch gpio_out_inactive
+
+
+
+/*********************hci command end*********************/
+
+/*********************hci ble receive data start*********************/
+
+//rega is le rx data address
+//regb is le rx data length
+//mem_le_att_handle is write handle
+module_le_receive_data:
+	storer rega,2,mem_module_le_rx_data_address
+	storer regb,2,mem_module_le_rx_data_len
+	fetch 2,mem_le_att_handle
+	store 2,mem_module_le_rx_data_handle
+	call module_check_ble_encrypt_state
+	rtn user
+	
+module_le_receive_data_ok:	
+	fetcht 2,mem_module_le_rx_data_len
+	fetch 1,mem_module_ble_data_uart_max_length
+	call not_greater_than
+	copy pdata,loopcnt
+	copy temp,pdata
+	isub loopcnt,pdata
+	store 2,mem_module_le_rx_data_len
+	call module_hci_event_receive_le_data
+	fetch 2,mem_module_le_rx_data_len
+	rtn blank
+	branch module_le_receive_data_ok
+
+/*********************hci ble receive data end*********************/
+
+module_exit_sniff:
+	fetch 2,mem_module_flag
+	rtnbit1 MOUDLE_TASK_UNSNIFF
+	call module_set_unsniff_task_flag	
+	branch app_bt_sniff_exit
+
+
+module_set_lpm_mult_2:
+	jam 2,mem_lpm_mult
+	rtn
+
+
+
+module_bb_event_timer:
+//	branch module_read_vdd_timer
+
+module_read_vdd_timer:
+	fetch 1,mem_module_read_vdd_flag
+	rtn blank
+	fetch 1,mem_module_read_vdd_count
+	rtn blank
+	increase -1,pdata
+	store 1,mem_module_read_vdd_count
+	nrtn blank
+	jam FLAG_MODULE_READ_VDD_COUNT,mem_module_read_vdd_count
+	call vdd_calculate_by_mode
+	div pdata,0x64
+	call get_div_result
+	remainder temp
+	store 1,mem_module_vdd_quotient
+	storet 1,mem_module_vdd_remainder
+	rtn	
+	
+
+module_control_air_flow:
+	call check_uart_tx_buff
+	branch app_l2cap_flow_control_enable,positive
+	branch app_l2cap_flow_control_disable
+
+
+/**************module state *******************/
+module_set_sniff_task_flag:
+	arg MOUDLE_TASK_SNIFF,queue
+	branch module_set_state
+
+module_clear_sniff_task_flag:
+	arg MOUDLE_TASK_SNIFF,queue
+	branch module_clr_state
+
+module_set_unsniff_task_flag:
+	arg MOUDLE_TASK_UNSNIFF,queue
+	branch module_set_state
+
+module_clear_unsniff_task_flag:
+	arg MOUDLE_TASK_UNSNIFF,queue
+	branch module_clr_state
+
+module_set_le_tx_data_flag:
+	arg MODULE_FLAG_BLE_DATA_FINISH,queue
+	branch module_set_state
+	
+module_clear_le_tx_data_flag:
+	arg MODULE_FLAG_BLE_DATA_FINISH,queue
+	branch module_clr_state
+
+module_clr_state:
+	fetch 2,mem_module_flag
+	qset0 pdata
+	store 2,mem_module_flag
+	rtn
+
+module_set_state:
+	fetch 2,mem_module_flag
+	qset1 pdata
+	store 2,mem_module_flag
+	rtn
+	
+/**************module state end*******************/
+
+
+else
+
+endif
Index: program/app_mouse.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_mouse.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_mouse.prog	(working copy)
@@ -0,0 +1,4940 @@
+
+ifdef COMPILE_MOUSE
+mouse_init:
+	call mouse_setting_config
+	call mouse_init_sunt
+	call mouse_dpi_config
+	rtn wake
+	call mouse_usb_check_enable
+	call mouse_drawing_optima_init
+	call mouse_cb_fuction
+	call mouse_sensor_powerdown
+	fetch 1,mem_usb_addr
+	rtnbit1 7
+mouse_init_wireless:	
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BTN_DOWN,mouse_start_discovery
+	call mouse_check_select_device_by_switch
+	branch mouse_start_work
+
+
+mouse_cb_fuction:
+	setarg mouse_24g_package_data
+	store 2,mem_cb_24g_transmit_data
+	setarg mouse_24g_search_dongle
+	store 2,mem_cb_24g_search_receiver
+	setarg mouse_lpm_before_common
+	store 2,mem_cb_24g_lpm_before
+	setarg mouse_le
+	store 2,mem_cb_le_process
+	setarg mouse_bt
+	store 2,mem_cb_bt_process
+	setarg mouse_process_lpm_before
+	store 2,mem_cb_before_lpm
+	setarg mouse_priority_bb_event
+	store 2,mem_cb_bb_event_process
+	setarg mouse_idle
+	store 2,mem_cb_idle_process
+	setarg mouse_before_hibernate
+	store 2,mem_cb_before_hibernate
+	setarg mouse_le_bb_event_connect_complete
+	store 2,mem_cb_att_write	
+	setarg mouse_bb_event_timer
+	store 2,mem_cb_event_timer
+	setarg mouse_spi_write_flash_cb
+	store 2,mem_cb_spi_flash_write_complate
+	setarg mouse_lpm_check_wake_lock
+	store 2,mem_cb_check_wakelock
+	setarg mouse_le_transmit
+	store 2,mem_cb_ble_transmit
+	setarg mouse_bt_slave_match
+	store 2,mem_cb_bt_slave_match
+	setarg mouse_set_lpm_mult
+	store 2,mem_cb_bt_set_mult
+	rtn
+
+
+mouse_setting_config:
+	rtn wake
+	call g24_transmit_init
+	call g24_chmap_param_init
+	call mouse_gpio_init
+	call mouse_param_init
+mouse_setting_config_next:
+	call le_set_config_fixed_ltk
+	call le_set_justwork
+	call le_set_fixed_ltk
+	call le_set_config_read_authentication
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_EEPROM,mouse_load_eeprom_info_check
+	bbit1 MOUSE_ENABLE_FLASH,mouse_load_flash_info_check
+	rtn
+	
+mouse_xtal_init:
+	jam 0x08,mem_fcomp_div		// 0x08--16M 
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_16M
+	jam 0x18,mem_fcomp_div		// 0x18--24M
+	rtn
+
+mouse_default_init:
+	jam 0xff,mem_usb_offline_check_gpio
+	jam 0xff,mem_ui_button_gpio
+	jam 0x1e,mem_ui_button_timeout
+
+	setarg mem_mouse_led_type
+	store 2,mem_ui_led_struct_ptr
+	jam 1,mem_ui_led_struct_num
+
+	setarg mem_mouse_rssi_signal_buf
+	store 2,mem_rssi_signal_buf_ptr
+
+	jam 1,mem_24g_data_type
+	
+	fetch 2,mem_mouse_discovery_timeout
+	store 2,mem_discovery_timeout
+
+	fetch 2,mem_mouse_24g_pair_timeout_init
+	store 2,mem_24g_pair_timeout_init
+
+	fetch 1,mem_mouse_24g_reconn_timeout_init
+	store 2,mem_24g_reconn_timeout_init
+
+	fetch 5,mem_rssi_dis_min_24g_init
+	store 5,mem_rssi_dis_min_24g
+
+	fetch 1,mem_mouse_24g_pair_tx_power
+	store 1,mem_24g_pair_tx_power
+
+
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	nrtn blank
+
+	
+// mouse.dat no configuration parameters
+	setarg 0x020800					//enable poweron direct  & 24g
+	store 3,mem_mouse_flag			
+	setarg 0x800700					// adc led use mode led
+	istore 3,contw
+	setarg 0x0300
+	istore 2,contw
+
+	jam 1,mem_lpm_mode
+	fetch 1,mem_mouse_enable_flag
+	isolate1 MOUSE_ADC_ENABLE,pdata
+	call mouse_adc_read_enable,true
+
+	fetch 1,mem_mouse_enable_flag
+	isolate1 MOUSE_24G_250HZ_ENABLE,pdata
+	call mouse_24g_set_250Hz,true
+	fetch 1,mem_mouse_enable_flag
+	isolate1 MOUSE_SEARCH_DONGLE_ENABLE,pdata
+	call mouse_24g_search_dongle_enable,true
+	fetch 1,mem_mouse_enable_flag
+	isolate1 MOUSE_CLK_16M_ENABLE,pdata
+	call mouse_16M_enable,true
+	fetch 1,mem_mouse_enable_flag
+	isolate1 MOUSE_DPI_4_LEVEL_ENABLE,pdata
+	call mouse_dpi_4level_enable,true
+	fetch 1,mem_mouse_enable_flag
+	isolate1 MOUSE_KEYBOARD_ENABLE,pdata
+	call mouse_customer_key_enable,true
+	
+	fetch 1,mem_24g_ch_map_update
+	ncall g24_chamap_param_update,blank
+
+	call mouse_xtal_init
+
+	fetch 1,mem_mouse_global_setup
+	and pdata,0x07,temp
+	storet 1,mem_adc_channel
+	rshift3 pdata,pdata
+	and pdata,0x01,temp
+	storet 1,mem_24g_ch_map_update
+	rshift pdata,pdata
+	and pdata,0x03,temp
+	storet 1,mem_adc_config_flag_init
+	rshift2 pdata,pdata
+	and pdata,0x03,pdata
+	call mouse_24g_long_sleep_set
+
+	fetch 1,mem_mouse_global_setup1
+	and pdata,0x03,temp
+	storet 1,mem_sensor_angle_default
+	rshift2 pdata,pdata
+	and pdata,0x03,temp
+	storet 1,mem_sensor_angle_switch
+	rshift2 pdata,pdata
+	and pdata,0x03,pdata
+	store 1,mem_config_sensor_dpi
+	store 1,mem_mouse_dpi
+	rshift2 pdata,pdata
+	and pdata,0x03,pdata
+	store 1,mem_device_number
+
+
+	setarg 0x0b0c0a
+	store 3,mem_lbutton_gpio
+	setarg 0xffffff
+	istore 3,contw
+	setarg 0x0607ff			// clk-07  sdio--06
+	istore 3,contw
+	setarg 0xffffff
+	istore 3,contw
+mouse_default_init_next:
+	
+/* adc*/
+	jam 0x0a,mem_adc_read_time_init
+	setarg 0x0064
+	store 2,mem_adc_low_volatage_led_blink_timer
+	call mouse_adc_vol_init	
+/****/
+	setarg 0x1770
+	store 2,mem_mouse_no_data_timeout				// 10min
+	jam 0x14,mem_mouse_device_poweron_timer_count_init	// 2s
+	setarg 0x0190
+	store 2,mem_mouse_low_v_led_blink_time			// 200ms on,200ms off
+	store 2,mem_mouse_dpi_led_blink_time
+	setarg 0x03e8
+	store 2,mem_mouse_disconvey_led_blink_time
+	jam 0x07,mem_rssi_buff_index
+	jam 125,mem_power_ctrl_pac_succ_cnt_init
+	jam TX_POWER_0DB,mem_tx_power
+
+	jam 0x01,mem_24g_fast_conn_enable
+	setarg 0x0f0f
+	store 2,mem_24g_fast_conn_addr
+	store 2,mem_24g_fast_conn_addr+2
+	
+//ble
+	fetch 2,mem_lap
+	store 2,mem_lap+4
+	arg mem_le_lap,contw
+	arg mem_lap,contr
+	arg 0x06,loopcnt
+	call reverse_byte
+	
+	jam 0x20,mem_lpm_mult_init
+	jam 0x34,mem_device1_type
+	fetch 6,mem_le_lap
+	store 6,mem_device1_locall_addr
+	jam 0x02,mem_mouse_bluetooth_type
+
+	jam 0x1f,mem_le_adv_data_len
+	
+	setarg 0x050102
+	store 3,mem_le_adv_data
+	setarg 0x120303
+	istore 3,contw
+	setarg 0x190318
+	istore 3,contw
+	setarg 0x03c2
+	istore 2,contw
+
+	setarg 0x06ff06
+	store 3,mem_le_adv_swift_pair
+	setarg 0x000300
+	istore 3,contw
+	setarg 0x090c80
+	istore 3,contw
+
+	setarg 0x355442		// BT5.2 Mouse
+	istore 3,contw
+	setarg 0x20322e
+	istore 3,contw
+	setarg 0x756f4d
+	istore 3,contw
+	setarg 0x6573
+	istore 2,contw
+
+	jam 0x1f,mem_le_scan_data_len
+	arg mem_le_adv_swift_pair+7,contr
+	arg mem_le_scan_data,contw
+	arg 13,loopcnt
+	call memcpy
+
+	fetch 1,mem_le_scan_data
+	increase -1,pdata
+	store 1,mem_le_name_len
+
+	arg mem_le_scan_data+2,contr
+	arg mem_le_name_len+1,contw
+	arg 11,loopcnt
+	call memcpy
+
+	setarg 0x070007
+	store 3,mem_le_interval_min
+	setarg 0x002000
+	istore 3,contw
+	setarg 0x012c
+	istore 2,contw
+
+	setarg 0x181203
+	store 3,mem_le_adv_ind
+
+	setarg 0x0000ff
+	store 3,mem_le_adv_direct_ind
+
+	setsect 0,0xfb
+	setsect 1,0x2c212
+	setsect 2,0x800f
+	setsect 3,0x21
+	store 8,mem_local_rx_max_octets
+
+	jam 0x07,mem_le_adv_channel_map
+
+	setarg 0x0015
+	store 2,mem_le_keyboard_handle
+	setarg 0x0019
+	store 2,mem_le_notify_handle
+	setarg 0x001d
+	store 2,mem_le_multimedia_handle
+	setarg 0x0021
+	store 2,mem_le_systemctrl_handle
+	setarg 0x0030
+	store 2,mem_le_battery_level_handle
+	setarg 0x0022
+	store 2,mem_le_pairing_handle
+
+	jam 0x96,mem_le_battery_level_updata_timer_init
+
+// 24g
+	jam MODE_24G_DEVICE,mem_device_flag
+	call g24_enable_1M
+	call g24_pair_param_init
+	
+	setarg 0x604800
+	store 3,mem_24g_enter_hibernate
+	setarg 0x012c
+	store 2,mem_24g_long_sleep_param_update_timer_init
+	setarg 0x0050
+	store 2,mem_24g_transmit_by_interrupt_exit_count_init
+	setarg 0x05
+	store 2,mem_mouse_24g_power_on_fast_conn_timer	// 200ms
+	setarg 0x0708									//search dongle 3min
+	store 2,mem_mouse_24g_search_dongle_time_init
+
+	
+// sensor
+	setarg 0x010403
+	store 3,mem_mouse_dpi_seting
+	setarg 0x2a2002
+	istore 3,contw
+	setarg 0x22153f
+	istore 3,contw
+	setarg 0x114433
+	istore 3,contw
+
+	setarg 0x265a09
+	store 3,mem_sensor_3212_init
+	setarg 0x041934
+	istore 3,contw
+	setarg 0x0009
+	istore 2,contw
+	setarg 0xffff
+	istore 2,contw
+
+	setarg 0x0d5a09
+	store 3,mem_sensor_3205_init
+	setarg 0xed1d10
+	istore 3,contw
+	setarg 0x807d
+	istore 2,contw
+	setarg 0xffff
+	istore 2,contw
+
+	setarg 0xff5a09
+	store 3,mem_sensor_8650_init
+	setarg 0x40ab27
+	istore 3,contw
+	setarg 0xa0d1be
+	istore 3,contw
+	setarg 0x12a141
+	istore 3,contw
+	setarg 0xa784a5
+	istore 3,contw
+	setarg 0xd0b5ff
+	istore 3,contw
+	setarg 0xff00b6
+	istore 3,contw
+	setarg 0x000900
+	istore 3,contw
+	setarg 0xffff
+	istore 2,contw
+
+	setarg 0x0d5a09
+	store 3,mem_sensor_ka8ul_init
+	setarg 0xc50e10
+	istore 3,contw
+	setarg 0x109a5b
+	istore 3,contw
+	setarg 0x421138
+	istore 3,contw
+	setarg 0x412828
+	istore 3,contw
+	setarg 0x394923
+	istore 3,contw
+	setarg 0x4bb04a
+	istore 3,contw
+	setarg 0x904ca0
+	istore 3,contw
+	setarg 0x09704d
+	istore 3,contw
+	setarg 0xffff00
+	istore 3,contw
+
+	setarg 0x46a509
+	store 3,mem_sensor_ka8g2_init
+	setarg 0x101934
+	istore 3,contw
+	setarg 0x690760
+	istore 3,contw
+	setarg 0x207d04
+	istore 3,contw
+	setarg 0x09007e
+	istore 3,contw
+	setarg 0x220d00
+	istore 3,contw
+	setarg 0xff220e
+	istore 3,contw
+	jam 0xff,mem_sensor_ka8g2_init+21
+		
+	setarg 0x0b5a09
+	store 3,mem_sensor_poweron_init
+	setarg 0x0009f3
+	istore 3,contw
+	setarg 0xffff
+	istore 2,contw
+
+	//sys init
+	branch app_sys_param_init
+	
+
+mouse_param_init:
+	setarg MOUSE_BT_SDP_ADDR				//bt sdp start address
+	store 2,mem_ui_uuid_table
+	setarg MOUSE_BLE_ATT_LIST_ADDR				//ble attlist start address
+	store 2,mem_ui_le_uuid_table
+	setarg 0x2580
+	store 3,mem_class
+	jam 3,mem_lpm_mult_timeout
+	jam 8,mem_lpm_overhead
+	jam DPI_BUTTON_STATE_UP,mem_select_device_button_statue
+	jam PB_BUTTON_STATE_UP,mem_select_device_button_statue
+	jam COMMBINATION_KEY_STATE_UP,mem_commbination_key_statue	
+	setarg 0x0200
+	store 2,mem_lpm_interval
+	jam 0x17,mem_le_local_mtu
+	jam 0x17,mem_le_remote_mtu
+//===========init spi param==============================
+	setarg 0x0a77
+	store 2,mem_spi_init_clk
+//===========all 16bit uuid==================================
+	setsect 0,0x306
+	setsect 1,0x4440
+	setsect 2,0x10000
+	setsect 3,0x4408
+	store 9,mem_all_uuid_16bits
+	setsect 0,0x1224
+	setsect 1,0x4000
+	setsect 2,0x0
+	istore 5,contw
+//===========features=====================================
+	setsect 0,0x3ffff
+	setsect 1,0x2fe23
+	setsect 2,0x199d9
+	setsect 3,0x20d
+	store 8,mem_features
+//======================================================	
+	setarg mem_le_tx_buffer0_omemalloc
+	store 2,mem_ble_l2cap_tx_buff0_ptr
+	setarg MOUSE_BLE_L2CAP_TXBUFF_SIZE
+	store 2,mem_ble_l2cap_tx_buff_size_ptr
+	
+	call mouse_device_led_all_off
+	call mouse_device_poweron_timer_init
+	call mouse_adc_gpio_mux_init
+
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_BT_125Hz,mouse_param_init_intervl_end
+	jam CLASSIC_INTERVAL_7_5MS,mem_sniff_param_interval
+	setarg LE_INTERVAL_7_5MS
+	store 2,mem_le_interval_min
+	store 2,mem_le_interval_min+2
+mouse_param_init_intervl_end:
+	call g24_interval_param_8ms
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_24G_250Hz,mouse_24g_short_sleep_set_end
+	call g24_interval_param_4ms
+mouse_24g_short_sleep_set_end:
+	fetch 1,mem_device_flag
+	store 1,mem_device_flag_temp
+	fetch 3,mem_le_lap+3
+	store 3,mem_mouse_le_lap_temp
+	fetch 1,mem_adc_config_flag_init
+	and pdata,0xfe,pdata		// hvin = vinlpm
+	store 1,mem_adc_config_flag_init
+	store 1,mem_adc_config_flag
+	setarg 0
+	store 7,mem_mouse_key
+	fetch 1,mem_ui_button_timeout
+	store 1,mem_bt_discovery_count
+	store 1,mem_select_device_count
+	call le_modified_name
+	branch mouse_sensor_set_angle
+
+
+mouse_start_work:
+	bpatch patch18_3,mem_patch18
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING, mouse_24g_first_start_auto_pair_mode
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_24g_start_mode
+	call mouse_wakeup_from_power_check	// wake from hibernate :enble user
+	nbranch mouse_buletooth_fast_conn_init,user
+mouse_start_reconnect_device:
+	bpatch patch18_4,mem_patch18
+	arg mem_device1_type,rega
+	fetch 1,mem_device_flag
+	increase -1,pdata
+	mul32 pdata,29,pdata
+	iadd rega,rega
+	ifetch 1,rega
+	store 1,mem_xrecord_mode
+mouse_start_reconnect:	
+	fetch 1,mem_xrecord_mode
+	beq REC_3_MODE,mouse3_0_check_reconn_target
+	beq REC_4_MODE,mouse4_0_check_reconn_target
+	branch mouse_start_discovery
+
+
+mouse_wakeup_from_power_check:
+	bpatch patch18_5,mem_patch18
+	disable user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_WAKEUP_FROM_POWER,mouse_wakeup_from_power
+	fetch 1,mem_wakup_from_power_flag
+	bbit0 BIT_POWER_ON,mouse_wakeup_from_power
+	enable user		// mouse power on
+mouse_wakeup_from_power:
+	fetch 1,mem_reconn_times_init
+	store 1,mem_reconn_times
+	rtn
+
+
+mouse3_0_check_reconn_target:
+	fetcht 2,mem_mouse_fast_page_to
+	fetch 1,mem_mouse_bluetooth_fast_conn_flag
+	beq 0xff,mouse3_0_check_reconn_target_next
+	fetcht 2,mem_mouse_page_to
+mouse3_0_check_reconn_target_next:	
+	storet 2,mem_page_to
+	fetch 6,mem_hci_plap
+	branch app_bt_start_discovery_short,blank
+	jam 0x17,mem_app_connection_options  //ssp
+	fetch 1,mem_ssp_enable
+	nbranch app_bt_start_reconnect,blank
+	jam 0x04,mem_app_connection_options  //no ssp
+	branch app_bt_start_reconnect
+	
+mouse4_0_check_reconn_target:
+	jam 1,mem_mouse_le_reconnect_flag
+	fetcht 1,mem_mouse_fast_direct_timeout
+	fetch 1,mem_mouse_bluetooth_fast_conn_flag
+	beq 0xff,mouse4_0_check_reconn_target_next
+	fetcht 1,mem_mouse_direct_timeout
+mouse4_0_check_reconn_target_next:	
+	storet 1,mem_mouse_direct_timer
+	call app_lpm_mult_disable
+	fetch 3,mem_le_adv_direct_ind
+	store 3,mem_le_adv_data+4
+	call mouse_le_check_adv_flag
+	setarg ADV_FLAG_BREDR_NOT_SUPPORTED
+	istore 1,contr
+	arg mem_le_scan_data,contr
+	call mouse_le_adv_data_update
+	branch check_51cmd_adv
+
+
+/*************************usb**********************************/
+mouse_usb_check_enable:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_USB
+	setarg mouse_usb_config_param
+	store 2,mem_cb_usb_config
+	jam MOUSE_USB_INTERFACE_REMOVE,mem_mouse_usb_vdd_status
+	branch mouse_usb_interface_check
+
+mouse_usb_config_param:
+	call mouse_usb_config_kb_check
+	call mouse_usb_config_param_init
+	branch mouse_usb_config_param_setup
+
+mouse_usb_config_kb_check:
+	jam DONGLE_KB_BIND_EEPROM_OFFECT,mem_mouse_usb_keyboard_flag
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_KEYBOARD
+	jam DONGLE_KB_BIND_SUCCESS,mem_mouse_usb_keyboard_flag
+	rtn
+
+mouse_usb_config_param_init:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_USB_250,mouse_usb_report_rate_set_250hz
+	bbit1 MOUSE_ENABLE_USB_500,mouse_usb_report_rate_set_500hz
+	bbit1 MOUSE_ENABLE_USB_1000,mouse_usb_report_rate_set_1000hz
+	jam 0x19,mem_wire_usb_interval
+	jam 0x08,mem_usb_tx_interval
+	rtn
+mouse_usb_report_rate_set_250hz:
+	jam 0x0c,mem_wire_usb_interval
+	jam 0x04,mem_usb_tx_interval
+	rtn
+mouse_usb_report_rate_set_500hz:
+	jam 0x06,mem_wire_usb_interval
+	jam 0x02,mem_usb_tx_interval
+	rtn
+mouse_usb_report_rate_set_1000hz:
+	jam 0x03,mem_wire_usb_interval
+	jam 0x01,mem_usb_tx_interval
+	rtn
+
+mouse_usb_config_param_setup:
+	call usb_tx_interval_config
+	call mouse_usb_vid_pid_config
+	branch mouse_usb_hid_icon_config
+
+mouse_usb_vid_pid_config:
+	fetch 1,mem_usb_vid_pid
+	rtn blank
+	fetch 1,mem_mouse_usb_keyboard_flag
+	beq DONGLE_KB_BIND_SUCCESS,dongle_usb_vid_pid_for_suit
+	branch dongle_usb_vid_pid_for_mouse_only_auto_pair
+
+mouse_usb_hid_icon_config:
+	fetch 1,mem_mouse_usb_keyboard_flag
+	branch dongle_usb_hid_icon_config+1
+
+
+mouse_usb_check:
+	fetch 1,core_usb_addr
+	bbit0 7,mouse_usb_no_exsit
+	bbit1 7,mouse_usb_exsit
+	rtn
+mouse_usb_no_exsit:
+	fetch 1,mem_usb_addr
+	rtnbit0 7
+	branch soft_reset_chip
+mouse_usb_exsit:
+	fetch 1,mem_usb_addr
+	rtnbit1 7
+	call mouse_24g_stop
+	branch mouse_stop_bluetooth_mode
+
+mouse_usb_isr:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_USB
+	call usb_isr
+	branch mouse_usb_interface_check
+//	branch usb_offline_state
+
+
+mouse_usb_interface_check:
+	bpatch patch18_6,mem_patch18
+	fetcht 1,mem_usb_offline_check_gpio
+	call gpio_get_bit
+	branch mouse_usb_gpio_low,true
+	branch mouse_usb_gpio_high
+
+
+mouse_usb_gpio_low:
+	fetch 1,mem_mouse_usb_vdd_status
+	rtneq MOUSE_USB_INTERFACE_REMOVE
+	jam MOUSE_USB_INTERFACE_REMOVE,mem_mouse_usb_vdd_status
+	jam 0,mem_usb_device_enumeration_endflag
+	jam 0,mem_usb_status
+	jam 0,mem_usb_state
+	branch mouse_init_wireless
+	
+	
+mouse_usb_gpio_high:
+	fetch 1,mem_mouse_usb_vdd_status
+	rtneq MOUSE_USB_INTERFACE_INSERT
+	jam MOUSE_USB_INTERFACE_INSERT,mem_mouse_usb_vdd_status
+	call mouse_24g_stop
+	call mouse_stop_bluetooth_mode
+	call mouse_device_led_all_off
+	branch usb_init
+	
+	
+mouse_usb_mode:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_USB
+	call mouse_usb_check
+	fetch 1,core_usb_addr
+	store 1,mem_usb_addr
+	rtnbit0 7
+	call mouse_clkn_check 
+	fetch 4,mem_btclk_sensor
+	fetcht 1,mem_wire_usb_interval
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	store 4,mem_btclk_sensor
+	call mouse_motion
+	nrtn user
+mouse_push_data_to_usb:
+	fetch 1,core_usb_addr
+	rtnbit0 7
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_KEYBOARD,mouse_push_mouse_data_to_usb
+	fetch 1,mem_customer_key
+	beq 1,mouse_push_keyboard_data_to_usb
+mouse_push_mouse_data_to_usb:
+	call dongle_usb_tx_ms_data
+	setarg MS_REPORT_ID
+	store 1,mem_usb_mouse_data
+	fetch 7,mem_mouse_key
+	istore 7,contw
+	rtn
+
+mouse_push_keyboard_data_to_usb:
+	fetch 1,mem_customer_data_trigger
+	branch mouse_push_release_keyboard_data_to_usb,blank
+	fetch 8,mem_customer_key_press+1
+mouse_push_keyboard_package_data_to_usb:
+	store 8,mem_pdatatemp
+	fetch 1,mem_customer_key_press
+	beq KB_MULTIKEY_REPORT_ID,mouse_push_multimedia_key_data_to_usb
+	beq KB_SYSTEM_CONCTRL_REPORT_ID,mouse_push_systemctrl_key_data_to_usb
+	call dongle_usb_tx_kb_data
+	fetch 8,mem_pdatatemp
+	store 8,mem_usb_kb_data
+	rtn
+	
+mouse_push_release_keyboard_data_to_usb:
+	fetch 8,mem_customer_key_release+1
+	branch mouse_push_keyboard_package_data_to_usb
+
+mouse_push_multimedia_key_data_to_usb:
+	call dongle_usb_tx_enable_ep2
+	jam USB_EP2_MULTIKEY,mem_usb_ep2_data
+	setarg KB_MULTIKEY_REPORT_ID
+	store 1,mem_usb_kb_multikey
+	fetch 2,mem_pdatatemp
+	istore 2,contw
+	rtn
+
+mouse_push_systemctrl_key_data_to_usb:
+	call dongle_usb_tx_enable_ep2
+	jam USB_EP2_SYSTEMKEY,mem_usb_ep2_data
+	setarg KB_SYSTEM_CONCTRL_REPORT_ID
+	store 1,mem_usb_kb_system
+	fetch 1,mem_pdatatemp
+	istore 1,contw
+	rtn
+
+	
+/*************************usb**********************************/
+
+
+/*****************system clk***********************************/
+
+mouse_clkn_check:
+	fetcht 4,mem_btclk_sensor
+	copy clkn_bt,pdata
+	isub temp,null
+	ncall mouse_clkn_timeout,positive
+	rtn
+mouse_clkn_timeout:
+	setarg 0
+	store 4,mem_btclk_sensor
+	rtn
+
+
+/*
+mouse_enable_clock_qdecoder:
+	fetch 2,core_clkoff
+	set0 CLOCK_OFF_QDECODER,pdata
+	store 2,core_clkoff
+	rtn
+*/
+
+mouse_lpm_check_wake_lock:
+	bmark1 mark_24g,app_get_lpm_wake_lock
+	fetch 1,mem_mouse_clear_sensor_data_flag
+	branch app_get_lpm_wake_lock,blank
+	fetch 1,mem_mouse_le_conn_param_reject
+	beq LE_LPM_DISABLE,app_get_lpm_wake_lock
+	fetch 2,mem_sdp_remote_cid
+	nbranch app_get_lpm_wake_lock,blank
+	fetch 1,mem_mouse_wheel_trigger
+	nbranch app_get_lpm_wake_lock,blank
+	branch app_put_lpm_wake_lock
+
+mouse_delay_enter_hibernata:
+	fetch 1,mem_mouse_direct_timeout
+	store 1,mem_mouse_bluetooth_reconnect_timeout
+	rtn
+
+
+mouse_app_enter_hibernate:
+	bpatch patch18_7,mem_patch18
+	call mouse_sensor_reset
+	call mouse_sensor_powerdown
+	call mouse_setgpio_hibernate
+	branch app_enter_hibernate
+
+	
+mouse_before_hibernate:
+	bpatch patch19_0,mem_patch19
+	enable user
+	fetch 4,0x8138
+	setflag user,26,pdata
+	store 4,core_lpm_reg
+	call lpm_write_ctrl
+	call disable_authrom
+	call mouse_device_led_all_off
+	call mouse_before_hibernate_wheel_gpio_set
+	call mouse_setgpio_hibernate
+	call mouse_flash_power_down
+	call gpio_set_before_lpm_common
+	fetcht 1,mem_sensor_motion_gpio
+	branch gpio_clr_wake
+
+
+mouse_setgpio_hibernate:
+	bpatch patch19_1,mem_patch19
+	call mouse_set_sdio_high
+	call clear_wake
+	call mouse_lpm_before_common
+	call gpio_pd_idle
+	arg 19,temp
+	call mouse_gpio_config_input_pu
+	branch mouse_gpio_set_high_impedance
+	
+
+	
+mouse_process_lpm_before:
+	rtnmark1 mark_24g
+	call mouse_lpm_before_common
+	fetch 1,mem_lpm_current_mult
+	nrtn blank					// 7.5ms, no gpio wakeup
+	branch gpio_clr_wake
+
+mouse_lpm_before_common:
+	bpatch patch19_2,mem_patch19
+	
+	call mouse_wheel_check
+	fetcht 1,mem_mouse_sensor_sclk_gpio					// set sclk high
+	call gpio_config_output
+mouse_lpm_before_common_next:	
+	call twspi_disable
+	
+	fetcht 1,mem_lbutton_gpio
+	call gpio_set_wake
+	fetcht 1,mem_rbutton_gpio
+	call gpio_set_wake
+	fetcht 1,mem_mbutton_gpio
+	call gpio_set_wake
+
+	fetcht 1,mem_bk_button_gpio
+	call gpio_set_wake
+	fetcht 1,mem_fw_button_gpio
+	call gpio_set_wake
+	fetcht 1,mem_dpi_button_gpio
+	call gpio_set_wake
+	fetcht 1,mem_config_select_device_button_gpio
+	call gpio_set_wake
+
+	fetcht 1,mem_customer_key_gpio
+	call gpio_set_wake
+	
+	fetcht 1,mem_whee_a_data_gpio
+	call gpio_set_wake_by_current_state
+	fetcht 1,mem_whee_b_data_gpio
+	call gpio_set_wake_by_current_state
+	fetcht 1,mem_whee_ta_data_gpio
+	call gpio_set_wake_by_current_state
+	fetcht 1,mem_whee_tb_data_gpio
+	call gpio_set_wake_by_current_state
+	fetcht 1,mem_sensor_motion_gpio
+	branch gpio_set_wake
+
+
+//short mult: no key 
+mouse_set_mult:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,mouse_set_ble_mult
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_CONNECTED,mouse_set_bt_mult
+	rtn
+mouse_set_ble_mult:
+	copy rega,pdata
+	nbranch le_set_config_short_mult,blank
+	branch le_clr_config_short_mult
+mouse_set_bt_mult:
+	copy rega,pdata
+	nbranch classic_bt_set_mult_short_flag,blank
+	branch classic_bt_clr_mult_short_flag
+
+/*****************system clk***********************************/
+	
+	
+/****************************adc**************************************/	
+mouse_adc_gpio_set:
+	fetch 1,mem_adc_config_flag
+	rtnne ADC_CONFIG_GPIO
+mouse_adc_gpio_check_output:
+	bpatch patch19_3,mem_patch19
+	fetcht 1,mem_adc_channel
+	sub temp,3,null
+	branch mouse_adc_gpio_4_7_set,positive
+	increase 5,temp
+	storet 1,mem_adc_channel_gpio
+mouse_adc_gpio_set_next:
+	copy temp,rega
+	call gpio_get_config
+	beq gpcfg_output_high,mouse_set_24g_led_statue
+	call mouse_clear_24g_led_statue
+	copy rega,temp
+	branch gpio_set_high_impedance
+
+mouse_adc_gpio_4_7_set:
+	increase 4,temp
+	storet 1,mem_adc_channel_gpio
+	branch mouse_adc_gpio_set_next
+
+mouse_adc_vol_init:
+	fetch 1,mem_adc_config_flag_init
+	beq ADC_CONFIG_GPIO,mouse_adc_gpio_vol_init
+	beq ADC_CONFIG_VINLPM,mouse_adc_gpio_vinlpm_init
+	jam ADC_CONFIG_VINLPM,mem_adc_config_flag_init
+	setarg 0x2c0172		// 0x0172--3.7V  0x012c--3.0V  0x0140--3.2V  0x014a--3.3V
+	store 3,mem_mouse_vdd_full_vol
+	setarg 0x014001
+	istore 3,contw
+	rtn
+mouse_adc_gpio_vol_init:	
+	setarg 0x5d0099		// 0x0099--1.5V   0x005d--0.9V  0x0068--1.0V  0x0071--1.1V
+	store 3,mem_mouse_vdd_full_vol
+	setarg 0x007100
+	istore 3,contw
+	rtn
+mouse_adc_gpio_vinlpm_init:
+	setarg 0xc8012c		// 0x012c--3.0V  0x00c8--2.0V  0x00dc--2.2V
+	store 3,mem_mouse_vdd_full_vol
+	setarg 0x00dc00
+	istore 3,contw
+	rtn
+	
+
+
+mouse_adc_gpio_mux_init:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_ADC
+	jam MOUSE_ADC_CHECK_MULTIPLE,mem_adc_mux_status
+	rtnbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC
+	rtnbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_ADC
+	jam MOUSE_ADC_CHECK_BATTERY_ONLY,mem_adc_mux_status
+	rtn
+
+mouse_adc_read_interval:	
+	fetch 1,mem_adc_read_timer
+	increase 1,pdata
+	store 1,mem_adc_read_timer
+	fetcht 1,mem_adc_read_time_init	//1s read adc
+	isub temp,null
+	rtn
+
+
+mouse_adc_read:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_ADC
+	call mouse_adc_gpio_set
+	fetch 1,mem_adc_mux_status
+	branch mouse_adc_read_battery,blank
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_GPIO,mouse_adc_read_gpio_mux_start	// gpio + dpi/switch
+	jam MOUSE_ADC_CHECK_VINLPM_MULTIPLE,mem_adc_mux_status
+	call mouse_adc_read_interval					// vinlpm + dpi/switch
+	branch  mouse_adc_read_gpio, positive
+	call mouse_adc_read_vinlpm
+	branch mouse_adc_read_start
+
+mouse_adc_read_gpio_mux_start:
+	jam MOUSE_ADC_CHECK_GPIO_MULTIPLE,mem_adc_mux_status
+	branch mouse_adc_read_start
+
+mouse_adc_read_gpio:
+	call mouse_adc_gpio_check_output
+	jam ADC_CONFIG_GPIO,mem_adc_config_flag
+	fetch 1,mem_24g_device_led_status
+	ncall mouse_adc_read_vinlpm,blank
+	branch mouse_adc_read_start
+	
+mouse_adc_read_vinlpm:
+	jam 0,mem_adc_read_timer
+	fetch 1,mem_adc_config_flag_init
+	store 1,mem_adc_config_flag
+	rtn	
+	
+mouse_adc_read_battery:		// only get battery
+	fetch 1,mem_adc_config_flag
+	bne ADC_CONFIG_GPIO,mouse_adc_read_battery_start
+	fetch 1,mem_24g_device_led_status
+	nrtn blank
+mouse_adc_read_battery_start:
+	call mouse_adc_read_interval
+	nrtn positive
+mouse_adc_read_start:
+	bpatch patch19_4,mem_patch19
+	fetch 1,mem_24g_device_led_status
+	nrtn blank
+	jam 0,mem_adc_read_timer
+	call vdd_calculate_by_mode
+	store 2,mem_mouse_vdd_now_vol
+	fetch 1,mem_adc_config_flag
+	bne ADC_CONFIG_GPIO, mouse_adc_data_process
+	fetcht 2,mem_mouse_vdd_now_vol	// BAT= 1.5V, R = 200k, a = a*1.8
+	mul32 temp,8,pdata
+	div pdata,10
+	call get_div_result
+	iadd temp,pdata
+	store 2,mem_mouse_vdd_now_vol
+mouse_adc_data_process:	
+	arg mem_mouse_vdd_calculate_set,rega
+	call mouse_adc_bat_percent_lowpower_out
+	fetch 1,mem_adc_power_flag
+	bbit1 2,mouse_adc_button_press
+	bbit1 1,mouse_power_down
+	bbit0 0,mouse_adc_no_low_voltage
+	jam 1,mem_mouse_adc_last_low_voltage_flag
+	branch mouse_adc_low_voltage
+	
+mouse_adc_low_voltage:
+	arg MOUSE_LOW_VOLTAGE_FLAG,queue
+	branch mouse_enable_function_flag
+mouse_adc_no_low_voltage:
+	arg MOUSE_LOW_VOLTAGE_FLAG,queue
+	call mouse_disable_function_flag
+	jam 12,mem_adc_low_volatage_led_timer_count
+	fetch 1,mem_mouse_adc_last_low_voltage_flag
+	rtn blank
+	jam 0,mem_mouse_adc_last_low_voltage_flag
+	fetcht 1,mem_config_low_voltage_alarm_gpio
+	branch mouse_led_off
+
+
+
+mouse_adc_bat_percent_lowpower_out:
+	bpatch patch19_5,mem_patch19
+	ifetch 8,rega
+	store 8,mem_pdatatemp
+	fetch 1,mem_adc_mux_status
+	beq MOUSE_ADC_CHECK_BATTERY_ONLY,mouse_adc_bat_percent_lowpower_out_battery
+	beq MOUSE_ADC_CHECK_GPIO_MULTIPLE,mouse_adc_bat_percent_lowpower_out_gpio_multiple
+	beq MOUSE_ADC_CHECK_VINLPM_MULTIPLE,mouse_adc_bat_percent_lowpower_out_vinlpm_multiple
+mouse_adc_bat_percent_lowpower_out_gpio_multiple:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC,mouse_adc_bat_percent_lowpower_out_gpio_switch
+	fetch 2,mem_pdatatemp+6		               	//now voltage
+	fetcht 2,mem_mouse_vdd_button_press_vol	// button press check
+	isub temp,null
+	nbranch mouse_adc_set_button_press_flag,positive
+	
+mouse_adc_bat_percent_lowpower_out_gpio_switch:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_ADC,mouse_adc_bat_percent_lowpower_out_battery
+	jam 0,mem_mouse_adc_button_press_flag
+	fetch 2,mem_pdatatemp+6				    	        //now voltage	
+	fetcht 2,mem_mouse_vdd_switch_gnd_24g_vol	// switch mode check
+	isub temp,null
+	nbranch mouse_select_24gdevice,positive
+	call mouse_select_btdevice
+	branch mouse_adc_bat_percent_lowpower_out_battery
+
+mouse_select_24gdevice:
+	call mouse_check_select_24gdevice
+	branch mouse_adc_bat_percent_lowpower_out_battery
+
+
+mouse_adc_bat_percent_lowpower_out_battery:	
+	call mouse_adc_clear_button_press_flag
+	call adc_clear_no_power_flag
+	call adc_clear_low_power_flag
+	fetch 2,mem_pdatatemp+6
+	fetcht 2,mem_pdatatemp+2	        //shutdown voltage
+	isub temp,null
+	ncall adc_set_no_power_flag,positive
+
+	fetcht 2,mem_pdatatemp+4		//low voltage
+	isub temp,null
+	ncall adc_set_low_power_flag,positive
+
+mouse_adc_bat_level_set:
+	fetch 2,mem_pdatatemp+6		//now voltage	
+	fetcht 2,mem_pdatatemp		//full voltage
+	isub temp,null
+	branch mouse_adc_bat_level_100_percent,positive		// now >= full
+	fetcht 2,mem_pdatatemp+2	        //shutdown voltage
+	isub temp,pdata
+	nbranch mouse_adc_bat_level_0_percent,positive		// now < shutdown
+	branch mouse_adc_bat_level_0_percent,blank			// now = shutdown
+	mul32 pdata,100,rega								// (now - shutdown)*100 /(full - shutdown)
+	fetch 2,mem_pdatatemp
+	fetcht 2,mem_pdatatemp+2
+	isub temp,temp
+	copy rega,pdata
+	idiv temp
+	call get_div_result
+	store 1,mem_le_battery_level_percentage
+	rtn
+
+mouse_adc_bat_level_100_percent:
+	jam 100,mem_le_battery_level_percentage
+	rtn
+mouse_adc_bat_level_0_percent:	
+	jam 0,mem_le_battery_level_percentage
+	rtn
+
+	
+mouse_adc_bat_percent_lowpower_out_vinlpm_multiple:
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_GPIO,mouse_adc_bat_percent_lowpower_out_gpio_multiple
+	branch mouse_adc_bat_percent_lowpower_out_battery
+	
+
+mouse_adc_set_button_press_flag:
+	fetcht 1,mem_adc_power_flag
+	set1 2,temp
+	storet 1,mem_adc_power_flag
+	rtn	
+
+mouse_adc_clear_button_press_flag:
+	fetcht 1,mem_adc_power_flag
+	set0 2,temp
+	storet 1,mem_adc_power_flag
+	rtn		
+
+mouse_adc_button_press:
+	jam 1,mem_mouse_adc_button_press_flag
+	rtn
+
+mouse_power_down:
+	call mouse_device_led_all_off
+	branch mouse_app_enter_hibernate
+	
+/****************************adc**************************************/	
+
+/****************************gpio******************************************/
+mouse_gpio_init:
+	fetcht 1,mem_eeprom_wp_gpio
+	call gpio_config_output
+	call usb_offline_check_init
+	fetcht 1,mem_lbutton_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_rbutton_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_mbutton_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_bk_button_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_fw_button_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_dpi_button_gpio
+	call mouse_gpio_config_input_pu
+
+	fetcht 1,mem_matrix_public_gpio
+	call mouse_gpio_config_input_pu
+
+	fetcht 1,mem_config_select_device_button_gpio
+	call mouse_gpio_config_input_pu
+
+	fetcht 1,mem_customer_key_gpio
+	call mouse_gpio_config_input_pu
+
+	fetcht 1,mem_whee_a_data_gpio
+	call mouse_gpio_config_input_pu
+
+	fetcht 1,mem_whee_b_data_gpio
+	call mouse_gpio_config_input_pu
+
+	fetcht 1,mem_whee_ta_data_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_whee_tb_data_gpio
+	call mouse_gpio_config_input_pu
+
+	fetcht 1,mem_sensor_motion_gpio
+	call mouse_gpio_config_input_pu
+
+	fetcht 1,mem_device_switch_gpio
+	call mouse_gpio_config_input_pu
+	
+
+	fetcht 1,mem_sensor_reset_gpio
+	call gpio_config_output
+
+	fetcht 1,mem_config_low_voltage_alarm_gpio
+	call gpio_config_output
+
+	fetcht 1,mem_config_device_24g_led_gpio
+	call gpio_config_output
+
+	fetcht 1,mem_config_device_bt1_led_gpio
+	call gpio_config_output
+	
+	fetcht 1,mem_config_device_bt2_led_gpio
+	call gpio_config_output
+
+	fetcht 1,mem_dpi_led_gpio
+	call gpio_config_output
+
+	fetcht 1,mem_select_sensor_angle_gpio
+	branch mouse_gpio_config_input_pu
+
+
+mouse_gpio_set_pupd_by_input:
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	rtn zero
+	and temp,0x7f,queue
+	fetch 4,core_gpio_in
+	qisolate1 pdata
+	branch mouse_gpio_config_input_pu,true
+	branch mouse_gpio_config_input_pd
+
+	
+mouse_gpio_config_input_pd:
+	set1 gpio_active_bit,temp
+	branch gpio_config_input
+
+mouse_gpio_config_input_pu:
+	set0 gpio_active_bit,temp
+	branch gpio_config_input
+
+mouse_gpio_set_high_impedance:
+	fetch 3,mem_mouse_set_high_impedance_bit_set
+	store 3,mem_pdatatemp
+	arg 20,loopcnt
+	arg 0,temp
+mouse_gpio_set_high_impedance_bit_loop:	
+	fetch 3,mem_pdatatemp
+	isolate1 0,pdata
+	call gpio_set_high_impedance,true
+	fetch 3,mem_pdatatemp
+	lshift pdata,pdata
+	store 3,mem_pdatatemp
+	increase 1,temp
+	loop mouse_gpio_set_high_impedance_bit_loop
+	rtn
+
+
+
+/****************************gpio******************************************/
+
+/*******************spi*****************************/
+mouse_sensor_spi_init:
+	call mouse_spid_init_pin
+	jam 0x73,mem_spi_init_clk
+//	jam 0x1e,mem_spi_init_delay_time
+	call mouse_spi_init
+	branch twspi_enable
+	
+mouse_spi_write_flash_cb:
+mouse_spi_init:
+	branch spid_init
+	
+mouse_spid_init_pin:
+	fetch 1,mem_mouse_sensor_sclk_gpio
+ 	arg gpcfg_spid_sck,temp
+ 	call gpio_config_function_int
+ 	fetch 1,mem_mouse_sensor_sdio_gpio
+ 	arg gpcfg_spid_sdio,temp
+ 	branch gpio_config_function_int
+
+
+/*******************spi*****************************/
+
+
+
+
+mouse_motion:
+	bpatch patch19_6,mem_patch19
+	disable user
+	setarg 0
+	store 6,mem_mouse_x
+	call mouse_check_sensor_data
+	call mouse_zwheel
+	call mouse_t_zwheel
+	call mouse_key
+	fetch 1,mem_mouse_key
+	and_into 0x1f,pdata
+	store 1,mem_mouse_key
+	nbranch mouse_drawing_optima_init,user
+	call mouse_drawing_optima
+	branch mouse_no_data_timer_init
+
+	
+
+/*******************wheel*************************/
+mouse_zwheel:
+	fetch 1,mem_mouse_z_data
+	rtn blank	
+	store 1,mem_mouse_z
+	jam 0,mem_mouse_z_data
+	branch enable_user
+	
+mouse_t_zwheel:
+	fetch 1,mem_mouse_tz_data
+	rtn blank	
+	store 1,mem_mouse_tz
+	jam 0,mem_mouse_tz_data
+	branch enable_user
+
+mouse_wheel_check:
+	call mouse_t_wheel_scan
+	call mouse_wheel_scan
+	fetch 1,mem_wheel_tb_new_pinlevel
+	fetcht 1,mem_wheel_tb_old_pinlevel
+	store 1,mem_wheel_tb_old_pinlevel
+	isub temp,null
+	nbranch app_lpm_wake_auto_lock,zero
+	fetch 1,mem_mwheel_b_new_pinlevel
+	fetcht 1,mem_mwheel_b_old_pinlevel
+	store 1,mem_mwheel_b_old_pinlevel
+	isub temp,null
+	nbranch app_lpm_wake_auto_lock,zero
+	rtn
+mouse_t_wheel_scan:
+	fetch 1,mem_whee_ta_data_gpio
+	rtneq GPIO_DISABLE
+	arg 0,rega
+	fetcht 1,mem_whee_ta_data_gpio
+	call gpio_get_bit
+	setflag true,0,rega
+	fetcht 1,mem_whee_tb_data_gpio
+	call gpio_get_bit
+	setflag true,1,rega
+	copy rega,pdata
+	store 1,mem_wheel_tb_new_pinlevel
+	beq 0x01,mouse_t_wheel_scan_judge1
+	beq 0x02,mouse_t_wheel_scan_judge2
+	fetch 1,mem_wheel_tog
+	bbit1 7,mouse_t_wheel_scan_judge3
+	rtn
+
+mouse_t_wheel_scan_judge1:
+	fetch 1,mem_wheel_tb_old_pinlevel
+	beq 0,mouse_t_wheel_scan_judge11
+	beq 3,mouse_t_wheel_scan_judge12
+	rtn
+mouse_t_wheel_scan_judge2:
+	fetch 1,mem_wheel_tb_old_pinlevel
+	beq 0,mouse_t_wheel_scan_judge21
+	beq 3,mouse_t_wheel_scan_judge22
+	rtn
+mouse_t_wheel_scan_judge11:
+	jam 0x82,mem_wheel_tog
+	rtn
+mouse_t_wheel_scan_judge12:
+	jam 0x81,mem_wheel_tog
+	rtn
+mouse_t_wheel_scan_judge21:
+	jam 0x80,mem_wheel_tog
+	rtn
+mouse_t_wheel_scan_judge22:
+	jam 0x83,mem_wheel_tog
+	rtn
+mouse_t_wheel_scan_judge3:
+	fetch 1,mem_wheel_tog
+	set0 7,pdata
+	store 1,mem_wheel_tog
+	beq 0,mouse_t_wheel_scan_judge30
+	beq 1,mouse_t_wheel_scan_judge31
+	beq 2,mouse_t_wheel_scan_judge32
+	beq 3,mouse_t_wheel_scan_judge33
+	rtn
+mouse_t_wheel_scan_judge30:
+	fetch 1,mem_wheel_tb_new_pinlevel
+	beq 3,mouse_wheel_t_forward
+	rtn
+mouse_t_wheel_scan_judge31:
+	fetch 1,mem_wheel_tb_new_pinlevel
+	beq 0,mouse_wheel_t_forward
+	rtn
+mouse_t_wheel_scan_judge32:
+	fetch 1,mem_wheel_tb_new_pinlevel
+	beq 3,mouse_wheel_t_back
+	rtn
+mouse_t_wheel_scan_judge33:
+	fetch 1,mem_wheel_tb_new_pinlevel
+	beq 0,mouse_wheel_t_back
+	rtn
+mouse_wheel_t_forward:
+	fetch 1,mem_mouse_tz_data
+	increase 1,pdata
+	store 1,mem_mouse_tz_data
+	rtn
+mouse_wheel_t_back:
+	fetch 1,mem_mouse_tz_data
+	increase -1,pdata
+	store 1,mem_mouse_tz_data
+	rtn
+
+
+mouse_wheel_scan:
+	fetch 1,mem_whee_a_data_gpio
+	rtneq GPIO_DISABLE
+	arg 0,rega
+	fetcht 1,mem_whee_a_data_gpio
+	call gpio_get_bit
+	setflag true,0,rega
+	fetcht 1,mem_whee_b_data_gpio
+	call gpio_get_bit
+	setflag true,1,rega
+	copy rega,pdata
+	store 1,mem_mwheel_b_new_pinlevel
+	beq 0x01,mouse_wheel_scan_judge1
+	beq 0x02,mouse_wheel_scan_judge2
+	fetch 1,mem_mwheel_tog
+	bbit1 7,mouse_wheel_scan_judge3
+	rtn
+
+mouse_wheel_scan_judge1:
+	fetch 1,mem_mwheel_b_old_pinlevel
+	beq 0,mouse_wheel_scan_judge11
+	beq 3,mouse_wheel_scan_judge12
+	rtn
+mouse_wheel_scan_judge2:
+	fetch 1,mem_mwheel_b_old_pinlevel
+	beq 0,mouse_wheel_scan_judge21
+	beq 3,mouse_wheel_scan_judge22
+	rtn
+mouse_wheel_scan_judge11:
+	jam 0x82,mem_mwheel_tog
+	rtn
+mouse_wheel_scan_judge12:
+	jam 0x81,mem_mwheel_tog
+	rtn
+mouse_wheel_scan_judge21:
+	jam 0x80,mem_mwheel_tog
+	rtn
+mouse_wheel_scan_judge22:
+	jam 0x83,mem_mwheel_tog
+	rtn
+mouse_wheel_scan_judge3:
+	fetch 1,mem_mwheel_tog
+	set0 7,pdata
+	store 1,mem_mwheel_tog
+	beq 0,mouse_wheel_scan_judge30
+	beq 1,mouse_wheel_scan_judge31
+	beq 2,mouse_wheel_scan_judge32
+	beq 3,mouse_wheel_scan_judge33
+	rtn
+mouse_wheel_scan_judge30:
+	fetch 1,mem_mwheel_b_new_pinlevel
+	beq 3,mouse_wheel_forward
+	rtn
+mouse_wheel_scan_judge31:
+	fetch 1,mem_mwheel_b_new_pinlevel
+	beq 0,mouse_wheel_forward
+	rtn
+mouse_wheel_scan_judge32:
+	fetch 1,mem_mwheel_b_new_pinlevel
+	beq 3,mouse_wheel_back
+	rtn
+mouse_wheel_scan_judge33:
+	fetch 1,mem_mwheel_b_new_pinlevel
+	beq 0,mouse_wheel_back
+	rtn
+mouse_wheel_forward:
+	fetch 1,mem_mouse_z_data
+	increase 1,pdata
+	store 1,mem_mouse_z_data
+	rtn
+mouse_wheel_back:
+	fetch 1,mem_mouse_z_data
+	increase -1,pdata
+	store 1,mem_mouse_z_data
+	rtn
+
+
+mouse_wheel_gpio_set_wake:
+	fetcht 1,mem_whee_a_data_gpio
+	call gpio_set_wake_by_current_state
+	fetcht 1,mem_whee_b_data_gpio
+	call gpio_set_wake_by_current_state
+	fetcht 1,mem_whee_ta_data_gpio
+	call gpio_set_wake_by_current_state
+	fetcht 1,mem_whee_tb_data_gpio
+	branch gpio_set_wake_by_current_state
+	
+mouse_before_hibernate_wheel_gpio_set:
+	fetcht 1,mem_whee_a_data_gpio
+	call mouse_gpio_set_pupd_by_input
+	fetcht 1,mem_whee_b_data_gpio
+	call mouse_gpio_set_pupd_by_input
+	fetcht 1,mem_whee_ta_data_gpio
+	call mouse_gpio_set_pupd_by_input
+	fetcht 1,mem_whee_tb_data_gpio
+	branch mouse_gpio_set_pupd_by_input
+
+mouse_wheel_trigger:
+	fetch 2,mem_mouse_z
+	rtn blank
+	jam 1,mem_mouse_wheel_trigger
+	jam 10,mem_mouse_wheel_trigger_timer
+	rtn
+
+mouse_wheel_trigger_timer:
+	arg mem_mouse_wheel_trigger_timer,regc
+	arg mouse_wheel_trigger_disable,regb
+	branch timer_single_step
+mouse_wheel_trigger_disable:
+	jam 0,mem_mouse_wheel_trigger
+	rtn
+
+
+/*
+mouse_set_qdecoder_x:
+	arg MOUSE_DEFAULT_XA_GPIO,temp
+	call mouse_gpio_config_input_pu
+	arg MOUSE_DEFAULT_XA_GPIO,temp
+	call gpio_get_bit
+	rtn true
+	fetch 1,core_qdec_cntx
+	set1 4,pdata
+	store 1,core_qdec_cntx
+	rtn
+*/	
+	
+/*******************wheel*************************/
+
+
+
+/********************dpi******************************/
+mouse_dpi_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC,mouse_dpi_check_connect_adc
+	fetch 1,mem_dpi_button_gpio
+	rtneq GPIO_DISABLE
+	arg 0,rega
+	jam MOUSE_DPI_KEY,mem_mouse_key_temp
+	fetcht 1,mem_dpi_button_gpio
+	call mouse_dpi_key_check
+mouse_dpi_check_next:
+	store 1,mem_mouse_dpikey_press_status
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,mouse_3io6key_dpi_check_end
+	call mouse_matrix_public_gpio_reset
+mouse_dpi_check_exit:	
+	copy rega,pdata
+	bbit1 MOUSE_DPI_KEY,mouse_dpi_down
+	branch mouse_dpi_up
+
+mouse_dpi_check_connect_adc:
+	fetch 1,mem_mouse_adc_button_press_flag
+	branch mouse_dpi_up,blank
+	branch mouse_dpi_down
+	
+mouse_dpi_key_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_GND,mouse_dpi_key_connect_gnd
+	fetch 1,mem_mouse_dpikey_press_status
+	copy pdata,regc
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,mouse_3io6key_check
+mouse_dpi_key_check_next:
+	fetch 1,mem_mouse_ghost_flag
+	nbranch mouse_dpi_check_end,blank
+	branch mouse_dpi_key_connect_matrix	
+
+mouse_3io6key_dpi_check_end:
+	fetcht 1,mem_dpi_button_gpio
+	call mouse_gpio_config_input_pu
+	branch mouse_dpi_check_exit
+
+mouse_dpi_check_end:
+	jam DPI_BUTTON_STATE_UP,mem_mouse_dpi_button_state
+	jam 0,mem_mouse_dpikey_press_status
+	rtn
+
+mouse_dpi_key_connect_gnd:
+	fetch 1,mem_mouse_dpikey_press_status
+	branch mouse_check_key_connect_gnd
+
+mouse_dpi_key_connect_matrix:
+	call gpio_get_bit
+	fetcht 1,mem_matrix_public_gpio
+	branch mouse_dpi_key_connect_gnd,true
+	fetcht 1,mem_matrix_public_gpio
+	call gpio_out_active
+	fetcht 1,mem_dpi_button_gpio
+	fetch 1,mem_mouse_dpikey_press_status
+	branch mouse_check_key_connect_gnd
+
+
+mouse_dpi_down:
+	fetch 1,mem_mouse_dpi_button_state
+	rtneq DPI_BUTTON_STATE_DOWN
+	jam DPI_BUTTON_STATE_DOWN,mem_mouse_dpi_button_state
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON
+	rtnbit1 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY
+	branch mouse_dpi_process
+
+mouse_dpi_up:
+	fetch 1,mem_mouse_dpi_button_state
+	rtneq DPI_BUTTON_STATE_UP
+	jam DPI_BUTTON_STATE_UP,mem_mouse_dpi_button_state
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON,mouse_dpi_up_next
+	bbit1 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY,mouse_dpi_up_next
+	rtn
+mouse_dpi_up_next:	
+	fetch 1,mem_mouse_dpi_long_press_flag
+	nbranch mouse_dpi_up_after_long_press,blank
+	fetch 1,mem_select_device_count
+	ncall mouse_dpi_process,blank
+mouse_dpi_up_after_long_press:	
+	jam 0,mem_mouse_dpi_long_press_flag
+	fetch 1,mem_ui_button_timeout
+	store 1,mem_select_device_count	
+	store 1,mem_bt_discovery_count	
+	rtn
+	
+mouse_dpi_process:	
+	bpatch patch19_7,mem_patch19
+	call mouse_dpi_ghost_check
+	rtn user
+	fetch 1,mem_mouse_dpi
+	increase 1,pdata
+	and pdata,0x03,pdata
+	store 1,mem_mouse_dpi
+	call mouse_seting_dpi
+	branch mouse_store_device_info_delay
+
+mouse_dpi_ghost_check:
+	disable user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_GND
+	rtnbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC
+	fetch 1,mem_mouse_lkey_press_status
+	rtn blank
+	fetch 1,mem_mouse_rkey_press_status
+	rtn blank
+	enable user
+	rtn
+	
+
+mouse_dpi_key_check_long_press:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON,mouse_select_device_by_dpi_button
+	bbit1 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY,mouse_discovery_by_dpi_button
+	rtn
+
+
+mouse_select_device_by_dpi_button:
+	fetch 1,mem_mouse_dpi_button_state
+	rtnne DPI_BUTTON_STATE_DOWN	
+	arg mem_select_device_count,regc
+	arg mouse_ready_reconnection_by_dpi_button,regb
+	branch timer_single_step
+
+mouse_ready_reconnection_by_dpi_button:
+	jam 1,mem_mouse_dpi_long_press_flag
+	branch mouse_ready_reconnection_by_button
+
+mouse_discovery_by_dpi_button:
+	fetch 1,mem_mouse_dpi_button_state
+	rtnne DPI_BUTTON_STATE_DOWN	
+	arg mem_bt_discovery_count,regc
+	arg mouse_long_dpi_button_bt_discovery,regb
+	branch timer_single_step
+
+mouse_long_dpi_button_bt_discovery:
+	jam 1,mem_mouse_dpi_long_press_flag
+	branch mouse_long_button_bt_discovery
+
+
+
+mouse_dpi_config:
+	branch mouse_seting_sensor_type
+
+
+mouse_setting_dpi_4_level:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_DPI_LEVEL_4
+	fetch 1,mem_mouse_dpi
+	rtnne MOUSE_DPI_LEVEL4
+	jam MOUSE_DPI_LEVEL1,mem_mouse_dpi
+	rtn
+	
+
+mouse_seting_dpi:
+	bpatch patch1a_0,mem_patch1a
+	call mouse_setting_dpi_4_level
+	call mouse_dpi_led_blink_delay
+mouse_seting_sensor_type:
+	fetch 1,mem_config_sensor_type
+	beq P3212,mouse_seting_3212_dpi
+	beq KA8G2,mouse_seting_ka8g2_dpi
+	fetch 1,mem_mouse_dpi
+	beq MOUSE_DPI_LEVEL1,mouse_set_cpi0		//1200
+	beq MOUSE_DPI_LEVEL2,mouse_set_cpi1		//1600
+	beq MOUSE_DPI_LEVEL3,mouse_set_cpi2		//800
+	beq MOUSE_DPI_LEVEL4,mouse_set_cpi3		//1000
+mouse_set_cpi1:	//320x+8009
+	fetcht 1,mem_320x_dpi_1
+	branch mouse_dpi_store
+mouse_set_cpi0:
+	fetcht 1,mem_320x_dpi_0
+	branch mouse_dpi_store
+mouse_set_cpi2:
+	fetcht 1,mem_320x_dpi_2
+	branch mouse_dpi_store
+mouse_set_cpi3:
+	fetcht 1,mem_320x_dpi_3
+	branch mouse_dpi_store
+
+mouse_dpi_store:
+	fetch 1,mem_config_sensor_type
+	beq P3065_XY,mouse_3065xy_set_dpi
+	beq MX8650,mouse_3065xy_set_dpi
+	beq KA8,mouse_ka8_set_dpi
+	beq P6520,mouse_ka8_set_dpi
+	beq P8009,mouse_3065xy_set_dpi
+mouse_dpi_write:		// 3205  1  2  3  4
+	storet 1,mem_mouse_cpi_count
+	setarg MOUSE_DPI_ADDRESS
+	call twspi_read
+	and pdata,0xf8,temp
+	fetch 1,mem_mouse_cpi_count
+	iadd temp,pdata
+	lshift8 pdata,pdata
+	add pdata,MOUSE_DPI_ADDRESS,pdata
+	branch twspi_write
+
+mouse_3065xy_set_dpi:	// 0 1 2 3
+	increase -1,temp
+	branch mouse_dpi_write
+
+mouse_ka8_set_dpi:	// 3 4 5 6
+	increase 2,temp
+	branch mouse_dpi_write
+
+mouse_seting_3212_dpi:
+	fetch 1,mem_mouse_dpi
+	beq MOUSE_DPI_LEVEL1,mouse_set_p3212_cpi0	//1200
+	beq MOUSE_DPI_LEVEL2,mouse_set_p3212_cpi1	//1600
+	beq MOUSE_DPI_LEVEL3,mouse_set_p3212_cpi2	//2400
+	beq MOUSE_DPI_LEVEL4,mouse_set_p3212_cpi3	//800
+mouse_set_p3212_cpi1:
+	fetch 1,mem_3212_dpi_1
+	branch mouse_p3212_dpi
+mouse_set_p3212_cpi0:
+	fetch 1,mem_3212_dpi_0
+	branch mouse_p3212_dpi
+mouse_set_p3212_cpi2:
+	fetch 1,mem_3212_dpi_2
+	branch mouse_p3212_dpi
+mouse_set_p3212_cpi3:
+	fetch 1,mem_3212_dpi_3
+mouse_p3212_dpi:
+	store 1,mem_mouse_cpi_count
+	lshift8 pdata,pdata
+	copy pdata,rega
+	add pdata,MOUSE_P3212_DPI_XADDRESS,pdata
+  	call twspi_write
+ 	copy rega,pdata
+  	add pdata,MOUSE_P3212_DPI_YADDRESS,pdata
+	branch twspi_write
+
+mouse_seting_ka8g2_dpi:
+	fetch 1,mem_mouse_dpi
+	beq MOUSE_DPI_LEVEL1,mouse_set_pka8g2_cpi0		//1600
+	beq MOUSE_DPI_LEVEL2,mouse_set_pka8g2_cpi1		//2400
+	beq MOUSE_DPI_LEVEL3,mouse_set_pka8g2_cpi2		//3200
+	beq MOUSE_DPI_LEVEL4,mouse_set_pka8g2_cpi3		//800
+mouse_set_pka8g2_cpi1:
+	fetch 1,mem_ka8g2_dpi_1
+	branch mouse_p3212_dpi
+
+mouse_set_pka8g2_cpi0:
+	fetch 1,mem_ka8g2_dpi_0
+	branch mouse_p3212_dpi
+	
+mouse_set_pka8g2_cpi2:
+	fetch 1,mem_ka8g2_dpi_2
+	branch mouse_p3212_dpi
+
+mouse_set_pka8g2_cpi3:
+	fetch 1,mem_ka8g2_dpi_3
+	branch mouse_p3212_dpi
+
+		
+/********************dpi******************************/		
+
+
+/***********************key******************************/
+
+mouse_key:
+	call mouse_check_key_gpio
+	call mouse_ghost_key_check
+	call mouse_set_mult
+	call mouse_24g_key
+	copy rega,pdata
+	fetcht 1,mem_mouse_key_last
+	store 1,mem_mouse_key_last
+	store 1,mem_mouse_key
+	ixor temp,pdata
+	sub pdata,0,null
+	rtn zero
+	branch enable_user
+
+mouse_24g_key:
+	rtnmark0 mark_24g
+	copy rega,pdata
+	rtn blank
+	store 1,mem_mouse_key
+	branch enable_user
+
+mouse_ghost_key_check:
+	jam 0,mem_mouse_matrix_key_cow_count
+	jam 0,mem_mouse_matrix_key_row_count
+	jam 0,mem_mouse_ghost_flag
+	copy pdata,temp
+	call mouse_ghost_key_check_L_BK
+	call mouse_ghost_key_check_M_FW
+	call mouse_ghost_key_check_BK_FW
+	call mouse_ghost_key_check_LMR
+	fetch 1,mem_mouse_matrix_key_row_count
+	rtn blank
+	fetch 1,mem_mouse_matrix_key_cow_count
+	rtn blank
+	jam 1,mem_mouse_ghost_flag
+	fetch 1,mem_mouse_key_last		// matrix have ghost key
+	copy pdata,rega
+	rtn
+
+mouse_ghost_key_check_L_BK:
+	and temp,MOUSE_L_BK_BUTTON,pdata
+	beq MOUSE_L_BK_BUTTON,mouse_matrix_cow_more_than_one_key
+	rtn
+mouse_ghost_key_check_M_FW:
+	and temp,MOUSE_M_FW_BUTTON,pdata
+	beq MOUSE_M_FW_BUTTON,mouse_matrix_cow_more_than_one_key
+	rtn
+mouse_ghost_key_check_BK_FW:
+	and temp,MOUSE_BK_FW_BUTTON,pdata
+	beq MOUSE_BK_FW_BUTTON,mouse_matrix_row_more_than_one_key
+	rtn	
+
+mouse_ghost_key_check_LMR:
+	and temp,MOUSE_LMR_BUTTON,pdata	// key LMR press
+	beq MOUSE_LR_BUTTON,mouse_matrix_row_more_than_one_key
+	beq MOUSE_LM_BUTTON,mouse_matrix_row_more_than_one_key
+	beq MOUSE_RM_BUTTON,mouse_matrix_row_more_than_one_key
+	beq MOUSE_LMR_BUTTON,mouse_matrix_row_more_than_one_key
+	rtn
+
+
+mouse_matrix_row_more_than_one_key:
+	jam 1,mem_mouse_matrix_key_row_count
+	rtn
+
+mouse_matrix_cow_more_than_one_key:
+	jam 1,mem_mouse_matrix_key_cow_count
+	rtn
+
+mouse_key_check_once:
+	call mouse_check_key_gpio_once
+	call mouse_check_key_gpio
+	setarg 0x00
+	store 3,mem_mouse_lkey_press_status
+	rtn
+	
+mouse_check_key_gpio:
+	bpatch patch1a_1,mem_patch1a
+	fetch 1,mem_sensor_shutdown_flag
+	ncall mouse_check_key_gpio_once,blank
+	arg 0,rega
+	call mouse_check_lkey_gpio
+	call mouse_check_rkey_gpio
+	call mouse_check_mkey_gpio
+	call mouse_check_bkkey_gpio
+	call mouse_check_fwkey_gpio
+mouse_check_key_gpio_next:
+	call mouse_check_customerkey_gpio
+	copy rega,pdata
+	rtn
+
+mouse_check_key_gpio_once:
+	setarg 0x030303
+	store 3,mem_mouse_lkey_press_status
+	rtn
+
+mouse_check_lkey_gpio:
+	jam MOUSE_L_KEY,mem_mouse_key_temp
+	fetcht 1,mem_lbutton_gpio
+	fetch 1,mem_mouse_lkey_press_status
+	call mouse_check_key_connect_gnd
+	store 1,mem_mouse_lkey_press_status
+	rtn
+
+mouse_check_rkey_gpio:
+	jam MOUSE_R_KEY,mem_mouse_key_temp
+	fetcht 1,mem_rbutton_gpio
+	fetch 1,mem_mouse_rkey_press_status
+	call mouse_check_key_connect_gnd
+	store 1,mem_mouse_rkey_press_status
+	rtn
+	
+mouse_check_mkey_gpio:
+	jam MOUSE_M_KEY,mem_mouse_key_temp
+	fetcht 1,mem_mbutton_gpio
+	fetch 1,mem_mouse_mkey_press_status
+	call mouse_check_key_connect_gnd
+	store 1,mem_mouse_mkey_press_status
+	rtn
+
+mouse_check_bkkey_gpio:
+	fetch 1,mem_bk_button_gpio
+	rtneq GPIO_DISABLE
+	jam MOUSE_BK_KEY,mem_mouse_key_temp
+	fetch 1,mem_mouse_bkkey_press_status
+	copy pdata,regc
+	fetcht 1,mem_bk_button_gpio
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,mouse_3io6key_bk_check
+mouse_check_bkkey_gpio_next:
+	call gpio_get_bit
+	branch mouse_check_bk_button_connect_gnd,true
+	fetcht 1,mem_matrix_public_gpio
+	call gpio_out_active
+	fetcht 1,mem_bk_button_gpio
+	fetch 1,mem_mouse_bkkey_press_status
+	call mouse_check_key_connect_gnd
+mouse_check_bkkey_gpio_end:	
+	store 1,mem_mouse_bkkey_press_status
+	branch mouse_matrix_public_gpio_reset
+
+mouse_check_bk_button_connect_gnd:
+	fetcht 1,mem_matrix_public_gpio
+	fetch 1,mem_mouse_bkkey_press_status
+	call mouse_check_key_connect_gnd
+	branch mouse_check_bkkey_gpio_end
+
+mouse_3io6key_bk_check:
+	call mouse_3io6key_check
+	store 1,mem_mouse_bkkey_press_status
+	fetcht 1,mem_bk_button_gpio
+	branch mouse_gpio_config_input_pu
+
+
+mouse_check_fwkey_gpio:
+	fetch 1,mem_fw_button_gpio
+	rtneq GPIO_DISABLE
+	jam MOUSE_FW_KEY,mem_mouse_key_temp
+	fetch 1,mem_mouse_fwkey_press_status
+	copy pdata,regc
+	fetcht 1,mem_fw_button_gpio
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,mouse_3io6key_fw_check
+mouse_check_fwkey_gpio_next:
+	call gpio_get_bit
+	branch mouse_check_fw_button_connect_gnd,true
+	fetcht 1,mem_matrix_public_gpio
+	call gpio_out_active
+	fetcht 1,mem_fw_button_gpio
+	fetch 1,mem_mouse_fwkey_press_status
+	call mouse_check_key_connect_gnd
+mouse_check_fwkey_gpio_end:	
+	store 1,mem_mouse_fwkey_press_status
+	branch mouse_matrix_public_gpio_reset
+
+mouse_check_fw_button_connect_gnd:
+	fetcht 1,mem_matrix_public_gpio
+	fetch 1,mem_mouse_fwkey_press_status
+	call mouse_check_key_connect_gnd
+	branch mouse_check_fwkey_gpio_end	
+
+mouse_3io6key_fw_check:
+	call mouse_3io6key_check
+	store 1,mem_mouse_fwkey_press_status
+	fetcht 1,mem_fw_button_gpio
+	branch mouse_gpio_config_input_pu
+
+
+mouse_matrix_public_gpio_reset:	
+	fetcht 1,mem_matrix_public_gpio
+	branch mouse_gpio_config_input_pu
+
+mouse_check_customerkey_gpio:
+	jam 0,mem_customer_key
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_KEYBOARD
+	fetch 1,mem_customer_key_gpio
+	rtneq GPIO_DISABLE
+	jam MOUSE_CUSTOMER_KEY,mem_mouse_key_temp
+	fetcht 1,mem_customer_key_gpio
+	fetch 1,mem_mouse_customerkey_press_status
+	call mouse_check_key_connect_gnd
+	store 1,mem_mouse_customerkey_press_status
+	copy rega,pdata
+	bbit1 MOUSE_CUSTOMER_KEY,mouse_customerkey_press
+	call mouse_customerkey_release
+mouse_check_customerkey_gpio_exit:
+	fetch 1,mem_customer_data_trigger
+	store 1,mem_customer_data_trigger_last
+	rtn
+
+
+mouse_customerkey_press:
+	jam 1,mem_customer_data_trigger
+	call mouse_customer_key_need_send
+	branch mouse_check_customerkey_gpio_exit
+
+mouse_customerkey_release:
+	jam 0,mem_customer_data_trigger
+	fetch 1,mem_customer_data_trigger_last
+	rtn blank
+mouse_customer_key_need_send:	
+	jam 1,mem_customer_key
+	rtn	
+
+
+mouse_check_matrix_button_connect_gnd:	
+	call gpio_get_bit
+	fetcht 1,mem_mouse_key_temp
+	copy temp,queue	
+	branch  mouse_key_press,true
+	branch mouse_key_release
+
+mouse_check_key_connect_gnd:	
+	lshift pdata,pdata
+	copy pdata,regb
+	call gpio_get_bit
+	setflag true,0,regb
+	and regb,0x07,pdata
+	fetcht 1,mem_mouse_key_temp
+	copy temp,queue
+	beq 0x07,mouse_key_press		//  about 17~22ms three times
+	beq 0x00,mouse_key_release
+	rtn
+
+mouse_key_release:
+	qset0 rega
+	rtn		
+
+mouse_key_press:
+	qset1 rega
+	rtn
+
+mouse_3io6key_check:
+	bpatch patch1a_2,mem_patch1a
+	copy regc,pdata
+	store 1,mem_mouse_key_status
+	lshift pdata,pdata
+	copy pdata,regb
+	copy temp,regc
+	call mouse_gpio_config_input_pd
+	copy regc,temp
+	call gpio_get_bit
+	nsetflag true,0,regb
+	call mouse_check_press
+	branch mouse_check_key_connect_gnd+4
+
+mouse_check_press:
+	fetcht 1,mem_mouse_key_status
+	and_into 0x01,temp
+	and regb,0x01,pdata
+	isub temp,null
+	nbranch mouse_current_mult_update,zero
+	rtn
+	
+/*************************key***************************************/
+
+/**********************sensor******************************/	
+mouse_init_sunt:
+	bpatch patch1a_3,mem_patch1a
+	call mouse_sensor_spi_init
+	rtn wake
+mouse_init_sensor_wakeup:	
+	call mouse_sensor_poweron
+mouse_init_sensor:
+	call mouse_read_sensor_id
+	beq P32XX_ID1,mouse_init_p32xx_id2_judge
+	beq P3065_ID1,mouse_init_p3065
+	beq PKA8G2_ID1,mouse_ka8g2_id2_judge
+	call mouse_twspi_reset
+	nop 6900
+	branch mouse_init_sensor
+mouse_twspi_reset:
+	fetch 1,mem_mouse_sensor_sclk_gpio
+	call twspi_reset 
+	branch mouse_spid_init_pin
+
+mouse_read_sensor_id:
+	setarg PAN_REG_PID_H
+	call twspi_read
+	store 1,mem_sensor_id2
+	setarg PAN_REG_PID_L
+	call twspi_read
+	store 1,mem_sensor_id1
+	rtn
+
+	
+
+mouse_init_p32xx_id2_judge:
+	fetch 1,mem_sensor_id2
+	beq P_MX8650,mouse_mx8650_init_param
+	beq P8009_ID2,mouse_8009_init_param
+	beq P3205_TJ3T_ID2,mouse_3205_3t_init_param
+	beq P3204_TJ3L_ID2,mouse_3204_3l_init_param
+	beq P3212_ID2,mouse_3212_init_param
+	beq PKA8_ID2,mouse_ka8_init_param_check
+	beq P6520A_ID2,mouse_p6520_init_param
+	branch mouse_init_sensor
+	
+mouse_mx8650_init_param:
+	jam MX8650,mem_config_sensor_type
+	call mouse_sensor_reset
+	call delay_10ms
+	arg mem_sensor_8650_init,regc
+	call mouse_sensor_wr_seq
+	branch mouse_dpi_config
+
+mouse_8009_init_param:
+	setarg 0x16
+	call twspi_read
+	sub pdata,0xbd,null 
+	nbranch mouse_init_sunt,zero
+	setarg 0x19
+	call twspi_read
+	sub pdata,0x55,null 
+	nbranch mouse_init_sunt,zero
+	setarg 0x1b
+	call twspi_read
+	sub pdata,0x1d,null 
+	nbranch mouse_init_sunt,zero
+	jam P8009,mem_config_sensor_type
+	arg mem_sensor_8009_init,regc
+	branch mouse_sensor_wr_seq
+
+mouse_3205_3t_init_param:
+	jam P3205,mem_config_sensor_type
+	arg mem_sensor_3205_init,regc
+	call mouse_sensor_wr_seq
+	arg mem_sensor_32xx_init,regc
+	call mouse_sensor_wr_seq
+	setarg 0x0943
+	call twspi_write
+	arg mem_sensor_32xx_init_1,regc
+	branch mouse_sensor_wr_seq	
+
+mouse_3204_3l_init_param:
+	jam P3204,mem_config_sensor_type
+	arg mem_sensor_3204_init,regc
+	call mouse_sensor_wr_seq
+	arg mem_sensor_32xx_init,regc
+	call mouse_sensor_wr_seq
+	arg mem_sensor_32xx_init_1,regc
+	branch mouse_sensor_wr_seq	
+
+mouse_3212_init_param:
+	jam P3212,mem_config_sensor_type
+	arg mem_sensor_3212_init,regc
+	branch mouse_sensor_wr_seq
+
+mouse_ka8_init_param_check:	
+	call mouse_sensor_disable_wp
+	setarg 0x9a5b
+	call twspi_write
+	setarg 0x0d
+	call twspi_read
+	sub pdata,0x12,null
+	branch mouse_ka8ul_init_param,zero
+	sub pdata,0x0a,null
+	nbranch mouse_ka8hd_sensor_judge,zero
+	setarg 0x0e
+	call twspi_read
+	sub pdata,0xe5,null
+	nbranch mouse_init_sensor,zero
+	setarg 0x10
+	call twspi_read
+	sub pdata,0xa5,null
+	branch mouse_ka8ul_init_param,zero
+	call mouse_enable_ka8_sensor_wp
+mouse_ka8_init_param:
+	jam KA8,mem_config_sensor_type	
+	rtn
+mouse_ka8ul_init_param:
+	jam KA8_UL,mem_config_sensor_type	
+	arg mem_sensor_ka8ul_init,regc
+	branch mouse_sensor_wr_seq
+mouse_ka8hd_sensor_judge:
+	sub pdata,0x10,null
+	nbranch mouse_init_sensor,zero
+	setarg 0x0e
+	call twspi_read
+	sub pdata,0xc5,null
+	nbranch mouse_init_sensor,zero
+	setarg 0x10
+	call twspi_read
+	sub pdata,0x38,null
+	nbranch mouse_init_sensor,zero
+mouse_ka8hd_init_param:
+	call mouse_enable_ka8_sensor_wp
+	jam KA8_HD,mem_config_sensor_type
+	rtn
+mouse_enable_ka8_sensor_wp:
+	setarg 0x005b
+	call twspi_write
+	branch mouse_sensor_enable_wp
+	
+mouse_p6520_init_param:
+	jam P6520,mem_config_sensor_type
+	arg mem_sensor_p6520_init,regc
+	branch mouse_sensor_wr_seq
+	
+mouse_init_p3065:
+	call mouse_sensor_poweron
+	fetch 1,mem_sensor_id2
+	beq P3065_XY_ID2,mouse_p3065xy_init_param
+	beq P3065_ID2,mouse_p3065_init_param
+	branch mouse_init_sensor
+	
+mouse_p3065_init_param:	
+	jam P3065,mem_config_sensor_type
+	rtn
+
+mouse_p3065xy_init_param:
+	jam P3065_XY,mem_config_sensor_type
+	rtn
+	
+mouse_ka8g2_id2_judge:
+	call mouse_sensor_poweron
+	fetch 1,mem_sensor_id2
+	beq PKA8G2_ID2,mouse_ka8g2_init_param
+	branch mouse_init_p32xx_id2_judge
+mouse_ka8g2_init_param:
+	jam KA8G2,mem_config_sensor_type
+	arg mem_sensor_ka8g2_init,regc
+	branch mouse_sensor_wr_seq
+	
+mouse_sensor_enable_wp:
+	setarg 0x0009
+	branch twspi_write
+mouse_sensor_disable_wp:
+	setarg 0x5a09
+	branch twspi_write
+
+mouse_sensor_wr_seq:
+	ifetch 2,regc
+	arg 0xffff,temp
+	isub temp,null
+	rtn zero
+	call twspi_write
+	increase 2,regc
+	branch mouse_sensor_wr_seq
+
+mouse_sensor_reset:
+	setarg 0x8006		// reset to factory settings
+	call twspi_write
+	nop 12000
+	rtn
+	
+mouse_sensor_poweron:
+	bpatch patch1a_4,mem_patch1a
+	call mouse_sensor_spi_init
+	call mouse_sensor_reset
+	arg mem_sensor_poweron_init,regc
+	call mouse_sensor_wr_seq
+	branch mouse_dpi_config
+
+mouse_sensor_powerdown:
+	call mouse_init_sunt
+	call mouse_sensor_spi_init
+	setarg 0x0806
+	branch twspi_write
+/*********sensor init*************/	
+
+
+
+/*********sensor motion*************/
+mouse_check_sensor_data:
+	fetch 1,mem_spi_write_flash_sm
+	rtnne FLASH_SM_NO_BUYS
+	fetch 1,mem_config_sensor_type
+	beq P3205,mouse_p32xx_sensor_motion
+	beq P3065,mouse_p32xx_sensor_motion
+	beq KA8,mouse_p32xx_sensor_motion
+	beq P3204,mouse_p32xx_sensor_motion
+	beq P3212,mouse_p3212_sensor_motion
+	beq P3065_xy,mouse_p32xx_sensor_motion
+	beq P8009,mouse_p8009_sensor_motion	
+	beq KA8G2,mouse_pka8g2_sensor_motion
+	branch mouse_p32xx_sensor_motion
+
+
+mouse_p32xx_sensor_motion:
+	call mouse_clear_sensor_data
+	disable user
+	fetch 1,mem_sensor_motion_gpio
+	beq GPIO_DISABLE,mouse_p32xx_sensor_motion_2
+	fetcht 1,mem_sensor_motion_gpio
+	call gpio_get_bit
+	nrtn true
+mouse_p32xx_sensor_motion_2:
+	setarg PAN_REG_PID_L
+	call twspi_read
+	bne P32XX_ID1,mouse_p3065_judge   
+mouse_p32xx_sensor_motion_1:
+	setarg PAN_REG_MOTION_STAUS
+	call twspi_read
+	rtnbit0 7
+	call mouse_read_sensor_common
+	fetch 1,mem_mouse_x
+	call mouse_data_extsign
+	store 2,mem_mouse_x
+	fetch 1,mem_mouse_y
+	call mouse_data_extsign
+	store 2,mem_mouse_y
+	fetch 1,mem_config_sensor_angle
+	beq MOUSE_6CLK_ANGLE,mouse_motion32xx_6clk_direction_selection
+	beq MOUSE_9CLK_ANGLE,mouse_motion32xx_9clk_direction_selection
+	beq MOUSE_12CLK_ANGLE,mouse_motion32xx_12clk_direction_selection
+	beq MOUSE_3CLK_ANGLE,mouse_motion32xx_3clk_direction_selection
+	rtn
+
+mouse_p3065_judge:
+	beq P3065_ID1,mouse_p32xx_sensor_motion_1
+	branch mouse_twspi_reset
+	
+mouse_motion32xx_6clk_direction_selection:
+	call mouse_motion_6clk_direction_dispose
+	branch mouse_sensor_sdio_low
+mouse_motion32xx_9clk_direction_selection:
+	call mouse_motion_9clk_direction_dispose
+	branch mouse_sensor_sdio_low
+mouse_motion32xx_12clk_direction_selection:
+	call mouse_motion_12clk_direction_dispose
+	branch mouse_sensor_sdio_low
+mouse_motion32xx_3clk_direction_selection:
+	call mouse_motion_3clk_direction_dispose
+	branch mouse_sensor_sdio_low
+
+
+	
+mouse_p3212_sensor_motion:
+	call mouse_clear_sensor_data
+	fetch 1,mem_sensor_motion_gpio
+	beq GPIO_DISABLE,mouse_p3212_sensor_motion_1
+	fetcht 1,mem_sensor_motion_gpio
+	call gpio_get_bit
+	nrtn true
+mouse_p3212_sensor_motion_1:	
+	setarg PAN_REG_PID_L
+	call twspi_read
+	bne P32XX_ID1,mouse_twspi_reset
+mouse_p3212_sensor_motion_2:
+	setarg PAN_REG_MOTION_STAUS
+	call twspi_read
+	rtnbit0 7
+	call mouse_read_sensor_common
+	call mouse_read_3212sensor_xy_high
+	store 1,mem_mouse_xy_h
+	rshift4 pdata,pdata
+	call mouse_data_extsign_bit3
+	store 1,mem_mouse_x+1
+	fetch 1,mem_mouse_xy_h
+	and pdata,0x0f,pdata
+	call mouse_data_extsign_bit3
+	store 1,mem_mouse_y+1
+	fetch 1,mem_config_sensor_angle
+	beq MOUSE_6CLK_ANGLE,mouse_motion_6clk_direction_dispose
+	beq MOUSE_9CLK_ANGLE,mouse_motion_9clk_direction_dispose
+	beq MOUSE_12CLK_ANGLE,mouse_motion_12clk_direction_dispose
+	beq MOUSE_3CLK_ANGLE,mouse_motion_3clk_direction_dispose
+	rtn
+
+mouse_read_3212sensor_xy_high:
+	setarg 0x12
+	branch twspi_read
+
+mouse_pka8g2_sensor_motion:
+	call mouse_clear_sensor_data
+	fetch 1,mem_sensor_motion_gpio
+	beq GPIO_DISABLE,mouse_pka8g2_sensor_motion_1
+	fetcht 1,mem_sensor_motion_gpio
+	call gpio_get_bit
+	nrtn true
+mouse_pka8g2_sensor_motion_1:
+	branch mouse_p3212_sensor_motion_2
+
+
+mouse_p8009_sensor_motion:
+	call mouse_clear_sensor_data
+	disable user
+	setarg PAN_REG_MOTION_STAUS
+	call twspi_read
+	rtnbit0 7
+	setarg PAN_REG_OPRATION_STATE
+	call twspi_read
+	branch mouse_p32xx_sensor_motion_1+3,blank
+	setarg 0
+	store 6,mem_mouse_x
+	rtn
+
+
+
+mouse_sensor_set_angle:
+	fetch 1,mem_sensor_angle_default
+	store 1,mem_config_sensor_angle
+	fetch 1,mem_select_sensor_angle_gpio
+	rtneq GPIO_DISABLE
+	fetcht 1,mem_select_sensor_angle_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_select_sensor_angle_gpio
+	call gpio_get_bit
+	call mouse_sensor_switch_angle,true
+	branch mouse_gpio_config_input_pd
+mouse_sensor_switch_angle:
+	fetch 1,mem_sensor_angle_switch
+	store 1,mem_config_sensor_angle
+	rtn
+	
+mouse_motion_6clk_direction_dispose:
+	fetch 2,mem_mouse_x
+	sub pdata,0,pdata
+	store 2,mem_mouse_x
+	branch enable_user
+mouse_motion_12clk_direction_dispose:
+	fetch 2,mem_mouse_y
+	sub pdata,0,pdata
+	store 2,mem_mouse_y
+	branch enable_user
+mouse_motion_9clk_direction_dispose:
+	fetch 2,mem_mouse_y
+	sub pdata,0,pdata
+	store 2,mem_mouse_y
+	fetch 2,mem_mouse_x
+	sub pdata,0,pdata
+	store 2,mem_mouse_x
+	call mouse_sensor_data_swap_places
+	branch enable_user
+mouse_motion_3clk_direction_dispose:
+	call mouse_sensor_data_swap_places
+	branch enable_user
+
+mouse_sensor_data_swap_places:
+	fetch 2, mem_mouse_y
+	fetcht 2,mem_mouse_x
+	store 2,mem_mouse_x
+	storet 2,mem_mouse_y
+	rtn
+
+	
+mouse_clear_sensor_data:
+	fetch 1,mem_mouse_move_flag
+	call mouse_read_sensor_common,blank
+	jam 1,mem_mouse_move_flag
+	rtn
+
+mouse_clear_sensor_data_by_reset:
+	jam 1,mem_mouse_clear_sensor_data_flag
+	call le_set_config_more_data
+mouse_init_sensor_reset:
+	branch mouse_init_sunt
+
+mouse_data_xy_release:
+	fetch 1,mem_sensor_motion_gpio
+	rtnne GPIO_DISABLE
+	fetch 1,mem_mouse_long_mult_flag
+	rtnne 1
+	setarg 0
+	store 1,mem_mouse_long_mult_flag
+	store 4,mem_mouse_x
+	branch mouse_init_sensor_reset
+
+mouse_data_extsign:
+	rtnbit0 7
+	arg 0xff00,temp
+	ior temp,pdata
+	rtn
+
+mouse_data_extsign_bit3:
+	rtnbit0 3
+	arg 0xf0,temp
+	ior temp,pdata
+	rtn
+
+mouse_read_sensor_common:
+	arg PAN_REG_DELTA_X,pdata
+	call twspi_read
+	store 2,mem_mouse_x
+	arg PAN_REG_DELTA_Y,pdata
+	call twspi_read
+	store 2,mem_mouse_y
+	rtn
+
+	/* sdio high will cost extra 9mA */
+mouse_sensor_sdio_low:
+	fetcht 1,mem_mouse_sensor_sdio_gpio
+	call gpio_get_bit
+	rtn true
+	setarg 0x0a
+	call twspi_read
+	nop 1000
+	branch mouse_sensor_sdio_low
+
+mouse_set_sdio_high:		// make sdio high to make 100uA less
+	setarg 0x8100
+	branch twspi_write
+	
+/****************************sensor*************************/
+
+/*******************mouse fast connect******************/
+mouse_buletooth_fast_conn_init:
+	jam 0xff,mem_mouse_bluetooth_fast_conn_flag
+	fetch 1,mem_mouse_bluetooth_type
+	bbit1 MODE_4_MOUSE,mouse_ble_fast_conn_init
+	bbit1 MODE_3_MOUSE,mouse_bt_fast_conn_init
+mouse_ble_fast_conn_init:	
+	jam 0x34,mem_xrecord_mode
+	setarg 0x0f0f0f
+	store 3,mem_le_lap
+	store 3,mem_le_lap+3
+	branch mouse_start_reconnect
+
+mouse_bt_fast_conn_init:
+	jam 0x33,mem_xrecord_mode
+	arg mem_mouse_compare_addr_ff,contr
+	call mouse_load_bt_device
+	branch mouse_start_reconnect
+
+mouse_buletooth_fast_conn_end:
+	bpatch patch1a_5,mem_patch1a
+	call mouse_select_reconn_device
+	call mouse_bluetooth_fast_conn_disable
+	fetch 1,mem_device_flag
+	beq MODE_BT_DEVICE1,mouse_device1_check_auto_discover
+	beq MODE_BT_DEVICE2,mouse_device2_check_auto_discover
+	rtn
+mouse_device1_check_auto_discover:
+	fetch 6,mem_device1_addr
+	branch mouse_device_check_auto_discover
+mouse_device2_check_auto_discover:
+	fetch 6,mem_device2_addr
+mouse_device_check_auto_discover:	
+	fetcht 6,mem_mouse_compare_addr_ff
+	isub temp,null
+	branch mouse_start_discovery ,zero
+	branch mouse_start_reconnect_device
+
+mouse_bt_fast_conn_send_device_name:
+	call mouse_bluetooth_fast_conn_disable
+	fetch 1,mem_local_name_length
+	increase 3,pdata
+	copy pdata,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0x04a1		// report id = 4
+	istore 2,contw
+	fetch 1,mem_local_name_length
+	increase 1,pdata
+	copy pdata,loopcnt
+	arg mem_local_name_length,contr
+	branch memcpy
+
+mouse_bluetooth_fast_conn_disable:
+	jam 0x5a,mem_mouse_bluetooth_fast_conn_flag
+	rtn	
+/*******************mouse fast connect******************/
+
+mouse_stop_bluetooth_mode:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_RECONNECT,mouse_cancel_reconnect
+	bbit1 UI_STATE_BLE_CONNECTED,app_ble_disconnect
+	bbit1 UI_STATE_BT_CONNECTED,app_bt_disconnect
+	branch mouse_stop_discovery
+
+mouse_disconnect:
+	setarg 0
+	store 2,mem_mouse_no_data_timer
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,app_ble_disconnect
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_CONNECTED,app_bt_disconnect
+	rtn
+	
+mouse_cancel_reconnect:
+	call mouse_bt_cannel_reconn_enable
+	branch check_51cmd_bb_reconn_cancel
+
+mouse_check_125Hz:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_BT_125Hz
+mouse_bluetooth_125Hz:
+	nbranch mouse_bluetooth_125hz_clear,user
+	fetch 1,mem_bluetooth_125hz_cnt
+	increase 1,pdata
+	and_into 0x0f,pdata
+	store 1,mem_bluetooth_125hz_cnt
+	nrtn blank
+mouse_bluetooth_125hz_clear:
+	jam 0,mem_bluetooth_125hz_cnt
+	disable user
+	rtn
+
+
+mouse_current_mult_update:
+	fetch 1,mem_sensor_motion_gpio
+	rtnne GPIO_DISABLE
+	jam 0,mem_lpm_mult
+	jam 30,mem_mouse_current_mult_timer
+	rtn
+
+
+mouse_priority_bb_event:	
+	bpatch patch1a_6,mem_patch1a
+	copy regc,pdata
+	beq BT_EVT_LE_CONNECTED,mouse_le_bb_event_connected
+	beq BT_EVT_BB_CONNECTED,mouse_bb_event_connected
+	beq BT_EVT_LE_DISCONNECTED,mouse_le_bb_disconnected
+	beq BT_EVT_BB_DISCONNECTED,mouse_bb_disconnected
+	beq BT_EVT_SETUP_COMPLETE,mouse_bt_event_setup_complete
+	beq BT_EVT_BUTTON_LONG_PRESSED,mouse_bb_event_discovery_btn
+	beq BT_EVT_HID_HANDSHAKE,mouse_bt_hid_handshake
+	beq BT_EVT_HID_CONNECTED,app_hid_connected
+	beq BT_EVT_RECONN_FAILED,mouse_bb_event_reconn_failed
+	beq BT_EVT_RECONN_PAGE_TIMEOUT,mouse_bb_event_reconn_timeout
+	beq BT_EVT_SWITCH_NOT_ACCEPT,app_bt_role_switch	
+	beq BT_EVT_SWITCH_SUCCESS_MASTER,mouse_enter_sniff_check
+	beq BT_EVT_SNIFF_NOT_ACCEPT,mouse_sniff_not_accept
+	beq BT_EVT_PINCODE_REQ,mouse_bb_event_pincode
+	beq BT_EVT_REMOTE_UNSNIFF,app_start_auto_sniff
+	beq BT_EVT_LE_PAIRING_SUCCESS,mouse_le_pairing_success
+	beq BT_EVT_LE_ENC_INFO,mouse_le_enc_info
+	beq BT_EVT_LE_START_ENC,mouse_le_ll_start_encryt
+	beq BT_EVT_LE_PAIRING_COMPLETE,mouse_le_pairing_complete
+	beq BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP,mouse_le_conn_param_update_rsp_recieved
+	beq BT_EVT_VIRTUAL_CABLE_UNPLUG,mouse_irtual_cable_unplug
+	beq BT_EVT_24G_PAIRING_COMPLETE,mouse_24g_pairing_complete
+	beq BT_EVT_24G_ATTEMPT_FAIL,mouse_24g_attempt_fail
+	beq BT_EVT_24G_ATTEMPT_SUCCESS,mouse_24g_attempt_success
+	beq BT_EVT_LE_PARSE_CONN_PARAM_ACCEPTED,mouse_le_parse_conn_param_accepted
+	rtn
+
+/***************************le*************************/
+mouse_le_bb_event_connected:
+	jam 0,mem_mouse_long_mult_flag
+	call mouse_init_sensor_reset
+	jam 1,mem_mouse_le_bb_connected_flag
+	call mouse_24g_first_store_reconn_info
+	fetch 1,mem_mouse_le_reconnect_flag
+	nbranch mouse_le_bb_event_connected_next,blank
+	jam 0x14,mem_mouse_send_secutiry_request_timer
+mouse_le_bb_event_connected_next:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set0 APP_DISC_BY_BUTTON ,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	jam 0,mem_mouse_direct_timer
+	fetch 2,mem_le_battery_level_updata_timer_init
+	store 2,mem_le_battery_level_updata_timer
+	call mouse_no_data_timer_init
+	branch mouse_stop_discovery
+
+mouse_le_bb_disconnected:
+	jam 0,mem_mouse_le_bb_connected_flag
+	setarg LE_INTERVAL_7_5MS
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_BT_125Hz,mouse_le_bb_disconnected_next
+	setarg LE_INTERVAL_8_75MS
+mouse_le_bb_disconnected_next:	
+	store 2,mem_le_interval_min
+	store 2,mem_le_interval_min+2
+	jam LE_LPM_ENABLE,mem_mouse_le_conn_param_reject
+	jam 0,mem_mouse_clear_sensor_data_flag
+	call le_clr_config_more_data
+	branch mouse_bb_disconnected
+
+mouse_le_pairing_success:
+	arg LL_PAIRING_SUCCESS_FLAG,queue
+	branch mouse_le_enable_connect_flag
+
+mouse_le_enc_info:
+mouse_updata_le_param:
+	jam BT_CMD_LE_UPDATE_CONN,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+mouse_le_ll_start_encryt:
+	fetch 1,mem_mouse_le_reconnect_flag
+	beq 1,mouse_le_ll_reconn_start_encryt
+	branch mouse_le_ll_enable_start_enc_flag
+mouse_le_ll_reconn_start_encryt:
+	call mouse_updata_le_param
+	jam 20,mem_le_start_encrypt_timer
+mouse_le_ll_enable_start_enc_flag:
+	arg LL_START_ENC_FLAG,queue
+	branch mouse_le_enable_connect_flag
+
+mouse_le_enable_connect_flag:
+	fetch 1,mem_le_connect_status_flag
+	qset1 pdata
+	store 1,mem_le_connect_status_flag
+	rtn
+
+mouse_le_pairing_complete:
+	branch app_ble_store_reconn_info
+
+mouse_le_conn_param_update_rsp_recieved:
+	fetch 2,mem_le_l2cap_signaling_conn_param_update_rsp_result
+	rtneq BLE_SIGNALING_CONNECT_PARAMETER_UPDATE_ACCEPTED
+	fetch 1,mem_le_tsniff
+	rshift2 pdata,pdata
+	sub pdata,LE_INTERVAL_15MS,null
+	rtn positive
+	setarg LE_INTERVAL_11_25MS
+	store 2,mem_le_interval_min
+	store 2,mem_le_interval_min+2
+	call mouse_updata_le_param
+mouse_le_conn_param_lpm_disable:
+	jam LE_LPM_DISABLE,mem_mouse_le_conn_param_reject
+	rtn
+
+mouse_le_conn_param_lpm_enable:
+	jam LE_LPM_ENABLE,mem_mouse_le_conn_param_reject
+	rtn
+
+mouse_le_bb_event_connect_complete:
+	fetch 1,mem_mouse_le_reconnect_flag
+	nrtn blank
+	fetch 1,mem_le_att_handle
+	sub pdata,34,pdata
+	nrtn zero
+	jam 0,mem_le_start_encrypt_timer
+mouse_le_write_enable:	
+	arg WRITE_REQ_ENABLE_FLAG,queue
+	branch mouse_le_enable_connect_flag
+
+mouse_le_parse_conn_param_accepted:
+	fetch 1,mem_le_new_conninterval
+	sub pdata,LE_INTERVAL_15MS,null
+	nbranch mouse_le_conn_param_lpm_disable,positive
+	fetch 1,mem_le_new_connslavelatency
+	fetcht 1,mem_lpm_mult_init
+	isub temp,null
+	branch mouse_le_lpm_mult_reinit,positive
+	fetch 1,mem_le_new_connslavelatency
+	store 1,mem_lpm_mult
+	branch mouse_le_conn_param_lpm_enable
+mouse_le_lpm_mult_reinit:
+	fetch 1,mem_lpm_mult_init
+	store 1,mem_lpm_mult
+	branch mouse_le_conn_param_lpm_enable
+	
+/*
+mouse_le_disable_connect_flag:
+	fetch 1,mem_le_connect_status_flag
+	qset0 pdata
+	store 1,mem_le_connect_status_flag
+	rtn
+*/
+mouse_le_clean_connect_flag:
+	jam 0,mem_le_connect_status_flag
+	rtn
+
+/*
+mouse_le_reconn_write_enable_timer_reinit:
+	fetch 1,mem_mouse_le_reconnect_flag
+	rtn blank
+	fetch 1,mem_le_connect_status_flag
+	and pdata,0x03,pdata
+	rtneq 0x03
+	jam 2,mem_le_start_encrypt_timer
+	rtn
+*/
+mouse_le:
+	bpatch patch1a_7,mem_patch1a
+	call le_fifo_check_nearly_full
+	nrtn blank
+	fetch 1,mem_mouse_bluetooth_fast_conn_flag
+	beq 0xff,mouse_le_next
+	fetch 1,mem_le_connect_status_flag
+	and pdata,0x03,pdata
+	rtnne 0x03
+mouse_le_next:	
+	fetch 1,mem_mouse_clear_sensor_data_flag
+	call mouse_clear_sensor_data_by_reset,blank
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_24G_PAIRING_FLAG,mouse_le_send_empty_packet
+	bbit1 MOUSE_SELECT_DEVICE_FLAG,mouse_le_send_empty_packet
+	bbit1 MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG,mouse_le_send_empty_packet
+	bbit1 MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG,mouse_le_send_empty_packet
+	call mouse_motion
+	call mouse_check_125Hz
+	nrtn user
+	call mouse_current_mult_update
+	call mouse_data_xy_release
+	call mouse_wheel_trigger
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_KEYBOARD,mouse_le_send_mouse_data
+	fetch 1,mem_customer_key
+	beq 1,mouse_le_send_keyboard_package_data		
+mouse_le_send_mouse_data:
+	branch mouse_fill_mouse_data_le
+
+
+mouse_le_send_keyboard_package_data:
+	fetch 1,mem_customer_data_trigger
+	branch mouse_le_release_keyboard_data,blank
+	fetch 8,mem_customer_key_press+1
+mouse_fill_keyboard_package_data_le:
+	store 8,mem_pdatatemp
+	fetch 1,mem_customer_key_press
+	beq KB_MULTIKEY_REPORT_ID,mouse_fill_multimedia_key_data_le
+	beq KB_SYSTEM_CONCTRL_REPORT_ID,mouse_fill_systemctrl_key_data_le
+	jam 8,mem_le_data_len
+	fetcht 2,mem_le_keyboard_handle
+	branch mouse_fill_data_le
+	
+
+mouse_le_release_keyboard_data:
+	fetch 8,mem_customer_key_release+1
+	branch mouse_fill_keyboard_package_data_le
+
+mouse_fill_multimedia_key_data_le:
+	jam 3,mem_le_data_len
+	fetcht 2,mem_le_multimedia_handle
+	branch mouse_fill_data_le
+
+mouse_fill_systemctrl_key_data_le:
+	jam 2,mem_le_data_len
+	fetcht 2,mem_le_systemctrl_handle
+	branch mouse_fill_data_le
+
+mouse_fill_battery_level_le:
+	arg 1,rega
+	fetcht 2,mem_le_battery_level_handle
+	call le_att_malloc_tx_notify
+	fetch 1,mem_le_battery_level_percentage
+	istore 1,contw
+	rtn
+
+
+mouse_le_send_empty_packet:
+	setarg 0
+	store 7,mem_mouse_key
+mouse_fill_mouse_data_le:
+	jam 7,mem_le_data_len
+	fetch 7,mem_mouse_key
+	store 7,mem_pdatatemp
+	fetcht 2,mem_le_notify_handle
+	branch mouse_fill_data_le
+
+mouse_fill_data_le:
+	fetch 1,mem_le_data_len
+	copy pdata,rega
+	call le_att_malloc_tx_notify
+	fetcht 1,mem_le_data_len
+	copy temp,loopcnt
+	arg mem_pdatatemp,contr
+	branch memcpy	
+
+mouse_check_51cmd_adv:
+	jam 0,mem_mouse_le_reconnect_flag
+	fetch 3,mem_le_adv_ind
+	store 3,mem_le_adv_data+4
+	call mouse_le_check_adv_flag
+	setarg ADV_FLAG_BREDR_NOT_SUPPORTED |ADV_FLAG_LIMITED_DISCOVERABLE
+	istore 1,contr
+	arg mem_le_adv_swift_pair,contr
+	call mouse_le_adv_data_update
+	branch check_51cmd_adv
+
+mouse_le_check_adv_flag:
+	arg mem_le_adv_data,rega
+mouse_le_check_adv_flag_loop:
+	ifetch 1,rega	//length
+	rtn blank
+	iadd contr,rega
+	ifetch 1,contr	//type
+	rtneq 0x01
+	branch mouse_le_check_adv_flag_loop
+	
+mouse_le_adv_data_update:
+	arg mem_le_adv_data+11,contw
+	arg 19,loopcnt
+	call memcpy
+	branch le_modified_name_adv
+	
+/***************************le*************************/
+
+
+/***********************bt****************************/	
+mouse_bt_sniff_param_interval_setup:
+	setarg CLASSIC_INTERVAL_7_5MS
+	store 2,mem_sniff_param_interval
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_BT_125Hz
+	setarg CLASSIC_INTERVAL_8_75MS
+	store 2,mem_sniff_param_interval
+	rtn
+
+mouse_bb_event_connected:
+	jam 0,mem_mouse_long_mult_flag
+	call mouse_init_sensor_reset
+	call mouse_24g_first_store_reconn_info
+	branch mouse_stop_discovery
+
+mouse_bb_disconnected:
+	jam 0,mem_mouse_enter_sniff_count
+	jam 0,mem_mouse_bt_send_first_package_flag
+	call mouse_bt_sniff_param_interval_setup
+	call mouse_bb_discon_clear_stack
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason
+	bbit1 APP_DISC_BLE,mouse4_0_event_bb_disconn
+	bbit1 APP_DISC_BY_BUTTON,app_disconn_reason_clear
+	bbit1 APP_DISC_AFTER_PAIRING,mouse_event_light_state_pairing
+	bbit1 APP_DISC_AFTER_RECONN,mouse_event_light_state_hibernate
+	bbit1 APP_DISC_AFTER_SNIFF,mouse_event_light_state_hibernate
+	branch mouse_start_discovery
+mouse_bb_discon_clear_stack:
+	setarg 0
+	store 8,mem_wheel_tb_old_pinlevel
+	istore 4,contw             //clean wheel statue
+	jam 0,mem_mouse_move_flag
+	jam APP_HANDSHAKE_NULL,mem_app_handshake_flag
+	jam 0,mem_ltk_exists
+	rtn
+
+mouse4_0_event_bb_disconn:
+	call mouse_le_clean_connect_flag
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason
+	bbit1 APP_DISC_BY_BUTTON,app_disconn_reason_clear
+	branch mouse_app_enter_hibernate
+
+
+mouse_event_light_state_pairing:
+	bbit1 APP_DISC_AFTER_HANDSHAKE,mouse_event_light_state_hibernate
+	bbit1 APP_DISC_AFTER_SNIFF,mouse_event_light_state_hibernate
+	branch mouse_start_discovery
+mouse_event_light_state_hibernate:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BTN_DOWN,mouse_start_discovery
+	call app_disconn_reason_clear
+
+	call mouse_key_check_once	//mult_key pair
+	call mouse_commbination_key_process
+	fetch 1,mem_commbination_key_statue
+	beq COMMBINATION_KEY_STATE_DOWN,mouse_delay_enter_hibernata
+	
+	fetch 1,mem_mouse_bluetooth_reconnect_timeout
+	nrtn blank
+	branch mouse_app_enter_hibernate
+
+
+mouse_bt_event_setup_complete:
+	rtn
+
+mouse_bt_send_first_package_timer_init:
+	jam 4,mem_mouse_bt_send_first_package_timer
+	rtn
+
+mouse_bt_hid_handshake:
+	jam APP_HANDSHAKE_DONE,mem_app_handshake_flag
+	call app_lpm_mult_enable
+	call app_bt_store_reconn_info
+	setarg 0
+	store 2,mem_discovery_timeout_timer_count
+	store 1,mem_hid_handshake_timer_count
+	call mouse_bt_send_first_package_timer_init
+	branch app_bt_enter_sniff
+
+mouse_bt_hid_handshake_boot_check:	
+	jam 0,mem_mouse_bt_boot_mode
+	fetch 1,mem_l2cap_rcv_hidtype
+	isolate1 0,pdata
+	rtn true
+	jam 1,mem_mouse_bt_boot_mode	//boot mode
+	rtn
+
+	
+mouse_bb_event_reconn_timeout:
+mouse_bb_event_reconn_failed:
+	fetch 1,mem_mouse_bluetooth_fast_conn_flag
+	beq 0xff,mouse_buletooth_fast_conn_end
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BTN_DOWN
+	rtnbit1 UI_STATE_BT_DISCOVERY
+	rtnbit1 UI_STATE_BLE_ADV
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG
+	bbit1 MOUSE_ENABLE_BT_RECONNECT_TIMEOUT_ENTER_DISCOVERY,mouse_start_discovery
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_24g_first_bb_event_reconn_timeout
+	branch mouse_app_enter_hibernate
+
+mouse_enter_sniff_check:
+	fetch 1,mem_mouse_enter_sniff_count
+	rtnne 2
+	jam 0,mem_mouse_enter_sniff_count
+	call mouse_bt_sniff_param_interval_setup
+	call mouse_bt_send_first_package_timer_init
+	branch app_bt_enter_sniff
+
+mouse_sniff_not_accept:
+	fetch 1,mem_mouse_enter_sniff_count
+	rtneq 2
+	increase 1,pdata
+	store 1,mem_mouse_enter_sniff_count
+	jam 0x12,mem_sniff_param_interval	//89Hz
+	call mouse_bt_send_first_package_timer_init
+	branch app_bt_enter_sniff
+
+mouse_bb_event_pincode:
+	call pincode_reinit
+	branch app_bt_set_pincode
+
+mouse_irtual_cable_unplug:
+	setarg 0x01
+	store 6,mem_plap
+	jam REC_3_MODE,mem_record_bt_mode
+	branch mouse_unplug_clean_bdaddr
+
+mouse_irtual_cable_unplug1:
+	setarg -1
+	store 6,mem_plap
+	jam REC_3_MODE,mem_record_bt_mode
+	jam 0xff,mem_mouse_bluetooth_fast_conn_flag
+	call mouse_before_store_reconn_info
+	jam 0xff,mem_device1_type
+	branch mouse_store_device_info_delay
+
+mouse_bt:
+	bpatch patch1b_0,mem_patch1b
+	rtn attempt
+	fetch 1,mem_app_handshake_flag
+	rtn blank
+	call l2cap_malloc_is_fifo_nearly_full
+	nrtn blank
+	fetch 1,mem_mouse_bluetooth_fast_conn_flag
+	beq 0xff,mouse_bt_fast_conn_send_device_name	
+	fetch 1,mem_mouse_clear_sensor_data_flag
+	call mouse_clear_sensor_data_by_reset,blank
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_24G_PAIRING_FLAG,mouse_send_empty_data
+	bbit1 MOUSE_SELECT_DEVICE_FLAG,mouse_send_empty_data
+	bbit1 MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG,mouse_send_empty_data
+	bbit1 MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG,mouse_send_empty_data
+	call mouse_motion
+	call mouse_check_125Hz
+	nrtn user
+	call mouse_current_mult_update
+	call mouse_data_xy_release
+	call mouse_wheel_trigger
+	fetch 1,mem_mouse_bt_boot_mode
+	beq 1,mouse_send_data_boot_mode	//boot
+	fetch 1,mem_mouse_bt_send_first_package_flag
+	rtn blank
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_KEYBOARD,mouse_send_data
+	fetch 1,mem_customer_key
+	beq 1,mouse_bt_send_keyboard_packet
+mouse_send_data:
+	arg 9,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0x02a1
+	istore 2,contw
+	fetch 7,mem_mouse_key
+	istore 7,contw
+	rtn
+
+mouse_send_data_boot_mode:
+	fetch 1,mem_mouse_key
+	store 1,mem_mouse_bt_boot_data
+	fetch 1,mem_mouse_x
+	istore 1,contw
+	fetch 1,mem_mouse_y
+	istore 1,contw
+	fetch 2,mem_mouse_z
+	istore 2,contw
+	arg 7,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0x02a1		// pid:02  mouse
+	istore 2,contw
+	fetch 5,mem_mouse_bt_boot_data
+	istore 5,contw
+	rtn
+
+mouse_send_empty_data:
+	setarg 0
+	store 7,mem_mouse_key
+	branch mouse_send_data
+
+
+mouse_bt_send_keyboard_packet:
+	fetch 1,mem_customer_data_trigger
+	branch mouse_bt_release_keyboard_data,blank
+	fetch 8,mem_customer_key_press+1
+mouse_bt_send_keyboard_data:
+	store 8,mem_pdatatemp
+	fetch 1,mem_customer_key_press
+	beq KB_MULTIKEY_REPORT_ID,mouse_bt_send_multimedia_key_data
+	beq KB_SYSTEM_CONCTRL_REPORT_ID,mouse_bt_send_systemctrl_key_data
+	arg 10,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0x01a1		// pid:01  standard key
+	istore 2,contw
+	fetch 8,mem_pdatatemp
+	istore 8,contw
+	rtn
+
+mouse_bt_send_multimedia_key_data:
+	arg 4,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0x03a1		// pid:03  multimedia key
+	istore 2,contw
+	fetch 2,mem_pdatatemp
+	istore 2,contw
+	rtn	
+
+mouse_bt_send_systemctrl_key_data:
+	arg 3,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0x04a1		// pid:04  systemctrl key	
+	istore 2,contw
+	fetch 1,mem_pdatatemp
+	istore 1,contw
+	rtn		
+
+mouse_bt_release_keyboard_data:
+	fetch 8,mem_customer_key_release+1
+	branch mouse_bt_send_keyboard_data	
+/*******************bt****************************/
+
+
+
+/********************mouse 100ms timer*****************/
+mouse_bb_event_timer:
+	bpatch patch1b_1,mem_patch1b
+	call mouse_adc_read
+	call mouse_low_voltage_led_timer
+	//24g
+	call g24_pair_timeout_timer
+	call g24_reconn_timeout_timer
+	call mouse_24g_long_sleep_param_update_timer
+	//led
+	call mouse_device_poweron_timer
+	call mouse_dpi_led_blink_delay_timer
+	//poll
+	call mouse_dpi_key_check_long_press
+	call mouse_bt_discovery_check
+	call mouse_commbination_key_process
+	call mouse_check_discovery_timeout_timer
+	//ble
+	call mouse_check_direct_timeout_timer
+	call mouse_le_enable_att_list_timer
+	call mouse_le_battery_updata_timer
+	call mouse_le_send_smp_security_request_timer
+	//bt
+	call mouse_check_hid_handshake_timer
+	call mouse_bt_check_sniff_req_timeout_timer
+	call mouse_check_reconnect_delay_long_sleep		//delete 3.0,reconnect fail
+	call mouse_current_mult_update_timer
+	call mouse_wheel_trigger_timer
+	call mouse_store_information_delay_timer
+	branch mouse_check_no_data_timeout_timer
+
+
+
+
+mouse_bt_discovery_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_PB_BUTTON_LONG_PRESS_DISCONVERY,mouse_bt_discovery_by_pb_button
+	rtn
+
+mouse_bt_discovery_by_pb_button:
+	fetch 1,mem_select_device_button_statue
+	rtnne PB_BUTTON_STATE_DOWN
+	arg mem_bt_discovery_count,regc
+	arg mouse_long_button_bt_discovery,regb
+	branch timer_single_step
+		
+mouse_long_button_bt_discovery:
+	fetch 1,mem_device_flag
+	rtneq MODE_24G_DEVICE
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG
+	arg MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG,queue
+	call mouse_enable_function_flag
+	call app_evt_button_long_pressed
+	branch mouse_bb_event_discovery_btn
+
+		
+mouse_commbination_key_process:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_24g_commbination_key_process
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_COMMBINATION_KEY_BY_BT_DISCOVERY
+	fetcht 1,mem_mouse_commbination_key_bt
+	branch mouse_commbination_key_start
+
+mouse_24g_commbination_key_process:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_COMMBINATION_KEY_BY_24G_PAIRING
+	fetcht 1,mem_mouse_commbination_key_24g
+mouse_commbination_key_start:
+	storet 1,mem_mouse_commbination_key
+	call mouse_check_key_gpio
+	and pdata,0x07,pdata
+	fetcht 1,mem_mouse_commbination_key
+	isub temp,null
+	branch mouse_commbination_key_down,zero
+mouse_commbination_key_up:
+	fetch 1,mem_ui_button_timeout
+	store 1,mem_combination_ui_button_count	//combination key timer init 
+	fetch 1,mem_commbination_key_statue
+	rtneq COMMBINATION_KEY_STATE_UP
+	jam COMMBINATION_KEY_STATE_UP,mem_commbination_key_statue	
+	rtn
+		
+mouse_commbination_key_down:
+	call mouse_combination_ui_timer
+	fetch 1,mem_commbination_key_statue
+	rtneq COMMBINATION_KEY_STATE_DOWN
+	jam COMMBINATION_KEY_STATE_DOWN,mem_commbination_key_statue
+	branch check_51cmd_bb_reconn_cancel
+
+
+mouse_combination_ui_timer:
+	arg mouse_24g_start_pair_mode,regb
+	arg mem_combination_ui_button_count,regc
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,timer_single_step
+	arg mouse_long_button_bt_discovery,regb
+	call timer_single_step
+	fetch 1,mem_combination_ui_button_count
+	beq 1,mouse_bt_discovery_button_down_enable	// ble release key press
+	rtn
+
+
+
+mouse_check_discovery_timeout_timer:	
+	arg mem_mouse_discovery_timer,regc
+	arg mouse_check_discovery_timeout,regb
+	branch timer_single_step_2B
+
+mouse_check_discovery_timeout:
+	call mouse_stop_discovery
+	branch mouse_app_enter_hibernate
+
+
+mouse_check_direct_timeout_timer:	
+	arg mem_mouse_direct_timer,regc
+	arg mouse_check_direct_timeout,regb
+	call timer_single_step_2B
+	fetch 1,mem_mouse_direct_timer
+	beq 1,app_ble_stop_direct_adv
+	rtn
+
+mouse_check_direct_timeout:
+	fetch 1,mem_mouse_bluetooth_fast_conn_flag
+	beq 0xff,mouse_buletooth_fast_conn_end
+	fetch 1,mem_reconn_times
+	nbranch mouse_polling_device,blank
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_BT_RECONNECT_TIMEOUT_ENTER_DISCOVERY,mouse_start_discovery
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_24g_first_bb_event_reconn_timeout
+	branch mouse_app_enter_hibernate
+	
+mouse_le_enable_att_list_timer:
+	arg mem_le_start_encrypt_timer,regc
+	arg mouse_le_write_enable,regb
+	branch timer_single_step
+
+mouse_le_send_smp_security_request_timer:
+	fetch 1,mem_mouse_le_bb_connected_flag
+	rtn blank
+	arg mem_mouse_send_secutiry_request_timer,regc
+	arg mouse_le_pairing_sm_start_check,regb
+	branch timer_single_step
+mouse_le_pairing_sm_start_check:
+	fetch 1,mem_mouse_le_reconnect_flag
+	nrtn blank
+	fetch 1,mem_le_pairing_state
+	rtnne FLAG_LE_PAIRING_NULL
+	branch le_pairing_sm_start
+
+mouse_le_battery_updata_timer:
+	arg mem_le_battery_level_updata_timer,regc
+	arg mouse_le_battery_level_updata,regb
+	branch timer_single_step
+
+mouse_le_battery_level_updata:
+	fetch 2,mem_le_battery_level_updata_timer_init
+	store 2,mem_le_battery_level_updata_timer
+	branch mouse_fill_battery_level_le
+	
+mouse_le_enable_att_list:	
+	fetch 1,mem_le_connect_status_flag
+	rtnbit1 LL_PAIRING_SUCCESS_FLAG
+	call mouse_updata_le_param
+	arg WRITE_REQ_ENABLE_FLAG,queue
+	branch mouse_le_enable_connect_flag
+
+mouse_check_hid_handshake_timer:
+	arg mem_hid_handshake_timer_count,regc
+	arg mouse_bt_hid_handshake,regb
+	branch timer_single_step
+	
+mouse_bt_check_sniff_req_timeout_timer:
+	arg mem_mouse_bt_send_first_package_timer,regc
+	arg mouse_bt_send_first_package,regb
+	branch timer_single_step
+mouse_bt_send_first_package:
+	jam 1,mem_mouse_bt_send_first_package_flag
+	rtn
+
+mouse_check_reconnect_delay_long_sleep:
+	arg mem_mouse_bluetooth_reconnect_timeout,regc
+	arg mouse_app_enter_hibernate,regb
+	branch timer_single_step
+
+
+mouse_current_mult_update_timer:
+	arg mem_mouse_current_mult_timer,regc
+	arg mouse_current_mult_reinit,regb
+	branch timer_single_step
+mouse_current_mult_reinit:
+	fetch 1,mem_lpm_mult_init
+	store 1,mem_lpm_mult
+	jam 1,mem_mouse_long_mult_flag
+	rtn
+
+
+mouse_check_no_data_timeout_timer:	
+	fetch 1,mem_usb_addr
+	rtnbit1 7
+	arg mem_mouse_no_data_timer,regc
+	arg mouse_check_no_data_timeout,regb
+	branch timer_single_step_2B
+
+mouse_check_no_data_timeout:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_24g_hibernate_set
+	branch mouse_disconnect
+	
+mouse_no_data_timer_init:
+	fetch 2,mem_mouse_no_data_timeout
+	store 2,mem_mouse_no_data_timer
+	rtn
+
+mouse_store_information_delay_timer:
+	arg mem_store_information_delay_timer,regc
+	arg mouse_store_device_info_check,regb
+	branch timer_single_step
+
+mouse_store_device_info_check:
+	call mouse_store_device_info
+	fetch 1,mem_mouse_need_soft_reset
+	nbranch mouse_soft_reset,blank
+	rtn
+
+mouse_bb_event_discovery_btn:
+	isolate1 mark_24g,mark
+	call mouse_24g_stop,true
+	call mouse_disconnect
+	call mouse_le_clean_connect_flag
+	branch mouse_start_discovery
+	
+mouse_start_discovery:
+	bpatch patch1b_2,mem_patch1b
+	call mouse_bluetooth_fast_conn_disable
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_ADV,mouse_start_discovery_norandom
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_BLE_RANDOM_ADDRE,mouse_start_discovery_norandom
+	fetcht 2,mem_random_addr_increase_count
+	increase 1,temp
+	storet 2,mem_random_addr_increase_count
+	storet 2,mem_le_lap+1
+	random pdata					//random ble addr
+	store 1,mem_le_lap
+mouse_start_discovery_norandom:
+	fetch 3,mem_mouse_le_lap_temp
+	store 3,mem_le_lap+3
+	call app_lpm_mult_disable
+	fetch 2,mem_discovery_timeout
+	store 2,mem_mouse_discovery_timer
+	jam 6,mem_connection_options
+	setarg 0
+	store 2,mem_mouse_no_data_timer
+	store 1,mem_mouse_direct_timer
+	store 1,mem_mouse_bluetooth_reconnect_timeout
+	store 1,mem_mouse_device_poweron_timer_count
+	store 1,mem_mouse_clear_sensor_data_flag
+	arg MOUSE_STORE_EEPROM_FLAG,queue
+	call mouse_enable_function_flag
+	call mouse_bt_discovery_button_down_disable
+	fetch 1,mem_mouse_bluetooth_type
+	isolate1 MODE_4_MOUSE,pdata
+	call mouse_check_51cmd_adv,true
+	fetch 1,mem_mouse_bluetooth_type
+	isolate1 MODE_3_MOUSE,pdata
+	call check_51cmd_start_discovery,true
+	call mouse_low_voltage_led_blink_disable
+	branch mouse_discover_setting_led_gpio
+
+
+mouse_stop_discovery:
+	bpatch patch1b_3,mem_patch1b
+	arg MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG,queue
+	call mouse_disable_function_flag
+	jam 0,mem_mouse_bluetooth_reconnect_timeout
+	fetch 1,mem_mouse_bluetooth_type
+	isolate1 MODE_4_MOUSE,pdata
+	call mouse_stop_le_adv,true
+	fetch 1,mem_mouse_bluetooth_type
+	isolate1 MODE_3_MOUSE,pdata
+	call mouse_stop_bt3_discovery,true
+	branch mouse_device_led_off
+mouse_stop_le_adv:
+	jam 0,mem_mouse_direct_timer
+	branch check_51cmd_stop_adv
+mouse_stop_bt3_discovery:
+	setarg 0
+	store 2,mem_mouse_discovery_timer
+	branch check_51cmd_stop_discovery
+
+mouse_store_remote_bdaddr:
+	bpatch patch1b_4,mem_patch1b
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_STORE_EEPROM_FLAG
+	call mouse_device_poweron_timer_init
+	arg MOUSE_STORE_EEPROM_FLAG,queue
+	call mouse_disable_function_flag
+	call mouse_check_device_addr
+mouse_unplug_clean_bdaddr:
+	call mouse_before_store_reconn_info
+	branch mouse_store_device_info_delay
+
+	
+mouse_check_device_addr:
+	fetch 1,mem_record_bt_mode
+	beq REC_4_MODE,mouse_check_le_device_addr
+	beq REC_3_MODE,mouse_check_bt_device_addr
+	rtn
+mouse_check_le_device_addr:
+	store 1,mem_device_addr_temp
+	fetch 6,mem_le_plap
+	branch mouse_check_bt_device_addr_common
+mouse_check_bt_device_addr:
+	store 1,mem_device_addr_temp
+	fetch 6,mem_plap
+mouse_check_bt_device_addr_common:
+	store 6,mem_device_addr_temp+1
+	fetch 7,mem_device_addr_temp
+	arg mem_device1_type,contr
+	arg 3,loopcnt
+mouse_check_device_addr_end:
+	ifetcht 7,contr
+	isub temp,null
+	branch mouse_clean_addr,zero
+	increase 22,contr
+	loop mouse_check_device_addr_end
+	rtn
+mouse_before_store_reconn_info:
+	arg mem_device1_type,rega
+	fetch 1,mem_device_flag
+	increase -1,pdata
+	mul32 pdata,29,pdata
+	iadd rega,rega
+	fetch 1,mem_record_bt_mode
+	istore 1,rega
+	beq REC_4_MODE,mouse_store_le_device
+	beq REC_3_MODE,mouse_store_bt_device
+	rtn
+	
+mouse_store_le_device:
+	fetch 6,mem_le_plap
+	istore 6,contw
+	arg mem_le_ltk,contr
+	call memcpy16
+	fetch 6,mem_le_lap
+	istore 6,contw
+	rtn
+mouse_store_bt_device:
+	fetch 6,mem_plap
+	istore 6,contw
+	arg mem_link_key,contr
+	branch memcpy16
+
+mouse_clean_addr:
+	increase -6,contr
+	copy contr,contw
+	fetcht 6,mem_device_addr_temp+1
+	increase 3,temp
+	istoret 6,contw
+	rtn
+	
+mouse_select_reconn_device:
+	arg mem_device1_type,rega
+	fetch 1,mem_device_flag
+	rtneq MODE_24G_DEVICE
+	increase -1,pdata
+	mul32 pdata,29,pdata
+	iadd rega,rega
+	ifetch 1,rega
+	store 1,mem_xrecord_mode
+	beq REC_3_MODE,mouse_load_bt_device
+	beq REC_4_MODE,mouse_load_le_device
+	rtn
+
+mouse_load_bt_device:
+	ifetch 6,contr
+mouse_load_bt_device_end:
+	store 6,mem_hci_plap
+	arg mem_link_key,contw
+	call memcpy16
+	branch check_link_key_load
+
+mouse_load_le_device:
+	ifetch 6,contr
+mouse_load_le_device_end:
+	store 6,mem_hci_plap
+	arg mem_le_ltk,contw
+	call memcpy16
+	ifetch 6,contr
+	store 6,mem_le_lap
+	rtn
+
+
+
+mouse_app_initflag_check:
+	fetch 2,mem_store_flag
+	arg EEPROM_INIT_FLAG,temp
+	isub temp,null
+	branch mouse_load_device_info,zero
+	storet 2,mem_store_flag
+	call mouse_ble_init_address
+	fetch 1,mem_device_flag_temp
+	store 1,mem_device_flag
+	fetch 1,mem_config_sensor_dpi
+	store 1,mem_mouse_dpi
+	fetch 4,mem_24g_fast_conn_addr
+	store 4,mem_24g_receiver_addr
+	store 4,mem_24g_addr	
+	rtn
+
+mouse_load_device_info:
+	call mouse_select_reconn_device
+	fetch 4,mem_mouse_24g_addr
+	store 4,mem_24g_receiver_addr
+	store 4,mem_24g_addr
+	rtn
+	
+mouse_ble_init_address:
+	fetch 6,mem_le_lap
+	store 6,mem_device1_locall_addr
+	add pdata,0x0100,pdata
+	store 6,mem_device2_locall_addr
+	add pdata,0x0100,pdata
+	store 6,mem_device3_locall_addr
+	rtn
+	
+
+mouse_store_device_info_delay:	
+	fetch 1,mem_store_information_delay_timer_init
+	store 1,mem_store_information_delay_timer
+	rtn
+
+mouse_store_device_info:
+	bpatch patch1b_5,mem_patch1b
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_EEPROM,mouse_store_eeprom_device_info
+	bbit1 MOUSE_ENABLE_FLASH,mouse_store_flash_device_info
+	rtn
+
+mouse_load_flash_info_check:
+	call spid_init_flash
+	call mouse_spid_flash_release_form_powerdown
+	call mouse_information_flash_parameters
+	call spid_read_flash
+	call mouse_spid_flash_powerdown
+	call mouse_app_initflag_check
+	branch mouse_sensor_spi_init
+
+
+mouse_information_flash_parameters:
+	setarg mem_mouse_information_end
+	arg mem_mouse_information_start,temp
+	isub temp,temp
+	fetch 3,mem_flash_base
+	arg mem_mouse_information_start,rega
+	rtn
+	
+mouse_store_flash_device_info:
+	call spid_init_flash
+	call mouse_spid_flash_release_form_powerdown
+	call mouse_flash_erase_sector
+
+	call mouse_information_flash_parameters
+	call mouse_spid_write_flash
+	call mouse_spid_flash_powerdown
+	branch mouse_sensor_spi_init
+
+mouse_spid_flash_release_form_powerdown:
+	jam FLASH_COMMAND_RELEASE_FROM_POWERDOWN,mem_temp
+mouse_spid_write_flash_cmd:
+	call delay_nop100
+	call spid_unlock_flash
+	arg mem_write_flash_head_temp,rega
+	fetcht 1,mem_temp
+	call mouse_spid_write_flash_cmd_common
+	branch delay_nop100
+
+mouse_spid_flash_powerdown:
+	jam FLASH_COMMAND_POWERDOWN,mem_temp
+	branch mouse_spid_write_flash_cmd
+
+mouse_spid_write_flash_cmd_common:
+	istoret 1,rega
+	rshift16 pdata,temp
+	istoret 1,contw
+	rshift8 pdata,temp
+	istoret 1,contw
+	istore 1,contw
+	deposit rega
+	store 2,core_spid_txaddr
+	setarg 0
+	store 2,core_spid_rxlen
+	jam spid_start,core_misc_ctrl
+	branch wait_spid_done
+		
+mouse_flash_erase_sector:
+	fetch 3,mem_flash_base
+	store 3,mem_spi_write_addr
+	branch spid_flash_erase_sector+2
+
+mouse_spid_write_flash:
+	copy pdata,regc
+	copy rega,pdata
+	increase -4,pdata
+	copy pdata,regb
+	ifetch 4,regb
+	store 4,mem_write_flash_head_temp
+	copy regc,pdata
+	call spid_write_flash
+	fetch 4,mem_write_flash_head_temp
+	istore 4,regb
+	rtn
+
+mouse_flash_power_down:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_FLASH
+	call mouse_spid_flash_powerdown
+	call twspi_enable	// 2 wire mode
+	fetcht 1,mem_spi_cs_gpio		//disable flash
+	call gpio_out_inactive
+	fetcht 1,mem_spi_hold_gpio
+	branch mouse_gpio_config_input_pd
+
+mouse_load_eeprom_info_check:
+	call iicd_read_init_pin
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	isolate1 MOUSE_ENABLE_2K_EEPROM,pdata
+	ncall clear_eeprom_size_2k,true
+	call mouse_eeprom_load_recon_info
+	branch mouse_app_initflag_check
+
+mouse_eeprom_load_recon_info:
+	arg 128,temp
+	arg mem_device_flag,rega
+	arg MOUSE_INFO_EEPROM_OFFECT,regb
+	branch iicd_read_eep_data
+
+mouse_store_eeprom_device_info:
+	arg 128,temp
+	arg mem_device_flag,rega
+	arg MOUSE_INFO_EEPROM_OFFECT,regb
+	branch iicd_write_protect_eep_data
+
+
+mouse_store_eerpom_dpi:
+	arg 1,temp
+	arg mem_mouse_dpi,rega
+	arg MOUSE_DPI_EEPROM_OFFECT,regb
+	branch iicd_write_protect_eep_data
+
+mouse_load_eeprom_dpi:
+	arg 1,temp
+	arg mem_mouse_dpi,rega
+	arg MOUSE_DPI_EEPROM_OFFECT,regb
+	branch iicd_read_eep_data
+
+
+
+mouse_idle:
+	bpatch patch1b_6,mem_patch1b
+	call mouse_low_voltage_led_no_enter_lpm
+	call ui_check_paring_button
+	call mouse_dpi_check
+	call mouse_select_device_check
+	call mouse_check_select_device_by_switch
+	call mouse_bt_button_check
+	call mouse_usb_isr
+	call mouse_wheel_check
+	branch mouse_usb_mode
+
+mouse_select_device_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_PB_BUTTON,mouse_select_device_by_pb_button
+	bbit1 MOUSE_ENABLE_PB_BUTTON_LONG_PRESS_DISCONVERY,mouse_select_device_by_pb_button
+	rtn
+
+mouse_select_device_by_pb_button_check_once:
+	jam 0x03,mem_mouse_pbkey_press_status
+mouse_select_device_by_pb_button:	
+	fetch 1,mem_config_select_device_button_gpio
+	rtneq GPIO_DISABLE
+	arg 0,rega
+	jam MOUSE_PB_KEY,mem_mouse_key_temp
+	fetcht 1,mem_config_select_device_button_gpio
+	call mouse_pb_button_check
+	store 1,mem_mouse_pbkey_press_status
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,mouse_3io6key_pb_button_check_end	
+	call mouse_matrix_public_gpio_reset
+mouse_select_device_by_pb_button_exit:	
+	copy rega,pdata
+	bbit1 MOUSE_PB_KEY,mouse_select_device_button_down
+	branch mouse_select_device_button_up
+
+mouse_3io6key_pb_button_check_end:
+	fetcht 1,mem_config_select_device_button_gpio
+	call mouse_gpio_config_input_pu
+	branch mouse_select_device_by_pb_button_exit
+
+
+mouse_pb_button_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_PB_BUTTON_CONNECT_GND,mouse_pb_button_connect_gnd
+	fetch 1,mem_mouse_pbkey_press_status
+	copy pdata,regc
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,mouse_3io6key_check
+	fetch 1,mem_mouse_ghost_flag
+	nbranch mouse_select_device_by_pb_button_end,blank
+	branch mouse_pb_button_connect_matrix
+
+mouse_select_device_by_pb_button_end:
+	jam PB_BUTTON_STATE_UP,mem_select_device_button_statue
+	jam 0,mem_mouse_pbkey_press_status
+	rtn
+
+mouse_pb_button_connect_gnd:
+	fetch 1,mem_mouse_pbkey_press_status
+	branch mouse_check_key_connect_gnd
+
+mouse_pb_button_connect_matrix:
+	call gpio_get_bit
+	fetcht 1,mem_matrix_public_gpio
+	branch mouse_pb_button_connect_gnd,true
+	fetcht 1,mem_matrix_public_gpio
+	call gpio_out_active
+	fetcht 1,mem_config_select_device_button_gpio
+	fetch 1,mem_mouse_pbkey_press_status
+	branch mouse_check_key_connect_gnd
+	
+mouse_select_device_button_up:
+	fetch 1,mem_select_device_button_statue
+	rtneq PB_BUTTON_STATE_UP
+	jam PB_BUTTON_STATE_UP,mem_select_device_button_statue	
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_PB_BUTTON_SHORT_PRESS_ENTER_DISCOVERY
+	fetch 1,mem_bt_discovery_count
+	sub pdata,20,null
+	ncall mouse_ready_reconnection_by_button,positive		// press button less than 30-20=1000ms
+	fetch 1,mem_ui_button_timeout
+	store 1,mem_bt_discovery_count
+	rtn
+
+mouse_select_device_button_down:
+	call mouse_select_device_ghost_check
+	rtn user
+	fetch 1,mem_select_device_button_statue
+	rtneq PB_BUTTON_STATE_DOWN
+	jam PB_BUTTON_STATE_DOWN,mem_select_device_button_statue
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_PB_BUTTON_SHORT_PRESS_ENTER_DISCOVERY,mouse_long_button_bt_discovery
+	fetch 1,mem_mouse_direct_timer
+	rtn blank
+	fetch 1,mem_mouse_direct_timeout
+	store 1,mem_mouse_direct_timer
+	rtn
+
+mouse_select_device_ghost_check:
+	disable user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_PB_BUTTON_CONNECT_GND
+	fetch 1,mem_mouse_lkey_press_status
+	rtn blank
+	fetch 1,mem_mouse_rkey_press_status
+	rtn blank
+	enable user
+	rtn
+	
+
+
+mouse_check_select_device_by_switch:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_GPIO,mouse_check_select_device_by_switch_gpio
+	bbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_ADC,mouse_adc_read
+	rtn
+mouse_check_select_device_by_switch_gpio:	
+	fetcht 1,mem_device_switch_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_device_switch_gpio
+	call gpio_get_bit
+	branch mouse_check_select_24gdevice,true
+mouse_select_btdevice:
+	fetch 1,mem_device_flag
+	rtneq MODE_BT_DEVICE1
+	jam MODE_BT_DEVICE1,mem_device_flag
+	branch mouse_stop_bluetooth_mode
+	
+	
+mouse_check_select_24gdevice:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_ADC,mouse_check_select_24g_device
+	fetch 6,mem_mouse_vdd_switch_gnd_full_vol
+	store 6,mem_mouse_vdd_calculate_set
+mouse_check_select_24g_device:	
+	fetch 1,mem_device_flag
+	rtneq MODE_24G_DEVICE
+	jam MODE_24G_DEVICE,mem_device_flag
+	branch mouse_24g_stop
+
+	
+
+mouse_ready_reconnection_by_button:
+	bpatch patch1b_7,mem_patch1b
+	fetch 1,mem_device_number
+	rtneq 1		// 1channel
+	call mouse_select_device_number
+	storet 1,mem_device_flag
+mouse_store_device_number_before_reset:	
+	jam 0,mem_link_key_exists
+	call mouse_select_device_enable
+	call mouse_stop_bluetooth_mode
+	call mouse_select_device_disable
+	jam 1,mem_mouse_need_soft_reset
+	branch mouse_store_device_info_delay
+
+
+mouse_soft_reset:
+	call mouse_select_device_enable
+	branch soft_reset_chip
+
+mouse_select_device_number:
+	fetcht 1,mem_device_flag
+	increase 1,temp
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_24G,mouse_select_device_number_24g
+	sub temp,2,null
+	ncall mouse_select_device_count_clean_bt,positive
+	rtn
+	
+mouse_select_device_number_24g:	
+	fetch 1,mem_device_number
+	increase -1,pdata
+	isub temp,null
+	ncall mouse_select_device_count_clean_24g,positive
+	rtn
+
+mouse_select_device_count_clean_24g:
+	arg 0,temp
+	rtn
+mouse_select_device_count_clean_bt:
+	arg 1,temp
+	rtn
+
+
+mouse_store_device_number2eeprom:
+	arg 1,temp
+	arg mem_device_flag,rega
+	arg 0,regb
+	branch iicd_write_protect_eep_data
+		
+
+mouse_bt_button_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_PB_BUTTON_SHORT_PRESS_ENTER_DISCOVERY
+	call mouse_select_device_by_pb_button
+	rtn
+
+
+
+
+mouse_select_device_enable:
+	arg MOUSE_SELECT_DEVICE_FLAG,queue
+	branch mouse_enable_function_flag
+mouse_select_device_disable:
+	arg MOUSE_SELECT_DEVICE_FLAG,queue
+	branch mouse_disable_function_flag
+mouse_bt_cannel_reconn_enable:
+	arg MOUSE_BT_CANNEL_RECONN_FLAG,queue
+	branch mouse_enable_function_flag
+mouse_bt_cannel_reconn_disable:
+	arg MOUSE_BT_CANNEL_RECONN_FLAG,queue
+	branch mouse_disable_function_flag
+mouse_bt_discovery_button_down_enable:
+	arg MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG,queue
+	branch mouse_enable_function_flag
+mouse_bt_discovery_button_down_disable:
+	arg MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG,queue
+	branch mouse_disable_function_flag
+
+mouse_adc_read_enable:
+	arg MOUSE_ENABLE_ADC,queue
+	branch mouse_enable_function_flag
+
+mouse_24g_set_250Hz:
+	arg MOUSE_ENABLE_24G_250Hz,queue
+	branch mouse_enable_function_flag
+
+mouse_24g_search_dongle_enable:
+	arg MOUSE_ENABLE_24G_SEARCH_DONGLE,queue
+	branch mouse_enable_function_flag
+	
+mouse_16M_enable:
+	arg MOUSE_ENABLE_16M,queue
+	branch mouse_enable_function_flag
+	
+mouse_dpi_4level_enable:
+	arg MOUSE_ENABLE_DPI_LEVEL_4,queue
+	branch mouse_enable_function_flag
+
+
+mouse_enable_function_flag:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	qset1 pdata
+	store MOUSE_FLAG_LEN,mem_mouse_flag
+	rtn
+
+mouse_disable_function_flag:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	qset0 pdata
+	store MOUSE_FLAG_LEN,mem_mouse_flag
+	rtn
+
+mouse_customer_key_enable:
+	arg MOUSE_ENABLE_KEYBOARD,queue
+	call mouse_enable_function_flag
+	setarg 0
+	store 8,mem_customer_key_press
+	store 8,mem_customer_key_release
+	fetch 1,mem_mouse_enable_flag	// 00--win+d     01--ctrl+alt+a    02--AC home    03--play
+	and pdata,0xc0,pdata
+	beq 0x40,mouse_customer_key_ctrl_alt_a
+	beq 0x80,mouse_customer_AC_home
+	beq 0xc0,mouse_customer_key_play
+	setarg 0x070008
+mouse_customer_standrad_key_set:	
+	store 8,mem_customer_key_press+1		// win + d
+	rtn
+
+mouse_customer_key_ctrl_alt_a:
+	setarg 0x040005
+	branch mouse_customer_standrad_key_set
+
+	
+mouse_customer_AC_home:
+	setarg 0x022303
+mouse_customer_media_key_set:	
+	store 8,mem_customer_key_press
+	setarg 0x03
+	store 8,mem_customer_key_release
+	rtn
+	
+mouse_customer_key_play:
+	setarg 0x00cd03
+	branch mouse_customer_media_key_set
+
+	
+
+
+
+	
+mouse_polling_device:
+	bpatch patch1c_0,mem_patch1c
+	fetch 1,mem_reconn_times
+	increase -1,pdata
+	store 1,mem_reconn_times
+	fetcht 1,mem_device_flag
+	sub temp,1,null
+	ncall mouse_select_device_number,zero
+	storet 1,mem_device_flag
+	jam 0,mem_link_key_exists
+	call mouse_store_device_number2eeprom
+	call mouse_before_store_reconn_info
+	branch mouse_start_reconnect_device
+	
+
+
+//notice: need to call p_mouse_drawing_optima_init when waked from mult
+mouse_drawing_optima:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_SMOOTHER
+	fetch 4,mem_mouse_x
+	rtn blank
+	call mouse_data_abs_check
+	setarg 0x03	//asm_flag enable condition
+	call mouse_pdata_greater_than_check
+	call mouse_disable_asm,blank
+	ncall mouse_enable_asm,blank
+	setarg 0x02	//asm_flag disable condition
+	call mouse_data_less_than_check
+	call mouse_disable_asm,blank
+	fetch 1,mem_mouse_asm_flag
+	beq 1,mouse_drawing_optima_modify
+mouse_drawing_optima_init:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_SMOOTHER
+	arg 5,loopcnt
+	arg mem_mouse_asm_flag,contw
+	branch clear_mem
+
+mouse_drawing_optima_modify:
+	call mouse_drawing_optima_xy_offset_modify
+	fetch 2,mem_mouse_x_pre
+	store 2,mem_data_pre
+	fetch 2,mem_mouse_x
+	store 2,mem_data_current
+	call mouse_drawing_optima_data_x
+	fetch 2,mem_data_pre
+	store 2,mem_mouse_x_pre
+	fetch 2,mem_data_current
+	store 2,mem_mouse_x
+
+	fetch 2,mem_mouse_y_pre
+	store 2,mem_data_pre
+	fetch 2,mem_mouse_y
+	store 2,mem_data_current
+	call mouse_drawing_optima_data_y
+	fetch 2,mem_data_pre
+	store 2,mem_mouse_y_pre
+	fetch 2,mem_data_current
+	store 2,mem_mouse_y
+	rtn
+
+mouse_drawing_optima_xy_offset_modify:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_XY_OFFSET
+	fetch 2,mem_mouse_x_pre
+	store 2,mem_data_value
+	call mouse_pre_xy_data_judge
+	store 2,mem_mouse_x_pre
+	fetch 2,mem_mouse_x
+	store 2,mem_data_value
+	call mouse_current_xy_data_judge
+	store 2,mem_mouse_x
+	fetch 2,mem_mouse_y_pre
+	store 2,mem_data_value
+	call mouse_pre_xy_data_judge
+	store 2,mem_mouse_y_pre
+	fetch 2,mem_mouse_y
+	store 2,mem_data_value
+	call mouse_current_xy_data_judge
+	store 2,mem_mouse_y
+	rtn
+
+mouse_pre_xy_data_judge:	
+	fetch 1,mem_data_value+1
+	branch mouse_pre_xy_pdata_offset,blank
+	branch mouse_pre_xy_ndata_offset
+
+mouse_pre_xy_pdata_offset:
+	fetch 1,mem_data_value
+	call mouse_pre_xy_get_0_4_times
+	store 1,mem_data_value
+mouse_xy_data_offset_new:
+	fetch 2,mem_data_value
+	rtn
+mouse_pre_xy_ndata_offset:
+	fetch 1,mem_data_value
+	call mouse_pdata_invert
+	call mouse_pre_xy_get_0_4_times
+	call disable_blank,blank
+	call mouse_pdata_get_new_value
+	branch mouse_xy_data_offset_new
+	
+mouse_current_xy_data_judge:
+	fetch 1,mem_data_value+1
+	branch mouse_current_xy_pdata_offset,blank
+	branch mouse_current_xy_ndata_offset
+mouse_current_xy_pdata_offset:
+	fetch 1,mem_data_value
+	call mouse_current_xy_get_0_6_times
+	store 1,mem_data_value
+	branch mouse_xy_data_offset_new
+mouse_current_xy_ndata_offset:	
+	fetch 1,mem_data_value
+	call mouse_pdata_invert
+	call mouse_current_xy_get_0_6_times
+	call disable_blank,blank
+	call mouse_pdata_get_new_value
+	branch mouse_xy_data_offset_new
+	
+mouse_pre_xy_get_0_4_times:
+	mul32 pdata,4,pdata
+	div pdata,5
+	call wait_div_end
+	quotient pdata
+	rtn
+mouse_current_xy_get_0_6_times:	//0.6 times
+	mul32 pdata,12,pdata
+	div pdata,10
+	call wait_div_end
+	quotient pdata
+	rtn	
+	
+mouse_drawing_optima_data_x:
+	fetch 2,mem_data_pre
+	fetcht 2,mem_data_current
+	iadd temp,pdata
+	fetcht 1,mem_mouse_data_xtemp
+	iadd temp,pdata
+	and pdata,0x01,temp
+	storet 1,mem_mouse_data_xtemp
+	branch mouse_drawing_optima_data
+
+mouse_drawing_optima_data_y:
+	fetch 2,mem_data_pre
+	fetcht 2,mem_data_current
+	iadd temp,pdata
+	fetcht 1,mem_mouse_data_ytemp
+	iadd temp,pdata
+	and pdata,0x01,temp
+	storet 1,mem_mouse_data_ytemp
+	branch mouse_drawing_optima_data
+
+/**********
+input:data_pre,data_current
+output:data_pre,data_current after optima
+***********/
+mouse_drawing_optima_data:
+	store 3,mem_data_sum
+	isolate1 16,pdata
+	branch mouse_data_sum_overflow,true
+	fetch 1,mem_data_sum+1
+	beq 0xff,mouse_data_sum_n
+	fetch 1,mem_data_sum
+mouse_data_store_pre:
+	rshift pdata,pdata
+	store 2,mem_data_pre
+	store 2,mem_data_current
+	rtn
+mouse_data_sum_overflow:
+	fetch 1,mem_data_sum+1	//sum positive
+	beq 0,mouse_data_sum_overflow_p
+	fetch 3,mem_data_sum	
+	branch mouse_data_store_pre
+mouse_data_sum_overflow_p:
+	jam 0,mem_data_sum+2
+	fetch 1,mem_data_sum
+	branch mouse_data_store_pre
+
+mouse_data_sum_n:
+	fetch 1,mem_data_sum	//sum negetive
+	call mouse_pdata_get_half
+	store 1,mem_data_pre
+	store 1,mem_data_current
+	branch mouse_data_zero,blank
+	setarg 0xff
+mouse_data_set_direction:	
+	store 1,mem_data_pre+1
+	store 1,mem_data_current+1
+	rtn
+mouse_data_zero:
+	setarg 0
+	branch mouse_data_set_direction
+
+mouse_pdata_get_half:
+	call mouse_pdata_invert
+	rshift pdata,pdata
+mouse_pdata_get_new_value:	
+	call mouse_rega_in_out
+	sub pdata,0,pdata
+	store 1,mem_data_value	
+	rtn
+
+mouse_pdata_invert:
+	sub pdata,0,pdata
+mouse_rega_in_out:	
+	store 1,mem_rega
+	fetch 1,mem_rega
+	rtn
+
+mouse_disable_asm:
+	jam 0,mem_mouse_asm_flag
+	rtn
+mouse_enable_asm:
+	jam 1,mem_mouse_asm_flag
+	rtn
+
+//rega mouse_x, regb mouse_y, pdata refer
+mouse_pdata_greater_than_check:
+	isub rega,null
+	nbranch disable_blank,positive
+	isub regb,null
+	nbranch disable_blank,positive
+	branch enable_blank
+mouse_data_less_than_check:
+	isub rega,null
+	nrtn positive
+	isub regb,null
+	nrtn positive
+	branch enable_blank
+
+mouse_data_abs_check:
+	fetch 2,mem_mouse_x
+	call mouse_data_abs
+	copy pdata,rega
+	fetch 2,mem_mouse_y
+	call mouse_data_abs
+	copy pdata,regb
+	rtn
+
+/***********
+input: data_current
+output:pdata,abs
+************/
+mouse_data_abs:
+	store 2,mem_data_current
+	fetch 1,mem_data_current+1
+	beq 0xff,mouse_data_reversal
+	fetch 1,mem_data_current
+mouse_data_abs_store:
+	and_into 0xff,pdata
+	//output:pdata
+	rtn
+mouse_data_reversal:
+	fetch 2,mem_data_current
+	sub pdata,0,pdata
+	branch mouse_data_abs_store
+
+mouse_24g_long_sleep_param_update_timer:
+	arg mem_24g_long_sleep_param_update_timer,regc
+	arg mouse_24g_long_sleep_normal_param,regb
+	branch timer_single_step
+mouse_24g_long_sleep_normal_param:
+	fetch 4,mem_24g_long_sleep_set1
+	store 4,mem_24g_enter_hibernate
+	jam 1,mem_mouse_long_mult_flag
+	rtn
+
+
+mouse_24g_long_sleep_set:
+	beq 0x00,mouse_24g_long_sleep_set_30ms
+	beq 0x01,mouse_24g_long_sleep_set_50ms
+	beq 0x02,mouse_24g_long_sleep_set_80ms
+	beq 0x03,mouse_24g_long_sleep_set_100ms
+mouse_24g_long_sleep_set_80ms:
+	setarg 0x0ea600
+mouse_24g_long_sleep_set_end:	
+	store 4,mem_24g_long_sleep_set1
+	rtn
+mouse_24g_long_sleep_set_30ms:
+	setarg 0x05e740
+	branch mouse_24g_long_sleep_set_end
+mouse_24g_long_sleep_set_50ms:
+	setarg 0x0927c0
+	branch mouse_24g_long_sleep_set_end
+mouse_24g_long_sleep_set_100ms:
+	setarg 0x124f80
+	branch mouse_24g_long_sleep_set_end
+
+	
+
+mouse_24g_hibernate_set:
+	jam 0,mem_24g_attempt_fail_flag
+	call g24_transmit_next_packet
+	setarg -1
+	store 4,mem_24g_enter_hibernate
+	setarg 0
+	store 7,mem_mouse_key
+	jam 1,mem_sensor_shutdown_flag
+	call mouse_sensor_powerdown
+	call mouse_setgpio_hibernate
+	branch g24_long_sleep
+
+mouse_wakeup_24g:
+	fetch 1,mem_sensor_shutdown_flag
+	ncall mouse_init_sensor_wakeup,blank
+	jam 0,mem_sensor_shutdown_flag
+	branch g24_transmit_no_ack
+
+mouse_24g_transmit_start:
+	fetch 1,mem_sensor_shutdown_flag
+	nbranch g24_short_sleep,blank
+	branch g24_transmit_start_next
+
+
+mouse_24g_stop:
+	set0 mark_24g,mark
+	jam STATE_24G_STOP,mem_24g_conn_sm
+	arg MOUSE_24G_PAIRING_FLAG,queue
+	branch mouse_disable_function_flag
+
+
+mouse_24g_start_mode:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_24G,mouse_24g_mode_setup_error
+	call mouse_wakeup_from_power_check	// wake from hibernate :enble user
+	branch mouse_24g_reconn_dongle_start,user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_AUTO_24G_PARING,mouse_24g_reconn_general_dongle
+	bbit0 MOUSE_ENABLE_24G_POWER_ON_PAIRING,mouse_24g_reconn_general_dongle
+	call mouse_key_check_once
+	and pdata,0x07,pdata
+	fetcht 1,mem_mouse_commbination_key_24g
+	isub temp,null
+	branch mouse_24g_start_pair_mode,zero
+	branch mouse_24g_reconn_general_dongle
+
+mouse_24g_mode_setup_error:
+	fetch 1,mem_reconn_times
+	nbranch mouse_polling_device,blank
+	rtn
+
+mouse_24g_reconn_dongle_start:
+	fetch 2,mem_24g_reconn_timeout_init
+	store 2,mem_24g_reconn_timeout
+	jam RECEIVER_AND_3_0_ADDR,mem_24g_reconn_type
+	branch g24_reconn_start
+
+
+mouse_24g_first_start_auto_pair_mode:
+	call mouse_wakeup_from_power_check
+	branch mouse_24g_first_start_reconn,user  	// wake from hibernate :enble user
+mouse_24g_reconn_general_dongle:	
+	jam MODE_24G_DEVICE,mem_device_flag
+	fetch 2,mem_mouse_24g_power_on_fast_conn_timer
+	store 2,mem_24g_reconn_timeout
+	jam FAST_CONN_AND_3_0_ADDR,mem_24g_reconn_type
+	branch g24_reconn_start
+
+mouse_24g_start_auto_pair:
+	call mouse_discover_setting_led_gpio
+	fetch 2,mem_24g_pair_timeout_init
+	store 2,mem_24g_reconn_timeout
+	jam PAIR_AND_3_0_ADDR,mem_24g_reconn_type
+	branch g24_reconn_start
+
+
+mouse_24g_first_start_reconn:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_24g_reconn_dongle_start
+	call mouse_bluetooth_fast_conn_disable
+	branch mouse_24g_first_bluetooth_reconnect
+	
+mouse_24g_first_bluetooth_reconnect:
+	call mouse_24g_stop
+	call mouse_device_led_all_off
+	jam MODE_BT_DEVICE1,mem_device_flag
+	call mouse_select_reconn_device
+	branch mouse_start_reconnect_device
+
+mouse_24g_first_bb_event_reconn_timeout:
+	call mouse_wakeup_from_power_check
+	branch mouse_app_enter_hibernate,user
+	branch mouse_start_discovery
+
+
+mouse_24g_first_store_reconn_info:
+	call mouse_wakeup_from_power_check
+	rtn user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_store_device_info_delay
+	rtn
+
+mouse_24g_start_pair_mode:
+	arg MOUSE_24G_PAIRING_FLAG,queue
+	call mouse_enable_function_flag
+	setarg 0
+	store 2,mem_24g_reconn_timeout	
+	call mouse_stop_discovery
+	call mouse_low_voltage_led_blink_disable
+	call mouse_discover_setting_led_gpio
+	jam TYPE_MS,mem_24g_data_type
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_KEYBOARD,g24_pair_start
+	jam TYPE_KB,mem_24g_data_type
+	branch g24_pair_start
+
+	
+mouse_24g_attempt_fail:
+	fetch 1,mem_24g_attempt_fail_flag
+	nbranch mouse_24g_hibernate_set,blank
+	fetch 1,mem_24g_reconn_type
+	beq FAST_CONN_AND_3_0_ADDR,mouse_24g_fast_conn_attempt_fail
+	beq PAIR_AND_3_0_ADDR,mouse_24g_auto_pair_attempt_fail
+	beq RECEIVER_AND_3_0_ADDR,mouse_reconn_dongle_attempt_fail
+mouse_24g_attempt_fail_enter_hibernate:
+	call mouse_device_led_off
+	call mouse_24g_stop
+	fetch 1,mem_reconn_times
+	nbranch mouse_polling_device,blank
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_app_enter_hibernate
+	rtn
+
+mouse_24g_fast_conn_attempt_fail:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag 
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_24g_start_auto_pair
+	bbit1 MOUSE_ENABLE_AUTO_24G_PARING,mouse_24g_start_auto_pair
+	branch mouse_24g_reconn_dongle_start
+
+
+mouse_24g_auto_pair_attempt_fail:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag 
+	bbit0 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_24g_attempt_fail_enter_hibernate
+	fetch 1,mem_device_number
+	beq 1,mouse_24g_attempt_fail_enter_hibernate		//24g first mode and only 2.4g device
+	branch mouse_24g_first_bluetooth_reconnect
+
+mouse_reconn_dongle_attempt_fail:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_24g_attempt_fail_enter_hibernate
+	bbit1 MOUSE_ENABLE_EEPROM,mouse_24g_attempt_fail_enter_hibernate
+	bbit1 MOUSE_ENABLE_FLASH,mouse_24g_attempt_fail_enter_hibernate
+	branch mouse_24g_start_auto_pair+1
+
+		
+mouse_24g_attempt_success:
+	call mouse_init_sensor_reset
+	jam 0,mem_mouse_long_mult_flag
+	jam 0,mem_24g_conn_sm
+	jam 0,mem_24g_reconn_type
+	fetch 4,mem_24g_receiver_addr
+	fetch 4,mem_24g_fast_conn_addr
+	isub temp,null
+	rtn zero
+	branch mouse_24g_first_store_reconn_info
+	
+mouse_24g_pairing_complete:
+	arg MOUSE_24G_PAIRING_FLAG,queue
+	call mouse_disable_function_flag
+	call mouse_device_poweron_timer_init
+	setarg 0
+	store 2,mem_24g_pair_timeout
+	store 2,mem_24g_reconn_timeout
+	store 1,mem_24g_conn_sm
+	store 1,mem_mouse_move_flag
+	store 1,mem_24g_reconn_type
+
+	call mouse_init_sensor_reset
+	call mouse_read_sensor_common
+	fetch 4,mem_24g_addr
+	store 4,mem_24g_receiver_addr
+	store 4,mem_mouse_24g_addr
+	branch mouse_store_device_info_delay
+
+mouse_24g_package_data:
+	rtnmark0 mark_24g
+	call mouse_motion
+	nrtn user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_KEYBOARD,mouse_24g_mouse_package_data
+	fetch 1,mem_customer_key
+	nbranch mouse_24g_keyboard_package_data,blank
+mouse_24g_mouse_package_data:
+	call mouse_data_xy_release
+	fetch 1,mem_24g_data_type
+	bbit1 1,mouse_24g_mouse_package_data_now	// last package is keyboard data
+	fetcht 1,mem_24g_txbuf+1
+	fetch 1,mem_mouse_key
+	ior temp,pdata
+	store 1,mem_mouse_key
+	fetcht 1,mem_24g_txbuf+6
+	fetch 1,mem_mouse_z
+	iadd temp,pdata
+	store 1,mem_mouse_z
+	fetcht 1,mem_24g_txbuf+7
+	fetch 1,mem_mouse_tz
+	iadd temp,pdata
+	store 1,mem_mouse_tz	
+mouse_24g_mouse_package_data_now:	
+	jam TYPE_MS,mem_24g_data_type
+	arg 7,rega	//length
+	arg mem_mouse_key,regb //tx buff
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_24G_250Hz,g24_transmit_by_interrupt_enable
+	fetch 2,mem_mouse_z
+	rtn blank
+	branch g24_transmit_by_interrupt_enable
+
+mouse_24g_keyboard_package_data:
+	jam TYPE_KB,mem_24g_data_type
+	arg 9,rega	//length
+	fetch 1,mem_customer_data_trigger
+	nbranch mouse_customer_key_press,blank
+	arg mem_customer_key_release,regb	//tx buff
+	rtn
+mouse_customer_key_press:
+	arg mem_customer_key_press,regb
+	rtn
+
+
+
+/**************************************g24 search receiver*****************************************/
+
+mouse_24g_search_dongle_init:
+	setarg 0
+	store 3,mem_mouse_search_dongle_action
+	rtn
+
+mouse_24g_search_dongle:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_24G_SEARCH_DONGLE
+	fetch 1,mem_mouse_long_mult_flag
+	rtn blank
+	fetch 1,mem_24g_abort_pac
+	rtn blank
+	fetch 1,mem_mouse_search_dongle_interval
+	increase 1,pdata
+	and_into 3,pdata
+	store 1,mem_mouse_search_dongle_interval
+	nrtn blank	//400ms
+	jam 0,mem_mouse_search_dongle_ch
+mouse_24g_search_dongle_loop:
+	fetch 1,mem_mouse_search_dongle_ch
+	increase 1,pdata
+	store 1,mem_mouse_search_dongle_ch
+	sub pdata,G24_CH_NUMBER,null
+	nbranch mouse_24g_search_dongle_loop_end,positive
+	call g24_reconn_data_prep
+	call g24_transmit_receive_ack
+	nbranch mouse_24g_search_dongle_loop_retry,sync
+	nbranch mouse_24g_search_dongle_loop_retry,user3
+	call mouse_24g_search_dongle_success
+mouse_24g_search_dongle_loop_end:
+	call g24_txbuf_clear
+	fetch 1,mem_mouse_search_dongle_count
+	increase 1,pdata
+	store 1,mem_mouse_search_dongle_count
+	beq G24_CH_POLL_COUNT,mouse_24g_search_dongle_check
+	rtn
+
+mouse_24g_search_dongle_loop_retry:
+	call g24_ch
+	branch mouse_24g_search_dongle_loop
+
+mouse_24g_search_dongle_check:
+	jam 0,mem_mouse_search_dongle_count
+	fetch 1,mem_mouse_search_dongle_action
+	rtnbit1 G24_DISCONN_STATE
+	set1 G24_DISCONN_STATE,pdata
+	store 1,mem_mouse_search_dongle_action
+	fetch 2,mem_mouse_24g_search_dongle_time_init		//3min
+	store 2,mem_mouse_no_data_timer
+	branch mouse_sensor_powerdown
+
+mouse_24g_search_dongle_success:
+	fetch 1,mem_24g_abort_pac
+	branch mouse_24g_search_dongle_init,blank
+	jam 0,mem_mouse_search_dongle_count
+	fetch 1,mem_mouse_search_dongle_action
+	rtnbit0 G24_DISCONN_STATE
+	set0 G24_DISCONN_STATE,pdata
+	store 1,mem_mouse_search_dongle_action
+	call mouse_no_data_timer_init
+	branch mouse_init_sensor_wakeup
+
+/**************************************g24 search receiver*****************************************/
+
+
+
+/*******************led*************************/
+mouse_device_poweron_timer:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_POWER_ON_LED
+	fetch 1,mem_mouse_device_poweron_timer_count
+	rtn blank
+	increase -1,pdata
+	store 1,mem_mouse_device_poweron_timer_count
+	branch mouse_device_led_off,blank
+	branch mouse_device_led_on
+	
+mouse_device_poweron_timer_init:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_POWER_ON_LED
+	call mouse_low_voltage_led_blink_disable
+	fetch 1,mem_mouse_device_poweron_timer_count_init
+	store 1,mem_mouse_device_poweron_timer_count
+	rtn	
+
+	
+mouse_discover_setting_led_gpio:
+	jam 0,mem_mouse_device_poweron_timer_count
+	fetch 2,mem_mouse_disconvey_led_blink_time
+	store 2,mem_mouse_on_time
+	store 2,mem_mouse_off_time	
+mouse_setting_led_gpio_comman:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_device_led_24g
+	beq MODE_BT_DEVICE1,mouse_device_led_bt1
+	beq MODE_BT_DEVICE2,mouse_device_led_bt2
+	rtn
+mouse_device_led_24g:
+	fetch 1,mem_config_device_24g_led_gpio
+	branch mouse_led_blink
+mouse_device_led_bt1:
+	fetch 1,mem_config_device_bt1_led_gpio
+	branch mouse_led_blink
+mouse_device_led_bt2:
+	fetch 1,mem_config_device_bt2_led_gpio
+mouse_led_blink:
+	store 1,mem_temp
+	call mouse_device_led_off
+	fetch 1,mem_temp
+	store 1,mem_mouse_struct_led_gpio
+	arg 0,rega
+	jam UI_LED_STATE_BLINK_START,mem_mouse_led_type
+	branch ui_led_blink_start_global
+
+
+mouse_dpi_led_blink_delay:
+	fetch 1,mem_dpi_led_gpio
+	rtneq GPIO_DISABLE
+	fetch 2,mem_mouse_discovery_timer
+	nrtn blank
+	fetch 2,mem_24g_pair_timeout
+	nrtn blank
+	fetch 2,mem_24g_reconn_timeout
+	nrtn blank
+	fetch 1,mem_mouse_device_poweron_timer_count
+	nrtn blank
+	fetch 1,mem_mouse_dpi_led_delay_count_init
+	branch mouse_dpi_led_blink_init,blank
+	store 1,mem_mouse_dpi_led_delay_count  //delay 1s led blink
+	rtn
+
+
+mouse_dpi_led_blink_delay_timer:
+	arg mem_mouse_dpi_led_delay_count,regc
+	arg mouse_dpi_led_blink_init,regb
+	branch timer_single_step	
+	
+mouse_dpi_led_blink_init:
+	fetch 1,mem_dpi_led_gpio
+	store 1,mem_mouse_struct_led_gpio
+	fetch 2,mem_mouse_dpi_led_blink_time
+	store 2,mem_mouse_on_time
+	store 2,mem_mouse_off_time
+	arg 0,rega
+	fetcht 1,mem_mouse_dpi
+	increase 1,temp
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_DPI_LEVEL_4,mouse_dpi_led_blink_init_end
+	increase 1,temp
+	sub temp,4,null
+	ncall mouse_dpi_led_blink_count_clean,positive		// blink count:2 3 4 1
+mouse_dpi_led_blink_init_end:	
+	storet 1,mem_mouse_blink_count
+	jam UI_LED_STATE_BLINK_START,mem_mouse_led_type
+	rtn
+
+mouse_dpi_led_blink_count_clean:
+	arg 1,temp
+	rtn
+
+mouse_check_dpi_blink:
+	disable user
+	fetch 1,mem_dpi_led_gpio
+	fetcht 1,mem_mouse_struct_led_gpio
+	isub temp,null
+	nrtn zero
+	fetch 1,mem_mouse_blink_count
+	rtn blank
+	jam 0,mem_adc_low_volatage_led_blink_enable
+	enable user
+	rtn
+
+mouse_device_led_all_off:
+	call mouse_dpi_led_off
+	call mouse_device_24g_led_off
+	call mouse_device_bt1_led_off
+	branch mouse_device_bt2_led_off
+
+mouse_device_led_off:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_device_24g_led_off
+	beq MODE_BT_DEVICE1,mouse_device_bt1_led_off
+	beq MODE_BT_DEVICE2,mouse_device_bt2_led_off
+	rtn
+
+mouse_device_24g_led_off:
+	jam 0,mem_24g_device_led_status
+	fetcht 1,mem_config_device_24g_led_gpio
+	branch mouse_led_off
+
+mouse_device_bt1_led_off:
+	fetcht 1,mem_config_device_bt1_led_gpio
+	branch mouse_led_off
+	
+mouse_device_bt2_led_off:
+	fetcht 1,mem_config_device_bt2_led_gpio
+	branch mouse_led_off
+
+mouse_dpi_led_off:
+	fetcht 1,mem_dpi_led_gpio
+	branch mouse_led_off
+
+mouse_device_led_on:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_device_24g_led_on
+	beq MODE_BT_DEVICE1,mouse_device_bt1_led_on
+	beq MODE_BT_DEVICE2,mouse_device_bt2_led_on
+	rtn
+
+mouse_device_24g_led_on:
+	fetcht 1,mem_config_device_24g_led_gpio
+	branch mouse_led_on
+mouse_device_bt1_led_on:
+	fetcht 1,mem_config_device_bt1_led_gpio
+	branch mouse_led_on
+mouse_device_bt2_led_on:
+	fetcht 1,mem_config_device_bt2_led_gpio
+	branch mouse_led_on
+
+mouse_led_off:
+	bpatch patch1c_1,mem_patch1c
+	storet 1,mem_mouse_struct_led_gpio
+	arg 0,rega
+	branch ui_led_off_global
+mouse_led_on:
+	bpatch patch1c_2,mem_patch1c
+	storet 1,mem_mouse_struct_led_gpio
+	arg 0,rega
+	branch ui_led_on_global
+
+mouse_ui_led_off_static:
+	fetch 1,mem_config_device_24g_led_gpio
+	isub temp,null
+	call mouse_clear_24g_led_statue,zero
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_4_LED,gpio_out_inactive
+	call mouse_check_bt2_led_off
+	call mouse_check_dpi_led_off
+	call mouse_check_low_v_led_off
+	fetch 1,mem_mouse_led_off_4_led
+	branch gpio_out_inactive,blank
+	jam 0,mem_mouse_led_off_4_led
+	branch gpio_set_high_impedance
+
+mouse_ui_led_on_static:
+	fetch 1,mem_config_device_24g_led_gpio
+	isub temp,null
+	call mouse_set_24g_led_statue,zero
+	branch gpio_out_active 
+
+
+mouse_check_bt2_led_off:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_BT2_FOR_4_LED
+	fetch 1,mem_config_device_bt2_led_gpio
+	branch mouse_check_1gpio_2led_off
+mouse_check_dpi_led_off:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_DPI_FOR_4_LED
+	fetch 1,mem_dpi_led_gpio
+	branch mouse_check_1gpio_2led_off
+mouse_check_low_v_led_off:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_LOW_V_FOR_4_LED
+	fetch 1,mem_config_low_voltage_alarm_gpio
+mouse_check_1gpio_2led_off:
+	isub temp,null
+	nrtn zero
+	jam 1,mem_mouse_led_off_4_led
+	rtn
+
+mouse_clear_24g_led_statue:
+	jam 0,mem_24g_device_led_status
+	rtn
+
+mouse_set_24g_led_statue:
+	jam 1,mem_24g_device_led_status
+	rtn
+
+mouse_low_voltage_led_timer:
+	fetch 2,mem_mouse_discovery_timer
+	nrtn blank
+	fetch 2,mem_24g_pair_timeout
+	nrtn blank
+	fetch 2,mem_24g_reconn_timeout
+	nrtn blank
+	fetch 1,mem_mouse_device_poweron_timer_count
+	nrtn blank
+	call mouse_check_dpi_blink
+	rtn user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_LOW_VOLTAGE_LED
+	rtnbit0 MOUSE_LOW_VOLTAGE_FLAG
+	bbit1 MOUSE_ENABLE_LOW_VOLTAGE_LED_BLINK_N_SECOND,mouse_low_voltage_led_blink_new_data
+	fetch 1,mem_adc_low_volatage_led_timer_count
+	increase 1,pdata
+	store 1,mem_adc_low_volatage_led_timer_count
+	sub pdata,20,null
+	ncall mouse_adc_low_volatage_led_timer_count_clean,positive
+	beq 2,mouse_low_voltage_led_on
+	beq 4,mouse_low_voltage_led_off
+	beq 6,mouse_low_voltage_led_on
+	beq 8,mouse_low_voltage_led_off
+	rtn
+mouse_adc_low_volatage_led_timer_count_clean:
+	jam 1,mem_adc_low_volatage_led_timer_count
+	branch mouse_low_voltage_led_off
+mouse_low_voltage_led_on:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_LOW_VOLTAGE_USE_MODE_LED,mouse_device_led_on
+	fetch 1,mem_config_low_voltage_alarm_gpio
+	rtneq GPIO_DISABLE
+	fetcht 1,mem_config_low_voltage_alarm_gpio
+	branch mouse_led_on
+mouse_low_voltage_led_off:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_LOW_VOLTAGE_USE_MODE_LED,mouse_device_led_off
+	fetch 1,mem_config_low_voltage_alarm_gpio
+	rtneq GPIO_DISABLE
+	fetcht 1,mem_config_low_voltage_alarm_gpio
+	branch mouse_led_off
+
+mouse_low_voltage_led_blink_new_data:
+	fetch 2,mem_mouse_no_data_timeout
+	fetcht 2,mem_mouse_no_data_timer
+	isub temp,temp
+	fetch 2,mem_adc_low_volatage_led_blink_timer
+	isub temp,null
+	nbranch mouse_low_voltage_led_blink_disable,positive
+	fetch 1,mem_adc_low_volatage_led_blink_enable
+	nrtn blank
+	jam 1,mem_adc_low_volatage_led_blink_enable
+	branch mouse_low_voltage_led_blink_init
+	
+mouse_low_voltage_led_blink_init:
+	fetch 2,mem_mouse_low_v_led_blink_time
+	store 2,mem_mouse_on_time
+	store 2,mem_mouse_off_time
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_LOW_VOLTAGE_USE_MODE_LED,mouse_setting_led_gpio_comman
+	fetch 1,mem_config_low_voltage_alarm_gpio
+	rtneq GPIO_DISABLE
+	branch mouse_led_blink
+
+mouse_low_voltage_led_blink_disable:
+	jam 0,mem_adc_low_volatage_led_blink_enable
+	branch mouse_low_voltage_led_off
+
+
+mouse_low_voltage_led_no_enter_lpm:	
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_LOW_VOLTAGE_LED
+	rtnbit0 MOUSE_LOW_VOLTAGE_FLAG
+	bbit1 MOUSE_ENABLE_LOW_VOLTAGE_LED_BLINK_N_SECOND,mouse_low_voltage_led_no_enter_lpm_blink
+	fetch 1,mem_adc_low_volatage_led_timer_count
+	sub pdata,10,null
+	branch mouse_lpm_mode_clear,positive
+mouse_low_voltage_led_no_enter_lpm_next:	
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,g24_transmit_by_interrupt_exit_check
+	jam 1,mem_lpm_mode
+	rtn
+
+g24_transmit_by_interrupt_exit_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag	
+	rtnbit1 MOUSE_ENABLE_24G_250Hz	
+	branch g24_transmit_by_interrupt_exit
+
+mouse_lpm_mode_clear:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,g24_transmit_by_interrupt_enable
+	jam 0,mem_lpm_mode
+	rtn
+
+mouse_low_voltage_led_no_enter_lpm_blink:
+	fetch 1,mem_adc_low_volatage_led_blink_enable
+	nbranch mouse_lpm_mode_clear,blank
+	branch mouse_low_voltage_led_no_enter_lpm_next
+	
+	
+/*******************led*************************/	
+mouse_store_signal_rssi:
+	call rssi_hex2dec
+	fetch 1,mem_rssi
+	branch rssi_signal
+
+mouse_le_transmit:
+	call mouse_store_signal_rssi
+	branch power_ctrl_start
+
+mouse_bt_slave_match:
+	call mouse_store_signal_rssi
+	fetch 1,mem_state
+	isolate1 state_inconn,pdata
+	nrtn true
+	fetch 1,mem_arq
+	isolate1 wack,pdata
+	call power_ctrl_pac_succ_decrs,true
+	ncall power_ctrl_pac_succ_incrs,true
+	branch power_ctrl_start
+
+mouse_le_set_lpm_mult:
+	fetch 1,mem_le_connect_status_flag
+	compare 3,pdata,3
+	nbranch disable_blank,true
+	call app_lpm_mult_enable
+	branch enable_blank
+
+mouse_bt_set_lpm_mult:
+	call l2cap_malloc_is_fifo_empty
+	nrtn blank
+	jam 1,mem_current_sniff_attempt
+	jam 0,mem_current_sniff_timeout
+	branch enable_blank
+
+mouse_set_lpm_mult:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,mouse_le_set_lpm_mult
+	branch mouse_bt_set_lpm_mult
+
+/*****************close define  COMPILE_MOUSE**********/
+else
+mouse_init:
+mouse_irtual_cable_unplug:
+mouse_store_remote_bdaddr:
+mouse_ui_led_off_static:
+mouse_ui_led_on_static:
+mouse_bt_hid_handshake_boot_check:
+mouse_delay_enter_hibernata:
+mouse_low_voltage_led_no_enter_lpm_blink:
+	rtn
+endif
+
+
+
Index: program/app_remote_car.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_remote_car.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_remote_car.prog	(working copy)
@@ -0,0 +1,393 @@
+ifdef COMPILE_REMOTE_CAR
+
+remote_car_init:
+	rtn wake	
+	call keyscan_key_init
+	setarg remote_car_g24_package_data
+	store 2,mem_cb_24g_transmit_data
+
+	setarg remote_car_process_lpm_before
+	store 2,mem_cb_24g_lpm_before
+	
+	setarg remote_car_le_before_hibernate
+	store 2,mem_cb_before_hibernate
+	
+	setarg remote_car_scale_process_idle
+	store 2,mem_cb_idle_process	
+	
+	setarg remote_car_scale_process_bb_event
+	store 2,mem_cb_bb_event_process
+
+	setarg remote_car_event_timer
+	store 2,mem_cb_event_timer
+	
+	setarg remote_car_power_off_signal
+	store 2,mem_remote_car_power_off_cb
+	
+	setarg remote_car_soft_switch_power_on_signal
+	store 2,mem_remote_car_power_standby_cb
+	
+	
+	bpatch patch1c_3,mem_patch1c
+	call set_eeprom_size_2k
+	call remote_car_init_environment
+
+	call queue_init
+	fetch 1,mem_remote_car_config_soft_switch_enable
+	store 1,mem_remote_car_hard_soft_switch
+	beq HARD_SWITCH, remote_car_hard_switch_power_on_signal
+	fetch 1,mem_remote_car_config_soft_switch_gpio
+	store 1,mem_ui_button_gpio
+remote_car_soft_switch_power_on_init:
+	call remote_car_ui_led_init
+	call ui_button_init
+	call ui_button_polling
+	jam POWER_STARTING,mem_remote_car_power_state
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BTN_DOWN
+	branch app_enter_hibernate
+
+
+
+remote_car_hard_switch_power_on_signal:
+	jam POWER_STANDBY,mem_remote_car_power_state
+remote_car_soft_switch_power_on_signal:
+	call remote_car_ui_led_init
+	arg 0,rega
+	call ui_led_blink_start_global
+	call remote_car_set_24g_addr_eeprom
+	call iicd_read_eep_data
+	call g24_factory_check
+	branch g24_pair_start,user
+	fetch 4,mem_24g_addr
+	store 4,mem_24g_receiver_addr
+	fetch 2,mem_24g_reconn_timeout_init
+	store 2,mem_24g_reconn_timeout
+	branch g24_reconn_start
+
+remote_car_set_24g_addr_eeprom:
+	arg 4,temp
+	arg mem_24g_addr,rega
+	arg REMOTE_INFO_EEPROM_OFFECT,regb
+	rtn
+
+
+remote_car_power_off_signal:	
+remote_car_ui_led_init:
+	bpatch patch1c_4,mem_patch1c
+	fetch 1,mem_remote_car_config_connect_led_gpio
+	bne INVALID_PIN_NUM,remote_car_pairing_led_gpio_set
+remote_car_ui_led_init_1:
+	fetcht 1, mem_remote_car_led_map
+	branch gpio_config_output
+remote_car_pairing_led_gpio_set:
+	store 1,mem_remote_car_led_map
+	branch remote_car_ui_led_init_1
+
+
+remote_car_init_environment:
+	call g24_transmit_init
+remote_no_data_timer_init:
+	fetch 2,mem_remote_car_no_data_timeout
+	store 2,mem_remote_car_no_data_timer
+	rtn
+
+remote_car_le_before_hibernate:
+	call remote_car_process_lpm_before
+remote_gpio_set_before_hibernate:
+	fetch 1,mem_remote_style_struct_led_gpio
+	set1 7,pdata
+	arg gpcfg_output_high,temp
+	branch gpio_config_function
+
+remote_car_process_lpm_before:
+	call gpio_set_before_lpm
+	branch keyscan_process_lpm_before
+
+remote_car_key_scan_process:
+	call keyscan_key_process
+	call get_remote_key_state
+	call remote_conn_led_state
+	branch send_data
+
+remote_conn_led_state:
+	fetch 1,mem_remote_car_24g_status
+	rtnne WORK_PAIRED
+	fetch 4,mem_remote_car_motor1_key0_press_state
+	branch remote_car_stop_state,blank
+	jam 0,mem_remote_car_no_data_check
+	enable user
+	branch check_51cmd_led_on
+remote_car_stop_state:
+	fetch 1,mem_remote_car_no_data_check
+	rtneq 0xff
+	pincrease 1
+	store 1,mem_remote_car_no_data_check
+	disable user
+	branch check_51cmd_led_off
+
+	
+get_remote_key_state:
+	fetcht 2,mem_key_value_retention
+	and temp,0x01,pdata
+	rshift temp,temp
+	store 1,mem_remote_car_motor1_key0_press_state
+	and temp,0x01,pdata
+	rshift temp,temp
+	store 1,mem_remote_car_motor1_key1_press_state
+	and temp,0x01,pdata
+	rshift temp,temp
+	store 1,mem_remote_car_motor2_key2_press_state
+	and temp,0x01,pdata
+	rshift temp,temp
+	store 1,mem_remote_car_motor2_key3_press_state
+	rtn
+send_data:
+	bpatch patch1c_5,mem_patch1c
+	call remote_car_fb_check
+	call remote_car_lr_check
+	call remote_car_no_data_timeout_check
+	nrtn user
+	branch remote_car_send_key 
+
+
+remote_car_no_data_timeout_check:
+	fetch 1,mem_remote_car_24g_status
+	rtnne WORK_PAIRED
+	fetch 1,mem_remote_car_no_data_check
+	rtn blank
+	sub pdata,1,null
+	nrtn positive
+	fetch 2,mem_24g_reconn_timeout_init
+	store 2,mem_24g_reconn_timeout
+	enable user
+	rtn
+
+
+	
+remote_car_fb_check:
+	fetch 1,mem_remote_car_motor1_key0_press_state
+	nbranch remote_car_send_motor1_key0_press,blank
+	fetch 1,mem_remote_car_motor1_key1_press_state
+	nbranch remote_car_send_motor1_key1_press,blank
+	branch remote_car_send_motor1_key0_rel
+	
+remote_car_lr_check:
+	fetch 1,mem_remote_car_motor2_key2_press_state
+	nbranch remote_car_send_motor2_key2_press,blank
+	fetch 1,mem_remote_car_motor2_key3_press_state
+	nbranch remote_car_send_motor2_key3_press,blank
+	branch remote_car_send_motor2_key2_rel
+
+
+remote_car_scale_process_idle:
+	call remote_car_24g_status_process
+	branch remote_car_key_scan_process
+
+remote_car_scale_process_bb_event:
+	copy regc,pdata
+	beq BT_EVT_BUTTON_UP,app_event_button_up
+	beq BT_EVT_BUTTON_LONG_PRESSED,app_button_long_pressed
+	beq BT_EVT_24G_PAIRING_COMPLETE,remote_car_24g_pairing_complete
+	beq BT_EVT_24G_ATTEMPT_SUCCESS,remote_car_24g_attempt_success
+	beq BT_EVT_24G_ATTEMPT_FAIL,remote_car_24g_attempt_fail
+	rtn
+
+remote_car_24g_attempt_fail:
+	branch g24_txbuf_clear
+
+remote_car_24g_pairing_complete:
+	call remote_car_set_24g_addr_eeprom
+	call iicd_write_protect_eep_data
+remote_car_24g_attempt_success:
+	jam 0,mem_24g_conn_sm
+	jam WORK_PAIRED,mem_remote_car_24g_auto_work_step
+	jam WORK_PAIRED,mem_remote_car_24g_pair_success_flag
+	rtn
+
+remote_car_24g_status_process:
+	fetch 1,mem_remote_car_24g_auto_work_step
+	rtneq POWER_ON
+	fetch 1,mem_remote_car_24g_status
+	rtneq WORK_PAIRED
+	jam WORK_PAIRED,mem_remote_car_24g_status
+remote_car_scale_process_paired:
+	arg 0,rega
+	branch ui_led_off_global
+remote_car_scale_process_shutdown:
+	arg 0,rega
+	call ui_led_off_global
+	call remote_car_ui_led_init
+	branch app_enter_hibernate
+	
+remote_car_event_timer:
+	call app_power_timer
+	call g24_pair_timeout_timer
+	call g24_reconn_timeout_timer	
+	branch remote_car_no_data_timer
+
+remote_car_no_data_timer:
+	fetch 1,mem_remote_car_config_timeout_shutdown_enable
+	rtn blank
+	fetch 1,mem_key_value_retention
+	nbranch remote_no_data_timer_init,blank
+	arg mem_remote_car_no_data_timer,regc
+	arg remote_car_scale_process_shutdown,regb
+	branch timer_single_step_2B
+
+
+//cross key,control front-back motor layout
+remote_car_send_motor1_key0_press:	//front
+	jam MOTOR_POSITIVE,mem_remote_car_24g_motor1_payload
+	rtn
+remote_car_send_motor1_key1_press:	//back
+	jam MOTOR_NEGATIVE,mem_remote_car_24g_motor1_payload
+	rtn
+remote_car_send_motor2_key2_press:	//left
+	jam MOTOR_POSITIVE,mem_remote_car_24g_motor2_payload
+	rtn
+remote_car_send_motor2_key3_press:	//right
+	jam MOTOR_NEGATIVE,mem_remote_car_24g_motor2_payload
+	rtn
+
+
+remote_car_send_motor1_key0_rel:
+remote_car_send_motor1_key1_rel:
+	jam MOTOR_STOP,mem_remote_car_24g_motor1_payload
+	rtn
+remote_car_send_motor2_key2_rel:
+remote_car_send_motor2_key3_rel:
+	jam MOTOR_STOP,mem_remote_car_24g_motor2_payload
+	rtn
+	
+remote_car_send_key:
+	arg mem_remote_car_24g_motor_packet,rega
+	branch queue_push
+remote_car_send_attack:
+	arg mem_remote_car_24g_fire_packet,rega
+	branch queue_push
+
+remote_car_g24_package_data:
+	fetch 1,mem_remote_car_24g_pair_success_flag
+	beq WORK_PAIRED,remote_car_g24_send_empty
+	arg mem_remote_car_24g_tx_temp,rega
+	call queue_pop
+	nbranch remote_car_moto_data,user
+remote_car_g24_package_data_continue:
+	arg mem_remote_car_24g_tx_temp,contr
+	ifetch 1,contr
+	copy pdata,rega
+	arg mem_remote_car_24g_tx_temp+1,regb
+	//rega: length
+	//regb: tx buffer
+	rtn
+	
+remote_car_g24_send_empty:
+	jam 0,mem_remote_car_24g_pair_success_flag
+	enable user
+	arg 1,rega
+	arg mem_remote_car_empty_packet,regb
+	rtn
+	
+remote_car_moto_data:
+	fetch 1,mem_remote_car_24g_tx_temp+3	//cmd
+	beq CAR_CMD_L_R_MOTOR_CONTROL,remote_car_moto_data_next
+	beq CAR_CMD_F_B_MOTOR_CONTROL,remote_car_moto_data_next
+	rtn
+remote_car_moto_data_next:
+	fetch 1,mem_remote_car_24g_tx_temp+6	//data moto1
+	nbranch remote_car_moto_data_enable_user,blank
+	fetch 1,mem_remote_car_24g_tx_temp+8	//data moto2
+	nbranch remote_car_moto_data_enable_user,blank
+	fetch 1,mem_remote_car_24g_tx_temp+10	//data moto3
+	nbranch remote_car_moto_data_enable_user,blank
+	rtn
+remote_car_moto_data_enable_user:
+	enable user
+	branch remote_car_g24_package_data_continue
+
+
+
+/*************remote car default_init starting*********************/
+remote_car_default_init:
+	jam 0x14,mem_ui_button_timeout
+	jam 0x01,mem_ui_button_last_state
+	setarg 0x060f
+	store 2,mem_remote_car_queue_each_size
+	setarg mem_remote_car_queue_each_size
+	store 2,mem_queue_ptr
+	jam 0x01,mem_lpm_mode
+	jam 0x06,mem_lpm_overhead
+	jam 0x02,mem_lpm_mult_timeout
+	jam 0x00,mem_remote_car_hard_soft_switch
+	setarg mem_remote_style_led_type
+	store 2,mem_ui_led_struct_ptr
+	jam 0x01,mem_ui_led_struct_num
+	jam 0xff,mem_remote_style_blink_count
+	setarg 0x0296
+	store 2,mem_remote_style_on_time
+	setarg 0x073a
+	store 2,mem_remote_style_off_time
+	setarg mem_remote_car_soft_power
+	store 2,mem_power_param_ptr
+	setarg 0x0c0c
+	store 2,mem_remote_car_power_off_timeout
+	setarg mem_remote_car_keyscan
+	store 2,mem_keyscan_ptr
+	jam 0x00,mem_remote_car_config_soft_switch_enable
+	jam 0xff,mem_remote_car_config_connect_led_gpio
+	jam 0xff,mem_remote_car_config_soft_switch_gpio
+	jam 0x00,mem_remote_car_config_key_map
+	jam 0x00,mem_remote_car_config_layout
+	jam 0x00,mem_remote_car_config_check_way
+	jam 0x01,mem_remote_car_config_timeout_shutdown_enable
+	setarg 0x4e55
+	store 2,mem_current_vdd_value_default_mid_x
+	store 2,mem_current_vdd_value_default_mid_y
+	setarg 0x0007
+	store 2,mem_current_vdd_default_range
+	jam 0x02,mem_adc_config_flag
+	setsect 0,0x35a0c
+	setsect 1,0x11a
+	setsect 2,0x60
+	setsect 3,0x28
+	store 9,mem_remote_car_24g_motor_packet
+	setsect 0,0x2000a
+	setsect 1,0x02
+	istore 4,contw
+	setsect 0,0x35a08
+	setsect 1,0x19a
+	setsect 2,0x00
+	setsect 3,0x00
+	store 9,mem_remote_car_24g_fire_packet
+	setarg 0x0064
+	store 2,mem_remote_car_no_data_timeout
+	jam TX_POWER_0DB,mem_tx_power
+	jam 0x01,mem_24g_data_type		//24g init
+	jam 0x06,mem_24g_max_retry
+	jam 0x01,mem_24g_pair_switch
+	jam 0x00,mem_24g_fast_conn_enable
+	call g24_rx_window_init
+	call g24_interval_param_8ms
+	call g24_chmap_param_init
+	call g24_pair_param_init
+	setarg 0x0708
+	store 2,mem_24g_pair_timeout_init
+	setarg 0x0050
+	store 2,mem_24g_reconn_timeout_init
+	setarg 0x0a7700
+	store 3,mem_24g_long_sleep_set
+	setarg 0x604800
+	store 3,mem_24g_enter_hibernate
+	branch app_sys_param_init
+
+/*************remote car default_init ending*********************/
+
+else
+remote_car_init:
+	rtn
+endif
+
+
+
+
Index: program/app_shutter.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_shutter.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/app_shutter.prog	(working copy)
@@ -0,0 +1,1008 @@
+
+ifdef COMPILE_SHUTTER
+
+//define CLASSIC_SHUTTER_FUCTION
+
+shutter_init:
+	rtn wake
+	call enable_authrom
+	setarg shutter_le_before_hibernate
+	store 2,mem_cb_before_hibernate
+
+	setarg shutter_process_lpm_before
+	store 2,mem_cb_before_lpm
+	
+	setarg app_enter_hibernate
+	store 2,mem_cb_discovry_timeout
+	
+	setarg shutter_process_idle
+	store 2,mem_cb_idle_process
+		
+	setarg shutter_process_bb_event 
+	store 2,mem_cb_bb_event_process
+
+	setarg shutter_le_scale_lpm_lock
+	store 2,mem_cb_check_wakelock
+	
+	setarg ble_shutter_receive_data
+	store 2,mem_cb_att_write
+
+	setarg shutter_le_bb_event_timer
+	store 2,mem_cb_event_timer
+
+	setarg shutter_key_change
+	store 2,mem_cb_shutter_keycan
+
+	setarg shutter_soft_swtich_power_on
+	store 2,mem_shutter_soft_switch_poweron_callback_function
+	setarg shutter_soft_swtich_power_off
+	store 2,mem_shutter_soft_switch_poweroff_callback_function
+
+	call shutter_set_ble_version
+	call le_modified_name
+	call shutter_init_param	
+	call keyscan_key_init
+	call queue_init
+	call ui_led_init_global
+	
+	bpatch patch1c_6,mem_patch1c
+	call shutter_load_buffer_config_form_DataRom
+ifdef CLASSIC_SHUTTER_FUCTION
+	call shutter_load_bluetooth_config_by_eeprom
+	call shutter_random_mac_addr
+	call classic_shutter_load_reconn_info
+endif
+	fetch 1, mem_shutter_hard_soft_switch_case
+	beq HARD_SWITCH, shutter_hart_swtich_power_on
+	fetch 1,mem_shutter_soft_switch_button_gpio
+	store 1,mem_ui_button_gpio
+	branch ui_soft_swtich_init
+
+shutter_set_ble_version:
+	//set ble version  4.1 
+	jam 7,mem_lmp_version
+	rtn
+
+/**************hard swtich function**************/
+shutter_hart_swtich_power_on:
+	jam UI_BUTTON_GPIO_DISABLE,mem_ui_button_gpio
+	jam SS_STATE_POWER_ON,mem_shutter_soft_switch_power_state
+	branch shutter_start_reconnect
+/****************************/
+
+/**************lpm lock callback function**************/
+shutter_le_scale_lpm_lock:
+	fetch 1,mem_shutter_soft_switch_power_state
+	beq SS_STATE_POWER_OFF,app_get_lpm_wake_lock
+	call l2cap_malloc_get_full_map
+	fetch 1,mem_used_map
+	nbranch app_get_lpm_wake_lock,blank
+	branch app_put_lpm_wake_lock
+/****************************/
+
+/**************c512bt event callback function*************/
+shutter_process_bb_event:
+	copy regc,pdata
+	
+ifdef CLASSIC_SHUTTER_FUCTION
+/**************classic shutter event*****************/
+	beq BT_EVT_BB_CONNECTED,classic_shutter_process_baseband_connect
+	beq BT_EVT_BB_DISCONNECTED,classic_shutter_process_baseband_disconnect
+	beq BT_EVT_RECONN_FAILED,classic_shutter_process_reconnect_failed
+	beq BT_EVT_SETUP_COMPLETE,classic_shutter_process_setup_complete
+	beq BT_EVT_HID_CONNECTED,app_hid_connected
+	beq BT_EVT_HID_DISCONNECTED,classic_shutter_process_hid_disconnect
+	beq BT_EVT_HID_HANDSHAKE,classic_shutter_process_hid_handshake
+	beq BT_EVT_RECONN_PAGE_TIMEOUT,classic_shutter_process_reconnect_page_timeout
+	beq BT_EVT_VIRTUAL_CABLE_UNPLUG,classic_shutter_process_virtual_cable_unplug
+	beq BT_EVT_REMOTE_UNSNIFF,classic_shutter_process_remote_unsniff
+	beq BT_EVT_STORE_NVRAM,classic_shutter_process_store_reconnect_information
+endif
+/**************ble shutter event*****************/
+	beq BT_EVT_LE_CONNECTED,ble_shutter_process_baseband_connect
+	beq BT_EVT_LE_DISCONNECTED,ble_shutter_process_baseband_disconnect
+	beq BT_EVT_LE_RECONNECT_COMPLETE,ble_shutter_process_reconnect_complete
+	beq BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP,ble_shutter_process_parse_connect_parameter_update_response
+/***************soft swtich event****************/
+	beq BT_EVT_BUTTON_LONG_PRESSED,shutter_process_soft_swtich_button_long_press
+	beq BT_EVT_BUTTON_DOWN,shutter_process_soft_swtich_button_down
+	beq BT_EVT_BUTTON_UP,shutter_process_soft_swtich_button_up
+	rtn
+/****************************/
+
+ifdef CLASSIC_SHUTTER_FUCTION
+/******************classic shutter event**********************/
+classic_shutter_process_baseband_connect:
+	jam 0,mem_classic_shutter_hid_disconn_count
+	jam 0,mem_classic_shutter_cable_unplug_conut	
+	rtn
+
+
+classic_shutter_process_baseband_disconnect:
+	call classic_shutter_disconnect_clear_flag
+	branch classic_shutter_process_reconnect_failed
+
+classic_shutter_disconnect_clear_flag:
+	jam APP_HANDSHAKE_NULL,mem_app_handshake_flag
+	jam 0,mem_hid_handshake_timer_count
+	jam 0,mem_unsniff2sniff_timer_count
+	jam 0,mem_classic_shutter_cable_unplug_conut
+	jam 0,mem_classic_shutter_hid_disconn_count
+	branch queue_init
+
+
+classic_shutter_process_reconnect_failed:
+	call app_disconn_reason_clear
+	branch shutter_start_bluetooth_discovery
+
+
+classic_shutter_process_setup_complete:
+	call shutter_stop_bluetooth_discovery
+	branch app_led_stop_blink
+
+
+classic_shutter_process_hid_disconnect:
+	jam 0,mem_classic_shutter_cable_unplug_conut	
+	setarg FLAG_SHUTTER_HID_DISCONN_TIMEOUT
+	store 1,mem_classic_shutter_hid_disconn_count
+	rtn
+
+
+classic_shutter_process_hid_handshake:
+	fetch 1,mem_app_handshake_flag
+	rtneq APP_HANDSHAKE_DONE
+	jam APP_HANDSHAKE_DONE,mem_app_handshake_flag
+	call app_lpm_mult_enable
+	call app_store_reconn_info
+	call shutter_stop_bluetooth_discovery
+	call app_led_off
+	branch app_bt_enter_sniff
+
+
+classic_shutter_process_reconnect_page_timeout:
+	branch classic_shutter_process_reconnect_failed
+
+
+classic_shutter_process_virtual_cable_unplug:
+	setarg FLAG_SHUTTER_CABLE_UNPLUG_TIMEOUT
+	store 1,mem_classic_shutter_cable_unplug_conut
+	rtn
+
+
+classic_shutter_process_remote_unsniff:
+	branch app_start_auto_sniff
+
+
+/***************classic shutter store reconn info***********************/
+classic_shutter_process_store_reconnect_information:
+	arg NVRAM_EEPROM_OFFSET,regb
+	fetch 1,mem_nv_data_number
+	mul32 pdata,34,temp
+	fetch 2,mem_nv_data_ptr
+	copy pdata,rega
+	branch iicd_write_eep_data
+
+classic_shutter_load_reconn_info:
+	arg NVRAM_EEPROM_OFFSET,regb
+	fetch 1,mem_shutter_bluetooth_type
+	rtnbit0 CLASSIC_SHUTTER
+	fetch 1,mem_nv_data_number
+	rtn blank
+	mul32 pdata,34,temp
+	fetch 2,mem_nv_data_ptr
+	copy pdata,rega
+	branch iicd_read_eep_data
+/**************************************/
+endif
+/******************ble shutter event**********************/
+ble_shutter_process_baseband_connect:
+	call shutter_stop_bluetooth_discovery
+	setarg 0
+	store 2,mem_ble_shutter_reconn_timer
+	branch app_led_off
+
+
+ble_shutter_process_baseband_disconnect:
+	call queue_init
+	jam 0,mem_ble_shutter_enable_notify
+	branch shutter_start_reconnect
+
+
+ble_shutter_process_reconnect_complete:
+	call queue_init
+	jam 1,mem_ble_shutter_enable_notify
+	fetch 8,mem_ble_shutter_interval_min
+	store 8,mem_le_interval_min
+	call app_lpm_mult_enable
+	branch le_l2cap_tx_update_req
+
+
+ble_shutter_process_parse_connect_parameter_update_response:
+	fetch 2,mem_le_l2cap_signaling_conn_param_update_rsp_result
+	rtneq BLE_SIGNALING_CONNECT_PARAMETER_UPDATE_ACCEPTED
+	fetch 8,mem_ble_shutter_interval_min_new
+	rtn blank
+	store 8,mem_le_interval_min
+	branch le_l2cap_tx_update_req
+/**************************************/
+
+/******************soft swtich event**********************/
+shutter_process_soft_swtich_button_long_press:
+	branch ui_soft_switch_botton_long_press
+
+shutter_process_soft_swtich_button_down:
+	fetch 1,mem_shutter_hard_soft_switch_case
+	rtneq HARD_SWITCH
+	fetch 1,mem_shutter_soft_switch_power_state
+	rtnne SS_STATE_POWER_ON
+	call shutter_store_currenct_led_state
+	branch app_led_on
+	
+shutter_store_currenct_led_state:
+	jam 1,mem_shutter_soft_swtich_botton_down
+	arg 11,loopcnt
+	arg mem_shutter_soft_swtich_led_struct_temp,contw
+	arg mem_shutter_led_struct_app_led,contr
+	branch memcpy
+	
+shutter_process_soft_swtich_button_up:
+	fetch 1,mem_shutter_hard_soft_switch_case
+	rtneq HARD_SWITCH
+	fetch 1,mem_shutter_soft_switch_power_state
+	beq SS_STATE_POWER_ON,shutter_load_currenct_led_state
+	branch ui_soft_switch_botton_up
+
+shutter_load_currenct_led_state:
+	fetch 1,mem_shutter_soft_swtich_botton_down
+	rtnne 1
+	jam 0,mem_shutter_soft_swtich_botton_down
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_CONNECTED,app_led_off
+	bbit1 UI_STATE_BLE_CONNECTED,app_led_off
+	arg 11,loopcnt
+	arg mem_shutter_soft_swtich_led_struct_temp,contr
+	arg mem_shutter_led_struct_app_led,contw
+	branch memcpy
+	
+/**************************************/
+
+
+shutter_le_bb_event_timer:
+/**************shutter check sleep timer**********************/
+	call shutter_check_sleep_timer
+/************************************/
+/**************soft reset power off timer**********************/
+	call shutter_check_power_off_timer
+/************************************/
+
+ifdef CLASSIC_SHUTTER_FUCTION
+/**************classic shutter timer**********************/
+	call classic_shutter_check_unplug_timer
+	call classic_shutter_hid_handshake_timer
+	call classic_shutter_hid_disconn_timer
+/************************************/
+endif
+/**************ble shutter timer**********************/
+	branch ble_shutter_reconn_timer
+/************************************/
+
+/**************shutter check sleep timer**********************/
+shutter_check_sleep_timer:
+	arg mem_shutter_sleep_timer,regc
+	arg shutter_sleep_timeout,regb
+	branch timer_single_step_2B
+shutter_sleep_timeout:
+	jam SS_STATE_POWER_OFF,mem_shutter_soft_switch_power_state
+	call app_led_off
+	call shutter_disconnect_current_connection
+	branch shutter_wait_power_off
+
+/**************soft reset power off timer**********************/
+shutter_check_power_off_timer:
+	arg mem_shutter_power_off_timer,regc
+	arg shutter_check_power_off_timeout,regb
+	branch timer_single_step
+
+shutter_check_power_off_timeout:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,shutter_wait_power_off
+	bbit1 UI_STATE_BT_CONNECTED,shutter_wait_power_off
+	fetch 1,mem_shutter_led_struct_app_led_type
+	beq UI_LED_STATE_BLINK_START,shutter_wait_power_off
+	beq UI_LED_STATE_BLINK_LIGHTING,shutter_wait_power_off
+	beq UI_LED_STATE_BLINK_DARKING,shutter_wait_power_off
+	branch app_enter_hibernate
+/************************************/
+ifdef CLASSIC_SHUTTER_FUCTION
+/**************classic shutter timer**********************/
+classic_shutter_check_unplug_timer:
+	arg mem_classic_shutter_cable_unplug_conut,regc
+	arg classic_shutter_unplug_timeout,regb
+	branch timer_single_step
+	
+classic_shutter_unplug_timeout:
+	fetch 1,mem_CONTROL_tasks
+	set1  L2CAP_DISCONNECT_INTERRUPT, pdata
+	set1  L2CAP_DISCONNECT_CONTROL, pdata
+	store 1,mem_CONTROL_tasks	
+	rtn
+
+classic_shutter_hid_handshake_timer:
+	arg mem_hid_handshake_timer_count,regc
+	arg classic_shutter_process_hid_handshake,regb
+	branch timer_single_step
+
+classic_shutter_hid_disconn_timer:
+	arg mem_classic_shutter_hid_disconn_count,regc
+	arg app_bt_disconnect,regb
+	branch timer_single_step
+
+/************************************/
+endif
+/**************ble shutter timer**********************/
+ble_shutter_reconn_timer:
+	fetch 1,mem_shutter_soft_switch_power_state
+	rtnne SS_STATE_POWER_ON
+	arg mem_ble_shutter_reconn_timer,regc
+	arg shutter_start_bluetooth_discovery,regb
+	branch timer_single_step_2B
+/************************************/
+
+shutter_process_idle:
+	call shutter_send_data_to_master
+	branch keyscan_key_process
+
+
+shutter_process_lpm_before:
+	call gpio_set_before_lpm
+	branch keyscan_process_lpm_before
+
+shutter_le_before_hibernate:
+	call gpio_set_before_lpm
+	branch disable_authrom
+
+//////////////////////////////////////////////////////////////////////////////////////////
+
+
+/****************shutter bluetooth control**********************/
+shutter_stop_bluetooth_discovery:
+	fetch 1,mem_shutter_bluetooth_type
+ifdef CLASSIC_SHUTTER_FUCTION	
+	bbit1 CLASSIC_SHUTTER,classic_shutter_stop_bluetooth_discovery
+endif	
+	bbit1 BLE_SHUTTER,ble_shutter_stop_bluetooth_discovery
+	rtn
+
+ble_shutter_stop_bluetooth_discovery:
+	fetch 2,mem_ble_shutter_connect_timeout
+	store 2,mem_shutter_sleep_timeout
+	store 2,mem_shutter_sleep_timer
+	branch app_ble_stop_adv
+	
+ifdef CLASSIC_SHUTTER_FUCTION	
+classic_shutter_stop_bluetooth_discovery:
+	fetch 2,mem_classic_shutter_connect_timeout
+	store 2,mem_shutter_sleep_timeout
+	store 2,mem_shutter_sleep_timer
+	branch app_bt_stop_discovery
+endif
+
+shutter_start_bluetooth_discovery:
+	fetch 1,mem_shutter_soft_switch_power_state
+	rtnne SS_STATE_POWER_ON
+	fetch 1,mem_shutter_bluetooth_type
+ifdef CLASSIC_SHUTTER_FUCTION	
+	bbit1 CLASSIC_SHUTTER,classic_shutter_start_discovery
+endif
+	bbit1 BLE_SHUTTER,ble_shutter_start_discovery
+	rtn
+ifdef CLASSIC_SHUTTER_FUCTION
+classic_shutter_start_discovery:
+	fetch 2,mem_classic_shutter_discovery_timeout,
+	store 2,mem_shutter_sleep_timeout
+	store 2,mem_shutter_sleep_timer
+	branch app_bt_start_discovery_short
+endif
+ble_shutter_start_discovery:
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_CONNECTED
+	fetch 2,mem_ble_shutter_discovery_timeout
+	store 2,mem_shutter_sleep_timeout
+	store 2,mem_shutter_sleep_timer
+	fetch 2,mem_ble_shutter_discovery_adv_interval
+	call shutter_ble_adv_interval_set
+	call app_led_start_blink
+	fetch 4,mem_ble_shutter_discovery_blink_on_time
+	store 4,mem_shutter_led_struct_app_led_on_time
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_ADV
+	branch app_ble_start_adv
+
+
+shutter_start_reconnect:
+	fetch 1,mem_shutter_soft_switch_power_state
+	rtnne SS_STATE_POWER_ON
+	fetch 1,mem_shutter_bluetooth_type
+ifdef CLASSIC_SHUTTER_FUCTION	
+	bbit1 CLASSIC_SHUTTER,classic_shutter_start_reconnect
+endif
+	bbit1 BLE_SHUTTER,ble_shutter_start_reconnect
+	rtn
+ifdef CLASSIC_SHUTTER_FUCTION
+classic_shutter_start_reconnect:
+	call app_check_reconn_target
+	branch shutter_start_bluetooth_discovery,blank
+	call app_led_on	
+	call app_bt_stop_discovery
+	branch app_bt_start_reconnect	
+endif
+ble_shutter_start_reconnect:
+	fetch 2,mem_ble_shutter_reconn_timer
+	fetcht 2,mem_ble_shutter_reconn_timeout
+	storet 2,mem_ble_shutter_reconn_timer
+	nrtn blank
+	fetch 2,mem_ble_shutter_reconn_adv_interval
+	call shutter_ble_adv_interval_set
+	call app_led_start_blink
+	fetch 4,mem_ble_shutter_reconn_blink_on_time
+	store 4,mem_shutter_led_struct_app_led_on_time
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_ADV
+	branch app_ble_start_adv
+
+shutter_disconnect_current_connection:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,app_ble_disconnect
+ifdef CLASSIC_SHUTTER_FUCTION
+	bbit1 UI_STATE_BT_CONNECTED,app_bt_disconnect
+endif
+	branch shutter_stop_bluetooth_discovery
+/**************************************/
+ifdef CLASSIC_SHUTTER_FUCTION
+/******************classic shutter load reconnect*********************/
+app_check_reconn_target:
+	fetch 1,mem_nv_data_number
+	copy pdata,loopcnt
+	fetch 2,mem_nv_data_ptr
+	copy pdata,rega
+app_check_reconn_target_loop:
+	ifetch 2,rega
+	beq 0,found_reconn_device
+	increase NV_DATA_LEN,rega
+	loop app_check_reconn_target_loop
+	branch enable_blank
+
+found_reconn_device:
+	ifetch 6,contr
+	store 6,mem_hci_plap
+	increase 10,contr
+	arg mem_link_key,contw
+	call  memcpy16
+	call check_link_key_load
+	branch disable_blank
+	
+/**************************************/
+endif
+/////////////////////////////////////////////////////////////////////////
+//output:if user is enable,mean,can send data
+shutter_check_data_enable:
+	call disable_user
+	fetch 2,mem_ui_state_map
+ifdef CLASSIC_SHUTTER_FUCTION
+	bbit1 UI_STATE_BT_CONNECTED,shutter_check_bt_data_enable
+endif
+	bbit1 UI_STATE_BLE_CONNECTED,shutter_check_ble_data_enable
+	rtn
+
+ifdef CLASSIC_SHUTTER_FUCTION
+shutter_check_bt_data_enable:
+	fetch 1,mem_hid_interrupt_state
+	rtnne 0x3f	
+	branch enable_user
+endif	
+
+shutter_check_ble_data_enable:
+	fetch 1,mem_ble_shutter_enable_notify
+	rtn blank
+	branch enable_user
+/////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////
+//output:if user is enable,mean,bluetooth disconnect
+shutter_check_bluetooth_conn:
+	call disable_user
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BT_CONNECTED
+	rtnbit1 UI_STATE_BLE_CONNECTED
+	branch enable_user
+/////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////
+shutter_change_bluetooth_status_bt_disconn:
+	fetch 1,mem_shutter_bluetooth_type
+ifdef CLASSIC_SHUTTER_FUCTION
+	bbit1 CLASSIC_SHUTTER,classic_shutter_change_bluetooth_status_bt_disconn
+endif
+	bbit1 BLE_SHUTTER,ble_shutter_change_bluetooth_status_bt_disconn
+	rtn
+ifdef CLASSIC_SHUTTER_FUCTION	
+classic_shutter_change_bluetooth_status_bt_disconn:
+	fetch 1,mem_scan_mode
+	rtnne 0x03
+	branch shutter_start_reconnect
+endif
+ble_shutter_change_bluetooth_status_bt_disconn:
+	branch shutter_start_reconnect
+
+/////////////////////////////////////////////////////////////////////////
+
+shutter_check_send_data:
+	disable user2
+	fetch 2,mem_shutter_sleep_timeout
+	store 2,mem_shutter_sleep_timer
+
+	call shutter_check_bluetooth_conn
+	branch shutter_change_bluetooth_status_bt_disconn,user
+	
+	call shutter_check_data_enable
+	nrtn user
+	enable user2
+	rtn
+
+//queue = key index
+//rega =1 press, =0 release
+shutter_key_change:
+	call shutter_check_send_data
+	nrtn user2
+	deposit rega
+	branch shutter_key_release,blank
+shutter_key_press:
+	call app_led_on
+	arg mem_key0_press,regc
+	branch push_queue_press_or_release
+
+shutter_key_release:
+	call app_led_off
+	arg mem_key0_release,regc
+
+push_queue_press_or_release:
+	arg MAX_QUEUE_NUM,pdata
+	imul32 queue,pdata
+	iadd regc,regc
+	
+//input:regc the address that want push to queue buffer
+push_buffer_in_queue:
+	ifetch 1,regc
+	rtn blank
+	call queue_push_one_byte
+	increase 1,regc
+	branch push_buffer_in_queue
+
+
+shutter_send_data_to_master:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,pop_queue_to_ble_data
+ifdef CLASSIC_SHUTTER_FUCTION	
+	bbit1 UI_STATE_BT_CONNECTED,pop_queue_to_classic_data
+endif
+	rtn
+
+pop_queue_to_ble_data:
+	call le_fifo_check_nearly_full
+	nrtn blank
+	call queue_pop_one_byte
+	nrtn user
+	pincrease -1
+	mul32 pdata,SHUTTER_BLE_DATA_BUFFER,pdata
+	arg mem_ble_data_buffer1,temp
+	iadd temp,contr
+	branch le_send_notify_from_list
+
+ifdef CLASSIC_SHUTTER_FUCTION
+pop_queue_to_classic_data:
+	call l2cap_malloc_is_fifo_nearly_full
+	nrtn blank
+	call queue_pop_one_byte
+	nrtn user
+	pincrease -1
+	mul32 pdata,SHUTTER_CLASSIC_DATA_BUFFER,pdata
+	arg mem_classic_data_buffer1,temp
+	iadd temp,contr
+	ifetch 5,contr
+	store 5,mem_classic_data_buffer
+classic_send_hid_data:
+	fetch 1,mem_classic_data_buffer
+	copy pdata,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0xa1
+	istore 1,contw
+	fetch 4,mem_classic_data_buffer + 1
+	istore 9,contw
+	rtn
+endif
+///////////queue function////////////
+//input:pdata is data that want push
+queue_push_one_byte:
+	store 1,mem_pdatatemp
+	arg mem_pdatatemp,rega
+	branch queue_push
+
+queue_pop_one_byte:
+	arg mem_pdatatemp,rega
+	call queue_pop
+	nrtn user
+	fetch 1,mem_pdatatemp
+	rtn
+
+///////////queue function ending////////////
+ble_shutter_receive_data:
+	fetch 2,mem_le_att_handle
+	beq GATT_KEYBOARD_WRITE_HANDLE,ble_shutter_process_reconnect_complete
+	rtn
+
+shutter_init_param:
+	setarg 0x02
+	store 1,mem_shutter_power_off_timeout
+/////////////ble connect interval//////////////
+	setarg 0x00200008
+	store 4,mem_ble_shutter_interval_min		//set min interval is 10ms,set max interval is 40ms
+	setarg 0x012c0005
+	istore 4,contw
+///////////////////////////////////////
+//////////////////MTU/////////////
+	jam 0x17,mem_le_local_mtu
+///////////////////////////////////////
+////////////////justwork/////////
+	setarg 0x1b
+ 	store 2,mem_le_pairing_handle
+ 	call le_set_config_fixed_ltk
+	call le_set_fixed_ltk
+	call le_set_justwork
+	branch le_set_config_read_authentication
+///////////////////////////////////////
+
+shutter_load_buffer_config_form_DataRom:
+///////load data Rom/////////
+ifdef CLASSIC_SHUTTER_FUCTION	
+	arg BT_KEY_VALUE_LIST_SIZE,loopcnt
+	arg mem_classic_data_buffer1,contw
+	arg CLASSIC_SHUTTER_KEY_VALUE_LIST,contr
+	call memcpy_fast
+endif
+	arg BLE_KEY_VALUE_LIST_SIZE,loopcnt
+	arg mem_ble_data_buffer1,contw
+	arg BLE_SHUTTER_KEY_VALUE_LIST,contr
+	branch memcpy_fast
+
+shutter_load_ble_gatt_form_DataRom:
+	arg BLE_GATT_LIST_SIZE,loopcnt
+	arg BLE_SHUTTER_GATT_LIST,contr
+	branch memcpy_fast
+
+ifdef CLASSIC_SHUTTER_FUCTION
+shutter_load_bt_sdp_form_DataRom:
+	arg BT_SDP_LIST_SIZE,loopcnt
+	arg CLASSIC_SHUTTER_SDP_LIST,contr
+	branch memcpy_fast
+
+shutter_load_bluetooth_config_store_name:
+	fetch 1,mem_shutter_config_data_temp
+	copy pdata,loopcnt
+	store 1,mem_le_name_len
+	call memcpy_fast
+	fetch 1,mem_shutter_config_data_temp
+	copy pdata,loopcnt
+	store 1,mem_local_name_length
+	call memcpy_fast
+	ifetch 1,contr
+	store 1,mem_shutter_key_num
+	ifetch 1,contr
+	store 1,mem_shutter_hard_soft_switch_case
+	rtn
+
+shutter_load_bluetooth_config_by_eeprom:
+	fetch 1,mem_shutter_bluetooth_type
+	rtnbit0 CLASSIC_SHUTTER
+	arg 3,temp
+	fetch 2,mem_shutter_config_eeprom_offset_addr
+	copy pdata,regb
+	arg mem_shutter_config_eeprom_start_flag,rega
+	call iicd_read_eep_data
+	fetcht 2,mem_shutter_config_eeprom_start_flag
+	setarg SHUTTER_EEPROM_CONFIG_CRC
+	isub temp,null
+	nrtn zero
+	fetch 1,mem_shutter_config_user_size
+	rtn blank
+	copy pdata,temp
+	fetch 2,mem_shutter_config_eeprom_offset_addr
+	add pdata,3,regb
+	arg mem_shutter_config_data_temp,rega
+	call iicd_read_eep_data
+	branch shutter_store_config
+
+shutter_store_config:
+	call shutter_load_bluetooth_config_store_name
+shutter_load_bluetooth_config_custom:
+	ifetch 2,contr
+	rtn blank
+	copy pdata,contw
+	ifetcht 1,contr
+	copy temp,loopcnt
+	call memcpy
+	branch shutter_load_bluetooth_config_custom
+///////////////////////////////////////////////////////////////////
+
+//////////////////////////random mac address//////////////////////////////
+shutter_random_mac_addr:
+	fetch 1,mem_shutter_bluetooth_type
+	rtnbit0 CLASSIC_SHUTTER
+	fetch 2,mem_classic_shutter_random_mac_offset_addr
+	rtn blank
+	copy pdata,regb
+	arg 4,temp
+	arg mem_shutter_random_mac_data_temp,rega
+	call iicd_read_eep_data
+	fetch 1,mem_shutter_random_mac_data_temp
+	bne 1,shutter_write_random_mac_addr_to_eeprom
+	branch shutter_write_random_mac_addr
+shutter_write_random_mac_addr_to_eeprom:
+	setarg 1
+	store 1,mem_shutter_random_mac_data_temp
+	force 3,loopcnt
+	call generate_random_loop
+	fetch 2,mem_classic_shutter_random_mac_offset_addr
+	copy pdata,regb
+	arg 4,temp
+	arg mem_shutter_random_mac_data_temp,rega
+	call iicd_write_eep_data
+shutter_write_random_mac_addr:
+	fetch 3,mem_shutter_random_mac_data_temp + 1
+	store 3,mem_lap
+	store 3,mem_le_lap
+	rtn
+endif
+	
+/////////////////////////////////////////////////////////////////
+shutter_soft_swtich_power_on:
+	branch shutter_start_reconnect
+
+
+shutter_soft_swtich_power_off:
+	arg 0,rega
+	arg mem_shutter_power_off_led_style,regc
+	call ui_led_set_style_global
+	call shutter_disconnect_current_connection
+shutter_wait_power_off:
+	fetch 1,mem_shutter_power_off_timeout
+	store 1,mem_shutter_power_off_timer
+	rtn
+	
+
+/*************soft swtich ui config*********************/
+ui_soft_swtich_init:
+	setarg SS_STATE_POWER_UP
+	call ui_soft_swtich_init_power_on_time
+	jam UI_BUTTON_STATE_UP,mem_ui_button_last_state
+	call ui_button_init
+	call ui_button_polling
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BTN_DOWN
+	branch app_enter_hibernate
+
+ui_soft_swtich_init_power_on_time:
+	fetcht 2,mem_power_param_ptr
+	istore 1,temp		//init power state 
+	ifetch 1,contw		//power on time
+	store 1,mem_ui_button_timeout
+	rtn
+
+
+ui_soft_switch_botton_up:
+	fetch 2,mem_power_param_ptr
+	ifetch 1,pdata
+	rtnne SS_STATE_POWER_UP
+	branch app_enter_hibernate
+
+
+ui_soft_switch_botton_long_press:
+	fetcht 2,mem_power_param_ptr
+	ifetch 1,temp
+	beq SS_STATE_POWER_ON,ui_soft_switch_power_off
+ui_soft_switch_power_on:
+	setarg SS_STATE_POWER_ON
+	fetcht 2,mem_power_param_ptr
+	istore 1,temp		//init power state 
+	add temp,SS_POWER_OFF_TIME,contr
+	ifetch 1,contr
+	istore 1,mem_ui_button_timeout
+	ifetch 2,contr
+	branch callback_func
+
+ui_soft_switch_power_off:
+	setarg SS_STATE_POWER_OFF
+	call ui_soft_swtich_init_power_on_time
+	add temp,SS_POWER_OFF_CB,contr
+	ifetch 2,contr
+	branch app_enter_hibernate,blank		//no call back function , just enter hibernate
+	branch callback_func
+	
+/*************soft swtich ui config ending*********************/
+
+//pdata:adv interval value
+shutter_ble_adv_interval_set:
+	store 2,mem_lpm_interval
+	increase -4,pdata
+	store 2,mem_le_adv_interval
+	rtn
+
+le_send_notify_from_list:
+	ifetch 1,contr	//length 
+	copy pdata,rega
+	ifetcht 2,contr	//handle
+	call store_contr
+	call le_att_malloc_tx_notify
+	copy rega,loopcnt
+	call get_contr
+	branch memcpy
+
+/*************shutter default_init starting*********************/
+shutter_default_init:
+	fetch 2,mem_shutter_key_conf0_temp
+	store 2,mem_shutter_key_conf0
+	fetch 1,mem_shutter_led_struct_app_led_gpio_temp
+	store 1,mem_shutter_led_struct_app_led_gpio
+	store 1,mem_shutter_power_off_led_style_gpio
+	fetch 1,mem_shutter_hard_soft_switch_case_temp
+	store 1,mem_shutter_hard_soft_switch_case
+	fetch 1,mem_shutter_soft_switch_button_gpio_temp
+	store 1,mem_shutter_soft_switch_button_gpio
+	jam 0x01,mem_shutter_bluetooth_type
+	setarg 0x0030
+	store 2,mem_classic_shutter_random_mac_offset_addr
+	setarg 0x0000
+	store 2,mem_shutter_config_eeprom_offset_addr
+	setarg 0x0001
+	store 2,mem_key0_press
+	store 2,mem_key1_press
+	setarg 0x0006
+	store 2,mem_key0_release
+	store 2,mem_key1_release
+	setarg 0x0007
+	store 2,mem_key2_press
+	setarg 0x0008
+	store 2,mem_key2_release
+	setarg mem_shutter_soft_switch_power_state
+	store 2,mem_power_param_ptr
+	setarg 0x201400
+	store 3,mem_shutter_soft_switch_power_state
+	jam 0x01,mem_lpm_mode
+	setarg 0x0100
+	store 2,mem_lpm_interval
+	jam 0x08,mem_lpm_overhead
+	jam 0x05,mem_lpm_mult
+	jam 0x02,mem_lpm_mult_timeout
+	setarg 0x0030
+	store 2,mem_sniff_param_interval
+	setarg 0x0001
+	istore 2,contw
+	jam 0x0a,mem_unsniff2sniff_timer
+	setarg 0x0096
+	store 2,mem_ble_shutter_reconn_blink_on_time
+	istore 2,contw
+	setarg 0x0296
+	store 2,mem_ble_shutter_discovery_blink_on_time
+	istore 2,contw
+	setsect 0,0x10
+	setsect 1,0x8008
+	setsect 2,0x2c000
+	setsect 3,0x04
+	store 8,mem_ble_shutter_interval_min_new
+	jam 0x01,mem_ui_led_struct_num
+	setarg mem_shutter_led_struct_app_led
+	store 2,mem_ui_led_struct_ptr
+	setarg 0x0000
+	store 2,mem_shutter_led_struct_app_led
+	setsect 0,0x1a0
+	setsect 1,0x68
+	setsect 2,0x00
+	setsect 3,0x00
+	store 8,mem_shutter_led_struct_app_led_on_time
+	setarg 0x0301
+	store 2,mem_shutter_power_off_led_style
+	setsect 0,0x1a0
+	setsect 1,0xe8
+	setsect 2,0x00
+	setsect 3,0x00
+	store 8,mem_shutter_power_off_led_style_on_time
+	setarg 0x000e
+	store 2,mem_ble_shutter_reconn_adv_interval
+	setarg 0x0140
+	store 2,mem_ble_shutter_discovery_adv_interval
+	store 2,mem_le_adv_interval
+	setarg 0x0050
+	store 2,mem_ble_shutter_reconn_timeout
+	jam 0x07,mem_le_adv_channel_map
+	jam 0x00,mem_le_adv_enable
+	setsect 0,0xfb
+	setsect 1,0x2c212
+	setsect 2,0x800f
+	setsect 3,0x21
+	store 8,mem_local_rx_max_octets
+	setsect 0,0xff00
+	setsect 1,0x3fc0
+	setsect 2,0xff0
+	setsect 3,0x3fc
+	store 8,mem_classic_shutter_discovery_timeout
+	setarg mem_queue_each_size
+	store 2,mem_queue_ptr
+	setarg 0x2001
+	store 2,mem_queue_each_size
+	jam 0x1f,mem_le_adv_data_len
+	setsect 0,0x10102
+	setsect 1,0x80c1
+	setsect 2,0x18120
+	setsect 3,0x640c
+	store 9,mem_le_adv_data
+	setsect 0,0x3c1
+	istore 2,contw
+	jam 0x1f,mem_le_scan_data_len
+	setsect 0,0x2090d
+	setsect 1,0x34c15
+	setsect 2,0x28532
+	setsect 3,0x1d1d5
+	store 9,mem_le_scan_data
+	setsect 0,0x26574
+	setsect 1,0x1c
+	istore 3,contw
+	setarg mem_shutter_keyscan
+	store 2,mem_keyscan_ptr
+	jam 0x02,mem_shutter_key_num
+	jam 0x17,mem_app_connection_options		//NVRAM CONFIG
+	setarg mem_shutter_nv_data
+	store 2,mem_nv_data_ptr
+	jam 0x05,mem_nv_data_number
+	setarg 0x2540
+	store 2,mem_class
+	setarg 0x040003
+	store 3,mem_lmp_io_cap_payload_iocap
+	jam 0x03,mem_ssp_mode_flag
+	jam 0x01,mem_ssp_enable
+	jam 0x01,mem_ui_profile_supported
+	jam 0x00,mem_ptt
+	setsect 0,0x3ffff
+	setsect 1,0x2fe23
+	setsect 2,0x199d9
+	setsect 3,0x20d
+	store 8,mem_features		//NVRAM CONFIG END
+	setarg 0x9af2	//BLE ATT LIST 
+	store 2,mem_ui_le_uuid_table	//BLE ATT LIST END
+	jam 0x01,mem_eir_enable	//BT SDP LIST
+	setsect 0,0x10306
+	setsect 1,0x4
+	setsect 2,0x2010
+	setsect 3,0x9040
+	store 9,mem_all_uuid_16bits
+	setsect 0,0x20011
+	setsect 1,0x44
+	istore 5,contw
+	jam 0x00,mem_all_uuid_128bits
+	setarg 0x9c70
+	store 2,mem_ui_uuid_table	//BT SDP LIST END
+	jam 0x18,mem_fcomp_div		//24M XTAL
+	branch app_sys_param_init
+	
+	
+
+/*************shutter default_init ending*********************/
+
+
+
+
+
+else
+	branch assert
+	
+endif
Index: program/ble_protocol_stack/le.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le.prog	(working copy)
@@ -0,0 +1,2002 @@
+ifdef COMPILE_LE
+//******************************************//
+//*************LE INIT ****************//
+//******************************************//
+
+le_init_conn:
+	bpatchx patch33_3,mem_patch33
+	disable wake
+	jam 1,mem_le_conn_handle
+	jam 3,mem_le_state
+	jam 1,mem_le_arq
+	setarg -1
+	store 2,mem_le_event_count
+	force 0,pdata
+	store 1,mem_le_ch
+	store 1,mem_le_op
+	store 3,mem_sniff_rcv
+	store 3,mem_sniff_lost
+	call le_clear_enc
+	jam 1,mem_le_txheader
+	jam 0,mem_le_txlen
+	jam FUN_RX_LL_1M_PHY,mem_le_rx_phy
+	jam FUN_TX_LL_1M_PHY,mem_le_tx_phy
+	jam 0,mem_le_l2cap_att_states
+	branch le_supervision_flush
+
+le_init_master:
+	bpatchx patch33_4,mem_patch33
+	enable master
+	jam lemode_master,mem_le_mode
+	jam 1,mem_le_att_handle
+	jam 1,mem_le_search_handle_start
+	setarg 0xffff
+	store 2,mem_le_search_handle_end
+	force 0,pdata
+	store 5,mem_ccm_pcnt_rx
+	set1 LE_CCM_DIRECTIONBIT,pdata
+	store 5,mem_ccm_pcnt_tx	
+	branch le_init_conn
+
+
+le_init_slave:
+	bpatchx patch33_5,mem_patch33
+	disable master
+ 	setarg 0x17
+ 	store 2,mem_le_remote_mtu
+	increase 4,pdata
+	store 2,mem_remote_rx_max_octets
+	jam lemode_slave,mem_le_mode
+	jam 0,mem_le_adv_enable
+	jam 0,mem_lpm_current_mult
+	call le_clear_pairing_state
+	fetch 2,mem_le_superto
+	store 2,mem_le_init_superto
+	fetch 2,mem_le_tsniff
+	mul32 pdata,5,pdata
+	rshift4 pdata,pdata
+	store 2,mem_le_superto			// vol.6 part B 4.5.2 only 6*conninterval before establish
+	branch le_init_conn
+	
+
+//******************************************//
+//*************LE main process*********//
+//******************************************//
+
+le_conn_dispatch:
+	bpatchx patch33_6,mem_patch33
+	call le_enable
+ 	fetch 1,mem_le_state
+ 	isolate1 lestate_encryption,pdata
+ 	setflag true,mark_ble_encryption,mark
+	call app_process_ble
+	fetch 1,mem_le_mode
+	bbit1 mode_master,le_master_dispatch
+	branch le_slave_dispatch
+	
+//******************************************//
+//***********LE master process*********//
+//******************************************//
+	
+le_master_dispatch:
+	bpatchx patch33_7,mem_patch33
+	enable master
+	call le_supervision_update
+	branch le_master_disconn,positive
+	call le_setup
+	call le_prepare_tx
+	disable match
+	call le_transmit_receive_sifs
+	nrtn match
+	fetch 1,mem_le_conn_rcv
+	increase 1,pdata
+	store 1,mem_le_conn_rcv
+	call le_acknowledge
+	disable master
+	rtn
+	
+le_master_disconn:
+	call le_disconnect
+	disable master
+	rtn
+	
+//******************************************//
+//***********LE slave process***********//
+//******************************************//
+le_slave_dispatch:
+	bpatchx patch34_0,mem_patch34
+	jam 0,mem_le_md_count
+	set0 mark_ble_crc_fail,mark
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256
+	call le_secure_connect_sm
+endif
+	disable attempt
+	call le_supervision_update
+	branch le_slave_disconn,positive
+	fetch 1,mem_le_rx_phy
+	call le_enable_phy_by_pdata
+	call le_setup
+	call le_receive_slave
+	nbranch le_slave_unsync,sync	// vol.6 part B 4.5.1 respond even crc error
+	call le_got_first_packet
+	branch le_slave_match,match
+	bmark1 mark_ble_crc_fail,le_slave_crc_fail
+	branch le_slave_cont
+	
+
+le_slave_crc_fail:
+le_slave_match:
+	bpatchx patch34_1,mem_patch34
+	fetch 1,mem_le_md_count
+	pincrease 1
+	store 1,mem_le_md_count
+	beq LE_MD_MAX_COUNT,le_slave_cont
+	call le_acknowledge
+	call le_prepare_tx
+	fetch 1,mem_le_tx_phy
+	call le_enable_phy_by_pdata
+	call le_transmit_norx
+	call le_parse
+	fetch 2,mem_cb_ble_transmit
+	call callback_func
+	call le_check_md
+	branch le_slave_more_data,user
+le_slave_cont:
+	bpatchx patch34_2,mem_patch34
+	call le_pairing_sm
+ 	call le_check_paring_time
+	call check_51cmd
+	fetch 1,mem_le_op
+	bbit1 op_disconn,le_slave_disconn
+le_slave_unsync:
+	bpatchx patch34_3,mem_patch34
+	call le_lpm_set_mult
+	branch calc_clke_offset
+
+
+le_check_md:
+	disable user
+	bmark1 mark_ble_rx_md,enable_user
+	bmark1 mark_ble_tx_md,enable_user
+	bmark1 mark_ble_crc_fail,enable_user
+	rtn
+
+
+le_slave_more_data:
+	bpatchx patch34_4,mem_patch34
+	enable attempt
+	call le_transmit_receive_sifs_notx
+	branch le_slave_match,match
+	bmark1 mark_ble_crc_fail,le_slave_crc_fail
+	branch le_slave_cont
+
+le_slave_disconn:
+
+	//fall through
+le_disconnect:
+	bpatchx patch34_5,mem_patch34
+	call le_clear_connection_info
+	call app_disconn_reason_collect_ble
+ifdef SECURE_CONNECTION
+	call le_clear_pairing_state
+	call le_sc_state_clear
+endif
+	jam BT_EVT_LE_DISCONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event
+
+le_clear_connection_info:
+	arg mem_used_map,contw
+	call memset0_16
+	jam 0,mem_le_conn_handle
+	jam lemode_idle,mem_le_mode
+	jam 0,mem_le_state
+le_clear_pairing_state:
+	bpatchx patch34_6,mem_patch34
+	jam FLAG_LE_ENC_NULL,mem_le_enc_state
+	jam FLAG_LE_PAIRING_NULL,mem_le_pairing_state
+	branch sp_clear_flags
+	
+le_got_first_packet:
+	bpatchx patch34_7,mem_patch34
+	fetch 1,mem_le_conn_rcv
+	increase 1,pdata
+	store 1,mem_le_conn_rcv
+	fetch 1,mem_le_state
+	rtnbit1 lestate_got_first_packet
+	set1 lestate_got_first_packet,pdata
+	store 1,mem_le_state
+	fetch 2,mem_le_init_superto
+	store 2,mem_le_superto
+	setarg 0
+	store 4,mem_le_transmit_window
+	rtn
+
+
+//input: pdata is phy mode
+//bit0 is le 1M phy
+//bit1 is le 2M phy
+//bit2 is le coded phy s2
+//bit7 is le coded phy s8
+le_enable_phy_by_pdata:
+	copy pdata,temp
+	bpatchx patch35_0,mem_patch35
+	copy temp,pdata
+	bbit1 BIT_LE_1M_PHY,le_enable
+	bbit1 BIT_LE_2M_PHY,le_enable_2M
+	bbit0 BIT_LE_CODED_PHY,le_enable
+	bbit1 BIT_LE_CODED_PHY_S8,le_enable_coded_s8
+	bbit1 BIT_LE_CODED_PHY_S2,le_enable_coded_s2
+	branch le_enable
+
+le_enable_2M:
+	call le_enable
+	set1 mark_ble_2M,mark
+	set0 mark_ble_lr,mark
+	jam 0x03,0x8901
+	jam 0x84,0x8920
+	rtn
+
+le_enable_coded_s2:
+le_enable_coded:
+	call le_enable
+	set1 mark_ble_lr,mark
+	set0 mark_ble_lr_s8,mark
+	jam 0x05,0x8901
+	jam 0x80,0x8920
+	jam 0x20,0x8930
+	jam 0x0a,0x8934
+	rtn
+
+le_enable_coded_s8:
+	call le_enable_coded
+	set1 mark_ble_lr_s8,mark
+	rtn
+
+le_enable:
+	bpatchx patch35_1,mem_patch35
+	enable le
+	set0 mark_ble_2M,mark
+	set0 mark_ble_lr,mark
+	jam 0x01,0x8901
+	jam 0x80,0x8920
+	jam 0xa7,0x8925
+	jam 0x03,0x8930
+	jam 0x58,0x8933
+	jam 0x0a,0x8934
+	jam 0x40,0x8937
+	jam 9,core_rx_bq_cfg0
+	rtn
+
+
+le_disable:
+	bpatchx patch35_2,mem_patch35
+	disable le
+	set0 mark_ble_encryption,mark
+	jam 0x00,0x8901
+	jam 0x80,0x8920
+	jam 0xa3,0x8925
+	jam 0x03,0x8930
+	jam 0x68,0x8933
+	jam 0x09,0x8934
+	jam 0x28,0x8937
+	jam 9,core_rx_bq_cfg0
+	rtn
+	
+le_prep:
+	disable enable_crc
+	disable enable_white
+	fetch 3,mem_le_crcinit
+	iforce crc24_init
+	fetch 1,mem_le_ch_mapped
+	reverse pdata,temp
+	set1 1,temp
+	rshift temp,white_init
+	rtn
+	
+
+le_rx_setfreq:
+	call le_setfreq
+le_rf_rx_enable:	
+	call set_freq_rx
+	fetch 2,mem_param_pll_setup
+	call sleep
+	branch rf_rx_enable
+
+le_tx_setfreq:
+	branch txon,match
+	bmark1 mark_ble_crc_fail,txon
+le_tx_setfreq0:
+	call le_setfreq
+	branch set_freq_tx
+le_setfreq:
+	bpatchx patch35_3,mem_patch35
+	call set_sync_on
+	fetch 1, mem_le_testtype
+	nbranch le_ctf_test,blank
+	fetch 1,mem_le_ch_mapped
+	sub pdata,36,null
+	branch le_ctf_normal,positive
+	force 0,temp
+	rtneq 37
+	force 24,temp
+	rtneq 38
+	force 78,temp
+	rtn
+	
+le_ctf_normal:
+	sub pdata,10,null
+	branch le_ctf_low,positive
+	increase 1,pdata
+	
+le_ctf_low:	
+	lshift pdata,pdata
+	add pdata,2,temp
+	rtn
+	
+le_ctf_test:
+	fetch 1,mem_le_ch_mapped
+	lshift pdata,temp
+	rtn
+
+le_sca_map:
+	arg 500,temp
+	rtn blank
+	arg 250,temp
+	rtneq 1
+	arg 150,temp
+	rtneq 2
+	arg 100,temp
+	rtneq 3
+	arg 75,temp
+	rtneq 4
+	arg 50,temp
+	rtneq 5
+	arg 40,temp
+	rtneq 6
+	arg 20,temp
+	rtn
+
+
+	
+le_setup:
+	bpatchx patch35_4,mem_patch35
+	enable swfine
+	fetch 4,mem_le_access
+	iforce access
+	call calc_mod_value_scale_le
+	call le_map_channel
+	setarg 0x200
+	branch le_setup_master,master
+	fetch 2,mem_le_receive_window
+	rshift pdata,pdata
+le_setup_master:
+	fetcht 2,mem_param_pll_setup
+	iadd temp,pdata
+	call ahead_window
+	deposit clke
+	rtn
+
+
+le_context_nextevent:
+	bpatchx patch35_5,mem_patch35
+	call push_stack_rega_b_c
+	storer loopcnt ,2,mem_loopcnt
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	rtnbit0 mode_le
+	add rega,coffset_le_event_cnt,contw
+	ifetch 2,contw
+	increase 1,pdata
+	istore 2,contw
+	call le_update_param
+	call le_update_channel_map
+	call le_update_phy	
+	call le_context_nexthop
+	call pop_stack_rega_b_c
+	fetchr loopcnt ,2,mem_loopcnt
+	rtn
+	
+le_context_nexthop:	
+	add rega,coffset_le_hop,contr
+	ifetch 1,contr
+	add rega,coffset_le_ch,contw
+	ifetcht 1,contw
+	iadd temp,pdata
+	sub pdata,36,null
+	branch le_nexthop_nowrap,positive
+	increase -37,pdata
+le_nexthop_nowrap:
+	istore 1,contw
+	rtn
+
+//input rega
+le_calc_channel_map:
+	add rega,coffset_le_channel_map,contr
+	ifetch 5,contr
+	force 0,temp
+	force 37,loopcnt
+le_count_channels_loop:
+	bbit0 0,le_count_channels_notused
+	increase 1,temp
+le_count_channels_notused:
+	rshift pdata,pdata
+	loop le_count_channels_loop
+	add temp,-1,pdata
+	add rega,coffset_le_channels,contw
+	istore 1,contw
+	rtn
+
+le_map_channel:
+	bpatchx patch35_6,mem_patch35
+	fetch 1,mem_le_ch
+	iforce queue
+	fetcht 5,mem_le_channel_map
+	qisolate1 temp
+	branch le_map_channel_end,true
+le_map_channel_next:
+	fetch 1,mem_le_channels
+	isub queue,pdata
+	branch le_map_channel_cont,positive
+	sub pdata,-1,queue
+	branch le_map_channel_next
+le_map_channel_cont:
+	copy queue,loopcnt
+	force 0,queue
+le_map_channel_loop:
+	qisolate1 temp
+	branch le_map_channel_skip,true
+	increase 1,loopcnt
+le_map_channel_skip:
+	deposit loopcnt
+	branch le_map_channel_end,blank
+	increase 1,queue
+	increase -1,loopcnt
+	branch le_map_channel_loop
+le_map_channel_end:
+	deposit queue
+	store 1,mem_le_ch_mapped
+	rtn
+
+
+le_wait_tx:
+	branch le_wait_master,master
+	until null,timeout
+	rtn
+	
+le_wait_master:
+	arg 0xea0,timeup
+	until clkn_rt,meet
+	rtn
+
+le_receive_adv:
+	disable swfine
+	fetch 2,mem_le_scan_window
+	copy pdata,timeup
+	branch le_receive_packet
+
+
+le_receive_slave:
+	bpatchx patch35_7,mem_patch35
+ 	call le_dec_init
+	enable swfine
+	fetch 2,mem_le_receive_window
+	fetcht 4,mem_le_transmit_window
+	iadd temp,timeup
+le_receive_packet:
+	call le_rx_setfreq
+le_receive_rxon:
+	bpatchx patch36_0,mem_patch36
+	call le_prep
+	bmark0 mark_ble_lr,le_receive_nolr
+	pulse dewhiten_code_calc
+	nop 30
+	call le_prep
+	lshift3 timeup,timeup
+le_receive_nolr:
+	disable match
+	enable decode_fec0
+	enable is_rx
+	disable is_tx
+	copy timeup,stop_watch
+	correlate null,timeout
+	branch le_receive_on_attempt,attempt
+	copy clke,temp
+	storet 6,mem_sync_clke
+le_receive_on_attempt:
+	nbranch le_unsync_end,sync
+	bpatchx patch36_1,mem_patch36
+	enable swfine
+	arg PARAM_T_IFS_150US+PARAM_20MS_INIT+PARAM_SYNC_TIME_DIFFERENCE,stop_watch
+	fetch 1,mem_system_clk
+	imul32 stop_watch,stop_watch
+	call rf_debug_rx_sync_line	//L-H
+	branch le_receive_skip,attempt
+	call calc_clke_all_modem
+	fetch 1,mem_le_state
+	bbit0 lestate_got_first_packet,le_receive_skip
+	fetcht 6,mem_sync_clke
+	call lpm_adjust_clk,wake
+le_receive_skip:
+	call save_rssi
+	enable enable_white
+	enable enable_crc
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_le_rxbuf_data_header
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_le_rxbuf_data_length
+ 	copy pdata,loopcnt
+	branch le_rx_nopayload,zero
+
+	bmark1 mark_ble_encryption,le_rx_dec
+
+le_rx_loop:
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	loop le_rx_loop
+	branch le_rx_nopayload
+
+le_rx_dec: 
+	copy contw,regb
+	call le_check_retransmit	
+//	bmark1 mark_old_packet,le_retransmit_end_of_packet
+	fetchr rega, 1,mem_le_rxbuf_data_length
+	increase -4,rega
+	nbranch le_mic_error,positive
+//	storer rega, 1,mem_le_rxbuf_data_length
+	call le_dec_start	
+	copy regb,contw
+	arg 0,temp
+	fetchr loopcnt, 1,mem_le_rxbuf_data_length
+	increase -4,loopcnt
+	branch le_rx_dec_loop_end,zero
+le_rx_dec_loop:
+	
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	increase 1,temp
+	and temp,0xf,null
+	call le_dec,zero
+	loop le_rx_dec_loop
+le_rx_dec_loop_end:
+	call le_dec_end	
+	copy regb,contw
+	
+
+le_rx_nopayload:
+	bpatchx patch36_2,mem_patch36
+	parse demod,bucket,24	
+	rshift32 pdata,pdata
+	rshift16 pdata,pdata
+	istore 3,contw
+	enable swfine
+	call le_set_until_tx_timer
+	branch le_crc_fail,crc_failed
+	bmark0 mark_ble_encryption,le_rx_match
+	fetch 1,mem_le_rxbuf_data_length
+	branch le_rx_match,blank
+	increase -4,pdata
+	store 1,mem_le_rxbuf_data_length
+	call wait_ccm_done
+ 	fetch 1,core_misc_status
+	bbit0 7, le_mic_error
+ 	force regidx_result,regext_index
+	storer regext, 4,mem_le_peer_mic
+le_rx_match:
+	call rf_debug_rx_crc_line	//L
+	enable match
+	set0 mark_ble_crc_fail,mark
+le_crc_fail_tx:
+	call ccm_ctrl_clr
+	fetch 1,mem_le_rx_phy
+	nsetflag ble_coded_info,BIT_LE_CODED_PHY_S8,pdata
+	store 1,mem_le_rx_phy
+le_match_set_txfreq:
+	bpatchx patch36_3,mem_patch36
+	fetcht 1,mem_last_freq
+	add temp,2,rega
+	bmark1 mark_ble_2M,le_match_set_txfreq_offset
+	add temp,2,rega
+le_match_set_txfreq_offset:
+	disable decode_fec0
+	call set_sync_on	
+	branch rf_tx_write_freq				/* set frequency to tx mode freq */
+	
+
+le_dec_init:
+	rtnmark0 mark_ble_encryption
+	call load_sk
+	force regidx_result,regext_index
+	call aes_clear
+	branch aes_clear_data
+	
+	
+le_dec_start:
+	jam 0,core_ccm_aad0 
+	jam 1,core_ccm_aad1
+	fetch 1,mem_le_rxbuf_data_header
+	and_into 0x3,pdata
+	store 1,core_ccm_aad2
+	
+	setarg mem_le_rxbuf_data_payload
+	store 2,core_ccm_input_playload_addr
+	store 2,core_ccm_output_playload_addr
+
+	fetchr rega, 1,mem_le_rxbuf_data_length
+	increase -4,rega
+
+	fetcht 5,mem_ccm_pcnt_rx	
+	isolate1 mark_old_packet,mark
+	call le_pcnt_rx_sub1,true
+	call ccm_b0
+	setarg 0
+	store 2,core_ccm_inptr
+	jam 6,core_ccm_ctrl
+	jam 7,core_ccm_ctrl	
+	rtn	
+
+le_pcnt_rx_sub1:
+	sub temp,0,null
+	branch le_pcnt_rx_sub1_0,zero
+	increase -1,temp
+	set1 LE_CCM_DIRECTIONBIT,temp
+	rtn
+
+le_pcnt_rx_sub1_0:
+	setarg 0xffffff
+	lshift16 pdata,pdata
+	arg 0xffff,temp
+	ior temp,temp
+	rtn
+
+le_dec:
+	copy contw,regb
+	fetch 1,mem_le_rxbuf_data_length
+	increase -4,pdata
+	isub temp,null
+	rtn zero
+	storet 2,core_ccm_inptr
+	copy regb,contw
+	rtn
+	
+le_dec_end://mic
+	parse demod,bucket,32
+	rshift32 pdata,pdata
+	rshift8 pdata,pdata
+	istore 4,contw
+	copy contw,regb
+//	store 4,mem_le_peer_mic
+	force regidx_data,regext_index
+	copy  pdata,regext
+	storet 2,core_ccm_inptr
+	rtn
+
+le_mic_error:
+	branch le_end_of_packet
+
+le_retransmit_end_of_packet:
+	call le_set_until_tx_timer	// start SIFS timer after last bit of crc
+	call end_of_packet
+	branch le_rx_match
+
+le_crc_fail:
+	call rf_debug_rx_crc_fail_line
+	bmark1 mark_ble_crc_fail,le_crc_fail_consecutive //two consecutive packets received with an invalid CRC match within a connection event shall close the event
+	set1 mark_ble_crc_fail,mark
+	branch le_crc_fail_tx
+	
+le_unsync_end:	
+le_crc_fail_consecutive:
+	set0 mark_ble_crc_fail,mark
+	branch le_end_of_packet
+
+le_end_of_packet:
+	call ccm_ctrl_clr
+	branch end_of_packet
+	
+calc_clke_all_modem:
+	bmark1 mark_ble_lr,calc_clke_modem_coded
+	bmark1 mark_ble_2M,calc_clke_modem_2M
+	fetch 2,mem_param_clke_cal_le_1m
+	copy pdata,clke_rt
+	copy bt_clk,clke_bt
+	rtn
+
+
+calc_clke_modem_coded:
+	fetch 2,mem_param_clke_cal_le_coded
+	copy pdata,clke_rt
+	add bt_clk,1,clke_bt
+	rtn
+
+calc_clke_modem_2M:
+	fetch 2,mem_param_clke_cal_le_2m
+	copy pdata,clke_rt
+	copy bt_clk,clke_bt
+	rtn
+
+
+le_set_until_tx_timer:
+	fetch 1,mem_le_rxbuf_data_length
+	add pdata,5,temp	//PDU Length
+	lshift3 temp,temp	//PDU bit size
+	fetch 1,mem_le_rx_phy
+	bmark1 mark_ble_lr,le_set_until_tx_timer_rx_lr
+	bbit1 BIT_LE_1M_PHY,le_set_until_tx_timer_rx_1M
+	bbit1 BIT_LE_2M_PHY,le_set_until_tx_timer_rx_2M
+le_set_until_tx_timer_rx_lr:
+	branch le_set_until_tx_timer_rx_coded_s2,ble_coded_info
+	branch le_set_until_tx_timer_rx_coded_s8
+
+le_set_until_tx_timer_rx_1M:
+	branch le_calc_stop_watch
+
+le_set_until_tx_timer_rx_2M:
+	rshift temp,temp
+	branch le_calc_stop_watch
+
+le_set_until_tx_timer_rx_coded_s2:
+	add temp,3,temp	//term2
+	lshift temp,temp
+	branch le_set_until_tx_timer_rx_coded
+
+le_set_until_tx_timer_rx_coded_s8:
+	add temp,3,temp	//term2
+	lshift3 temp,temp
+le_set_until_tx_timer_rx_coded:
+	setarg PARAM_CODED_C1_TERM1_TIME_40US
+	iadd temp,temp
+	branch le_calc_stop_watch
+
+le_calc_stop_watch:
+	fetch 1,mem_system_clk
+	imul32 temp,temp		//mips cpu
+	arg PARAM_20MS_INIT,rega
+	imul32 rega,pdata
+	isub temp,temp
+	copy stop_watch,pdata
+	isub temp,stop_watch
+	rtn
+
+le_transmit_receive_sifs_without_change_mode:
+	call le_transmit
+	fetcht 1,mem_last_freq
+	call set_freq_rx
+	call rf_rx_enable
+	enable swfine
+	arg 5500,timeup
+	branch le_receive_rxon
+
+
+le_transmit_receive_sifs:
+	bpatchx patch36_4,mem_patch36
+	fetch 1,mem_le_tx_phy
+	call le_enable_phy_by_pdata
+	call le_transmit
+le_transmit_receive_sifs_notx:
+	fetch 1,mem_le_rx_phy
+	call le_enable_phy_by_pdata
+
+	fetcht 1,mem_last_freq
+	call set_freq_rx
+	call rf_rx_enable
+	enable swfine
+	arg 5500,timeup
+	bmark0 mark_ble_lr,le_receive_rxon
+	arg 8500,timeup
+	branch le_receive_rxon
+
+le_transmit_norx:
+	call le_transmit
+	branch end_of_packet
+	
+le_transmit:
+	bpatchx patch36_5,mem_patch36
+	call le_prep
+	call le_tx_setfreq
+	call rf_debug_tx_on_line	//H
+	set1 TXGFSK,radio_ctrl
+	enable encode_fec0
+	enable is_tx
+	disable is_rx
+	call le_wait_tx
+	disable lr_s2en
+	bmark1 mark_ble_lr,le_transmit_lr
+	bmark1 mark_ble_2M,le_transmit_2M
+	rshift16 access,pdata
+	rshift8 pdata,pdata
+	rshift4 pdata,pdata
+	inject mod,40
+le_transmit_packet:
+	enable enable_white
+	enable enable_crc
+	bpatchx patch36_6,mem_patch36
+	fetch 1,mem_le_txheader
+	inject mod,8
+	ifetch 1,contr
+	copy pdata,loopcnt
+	inject mod,8
+	sub loopcnt,0,null
+	branch le_tr_nopayload,zero
+
+	fetch 1,core_ccm_ctrl
+	branch le_transmit_packet_not_enc,blank 
+	bmark1 mark_ble_encryption,le_transmit_packet_enc
+le_transmit_packet_not_enc:	
+	arg mem_le_txpayload,contr
+le_tr_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop le_tr_loop
+	
+le_tr_nopayload:
+	enable enable_parity
+	inject mod,24
+	disable enable_parity
+	bmark0 mark_ble_lr,le_transmit_skip
+	disable enable_white
+	setarg 0
+	inject mod,3
+le_transmit_skip:
+	until null,tx_clear
+	nop 100          /* flush out the last bit */
+	disable encode_fec0
+	disable encode_fec3
+	call set_sync_on
+	call rf_debug_tx_off_line	//L
+le_check_start_pause_enc:
+	fetch 1,mem_le_txheader
+	and pdata,LLID_LE_LL,pdata
+	rtnne LLID_LE_LL
+	fetch 1,mem_le_enc_state
+	beq  FLAG_LE_ENC_PAUSE,le_clear_enc
+	rtnne FLAG_LE_SEND_START_ENC_REQ
+	fetch 1,mem_le_txpayload
+	beq LL_START_ENC_REQ,le_set_enc
+	rtn
+	
+
+le_transmit_packet_enc:
+	increase -4,loopcnt
+	copy loopcnt,temp	
+	call ccm_wait_enc	
+	arg mem_le_txpayload,contr
+le_transmit_packet_enc_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop le_transmit_packet_enc_loop
+	call ccm_check_enc_done
+	copy regext,pdata
+	inject mod,32
+	branch le_tr_nopayload
+
+le_transmit_lr:
+	arg 10,loopcnt
+le_transmit_lr_preamble_loop:
+	setarg 0x3c
+	inject mod,8
+	loop le_transmit_lr_preamble_loop
+	disable encode_fec0
+	enable encode_fec3
+	rshift16 access,pdata
+	rshift16 pdata,pdata
+	rshift4 pdata,pdata
+	inject mod,32
+	bmark1 mark_ble_lr_s8,le_transmit_lr_s8
+le_transmit_lr_s2:
+	setarg 1
+	inject mod,5
+	enable lr_s2en
+	branch le_transmit_packet
+
+le_transmit_lr_s8:
+	setarg 0
+	inject mod,5
+	branch le_transmit_packet
+
+le_transmit_2M:
+	fetch 1,mem_system_clk
+	rshift pdata,loopcnt
+le_transmit_2M_dealy:
+	nop 2
+	loop le_transmit_2M_dealy
+//	nop 36	//2M 前端发送比1M快3us左右
+	rshift16 access,pdata
+	rshift8 pdata,pdata
+	rshift4 pdata,temp
+	copy temp,pdata
+	inject mod,8
+	copy temp,pdata
+	inject mod,40
+	branch le_transmit_packet
+	
+
+le_update_param:
+	arg le_update_param_ahead1_cb,regc
+	arg le_update_param_cb,regb
+	arg lestate_update_param,queue
+	branch le_check_update_flag
+
+le_update_param_ahead1_cb:
+	add rega,coffset_sniff_anchor,contr
+	ifetcht 4,contr
+	add rega,coffest_le_new_transmitwindowsize,contr
+	ifetch 1,contr
+	add rega,coffset_le_window_size,contw
+	istore 1,contw
+	ifetch 2,contr
+	lshift2 pdata,pdata
+	iadd temp,timeup	//add windowsize
+	add rega,coffset_sniff_anchor,contw  
+	deposit timeup
+	istore 4,contw
+	ifetch 2,contr
+	lshift2 pdata,pdata
+	add rega,coffset_tsniff,contw
+	istore 2,contw
+	ifetch 4,contr
+	add rega,coffset_le_slave_latency,contw
+	istore 4,contw
+	branch le_receive_window_size
+
+le_update_param_cb:
+	ifetch 1,rega
+	set0 lestate_got_first_packet,pdata
+	istore 1,rega
+	fetch 2,mem_le_superto
+	store 2,mem_le_init_superto
+	storer rega,2,mem_rega
+	jam BT_EVT_LE_PARSE_CONN_PARAM_ACCEPTED,mem_fifo_temp
+	call ui_ipc_send_event
+	fetchr rega,2,mem_rega
+	add rega,coffset_le_slave_superto,contr
+	ifetch 2,contr
+	store 2,mem_le_init_superto
+	rtn	
+
+le_update_channel_map:
+	arg 0,regc
+	arg le_update_channel_map_cb,regb
+	arg lestate_update_map,queue
+	branch le_check_update_flag
+	
+le_update_channel_map_cb:
+	add rega,coffset_le_new_map,contr
+	ifetch 5,contr
+	add rega,coffset_le_channel_map,contw
+	istore 5,contw
+	branch le_calc_channel_map
+	
+
+le_update_phy:
+	arg 0,regc
+	arg le_update_phy_cb,regb
+	arg lestate_update_phy,queue
+	branch le_check_update_flag
+	
+le_update_phy_cb:
+	add rega,coffset_le_new_m2s_phy,contr
+	ifetch 1,contr
+	call le_update_phy_cb_m2s
+	istore 1,contw
+	add rega,coffset_le_new_s2m_phy,contr
+	ifetch 1,contr
+	call le_update_phy_cb_s2m
+	istore 1,contw
+	storer rega,2,mem_rega
+	jam BT_EVT_LE_UPDATE_PHY,mem_fifo_temp
+	call ui_ipc_send_event
+	fetchr rega,2,mem_rega
+	rtn	
+
+le_update_phy_cb_m2s:
+	call le_update_phy_cb_m2s_no_change,blank
+	add rega,coffset_le_rx_phy,contw
+	nrtn master
+	fetcht 1,mem_le_tx_phys
+	isolate1 BIT_LE_CODED_PHY_S8,temp
+	setflag true,BIT_LE_CODED_PHY_S8,pdata
+	add rega,coffset_le_tx_phy,contw
+	rtn
+
+le_update_phy_cb_m2s_no_change:
+	add rega,coffset_le_rx_phy,contr
+	ifetch 1,contr
+	nrtn master
+	add rega,coffset_le_tx_phy,contr
+	ifetch 1,contr
+	rtn
+
+le_update_phy_cb_s2m:
+	call le_update_phy_cb_s2m_no_change,blank
+	fetcht 1,mem_le_tx_phys
+	isolate1 BIT_LE_CODED_PHY_S8,temp
+	setflag true,BIT_LE_CODED_PHY_S8,pdata
+	add rega,coffset_le_tx_phy,contw
+	nrtn master
+	set0 BIT_LE_CODED_PHY_S8,pdata
+	add rega,coffset_le_rx_phy,contw
+	rtn
+
+le_update_phy_cb_s2m_no_change:
+	add rega,coffset_le_tx_phy,contr
+	ifetch 1,contr
+	nrtn master
+	add rega,coffset_le_rx_phy,contr
+	ifetch 1,contr
+	rtn
+	
+
+//regb regc is cb function
+//queue is state flag
+le_check_update_flag:
+	ifetch 1,rega
+	qisolate0 pdata
+	rtn true
+	add rega,coffset_le_event_cnt,contr
+	ifetcht 2,contr
+	add rega,coffset_le_instant,contr
+	ifetch 2,contr
+	
+	isub temp,pdata
+	branch le_update,zero
+	nbranch le_check_update_small,positive
+	sub pdata,1,null
+	branch le_update_ahead1,zero
+	rtn
+	
+le_update_ahead1:
+	copy regc,pdata
+	branch callback_func
+
+le_update:
+	ifetch 1,rega
+	qset0 pdata
+	istore 1,rega
+	copy regb,pdata
+	branch callback_func
+	
+le_check_update_small:
+	add rega,coffset_le_event_cnt,contr
+	ifetch 2,contr
+	add rega,coffset_le_instant,contr
+	ifetch 2,contr
+	isub temp,pdata
+	arg 0xffff,temp
+	isub temp,null
+	branch le_update,zero
+	arg 0xf000,temp
+	isub temp,null
+	nbranch le_update,positive
+	rtn
+	
+
+le_check_retransmit:
+	fetcht 1,mem_le_arq
+	fetch 1,mem_le_rxbuf_data_header
+//	isolate1 md,pdata
+//	setflag true,mark_ble_rx_md,mark
+	rshift pdata,pdata
+	ixor temp,pdata
+	isolate1 nesn,pdata
+	setflag true,mark_old_packet,mark	/* retransmit */
+	rtn
+
+
+le_acknowledge:
+	bpatchx patch36_7,mem_patch36
+	call le_supervision_flush
+	rtnmark1 mark_ble_crc_fail
+	call le_check_wak
+	fetch 1,mem_le_rxbuf_data_header
+	isolate1 md,pdata
+	setflag true,mark_ble_rx_md,mark
+	rshift pdata,pdata
+	ixor temp,pdata
+	isolate1 nesn,pdata
+	setflag true,mark_old_packet,mark	/* retransmit */
+	rtnmark1 mark_old_packet
+	fetch 1,mem_le_rxbuf_data_length
+	branch le_ack_unenc,blank		/* empty packet, no decryption */
+	fetch 1,mem_le_state
+	bbit0 lestate_encryption,le_ack_unenc
+	fetcht 4,mem_le_peer_mic
+	fetch 4,mem_ccm_last_mic			
+	isub temp,null
+	branch assert,zero
+	storet 4,mem_ccm_last_mic
+	fetch 5,mem_ccm_pcnt_rx
+	increase 1,pdata
+	set1 LE_CCM_DIRECTIONBIT,pdata
+	store 5,mem_ccm_pcnt_rx
+	
+le_ack_unenc:
+	fetcht 1,mem_le_arq
+	setflip nesn,temp
+	storet 1,mem_le_arq
+	fetch 1,mem_le_configuration
+	rtnbit0 BIT_BLE_DEAL_BB_PACKET
+	bpatchx patch37_0,mem_patch37
+	fetch 1,mem_le_rxbuf_data_length
+	rtn blank		//empty packet
+	fetch 1,mem_le_rxbuf_data_header
+	compare LLID_CONTINUE,pdata,3
+	branch le_parse_writing_attribute_continue,true //ACL-U continue
+	compare LLID_START,pdata,3
+	branch le_parse_writing_attribute_start,true
+	rtn
+
+	
+le_check_wak:
+	bpatchx patch37_1,mem_patch37
+	fetcht 1,mem_le_arq
+	isolate0 wak,temp
+	rtn true
+	fetch 1,mem_le_rxbuf_data_header
+	lshift pdata,pdata
+	ixor temp,pdata
+	rtnbit0 sn			/* received NESN is same as SN, NAK */
+	set0 wak,temp
+	setflip sn,temp
+	storet 1,mem_le_arq
+	compare 3,temp,3
+	nrtn true
+	rtn
+	
+
+le_set_enc:
+	fetch 1,mem_le_state
+	set1 lestate_encryption,pdata
+	store 1,mem_le_state
+	set1 mark_ble_encryption,mark
+	rtn	
+	
+le_clear_enc:
+	bpatchx patch37_2,mem_patch37
+	jam FLAG_LE_ENC_NULL,mem_le_enc_state
+	arg 0,pdata
+	store 4,mem_ccm_last_mic
+	store 5,mem_ccm_pcnt_tx
+	set1 LE_CCM_DIRECTIONBIT,pdata
+	store 5,mem_ccm_pcnt_rx
+	fetch 1,mem_le_state
+	set0 lestate_encryption,pdata
+	store 1,mem_le_state
+	set0 mark_ble_encryption,mark
+	rtn
+
+
+
+
+le_scan_check_sender_addr_type:
+	arg 1,rega// sender_addr_type
+	fetch 1,mem_le_rxbuf_adv_connect_ind_header
+	rtnbit1 LE_SENDER_ADDR_BIT
+	arg 0,rega
+	rtn
+
+
+le_get_master_rx_max:
+	copy contr,contw
+	fetcht 2,mem_remote_rx_max_octets
+	copy contw,contr
+	rtn
+
+
+le_prepare_tx:
+	bpatchx patch37_3,mem_patch37
+	fetch 1,mem_le_arq
+	rtnbit1 wak
+	call le_check_tx_md
+	call le_fifo_get_first_tx_ptr	//no packet to send
+	branch le_send_empty,blank
+	ifetch 2,contr
+	ifetcht 2,contr
+	copy temp,rega
+	isub rega,pdata
+	call le_get_master_rx_max
+	call not_greater_than
+	copy pdata,temp
+	ifetchr type,1,contr
+	copy rega,pdata
+	iadd contr,pdata
+	store 2,mem_contr
+	call le_update_tx_type
+	call le_send_packet
+	
+	call le_fifo_get_first_tx_ptr
+	ifetch 2,contr
+	copy pdata,rega	//rega:total length
+	copy contr,regc
+	ifetcht 2,contr
+	copy temp,regb	//temp&regb is offset
+	isub regb,pdata
+	call le_get_master_rx_max
+	call not_greater_than
+	iadd regb,pdata
+	istore 2,regc
+	isub rega,null
+	nrtn zero
+	branch le_fifo_release_first_node
+
+	
+le_check_tx_md:
+	call le_check_continue
+	rtnmark1 mark_ble_tx_md
+	fetch 1,mem_le_configuration
+	bbit0 BIT_BLE_TRANSMIT_PACKET_BY_MD,le_clear_md
+	call le_fifo_get_second_tx_ptr	//no packet to send
+	branch le_clear_md,blank
+	branch le_set_md
+
+	
+le_check_continue:
+	call le_fifo_get_first_tx_ptr	//no packet to send
+	branch le_clear_md,blank
+	ifetch 2,contr				//pdata:length
+	ifetcht 2,contr				//temp:offest
+	isub temp,rega			//pdata:length - offset
+	call le_get_master_rx_max
+	copy temp,pdata
+	isub rega,null
+	branch le_clear_md,positive				//27 > length -offset
+le_set_md:
+	set1 mark_ble_tx_md,mark
+	rtn
+
+le_clear_md:
+	set0 mark_ble_tx_md,mark
+	rtn
+
+le_update_tx_type:
+	copy rega,pdata
+	rtn blank
+	arg LLID_CONTINUE,type
+	rtn
+
+
+le_att_check_notification_enable: // temp ->handle,output-> pdata,output :contr->rega
+	bpatchx patch37_4,mem_patch37
+	increase 1,temp
+	call le_att_get_handle_ptr
+	increase -2,contr
+	ifetch 2,contr
+	arg CLIENT_CHARACTERTIC_CONFIGURATION,temp
+	isub temp,null
+	nrtn zero
+	increase 1,contr
+	copy contr,rega
+	ifetch 1,contr
+	rtn
+	
+
+le_send_empty:
+	force 0,temp
+	force 1,type
+	
+le_send_packet:
+	bpatchx patch37_5,mem_patch37
+	storet 1,mem_le_txlen
+	fetcht 1,mem_le_arq
+	set1 wak,temp
+	and temp,0xfc,pdata
+	ior type,pdata
+	store 1,mem_le_arq
+	and_into 0x1f,pdata
+	isolate1 mark_ble_tx_md,mark
+	setflag true,md,pdata
+	store 1,mem_le_txheader
+
+	fetch 1,mem_le_txheader
+	compare 1,type,3
+	nbranch le_send_no_txlen,true
+	fetch 1,mem_le_txlen
+	rtn blank
+	
+le_send_no_txlen:	
+	bmark1 mark_ble_encryption,le_send_packet_enc
+	fetchr loopcnt,1,mem_le_txlen
+	fetch 2,mem_contr
+	copy pdata,contr
+	arg mem_le_txpayload,contw
+	branch memcpy_fast
+	
+le_send_packet_enc:
+	call load_sk
+	branch le_encrypt_new_start
+
+get_lpm_wake_ble_rx_lock:
+	arg wake_lock_ble_rx,queue
+	branch lpm_get_wake_lock
+
+put_lpm_wake_ble_rx_lock:
+	arg wake_lock_ble_rx,queue
+	branch lpm_put_wake_lock
+
+
+le_parse:
+	bpatchx patch37_6,mem_patch37
+	rtnmark1 mark_old_packet
+	rtnmark1 mark_ble_crc_fail
+	fetch 1,mem_le_rxbuf_data_header
+	and pdata,0x3,pdata
+	store 1,mem_le_packet_llid
+	fetch 1,mem_le_rxbuf_data_length
+	rtn blank							//empty rtn
+	setarg mem_le_rxbuf_data_payload
+	store 2,mem_le_payload_ptr
+	bpatchx patch37_7,mem_patch37
+	fetch 1,mem_le_packet_llid
+	beq LLID_LE_LL,le_parse_ll
+le_parse_l2cap:
+	call le_check_l2cap_complete
+	nbranch get_lpm_wake_ble_rx_lock,user
+	call put_lpm_wake_ble_rx_lock
+	setarg 0
+	store 2,mem_le_packet_len_recved
+	fetch 2,mem_le_payload_ptr
+	add pdata,2,contr	//l2cap length
+	bpatchx patch38_0,mem_patch38
+	ifetch 2,contr
+	beq LE_L2CAP_CID_ATT,le_parse_att
+	beq LE_L2CAP_CID_SMP,le_parse_smp
+	beq LE_L2CAP_CID_SIGNAL,le_parse_signaling
+	rtn
+
+
+le_check_l2cap_complete:
+	fetch 1,mem_le_packet_llid
+	beq LLID_START,le_check_l2cap_llid_start
+	beq LLID_CONTINUE,le_check_l2cap_llid_continue
+	rtn
+
+//input: pdata is CID number
+//output: 	if CID is legal ,enable user
+//		if ICD is illegal,disable user 
+le_check_l2cap_CID_legal:
+	call enable_user
+	arg LE_L2CAP_CID_ATT,temp
+	isub pdata,null
+	rtn zero
+	arg LE_L2CAP_CID_SIGNAL,temp
+	isub pdata,null
+	rtn zero
+	arg LE_L2CAP_CID_SMP,temp
+	isub pdata,null
+	rtn zero
+	branch disable_user
+
+	
+le_check_l2cap_llid_start:
+	fetch 2,mem_le_payload_ptr
+	copy pdata,contr
+	ifetch 2,contr
+	store 2,mem_le_l2cap_size
+	ifetch 2,contr			//CID
+	call le_check_l2cap_CID_legal
+	nrtn user		//CID error
+	fetcht 1,mem_le_rxbuf_data_length
+	storet 2,mem_le_packet_len_recved
+	fetch 2,mem_le_l2cap_size
+	increase 4,pdata		//CID:2 L2cap length 2
+	isub temp,null
+	branch enable_user,zero
+	fetchr loopcnt,1,mem_le_rxbuf_data_length
+	arg mem_le_l2cap_buf,contw
+	fetch 2,mem_le_payload_ptr
+	copy pdata,contr
+	call memcpy_fast
+	branch disable_user
+
+//no input
+//output: 	if CID is legal ,enable user
+//		if ICD is illegal,disable user 
+le_check_l2cap_continue_legal:
+	call enable_user
+	fetch 2,mem_le_packet_len_recved
+	nrtn blank
+	branch disable_user
+
+le_check_l2cap_llid_continue:
+	call le_check_l2cap_continue_legal
+	nrtn user		//check receive start packet
+	fetch 2,mem_le_packet_len_recved
+	arg mem_le_l2cap_buf,contw
+	iadd contw,rega
+	fetcht 1,mem_le_rxbuf_data_length
+	iadd temp,pdata
+	store 2,mem_le_packet_len_recved
+	fetchr loopcnt,1,mem_le_rxbuf_data_length
+	copy rega,contw
+	fetch 2,mem_le_payload_ptr
+	copy pdata,contr
+	call memcpy_fast
+	setarg mem_le_l2cap_buf
+	store 2,mem_le_payload_ptr		//update ptr->mem_le_l2capbuff
+	fetch 2,mem_le_l2cap_size
+	increase 4,pdata
+	fetcht 2,mem_le_packet_len_recved
+	isub temp,null
+	branch enable_user,zero
+	branch disable_user
+
+
+
+
+
+le_get_search_att_uuid:
+	call store_contr
+	arg mem_le_search_uuid_length,contw
+	branch le_get_search_common
+
+
+	/* rega pointers to data, regb is length */
+le_writeatt_cb:
+	fetch 2,mem_cb_att_write
+	branch callback_func
+	
+le_supervision_update:
+	fetcht 4,mem_le_supervision_timer
+	call get_clkbt
+	isub temp,timeup					/* and to 28 bits */
+	deposit timeup
+	fetcht 2,mem_le_superto
+	lshift4 temp,temp
+	lshift temp,temp
+	isub temp,pdata
+	rtn
+	
+le_supervision_flush:
+	call get_clkbt
+	store 4,mem_le_supervision_timer
+	rtn
+
+	
+//input rega
+le_receive_window_size:
+	bpatchx patch38_1,mem_patch38
+	add rega, coffset_le_peer_sca,contr
+	ifetch 1,contr
+	call le_sca_map
+	add rega, coffset_tsniff,contr
+	ifetch 2,contr
+	imul32 temp,pdata
+	fetcht 2,mem_param_rt_rthalfslot
+	imul32 temp,pdata
+	arg 1000000,temp
+	idiv temp
+	arg PARAM_WINDOWN_SIZE,temp
+	fetch 1,mem_system_clk
+	imul32 temp,temp
+	add rega, coffset_le_window_size,contr
+	ifetch 1,contr
+	imul32 temp,pdata
+	iadd temp,pdata
+	store 4,mem_le_transmit_window	
+	fetch 2,mem_rx_window_sniff
+	call wait_div_end
+	quotient temp
+	iadd temp,pdata
+	add rega, coffset_rx_window,contw
+	istore 2,contw
+	rtn
+
+	
+
+le_init_attlist_search:
+	bpatchx patch38_2,mem_patch38
+	fetch 2,mem_le_search_handle_start
+	iforce regb
+	fetch 2,mem_le_search_handle_end
+	iforce regc
+	fetch 2,mem_ui_le_uuid_table
+	iforce contr
+	enable user
+	rtn
+
+	/* return handle in pdata, blank:end of list, positive:in range */
+le_att_handle_inrange:
+	ifetch 2,contr
+	and_into 0xff,pdata
+	rtn blank
+	isub regb,null			/* less than start ? */
+	nrtn positive
+	isub regc,null			/* greater than end ? */
+	rtn zero
+	branch le_att_handle_blank,positive
+	force 1,null
+	rtn
+le_att_handle_blank:
+	force 0,pdata
+	rtn
+
+
+	/* handle in temp, return pointer in contr to length, blank not found */
+le_att_get_handle_ptr:
+	call le_att_get_handle_ptr2
+	branch le_att_get_handle_ptr_found,zero
+	rtn
+	
+le_att_get_handle_ptr2:
+	bpatchx patch38_3,mem_patch38
+	fetch 2,mem_ui_le_uuid_table
+	iforce contr
+le_att_get_handle_loop1:
+	ifetch 2,contr
+	and_into 0xff,pdata
+	rtn blank
+	isub temp,null
+	rtn zero
+	ifetch 1,contr
+	iadd contr,contr	
+	ifetch 1,contr			// length  
+	iadd contr,contr
+	branch le_att_get_handle_loop1
+le_att_get_handle_ptr_found:
+	ifetch 1,contr
+	iadd contr,contr	
+	rtn	
+
+
+
+le_att_get_short_uuid_ptr:
+	bpatchx patch38_4,mem_patch38
+	fetch 2,mem_ui_le_uuid_table
+	iforce contr
+le_att_get_short_uuid_loop:
+	ifetch 2,contr
+	and_into 0xff,pdata
+	rtn blank
+	ifetch 1,contr
+	iadd contr,contr
+	increase -2,contr
+	ifetch 2,contr
+	isub temp,null
+	rtn zero
+	ifetch 1,contr			 
+	iadd contr,contr
+	branch le_att_get_short_uuid_loop	
+
+
+//output:temp:new handle num
+//contr:address write data
+le_att_get_last_handle:
+	fetch 2,mem_ui_le_uuid_table
+	iforce contr
+le_att_get_last_handle_loop:
+	ifetch 2,contr
+	and_into 0xff,pdata
+	rtn blank
+	add pdata,1,temp
+	ifetch 1,contr
+	iadd contr,contr	
+	ifetch 1,contr			// length
+	iadd contr,contr
+	copy contr,contw
+	branch le_att_get_last_handle_loop
+
+
+le_att_get_handle_info_from_ptr:
+	fetch 2, mem_le_cur_attlist_start_ptr
+	branch le_att_get_handle_info_fast
+
+le_att_get_handle_info:
+	bpatchx patch38_5,mem_patch38
+	fetch 2,mem_ui_le_uuid_table
+le_att_get_handle_info_fast:
+	iforce contr
+le_att_get_handle_loop:
+	ifetch 2,contr
+	and_into 0xff,pdata
+	branch le_att_unfind_handle,blank
+	isub temp,null
+	branch le_att_finded_handle, zero
+	ifetch 1,contr			// length  
+	iadd contr,contr	
+	ifetch 1,contr			//length 
+	iadd contr,contr
+	branch le_att_get_handle_loop
+le_att_unfind_handle:
+	branch disable_blank
+
+le_att_finded_handle:
+	ifetch 1,contr
+	store 1,mem_le_cur_uuid_length
+	copy pdata,loopcnt
+	arg mem_le_cur_uuid,contw
+	call memcpy_fast
+	ifetch 1,contr
+	store 1,mem_le_curr_att_len
+	call store_contr
+	branch enable_blank
+
+	
+le_modified_name:
+	bpatchx patch38_6,mem_patch38
+	call le_modified_name_att_list
+	branch le_modified_name_adv
+
+le_modified_name_att_list:
+	arg UUID_CHRCTR_DEVICE_NAME,temp
+	call le_att_get_short_uuid_ptr
+	rtn blank
+	ifetch 1,contr						// attribute length
+	copy contr,contw
+	fetcht 1,mem_le_name_len
+	copy temp,loopcnt
+	isub temp,null
+	nbranch le_name_length_longer_than_att,positive
+	isub temp,temp
+	arg mem_le_name,contr
+	call memcpy_fast
+	copy temp,loopcnt
+	ncall memcpy_empty,zero
+	rtn
+le_name_length_longer_than_att:
+	copy pdata,loopcnt
+	arg mem_le_name,contr
+	branch memcpy_fast
+
+
+le_modified_name_adv:
+	arg mem_le_adv_data_len+32,regc
+	arg mem_le_adv_data,rega
+	call le_modified_name_adv_and_scan
+	setarg 0
+	setflag user,0,pdata
+	store 1,mem_pdatatemp
+	arg mem_le_scan_data_len+32,regc
+	arg mem_le_scan_data,rega
+	call le_modified_name_adv_and_scan
+	rtn user
+	fetch 1,mem_pdatatemp
+	branch assert,blank
+	rtn
+
+
+le_modified_name_adv_and_scan:
+	bpatchx patch38_7,mem_patch38
+	call enable_user
+	call clear_temp_block
+	arg 0,regb	//current length
+	arg mem_le_data_temp,contw
+	call le_modified_name_adv_loop
+	fetch 1,mem_le_name_len
+	add pdata,1,temp
+	iadd regb,rega	
+	increase 2,rega
+	sub rega,0x1f,null
+	nbranch le_modified_name_adv_and_scan_name_overflow,positive
+	istoret 1,contw		//store ble name length
+	arg GAP_ADTYPE_LOCAL_NAME_COMPLETE,temp
+	istoret 1,contw		//store ble name type
+	iforce loopcnt
+	call memcpy_fast
+	copy rega,regb
+le_modified_name_adv_and_scan_store_data:
+	deposit regb
+	store 1,mem_le_data_len_temp
+	arg mem_le_data_len_temp,contr
+	setarg -32
+	iadd regc,contw
+	branch memcpy32
+
+le_modified_name_adv_and_scan_name_overflow:
+	call disable_user
+	branch le_modified_name_adv_and_scan_store_data
+	
+le_modified_name_adv_loop:
+	ifetch 1,rega		//pdata:length
+	rtn blank			//length is zero,ending find
+	pincrease 1		//length += 1
+	ifetcht 1,contr		//pdata:type
+	sub temp,GAP_ADTYPE_LOCAL_NAME_COMPLETE,null
+	branch le_modified_name_adv_found_name,zero
+	iadd regb,regb	
+	copy rega,contr
+	iforce loopcnt
+	call memcpy_fast
+	copy contr,rega
+le_modified_name_adv_loop2:
+	deposit rega
+	isub regc,null
+	rtn positive
+	branch le_modified_name_adv_loop
+
+le_modified_name_adv_found_name:
+	iadd rega,rega
+	branch le_modified_name_adv_loop2
+
+
+memcpy_empty:
+	setarg SPACE
+	istore 1,contw
+	loop memcpy_empty
+	rtn
+
+	
+le_lpm_set_mult:
+	bpatchx patch39_0,mem_patch39
+	disable wake
+	branch le_lpm_set_mult_attempt,attempt
+	nbranch le_lpm_lost,match
+le_lpm_set_mult_attempt:
+	call lpm_match
+	fetch 2,mem_rx_window_sniff
+	store 2,mem_le_receive_window
+le_lpm_set_mult_attempt_match:
+	nbranch lpm_mult_short,match
+	bmark1 mark_old_packet,lpm_mult_short
+
+	fetch 1,mem_le_rxbuf_data_length
+	nbranch lpm_mult_short,blank		// rx not empty, short interval
+	fetch 1,mem_le_txlen
+	nbranch lpm_mult_short,blank		// tx not empty, short interval
+	
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_SHORT_MULT,lpm_mult_short	//check flag,if flag is 1,always short mult
+	
+	fetch 1,mem_le_state
+	bbit1 lestate_update_param,lpm_mult_short
+	branch lpm_mult_wait_timeout
+	
+le_lpm_lost:
+	fetcht 2,mem_rx_window_sniff
+	rshift temp,temp
+	fetch 2,mem_le_receive_window
+	iadd temp,pdata
+	store 2,mem_le_receive_window
+	branch lpm_lost
+
+///////////////////////////////BLE CONFIG//////////////////////////////////////////
+le_set_config_fixed_tk:
+	arg BIT_BLE_PASSKEY_FIXED_KEY,queue
+	branch le_set_config
+
+le_clr_config_fixed_tk:
+	arg BIT_BLE_PASSKEY_FIXED_KEY,queue
+	branch le_clr_config
+
+le_set_config_fixed_ltk:
+	arg BIT_BLE_PAIRING_FIXED_LTK,queue
+	branch le_set_config
+
+le_clr_config_fixed_ltk:
+	arg BIT_BLE_PAIRING_FIXED_LTK,queue
+	branch le_clr_config
+
+le_set_config_more_data:
+	arg BIT_BLE_TRANSMIT_PACKET_BY_MD,queue
+	branch le_set_config
+
+le_clr_config_more_data:
+	arg BIT_BLE_TRANSMIT_PACKET_BY_MD,queue
+	branch le_clr_config
+
+le_set_config_read_authentication:
+	arg BIT_BLE_READ_AUTH,queue
+	branch le_set_config
+
+le_clr_config_read_authentication:
+	arg BIT_BLE_READ_AUTH,queue
+	branch le_clr_config
+
+le_set_config_write_authentication:
+	arg BIT_BLE_WRITE_AUTH,queue
+	branch le_set_config
+
+le_clr_config_write_authentication:
+	arg BIT_BLE_WRITE_AUTH,queue
+	branch le_clr_config
+
+le_set_config_short_mult:
+	arg BIT_BLE_SHORT_MULT,queue
+	branch le_set_config
+
+le_clr_config_short_mult:
+	arg BIT_BLE_SHORT_MULT,queue
+	branch le_clr_config
+
+
+le_set_config:
+	fetch 1,mem_le_configuration
+	qset1 pdata
+	store 1,mem_le_configuration
+	rtn
+
+le_clr_config:
+	fetch 1,mem_le_configuration
+	qset0 pdata
+	store 1,mem_le_configuration
+	rtn
+
+le_set_fixed_ltk:
+	setarg 0x112233
+	store 3,mem_le_fixed_ltk
+	setarg 0x445566
+	istore 3,contw
+	setarg 0x778899
+	istore 3,contw
+	setarg 0x001122
+	istore 3,contw
+	setarg 0x334455
+	istore 3,contw
+	setarg 0x66
+	istore 1,contw
+	rtn
+
+
+le_set_justwork:
+	setarg 0x01000302
+	store 4,mem_le_pres
+	setarg 0x010010
+	store 3,mem_le_pres_max_keysize
+	jam 1,mem_le_pairing_mode
+	rtn
+
+/////////////////////////////////////////////////////////////////////////
+
+le_fifo_malloc_tx_empty:
+	arg 0,rega
+	arg LLID_EMPTY,type
+	branch le_fifo_malloc_tx
+
+
+//rega:len regb:ll opcode
+le_fifo_malloc_tx_ll:
+	arg LLID_LE_LL,type
+	call le_fifo_malloc_tx
+	copy regb,pdata
+	istore 1,contw
+	rtn
+	
+
+//rega:len regb:cid
+le_fifo_malloc_tx_l2cap:
+	force LLID_START,type
+	increase 4,rega
+	call le_fifo_malloc_tx
+	increase -4,rega
+	copy rega,pdata
+	istore 2,contw
+	copy regb,pdata
+	istore 2,contw
+	rtn
+
+
+//rega:len type:llid
+le_fifo_malloc_tx:
+	increase 5,rega
+	call ble_l2cap_malloc
+	increase -5,rega
+	copy rega,pdata
+	istore 2,contw				//lengh
+	setarg 0
+	istore 2,contw				//offset
+	copy type,pdata
+	istore 1,contw				//LLID
+	rtn
+
+
+le_fifo_get_first_tx_ptr:
+	call l2cap_malloc_fifo_out
+	copy pdata,contr
+	rtn
+
+le_fifo_get_second_tx_ptr:
+	fetch 2,mem_tx_fifo2_ptr
+	rtn
+
+le_fifo_get_last_tx_ptr:
+	call le_fifo_get_last_tx_ptr0
+	copy pdata,contr
+	rtn
+
+
+le_fifo_get_last_tx_ptr0:
+	fetch 2,mem_tx_fifo3_ptr
+	rtn
+
+
+le_fifo_get_first_l2cap_ptr:
+	call le_fifo_get_first_tx_ptr
+	increase 5,contr
+	rtn
+
+le_fifo_get_first_att_ptr:
+	call le_fifo_get_first_tx_ptr
+	increase 9,contr
+	rtn
+
+le_fifo_get_last_att_ptr:
+	call le_fifo_get_last_tx_ptr
+	increase 9,contr
+	rtn
+
+le_fifo_get_last_l2cap_ptr:
+	call le_fifo_get_last_tx_ptr
+	increase 5,contr
+	rtn
+
+
+le_fifo_check_full:
+	branch l2cap_malloc_is_fifo_full
+
+
+le_fifo_check_nearly_full:
+	branch l2cap_malloc_is_fifo_nearly_full
+
+	
+le_fifo_check_empty:
+	branch l2cap_malloc_is_fifo_empty
+
+
+le_fifo_release_first_node:
+	branch l2cap_malloc_free
+
+
+/*
+	function name:le_set_dle (data packet length extension)
+	input:pdata is dle params
+	bit0~bit15 max rx octets
+	bit16~bit31 max rx time
+	bit32~bit47 max tx octets
+	bit48~bit63 max tx time
+*/
+le_set_dle:
+	store 8,mem_local_rx_max_octets
+	branch le_set_feature_data_packet_length_extension
+
+
+/*
+	function name:le_set_phys
+	input:temp is tx & rx phys
+	bit0~bit7 is tx phys
+	bit8~bit15 is rx phys
+*/
+le_set_phys:
+	and temp,0xff,rega
+	call le_set_tx_phy
+	rshift8 temp,rega
+	branch le_set_rx_phy
+
+le_set_tx_phy:
+	storer rega,1,mem_le_tx_phys
+	isolate1 BIT_LE_2M_PHY,rega
+	call le_set_feature_2M_phy,true
+	isolate1 BIT_LE_CODED_PHY,rega
+	call le_set_feature_coded_phy,true
+	rtn
+
+le_set_rx_phy:
+	storer rega,1,mem_le_rx_phys
+	branch le_set_tx_phy+1
+
+
+le_set_feature_2M_phy:
+	arg BIT_LL_FEATURE_LE_2M_PHY,queue
+	branch le_set_feature
+
+
+le_set_feature_coded_phy:
+	arg BIT_LL_FEATURE_LE_CODED_PHY,queue
+	branch le_set_feature
+
+
+le_set_feature_data_packet_length_extension:
+	arg BIT_LL_FEATURE_LE_DATA_PACKET_LENGTH_EXTENSION,queue
+	branch le_set_feature
+
+
+le_set_feature:
+	fetch 8,mem_le_local_feature
+	qset1 pdata
+	store 8,mem_le_local_feature
+	rtn
+
+
+
Index: program/ble_protocol_stack/le_advertising.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_advertising.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_advertising.prog	(working copy)
@@ -0,0 +1,382 @@
+
+/*
+ble core spec advertising
+*/
+
+le_advertising_dispatch:
+	rtnmark1 mark_adc_enable
+	jam FUN_RX_LL_1M_PHY,mem_le_rx_phy
+	jam FUN_TX_LL_1M_PHY,mem_le_tx_phy
+	call le_enable
+	call le_scan
+	call le_adv
+	branch le_disable
+
+le_scan:
+	bpatchx patch39_1,mem_patch39
+	fetch 1,mem_le_scan_enable
+	rtnne LE_SCAN_ENABLE
+	arg le_scan_interval_timer,queue
+	call timer_check
+	nrtn blank
+	fetch 2,mem_le_scan_interval
+	fetcht 2,mem_le_scan_window
+	isub temp,pdata
+	arg le_scan_interval_timer,queue
+	call timer_init
+	disable master
+	call le_init_adv
+	call le_wait_adv
+	nrtn match
+	bpatchx patch39_2,mem_patch39
+	fetch 6,mem_le_rxbuf+2
+	store 6,mem_le_plap
+//	call le_scan_dongle
+
+	fetch 1,mem_le_adv_rcv
+	increase 1,pdata
+	store 1,mem_le_adv_rcv
+	call le_create_conn
+	rtn master
+	call le_send_scan_request
+	nrtn match
+	fetch 1,mem_le_scanrsp_rcv
+	increase 1,pdata
+	store 1,mem_le_scanrsp_rcv
+	fetch 9,mem_le_rxbuf+8
+	store 9,mem_tmp_buffer
+	rtn
+
+
+le_wait_adv:
+	bpatchx patch39_3,mem_patch39
+	call le_next_adv_channel
+	call le_receive_adv
+	fetch 1,mem_le_adv_waitcnt
+	increase 1,pdata
+	store 1,mem_le_adv_waitcnt
+	rtn
+
+
+le_create_conn:
+	bpatchx patch39_4,mem_patch39
+	fetch 1,mem_cmd_le_create_conn
+	rtnne hci_cmd_le_create_conn
+	fetch 6,mem_le_plap
+	fetcht 6,mem_le_conn_peer_addr
+	isub temp,null
+	nrtn zero
+	call context_new
+	nrtn zero
+	call le_connect_request
+	call le_init_master
+	jam 0,mem_hci_cmd
+	jam 0,mem_le_peer_sca
+	jam 0,mem_le_scan_enable
+	jam 0,mem_cmd_le_create_conn
+	branch context_save
+
+le_connect_request:
+	bpatchx patch39_5,mem_patch39
+	force -1,pdata
+	setsect 2,1
+	store 5,mem_le_channel_map
+	arg mem_le_state,rega	
+	call le_calc_channel_map	
+	force 4,loopcnt
+	arg mem_le_access,contw
+	call generate_random_loop	
+	fetch 2,mem_le_timeout
+	store 2,mem_le_superto
+le_con_req_hop_retry:
+	random pdata
+	and_into 0xf,pdata
+	sub pdata,4,null
+	branch le_con_req_hop_retry,positive
+	store 1,mem_le_hop
+	store 1,mem_tmp1
+	bpatchx patch39_6,mem_patch39
+	fetcht 2,mem_le_conn_interval
+	storet 2,mem_le_tsniff	
+	copy temp,regc			// tsniff in regc
+	add clkn_bt,7,pdata			// leave space for offset
+	idiv regc
+	call wait_div_end
+	remainder rega
+	isub rega,pdata
+	iadd regc,pdata
+	fetcht 2,mem_le_dsniff
+	iadd temp,pdata
+	store 4,mem_le_anchor
+	isub clkn_bt,rega
+	increase -6,rega			// window offset
+	arg 0x2205,regb			// length & CONN_REQ PDU
+	fetch 1,mem_le_conn_own_addr_type
+	nsetflag blank,LE_SENDER_ADDR_BIT,regb
+	fetch 1,mem_le_conn_peer_addr_type
+	nsetflag blank,LE_RECEIVER_ADDR_BIT,regb
+	copy regb,pdata
+	store 2,mem_le_txheader
+	fetch 6,mem_le_lap
+	istore 6,contw//own addr
+	fetch 6,mem_le_plap
+	istore 6,contw// peer addr
+	fetch 4,mem_le_access
+	istore 4,contw
+	random pdata
+	istore 2,contw				/* crc init */
+	random pdata
+	istore 1,contw
+	force 2,pdata				/* window size */	
+	istore 1,contw
+	rshift2 rega,pdata
+	istore 2,contw				/* window offset */
+	rshift2 regc,pdata			
+	istore 2,contw				/* conn Interval */
+	bpatchx patch39_7,mem_patch39
+	setarg 0					/* slave latency */
+	istore 2,contw
+	fetch 2,mem_le_timeout
+	istore 2,contw
+	fetch 5,mem_le_channel_map
+	istore 5,contw				/* channel map */
+	fetch 1,mem_le_hop
+	arg param_le_sca,temp
+	ior temp,pdata
+	istore 1,contw
+	call le_transmit_norx
+	setarg mem_le_txheader
+	add pdata,18,contr
+	ifetch 3,contr
+	store 3,mem_le_crcinit
+	rtn
+		
+
+
+le_adv:
+	jam 36,mem_le_ch_mapped
+	jam 0,mem_le_adv_channel_map_temp
+le_adv_loop:
+	fetch 1,mem_le_adv_enable
+	rtn blank
+	arg le_adv_interval_timer,queue
+	call timer_check
+	nrtn blank
+	bpatchx patch3a_0,mem_patch3a
+le_adv_loop_tx:
+	enable swfine
+	call le_init_adv
+	call le_next_adv_channel
+	call le_send_adv_ind
+	nbranch le_adv_not_match,match
+	fetch 1,mem_le_req_rcv
+	increase 1,pdata
+	store 1,mem_le_req_rcv
+	fetch 1,mem_le_rxbuf_adv_header
+	and pdata,0x0f,pdata
+	beq SCAN_REQ,le_send_scan_response
+	beq CONNECT_REQ,le_parse_connect_req
+le_adv_not_match:
+	bpatchx patch3a_1,mem_patch3a
+	fetch 1,mem_le_adv_channel_map_temp
+	fetcht 1,mem_le_adv_channel_map
+	isub temp,null
+	nbranch le_adv_loop,zero
+	random pdata 
+	arg 0x1ff,temp
+	iand temp,pdata
+	add pdata,250,pdata
+	call delay
+	arg le_adv_interval_timer,queue
+	fetch 2,mem_le_adv_interval
+	branch timer_init
+
+
+le_init_adv:
+	bpatchx patch3a_2,mem_patch3a
+	disable master
+le_adv_access:
+	setarg 0x8e89be
+	lshift8 pdata,pdata
+	or_into 0xd6,pdata
+	iforce access
+	setarg 0x555555
+	store 3,mem_le_crcinit
+	branch calc_mod_value_scale_le
+
+
+
+le_send_adv_ind:
+	bpatchx patch3a_3,mem_patch3a
+	fetch 1,mem_le_adv_type
+	fetcht 1,mem_le_adv_own_addr_type
+	lshift4 temp,temp
+	lshift2 temp,temp
+	iadd temp,temp
+	storet 1,mem_le_txheader
+	beq ADV_DIRECT_IND,le_send_adv_direct_ind
+	fetcht 1,mem_le_adv_data_len
+	add temp,6,pdata
+	store 1,mem_le_txlen
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload
+	copy temp,loopcnt
+	arg mem_le_adv_data,contr
+	call memcpy_fast
+	branch le_send_adv_transmit
+
+le_send_adv_direct_ind:
+	setarg 12
+	store 1,mem_le_txlen
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload
+	fetch 6,mem_hci_plap
+	istore 6,contw
+le_send_adv_transmit:
+	bpatchx patch3a_4,mem_patch3a
+	fetch 1,mem_le_adv_transmit
+	increase 1,pdata
+	store 1,mem_le_adv_transmit
+	arg 1800,stop_watch
+	disable match
+	branch le_transmit_receive_sifs_without_change_mode
+
+
+le_send_scan_request:
+	bpatchx patch3a_5,mem_patch3a
+	fetch 1,mem_le_scan_type
+	rtnne LE_SCAN_TYPE_ACTIVE
+	fetch 1,mem_le_adv_transmit
+	increase 1,pdata
+	store 1,mem_le_adv_transmit
+	arg 0x0c03,temp// length + SCAN_REQ PDU
+	fetch 1,mem_le_scan_own_addr_type
+	nsetflag blank,LE_SENDER_ADDR_BIT,temp
+	copy rega,pdata
+	nsetflag blank,LE_RECEIVER_ADDR_BIT,temp	
+	storet 2,mem_le_txheader
+	fetch 6,mem_le_lap
+	istore 6,contw
+	fetch 6,mem_le_plap
+	istore 6,contw
+	branch le_transmit_receive_sifs_without_change_mode
+
+le_send_scan_response:
+	fetch 6,mem_le_rxbuf_adv_scan_req_adv_address
+	fetcht 6,mem_le_lap
+	isub temp,null
+	nrtn zero
+	arg SCAN_RSP,temp
+	fetch 1,mem_le_adv_own_addr_type
+	nsetflag blank,LE_SENDER_ADDR_BIT,temp
+	storet 1,mem_le_txheader
+	fetcht 1,mem_le_scan_data_len
+	add temp,6,pdata
+	store 1,mem_le_txlen
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload
+	arg mem_le_scan_data,contr
+	copy temp,loopcnt
+	call memcpy_fast
+	call le_transmit_norx
+	branch le_adv_not_match
+
+le_parse_connect_req:
+	fetch 6,mem_le_rxbuf_adv_connect_ind_adv_address
+	fetcht 6,mem_le_lap
+	isub temp,null
+	nrtn zero
+	call le_scan_check_sender_addr_type
+	storer rega,1,mem_le_conn_peer_addr_type
+	fetch 6,mem_le_rxbuf_adv_connect_ind_init_address
+	store 6,mem_le_plap
+	fetch 8,mem_le_rxbuf_adv_connect_ind_access_address
+	store 8,mem_le_access 	// and crcinit & window size
+	fetcht 2,mem_le_rxbuf_adv_connect_ind_win_offset	// transmit offset
+	bpatchx patch3a_6,mem_patch3a
+	lshift2 temp,temp
+	fetch 2,mem_le_rxbuf_adv_connect_ind_interval	// connInterval
+	lshift2 pdata,pdata
+	store 2,mem_le_tsniff
+	store 4,mem_le_anchor
+	isub temp,pdata
+	add pdata,-2,clke_bt
+	fetch 9,mem_le_rxbuf_adv_connect_ind_latency
+	store 9,mem_le_slave_latency// and super to & channel map
+	fetch 1,mem_le_rxbuf_adv_connect_ind_hop_and_sca
+	and pdata,0x1f,temp
+	storet 1,mem_le_hop
+	rshift4 pdata,temp
+	rshift temp,temp
+	storet 1,mem_le_peer_sca
+	arg mem_le_state,rega
+	call le_receive_window_size
+	arg mem_le_state,rega	
+	call le_calc_channel_map
+	call le_init_slave
+	call context_new
+	nrtn zero
+	bpatchx patch3a_7,mem_patch3a
+	call calc_clke_offset
+	call le_l2cap_reset_signaling_identifier
+	jam BT_EVT_LE_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	branch context_save
+
+
+le_next_adv_channel:
+	bpatchx patch3b_0,mem_patch3b
+	fetch 1,mem_le_ch_mapped
+	beq 37,le_next_adv_channel_curr_channel_37
+	beq 38,le_next_adv_channel_curr_channel_38
+	beq 39,le_next_adv_channel_curr_channel_39
+	branch le_next_adv_channel_curr_channel_39
+
+le_next_adv_channel_curr_channel_37:
+	fetcht 1,mem_le_adv_channel_map
+	isolate1 BIT_ADV_CHANNEL_MAP_38,temp		//check 38 channel enable
+	branch set_le_next_adv_channel_38,true
+	isolate1 BIT_ADV_CHANNEL_MAP_39,temp		//check 39 channel enable
+	branch set_le_next_adv_channel_39,true
+	branch set_le_next_adv_channel_37
+
+
+le_next_adv_channel_curr_channel_38:
+	fetcht 1,mem_le_adv_channel_map
+	isolate1 BIT_ADV_CHANNEL_MAP_39,temp		//check 39 channel enable
+	branch set_le_next_adv_channel_39,true
+	isolate1 BIT_ADV_CHANNEL_MAP_37,temp		//check 37 channel enable
+	branch set_le_next_adv_channel_37,true
+	branch set_le_next_adv_channel_38
+
+
+le_next_adv_channel_curr_channel_39:
+	fetcht 1,mem_le_adv_channel_map
+	isolate1 BIT_ADV_CHANNEL_MAP_37,temp		//check 37 channel enable
+	branch set_le_next_adv_channel_37,true
+	isolate1 BIT_ADV_CHANNEL_MAP_38,temp		//check 38 channel enable
+	branch set_le_next_adv_channel_38,true
+	branch set_le_next_adv_channel_39
+
+set_le_next_adv_channel_37:
+	jam 37,mem_le_ch_mapped
+	fetch 1,mem_le_adv_channel_map_temp
+	set1 BIT_ADV_CHANNEL_MAP_37,pdata
+	store 1,mem_le_adv_channel_map_temp
+	rtn
+
+set_le_next_adv_channel_38:
+	jam 38,mem_le_ch_mapped
+	fetch 1,mem_le_adv_channel_map_temp
+	set1 BIT_ADV_CHANNEL_MAP_38,pdata
+	store 1,mem_le_adv_channel_map_temp
+	rtn
+
+set_le_next_adv_channel_39:
+	jam 39,mem_le_ch_mapped
+	fetch 1,mem_le_adv_channel_map_temp
+	set1 BIT_ADV_CHANNEL_MAP_39,pdata
+	store 1,mem_le_adv_channel_map_temp
+	rtn
+
+
Index: program/ble_protocol_stack/le_l2cap_att.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_l2cap_att.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_l2cap_att.prog	(working copy)
@@ -0,0 +1,873 @@
+
+
+le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+	beq ATTOP_EXCHANGE_MTU_REQUEST,le_parse_att_exchange_mtu_request
+	beq ATTOP_EXCHANGE_MTU_RESPONSE,le_parse_att_exchange_mtu_response
+	beq ATTOP_FIND_INFORMATION_REQUEST,le_parse_att_find_information_request
+	beq ATTOP_FIND_BY_TYPE_VALUE_REQUEST,le_parse_att_find_by_type_value_request
+	beq ATTOP_READ_BY_TYPE_REQUEST,le_parse_att_read_by_type_request
+	beq ATTOP_READ_REQUEST,le_parse_att_read_request
+	beq ATTOP_READ_BLOB_REQUEST,le_parse_att_read_blob_request
+	beq ATTOP_READ_BY_GROUP_TYPE_REQUEST,le_parse_att_read_by_group_type_request
+	beq ATTOP_WRITE_REQUEST,le_parse_att_write_request
+	beq ATTOP_PREPARE_WRITE_REQUEST,le_parse_att_prepare_write_request
+	beq ATTOP_EXECUTE_WRITE_REQUEST,le_parse_att_execute_write_request
+	beq ATTOP_HANDLE_VALUE_CONFIRMATION,le_parse_handle_value_confirmation
+	beq ATTOP_WRITE_COMMAND,le_parse_att_write_command
+	rtn
+
+
+le_send_att_exchange_mtu_requset:
+	force 3,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_EXCHANGE_MTU_REQUEST
+	istore 1,contw
+	fetch 2,mem_le_local_mtu
+	istore 2,contw
+	rtn
+
+
+le_parse_att_exchange_mtu_request:
+	call le_parse_att_exchange_mtu_response
+le_send_att_exchange_mtu_response:
+	force 3,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_EXCHANGE_MTU_RESPONSE
+	istore 1,contw
+	fetch 2,mem_le_local_mtu
+	istore 2,contw
+	rtn
+
+le_parse_att_exchange_mtu_response:
+	rshift8 pdata,pdata
+	store 2,mem_le_remote_mtu
+	rtn
+
+le_parse_att_find_information_request:
+	call le_get_search_handle_start_end_common
+	call enable_user
+	branch le_send_att_find_information_response
+	
+le_send_att_find_information_response:
+	arg 3,timeup
+	call le_init_attlist_search
+le_send_att_find_information_res_loop:
+	call le_att_handle_inrange
+	branch le_send_att_find_information_res_end,blank
+	nbranch le_send_att_find_information_res_next,positive
+	increase -2,contr
+	call store_contr
+	call get_contw
+	nbranch le_send_att_find_information_res_store_info,user
+	call push_stack_rega_b_c
+	call disable_user
+	storer timeup,4,mem_timeup
+	force 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	fetchr timeup,4,mem_timeup
+	call pop_stack_rega_b_c
+	setarg ATTOP_FIND_INFORMATION_RESPONSE
+	istore 1,contw
+	setarg UUID_SIZE_16BIT
+	istore 1,contw
+le_send_att_find_information_res_store_info:
+	call get_contr
+	ifetch 2,contr
+	and_into 0xff,pdata
+	istore 2,contw
+	ifetch 1,contr
+	copy pdata,loopcnt
+	call memcpy
+	call store_contw
+	increase -1,timeup
+	branch le_send_att_find_information_res_end,zero
+le_send_att_find_information_res_cont:
+	ifetch 1,contr
+	iadd contr,contr
+	branch le_send_att_find_information_res_loop
+le_send_att_find_information_res_next:
+	ifetch 1,contr
+	iadd contr,contr
+	branch le_send_att_find_information_res_cont
+le_send_att_find_information_res_end:
+	branch le_send_att_error_response_notfound,user
+	branch le_send_auto_len_by_mem
+
+
+le_parse_att_find_by_type_value_request:
+	call le_get_search_handle_start_end_common
+	ifetch 2,contr
+	store 2,mem_le_search_uuid
+	call store_contr
+	arg mem_le_search_att_type_length,contw
+	fetch 2,mem_le_l2cap_size
+	increase -7,pdata
+	call le_get_search_common2
+	branch le_send_att_find_by_type_value_response
+
+
+le_start_end_handle_check_1:
+	disable user
+	fetcht 2,mem_le_search_handle_start
+	fetch 2,mem_le_search_handle_end
+	isub temp,null
+	nbranch le_start_end_handle_check_1_fail,positive
+	deposit temp
+	rtnne 0
+le_start_end_handle_check_1_fail:
+	enable user
+	jam ATT_ERR_INVALID_HANDLE,mem_le_err_code
+	branch le_send_att_error_response
+
+
+le_send_att_find_by_type_value_response:
+	call le_start_end_handle_check_1
+	rtn user
+	fetcht 2,mem_le_search_uuid
+	setarg UUID_GATT_PRIMARY_SERVICE
+	isub temp,null
+	branch le_send_att_find_by_type_value_res_primary,zero
+	branch le_send_att_error_response_notfound
+	
+
+le_send_att_find_by_type_value_res_primary:
+	jam LE_FIND_BY_TYPE_VAL_RES_NOT_FOUND,mem_le_search_res
+	fetcht 2,mem_le_search_handle_start
+	storet 2,mem_temp
+	call le_att_get_handle_info
+	nbranch le_send_att_error_response_notfound,blank
+le_send_att_find_primary_search_loop:
+	fetcht 2,mem_temp
+	call le_att_get_handle_info
+	nbranch le_send_att_error_response_notfound2,blank	
+	copy contr,rega
+	fetch 1,mem_le_curr_att_len
+	copy pdata,loopcnt
+	fetcht 1,mem_le_search_att_type_length
+	isub temp,null
+	nbranch le_send_att_find_primary_search_loop1,zero
+	arg mem_le_search_att_type,regb
+	call string_compare
+
+	branch le_send_att_find_primary_search_end_start_handle_found,zero
+
+	fetch 2,mem_le_cur_uuid
+	fetcht 2,mem_le_search_uuid
+	isub temp,null
+	branch le_send_att_find_primary_search_end_ending_handle_found,zero
+le_send_att_find_primary_search_loop1:
+	fetch 2,mem_temp
+	increase 1,pdata
+	store 2,mem_temp
+	branch le_send_att_find_primary_search_loop
+
+le_send_att_error_response_notfound2:
+	fetch 1,mem_le_search_res
+	beq LE_FIND_BY_TYPE_VAL_RES_FOUND_STARTING_HANDLE,le_send_att_find_primary_search_end_ending_handle_found
+	branch le_send_att_error_response_notfound
+
+	
+le_send_att_find_primary_search_end_start_handle_found:
+	fetch 2,mem_le_cur_uuid
+	fetcht 2,mem_le_search_uuid
+	isub temp,null
+	nbranch  le_send_att_find_primary_search_loop1,zero
+	jam LE_FIND_BY_TYPE_VAL_RES_FOUND_STARTING_HANDLE,mem_le_search_res
+//	copy rega,temp
+	fetcht 2,mem_temp
+	storet 2,mem_le_cur_handle_start
+	branch le_send_att_find_primary_search_loop1
+
+le_send_att_find_primary_search_end_ending_handle_found:
+	fetch 1,mem_le_search_res
+	beq LE_FIND_BY_TYPE_VAL_RES_NOT_FOUND,le_send_att_find_primary_search_loop1
+	jam LE_FIND_BY_TYPE_VAL_RES_FOUND_ENDING_HANDLE,mem_le_search_res
+	fetcht 2,mem_temp
+	increase -1,temp
+	storet 2,mem_le_cur_handle_end
+	
+le_send_att_find_primary_search_end:
+	arg 5,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_FIND_BY_TYPE_VALUE_RESPONSE
+	istore 1,contw
+	fetch 2,mem_le_cur_handle_start
+	istore 2,contw
+	fetch 2,mem_le_cur_handle_end
+	istore 2,contw
+	rtn
+
+
+
+le_parse_att_read_by_type_request:
+	call le_get_search_handle_start_end_common
+	call le_get_search_att_type
+	branch le_send_att_read_by_type_response
+	
+le_send_att_read_by_type_response:
+	fetcht 2,mem_le_search_handle_start
+	storet 2,mem_temp
+	call le_init_attlist_search
+	call le_att_get_handle_ptr2
+	increase -2,contr
+	copy contr,pdata
+	store 2,mem_le_cur_attlist_start_ptr
+
+	fetcht 2,mem_le_search_att_type
+	setarg UUID_CHRCTR_DEVICE_NAME
+	isub temp,null
+	branch le_send_att_read_by_type_res_device_name,zero
+	setarg UUID_GATT_CHARACTERISTIC
+	isub temp,null
+	nbranch le_send_att_read_by_type_res_not_characteristic,zero
+	arg 2,timeup
+le_send_att_read_by_type_response_loop:
+	call le_att_check_handle_end
+	nbranch le_send_att_read_by_type_response_end,positive
+	fetcht 2,mem_temp
+	call le_att_get_handle_info_from_ptr
+	nbranch le_send_att_read_by_type_response_end,blank
+	call le_att_same_type
+	nbranch le_send_att_read_by_type_response_next_handle,zero
+	nbranch le_send_att_read_by_type_res_found_next,user
+	disable user
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BY_TYPE_RESPONSE
+	istore 1,contw
+	copy contw,alarm
+	increase 1,contw
+	
+	call le_send_att_read_by_type_write_properties
+	call le_att_next_handle
+	call le_att_get_handle_info_from_ptr
+	call le_send_att_read_by_type_write_uuid
+	fetch 1,mem_le_cur_uuid_length
+	add pdata,5,rega
+	istorer rega,1,alarm
+	
+	sub rega,7,null
+	ncall enable_user2,zero
+	call disable_user2,zero
+ 	call le_get_search_max_mtu_data
+	idiv rega
+	call wait_div_end
+	quotient timeup
+	increase -1,timeup
+	branch le_send_att_read_by_type_response_end,zero
+le_send_att_read_by_type_response_next_handle:
+	call le_att_next_handle
+	branch le_send_att_read_by_type_response_loop
+le_send_att_read_by_type_response_end:
+	branch le_send_att_error_response_notfound,user
+	branch le_send_auto_len_by_mem
+
+le_send_att_read_by_type_res_found_next:
+	call le_store_att_record
+	call le_att_next_handle
+	call le_att_get_handle_info_from_ptr
+	call le_send_att_read_by_type_res_check_pair_length_type
+	nbranch le_send_att_read_by_type_response_end,blank
+
+	call get_contw
+	fetch 2,mem_temp
+	increase -1,pdata
+	istore 2,contw
+	call le_write_att_record_common
+	call le_send_att_read_by_type_write_uuid
+	increase -1,timeup
+	branch le_send_att_read_by_type_response_end,zero
+	branch le_send_att_read_by_type_response_next_handle
+
+	
+le_send_att_read_by_type_write_properties:
+	fetch 2,mem_temp
+	istore 2,contw
+	
+	fetch 1,mem_le_curr_att_len
+	copy pdata,loopcnt
+	call get_contr
+	call memcpy_fast
+	branch store_contw
+le_send_att_read_by_type_write_uuid:
+	call get_contw
+	fetch 2,mem_temp
+	istore 2,contw
+	call store_contw
+	fetch 1,mem_le_cur_uuid_length
+	copy pdata,loopcnt
+	call get_contw	
+	call get_contr
+	isub loopcnt,contr
+	increase -1,contr
+	call memcpy_fast
+	branch store_contw
+
+
+
+le_send_att_read_by_type_res_not_characteristic:
+	call le_att_get_short_uuid_ptr
+	branch le_send_att_error_response_notfound,blank
+	copy contr,regc
+	increase -5,contr // point to handle
+	ifetch 2,contr
+	store 2,mem_temp
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BY_TYPE_RESPONSE
+	istore 1,contw
+	ifetch 1,regc
+	copy pdata,loopcnt
+	increase 2,pdata
+	istore 1,contw
+	fetch 2,mem_temp
+	istore 2,contw
+	add regc,1,contr
+	call memcpy_fast
+	call store_contw
+	branch le_send_auto_len_by_mem
+
+	
+
+le_send_att_read_by_type_res_device_name:
+	arg UUID_CHRCTR_DEVICE_NAME,temp
+	call le_att_get_short_uuid_ptr
+	rtn blank
+	increase -5,contr // point to handle
+	ifetch 2,contr		
+	store 2,mem_temp
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BY_TYPE_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_name_len
+	copy pdata,loopcnt
+	increase 2,pdata
+	istore 1,contw
+	fetch 2,mem_temp
+	istore 2,contw
+	arg mem_le_name,contr
+	call memcpy_fast
+	call store_contw
+	branch le_send_auto_len_by_mem
+
+
+
+le_parse_att_read_request:
+	call le_check_encrypt_state
+	fetcht 2,mem_le_att_handle
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_READ_AUTH,le_send_att_read_response_check_auth
+
+//input:temp is handle
+le_send_att_read_response:
+	call le_att_get_handle_ptr2
+	nbranch le_send_att_error_response_notfound,zero
+	call le_send_att_read_response_check_handle,user
+	rtn user
+	call le_att_get_handle_ptr_found
+	increase -2,contr
+	ifetch 2,contr
+	arg UUID_CHRCTR_DEVICE_NAME,temp
+	isub temp,null
+	branch le_send_device_name,zero
+	ifetch 1,contr
+	sub pdata,22,null
+	branch le_send_att_read_response_less,positive
+	force 22,pdata
+le_send_att_read_response_less:
+	copy pdata,regc
+	call store_contr
+	add regc,1,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_RESPONSE
+	istore 1,contw
+	copy regc,loopcnt
+	call get_contr
+	branch memcpy
+
+le_send_device_name:
+	call store_contr
+	fetch 1,mem_le_name_len
+	add pdata,1,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_name_len
+	copy pdata,loopcnt
+	arg mem_le_name,contr
+	branch memcpy
+	
+	
+le_send_att_read_response_check_auth:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_read_response,zero
+	nbranch le_send_att_read_response,user
+le_send_att_read_response_error_insufficient_auth:
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+
+le_send_att_read_response_check_handle:
+	increase -2,contr
+	ifetch 2,contr
+	bbit1 BIT_OF_ATT_HANDLE_READ_AUTHENTICATED,le_send_att_read_response_error_insufficient_auth
+	branch disable_user
+
+le_parse_att_read_blob_request:
+	ifetch 2,contr
+	store 2,mem_le_att_offset
+le_send_att_read_blob_response:
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BLOB_RESPONSE
+	istore 1,contw
+	fetch 2,mem_le_att_offset
+	iforce rega
+	fetcht 2,mem_le_att_handle
+	call le_att_get_handle_ptr 
+	branch le_send_att_error_response_notfound,blank
+	ifetch 1,contr
+	isub rega,loopcnt
+	nbranch le_send_att_error_response_notfound,positive
+	sub loopcnt,22,null
+	branch le_send_att_read_blob_response_less,positive
+	force 22,loopcnt
+le_send_att_read_blob_response_less:
+	deposit rega
+	iadd contr,contr
+	call memcpy_fast
+	call store_contw
+	branch le_send_auto_len_by_mem
+
+
+//查询server
+le_parse_att_read_by_group_type_request:
+	call le_get_search_handle_start_end_common
+ 	call le_get_search_att_type
+	branch le_send_att_read_by_group_type_response
+
+
+//mem_le_search_att_type
+//mem_le_search_handle_start
+//mem_le_search_handle_end
+le_send_att_read_by_group_type_response:
+	arg 2,timeup
+	fetcht 2,mem_le_search_handle_start
+	storet 2,mem_temp
+	call le_att_get_handle_ptr2
+	increase -2,contr
+	copy contr,pdata
+	store 2,mem_le_cur_attlist_start_ptr
+le_send_att_read_by_group_type_response_loop:
+	call le_att_check_handle_end		//check current handle >= ending handle
+	nbranch le_send_att_read_by_group_type_end0,positive
+	fetcht 2,mem_temp
+	call le_att_get_handle_info_from_ptr	//get current handle info
+	nbranch le_send_att_read_by_group_type_end1,blank
+
+	call le_att_same_type				//compair attr group type
+	nbranch le_send_att_read_by_group_type_next_handle,zero
+	copy timeup,pdata
+	beq 0,le_send_att_read_by_group_type_end1	//loop count
+	nbranch le_send_att_read_by_group_type_store_write_record,user		//un first
+	disable user
+	//first att uuid
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BY_GROUP_TYPE_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_curr_att_len
+	add pdata,4,rega
+	istorer rega,1,contw
+	call store_contw
+	sub rega,6,null
+	ncall enable_user2,zero
+	call disable_user2,zero
+ 	call le_get_search_max_mtu_data
+	idiv rega
+	call wait_div_end
+	quotient timeup
+	branch le_send_att_read_by_group_type_store_record
+le_send_att_read_by_group_type_store_write_record:
+	call le_send_att_read_by_group_type_check_pair_length_type
+	nbranch le_send_att_read_by_group_type_end1,blank
+	fetch 2,mem_temp
+	increase -1,pdata
+	store 2,mem_le_cur_handle_end
+	call le_write_att_record
+le_send_att_read_by_group_type_store_record:
+	fetch 2,mem_temp
+	store 2,mem_le_cur_handle_start
+	call le_store_att_record
+	increase -1,timeup
+//	branch le_send_att_read_by_group_type_last_find,zero		
+le_send_att_read_by_group_type_next_handle:
+	call le_att_next_handle
+	branch le_send_att_read_by_group_type_response_loop
+
+le_send_att_read_by_type_res_check_pair_length_type:
+	fetch 1,mem_le_cur_uuid_length
+	branch le_send_att_read_by_group_type_check_pair_length_type+1
+
+//output:blank is same
+le_send_att_read_by_group_type_check_pair_length_type:
+	fetch 1,mem_le_curr_att_len
+	branch le_send_att_read_by_group_type_check_pair_length_type_16byte,user2
+	increase -2,pdata
+	rtn
+
+le_send_att_read_by_group_type_check_pair_length_type_16byte:
+	increase -16,pdata
+	rtn
+
+le_send_att_read_by_group_type_end0:	//> att handle end
+	fetch 2,mem_temp
+	store 2,mem_le_cur_handle_end
+	branch le_send_att_read_by_group_type_end_common
+le_send_att_read_by_group_type_end1:	//>att max list handle or diff len 
+	fetch 2,mem_temp
+	increase -1,pdata
+	store 2,mem_le_cur_handle_end
+	branch le_send_att_read_by_group_type_end_common
+le_send_att_read_by_group_type_end_common:
+	branch le_send_att_error_response_notfound,user
+	call le_write_att_record
+	branch le_send_auto_len_by_mem
+
+
+
+
+le_parse_att_write_request:
+	copy contr,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-3,regb
+	call le_writeatt_cb
+le_send_att_write_response_check_auth:
+	call le_check_encrypt_state
+	fetcht 2,mem_le_att_handle
+	call le_att_get_handle_ptr2
+	nbranch le_send_att_write_response_error_invalid_handle,zero
+	call le_send_att_write_response_check_handle,user
+	rtn user
+
+	fetch 1,mem_le_configuration
+	bbit0 BIT_BLE_WRITE_AUTH,le_send_att_write_response
+
+	fetcht 2,mem_le_att_handle
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_write_response,zero
+	call le_check_encrypt_state
+	nbranch le_send_att_write_response,user
+	branch le_send_att_read_response_error_insufficient_auth
+
+
+le_send_att_write_response:
+	force 1,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_WRITE_RESPONSE
+	istore 1,contw
+	rtn
+
+le_send_att_write_response_check_handle:
+	increase -2,contr
+	ifetch 2,contr
+	bbit1 BIT_OF_ATT_HANDLE_WRITE_AUTHENTICATED,le_send_att_read_response_error_insufficient_auth
+	branch disable_user
+
+le_send_att_write_response_error_invalid_handle:
+	jam ATT_ERR_INVALID_HANDLE,mem_le_err_code
+	branch le_send_att_error_response
+
+
+le_check_encrypt_state:
+	call disable_user
+	fetch 1,mem_le_pairing_mode
+	rtneq LE_PAIRING_MODE_NONE
+	fetch 1,mem_context
+	rtnbit1 lestate_encryption
+	branch enable_user
+
+
+le_parse_att_prepare_write_request:
+	add contr,2,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-5,regb
+	call le_writeatt_cb
+	branch le_send_att_prepare_write_response
+
+
+le_send_att_prepare_write_response:
+	fetch 2,mem_le_l2cap_size
+	copy pdata,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_PREPARE_WRITE_RESPONSE
+	istore 1,contw
+	fetch 2,mem_le_att_handle
+	istore 2,contw
+	fetch 2,mem_le_l2cap_size
+	add pdata,-5,loopcnt	
+	fetch 2,mem_le_payload_ptr
+	add pdata,7,contr
+	ifetch 2,contr		//offset
+	istore 2,contw
+	branch memcpy_fast
+
+
+
+le_parse_att_execute_write_request:
+
+le_send_att_execute_write_response:
+	force 1,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_EXECUTE_WRITE_RESPONSE
+	istore 1,contw
+	rtn
+
+le_parse_handle_value_confirmation:
+	fetch 1,mem_le_l2cap_att_states
+	set0 BLE_L2CAP_RECV_CONFIRMATION_PACKET,pdata
+	store 1,mem_le_l2cap_att_states
+	rtn
+
+le_parse_att_write_command:
+	copy contr,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-3,regb
+	branch le_writeatt_cb
+
+
+
+//rga:len temp:handle;rgea,regb,regc already used
+le_att_malloc_tx_notify:
+	copy temp,regc
+	increase 3,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	increase -3,rega
+	setarg ATTOP_HANDLE_VALUE_NOTIFICATION
+	istore 1,contw
+	copy regc,temp
+	istoret 2,contw
+	rtn
+
+//rga:len temp:handle;rgea,regb,regc already used
+le_att_malloc_tx_indication:
+	fetch 1,mem_le_l2cap_att_states
+	set1 BLE_L2CAP_SEND_INDICATION_PACKET,pdata
+	store 1,mem_le_l2cap_att_states
+	copy temp,regc
+	increase 3,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	increase -3,rega
+	setarg ATTOP_HANDLE_VALUE_INDICATION
+	istore 1,contw
+	copy regc,temp
+	istoret 2,contw
+	rtn
+
+
+///////////////////////////ATT common function////////////////////////////////////
+
+le_send_att_error_response_notfound:	
+	jam ATT_ERR_ATTRIBUTE_NOT_FOUND,mem_le_err_code
+le_send_att_error_response:	
+	force 5,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_ERROR_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_att_opcode
+	istore 1,contw
+	fetch 2,mem_le_att_handle
+	istore 2,contw
+	fetch 1,mem_le_err_code
+	istore 1,contw
+	rtn
+
+
+le_fifo_malloc_tx_l2cap_gatt:
+	force LE_L2CAP_CID_ATT,regb
+	branch le_fifo_malloc_tx_l2cap
+
+
+le_att_next_handle:
+	fetcht 2,mem_temp
+	increase 1,temp
+	storet 2,mem_temp
+	rtn
+
+le_att_check_handle_end:
+	fetcht 2,mem_temp
+	fetch 2,mem_le_search_handle_end
+	isub temp,null
+	rtn
+
+
+le_att_same_type:
+	fetcht 1,mem_le_search_att_type_length
+	arg mem_le_search_att_type,rega
+le_att_check_same_common:
+	fetch 1,mem_le_cur_uuid_length
+	copy pdata,loopcnt
+	isub temp,null
+	nrtn zero
+	arg mem_le_cur_uuid ,regb
+	branch string_compare
+
+le_att_same_uuid:
+	fetcht 1,mem_le_search_uuid_length
+	arg mem_le_search_uuid,rega
+	branch le_att_check_same_common
+
+
+le_store_att_record:
+	fetch 1,mem_le_curr_att_len
+	store 1, mem_tmp_buffer
+	copy pdata,loopcnt
+	call get_contr
+	branch memcpy_fast
+
+
+le_write_att_record:
+	call get_contw
+	fetch 2,mem_le_cur_handle_start
+	istore 2,contw
+	fetch 2,mem_le_cur_handle_end
+	istore 2,contw
+le_write_att_record_common:
+	fetch 1,mem_tmp_buffer
+	copy pdata,loopcnt
+	call memcpy_fast
+	branch store_contw
+
+
+
+le_send_auto_len_by_mem:
+	call get_contw
+	call le_fifo_get_last_att_ptr
+	copy contw,pdata
+	isub contr,rega
+	call le_fifo_get_last_l2cap_ptr
+	copy rega,pdata
+	istore 2,contr
+	increase 4,rega
+	call le_fifo_get_last_tx_ptr
+	copy rega,pdata
+	istore 1,contr
+	rtn
+
+
+le_get_search_handle_start_end_common:
+	rshift8 pdata,pdata
+	store 2,mem_le_search_handle_start
+	ifetch 2,contr
+	store 2,mem_le_search_handle_end
+	rtn
+
+le_get_search_max_mtu_data:
+	fetch 2,mem_le_remote_mtu
+	increase -2,pdata
+	//-2原因
+	//uint8_t attribute opcode
+	//uint8_t length
+	fetcht 2,mem_le_local_mtu
+	increase -2,temp
+	call not_greater_than
+	arg 240,temp
+	call not_greater_than
+	//pdata is max mtu size
+	rtn
+
+le_get_search_att_type:
+	call store_contr
+	arg mem_le_search_att_type_length,contw
+le_get_search_common:	
+	fetch 2,mem_le_l2cap_size
+	increase -5,pdata
+le_get_search_common2:		
+	istore 1,contw
+	copy pdata,loopcnt
+	call get_contr
+	branch memcpy_fast	
+
+
+
+le_parse_writing_attribute_start:
+	fetch 2,mem_le_rxbuf_data_att_cid//CID
+	rtnne LE_L2CAP_CID_ATT
+	fetch 1,mem_le_l2cap_att_states
+	set1 BLE_L2CAP_DEAL_WITH_CONTINUE_PACKET,pdata
+	store 1,mem_le_l2cap_att_states
+	fetch 3,mem_le_rxbuf_data_att_opcode
+	store 3,mem_le_att_opcode
+	set1 mark_old_packet,mark
+	beq ATTOP_WRITE_REQUEST,le_parse_attribute_write_request
+	beq ATTOP_WRITE_COMMAND,le_parse_attribute_write_command
+	beq ATTOP_EXECUTE_WRITE_REQUEST,le_parse_att_execute_write_request
+	beq ATTOP_EXCHANGE_MTU_REQUEST,le_parse_att_exchange_mtu_request
+	beq ATTOP_HANDLE_VALUE_CONFIRMATION,le_parse_handle_value_confirmation
+	set0 mark_old_packet,mark
+le_clear_l2cap_att_states_deal_with_contiune_packet:
+	fetch 1,mem_le_l2cap_att_states
+	set0 BLE_L2CAP_DEAL_WITH_CONTINUE_PACKET,pdata
+	store 1,mem_le_l2cap_att_states
+	rtn
+
+le_parse_writing_attribute_continue:
+	fetch 1,mem_le_l2cap_att_states
+	rtnbit0 BLE_L2CAP_DEAL_WITH_CONTINUE_PACKET
+	set1 mark_old_packet,mark
+	call le_parse_l2cap_continue_common
+	call le_parse_attribute_check_complete_packet
+	call le_clear_l2cap_att_states_deal_with_contiune_packet,user
+	fetch 1,mem_le_att_opcode
+	beq ATTOP_WRITE_REQUEST,le_send_att_write_response_check_auth
+	rtn
+
+
+le_parse_attribute_write_request:
+	call le_parse_attribute_write_command
+	branch le_send_attribute_write_response_check_auth
+
+le_send_attribute_write_response_check_auth:
+	call le_parse_attribute_check_complete_packet
+	nrtn user
+	branch le_send_att_write_response_check_auth
+
+
+le_parse_attribute_write_command:
+	call le_parse_attribute_check_complete_packet_init
+	arg mem_le_rxbuf_data_att_write_payload,rega
+	branch le_writeatt_cb
+
+
+le_parse_attribute_check_complete_packet_init:
+	fetch 1,mem_le_rxbuf_data_att_write_length
+	add pdata,-7,regb
+	increase -4,pdata
+	store 2,mem_le_packet_len_recved	//payload length
+	fetcht 2,mem_le_rxbuf_data_att_write_l2cap_length	//l2cap length
+	storet 2,mem_le_l2cap_size
+	rtn
+
+
+le_parse_l2cap_continue_common:
+	fetchr regb,1,mem_le_rxbuf_data_continue_length
+	fetch 2,mem_le_packet_len_recved
+	iadd regb,temp
+	storet 2,mem_le_packet_len_recved
+	arg mem_le_rxbuf_data_continue_payload,rega
+	branch le_writeatt_cb
+
+
+//enable user,recevie complete packet
+le_parse_attribute_check_complete_packet:
+	call disable_user
+	fetch 2,mem_le_packet_len_recved
+	fetcht 2,mem_le_l2cap_size
+	isub temp,null
+	nrtn zero
+	branch enable_user
+
Index: program/ble_protocol_stack/le_l2cap_att_wechat.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_l2cap_att_wechat.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_l2cap_att_wechat.prog	(working copy)
@@ -0,0 +1,276 @@
+
+ifdef COMPILE_WECHAT
+
+/*
+	function name:le_l2cap_att_receive_data_check_wechat_air_sync_protocol
+	依据微信蓝牙外设协议1.0.4
+	输入:
+		rega is le rx data address
+		regb is le rx data length
+		mem_le_att_handle is write handle
+	输出:
+		user enable 是微信协议
+		disable不是微信协议
+*/
+le_l2cap_att_receive_data_check_wechat_air_sync_protocol:
+	call enable_user
+	fetch 2,mem_le_wechat_air_sync_ptr
+	rtn blank
+	arg le_l2cap_att_receive_data_deal_wechat_air_sync_protocol,regc
+	branch wechat_air_sync_calc_function
+le_l2cap_att_receive_data_deal_wechat_air_sync_protocol:
+	fetcht 2,mem_le_att_handle
+	fetch 1,mem_wechat_indication_handle
+	pincrease 1
+	isub temp,null
+	branch wechat_air_sync_enable_indicate_chara,zero
+	fetch 1,mem_wechat_write_handle
+	isub temp,null
+	branch wechat_air_sync_receive_wechat_data,zero
+	branch disable_user
+	
+wechat_air_sync_enable_indicate_chara:
+	call wechat_air_sync_reset_nSeq
+wechat_air_sync_send_request_auth:
+	call wechat_air_sync_init_authreq_base_request
+	arg mem_wechat_authreq_base_request,rega
+	arg ECI_REQ_AUTH_MESSAGE_LENGTH,loopcnt
+	arg ECI_REQ_AUTH,temp
+	branch wechat_air_sync_send_message
+
+wechat_air_sync_receive_wechat_data:
+	fetch 1,mem_wechat_receive_push_data
+	beq 1,wechat_air_sync_receive_wechat_data_contiune_packet
+	ifetch 2,rega
+	arg WECHAT_RX_HEAD,temp
+	isub temp,null
+	branch wechat_air_sync_receive_wechat_data_head_packet,zero
+wechat_air_sync_receive_wechat_data_contiune_packet:
+	fetch 2,mem_wechat_rx_len
+	iadd regb,pdata
+	store 2,mem_wechat_rx_len	
+	fetch 2,mem_wechat_rx_address
+	copy pdata,contw
+	copy rega,contr
+	copy regb,loopcnt
+	call memcpy_fast
+	copy contw,pdata
+	store 2,mem_wechat_rx_address
+	branch wechat_air_sync_receive_wechat_packet_complete
+
+
+wechat_air_sync_receive_wechat_data_head_packet:
+	fetch 2,mem_wechat_rx_buffer_ptr
+	copy pdata,contw
+	copy rega,contr
+	copy regb,loopcnt
+	call memcpy_fast
+	copy contw,pdata
+	store 2,mem_wechat_rx_address
+	storer regb,2,mem_wechat_rx_len
+	fetchr regc,2,mem_wechat_rx_buffer_ptr
+	add regc,WECHAT_PROTOCOL_MESSAGE_N_CMD_ID,contr
+	ifetch 2,contr
+	arg ECI_PUSH_RECEIVE_DATA,temp
+	isub temp,null
+	call wechat_air_sync_receive_wechat_push_data,zero
+	branch wechat_air_sync_receive_wechat_packet_complete
+
+wechat_air_sync_receive_wechat_push_data:
+	jam 1,mem_wechat_receive_push_data
+	rtn
+
+wechat_air_sync_receive_wechat_packet_complete:
+	fetch 2,mem_wechat_rx_len
+	fetchr regc,2,mem_wechat_rx_buffer_ptr
+	add regc,WECHAT_PROTOCOL_MESSAGE_N_LENGTH,contr
+	ifetcht 2,contr
+	byteswap temp,temp
+	isub temp,null
+	nrtn positive
+	jam 0,mem_wechat_receive_push_data
+	fetchr regc,2,mem_wechat_rx_buffer_ptr
+	add regc,WECHAT_PROTOCOL_MESSAGE_N_CMD_ID,contr
+	ifetch 2,contr
+	arg ECI_RESPONSE_AUTH,temp
+	isub temp,null
+	branch wechat_air_sync_receive_wechat_data_auth_respone,zero
+	arg ECI_PUSH_RECEIVE_DATA,temp
+	isub temp,null
+	branch wechat_air_sync_receive_wechat_data_push_receive_data,zero
+	rtn
+
+wechat_air_sync_receive_wechat_data_auth_respone:
+wechat_air_sync_wechat_send_request_init:
+	call wechat_air_sync_init_authreq_base_request
+	arg mem_wechat_initreq_base_request,rega
+	arg ECI_REQ_INIT_MESSAGE_LENGTH,loopcnt
+	arg ECI_REQ_INIT,temp
+	branch wechat_air_sync_send_message
+
+
+//接收数据的回调，可以使用wechat_air_sync_check_push_data_struct解析函数
+wechat_air_sync_receive_wechat_data_push_receive_data:
+
+	fetch 2,mem_wechat_rx_push_data_cb
+	branch callback_func
+
+/*
+数据解析默认函数，不能保证全部数据格式都能解析
+输出:disable user is no data
+	loopcnt is data length
+	contr is data ptr
+*/
+wechat_air_sync_check_push_data_struct:
+	call disable_user
+	fetchr regc,2,mem_wechat_rx_buffer_ptr
+	add regc,WECHAT_PROTOCOL_MESSAGE_PAYLOAD,contr
+	ifetch 2,contr
+	rtnne TAG_RecvDataPush_BasePush
+	ifetch 1,contr
+	rtnne TAG_RecvDataPush_Data
+	ifetch 1,contr
+	rtn blank
+	copy pdata,loopcnt
+	copy contr,regc
+	branch enable_user
+
+
+wechat_air_sync_send_message:
+	call enable_user2
+wechat_air_sync_send_message_without_payload:
+	fetch 2,mem_wechat_tx_buffer_ptr
+	store 2,mem_wechat_tx_address
+	copy pdata,contw
+	setarg WECHAT_HEAD_MAGIC_NUMBER
+	istore 1,contw			//bMagicNumber
+	setarg WECAHT_HEAD_VERSION
+	istore 1,contw			//bVer
+	add loopcnt,8,regd	//nLength
+	byteswap regd,pdata
+	istore 2,contw			//nLength
+	istoret 2,contw			//nCmdId
+	fetcht 2,mem_wechat_tx_nSeq
+	istoret 2,contw			//Tx nSeq
+	copy contw,regc
+	copy rega,contr
+	call memcpy_fast,user2
+	storer regd,2,mem_wechat_tx_len
+	branch wechat_air_sync_update_nSeq
+	
+wechat_air_sync_update_nSeq:
+	byteswap temp,pdata
+	pincrease 1
+	byteswap pdata,pdata
+	nbranch wechat_air_sync_store_nSeq,blank
+wechat_air_sync_reset_nSeq:
+	setarg 0x0100
+wechat_air_sync_store_nSeq:
+	store 2,mem_wechat_tx_nSeq
+	rtn
+
+
+wechat_air_sync_init_authreq_base_request:
+	setarg 0x000a
+	store 2,mem_wechat_authreq_base_request
+	setarg 0x048084
+	lshift8 pdata,pdata
+	or pdata,0x18,pdata
+	store 4,mem_wechat_authreq_protocol_version
+	setarg 0x0120
+	store 2,mem_wechat_authreq_auth_protocol
+	setarg 0x0228
+	store 2,mem_wechat_authreq_eam_mac_no_encrypt
+	setarg 0x063a
+	store 2,mem_wechat_authreq_mac_address
+	fetch 6,mem_le_lap
+	call inverse_data_6Byte
+	store 6,mem_wechat_authreq_device_address
+	rtn
+
+wechat_air_sync_ble_transmit_wechat_message:
+	fetch 1,mem_le_l2cap_att_states
+	rtnbit1 BLE_L2CAP_RECV_CONFIRMATION_PACKET
+	call le_fifo_check_nearly_full
+	nrtn blank				//no fifo
+	fetch 2,mem_le_wechat_air_sync_ptr
+	rtn blank
+	arg wechat_air_sync_ble_send_wechat_message,regc
+	branch wechat_air_sync_calc_function
+
+wechat_air_sync_ble_send_wechat_message:
+	call module_get_le_remote_mtu
+	fetch 2,mem_wechat_tx_len
+	rtn blank
+	add temp,-3,pdata		//sub handle and opcode
+	fetcht 2,mem_wechat_tx_len
+	call not_greater_than
+	copy pdata,rega
+	copy temp,pdata
+	isub rega,pdata
+	store 2,mem_wechat_tx_len
+	fetcht 1,mem_wechat_indication_handle
+	call le_att_malloc_tx_indication
+	fetch 2,mem_wechat_tx_address
+	copy pdata,contr
+	copy rega,loopcnt
+	call memcpy_fast
+	copy contr,pdata
+	store 2,mem_wechat_tx_address
+	rtn
+
+
+wechat_air_sync_calc_function:
+	call wechat_air_sync_load_in_local_buffer
+	copy regc,pdata
+	call callback_func
+	branch wechat_air_sync_store_in_global_buffer
+
+
+wechat_air_sync_load_in_local_buffer:
+	fetch 2,mem_le_wechat_air_sync_ptr
+	rtn blank
+	copy pdata,contr
+	arg WECHAT_AIR_SYNC_STRUCT_SIZE,loopcnt
+	arg mem_wechat_indication_handle,contw
+	branch memcpy_fast
+
+wechat_air_sync_store_in_global_buffer:
+	fetch 2,mem_le_wechat_air_sync_ptr
+	rtn blank
+	copy pdata,contw
+	arg WECHAT_AIR_SYNC_STRUCT_SIZE,loopcnt
+	arg mem_wechat_indication_handle,contr
+	branch memcpy_fast
+
+
+//input:rega is data ptr
+//regb is data length
+wechat_air_sync_send_wechat_packet:
+	call enable_user
+	fetch 2,mem_le_wechat_air_sync_ptr
+	rtn blank
+	arg wechat_air_sync_send_wechat_packet_cb,regc
+	branch wechat_air_sync_calc_function
+
+wechat_air_sync_send_wechat_packet_cb:
+	fetch 2,mem_wechat_tx_len
+	nrtn blank
+	call disable_user
+	call disable_user2
+	add regb,6,loopcnt
+	arg ECI_REQ_SEND_DATA,temp
+	call wechat_air_sync_send_message_without_payload
+	copy regc,contw
+	setarg 0x12000a
+	istore 3,contw
+	istorer regb,1,contw
+	copy rega,contr
+	copy regb,loopcnt
+	call memcpy_fast
+	setarg 0x0018
+	istore 2,contw
+	rtn
+
+endif
+
Index: program/ble_protocol_stack/le_l2cap_signalling.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_l2cap_signalling.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_l2cap_signalling.prog	(working copy)
@@ -0,0 +1,54 @@
+
+
+le_parse_signaling:
+	ifetch 1,contr
+	ifetcht 1,contr //id
+	ifetcht 2,contr //length
+	beq L2CAP_CONNECTION_PARAMETER_UPDATE_RESPONSE,le_l2cap_parse_conn_parameter_update_rsp
+	rtn
+le_l2cap_parse_conn_parameter_update_rsp:
+	ifetch 2,contr	//result
+	store 2,mem_le_l2cap_signaling_conn_param_update_rsp_result
+	jam BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+//mem_le_interval_min:the ptr that connection parameter,
+//include 	ConnIntervalMin,ConnIntervalMax,
+//		ConnSlaveLatency,ConnSupervisionTimeout
+le_l2cap_tx_update_req:
+	arg 0x0c,rega
+	arg L2CAP_CONNECTION_PARAMETER_UPDATE_REQUEST,regc
+	call le_fifo_malloc_tx_l2cap_signaling
+	setarg 0x08
+	istore 2,contw
+	fetch 8,mem_le_interval_min
+	istore 8,contw
+	rtn
+
+
+//rega:len regc:signaling opcode
+le_fifo_malloc_tx_l2cap_signaling:
+	call le_l2cap_update_signaling_identifier
+	arg LE_L2CAP_CID_SIGNAL,regb
+	call le_fifo_malloc_tx_l2cap
+	copy regc,pdata
+	istore 1,contw
+	fetch 1,mem_le_signaling_identifier
+	istore 1,contw
+	rtn
+
+
+le_l2cap_update_signaling_identifier:
+	fetch 1,mem_le_signaling_identifier
+	//beq 0xff,le_l2cap_signaling_identifier_set_1
+	pincrease 1
+	store 1,mem_le_signaling_identifier
+	rtnne 0
+	
+le_l2cap_reset_signaling_identifier:
+	jam 1,mem_le_signaling_identifier
+	rtn
+
+
+
Index: program/ble_protocol_stack/le_l2cap_smp.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_l2cap_smp.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_l2cap_smp.prog	(working copy)
@@ -0,0 +1,611 @@
+
+le_pairing_mode_init:
+	fetch  1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_NONE, le_set_no_pairing
+	beq LE_PAIRING_MODE_LAGACY_JUSTWORK,le_set_pairing_mode_lagacy_just_work
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY,le_set_pairing_mode_lagacy_passkey
+ifdef SECURE_CONNECTION
+	beq LE_PAIRING_MODE_SECURE_CONNECT_JUSTWORK,le_set_pairing_mode_secure_justwork
+	beq LE_PAIRING_MODE_SECURE_CONNECT_NUMERIC,le_set_pairing_mode_secure_numeric
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_set_pairing_mode_secure_passkey
+endif
+	rtn
+
+ifdef SECURE_CONNECTION	
+le_set_pairing_mode_secure_justwork:
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch le_set_noinputnooutput
+le_set_pairing_mode_secure_numeric:
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	jam FLAG_IOCAP_DISPLAYYESNO,mem_le_pres_iocap
+	rtn
+le_set_pairing_mode_secure_passkey:	
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch le_set_displayonly
+endif
+le_set_no_pairing:
+	jam FLAG_LE_NO_BONDING_NO_MITM,mem_le_pres_auth
+le_set_noinputnooutput:	
+	jam FLAG_IOCAP_NOINPUTNOOUTPUT,mem_le_pres_iocap
+	rtn
+le_set_pairing_mode_lagacy_just_work:
+	jam FLAG_LE_BONDING_MITM,mem_le_pres_auth
+	branch le_set_noinputnooutput
+le_set_pairing_mode_lagacy_passkey:
+	jam FLAG_LE_BONDING_MITM,mem_le_pres_auth
+le_set_displayonly:	
+	jam FLAG_IOCAP_DISPLAYONLY,mem_le_pres_iocap
+	rtn
+
+	
+le_secure_connection_enable:
+	fetch 1,mem_secure_connections_enable
+	set1 SECURE_CONNECTIONS_LE_BIT,pdata
+	store 1,mem_secure_connections_enable
+	rtn
+	
+le_secure_connection_disable:
+	fetch 1,mem_secure_connections_enable
+	set0 SECURE_CONNECTIONS_LE_BIT,pdata
+	store 1,mem_secure_connections_enable
+	rtn
+
+le_parse_smp:
+	ifetch 1,contr
+	beq SMP_PAIRING_REQUEST,le_parse_smp_pairing_request
+//	beq SMP_PAIRING_RESPONSE,le_parse_smp_pairing_response
+	beq SMP_PAIRING_CONFIRM,le_parse_smp_pairing_confirm
+	beq SMP_PAIRING_RANDOM,le_parse_smp_pairing_random
+	beq SMP_PAIRING_FAILED,le_parse_smp_pairing_failed
+//	beq SMP_ENCRYPTION_INFORMATION,le_parse_smp_encryption_information
+	beq SMP_MASTER_IDENTIFICATION,le_parse_smp_master_identification
+	beq SMP_IDENTITY_INFORMATION,le_parse_smp_identity_information
+	beq SMP_IDENTITY_ADDRESS_INFORMATION,le_parse_smp_identity_address_information
+	beq SMP_SIGNING_INFORMATION,le_parse_smp_signing_information
+	beq SMP_SECURITY_REQUEST,le_parse_smp_security_request
+ifdef SECURE_CONNECTION
+	beq SMP_PAIRING_PUBLIC_KEY,le_parse_smp_public_key
+	beq SMP_PAIRING_DHKEY_CHECK,le_parse_smp_dhkey_check
+endif
+	rtn
+
+
+
+le_send_smp_security_request:
+	force 2,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_SECURITY_REQUEST
+	istore 1,contw
+	fetch 1,mem_le_pres_auth
+	istore 1,contw
+	rtn
+		
+le_parse_smp_pairing_request:
+	store 1,mem_le_preq
+	ifetch 6,contr
+	istore 6,contw
+	fetch 1,mem_le_pairing_mode
+	beq  LE_PAIRING_MODE_NONE,le_smp_pairing_fail_reason_not_support_pairing
+	call le_send_smp_pairing_response
+	fetch 1,mem_sc_only_mode
+	branch le_parse_smp_pairing_request2, blank
+	fetch 1,mem_le_preq_auth
+	bbit0  LE_AUTH_SECURE_CONNECTION_PAIRING_BIT,app_ble_disconnect
+	fetch 1,mem_le_pairing_mode
+	bbit0 LE_PAIRING_MODE_SECURE_CONNECT_BIT,app_ble_disconnect
+le_parse_smp_pairing_request2:	
+	jam FLAG_LE_PAIRING_RCV_PAIRING_REQ,mem_le_pairing_state
+	fetch 1,mem_le_preq_iocap
+	beq  FLAG_IOCAP_DISPlAYONLY,le_set_tk_0
+	beq  FLAG_IOCAP_DISPLAYYESNO,le_set_tk_0
+	beq  FLAG_IOCAP_NOINPUTNOOUTPUT,le_set_tk_0
+	fetch 1,mem_le_pairing_mode	
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY,le_parse_smp_pairing_req_passkey
+	rtneq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY
+le_set_tk_0:
+	arg 0,pdata
+	store 4,mem_le_tk
+	rtn
+
+le_parse_smp_pairing_req_passkey:
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_PASSKEY_FIXED_KEY,le_parse_smp_pairing_req_fixed_passkey
+le_genernate_tk:
+	arg mem_le_tk,rega
+	copy rega,contw
+	arg 3,loopcnt
+	call generate_random_loop
+	fetch 2,mem_le_tk + 2
+	and_into 0x7,pdata
+	store 2,mem_le_tk + 2
+le_parse_smp_pairing_req_fixed_passkey:
+	jam BT_EVT_LE_TK_GENERATE,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+
+le_send_smp_pairing_response:
+	force 7,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	fetch 7,mem_le_pres
+	istore 7,contw
+	rtn
+		
+
+le_parse_smp_pairing_confirm:
+ifdef SECURE_CONNECTION
+	jam FLAG_LE_PAIRING_RECEIVE_PAIRING_CONFIRM,mem_le_pairing_state
+	arg mem_le_rconfirm,contw
+	call memcpy16
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_parse_smp_pairing_confirm_secure_passkey
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY_RES_INPUT,le_parse_smp_pairing_confirm_passkey_res_input
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT,le_parse_smp_pairing_confirm_sc_passkey_res_input
+endif
+	branch le_send_smp_pairing_confirm
+ifdef SECURE_CONNECTION
+le_parse_smp_pairing_confirm_secure_passkey:
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_PASSKEY_WAIT_CONFIRM,mem_le_secure_connect_state	
+	rtn
+endif
+
+
+le_parse_smp_pairing_confirm_passkey_res_input:
+	jam BT_EVT_LE_GET_PASSKEY,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+le_parse_smp_pairing_confirm_sc_passkey_res_input:
+	fetch 4,mem_le_tk
+	branch le_parse_smp_pairing_confirm_passkey_res_input,blank
+	branch le_parse_smp_pairing_confirm_secure_passkey
+
+
+le_send_smp_pairing_confirm:
+	jam FLAG_LE_PAIRING_SEND_PAIRING_CONFIRM,mem_le_pairing_state
+ifdef SECURE_CONNECTION
+	fetch 1,mem_le_pairing_mode
+	bbit1 LE_PAIRING_MODE_SECURE_CONNECT_BIT,le_send_smp_pairing_confirm_sc
+endif
+	call generate_confirm
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_CONFIRM
+	istore 1,contw
+	branch  store_aes_result
+
+	
+ifdef SECURE_CONNECTION
+le_send_smp_pairing_confirm_sc:
+	arg mem_le_srand,contw	
+	call generate_random
+	call function_f4_cb
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_CONFIRM
+	istore 1,contw
+	branch  load_inverse_result
+
+endif
+
+	
+le_parse_smp_pairing_random:	
+ifdef SECURE_CONNECTION
+	copy contr,rega
+	fetch 1,mem_le_pairing_mode
+	bbit1 LE_PAIRING_MODE_SECURE_CONNECT_BIT,le_parse_smp_pairing_random_sc
+	copy rega,contr
+endif
+	call authenticate_rconfirm
+	branch le_parse_smp_pairing_random_success,zero
+le_send_pairing_confirm_value_failed:
+	jam PAIRING_FAILED_CONFIRM_VALUE_FAILED,mem_le_ll_pairing_fail_reason
+le_send_pairing_failed:
+	force 2,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_FAILED
+	istore 1,contw
+	fetch 1,mem_le_ll_pairing_fail_reason
+	istore 1,contw	
+le_parse_smp_pairing_failed:
+	force smp_pairing_timer,queue
+	call timer_stop
+	jam FLAG_LE_PAIRING_NULL,mem_le_pairing_state
+	jam BT_EVT_LE_PAIRING_FAIL,mem_fifo_temp
+	branch ui_ipc_send_event
+
+le_smp_pairing_fail_reason_not_support_pairing:
+	jam PAIRING_FAILED_PAIRING_NOT_SUPPORTED,mem_le_ll_pairing_fail_reason
+	branch le_send_pairing_failed
+	
+	
+ifdef SECURE_CONNECTION	
+le_parse_smp_pairing_random_sc:
+	arg mem_le_mrand,contw
+	copy rega,contr
+	call memcpy16	
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_parse_smp_pairing_random_sc_passkey
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT,le_parse_smp_pairing_random_sc_passkey
+	call function_g2
+	call le_send_smp_pairing_random
+	fetch 1,mem_le_pairing_mode
+	rtnne LE_PAIRING_MODE_SECURE_CONNECT_NUMERIC
+	jam BT_EVT_LE_GKEY_GENERATE,mem_fifo_temp
+	branch ui_ipc_send_event	
+	
+le_parse_smp_pairing_random_sc_passkey:
+	call function_f4_ca
+	arg mem_AES_CMAC_temp,contw
+	call load_inverse_result	
+	arg mem_AES_CMAC_temp,rega
+	arg mem_le_rconfirm ,regb
+	arg 16,loopcnt
+	call string_compare
+	nbranch le_send_pairing_confirm_value_failed,zero
+	branch le_send_smp_pairing_random
+endif
+	
+le_parse_smp_pairing_random_success:
+	call generate_stk
+	jam BT_EVT_LE_PAIRING_SUCCESS,mem_fifo_temp
+	call ui_ipc_send_event
+	jam 1,mem_ltk_exists
+	jam FLAG_LE_PAIRING_AFTER_AUTH,mem_le_pairing_state
+	
+le_send_smp_pairing_random:
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_RANDOM
+	istore 1,contw
+	arg mem_le_srand,contr
+	branch memcpy16
+
+le_send_smp_encryption_information:
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_ENCRYPTION_INFORMATION
+	istore 1,contw
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_PAIRING_FIXED_LTK,le_send_fixed_ltk
+	arg mem_le_ltk,contr
+	branch memcpy16
+
+le_send_fixed_ltk:
+	arg mem_le_fixed_ltk,contr
+	branch memcpy16
+
+
+le_send_smp_master_identification:
+	arg mem_le_ediv,contw
+	force 10,loopcnt
+	call generate_random_loop
+	force 11,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_MASTER_IDENTIFICATION
+	istore 1,contw
+	fetch 2,mem_le_ediv
+	istore 2,contw
+	fetch 8,mem_le_rand
+	istore 8,contw
+	rtn
+
+le_send_smp_identity_information:
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_IDENTITY_INFORMATION
+	istore 1,contw
+	setarg 0
+	istore 8,contw
+	istore 8,contw
+	rtn
+	
+
+le_send_smp_identity_address_information:
+	force 8,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_IDENTITY_ADDRESS_INFORMATION
+	istore 1,contw
+	fetch 1,mem_le_conn_own_addr_type
+	istore 1,contw
+	fetch 6,mem_le_lap	
+	istore 6,contw
+	rtn	
+
+
+le_send_pairing_fail_unspecified_reason:
+	jam PAIRING_FAILED_UNSPECIFIED_REASON,mem_le_ll_pairing_fail_reason
+	branch le_send_pairing_failed
+
+le_check_init_key_distribution:
+	fetch 1,mem_le_pres_init_key_distribution
+	fetcht 1,mem_le_pres_init_key_distribution
+	iand temp,pdata
+	rtn	
+
+le_parse_smp_identity_information:
+	arg mem_le_irk,contw
+	call memcpy16
+	call le_check_init_key_distribution
+	isolate0 LE_INITATOR_IRK_BIT,pdata
+	branch le_send_pairing_fail_unspecified_reason,true
+	fetch 1,mem_device_option
+	rtnne dvc_op_module
+	call le_check_master_addr_type
+	nrtn user
+	branch app_ble_store_reconn_info
+
+//output:user is enable ,random addr type
+le_check_master_addr_type:
+	call disable_user
+	fetch 1,mem_le_conn_peer_addr_type
+	rtneq MASTER_PUBLIC_ADDR
+	fetch 1,mem_le_preq_init_key_distribution
+	rtnbit0 LE_INITATOR_IRK_BIT
+	branch enable_user
+
+le_parse_smp_identity_address_information:
+	call le_check_init_key_distribution
+	isolate0 LE_INITATOR_IRK_BIT,pdata
+	branch le_send_pairing_fail_unspecified_reason,true
+	rtn
+
+le_parse_smp_master_identification:
+le_parse_smp_signing_information:	
+le_parse_smp_security_request:
+	rtn
+	
+ifdef SECURE_CONNECTION
+le_parse_smp_public_key:
+	arg mem_le_pubkey_remote_x_256,contw	
+	call memcpy64
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_RECEIVE_PUBLIC_KEY,mem_le_secure_connect_state
+	rtn
+
+le_parse_smp_dhkey_check:
+	arg mem_sp_confirm_remote,contw
+	call memcpy16	
+	jam LE_SC_STAT_RECEIVE_DHKEY,mem_le_secure_connect_state
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	rtn	
+
+le_send_smp_pairing_public_key:
+	force 65,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_PUBLIC_KEY
+	istore 1,contw	
+	arg mem_sc_pubkey_local_x_256,contr
+	branch memcpy64
+	
+le_send_smp_pairing_dhkey_check:
+	call function_f6_eb	
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_DHKEY_CHECK
+	istore 1,contw
+	branch load_inverse_result
+	
+endif
+
+le_check_paring_time:
+	fetch 1,mem_le_pairing_state
+	rtneq FLAG_LE_PAIRING_END
+	arg FLAG_LE_PAIRING_RCV_PAIRING_REQ,temp
+	isub temp,null
+	nrtn positive
+	arg smp_pairing_timer,queue
+	call timer_check
+	nrtn blank
+	branch le_send_pairing_fail_unspecified_reason
+
+le_pairing_sm:
+	bpatchx patch3b_1,mem_patch3b
+	call le_fifo_check_nearly_full
+	nrtn blank	
+	fetch 1,mem_le_pairing_state
+	beq FLAG_LE_PAIRING_NULL,le_pairing_sm_null
+	beq FLAG_LE_PAIRING_START,le_pairing_sm_start
+	beq FLAG_LE_PAIRING_SEND_RECURITY_REQ,le_pairing_sm_send_sec_req
+	beq FLAG_LE_PAIRING_RCV_PAIRING_REQ,le_pairing_sm_rcv_pairing_req
+	beq FLAG_LE_PAIRING_AFTER_AUTH,le_pairing_sm_after_auth
+	beq FLAG_LE_PARING_SEND_ENC_INFORMATION,le_pairng_sm_send_enc_information
+	beq FLAG_LE_PARING_SEND_MASTER_IDENTIFICATION,le_pairng_sm_send_master_indentification
+	beq FLAG_LE_PARING_SEND_INDENTITY_INFORMATION,le_pairng_sm_send_indentity_information
+	rtn
+
+le_pairing_sm_null:
+le_pairing_sm_send_sec_req:
+	fetch 1,mem_le_enc_state
+	rtnne FLAG_LE_SEND_START_ENC_RSP
+	jam FLAG_LE_ENC_END,mem_le_enc_state
+	jam FLAG_LE_PAIRING_END,mem_le_pairing_state
+	jam BT_EVT_LE_RECONNECT_COMPLETE ,mem_fifo_temp
+	branch ui_ipc_send_event	
+	
+	
+le_pairing_sm_start:
+	jam FLAG_LE_PAIRING_SEND_RECURITY_REQ,mem_le_pairing_state
+	branch le_send_smp_security_request
+
+le_pairing_sm_rcv_pairing_req:
+	jam FLAG_LE_PAIRING_WAIT_STK_GENERATION,mem_le_pairing_state
+	setarg TIMER_SMP_PAIRING_TIMEOUT
+	arg smp_pairing_timer,queue
+	branch timer_init
+	
+le_pairing_sm_after_auth:
+	fetch 1,mem_le_enc_state
+	beq FLAG_LE_SEND_START_ENC_RSP,le_pairing_sm_after_auth_start_enc
+	rtn
+	
+le_pairing_sm_after_auth_start_enc:
+	fetch 1,mem_le_pairing_mode
+	bbit1 LE_PAIRING_MODE_SECURE_CONNECT_BIT,le_pairing_sm_after_auth_start_enc_sc
+
+	jam FLAG_LE_PARING_SEND_ENC_INFORMATION,mem_le_pairing_state
+	call le_send_smp_encryption_information
+le_pairing_sm_after_auth_start_enc_common:
+	jam BT_EVT_LE_ENC_INFO,mem_fifo_temp
+	call ui_ipc_send_event
+	fetch 1,mem_device_option
+	rtnne dvc_op_module
+	call le_check_master_addr_type
+	rtn user
+	branch app_ble_store_reconn_info
+
+le_pairing_sm_after_auth_start_enc_sc:
+	jam FLAG_LE_PARING_SEND_MASTER_IDENTIFICATION,mem_le_pairing_state
+	branch le_pairing_sm_after_auth_start_enc_common
+
+le_pairng_sm_send_enc_information:	
+	jam FLAG_LE_PARING_SEND_MASTER_IDENTIFICATION,mem_le_pairing_state
+	branch le_send_smp_master_identification
+
+le_pairng_sm_send_master_indentification:	
+	fetch 1,mem_le_preq_resp_key_distribution
+	fetcht 1,mem_le_pres_resp_key_distribution
+	iand temp,pdata
+	isolate0 LE_INITATOR_IRK_BIT,pdata
+	branch le_parse_start_enc_rsp_after_auth_end,true
+	jam FLAG_LE_PARING_SEND_INDENTITY_INFORMATION,mem_le_pairing_state
+	branch le_send_smp_identity_information
+
+le_pairng_sm_send_indentity_information:		
+	call le_send_smp_identity_address_information
+	branch le_parse_start_enc_rsp_after_auth_end
+
+
+le_parse_start_enc_rsp_after_auth_end:
+	force smp_pairing_timer,queue
+	call timer_stop
+	jam FLAG_LE_ENC_END,mem_le_enc_state
+	jam FLAG_LE_PAIRING_END,mem_le_pairing_state
+	jam BT_EVT_LE_PAIRING_COMPLETE ,mem_fifo_temp
+	branch ui_ipc_send_event	
+	
+
+ifdef SECURE_CONNECTION
+
+le_secure_connect_sm:
+	bpatchx patch3b_2,mem_patch3b
+	fetch 1,mem_le_pairing_mode
+	rtnbit0 LE_PAIRING_MODE_SECURE_CONNECT_BIT
+	fetch 1,mem_le_secure_connect_flag
+	rtnne LE_SP_FLAG_COMMIT_256
+	jam SP_FLAG_STANDBY,mem_le_secure_connect_flag
+	fetch 1,mem_le_secure_connect_state
+	beq  LE_SC_STAT_RECEIVE_PUBLIC_KEY,le_sc_sm_receive_public_key
+	beq LE_SC_STAT_WAIT_SEND_PUBLIC_KEY,le_sc_sm_wait_send_public_key
+	beq LE_SC_STAT_SEND_PUBLIC_KEY,le_sc_sm_send_public_key
+	beq LE_SC_STAT_RECEIVE_DHKEY,le_sc_sm_receive_dhkey
+	beq LE_SC_STAT_WAIT_CONFIRM_GKEY,le_sc_sm_wait_confirm_gkey
+	beq  LE_SC_STAT_PASSKEY_WAIT_CONFIRM,le_sc_sm_passkey_wait_confirm
+	rtn	
+
+le_sc_state_clear:
+	jam SP_FLAG_STANDBY,mem_le_secure_connect_flag
+	jam LE_SC_STAT_NULL,mem_le_secure_connect_state
+	jam FLAG_LE_SC_CONFRIM_NULL,mem_le_sc_confirm_gkey_flag
+	rtn
+	
+le_sc_sm_passkey_wait_confirm:
+	fetch 1,mem_authentication_passkey_times
+	copy pdata,queue
+	increase 1,pdata
+	store 1,mem_authentication_passkey_times
+	fetch 4,mem_le_tk
+	qisolate1 pdata
+	setarg 0x80
+	setflag true,0,pdata
+	store 1,mem_passkey_1bit
+	branch le_sc_sm_ready_send_pairing_confirm
+	
+le_sc_sm_wait_confirm_gkey:
+	fetch 1,mem_le_sc_confirm_gkey_flag
+	jam FLAG_LE_SC_CONFRIM_NULL,mem_le_sc_confirm_gkey_flag
+	beq FLAG_LE_SC_CONFRIM_GKEY_OK,le_sc_confirm_gkey_ok
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	rtn
+	
+le_sc_confirm_gkey_ok:
+	jam BT_EVT_LE_PAIRING_SUCCESS,mem_fifo_temp
+	call ui_ipc_send_event	
+	jam FLAG_LE_PAIRING_AFTER_AUTH,mem_le_pairing_state
+	branch le_send_smp_pairing_dhkey_check
+
+le_sc_sm_receive_dhkey:
+	fetch 1,mem_sp_dhkey_invalid
+	beq SP_KEY_VALID_256,le_dhkey_ready
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	rtn
+
+le_dhkey_ready:
+	call function_f5
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY ,le_dhkey_ready_common
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT ,le_dhkey_ready_common
+	call le_set_tk_0 
+le_dhkey_ready_common:
+	call function_f6_ea
+	arg mem_AES_CMAC_temp,rega
+	arg mem_sp_confirm_remote ,regb
+	arg 16,loopcnt
+	call string_compare
+	branch le_dhkey_check_ok,zero
+le_dhkey_check_fail:	
+	jam PAIRING_FAILED_DHKEY_CHECK_FAILED,mem_le_ll_pairing_fail_reason
+	branch le_send_pairing_failed
+
+	
+le_dhkey_check_ok:
+	call sp_calc_check_publickey_256
+	nbranch le_dhkey_check_fail,zero
+	jam 1,mem_ltk_exists
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_JUSTWORK,le_sc_confirm_gkey_ok
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY ,le_sc_confirm_gkey_ok	
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT ,le_sc_confirm_gkey_ok	
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_WAIT_CONFIRM_GKEY,mem_le_secure_connect_state	
+	rtn	
+
+le_sc_sm_send_public_key:
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_sc_sm_send_public_key_passkey
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT,le_sc_sm_send_public_key_passkey
+	jam 0,mem_passkey_1bit
+le_sc_sm_ready_send_pairing_confirm:
+	branch le_send_smp_pairing_confirm
+
+le_sc_sm_send_public_key_passkey:
+	jam 0,mem_authentication_passkey_times
+	rtneq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY_RES_INPUT
+	branch le_parse_smp_pairing_req_passkey
+
+	
+le_sc_sm_receive_public_key:
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	fetch 1,mem_sc_local_key_invalid
+	beq SP_KEY_VALID_256,le_public_key_ready
+	rtn
+	
+le_public_key_ready:
+	jam LE_SC_STAT_WAIT_SEND_PUBLIC_KEY,mem_le_secure_connect_state	
+	jam SP_KEY_INVALID,mem_sp_dhkey_invalid
+	branch sp_dhkey_calc_256	
+
+le_sc_sm_wait_send_public_key:
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_SEND_PUBLIC_KEY,mem_le_secure_connect_state
+	branch le_send_smp_pairing_public_key
+
+endif
+
+
+le_fifo_malloc_tx_l2cap_smp:
+	force LE_L2CAP_CID_SMP,regb
+	branch le_fifo_malloc_tx_l2cap
+
+
Index: program/ble_protocol_stack/le_ll.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_ll.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ble_protocol_stack/le_ll.prog	(working copy)
@@ -0,0 +1,339 @@
+
+le_parse_ll:
+	fetch 1,mem_le_rxbuf_data_ll_opcode
+	beq LL_CONNECTION_UPDATE_IND,le_parse_connection_update_ind
+	beq LL_CHANNEL_MAP_IND,le_parse_channel_map_ind
+	beq LL_TERMINATE_IND,le_parse_terminate_ind
+	beq LL_ENC_REQ,le_parse_enc_req
+	beq LL_ENC_RSP,le_parse_enc_rsp
+	beq LL_START_ENC_REQ,le_parse_start_enc_req
+	beq LL_START_ENC_RSP,le_parse_start_enc_rsp
+	beq LL_UNKNOWN_RSP,le_parse_unknown_rsp
+	beq LL_FEATURE_REQ,le_parse_feature_req
+	beq LL_FEATURE_RSP,le_parse_feature_rsp
+	beq LL_PAUSE_ENC_REQ,le_parse_pause_enc_req
+	beq LL_PAUSE_ENC_RSP,le_parse_pause_enc_rsp
+	beq LL_VERSION_IND,le_parse_version_ind
+	beq LL_REJECT_IND,le_parse_reject_ind
+	beq LL_PING_REQ,le_parse_ping_req
+	beq LL_PING_RSP,le_parse_ping_rsp
+	beq LL_LENGTH_REQ,le_parse_length_req
+	beq LL_LENGTH_RSP,le_parse_length_rsp
+	beq LL_PHY_REQ,le_parse_phy_req
+	beq LL_PHY_UPDATE_IND,le_parse_phy_update_ind
+	fetchr regc,1,mem_le_rxbuf_data_ll_opcode
+	branch le_send_unknown_rsp
+
+
+//LL Opcode:0x00
+le_parse_connection_update_ind:
+	ifetch 9,contr
+	store 9,mem_le_new_param
+	ifetch 2,contr
+	store 2,mem_le_instant
+	fetch 1,mem_le_state
+	set1 lestate_update_param,pdata
+	store 1,mem_le_state
+	rtn
+
+
+//LL Opcode:0x01
+le_parse_channel_map_ind:
+	ifetch 5,contr
+	store 5,mem_le_new_map
+	ifetch 2,contr
+	store 2,mem_le_instant
+le_update_map_enable:
+	fetch 1,mem_le_state
+	set1 lestate_update_map,pdata
+	store 1,mem_le_state
+	rtn
+
+
+//LL Opcode:0x02
+le_parse_terminate_ind:
+	setarg 20 // 200ms
+	store 2,mem_le_superto
+	store 2,mem_le_init_superto
+	rtn
+
+
+//LL Opcode:0x03
+le_parse_enc_req:
+	ifetch 8,contr
+	store 8,mem_le_rand
+	ifetch 2,contr
+	store 2,mem_le_ediv
+	ifetch 8,contr
+	store 8,mem_le_skdm
+	ifetch 4,contr
+	store 4,mem_ccm_ivm
+	call le_send_enc_rsp
+	bpatchx patch3b_3,mem_patch3b
+	fetch 1,mem_le_pairing_state
+	beq FLAG_LE_PAIRING_AFTER_AUTH,le_parse_enc_req_after_auth
+	fetch 1,mem_le_configuration
+	bbit1  BIT_BLE_PAIRING_FIXED_LTK,le_parse_enc_req_fixed_ltk
+	fetch 1,mem_nv_data_number
+	ncall load_device_list_mode_4,blank
+	fetch 1,mem_ltk_exists
+	beq 0,le_ltk_lost
+le_parse_enc_req_after_auth:
+	jam FLAG_LE_RCV_ENC_START,mem_le_enc_state
+	call  le_send_start_enc_req
+	branch generate_sk
+le_parse_enc_req_fixed_ltk:
+	jam 1,mem_ltk_exists
+	arg mem_le_fixed_ltk,contr
+	arg mem_le_ltk,contw
+	call memcpy16
+	branch le_parse_enc_req_after_auth
+le_ltk_lost:
+	bpatchx patch3b_4,mem_patch3b
+	jam FLAG_LE_ENC_NULL,mem_le_enc_state
+	jam FLAG_LE_ENC_NULL,mem_le_pairing_state
+	jam BT_EVT_LE_LTK_LOST,mem_fifo_temp
+	branch ui_ipc_send_event
+
+//LL Opcode:0x04
+le_parse_enc_rsp:
+	ifetch 8,contr
+	store 8,mem_le_skds
+	ifetch 4,contr
+	store 4,mem_ccm_ivs
+	branch generate_sk
+
+
+//LL Opcode:0x05
+le_parse_start_enc_req:
+	fetch 1,mem_le_state
+	set1 lestate_encryption,pdata
+	store 1,mem_le_state
+	rtn
+
+//LL Opcode:0x06
+le_parse_start_enc_rsp:
+	rtn master
+	jam BT_EVT_LE_START_ENC,mem_fifo_temp
+	call ui_ipc_send_event	
+	jam FLAG_LE_SEND_START_ENC_RSP,mem_le_enc_state
+	branch le_send_start_enc_rsp
+
+
+//LL Opcode:0x07
+le_parse_unknown_rsp:
+	rtn
+
+
+//LL Opcode:0x08
+le_parse_feature_req:
+	branch le_send_feature_rsp
+
+
+//LL Opcode:0x09
+le_parse_feature_rsp:
+	rtn
+
+
+//LL Opcode:0x0a
+le_parse_pause_enc_req:
+	jam FLAG_LE_ENC_PAUSE,mem_le_enc_state
+	call le_send_pause_enc_rsp	
+	jam BT_EVT_LE_PAUSE_ENC,mem_fifo_temp
+	branch ui_ipc_send_event	
+
+
+//LL Opcode:0x0b
+le_parse_pause_enc_rsp:
+	rtn
+
+
+//LL Opcode:0x0c
+le_parse_version_ind:
+	rtn master
+	branch le_send_version_ind
+
+
+//LL Opcode:0x0d
+le_parse_reject_ind:
+	rtn
+
+
+//LL Opcode:0x13
+le_parse_ping_req:
+	branch le_send_ping_rsp
+
+
+//LL Opcode:0x14
+le_parse_ping_rsp:
+	rtn
+
+
+le_parse_length_req:
+	call le_parse_length_rsp
+	branch le_send_data_length_res
+
+le_parse_length_rsp:
+	ifetch 8,contr
+	store 8,mem_remote_rx_max_octets
+	fetch 2,mem_remote_rx_max_octets
+	fetcht 2,mem_local_tx_max_octets
+	call not_greater_than
+	store 2,mem_remote_rx_max_octets
+	
+	fetch 2,mem_remote_tx_max_octets
+	fetcht 2,mem_local_rx_max_octets
+	call not_greater_than
+	store 2,mem_remote_tx_max_octets
+	rtn
+
+
+//LL Opcode:0x16
+le_parse_phy_req:
+	branch le_send_phy_rsp
+
+
+//LL Opcode:0x18
+le_parse_phy_update_ind:
+	ifetch 2,contr
+	store 2,mem_le_new_m2s_phy
+	ifetch 2,contr
+	store 2,mem_le_instant
+	rtn blank
+	fetch 1,mem_le_state
+	set1 lestate_update_phy,pdata
+	store 1,mem_le_state	
+	rtn
+
+
+///////////////////send ll packet//////////////
+//LL Opcode:0x02
+le_send_terminate_ind_user_terminated:
+	arg ERROR_REMOTE_USER_TERMINATED_CONNECTION,regc
+
+//regc:The ErrorCode field shall be set to inform the remote device why the connection is about to be terminated.
+le_send_terminate_ind:
+	arg 2,rega
+	arg LL_TERMINATE_IND,regb
+	call le_fifo_malloc_tx_ll
+	copy regc,pdata
+	istore 1,contw
+	rtn
+
+
+//LL Opcode:0x04
+le_send_enc_rsp:
+	arg mem_le_skds,contw
+	force 8,loopcnt
+	call generate_random_loop
+	arg mem_ccm_ivs,contw
+	force 4,loopcnt
+	call generate_random_loop
+	arg 13,rega
+	arg LL_ENC_RSP,regb
+	call le_fifo_malloc_tx_ll
+	fetch 8,mem_le_skds
+	istore 8,contw
+	fetch 4,mem_ccm_ivs
+	istore 4,contw
+	rtn
+
+
+//LL Opcode:0x05
+le_send_start_enc_req:
+	jam FLAG_LE_SEND_START_ENC_REQ,mem_le_enc_state
+	arg LL_START_ENC_REQ,regb
+	branch le_send_ll_one_lenth
+
+
+//LL Opcode:0x06
+le_send_start_enc_rsp:
+	arg LL_START_ENC_RSP,regb
+	branch le_send_ll_one_lenth
+
+
+//LL Opcode:0x07
+//input:regc is receive ll opcode
+le_send_unknown_rsp:
+	arg 2,rega
+	arg LL_UNKNOWN_RSP,regb
+	call le_fifo_malloc_tx_ll
+	istorer regc,1,contw
+	rtn	
+
+
+//LL Opcode:0x09
+le_send_feature_rsp:
+	arg 9,rega
+	arg LL_FEATURE_RSP,regb
+	call le_fifo_malloc_tx_ll
+	fetch 8,mem_le_local_feature
+	or pdata,FUN_LL_FEATURE_LE_ENCRYPTION,pdata
+	istore 8,contw
+	rtn
+
+
+//LL Opcode:0x0B
+le_send_pause_enc_rsp:
+	arg LL_PAUSE_ENC_RSP,regb
+	branch le_send_ll_one_lenth
+
+
+//LL Opcode:0x0C
+le_send_version_ind:
+	arg 6,rega
+	arg LL_VERSION_IND,regb
+	call le_fifo_malloc_tx_ll
+	fetch 5,mem_lmp_version
+	istore 5,contw
+	rtn
+
+//LL Opcode:0x0D
+le_send_reject_ind:
+	arg 2,rega
+	arg LL_REJECT_IND,regb
+	call le_fifo_malloc_tx_ll
+	setarg LE_ERR_PIN_OR_KEY_MISSING
+	istore 1,contw
+	rtn		
+
+
+//LL Opcode:0x13
+le_send_ping_rsp:
+	arg LL_PING_RSP,regb
+	branch le_send_ll_one_lenth
+	
+le_send_data_length_req:
+	arg LL_LENGTH_REQ,regb
+	branch le_send_data_length
+
+le_send_data_length_res:
+	arg LL_LENGTH_RSP,regb
+le_send_data_length:
+	arg 9,rega
+	call le_fifo_malloc_tx_ll
+	fetch 8,mem_local_rx_max_octets
+	istore 8,contw
+	rtn
+
+
+//LL Opcode:0x17
+le_send_phy_rsp:
+	arg 3,rega
+	arg LL_PHY_RSP,regb
+	call le_fifo_malloc_tx_ll
+	fetch 1,mem_le_tx_phys
+	and pdata,0x07,pdata
+	istore 1,contw
+	fetch 1,mem_le_rx_phys
+	and pdata,0x07,pdata
+	istore 1,contw
+	rtn		
+
+
+//regb:ll opcode
+le_send_ll_one_lenth:
+	arg 1,rega
+	branch le_fifo_malloc_tx_ll
+
+
Index: program/bt.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/bt.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/bt.prog	(working copy)
@@ -0,0 +1,4605 @@
+define FPGA
+define ROMCODE
+define PATCH
+//define RAM_VERSION
+//define CLK24M
+//define ACL_DEBUG
+define SECURE_CONNECTION
+define DEBUG_RF_INIT
+
+define SIMPLE_PAIRING
+define COMPILE_RFCOMM
+define COMPILE_SHUTTER
+define COMPILE_ANTILOST
+define COMPILE_MOUSE
+define COMPILE_MODULE
+define COMPILE_USB
+define COMPILE_DONGLE
+define COMPILE_LE
+define COMPILE_24G
+define COMPILE_CAR
+define COMPILE_REMOTE_CAR
+//define COMPILE_ESL
+//define COMPILE_WECHAT
+//define COMPLIE_TEST
+INCLUDE "bt_format"
+
+org 0x0000		// start from patch ram address start
+ifdef SIM
+include sim.prog
+else
+include patch.prog
+endif
+
+/******************************************/
+/***********   ROM Start   ***************/
+/******************************************/
+
+org 0x800		// start from rom address start
+start:
+	call lpmstate
+
+soft_reset:
+	bpatch patch00_0,mem_patch00
+	clear_stack
+	call app_param_init
+	call initialize_radio
+	call iic_init_360khz
+	call init_param
+	call l2cap_init
+	bpatch patch00_1,mem_patch00
+	call rfcomm_init
+	call init_lmp
+	call ui_init
+	call app_init
+	ncall adc_init_data,wake
+//	ncall load_chip_option,wake
+	bpatch patch00_2,mem_patch00
+	call app_lpm_init,wake
+ifdef SIMPLE_PAIRING
+	call publickey_init
+	call sp_wait_pubkey_calc_done
+else
+	call sp_reset
+ifdef SECURE_CONNECTION
+	call publickey_init
+endif
+endif
+	call lpm_recover_clk,wake
+main_loop:	
+	bpatch patch00_3,mem_patch00
+ifdef SIMPLE_PAIRING
+	call sp_calc_sequence
+endif
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256
+endif
+ifdef SIMPLE_PAIRING
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256_check
+endif
+endif
+	call le_advertising_dispatch
+	call idle_dispatch
+	call app_process_idle
+	bpatch patch00_4,mem_patch00
+	call inquiry_dispatch
+	call inquiry_scan_dispatch
+	call page_scan_dispatch
+	call connection_dispatch
+	call g24_dispatch
+	call lpm_dispatch
+	branch main_loop
+
+connection_dispatch:
+	rtnmark1 mark_adc_enable
+	call connection_incontext
+	rtnmark0 mark_context
+	set0 mark_context,mark
+	call context_save
+	branch le_disable
+	
+connection_incontext:
+	bpatch patch00_5,mem_patch00
+	call context_search_insniff
+	nbranch connection_nosniff,zero
+	call context_load
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,le_conn_dispatch
+	bbit1 mode_master, master_dispatch
+	branch slave_dispatch
+connection_nosniff:
+	call context_get_next
+	copy loopcnt,null
+	rtn zero
+	call context_load
+	fetch 1,mem_state
+	bbit1 state_inpage,master_page
+	fetch 1,mem_mode
+	bbit1 mode_master, master_dispatch
+	branch slave_dispatch
+
+
+
+/**************************************/
+/**************idle dispatch*********/
+/**************************************/
+	
+idle_dispatch:
+	fetch 1,mem_hci_cmd
+	rtn blank
+	beq hci_cmd_inquiry,idle_inquiry
+	beq hci_cmd_inquiry_cancel,idle_inquiry_cancel
+	beq hci_cmd_remote_name_req,idle_remote_name_req
+	beq hci_cmd_create_conn,idle_create_conn
+	beq hci_cmd_le_create_conn,idle_le_create_conn
+	call context_search_conn_handle
+	rtn zero
+	call context_search_plap
+	rtn zero
+idle_exit:
+	jam 0,mem_hci_cmd
+	rtn
+
+idle_le_create_conn:
+	jam hci_cmd_le_create_conn,mem_cmd_le_create_conn
+	jam 0,mem_hci_cmd
+	rtn
+	
+idle_inquiry:
+	set1 mark_inquiry_on,mark
+	set0 mark_inquiry_trainb,mark
+	jam param_ninquiry,mem_ninqy_index
+	jam 31,mem_nfreq_index_inq
+	branch idle_exit
+
+idle_inquiry_cancel:
+	set0 mark_inquiry_on,mark
+	force 0,stop_watch
+	branch idle_exit
+
+idle_remote_name_req:
+	call context_search_plap
+	rtn zero
+	force LMP_NAME_REQ,temp
+	jam 5,mem_nameres_cnt
+	branch idle_start_page
+
+idle_create_conn:
+	bpatch patch00_6,mem_patch00
+idle_create_conn_device:
+	fetch 6,mem_hci_plap
+//	branch idle_exit,blank
+	nop 1
+	jam RECONNECT_HID,memui_reconnect_mode
+	//jam HS_INIT_CALL,mem_hs_mode //init as master
+	jam CONN_SM_WAIT_FEATURES_RES,mem_conn_sm
+	branch idle_create_conn_cont
+	
+idle_create_conn_cont:
+	force LMP_VERSION_REQ,temp
+idle_start_page:
+	bpatch patch00_7,mem_patch00
+	fetch 1,mem_page_mode
+	branch idle_page_mode_r0,blank
+	lshift3 pdata,pdata
+	lshift4 pdata,pdata
+	increase -1,pdata
+idle_page_mode_r0:
+	store 1,mem_npage
+	store 1,mem_npage_index
+	jam 31,mem_nfreq_index_page
+	set0 mark_page_trainb,mark
+	call context_new
+	nbranch idle_page_fail,zero
+	call get_free_amaddr
+	store 1,mem_amaddr
+	storet 1,mem_lmo_opcode2
+	fetch 6,mem_hci_plap
+	store 6,mem_plap
+	bpatch patch01_0,mem_patch01
+	call timer_reinit
+	force 0,pdata
+	compare LMP_NAME_REQ,temp,0xff
+	nsetflag true,state_init_seq,pdata
+	set1 state_inpage,pdata
+	store 1,mem_state
+	jam BT_EVT_RECONN_STARTED,mem_fifo_temp
+	call ui_ipc_send_event
+	force 0,pdata
+	setflag true,smap_name_req,pdata
+	store 1,mem_state_map
+	setarg 0
+	set1 mode_master,pdata
+	store 1,mem_mode
+	enable master
+	call context_save
+	disable master
+	force page_length_timer,queue
+	fetch 2,mem_page_to
+	call timer_init
+	branch idle_exit
+idle_page_fail:
+	bpatch patch01_1,mem_patch01
+	fetch 6,mem_hci_plap
+	store 6,mem_plap
+	compare LMP_NAME_REQ,temp,0xff
+	branch idle_name_fail,true
+	branch idle_exit
+idle_name_fail:
+	arg mem_tmp_buffer,contw
+	arg 8,loopcnt
+	call memset0
+	jam BT_EVT_RECONN_FAILED,mem_fifo_temp
+	call ui_ipc_send_event
+	branch idle_exit
+	
+
+/******************************************/
+/**************  Inquiry  *****************/
+/******************************************/
+
+inquiry_dispatch:
+	rtnmark1 mark_adc_enable
+	rtnmark0 mark_inquiry_on
+	force inquiry_length_timer,queue
+	call timer_check
+	nsetflag blank,mark_inquiry_on,mark
+	nbranch inquiry_start,blank
+	rtn
+	
+
+
+inquiry_start:
+	bpatch patch01_2,mem_patch01
+	fetcht 2,mem_inq_window
+	force 4,queue
+	call sniff_check_window
+	rtn user
+	call afh_clear
+	force 0,freq_mode
+inquiry_restart:
+	rtn timeout
+	set0 mark_fhs_already_good,mark
+	set0 mark_fhs_eir,mark
+inquiry_rx_restart:
+	add clkn_bt,1,bt_clk
+	isolate1 mark_inquiry_trainb,mark
+	setflag true,2,freq_mode
+	compare 0x00,bt_clk,0x02      /* see if this is even slot */
+	nbranch inquiry_receive,true
+
+inquiry_transmit:
+	bpatch patch01_3,mem_patch01
+	fetch 1,mem_inquiry_transmit
+	increase 1,pdata
+	store 1,mem_inquiry_transmit
+	call fetch_giac
+	call tx_radio_freq
+	call fetch_diac
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_native
+	call send_access_word
+	call end_of_packet
+	call inquiry_check_train
+	branch inquiry_restart
+
+inquiry_check_train:
+	bpatch patch01_4,mem_patch01
+	fetch 1,mem_nfreq_index_inq
+	increase -1,pdata
+	store 1,mem_nfreq_index_inq
+	rtn positive  /* if it's time to incremnt N */
+	jam 31,mem_nfreq_index_inq
+	fetch 1,mem_ninqy_index
+	increase -1,pdata
+	store 1,mem_ninqy_index
+	rtn positive      /* if it's time to change train */
+	setflip mark_inquiry_trainb,mark
+	jam param_ninquiry,mem_ninqy_index
+	rtn
+
+inquiry_receive:
+	bpatch patch01_5,mem_patch01
+	call fetch_giac
+	call rx_radio_freq
+	call fetch_diac
+	call start_rx_native
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_clkn_rt
+	branch inquiry_sync,sync   /* try look for id packet again if not found */
+	call inquiry_check_train
+	branch inquiry_rx_restart
+inquiry_sync:
+	bpatch patch01_6,mem_patch01
+	call save_rssi
+	call scan_mode_whiten
+	call receive_packet_whitened
+	set0 mark_rxbuf_inuse,mark
+	rtnmark0 mark_fhs_already_good
+inquiry_receive_rtn:
+inquiry_receive_eir_rtn:
+	fetch 1,mem_inquiry_rcv
+	increase 1,pdata
+	store 1,mem_inquiry_rcv
+	rtn
+		
+/******************************************/
+/**************  Master Dispatch  *************/
+/******************************************/
+
+
+
+master_page:
+	bpatch patch01_7,mem_patch01
+	enable master
+	enable clknt
+	fetch 2,mem_page_interval
+	branch master_page_no_interval,blank
+	force page_interval_timer,queue
+	call timer_check               
+	nrtn blank
+master_page_no_interval:
+	bpatch patch02_0,mem_patch02
+	fetcht 2,mem_page_window
+	force 40,queue
+	call sniff_check_window
+	branch page_exit,user
+	force page_length_timer,queue
+	call timer_check
+	nbranch page_start,blank
+	fetch 1,mem_state_map
+	bbit1 smap_name_req,master_npage_timeout
+	branch master_page_timeout
+master_npage_timeout:
+	arg mem_tmp_buffer,contw
+	arg 8,loopcnt
+	call memset0
+master_page_timeout:
+	bpatch patch02_1,mem_patch02
+	jam 0,mem_state
+	call init_lmp_work
+	jam 0,memui_reconnect_mode
+	jam BT_EVT_RECONN_PAGE_TIMEOUT,mem_fifo_temp
+	call ui_ipc_send_event	
+	branch page_exit
+
+page_start:
+	bpatch patch02_2,mem_patch02
+	force 0,timeup
+	until clkn_rt,meet
+	fetch 1,mem_page_clk
+	increase -1,pdata
+	ixor clkn_bt,pdata
+	compare 0,pdata,3
+	nbranch page_start,true
+	deposit am_addr
+	store 1,mem_fhs_am_addr
+	force 0,N_tx_slot
+	force 0,freq_mode
+
+page_restart:
+	bpatch patch02_3,mem_patch02
+	branch page_exit,timeout
+	call fetch_page_bt_adr
+	fetchr timeup,2,mem_param_rf_setup
+	until clkn_rt,meet         /* wait for the start_receiver time against native real clk  */
+page_rx_restart:
+	bpatch patch02_4,mem_patch02
+	fetch 4,mem_page_clk    /* deposit clk_estimate */
+	iforce bt_clk
+	increase 1,pdata
+	store 4,mem_page_clk
+	isolate1 mark_page_trainb,mark
+	setflag true,2,freq_mode
+	compare 0x00,bt_clk,0x02      /* see if this is even slot */
+	nbranch page_receive,true
+	fetch 1, mem_page_transmit
+	increase 1,pdata
+	store 1, mem_page_transmit
+	call tx_radio_freq
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_native
+	call send_access_word
+	call end_of_packet
+	call page_check_train
+	branch page_restart	
+page_exit:
+	bpatch patch02_5,mem_patch02
+	disable master
+	fetch 2,mem_page_interval      
+	rtn blank
+	force page_interval_timer,queue
+	branch timer_init              
+
+page_check_train:
+	bpatch patch02_6,mem_patch02
+	fetch 1,mem_nfreq_index_page
+	increase -1,pdata
+	store 1,mem_nfreq_index_page
+	rtn positive
+	jam 31,mem_nfreq_index_page
+	fetch 1,mem_npage_index
+	increase -1,pdata                 /* increment N */
+	store 1,mem_npage_index
+	rtn positive      			/* if it's time to change train */
+	setflip mark_page_trainb,mark             /* change train */
+	fetch 1,mem_npage
+	store 1,mem_npage_index
+	rtn
+	
+page_receive:
+	bpatch patch02_7,mem_patch02
+	call rx_radio_freq
+	call start_rx_native
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_clkn_rt	/* try id look for id packet again */
+	branch page_sync,sync         /* restart if didn't receive anything */
+	call page_check_train
+	branch page_rx_restart
+page_sync:
+	call end_of_packet
+	fetch 1, mem_page_rcv
+	increase 1,pdata
+	store 1, mem_page_rcv
+	force 0,stop_watch
+	fetch 4,mem_page_clk
+page_send_fhs:
+	bpatch patch03_0,mem_patch03
+	call rf_setup_time_master_slot
+	call fetch_page_bt_adr
+	increase 1,N_tx_slot
+page_send_fhs_continue:
+	and_into 0x1fd,bt_clk
+	and_into 0x1fc,freq_mode               /* master response = x00, even_train settin must remain the same */
+	call tx_radio_freq
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_native
+	call send_access_word
+	deposit clkn_bt
+	store 4,mem_clkn_bt
+	force 0,am_addr
+	force type_fhs,type
+	call scan_mode_whiten
+	call transmit_packet_whitened
+page_wait_fhs_reply:
+	bpatch patch03_1,mem_patch03
+	call rf_setup_time_slave_slot
+	or_into 0x02,bt_clk
+	and_into 0x1fc,freq_mode               /* master response sequence = x00, even train setting must be preserved */
+	call rx_radio_freq
+	call start_rx_native
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_clkn_rt	/* look for that reply */
+	call end_of_packet,sync              /* id reply is enough */
+	branch page_wait_fhs_reply_ok,sync           /* no reply then send fhs again */
+	fetch 1,mem_fhs_wait_counter
+	branch page_restart,blank
+	increase -1,pdata
+	store 1,mem_fhs_wait_counter
+	branch page_send_fhs
+	
+page_wait_fhs_reply_ok:
+	bpatch patch03_2,mem_patch03
+	fetch 1, mem_page_rcv_fhs
+	increase 1,pdata
+	store 1, mem_page_rcv_fhs
+	call prepare_newconn
+master_newconn_loop:
+	set1 mark_first_packet,mark
+	call master_newconn_once
+	branch newconn_poll_responded,sync
+	set0 mark_first_packet,mark
+	call new_conn_timeout
+	nbranch master_newconn_loop,blank
+	branch page_restart
+
+newconn_poll_responded:
+	bpatch patch03_3,mem_patch03
+	set0 mark_first_packet,mark
+	fetch 1,mem_state
+	set0 state_inpage,pdata
+	store 1,mem_state
+	call newconn_init
+	disable master
+	rtn
+	
+
+master_dispatch:
+	bpatch patch03_4,mem_patch03
+	enable master
+	enable clknt
+	call role_switch_master
+	rtn user
+	call rf_setup_time_master_slot
+	add clkn_bt,1,bt_clk
+	call fetch_self_bt_adr
+	force 0x03,freq_mode
+	call scheduler_tx_l2cap_pkt
+	call prepare_tx
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_native
+	call send_access_word
+	call transmit_packet
+master_loop:
+	bpatch patch03_5,mem_patch03
+	call parse_lmp
+	call master_conn_recv_packet
+	nbranch master_notmatch,match
+	call supervision_flush
+	call parse_l2cap
+	fetch 1,mem_master_rcvcnt
+	increase 1,pdata
+	store 1,mem_master_rcvcnt
+master_notmatch:
+	bpatch patch03_6,mem_patch03
+	call scheduler_process
+	call check_master_disconnect
+	nrtn master					/* disconnected */
+	call check_attempt
+	nbranch master_attempt,blank
+master_exit:
+	disable master
+	rtn
+
+master_attempt:
+	call prepare_tx
+	call master_conn_send_packet
+	branch master_loop
+
+
+check_master_disconnect:
+	branch check_master_match,match
+	call supervision_update
+	branch master_disconnect,positive
+check_master_match:
+	call check_disconnect_timeout
+	nbranch master_disconnect,user
+	fetch 1,mem_state_map
+	rtnbit0 smap_name_req
+	rtnbit1 smap_name_res
+	fetch 1,mem_op
+	rtnbit1 op_disconn
+	call conn_timer_expired
+	nrtn blank
+	fetch 1,mem_nameres_cnt
+	increase -1,pdata
+	store 1,mem_nameres_cnt
+	nrtn blank
+	branch lmp_disconnect
+
+master_disconnect:
+	bpatch patch03_7,mem_patch03
+	call quit_connection
+	disable master
+	fetch 1,mem_state_map
+	bbit1 smap_name_req,master_name_disconnect
+	rtn
+	
+master_name_disconnect:
+	fetch 1,mem_state_map
+	rtnbit1 smap_name_res
+master_name_error:
+	arg mem_tmp_buffer,contw
+	arg 8,loopcnt
+	branch memset0
+	
+check_disconnect_timeout:
+	bpatch patch04_0,mem_patch04
+	enable user
+	fetch 1,mem_op
+	rtnbit0 op_disconn
+	call conn_timer_expired
+	nrtn blank
+	branch disable_user
+
+conn_timer_expired:
+	fetch 1,mem_conn_timer
+	increase -1,pdata
+	store 1,mem_conn_timer
+	rtn
+
+linkkey_ready:
+	bpatch patch04_1,mem_patch04
+	fetch 1,mem_state
+	bbit1 state_linkkey,linkkey_set
+	fetch 1,mem_pairing_auth
+	branch linkkey_set,blank
+	jam DEFALT_PAIRING_AUTH,mem_pairing_auth
+	jam BT_EVT_LINKKEY_GENERATE,mem_fifo_temp
+	call ui_ipc_send_event
+	branch linkkey_set
+linkkey_set:
+	bpatch patch04_2,mem_patch04
+	call context_traverse_linkkey
+	fetch 1,mem_state
+	set1 state_linkkey,pdata
+	store 1,mem_state
+	jam 1,mem_link_key_exists
+	fetch 1,mem_conn_sm
+	bne CONN_SM_PAIRING,linkkey_set_continue
+linkkey_set_continue:
+	rtn
+
+generate_linkkey_continue:
+	jam PAIRING_AUTH,mem_pairing_auth
+clear_linkstate:
+	fetch 1,mem_state
+	set0 state_linkkey,pdata
+	store 1,mem_state
+	rtn
+	
+
+	/* rtn user if switch */
+role_switch_check:
+	bpatch patch04_3,mem_patch04
+	disable user
+	fetch 2,mem_tsniff
+	arg 0xffff,temp
+	isub temp,null
+	nrtn zero
+	fetch 4,mem_sniff_anchor
+	branch role_switch_clkn,clknt
+	isub clke_bt,pdata
+	branch role_switch_clke
+role_switch_clkn:
+	isub clkn_bt,pdata
+role_switch_clke:
+	sub pdata,4,null
+	nrtn positive
+	force 0,pdata
+	store 2,mem_tsniff
+	branch enable_user
+
+
+	/* pdata: switch instant, set tsniff=0 for special sniff */	
+role_switch_prepare:
+	copy pdata,temp
+	storet 4,mem_sniff_anchor
+role_switch_prepare0:
+	bpatch patch04_4,mem_patch04
+	jam SWITCH_FLAG_ACCEPT,mem_switch_flag
+	setarg 0xffff
+	store 2,mem_tsniff
+	jam 1,mem_sniff_attempt
+	rtn
+
+
+role_switch_master:
+	bpatch patch04_5,mem_patch04
+	call role_switch_check
+	nrtn user
+	disable user
+	jam param_newconnto,mem_newconnto_counter
+	set0 mark_fhs_already_good,mark
+	set0 mark_role_switch_receive_fhs,mark
+roles_waitfhs_loop:
+	call rf_setup_time_master_slot
+	call master_recv_packet
+	bmark1 mark_fhs_already_good,roles_replyto_fhs
+	call new_conn_timeout
+	nbranch roles_waitfhs_loop,blank
+	bmark1 mark_role_switch_receive_fhs,roles_replyto_fhs_rcvd
+role_switch_fail_master:
+	bpatch patch04_6,mem_patch04
+	disable user
+	deposit clkn_bt
+	store 4,mem_next_btclk
+	enable clknt
+	enable master
+	jam BT_EVT_SWITCH_FAIL_MASTER,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+roles_replyto_fhs:
+	bpatch patch04_7,mem_patch04
+	call rf_setup_time_slave_slot
+	arg type_id,type
+	call master_send_packet
+	set1 mark_role_switch_receive_fhs,mark
+	set0 mark_fhs_already_good,mark
+	fetch 1,mem_amaddr
+	iforce am_addr	//use current LT_ADDR
+	jam 2,mem_newconnto_counter
+	branch roles_waitfhs_loop
+
+roles_replyto_fhs_rcvd:
+	fetch 4,mem_clke_bt		//wait for 2 fhs,need 2.5ms
+	pincrease 8
+	store 4,mem_clke_bt
+	disable clknt
+	disable master
+	call apply_switch_clke
+	call prepare_newconn
+roles_newconns_loop:
+	bpatch patch05_0,mem_patch05
+	call slave_newconn_once
+	branch roles_newconns_responded,match
+	call new_conn_timeout
+	nbranch roles_newconns_loop,blank
+	branch role_switch_fail_master
+roles_newconns_responded:
+	fetch 1,mem_mode
+	set0 mode_master,pdata
+	store 1,mem_mode
+	call supervision_flush
+	call calc_clke_offset
+	enable user
+	jam BT_EVT_SWITCH_SUCCESS_MASTER,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+
+
+context_load:
+	bpatch patch05_1,mem_patch05
+	set1 mark_context,mark
+	deposit rega
+	store 2,mem_context_ptr
+	force context_size,loopcnt
+	arg mem_le_state,contw
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	copy rega,contr
+	bbit1 mode_le,memcpy
+	arg mem_state,contw
+	call memcpy
+	disable attempt
+	fetch 1,mem_amaddr
+	iforce am_addr
+	jam 1,mem_current_sniff_attempt
+	branch context_load_master,master
+	jam 1,mem_current_sniff_attempt
+context_load_master:
+	fetch 1,mem_state
+	rtnbit0 state_insniff
+	fetch 1,mem_sniff_attempt
+	store 1,mem_current_sniff_attempt
+	fetch 1,mem_sniff_timeout
+	store 1,mem_current_sniff_timeout
+	rtn
+	
+context_save:
+	bpatch patch05_2,mem_patch05
+	fetch 2,mem_context_ptr
+	iforce contw
+	force context_size,loopcnt
+	arg mem_le_state,contr
+	branch memcpy,le
+	arg mem_state,contr
+	branch memcpy
+
+	
+
+context_get_next:
+	arg context_num,loopcnt
+	fetcht 1,mem_current_context
+context_get_next_loop:
+	increase 1,temp
+	compare context_num,temp,0xff
+	nbranch context_get_next_cont,true
+	arg 0,temp
+context_get_next_cont:
+	storet 1,mem_current_context
+	mul32 temp,context_size,pdata
+	arg mem_context,rega
+	iadd rega,rega
+	ifetch 1,rega
+	bbit1 state_insniff,context_get_next_sniff
+	rtnbit1 state_inconn
+	rtnbit1 state_inpage
+context_get_next_sniff:
+	loop context_get_next_loop
+	rtn
+	
+context_new:
+	bpatch patch05_3,mem_patch05
+	arg context_search_empty,regc
+	call context_search
+	nrtn zero					// all occupied
+	deposit rega
+	store 2,mem_context_ptr
+	force 0,null
+	rtn
+	
+	//return zero if anyone's wack is 1.
+	//return nzero if all wack is 0
+context_check_all_wack:
+	call check_esco_amaddr
+	branch context_check_esco_wack,true
+	fetch 2,mem_context_ptr
+	add pdata,coffset_arq,contw
+	fetch 1,mem_arq
+	istore 1,contw
+	arg context_check_a_wack,regc
+	branch context_search
+
+context_check_esco_wack:
+	fetch 1,mem_arq
+	isolate1 wack,pdata
+	branch context_esco_wack,true
+	force 1,null
+	rtn
+context_esco_wack:
+	force 0,null
+	rtn
+	
+	//rtn nzero if idle(no conn)
+context_check_idle:
+	arg context_check_inconn,regc
+	branch context_search
+	
+context_traverse_linkkey:
+	fetcht 2,mem_context_ptr
+	arg context_traverse_clearkey,regc
+	branch context_search
+	
+	
+	/* return zero if conn handle is found */
+context_search_conn_handle:
+	fetcht 1,mem_hci_conn_handle
+context_search_conn_handle2:
+	arg context_search_handle,regc
+	branch context_search
+	/* return zero if plap is found */
+context_search_plap:
+	bpatch patch05_4,mem_patch05
+	fetcht 6,mem_hci_plap
+context_search_plap2:
+	arg context_search_lap,regc
+	branch context_search
+	/* return zero if sniff anchor is meet and rega pointers to context */
+context_search_insniff:
+	arg context_search_sniff,regc
+	branch context_search
+	/* return zero if sniff window is in content with current transaction */
+context_search_sniff_window:
+	arg context_search_window,regc
+context_search:
+	bpatch patch05_5,mem_patch05
+	arg mem_context,rega
+	arg context_num,loopcnt
+context_search_loop:
+	ifetch 1,rega
+	copy regc,pc
+context_search_next:
+	increase context_size,rega
+	loop context_search_loop
+	force 1,null
+	rtn
+
+context_search_empty:
+	bbit1 state_inconn,context_search_next
+	bbit1 state_inpage,context_search_next
+	force 0,null
+	rtn
+	
+context_search_lap:
+	bbit1 state_inpage,context_search_lap_cont
+	bbit0 state_inconn,context_search_next
+context_search_lap_cont:
+	add rega,coffset_plap,contr
+	ifetch 6,contr
+	isub temp,null
+	rtn zero
+	branch context_search_next
+
+context_search_handle:
+	bbit0 state_inconn,context_search_next
+	add rega,coffset_conn_handle,contr
+	ifetch 1,contr
+	isub temp,null
+	rtn zero
+	branch context_search_next
+
+context_search_sniff:
+	bbit0 state_insniff,context_search_next
+context_search_sniff_loop:
+	call context_get_anchor
+	call sign_pdata_temp
+	isub temp,pdata
+	increase 1,pdata
+	branch context_search_sniff_miss,positive
+	copy contr,regb
+	store 9,mem_temp
+	fetch 1,mem_sc_calc
+	nbranch context_search_sniff_sc,blank
+	fetch 9,mem_temp
+	copy regb,contr
+	increase 5,pdata  
+	branch context_search_meet1
+context_search_sniff_sc:
+	fetch 9,mem_temp
+	copy regb,contr	
+	increase 20,pdata  
+context_search_meet1:
+	nbranch context_search_next,positive
+context_search_meet:
+	copy temp,bt_clk
+	call context_next_anchor
+	force 0,null
+	rtn
+	
+	
+context_search_sniff_miss:
+	iforce regb
+	add rega,coffset_tsniff,contr
+	ifetch 2,contr
+	branch context_search_meet,blank
+	call context_next_anchor
+	branch context_search_sniff_loop
+
+sign_pdata_temp:
+	rshift16 pdata,timeup    
+	rshift8 timeup,timeup    
+	branch sign_pdata_temp_p0,zero    
+	compare 0xf,timeup,0xf    
+	nrtn true    
+	rshift16 temp,timeup    
+	rshift8 timeup,timeup    
+	nrtn zero    
+	set1 28,temp    
+	rtn
+sign_pdata_temp_p0:    
+	rshift16 temp,timeup    
+	rshift8 timeup,timeup    
+	compare 0xf,timeup,0xf    
+	nrtn true    
+	set1 28,pdata    
+	rtn
+
+context_check_inconn:
+	bbit0 state_inconn,context_search_next
+	force 0,null 				// found
+	rtn
+	
+context_check_a_wack:
+	bbit0 state_inconn,context_search_next
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,context_search_next
+	add rega,coffset_arq,contr
+	ifetch 1,contr
+	bbit0 wack,context_search_next
+	force 0,null 				// found
+	rtn
+
+context_get_anchor:
+	add rega,coffset_mode,contr
+	ifetcht 1,contr
+	deposit clkn_bt
+	isolate1 mode_master,temp
+	add rega,coffset_sniff_anchor,contr
+	ifetcht 4,contr
+	rtn true
+	add rega,coffset_clk_offset,contr
+	ifetch 6,contr
+	call calc_clke2
+	deposit clke_bt
+	rtn
+
+context_next_anchor:
+	add rega,coffset_tsniff,contr
+	add rega,coffset_sniff_anchor,contw
+	ifetch 2,contr
+	iadd temp,timeup			/* wrap to 28 bits */
+	deposit timeup
+	istore 4,contw
+	branch le_context_nextevent
+	
+
+context_search_window:
+	bbit0 state_insniff,context_search_next
+	call context_get_anchor
+	iadd stop_watch,pdata
+	iadd stop_watch,pdata
+	iadd queue,pdata
+	isub temp,null
+	nbranch context_search_next,positive
+	force 0,null
+	rtn
+
+context_traverse_clearkey:
+	bbit0 state_inconn,context_search_next
+	deposit temp
+	isub rega,null
+	branch context_search_next,null
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,context_search_next
+	ifetch 1,rega
+	set0 state_linkkey,pdata
+	istore 1,rega
+	branch context_search_next
+
+	
+master_conn_send_packet:
+	bpatch patch05_6,mem_patch05
+	call rf_setup_time_master_slot
+master_send_packet:
+	add clkn_bt,1,bt_clk          /* master start to use native clock */
+	call fetch_self_bt_adr
+	force 0x03,freq_mode          /* we are in connection!! */
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_native
+	call send_access_word
+	branch transmit_packet
+
+master_conn_recv_packet:
+	bpatch patch05_7,mem_patch05
+	call rf_setup_time_slave_slot
+master_recv_packet:
+	add clkn_bt,1,bt_clk          /* master start to use native clock */
+	call fetch_self_bt_adr
+	force 0x03,freq_mode          /* we are in connection!! */
+	call rx_radio_freq
+	call init_rx_packet_flags
+	call prep_crypt
+	call start_rx_native	/* start listening at start_rx time */
+	call start_receiver
+master_rx_conn_finish_packet:
+	call wait_access_clkn_rt	/* master use native clock */
+	nrtn sync
+	call save_rssi
+	branch receive_packet
+	
+	
+
+master_newconn_once:
+	bpatch patch06_0,mem_patch06
+	fetch 1,mem_fhs_am_addr
+	iforce am_addr			//review
+	force type_poll,type
+	call master_conn_send_packet
+	branch master_conn_recv_packet
+
+
+
+
+
+
+/******************************************/
+/************* Inquiry Scan ***************/
+/******************************************/
+
+inquiry_scan_dispatch:
+	rtnmark1 mark_adc_enable
+	fetch 1,mem_scan_mode
+	rtnbit0 inq_scan_mode
+	force iscan_interval_timer,queue
+	call timer_check
+	nrtn blank
+	fetcht 2,mem_iscan_window
+	force 4,queue
+	call sniff_check_window
+	rtn user
+	call inquiry_scan_start
+	force iscan_interval_timer,queue
+	fetch 2,mem_iscan_interval
+	nbranch timer_init,sync
+	random pdata				/* inquiry scan backoff */
+	iand mask3ff,pdata
+	branch timer_init
+	
+
+inquiry_scan_start:
+	bpatch patch06_1,mem_patch06
+	jam 0,mem_fhs_am_addr
+	disable clknt
+	disable attempt
+	call afh_clear
+	and clkn_bt,0x1fc,bt_clk      /* freeze the clock, set bit[1] 0, this is version 1.1 */
+	force 0x01,freq_mode     /* slave in inquiry scan, kind of same as inquriy_response, this is version 1.1 */
+	call fetch_giac
+	call rx_radio_freq
+	setflip mark_inquiry_state,mark
+	fetch 1,mem_inquiryscan_waitcnt
+	increase 1,pdata
+	store 1,mem_inquiryscan_waitcnt
+	call fetch_diac
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_forever	/* until there is timeout, or matched (true) */
+	nrtn sync
+	bpatch patch06_2,mem_patch06
+	force 0,stop_watch
+	call shutdown_radio	/* must have heard */
+	fetch 1,mem_inquiryscan_rcvcnt
+	increase 1,pdata
+	store 1,mem_inquiryscan_rcvcnt
+	call fetch_giac
+	call rf_setup_time_slave_slot
+	or_into 0x002,bt_clk               /* put clk(1) to 1 */
+	force 0x01,freq_mode               /* slave in inquriy and page, response only */
+	call tx_radio_freq
+	call fetch_diac
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_external
+	deposit clkn_bt
+	store 4,mem_clkn_bt
+	call send_access_word
+	force type_fhs,type
+	force 0,am_addr                       /* put 0 into am_addr field for fhs */
+	call scan_mode_whiten
+	call transmit_packet_whitened
+	call send_eir
+	and_into 0x1fd,bt_clk                 /* put clk(1) back to 0 */
+	increase 1,N_tx_slot
+	rtn
+
+send_eir:
+	bpatch patch06_3,mem_patch06
+	fetch 1,mem_eir_enable
+	rtn blank
+	arg mem_eir,contw
+	fetch 1,mem_local_name_length
+	copy pdata,loopcnt
+	increase 1,pdata
+	istore 1,contw	
+	copy contw,temp
+	increase 1,pdata
+	store 2,mem_tx_len	
+	copy temp,contw
+	setarg 0x09  //type:name
+	istore 1,contw		
+	arg  mem_local_name,contr
+	call memcpy       //name
+
+	arg mem_all_uuid_128bits,regc
+	arg 4,loopcnt
+	call get_all_uuid
+	arg mem_all_uuid_16bits,regc
+	arg 1,loopcnt
+	call get_all_uuid
+
+	force type_dm3,type		/* DM3 */
+	jam 2,mem_tx_lch
+	setarg mem_eir
+	store 2,mem_txptr
+	call rf_setup_time_slave_slot
+	call tx_radio_freq
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_external
+	call send_access_word
+	call scan_mode_whiten
+	call transmit_packet_whitened
+	rtn
+
+
+get_all_uuid:
+	copy contw,temp
+	copy regc,contr
+	ifetch 1,contr
+	rtn blank
+lshift_loop:
+	lshift pdata,pdata
+	loop lshift_loop
+	copy pdata,rega
+	increase 2,pdata
+	copy pdata,queue
+	fetch 2,mem_tx_len
+	iadd queue,pdata
+	store 2,mem_tx_len
+	copy temp,contw
+	copy rega,pdata
+	increase 1,pdata
+	istore 1,contw
+	copy regc,contr
+	ifetch 1,contr
+	ifetch 1,contr	//fetch type
+	istore 1,contw
+	copy rega,loopcnt
+	branch memcpy  //copy uuid
+	
+/******************************************/
+/******** Slave dispatch ***********/
+/******************************************/
+
+page_scan_dispatch:	
+	rtnmark1 mark_adc_enable
+	fetch 1,mem_scan_mode
+	rtnbit0 page_scan_mode
+	force pscan_interval_timer,queue
+	call timer_check
+	nrtn blank
+	fetcht 2,mem_pscan_window
+	force 40,queue
+	call sniff_check_window
+	rtn user
+	force 0,am_addr
+	jam param_pagerespto,mem_fhs_wait_counter
+	set0 mark_fhs_already_good,mark
+	call page_scan_start
+	force pscan_interval_timer,queue
+	fetch 2,mem_pscan_interval
+	branch timer_init
+	
+
+page_scan_start:
+	bpatch patch06_4,mem_patch06
+	disable clknt
+	call afh_clear
+	fetch 1,mem_pagescan_waitcnt
+	increase 1,pdata
+	store 1,mem_pagescan_waitcnt
+	force 0,N_tx_slot
+	call fetch_self_bt_adr
+	add clkn_bt,1,bt_clk      /* freeze the clock on native clock until scan window is up */
+	force 0x02, freq_mode     /* slave in inquiry and page, not response */
+	bpatch patch06_5,mem_patch06
+	call rx_radio_freq
+	call start_receiver	/* wait for that id packet from master */
+	call wait_access_forever
+	nrtn sync                          /* pscan window timeout occured, back to dispatch */
+	call shutdown_radio	/* got the id packet */
+	fetch 1,mem_pagescan_rcvcnt
+	increase 1,pdata
+	store 1,mem_pagescan_rcvcnt
+	force 0,stop_watch
+	call rf_setup_time_slave_slot
+	or_into 0x002,bt_clk               /* put clk(1) to 1 */
+	force 0x01,freq_mode               /* slave in inquriy and page, response only */
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_external
+	call send_access_word
+	call end_of_packet
+	force 0,am_addr
+	fetchr timeup,2,mem_param_rf_setup
+	until clke_rt,meet
+	or_into 0x03,clke_bt
+	and_into 0x1fd,bt_clk
+page_scan_wait_fhs_restart:
+	bpatch patch06_6,mem_patch06
+	increase 1,N_tx_slot
+	call rx_radio_freq
+	call start_receiver
+	call wait_access_mhalfbnd
+	nbranch page_scan_wait_fhs_again,sync	/* go back if didn't find access code */
+	call scan_mode_whiten
+	call receive_packet_whitened
+	bmark1 mark_fhs_already_good,page_scan_reply_to_fhs
+page_scan_wait_fhs_again:
+	bpatch patch06_7,mem_patch06
+	fetch 1,mem_fhs_wait_counter
+	rtn blank
+	increase -1,pdata
+	store 1,mem_fhs_wait_counter
+	call rf_setup_time_master_slot	/* set up expiration time */
+	branch page_scan_wait_fhs_restart
+
+
+page_scan_reply_to_fhs:
+	bpatch patch07_0,mem_patch07
+	set0 1,clke_bt
+	set1 0,clke_bt
+	fetch 1,mem_pagescan_rcvfhscnt
+	increase 1,pdata
+	store 1,mem_pagescan_rcvfhscnt
+	call rf_setup_time_slave_slot
+	or_into 0x02,bt_clk
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_external
+	call send_access_word
+	call end_of_packet
+slave_apply_clke_bt:
+	compare 0x03,clke_bt,0x03
+	branch slave_apply_clke_bt_now,true
+	until null,mhalfbnd
+	branch slave_apply_clke_bt
+slave_apply_clke_bt_now:
+	fetch 4,mem_clke_bt
+	or_into 0x03,pdata
+	icopy clke_bt
+
+start_slave_connection:
+	bpatch patch07_1,mem_patch07
+	fetch 6,extm_lap
+	store 6,mem_plap
+	call prepare_newconn
+slave_newconn_loop:
+	call slave_newconn_once
+	branch sconn_successful,match     /* we were talked to */
+	call new_conn_timeout
+	nbranch slave_newconn_loop,blank
+	rtn
+
+	
+sconn_successful:
+	bpatch patch07_2,mem_patch07
+	call newconn_init
+	call context_new
+	nrtn zero
+	jam 0,mem_mode
+	call calc_clke_offset
+	branch context_save
+
+
+
+
+slave_dispatch:
+	bpatch patch07_3,mem_patch07
+	call calc_clke
+	call role_switch_slave
+	rtn user
+slave_loop:
+	bpatch patch07_4,mem_patch07
+	call scheduler_process
+	call slave_conn_recv_packet	/* go listen for a packet */
+	nbranch slave_notmatch,match
+	fetch 2,mem_cb_bt_slave_match
+	call callback_func
+	call supervision_flush
+	call scheduler_tx_l2cap_pkt
+	call prepare_tx
+	call slave_conn_send_packet
+	call parse_l2cap
+	call parse_lmp
+	fetch 1,mem_slave_rcvcnt
+	increase 1,pdata
+	store 1,mem_slave_rcvcnt
+	call calc_clke_offset
+slave_notmatch:
+	bpatch patch07_5,mem_patch07
+	call lpm_set_mult
+	call supervision_update
+	branch slave_disconnect,positive
+	call check_disconnect_timeout
+	nbranch slave_disconnect,user
+	call check_attempt
+	nbranch slave_loop,blank
+	rtn
+
+slave_disconnect:
+	bpatch patch07_6,mem_patch07
+	jam 0,mem_tester_emulate
+	jam 0,mem_debug_config
+	call quit_connection
+	set0 mark_testmode,mark
+	call test_enable_white
+	fetch 1,mem_state
+	rtn
+
+
+role_switch_slave:
+	call role_switch_check
+	nrtn user
+	copy am_addr,temp
+	call get_free_amaddr
+	store 1,mem_fhs_am_addr
+	copy temp,am_addr
+	jam param_newconnto,mem_newconnto_counter
+roles_sendfhs_loop:
+	bpatch patch07_7,mem_patch07
+	call rf_setup_time_master_slot
+	force type_fhs,type
+	call slave_send_access
+	deposit clkn_bt
+	store 4,mem_clkn_bt
+	call transmit_packet
+	call rf_setup_time_slave_slot
+	enable user3
+	call slave_receive_access
+	branch roles_got_fhs_reply,sync
+	call shutdown_radio
+	call new_conn_timeout
+	nbranch roles_sendfhs_loop,blank
+	rtnmark0 mark_accept_switch
+	jam LMP_SLOT_OFFSET,mem_lmo_opcode2
+	set1 mark_switch_initiated,mark
+	rtn
+roles_got_fhs_reply:
+	enable clknt
+	call prepare_newconn
+	call afh_clear
+roles_newconn_loop:
+	bpatch patch08_0,mem_patch08
+	call master_newconn_once
+	branch roles_newconn_responded,sync
+	call new_conn_timeout
+	nbranch roles_newconn_loop,blank
+	disable clknt
+	deposit clke_bt
+	store 4,mem_next_btclk
+	rtn
+roles_newconn_responded:
+	enable master
+	bmark0 mark_accept_switch,roles_newconn_nolmp
+	set0 mark_accept_switch,mark
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_HOST_CONNECTION_REQ,mem_lmi_opcode2
+	call tid_set_reply
+roles_newconn_nolmp:
+	deposit am_addr
+	store 1,mem_amaddr
+	force 0,pdata
+	store 6,mem_clk_offset
+	fetch 1,mem_mode
+	set1 mode_master,pdata
+	store 1,mem_mode
+	call supervision_flush
+	disable master
+	enable user
+	rtn
+
+	
+
+init_rx_packet_flags:
+	bpatch patch08_1,mem_patch08
+	disable match
+	set0 mark_loopback,mark
+	set0 mark_am_addr_broadcast,mark          /* initialize slave flags */
+	set0 mark_longpacket,mark
+	set0 mark_old_packet,mark
+	fetch 1,mem_arq    /* mem_arq + am_addr */
+	set0 arqnx,pdata
+	set1 flowx,pdata
+	store 1,mem_arq
+	rtn
+
+prepare_newconn:
+	bpatch patch08_2,mem_patch08
+	jam param_newconnto,mem_newconnto_counter
+	jam param_newconn_arq,mem_arq
+	fetch 2,mem_rx_window_init
+	store 2,mem_rx_window
+	deposit clkn_bt
+	store 4,mem_next_btclk
+	rtn clknt
+	deposit clke_bt
+	store 4,mem_next_btclk
+	rtn
+
+newconn_init:
+	bpatch patch08_3,mem_patch08
+	call init_lmp_reinit
+	call new_conn_handle
+	store 1,mem_conn_handle
+	setarg 0
+	store 2,mem_l2cap_rxbuff1_len
+	setarg param_supervision_to
+	store 2,mem_supervision_to
+	fetch 1,mem_state
+	set1 state_inconn,pdata
+	store 1,mem_state
+	jam 0,mem_op
+	jam 0,mem_state_map
+	jam 0,mem_lpm_current_mult
+	branch supervision_flush
+	
+
+clear_linkkey:
+	bpatch patch08_4,mem_patch08
+	force 0,pdata
+	store 8,mem_link_key
+	istore 8,contw
+	call clear_linkstate
+	branch context_traverse_linkkey
+	
+new_conn_timeout:
+	fetch 1,mem_newconnto_counter
+	increase -1,pdata
+	store 1,mem_newconnto_counter
+	rtn
+
+new_conn_handle:
+	fetch 1,mem_handle_num
+	increase 1,pdata
+	store 1,mem_handle_num
+	rtn
+
+
+quit_connection:
+	bpatch patch08_5,mem_patch08
+	fetch 1,mem_hci_cmd
+	beq hci_cmd_remote_name_req,quit_connection_name
+	fetch 1,mem_lmp_to_send
+	bne LMP_NAME_REQ,quit_connection_cont
+quit_connection_name:
+	call cmd_check_plap
+	nbranch quit_connection_cont,zero
+	call master_name_error
+	jam 0,mem_hci_cmd
+quit_connection_cont:
+	bpatch patch08_6,mem_patch08
+	call app_disconn_reason_collect_bt
+	call sniff_exit
+	jam BT_EVT_BB_DISCONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	call init_lmp_work
+	call l2cap_init_work
+ifdef SIMPLE_PAIRING
+	call sp_clear_flags
+endif
+	fetch 1,mem_state
+	set0 state_inconn,pdata
+	store 1,mem_state
+	jam 0,memui_reconnect_mode
+
+	fetch 1,mem_state_map
+	compare 0x0,pdata,0xc0
+	branch quit_connection_not_clear_mark,true
+	set0 mark_rxbuf_inuse,mark
+quit_connection_not_clear_mark:
+	fetch 1,mem_arq
+	bbit0 wack,quit_connection_not_clear_tx
+quit_connection_not_clear_tx:
+	fetch 1,mem_op
+	rtnbit0 op_txl2cap
+	set0 mark_tx_l2cap,mark
+	rtn
+
+slave_newconn_once:
+	bpatch patch08_7,mem_patch08
+	fetch 1,extm_newconn_am_addr
+	rtn blank     
+	icopy am_addr
+	call slave_conn_recv_packet
+	nrtn match
+	force type_null,type
+	call slave_conn_send_packet
+	deposit am_addr
+	store 1,mem_amaddr                 /* now the new am_addr is official */
+	force 0,pdata
+	store 1,extm_newconn_am_addr
+	rtn
+
+
+/******************************************/
+/********  Time consuming task  ***********/
+/******************************************/
+prepare_tx:
+	bpatch patch09_0,mem_patch09
+	fetch 1,mem_state
+	bbit0 state_insco,prepare_tx_not_sco
+	force type_hv3,type
+	bmark0 mark_esco,prepare_tx_not_esco
+	call check_esco_amaddr
+	nbranch prepare_tx_not_sco,true
+	branch prepare_tx_not_sco,attempt	
+	call set_wait_ack					/* send esco only at the first attempt */
+	setarg 2		/* esco only has 1 retry */
+	store 2,mem_retransmission_cnt
+	rtn
+
+prepare_tx_not_esco:
+	nrtn attempt						/* send sco only at the first attempt */
+prepare_tx_not_sco:
+	bpatch patch09_1,mem_patch09
+	call context_check_all_wack			 //abandon mark_retransmit, use context_check_all_wack instead.
+	nbranch prepare_tx_no_retransmit,zero
+	fetch 1,mem_arq
+	bbit0 wack,prepare_tx_pollnull		/* other wack, tx buffer in use, but not me */
+prepare_tx_retransmit:
+	bmark1 mark_loopback,prepare_tx_loopback
+	fetch 1,mem_debug_config
+	bbit1 debug_tx_pattern,prepare_tx_txpat
+	fetch 2,mem_retransmission_cnt
+	increase -1,pdata
+	store 2,mem_retransmission_cnt
+	branch prepare_tx_nomore_retransmit,blank
+	fetch 1,mem_last_type
+	iforce type
+	rtn
+
+prepare_tx_nomore_retransmit:
+	bpatch patch09_2,mem_patch09
+	call clear_got_tx
+prepare_tx_no_retransmit:
+	call check_esco_amaddr
+	branch prepare_tx_pollnull,true
+	call send_lmp
+	branch prepare_tx_sendlmp,user
+	fetch 1,mem_op
+	bbit1 op_txl2cap,prepare_tx_sendl2cap
+	bmark1 mark_loopback,prepare_tx_loopback
+	fetch 1,mem_debug_config
+	bbit1 debug_tx_pattern,prepare_tx_txpat
+prepare_tx_pollnull:
+	force type_poll,type				/* POLL for master */
+	rtn master
+	force type_null,type				/* default is NULL */
+	rtn
+prepare_tx_loopback:
+	bpatch patch09_3,mem_patch09
+	fetch 1,mem_rx_type
+	iforce type
+	rtnne 1
+	force type_null,type
+	rtn
+prepare_tx_txpat:
+	fetch 1,test_mode_packet_type
+	and pdata,0xf,type
+	set1 mark_loopback,mark
+	rtn
+prepare_tx_sendlmp:
+	force type_lmp,type
+	call set_wait_ack
+prepare_tx_ccm_edr_lmp:
+	call check_enc_ccm
+	rtn blank		
+	jam 3,mem_llid
+	fetch 1,mem_lmo_header_length
+	and pdata,0x1f8,pdata
+	rshift3 pdata,pdata
+	store 2,mem_ccm_len
+	copy pdata,rega
+	arg mem_lmo_header_opcode,regc
+	branch ccm_br_enc_new	
+
+	
+prepare_tx_sendl2cap:
+	call tx_l2cap_type
+	call set_wait_ack
+prepare_tx_ccm_edr:
+	call check_enc_ccm
+	rtn blank		
+	fetch 1,mem_tx_lch
+	and_into 3,pdata
+	store 1,mem_llid
+	fetch 2,mem_tx_len
+	copy pdata,rega
+	store 2,mem_ccm_len
+	fetch 2,mem_txptr
+	copy pdata,regc
+	branch ccm_br_enc_new
+	
+	
+set_wait_ack:
+	bpatch patch09_4,mem_patch09
+	fetcht 1,mem_arq
+	set1 wack,temp
+	storet 1,mem_arq
+	deposit type
+	store 1,mem_last_type
+	setarg 0xffff
+	store 2,mem_retransmission_cnt
+	rtn
+
+tx_l2cap_type:
+	bpatch patch09_5,mem_patch09
+	fetch 1,mem_state_map
+	isolate1 smap_edr,pdata
+	fetch 2,mem_tx_len
+	branch tx_l2cap_type_edr,true
+	force type_dm1,type		/* DM1 */
+	sub pdata,17,null			
+	rtn positive
+	force type_dh1,type		/* DH1 */
+	sub pdata,27,null				
+	rtn positive
+	force type_dm3,type		/* DM3 */
+	sub pdata,121,null
+	rtn positive
+	force type_dh3,type		/* DH3 */
+	sub pdata,183,null
+	rtn positive	
+	force type_dm5,type		/* DM5 */
+	sub pdata,224,null
+	rtn positive
+	force type_dh5,type		/* DH5 */
+	rtn
+tx_l2cap_type_edr:
+	force type_dm1,type
+	sub pdata,17,null
+	rtn positive
+	force type_dh1,type		/*2-DH1*/
+	sub pdata,54,null
+	rtn positive
+	force type_dm3,type		/*2-DH3*/
+	arg 367,temp
+	isub temp,null
+	nrtn positive
+	force type_dm5,type		/*2-DH5*/
+	arg 679,temp
+	isub temp,null
+	nrtn positive
+	force type_dh5,type		/*3-DH5*/
+	rtn
+
+
+/******************************************/
+/***********  Receive Packet  *************/
+/******************************************/
+
+
+
+slave_receive_master_slot:
+	fetch 1,mem_state
+	bbit0 state_insniff,slave_receive_notsniff
+	fetch 2,mem_tsniff
+	branch slave_receive_notsniff,blank		/* role switch */
+	nbranch slave_receive_sniff,attempt
+slave_receive_notsniff:
+	call rf_setup_time_master_slot
+slave_receive_access:
+	add clke_bt,1,bt_clk
+slave_receive_sniff:
+	enable swfine
+	fetch 2,mem_rx_window
+	rshift pdata,pdata
+	fetcht 2,mem_param_pll_setup
+	iadd temp,pdata
+	call ahead_window
+	call fetch_extm_bt_adr
+	force 0x03,freq_mode          /* connection hop */
+	call rx_radio_freq
+	call init_rx_packet_flags
+	call prep_crypt
+	bpatch patch09_6,mem_patch09
+	fetch 2,mem_rx_window
+	rshift pdata,pdata
+	call ahead_window
+	call start_receiver
+	enable decode_fec0
+	fetch 2,mem_rx_window
+	fetcht 2,mem_param_clke_cal
+	iadd temp,stop_watch
+	correlate null,timeout
+	copy clke,temp
+	storet 6,mem_sync_clke
+	disable decode_fec0
+	nrtn sync
+	fetch 2,mem_param_clke_cal
+	copy pdata,clke_rt
+	copy bt_clk,clke_bt
+	branch lpm_adjust_clk,wake
+	rtn
+
+
+slave_conn_recv_packet:
+	bpatch patch09_7,mem_patch09
+	call slave_receive_master_slot
+	nbranch shutdown_radio,sync
+	call save_rssi
+	bmark0 mark_testmode,receive_packet
+	fetch 2,mem_tst_pktcnt_sync
+	increase 1,pdata
+	store 2,mem_tst_pktcnt_sync
+receive_packet:
+	call rf_debug_rx_sync_line	//L-H
+	rshift bt_clk,temp
+	or temp,0x40,white_init
+receive_packet_whitened:
+	bpatch patch0a_0,mem_patch0a
+	enable enable_white
+	enable enable_hec
+	enable decode_fec1
+	parse demod,bucket,3  /* get am_addr */
+	rshift8 pwindow,pdata
+	store 1,mem_temp_am_addr
+	parse demod,bucket,4  /* get type */
+	inject bucket,7       /* align up to pwindow */
+	copy pwindow,pdata
+	store 1,mem_rx_type
+	parse demod,bucket,3  /* get arq */
+	rshift8 pwindow,pdata
+	store 1,mem_temp_arq
+	fetch 1,mem_rx_type
+	sub pdata,3,null
+	branch receive_packet_noedr,positive
+	beq 7,receive_packet_noedr		/* esco packet */
+	fetch 1,mem_state_map
+	isolate1 smap_edr,pdata
+	setflag true,PSK,radio_ctrl
+receive_packet_noedr:
+	bpatch patch0a_1,mem_patch0a
+	parse demod,bucket,8   /* cycle thru hec */
+	disable decode_fec1
+	disable enable_hec   /* at this moment, 1 seqn + 8 hec is in shift */
+	branch error_header,crc_failed  /* if hec error, nothing is valid */
+	bmark0 mark_testmode,receive_packet_amchk
+	fetch 2,mem_tst_pktcnt_hec
+	increase 1,pdata
+	store 2,mem_tst_pktcnt_hec
+receive_packet_amchk:	
+	bpatch patch0a_2,mem_patch0a
+	fetch 1,mem_temp_am_addr
+	compare 0,pdata,0x07           /* check for broadcast */
+	setflag true,mark_am_addr_broadcast,mark   /* received a broadcast message, can fire ar_addr if during unpark_req */
+	branch am_addr_ok,true
+	icompare 0x07,am_addr
+	branch am_addr_match,true
+	bmark0 mark_esco,end_of_packet
+	fetch 1,mem_arq    /* mem_arq + am_addr */
+	set0 arqnx,pdata
+	set1 flowx,pdata
+	store 1,mem_arq
+am_addr_match:
+	call rf_debug_rx_match_line	//L
+	enable match
+am_addr_ok:
+	bpatch patch0a_3,mem_patch0a
+	fetch 1,mem_rx_type
+	icopy type
+	bmark1 mark_am_addr_broadcast,arqn_bypass        /* arqn doesn't make sense */
+	fetcht 1,mem_temp_arq
+	fetch 1,mem_arq
+	set0 flow,pdata
+	isolate1 flow,temp
+	setflag true,flow,pdata
+	isolate1 arqn,temp
+	setflag true,arqn,pdata
+	store 1,mem_arq
+	isolate0 arqn,temp
+	branch arqn_bypass,true
+	call clear_got_tx
+arqn_bypass:
+	bpatch patch0a_4,mem_patch0a
+	arg 0,temp
+	call reserve_slot
+	and type,0xf,pdata
+	beq type_poll,process_poll
+	beq type_null,end_of_packet	/* null */
+	beq type_fhs,process_fhs
+	fetcht 1,mem_temp_arq
+	fetch 1,mem_arq
+	icompare 0x04,temp    /* bit 2 is seqn */
+	nbranch rx_type_dispatch,true   /* different then it's new */
+	bmark0 mark_am_addr_broadcast,failed_seqn         /* seqn failed, and not broadcast */
+	bbit0 bcast1,rx_type_dispatch           /* first broadcast never fail seqn */
+failed_seqn:
+	set1 mark_old_packet,mark
+rx_type_dispatch:
+	bpatch patch0a_5,mem_patch0a
+	deposit type
+	beq type_dm1, process_dm1
+	beq type_dh1, process_dh1
+	beq type_3dh1, process_3dh1
+	arg 4,temp
+	call reserve_slot
+	beq type_dm3, process_dm3
+	beq type_dh3, process_dh3
+	arg 8,temp
+	call reserve_slot
+	beq type_dm5, process_dm5
+	beq type_dh5, process_dh5
+	rtn
+
+
+
+
+process_poll:
+	branch end_of_packet
+
+process_dm3:
+process_dm5:
+	set1 mark_longpacket,mark
+process_dm1:
+	enable decode_fec2
+	branch process_dmh
+	
+process_dh3:
+process_dh5:
+	set1 mark_longpacket,mark
+process_3dh1:
+	set1 PSK3M,radio_ctrl
+process_dh1:
+	enable decode_fec0
+process_dmh:
+	bpatch patch0a_6,mem_patch0a
+	bmark1 mark_first_packet,end_of_packet
+	bmark1 mark_rxbuf_inuse,end_of_packet			/* buffer in use, nack */
+	isolate0 PSK,radio_ctrl
+	branch process_dmh_noedr,true
+	disable enable_white
+	enable decode_fec0
+	disable decode_fec2
+	add clkn_bt,2,timeup
+	correlate clkn_bt,meet
+	nbranch error_payload,sync
+	set1 mark_longpacket,mark
+	enable enable_white
+process_dmh_noedr:
+	bpatch patch0a_7,mem_patch0a
+	enable encrypt
+	enable enable_crc
+	parse demod,bucket,3  /* parse in lch+l2cap flow */
+	rshift8 pwindow,pdata
+	store 1,mem_lch_code		/* for loopback */
+	parse demod,bucket,5  /* parse in 5 bit packetlength */
+	bmark1 mark_longpacket,process_dmh_long
+	rshift3 pwindow,loopcnt
+	rshift3 loopcnt,loopcnt
+	branch process_dmh_common
+process_dmh_long:
+	parse demod,bucket,5		/* multi slot packet length of dh3 dh5 dm3 dm5 */
+	rshift pwindow,loopcnt
+	parse demod,bucket,3  /* undefined+bit 9 of length */
+process_dmh_common:	
+	bpatch patch0b_0,mem_patch0b
+	deposit loopcnt
+	store 2,mem_len
+	branch process_dmh_data_0,blank
+	call check_enc_ccm
+	branch process_dmh_common2,blank
+process_dmh_common2_ccm:
+	increase 4,loopcnt
+	deposit loopcnt
+process_dmh_common2:	
+	isub mask3ff,null
+	branch error_payload,positive	/* packet too large, discard */
+	bpatch patch0b_1,mem_patch0b
+	set0 mark_fhs_eir,mark
+	fetch 1,mem_lch_code
+	and_into 0x03,pdata
+	arg mem_rxbuf,contw //lmp_data or test packet
+	beq LLID_LMP,process_lmp
+	bmark1 mark_testmode,process_dmh_common2_testmode
+	//non-HCI mode
+	fetch 1,mem_lch_code
+	and_into 0x03,pdata
+	beq LLID_L2CAP_START,process_dmh_data_l2cap_start_pkt
+	beq LLID_L2CAP_CONT,process_dmh_data_l2cap_continue_pkt
+	branch error_payload
+	
+process_dmh_common2_testmode:	
+	arg mem_l2cap_rxbuff1,contw
+	branch process_dmh_data	
+
+process_dmh_data_0:
+	call check_enc_ccm
+	branch process_dmh_data_end,blank
+	setarg 0
+	store 2,mem_ccm_len
+	parse demod,bucket,32
+	rshift32 pdata,pdata
+	rshift8 pdata,pdata
+	store 4,mem_le_peer_mic
+	branch process_dmh_data_end
+	
+//blank not enc_ccm
+check_enc_ccm:
+	fetch 1,mem_state_map
+	bbit0 smap_encryption,enable_blank
+	fetch 1,mem_encapsulated_minor_type
+	bne ENCAPSULATED_MINOR_TYPE_P256,enable_blank
+	branch disable_blank
+	
+process_lmp:
+	fetch 2,mem_len
+	sub pdata,17,null		//lmp buffer size
+	nbranch error_payload,positive
+	bmark1 mark_old_packet,ack_payload
+	branch process_dmh_data
+
+	
+process_dmh_data_l2cap_start_pkt:
+	bpatch patch0b_2,mem_patch0b
+	bmark1 mark_old_packet,ack_payload
+	fetch 2,mem_len
+	arg 0x2e0,temp //l2cap buffer size
+	isub temp,null
+	branch error_payload,positive
+	fetch 1,mem_l2cap_rxbuff_inuse
+	bbit0 L2CAP_INUSE_BUFF1,process_dmh_data_into_buff1
+	bbit0 L2CAP_INUSE_BUFF2,process_dmh_data_into_buff2
+	branch end_of_packet
+process_dmh_data_into_buff1:
+	jam 1,mem_l2cap_rxbuff_new //new data in buff 1
+	fetch 2,mem_l2cap_rxbuff1_len
+	bne 0,end_of_packet			//baseband head error
+	arg mem_l2cap_rxbuff1,contw
+	branch process_dmh_data
+process_dmh_data_into_buff2:
+	jam 2,mem_l2cap_rxbuff_new //new data in buff 2
+	fetch 2,mem_l2cap_rxbuff2_len
+	bne 0,end_of_packet
+	arg mem_l2cap_rxbuff2,contw
+	branch process_dmh_data
+	
+process_dmh_data_l2cap_continue_pkt:
+	bpatch patch0b_3,mem_patch0b
+	bmark1 mark_old_packet,ack_payload
+	fetch 2,mem_len
+	arg 0x2e0,temp //l2cap buffer size
+	isub temp,null
+	branch error_payload,positive
+	fetch 1,mem_l2cap_rxbuff_new
+	beq 1,process_dmh_data_l2cap_continue_pkt1
+	beq 2,process_dmh_data_l2cap_continue_pkt2
+	branch end_of_packet
+process_dmh_data_l2cap_continue_pkt1:
+	arg mem_l2cap_rxbuff1,contw
+	fetch 2,mem_l2cap_rxbuff1_len
+	iadd contw,contw
+	branch process_dmh_data
+process_dmh_data_l2cap_continue_pkt2:
+	arg mem_l2cap_rxbuff2,contw
+	fetch 2,mem_l2cap_rxbuff2_len
+	iadd contw,contw
+process_dmh_data:	
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	loop process_dmh_data
+process_dmh_data_end:	
+	bpatch patch0b_4,mem_patch0b
+	parse demod,bucket,16  /* cycle through the crc */
+	branch error_payload_crc,crc_failed
+	call check_enc_ccm
+	call enable_user2
+	ncall ccm_br_decrypt_new,blank
+	nbranch error_mic_error,user2
+	call rf_debug_rx_crc_line	//L
+
+	fetch 1,mem_l2cap_flow_ctrl_flag
+	beq L2CAP_FLOW_CTRL_ENABLE,flow_ctrl
+
+	bmark1 mark_testmode,process_dmh_cont
+	bmark1 mark_old_packet,redundant_payload
+	fetch 1,mem_lch_code
+	compare 3,pdata,3
+	branch process_dmh_cont,true
+	fetch 2,mem_len
+	branch process_dmh_cont,blank
+	bpatch patch0b_5,mem_patch0b
+	fetch 1,mem_l2cap_rxbuff_new
+	beq 1,process_l2cap_pass_crc_buff1
+	beq 2,process_l2cap_pass_crc_buff2
+	branch assert
+process_l2cap_pass_crc_buff1:
+	fetch 2,mem_l2cap_rxbuff1_len
+	fetcht 2,mem_len
+	iadd temp,pdata
+	store 2,mem_l2cap_rxbuff1_len
+	rtn blank
+	fetcht 2,mem_l2cap_rxbuff1// l2cap payload length
+	increase 4,temp
+	isub temp,null
+	call l2cap_buff1_inuse,zero //l2cap pkts not ended
+	branch process_dmh_cont
+process_l2cap_pass_crc_buff2:
+	fetch 2,mem_l2cap_rxbuff2_len
+	fetcht 2,mem_len
+	iadd temp,pdata
+	store 2,mem_l2cap_rxbuff2_len
+	rtn blank
+	fetcht 2,mem_l2cap_rxbuff2// l2cap payload length 
+	add temp,4,temp
+	isub temp,null
+	call l2cap_buff2_inuse,zero //l2cap pkts not ended
+//	branch process_dmh_cont
+process_dmh_cont:
+	bpatch patch0b_6,mem_patch0b
+	fetcht 1,mem_state_map
+	fetch 1,mem_lch_code
+	compare 3,pdata,0x03
+	setflag true,smap_rxlmp,temp
+	nsetflag true,smap_rxl2cap,temp
+	storet 1,mem_state_map
+	nbranch process_dmh_cont_rxbuf_not_use,true
+	set1 mark_rxbuf_inuse,mark
+process_dmh_cont_rxbuf_not_use:
+	bmark0 mark_testmode,ack_payload
+	isolate1 smap_rxlmp,temp
+	branch ack_payload,true
+	fetch 2,mem_tst_pktcnt_crc
+	increase 1,pdata
+	store 2,mem_tst_pktcnt_crc
+	set1 mark_loopback,mark
+	set0 smap_rxl2cap,temp
+	set0 mark_rxbuf_inuse,mark
+	storet 1,mem_state_map
+ack_payload:
+	bpatch patch0b_7,mem_patch0b
+	call check_enc_ccm
+	ncall ccm_br_pcnt_rx_add,blank
+	fetcht 1,mem_temp_arq
+	fetch 1,mem_arq
+	set1 arqnx,pdata
+	isolate1 seqn,temp            /* if accept, seqn always copies from the header */
+	setflag true,seqn,pdata
+	isolate1 mark_am_addr_broadcast,mark
+	setflag true,bcast1,pdata
+	store 1,mem_arq
+	fetch 2,mem_len
+	nbranch end_of_packet,blank
+	fetch 1,mem_state_map
+	set0 smap_rxl2cap,pdata//better to do this in l2cap_flow_ctrl_stop
+	store 1,mem_state_map
+	fetch 1,mem_lch_code
+	compare 0x01,pdata,0x07
+	//call l2cap_flow_ctrl_stop,true
+	branch end_of_packet
+	
+error_header:
+	bpatch patch0c_0,mem_patch0c
+	disable match
+	fetch 2,mem_rx_hec_err
+	increase 1,pdata
+	store 2,mem_rx_hec_err
+	branch end_of_packet
+error_payload_crc:
+	fetch 2,mem_rx_crc_err
+	increase 1,pdata
+	store 2,mem_rx_crc_err
+	call discard_pkt
+	bmark0 mark_testmode,error_payload
+	set1 mark_loopback,mark
+error_payload:
+	branch end_of_packet
+
+flow_ctrl:
+error_mic_error:
+	branch error_payload_crc
+
+	
+discard_pkt:
+	bpatch patch0c_1,mem_patch0c
+	fetch 1,mem_lch_code
+	compare 3,pdata,0x03
+	nbranch discard_pkt_l2cap,true
+discard_pkt_lmp:	
+	fetcht 1,mem_state_map
+	set0 smap_rxlmp,temp
+	storet 1,mem_state_map
+	rtn
+discard_pkt_l2cap:
+//	isolate1 mark_testmode,mark
+//	setflag true,mark_loopback,mark
+	fetcht 1,mem_state_map
+	set0 smap_rxl2cap,temp
+	storet 1,mem_state_map
+	rtn
+
+redundant_payload:
+	fetch 1,mem_arq
+	set1 arqnx,pdata
+	store 1,mem_arq
+end_of_packet:
+	bpatch patch0c_2,mem_patch0c
+	disable encode_fec0
+	disable encode_fec2
+	disable decode_fec0
+	disable decode_fec2
+	disable enable_crc
+	disable encrypt
+	disable enable_white
+	branch shutdown_radio,is_rx
+	until null,tx_clear
+	nop 100          /* flush out the last bit */
+	branch shutdown_radio
+	
+process_fhs:
+	bpatch patch0c_3,mem_patch0c
+	enable enable_crc
+	enable decode_fec2
+	parse demod,bucket,72
+	isolate1 58,pdata
+	setflag true,mark_fhs_eir,mark
+	copy bt_adr,temp             /* save current address to aside */
+	ialigned bt_adr            /* send it to access gen */
+	ialigned fhs0			/* get fhs_misc */
+	pulse recalc                /* calc the lap just received from the other guy */
+	setsect 2,0xfffff             /* preset ms of shift reg as big mask */
+	setsect 3,0x0ffff             /* preset ms of shift reg as big mask */
+	nop 32                       /* 30 cycles after recalc */
+	iverify fhs_parity             /* check fhs_parity against ls 34 bits at shift reg, with msb 36 bits as mask */
+	deposit lap
+	store 3,extm_lap
+	deposit uap
+	store 1,extm_uap
+	copy temp,bt_adr             /* put the address back */
+	branch fhs_parity_ok,true     /* fhs parity failed */
+	branch error_payload
+fhs_parity_ok:
+	bpatch patch0c_4,mem_patch0c
+	parse demod,bucket,72
+	ialigned fhs1                   /* give host the information on class and fhs_misc */
+	ialigned am_addr                /* store the am_addr the master assigned us */
+	ialigned nap
+	ialigned regb                   /* store external clock in regb according to clock format */
+	force 0,pdata
+	parse demod,bucket,16  /* cycle through the crc */
+	branch error_payload,crc_failed
+	call rf_debug_rx_crc_line	//L
+	setarg 0x0ffffffc
+	iand regb,pdata
+	store 4,mem_clke_bt
+	deposit fhs_class
+	store 3,extm_class
+	deposit fhs_misc
+	store 1,extm_fhs_misc
+	deposit am_addr
+	store 1,extm_newconn_am_addr
+	deposit nap
+	store 2,extm_nap
+	deposit bt_clk
+	inject rxf,32
+	compare type_fhs,type,0x0f         /* see if this was fhs packet */
+	setflag true,mark_fhs_already_good,mark
+	branch end_of_packet
+
+clear_got_tx:
+	bpatch patch0c_5,mem_patch0c
+	fetch 1,mem_arq
+	rtnbit0 wack
+	set0 wack,pdata
+	setflip seqnx,pdata
+	store 1,mem_arq
+	call check_enc_ccm
+	ncall ccm_br_pcnt_tx_add,blank
+	fetch 1,mem_last_type
+	beq type_lmp,clear_got_txlmp
+	rtneq type_hv3
+	fetch 1,mem_op
+	rtnbit0 op_txl2cap,pdata
+	set0 op_txl2cap,pdata
+	set1 op_pkt_comp,pdata
+	store 1,mem_op
+	set0 mark_tx_l2cap,mark
+	fetch 2,mem_l2cap_tx_multi_offset
+	nrtn blank
+	fetch 1,mem_op
+	set0 op_pkt_comp,pdata
+	store 1,mem_op
+	branch l2cap_malloc_free
+
+clear_got_txlmp:
+	bpatch patch0c_6,mem_patch0c
+	fetch 1,mem_lmo_header_opcode_x
+	rshift pdata,pdata
+	beq LMP_START_ENCRYPTION_REQ,start_encryption
+	beq LMP_STOP_ENCRYPTION_REQ,stop_encryption
+	beq LMP_UNSNIFF_REQ, sniff_exit
+	beq LMP_ESCAPE,clear_lmp_escape
+	rtnne LMP_ACCEPTED
+	fetch 1,mem_lmo_payload
+	beq LMP_START_ENCRYPTION_REQ,clear_send_setup_complete
+	rtn
+
+clear_lmp_escape:
+	fetch 1,mem_lmo_payload
+	set1 7,pdata
+	rtn
+clear_send_setup_complete:
+	rtn master
+	fetch 1,mem_state
+	rtnbit1 state_conn_comp
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	rtn
+	
+	
+start_encryption:
+	bpatch patch0c_7,mem_patch0c
+	fetch 1,mem_state_map
+	set1 smap_encryption,pdata
+	store 1,mem_state_map
+	jam 1,core_encrypt
+	force 0,pdata
+	store 5,mem_ccm_pcnt_rx
+	set1 BR_CCM_DIRECTIONBIT,pdata
+	store 5,mem_ccm_pcnt_tx	
+	rtn	
+
+stop_encryption:
+	bpatch patch0d_0,mem_patch0d
+	fetch 1,mem_state_map
+	set0 smap_encryption,pdata
+	store 1,mem_state_map
+	jam 0,core_encrypt
+	rtn
+
+
+sniff_init:
+	bpatch patch0d_1,mem_patch0d
+	add clkn_bt,3,rega
+	branch sniff_init_master,master
+	add clke_bt,3,rega
+sniff_init_master:
+	fetcht 2,mem_tsniff
+	deposit rega
+	set0 27,pdata
+	idiv temp
+	fetch 2,mem_dsniff
+	call wait_div_end
+	remainder regc
+	isub regc,pdata
+	branch sniff_init_nowrap,positive
+	iadd temp,pdata
+sniff_init_nowrap:
+	iadd rega,pdata
+	store 4,mem_sniff_anchor
+	jam SWITCH_FLAG_INIT,mem_switch_flag
+	fetch 1,mem_state
+	set1 state_insniff,pdata
+	store 1,mem_state
+	fetch 1,mem_sniff_attempt
+	store 1,mem_current_sniff_attempt
+	setarg 0
+	store 3,mem_sniff_rcv
+	store 3,mem_sniff_lost
+	store 1,mem_sniff_unint_lost
+	jam BT_EVT_ENTER_SNIFF,mem_fifo_temp
+	call ui_ipc_send_event
+	fetch 2,mem_rx_window_sniff
+	store 2,mem_rx_window
+	nrtn master
+	add am_addr,-1,queue
+	rtn
+
+sniff_exit:
+	bpatch patch0d_2,mem_patch0d
+	fetch 1,mem_state
+	rtnbit0 state_insniff
+	set0 state_insniff,pdata
+	store 1,mem_state
+	fetch 2,mem_rx_window_init
+	store 2,mem_rx_window
+	disable wake
+	jam BT_EVT_EXIT_SNIFF,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+check_attempt:
+	bpatch patch0d_3,mem_patch0d
+	enable attempt
+	fetch 1,mem_state
+	bbit1 state_insniff,check_attempt_sniff
+	rtnmark1 mark_testmode						/* pdata won't be blank now, try attempt */
+	fetch 1,mem_arq
+	rtnbit1 wack
+	fetch 1,mem_lmp_to_send
+	nrtn blank
+	fetch 1,mem_op
+	rtnbit1 op_txl2cap
+check_attempt_nomore:
+	force 0,pdata
+	rtn
+
+check_attempt_sniff:
+	bbit0 state_insco,check_attempt_not_sco
+	fetch 1,mem_current_sniff_attempt
+	beq 2,check_attempt_sniff_restore_sco
+	fetch 1,mem_arq
+	bbit1 wack,check_attempt_notimeout
+	bmark0 mark_esco_rxok,check_attempt_notimeout
+check_attempt_sniff_restore_sco:
+	nbranch check_attempt_notimeout,master
+	fetch 1,mem_lmp_to_send
+	nbranch check_attempt_notimeout,blank
+check_attempt_sco_master:
+	branch check_attempt_nomore
+
+
+
+
+
+	
+check_attempt_not_sco:
+	fetch 1,mem_current_sniff_attempt
+	bne 1,check_attempt_notimeout
+	fetch 1,mem_current_sniff_timeout
+	branch check_attempt_notimeout,blank
+	increase -1,pdata
+	store 1,mem_current_sniff_timeout
+	fetch 1,mem_arq
+	rtnbit1 wack						// waiting for next ack
+	nrtn match						// waiting for next poll
+check_attempt_notimeout:
+	fetch 1,mem_current_sniff_attempt
+	increase -1,pdata
+	store 1,mem_current_sniff_attempt
+	rtn
+
+
+
+
+
+
+
+
+
+	/* enable user if sniff window vialation, queue is extra overhead */
+sniff_check_window:
+	bpatch patch0d_4,mem_patch0d
+	disable swfine
+	copy temp,stop_watch
+	call context_search_sniff_window
+	disable user
+	nrtn zero
+	force 0,stop_watch
+	enable user
+	rtn
+
+	//return true if it is esco context
+check_esco_amaddr:
+	fetch 1,mem_esco_addr
+	icompare 0xff,am_addr
+	rtn
+	
+
+parse_l2cap:	
+	bpatch patch0d_5,mem_patch0d
+	set0 mark_rxbuf_inuse,mark 
+parse_l2cap_cont:
+	jam L2CAP_RX_CLEAR,mem_l2cap_rx_done
+	fetch 1,mem_l2cap_rxbuff_inuse
+	rtn blank
+	isolate1 L2CAP_INUSE_BUFF1,pdata
+	arg mem_l2cap_rxbuff1,contr
+	call process_rx_l2cap_pkt,true
+	bpatch patch0d_6,mem_patch0d
+	fetch 1,mem_l2cap_rx_done
+	beq L2CAP_RX_DONE,parse_l2cap_release_buff1
+	
+	jam L2CAP_RX_CLEAR,mem_l2cap_rx_done
+	fetch 1,mem_l2cap_rxbuff_inuse
+	rtnbit0 L2CAP_INUSE_BUFF2
+	arg mem_l2cap_rxbuff2,contr	
+	call process_rx_l2cap_pkt
+	fetch 1,mem_l2cap_rx_done
+	beq L2CAP_RX_DONE,parse_l2cap_release_buff2
+	rtn
+		
+parse_l2cap_release_buff1:
+	fetch 1,mem_l2cap_rxbuff_inuse
+	set0 L2CAP_INUSE_BUFF1,pdata
+	store 1,mem_l2cap_rxbuff_inuse
+	setarg 0
+	store 2,mem_l2cap_rxbuff1_len
+	rtn
+parse_l2cap_release_buff2:
+	fetch 1,mem_l2cap_rxbuff_inuse
+	set0 L2CAP_INUSE_BUFF2,pdata
+	store 1,mem_l2cap_rxbuff_inuse
+	setarg 0
+	store 2,mem_l2cap_rxbuff2_len
+	rtn
+
+l2cap_buff1_inuse:
+	fetch 1,mem_l2cap_rxbuff_inuse
+	set1 L2CAP_INUSE_BUFF1,pdata
+	store 1,mem_l2cap_rxbuff_inuse
+	rtn
+
+l2cap_buff2_inuse:
+	fetch 1,mem_l2cap_rxbuff_inuse
+	set1 L2CAP_INUSE_BUFF2,pdata
+	store 1,mem_l2cap_rxbuff_inuse
+	rtn
+
+/******************************************/
+/**********  Transmit Packet  *************/
+/******************************************/
+
+slave_send_access:
+	bpatch patch0d_7,mem_patch0d
+	add clke_bt,1,bt_clk          /* slave start to use native clock */
+	call fetch_extm_bt_adr
+	force 0x03,freq_mode          /* connection frequency */
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_external
+	branch send_access_word
+	
+
+slave_conn_send_packet:
+	bpatch patch0e_0,mem_patch0e
+	call rf_setup_time_slave_slot
+	deposit clke_bt
+	fetcht 4,mem_next_btclk
+	isub temp,pdata
+	rtnne 1					/* missed slave slot */
+	compare type_null,type,0x1f
+	nbranch slave_conn_send_access,true
+	fetch 1,mem_rx_type
+	rtn blank					/* null packet, do nothing */
+slave_conn_send_access:
+	call slave_send_access
+transmit_packet:
+	compare type_id,type,0x1f        /* is this id only ? */
+	branch end_of_packet,true
+	rshift bt_clk,temp
+	or temp,0x40,white_init
+transmit_packet_whitened:
+	bpatch patch0e_1,mem_patch0e
+	enable enable_white
+	enable enable_hec
+	enable encode_fec1
+	set0 mark_longpacket,mark
+	deposit am_addr
+	inject mod,3             /* am_addr, temp is disabled */
+	deposit type
+	inject mod,4
+	fetch 1,mem_arq   /* aka mem_arq */
+	inject bucket,4  /* align up to flowx, arqnx, seqnx */
+	inject mod,3
+	enable enable_parity
+	inject mod,8   /* transmit parity */
+	disable encode_fec1
+	disable enable_parity
+	disable enable_hec
+	set0 PSK3M,radio_ctrl
+	arg 0,temp
+	call reserve_slot
+	bpatch patch0e_2,mem_patch0e
+	and type,0x1f,pdata
+	beq type_lmp, transmit_lmp
+	beq type_null, end_of_packet
+	beq type_poll, end_of_packet
+	beq type_fhs, transmit_fhs  /* master mode fhs need got_tx and ack */
+	beq type_dm1, transmit_dm1
+	beq type_dh1, transmit_dh1
+	beq type_3dh1, transmit_3dh1
+	arg 4,temp
+	call reserve_slot
+	beq type_dm3, transmit_dm3
+	beq type_dh3, transmit_dh3
+	arg 8,temp
+	call reserve_slot
+	beq type_dh5, transmit_dh5
+	branch transmit_dm5	/* must be 14, dm5 */
+
+
+	
+transmit_fhs:
+	bpatch patch0e_3,mem_patch0e
+	fetch 1,mem_fhs_am_addr            /* this is the am_addr to assign to slave */
+	icopy am_addr
+	fetch 1,mem_fhs_misc
+	icopy fhs_misc    /* [7:6]SR [5:4]SP [3:1]PS [0]undef  */
+	fetch 3,mem_class   /* store away class */
+	icopy fhs_class
+	fetch 2,mem_nap
+	icopy nap
+	enable enable_crc
+	enable encode_fec2
+	copy bt_adr,rega
+	call fetch_self_bt_adr
+	pulse recalc
+	nop 32                    /* 30 cycles after recalc for sync word generation */
+	copy bt_clk,timeup
+	fetch 4,mem_clkn_bt
+	icopy bt_clk
+	preload fhs0
+	set1 58,pdata		/* eir */
+	inject mod,72
+	preload fhs1
+	inject mod,72
+	copy timeup,bt_clk
+	copy rega,bt_adr
+	enable enable_parity
+	inject mod,16   /* generate CRC */
+	disable enable_parity
+	branch end_of_packet
+
+transmit_lmp_ccm:
+	disable encrypt
+	branch transmit_lmp_common
+	
+transmit_lmp:
+	bpatch patch0e_4,mem_patch0e
+	call check_enc_ccm
+	nbranch transmit_lmp_ccm,blank
+	enable encrypt
+transmit_lmp_common:
+	enable enable_crc
+	enable encode_fec2
+	fetch 1,mem_lmo_header_length   /* this is the payload header */
+	and pdata,0x1f8,temp       /* temp is number of bits, check payload header format */
+	arg mem_lmo_header_length,contr
+	increase 8,temp   /* temp is in bits */
+	rshift3 temp,loopcnt
+transmit_lmp_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop  transmit_lmp_loop
+	branch transmit_end
+
+
+transmit_dm1:
+	enable encode_fec2
+	branch transmit_dmh
+transmit_dm3:
+transmit_dm5:
+	enable encode_fec2
+	set1 mark_longpacket,mark
+	branch transmit_dmh
+
+transmit_3dh1:
+	set1 PSK3M,radio_ctrl
+transmit_dh1:
+	enable encode_fec0
+	branch transmit_dmh
+	
+transmit_dh3:
+transmit_dh5:
+	set1 PSK3M,radio_ctrl
+	enable encode_fec0
+	set1 mark_longpacket,mark
+
+transmit_dmh:
+	bpatch patch0e_5,mem_patch0e
+	fetch 1,mem_state_map
+	bbit0 smap_edr,transmit_noedr
+	sub type,3,null
+	branch transmit_noedr,positive
+	disable encrypt
+	disable encode_fec2
+	enable encode_fec0
+	disable enable_white
+	set1 PSK,radio_ctrl
+	isolate1 PSK3M,radio_ctrl
+	branch transmit_edr3m,true
+	setarg 0xabeee
+	inject mod,20
+	branch transmit_edr_sync_end
+transmit_edr3m:
+	setarg 0x5faeba
+	inject mod,24
+	setarg 0x12
+	inject mod,6
+transmit_edr_sync_end:	
+	enable enable_white
+	set1 mark_longpacket,mark
+transmit_noedr:
+	enable encrypt
+	enable enable_crc
+	bmark1 mark_loopback,transmit_loopback
+	fetch 1,mem_tx_lch
+	inject mod,3
+	fetch 2,mem_tx_len
+	iforce loopcnt
+	bmark1 mark_longpacket,transmit_long
+	inject mod,5
+	branch transmit_stuff
+transmit_long:	
+	inject mod,13
+transmit_stuff:
+	deposit loopcnt
+	branch transmit_end,blank
+	fetch 2,mem_txptr
+	iforce contr
+transmit_stuff_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop transmit_stuff_loop
+//	branch transmit_end
+
+transmit_end:
+	bpatch patch0e_6,mem_patch0e
+	call check_enc_ccm
+	branch transmit_end2,blank
+	fetch 4,mem_le_mic  
+	inject mod,32
+transmit_end2:	
+	enable enable_parity
+	inject mod,16
+	disable enable_parity
+	call set_wait_ack
+	fetch 1,mem_state_map
+	bbit0 smap_edr,end_of_packet
+	force 0,pdata
+	inject mod,6				/* edr trailer */
+	branch end_of_packet
+
+
+transmit_loopback:
+	bpatch patch0e_7,mem_patch0e
+	bmark1 mark_longpacket,transmit_loopback_long
+transmit_loopback_short:
+	fetch 1,mem_lch_code
+	inject mod,3						/* LLID and FLOW */
+	fetch 1,mem_len	/* take packet length */
+	iforce regc
+	inject mod,5
+	branch transmit_loopback_cont
+transmit_loopback_long:
+	fetch 1,mem_lch_code
+	inject mod,3						/* LLID and FLOW */
+	fetch 2,mem_len	/* take packet length */
+	iforce regc
+	inject mod,13
+transmit_loopback_cont:
+	arg mem_l2cap_rxbuff1,contr
+transmit_loopback_loop:	
+	copy regc,null
+	branch transmit_loopback_end,zero
+	ifetch 1,contr
+	inject mod,8
+	increase -1,regc
+	branch transmit_loopback_loop
+transmit_loopback_end:
+	fetch 2,mem_tst_pktcnt_dmh
+	increase 1,pdata
+	store 2,mem_tst_pktcnt_dmh
+	branch transmit_end
+	
+
+apply_switch_clke:
+	fetch 4,mem_clke_bt
+	add pdata,7,rega
+	fetch 2,mem_slot_offset
+	nbranch apply_switch_nozero,blank
+	increase -3,rega
+	branch apply_switch_wait_loop
+apply_switch_nozero:
+	mul32 pdata,12,pdata
+	fetcht 2,core_halfslot
+	increase 1,temp
+apply_switch_loop:
+	isub temp,pdata
+	nbranch apply_switch_bt,positive
+	increase -1,rega
+	branch apply_switch_loop
+apply_switch_bt:
+	sub pdata,0,pdata
+apply_switch_wait_loop:
+	until null,oneslot
+	compare 0,clkn_bt,3
+	nbranch apply_switch_wait_loop,true
+	iforce clke_rt
+	copy rega,clke_bt
+	iforce clke_rt
+	rtn
+	
+
+calc_slot_offset:
+	bpatch patch0f_0,mem_patch0f
+	until null,halfslot
+	deposit clke
+	iforce contr
+	rshift16,pdata,pdata
+	isub clkn_bt,loopcnt
+	and_into 3,loopcnt			/* bt portion */
+	nbranch calc_bt_portion,zero
+	force 0,pdata
+	branch calc_skip_bt
+calc_bt_portion:
+	fetcht 2,mem_param_rt_rthalfslot
+	force 0,pdata
+calc_slot_offset_loop:
+	iadd temp,pdata
+	loop calc_slot_offset_loop
+calc_skip_bt:
+	iadd contr,pdata			/* add rt portion */
+	div pdata,12
+	call get_div_result
+	store 2,mem_slot_offset
+	rtn
+
+calc_clke_offset:
+	bpatch patch0f_1,mem_patch0f
+	deposit clke
+	copy clkn,temp
+	isub temp,null
+	nsetflag positive,44,pdata
+	isub temp,temp
+	fetch 2,mem_param_rt_rthalfslot
+	isolate0 15,temp
+	branch calc_clke_pos,true
+	copy temp,alarm
+	arg 0x10000,temp
+	fetch 2,mem_param_rt_rthalfslot
+	isub temp,pdata
+	iadd alarm,temp
+	
+calc_clke_pos:
+	storet 6,mem_le_clk_offset
+	rtn le
+	storet 6,mem_clk_offset
+	rtn
+
+calc_clke:
+	disable clknt
+	fetch 6,mem_le_clk_offset
+	branch calc_clke2,le
+	fetch 6,mem_clk_offset
+calc_clke2:
+	iadd clkn,alarm
+	increase 10,alarm
+	fetch 2,mem_param_rt_rthalfslot
+	isub alarm,pdata
+	isolate0 15,pdata
+	branch calc_clke_pos_adj,true
+	setarg 0x10000
+	fetchr regd,2,mem_param_rt_rthalfslot
+	isub regd,pdata
+	iadd alarm,alarm
+calc_clke_pos2:
+	copy alarm,clke
+	rtn
+calc_clke_pos_adj:		/* add 2 clock */
+	force 0,null
+	branch calc_clke_pos2
+	
+/******************************************/
+/********* RF related functions ***********/
+/******************************************/
+
+calc_mod_value_scale:
+	branch calc_mod_value_scale_le2,le
+	setarg 0x402c17
+	store 3,mem_scale_ratio
+	rshift16 access,pdata
+	rshift3 pdata,temp
+	arg 48,loopcnt
+calc_mod_value_scale_do:
+	setarg 0
+	store 3,mem_xcnt
+calc_mod_vs_loop:
+	rshift temp,pdata
+	ixor temp,pdata
+	and_into 3,pdata
+	bbit0 1,calc_mod_vs01
+	pincrease -1
+calc_mod_vs01:
+	arg mem_xcnt,contw
+	iadd contw,contw
+	ifetch 1,contw
+	pincrease 1
+	istore 1,contw
+	rshift temp,temp
+	loop calc_mod_vs_loop
+	arg mem_xcnt+2,rega
+	arg mem_scale_ratio,regb
+	arg 0,regc
+	arg 3,loopcnt
+calc_mod_vs_loop2:
+	ifetch 1,rega
+	ifetcht 1,regb
+	imul32 temp,pdata
+	iadd regc,regc
+	increase -1,rega
+	increase 1,regb
+	loop calc_mod_vs_loop2
+	fetch 1,mem_scale_ratio+1
+	lshift8 pdata,pdata
+	lshift4 pdata,pdata
+	idiv regc
+	call wait_div_end
+	quotient pdata
+	store 2,mod_value_scale1
+	store 2,mem_scale_ratio_temp
+	rtn
+
+calc_mod_value_scale_le2:
+	fetch 2,mem_scale_ratio_temp
+	store 2,mod_value_scale1
+	rtn
+
+calc_mod_value_scale_le:
+	setarg 0x402d19
+	store 3,mem_scale_ratio
+	rshift32 access,pdata
+	rshift3 pdata,temp
+	arg 32,loopcnt
+	branch calc_mod_value_scale_do
+
+calc_radio_freq:
+	bpatch patch0f_2,mem_patch0f
+	call set_sync_on
+	copy bt_clk,pdata
+	and_into 0x180,pdata
+	compare 3,freq_mode,0x07
+	nbranch freq_not_connection,true    /* don't do the hack if not in connection */
+	rshift3 pdata,pdata
+	iadd freq_index,pdata
+	branch do_hop_mod_now
+freq_not_connection:	
+	copy freq_index,pdata
+do_hop_mod_now:
+	div pdata,79
+	pulse recalc         /* now is good time to recalc id */
+	call wait_div_end
+	remainder rega
+	add rega,-40,temp
+	branch odd_half,positive
+	lshift rega,temp
+	branch freq_result
+odd_half:
+	lshift temp,temp
+	increase 1,temp
+freq_result:	
+	bpatch patch0f_3,mem_patch0f
+	fetch 1,mem_mode
+	bbit0 afh_change,afh_process_con
+afh_process_0:	
+	fetch 4, mem_afh_instant   
+	isub bt_clk, null
+	branch afh_process_con,positive
+	call afh_clear
+	fetch 1,mem_afh_new_mod
+	rtn blank
+	fetch 1,mem_mode
+	set1 afh_enable,pdata
+	store 1,mem_mode
+	fetch 5,mem_afh_map_new
+	store 5,mem_afh_map_lo
+	ifetch 5,contr
+	store 5,mem_afh_map_hi
+	call afh_process_freq_map
+afh_process_con:
+	fetch 1,mem_mode
+	rtnbit0 afh_enable
+	isolate1 1,bt_clk
+	branch afh_same_channel,true	/* at odd slot, use the same as last even */
+	rshift3 temp,rega
+	and temp,7,queue
+	setarg mem_afh_map_lo  
+	iadd rega, rega
+	ifetch 1, rega
+	qisolate0 pdata
+	branch afh_process_1,true		/* not in map, do afh */
+	deposit temp
+	branch afh_process_end
+afh_process_1:
+	fetch 1, mem_afh_used
+	iforce regb                     
+	deposit bt_clk
+	and_into 0x180, pdata
+	rshift3 pdata,pdata
+	iadd freq_index,pdata
+	idiv regb
+	setarg mem_afh_map     
+	call wait_div_end
+	remainder rega
+	iadd rega,contr
+	ifetch 1,contr
+afh_process_end:	
+	store 1,mem_afh_index
+	iforce temp  
+  	rtn
+
+afh_same_channel:
+	fetch 1, mem_afh_index           /* last afh index  */
+	iforce temp
+	rtn
+
+afh_clear:
+	fetch 1,mem_mode
+	set0 afh_enable,pdata
+	set0 afh_change,pdata
+	store 1,mem_mode
+	rtn
+/*
+fixed_frequency:
+	fetcht 1,mem_fixed_freq
+	rtn
+*/
+afh_process_freq_map:
+	bpatch patch0f_4,mem_patch0f
+	arg mem_afh_map,contw
+	force 10,loopcnt
+	call memset0
+	arg mem_afh_map,contw
+	force 0,regc
+	force 2,queue
+process_freq_3:	
+	fetch 5,mem_afh_map_lo
+	iforce temp
+	compare 2,queue,0xff
+	branch process_freq_1,true
+	rshift temp,temp
+process_freq_1:	
+	isolate0 0,temp
+	branch process_freq_0,true
+	deposit regc
+	istore 1,contw
+process_freq_0:
+	rshift2 temp,temp
+	increase 2,regc
+	compare 40,regc,0xfe
+	nbranch process_freq_2,true
+	fetch 5,mem_afh_map_hi
+	iforce temp
+	compare 2,queue,0xff
+	branch process_freq_2,true
+	rshift temp,temp
+process_freq_2:	
+	sub regc,78,null
+	branch process_freq_1,positive
+	force 1,regc
+	increase -1,queue
+	nbranch process_freq_3,zero
+	arg mem_afh_map,rega
+	deposit contw
+	isub rega,pdata
+	store 1,mem_afh_used
+	rtn
+
+rx_radio_freq:
+	bpatch patch0f_5,mem_patch0f
+	call calc_radio_freq
+	fetch 1,mem_debug_config
+	bbit0 debug_rx_fixed_freq,rx_radio_freq_now
+	fetcht 1,mem_rx_fixed_freq
+rx_radio_freq_now:
+	branch set_freq_rx
+	
+
+tx_radio_freq:
+	bpatch patch0f_6,mem_patch0f
+	call calc_radio_freq
+	fetch 1,mem_debug_config
+	bbit0 debug_tx_fixed_freq,tx_radio_freq_now
+	fetcht 1,mem_tx_fixed_freq
+tx_radio_freq_now:
+	branch set_freq_tx
+	
+
+fetch_giac:
+	force 0,uap
+	fetch 3,mem_glap
+	iforce lap
+	rtn
+
+fetch_page_bt_adr:
+	bpatch patch0f_7,mem_patch0f
+	fetch 1,mem_hci_puap
+	icopy uap
+	fetch 3,mem_hci_plap
+	icopy lap
+	rtn
+
+fetch_self_bt_adr:
+	bpatch patch10_0,mem_patch10
+	fetch 2,mem_nap
+	icopy nap
+	fetch 1,mem_uap
+	icopy uap
+	fetch 3,mem_lap
+	icopy lap                 /* copy self_adr,bt_adr */      /* use own address */
+	rtn
+
+fetch_extm_bt_adr:
+	bpatch patch10_1,mem_patch10
+	fetch 2,mem_pnap
+	icopy nap
+	fetch 1,mem_puap
+	icopy uap
+	fetch 3,mem_plap
+	icopy lap         
+	rtn
+
+
+fetch_diac:
+	bmark1 mark_all_diac,fetch_diac_do
+	rtnmark0 mark_inquiry_state
+	rtnmark0 mark_periodical_diac
+fetch_diac_do:
+	and_into -256,lap
+	pulse recalc
+	nop 32
+	rtn
+
+
+shutdown_radio:
+	bpatch patch10_2,mem_patch10
+	call rf_debug_shutdown_radio_line	//L-H-L
+	force 0x08,radio_ctrl
+	force 0,radio_ctrl
+	disable is_rx
+	disable is_tx
+	pulse packet_end
+	jam 0x5,modem_en
+	nop 2
+	jam 0x0,modem_en
+	call set_sync_on
+	jam 0,core_syn_en
+	jam 0x10,core_rf_ldo_en0
+	fetch 1,core_clkpll_cfg6
+	set0 7,pdata
+	store 1,core_clkpll_cfg6
+	jam 0,core_rf_ldo_en1
+	branch gain_control
+
+
+
+set_sync_on:
+	bpatch patch10_3,mem_patch10
+	jam 0x5,modem_en
+	nop 2
+	jam 0x0,modem_en					/* if called from tx or rx */
+	fetch 1,mem_fcomp_div
+	beq XTAL_24M,set_sync_on_24m
+	beq XTAL_16M,set_sync_on_16m
+set_sync_on_24m:
+	jam 0xaa,core_rf_ldo_cfg4
+	jam 0xaa,core_rf_ldo_cfg5
+	jam 0x15,core_rf_ldo_cfg6
+	
+	jam 0x78,core_rf_ldo_en0 //ldo en
+	fetch 1,core_clkpll_cfg6
+	set1 7,pdata
+	store 1,core_clkpll_cfg6
+	jam 0x04,core_rf_ldo_en1
+	nop 60
+	jam 0x7a,core_syn_en //module en
+	jam 0,core_rx_en0
+	jam 0,core_rx_en1    
+	jam 0,core_tx_en0
+	jam 0,core_tx_en1
+
+	jam 0x2a,core_rf_ldo_cfg5  //ldo bleeding current disable
+	jam 0x78,core_rf_ldo_en0
+set_sync_on_next:
+	fetch 1,core_clkpll_cfg6
+	set0 7,pdata
+	store 1,core_clkpll_cfg6
+	jam 0,core_syn_cal_ctrl
+	rtn
+
+set_sync_on_16m:
+	jam 0xe6,core_syn_aac_cfg1
+
+	jam 0xaa,core_rf_ldo_cfg4
+	jam 0xaa,core_rf_ldo_cfg5
+	jam 0x15,core_rf_ldo_cfg6
+	
+	jam 0x78,core_rf_ldo_en0 //ldo en
+	fetch 1,core_clkpll_cfg6
+	set1 7,pdata
+	store 1,core_clkpll_cfg6
+	jam 0x04,core_rf_ldo_en1
+	nop 60
+	jam 0x3a,core_syn_en //module en
+	jam 0,core_rx_en0                 
+	jam 0,core_rx_en1       
+	jam 0,core_tx_en0
+	jam 0,core_tx_en1
+
+	jam 0x2a,core_rf_ldo_cfg5  //ldo bleeding current disable
+	jam 0x38,core_rf_ldo_en0
+	branch set_sync_on_next
+
+set_freq_rx:
+	bpatch patch10_4,mem_patch10
+	
+	fetch 1,mem_fcomp_div
+	sub pdata,XTAL_24M,null
+	call rf_rx_write_freq_24m,zero
+	ncall rf_rx_write_freq_16m,zero
+
+	storet 1,mem_last_freq
+	add temp,0,pdata
+	bmark1 mark_ble_2M,set_rxfreq_2M_offset
+	add temp,1,pdata
+set_rxfreq_2M_offset:
+	call rf_rx_write_freq
+	branch calc_mod_value_scale
+
+
+rf_rx_write_freq_24m:
+	jam 0,core_syn_cal_ctrl
+	jam 0x04,core_syn_top_ctrl
+	jam 0,core_syn_mmd_cp_ctrl
+	jam 0x03,core_syn_cp_lpf_cfg
+	jam 0x40,core_syn_afc_cfg3
+	rtn
+rf_rx_write_freq_16m:
+	jam 0x30,core_syn_cal_ctrl
+	jam 0x06,core_syn_top_ctrl
+	jam 0,core_syn_mmd_cp_ctrl
+	jam 0x20,core_syn_cp_lpf_cfg
+	jam 0x15,core_syn_afc_cfg3
+	rtn
+
+rf_rx_enable:
+	bpatch patch10_5,mem_patch10
+	call rf_debug_rx_gpio_high
+	
+	fetch 1,mem_gain_fix
+	beq 0xff,rf_rx_enable_no_soft_agc 
+	arg mem_gain_table,contr
+	iadd contr,contr
+	ifetch 1,contr
+	store 1,core_rf_rx_gain_fix
+	jam 0x27,core_rf_rx_agc_ctrl
+	
+rf_rx_enable_no_soft_agc:
+	fetcht 1,mem_gain_second_agc_en	//0x00 or 0x08
+	fetch 1,core_rf_rx_agc_ctrl
+	ior temp,pdata
+	store 1,core_rf_rx_agc_ctrl
+
+	jam 0xaa,core_rf_ldo_cfg4 //ldo config set
+	jam 0x2a,core_rf_ldo_cfg5
+	jam 0x13,core_rf_ldo_cfg6
+	jam 0x7f,core_rf_ldo_en0
+	fetch 1,core_clkpll_cfg6
+	set0 7,pdata
+	store 1,core_clkpll_cfg6
+	nop 60
+	jam 0x1f,core_rx_en0
+	jam 0xf8,core_rx_en1
+	jam 0x18,core_tx_en0
+	jam 0x00,core_rf_ldo_cfg4
+	jam 0x20,core_rf_ldo_cfg5
+	nop 10
+	jam 0x04,modem_en
+	nop 2
+	jam 0x0c,modem_en
+	rtn
+
+
+	/* pdata is frequency, 00=2400Mhz */
+rf_rx_write_freq:
+	bpatch patch10_6,mem_patch10
+	arg 2400,contr
+	iadd contr,pdata
+	fetcht 1,mem_fcomp_div
+	branch rf_write_freq_calc
+
+	/* rega is frequency, 00=2400Mhz */
+rf_tx_write_freq:
+	bpatch patch10_7,mem_patch10
+	fetch 1,mem_fcomp_div
+	sub pdata,XTAL_24M,null
+	call rf_tx_write_freq_24m,zero
+	ncall rf_tx_write_freq_16m,zero
+	
+	setarg 2400
+	iadd rega,pdata
+	lshift pdata,pdata
+	fetcht 1,mem_fcomp_div
+	mul32 temp,0x03,temp
+rf_write_freq_calc:	
+	lshift temp,temp
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	store 1,core_syn_divr_int
+	remainder pdata		
+	lshift16 pdata,pdata
+	lshift8 pdata,pdata
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	store 1,core_syn_divr_int+3
+	rshift8 pdata,pdata
+	store 1,core_syn_divr_int+2
+	rshift8 pdata,pdata
+	store 1,core_syn_divr_int+1
+	fetcht 1,core_syn_cal_ctrl		//reg syn_cal_ctrl[3:0] = 2??￥b0000, reset
+	and_into 0xf0,temp
+	storet 1,core_syn_cal_ctrl
+	nop 12
+	fetch 1,mem_fcomp_div
+	beq XTAL_24M,rf_write_freq_calc_24m
+	beq XTAL_16M,rf_write_freq_calc_16m
+rf_write_freq_calc_24m:	
+	or_into 0x0c,temp
+	storet 1,core_syn_cal_ctrl
+	nop 12
+	or_into 0x03,temp
+	storet 1,core_syn_cal_ctrl
+	rtn
+
+rf_write_freq_calc_16m:
+	or_into 0x3c,temp
+	storet 1,core_syn_cal_ctrl
+	nop 12
+	or_into 0x33,temp
+	storet 1,core_syn_cal_ctrl
+	rtn
+
+
+rf_tx_write_freq_24m:
+	jam 0,core_syn_cal_ctrl
+	jam 0x12,core_syn_top_ctrl
+	jam 0,core_syn_mmd_cp_ctrl
+	jam 0x03,core_syn_cp_lpf_cfg
+	jam 0xa6,core_syn_aac_cfg1
+	jam 0x40,core_syn_afc_cfg3
+	rtn
+
+rf_tx_write_freq_16m:
+	jam 0x30,core_syn_cal_ctrl
+	jam 0x15,core_syn_top_ctrl
+	jam 0,core_syn_mmd_cp_ctrl
+	jam 0x20,core_syn_cp_lpf_cfg
+	jam 0xa6,core_syn_aac_cfg1
+	jam 0x15,core_syn_afc_cfg3
+	rtn
+
+
+set_freq_tx:
+	bpatch patch11_0,mem_patch11
+
+	jam 0x12,core_syn_top_ctrl
+	storet 1,mem_last_freq
+	add temp,2,rega
+	call rf_tx_write_freq
+	nop 0x3c0
+
+txon:
+	bpatch patch11_1,mem_patch11
+	
+	jam 0xaa,core_rf_ldo_cfg4 //ldo config set
+	jam 0x2a,core_rf_ldo_cfg5
+	jam 0x10,core_rf_ldo_cfg6
+	
+	jam 0x7f,core_rf_ldo_en0	//ldo en
+	fetch 1,core_clkpll_cfg6
+	set0 7,pdata
+	store 1,core_clkpll_cfg6
+	jam 0x07,core_rf_ldo_en1 
+	nop 60
+
+	jam 0x0d,core_tx_en0
+	jam 0xf9,core_tx_en1		// reg tx_en1[7:0] = 8??￥b11011001
+	jam 0x00,core_rf_ldo_cfg4
+	jam 0x20,core_rf_ldo_cfg5
+	nop 10
+	jam 0x01, modem_en
+	nop 2
+	jam 0x03, modem_en
+	
+	bpatch patch11_2,mem_patch11
+	fetch 1,mem_tx_power
+	beq TX_POWER_3DB,set_tx_power_3db
+	beq TX_POWER_5DB,set_tx_power_5db
+	beq TX_POWER_6DB,set_tx_power_6db
+	beq TX_POWER_7DB,set_tx_power_7db
+	beq TX_POWER_10DB,set_tx_power_10db
+	beq TX_POWER_F3DB,set_tx_power_f3db
+	beq TX_POWER_F5DB,set_tx_power_f5db
+	beq TX_POWER_F20DB,set_tx_power_f20db
+	beq TX_POWER_F30DB,set_tx_power_f30db
+set_tx_power_0db:
+	jam 0x6a,core_tx_pwr_ctrl0
+	jam 0x07,core_tx_pwr_ctrl1
+set_rf_ldo_cfg89:
+	jam 0xa3,core_rf_ldo_cfg8
+	jam 0x07,core_rf_ldo_cfg9
+	rtn
+
+set_tx_power_3db:
+	jam 0x66,core_tx_pwr_ctrl0
+	jam 0x0b,core_tx_pwr_ctrl1
+set_rf_ldo_cfg89_2:
+	jam 0xaa,core_rf_ldo_cfg8
+	jam 0x0a,core_rf_ldo_cfg9
+	rtn
+
+set_tx_power_5db:
+	jam 0x6c,core_tx_pwr_ctrl0
+	jam 0x0d,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89_2
+
+set_tx_power_6db:
+	jam 0x6b,core_tx_pwr_ctrl0
+	jam 0x0f,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89_2
+
+set_tx_power_7db:
+	jam 0xa7,core_tx_pwr_ctrl0
+	jam 0x0f,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89_2
+
+set_tx_power_10db:
+	jam 0xb6,core_tx_pwr_ctrl0
+	jam 0x0f,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89_2
+
+set_tx_power_f3db:
+	jam 0x68,core_tx_pwr_ctrl0
+	jam 0x05,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89
+	
+set_tx_power_f5db:
+	jam 0x60,core_tx_pwr_ctrl0
+	jam 0x05,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89
+
+set_tx_power_f20db:
+	jam 0x53,core_tx_pwr_ctrl0
+	jam 0x01,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89
+
+set_tx_power_f30db:
+	jam 0x4c,core_tx_pwr_ctrl0
+	jam 0x00,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89
+
+
+initialize_radio:
+	jam clksel_rc,core_clksel
+initialize_radio_wait:
+	fetch 2,mem_rf_init_ptr
+	bbit0 14,initialize_radio_wait
+	iforce contr
+	arg 0x8a00,temp
+initialize_radio_loop:
+	ifetch 1,contr
+	beq 0xff,initialize_radio_cont
+	ior temp,contw
+	ifetch 1,contr
+	istore 1,contw
+	branch initialize_radio_loop
+	
+initialize_radio_cont:
+	bpatch patch11_3,mem_patch11
+	jam 0xe6,core_syn_aac_cfg1
+
+	call initialize_syn_afc_cfg1
+	call initialize_rf_ldo_cfg1
+	call initialize_rc_cal
+	
+	jam 0x09,core_rx_bq_cfg0
+
+	jam 5,core_clkpll_cfg0
+	jam 0x94,core_rx_iqadc_cfg
+	
+	fetch 1,mem_fcomp_div
+	bne XTAL_16M,initialize_radio_cont_next
+	jam 0x34,core_clkpll_cfg5		//16M XTAL
+initialize_radio_cont_next:
+	jam 0xff,core_clkpll_ctrl1
+	nop 100
+	jam 0x0e,core_clkpll_ctrl2
+	jam 0x03,core_clkpll_ctrl0
+	
+	call set_tx_power_0db
+	
+	jam 0x2b,core_tx_mixer_cfg1
+	jam 0x13,core_tx_mixer_cfg2
+	
+	jam clksel_dpll,core_clksel
+	jam SYSTEM_CLK_12M,mem_system_clk
+	branch le_disable
+
+
+initialize_syn_afc_cfg1:
+	fetch 1,mem_syn_afc_cfg1
+	branch initialize_syn_afc_cfg1_default,blank
+	or_into 0x20,pdata
+	store 1,core_syn_afc_cfg1
+	rtn
+initialize_syn_afc_cfg1_default:
+	jam 0x29,core_syn_afc_cfg1
+	rtn
+
+initialize_rf_ldo_cfg1:
+	fetch 1,mem_rf_ldo_cfg1
+	branch initialize_rf_ldo_cfg1_default,blank
+	store 1,core_rf_ldo_cfg1
+	rtn
+initialize_rf_ldo_cfg1_default:
+	jam 0x00,core_rf_ldo_cfg1
+	rtn
+
+initialize_rc_cal:
+	fetch 1,mem_rc_cal
+	branch initialize_rc_cal_default,blank
+	store 1,core_rx_bq_bw_cal
+	rtn
+initialize_rc_cal_default:
+	jam 0xd3,core_rx_bq_bw_cal
+	rtn
+
+
+
+	
+	
+save_rssi:
+	bpatch patch11_4,mem_patch11
+	jam 0x20,mem_rssi_hex
+	fetch 1,modem_rssi
+	store 1,mem_modem_rssi
+	sub pdata,0xfc,null
+	nrtn positive
+	sub pdata,0x7f,null
+	rtn positive
+
+	fetch 1,modem_gain
+	and pdata,0x0f,temp
+	lshift temp,temp
+	rshift4 pdata,pdata
+	iadd temp,temp
+	mul32 temp,3,temp
+	fetch 1,mem_modem_rssi
+	sub pdata,0xff,pdata
+	iadd temp,pdata 
+	increase -5,pdata
+	store 1,mem_rssi_hex
+	rtn
+
+rssi_hex2dec:
+	fetch 1,mem_rssi_hex
+	call bcd
+	store 1,mem_rssi			/* bcd value */
+	rtn
+
+bcd:
+	and_into 0xff,pdata
+	div pdata,10
+	call get_div_result
+	lshift4 pdata,pdata
+	remainder temp
+	ior temp,pdata
+	rtn
+
+gain_control:
+	fetch 1,mem_gain_fix
+	rtneq 0xff
+	nbranch  gain_increase,sync
+	fetch 1,mem_modem_rssi
+	sub pdata,0xf0,null
+	nbranch gain_descend,positive
+	sub pdata,0x7f,null
+	branch gain_descend,positive
+	
+	fetchr rega, 1,core_rf_rx_gain_fix
+	fetch 1,mem_gain_fix
+	rtneq 0	
+	arg mem_gain_table,contr
+	iadd contr,contr
+	ifetch 1,contr
+	isub rega,null
+	nrtn zero
+	increase -2,contr
+	ifetcht  1,contr
+	rshift4 temp,pdata
+	rshift4 rega,regb
+	isub regb,regb
+	and temp,0xf,pdata
+	and rega,0xf,rega
+	isub rega,rega
+	lshift rega,pdata
+	iadd regb,regb
+	mul32 regb,3,regb
+	fetcht 1,mem_modem_rssi
+	and temp,0x80,pdata
+	rtn blank
+add_negative:
+	setarg 0x100
+	isub temp,temp
+	copy regb,pdata
+	isub temp,pdata
+	rtn positive
+	and pdata,0xff,pdata
+	rtneq 0xff
+	rtneq 0xfe
+	
+gain_increase:	
+	fetch 1,mem_gain_fix
+	beq 1,set_rx_gain0
+	beq 2,set_rx_gain1
+//	beq 0,set_rx_gain0
+	branch set_rx_gain0
+	
+gain_descend:
+	fetch 1,mem_gain_fix
+	beq 0,set_rx_gain1
+	beq 1,set_rx_gain2
+//	beq 2,set_rx_gain2
+set_rx_gain2:
+	jam 2,mem_gain_fix
+	rtn
+
+set_rx_gain0:
+	jam 0,mem_gain_fix
+	rtn
+	
+set_rx_gain1:
+	jam 1,mem_gain_fix
+	rtn
+
+	
+xtal_fast_wake:
+	setarg 0xf0f
+	branch lpm_write_config
+
+init_lpm_ctrl:
+	setarg 0x80f
+	branch lpm_write_config
+
+
+
+start_receiver:
+	bpatch patch11_5,mem_patch11
+	disable is_tx
+	enable is_rx
+	pulse init_encrypt
+	branch rf_rx_enable
+
+prep_crypt:
+	bpatch patch11_6,mem_patch11
+	call check_enc_ccm
+	nbranch prep_crypt_ccm, blank	
+	fetch 1,mem_state_map
+	isolate1 smap_encryption,pdata
+	setflag true,0,pdata
+	store 1,core_encrypt
+	arg mem_kc,contr
+	ifetch 9,contr
+	iforce kc_ls
+	ifetch 7,contr
+	iforce kc_ms
+	fetch 1,mem_key_size
+	add pdata,-1,g1l
+	pulse kc_p_activate               /* immediately start calculating primary Key */
+	rtn
+
+prep_crypt_ccm:
+	jam 0,core_encrypt
+	rtn
+	
+wait_access_end:
+	deposit clke
+	store 6,mem_sync_clke
+	disable decode_fec0
+	nbranch shutdown_radio,sync
+	fetch 2,mem_param_clke_cal
+	copy pdata,clke_rt
+	increase 1,clke_bt
+	and_into 0x1fc,clke_bt
+	rtn
+
+
+
+wait_access_mhalfbnd:
+	enable decode_fec0
+wait_access_mhalfbnd_correlate:
+	correlate null,mhalfbnd    /* keep correlating until sync is found, or clke half */
+	branch wait_access_end,sync
+	compare 0x02,clke_bt,0x02
+	nbranch wait_access_mhalfbnd_correlate,true
+	branch wait_access_end
+
+wait_access_clkn_rt:
+	bpatch patch11_7,mem_patch11
+	fetchr timeup,2,mem_param_conn_access	/* found sync must occur within this time */
+	enable decode_fec0
+	correlate clkn_rt,meet    /* keep correlating until sync is found, or until clkn_rt timeup */
+	disable decode_fec0
+	nbranch shutdown_radio,sync
+	rtn
+
+wait_access_forever:
+	bpatch patch12_0,mem_patch12
+	enable decode_fec0
+	correlate null,timeout    /* keep correlating until sync is found, or timeout */
+	disable decode_fec0
+	nbranch shutdown_radio,sync
+	fetch 2,mem_param_clke_cal
+	copy pdata,clke_rt
+	and_into 0x1fc,clke_bt
+	rtn
+
+	/* reserve slots for mult-slot packet */
+reserve_slot:
+	bpatch patch12_1,mem_patch12
+	iforce rega
+	deposit bt_clk
+	iadd temp,timeup
+	copy timeup,pdata
+	store 4,mem_next_btclk
+	deposit rega
+	rtn
+
+	/* pdata = clks ahead of bt_clk */
+ahead_window:
+	copy pdata,temp
+	bpatch patch12_2,mem_patch12
+	copy temp,pdata
+	call clk2bt
+	lshift16 bt_clk,pdata
+	set1 44,pdata
+	call clk_diff
+	set0 44,pdata
+	call get_clk
+	call clk_diff
+	rtn user
+	call clk2rt
+	iforce stop_watch
+	until null,timeout
+	rtn
+
+
+setup_clk:
+	bpatch patch12_3,mem_patch12
+	branch setup_clkn,clknt
+	until clke_rt,meet
+skip_setup_clke:
+	copy clke_bt,temp
+	branch setup_clknbt
+setup_clkn:
+	branch skip_setup_clkn,attempt
+	until clkn_rt,meet
+skip_setup_clkn:
+	copy clkn_bt,temp
+setup_clknbt:
+	branch setup_clk11,user
+	compare 1,temp,3
+	nbranch setup_clk,true
+setup_complete:
+	bpatch patch12_4,mem_patch12
+	fetch 1,mem_state
+	rtnbit0 state_inconn
+	fetch 4,mem_next_btclk
+	isub temp,pdata
+	nrtn positive
+	sub pdata,0xff,null
+	branch setup_clk,positive
+	rtn
+setup_clk11:
+	compare 3,temp,3
+	nbranch setup_clk,true
+	branch setup_complete
+
+rf_setup_time:
+	bpatch patch12_5,mem_patch12
+	fetchr timeup,2,mem_param_rf_setup
+	branch setup_clk
+	
+rf_setup_time_slave_slot:
+	disable user
+	branch rf_setup_time
+
+rf_setup_time_master_slot:
+	enable user
+	branch rf_setup_time
+	
+start_transmitter:
+	bpatch patch12_6,mem_patch12
+	call prep_crypt
+	disable is_rx
+	enable is_tx
+	rtn
+
+
+
+start_tx_native:
+	bpatch patch12_7,mem_patch12
+	fetchr timeup,2,mem_param_tx_setup
+	until clkn_rt,meet         /* wait until start_tx time */
+	pulse init_encrypt
+	rtn
+
+start_rx_native:
+	bpatch patch13_0,mem_patch13
+	fetchr timeup,2,mem_param_rx_setup
+	until clkn_rt,meet
+	rtn
+
+
+start_tx_external:
+	bpatch patch13_1,mem_patch13
+	fetchr timeup,2,mem_param_tx_setup
+	until clke_rt,meet         /* wait until start_tx time */
+	pulse init_encrypt
+	rtn
+
+send_access_word:
+	bpatch patch13_2,mem_patch13
+	call rf_debug_tx_on_line	//H
+	preload access          /* load in access word ready to be sent */
+	enable encode_fec0
+	set1 TXGFSK,radio_ctrl
+	inject mod,72
+	disable encode_fec0
+	rtn
+
+
+scan_mode_whiten:
+	copy xin,temp
+	or_into 0x60,temp                /* extend xin with 5->1, 6->1 */
+	copy temp,white_init
+	rtn
+
+
+
+	/* return blank if free amaddr is found */
+get_free_amaddr:
+	bpatch patch13_3,mem_patch13
+	fetch 1,mem_current_amaddr
+	increase 1,pdata
+	bne param_esco_addr,get_free_amaddr_cont
+	force 1,pdata
+get_free_amaddr_cont:
+	store 1,mem_current_amaddr
+	iforce am_addr
+	rtn
+
+get_clk:
+	copy clkn,temp
+	rtn master
+	copy clke,temp
+	rtn
+
+get_clkbt:
+	deposit clkn_bt
+	rtn master
+	deposit clke_bt
+	rtn
+
+
+supervision_update:
+	bpatch patch13_4,mem_patch13
+	fetcht 4,mem_supervision_timer
+	call get_clkbt
+	isub temp,timeup					/* and to 28 bits */
+	deposit timeup
+	fetcht 2,mem_supervision_to
+	lshift temp,temp
+	isub temp,pdata
+	rtn
+	
+supervision_flush:
+	bpatch patch13_5,mem_patch13
+	call get_clkbt
+	store 4,mem_supervision_timer
+	rtn
+
+assert:
+	bpatch patch13_6,mem_patch13
+	branch assert
+	
+loop:
+	branch loop
+
+sleep:	
+	rtn blank
+	/* sleep pdata clocks, only even clocks are accurate */
+	rshift pdata,pdata
+	increase -3,pdata
+sleep_loop:	
+	increase -1,pdata
+	nbranch sleep_loop,zero
+	force 0,pdata
+	rtn
+
+
+
+init_param:
+	/* clear specified sched ram */
+	arg 0x10,loopcnt
+	arg 0,contw
+	call memset0
+	arg mem_le_state,contw
+	arg 10,loopcnt
+	call memset0
+	jam 0,mem_sp_calc
+	jam 0,mem_fifo_temp
+	jam 0,mem_le_testtype
+	jam 0,mem_debug_config
+	jam 0,mem_lmp_conn_state
+	jam 0,mem_connection_options
+	jam 0,mem_tester_emulate
+	jam 0,mem_tester_cnt
+	setarg param_glap
+	store 3,mem_glap
+	jam 0x60,mem_fhs_misc		/* R1 for 1.28s ps interval,P2 */
+	jam param_max_slot,mem_max_slot
+	jam 0x02,mem_fw_ver		/* set firmware version */
+
+	setarg param_tx_setup
+	store 2,mem_param_tx_setup
+	setarg param_rf_setup
+	store 2,mem_param_rf_setup
+	setarg param_conn_access
+	store 2,mem_param_conn_access
+	setarg param_rx_setup
+	store 2,mem_param_rx_setup
+	setarg param_clke_cal
+	store 2,mem_param_clke_cal
+	setarg param_pll_setup
+	store 2,mem_param_pll_setup
+	setarg param_dpll_start_delay
+	store 2,mem_param_dpll_start_delay
+	setarg param_rt_rthalfslot
+	store 2,mem_param_rt_rthalfslot
+	setarg param_clke_cal_le_1m
+	store 2,mem_param_clke_cal_le_1m
+	setarg param_clke_cal_le_2m
+	store 2,mem_param_clke_cal_le_2m
+	setarg param_clke_cal_le_coded
+	store 2,mem_param_clke_cal_le_coded
+	setarg mem_ble_tx_buff0
+	store 2,mem_ble_l2cap_tx_buff0_ptr
+	setarg mem_ble_l2cap_tx_buff_size
+	store 2,mem_ble_l2cap_tx_buff_size_ptr
+	
+	call init_memp	
+	setarg mem_sp_state_end
+	arg mem_sp_state_start,contw
+	isub contw,loopcnt
+	call clear_mem
+
+init_param_next:
+	bpatch patch13_7,mem_patch13
+	rtn wake
+	jam BLUETOOTH_CORE_SPECIFICATION_5_0,mem_lmp_version
+	setarg COMPANY_ID_YICHIP
+	store 2,mem_lmp_compid
+	setarg 0x08
+	store 2,mem_lmp_subversion	
+	jam 0x7f ,mem_seqi
+	
+	setarg 0x24
+	store 2,mem_iscan_window
+	store 2,mem_pscan_window
+	setarg 0x200
+	store 2,mem_iscan_interval
+	store 2,mem_pscan_interval
+	setarg 0x20
+	store 2,mem_inq_window
+	store 2,mem_page_window
+	setarg 0x2000
+	store 2,mem_page_to
+	setarg 0x480
+	store 2,mem_rx_window_init
+	setarg 0xc00
+	store 2,mem_rx_window_sniff
+
+	setarg 0xc3f
+	store 2,mem_lpm_xtalcnt+1
+	setarg 0x333
+	istore 2,contw
+	setarg 0x24109d
+	store 3,mem_lpm_ctrl3+1
+	
+	call clear_wake
+	setarg 0
+	store 2,mem_tx_len
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn
+	rtn
+
+clk24m_init:
+	jam 6,core_clksel
+	jam 1,core_clksel
+	nop 10
+	setarg 7498
+	store 2,core_halfslot
+	rtn
+
+test_init:
+	setarg test_proc
+	store 2,mem_cb_bt_process
+	setarg test_proc
+	store 2,mem_cb_idle_process
+	rtn
+
+test_proc:
+	fetch 1,mem_state
+	bbit0 state_insniff,check_test_cond
+	set1 mark_lpm_mult_enable,mark
+	fetch 6,mem_sniff_rcv
+	store 6,mem_local_name
+	rtn
+
+check_test_cond:
+	fetch 1,mem_tester_emulate
+	rtnbit0 tester_change
+	fetch 1,mem_tester_cnt
+	increase 1,pdata
+	store 1,mem_tester_cnt
+	rtnne 5
+	jam 0,mem_tester_cnt
+	fetch 1,mem_tester_emulate
+	set0 tester_change,pdata
+	store 1,mem_tester_emulate
+	bbit1 tester_exit,check_test_exit
+	isolate1 tester_no_whitening,pdata
+	call test_no_white,true
+	ncall test_enable_white,true
+	fetch 1,test_mode_packet_type
+	compare 0x20,pdata,0x30
+	fetch 1,mem_state_map
+	setflag true,smap_edr,pdata
+	store 1,mem_state_map
+	fetch 1,mem_tester_emulate
+	fetcht 1,mem_debug_config
+	isolate1 tester_pattern_test,pdata
+	setflag true,debug_tx_pattern,temp
+	isolate1 tester_fixed_freq,pdata
+	setflag true,debug_tx_fixed_freq,temp
+	setflag true,debug_rx_fixed_freq,temp
+	storet 1,mem_debug_config
+	fetch 1,test_mode_tx_freq
+	store 1,mem_tx_fixed_freq
+	fetch 1,test_mode_rx_freq
+	store 1,mem_rx_fixed_freq
+	set1 mark_testmode,mark
+	rtn
+	
+check_test_exit:
+	set0 mark_testmode,mark
+	jam 0,mem_tester_emulate
+	fetch 1,mem_test_mode_old_debug_config
+	store 1,mem_debug_config
+	branch test_enable_white
+
+
+/*****************************************LPO************************************************/
+
+lpmstate:
+	setarg 0xee21
+	store 2,core_clkoff			// disable unused peripherals
+	fetch 4,core_gpio_in
+	store 4,mem_saved_gpio_in
+	fetch 1,core_lpm_ctrl+3
+	store 1,mem_wakup_from_power_flag	//power up bit2 = 0
+	fetch 1,core_lpm_ldocnt
+	bbit0 gpio_latch,loadcode		// power up boot
+	enable wake
+	bbit0 cold_wake,lpmwake		
+	disable wake
+	deposit auxcnt
+	nbranch lpmwake,blank		// sleep interrupted, wakeup
+	fetch 1,core_lpm_ctrl+3
+	bbit1 reload_code,lpmwake
+	arg param_hibernate_clks,temp
+	branch lpm_enter_sleep
+lpmwake:
+	fetch 4,core_lpm_ctrl2
+	store 4,core_lpm_reg
+	fetch 1,core_lpm_ctrl2+1
+	and_into 0xe0,pdata			//digital aon ldo vout sel: 1.2v
+	store 1,core_lpm_reg+1
+	call lpm_write_ctrl3
+	fetch 3,core_lpm_xtalcnt
+	store 3,core_lpm_reg
+	ifetch 1,contr
+	or_into isogate_mask,pdata		// open all isolation gate&power switch
+	istore 1,contw
+	call lpm_write_ctrl2
+	fetch 1,core_lpm_isogate
+	set1 enable_retmem,pdata
+	store 1,core_lpm_isogate
+	call lpm_write_ctrl2
+	call lpm_load_context,wake
+	fetch 1,core_lpm_reg+2
+	set0 gpio_latch,pdata			// enable gpio fuction
+	store 1,core_lpm_reg+2
+	call lpm_write_ctrl2
+	nbranch loadcode,wake		// wakeup from hibernate
+	call lpm_save_mpu_lock
+	rtnmark0 mark_otp_encrypt
+	jam lock_otp,core_misc_ctrl	// disable further read/write of key
+	rtn 
+
+lpm_save_mpu_lock:
+	fetch 3,mem_efuse_header
+	rtn blank
+	store 3,mem_tmp_buffer
+	branch app_lpm_peripheral_lock_check
+
+lpm_ctrl3_cfg_dig_vsel:
+	fetch 1,mem_dig_aon_vsel
+	beq 1,lpm_ctrl3_cfg_vsel_108
+	beq 2,lpm_ctrl3_cfg_vsel_096
+	beq 3,lpm_ctrl3_cfg_vsel_084
+lpm_ctrl3_cfg_vsel_120:
+	fetch 1,mem_lpm_ctrl3+1
+	and_into 0xe0,pdata
+lpm_ctrl3_cfg_vsel_store:	
+	store 1,mem_lpm_ctrl3+1
+	rtn
+lpm_ctrl3_cfg_vsel_108:
+	fetch 1,mem_lpm_ctrl3+1
+	and_into 0xe0,pdata
+	or_into 0x1d,pdata
+	branch lpm_ctrl3_cfg_vsel_store
+lpm_ctrl3_cfg_vsel_096:
+	fetch 1,mem_lpm_ctrl3+1
+	and_into 0xe0,pdata
+	or_into 0x1b,pdata
+	branch lpm_ctrl3_cfg_vsel_store
+lpm_ctrl3_cfg_vsel_084:
+	fetch 1,mem_lpm_ctrl3+1
+	and_into 0xe0,pdata
+	or_into 0x17,pdata
+	branch lpm_ctrl3_cfg_vsel_store
+
+lpm_load_context:
+	fetch 1,mem_saved_spidctrl
+	store 1,core_spid_ctrl
+	arg mem_saved_gpio,contr
+	arg core_gpio_conf,contw
+	call memcpy20
+	fetch 8,mem_saved_mark
+	iforce mark
+	fetch 8,core_gpio_wakeup_low
+	store 8,mem_gpio_wakeup_low
+	branch load_ucode
+
+lpm_save_context:
+	deposit mark
+	store 8,mem_saved_mark
+	arg core_gpio_conf,contr
+	arg mem_saved_gpio,contw
+	call memcpy20
+	fetch 1,core_spid_ctrl
+	store 1,mem_saved_spidctrl
+	branch lpm_write_gpio_wakeup
+
+lpo_calibration:
+	fetch 1,core_aes_en
+	rshift4 pdata,pdata
+	nbranch lpo_cal_inited,blank
+	fetch 3,mem_clks_per_lpo
+	nrtn blank
+	fetch 1,core_aes_en
+	or_into 0xc0,pdata
+	store 1,core_aes_en
+	jam ccnt_start,core_misc_ctrl
+lpo_cal_inited:
+	fetch 1,core_perf_status
+	rtnbit0 1
+	fetch 3,core_clk_counter
+	store 3,mem_clks_per_lpo
+	rtn
+
+
+	/* temp is synced clke */
+lpm_adjust_clk:
+	bpatch patch14_0,mem_patch14
+	deposit clke
+	call clk_diff_rt
+	fetcht 4,mem_sleep_counter_all
+	sub temp,0xff,null
+	rtn positive				// interval too small
+	lshift8 pdata,pdata
+	lshift4 pdata,pdata
+	idiv temp
+	call get_div_result
+	arg param_lpm_adjmax,temp
+	call ceiling
+	store 1,mem_lpm_adjust
+	nbranch lpm_adjust_positive,user
+	sub pdata,0,pdata
+lpm_adjust_positive:
+	fetcht 3,mem_clks_per_lpo
+	iadd temp,pdata
+	store 3,mem_clks_per_lpo
+lpm_clear_counter:
+	setarg 0
+	store 4,mem_sleep_counter_all
+	rtn
+
+
+	/* temp is lpo counter for doze */
+lpm_doze:
+	fetch 1,mem_lpm_config+2
+	set1 reload_code,pdata
+	store 1,mem_lpm_config+2
+	branch lpm_hibernate_normal
+	
+
+	/* no retention memory at all */
+lpm_hibernate:
+	arg param_hibernate_clks,temp
+	fetch 1,mem_lpm_config+1
+	set0 7,pdata					/* lowest lpo */
+	store 1,mem_lpm_config+1
+lpm_hibernate_normal:
+	bpatch patch14_1,mem_patch14
+	call lpm_write_gpio_wakeup
+	fetch 1,mem_lpm_hibernate_switch
+	store 1,mem_lpm_xtalcnt + 4
+	fetch 1,mem_lpm_xtalcnt + 2
+	set1 cold_wake,pdata
+	store 1,mem_lpm_xtalcnt + 2
+
+	/* temp is lpo clocks to sleep */
+lpm_sleep:
+	bpatch patch14_2,mem_patch14
+	call xtal_fast_wake
+	fetch 4,mem_sleep_counter_all
+	iadd temp,pdata
+	store 4,mem_sleep_counter_all
+	call lpm_save_context
+	call lpm_ctrl3_cfg_dig_vsel
+	fetch 4,mem_lpm_ctrl3
+	copy pdata,regb
+	fetch 5,mem_lpm_xtalcnt
+	store 4,core_lpm_reg
+	rshift32 pdata,rega
+	until null,lpo_edge
+	deposit clkn
+	store 6,mem_sleep_clkn
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	until null,lpo_edge
+	until null,lpo_edge
+	deposit rega
+	store 1,core_lpm_isogate
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	until null,lpo_edge
+	until null,lpo_edge
+	storer regb,4,core_lpm_reg
+	jam lpmreg_sel_ctrl3,core_lpm_wr
+lpm_enter_sleep:
+	until null,lpo_edge
+	until null,lpo_edge
+	storet 4,core_lpm_reg
+	jam lpmreg_sel_counter,core_lpm_wr
+	until null,never
+
+
+
+
+lpm_recover_clk:
+	bpatch patch14_3,mem_patch14
+	setarg 0
+	copy auxcnt,null
+	branch lpm_recover_timeout,zero
+	fetch 1,core_lpm_xtalcnt
+	fetcht 1,core_lpm_buckcnt
+	isub temp,null
+	branch lpm_recover_xtal,positive
+	deposit temp
+lpm_recover_xtal:
+	isub auxcnt,pdata
+	increase 1,pdata
+lpm_recover_timeout:
+	increase 10,pdata
+	until null,lpo_edge
+	iadd lpo_time,pdata
+	fetcht 4,mem_sleep_counter
+	iadd temp,pdata
+	fetcht 3,mem_clks_per_lpo
+	imul32 temp,pdata
+	rshift8 pdata,pdata
+	rshift4 pdata,pdata
+	increase param_lpm_fix,pdata
+	fetcht 2,mem_param_rt_rthalfslot
+	idiv temp
+	call get_div_result
+	lshift16 pdata,pdata
+	remainder temp
+	ior temp,pdata
+	fetcht 6,mem_sleep_clkn
+	call clk_add
+	copy temp,clkn
+	fetch 6,mem_context + coffset_clk_offset
+	call calc_clke2
+	deposit clke
+	store 6,mem_pdatatemp
+	deposit auxcnt
+	istore 1,contw
+	fetch 1,core_gpio_in1
+	or_into 0xf0,pdata
+	istore 1,contw
+	rtn
+	
+lpm_dispatch:
+	bpatch patch14_4,mem_patch14
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	rtn blank
+	fetch 1,mem_lpm_mode
+	rtn blank
+	fetch 1,mem_ssp_enable
+	branch lpm_dispatch_next,blank
+	fetch 1,mem_sp_local_key_invalid	// simple pairing is not ready
+	rtn blank
+lpm_dispatch_next:
+	fetch 1,mem_sc_calc
+	nrtn blank	
+	rtnmark1 mark_adc_enable
+	arg context_check_a_wack,regc
+	call context_search
+	rtn zero
+	call lpm_check_wake_lock
+	nrtn blank
+	fetch 1,mem_context
+	compare 3,pdata,0x7							/* sco won't sleep */
+	nbranch lpm_dispatch_unconn,true
+	fetch 2,mem_context + coffset_tsniff		/* role switch */
+	rtn blank																
+	rtn wake
+	bpatch patch14_5,mem_patch14
+lpm_dispatch_next2:
+	fetcht 1,mem_lpm_current_mult
+	fetch 2,mem_context + coffset_tsniff
+	imul32 temp,pdata
+	rshift4 temp,temp
+	rshift2 temp,temp
+	isub temp,pdata
+	fetcht 4,mem_context + coffset_sniff_anchor
+	iadd temp,pdata
+	fetcht 1,mem_lpm_overhead
+	isub temp,pdata
+	lshift16 pdata,alarm
+	bpatch patch14_6,mem_patch14
+	fetch 2,mem_context + coffset_rx_window
+	rshift pdata,pdata
+	call clk2bt
+	deposit alarm
+	call clk_diff
+	copy clke,temp
+	call clk_diff_rt
+	rtn user
+lpm_dispatch_sleep:
+	call clk2lpo
+lpm_dispatch_lpo:
+	bpatch patch14_7,mem_patch14
+	fetch 1,mem_lpm_xtalcnt
+	isub temp,null
+	branch lpm_clear_counter,positive
+	storet 4,mem_sleep_counter
+	call app_will_enter_lpm
+	call l2cap_lpm_save_txbuf
+	fetcht 4,mem_sleep_counter
+	branch lpm_sleep
+	
+lpm_dispatch_unconn:
+	bpatch patch15_0,mem_patch15
+	fetch 1,mem_context
+	rtnbit1 state_inconn					// wont sleep in connection
+	rtnbit1 state_inpage					// wont sleep when paging
+	fetch 1,mem_ssp_enable
+	branch lpm_unconn_nossp,blank
+	fetch 1,mem_sp_local_key_invalid	// simple pairing is not ready
+	rtn blank
+lpm_unconn_nossp:
+	fetch 1,mem_le_adv_enable
+	nbranch lpm_unconn_cont,blank
+	fetch 1,mem_scan_mode
+	rtn blank
+lpm_unconn_cont:
+	fetch 2,mem_lpm_interval
+	rtn blank
+lpm_sleep_btclk:
+	fetcht 1,mem_lpm_overhead
+	isub temp,pdata
+	arg 7500,temp				/* 1.25ms */
+	imul32 temp,pdata
+	branch lpm_dispatch_sleep
+
+lpm_set_mult:
+	bpatch patch15_1,mem_patch15
+	disable wake
+	fetch 1,mem_state
+	rtnbit0 state_insniff
+	nbranch lpm_not_match,match
+	call lpm_match
+	fetch 2,mem_rx_window_sniff
+	store 2,mem_rx_window
+	fetch 1,mem_arq
+	bbit1 wack,lpm_mult_short
+	bmark0 mark_lpm_mult_enable,lpm_mult_short
+	call l2cap_malloc_is_fifo_empty
+	nbranch lpm_mult_short,blank
+	fetch 1,mem_classic_bt_flag
+	bbit1 SHORT_MULT_FLAG,lpm_mult_short
+lpm_mult_wait_timeout:
+	fetch 2,mem_cb_bt_set_mult
+	call callback_func
+	nbranch lpm_mult_short,blank
+	jam 0,mem_lpm_current_mult
+	bmark0 mark_lpm_mult_enable,lpm_mult_short
+	fetch 1,mem_lpm_mult_cnt
+	branch lpm_mult_long,blank
+	increase -1,pdata
+	store 1,mem_lpm_mult_cnt
+	rtn
+
+
+classic_bt_set_mult_short_flag:
+	arg SHORT_MULT_FLAG,queue
+	branch classic_bluetooth_set_flag
+	
+classic_bt_clr_mult_short_flag:
+	arg SHORT_MULT_FLAG,queue
+	branch classic_bluetooth_clr_flag
+
+
+
+lpm_match:
+	jam 0,mem_sniff_unint_lost
+	fetch 3,mem_sniff_rcv
+	increase 1,pdata
+	store 3,mem_sniff_rcv
+	rtn
+
+lpm_not_match:
+	bpatch patch15_2,mem_patch15
+	fetcht 2,mem_rx_window_sniff
+	rshift temp,temp
+	fetch 2,mem_rx_window
+	iadd temp,pdata
+	store 2,mem_rx_window
+lpm_lost:
+	jam 0,mem_lpm_current_mult
+	fetch 3,mem_sniff_lost
+	increase 1,pdata
+	store 3,mem_sniff_lost
+	fetch 1,mem_sniff_unint_lost
+	increase 1,pdata
+	store 1,mem_sniff_unint_lost
+	rtn
+
+lpm_mult_short:
+	jam 0,mem_lpm_current_mult
+	fetch 1,mem_lpm_mult_timeout
+	store 1,mem_lpm_mult_cnt
+	rtn
+
+lpm_mult_long:
+	fetcht 1,mem_lpm_mult
+	storet 1,mem_lpm_current_mult
+	rtn
+
+lpm_cal_xtal_startup:
+	bpatch patch15_3,mem_patch15
+	fetch 1,mem_lpm_xtalcnt
+	nrtn blank
+	jam clksel_rc,core_clksel
+	setarg 0xf0c
+	call lpm_write_config
+	setarg 200000
+	call sleep
+	until null,lpo_edge
+	copy lpo_time,alarm
+	call xtal_fast_wake
+	jam clksel_xtal,core_clksel
+	nop 10
+	until null,lpo_edge
+	deposit lpo_time
+	isub alarm,pdata
+	increase 0x30,pdata
+	arg 0xff,temp
+	call ceiling
+	store 1,mem_lpm_xtalcnt
+	nop 30000
+	nop 30000
+	nop 30000	
+	rtn
+
+lpm_cal_xtal_startup_by_snooze:
+	fetch 1,mem_lpm_xtalcnt
+	nrtn blank
+	jam 0xff,core_xtal_stable_time
+	jam clksel_rc,core_clksel
+	call xtal_fast_wake
+	setarg 1000
+	iadd lpo_time,alarm
+	snooze
+	deposit lpo_time
+	nop 12000	//delay about 1ms
+	nop 12000	//delay about 1ms
+	nop 12000	//delay about 1ms
+	nop 12000	//delay about 1ms
+	nop 12000	//delay about 1ms
+	nop 12000	//delay about 1ms
+	nop 12000	//delay about 1ms
+	nop 12000	//delay about 1ms
+	nop 12000	//delay about 1ms
+	isub alarm,pdata
+	add pdata,0x30,pdata
+	arg 0xff,temp
+	call ceiling
+	store 1,mem_lpm_xtalcnt
+	nop 30000
+	nop 30000
+	nop 30000	//delay 90000 nop
+	rtn
+
+
+
+	/* pdata is lpm_reg[11:0] */
+lpm_write_config:
+	arg 0xfff,contw
+	iand contw,contw
+	fetch 1,mem_lpm_config
+	and_into 0xf0,pdata
+	lshift8 pdata,pdata
+	ior contw,pdata
+	store 2,core_lpm_reg
+	ifetch 2,contr
+	istore 2,contw
+
+lpm_write_ctrl:
+	setarg lpmreg_sel_ctrl
+	branch lpm_write
+
+lpm_write_ctrl2:
+	setarg lpmreg_sel_ctrl2
+lpm_write:
+	until null,lpo_edge
+	store 1,core_lpm_wr
+	until null,lpo_edge
+	until null,lpo_edge
+	rtn
+
+
+lpm_write_sel_vdd3v3:
+	jam 0x00,mem_lpm_ctrl3
+	fetch 4,core_lpm_ctrl2
+	store 4,core_lpm_reg
+	fetch 1,core_lpm_ctrl2
+	and_into 0xc1,pdata			//select 3.3v
+	store 1,core_lpm_reg
+	branch lpm_write_ctrl3
+
+lpm_write_sel_vdd5v:
+	jam 0x3e,mem_lpm_ctrl3
+	fetch 4,core_lpm_ctrl2
+	store 4,core_lpm_reg
+	fetch 1,core_lpm_ctrl2
+	or_into 0x3e,pdata			//select 5v
+	store 1,core_lpm_reg
+lpm_write_ctrl3:
+	setarg lpmreg_sel_ctrl3
+	branch lpm_write
+
+
+lpm_write_gpio_wakeup:
+	bpatch patch15_4,mem_patch15
+	fetch 4,mem_gpio_wakeup_low
+	store 4,core_lpm_reg
+	setarg lpmreg_sel_gpiolow
+	call lpm_write
+	fetch 4,mem_gpio_wakeup_high
+	store 4,core_lpm_reg
+	setarg lpmreg_sel_gpiohigh
+	branch lpm_write
+
+lpm_get_wake_lock:
+	fetch 2,mem_lpm_wake_lock
+	qset1 pdata
+	store 2,mem_lpm_wake_lock
+	rtn
+
+lpm_put_wake_lock:
+	fetch 2,mem_lpm_wake_lock
+	qset0 pdata
+	store 2,mem_lpm_wake_lock
+	rtn
+
+
+
+lpm_check_wake_lock:
+	bpatch patch15_5,mem_patch15
+	call app_check_wake_lock
+	fetch 2,mem_lpm_wake_lock
+	copy pdata,rega
+	fetch 1,mem_state_map
+	isolate1 smap_rxlmp,pdata
+	setflag true,wake_lock_lmp_rx,rega
+	fetch 1,mem_lmo_opcode1
+	fetcht 1,mem_lmo_opcode2
+	iadd temp,pdata
+	fetcht 1,mem_lmp_to_send
+	iadd temp,pdata
+	nsetflag blank,wake_lock_lmp_tx,rega
+	fetch 3,mem_tx_fifo3
+	nsetflag blank,wake_lock_ble_tx,rega
+	fetch 2,mem_l2cap_rxbuff1_len
+	fetcht 2,mem_l2cap_rxbuff2_len
+	iadd temp,pdata
+	nsetflag blank,wake_lock_l2cap_rx,rega
+	fetch UTIL_FIFO_LEN,mem_ipc_fifo_bt2c51
+	nsetflag blank,wake_lock_ipc_bt2c51,rega
+	fetch UTIL_FIFO_LEN,mem_ipc_fifo_c512bt
+	nsetflag blank,wake_lock_ipc_c512bt,rega
+	fetch 1,mem_hci_cmd
+	nsetflag blank,wake_lock_cmd,rega
+	fetch 1,mem_device_option
+	compare dvc_op_module,pdata,0xff
+	call lpm_uart_wake_lock,true
+	copy rega,pdata
+	store 2,mem_lpm_wake_lock
+	rtn
+
+lpm_uart_wake_lock:
+	fetch 2,core_uart_rxitems
+	nsetflag blank,wake_lock_uart_rx ,rega
+	fetch 2,core_uart_txitems
+	nsetflag blank,wake_lock_uart_tx ,rega
+	rtn
+
+lpm_shut_down:
+	fetch 4,core_lpm_ctrl
+	set0 27,pdata
+	store 4,core_lpm_reg
+	call lpm_write_ctrl
+	branch assert
+	
+lpm_disable_exen_output:
+	fetch 4,core_lpm_xtalcnt
+	set0 20,pdata
+	store 4,core_lpm_reg
+	branch lpm_write_ctrl2
+
+
Index: program/debug.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/debug.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/debug.prog	(working copy)
@@ -0,0 +1,66 @@
+
+// Rf debug
+
+/*****************************************************************************************************************************************************************************************
+    txon     txoff       rxon		      sync             crc pass    shutdown radio          match
+     _________          ______________    _________________     ___        ___                     
+    |         |        |              |  |                 |   |   |      |   |                   
+    |	      |        |              |  |                 |   |   |      |   |                   
+____|tx data  |________|   rx window  |__| rx data         |___|   |______|   |_______       __________
+
+*****************************************************************************************************************************************************************************************/
+
+rf_debug_rx_gpio_low:
+	fetch 1,mem_rf_debug_rx_gpio
+rf_debug_gpio_low:
+	arg gpcfg_output_low,temp
+	branch gpio_config_function
+
+rf_debug_rx_on_line:
+rf_debug_rx_gpio_high:
+	fetch 1,mem_rf_debug_rx_gpio
+rf_debug_gpio_high:
+	arg gpcfg_output_high,temp
+	branch gpio_config_function
+
+rf_debug_rx_gpio_h_l_h:
+	call rf_debug_rx_gpio_high
+rf_debug_rx_gpio_l_h:
+	call rf_debug_rx_gpio_low
+	branch rf_debug_rx_gpio_high
+
+rf_debug_rx_gpio_l_h_l:
+rf_debug_shutdown_radio_line:
+	call rf_debug_rx_gpio_l_h
+rf_debug_rx_crc_line:
+	branch rf_debug_rx_gpio_low
+
+rf_debug_rx_sync_line:
+	branch rf_debug_rx_gpio_l_h
+
+rf_debug_rx_crc_fail_line:
+	call rf_debug_rx_gpio_l_h
+	branch rf_debug_rx_gpio_l_h_l
+
+rf_debug_rx_match_line:
+rf_debug_rx_crc_error_line:
+rf_debug_rx_sync_timeout_line:
+	branch rf_debug_rx_gpio_low
+
+
+rf_debug_tx_off_line:
+rf_debug_tx_gpio_low:
+	fetch 1,mem_rf_debug_tx_gpio
+	branch rf_debug_gpio_low
+
+rf_debug_tx_on_line:
+rf_debug_tx_gpio_high:
+	fetch 1,mem_rf_debug_tx_gpio
+	branch rf_debug_gpio_high
+
+rf_debug_tx_gpio_l_h_l:
+	call rf_debug_tx_gpio_low
+	call rf_debug_tx_gpio_high
+	branch rf_debug_tx_gpio_low
+
+	
Index: program/g24_protocol_stack/24g.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g.prog	(working copy)
@@ -0,0 +1,516 @@
+
+
+g24_dispatch:
+	bpatchx patch3b_5,mem_patch3b
+	rtnmark1 mark_adc_enable
+	bmark1 mark_24g_rxmode,g24_receive_dispatch
+	branch g24_transmit_dispatch
+
+
+/****************************g24 base transceiver start********************************/
+
+g24_prep:
+	disable enable_crc
+	disable enable_white
+	setarg 0x555555
+	iforce crc24_init
+	fetch 1,mem_24g_ch
+	branch le_prep+5	
+
+g24_receive_packet:
+	bpatchx patch3b_6,mem_patch3b
+	fetch 1,mem_24g_rx_phy
+	call le_enable_phy_by_pdata
+	fetch 4,mem_24g_addr
+	iforce access
+	call calc_mod_value_scale_le
+	call set_sync_on
+	fetcht 1,mem_24g_ch
+	call le_rf_rx_enable
+g24_receive_rxon:
+	call g24_prep
+	bmark0 mark_ble_lr,g24_receive_nolr
+	pulse dewhiten_code_calc
+	nop 30
+	call g24_prep
+g24_receive_nolr:
+	disable user3
+	enable decode_fec0
+	enable is_rx
+	disable is_tx
+	enable swfine
+	fetch 2,mem_24g_rx_window
+	iforce stop_watch
+	correlate null,timeout
+	nbranch g24_sync_timeout,sync
+	call rf_debug_rx_sync_line
+	bmark1 mark_ble_lr,g24_receive_skip_fec1
+	disable decode_fec0	
+	enable decode_fec1	//lr do not use fec1
+g24_receive_skip_fec1:
+	enable enable_white
+	enable enable_crc
+	call g24_receive_byte
+	store 1,mem_24g_get_syncword_crc8
+	fetcht 1,mem_24g_syncword_crc8
+	isub temp,null
+	nbranch g24_end_of_packet,zero
+	bpatchx patch3b_7,mem_patch3b
+	disable user7
+	isolate1 mark_ble_lr,mark
+	call g24_lr_receive_pdu_len,true
+	branch g24_end_of_packet,user7
+	call g24_receive_byte
+	store 1,mem_24g_rxbuf	//device id
+	bmark1 mark_24g_rxmode,g24_receive_skip
+	fetch 1,mem_24g_rxbuf
+	fetcht 1,mem_24g_data_type
+	icompare bits_data,temp
+	nbranch g24_end_of_packet,true
+g24_receive_skip:
+	call g24_receive_byte
+	isolate1 mark_ble_lr,mark
+	call g24_lr_receive_payload_len,true
+	istore 1,contw
+	rshift3 pdata,pdata
+	sub pdata,0x1f,null
+	nbranch g24_end_of_packet,positive	//max payload: 32bytes
+	copy pdata,loopcnt
+	branch g24rx_nopayload,zero
+g24rx_loop:
+	call g24_receive_byte
+	istore 1,contw
+	loop g24rx_loop
+g24rx_nopayload:
+	bmark1 mark_24g_rxmode,g24_receive_skip_rssi
+	copy contw,rega
+	call g24_receive_byte
+	store 1,mem_rssi_hex_received	//receive rssi hex
+	copy rega,contw
+g24_receive_skip_rssi:
+	parse demod,bucket,24
+	rshift32 pdata,pdata
+	rshift16 pdata,pdata
+	istore 3,contw
+	disable decode_fec1
+	isolate1 mark_24g_rxmode,mark
+	call save_rssi_dec,true
+	branch g24_end_of_packet,crc_failed
+	call rf_debug_rx_crc_line	//L
+	enable user3
+	call le_match_set_txfreq
+	bpatchx patch3c_0,mem_patch3c
+	rtnmark1 mark_24g_rxmode
+	fetch 1,mem_rssi_hex_received
+	fetcht 1,mem_rssi_hex_received_max_value
+	isub temp,null
+	call copy_temp2pdata,positive
+	branch rssi_signal
+
+g24_lr_receive_pdu_len:
+	call g24_receive_byte
+	sub pdata,1,null
+	branch enable_user7,positive
+	increase -2,pdata	//minus hec and pdu length
+	bmark1 mark_24g_rxmode,g24_lr_receive_pdu_norssi
+	branch enable_user7,blank
+	increase -1,pdata	//minus rssi_hex length
+g24_lr_receive_pdu_norssi:
+	store 1,mem_temp	//payload length
+	rtn
+
+g24_lr_receive_payload_len:
+	and_into 0x07,pdata	//pdata[7:3]:length
+	fetcht 1,mem_temp	//payload length
+	lshift3 temp,temp
+	ior temp,pdata
+	rtn
+	
+g24_receive_byte:
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	rtn
+
+g24_sync_timeout:
+	isolate1 mark_24g_rxmode,mark
+	call rssi_noise,true
+g24_end_of_packet:
+	call le_disable
+	disable encode_fec1
+	disable decode_fec1
+	branch end_of_packet
+
+g24_set_freq_tx:
+	call set_sync_on
+	fetcht 1,mem_24g_ch
+	branch set_freq_tx
+
+g24_transmit:
+	bpatchx patch3c_1,mem_patch3c
+	fetch 1,mem_24g_tx_phy
+	call le_enable_phy_by_pdata
+	fetch 4,mem_24g_addr
+	iforce access
+	call g24_prep
+	call g24_set_freq_tx
+	set1 TXGFSK,radio_ctrl
+	enable encode_fec0
+	enable is_tx
+	disable is_rx
+	call rf_debug_tx_on_line
+	disable lr_s2en
+	bmark1 mark_ble_lr,g24_transmit_lr
+	bmark1 mark_ble_2M,g24_transmit_2M
+	rshift16 access,pdata
+	rshift8 pdata,pdata
+	rshift4 pdata,pdata
+	inject mod,40
+g24_transmit_packet:
+	bmark1 mark_ble_lr,g24_transmit_nolr
+	disable encode_fec0	
+	enable encode_fec1	////lr use encode_fec3
+g24_transmit_nolr:
+	enable enable_white
+	enable enable_crc
+	fetch 1,mem_24g_txlen
+	iforce loopcnt
+	arg mem_24g_txpayload,contr
+g24tr_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop g24tr_loop
+	enable enable_parity
+	inject mod,24	//crc
+	disable enable_parity
+	bmark0 mark_ble_lr,g24_transmit_skip
+	disable enable_white
+	setarg 0
+	inject mod,3
+g24_transmit_skip:	
+	until null,tx_clear
+	nop 100
+	disable lr_s2en
+	disable encode_fec0
+	disable encode_fec1
+	disable encode_fec3
+	call set_sync_on
+	branch rf_debug_tx_off_line
+
+g24_transmit_lr:
+	arg 10,loopcnt
+g24_transmit_lr_preamble_loop:
+	setarg 0x3c
+	inject mod,8
+	loop g24_transmit_lr_preamble_loop
+	disable encode_fec0
+	enable encode_fec3
+	rshift16 access,pdata
+	rshift16 pdata,pdata
+	rshift4 pdata,pdata
+	inject mod,32
+	bmark1 mark_ble_lr_s8,g24_transmit_lr_s8
+g24_transmit_lr_s2:
+	setarg 1
+	inject mod,5
+	enable lr_s2en
+	branch g24_transmit_packet
+
+g24_transmit_lr_s8:
+	setarg 0
+	inject mod,5
+	branch g24_transmit_packet
+
+g24_transmit_2M:
+	fetch 1,mem_system_clk
+	rshift pdata,loopcnt
+g24_transmit_2M_dealy:
+	nop 2
+	loop g24_transmit_2M_dealy
+//	nop 36	//2M 前端发送比1M快3us左右
+	rshift16 access,pdata
+	rshift8 pdata,pdata
+	rshift4 pdata,temp
+	copy temp,pdata
+	inject mod,8
+	copy temp,pdata
+	inject mod,40
+	branch g24_transmit_packet
+
+/****************************g24 base transceiver end********************************/
+
+
+
+/****************************g24 general func start********************************/
+
+g24_transmit_prep:
+	fetch 1,mem_24g_tx_phy
+	bbit1 BIT_LE_CODED_PHY,g24_lr_transmit_prep
+// total length
+	fetch 1,mem_24g_datalen
+	increase 3,pdata	//hec/type/control
+	store 1,mem_24g_txlen
+//hec
+	fetch 1,mem_24g_syncword_crc8
+	store 1,mem_24g_txpayload
+// data type
+	fetch 1,mem_24g_data_type
+	istore 1,contw
+//prepare 5bit payload length, 2bit PID, 1bit NO_ACK
+	fetch 1,mem_24g_datalen
+g24_transmit_prep_pdu:
+	lshift3 pdata,pdata
+	fetcht 1,mem_24g_pid
+	and temp,0x03,temp
+	lshift temp,temp
+	ior temp,pdata
+	fetcht 1,mem_24g_no_ack
+	iadd temp,pdata
+	istore 1,contw
+//prepare payload data
+	fetch 1,mem_24g_datalen
+	iforce loopcnt
+	arg mem_24g_txbuf,contr
+	call memcpy
+//rssi hex	
+	rtnmark0 mark_24g_rxmode
+	fetch 1,mem_rssi_hex
+	istore 1,contw
+	fetch 1,mem_24g_tx_phy
+	rtnbit1 BIT_LE_CODED_PHY
+	fetch 1,mem_24g_txlen
+	increase 1,pdata	//plus rssi_hex length
+	store 1,mem_24g_txlen
+	rtn
+	
+g24_lr_transmit_prep:
+// total length
+	fetch 1,mem_24g_datalen
+	increase 4,pdata	//hec/pdu/type/control
+	bmark0 mark_24g_rxmode,g24_lr_transmit_prep_skip
+	increase 1,pdata	//mem_rssi_hex
+g24_lr_transmit_prep_skip:
+	store 1,mem_24g_txlen
+//hec
+	fetch 1,mem_24g_syncword_crc8
+	store 1,mem_24g_txpayload
+// pdu length
+	fetch 1,mem_24g_txlen
+	increase -2,pdata	//minus hec and pdu length
+	istore 1,contw
+// data type
+	fetch 1,mem_24g_data_type
+	istore 1,contw
+	setarg 0
+	branch g24_transmit_prep_pdu
+
+g24_read_len_pid_crc:
+//read control
+	fetch 1,mem_24g_rxbuf+1
+	rshift3 pdata,pdata
+	store 1,mem_24g_rxdata_length
+//get crc
+	increase 1,pdata
+	arg mem_24g_rxbuf+1,contr
+	iadd contr,contr
+	ifetch 3,contr
+	store 3,mem_24g_sta_crc
+//read pid
+	fetch 1,mem_24g_rxbuf+1
+	rshift pdata,pdata
+	and pdata,0x03,pdata
+	store 1,mem_24g_sta_pid
+	rtn
+
+	
+g24_ch:
+	fetcht 1,mem_24g_current_ch_number
+	call g24_ch_map_size
+	storet 1,mem_24g_current_ch_number
+	rtn
+
+g24_ch_map_size:
+	call g24_ch_calc
+	increase 1,temp
+	and_into 3,temp //map size =4
+	rtn
+	
+g24_ch_calc:
+	fetch 1,mem_24g_addr	
+	and_into 0x03,pdata
+	mul32 pdata,4,rega			//24addr low bit0 bit1 ,00-map1,01-map2,10-map3,11-map4
+	setarg mem_24g_ch_map1
+	iadd rega,pdata
+	iadd temp,contr
+	ifetch 1,contr
+	store 1,mem_24g_ch
+	rtn
+
+
+g24_update_addr_and_synccrc8:
+	store 4,mem_24g_addr
+//output: 1BYTE crc8
+g24_syncword_crc8:
+	arg 0,rega
+	arg 4,loopcnt
+	arg mem_24g_addr,contr
+g24_syncword_crc8_loop:
+	ifetch 1,contr
+	iadd rega,rega
+	loop g24_syncword_crc8_loop
+	copy rega,pdata
+	store 2,mem_24g_syncword
+	fetch 1,mem_24g_syncword
+	fetcht 1,mem_24g_syncword+1
+	iadd temp,pdata
+	store 1,mem_24g_syncword_crc8
+	rtn
+
+
+g24_timer_check:
+	call disable_user
+	fetcht 4,mem_24g_tx_btclk
+	copy clkn_bt,pdata
+	isub temp,null
+	ncall g24_timer_timeout,positive
+	copy pdata,regb
+	fetch 4,mem_24g_tx_btclk
+	fetcht 1,mem_24g_interval
+	iadd temp,temp
+	copy regb,pdata
+	isub temp,null
+	nrtn positive
+	set0 28,pdata
+	store 4,mem_24g_tx_btclk
+	branch enable_user
+g24_timer_timeout:
+	rtn zero
+	set1 28,pdata
+	rtn
+g24_timer_init:
+	setarg 0
+	store 4,mem_24g_tx_btclk
+	rtn
+
+
+
+//mem_24g_ch_map1:00 13 2c 42
+//mem_24g_ch_map2:06 15 36 48
+//mem_24g_ch_map3:0f 1a 3a 4c
+//mem_24g_ch_map4:11 23 31 4d
+g24_chmap_param_init:
+	setsect 0,0x1300
+	setsect 1,0x1908b
+	setsect 2,0x36150
+	setsect 3,0x3d20
+	store 9,mem_24g_ch_map1
+	setsect 0,0x3a1a
+	setsect 1,0xc453
+	setsect 2,0xd312
+	setsect 3,0x1
+	istore 7,contw
+	fetch 1,mem_24g_ch_map_update
+	rtn blank
+	arg mem_24g_ch_update_map1,contr
+	arg mem_24g_ch_map1,contw
+	branch memcpy16
+
+
+
+//mem_24g_ch_update_map1:00 1e 00 4e
+//mem_24g_ch_update_map2:03 23 03 42
+//mem_24g_ch_update_map3:06 25 06 4c
+//mem_24g_ch_update_map4:09 27 09 3c
+g24_chamap_param_update:
+	setarg 0x4e001e
+	store 3,mem_24g_ch_update_map1+1
+	setarg 0x032303
+	istore 3,contw
+	setarg 0x250642
+	istore 3,contw
+	setarg 0x094c06
+	istore 3,contw
+	setarg 0x3c0927
+	istore 3,contw
+	jam 1,mem_24g_ch_map_update
+	rtn
+
+
+g24_rx_window_init:
+	arg 0x7530,temp
+	bmark1 mark_24g_rxmode,g24_rx_window_store
+	arg 0x12c0,temp
+	fetch 1,mem_24g_rx_phy
+	bbit0 2,g24_rx_window_store	//uncoded phy
+	arg 0x2ee0,temp
+g24_rx_window_store:	
+	storet 2,mem_24g_rx_window
+	rtn
+
+g24_enable_1M:
+	jam 0x01,mem_24g_rx_phy
+	jam 0x01,mem_24g_tx_phy
+	rtn
+
+//g24_enable_2M:
+//	jam 0x02,mem_24g_rx_phy
+//	jam 0x02,mem_24g_tx_phy
+//	rtn
+//	
+//g24_enable_coded_s2:
+//	jam 0x04,mem_24g_rx_phy
+//	jam 0x04,mem_24g_tx_phy
+//	rtn
+
+//g24_enable_coded_s8:
+//	jam 0x84,mem_24g_rx_phy
+//	jam 0x84,mem_24g_tx_phy
+//	rtn
+
+
+/****************************g24 general func end********************************/
+
+
+
+/****************************g24 sim start********************************/
+/*
+g24_sim_rx:
+	set1 mark_24g_rxmode,mark
+	jam 1,mem_24g_rx_phy	//0x01:1M/0x02:2M/0x04:S2/0x84:S8
+	fetch 1,mem_24g_rx_phy
+	call le_enable_phy_by_pdata
+	jam 0,mem_24g_ch
+	setarg 0x123456
+	store 3,mem_24g_addr
+	istore 1,contw
+	call g24_syncword_crc8
+	setarg 0x3000
+	store 2,mem_24g_rx_window
+g24_sim_rx_loop:
+	call g24_receive_packet
+	call g24_read_len_pid_crc
+	call g24_end_of_packet
+	branch g24_sim_rx_loop
+
+g24_sim_tx:
+	jam 1,mem_24g_tx_phy
+	fetch 1,mem_24g_tx_phy
+	call le_enable_phy_by_pdata
+	jam 0,mem_24g_ch
+	setarg 0x123456
+	store 3,mem_24g_addr
+	istore 1,contw
+	call g24_syncword_crc8
+	jam 1,mem_24g_datalen
+	jam 1,mem_24g_txbuf
+	jam 0x88,mem_rssi_hex
+	call g24_transmit_prep
+g24_sim_tx_loop:
+	call g24_transmit
+	call g24_end_of_packet
+	branch g24_sim_tx_loop
+
+*/
+
+/****************************g24 sim end********************************/
+
+	
Index: program/g24_protocol_stack/24g_pair.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_pair.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_pair.prog	(working copy)
@@ -0,0 +1,360 @@
+
+
+g24_pair_param_init:
+	jam 0x4e,mem_24g_pair_ch
+	setarg 0x101520
+	store 3,mem_24g_pair_addr
+	setarg 0x05
+	istore 1,contw
+	rtn
+
+
+
+/****************************g24 pair transmitter start********************************/
+
+g24_pair_timeout_timer:
+	arg mem_24g_pair_timeout,regc
+	arg g24_stop_24g_mode,regb
+	branch timer_single_step_2B
+
+g24_pair_start:
+	set1 mark_24g,mark
+	fetch 1,mem_24g_conn_sm
+	set0 STATE_24G_RECONN,pdata
+	set1 STATE_24G_PAIR,pdata
+	store 1,mem_24g_conn_sm
+	setarg 0
+	store 2,mem_24g_reconn_timeout
+	fetch 2,mem_24g_pair_timeout_init
+	store 2,mem_24g_pair_timeout
+	jam 0,mem_24g_pair_no_ack
+	call g24_pair_sm_reinit
+g24_pair_init_param:
+	jam 0,mem_24g_pid
+	fetch 1,mem_24g_pair_ch
+	store 1,mem_24g_ch
+	fetch 1,mem_24g_pair_tx_power
+	store 1,mem_tx_power
+	fetch 4,mem_24g_pair_addr
+	branch g24_update_addr_and_synccrc8
+
+
+g24_pair_dispatch:
+	bpatchx patch3c_2,mem_patch3c
+	fetch 1,mem_24g_pair_sm
+	beq STATE_24G_PAIRING_SUCCESS,g24_pair_exit
+	beq STATE_24G_PAIRING_1,g24_pair_sm_1
+	beq STATE_24G_PAIRING_2,g24_pair_sm_2
+	beq STATE_24G_PAIRING_3,g24_pair_sm_3
+	beq STATE_24G_PAIRING_4,g24_pair_sm_4
+	rtn
+
+g24_pair_sm_1:
+	jam DATATYPE_ATTEMP,mem_24g_txbuf
+	branch g24_pair_sm_prep
+
+g24_pair_sm_2:
+	fetch 1,mem_24g_pair_switch
+	branch g24_pair_sm_2_skip,blank
+	fetch 4,mem_24g_device_addr
+	call g24_update_addr_and_synccrc8	//use transmitter addr
+g24_pair_sm_2_skip:
+	jam DATATYPE_BIND,mem_24g_txbuf	
+	branch g24_pair_sm_prep
+
+g24_pair_sm_3:
+	jam DATATYPE_CONFIG,mem_24g_txbuf	
+	fetch 1,mem_24g_pair_switch
+	branch g24_pair_sm_prep,blank
+	fetch 4,mem_24g_receiver_addr		//prep receiver addr
+	store 4,mem_24g_txbuf+2
+	branch g24_pair_sm_common
+
+g24_pair_sm_4:
+	jam DATATYPE_OK,mem_24g_txbuf
+g24_pair_sm_prep:
+	fetch 4,mem_24g_device_addr
+	store 4,mem_24g_txbuf+2
+g24_pair_sm_common:
+	fetch 1,mem_24g_data_type
+	and_into bits_data,pdata
+	store 1,mem_24g_txbuf+1
+	jam 0,mem_24g_txbuf+6
+	jam 7,mem_24g_datalen
+	call g24_transmit_prep
+	call g24_transmit_receive_ack
+	nrtn sync
+	nrtn user3
+	call g24_txbuf_clear
+	call g24_ackpayload_parse
+	bpatchx patch3c_3,mem_patch3c
+	fetch 1,mem_24g_pair_sm
+	rtneq STATE_24G_PAIRING_SUCCESS
+	beq STATE_24G_PAIRING_1,g24_pair_sm_1_waiting_ack
+	beq STATE_24G_PAIRING_2,g24_pair_sm_2_waiting_ack
+	beq STATE_24G_PAIRING_3,g24_pair_sm_3_waiting_ack
+	beq STATE_24G_PAIRING_4,g24_pair_sm_4_waiting_ack
+	rtn
+
+g24_pair_sm_reinit:	
+	jam STATE_24G_PAIRING_2,mem_24g_pair_sm
+	fetch 1,mem_24g_pair_switch
+	rtn blank
+	jam STATE_24G_PAIRING_1,mem_24g_pair_sm
+	rtn
+
+g24_pair_sm_1_waiting_ack:
+	jam STATE_24G_PAIRING_2,mem_24g_pair_sm
+	branch g24_transmit_abandon
+	
+g24_pair_sm_2_waiting_ack:
+	fetch 1,mem_24g_pair_switch
+	branch g24_pair_sm_2_waiting_ack_skip,blank
+	fetch 4,mem_24g_rxpayload+2
+	store 4,mem_24g_receiver_addr
+g24_pair_sm_2_waiting_ack_skip:	
+	jam STATE_24G_PAIRING_3,mem_24g_pair_sm
+	branch g24_transmit_abandon
+
+g24_pair_sm_3_waiting_ack:
+	fetch 1,mem_24g_pair_switch
+	branch g24_pair_sm_3_waiting_ack_skip,blank
+	fetch 4,mem_24g_rxpayload+2
+	fetcht 4,mem_24g_device_addr
+	isub temp,null
+	nrtn zero
+g24_pair_sm_3_waiting_ack_skip:	
+	jam STATE_24G_PAIRING_4,mem_24g_pair_sm
+	branch g24_transmit_abandon	
+	
+g24_pair_sm_4_waiting_ack:
+	fetch 1,mem_24g_pair_switch
+	branch g24_pair_sm_4_waiting_ack_skip,blank
+	fetch 4,mem_24g_rxpayload+2
+	fetcht 4,mem_24g_receiver_addr
+	isub temp,null
+	nrtn zero
+g24_pair_sm_4_waiting_ack_skip:	
+	jam STATE_24G_PAIRING_SUCCESS,mem_24g_pair_sm
+	jam BT_EVT_24G_PAIRING_COMPLETE,mem_fifo_temp
+	call ui_ipc_send_event
+	setarg 0
+	store 2,mem_24g_pair_timeout
+	fetch 4,mem_24g_rxpayload+2
+	call g24_update_addr_and_synccrc8
+g24_pair_exit:
+	fetch 1,mem_24g_conn_sm
+	set0 STATE_24G_PAIR,pdata
+	store 1,mem_24g_conn_sm
+	branch g24_transmit_abandon
+
+
+
+
+/****************************g24 pair transmitter end********************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/****************************g24 pair receiver start********************************/
+
+
+g24_bind_mode_enable:
+	jam DONGLE_BIND,mem_24g_work_mode
+	jam CLEAR_INIT,mem_24g_mode_init
+	rtn
+
+g24_bind_init:
+	fetch 1,mem_24g_mode_init
+	rtnbit1 DONGLE_BIND
+	set1 DONGLE_BIND,pdata
+	store 1,mem_24g_mode_init
+	setarg 0
+	store 3,mem_24g_device1_bind_step
+	store 4,mem_24g_transmitter_addr
+	jam 1,mem_24g_ackpayload_enable
+	branch g24_pair_init_param
+
+
+g24_bind_ackpayload_prep:
+	jam 1,mem_24g_ackpayload_enable
+	jam 0x08,mem_24g_datalen
+	arg mem_24g_bind_payload,contr
+	arg mem_24g_txbuf,contw
+	branch memcpy8
+
+
+g24_bind_data_process:
+	call g24_rx_interrupt_clear
+	call g24_receive_packet
+	nbranch g24_rx_interrupt_clear,user3
+	call g24_bind_data_parse
+	nbranch g24_bind_data_error,user
+	call g24_transmit_ack
+	fetch 1,mem_24g_pair_switch
+	rtn blank
+	fetch 4,mem_24g_transmitter_addr
+	rtn blank
+	branch g24_update_addr_and_synccrc8
+
+g24_bind_data_error:
+	call g24_rx_interrupt_clear
+	branch g24_end_of_packet
+
+g24_bind_data_parse:
+	jam BIND_MODE_CONTINUE,mem_24g_bind_mode_continue	//about 400ms
+	call disable_user
+	arg mem_24g_rxbuf,contr
+	arg mem_24g_rxdata_temp,contw
+	call memcpy8
+	bpatchx patch3c_4,mem_patch3c
+	fetch 1,mem_24g_rxdata_temp+2
+	beq DATATYPE_BIND,g24_bind_first_step	//bind step 1
+	beq DATATYPE_CONFIG,g24_bind_second_step
+	beq DATATYPE_OK,g24_bind_third_step
+	beq DATATYPE_ATTEMP,g24_data_attemp
+	branch g24_rx_interrupt_clear
+
+
+g24_bind_first_step:
+	fetch 1,mem_24g_rxdata_temp+3
+	beq DATATYPE_DEVICE1,g24_bind_first_step_device1
+	beq DATATYPE_DEVICE2,g24_bind_first_step_device2
+	rtn
+
+g24_bind_first_step_device1:
+	jam 1,mem_24g_device1_bind_step
+g24_bind_dvc1_payload_cfg:
+	jam DATATYPE_DEVICE1,mem_24g_bind_payload
+g24_bind_payload_cfg:
+	jam 0x80,mem_24g_bind_payload+1
+	fetch 6,mem_lap
+	store 6,mem_24g_bind_payload+2
+	branch enable_user
+
+g24_bind_first_step_device2:
+	jam 1,mem_24g_device2_bind_step
+g24_bind_dvc2_payload_cfg:
+	jam DATATYPE_DEVICE2,mem_24g_bind_payload
+	branch g24_bind_payload_cfg
+
+
+g24_bind_second_step:
+	fetch 1,mem_24g_pair_switch
+	branch g24_bind_second_step_skip,blank
+	fetch 4,mem_24g_rxdata_temp+4
+	fetcht 4,mem_lap
+	isub temp,null
+	nrtn zero
+g24_bind_second_step_skip:	
+	fetch 1,mem_24g_rxdata_temp+3
+	beq DATATYPE_DEVICE1,g24_bind_second_step_device1
+	beq DATATYPE_DEVICE2,g24_bind_second_step_device2
+	rtn
+
+g24_bind_second_step_device1:
+	fetch 1,mem_24g_device1_bind_step
+	beq 1,g24_bind_dvc1_step_set2
+	rtn
+g24_bind_dvc1_step_set2:
+	jam 2,mem_24g_device1_bind_step
+	fetch 1,mem_24g_pair_switch
+	branch g24_bind_dvc1_payload_cfg,blank
+g24_bind_dvc1_payload_cfg_transmitter_addr:
+	jam DATATYPE_DEVICE1,mem_24g_bind_payload
+g24_bind_payload_cfg_transmitter_addr:
+	jam 0x80,mem_24g_bind_payload+1
+	fetch 4,mem_24g_transmitter_addr
+	store 4,mem_24g_bind_payload+2
+	branch enable_user
+
+g24_bind_second_step_device2:
+	fetch 1,mem_24g_device2_bind_step
+	beq 1,g24_bind_dvc2_step_set2
+	rtn
+g24_bind_dvc2_step_set2:
+	jam 2,mem_24g_device2_bind_step
+	fetch 1,mem_24g_pair_switch
+	branch g24_bind_dvc2_payload_cfg,blank	
+	jam DATATYPE_DEVICE2,mem_24g_bind_payload
+	branch g24_bind_payload_cfg_transmitter_addr
+
+
+g24_bind_third_step:
+	fetch 1,mem_24g_pair_switch
+	branch g24_bind_third_step_skip,blank
+	fetch 4,mem_24g_rxdata_temp+4
+	fetcht 4,mem_24g_transmitter_addr
+	isub temp,null
+	nrtn zero
+g24_bind_third_step_skip:
+	fetch 1,mem_24g_rxdata_temp+3
+	beq DATATYPE_DEVICE1,g24_bind_third_step_device1
+	beq DATATYPE_DEVICE2,g24_bind_third_step_device2
+	rtn
+
+g24_bind_third_step_device1:
+	fetch 1,mem_24g_device1_bind_step
+	beq 2,g24_bind_dvc1_step_success
+	rtn
+g24_bind_dvc1_step_success:
+	call g24_bind_dvc1_payload_cfg
+	fetch 1,mem_24g_bind_device_status
+	or_into 0x01,pdata
+	store 1,mem_24g_bind_device_status
+g24_bind_exit:
+	setarg 0
+	store 2,mem_24g_device1_bind_step
+	rtn
+	
+g24_bind_third_step_device2:
+	fetch 1,mem_24g_device2_bind_step
+	bne 0,g24_bind_dvc2_step_success
+	rtn
+g24_bind_dvc2_step_success:	
+	call g24_bind_dvc2_payload_cfg
+	fetch 1,mem_24g_bind_device_status
+	or_into 0x02,pdata
+	store 1,mem_24g_bind_device_status
+	call g24_bind_exit
+g24_store_dvc2_bind_flag:
+	fetch 1,mem_device_option
+	rtnne dvc_op_dongle
+	fetch 1,mem_dg_kb_bind_flag
+	rtneq DONGLE_KB_BIND_SUCCESS
+	jam DONGLE_KB_BIND_SUCCESS,mem_dg_kb_bind_flag
+	call dongle_write_kb_bind_status
+	branch soft_reset_chip
+
+
+
+
+
+
+/****************************g24 pair receiver end********************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: program/g24_protocol_stack/24g_receiver.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_receiver.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_receiver.prog	(working copy)
@@ -0,0 +1,483 @@
+
+g24_receive_init:
+	set1 mark_24g_rxmode,mark
+	fetch 1,mem_tx_power
+	store 1,mem_tx_power_temp
+	call g24_rx_window_init
+	branch rssi_receiver_buff_init
+
+g24_receive_dispatch:
+	fetch 2,mem_cb_24g_receive_process
+	branch callback_func
+
+g24_ackpayload_prep:
+	jam 0,mem_24g_datalen
+	fetch 1,mem_24g_ackpayload_enable
+	rtn blank
+	fetch 2,mem_cb_24g_ackpayload
+	branch callback_func
+
+
+g24_receive_packet_start:
+	call g24_receive_transmit_ack
+	nbranch g24_rx_interrupt_clear,user3
+g24_receive_packet_parse:
+	call g24_receive_packet_parse_pid_crc
+	nbranch g24_rx_interrupt_clear,user
+	fetch 1,mem_24g_rxdata_length
+	branch g24_rx_interrupt_clear,blank
+	increase 2,pdata
+	iforce loopcnt
+	arg mem_24g_rxbuf,contr
+	arg mem_24g_rxdata_temp,contw
+	call memcpy
+	jam 0,mem_24g_mode_switch
+	fetch 1,mem_24g_pair_mode
+	call g24_enable_nodata_timer,blank
+	fetch 1,mem_24g_rxdata_temp+2
+	beq DATATYPE_DEVICE1,g24_data_device1	//mouse
+	beq DATATYPE_DEVICE2,g24_data_device2	//keyboard
+	beq DATATYPE_ATTEMP,g24_data_attemp	//reconn packet
+g24_rx_interrupt_clear:
+	arg mem_24g_rxbuf,contw
+	arg 66,loopcnt
+	branch clear_mem
+
+
+g24_data_device1:
+	call g24_ch_timer_reinit
+	fetch 1,mem_24g_abort_packet
+	fetcht 1,mem_24g_rxdata_temp
+	isolate1 bit_abort,temp
+	setflag true,0,pdata
+	store 1,mem_24g_abort_packet
+	beq 1,g24_data_attemp_device1_abort
+	fetch 1,mem_24g_hop_packet
+	fetcht 1,mem_24g_rxdata_temp
+	isolate1 bit_hop,temp
+	setflag true,0,pdata
+	store 1,mem_24g_hop_packet
+	fetch 2,mem_cb_24g_data_device1
+	branch callback_func
+
+g24_data_device2:
+	fetcht 1,mem_24g_rxdata_temp
+	isolate1 bit_abort,temp
+	branch g24_data_attemp_device2_abort,true
+	fetch 2,mem_cb_24g_data_device2
+	branch callback_func
+
+g24_data_attemp_device1_abort:
+	fetch 1,mem_device_option
+	sub pdata,dvc_op_car,null
+	call car_stop_blink,zero
+	fetch 4,mem_24g_rxdata_temp+10
+	branch g24_store_device1_addr
+g24_data_attemp_device2_abort:
+	fetch 4,mem_24g_rxdata_temp+10
+	branch g24_store_device2_addr	
+
+
+g24_receive_packet_parse_pid_crc:
+	call disable_user
+	fetch 1,mem_24g_sta_pid
+	fetcht 1,mem_24g_last_pid
+	isub temp,null
+	ncall enable_user,zero
+	fetch 1,mem_24g_sta_pid
+	store 1,mem_24g_last_pid
+	fetch 3,mem_24g_sta_crc
+	fetcht 3,mem_24g_last_crc
+	isub temp,null
+	ncall enable_user,zero
+	fetch 3,mem_24g_sta_crc
+	store 3,mem_24g_last_crc
+	rtn
+
+g24_receive_transmit_ack:
+	call g24_rx_interrupt_clear
+	call g24_receive_packet
+	nrtn user3
+g24_transmit_ack:
+//data type
+	fetch 1,mem_24g_rxbuf
+	store 1,mem_24g_data_type
+//read len pid crc
+	call g24_read_len_pid_crc
+//read ack
+	fetch 1,mem_24g_rxbuf+1
+	isolate1 bit_ack_24g,pdata
+	branch g24tx_no_ack,true
+g24tx_with_ack:
+	call g24_ackpayload_prep
+	call g24_transmit_prep
+	call g24_transmit
+g24tx_no_ack:
+	branch g24_end_of_packet
+
+
+g24_enable_nodata_timer:
+	jam 1,mem_24g_nodata_timer_enable
+g24_enable_nodata_timer_init:
+	setarg TIMER_NODATA_DELAY
+	arg TIMER_NODATA,queue
+	branch timer_init
+
+
+
+/****************************g24 receiver mode switch start********************************/
+
+g24_mode_switch_init:
+	jam 1,mem_24g_mode_switch
+	jam 0,mem_24g_time_slice
+	jam 0xff,mem_24g_interval
+	branch g24_timer_init
+	
+g24_mode_switch:
+	bpatchx patch3c_5,mem_patch3c
+	fetch 1,mem_24g_mode_switch
+	rtn blank
+	call g24_timer_check
+	nrtn user	//80ms
+	call g24_bind_mode_continue
+	fetch 1,mem_24g_time_slice
+	increase 1,pdata
+	and_into 1,pdata
+	store 1,mem_24g_time_slice
+	beq 0,g24_work_mode_switch
+	beq 1,g24_bind_mode_switch
+	rtn
+
+g24_bind_mode_continue:
+	fetch 1,mem_24g_bind_mode_continue
+	rtn blank
+	increase -1,pdata
+	store 1,mem_24g_bind_mode_continue
+	rtn
+
+g24_work_mode_switch:
+	fetch 1,mem_24g_bind_mode_continue
+	nrtn blank
+	branch g24_switch_work_mode
+
+g24_bind_mode_switch:
+	fetch 1,mem_24g_bind_mode_continue
+	nrtn blank
+	branch g24_bind_mode_enable
+
+/****************************g24 receiver mode switch end********************************/
+
+
+
+
+/****************************g24 receiver work mode start********************************/
+
+g24_work_init:
+	fetch 1,mem_24g_mode_init
+	rtnbit1 DONGLE_WORK
+	set1 DONGLE_WORK,pdata
+	store 1,mem_24g_mode_init
+	fetch 1,mem_tx_power_temp
+	store 1,mem_tx_power
+	jam 0,mem_24g_ackpayload_enable
+	jam 0,mem_usb_tx_enable
+	jam 1,mem_24g_abort_packet
+	jam 0,mem_24g_pid
+	fetch 4,mem_lap
+	call g24_update_addr_and_synccrc8
+	call g24_ch
+	branch g24_rx_interrupt_clear
+
+
+g24_switch_work_mode:
+	jam 0,mem_24g_ackpayload_enable
+g24_work_mode_enable:
+	jam DONGLE_WORK,mem_24g_work_mode
+	jam CLEAR_INIT,mem_24g_mode_init	
+	rtn
+
+
+g24_work_mode_start:
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_WORK
+	call g24_work_init
+	call g24_ch_process
+	branch g24_receive_packet_start
+
+
+
+/****************************g24 receiver work mode end********************************/
+
+
+
+
+
+
+/****************************g24 receiver bind mode start********************************/
+
+g24_bind_mode_auto:
+	bpatchx patch3c_6,mem_patch3c
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_BIND
+	call g24_bind_init
+	call g24_bind_data_process
+	fetch 1,mem_24g_pair_mode
+	nrtn blank
+	fetch 1,mem_24g_bind_device_status
+	rtn blank
+	jam 0,mem_24g_mode_switch
+	call g24_switch_work_mode
+	call g24_enable_nodata_timer
+	branch g24_timer_init
+
+
+/****************************g24 receiver bind mode end********************************/
+
+
+
+
+
+
+/****************************g24 receiver search mode start********************************/
+
+g24_search_mode_init:
+	fetch 1,mem_24g_mode_init
+	rtnbit1 DONGLE_SEARCH
+	set1 DONGLE_SEARCH,pdata
+	store 1,mem_24g_mode_init
+	jam 0,mem_24g_time_slice
+	jam 1,mem_24g_ackpayload_enable
+	setarg 0
+	store 3,mem_rssi_noise_self_index
+	store 7,mem_24g_self_config_ch_once
+	call g24_receiver_addr_check
+	nrtn zero
+	fetch 1,mem_24g_current_ch_number
+	store 1,mem_24g_self_ch_number
+	fetch 1,mem_24g_ch
+	store 1,mem_24g_self_last_ch
+	rtn
+
+
+g24_search_mode_auto:
+	bpatchx patch3c_7,mem_patch3c
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_SEARCH
+	call g24_search_mode_init
+	call g24_auto_addr_ch_search
+	call g24_receive_transmit_ack
+	nbranch g24_rx_interrupt_clear,user3
+	//dongle addr,then parse rxdata
+	call g24_receiver_addr_check
+	call g24_receive_packet_parse,zero
+	//receive data,then go to paired
+	jam DONGLE_WORK,mem_24g_work_mode
+	fetch 1,mem_24g_mode_init
+	set1 DONGLE_WORK,pdata
+	store 1,mem_24g_mode_init
+
+	fetch 1,mem_24g_ackpayload_enable
+	sub pdata,2,null
+	ncall g24_ackpayload_disable,zero
+
+	call g24_rx_interrupt_clear
+	call g24_enable_nodata_timer
+	call g24_receiver_addr_check
+	branch g24_self_ch_num_reinit,zero
+	fetch 4,mem_24g_addr
+	fetcht 4,mem_24g_device2_addr
+	isub temp,null
+	branch g24_device2_ch_num_reinit,zero		
+	fetch 4,mem_24g_addr
+	fetcht 4,mem_24g_device1_addr
+	isub temp,null
+	branch g24_device1_ch_num_reinit,zero
+	rtn
+
+
+g24_self_ch_num_reinit:
+	fetch 1,mem_24g_self_ch_number
+g24_current_ch_num_reinit:
+	store 1,mem_24g_current_ch_number
+	rtn
+
+g24_device2_ch_num_reinit:
+	fetch 1,mem_24g_device2_ch_number
+	branch g24_current_ch_num_reinit
+
+g24_device1_ch_num_reinit:
+	fetch 1,mem_24g_device1_ch_number
+	branch g24_current_ch_num_reinit
+
+
+g24_auto_addr_ch_search:
+	fetch 1,mem_24g_time_slice
+	increase 1,pdata
+	and_into 3,pdata
+	store 1,mem_24g_time_slice
+	//pairing address and channel come first
+	beq 0,g24_auto_bind_config_device2
+	beq 1,g24_auto_bind_config_self
+	beq 2,g24_auto_bind_config_device1
+	beq 3,g24_auto_bind_config_self
+	rtn
+
+g24_auto_bind_config_device1:
+	call g24_bind_dvc1_payload_cfg
+	fetch 4,mem_24g_device1_addr
+	branch g24_auto_addr_ch_search,blank
+	call g24_update_addr_and_synccrc8
+	fetch 1,mem_24g_device1_config_ch_once
+	call g24_device1_config_ch_once,blank
+	fetch 1,mem_24g_device1_last_ch
+	store 1,mem_24g_ch
+	fetcht 1,mem_rssi_noise_device1_index
+	fetchr rega,2,mem_rssi_noise_device1_buffer_ptr
+	call rssi_store
+	storet 1,mem_rssi_noise_device1_index
+	call rssi_average
+	storet 1,mem_rssi_noise_device1_avg
+	sub temp,RSSI_THRESH_NOISE,null
+	nrtn positive
+	fetcht 1,mem_24g_device1_ch_number
+	call g24_ch_map_size
+	storet 1,mem_24g_device1_ch_number
+	store 1,mem_24g_device1_last_ch
+	rtn
+
+g24_device1_config_ch_once:
+	jam 1,mem_24g_device1_config_ch_once
+	arg 0,temp
+	call g24_ch_calc
+	store 1,mem_24g_device1_last_ch
+	rtn
+	
+g24_auto_bind_config_device2:
+	call g24_bind_dvc2_payload_cfg
+	fetch 4,mem_24g_device2_addr
+	branch g24_auto_addr_ch_search,blank
+	call g24_update_addr_and_synccrc8
+	fetch 1,mem_24g_device2_config_ch_once
+	call g24_device2_config_ch_once,blank
+	fetch 1,mem_24g_device2_last_ch
+	store 1,mem_24g_ch
+	fetcht 1,mem_rssi_noise_device2_index
+	fetchr rega,2,mem_rssi_noise_device2_buffer_ptr
+	call rssi_store
+	storet 1,mem_rssi_noise_device2_index
+	call rssi_average
+	storet 1,mem_rssi_noise_device2_avg
+	sub temp,RSSI_THRESH_NOISE,null
+	nrtn positive
+	fetcht 1,mem_24g_device2_ch_number
+	call g24_ch_map_size
+	storet 1,mem_24g_device2_ch_number
+	store 1,mem_24g_device2_last_ch
+	rtn
+
+g24_device2_config_ch_once:
+	jam 1,mem_24g_device2_config_ch_once
+	arg 0,temp
+	call g24_ch_calc
+	store 1,mem_24g_device2_last_ch
+	rtn	
+
+g24_auto_bind_config_self:
+	call g24_bind_dvc1_payload_cfg
+	fetch 4,mem_lap
+	call g24_update_addr_and_synccrc8
+	fetch 1,mem_24g_self_config_ch_once
+	call g24_self_config_ch_once,blank
+	fetch 1,mem_24g_self_last_ch
+	store 1,mem_24g_ch
+	fetcht 1,mem_rssi_noise_self_index
+	fetchr rega,2,mem_rssi_noise_self_buffer_ptr
+	call rssi_store
+	storet 1,mem_rssi_noise_self_index
+	call rssi_average
+	storet 1,mem_rssi_noise_self_avg
+	sub temp,RSSI_THRESH_NOISE,null
+	nrtn positive
+	fetcht 1,mem_24g_self_ch_number
+	call g24_ch_map_size
+	storet 1,mem_24g_self_ch_number
+	store 1,mem_24g_self_last_ch
+	rtn
+
+g24_self_config_ch_once:
+	jam 1,mem_24g_self_config_ch_once
+	fetch 1,mem_24g_self_last_ch
+	store 1,mem_24g_ch
+	rtn
+
+
+g24_ackpayload_disable:
+	jam 0,mem_24g_ackpayload_enable
+	rtn
+
+
+g24_receiver_addr_check:
+	fetch 4,mem_24g_addr
+	fetcht 4,mem_lap
+	isub temp,null
+	rtn
+
+/****************************g24 receiver search mode end********************************/
+
+
+
+
+
+
+/****************************g24 receiver nodata process start********************************/
+
+
+g24_nodata_process:
+	fetch 1,mem_24g_ackpayload_enable
+	rtneq 2
+	fetch 1,mem_24g_nodata_timer_enable
+	rtn blank
+	arg TIMER_NODATA,queue
+	call timer_check
+	nrtn blank
+	jam 0,mem_24g_nodata_timer_enable
+	jam 0,mem_24g_bind_mode_continue
+	//no data for more than 100ms,then go to search
+	jam DONGLE_SEARCH,mem_24g_work_mode
+	jam CLEAR_INIT,mem_24g_mode_init
+	branch g24_rx_interrupt_clear
+
+
+/****************************g24 receiver nodata process end********************************/
+
+
+g24_ch_process:
+	fetch 1,mem_24g_abort_packet
+	beq 1,rssi_noise_monitor
+	fetch 1,mem_24g_hop_packet
+	beq 1,g24_ch_receive_hop_pac
+	fetcht 4,mem_24g_hop_btclk
+	copy clkn_bt,pdata
+	isub temp,null
+	ncall g24_timer_timeout,positive
+	copy pdata,regb
+	fetch 4,mem_24g_hop_btclk
+	fetcht 1,mem_24g_hop_interval
+	iadd temp,temp
+	copy regb,pdata
+	isub temp,null
+	nrtn positive
+	set0 28,pdata
+	store 4,mem_24g_hop_btclk
+	jam 1,mem_24g_abort_packet
+	branch g24_ch
+
+g24_ch_receive_hop_pac:
+	jam 0,mem_24g_hop_packet
+	branch g24_ch
+
+g24_ch_timer_reinit:
+	copy clkn_bt,pdata
+	store 4,mem_24g_hop_btclk
+	rtn
+
Index: program/g24_protocol_stack/24g_reconn.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_reconn.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_reconn.prog	(working copy)
@@ -0,0 +1,163 @@
+
+/****************************g24 reconn transmitter start********************************/
+
+g24_reconn_timeout_timer:
+	arg mem_24g_reconn_timeout,regc
+	arg g24_stop_24g_mode,regb
+	branch timer_single_step_2B
+
+
+g24_reconn_start:
+	bpatchx patch3d_0,mem_patch3d
+	set1 mark_24g,mark
+	fetch 1,mem_24g_conn_sm
+	set0 STATE_24G_PAIR,pdata
+	set1 STATE_24G_RECONN,pdata
+	store 1,mem_24g_conn_sm
+	fetch 1,mem_24g_fast_conn_enable
+	branch g24_reconn_receiver_addr,blank
+	fetch 1,mem_24g_reconn_type
+	beq FAST_CONN_AND_RECEIVER,g24_reconn_fast_conn
+	beq FAST_CONN_AND_3_0_ADDR,g24_reconn_fast_conn
+	beq RECEIVER_AND_3_0_ADDR,g24_reconn_device_3_0_addr
+	beq PAIR_AND_3_0_ADDR,g24_reconn_device_3_0_addr
+g24_reconn_fast_conn:
+	fetch 1,mem_24g_pair_tx_power
+	store 1,mem_tx_power
+	fetcht 1,mem_24g_fast_conn_temp_ch
+	storet 1,mem_24g_current_ch_number
+	fetch 4,mem_24g_fast_conn_addr
+	call g24_ch_syncword_crc8_init
+	storet 1,mem_24g_fast_conn_temp_ch
+	rtn
+	 
+g24_reconn_receiver_addr:
+	jam TX_POWER_3DB,mem_tx_power
+	fetcht 1,mem_24g_receiver_temp_ch
+	storet 1,mem_24g_current_ch_number
+	fetch 4,mem_24g_receiver_addr
+	call g24_ch_syncword_crc8_init
+	storet 1,mem_24g_receiver_temp_ch
+	rtn
+
+g24_reconn_device_3_0_addr:
+	jam TX_POWER_3DB,mem_tx_power
+	fetcht 1,mem_24g_device_temp_ch
+	storet 1,mem_24g_current_ch_number
+	fetch 4,mem_24g_device_addr
+	call g24_ch_syncword_crc8_init
+	storet 1,mem_24g_device_temp_ch
+	rtn	
+
+g24_store_receiver_addr:
+	fetch 4,mem_24g_rxpayload+2
+	store 4,mem_24g_receiver_addr	
+g24_ch_syncword_crc8_init:	
+	call g24_update_addr_and_synccrc8
+	branch g24_ch
+
+
+g24_reconn_dispatch:
+	bpatchx patch3d_1,mem_patch3d
+	call g24_reconn_data_prep
+	call g24_transmit_receive_ack
+	nbranch g24_reconn_device_fail,sync
+	nbranch g24_reconn_device_fail,user3
+	call g24_ackpayload_parse
+g24_reconn_receiver_succ:
+	fetch 1,mem_24g_conn_sm
+	set0 STATE_24G_RECONN,pdata
+	store 1,mem_24g_conn_sm
+	setarg 0
+	store 2,mem_24g_pair_timeout
+	store 2,mem_24g_reconn_count
+	store 2,mem_24g_reconn_timeout	
+	fetch 4,mem_24g_pair_addr
+	fetcht 4,mem_24g_addr
+	isub temp,null
+	branch g24_pair_start,zero
+	fetch 4,mem_24g_device_addr
+	fetcht 4,mem_24g_addr
+	isub temp,null
+	call g24_store_receiver_addr,zero
+	jam BT_EVT_24G_ATTEMPT_SUCCESS,mem_fifo_temp
+	call ui_ipc_send_event
+g24_txbuf_clear:
+	arg 4,loopcnt
+	arg mem_24g_txbuf,contw
+	branch memset0
+
+g24_reconn_data_prep:
+	jam DATATYPE_ATTEMP,mem_24g_txbuf
+	fetch 1,mem_24g_data_type
+	store 1,mem_24g_txbuf+1
+	fetch 4,mem_24g_device_addr
+	store 4,mem_24g_txbuf+2
+	jam 6,mem_24g_datalen
+	branch g24_transmit_prep
+
+g24_reconn_device_fail:
+	fetch 1,mem_24g_fast_conn_enable
+	branch g24_ch,blank
+	fetch 2,mem_24g_reconn_count
+	increase 1,pdata
+	store 2,mem_24g_reconn_count
+	isolate1 3,pdata	// each 8 times switch
+	fetch 1,mem_24g_reconn_type
+	beq FAST_CONN_AND_RECEIVER,g24_reconn_fast_conn_and_receiver
+	beq FAST_CONN_AND_3_0_ADDR,g24_reconn_fast_conn_and_3_0
+	beq RECEIVER_AND_3_0_ADDR,g24_reconn_receiver_and_3_0
+	beq PAIR_AND_3_0_ADDR,g24_reconn_pair_and_3_0
+	branch g24_reconn_receiver_addr
+
+
+g24_reconn_fast_conn_and_receiver:
+	branch g24_reconn_receiver_addr,true
+	branch g24_reconn_fast_conn
+
+g24_reconn_fast_conn_and_3_0:
+	branch g24_reconn_device_3_0_addr,true
+	branch g24_reconn_fast_conn
+	
+g24_reconn_receiver_and_3_0:
+	branch g24_reconn_device_3_0_addr,true
+	branch g24_reconn_receiver_addr
+
+g24_reconn_pair_and_3_0:
+	branch g24_pair_init_param,true
+	branch g24_reconn_device_3_0_addr
+
+
+/****************************g24 reconn transmitter end********************************/
+
+
+
+
+
+/****************************g24 reconn receiver start********************************/
+
+g24_data_attemp:
+	fetch 1,mem_24g_rxdata_temp+3
+	beq DATATYPE_DEVICE1,g24_data_attemp_device1
+	beq DATATYPE_DEVICE2,g24_data_attemp_device2
+	rtn
+g24_data_attemp_device1:
+	call enable_user
+	fetch 4,mem_24g_rxdata_temp+4
+	store 4,mem_24g_transmitter_addr
+g24_store_device1_addr:
+	store 4,mem_24g_device1_addr
+	rtn
+g24_data_attemp_device2:
+	call enable_user
+	fetch 4,mem_24g_rxdata_temp+4
+	store 4,mem_24g_transmitter_addr	
+g24_store_device2_addr:
+	store 4,mem_24g_device2_addr
+	rtn
+
+/****************************g24 reconn receiver end********************************/
+
+
+
+
Index: program/g24_protocol_stack/24g_rssi.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_rssi.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_rssi.prog	(working copy)
@@ -0,0 +1,109 @@
+
+/****************************g24 rssi general start********************************/
+
+rssi_store:
+	copy rega,pdata
+	iadd temp,contw
+	fetch 1,mem_rssi
+	istore 1,contw
+	increase 1,temp
+	fetch 1,mem_rssi_buff_index	//buff len minus 1
+	iand temp,temp
+	rtn
+rssi_average:
+	fetch 1,mem_rssi_buff_index
+	increase 1,pdata
+	store 2,mem_loopcnt
+	copy pdata,loopcnt
+	copy rega,contr
+	arg 0,pdata
+rssi_average_loop:
+	ifetcht 1,contr
+	iadd temp,pdata
+	loop rssi_average_loop
+	fetcht 2,mem_loopcnt
+	idiv temp
+	call wait_div_end
+	quotient temp
+	rtnmark1 mark_24g_rxmode
+	copy temp,pdata
+	rtnmark0 mark_24g
+	call bcd
+	copy pdata,temp
+	rtn
+
+save_rssi_dec:
+	call save_rssi
+	branch rssi_hex2dec
+
+/****************************g24 rssi general end********************************/
+
+
+
+
+
+/****************************g24 transmitter rssi start********************************/
+rssi_transmitter_buff_init:
+	fetch 2,mem_rssi_signal_buf_ptr
+	branch rssi_buff_clear
+
+rssi_signal:
+	copy pdata,rega
+	fetcht 1,mem_rssi_signal_index
+	fetch 2,mem_rssi_signal_buf_ptr
+	iadd temp,contw
+	copy rega,pdata
+	istore 1,contw
+	increase 1,temp
+	fetch 1,mem_rssi_buff_index	//buff len minus 1
+	iand temp,temp
+	storet 1,mem_rssi_signal_index
+	rtn
+
+/****************************g24 transmitter rssi end********************************/
+
+
+
+
+
+/****************************g24 receiver rssi start********************************/
+
+rssi_receiver_buff_init:
+	fetch 2,mem_rssi_noise_buffer_ptr
+	call rssi_buff_clear
+	fetch 2,mem_rssi_noise_self_buffer_ptr
+	call rssi_buff_clear
+	fetch 2,mem_rssi_noise_device1_buffer_ptr
+	call rssi_buff_clear
+	fetch 2,mem_rssi_noise_device2_buffer_ptr
+rssi_buff_clear:
+	rtn blank
+	copy pdata,contw
+	fetch 1,mem_rssi_buff_index
+	increase 1,pdata
+	copy pdata,loopcnt
+	branch clear_mem
+
+
+rssi_noise:
+	call save_rssi_dec
+	rtn blank
+	fetcht 1,mem_rssi_noise_index
+	fetchr rega,2,mem_rssi_noise_buffer_ptr
+	call rssi_store
+	storet 1,mem_rssi_noise_index
+	rtn
+
+
+rssi_noise_monitor:
+	fetchr rega,2,mem_rssi_noise_buffer_ptr
+	call rssi_average
+	storet 1,mem_rssi_noise_avg
+	sub temp,RSSI_THRESH_NOISE,null
+	nrtn positive
+	branch g24_ch
+
+
+/****************************g24 receiver rssi end********************************/
+
+	
Index: program/g24_protocol_stack/24g_transmitter.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_transmitter.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_transmitter.prog	(working copy)
@@ -0,0 +1,380 @@
+
+
+g24_transmit_init:
+	fetch 4,mem_lap		//need to roll this address
+	store 4,mem_24g_device_addr
+	call g24_rx_window_init
+	branch rssi_transmitter_buff_init
+
+g24_interval_param_4ms:
+	setarg G24_4MS_INTERVAL_PARAM
+	store 3,mem_24g_short_sleep_set
+	setarg 0x100c0c
+	store 3,mem_24g_interval
+	setarg 0x00bb80
+	store 3,mem_24g_long_sleep_set
+	jam 5,mem_24g_fast_hop_count
+	rtn
+
+g24_interval_param_8ms:
+	setarg G24_8MS_INTERVAL_PARAM
+	store 3,mem_24g_short_sleep_set
+	setarg 0x1c1919
+	store 3,mem_24g_interval
+	setarg 0x017700
+	store 3,mem_24g_long_sleep_set
+	jam 11,mem_24g_fast_hop_count
+	rtn
+
+
+g24_transmit_dispatch:
+	rtnmark0 mark_24g
+	fetch 1,mem_24g_conn_sm
+	bbit1 STATE_24G_PAIR,g24_pair_dispatch
+	bbit1 STATE_24G_RECONN,g24_reconn_dispatch
+	fetch 1,mem_24g_transmit_by_interrupt
+	beq G24_TX_TIMER_INT_ENABLE,g24_transmit_by_interrupt
+g24_transmit_no_interrupt:
+	bpatchx patch3d_2,mem_patch3d
+	call g24_txdata_prep
+	nbranch g24_nodata_transmit,user
+g24_transmit_start:
+	call g24_transmit_process
+	call power_ctrl_start
+	fetch 1,mem_device_option
+	beq dvc_op_mouse,mouse_24g_transmit_start
+g24_transmit_start_next:	
+	fetch 8,mem_24g_long_sleep_set
+	store 8,mem_24g_enter_hibernate
+	fetch 2,mem_24g_long_sleep_param_update_timer_init
+	store 2,mem_24g_long_sleep_param_update_timer
+g24_short_sleep:
+	call g24_lpm_wait
+	nrtn user
+	call clear_wake
+	fetch 3,mem_24g_short_sleep_set
+	branch lpm_dispatch_sleep
+
+
+
+
+/****************************g24 transmitter data prep start********************************/
+
+g24_txdata_prep:
+	call g24_package_data
+	nrtn user
+	branch g24_transmit_prep
+
+
+g24_package_data:
+	fetch 2,mem_cb_24g_transmit_data
+	call callback_func
+	branch g24_accumulate_data,user
+	fetch 7,mem_24g_txbuf+1	//mouse data
+	rtn blank
+	branch enable_user	// retransmit
+	
+g24_accumulate_data:
+	jam 0,mem_24g_abort_pac
+	add rega,1,pdata
+	store 1,mem_24g_datalen
+	call g24_transmit_rf_ctrl_clear
+	store 1,mem_24g_txbuf
+	copy regb,contr
+	copy rega,loopcnt
+	branch memcpy
+
+g24_transmit_rf_ctrl_clear:	
+	fetch 1,mem_24g_data_type
+	and_into bits_data,pdata
+	store 1,mem_24g_data_type
+	rtn
+
+/****************************g24 transmitter data prep end********************************/
+
+
+
+
+/****************************g24 transmitter data transmit start********************************/
+
+g24_transmit_process:
+	jam 0,mem_24g_retry
+g24_transmit_loop:
+	fetchr timeup,2,mem_param_rx_setup
+	until clkn_rt,meet
+	call g24_transmit_receive_ack
+	fetch 1,mem_24g_no_ack	//tx noack
+	beq no_ack_24g,g24_transmit_no_ack
+	nbranch g24_retransmit,sync
+	nbranch g24_retransmit,user3
+	call g24_ackpayload_parse
+	fetch 1,mem_device_option
+	beq dvc_op_mouse,mouse_wakeup_24g
+g24_transmit_no_ack:
+	call power_ctrl_pac_succ_incrs
+g24_transmit_next_packet:
+	call g24_txbuf_clear
+	fetch 1,mem_24g_pid
+	increase 1,pdata
+	store 1,mem_24g_pid
+	call g24_hop_enable_packet
+g24_transmit_abandon:
+	setarg 0
+	store 1,mem_24g_ensure
+	store 2,mem_24g_txfail_cnt
+	rtn
+
+g24_transmit_receive_ack:
+	disable user3
+	call g24_transmit
+	fetch 1,mem_24g_no_ack
+	beq no_ack_24g,g24_end_of_packet
+	force 0,radio_ctrl
+	fetch 4,mem_24g_addr
+	iforce access
+	call calc_mod_value_scale_le	
+	fetcht 1,mem_last_freq
+	call set_freq_rx
+	call rf_rx_enable
+	call g24_receive_rxon
+	call g24_end_of_packet,user3
+	rtn
+
+g24_retransmit:
+	fetch 1,mem_24g_abort_pac
+	nrtn blank
+	fetch 2,mem_24g_txfail_cnt
+	increase 1,pdata
+	store 2,mem_24g_txfail_cnt	
+	fetch 1,mem_24g_txfail_cnt+1
+	bbit1 4,g24_tx_attempt_fail
+	call g24_transmit_hop_process
+	branch g24_transmit_loop
+
+
+g24_ackpayload_parse:
+	call g24_read_len_pid_crc
+	fetch 1,mem_24g_rxdata_length	//ack payload length 
+	rtn blank
+	iforce loopcnt
+	arg mem_24g_rxbuf+2,contr
+	arg mem_24g_rxpayload,contw	//ack payload buffer 
+	branch memcpy
+
+
+g24_tx_attempt_fail:
+	setarg 0
+	store 2,mem_24g_txfail_cnt
+	jam 1,mem_24g_attempt_fail_flag
+g24_stop_24g_mode:	
+	jam BT_EVT_24G_ATTEMPT_FAIL,mem_fifo_temp
+	branch ui_ipc_send_event
+
+/****************************g24 transmitter data transmit end********************************/
+
+
+
+
+
+/****************************g24 transmitter hop start********************************/
+
+g24_transmit_hop_process:
+	bpatchx patch3d_3,mem_patch3d
+	fetcht 1,mem_24g_retry
+	fetch 1,mem_24g_fast_hop_count			// 125Hz=11  250Hz=5
+	isub temp,null
+	nbranch g24_tx_fast_hop,positive		// >= (6+6)or(3+3) hop fast    fail packet count >= 2
+	increase 1,temp
+	storet 1,mem_24g_retry
+	fetch 1,mem_24g_fast_hop_count
+	beq 5,g24_transmit_hop_process_4ms
+	fetch 1,mem_24g_retry
+	beq 6,g24_hop_ch_disable
+	beq 12,g24_hop_ch_disable
+	rtn	
+
+
+g24_transmit_hop_process_4ms:
+	fetch 1,mem_24g_retry
+	beq 3,g24_hop_ch_disable
+	beq 6,g24_hop_ch_disable
+	rtn	
+
+
+
+g24_hop_ch_enable:
+	//fetch 1,mem_24g_data_type
+	//set1 bit_hop,pdata
+	//store 1,mem_24g_data_type
+	//update txpayload
+g24_txpayload_type_update:	
+	bmark1 mark_ble_lr,g24_lr_type_update
+	store 1,mem_24g_txpayload+OFFSET_DATA_TYPE
+	rtn
+g24_lr_type_update:
+	store 1,mem_24g_txpayload+OFFSET_LR_DATA_TYPE
+	rtn
+
+g24_hop_enable_packet:
+	fetch 1,mem_24g_data_type
+	rtnbit0 bit_hop
+g24_hop_ch_disable:
+	fetch 1,mem_24g_data_type
+	set0 bit_hop,pdata
+	store 1,mem_24g_data_type
+	call g24_txpayload_type_update
+	call power_ctrl_pac_succ_decrs
+	branch g24_ch
+
+g24_tx_fast_hop:
+	call power_ctrl_txpower_incrs
+	call power_ctrl_pac_succ_decrs
+	branch g24_ch
+	
+/****************************g24 transmitter hop end********************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+/****************************g24 transmitter long lpm prep start********************************/
+
+g24_search_receiver:
+	fetch 2,mem_cb_24g_search_receiver
+	branch callback_func
+
+g24_nodata_transmit:
+	fetch 1,mem_24g_abort_pac
+	call g24_send_abort_packet,blank
+	fetch 1,mem_24g_transmit_by_interrupt
+	rtneq G24_TX_TIMER_INT_ENABLE
+	call g24_search_receiver
+	branch g24_long_sleep
+
+g24_send_abort_packet:
+	jam TYPE_MS,mem_24g_data_type
+	jam 1,mem_24g_abort_pac
+	call g24_transmit_rf_ctrl_clear
+	store 1,mem_24g_txbuf
+	setarg 0
+	store 7,mem_24g_txbuf+1
+	fetch 4,mem_24g_device_addr
+	store 4,mem_24g_txbuf+8
+	jam 12,mem_24g_datalen
+	fetch 1,mem_24g_data_type
+	set1 bit_abort,pdata
+	store 1,mem_24g_data_type
+	call g24_transmit_prep
+	branch g24_transmit_start
+	
+g24_long_sleep:
+	call g24_lpm_wait
+	nrtn user
+	fetch 8,mem_24g_enter_hibernate
+g24_long_sleep2:
+	call clk2lpo
+	storet 4,mem_sleep_counter
+	branch lpm_sleep
+
+g24_lpm_wait:
+	bpatchx patch3d_4,mem_patch3d
+	enable user
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	branch disable_user,blank
+	fetch 1,mem_lpm_mode
+	branch disable_user,blank
+	fetch 1,mem_24g_transmit_by_interrupt
+	beq G24_TX_TIMER_INT_ENABLE,disable_user
+g24_setgpio_lpm_before:
+	fetch 2,mem_cb_24g_lpm_before
+	branch callback_func
+
+
+/****************************g24 transmitter long lpm prep end********************************/
+
+
+
+
+
+
+
+/****************************g24 transmit by interrupt start********************************/
+
+g24_transmit_by_interrupt:
+	call g24_timer_check
+	nrtn user
+	call g24_interval_calibrate
+	fetch 2,mem_24g_transmit_by_interrupt_exit_count
+	increase 1,pdata
+	store 2,mem_24g_transmit_by_interrupt_exit_count
+	fetcht 2,mem_24g_transmit_by_interrupt_exit_count_init
+	isub temp,null
+	call g24_transmit_by_interrupt_exit,zero
+	branch g24_transmit_no_interrupt
+
+	
+g24_transmit_by_interrupt_exit:
+	jam G24_TX_TIMER_INT_DISABLE,mem_24g_transmit_by_interrupt
+	setarg 0
+	store 2,mem_24g_transmit_by_interrupt_exit_count
+	setarg 100
+	store 2,mem_24g_transmit_by_interrupt_exit_count_init
+g24_interval_min:
+	jam 0,mem_24g_pac_index
+	fetch 1,mem_24g_interval_min
+g24_interval_store:
+	store 1,mem_24g_interval
+	rtn
+g24_interval_max:
+	fetch 1,mem_24g_interval_max
+	branch g24_interval_store
+	
+g24_interval_calibrate:
+	fetch 1,mem_24g_pac_index
+	increase 1,pdata
+	store 1,mem_24g_pac_index
+	beq 4,g24_interval_max
+	beq 5,g24_interval_min
+	rtn
+
+g24_transmit_by_interrupt_enable:
+	jam G24_TX_TIMER_INT_ENABLE,mem_24g_transmit_by_interrupt
+	setarg 0
+	store 2,mem_24g_transmit_by_interrupt_exit_count
+	rtn
+
+
+/****************************g24 transmit by interrupt end********************************/
+
+
+
+
+/****************************g24 transmitter fac check start********************************/
+
+g24_factory_check:
+	arg 2,loopcnt
+	arg mem_24g_addr,contr
+pdata_0xff_check:
+	call enable_user
+	setarg 0xffff
+pdata_0xff_check_loop:
+	ifetcht 2,contr
+	isub temp,null
+	ncall disable_user,zero
+	loop pdata_0xff_check_loop
+	rtn
+
+/****************************g24 transmitter fac check end********************************/
+
+
+
+	
Index: program/g24_protocol_stack/24g_txpower_ctrl.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_txpower_ctrl.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/g24_protocol_stack/24g_txpower_ctrl.prog	(working copy)
@@ -0,0 +1,95 @@
+
+/****************************g24 transmitter tx power start********************************/
+
+power_ctrl_start:
+	bpatchx patch3d_5,mem_patch3d
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_ADV
+	rtnbit1 UI_STATE_BT_RECONNECT
+	rtnbit1 UI_STATE_BT_DISCOVERY
+	fetchr rega,2,mem_rssi_signal_buf_ptr
+	call rssi_average
+	storet 1,mem_rssi_avg_received
+	fetch 1,mem_rssi_dis_max_24g
+	bmark1 mark_24g,power_ctrl_start_next
+	fetch 1,mem_rssi_dis_max_ble
+power_ctrl_start_next:
+	isub temp,null
+	nbranch power_ctrl_txpower_incrs_force,positive
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	sub pdata,2,null
+	nbranch power_ctrl_txpower_decrs_check,positive
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	beq 0,power_ctrl_txpower_incrs
+	rtn
+
+power_ctrl_txpower_decrs_check:
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	fetcht 1,mem_power_ctrl_pac_succ_cnt_init
+	isub temp,null
+	nrtn zero
+	jam 0,mem_power_ctrl_pac_succ_cnt
+power_ctrl_txpower_decrs:
+	fetcht 1,mem_rssi_avg_received
+	fetch 1,mem_rssi_dis_min_24g
+	bmark1 mark_24g,power_ctrl_txpower_decrs_next
+	fetch 1,mem_rssi_dis_min_ble
+power_ctrl_txpower_decrs_next:	
+	isub temp,null
+	nrtn positive
+	fetch 1,mem_power_ctrl_level
+	beq 0,power_ctrl_decrs_level0
+	increase -1,pdata
+	store 1,mem_power_ctrl_level
+	beq 0,power_ctrl_decrs_level0
+power_ctrl_decrs_level1:
+power_ctrl_incrs_level1:	//0dBm
+	jam TX_POWER_0DB,mem_tx_power
+	rtn
+
+power_ctrl_txpower_incrs_force:
+	jam 0,mem_power_ctrl_pac_succ_cnt
+power_ctrl_txpower_incrs:
+	fetch 1,mem_power_ctrl_level
+	beq 2,power_ctrl_incrs_level2
+	increase 1,pdata
+	store 1,mem_power_ctrl_level
+	beq 1,power_ctrl_incrs_level1
+power_ctrl_incrs_level2:	//+6dBm
+	jam TX_POWER_6DB,mem_tx_power
+	rtn
+	
+power_ctrl_decrs_level0: //-5dBm
+	jam TX_POWER_f5DB,mem_tx_power
+	rtn
+
+power_ctrl_pac_succ_cnt_init:
+	jam 1,mem_power_ctrl_level
+	jam 0,mem_power_ctrl_pac_succ_cnt
+	rtn
+
+power_ctrl_pac_succ_incrs:
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	increase 1,pdata
+	store 1,mem_power_ctrl_pac_succ_cnt
+	rtn
+
+power_ctrl_pac_succ_decrs:
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	sub pdata,2,null
+	ncall power_ctrl_pac_succ_cnt_reinit,positive
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	rtneq 0
+	increase -1,pdata
+	store 1,mem_power_ctrl_pac_succ_cnt
+	rtn
+
+power_ctrl_pac_succ_cnt_reinit:
+	jam 3,mem_power_ctrl_pac_succ_cnt
+	rtn
+
+/****************************g24 transmitter tx power end********************************/
+
+
+
+
Index: program/hci_main.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/hci_main.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/hci_main.prog	(working copy)
@@ -0,0 +1,320 @@
+/*********************************/
+/**********   HCI  *****************/
+/*********************************/
+
+hci_init:
+	clear_stack		//清空堆栈
+	call hci_init_clksel
+	call hci_init_uart_default_config
+	call hci_init_uart_config
+	call hci_init_pwm_default_config
+	call hci_init_pwm
+
+	jam 1,mem_hci_command_complete_num_hci_command_packet
+	jam HCI_H4_TYPE_EVENT,mem_hci_event_head_type
+
+hci_process_loop:
+	call hci_process_check_uart_rx
+	branch hci_process_loop
+
+
+hci_init_clksel:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_HCI_BOOT_CLKSEL
+	bbit1 7,hci_init_clksel_xtal
+hci_init_clksel_dpll:
+	jam 0xff,core_clkpll_ctrl1
+	nop 100
+	jam 0x0e,core_clkpll_ctrl2
+	jam 0x03,core_clkpll_ctrl0
+	jam clksel_dpll,core_clksel
+	rtn
+	
+hci_init_clksel_xtal:
+	jam clksel_xtal,core_clksel
+	rtn
+
+hci_init_uart_default_config:
+	call hci_init_uart_default_config_tx
+	call hci_init_uart_default_config_rx
+	call hci_init_uart_default_config_rts
+	branch hci_init_uart_default_config_cts
+
+hci_init_uart_default_config_tx:
+	fetch 1,mem_hci_uart_tx_gpio
+	nrtn blank
+	jam HCI_UART_TX_GPIO_NUM,mem_hci_uart_tx_gpio
+	rtn	
+
+hci_init_uart_default_config_rx:
+	fetch 1,mem_hci_uart_rx_gpio
+	nrtn blank
+	jam HCI_UART_RX_GPIO_NUM,mem_hci_uart_rx_gpio
+	rtn	
+hci_init_uart_default_config_rts:
+	fetch 1,mem_hci_uart_rts_gpio
+	nrtn blank
+	jam HCI_UART_RTS_GPIO_NUM,mem_hci_uart_rts_gpio
+	rtn	
+hci_init_uart_default_config_cts:
+	fetch 1,mem_hci_uart_cts_gpio
+	nrtn blank
+	jam HCI_UART_CTS_GPIO_NUM,mem_hci_uart_cts_gpio
+	rtn	
+
+
+hci_init_uart_config:
+	setarg mem_h5rx_buf
+	store 2,mem_pdatatemp
+	setarg mem_h5rx_buf_end
+	istore 2,contw
+	setarg mem_h5tx_buf
+	istore 2,contw
+	setarg mem_h5tx_buf_end
+	istore 2,contw	
+	fetch 8,mem_pdatatemp
+	call uarta_init_dma_mem
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_HCI_BOOT_CLKSEL
+	isolate1 7,pdata
+	call uart_clock_select_main_freq_crystal,true
+	ncall uart_clock_select_main_freq_dpll,true
+	arg 115200,temp
+	call uarta_calc_baud_rate_config
+	fetch 1,mem_hci_uart_tx_gpio
+	arg gpcfg_uart_txd,temp
+	call gpio_config_function_int
+	fetch 1,mem_hci_uart_rx_gpio
+	arg gpcfg_uart_rxd|gpcfg_pullup,temp
+	call gpio_config_function_int
+	fetch 1,mem_hci_uart_rts_gpio
+	arg gpcfg_uart_rts,temp
+	call gpio_config_function_int
+	fetch 1,mem_hci_uart_cts_gpio
+	arg gpcfg_uart_cts,temp
+	call gpio_config_function_int
+
+	arg FUN_UART_CONTROL_ENABLE|FUN_UART_CONTROL_SETTING_RATE_BAUD,temp
+	storet 1,core_uart_ctrl
+	branch clean_mem
+
+hci_init_pwm_default_config:
+	fetch 1,mem_hci_pwm_12mhz_gpio
+	nrtn blank
+	jam HCI_PMW_12MHZ_GPIO_NUM,mem_hci_pwm_12mhz_gpio
+	rtn	
+
+hci_init_pwm:
+	fetch 1,mem_hci_pwm_12mhz_gpio
+	arg gpcfg_pwm_out0,temp
+	call gpio_config_function_int
+	arg 0x40,rega
+	call pwm_init
+	arg 0,rega
+	arg 0,regb
+	setarg 0
+	call pwm_duty_cycle_set
+	arg 0,queue
+	branch pwm_set_select
+
+
+hci_process_check_uart_rx:
+	fetch 2,core_uart_rxitems
+	add pdata,-4,rega
+	nrtn positive
+	call uarta_prepare_rx
+	ifetch 1,contru
+	beq HCI_H4_TYPE_CMD,hci_parse_packet_cmd
+//	beq HCI_H4_TYPE_ACL,hci_parse_packet_acl
+	call delay_10ms
+	branch uarta_clear_current_rx
+
+//hci_parse_packet_acl:
+//	rtn
+hci_parse_packet_cmd:
+	ifetch 2,contru	// Opcode
+	store 2,mem_hci_opcode
+	arg 0x3ff,temp
+	iand temp,temp	//low 10bit
+	storet 2,mem_hci_opcode_ocf
+	rshift2 pdata,pdata
+	rshift8 pdata,pdata	//high 6bit
+	store 1,mem_hci_opcode_ogf
+	ifetch 1,contru	// parameter total length
+	pincrease -1		//大于等于
+	isub rega,null
+	rtn positive
+	call hci_parse_complete_packet
+	branch hci_drop_current_packet
+
+hci_parse_complete_packet:
+	fetch 1,mem_hci_opcode_ogf
+//	beq HCI_OGF_LINK_CONTROL,hci_parse_packet_cmd_ogf_link_control
+//	beq HCI_OGF_LINK_POLICY,hci_parse_packet_cmd_ogf_link_policy
+//	beq HCI_OGF_CONTROLLER_AND_BASEBAND,hci_parse_packet_cmd_ogf_controller_and_baseband
+//	beq HCI_OGF_INFOMATIONAL_PARAM,hci_parse_packet_cmd_ogf_infomational_parameters
+//	beq HCI_OGF_STATUS_PARAM,hci_parse_packet_cmd_ogf_status_parameters
+//	beq HCI_OGF_TEST,hci_parse_packet_cmd_ogf_testing
+//	beq HCI_OGF_LE_CONTROLLER,hci_parse_packet_cmd_ogf_le_controller
+	beq HCI_OGF_VENDOR_SPECIFIC_DEBUG,hci_parse_packet_cmd_ogf_vendorspecific_debug
+	branch hci_send_event_command_complete_error_command_nuknown
+
+//hci_parse_packet_cmd_ogf_link_control:
+//hci_parse_packet_cmd_ogf_link_policy:
+//hci_parse_packet_cmd_ogf_controller_and_baseband:
+//hci_parse_packet_cmd_ogf_infomational_parameters:
+//hci_parse_packet_cmd_ogf_status_parameters:
+//hci_parse_packet_cmd_ogf_testing:
+//hci_parse_packet_cmd_ogf_le_controller:
+
+hci_parse_packet_cmd_ogf_vendorspecific_debug:
+	bpatch patch1c_7,mem_patch1c
+	fetch 1,mem_hci_opcode_ocf
+	beq HCI_VENDOR_CMD_RESET,hci_normal_reply
+	beq HCI_VENDOR_CMD_CHIPID,phci_grp_vendor_chipid
+	beq HCI_VENDOR_CMD_BAUD,phci_grp_vendor_baud
+	beq HCI_VENDOR_CMD_PATCH,phci_grp_vendor_patch
+	beq HCI_VENDOR_CMD_PATCH_DONE,phci_grp_vendor_done
+	beq HCI_VENDOR_CMD_ECHO,hci_normal_reply
+	beq HCI_VENDOR_CMD_MEM,phci_grp_vendor_mem
+	beq HCI_VENDOR_CMD_SET_FLOW_CONTROL,phci_grp_vendor_flow_control
+	branch hci_normal_reply
+
+	
+phci_grp_vendor_chipid:
+	jam COMMAND_SUCCEEDED,mem_hci_command_complete_return_parameter
+	fetch 2,core_chipid
+	store 2,mem_hci_command_complete_return_parameter_chip_id
+	arg 3,loopcnt
+	branch hci_send_event_command_complete
+	
+phci_grp_vendor_baud:
+	ifetch 2,contu
+	store 2,core_uart_baud
+	rtn
+
+
+phci_grp_vendor_patch_common:
+	ifetch 1,contu
+	copy pdata,temp //check sum via temp
+	store 1,core_ucode_low
+	ifetch 1,contu
+	iadd temp,temp
+	set1 7,pdata
+	store 1,core_ucode_ctrl
+	ifetch 1,contu
+	iadd temp,temp
+	copy pdata,loopcnt
+	rtn
+	
+phci_grp_vendor_patch:
+	call phci_grp_vendor_patch_common
+phci_grp_vendor_patch_loop:
+	ifetch 1,contu
+	store 1,core_ucode_data
+	iadd temp,temp
+	loop phci_grp_vendor_patch_loop
+phci_grp_vendor_patch_check_sum:	
+	and temp,0xff,temp
+	ifetch 1,contu
+	isub temp,null
+	nbranch phci_grp_vendor_patch_bad,zero
+	branch hci_normal_reply
+
+phci_grp_vendor_done:
+	arg 0x20,loopcnt    //patch switch length
+	arg mem_patch00,contw
+	arg 0,temp //checksum
+phci_grp_vendor_done_loop:
+	ifetch 1,contu
+	istore 1,contw
+	iadd temp,temp
+	loop phci_grp_vendor_done_loop
+	and temp,0xff,temp
+	ifetch 1,contu
+	isub temp,null
+	nbranch phci_grp_vendor_patch_bad,zero
+	jam 0,core_ucode_ctrl
+	call hci_normal_reply
+	call wait_uarttx
+	branch soft_reset
+
+phci_grp_vendor_patch_bad:
+	jam 0,core_ucode_ctrl
+	branch hci_send_event_command_complete_error_command_nuknown
+	
+
+phci_grp_vendor_mem:
+	ifetch 1,contu
+	copy pdata,loopcnt
+	ifetch 2,contu
+	copy pdata,contw
+	call uart_copy_rx_bytes
+	branch hci_normal_reply
+
+phci_grp_vendor_flow_control:
+	fetch 1,core_uart_ctrl
+	set1 BIT_UART_CONTROL_FLOW_CONTROL,pdata
+	store 1,core_uart_ctrl
+	branch hci_normal_reply
+
+	
+hci_normal_reply:
+	branch hci_send_event_command_complete_without_payload
+
+hci_send_event_command_complete_error_command_nuknown:
+	jam COMMAND_UNKNOWN,mem_hci_command_complete_return_parameter
+	branch hci_send_event_command_complete_without_payload+1
+hci_send_event_command_complete_error_command_disallowed:
+	jam COMMAND_DISALLOWED,mem_hci_command_complete_return_parameter
+	branch hci_send_event_command_complete_without_payload+1
+hci_send_event_command_complete_without_payload:
+	jam COMMAND_SUCCEEDED,mem_hci_command_complete_return_parameter
+	arg 1,loopcnt
+	branch hci_send_event_command_complete
+
+/***************
+function:send command complete event to host
+input:
+mem_mesh_command_complete_num_hci_command_packet:
+Num Hci Command Packet Commonly used 1
+mem_mesh_hci_opcode:command opcode ,OCF & OGF
+loopcnt:return parameters data length
+mem_mesh_command_complete_return_parameter
+:return parameters data point
+***************/
+hci_send_event_command_complete:
+	jam HCI_EVENT_COMMAND_COMPLETE,mem_hci_event_head_event_code
+	add loopcnt,3,pdata
+	store 1,mem_hci_event_para_total_length
+	call hci_prepare_send_event
+	fetch 3,mem_hci_command_complete_num_hci_command_packet
+	istore 3,contwu
+//	copy rega,contr
+	arg mem_hci_command_complete_return_parameter,contr
+	call uart_copy_tx_bytes
+	branch uarta_send_register_pop
+
+//mem_mesh_event_head_event_code:event code
+//mem_mesh_event_para_total_length:parameter total length
+hci_prepare_send_event:
+	call uarta_prepare_tx_register_push
+	fetch 3,mem_hci_event_head_type
+	istore 3,contwu
+	rtn
+
+hci_drop_current_packet:
+	call uarta_prepare_rx
+	increase 3,contru
+	ifetch 1,contru
+	iadd contru,contru
+	branch uarta_rxdone
+
+cmd_exit:
+	jam 0,mem_hci_cmd
+	rtn
+
+cmd_check_plap:
+	fetch 6,mem_hci_plap
+	fetcht 6,mem_plap
+	isub temp,null
+	rtn
+
Index: program/hid.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/hid.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/hid.prog	(working copy)
@@ -0,0 +1,89 @@
+/**
+* the following API is to send the HID data
+* 
+*/
+
+/**
+* the following API is to process the hid  rx data
+* 
+*/
+//handle the hid data
+
+hid_rx_process:
+	bpatch patch1d_0,mem_patch1d
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	ifetch 1,contr
+	store 1,mem_l2cap_rcv_hidtype
+	and pdata,0x0f,temp
+	rshift4 pdata,pdata //hidtype
+	beq hid_type_set_idle,hid_rx_process_handshake
+	beq hid_type_set_protocol,hid_rx_process_handshake
+	beq hid_type_data,hid_rx_process_data
+	beq HID_TYPE_SET_REPORT,hid_rx_process_set_report
+	beq HID_TYPE_CONTROL,hid_rx_process_hid_control
+	rtn
+
+hid_rx_process_hid_control:
+	copy temp,pdata
+	beq HID_CONTROL_P_VIRTUALCABLEUNPLUG,hid_rx_process_virtual_cable_unplug
+	beq HID_CONTROL_P_SUSPEND,hid_rx_process_suspend
+	rtn
+	
+hid_rx_process_virtual_cable_unplug:
+	jam BT_EVT_VIRTUAL_CABLE_UNPLUG,mem_fifo_temp
+	call ui_ipc_send_event
+	fetch 1,mem_device_option
+	rtnne dvc_op_mouse
+	copy temp,pdata
+	beq HID_CONTROL_P_VIRTUALCABLEUNPLUG,mouse_irtual_cable_unplug
+	rtn
+hid_rx_process_suspend:
+	rtn
+
+hid_rx_process_set_report:
+	call hid_rx_process_data
+	arg 0x01,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_ctrl_remote_cid
+	istore 2,contw
+	setarg 0x00
+	istore 1,contw
+	rtn
+
+hid_rx_process_handshake:
+	arg 1,rega//payload length
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_ctrl_remote_cid
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	jam 1,mem_ui_data_txbuff_length
+	fetch 1,mem_hid_control_state
+	set1 l2cap_channel_hid_handshake_done,pdata
+	store 1,mem_hid_control_state
+	jam BT_EVT_HID_HANDSHAKE,mem_fifo_temp
+	call ui_ipc_send_event
+	fetch 1,mem_device_option
+	rtnne dvc_op_mouse
+	branch mouse_bt_hid_handshake_boot_check
+	
+
+hid_rx_process_data:
+	ifetch 1,contr
+	beq HID_REPORT_ID_KB,hid_rx_process_data_hid_kb
+	rtn
+
+hid_rx_process_data_hid_kb:
+	rtn
+
+	
+hid_malloc_tx_buff:
+	call l2cap_malloc
+	copy rega,temp
+	storet 1,mem_ui_data_txbuff_length
+	copy pdata,contw
+	copy rega,pdata
+	istore 2,contw //hid payload length
+	rtn
+
Index: program/kscan_peipherals.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/kscan_peipherals.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/kscan_peipherals.prog	(working copy)
@@ -0,0 +1,152 @@
+
+
+
+ifdef COMPILE_KEYSCAN
+/****************************************key scan***************************************/
+/******the key_scan use explain******
+
+* First:call kscan_init
+* Second:call kscan_main
+* Finally: the key scanning reault is mem_kscan_value.
+
+******
+***************************************************************************************
+*/
+kscan_init:  
+	fetch 2,mem_kscan_ptr
+	copy pdata,regc
+	call kscan_row_num_select
+	branch kscan_col_num_select
+
+kscan_col_init:
+	setarg 0
+	add regc,KEYSCAN_OFFECT_SHIFT_COUNT,rega
+	istore 1,rega
+	add regc,KEYSCAN_OFFECT_COL_NUM,rega
+	ifetch 1,rega
+	branch kscan_value_init,blank
+	copy pdata,loopcnt
+	add regc,KEYSCAN_OFFECT_COL_CONF_PIN,regb
+kscan_col_loop: 
+	ifetcht 1, regb
+	call gpio_config_output
+	ifetcht 1, regb
+	call gpio_out_active
+	call kscan_value_init             
+	ifetcht 1,regb
+	call gpio_config_input
+	increase 1,regb
+	loop kscan_col_loop
+	rtn  
+kscan_row_num_select:          
+	add regc,KEYSCAN_OFFECT_ROW_NUM,contw
+	ifetch 1,contw 
+	rtn blank
+	copy pdata,loopcnt
+	add regc,KEYSCAN_OFFECT_ROW_CONF_PIN,rega
+	branch kscan_ioselect_input   
+kscan_col_num_select:           
+	add regc,KEYSCAN_OFFECT_COL_NUM,contw
+	ifetch 1,contw 
+	rtn blank
+	copy pdata,loopcnt
+	add regc,KEYSCAN_OFFECT_COL_CONF_PIN,rega
+	branch kscan_ioselect_input
+kscan_ioselect_input: 
+	ifetcht 1,rega
+	call gpio_config_input 
+	increase 1,rega
+	loop kscan_ioselect_input
+	rtn
+kscan_value_init:
+	setarg 0
+	add regc,KEYSCAN_OFFECT_ROW_COUNT,rega
+	istore 1,rega
+	add regc,KEYSCAN_OFFECT_ROW_CONF_PIN,rega
+kscan_save_vaule:
+	ifetcht 1,rega       
+	call gpio_get_bit   
+	add regc,KEYSCAN_OFFECT_VALUE_TEMP,temp
+	ifetch 2,temp
+ 	add regc,KEYSCAN_OFFECT_SHIFT_COUNT,contr
+	ifetcht 1,contr
+	copy temp,queue
+	qsetflag true,pdata
+
+	add regc,KEYSCAN_OFFECT_VALUE_TEMP,temp
+ 	istore 2,temp
+	increase 1,rega
+    
+	add regc,KEYSCAN_OFFECT_SHIFT_COUNT,contw
+	ifetch 1,contw 
+	increase 1,pdata
+	istore 1,contw
+    
+	add regc,KEYSCAN_OFFECT_ROW_COUNT,contw
+	ifetcht 1,contw 
+	increase 1,temp
+	istoret 1,contw
+	add regc,KEYSCAN_OFFECT_ROW_NUM,contw
+	ifetch 1,contw 
+	ixor temp,null  
+	nbranch kscan_save_vaule,zero
+	rtn       
+	
+	
+kscan_lpm_berfore:
+	fetch 2,mem_kscan_ptr
+	copy pdata,regc
+ 	add regc,KEYSCAN_OFFECT_ROW_NUM,contw
+ 	ifetch 1,contw 
+	copy pdata,loopcnt
+	add regc,KEYSCAN_OFFECT_COL_CONF_PIN,rega
+kscan_select_wake:    
+	ifetcht 1,rega
+	call gpio_set_wake   
+	increase 1,rega
+	loop kscan_select_wake
+	rtn
+
+kscan_clkn_bt_timer_check:
+	ifetcht 4,rega
+	copy clkn_bt,pdata
+	isub temp,null
+	rtn positive
+	setarg 0
+	istore 4,rega
+	rtn
+
+kscan_process:
+	fetch 2,mem_kscan_ptr
+	copy pdata,regc
+	add regc,KEYSCAN_OFFECT_BTCLK,rega
+	call kscan_clkn_bt_timer_check
+	ifetch 4,rega
+	add regc,KEYSCAN_OFFECT_BTCLK_INTERVAL,regb
+	ifetcht 1,regb
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	istore 4,rega
+	call kscan_col_init  
+	add regc,KEYSCAN_OFFECT_VALUE_TEMP,rega
+	ifetch 2,rega
+	add regc,KEYSCAN_OFFECT_LASVALUE,rega
+	ifetcht 2,rega
+	istore 2,rega
+	iand temp,pdata
+	add regc,KEYSCAN_OFFECT_VALUE,rega    
+	istore 2,rega 
+	rtn  
+
+endif
+	
+	
+
+
+
+	
+    
+	
+
Index: program/l2cap.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/l2cap.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/l2cap.prog	(working copy)
@@ -0,0 +1,1901 @@
+/************************************/
+/*initialize L2CAP related variables*/
+/************************************/
+l2cap_init:
+	branch l2cap_init_wake,wake
+l2cap_init_work:
+	setarg mem_l2cap_xmem_end
+	arg mem_l2cap_xmem_start,contw
+	isub contw,loopcnt
+	call clear_mem
+l2cap_init_wake:	
+	bpatch patch1d_1,mem_patch1d
+	setarg mem_sdp_mem_end
+	arg mem_sdp_mem_start,contw
+	isub contw,loopcnt
+	call clear_mem
+	setarg mem_l2cap_mem_end
+	arg mem_l2cap_mem_start,contw
+	isub contw,loopcnt
+	call clear_mem
+	branch l2cap_lpm_load_txbuf
+	
+process_rx_l2cap_pkt:
+	bpatch patch1d_2,mem_patch1d
+	copy contr,temp
+	//call l2cap_malloc_is_fifo_full
+	//nrtn blank
+	copy temp,contr
+	ifetch 2,contr
+	store 2,mem_l2cap_rx_pkt_length
+	ifetch 2,contr
+	store 2,mem_l2cap_rx_cid
+	deposit contr
+	store 2,mem_l2cap_payload_ptr
+	fetch 1,memui_reconnect_mode
+	beq NO_RECONNECTION,l2cap_rx_multiplexing
+	branch ml2cap_rx_multiplexing
+
+l2cap_rx_multiplexing:
+	fetch 2, mem_l2cap_rx_pkt_length
+	branch l2cap_rx_reset_state,blank
+	bpatch patch1d_3,mem_patch1d
+	fetch 1,mem_l2cap_rx_cid
+	beq L2CAP_signal_channel,l2cap_call_proc_signal
+l2cap_rx_multiplexing0:
+	beq L2CAP_SDP_channel,l2cap_call_proc_sdp
+	beq L2CAP_RFCOMM_channel,l2cap_call_proc_rfcomm
+	beq L2CAP_HID_Control_channel,l2cap_call_proc_hid
+	beq L2CAP_HID_Interrupt_channel,l2cap_call_proc_hid
+	branch l2cap_rx_reset_state
+
+l2cap_check_map:
+//	call l2cap_malloc_is_fifo_full
+//	nrtn blank
+	bpatch patch1d_4,mem_patch1d
+	call l2cap_malloc_get_full_map
+	fetch 1,mem_used_map
+	beq 0,set_pdata_0
+	beq 1,set_pdata_0
+	beq 2,set_pdata_0
+	beq 3,set_pdata_0
+	beq 0x81,set_pdata_0
+	beq 0xc0,set_pdata_0
+	beq 0x80,set_pdata_0
+	beq 0x40,set_pdata_0
+	rtn
+
+l2cap_call_proc_signal:
+	call l2cap_check_map
+	nrtn blank
+l2cap_call_proc_signal0:
+	call l2cap_malloc_signal_channel
+	call l2cap_process_signal_pkt
+	fetcht 2,mem_l2cap_signal_tx_length
+	branch l2cap_call_proc_no_reply,blank
+	call l2cap_get_signal_tx_buff
+	fetch 2,mem_l2cap_signal_tx_length
+	istore 2,contw
+	force L2CAP_signal_channel,pdata
+	istore 2,contw
+	branch l2cap_rx_reset_state
+	
+l2cap_call_proc_sigal_pending:
+	fetch 1,mem_l2cap_pending_item
+	rtn blank
+	copy pdata,rega
+	bpatch patch1d_5,mem_patch1d
+	fetch 4,mem_l2cap_sdpres_delay_time
+	arg 0x100,temp
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	jam 0,mem_l2cap_pending_item
+	copy rega,pdata
+	beq L2CAP_SDP_channel,l2cap_sdp_conn_succ
+	branch assert
+l2cap_sdp_conn_succ:
+	arg 0,debug
+	call l2cap_malloc_signal_channel
+	call restore_l2cap_req_param
+	call l2cap_get_signal_tx_payload
+	call save_cont_pointers
+	call send_connection_sdp_res
+	call l2cap_get_signal_tx_buff
+	//fetch 2,mem_l2cap_signal_tx_length
+	setarg 0x000c
+	istore 2,contw
+	force L2CAP_signal_channel,pdata
+	istore 2,contw
+	branch l2cap_rx_reset_state
+
+
+
+l2cap_reset_sdp_map:
+	bpatch patch1d_6,mem_patch1d
+	fetch 2,mem_sdp_tx_pkt_length
+	increase 4,pdata
+	call rshift7
+	add pdata,1,temp ///temp: how many128
+	arg mem_tx_fifo3,contr
+	ifetch 3,contr
+	rtn blank
+	store 3,mem_tx_fifo_map_temp
+	fetch 1,mem_tx_fifo_map_temp
+	copy pdata,rega
+	call check_l2cap_map
+	copy regb,pdata
+	store 1,mem_tx_fifo3
+	rtn
+
+check_l2cap_map:
+	arg 0,queue
+	arg 0,regb
+
+check_l2cap_map_loop:
+	sub queue,7,null
+	nrtn positive
+	qisolate1 rega
+	branch check_l2cap_map_used,true
+	branch check_l2cap_map_used2
+
+check_l2cap_map_used:
+	copy temp,pdata
+	branch check_l2cap_map_used2,blank
+	qset1 regb
+	increase -1,temp
+
+check_l2cap_map_used2:
+	increase 1,queue
+	branch check_l2cap_map_loop
+
+l2cap_call_proc_sdp:
+	call l2cap_malloc_is_fifo_empty
+	nrtn blank// not process this packet until fifo empty
+	call l2cap_check_map
+	nrtn blank
+	call l2cap_malloc_sdp_channel
+	call enable_authrom
+	call sdp_process
+	call disable_authrom
+	call l2cap_reset_sdp_map
+	branch l2cap_call_proc_sdp_common
+
+	
+ml2cap_call_proc_sdp:
+	call l2cap_malloc_is_fifo_empty
+	nrtn blank// not process this packet until fifo empty
+	call l2cap_malloc_sdp_channel
+	call enable_authrom
+	call sdp_process
+	call disable_authrom
+l2cap_call_proc_sdp_common:
+	call l2cap_get_sdp_tx_buff
+	fetch 2,mem_sdp_tx_pkt_length
+	branch l2cap_call_proc_no_reply,blank
+	istore 2,contw
+	fetch 2,mem_sdp_remote_cid
+	istore 2,contw
+	branch l2cap_rx_reset_state
+
+l2cap_call_proc_hid:
+	call hid_rx_process
+	branch l2cap_rx_reset_state
+
+l2cap_call_proc_rfcomm:
+	bpatch patch1d_7,mem_patch1d
+	jam RFCOMM_MALLOC_SUCCEED,mem_rfcomm_malloc_fail_flag
+	call rfcomm_rx_process
+	fetch 1,mem_rfcomm_malloc_fail_flag
+	rtneq RFCOMM_MALLOC_FAIL
+	branch l2cap_rx_reset_state
+l2cap_call_proc_no_reply:
+	call l2cap_malloc_discard
+	//fall through
+l2cap_rx_reset_state:
+	setarg 0
+	store 2,mem_l2cap_rx_pkt_length
+	store 2,mem_l2cap_rx_cid
+	jam L2CAP_RX_DONE,mem_l2cap_rx_done
+	rtn
+/* To process one L2CAP signalling pkt consisting of 1 or more signalling commands.	*/
+l2cap_process_signal_pkt:
+	bpatch patch1e_0,mem_patch1e
+	call l2cap_get_signal_tx_payload
+	force 0,regb
+	fetch 2,mem_l2cap_rx_pkt_length
+	copy pdata,regc
+	fetch 2,mem_l2cap_payload_ptr
+	iforce contr
+l2cap_process_signal_pkt_loop:
+	call l2cap_process_one_signal
+	deposit regc
+	increase -4,regc
+	increase -4,pdata
+	nbranch l2cap_process_signal_pkt_loop,blank
+	copy regb,pdata
+	store 2,mem_l2cap_signal_tx_length
+	rtn
+
+l2cap_process_one_signal:
+	bpatch patch1e_1,mem_patch1e
+	ifetch 1,contr
+	beq signal_cmd_reject,l2cap_proc_signal_cmd_reject
+	beq signal_connect_req,l2cap_proc_signal_connect_req
+	beq signal_connect_rsp,l2cap_proc_signal_connect_rsp
+	beq signal_config_req,l2cap_proc_signal_config_req
+	beq signal_config_rsp,l2cap_proc_signal_config_rsp
+	beq signal_disconnect_req,l2cap_proc_signal_disconnect_req
+	beq signal_disconnect_rsp,l2cap_proc_signal_disconnect_rsp
+	beq signal_echo_req,l2cap_proc_signal_echo_req
+	beq signal_echo_rsp,l2cap_proc_signal_echo_rsp
+	beq signal_info_req,l2cap_proc_signal_info_req
+	beq signal_info_rsp,l2cap_proc_signal_info_rsp
+	call l2cap_reject_command
+l2cap_process_one_signal_rtn:
+	rtn
+
+l2cap_proc_signal_info_req:
+	ifetch 1,contr //IDs
+	copy pdata,queue
+	ifetch 2,contr //length
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	setarg signal_info_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1, contw
+	ifetch 2,contr 
+l2cap_proc_signal_info_req_reply:
+	beq L2CAP_SIG_EXT_FEATRUE,l2cap_proc_signal_info_req_ext
+	beq L2CAP_SIG_FIX_FEATRUE,l2cap_proc_signal_info_req_fix
+	rtn
+l2cap_proc_signal_info_req_ext:
+	setarg 0x020008
+	istore 6, contw
+	setarg 0x0280
+	istore 4, contw
+	force 12,pdata
+	branch l2cap_proc_signal_info_req_common
+l2cap_proc_signal_info_req_fix:
+	setarg 0x3000c
+	istore 6, contw
+	setarg 0x0006
+	istore 8, contw
+	force 16,pdata
+l2cap_proc_signal_info_req_common:
+	iadd regb,regb
+	branch l2cap_process_one_signal_rtn
+	
+ml2cap_proc_signal_info_req:
+	ifetch 1,contr //IDs
+	copy pdata,queue
+	ifetch 2,contr //length
+	copy pdata,rega
+	ifetch 2,contr
+	store 2,mem_temp
+	copy regc,pdata
+	isub rega,regc 
+	call l2cap_get_signal_tx_payload
+	setarg signal_info_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw 
+	fetch 2,mem_temp
+	branch l2cap_proc_signal_info_req_reply
+
+
+/*  Respond to the command reject signal sent from the remote BD.   */
+l2cap_proc_signal_cmd_reject:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega
+	iadd contr,contr
+	copy regc,pdata
+	isub rega,regc
+l2cap_proc_signal_cmd_reject_rtn:
+	branch l2cap_process_one_signal_rtn
+/* Respond to an L2CAP connection request from remote BD. (generate a connection_rsp)	*/
+l2cap_proc_signal_connect_req:
+	call save_cont_pointers
+	//fetch 6,mem_inquiry_bd_addr
+  	//store 6,mem_master_paged_bd_addr
+  	call load_cont_pointers
+	arg 0,debug
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega
+	ifetch 2,contr
+	copy pdata,temp //PSM
+	ifetch 2,contr
+	copy pdata,timeup
+	bpatch patch1e_2,mem_patch1e
+	copy temp,pdata
+	beq PSM_SDP,l2cap_proc_signal_connect_req_sdp
+	beq PSM_RFCOMM,l2cap_proc_signal_connect_req_rfcomm
+	beq PSM_HID_control,l2cap_proc_signal_connect_req_hid_ctrl
+	beq PSM_HID_interrupt,l2cap_proc_signal_connect_req_hid_int
+	call l2cap_reject_command
+	branch l2cap_proc_signal_connect_req_rtn
+
+l2cap_proc_signal_connect_req_sdp:
+	call save_cont_pointers
+	arg L2CAP_SDP_channel,temp
+	fetch 2,mem_sdp_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_sdp_remote_cid
+	copy clkn_bt,pdata
+	store 4,mem_l2cap_sdpres_delay_time
+	call store_l2cap_req_param
+	branch  send_connection_pending
+
+store_l2cap_req_param:
+	storet 2,mem_psm
+	deposit timeup
+	store 2,mem_scid
+	deposit rega
+	store 2,mem_cmd_length
+	deposit regb
+	store 2,mem_tt2
+	deposit regc
+	store 2,mem_tt3
+	deposit queue
+	store 2,mem_id
+	rtn
+
+restore_l2cap_req_param:
+	fetcht 2,mem_psm
+	fetch 2,mem_scid
+	copy pdata,timeup
+	fetch 2,mem_cmd_length
+	copy pdata,rega
+	fetch 2,mem_tt2
+	copy pdata,regb
+	fetch 2,mem_tt3
+	copy pdata,regc
+	fetch 2,mem_id
+	copy pdata,queue
+	rtn
+
+l2cap_proc_signal_connect_req_rfcomm:
+	call save_cont_pointers
+	setarg L2CAP_RFCOMM_channel
+	arg L2CAP_RFCOMM_channel,temp
+	fetch 2,mem_RFCOMM_remote_CID
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_RFCOMM_remote_CID
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_rfcomm_state
+	branch send_connection_res
+l2cap_proc_signal_connect_req_hid_ctrl:
+	call save_cont_pointers
+	arg L2CAP_HID_Control_channel,temp
+	fetch 2,mem_hid_ctrl_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_hid_ctrl_remote_cid
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_control_state
+	branch send_connection_res
+l2cap_proc_signal_connect_req_hid_int:
+	call save_cont_pointers
+	deposit clke
+	arg L2CAP_HID_Interrupt_channel,temp
+	fetch 2,mem_hid_int_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_hid_int_remote_cid
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_interrupt_state
+	branch send_connection_res
+
+send_connection_pending:
+	setarg L2CAP_connect_pending
+	store 2,memL2CAP_T1
+	jam L2CAP_SDP_channel,mem_l2cap_pending_item
+	branch send_connection_res0
+send_connection_sdp_res:
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_sdp_state
+send_connection_res:
+	setarg L2CAP_connect_successful
+	store 2,memL2CAP_T1
+send_connection_res0:
+	bpatch patch1e_3,mem_patch1e
+	call load_cont_pointers
+	setarg signal_connect_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 0x0008
+	istore 2,contw
+	copy temp,pdata
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	fetch 2,memL2CAP_T1
+	beq L2CAP_connect_pending,connect_pending
+	isolate0 0,debug
+	branch connect_suc,true
+	setarg L2CAP_connect_refused_no_resources
+connect_suc:
+	istore 2,contw
+	force 0x0000,pdata
+	istore 2,contw
+	setarg 12
+	branch connect_req_update_byte_counts
+connect_pending:
+	istore 2,contw
+	force 0x0002,pdata
+	istore 2,contw
+	setarg 12
+	branch connect_req_update_byte_counts
+	
+already_connected:
+	set1 0,debug
+	branch send_connection_res
+connect_req_update_byte_counts:
+	iadd regb,regb
+	copy regc,pdata
+	isub rega,regc
+	branch l2cap_proc_signal_connect_req_rtn
+l2cap_proc_signal_connect_req_rtn:
+	branch l2cap_process_one_signal_rtn
+
+l2cap_proc_signal_connect_rsp:
+	ifetch 1,contr //identifier
+	copy pdata,queue
+	ifetch 2,contr //length
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	ifetch 2,contr //remote cid
+	copy pdata,timeup
+	ifetch 2,contr //local cid
+	copy pdata,temp
+	bpatch patch1e_4,mem_patch1e
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch l2cap_proc_signal_connect_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch l2cap_proc_signal_connect_rsp_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch l2cap_proc_signal_connect_rsp_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch l2cap_proc_signal_connect_rsp_hid_int,zero
+	rtn
+
+l2cap_proc_signal_connect_rsp_sdp:
+	copy timeup,pdata
+	store 2,mem_sdp_remote_cid
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_sdp_state
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_connect_rsp_rfcomm:
+	copy timeup,pdata
+	store 2,mem_rfcomm_remote_CID
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_rfcomm_state
+	rtn
+l2cap_proc_signal_connect_rsp_hid_int:
+	copy timeup,pdata
+	store 2,mem_hid_ctrl_remote_cid
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_interrupt_state
+	rtn
+l2cap_proc_signal_connect_rsp_hid_ctrl:
+	copy timeup,pdata
+	store 2,mem_hid_int_remote_cid
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_control_state
+	rtn
+
+l2cap_proc_signal_config_req:
+	ifetch 1,contr//identifier
+	copy pdata,queue
+	ifetch 2,contr//length
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	ifetch 2,contr//dest cid
+	copy pdata,temp
+	copy temp,rega
+	bpatch patch1e_5,mem_patch1e
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch l2cap_proc_signal_config_req_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch l2cap_proc_signal_config_req_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch l2cap_proc_signal_config_req_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch l2cap_proc_signal_config_req_hid_int,zero
+	branch l2cap_reject_command
+	//branch L2CAP_proc_signal_config_req_rtn
+l2cap_proc_signal_config_req_sdp:
+	copy contw, timeup
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	//set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_sdp_state
+	copy timeup,contw
+	arg L2CAP_SDP_channel,timeup
+	fetch 2,mem_sdp_remote_cid
+	copy pdata,temp
+	branch l2cap_send_config_rsp
+l2cap_proc_signal_config_req_hid_ctrl:
+	copy contw, timeup
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	//set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_hid_control_state
+	copy timeup,contw
+	arg L2CAP_HID_Control_channel,timeup
+	fetch 2,mem_hid_ctrl_remote_cid
+	copy pdata,temp
+	branch l2cap_send_config_rsp
+l2cap_proc_signal_config_req_hid_int:
+	copy contw, timeup
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	//set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_hid_interrupt_state
+	copy timeup,contw
+	arg L2CAP_HID_Interrupt_channel,timeup
+	fetch 2,mem_hid_int_remote_cid
+	copy pdata,temp
+	branch l2cap_send_config_rsp
+l2cap_proc_signal_config_req_rfcomm:
+	copy contw, timeup
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	//set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_rfcomm_state
+//	jam UPPERSM_RP_SDP_CONN,mem_upper_sm_remote_page
+	copy timeup,contw
+	arg L2CAP_RFCOMM_channel,timeup
+	fetch 2,mem_RFCOMM_remote_CID
+	copy pdata,temp
+l2cap_send_config_rsp:
+	bpatch patch1e_6,mem_patch1e
+	setarg  signal_config_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 0x0006
+	istore 2,contw
+	copy temp,pdata
+	istore 2,contw
+	force 0x00,pdata
+	istore 2,contw
+	force L2CAP_config_success,pdata
+	istore 2,contw
+	force 10,pdata
+	iadd regb,regb
+	//copy temp,pdata
+	storet 2,mem_config_req_dest_CID
+	copy queue,pdata
+	store 1,mem_config_identifier
+	force L2CAP_SDP_channel,pdata
+	icompare 0xff,timeup
+	branch l2cap_send_config_rsp_is_sdp,true
+	increase 1,pdata
+l2cap_send_config_rsp_is_sdp:
+	//store 1,mem_send_config_req
+	rtn
+l2cap_check_channel_state:
+	disable user
+	rtnbit1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	copy contr,contw
+	increase -1,contw
+	istore 1,contw
+	enable user
+	rtn
+l2cap_send_config_req:
+l2cap_send_config_req_sdp:
+	fetch 1,mem_sdp_state
+	call l2cap_check_channel_state
+	nbranch l2cap_send_config_req_rfcomm,user
+	jam L2CAP_SDP_channel,mem_send_config_req
+	fetch 2,mem_sdp_remote_cid
+	store 2,mem_config_req_dest_CID
+	branch l2cap_generate_config_req
+l2cap_send_config_req_rfcomm:
+	fetch 1,mem_rfcomm_state
+	call l2cap_check_channel_state
+	nbranch l2cap_send_config_req_hid_ctrl,user
+	jam L2CAP_RFCOMM_channel,mem_send_config_req
+	fetch 2,mem_RFCOMM_remote_CID
+	store 2,mem_config_req_dest_CID
+	branch l2cap_generate_config_req
+l2cap_send_config_req_hid_ctrl:
+	fetch 1,mem_hid_control_state
+	call l2cap_check_channel_state
+	nbranch l2cap_send_config_req_hid_int,user
+	jam L2CAP_HID_Control_channel,mem_send_config_req
+	fetch 2,mem_hid_ctrl_remote_cid
+	store 2,mem_config_req_dest_CID
+	branch l2cap_generate_config_req
+l2cap_send_config_req_hid_int:
+	fetch 1,mem_hid_interrupt_state
+	call l2cap_check_channel_state
+	nrtn user//End of sending config req
+	jam L2CAP_HID_Interrupt_channel,mem_send_config_req
+	fetch 2,mem_hid_int_remote_cid
+	store 2,mem_config_req_dest_CID
+	//branch L2CAP_generate_config_req
+
+l2cap_generate_config_req:
+	bpatch patch1e_7,mem_patch1e
+	call l2cap_get_req_id
+	call l2cap_malloc_signal_channel
+	force 0,regb
+	call l2cap_get_signal_tx_payload
+	force signal_config_req,pdata
+	istore 1,contw
+	fetch 1,mem_ML2CAP_comm_id
+	istore 1,contw
+	setarg 0x0008
+	istore 2,contw
+	fetch 2,mem_config_req_dest_CID
+	istore 2,contw
+	setarg 0x0000
+	istore 2,contw
+	force 1,pdata
+	istore 1,contw
+	force 2,pdata
+	istore 1,contw
+	fetch 1,mem_send_config_req
+	beq L2CAP_RFCOMM_channel,l2cap_generate_config_req_rfcomm
+	setarg L2CAP_config_MTU_SDP
+	istore 2,contw
+	branch l2cap_generate_config_req_done
+l2cap_generate_config_req_rfcomm:
+	setarg L2CAP_config_MTU_RFCOMM
+	istore 2,contw
+l2cap_generate_config_req_done:
+	arg 0x0c,temp
+	storet 2,mem_l2cap_signal_tx_length
+	call l2cap_get_signal_tx_buff
+	fetch 2,mem_l2cap_signal_tx_length
+	istore 2,contw
+	force L2CAP_signal_channel,pdata
+	istore 2,contw
+	jam 0,mem_send_config_req
+l2cap_proc_signal_config_req_rtn:
+	branch l2cap_process_one_signal_rtn
+
+l2cap_proc_signal_config_rsp:
+	increase 1,contr
+	ifetch 2,contr
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	ifetch 2,contr //source cid
+	copy pdata,rega
+	bpatch patch1f_0,mem_patch1f
+	setarg L2CAP_SDP_channel
+	isub rega,null
+	branch l2cap_proc_signal_config_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub rega,null
+	branch l2cap_proc_signal_config_rsp_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub rega,null
+	branch l2cap_proc_signal_config_rsp_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub rega,null
+	branch l2cap_proc_signal_config_rsp_hid_int,zero
+	increase 2,contr
+	ifetch 2,contr
+	iforce null
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_config_rsp_sdp:
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_sdp_state
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_config_rsp_rfcomm:
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_rfcomm_state
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_config_rsp_hid_ctrl:
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_hid_control_state
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_config_rsp_hid_int:
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_hid_interrupt_state
+	jam BT_EVT_HID_CONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+
+
+l2cap_proc_signal_disconnect_req:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	ifetch 2,contr
+	copy pdata,rega
+	ifetch 2,contr
+	copy pdata,timeup
+	copy rega,temp
+	call save_cont_pointers
+	bpatch patch1f_1,mem_patch1f
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_req_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_req_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_req_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_req_hid_int,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+l2cap_proc_signal_disconnect_req_hid_ctrl:
+	copy timeup,temp
+	fetch 2,mem_hid_ctrl_remote_cid
+	isub temp,null
+	branch l2cap_disconnect_hid_control_now,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+l2cap_proc_signal_disconnect_req_hid_int:
+	copy timeup,temp
+	fetch 2,mem_hid_int_remote_cid
+	isub temp,null
+	branch l2cap_disconnect_hid_interrupt_now,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+
+l2cap_proc_signal_disconnect_req_sdp:
+	copy timeup,temp
+	fetch 2,mem_sdp_remote_cid
+	isub temp,null
+	branch l2cap_disconnect_sdp_now,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+l2cap_disconnect_hid_control_now:
+	call l2cap_reset_hid_ctrl_state
+	branch l2cap_send_disconnect_rsp_pkt
+l2cap_disconnect_hid_interrupt_now:
+	call l2cap_reset_hid_int_state
+	fetch 2, mem_hid_ctrl_remote_cid
+	branch l2cap_send_disconnect_rsp_pkt, blank
+	//set the flag,hid channel close
+	//should we set here?
+	//call HID_mem_lock
+	//fetch 1, mem_hid_cb1
+	//set1 HID_CB_APP_HID_DISCONNECTED,pdata
+	//store 1, mem_hid_cb1
+	//call HID_mem_unlock
+	branch l2cap_send_disconnect_rsp_pkt
+
+l2cap_disconnect_sdp_now:
+	call l2cap_reset_sdp_channel_state
+	fetch 1,mem_upper_sm_ss
+	nbranch l2cap_send_disconnect_rsp_pkt,blank
+	//jam LMP_ENCRYPTION_MODE_REQ,mem_lmo_opcode2
+	//jam UPPERSM_RP_SDP_CONN,mem_upper_sm_remote_page
+	branch l2cap_send_disconnect_rsp_pkt
+l2cap_proc_signal_disconnect_req_rfcomm:
+	copy timeup,temp
+	fetch 2, mem_RFCOMM_remote_CID
+	isub temp,null
+	branch l2cap_disconnect_rfcomm_now,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+l2cap_disconnect_rfcomm_now:
+	call l2cap_reset_rfcomm_channel_state
+	branch l2cap_send_disconnect_rsp_pkt
+l2cap_send_disconnect_rsp_pkt:
+	call load_cont_pointers
+	setarg signal_disconnect_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy rega,pdata
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	force 8,pdata
+	branch l2cap_proc_signal_disconnect_req_rtn
+l2cap_proc_signal_disconnect_req_err_rtn:
+	call load_cont_pointers
+	branch l2cap_proc_signal_disconnect_req_rtn
+l2cap_proc_signal_disconnect_req_rtn:
+	iadd regb,regb
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_disconnect_rsp:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	ifetch 2,contr
+	copy pdata,timeup
+	ifetch 2,contr
+	copy pdata,temp
+	call save_cont_pointers
+	bpatch patch1f_2,mem_patch1f
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_rsp_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_rsp_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_rsp_hid_int,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_rsp_err_rtn
+l2cap_proc_signal_disconnect_rsp_sdp:
+	copy temp,rega
+	copy timeup,temp
+	fetch 2,mem_sdp_remote_cid
+	isub temp,null
+	call l2cap_reset_sdp_channel_state,zero
+	branch l2cap_proc_signal_disconnect_rsp_rtn
+l2cap_proc_signal_disconnect_rsp_rfcomm:
+	copy temp,rega
+	copy timeup,temp
+	fetch 2,mem_rfcomm_remote_CID
+	isub temp,null
+	call l2cap_reset_rfcomm_channel_state,zero
+	branch l2cap_proc_signal_disconnect_rsp_rtn
+l2cap_proc_signal_disconnect_rsp_hid_ctrl:
+	copy temp,rega
+	copy timeup,temp
+	fetch 2,mem_hid_ctrl_remote_cid
+	isub temp,null
+	call  l2cap_reset_hid_ctrl_state,zero
+	branch l2cap_proc_signal_disconnect_rsp_rtn
+l2cap_proc_signal_disconnect_rsp_hid_int:
+	copy temp,rega
+	copy timeup,temp
+	fetch 2,mem_hid_int_remote_cid
+	isub temp,null
+	call l2cap_reset_hid_int_state,zero
+	branch l2cap_proc_signal_disconnect_rsp_rtn
+l2cap_proc_signal_disconnect_rsp_rtn:
+	call load_cont_pointers
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_disconnect_rsp_err_rtn:
+	branch l2cap_process_one_signal_rtn
+
+/* received an echo request from remote BD.  Will echo the 1st 1 byte back,		*/
+l2cap_proc_signal_echo_req:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega
+	iadd contr,contr
+	setarg 9
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	force 0x0000,pdata
+	istore 2,contw
+	force 4,pdata
+	iadd regb,regb
+	copy regc,pdata
+	isub rega,regc
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_echo_rsp:
+	branch l2cap_process_one_signal_rtn
+
+l2cap_proc_signal_info_rsp:
+	branch l2cap_process_one_signal_rtn
+l2cap_reject_command:
+	force 0,regb
+	call l2cap_get_signal_tx_payload
+	setarg signal_cmd_reject
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 2
+	istore 2,contw
+	setarg cmd_not_understood
+	istore 2,contw
+	increase 6,regb
+	arg 4,regc
+	branch l2cap_process_one_signal_rtn
+
+
+
+l2cap_reset_rfcomm_channel_state:
+	setarg 0
+	store 2,mem_RFCOMM_Tx_pkt_length
+	store 2,mem_RFCOMM_remote_CID
+	jam 0,mem_rfcomm_state
+	rtn
+l2cap_reset_sdp_channel_state:
+	setarg 0
+	store 2,mem_sdp_tx_pkt_length
+	store 2,mem_sdp_remote_cid
+	jam 0,mem_sdp_state
+	rtn
+l2cap_reset_hid_ctrl_state:
+	setarg 0
+	store 2,mem_hid_ctrl_remote_cid
+	jam 0,mem_hid_control_state
+	fetch 1,mem_hid_interrupt_state
+	beq 0,l2cap_reset_hid_disconnected
+	rtn
+
+l2cap_reset_hid_int_state:
+	setarg 0
+	store 2,mem_hid_int_remote_cid
+	jam 0,mem_hid_interrupt_state
+	fetch 1,mem_hid_control_state
+	beq 0,l2cap_reset_hid_disconnected
+	rtn
+	
+l2cap_reset_hid_disconnected:
+	jam BT_EVT_HID_DISCONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event	
+
+l2cap_disconnect_interrupt_req:
+	fetch 1,mem_CONTROL_tasks
+	set0  L2CAP_DISCONNECT_INTERRUPT, pdata
+	store 1,mem_CONTROL_tasks
+	fetch 2, mem_hid_int_remote_cid
+	rtn blank
+	call l2cap_malloc_signal_channel
+	fetch 2, mem_hid_int_remote_cid
+	copy pdata,rega
+	force L2CAP_HID_Interrupt_channel,regb
+	branch l2cap_generate_disconnect_req
+l2cap_disconnect_control_req:
+	fetch 1,mem_CONTROL_tasks
+	set0  L2CAP_DISCONNECT_CONTROL, pdata
+	store 1,mem_CONTROL_tasks
+	fetch 2, mem_hid_ctrl_remote_cid
+	rtn blank
+	call l2cap_malloc_signal_channel
+	fetch 2, mem_hid_ctrl_remote_cid
+	copy pdata,rega
+	force L2CAP_HID_Control_channel,regb
+l2cap_generate_disconnect_req:
+	call l2cap_get_req_id
+	call l2cap_get_signal_tx_payload
+	force signal_disconnect_req,pdata
+	istore 1,contw
+	fetch  1,mem_ML2CAP_comm_id
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy rega,pdata
+	istore 2,contw
+	copy regb,pdata
+	istore 2,contw
+	force 0x08,temp //signal tx length in temp
+	branch ml2cap_send_signal
+
+ml2cap_send_signal_connect_req:
+	bpatch patch1f_3,mem_patch1f
+	call l2cap_get_req_id
+	call l2cap_get_signal_tx_payload
+	setarg signal_connect_req
+	istore 1,contw
+	fetch 1,mem_ML2CAP_comm_id
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy temp,pdata	 //PSM
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	arg 8,temp
+	branch ml2cap_send_signal
+ml2cap_send_signal_config_req:
+	bpatch patch1f_4,mem_patch1f
+	call l2cap_get_req_id
+	call l2cap_get_signal_tx_payload
+	setarg signal_config_req
+	istore 1,contw
+	fetch 1,mem_ML2CAP_comm_id
+	istore 1,contw
+	setarg 0x0008
+	istore 2,contw
+	/****modigy for nokia*****/
+	copy temp,pdata
+	/*setarg 0x0040*/
+	istore 2,contw
+	setarg 0x0000
+	istore 2,contw
+	setarg 0x01
+	istore 1,contw
+	setarg 0x02
+	istore 1,contw
+	setarg L2CAP_config_MTU_RFCOMM
+	istore 2,contw
+	arg 0xc,temp
+	branch ml2cap_send_signal
+ml2cap_send_signal_disconn_req:
+	bpatch patch1f_5,mem_patch1f
+	call l2cap_get_req_id
+	call l2cap_get_signal_tx_payload
+	setarg signal_disconnect_req
+	istore 1,contw
+	fetch 1,mem_ML2CAP_comm_id
+	increase 1,pdata
+	copy contw,rega
+	store 1,mem_ML2CAP_comm_id
+	copy rega,contw
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy temp,pdata
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	arg 0x8,temp
+	//branch ml2cap_send_signal
+	//Fall through
+ml2cap_send_signal:
+	storet 2,mem_l2cap_signal_tx_length
+	copy temp,pdata
+	branch l2cap_malloc_discard,blank
+	call l2cap_get_signal_tx_buff
+	fetch 2,mem_l2cap_signal_tx_length
+	istore 2,contw //make sure that length is still in temp!
+	force L2CAP_signal_channel,pdata
+	istore 2,contw
+	rtn
+
+msdp_send_req_done:
+	fetch 2,mem_sdp_tx_pkt_length
+	branch assert,blank
+	call l2cap_get_sdp_tx_buff
+	fetch 2,mem_sdp_tx_pkt_length
+	istore 2,contw
+	fetch 2,mem_sdp_remote_cid
+	istore 2,contw
+	rtn
+ml2cap_rx_multiplexing:
+	fetch 2, mem_l2cap_rx_pkt_length
+	branch l2cap_rx_reset_state,blank
+	bpatch patch1f_6,mem_patch1f
+	fetch 1,mem_l2cap_rx_cid
+	beq L2CAP_signal_channel,ml2cap_call_proc_signal
+	beq L2CAP_SDP_channel,ml2cap_call_proc_sdp
+	beq L2CAP_RFCOMM_channel,l2cap_call_proc_rfcomm
+	beq L2CAP_HID_Control_channel,l2cap_call_proc_hid
+	beq L2CAP_HID_Interrupt_channel,l2cap_call_proc_hid
+	branch l2cap_rx_reset_state
+
+ml2cap_call_proc_signal:
+	call l2cap_malloc_signal_channel
+	force 0,regb
+	call l2cap_get_signal_tx_payload
+	copy pdata,contw
+	fetch 2,mem_l2cap_rx_pkt_length
+	copy pdata,regc
+	fetch 2,mem_l2cap_payload_ptr
+	iforce contr
+ml2cap_proc_one_comm_loop:
+	call ml2cap_proc_one_comm
+	increase -4,regc
+	nbranch ml2cap_proc_one_comm_loop,zero
+	copy regb,temp
+	call ml2cap_send_signal
+	branch l2cap_rx_reset_state
+	
+ml2cap_proc_one_comm:
+	ifetch 1,contr
+	beq signal_connect_req,ml2cap_proc_signal_connect_req
+	beq signal_cmd_reject,ml2cap_proc_signal_cmd_reject
+	beq signal_connect_rsp,ml2cap_proc_signal_connect_rsp
+	beq signal_config_rsp,ml2cap_proc_signal_config_rsp
+	beq signal_config_req,ml2cap_proc_signal_config_req
+	beq signal_disconnect_rsp,ml2cap_proc_signal_disconn_rsp
+	beq signal_disconnect_req,ml2cap_proc_signal_disconn_req
+	beq signal_echo_req,l2cap_proc_signal_echo_req
+	beq signal_info_req,ml2cap_proc_signal_info_req
+	branch ml2cap_proc_send_reject
+
+ml2cap_proc_signal_connect_req:
+	call save_cont_pointers
+	//jam NO_RECONNECTION,memui_reconnect_mode
+	call load_cont_pointers
+	branch l2cap_proc_signal_connect_req
+ml2cap_proc_signal_cmd_reject:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+mvptr:
+	ifetch 1,contr
+	increase -1,rega
+	nbranch mvptr,zero
+	rtn
+ml2cap_proc_signal_connect_rsp:
+	ifetch 1,contr //id
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega	//length
+	ifetch 2,contr
+	copy pdata,timeup	//destination	cid
+	ifetch 2,contr
+	copy pdata,temp	//source	cid
+	ifetch 2,contr 		// result
+	sub pdata,0,null
+	branch ml2cap_proc_signal_connect_rsp_sucessful,zero
+	beq L2CAP_connect_refused_PSM_unsupported,ml2cap_proc_signal_connect_refused_result
+	beq L2CAP_connect_refused_no_resources,ml2cap_proc_signal_connect_refused_result
+	branch ml2cap_proc_signal_connect_rsp_mnosucc
+ml2cap_proc_signal_connect_refused_result:
+	jam BT_EVT_ML2CAP_CONN_REFUSED,mem_fifo_temp
+	call ui_ipc_send_event
+ml2cap_proc_signal_connect_rsp_mnosucc:
+	ifetch 2,contr //reason
+	branch mnosucc
+ml2cap_proc_signal_connect_rsp_sucessful:
+	call save_cont_pointers
+	//fetch 1,mem_ML2CAP_comm_id
+	//icompare 0xff,queue
+	//nbranch mnosucc1,true
+	bpatch patch1f_7,mem_patch1f
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch ml2cap_proc_signal_connect_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch ml2cap_proc_signal_connect_rsp_rfcomm,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch ml2cap_proc_signal_connect_rsp_hid_int,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch ml2cap_proc_signal_connect_rsp_hid_ctrl,zero
+	branch mnosucc
+ml2cap_proc_signal_connect_rsp_sdp:
+	copy timeup,pdata
+	store 2,mem_sdp_remote_cid
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_sdp_state
+	branch mnosucc1
+ml2cap_proc_signal_connect_rsp_rfcomm:
+	copy timeup,pdata
+	store 2,mem_RFCOMM_remote_CID
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_rfcomm_state
+	branch mnosucc1
+ml2cap_proc_signal_connect_rsp_hid_ctrl:
+	copy timeup,pdata
+	store 2,mem_hid_ctrl_remote_cid
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_control_state
+	branch mnosucc1
+ml2cap_proc_signal_connect_rsp_hid_int:
+	copy timeup,pdata
+	store 2,mem_hid_int_remote_cid
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_interrupt_state
+	//branch mnosucc1
+
+mnosucc1:
+	call load_cont_pointers
+mnosucc:
+	copy regc,pdata
+	isub rega,regc
+	rtn
+
+ml2cap_proc_signal_config_rsp:
+	ifetch 1,contr		//	Ident
+	copy pdata,queue
+	ifetch 2,contr		//	SigLen
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	ifetch 2,contr		//	DestnCID
+	copy pdata,timeup
+	ifetch 2,contr
+	ifetch 2,contr		//	Get the result value, check success
+	nbranch mcrsdone1,blank
+	call save_cont_pointers
+	//fetch 1,mem_ML2CAP_comm_id
+	//icompare 0xff,queue
+	//nbranch mcfrsdone,true
+	copy timeup,temp
+	bpatchx patch20_0,mem_patch20
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_rsp_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_rsp_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_rsp_hid_int,zero
+ml2cap_proc_signal_config_rsp_sdp:
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_sdp_state
+	rtn
+ml2cap_proc_signal_config_rsp_rfcomm:
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_rfcomm_state
+	rtn
+ml2cap_proc_signal_config_rsp_hid_ctrl:
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_hid_control_state
+	rtn
+ml2cap_proc_signal_config_rsp_hid_int:
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_hid_interrupt_state
+	jam BT_EVT_HID_CONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+mcfrsdone:
+	call load_cont_pointers
+mcrsdone1:
+	increase -6,rega
+mloop2:
+	branch mcrsdone,zero
+	increase 1,contr
+	increase -1,rega
+	branch mloop2
+mcrsdone:
+	rtn
+ml2cap_proc_signal_config_req:
+	ifetch 1,contr		//	Ident
+	copy pdata,queue
+	ifetch 2,contr		//	SigLen
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	ifetch 2,contr		//	DestnCID
+	increase 2,contr
+	copy pdata,temp
+	setarg  signal_config_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	increase 2,rega
+	copy rega,pdata
+	istore 2,contw
+	call save_cont_pointers
+	bpatchx patch20_1,mem_patch20
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_req_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_req_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_req_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_req_hid_int,zero
+	branch mcfgrq_done
+ml2cap_proc_signal_config_req_sdp:
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	store 1,mem_sdp_state
+	bbit1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,ml2cap_proc_signal_config_req_sdp_nsndreq
+	fetcht 1,mem_CONTROL_tasks
+	set1 L2CAP_init_Config_Req,temp
+	storet 1,mem_CONTROL_tasks
+	copy queue,pdata
+	increase 1,pdata
+	store 1,mem_config_identifier
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_sdp_state
+ml2cap_proc_signal_config_req_sdp_nsndreq:
+	fetch 2,mem_sdp_remote_cid
+	store 2,mem_config_req_dest_CID
+	branch mcfgrq_done
+ml2cap_proc_signal_config_req_rfcomm:
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	store 1,mem_rfcomm_state
+	fetch 2,mem_RFCOMM_remote_CID
+	branch mcfgrq_done
+ml2cap_proc_signal_config_req_hid_ctrl:
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	store 1,mem_hid_control_state
+	fetch 2,mem_hid_ctrl_remote_cid
+	branch mcfgrq_done
+ml2cap_proc_signal_config_req_hid_int:
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	store 1,mem_hid_interrupt_state
+	fetch 2,mem_hid_int_remote_cid
+	//branch mcfgrq_done
+
+mcfgrq_done:
+	copy pdata,timeup
+	call load_cont_pointers
+/*******for Nokia**************/
+	copy timeup,pdata
+	/*setarg 0x0040*/
+	istore 2,contw
+	force 0x0000,pdata
+	istore 2,contw
+	force 0x0000,pdata
+	istore 2,contw
+	force 10,pdata
+	iadd regb,regb
+	increase -6,rega
+mloop1:
+	branch mcrqdone,zero
+	ifetch 1,contr
+	istore 1,contw
+	increase 1,regb
+	increase -1,rega
+	branch mloop1
+mcrqdone:
+	rtn
+ml2cap_proc_signal_disconn_req:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+
+	ifetch 2,contr
+	copy pdata,rega
+	ifetch 2,contr
+	copy pdata,timeup
+	call save_cont_pointers
+	bpatchx patch20_2,mem_patch20
+	setarg L2CAP_SDP_channel
+	copy rega,temp
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_sdp,zero
+	setarg L2CAP_HID_Control_channel
+	copy rega,temp
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	copy rega,temp
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_hid_int,zero
+	branch mclsrfc
+ml2cap_proc_signal_disconn_sdp:
+	setarg 0x0000
+	store 2,mem_sdp_tx_pkt_length
+	store 2,mem_sdp_remote_cid
+	store 1,mem_sdp_state
+	branch mclssdp
+ml2cap_proc_signal_disconn_hid_ctrl:
+	call l2cap_reset_hid_ctrl_state
+	branch mclssdp
+ml2cap_proc_signal_disconn_hid_int:
+	call l2cap_reset_hid_int_state
+	//call HID_mem_lock
+	//fetch 1, mem_hid_cb1
+	//set1 HID_CB_APP_HID_DISCONNECTED,pdata
+	//store 1, mem_hid_cb1
+	//call HID_mem_unlock
+	branch mclssdp
+mclsrfc:
+	setarg 0x0000
+	store 2,mem_RFCOMM_Tx_pkt_length
+mclssdp:
+	call load_cont_pointers
+	setarg signal_disconnect_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy rega,pdata
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	force 8,pdata
+	iadd regb,regb
+	rtn
+
+ml2cap_proc_signal_disconn_rsp:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,rega
+	ifetch 2,contr
+	copy pdata,timeup
+	ifetch 2,contr
+	copy pdata,temp
+	call save_cont_pointers
+	bpatchx patch20_3,mem_patch20
+	fetch 1,mem_ML2CAP_comm_id
+	icompare 0xff,queue
+	nbranch mdisdone,true
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_rsp_rfcomm,zero
+	branch mdisdone
+ml2cap_proc_signal_disconn_rsp_sdp:
+	jam 0,mem_sdp_remote_cid
+	jam 0,mem_sdp_state
+	branch mdisdone
+ml2cap_proc_signal_disconn_rsp_rfcomm:
+	//
+	//
+mdisdone:
+	call load_cont_pointers
+	copy regc,pdata
+	isub rega,regc
+	rtn
+
+ml2cap_proc_send_reject:
+	setarg signal_cmd_reject
+	istore 1,contw
+	ifetch 1,contr
+	istore 1,contw
+	setarg 0x0002
+	istore 2,contw
+	setarg 0x0000
+	istore 2,contw
+	setarg 0x0006
+	iadd regb,regb
+	force 4,regc
+	rtn
+	
+//l2cap command id, 0 is not allowed
+l2cap_get_req_id:
+	fetch 1,mem_ML2CAP_comm_id
+	increase 1,pdata
+	bne 0,l2cap_get_req_id_ok
+	increase 1,pdata
+l2cap_get_req_id_ok:
+	store 1,mem_ML2CAP_comm_id
+	rtn
+
+
+/*********************************************************/
+//char* malloc(short len)
+//input: rega -> len
+//rtn: regb -> pbuff;return from pdata
+//val: queue -> i
+//val: timeup -> buff_cnt
+/*********************************************************/
+l2cap_malloc:
+bt_l2cap_malloc:
+	arg mem_tx_buff0,regd
+	arg mem_bt_l2cap_tx_buff_size,rege
+	call enable_user
+	branch host_l2cap_malloc
+
+ble_l2cap_malloc:
+	fetchr regd,2,mem_ble_l2cap_tx_buff0_ptr
+	fetchr rege,2,mem_ble_l2cap_tx_buff_size_ptr
+	call disable_user
+	branch host_l2cap_malloc
+
+/*
+	malloc l2cap buffer
+	input:
+	BT is enable user
+	BLE is disable user
+	rega is want malloc buffer size
+	regd is l2cap buffer start ptr
+	rege is l2cap buffer size
+	output:
+	pdata & contw is buffer ptr
+*/
+host_l2cap_malloc:
+	bpatchx patch20_4,mem_patch20
+	call l2cap_malloc_is_fifo_full
+	nbranch assert,blank//assert when fifo full
+	call l2cap_malloc_get_full_map
+	arg 8,loopcnt
+host_l2cap_malloc_loop:
+	fetcht 1,mem_used_map
+	sub loopcnt,8,queue
+	qisolate1 temp
+	branch host_l2cap_malloc_next_buffer,true//if(1 == (used_map & (1 << i)))goto next;
+	call host_l2cap_malloc_check_buffer_enough
+	nbranch host_l2cap_malloc_next_buffer,positive//if(buff_cnt <= 0)goto next;
+	call host_l2cap_malloc_into_fifo
+	branch host_l2cap_malloc_succ//return (pbuff);
+host_l2cap_malloc_next_buffer:
+	copy rege,pdata
+	iadd regd,regd		//pbuff += BUFF_SIZE;//point to next buff
+	loop host_l2cap_malloc_loop
+	branch assert	//return NULL
+host_l2cap_malloc_succ:
+	copy regd,pdata
+	copy regd,contw
+	rtn//return pointer via pdata
+
+/*********************************************************/
+//char is_size_enough(char buff_index, short len)
+//input: rega -> len
+//input: loopcnt -> 8-buff_index
+//rtn: positive is diable mean no buffer
+//positive is enable mean get buffer
+/*********************************************************/
+host_l2cap_malloc_check_buffer_enough:
+	bpatchx patch20_5,mem_patch20
+	sub loopcnt,8,queue
+	arg 0,temp
+	arg 0,timeup
+host_l2cap_malloc_check_buffer_enough_loop:
+	copy queue,pdata
+	beq 8,host_l2cap_malloc_check_buffer_enough_end
+	fetch 1,mem_used_map
+	qisolate1 pdata		//the buffer is used
+	branch host_l2cap_malloc_check_buffer_enough_end,true
+	qset1 timeup
+	copy rege,pdata
+	iadd temp,temp
+	increase 1,queue
+	copy rega,pdata
+	isub temp,null
+	branch host_l2cap_malloc_check_buffer_enough_end,zero//(max_size_fom_buff_index ==  len)
+	branch host_l2cap_malloc_check_buffer_enough_loop,positive//(max_size_fom_buff_index <  len)
+host_l2cap_malloc_check_buffer_enough_end:
+	copy temp,pdata
+	isub rega,null
+	nrtn zero
+	qset1 timeup
+	rtn
+
+/*********************************************************/
+//void buff_into_fifo(char buff_index, char buff_cnt, short len)
+//input: rega -> len
+//input: regc -> buff_index
+//input: timeup -> buff_cnt
+//val:temp ->   (fifo->map)
+/*********************************************************/
+host_l2cap_malloc_into_fifo:
+	bpatchx patch20_6,mem_patch20
+	call l2cap_malloc_is_fifo_full
+	nbranch assert,blank //fifo full
+	call l2cap_malloc_is_fifo_empty
+	branch host_l2cap_malloc_into_fifo_no_push,blank//fifo empty, no need to push
+	fetch 9,mem_tx_fifo1
+	store 9,mem_tx_fifo0
+	setarg 0
+	istore 3,contw//mem_tx_fifo3
+host_l2cap_malloc_into_fifo_no_push:
+	storer timeup,1,mem_tx_fifo3_map
+	storer regd,2,mem_tx_fifo3_ptr
+	rtn
+
+
+/*********************************************************/
+//void* l2cap_malloc_fifo_out(void)
+//output:len -> temp
+//output:ptr ->pdata
+//only get ptr,not free
+/*********************************************************/
+l2cap_malloc_fifo_out:
+	bpatchx patch20_7,mem_patch20
+	call l2cap_malloc_fifo_get_first_ptr
+	increase 1,contr
+	ifetch 2,contr //ptr ->pdata
+	rtn
+
+
+/*********************************************************/
+//void free_first_buff_in_fifo(void)
+//only free the first one
+/*********************************************************/
+l2cap_malloc_free:
+	bpatchx patch21_0,mem_patch21
+	call l2cap_malloc_fifo_get_first_ptr
+	copy contr,contw
+	copy contr,temp
+	setarg 0
+	istore 3,contw
+	rtn
+
+
+/*********************************************************/
+//void l2cap_malloc_discard(void)
+//discard the latest malloc
+/*********************************************************/
+l2cap_malloc_discard:
+	bpatchx patch21_1,mem_patch21
+	call l2cap_malloc_is_fifo_empty
+	branch assert,blank
+	fetch 3,mem_tx_fifo2
+	store 3,mem_tx_fifo3
+	fetch 3,mem_tx_fifo1
+	store 3,mem_tx_fifo2
+	fetch 3,mem_tx_fifo0
+	store 3,mem_tx_fifo1
+	rtn
+
+
+/*********************************************************/
+//bool fifo_is_full(void)
+//blank == 1: not full
+//blank == 0: full
+/*********************************************************/
+l2cap_malloc_is_fifo_full:
+	bpatchx patch21_2,mem_patch21
+	fetch 3,mem_tx_fifo0
+	rtn
+
+
+/*********************************************************/
+//bool fifo_nearly_full(void)
+//blank == 1: nearly full
+//blank == 0: not nearly full
+/*********************************************************/
+l2cap_malloc_is_fifo_nearly_full:
+	bpatchx patch21_3,mem_patch21
+	fetch 3,mem_tx_fifo1
+	rtn
+
+
+/*********************************************************/
+//bool fifo_is_empty(void)
+//blank == 1: empty
+//blank == 0: not empty
+/*********************************************************/
+l2cap_malloc_is_fifo_empty:
+	bpatchx patch21_4,mem_patch21
+	fetch 3,mem_tx_fifo3
+	rtn
+
+
+/*********************************************************/
+//char* l2cap_malloc_fifo_get_first_ptr(void)
+//output:contr  -->ptr
+/*********************************************************/	
+l2cap_malloc_fifo_get_first_ptr:
+	call l2cap_malloc_is_fifo_empty
+	branch l2cap_malloc_fifo_get_first_ptr_empty,blank // fifo is empty
+	arg mem_tx_fifo0,contr
+l2cap_malloc_free_loop:
+	ifetch 3,contr
+	branch l2cap_malloc_free_loop,blank
+l2cap_malloc_fifo_get_first_ptr_empty:
+	increase -3,contr
+	rtn
+
+
+/*********************************************************/
+//char* l2cap_malloc_get_full_map(void)
+//output:mem_used_map  -->full_map
+//add all maps into one
+/*********************************************************/	
+l2cap_malloc_get_full_map:
+	bpatchx patch21_5,mem_patch21
+	arg 4,loopcnt
+	arg mem_tx_fifo0_map,contr
+	arg 0,temp
+l2cap_malloc_get_full_map_loop:	
+	ifetch 3,contr
+	and pdata,0xff,pdata
+	ior temp,temp
+	loop l2cap_malloc_get_full_map_loop
+	storet 1,mem_used_map
+	rtn
+
+
+l2cap_malloc_signal_channel:
+	bpatchx patch21_6,mem_patch21
+	arg L2CAP_SIGNAL_MALLOC_SIZE,rega
+	call l2cap_malloc
+	store 2,mem_l2cap_signal_tx_buff_ptr
+	increase 4,pdata
+	store 2,mem_l2cap_signal_tx_payload_ptr
+	setarg 0
+	store 2,mem_l2cap_signal_tx_length
+	rtn
+
+l2cap_get_signal_tx_buff:
+	fetch 2,mem_l2cap_signal_tx_buff_ptr
+	branch l2cap_util_pdata_to_contw
+
+l2cap_get_signal_tx_payload:
+	fetch 2,mem_l2cap_signal_tx_payload_ptr
+	branch l2cap_util_pdata_to_contw
+
+
+l2cap_malloc_sdp_channel:
+	bpatchx patch21_7,mem_patch21
+	arg SDP_MALLOC_SIZE,rega
+	call l2cap_malloc
+	store 2,mem_sdp_tx_buff_ptr
+	increase 4,pdata
+	store 2,mem_sdp_tx_payload_ptr
+	setarg 0
+	store 2,mem_sdp_tx_pkt_length
+	rtn
+
+l2cap_get_sdp_tx_buff:
+	fetch 2,mem_sdp_tx_buff_ptr
+	branch l2cap_util_pdata_to_contw
+
+l2cap_get_sdp_tx_payload:
+	fetch 2,mem_sdp_tx_payload_ptr
+	branch l2cap_util_pdata_to_contw
+
+
+l2cap_malloc_rfcomm_channel:
+	bpatchx patch22_0,mem_patch22
+	call push_stack
+	jam RFCOMM_MALLOC_FAIL,mem_rfcomm_malloc_fail_flag
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	arg RFCOMM_MALLOC_SIZE,rega
+	call l2cap_malloc
+	store 2,mem_rfcomm_tx_buff_ptr
+	increase 4,pdata
+	store 2,mem_rfcomm_tx_payload_ptr
+	setarg 0
+	store 2,mem_rfcomm_tx_pkt_length
+	jam RFCOMM_MALLOC_SUCCEED,mem_rfcomm_malloc_fail_flag
+	branch pop_stack
+
+l2cap_get_rfcomm_tx_buff:
+	fetch 2,mem_rfcomm_tx_buff_ptr
+	branch l2cap_util_pdata_to_contw
+	
+l2cap_util_pdata_to_contw:
+	branch assert,blank
+	copy pdata,contw
+	rtn
+	
+
+l2cap_lpm_save_calc_len:
+	bpatchx patch22_1,mem_patch22
+	arg 0,regb
+	arg mem_tx_fifo0_map,rega
+	increase -2,rega
+l2cap_lpm_save_calc_len_loop:
+	increase 2,rega
+	setarg mem_tx_fifo_end
+	isub rega,null
+	branch l2cap_lpm_save_calc_len_end,zero //end of 2lcap tx fifo
+	ifetch 1,rega
+	increase 1,rega
+	branch l2cap_lpm_save_calc_len_loop,blank
+	ifetcht 2,rega
+	ifetch 2,temp
+	iadd regb,regb
+	increase 4,regb //l2cap header len
+	branch l2cap_lpm_save_calc_len_loop
+l2cap_lpm_save_calc_len_end:
+	copy regb,pdata
+	rtn
+
+
+l2cap_lpm_get_wake_lock:
+	arg wake_lock_l2cap_tx,queue
+	branch lpm_get_wake_lock
+
+l2cap_lpm_put_wake_lock:
+	arg wake_lock_l2cap_tx,queue
+	branch lpm_put_wake_lock
+	
+l2cap_lpm_save_txbuf:
+	bpatchx patch22_2,mem_patch22
+	call l2cap_malloc_get_full_map
+	fetch 1,mem_used_map
+	rtn blank
+	call l2cap_lpm_save_calc_len
+	arg l2cap_lpm_txbuf_len,temp
+	isub temp,null
+	branch l2cap_lpm_get_wake_lock,positive //no enougth space to save l2cap tx data
+	call l2cap_lpm_put_wake_lock
+	arg mem_l2cap_lpm_txbuf,contw
+	arg mem_tx_fifo0,rega
+l2cap_lpm_save_txbuf_loop:
+	setarg mem_tx_fifo_end
+	isub rega,null
+	rtn zero //end of 2lcap tx fifo
+	ifetch 1,rega  //mem_tx_fifoX_map
+	increase 1,rega
+	nbranch l2cap_lpm_save_txbuf_nempty,blank
+	istore 2,contw // length = 0
+	increase 2,rega
+	branch l2cap_lpm_save_txbuf_loop
+l2cap_lpm_save_txbuf_nempty:
+	ifetch 2,rega //ptr
+	increase 2,rega
+	copy pdata,contr
+	ifetch 2,contr  //l2cap len
+	istore 2,contw
+	copy pdata,loopcnt
+	increase 2,loopcnt //add CID len
+	call memcpy
+	branch l2cap_lpm_save_txbuf_loop
+	
+l2cap_lpm_load_txbuf:
+	bpatchx patch22_3,mem_patch22
+	call l2cap_malloc_get_full_map
+	fetch 1,mem_used_map
+	rtn blank
+	arg mem_tx_fifo0_ptr,rega
+	increase -3,rega //mem_tx_fifo0_ptr -3
+	arg mem_l2cap_lpm_txbuf,contr
+l2cap_lpm_load_txbuf_loop:
+	increase 3,rega //mem_tx_fifoX_ptr
+	setarg mem_tx_fifo_end+1
+	isub rega,null
+	rtn zero //end of 2lcap tx fifo
+	ifetch 2,contr
+	branch l2cap_lpm_load_txbuf_loop,blank
+	increase 4,pdata //l2cap header len
+	copy pdata,loopcnt
+	copy contr,regb
+	ifetch 2,rega //ptr
+	copy pdata,contw
+	copy regb,contr
+	increase -2,contr
+	call memcpy
+	branch l2cap_lpm_load_txbuf_loop
+	
+
+
+	
Index: program/lmp.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/lmp.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/lmp.prog	(working copy)
@@ -0,0 +1,2744 @@
+	
+/******************************************/
+/*************   LMP Parse   **************/
+/******************************************/
+init_lmp:
+	rtn wake
+init_lmp_work:
+	bpatchx patch22_4,mem_patch22
+	setarg 0
+	store 1,mem_lmp_to_send
+	store 1,mem_conn_sm
+	store 1,mem_lmo_opcode1
+	store 1,mem_lmo_opcode2
+	store 1,mem_esco_addr
+	store 1,mem_connection_options
+	store 1,mem_pairing_auth
+	store 3,mem_encapsulated_major_type
+	store 1,mem_remote_br_sc_support
+	jam SWITCH_FLAG_INIT,mem_switch_flag
+	jam 0,mem_switch_fail_master_count
+	jam NULL_ENCRYP,mem_wait_encryption
+init_lmp_reinit:	
+	jam 0,mem_pairing_auth
+	jam 0,mem_sp_localsm
+	jam 0,mem_lmp_conn_state
+	//fall through
+parse_rx_done:
+	rtn
+
+parse_lmp:
+	bpatchx patch22_5,mem_patch22
+	call setlocalsm_master,master	//use this flag in hci
+	ncall setlocalsm_slave,master
+	call lmo_fifo_check
+	nrtn blank
+	fetch 1,mem_state_map
+	rtnbit0 smap_rxlmp
+	set0 smap_rxlmp,pdata
+	set0 mark_rxbuf_inuse,mark
+	store 1,mem_state_map
+	fetch 1,mem_rxbuf
+	fetcht 1,mem_state_map
+	isolate1 smap_lmptidinit,pdata
+	setflag true,smap_lmptid,temp
+	storet 1,mem_state_map
+	and_into 0x2,temp //smap_lmptid only
+	storet 1,mem_lmo_tid2
+	fetcht 1,mem_state_map
+	rshift pdata,pdata			/* align lmp_opcode */
+  	store 1,mem_lmi_opcode2
+	bpatchx patch22_6,mem_patch22
+  	fetch 1,mem_lmi_opcode2
+  	beq LMP_ESCAPE,parse_lmp_escape//multi
+  	beq LMP_ACCEPTED,parse_lmp_accepted//multi
+	beq LMP_NOT_ACCEPTED,parse_lmp_not_accepted//multi
+  	beq LMP_SET_AFH, parse_lmp_set_afh
+  	beq LMP_CLKOFFSET_REQ, parse_lmp_clkoffset_req
+ 	beq LMP_ENCRYPTION_MODE_REQ, parse_lmp_encryption_mode_req
+ 	beq LMP_ENCRYPTION_KEY_SIZE_REQ,parse_lmp_crypt_key
+	beq LMP_AUTO_RATE,parse_lmp_auto_rate
+	beq LMP_TEST_CONTROL,parse_lmp_test_control//multi
+	beq LMP_TEST_ACTIVATE,parse_lmp_test_activate
+	beq LMP_SETUP_COMPLETE,parse_lmp_setup_complete
+	beq LMP_SUPERVISION_TIMEOUT,parse_lmp_supervision_timeout
+	beq LMP_FEATURES_REQ,parse_lmp_features_req
+	beq LMP_HOST_CONNECTION_REQ,parse_lmp_conn_req
+	beq LMP_VERSION_REQ,parse_lmp_version_req
+	beq LMP_VERSION_RES,parse_lmp_version_res
+	beq LMP_DETACH,parse_lmp_detach
+	beq LMP_MAX_SLOT,parse_lmp_max_slot
+	beq LMP_MAX_SLOT_REQ,parse_lmp_max_slot_req
+	beq LMP_NAME_REQ,parse_lmp_name_req
+	beq LMP_NAME_RES,parse_lmp_name_res
+	beq LMP_FEATURES_RES,parse_lmp_features_res
+	beq LMP_COMB_KEY,parse_lmp_comb_key
+	beq LMP_AU_RAND, parse_lmp_au_rand
+	beq LMP_IN_RAND,parse_lmp_in_rand
+	beq LMP_SRES,parse_lmp_sres
+	beq LMP_INCR_POWER_REQ,parse_lmp_incr_power
+	beq LMP_DECR_POWER_REQ,parse_lmp_decr_power
+	beq LMP_MAX_POWER, parse_lmp_max_power
+	beq LMP_MIN_POWER, parse_lmp_min_power
+	beq LMP_PAGE_MODE_REQ, parse_lmp_page_mode_req
+	beq LMP_PAGE_SCAN_MODE_REQ, parse_lmp_page_scan_mode_req
+	beq LMP_PREFERRED_RATE, parse_lmp_preferred_rate
+	beq LMP_SLOT_OFFSET, parse_lmp_slot_offset
+	beq LMP_SNIFF_REQ, parse_lmp_sniff_req
+	beq LMP_START_ENCRYPTION_REQ, parse_lmp_start_encryption_req
+	beq LMP_STOP_ENCRYPTION_REQ, parse_lmp_stop_encryption_req
+	beq LMP_SWITCH_REQ, parse_lmp_switch_req
+	beq LMP_TEMP_RAND, parse_lmp_temp_rand
+	beq LMP_TEMP_KEY, parse_lmp_temp_key
+	beq LMP_TIMING_ACCURACY_REQ, parse_lmp_timing_accuracy_req
+	beq LMP_TIMING_ACCURACY_RES, parse_lmp_timing_accuracy_res
+	beq LMP_UNIT_KEY, parse_lmp_unit_key
+	beq LMP_UNSNIFF_REQ, parse_lmp_unsniff_req
+	beq LMP_USE_SEMI_PERMANENT_KEY, parse_lmp_use_semi_permanend_key
+	beq LMP_ENCAPSULATED_HEADER,parse_lmp_encapsulated_header
+	beq LMP_ENCAPSULATED_PAYLOAD,parse_lmp_encapsulated_payload
+	beq LMP_SIMPLE_PAIRING_CONFIRM,parse_simple_pairing_confirm
+	beq LMP_SIMPLE_PAIRING_NUMBER,parse_lmp_simple_pairing_number
+	beq LMP_DHKEY_CHECK,parse_dhkey_check
+	beq LMP_CLKOFFSET_RES, parse_lmp_clkoffset_res
+	beq LMP_ENC_KEY_SIZE_MASK_REQ,parse_enc_key_size_mask_req
+	beq LMP_QUALITY_OF_SERVICE_REQ,parse_quality_of_server_req
+	beq LMP_QUALITY_OF_SERVICE,parse_quality_of_server
+/* lmp is not recognized, check to see if we respond to all messages */ 
+/* rejecting the unrecognized message with PDU not recognized */
+reject_unknown_packet:
+	jam UNKNOWN_LMP_PDU,mem_lmo_reason2
+reject_lmp_packet:
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	rtn
+
+parse_quality_of_server_req:
+	branch accept_lmp_msg
+
+parse_quality_of_server:
+	rtn
+
+parse_lmp_clkoffset_req:
+	jam LMP_CLKOFFSET_RES,mem_lmo_opcode2
+	rtn	
+
+parse_enc_key_size_mask_req:
+	jam LMP_ENC_KEY_SIZE_MASK_RES,mem_lmo_opcode2
+	rtn
+	
+parse_lmp_set_afh:
+	fetch 4,mem_rxbuf+1
+	lshift pdata,pdata
+	store 4,mem_afh_instant
+	fetch 1,mem_rxbuf+5
+	store 1,mem_afh_new_mod
+	fetch 5,mem_rxbuf+6
+	store 5,mem_afh_map_new
+	fetch 5,mem_rxbuf+11
+	istore 5,contw
+	fetch 1,mem_mode
+	set1 afh_change,pdata
+	store 1,mem_mode
+	rtn
+parse_lmp_escape:
+	bpatchx patch22_7,mem_patch22
+	fetch 1,mem_rxbuf+1
+	set1 7,pdata
+	store 1,mem_lmi_opcode2
+	beq LMP_EXT_ACCEPTED,parse_lmpext_accepted
+	beq LMP_NOT_ACCEPTED_EXT,parse_lmpext_not_accepted
+	beq LMP_SNIFF_SUBRATING_REQ, parse_lmp_sniff_subrating_req
+	beq LMP_SNIFF_SUBRATING_RES, parse_lmp_sniff_subrating_res
+	beq LMP_PACKET_TYPE_TABLE_REQ,parse_lmpext_packet_type_table_req
+	beq LMP_EXT_FEATURES_REQ,parse_lmpext_features_req
+	beq LMP_EXT_FEATURES_RES,parse_lmpext_features_res
+	beq LMP_EXT_CHN_CLASSIFICATION_REQ,parse_lmpext_chn_classification_req
+	beq LMP_PAUSE_ENCRYPTION_REQ,parse_lmpext_pause_encrypt
+	beq LMP_RESUME_ENCRYPTION_REQ,parse_lmpext_resume_encrypt
+	beq LMP_IO_CAP_REQ,parse_lmpext_iocap_req
+	beq LMP_IO_CAP_RES,parse_lmpext_iocap_res
+	beq LMP_PING_REQ,parse_lmpext_ping_req
+	rtneq LMP_EXT_FEATURES_RES
+
+reject_unknown_ext_packet:
+	jam LMP_NOT_ACCEPTED_EXT,mem_lmo_opcode2
+	jam UNKNOWN_LMP_PDU,mem_lmo_reason2
+	rtn
+
+parse_lmpext_ping_req:
+	jam LMP_PING_RES,mem_lmo_opcode2
+	rtn
+	
+parse_lmpext_chn_classification_req:
+	jam LMP_NOT_ACCEPTED_EXT,mem_lmo_opcode2
+	jam NOT_SUPPORT_CHN_CLASSIFICATION,mem_lmo_reason2
+	rtn
+	
+parse_lmpext_iocap_req:
+	call iocap_lmpext_load
+	jam LMP_IO_CAP_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmpext_iocap_res:
+	call iocap_lmpext_load
+	branch iocap_lmpext_common
+	
+iocap_lmpext_load:
+	arg      mem_sp_iocap_remote,contw
+	fetch 3, mem_rxbuf+2
+	istore    3,contw
+	rtn
+	
+iocap_lmpext_common:
+ifdef SIMPLE_PAIRING
+	branch master_set_mem_master_sp_flag,true//is un very ok to use master flag,but we have to add many codes if wo don't
+endif
+	rtn
+parse_lmpext_accepted:
+	fetch 1,mem_rxbuf+3
+	set1 7,pdata
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_PACKET_TYPE_TABLE_REQ,parse_lmpext_accepted_ptt
+	rtn
+
+	
+parse_lmpext_not_accepted:
+	fetch 1,mem_rxbuf+3
+	set1 7,pdata
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_PACKET_TYPE_TABLE_REQ,parse_lmpext_not_accepted_ptt
+	rtn
+
+parse_lmpext_accepted_ptt:
+	fetch 1,mem_ptt
+	fetcht 1,mem_state_map
+	nsetflag blank,smap_edr,temp
+	storet 1,mem_state_map
+parse_lmpext_not_accepted_ptt:
+	fetch 1,mem_state
+	rtnbit0 state_init_seq
+	set0 state_init_seq,pdata
+	store 1,mem_state
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	rtn
+
+parse_lmpext_pause_encrypt:
+	nbranch parse_lmpext_pause_encrypt_slave, master
+	jam LMP_STOP_ENCRYPTION_REQ,mem_lmo_opcode2
+	branch tid_reply
+
+parse_lmpext_pause_encrypt_slave:	
+	jam LMP_PAUSE_ENCRYPTION_REQ, mem_lmo_opcode2
+	rtn
+
+parse_lmpext_resume_encrypt:
+//trans file to pc may cause pause/resume encrypt
+//if ms is conn_sm_wait_end the controllor won't send ack after recieved start_encypt_accept
+	call tid_reply
+	branch lmp_start_encryption
+
+parse_lmpext_features_req:
+	ifetch 1,contr
+	store 1,mem_ext_features_page
+	beq 1,parse_lmpext_features_req_page1
+	beq 2,parse_lmpext_features_req_page2	
+	rtn
+	
+parse_lmpext_features_req_page1:
+	jam LMP_EXT_FEATURES_RES,mem_lmo_opcode2
+	increase 1,contr
+	ifetch 1,contr
+	bbit1 LMP_FEATURES_EXT_PAGE1_SC_HOST_BIT,remote_support_br_sc_host
+	branch remote_not_support_br_sc_host
+	
+parse_lmpext_features_req_page2:
+	jam LMP_EXT_FEATURES_RES,mem_lmo_opcode2
+	increase 1,contr
+	ifetch 2,contr
+	bbit1 LMP_FEATURES_EXT_PAGE2_SC_CONTROLLER_BIT,remote_support_br_sc_controller
+	branch remote_not_support_br_sc_controller
+	
+remote_support_br_sc_controller:
+	fetch 1,mem_remote_br_sc_support
+	set1 REMOTE_BR_SC_CONTROLLER_BIT,pdata
+	call set_remote_br_sc_support
+	
+	fetch 1,mem_remote_br_sc_support
+	rtnne 3
+	fetch 1,mem_secure_connections_enable
+	rtnbit0 SECURE_CONNECTIONS_BR_BIT
+ 	jam ENCAPSULATED_MINOR_TYPE_P256,mem_encapsulated_minor_type
+ 	rtn
+ 	
+remote_not_support_br_sc_controller:
+	fetch 1,mem_remote_br_sc_support
+	set0 REMOTE_BR_SC_CONTROLLER_BIT,pdata
+set_remote_br_sc_support:	
+	store  1,mem_remote_br_sc_support
+	rtn
+	 
+remote_support_br_sc_host:
+	fetch 1,mem_remote_br_sc_support
+	set1 REMOTE_BR_SC_HOST_BIT,pdata
+	branch set_remote_br_sc_support	
+	
+remote_not_support_br_sc_host:
+	fetch 1,mem_remote_br_sc_support
+	set0 REMOTE_BR_SC_HOST_BIT,pdata
+	branch set_remote_br_sc_support	
+	
+parse_lmpext_features_res:
+	fetcht 1,mem_rxbuf+4
+	and temp,0x1,temp
+	storet 1,mem_remote_sppcap
+	fetch 1,mem_hci_cmd
+	bne hci_cmd_wait_remote_ext_feature,parse_lmpext_features_res_not_hci
+	jam 0,mem_hci_cmd
+parse_lmpext_features_res_not_hci:
+	fetch 1,mem_conn_sm
+	rtnne CONN_SM_WAIT_FEATURES_EXT
+	jam CONN_SM_SEND_CONN_REQ,mem_conn_sm
+	branch process_conn_sm
+
+parse_lmp_accepted:
+	bpatchx patch23_0,mem_patch23
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_HOST_CONNECTION_REQ,parse_lmp_accepted_hostconn//ok
+	beq LMP_IN_RAND,parse_lmp_accepted_inrand//ok
+	beq LMP_ENCRYPTION_MODE_REQ,parse_lmp_accepted_enc_mode//ok
+	beq LMP_ENCRYPTION_KEY_SIZE_REQ,parse_lmp_accepted_enc_keysize//ok
+	beq LMP_START_ENCRYPTION_REQ,parse_lmp_accepted_start_enc//ok
+	beq LMP_STOP_ENCRYPTION_REQ,parse_lmp_accepted_stop_enc//ok
+	beq LMP_UNSNIFF_REQ,parse_lmp_accepted_unsniff_req//ok
+	beq LMP_SNIFF_REQ,parse_lmp_accepted_sniff_req//ok
+	beq LMP_SWITCH_REQ,parse_lmp_accepted_switch
+	// simple pairing 
+	beq LMP_ENCAPSULATED_HEADER,parse_lmp_accepted_encapsulated_header//ok
+	beq LMP_ENCAPSULATED_PAYLOAD,parse_lmp_accepted_encapsulated_payload//ok
+	beq LMP_SIMPLE_PAIRING_NUMBER,parse_lmp_accepted_simple_pairing_number//ok
+	beq LMP_DHKEY_CHECK,parse_lmp_accepted_dhkey_check//ok
+	rtn
+	
+parse_lmp_not_accepted:
+	bpatchx patch23_1,mem_patch23
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_NAME_REQ,parse_lmp_not_accepted_name_req//ok
+	beq LMP_HOST_CONNECTION_REQ,parse_lmp_not_accepted_hostconn//ok
+	beq LMP_AU_RAND,parse_lmp_not_accepted_aurand//ok
+	beq LMP_IN_RAND,parse_lmp_not_accepted_inrand//ok
+	beq LMP_SWITCH_REQ,parse_lmp_not_accepted_switch//ok
+	/* simple pairing support */
+	beq  LMP_SIMPLE_PAIRING_NUMBER,parse_lmp_not_accepted_simple_pairing_number//ok
+	beq  LMP_DHKEY_CHECK,parse_lmp_not_accepted_dhkey_check//ok
+	beq LMP_UNSNIFF_REQ,parse_lmp_not_accepted_unsniff_req
+	beq LMP_SNIFF_REQ,parse_lmp_not_acdcept_sniff_req
+	rtn
+
+parse_lmp_accepted_switch:
+	jam BT_EVT_SWITCH_ACCEPT,mem_fifo_temp
+	call ui_ipc_send_event
+	branch role_switch_prepare0
+	
+parse_lmp_not_accepted_switch:
+	jam BT_EVT_SWITCH_NOT_ACCEPT,mem_fifo_temp
+	call ui_ipc_send_event
+	jam SWITCH_FLAG_NOT_ACCEPT,mem_switch_flag
+	setarg TIMER_SWITCH_WAITE
+	arg switch_wait_timer,queue
+	branch timer_init
+
+
+parse_lmp_accepted_hostconn:
+	//fetch 1,mem_state
+	//rtnbit0 state_init_seq
+	fetch 1,mem_lmp_conn_state
+	set1 RECEIVED_CONN_REQ,pdata
+	store 1,mem_lmp_conn_state
+	jam BT_EVT_BB_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	jam LMP_PACKET_TYPE_TABLE_REQ,mem_lmo_opcode2
+	//nbranch parse_lmp_accepted_hostconn_ctn,master
+parse_lmp_accepted_hostconn_ctn:
+	/* checking to see if we requested host connection */
+	fetch 1,mem_conn_sm
+	bne CONN_SM_WAIT_CONN_ACCEPT, parse_rx_done
+	//branch parse_lmp_accepted_hostconn_master,master
+	/* continuing on with host connection state machine */
+	jam CONN_SM_AUTH_PAIR,mem_conn_sm
+	rtn
+	//branch host_create_conn_auth_pair
+
+	/* we need to move fast and send au_rand...jumping to next part of state machine for conn */
+//parse_lmp_accepted_hostconn_master:
+	//jam CONN_SM_AUTH_PAIR ,mem_conn_sm
+//	rtn
+
+parse_lmp_not_accepted_hostconn:
+	jam ACL_CONNECTION_ALREADY_EXISTS,mem_disconn_reason_send
+	jam LMP_DETACH,mem_lmo_opcode2
+	/* clearing connection state machine */
+	jam CONN_SM_STANDBY,mem_conn_sm
+	/* sending error message to host */
+	branch parse_rx_done,true
+	rtn
+
+parse_lmp_accepted_inrand:
+	fetch 1,mem_link_key_exists
+	nrtn blank
+	call clear_linkkey
+	call  lmp_generate_key
+	rtn master
+	set1 mark_slave_in_rand_accepted,mark
+	rtn
+
+parse_lmp_accepted_enc_mode:
+	nrtn master
+	jam LMP_ENCRYPTION_KEY_SIZE_REQ,mem_lmo_opcode2
+	fetch 1,mem_state_map
+	rtnbit0 smap_encryption
+	jam LMP_STOP_ENCRYPTION_REQ,mem_lmo_opcode2
+	rtn
+
+parse_lmp_accepted_enc_keysize:
+	branch lmp_start_encryption
+	
+parse_lmp_accepted_start_enc:
+	call send_create_conn_start_l2cap_timer_sm
+	fetch 1,mem_state
+	rtnbit1 state_conn_comp
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	fetch 1,mem_conn_sm
+	rtnne CONN_SM_ENCRYPT_WAIT
+	jam CONN_SM_ENCRYPT_WAIT_CLEAR,mem_conn_sm
+	rtn
+	
+parse_lmp_accepted_stop_enc:
+	/* again this won't work with multipoint. keep track of anyone else encrypting */
+	//jam HOST_STOP_ENCRYPTION,message_queue_B0
+	//jam 1,message_queue_B1
+	//jam HOST_RETURN_SUCCESS,message_queue_B2
+	//fetch 1,mem_lmp_state2
+	//set1 MESSAGE_QUEUE,pdata
+	//store 1,mem_lmp_state2
+	rtn
+
+parse_lmp_not_accepted_aurand:	
+parse_lmp_not_accepted_aurand_send_detach:	
+	fetch 1,mem_device_option
+	sub pdata,dvc_op_mouse,null
+	call mouse_delay_enter_hibernata,zero
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam OTHER_END_TERMINATED,mem_disconn_reason_send
+	rtn
+/*in pair remote cancel the pair*/
+parse_lmp_not_accepted_inrand:
+	fetch 1,mem_rxbuf+2
+	beq KEY_MISSING,parse_lmp_inrand_key_missing
+	rtnne PAIRING_NOT_ALLOWED
+	jam PAIRING_NOT_ALLOWED,mem_disconn_reason_send
+	jam LMP_DETACH,mem_lmo_opcode2
+	rtn	
+parse_lmp_inrand_key_missing:
+	jam KEY_MISSING,mem_disconn_reason_send
+	jam LMP_DETACH,mem_lmo_opcode2
+	rtn
+	
+parse_lmp_not_accepted_name_req:
+	rtn
+	
+parse_lmp_not_accepted_simple_pairing_number:
+	jam SP_STAT_NULL,mem_sp_state
+	jam LMP_DETACH,mem_lmo_opcode2
+	branch parse_rx_done
+	
+parse_lmp_not_accepted_dhkey_check:
+	jam SP_STAT_NULL,mem_sp_state
+	jam LMP_DETACH,mem_lmo_opcode2
+	branch parse_rx_done
+parse_lmp_not_accepted_unsniff_req:
+	jam BT_EVT_UNSNIFF_NOT_ACCEPT,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+parse_lmp_accepted_unsniff_req:
+	jam BT_EVT_UNSNIFF_ACCEPT,mem_fifo_temp
+	call ui_ipc_send_event
+	branch sniff_exit
+	
+parse_lmp_accepted_sniff_req:
+	jam BT_EVT_SNIFF_ACCEPT,mem_fifo_temp
+	call ui_ipc_send_event
+	setarg 0
+	store 2,mem_dsniff
+	fetch 2,mem_sniff_param_interval
+	lshift pdata,pdata
+	store 2,mem_tsniff
+	fetch 1,mem_sniff_param_attempt
+	store 1,mem_sniff_attempt
+	fetch 1,mem_sniff_param_timeout
+	store 1,mem_sniff_timeout
+	branch sniff_init
+	
+parse_lmp_not_acdcept_sniff_req:
+	jam BT_EVT_SNIFF_NOT_ACCEPT,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+parse_lmp_crypt_key:
+	fetcht 1,mem_rxbuf+1
+	sub temp,6,null
+	branch lmp_reject_pdu_not_allowed,positive
+	storet 1,mem_key_size
+	branch accept_lmp_msg
+	
+parse_lmp_setup_complete:
+	fetch 1,mem_lmp_conn_state
+	set1 RECEIVED_SETUP_COMPLETE,pdata
+	store 1,mem_lmp_conn_state
+	rtnbit1 SENT_SETUP_COMPLETE
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	branch parse_rx_done
+	
+parse_lmp_max_slot:
+	//jam LMP_MAX_SLOT,mem_lmi_opcode2
+	//branch accept_lmp_msg
+	rtn
+	
+parse_lmp_max_slot_req:
+	fetch 1,mem_max_slot
+	fetcht 1,mem_rxbuf+1
+	isub temp,null
+	//jam LMP_MAX_SLOT_REQ,mem_lmi_opcode2
+	branch accept_lmp_msg,positive
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	jam UNSPECIFIED_ERROR,mem_lmo_reason2
+	jam LMP_MAX_SLOT_REQ,mem_lmi_opcode2
+	rtn
+	
+parse_lmp_detach:
+	branch prepare_disconnect
+	
+accept_lmp_msg:
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	rtn
+
+parse_lmp_incr_power:
+	jam LMP_MAX_POWER,mem_lmo_opcode2
+	rtn
+
+parse_lmp_decr_power:
+	jam LMP_MIN_POWER,mem_lmo_opcode2
+	rtn
+	
+parse_lmp_version_res:
+	fetch 1,mem_conn_sm
+	rtneq CONN_SM_WAIT_VERSION
+	/* continuing on with host connection state machine */
+	jam CONN_SM_SEND_FEATURES ,mem_conn_sm
+	/* we need to move fast and send au_rand...jumping to next part of state machine for conn */
+	rtn
+
+
+parse_lmp_auto_rate:
+	rtn	
+
+parse_lmp_in_rand:
+	fetch 1,mem_sc_only_mode
+	nbranch parse_lmp_in_rand_not_accept,blank
+	
+	call lmp_copy_rand
+	jam pincode_state_wait_pincode,mem_pincode_state
+	jam BT_EVT_PINCODE_REQ,mem_fifo_temp
+	call ui_ipc_send_event
+
+	call tid_check
+	nbranch lmp_accept_inrand,true
+	nbranch parse_lmp_inrand_res,master // ignore this because of not ssp temporary
+parse_lmp_in_rand_not_accept:
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	jam LMP_IN_RAND,mem_lmi_opcode2
+	jam TRANSACTION_COLLISION,mem_lmo_reason2
+	rtn
+	
+parse_lmp_inrand_res:
+	fetch 1,mem_op
+	set1 op_inrand_req,pdata
+	store 1,mem_op
+	rtn
+
+//store current tid
+pop_tid_follow:
+	fetcht 1,mem_state_map
+	nsetflag blank,smap_lmptid,temp
+	storet 1,mem_state_map
+	rtn
+	
+//restore current tid
+push_tid_follow:
+	fetch 1,mem_lmo_tid2
+	rshift pdata,pdata
+	and_into 1,pdata
+	rtn
+
+parse_lmp_au_rand_moudle:
+	fetch 1,mem_nv_data_number
+	rtn blank
+	fetch 1,mem_pairing_auth
+	call load_device_list,blank
+	rtn	
+
+parse_lmp_au_rand:
+	call parse_lmp_au_rand_moudle
+	call push_tid_follow
+	store 1,mem_sres_tid
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,parse_lmp_au_rand_256
+	call lmp_copy_rand
+	jam LMP_SRES,mem_lmo_opcode2
+parse_lmp_au_rand_common:	
+	fetch 1,mem_link_key_exists
+	nrtn blank
+	fetch 1,mem_state
+	rtnbit1 state_combkey		/* we have comb key, but not verified */
+	jam KEY_MISSING,mem_lmo_reason2
+	branch reject_lmp_packet
+	
+parse_lmp_au_rand_256:
+	jam LMP_AU_RAND,mem_lmo_opcode2
+	arg mem_sp_random_remote,contw
+	arg mem_rxbuf+1,contr
+	call memcpy16	
+	branch parse_lmp_au_rand_common
+
+	
+parse_lmp_sres:	
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,parse_lmp_sres_256
+
+	arg mem_plap,rega
+	call function_e1
+	fetcht 4,mem_input_store
+	fetch 4,mem_rxbuf+1
+	isub temp,null
+	branch authentication_ok,zero
+authentication_fail:	
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam AUTHENTICATION_FAILURE_ERROR,mem_disconn_reason_send	
+	rtn
+	
+authentication_ok:
+	call copy_aco
+	call authentication_ok_common
+	fetch 1,mem_ssp_enable
+	branch  pairing_success,blank
+	rtn
+
+parse_lmp_sres_256:
+	fetch 4,mem_rxbuf+1
+	fetcht 4,mema
+	isub temp,null
+	branch authentication_ok_256,zero
+	branch authentication_fail
+	
+authentication_ok_256:
+	call authentication_ok_common
+	fetch 1,mem_secure_connections_enable
+	bbit1  SECURE_CONNECTIONS_BR_BIT,pairing_success
+	rtn
+	
+	
+authentication_ok_common:
+	call linkkey_ready///save link key
+	fetch 1,mem_op
+	isolate1 op_auth_req,pdata
+	set0 op_auth_req,pdata
+	store 1,mem_op
+	fetch 1,mem_conn_sm
+	beq CONN_SM_AUTH_WAIT,authentication_ok_conn_sm
+	beq CONN_SM_PAIRING_WAIT,authentication_ok_conn_sm
+	rtn
+authentication_ok_conn_sm:
+	fetch 1,mem_pairing_auth
+	rtnne DEFALT_PAIRING_AUTH
+	fetch 1,mem_state_map
+	rtnbit1 smap_encryption
+	branch host_create_conn_encrypt
+
+parse_lmp_comb_key:
+	arg mem_rxbuf+1,rega
+	arg mem_kinit,regb
+	arg mem_random_number,contw
+	call xor16
+	arg mem_plap,rega
+	call generate_linkkey
+	jam LMP_AU_RAND,mem_lmo_opcode2
+	fetch 1,mem_state
+	bbit0 state_combkey,lmp_generate_key
+	rtn
+	
+parse_lmp_name_res:
+	fetch 2,mem_len
+	add pdata,-3,loopcnt	//for remote name length error
+	fetcht 1,mem_rxbuf+1
+	setarg mem_tmp_buffer
+	iadd temp,contw
+	arg mem_rxbuf+3,contr
+	call memcpy
+	fetcht 1,mem_name_offset
+	fetch 1,mem_rxbuf+2
+	isub temp,pdata
+	sub pdata,14,null
+	branch parse_lmp_name_res_end,positive
+	add temp,14,pdata
+	store 1,mem_name_offset
+	jam LMP_NAME_REQ,mem_lmo_opcode2
+	rtn
+parse_lmp_name_res_end:
+	fetch 1,mem_state_map
+	set1 smap_name_res,pdata
+	store 1,mem_state_map
+	bbit1 smap_name_req,lmp_disconnect
+	rtn
+parse_lmp_name_req:
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_opcode2 //offset 
+	jam LMP_NAME_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmp_conn_req:
+	branch accept_lmp_msg
+
+parse_lmp_timing_accuracy_req:
+	jam LMP_TIMING_ACCURACY_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmp_features_req:
+	jam LMP_FEATURES_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmp_version_req:
+	jam LMP_VERSION_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmp_supervision_timeout:
+//	fetch 2,mem_rxbuf+1
+//	store 2,mem_supervision_to
+	rtn
+	
+
+
+parse_lmp_sniff_subrating_req:
+	fetch 2,mem_tsniff
+	iforce temp
+	fetch 1,mem_rxbuf+2
+	store 1,mem_subsniff_rate
+	imul32 temp,temp
+	fetch 2,mem_rxbuf+3
+	lshift pdata,pdata
+	store 2,mem_subsniff_tcmax
+	fetch 4,mem_rxbuf+5
+	lshift pdata,pdata
+ 	store 4,mem_subsniff_instant
+	//product pdata
+	deposit temp
+	store 2,mem_subsniff_tsniff
+	rtn
+parse_lmpext_packet_type_table_req:
+	fetcht 1,mem_ptt
+	fetch 1,mem_rxbuf+2
+	ixor temp,null
+	nbranch reject_unknown_ext_packet,zero
+	isolate1 0,pdata
+	fetch 1,mem_state_map
+	setflag true,smap_edr,pdata
+	store 1,mem_state_map
+	jam LMP_EXT_ACCEPTED,mem_lmo_opcode2
+	jam LMP_PACKET_TYPE_TABLE_REQ,mem_lmi_opcode2
+	rtn
+
+	
+parse_lmp_sniff_subrating_res:
+parse_lmp_preferred_rate:
+parse_lmp_max_power:
+parse_lmp_min_power:
+	rtn
+parse_lmp_page_mode_req:
+	//jam LMP_PAGE_MODE_REQ,mem_lmi_opcode2
+	branch accept_lmp_msg
+parse_lmp_page_scan_mode_req:
+	//this can influence connection. need accepted
+	//jam LMP_PAGE_SCAN_MODE_REQ,mem_lmi_opcode2
+	branch accept_lmp_msg
+
+
+	
+parse_lmp_slot_offset:
+	fetch 2,mem_rxbuf+1
+	store 2,mem_slot_offset
+	rtn
+
+parse_lmp_sniff_req_check_sniff_para:
+	fetch 2,mem_rxbuf+4 /* tsniff */
+	fetcht 1,mem_lpm_mult
+	imul32 temp,pdata
+	arg 0x640,temp
+	isub temp,null
+//	branch lmp_reject_pdu_not_allowed,positive
+	rtn
+	
+parse_lmp_sniff_req:
+	fetch 2,mem_rxbuf+6
+	branch lmp_reject_pdu_not_allowed,blank
+	call parse_lmp_sniff_req_check_sniff_para
+	branch lmp_reject_pdu_not_allowed,positive
+	fetch 1,mem_device_option
+	sub pdata,dvc_op_module,null
+	call module_set_lpm_mult_2,zero
+	fetch 1,mem_state
+	bbit1 state_insniff,lmp_reject_pdu_not_allowed
+	fetch 2,mem_rxbuf+2 /* dsniff */
+	lshift pdata,pdata
+	store 2,mem_dsniff	
+	fetch 2,mem_rxbuf+4 /* tsniff */
+	lshift pdata,pdata
+	store 2,mem_tsniff
+	fetch 2,mem_rxbuf+6 /* sniff attempt */
+	store 1,mem_sniff_attempt
+	iforce temp
+	fetch 2,mem_rxbuf+8 /* sniff timeout */
+	store 1,mem_sniff_timeout
+	isub temp,null
+	nbranch set_big_value_to_attempt,positive
+	store 1,mem_sniff_attempt
+set_big_value_to_attempt:	
+	//call sniff_init
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_SNIFF_REQ,mem_lmi_opcode2
+	rtn
+
+parse_lmp_start_encryption_req:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,parse_lmp_start_encryption_req_256
+	call accept_lmp_msg
+	call lmp_copy_rand
+	call function_e3
+	branch start_encryption
+
+parse_lmp_start_encryption_req_256:
+	call accept_lmp_msg
+//	call lmp_copy_rand
+	call start_encryption
+calc_kc:	
+	call function_h3
+	arg mem_kc,contw
+	arg mem_sp_calc_result_high,contr
+	arg 0x10,loopcnt
+	branch reverse_byte
+	
+parse_lmp_stop_encryption_req:
+	call accept_lmp_msg
+	branch stop_encryption
+	
+
+parse_lmp_switch_req:
+	fetch 4,mem_rxbuf+1
+	lshift pdata,pdata
+	//branch parse_lmp_switch_req_not_accept
+	branch parse_lmp_switch_accept,master
+	fetcht 1,mem_link_key_exists
+	nbranch parse_lmp_switch_req_clear_mark,blank
+parse_lmp_switch_req_not_accept:
+	jam LMP_SWITCH_REQ,mem_lmi_opcode2
+	branch lmp_reject_pdu_not_allowed
+	
+parse_lmp_switch_req_clear_mark:
+	jam LMP_SLOT_OFFSET,mem_lmo_opcode2
+	jam 0,mem_conn_sm
+	branch role_switch_prepare
+
+parse_lmp_switch_accept:
+	call role_switch_prepare
+	set1 mark_reconn_recieve_switch,mark
+	fetch 1,mem_connection_options
+	set0 CONNECTION_SWITCH,pdata
+	store 1,mem_connection_options
+	branch accept_lmp_msg
+
+	
+
+parse_lmp_temp_rand:
+parse_lmp_temp_key:
+parse_lmp_timing_accuracy_res:	
+parse_lmp_unit_key:	
+parse_lmp_use_semi_permanend_key:
+	rtn
+
+	
+parse_lmp_unsniff_req:
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_UNSNIFF_REQ,mem_lmi_opcode2
+	jam BT_EVT_REMOTE_UNSNIFF,mem_fifo_temp
+	call ui_ipc_send_event
+	branch sniff_exit
+	
+parse_lmp_encapsulated_header:
+	jam 0,mem_sp_remote_key_recv_count
+	fetch 1,mem_rxbuf+1
+	store 1,mem_encapsulated_major_type
+	bne ENCAPSULATED_MAJOR_TYPE,lmp_reject_pdu_not_allowed
+	fetcht 1,mem_rxbuf+2
+	storet 1,mem_encapsulated_minor_type
+	
+	fetch 1,mem_sc_only_mode
+	branch parse_lmp_encapsulated_header2,blank
+	sub temp,ENCAPSULATED_MINOR_TYPE_P256,null
+	nbranch authentication_fail,zero
+parse_lmp_encapsulated_header2:
+	fetch 1,mem_rxbuf+3
+	beq ENCAPSULATED_LEN_P256,parse_lmp_encapsulated_header3
+	beq ENCAPSULATED_LEN_P192,parse_lmp_encapsulated_header3
+	branch lmp_reject_pdu_not_allowed
+
+parse_lmp_encapsulated_header3:
+	store 1,mem_encapsulated_len	
+	call check_localsm
+	branch parse_lmp_encapsulated_header_master,true
+	jam SP_STAT_KEY_RECV,mem_sp_state
+parse_lmp_encapsulated_header_master:
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_ENCAPSULATED_HEADER,mem_lmi_opcode2
+	branch parse_rx_done
+	
+	
+parse_lmp_accepted_encapsulated_header:
+	//jam LMP_ENCAPSULATED_PAYLOAD,mem_lmi_opcode2
+	//branch   accept_lmp_msg  	
+	jam LMP_ENCAPSULATED_PAYLOAD,mem_lmo_opcode2
+      //   branch   accept_lmp_msg  	
+         rtn
+parse_lmp_accepted_simple_pairing_number:
+	fetch 1,mem_ssp_mode_flag
+	beq SSP_MODE_SSP_PIN_FLAG,parse_lmp_accepted_simple_pairing_number_ssp_pin
+	beq SSP_MODE_PASSKEY_ENTRY_FLAG,parse_lmp_accepted_simple_pairing_number_passkey
+parse_lmp_accepted_simple_pairing_number_common:
+	call check_localsm
+	rtn true
+	jam SP_STAT_CONFIRM_RECV,mem_sp_state
+	rtn
+
+parse_lmp_accepted_simple_pairing_number_ssp_pin:
+	call g_noninit_number_confirm
+	jam BT_EVT_BT_GKEY_GENERATE,mem_fifo_temp
+	call ui_ipc_send_event
+	branch parse_lmp_accepted_simple_pairing_number_common
+
+
+parse_lmp_accepted_simple_pairing_number_passkey:
+	call check_localsm
+	rtn true
+	fetch 1,mem_authentication_passkey_times
+	beq 19,authentication_passkey_end
+	increase 1,pdata
+	store 1,mem_authentication_passkey_times
+//	branch p_authentication_passkey
+
+authentication_passkey:
+	jam SP_FLAG_COMMIT,mem_sp_flag
+	jam SP_STAT_COMMIT_CALC,mem_sp_state 
+	fetch 1,mem_authentication_passkey_times
+	copy pdata,queue
+	fetch 6,mem_pin
+	qisolate1 pdata
+	setarg 0x80
+	setflag true,0,pdata
+	store 1,mem_passkey_1bit
+	rtn
+
+authentication_passkey_end:	
+	jam SP_STAT_CONFIRM_RECV,mem_sp_state
+	rtn
+
+parse_lmp_accepted_dhkey_check:
+	call parse_lmp_accepted_dhkey_check_common
+pairing_success:
+	fetch 1,mem_flag_pairing_state
+	rtn blank
+	jam FLAG_PAIRING_STATE_NOT_PAIRING,mem_flag_pairing_state
+	jam BT_EVT_BT_PAIRING_SUCCESS,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+parse_lmp_accepted_dhkey_check_common:
+	call check_localsm
+ifdef SIMPLE_PAIRING
+	ncall g_noninit_192,true	//when be master  call g_init
+	call g_init_192,true
+endif
+	call check_localsm
+	rtn true
+	jam SP_STAT_LINK_KEY_CALC,mem_sp_state
+	jam SP_FLAG_COMMIT,mem_sp_flag
+	rtn
+
+parse_simple_pairing_confirm:
+	arg mem_sp_confirm_remote,contw
+	arg mem_rxbuf+1,contr
+	call memcpy16
+	fetch 1,mem_ssp_mode_flag
+	rtneq  SSP_MODE_PASSKEY_ENTRY_FLAG
+ifdef SIMPLE_PAIRING
+	branch master_set_mem_master_sp_flag
+endif
+	rtn
+	
+parse_lmp_encapsulated_payload:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P192,parse_lmp_encapsulated_payload_192
+	beq ENCAPSULATED_MINOR_TYPE_P256,parse_lmp_encapsulated_payload_256
+	branch lmp_reject_pdu_not_allowed
+
+parse_lmp_encapsulated_payload_256:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_RANDOM_SEND,parse_encapsulated_payload_256_master
+	fetch    1,mem_sp_state
+	bne SP_STAT_KEY_RECV,lmp_reject_pdu_not_allowed
+parse_encapsulated_payload_256_master:
+	fetch    1,mem_sp_remote_key_recv_count
+	sub      pdata,0x30,contw
+	nbranch  lmp_reject_pdu_not_allowed,positive
+	arg      mem_le_pubkey_remote_x_256,contw
+	iadd     contw,contw
+	fetch 8,mem_rxbuf+1
+	istore   8,contw
+	fetch 8,mem_rxbuf+9
+	istore   8,contw
+	fetch    1,mem_sp_remote_key_recv_count
+	increase 16,pdata
+	store    1,mem_sp_remote_key_recv_count
+	bne ENCAPSULATED_LEN_P256,accept_lmp_msg
+	branch parse_lmp_encapsulated_payload_completed
+
+parse_lmp_encapsulated_payload_192:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_RANDOM_SEND,parse_encapsulated_payload_192_master
+	fetch    1,mem_sp_state
+	bne SP_STAT_KEY_RECV,lmp_reject_pdu_not_allowed
+parse_encapsulated_payload_192_master:
+	fetch    1,mem_sp_remote_key_recv_count
+	sub      pdata,0x20,contw
+	nbranch  lmp_reject_pdu_not_allowed,positive
+	arg      mem_sp_pubkey_remote,contw
+	iadd     contw,contw
+	fetch 8,mem_rxbuf+1
+	istore   8,contw
+	fetch 8,mem_rxbuf+9
+	istore   8,contw
+	fetch    1,mem_sp_remote_key_recv_count
+	increase 16,pdata
+	store    1,mem_sp_remote_key_recv_count
+	bne ENCAPSULATED_LEN_P192,accept_lmp_msg
+parse_lmp_encapsulated_payload_completed:
+	call check_localsm
+	branch accept_lmp_msg,true
+	jam      SP_KEY_VALID,mem_sp_remote_key_invalid
+	jam      SP_STAT_KEY_GENERATE,mem_sp_state
+	jam      SP_FLAG_COMMIT,mem_sp_flag  
+	branch   accept_lmp_msg
+	
+	
+parse_lmp_accepted_encapsulated_payload: 
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P192,parse_lmp_accepted_encapsulated_payload_192
+	beq ENCAPSULATED_MINOR_TYPE_P256,parse_lmp_accepted_encapsulated_payload_256
+	rtn
+	
+parse_lmp_accepted_encapsulated_payload_192:
+	fetch 1,mem_sp_local_key_send_count
+	beq	ENCAPSULATED_LEN_P192,parse_lmp_encapsulated_payload_all_accepted
+	jam LMP_ENCAPSULATED_PAYLOAD,mem_lmo_opcode2
+	rtn    
+	
+parse_lmp_accepted_encapsulated_payload_256:
+	fetch 1,mem_sp_local_key_send_count
+	beq	ENCAPSULATED_LEN_P256,parse_lmp_encapsulated_payload_all_accepted
+	jam LMP_ENCAPSULATED_PAYLOAD,mem_lmo_opcode2
+	rtn    
+	
+parse_lmp_encapsulated_payload_all_accepted:   
+	call check_localsm
+	branch parse_lmp_encapsulated_payload_all_accepted_master,true
+	fetch 1,mem_ssp_mode_flag
+	beq SSP_MODE_PASSKEY_ENTRY_FLAG,parse_lmp_encapsulated_payload_all_accepted_get_passkey
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	jam      SP_STAT_COMMIT_CALC,mem_sp_state 
+	branch   parse_rx_done
+
+parse_lmp_encapsulated_payload_all_accepted_get_passkey:
+	jam BT_EVT_BT_GET_PASSKEY,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+parse_lmp_encapsulated_payload_all_accepted_master:
+	//call sp_master_generate_local_key
+	branch   parse_rx_done   
+
+parse_lmp_simple_pairing_number:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_RANDOM_SEND,parse_lmp_simple_pairing_number_master
+	fetch    1,mem_sp_state
+	bne SP_STAT_RANDOM_RECV,lmp_reject_pdu_not_allowed
+parse_lmp_simple_pairing_number_master:
+	arg      mem_sp_random_remote,contw
+	fetch 8,mem_rxbuf+1
+	istore   8,contw
+	fetch 8,mem_rxbuf+9
+	istore   8,contw
+	call check_localsm
+	branch parse_lmp_simple_pairing_number_master0,true
+	jam      SP_STAT_RANDOM_SEND,mem_sp_state
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	branch accept_lmp_msg  
+parse_lmp_simple_pairing_number_master0:
+	jam SP_STAT_COMMIT_CALC,mem_master_sp_state
+ifdef SIMPLE_PAIRING
+	branch master_set_mem_master_sp_flag
+endif
+	branch lmp_reject_pdu_not_allowed	
+	
+parse_dhkey_check:
+	fetch    1,mem_master_sp_state
+	beq SP_STAT_CONFIRM_SEND,parse_dhkey_check_master
+	fetch    1,mem_sp_state
+	bne SP_STAT_CONFIRM_RECV,lmp_reject_pdu_not_allowed
+parse_dhkey_check_master:
+	arg mem_sp_check_result,contw
+	arg mem_rxbuf+1,contr
+	call memcpy16
+	call check_localsm
+	branch parse_dhkey_check_master0,true
+	fetch 1,mem_ssp_mode_flag
+	beq SSP_MODE_SSP_PIN_FLAG,number_comparison_mode
+number_comparison_successed:
+	jam 0,mem_flag_mode_ssp_pin
+	jam SP_STAT_CONFIRM_CHECK,mem_sp_state
+	jam SP_FLAG_COMMIT,mem_sp_flag
+	jam LMP_DHKey_Check,mem_lmi_opcode2
+	branch   parse_rx_done
+	
+parse_dhkey_check_master0:
+	jam      SP_STAT_CONFIRM_CHECK,mem_master_sp_state
+	jam      SP_FLAG_COMMIT,mem_master_sp_flag
+	branch   parse_rx_done
+	
+lmp_reject_pdu_not_allowed:
+	jam PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch reject_lmp_packet
+
+number_comparison_mode:
+	fetch 1,mem_flag_mode_ssp_pin
+	bbit1 FLAG_MODE_SSP_PIN_REVICEVE_COMPARISON_BIT ,comparison_result
+	set1 FLAG_MODE_SSP_PIN_RECIEVE_DHKEY_BIT,pdata
+	store 1,mem_flag_mode_ssp_pin
+	rtn
+	
+comparison_result:
+	bbit1 FLAG_MODE_SSP_PIN_COMPARISON_RESULT_BIT,number_comparison_successed
+	jam 0,mem_flag_mode_ssp_pin
+	branch lmp_reject_pdu_not_allowed
+
+	
+parse_lmp_clkoffset_res:
+	branch parse_rx_done
+		
+parse_lmp_encryption_mode_req:
+	fetch 1,mem_connection_options
+	set0 CONNECTION_ENCRYPT,pdata
+	store 1,mem_connection_options
+	call accept_lmp_msg
+	nrtn master					/* do sth only if we're master */
+	fetch 1,mem_rxbuf+1
+	fetcht 1,mem_op
+	setflag blank,op_stop_enc,temp
+	nsetflag blank,op_start_enc,temp
+	storet 1,mem_op
+	rtn 
+	
+parse_lmp_features_res:
+	fetcht 8,mem_rxbuf+1		/*fix bcp(baoshijie) err*/
+parse_lmp_features_res_not_hci:	
+	fetch 1,mem_conn_sm
+	rtnne CONN_SM_WAIT_FEATURES_RES
+
+	fetch 1,mem_connection_options
+	bbit0 CONNECTION_FEATURE_EXT,parse_lmp_send_conn
+
+	jam CONN_SM_SEND_FEATURES_EXT,mem_conn_sm
+	rtn
+parse_lmp_send_conn:
+	jam CONN_SM_SEND_CONN_REQ,mem_conn_sm
+	rtn
+parse_lmp_test_activate:
+	fetch 1,mem_debug_config
+	store 1,mem_test_mode_old_debug_config
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_TEST_ACTIVATE,mem_lmi_opcode2
+	rtn
+parse_lmp_test_control:
+	/* the 9 test control parameters are XORed with 0x55 */
+	/* doing the XOR here and storing in mem_temp_payload */
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_TEST_CONTROL,mem_lmi_opcode2
+	force 9,loopcnt
+	arg mem_rxbuf+1,contr
+	arg mem_temp_payload,contw
+parse_lmp_test_xor:
+	ifetch 1,contr
+	xor_into 0x55,pdata
+	istore 1,contw
+	loop parse_lmp_test_xor
+	fetch 1,test_mode_scenario
+	fetcht 1,mem_tester_emulate
+	set0 tester_no_whitening,temp
+	set0 tester_pattern_test,temp
+	beq EXIT_TEST_MODE,	 parse_lmp_test_control_exit
+	beq PAUSE_TEST_MODE,	 parse_lmp_test_control_pause
+	beq CLOSED_LOOP_BACK_ACL,	 parse_lmp_test_control_loopback
+	beq ACL_WITHOUT_WHITENING,	 parse_lmp_test_control_loopback_nowhite
+	beq CLOSED_LOOP_BACK_SCO,	 parse_lmp_test_control_loopback
+	beq SCO_WITHOUT_WHITENING,	 parse_lmp_test_control_loopback_nowhite
+	beq ZERO_PATTERN,	 parse_lmp_test_control_pattern
+	beq ONE_PATTERN,	 parse_lmp_test_control_pattern
+	beq ALT_PATTERN,	 parse_lmp_test_control_pattern
+	beq ALT2_PATTERN,	 parse_lmp_test_control_pattern
+	beq PSEUDORANDOM,	 parse_lmp_test_control_pattern
+	rtn
+parse_lmp_test_control_exit:
+	/* restoring old parameters */
+	fetch 1,mem_tester_emulate
+	set1 tester_exit,pdata
+	set1 tester_change,pdata
+	store 1,mem_tester_emulate
+	rtn
+parse_lmp_test_control_pattern:
+	set1 tester_pattern_test,temp
+	jam 5,mem_lch_code
+	fetch 2,test_mode_data_length
+	iforce loopcnt
+	store 2,mem_len
+	arg mem_rxbuf,contw
+	call pn9
+parse_lmp_test_control_loopback_nowhite:
+	set1 tester_no_whitening,temp
+parse_lmp_test_control_loopback:
+	set1 tester_change,temp
+	force 0,pdata
+	store 1,mem_slave_rcvcnt
+	store 2,mem_tst_pktcnt_crc
+	store 2,mem_tst_pktcnt_dmh
+	store 2,mem_tst_pktcnt_hec
+	store 2,mem_tst_pktcnt_sync
+	fetch 1,test_mode_hopping_mode
+	compare FIXED_FREQ,pdata,0xff
+	setflag true,tester_fixed_freq,temp
+	storet 1,mem_tester_emulate
+	rtn
+
+parse_lmp_test_control_pause:
+	set0 mark_testmode,mark
+	jam 0,mem_tester_emulate
+	fetch 1,mem_debug_config
+	set0 debug_tx_pattern,pdata
+	store 1,mem_debug_config
+	rtn
+
+
+	
+	
+
+lmp_copy_rand:	
+	arg mem_rxbuf+1,contr
+	arg mem_random_number,contw
+	branch memcpy16
+
+lmp_generate_key:
+	jam LMP_COMB_KEY,mem_lmo_opcode2
+	rtn
+
+lmp_start_encryption:
+	nrtn master
+	jam LMP_START_ENCRYPTION_REQ,mem_lmo_opcode2
+	rtn
+	
+lmp_accept_inrand:
+	arg mem_lap,rega
+	call generate_kinit
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_IN_RAND,mem_lmi_opcode2
+	rtn
+
+lmp_disconnect:
+	jam 10,mem_conn_timer
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam LOCAL_HOST,mem_disconn_reason_send	
+	rtn
+
+/*********************************/
+/*********lmp send*************/
+/********************************/
+	/* enable user if a lmp packet is to send */
+send_lmp:
+	bpatchx patch23_2,mem_patch23
+	disable user
+	call lmo_fifo_process
+	fetch 1,mem_lmp_to_send
+	rtn blank
+/* lmp message to be processed. this will either be because host??? */
+/* wants to send a lmp message or because one resulted from the LMP */
+/* processing section */
+/********* outgoing lmp lookup table *************/
+	bbit1 7,send_lmp_escape
+send_lmp0:
+	beq LMP_NAME_REQ,	 send_lmp_name_req
+	beq LMP_NAME_RES,	 send_lmp_name_res
+	beq LMP_ACCEPTED,	 send_lmp_accepted
+	beq LMP_NOT_ACCEPTED,	 send_lmp_not_accepted
+	beq LMP_FEATURES_REQ,	 send_lmp_features_req
+	beq LMP_FEATURES_RES,	 send_lmp_features_res
+	beq LMP_TIMING_ACCURACY_RES,	 send_lmp_timing_accuracy_res
+	beq LMP_VERSION_REQ,	 send_lmp_version_req
+	beq LMP_VERSION_RES,	 send_lmp_version_res
+	beq LMP_SETUP_COMPLETE,	 send_lmp_setup_complete
+	beq LMP_SUPERVISION_TIMEOUT,	 send_lmp_superto
+	beq LMP_HOST_CONNECTION_REQ,send_lmp_no_payload
+	beq LMP_IN_RAND,send_lmp_inrand
+	beq LMP_COMB_KEY,send_lmp_comb_key
+	beq LMP_AU_RAND,send_lmp_aurand
+	beq LMP_SRES,send_lmp_sres
+	beq LMP_ENCRYPTION_MODE_REQ,send_lmp_encryption_mode_req
+	beq LMP_ENCRYPTION_KEY_SIZE_REQ,send_lmp_encryption_key_size_req
+	beq LMP_START_ENCRYPTION_REQ,send_lmp_start_encryption
+	beq LMP_DETACH,send_lmp_detach
+	beq LMP_QUALITY_OF_SERVICE_REQ, send_lmp_quality_of_service_req
+	beq LMP_UNIT_KEY,send_lmp_unit_key
+	//Optional (O)
+	beq LMP_INCR_POWER_REQ,send_lmp_inc_power	
+	beq LMP_CLKOFFSET_RES, send_lmp_clkoffset_res	
+	beq LMP_MAX_POWER,send_lmp_nopayload_reply
+	beq LMP_MAX_SLOT, send_lmp_max_slot
+	beq LMP_MAX_SLOT_REQ, send_lmp_max_slot_req
+	beq LMP_MIN_POWER,send_lmp_nopayload_reply
+	beq LMP_SLOT_OFFSET, send_lmp_slot_offset
+	beq LMP_SWITCH_REQ, send_lmp_switch_req
+	beq LMP_SNIFF_REQ, send_lmp_sniff_req
+	beq LMP_STOP_ENCRYPTION_REQ, send_lmp_stop_encryption_req	
+	beq LMP_TIMING_ACCURACY_REQ, send_lmp_timing_accuracy_req
+	beq LMP_UNSNIFF_REQ, send_lmp_unsniff_req
+	beq LMP_ENCAPSULATED_HEADER,send_lmp_encapsulated_header
+	beq LMP_ENCAPSULATED_PAYLOAD,send_lmp_encapsulated_payload
+	beq LMP_SIMPLE_PAIRING_CONFIRM,send_lmp_simple_pairing_comfirm
+	beq LMP_SIMPLE_PAIRING_NUMBER,send_lmp_simple_pairing_number
+	beq LMP_DHKEY_CHECK,send_lmp_dhkey_check
+	beq LMP_AUTO_RATE,send_lmp_auto_rate
+	beq LMP_ENC_KEY_SIZE_MASK_RES,send_lmp_enc_key_size_mask_res
+	//master only must(M)
+	beq LMP_CLKOFFSET_REQ, send_lmp_clkoffset_req
+	beq LMP_QUALITY_OF_SERVICE, send_lmp_quality_of_service
+	beq LMP_TEST_ACTIVATE, send_lmp_test_activate
+	beq LMP_TEST_CONTROL, send_lmp_test_control
+send_lmp_error:
+	branch assert
+	rtn
+send_lmp_escape:
+	beq LMP_EXT_ACCEPTED,send_lmpext_accepted
+	beq LMP_EXT_FEATURES_REQ,send_lmpext_features_req
+	beq LMP_EXT_FEATURES_RES,send_lmpext_features_res
+	beq LMP_NOT_ACCEPTED_EXT,send_lmpext_not_accepted
+	beq LMP_PACKET_TYPE_TABLE_REQ,send_lmpext_packet_type_table_req
+	beq LMP_PAUSE_ENCRYPTION_REQ,send_lmpext_pause_encryption_req
+	beq LMP_IO_CAP_REQ,send_lmp_io_cap_req
+	beq LMP_IO_CAP_RES,send_lmpext_io_cap_res
+	beq LMP_SNIFF_SUBRATING_REQ,send_lmpext_sniff_subrating_req
+	beq LMP_SNIFF_SUBRATING_RES,send_lmpext_sniff_subrating_res
+	beq LMP_PING_RES,send_lmpext_ping_res
+	branch assert
+
+
+/******** LMP follow messages **********/
+/****** TID follow received packet  *******/
+
+send_lmp_accepted:
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_lmi_opcode
+	istore 1,contw
+	call send_lmp_follow
+	bpatchx patch23_3,mem_patch23
+	fetch 1,mem_lmi_opcode
+	beq LMP_IN_RAND,send_lmp_accepted_inrand
+	beq LMP_ENCRYPTION_MODE_REQ,send_lmp_accepted_enc_mode
+	beq LMP_ENCRYPTION_KEY_SIZE_REQ,send_lmp_accepted_enc_key
+	beq LMP_SNIFF_REQ,send_lmp_accept_sniff_req
+	beq LMP_HOST_CONNECTION_REQ,send_lmp_accepted_connection
+	beq LMP_DHKEY_CHECK,send_lmp_accept_dhkey_check
+	beq LMP_START_ENCRYPTION_REQ,send_create_conn_start_l2cap_timer_sm  
+	rtn	
+		
+send_create_conn_start_l2cap_timer_sm:
+	fetch 1,mem_conn_sm
+	rtn blank
+	jam CONN_SM_WAIT_DONE,mem_conn_sm
+	setarg TIMER_ENPT_WAITE
+	arg enpt_delay_timer,queue
+	branch timer_init
+	
+send_lmp_accept_sniff_req:
+	branch sniff_init
+send_lmp_not_accepted:
+	force 3,pdata
+	call msg_send_lmp
+	fetch 1,mem_lmi_opcode
+	beq LMP_AU_RAND,send_not_accept_aurand
+	istore 1,contw
+	fetch 1,mem_lmo_reason
+	istore 1,contw
+	branch send_lmp_follow
+
+send_not_accept_aurand:
+	istore 1,contw
+	fetch 1,mem_lmo_reason
+	istore 1,contw
+	arg mem_sres_tid,temp
+	branch special_tid_store
+
+send_lmpext_accepted:	
+	force 4,queue
+	call send_lmpext
+	setarg LMP_ESCAPE
+	istore 1,contw
+	fetch 1,mem_lmi_opcode
+	set0 7,pdata
+	istore 1,contw
+	fetch 1,mem_lmi_opcode
+	branch send_lmp_follow
+
+send_lmpext_not_accepted:
+	force 5,queue
+	call send_lmpext
+	setarg LMP_ESCAPE
+	istore 1,contw
+	fetch 1,mem_lmi_opcode
+	set0 7,pdata
+	istore 1,contw
+	fetch 1,mem_lmo_reason
+	istore 1,contw
+	branch send_lmp_follow
+	
+
+send_lmp_accepted_inrand:
+	call clear_linkkey
+	call tid_check	
+	rtn true
+	branch lmp_generate_key
+
+send_lmp_accepted_enc_mode:
+	fetch 1,mem_op
+	bbit1 op_start_enc,send_lmp_accepted_enc_start
+	rtnbit0 op_stop_enc
+	jam LMP_STOP_ENCRYPTION_REQ,mem_lmo_opcode2
+	set0 op_stop_enc,pdata
+	call tid_reply
+	branch send_lmp_accepted_enc_exit
+send_lmp_accepted_enc_start:
+	jam LMP_ENCRYPTION_KEY_SIZE_REQ,mem_lmo_opcode2
+	set0 op_start_enc,pdata
+send_lmp_accepted_enc_exit:
+	store 1,mem_op
+	rtn
+
+send_lmp_accepted_enc_key:
+	call check_localsm
+	branch lmp_start_encryption,true
+	rtn
+
+send_lmp_accepted_connection:
+	jam LMP_PACKET_TYPE_TABLE_REQ,mem_lmo_opcode2
+	//jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	fetch 1,mem_lmp_conn_state
+	set1 RECEIVED_CONN_REQ,pdata
+	store 1,mem_lmp_conn_state
+	jam BT_EVT_BB_CONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+send_lmp_accept_dhkey_check:
+	rtn
+/******** LMP reply messages **********/
+/****** TID always set to remote  *******/
+
+
+send_lmpext_ping_res:
+	force 2,queue
+	call send_lmpext
+	branch send_lmp_reply	
+
+send_lmpext_features_res:
+	copy pdata,rega
+	call check_ssp_enable
+	fetch 1,mem_ext_features_page
+	beq 1,send_lmpext_features_res1
+	beq 2,send_lmpext_features_res2
+	rtn
+	
+send_lmpext_features_res1:	
+	copy rega,pdata
+	force 12,queue
+	call send_lmpext
+	setarg 0x01
+	istore 1,contw
+	fetch 2,mem_lmpext_ssp_enable
+	istore 9,contw
+	branch send_lmp_reply
+
+send_lmpext_features_res2:
+	copy rega,pdata
+	force 12,queue
+	call send_lmpext
+	setarg 0x02
+	istore 1,contw
+	setarg 0x010002
+	istore 9,contw
+	branch send_lmp_reply
+
+check_ssp_enable:
+	fetch 1,mem_ssp_enable 
+	branch ssp_disable, blank
+	call  ssp_enable
+	branch check_br_sc_enable
+
+ssp_disable:
+	fetch 1,mem_features+6
+	set0 param_featrue_ssp,pdata
+	store 1,mem_features+6
+	setarg 0x1
+	store 2,mem_lmpext_ssp_enable
+	branch sp_clear_flags
+	
+//default:featrue is enable,extfeature is disable
+ssp_enable:
+	bpatchx patch23_4,mem_patch23
+	fetch 1,mem_features+6
+	set1 param_featrue_ssp,pdata
+	store 1,mem_features+6
+	setarg param_lmpext_ssp_enable
+	store 2,mem_lmpext_ssp_enable
+	rtn
+	
+check_br_sc_enable:
+	fetch 1,mem_secure_connections_enable
+	bbit1  SECURE_CONNECTIONS_BR_BIT,br_sc_enable
+	rtn
+	
+br_sc_enable:
+	setarg 0x0902 //0x0902
+	store 2,mem_lmpext_ssp_enable
+	rtn
+
+send_lmpext_io_cap_res:     
+	force 5,queue
+         call send_lmpext
+       	fetch 3,mem_lmp_io_cap_payload_iocap
+         istore 3,contw
+	call send_lmp_reply
+	jam FLAG_PAIRING_STATE_PAIRING,mem_flag_pairing_state
+	fetch 1,mem_lmp_io_cap_payload_iocap
+	beq IO_CAPABILITY_DISPLAY_YESNO,responder_iocap_display_yesno
+	beq IO_CAPABILITY_KEYBOARD_ONLY,responder_iocap_keyboard_only
+	beq IO_CAPABILITY_NO_INPUT_NO_OUTPUT,responder_iocap_no_input_no_output
+	rtn
+
+responder_iocap_keyboard_only:
+	fetch 1,mem_sp_iocap_remote
+	beq IO_CAPABILITY_DISPLAY_ONLY,responder_iocap_keyboard_only_initiator_iocap_display_only
+	beq IO_CAPABILITY_DISPLAY_YESNO,responder_iocap_keyboard_only_initiator_iocap_display_yesno
+	beq IO_CAPABILITY_KEYBOARD_ONLY,responder_iocap_keyboard_only_initiator_iocap_keyboard_only
+	beq IO_CAPABILITY_NO_INPUT_NO_OUTPUT,responder_iocap_keyboard_only_initiator_iocap_no_input_no_output
+	rtn
+
+
+responder_iocap_display_yesno:
+	fetch 1,mem_sp_iocap_remote
+	beq IO_CAPABILITY_DISPLAY_ONLY,responder_iocap_display_yesno_initiator_iocap_display_only
+	beq IO_CAPABILITY_DISPLAY_YESNO,responder_iocap_display_yesno_initiator_iocap_display_yesno
+	beq IO_CAPABILITY_KEYBOARD_ONLY,responder_iocap_display_yesno_initiator_iocap_keyboard_only
+	beq IO_CAPABILITY_NO_INPUT_NO_OUTPUT,responder_iocap_display_yesno_initiator_iocap_no_input_no_output
+	rtn
+
+	
+responder_iocap_no_input_no_output:
+	fetch 1,mem_sp_iocap_remote
+	beq IO_CAPABILITY_DISPLAY_ONLY,responder_iocap_no_input_no_output_initiator_iocap_display_only
+	beq IO_CAPABILITY_DISPLAY_YESNO,responder_iocap_no_input_no_output_initiator_iocap_display_yesno
+	beq IO_CAPABILITY_KEYBOARD_ONLY,responder_iocap_no_input_no_output_initiator_iocap_keyboard_only
+	beq IO_CAPABILITY_NO_INPUT_NO_OUTPUT,responder_iocap_no_input_no_output_initiator_iocap_no_input_no_output
+	rtn
+
+responder_iocap_keyboard_only_initiator_iocap_no_input_no_output:
+responder_iocap_display_yesno_initiator_iocap_no_input_no_output:
+responder_iocap_display_yesno_initiator_iocap_display_only:
+responder_iocap_no_input_no_output_initiator_iocap_display_only:
+responder_iocap_no_input_no_output_initiator_iocap_display_yesno:
+responder_iocap_no_input_no_output_initiator_iocap_keyboard_only:
+responder_iocap_no_input_no_output_initiator_iocap_no_input_no_output:
+set_ssp_mode_justwork: 
+	jam SSP_MODE_JUST_WORK_FLAG,mem_ssp_mode_flag
+	fetch 1,mem_classic_bt_flag
+	bbit1 FLAG_SSP_REJECT_JUSTWORK,app_bt_disconnect
+	rtn
+
+responder_iocap_display_yesno_initiator_iocap_display_yesno:
+set_ssp_mode_numeric_comparison: 
+	jam SSP_MODE_SSP_PIN_FLAG,mem_ssp_mode_flag
+	rtn
+
+responder_iocap_keyboard_only_initiator_iocap_display_yesno:
+responder_iocap_keyboard_only_initiator_iocap_keyboard_only:	
+responder_iocap_keyboard_only_initiator_iocap_display_only:	
+responder_iocap_display_yesno_initiator_iocap_keyboard_only:
+set_ssp_mode_passkey: 
+	jam SSP_MODE_PASSKEY_ENTRY_FLAG,mem_ssp_mode_flag
+	rtn
+
+
+classic_bt_set_reject_justwork_flag:
+	arg FLAG_SSP_REJECT_JUSTWORK,queue
+	branch classic_bluetooth_set_flag
+
+classic_bt_clr_reject_justwork_flag:
+	arg FLAG_SSP_REJECT_JUSTWORK,queue
+	branch classic_bluetooth_clr_flag
+
+classic_bluetooth_set_flag:
+	fetch 1,mem_classic_bt_flag
+	qset1 pdata
+	store 1,mem_classic_bt_flag
+	rtn
+
+classic_bluetooth_clr_flag:
+	fetch 1,mem_classic_bt_flag
+	qset0 pdata
+	store 1,mem_classic_bt_flag
+	rtn
+
+         
+send_lmp_io_cap_req:
+	force 5,queue
+	call send_lmpext
+	fetch 3,mem_lmp_io_cap_payload_iocap
+	istore 3,contw
+	branch send_lmp_request
+	
+
+send_lmpext_sniff_subrating_req: 
+
+	rtn
+send_lmpext_sniff_subrating_res: 
+         force 9,queue
+         call send_lmpext
+         fetch 1,mem_subsniff_rate
+         istore 1,contw
+         fetch 2,mem_subsniff_tcmax
+         istore 2,contw
+         fetch 4,mem_subsniff_instant
+         istore 4,contw
+	branch send_lmp_reply
+
+send_lmp_name_res:
+	force 17,pdata
+	call msg_send_lmp
+	fetch 1,mem_lmi_opcode  /* loading name offset */
+	copy pdata,temp
+	beq 0x00,send_lmp_name_res_offset_ok
+	beq 0x0e,send_lmp_name_res_offset_ok
+	beq 0x1c,send_lmp_name_res_offset_ok
+	rtn
+send_lmp_name_res_offset_ok:
+	istore 1,contw	/* writing name offset */
+	fetch 1,mem_local_name_length
+	istore 1,contw	/* writing name length */
+	arg 14,loopcnt
+	setarg mem_local_name
+	iadd temp,contr	/* setting read location */
+	call memcpy
+	branch send_lmp_reply
+
+
+send_lmp_timing_accuracy_res:
+	force 3,pdata
+	call msg_send_lmp
+	setarg 0x0114
+	istore 2,contw
+	branch send_lmp_reply
+
+send_lmp_clkoffset_res:
+	// dopod s505 must wait for this res
+	force 3,pdata
+	call msg_send_lmp
+	fetch 4,mem_clke_bt
+	isub clkn_bt,pdata
+	branch send_lmp_clkoffset_res_master,master
+	sub pdata,0,pdata		/* our role is slave */
+send_lmp_clkoffset_res_master:	
+	// bit 16-2 of clkslave-clkmaster
+	rshift2 pdata,pdata
+	set0 15,pdata
+	istore 2,contw
+	branch send_lmp_reply
+
+send_lmp_version_res:
+	force 6,pdata
+	call msg_send_lmp
+	fetch 5,mem_lmp_version
+	istore 5,contw
+	branch send_lmp_reply
+
+send_lmp_features_res:
+	force 9,pdata
+	call msg_send_lmp
+	fetch 8,mem_features
+	istore 8,contw
+	branch send_lmp_reply  
+
+
+/******** LMP request messages **********/
+/****** TID always set to local initiated *******/
+	
+
+send_lmpext_features_req:
+	call check_ssp_enable
+	fetch 1,mem_lmp_to_send
+	force 12,queue
+	call send_lmpext
+	setarg 0x01
+	istore 1,contw
+	fetch 2,mem_lmpext_ssp_enable
+	istore 2,contw
+	setarg 0
+	istore 3,contw
+	setarg 0x00
+	istore 4,contw
+	branch send_lmp_request
+
+send_lmpext_packet_type_table_req:
+	force 3,queue
+	call send_lmpext
+	fetch 1,mem_ptt
+	istore 1,contw
+	disable user
+	call send_lmp_request
+	nrtn user
+	nrtn master
+	fetch 1,mem_afh_cfg
+	rtnbit0 AFH_CFG_ON
+	call afh_init
+	branch afh_open_all_channels
+	
+
+afh_init:
+	jam 0x3,mem_afh_cfg
+	setarg 0
+	store 4,mem_afh_timer
+	arg mem_afh_map_lo,contw
+	call afh_reset_map
+	arg mem_afh_map_new,contw
+	call afh_reset_map
+	arg mem_afh_classify_channel_map,contw
+	call afh_reset_map
+	branch afh_clear_error_counter
+afh_open_all_channels:
+	arg mem_afh_map_new,contw
+	call afh_reset_map
+	call afh_clear_error_counter
+	branch afh_set_send_flag
+
+
+afh_reset_map:
+	setarg 0xffffff
+	istore 3,contw
+	istore 3,contw
+	istore 3,contw
+	setarg 0x7f
+	istore 1,contw
+	rtn
+afh_clear_error_counter:
+	setarg 0
+	store 2,mem_afh_error_total
+	rtn
+afh_set_send_flag:
+	fetch 1,mem_afh_cfg
+	set1 send_lmp_set_afh,pdata
+	store 1,mem_afh_cfg
+	rtn
+
+
+send_lmpext_pause_encryption_req:
+	force 2,queue
+	call send_lmpext
+	nbranch send_lmp_reply,master
+	// assume slave will not send pause req firstly???
+	branch send_lmp_request
+
+
+	
+send_lmp_detach:
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_disconn_reason_send
+	istore 1,contw
+	call send_lmp_request
+prepare_disconnect:
+	fetch 1,mem_op
+	set1 op_disconn,pdata
+	store 1,mem_op
+	jam 50,mem_conn_timer
+	rtn
+	
+
+send_lmp_no_payload:
+	force 1,pdata
+	call msg_send_lmp
+	branch send_lmp_request
+send_lmp_nopayload_reply:
+	force 1,pdata
+	call msg_send_lmp
+	branch send_lmp_reply
+	
+	
+send_lmp_encryption_mode_req:
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_state_map
+	isolate0 smap_encryption,pdata
+	setflag true,0,pdata
+	and_into 1,pdata
+	istore 1,contw
+	branch send_lmp_request
+
+
+send_lmp_superto:
+	force 3,pdata
+	call msg_send_lmp
+	fetch 2,mem_supervision_to
+	istore 2,contw
+	branch send_lmp_request
+
+send_lmp_name_req:
+	jam 250,mem_conn_timer
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_name_offset
+	istore 1,contw
+	branch send_lmp_request
+
+send_lmp_test_control:
+	force 10,pdata
+	call msg_send_lmp
+	arg mem_temp_payload,contr
+	force 9,loopcnt
+send_lmp_test_control_loop:	
+	ifetch 1,contr
+	xor_into 0x55,pdata
+	istore 1,contw
+	loop send_lmp_test_control_loop
+	branch send_lmp_request  
+
+send_lmp_quality_of_service_req:
+	branch send_lmp_request
+send_lmp_unit_key:
+	branch send_lmp_request
+
+send_lmp_slot_offset:
+	rtn master
+	call calc_slot_offset
+	force 9,pdata
+	call msg_send_lmp
+	fetch 2,mem_slot_offset
+	istore 2,contw
+	fetch 3,mem_lap
+	istore 3,contw
+	fetch 1,mem_uap
+	istore 1,contw
+	fetch 2,mem_nap
+	istore 2,contw
+	bmark0 mark_switch_initiated,send_lmp_slot_offset_reply
+	set0 mark_switch_initiated,mark
+	call send_lmp_request
+	jam LMP_SWITCH_REQ,mem_lmo_opcode2
+	rtn
+send_lmp_slot_offset_reply:
+	call send_lmp_reply
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_SWITCH_REQ,mem_lmi_opcode2
+	rtn
+	
+send_lmp_switch_req:
+	arg 0x200,temp
+	branch switch_on_native,master
+	deposit clke_bt
+	branch switch_slack
+switch_on_native:
+	deposit clkn_bt
+switch_slack:
+	deposit bt_clk
+	iadd temp,pdata
+	and_into 0x1fc,pdata
+	store 4,mem_sniff_anchor
+	force 5,pdata
+	call msg_send_lmp
+	fetch 4,mem_sniff_anchor		/* reused as switch instant */
+	rshift pdata,pdata
+	istore 4,contw
+	branch send_lmp_request
+
+send_lmp_sniff_req:
+	force 10,pdata
+	call msg_send_lmp
+	arg mem_sniff_payload,contr
+	ifetch 9,contr
+	istore 9,contw
+	branch send_lmp_request
+
+	
+send_lmp_timing_accuracy_req:
+/* default to TID_NORM_SEND */
+	force 3,pdata
+	call msg_send_lmp
+	setarg 0x0114
+	istore 2,contw
+	branch send_lmp_request
+	
+send_lmp_unsniff_req:
+//--------------------need to completa
+	force 1,pdata
+	call msg_send_lmp
+	//fetch 1,mem_unsniff_pending
+	//nbranch send_msg_done,blank
+	//jam 1,mem_unsniff_pending
+	//fetch 2,mem_sniff_attempt
+	//fetch 2,mem_nsniff_attempt
+	//lshift3 pdata,pdata
+	//lshift pdata,pdata
+	//store 1,mem_unsniff_cnt
+	branch send_lmp_request
+
+	
+send_lmp_max_slot:
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_max_slot
+	istore 1,contw
+	branch send_lmp_request
+	
+	
+send_lmp_max_slot_req:
+	force 2,pdata
+	call msg_send_lmp
+	setarg 0x05		/*5 slot*/
+	istore 1,contw
+	branch send_lmp_request
+
+
+send_lmp_inc_power:
+	force 2,pdata
+	call msg_send_lmp
+	setarg 0x00		/*5 slot*/
+	istore 1,contw
+	branch send_lmp_request
+
+
+send_lmp_setup_complete_by_module:
+	jam LMP_MAX_SLOT_REQ,mem_lmo_opcode2
+	rtn
+send_lmp_setup_complete:
+	fetch 1,mem_device_option
+	sub pdata,dvc_op_module,null
+	call send_lmp_setup_complete_by_module,zero
+	fetch 1,mem_state
+	set1 state_conn_comp,pdata
+	store 1,mem_state
+	copy clkn_bt,pdata
+	store 4,mem_aurand_send_delay_time
+	fetch 1,mem_lmp_conn_state
+	bbit1 SENT_SETUP_COMPLETE,send_lmp_setup_complete_has_sent
+	set1 SENT_SETUP_COMPLETE,pdata
+	store 1,mem_lmp_conn_state
+	jam BT_EVT_SETUP_COMPLETE,mem_fifo_temp
+	call ui_ipc_send_event
+	force 1,pdata
+	call msg_send_lmp
+	branch send_lmp_request
+send_lmp_setup_complete_has_sent:
+	jam 0,mem_lmp_to_send
+	rtn
+	
+send_lmp_version_req:
+	force 6,pdata
+	call msg_send_lmp
+	fetch 5,mem_lmp_version
+	istore 5,contw
+	branch send_lmp_request
+
+send_lmp_features_req:
+	force 9,pdata
+	call msg_send_lmp
+	fetch 8,mem_features
+	istore 8,contw
+	branch send_lmp_request  
+
+sp_master_send_io_cap_get:
+	jam SP_FLAG_COMMIT,mem_master_sp_flag
+	fetch 1,mem_sp_local_key_invalid
+	rtnne SP_KEY_VALID
+	jam SP_MASTER_STAT_START_DONE,mem_master_sp_state
+	rtn
+
+sp_master_send_io_cap_send:
+	call tid_initiate
+	jam LMP_IO_CAP_REQ,mem_lmo_opcode2
+	jam SP_STAT_KEY_SEND,mem_master_sp_state
+	rtn
+	
+	
+sp_master_send_LMP_ENCAPSULATED_HEADER:
+	call tid_initiate
+	jam      LMP_ENCAPSULATED_HEADER,mem_lmo_opcode2
+	jam SP_STAT_RANDOM_SEND,mem_master_sp_state
+	rtn
+	
+sp_master_commitment_compare:
+	arg mem_sp_calc_result_high,rega
+	arg mem_sp_confirm_remote,regb
+	arg 16,loopcnt
+	call string_compare
+	branch sp_master_commitment_compare_success,zero
+	jam SP_STAT_NULL,mem_master_sp_state
+ifdef SIMPLE_PAIRING
+	call master_clear_mem_master_sp_flag
+endif
+	jam LMP_SIMPLE_PAIRING_NUMBER,mem_lmi_opcode2 
+	branch lmp_reject_pdu_not_allowed
+	
+sp_master_commitment_compare_success:
+	jam SP_STAT_CONFIRM_CALC,mem_master_sp_state
+ifdef SIMPLE_PAIRING
+	call master_set_mem_master_sp_flag
+endif
+	jam LMP_SIMPLE_PAIRING_NUMBER,mem_lmi_opcode2
+	branch accept_lmp_msg  
+	
+
+	
+sp_master_send_lmp_simple_pairing_number:
+	jam LMP_SIMPLE_PAIRING_NUMBER,mem_lmo_opcode2
+	rtn
+	
+
+
+sp_send_lmp_encapsulated_header:
+	// calculate the private & public key here
+	//jam      LMP_ENCAPSULATED_HEADER,mem_lmp_to_send
+	jam      LMP_ENCAPSULATED_HEADER,mem_lmo_opcode2
+	//jam      TID_PAIRING,mem_lmp_tid
+	rtn
+	//fetch 1,mem_tid_table
+	//set1 TID_PAIRING,pdata
+	//store 1,mem_tid_table
+     
+    
+send_lmp_encapsulated_header: 
+	jam 0,mem_sp_local_key_send_count
+	force 4,pdata
+	call msg_send_lmp
+	fetch 3,mem_encapsulated_major_type
+	istore 3,contw 
+	call check_localsm
+	branch send_lmp_request,true
+	branch send_lmp_reply
+
+
+send_lmp_encapsulated_payload:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,send_lmp_encapsulated_payload_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,send_lmp_encapsulated_payload_192
+	rtn
+	
+send_lmp_encapsulated_payload_256:
+	 force 17,pdata
+	call msg_send_lmp
+	fetch 1,mem_sp_local_key_send_count
+	arg mem_sc_pubkey_local_x_256,contr
+	branch send_lmp_encapsulated_payload_common
+
+send_lmp_encapsulated_payload_192:
+	 force 17,pdata
+	call msg_send_lmp
+	fetch 1,mem_sp_local_key_send_count
+	arg mem_sp_pubkey_local,contr
+send_lmp_encapsulated_payload_common:
+	iadd contr,contr    
+	ifetch   8,contr
+	istore   8,contw
+	ifetch   8,contr
+	istore   8,contw
+	fetch    1,mem_sp_local_key_send_count
+	increase 16,pdata
+	store    1,mem_sp_local_key_send_count
+	call check_localsm
+	branch send_lmp_request,true
+	branch send_lmp_reply
+	//branch send_lmp_request
+	
+sp_send_lmp_simple_pairing_comfirm:
+        jam      SP_STAT_RANDOM_RECV,mem_sp_state
+        jam      LMP_SIMPLE_PAIRING_CONFIRM,mem_lmo_opcode2
+        rtn
+send_lmp_simple_pairing_comfirm:
+        //jam      SP_STAT_RANDOM_RECV,mem_sp_state
+        //jam      TID_PAIRING,mem_lmp_tid
+        force    17,pdata
+        call msg_send_lmp   
+        arg      mem_sp_calc_result_high,contr
+        ifetch   8,contr
+        istore   8,contw
+        ifetch   8,contr
+        istore   8,contw 
+        branch send_lmp_reply
+
+sp_send_lmp_simple_pairing_number:
+	jam      LMP_SIMPLE_PAIRING_NUMBER,mem_lmo_opcode2
+	rtn
+
+send_lmp_simple_pairing_number:
+	//jam      TID_PAIRING,mem_lmp_tid
+	call check_localsm
+ifdef SIMPLE_PAIRING
+	call sp_local_random_key_generator,true
+endif
+	force    17,pdata
+	call msg_send_lmp
+	arg      mem_sp_random_local,contr
+	ifetch   8,contr
+	istore   8,contw
+	ifetch   8,contr
+	istore   8,contw
+	call check_localsm
+	nbranch send_lmp_reply,true
+	branch send_lmp_request,true
+
+master_sp_sm_end:
+	//jam DEFAULT_STATEMACHINE,mem_sp_localsm
+	jam SP_STAT_DONE,mem_master_sp_state
+sp_aurand_send:
+	call tid_initiate
+	jam LMP_AU_RAND,mem_lmo_opcode2
+	call check_localsm_master
+ifdef SIMPLE_PAIRING
+	branch sp_master_key_prarm_push,true
+	branch sp_link_key_prarm_push
+endif
+master_sp_send_lmp_dhkey_check:
+	call tid_reply
+sp_send_lmp_dhkey_check: 
+	jam      LMP_DHKEY_CHECK,mem_lmo_opcode2
+	rtn
+send_lmp_dhkey_check: 
+	//jam      TID_PAIRING,mem_lmp_tid
+	force    17,pdata
+	call     msg_send_lmp
+	arg      mem_sp_calc_result_high,contr
+	ifetch   8,contr
+	istore   8,contw
+	ifetch   8,contr
+	istore   8,contw 
+	call check_localsm
+	nbranch send_lmp_reply,true
+	branch send_lmp_request,true
+
+send_lmp_enc_key_size_mask_res:
+	force 3,pdata
+	call msg_send_lmp   
+	setarg 0xfffe //enc key size mask
+	istore 2,contw
+	branch send_lmp_reply
+
+send_lmp_auto_rate:
+	branch send_lmp_request
+send_lmp_clkoffset_req:
+	branch send_lmp_request
+send_lmp_quality_of_service:
+	branch send_lmp_request
+send_lmp_test_activate:
+	branch send_lmp_request
+
+/******** LMP request/reply messages **********/
+/****** TID transaction specific *******/
+
+send_lmp_comb_key:
+	call generate_random_number
+	arg mem_lap,rega
+	call generate_linkkey
+	force 17,pdata
+	call msg_send_lmp
+	arg mem_kinit,rega
+	arg mem_random_number,regb
+	call xor16
+	nbranch send_lmp_follow,master
+	branch send_lmp_tid
+
+send_lmp_inrand:
+	call generate_random_number
+	arg mem_plap,rega
+	call generate_kinit
+send_lmp_rand:	/* used by in_rand,au_rand,start_encrypt */
+	force 17,pdata
+	call msg_send_lmp
+	arg mem_random_number,contr
+	call memcpy16
+	fetch 1,mem_conn_sm 
+	beq CONN_SM_AUTH_WAIT,send_lmp_request
+	beq CONN_SM_PAIRING_WAIT,send_lmp_request
+	branch send_lmp_tid
+
+send_lmp_aurand:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,send_lmp_aurand_256
+
+	fetch 1,mem_pairing_auth
+	branch send_lmp_aurand_notpairing,blank
+send_lmp_aurand2:
+	call check_localsm
+	call tid_initiate,true
+	ncall tid_reply,true
+	branch send_lmp_aurand_common
+send_lmp_aurand_notpairing:
+	call tid_initiate
+send_lmp_aurand_common:
+	call generate_random_number
+	branch send_lmp_rand
+
+send_lmp_aurand_256:
+	jam LMP_SRES,mem_lmo_opcode2
+	branch send_lmp_aurand2
+
+send_lmp_sres:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,send_lmp_sres_256
+
+	arg mem_lap,rega
+	call function_e1
+	force 5,pdata
+	call msg_send_lmp
+	fetch 4,mem_input_store
+	istore 4,contw
+	arg mem_sres_tid,temp
+	call special_tid_store
+	call copy_aco
+	call check_localsm
+	branch send_lmp_sres_master,true
+	jam DONE_ENCRYP,mem_wait_encryption
+	fetch 1,mem_pairing_auth
+	rtn blank
+	jam LMP_AU_RAND,mem_lmo_opcode2
+send_lmp_sres_master:
+	fetch 1,mem_link_key_exists
+	rtn blank
+send_lmp_sres_startenc:
+	call check_localsm
+	nbranch send_lmp_sres_startenc_slave,true
+	rtn
+	
+send_lmp_sres_startenc_slave:
+	rtnmark0 mark_slave_in_rand_accepted
+	set0 mark_slave_in_rand_accepted,mark
+	jam LMP_ENCRYPTION_MODE_REQ, mem_lmo_opcode2
+	rtn
+	
+send_lmp_sres_256:
+	call function_h4
+	call function_h5
+	force 5,pdata
+	call msg_send_lmp
+	fetch 4,memb
+	istore 4,contw
+	arg mem_sres_tid,temp
+	call special_tid_store
+	call copy_aco_256
+	call check_localsm
+	branch send_lmp_sres_master,true
+	jam DONE_ENCRYP,mem_wait_encryption
+	fetch 1,mem_pairing_auth
+	rtn blank
+	branch send_lmp_sres_master
+	
+copy_aco_256:
+	fetch 8,mem_sp_calc_result_high
+	store 8,mem_ccm_iv
+	rtn
+	
+send_lmp_start_encryption:
+	call generate_random_number
+	call function_e3
+	force 17,pdata
+	call msg_send_lmp
+	arg mem_random_number,contr
+	call memcpy16
+	branch send_lmp_tid
+
+send_lmp_stop_encryption_req:
+	force 1,pdata
+	call msg_send_lmp
+	branch send_lmp_tid
+
+send_lmp_encryption_key_size_req:
+	force 2,pdata
+	call msg_send_lmp
+	force 16,pdata
+	istore 1,contw
+	store 1,mem_key_size
+	branch send_lmp_tid
+
+msg_send_lmp:
+/* FLOW is set high and LMP is indicated */
+	lshift3 pdata,pdata
+	or_into 0x07,pdata
+	store 1,mem_lmo_header_length
+	arg 17,loopcnt
+	arg mem_lmo_payload,contw
+	call clear_mem
+	arg mem_lmo_payload,contw
+	rtn
+
+send_lmpext:
+	and pdata,0x7f,rega
+	jam LMP_ESCAPE,mem_lmp_to_send
+	deposit queue
+	call msg_send_lmp
+	deposit rega
+	istore 1,contw
+	rtn
+
+send_lmp_follow:
+	fetch 1,mem_lmp_to_send
+	lshift pdata,pdata
+	fetcht 1,mem_state_map
+	isolate1 smap_lmptid,temp
+	setflag true,0,pdata
+	branch send_lmp_exit
+
+
+send_lmp_tid:
+	fetcht 1,mem_state_map
+	and_into 1,temp
+	branch send_lmp_end
+
+send_lmp_reply:
+	force 0,temp
+	branch send_lmp_end
+	
+send_lmp_request:
+	force 1,temp
+send_lmp_end:
+	fetch 1,mem_lmp_to_send
+	lshift pdata,pdata
+	setflag master,0,pdata
+	ixor temp,pdata
+send_lmp_exit:
+	store 1,mem_lmo_header_opcode
+	store 1,mem_lmo_header_opcode_x
+	jam 0,mem_lmp_to_send
+	call lmo_fifo_process_lmo0empty
+	enable user
+	rtn
+
+//blank : not full 
+lmo_fifo_check:
+	fetch 1,mem_lmo_opcode2
+	rtn blank
+	call lmo_fifo_process
+	fetch 1,mem_lmo_opcode2
+	rtn
+
+lmo_fifo_process:
+	bpatchx patch23_5,mem_patch23
+	fetch 1,mem_lmp_to_send
+	branch lmo_fifo_process_lmo0empty,blank
+	fetch 1,mem_lmo_opcode1
+	nrtn blank
+	branch lmo_fifo_process_lmo2to1
+lmo_fifo_process_lmo0empty:
+	fetch 1,mem_lmo_opcode1
+	branch lmo_fifo_process_lmo1_empty,blank
+	fetch 3,mem_lmo_opcode1
+	store 3,mem_lmp_to_send//1=>0
+	fetcht 1,mem_lmo_tid1
+	fetch 1,mem_state_map
+	set0 smap_lmptid,pdata
+	ior temp,pdata
+	store 1,mem_state_map
+	jam 0,mem_lmo_opcode1
+lmo_fifo_process_lmo2to1:
+	fetch 1,mem_lmo_opcode2
+	rtn blank
+	fetch 4,mem_lmo_opcode2
+	store 4,mem_lmo_opcode1//2=>1
+	jam 0,mem_lmo_opcode2
+	rtn
+lmo_fifo_process_lmo1_empty:
+	fetch 1,mem_lmo_opcode2
+	rtn blank
+	fetch 3,mem_lmo_opcode2
+	store 3,mem_lmp_to_send//2=>0	
+	fetcht 1,mem_lmo_tid2
+	fetch 1,mem_state_map
+	set0 smap_lmptid,pdata
+	ior temp,pdata
+	store 1,mem_state_map
+	jam 0,mem_lmo_opcode2
+	rtn
+	
+//input:temp
+special_tid_store:
+	bpatchx patch23_6,mem_patch23
+	fetch 1,mem_state_map
+	copy pdata,regc
+	ifetch 1,temp
+	call pop_tid_follow
+	call send_lmp_follow
+	copy regc,pdata
+	store 1,mem_state_map
+	rtn
+	
+tid_reply:
+	fetcht 1,mem_state_map
+	set0 smap_lmptidinit,temp
+	storet 1,mem_state_map
+	rtn
+	
+tid_initiate:
+	fetcht 1,mem_state_map
+	set1 smap_lmptidinit,temp
+	storet 1,mem_state_map
+	rtn
+	
+	/* true if transaction from remote */
+tid_check:
+	nsetflag master,smap_lmptid,pdata //it is ok
+	fetcht 1,mem_state_map
+	ixor temp,pdata
+	isolate1 smap_lmptid,pdata
+	rtn	
+
+	/* set to remote */
+tid_set_reply:
+	fetch 1,mem_state_map
+	setflag master,smap_lmptid,pdata //it is ok
+	store 1,mem_state_map
+	rtn
+
+	/*rtn true when we lead lmp*/
+check_localsm:
+	fetch 1,mem_sp_localsm
+	compare 	LOCAL_STATEMACHINE,pdata,0x7f
+	rtn
+setlocalsm_master:
+	fetch 1,mem_sp_localsm
+	set1 7,pdata
+	store 1,mem_sp_localsm
+	rtn
+setlocalsm_slave:
+	fetch 1,mem_sp_localsm
+	set0 7,pdata
+	store 1,mem_sp_localsm
+	rtn
+check_localsm_master:
+	fetch 1,mem_sp_localsm
+	isolate1 7,pdata
+	store 1,mem_sp_localsm
+	rtn
+	
+generate_random_number:
+	/* generating a 16 byte random number,storing in ape_random_number */
+	arg mem_random_number,contw
+generate_random:
+	force 16,loopcnt
+generate_random_another:
+generate_random_loop:
+	random pdata
+	istore 1,contw
+	loop generate_random_another
+	rtn
+
+generate_linkkey:
+	call function_e21
+	arg mem_link_key,rega
+	arg mem_input_store,regb
+	ifetch 8,rega					/* check if already got comb key */
+	fetcht 1,mem_state
+	nsetflag blank,state_combkey,temp
+	storet 1,mem_state
+	copy rega,contw
+	call  xor16
+	branch generate_linkkey_continue
+
+/*********************************/
+/*********lmp send*************/
+/********************************/
+
+process_conn_sm:
+	//nrtn master
+	bpatchx patch23_7,mem_patch23
+
+	call lmo_fifo_check
+	nrtn blank
+process_conn_sm_continue:
+	fetch 1,mem_conn_sm
+	rtn blank
+	/* state machine begins in standby */
+	//beq CONN_SM_STANDBY, host_create_conn_begin
+	//beq CONN_SM_WAIT_PAGE, host_create_conn_wait_page
+	beq CONN_SM_SEND_CONN_REQ, host_create_conn_send_conn_req
+	beq CONN_SM_WAIT_CONN_ACCEPT, host_create_conn_wait_accept
+	beq CONN_SM_SEND_FEATURES, host_create_conn_send_features
+	beq CONN_SM_WAIT_FEATURES_RES, host_create_conn_waiting
+	beq CONN_SM_SEND_SWITCH,host_create_conn_send_switch
+	beq CONN_SM_AUTH_PAIR, host_create_conn_auth_pair
+	beq CONN_SM_AUTH_PAIR_WAIT, host_create_conn_auth_pair_wait
+	beq CONN_SM_ENCRYPT, host_create_conn_encrypt
+	beq CONN_SM_ENCRYPT_WAIT, host_create_conn_encrypt_wait
+	beq CONN_SM_ENCRYPT_WAIT_CLEAR, host_create_conn_encrypt_wait_clear
+	beq CONN_SM_SEND_SETUP_COMPLETE, host_create_conn_send_setup_complete
+	beq CONN_SM_WAIT_SETUP_COMPLETE, host_create_conn_wait_setup_complete
+	beq CONN_SM_DETACH_DELAY,host_create_conn_master_detach
+	beq CONN_SM_SEND_VERSION, host_create_conn_send_version
+	beq CONN_SM_WAIT_VERSION, host_create_conn_waiting
+	beq CONN_SM_WAIT_SWITCH_AFTER_HOST_CONNECTION, host_creat_conn_wait_switch
+	beq CONN_SM_SEND_FEATURES_EXT,host_creat_conn_send_feat_ext
+	beq CONN_SM_WAIT_FEATURES_EXT,host_create_conn_waiting
+	beq CONN_SM_PAIRING,host_create_conn_pairing
+	beq CONN_SM_PAIRING_WAIT,host_create_conn_pairing_wait
+	beq CONN_SM_AUTH,host_create_conn_auth
+	beq CONN_SM_AUTH_WAIT,host_create_conn_auth_wait
+	beq CONN_SM_DONE,host_create_conn_done
+	beq CONN_SM_WAIT_DONE,host_create_conn_done_wait
+	jam CONN_SM_STANDBY,mem_conn_sm
+	/* sending error message to host */
+	rtn
+host_create_conn_done:
+	fetch 1,mem_lmp_conn_state		
+	rtnbit0 RECEIVED_SETUP_COMPLETE
+	rtnbit0 SENT_SETUP_COMPLETE
+	jam CONN_SM_STANDBY,mem_conn_sm
+	call host_conn_judge_encrypt
+	branch scheduler_start_upper_sm
+	
+host_conn_judge_encrypt:
+	fetch 1,mem_connection_options
+	rtnbit0 CONNECTION_ENCRYPT
+	jam CONN_SM_ENCRYPT_WAIT,mem_conn_sm
+	rtn
+
+host_create_conn_done_wait:
+	arg enpt_delay_timer,queue
+	call timer_check
+	nrtn blank
+	jam CONN_SM_DONE,mem_conn_sm
+	rtn
+	
+host_create_conn_auth:
+	fetch 1,mem_connection_options
+	set0 CONNECTION_AUTH,pdata
+	store 1,mem_connection_options
+	jam CONN_SM_AUTH_WAIT,mem_conn_sm
+	jam LMP_AU_RAND,mem_lmo_opcode2
+	rtn 
+host_create_conn_auth_wait:
+	rtn
+host_create_conn_pairing:
+	fetch 1,mem_pincode_state
+	rtnne pincode_state_pincode_ready //wait for pincode
+	call host_auth
+	jam CONN_SM_PAIRING_WAIT,mem_conn_sm
+	rtn
+
+host_create_conn_pairing_wait:
+	rtn
+host_creat_conn_send_feat_ext:
+	jam CONN_SM_WAIT_FEATURES_EXT,mem_conn_sm
+	jam LMP_EXT_FEATURES_REQ,mem_lmo_opcode2
+	rtn
+host_create_conn_send_version:
+	jam CONN_SM_WAIT_VERSION,mem_conn_sm
+	jam LMP_VERSION_REQ,mem_lmo_opcode2
+	rtn 
+	
+host_creat_conn_wait_switch:
+	fetch 1,mem_switch_flag
+	rtneq SWITCH_FLAG_INIT
+	beq SWITCH_FLAG_ACCEPT,host_create_conn_switch_accept
+	arg switch_wait_timer,queue
+	call timer_check
+	nrtn blank
+	jam SWITCH_FLAG_INIT,mem_switch_flag
+	branch host_create_conn_switch
+host_create_conn_switch_accept:
+	rtn master
+	branch host_create_conn_auth_pair
+
+host_create_conn_send_features:
+	jam CONN_SM_WAIT_FEATURES_RES,mem_conn_sm
+	jam LMP_FEATURES_REQ,mem_lmo_opcode2
+	rtn 
+host_create_conn_send_switch:
+	jam LMP_SWITCH_REQ,mem_lmo_opcode2
+	set1 mark_switch_initiated,mark
+	jam CONN_SM_WAIT_CONN_ACCEPT,mem_conn_sm
+	setarg 0x1ff
+	store 2, mem_soft_timer
+	rtn
+
+host_create_conn_send_conn_req:
+	jam CONN_SM_WAIT_CONN_ACCEPT,mem_conn_sm
+	setarg 0xff
+	store 2,mem_soft_timer
+	set0 mark_reconn_recieve_switch,mark
+	jam LMP_HOST_CONNECTION_REQ,mem_lmo_opcode2
+	branch init_lmp_reinit
+host_create_conn_wait_accept:
+	rtnmark1 mark_reconn_recieve_switch
+	fetch 2,mem_soft_timer
+	increase -1,pdata
+	branch host_create_conn_resend,zero
+	store 2, mem_soft_timer
+	rtn
+host_create_conn_resend:
+	jam CONN_SM_SEND_SWITCH,mem_conn_sm
+	rtn
+host_create_conn_waiting:
+	/* we will exit waiting for connection request accepted, features res, or other commands to finish */
+	rtn 
+
+host_create_conn_switch:
+	fetch 1,mem_lmp_conn_state
+	rtnbit0 SENT_SETUP_COMPLETE
+	rtnbit0 RECEIVED_SETUP_COMPLETE
+	fetch 1,mem_connection_options
+	set0 CONNECTION_SWITCH,pdata
+	store 1,mem_connection_options
+	jam LMP_SWITCH_REQ,mem_lmo_opcode2
+	jam CONN_SM_WAIT_SWITCH_AFTER_HOST_CONNECTION,mem_conn_sm
+	rtn 
+
+host_create_conn_send_setup_complete:
+	jam CONN_SM_WAIT_SETUP_COMPLETE,mem_conn_sm	
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	rtn 
+
+host_create_conn_wait_setup_complete:
+	fetch 1,mem_lmp_conn_state
+	rtnbit0 RECEIVED_SETUP_COMPLETE
+	jam CONN_SM_STANDBY,mem_conn_sm	
+
+	rtn
+host_create_conn_wait_setup_complete_rtn:	
+	jam CONN_SM_AUTH_PAIR ,mem_conn_sm
+	rtn
+
+host_create_conn_master_detach:
+	fetch 2, mem_soft_timer
+	increase -1,pdata
+	branch host_create_conn_send_detach,blank//detach
+	store 2, mem_soft_timer
+	rtn 
+host_create_conn_send_detach:
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam LOCAL_HOST,mem_disconn_reason_send
+	jam 0,mem_conn_sm
+	rtn
+host_create_conn_auth_pair:
+	/* checking whether or not to do m/s switch */
+	fetch 1,mem_connection_options
+	bbit1 CONNECTION_SWITCH,host_create_conn_switch
+	bbit1 CONNECTION_AUTH,host_create_conn_auth_pair_true
+host_create_conn_sm_done:
+	jam CONN_SM_DONE,mem_conn_sm
+	rtn
+host_create_conn_auth_pair_true:
+	fetch 1,mem_link_key_exists
+	branch host_create_conn_auth_pair_nokey,blank
+	fetch 1,mem_lmp_conn_state
+	rtnbit0 SENT_SETUP_COMPLETE
+	rtnbit0 RECEIVED_SETUP_COMPLETE
+	fetch 4,mem_aurand_send_delay_time
+	arg 100,temp
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	branch host_create_conn_auth
+
+host_create_conn_auth_pair_nokey:
+	jam CONN_SM_PAIRING,mem_conn_sm
+	jam 4,mem_pin_length
+	setarg 0x3030
+	store 2,mem_pin
+	istore 2,contw
+	jam pincode_state_pincode_ready,mem_pincode_state
+	branch host_create_conn_pairing
+
+host_create_conn_auth_pair_wait:
+	rtn
+host_create_conn_encrypt:
+	fetch 1,mem_connection_options
+	bbit1 CONNECTION_ENCRYPT,host_create_conn_encrypt_start
+	jam CONN_SM_DONE,mem_conn_sm
+	rtn 
+
+host_create_conn_encrypt_start:
+	fetch 1,mem_connection_options
+	set0 CONNECTION_ENCRYPT,pdata
+	store 1,mem_connection_options
+	jam LMP_ENCRYPTION_MODE_REQ,mem_lmo_opcode2  
+	rtn
+
+host_create_conn_encrypt_wait:
+	fetch 1, mem_wait_encryption
+	rtn blank
+	jam CONN_SM_STANDBY,mem_conn_sm
+	branch host_create_conn_encrypt_start 
+
+host_create_conn_encrypt_wait_clear:
+	jam CONN_SM_SEND_SETUP_COMPLETE,mem_conn_sm
+	rtn 
+
+host_auth:
+	fetch 1,mem_op
+	bbit1 op_inrand_req,remote_auth
+	call tid_initiate
+	jam LMP_IN_RAND,mem_lmo_opcode2
+	branch cmd_exit
+remote_auth:
+	fetch 1,mem_op
+	set0 op_inrand_req,pdata
+	store 1,mem_op
+	call lmp_accept_inrand
+	call tid_set_reply
+	branch cmd_exit
+
+pincode_reinit:
+	setarg 4
+	store 1,mem_pin_length
+	setarg 0x3030
+	istore 2,contw
+	istore 2,contw
+	rtn
+	
+
Index: program/mesh_protocol_stack/mesh_access_layer.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_access_layer.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_access_layer.prog	(working copy)
@@ -0,0 +1,143 @@
+
+/*
+	mesh协议中access layer
+	主要是负责mesh中access layer数据的解析
+*/
+
+/*
+	access layer解析指令集
+*/
+//input:alarm is upper transport access ptr
+ali_mesh_access_layer_resolve_message:
+	fetch 1,mem_ccm_data_len
+	store 1,mem_mesh_receive_model_message_payload_len
+	copy alarm,contr
+	call memcpy24
+	call logging_tx_info_receive_access_message
+	fetch 2,mem_mesh_cb_receive_access_message
+	branch callback_func
+
+ali_mesh_access_layer_check_access_message_opcode:
+	fetch 1,mem_mesh_receive_model_message_payload_opcode
+	beq MESH_MESSAGE_OPCODE_CONFIG_APPKEY_ADD,ali_mesh_access_layer_message_opcode_config_AppKey_Add
+	beq MESH_CONFIGURATION_AND_HEALTH_MESSAGE_OPCODE_HEADER,ali_mesh_access_layer_config_or_health_message_opcode
+	beq MESH_MODULE_MESSAGE_OPCODE_HEADER,ali_mesh_model_layer_check_model_message_opcode
+	beq VENDOR_MESSAGE_ATTR_SET,ali_mesh_ali_vendor_message_attribute_set
+	beq VENDOR_MESSAGE_ATTR_GET,ali_mesh_ali_vendor_message_opcode_attr_get
+	beq VENDOR_MESSAGE_ATTR_CONFIRMATION,ali_mesh_ali_vendor_message_opcode_attr_confrimation
+	rtn
+
+
+/*
+	接收到config AppKey Add指令
+*/
+ali_mesh_access_layer_message_opcode_config_AppKey_Add:
+	arg mem_mesh_receive_application_key,contr
+	arg mem_mesh_application_key,contw
+	call memcpy16
+	jam PAIRED_STATUS,mem_mesh_provisioned_flag
+	
+	call ali_mesh_encrypt_base_function_k4
+	call ali_mesh_access_layer_finish_pairing_init_subscription_list
+	call ali_mesh_accesss_layer_check_message_type
+	call ali_mesh_access_layer_send_config_AppKey_status
+	jam PAIRED_STATUS,mem_mesh_provisioned_flag
+	fetch 2,mem_mesh_cb_receive_config_appkey_add
+	branch callback_func
+
+ali_mesh_accesss_layer_check_message_type:
+	fetch 1,mem_mesh_network_packet_type
+	jam RECEIVED_CONFIG_APPKEY_ADD,mem_mesh_provisioned_flag		//中间状态 APP配网时，需要回复数量多
+	rtneq MESH_MESSAGE_APP
+	jam PAIRED_STATUS,mem_mesh_provisioned_flag					//tmall配网不需要重传多次
+	rtn
+
+ali_mesh_access_layer_send_config_AppKey_status:
+	setarg MESH_CONFIGURATION_AND_HEALTH_MESSAGE_OPCODE_HEADER
+	store 1,mem_mesh_access_layer_payload
+	setarg MESH_MESSAGE_OPCODE_CONFIG_CONFIG_MODEL_PUBLICATION_SET
+	istore 1,contw
+	setarg STATUS_CODE_SUCCESS
+	istore 1,contw
+	fetch 3,mem_mesh_NETKeyindex_and_APPKeyindex
+	istore 3,contw
+	jam 6,mem_mesh_access_layer_payload_len
+	branch ali_mesh_upper_transport_layer_send_access_message
+
+
+ali_mesh_access_layer_finish_pairing_init_subscription_list:
+	fetch 2,mem_mesh_core_feature
+	rtnbit1 MESH_FEATURE_DISABLE_SUBSCRIPTION
+	call mesh_get_element_info_config
+ali_mesh_access_layer_finish_pairing_init_subscription_list_loop:
+	add rega,ELEMENT_DEVICE_SUBSCRIPTION_LABEL,regc
+	setarg -1
+	istore SUBSCRIPTION_MAX_COUNT,regc
+	istore SUBSCRIPTION_MAX_COUNT,contw
+	ifetch 2,rega		//read group address
+	istore 2,regc
+	copy regb,pdata
+	iadd rega,rega
+	loop ali_mesh_access_layer_finish_pairing_init_subscription_list_loop
+	fetch 2,mem_mesh_cb_subscriptuion_list_changed
+	branch callback_func
+
+
+/*
+	generic onoff status
+*/
+ali_mesh_access_layer_send_generic_onoff_status:
+	setarg MESH_MODULE_MESSAGE_OPCODE_HEADER
+	store 1,mem_mesh_access_layer_payload
+	setarg MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONOFF_STATUS_NO_HEAD
+	istore 1,contw
+	fetch 1,mem_mesh_generic_onoff_set_payload_OnOff
+	istore 1,contw
+	jam 3,mem_mesh_access_layer_payload_len
+	branch ali_mesh_upper_transport_layer_send_access_message
+
+
+/*
+	light lightness status
+*/
+ali_mesh_access_layer_send_light_lightness_status:
+	setarg MESH_MODULE_MESSAGE_OPCODE_HEADER
+	store 1,mem_mesh_access_layer_payload
+	setarg MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_STATUS_NO_HEAD
+	istore 1,contw
+	fetch 2,mem_mesh_light_lightness_set_payload_lightness
+	istore 2,contw
+	jam 4,mem_mesh_access_layer_payload_len
+	branch ali_mesh_upper_transport_layer_send_access_message
+
+
+ali_mesh_access_layer_send_light_ctl_stauts:
+	setarg MESH_MODULE_MESSAGE_OPCODE_HEADER
+	store 1,mem_mesh_access_layer_payload
+	setarg MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_STATUS_NO_HEAD
+	istore 1,contw
+	fetch 4,mem_mesh_CTL_Lightness
+	istore 4,contw
+	jam 6,mem_mesh_access_layer_payload_len
+	branch ali_mesh_upper_transport_layer_send_access_message
+
+
+
+ali_mesh_access_layer_send_scene_status:
+	setarg MESH_MODULE_MESSAGE_OPCODE_SCENE_STATUS
+	store 1,mem_mesh_access_layer_payload
+	setarg MESH_SUCCESS
+	istore 1,contw
+	fetch 2,mem_mesh_scene_recall_payload_scene_number
+	istore 2,contw
+	jam 4,mem_mesh_access_layer_payload_len
+	branch ali_mesh_upper_transport_layer_send_access_message
+
+
+
+logging_tx_info_receive_access_message:
+	fetchr loopcnt,1,mem_ccm_data_len
+	copy alarm,rega
+	arg MESH_ACCESS_RECEIVE_MESSAGE,regb
+	branch logging_tx_info
+
Index: program/mesh_protocol_stack/mesh_ali_vendor_message.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_ali_vendor_message.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_ali_vendor_message.prog	(working copy)
@@ -0,0 +1,503 @@
+
+/*
+	mesh协议中ali vendor message resolve
+	主要是阿里自定义attribute set 指令设置
+*/
+
+
+/*
+	主要是阿里定时设置模块指令解析
+	其他非标的指令设置
+*/
+ali_mesh_ali_vendor_message_attribute_set:
+	call ali_mesh_ali_vendor_message_attrbute_check_company_id_and_tid
+	nrtn user
+	fetch 2,mem_mesh_vendor_message_attr_type
+	arg VENDOR_MESSAGE_ATTR_TYPE_TIME,temp
+	isub temp,null	//设置设备的时间
+	branch ali_mesh_ali_vendor_message_opcode_timer_set_curr_time,zero
+	arg VENDOR_MESSAGE_ATTR_TYPE_TIMING,temp
+	isub temp,null
+	branch ali_mesh_ali_vendor_message_opcode_timer_set_timing,zero
+	arg VENDOR_MESSAGE_ATTR_TYPE_CYCLE_TIMING, temp
+	isub temp, null
+	branch ali_mesh_ali_vendor_message_opcode_timer_set_timing_cyclically, zero
+	arg VENDOR_MESSAGE_ATTR_TYPE_DELETE_TIMING,temp
+	isub temp,null
+	branch ali_mesh_ali_vendor_message_opcode_timer_delete_timing,zero
+	arg VENDOR_MESSAGE_ATTR_TYPE_MAIN_LIGHT,temp
+	isub temp,null	//主灯控制
+	branch ali_mesh_ali_vendor_message_attribute_set_main_light,zero
+	arg VENDOR_MESSAGE_ATTR_TYPE_BACKGROUND_LIGHT,temp
+	isub temp,null	//背光灯控制
+	branch ali_mesh_ali_vendor_message_attribute_set_background_light,zero
+	arg VENDOR_MESSAGE_ATTR_TYPE_COLOR,temp
+	isub temp,null	//颜色控制
+	branch ali_mesh_ali_vendor_message_attribute_set_color,zero
+	rtn
+
+ali_mesh_ali_vendor_message_opcode_attr_get:
+ali_mesh_ali_vendor_message_opcode_attr_confrimation:
+	rtn
+
+ali_mesh_ali_vendor_message_attrbute_check_company_id_and_tid:
+	call disable_user
+	fetch 2,mem_mesh_vendor_message_cid
+	arg VENDOR_MESSAGE_OPCODE_COMPANY_ID,temp
+	isub temp,null
+	nrtn zero
+	fetcht 1,mem_mesh_vendor_mesh_receive_tid
+	fetch 1,mem_mesh_vendor_message_tid
+	isub temp,null
+	rtn zero
+	store 1,mem_mesh_vendor_mesh_receive_tid
+	branch enable_user
+
+ali_mesh_ali_vendor_message_attribute_set_main_light:
+	call ali_mesh_ali_vendor_message_ack_attr_status_uint8
+	fetch 2,mem_mesh_cb_main_light_onoff_set
+	branch callback_func
+
+
+ali_mesh_ali_vendor_message_attribute_set_background_light:
+	call ali_mesh_ali_vendor_message_ack_attr_status_uint8
+	fetch 2,mem_mesh_cb_background_onoff_set
+	branch callback_func
+
+ali_mesh_ali_vendor_message_attribute_set_color:
+	call ali_mesh_ali_vendor_message_ack_attr_status_uint48
+	fetch 2,mem_mesh_cb_color_set
+	branch callback_func
+
+
+/*
+	阿里定时模块代码
+*/
+ali_mesh_ali_vendor_message_opcode_timer_set_curr_time:
+	call ali_mesh_ali_vendor_message_ack_attr_status_uint32
+
+	fetch 4,mem_mesh_vendor_message_current_time
+	store 4,mem_mesh_vendor_timer_current_time
+	branch ali_mesh_time_init_system_time
+
+
+ali_mesh_ali_vendor_message_opcode_timer_set_timing:
+	call ali_mesh_ali_vendor_message_ack_attr_status_uint64
+	call ali_mesh_ali_vendor_message_calc_timing_address
+	rtn blank
+	fetch 1,mem_mesh_vendor_timer_timing_index
+	call ali_mesh_vendor_timer_buffer_offset_cal
+	fetcht 8,mem_mesh_vendor_timer_timing_index
+	istoret 8,contw
+ali_mesh_ali_vendor_message_cb_timing_changed:
+	fetch 2,mem_mesh_cb_vendor_timing_changed
+	branch callback_func
+
+ali_mesh_ali_vendor_message_opcode_timer_set_timing_cyclically:
+	call ali_mesh_ali_vendor_message_ack_attr_status_uint56
+	call ali_mesh_ali_vendor_message_calc_timing_address
+	rtn blank
+	jam TIMER_CYCLICAL_FALG,mem_mesh_vendor_timer_timing_cyclic_flag
+	fetch 1,mem_mesh_vendor_timer_timing_index_cyclic
+	call ali_mesh_vendor_timer_buffer_offset_cal
+	fetch 8,mem_mesh_vendor_timer_timing_index_cyclic    //取8个Bytes，包括标识周期定时的flag
+	istore 8,contw
+	branch ali_mesh_ali_vendor_message_cb_timing_changed
+
+
+ali_mesh_ali_vendor_message_opcode_timer_delete_timing:
+	call ali_mesh_ali_vendor_message_opcode_timer_delete_timing_ack
+	call ali_mesh_ali_vendor_message_calc_timing_address
+	rtn blank
+	fetch 1,mem_mesh_vendor_timer_timing_index
+	rtn blank
+	call ali_mesh_vendor_timer_buffer_offset_cal
+	arg 0, temp
+	istoret 1, contw
+	fetch 1,mem_mesh_receive_model_message_payload_len
+	sub pdata,8,null
+	call ali_mesh_ali_vendor_message_opcode_timer_delete_timing_delete_second,zero
+	branch ali_mesh_ali_vendor_message_cb_timing_changed
+
+ali_mesh_ali_vendor_message_opcode_timer_delete_timing_delete_second:
+	call ali_mesh_ali_vendor_message_calc_timing_address
+	fetch 1,mem_mesh_vendor_timer_timing_index1
+	call ali_mesh_vendor_timer_buffer_offset_cal
+	arg 0, temp
+	istoret 1, contw
+	rtn
+
+
+ali_mesh_ali_vendor_message_opcode_timer_delete_timing_ack:
+	fetch 1,mem_mesh_receive_model_message_payload_len
+	beq 7,ali_mesh_ali_vendor_message_ack_attr_status_uint8
+	branch ali_mesh_ali_vendor_message_ack_attr_status_uint16
+
+ali_mesh_vendor_timer_buffer_offset_cal:
+	pincrease -1
+	lshift3 pdata,pdata
+	iadd contw,contw
+	rtn
+
+
+ali_mesh_ali_vendor_message_calc_timing_address:
+	call mesh_get_element_info_config
+	add rega,ELEMENT_DEVICE_VENDOR_TIME_PTR,rega
+	fetch 1,mem_mesh_receive_element_number
+	imul32 regb,pdata
+	iadd rega,rega
+	ifetch 2,rega
+	copy pdata,contw
+	rtn
+
+
+
+/*
+	阿里mesh自定义status,被动回复SET或者GET状态
+*/
+
+ali_mesh_ali_vendor_message_status_add_head:
+	setarg VENDOR_MESSAGE_ATTR_STATUS
+	store 1,mem_mesh_access_layer_payload
+	setarg VENDOR_MESSAGE_OPCODE_COMPANY_ID
+	istore 2,contw
+	fetch 1,mem_mesh_vendor_mesh_receive_tid
+	istore 1,contw
+	istoret 2,contw
+	rtn
+
+
+/*
+	阿里mesh自定义indication，主动上报状态给天猫精灵
+	DST:0x00f0
+*/
+//开关上电
+ali_mesh_ali_vendor_message_opcode_device_power_on:
+	arg 0,queue
+	arg VENDOR_MESSAGE_EVENT_DEVICE_POWER_ON,temp
+	arg VENDOR_ATTR_TYPE_EVENT_TRIGGER,rega
+	branch ali_mesh_ali_vendor_message_opcode_para_uint8
+
+
+//上报开关状态
+//input:temp is generic onoff status
+//0 GENERIC_ONOFF_CMD_OFF
+//1 GENERIC_ONOFF_CMD_ON
+//input:queue is element number
+//e.g 灯queue0
+//风扇灯中灯0，风扇1
+//风扇:0
+ali_mesh_ali_vendor_message_opcode_generic_OnOff:
+	arg VENDOR_ATTR_GENERIC_ONOFF_SERVER,rega
+	branch ali_mesh_ali_vendor_message_opcode_para_uint8
+
+//上报模式给天猫精灵
+//input: temp is scene server mode
+ali_mesh_ali_vendor_message_opcode_scene_server_first_element:
+	arg 0,queue
+//上报模式给天猫精灵
+//input: temp is scene server mode
+//queue is element_number
+ali_mesh_ali_vendor_message_opcode_scene_server:
+	arg VENDOR_ATTR_SCENE_SERVER,rega
+	branch ali_mesh_ali_vendor_message_opcode_para_uint16
+
+
+ali_mesh_ali_vendor_message_opcode_main_light_OnOff_first_element:
+	arg 0,queue
+//上报主灯开关状态
+//input:temp is generic onoff status
+//0 GENERIC_ONOFF_CMD_OFF
+//1 GENERIC_ONOFF_CMD_ON
+//input:queue is element number
+ali_mesh_ali_vendor_message_opcode_main_light_OnOff:
+	arg VENDOR_ATTR_MAIN_LIGHT_SERVER,rega
+	branch ali_mesh_ali_vendor_message_opcode_para_uint8
+
+ali_mesh_ali_vendor_message_opcode_background_light_OnOff_first_element:
+	arg 0,queue
+//上报背光灯开关状态
+//input:temp is generic onoff status
+//0 GENERIC_ONOFF_CMD_OFF
+//1 GENERIC_ONOFF_CMD_ON
+//input:queue is element number
+ali_mesh_ali_vendor_message_opcode_background_light_OnOff:
+	arg VENDOR_ATTR_BACKGROUND_LIGHT_ONOFF_SERVER,rega
+	branch ali_mesh_ali_vendor_message_opcode_para_uint8
+
+ali_mesh_ali_vendor_message_opcode_brightness_first_element:
+	arg 0,queue
+//上报灯的亮度
+//input:temp is bright ness 0-100
+ali_mesh_ali_vendor_message_opcode_brightness:
+	call ali_mesh_model_layer_message_calc_actual_lightness
+	arg VENDOR_ATTR_LIGHTNESS_LEVEL_SERVER,rega
+	branch ali_mesh_ali_vendor_message_opcode_para_uint16
+
+ali_mesh_ali_vendor_message_opcode_color_temperature_first_element:
+	arg 0,queue
+//上报灯的亮度
+//input:temp is bright ness 0-100
+ali_mesh_ali_vendor_message_opcode_color_temperature:
+	call ali_mesh_model_layer_message_calc_actual_temperature
+	arg VENDOR_ATTR_COLOR_TEMPERATURE_SERVER,rega
+	branch ali_mesh_ali_vendor_message_opcode_para_uint16
+
+
+//input:temp is timing index number
+ali_mesh_ali_vendor_message_opcode_timing_finish:
+	lshift temp,temp
+	or temp,VENDOR_MESSAGE_EVENT_FINISH_TIMING,temp
+	arg VENDOR_ATTR_TYPE_EVENT_TRIGGER,rega
+	branch ali_mesh_ali_vendor_message_opcode_para_uint16
+
+
+ali_mesh_ali_vendor_message_indication_info_add_head_event_trigger:
+	call ali_mesh_ali_vendor_message_indication_info_add_head
+	setarg VENDOR_ATTR_TYPE_EVENT_TRIGGER
+	istore 2,contw
+	rtn
+
+ali_mesh_ali_vendor_message_ack_attr_status_uint64:
+	arg 8,loopcnt
+	branch ali_mesh_ali_vendor_message_ack_attr_status
+
+ali_mesh_ali_vendor_message_ack_attr_status_uint56:
+	arg 8,loopcnt
+	branch ali_mesh_ali_vendor_message_ack_attr_status
+
+ali_mesh_ali_vendor_message_ack_attr_status_uint48:
+	arg 6,loopcnt
+	branch ali_mesh_ali_vendor_message_ack_attr_status
+
+ali_mesh_ali_vendor_message_ack_attr_status_uint32:
+	arg 4,loopcnt
+	branch ali_mesh_ali_vendor_message_ack_attr_status
+
+ali_mesh_ali_vendor_message_ack_attr_status_uint16:
+	arg 2,loopcnt
+	branch ali_mesh_ali_vendor_message_ack_attr_status
+
+ali_mesh_ali_vendor_message_ack_attr_status_uint8:
+	arg 1,loopcnt
+	branch ali_mesh_ali_vendor_message_ack_attr_status
+
+//input:loopcnt is attr length
+ali_mesh_ali_vendor_message_ack_attr_status:
+	add loopcnt,6,pdata
+	store 1,mem_mesh_access_layer_payload_len
+	call ali_mesh_ali_vendor_message_status_add_head
+	arg mem_mesh_vendor_attr_parameter,contr
+	call memcpy
+	branch ali_mesh_upper_transport_layer_send_access_message
+	
+
+
+//input:queue is element number
+//rega is vendor model attr
+//temp is vendor model attr parameter 
+ali_mesh_ali_vendor_message_opcode_para_uint8:
+	call ali_mesh_ali_vendor_message_indication_info_add_head
+	istorer rega,2,contw
+	istoret 1,contw
+	jam 7,mem_mesh_access_layer_payload_len
+	branch ali_mesh_ali_vendor_message_send_message
+
+
+//input:queue is element number
+//rega is vendor model attr
+//temp is vendor model attr parameter 
+ali_mesh_ali_vendor_message_opcode_para_uint16:
+	call ali_mesh_ali_vendor_message_indication_info_add_head
+	istorer rega,2,contw
+	istoret 2,contw
+	jam 8,mem_mesh_access_layer_payload_len
+	branch ali_mesh_ali_vendor_message_send_message
+
+
+//input:queue is element number
+ali_mesh_ali_vendor_message_send_message:
+	call ali_mesh_more_element_calc_queue_address
+	branch ali_mesh_upper_transport_layer_send_access_message_without_cleat_tx_buffer
+
+
+ali_mesh_ali_vendor_message_indication_info_add_head:
+	fetch 1,mem_mesh_transport_AID
+	store 1,mem_mesh_message_Transport_Head
+	setarg VENDOR_MESSAGE_TMALL_DST
+	store 2,mem_mesh_send_message_DST
+	fetch 1,mem_mesh_vendor_mesh_send_tid
+	pincrease 1
+	store 1,mem_mesh_vendor_mesh_send_tid
+	beq VENDOR_MESSAGE_SEND_TID_MAX,ali_mesh_ali_vendor_message_indication_info_reset_tid
+	setarg VENDOR_MESSAGE_ATTR_INDICATION
+	store 1,mem_mesh_access_layer_payload
+	setarg VENDOR_MESSAGE_OPCODE_COMPANY_ID
+	istore 2,contw
+	fetch 1,mem_mesh_vendor_mesh_send_tid
+	istore 1,contw
+	rtn
+
+ali_mesh_ali_vendor_message_indication_info_reset_tid:
+	jam VENDOR_MESSAGE_SEND_TID_MIN,mem_mesh_vendor_mesh_send_tid
+	rtn
+
+/*
+	阿里定时函数
+*/
+ali_mesh_time_function:
+	copy clkn_bt,temp
+	fetch 4,mem_system_time
+	isub temp,null
+	call ali_mesh_timer_timeout,positive
+	call ali_mesh_clkn_bt_add_1s
+	isub temp,null	
+	rtn positive
+	call ali_mesh_time_init_system_time_without_clk
+	fetch 4,mem_mesh_vendor_timer_current_time
+	pincrease 1
+	store 4,mem_mesh_vendor_timer_current_time
+	branch ali_mesh_ali_vendor_check_time
+
+
+ali_mesh_time_init_system_time:
+	copy clkn_bt,pdata
+ali_mesh_time_init_system_time_without_clk:
+	store 4,mem_system_time
+	fetch 1,mem_system_time+3
+	and_into 0x0f,pdata
+	store 1,mem_system_time+3
+	rtn
+
+ali_mesh_timer_timeout:
+	rtn zero
+	copy pdata,regb
+	setarg 0x100000
+	lshift8 pdata,pdata
+	iadd temp,temp
+	copy regb,pdata
+	rtn
+
+ali_mesh_clkn_bt_add_1s:
+	arg 20,loopcnt
+ali_mesh_time_loop:	
+	pincrease 160
+	loop ali_mesh_time_loop	
+	rtn
+
+ali_mesh_ali_vendor_check_time:
+	call mesh_get_element_info_config
+	add rega,ELEMENT_DEVICE_VENDOR_TIME_PTR,rega
+	jam 0,mem_mesh_receive_element_number
+
+ali_mesh_ali_vendor_check_time_loop:
+	call ali_mesh_more_element_push_stack
+	ifetch 2,rega
+	branch ali_mesh_ali_vendor_check_time_next_element,blank
+	copy pdata,alarm
+	call ali_mesh_ali_vendor_check_time_one_element
+ali_mesh_ali_vendor_check_time_next_element:
+	call ali_mesh_more_element_pop_stack
+	fetch 1,mem_mesh_receive_element_number
+	pincrease 1
+	store 1,mem_mesh_receive_element_number
+	fetcht 1,mem_mesh_element_number
+	isub temp,pdata
+	rtn zero	//check all
+	copy regb,pdata
+	iadd rega,rega
+	branch ali_mesh_ali_vendor_check_time_loop
+
+ali_mesh_ali_vendor_check_time_one_element:
+	arg 40,loopcnt
+//timer loop:input loopcnt timer count
+//alarm timer address
+//mem_mesh_receive_element_number:element number
+ali_mesh_ali_vendor_check_time_one_element_loop:
+	copy loopcnt,pdata
+	store 1,mem_mesh_loopcnt_tmep
+	ifetch 1,alarm
+	ncall ali_mesh_ali_vendor_had_timing,blank 
+	increase 8,alarm
+	fetch 1,mem_mesh_loopcnt_tmep
+	copy pdata,loopcnt
+	loop ali_mesh_ali_vendor_check_time_one_element_loop
+	rtn
+
+ali_mesh_ali_vendor_had_timing:
+	ifetcht 8, alarm
+	storet 8, mem_mesh_vendor_timer_timing_index_cyclic    //作为每次检测的临时存储
+	fetch 1,mem_mesh_vendor_timer_timing_attr_para
+	beq TIMER_CYCLICAL_FALG, ali_mesh_ali_vendor_had_timing_cyclically
+	fetcht 4,mem_mesh_vendor_timer_current_time
+	fetch 4, mem_mesh_vendor_timer_timing_time
+	isub temp,null
+	fetch 1, mem_mesh_vendor_timer_timing_attr_para
+	branch ali_mesh_ali_vendor_time_timeout,zero
+	rtn
+
+ali_mesh_ali_vendor_time_timeout:
+	store 1,mem_mesh_generic_onoff_set_payload_OnOff
+	
+	fetch 2,mem_mesh_cb_generic_onoff_set
+	call callback_func
+
+	copy alarm,pdata
+	store 2,mem_mesh_alarm_temp
+
+	fetchr queue,1,mem_mesh_receive_element_number
+	ifetcht 1,alarm
+	call ali_mesh_ali_vendor_message_opcode_timing_finish
+
+	fetcht 1,mem_mesh_generic_onoff_set_payload_OnOff
+	fetchr queue,1,mem_mesh_receive_element_number
+	call ali_mesh_ali_vendor_message_opcode_generic_OnOff
+
+	fetch 2,mem_mesh_alarm_temp
+	copy pdata,alarm
+	setarg 0
+	istore 1,alarm
+	branch ali_mesh_ali_vendor_message_cb_timing_changed
+
+
+ali_mesh_ali_vendor_had_timing_cyclically:
+	fetch 4, mem_mesh_vendor_timer_current_time
+	arg SECONDS_OF_MIN, temp
+	idiv temp
+	call wait_div_end
+	remainder pdata
+	nrtn blank
+
+	fetch 4, mem_mesh_vendor_timer_current_time
+	arg SECONDS_OF_FOUR_DAYS, temp
+	isub temp, pdata      //格林威治时间1970年01月01日为周四,  这里减去四天，为了与周一对齐
+
+	arg SECONDS_OF_WEEK, temp
+	idiv temp
+	call wait_div_end
+	remainder pdata     //pdata:本周走过的秒数
+	arg SECONDS_OF_DAY, temp
+	idiv temp
+	call wait_div_end
+	remainder rega     //rega:当天走过的秒数
+	quotient queue    //queue:当前是周几；0:周一；1:周二；... ...6:周日
+	
+	setarg 0    //clear pdata
+	qset1 pdata
+	fetcht 1, mem_mesh_vendor_timer_timing_weekdays_cyclic
+	iand temp, pdata
+	rtn blank
+	deposit rega
+	arg SECONDS_OF_MIN, temp
+	idiv temp
+	call wait_div_end
+	quotient temp
+	setarg EIGHT_HOURS_TIME_ZONE_OFFSET
+	iadd temp, temp
+	fetch 2, mem_mesh_vendor_timer_timing_time_cyclic
+	isub temp, null
+	nrtn zero
+	fetch 1, mem_mesh_vendor_timer_timing_attr_para_cyclic
+	branch ali_mesh_ali_vendor_time_timeout
+
+
Index: program/mesh_protocol_stack/mesh_bearer_layer.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_bearer_layer.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_bearer_layer.prog	(working copy)
@@ -0,0 +1,106 @@
+
+/*
+	mesh协议中bearer layer
+	主要是负责mesh中实际发送数据包内容
+*/
+
+ali_mesh_bearer_layer_send_packet_by_network_layer:
+	bpatchx patch3d_6,mem_patch3d
+	jam ADV_PAIRING_MESH_MESSAGE_DURATION,mem_mesh_queue_ele_duration
+	fetch 1,mem_mesh_gatt_package_send_msg_id
+	store 1,mem_mesh_queue_ele_gatt_msg_id
+
+	fetch 1,mem_mesh_lower_transport_layer_payload_len
+	pincrease 11
+	add pdata,-2,loopcnt
+	//长度+11的原因
+	//uint8_t AD length
+	//uint8_t AD type:GAP_ADTYPE_MESH_MESSAGE
+	//uint8_t IVI & NID
+	//uint8_t CTL & TTL
+	//uint24_t SEQ
+	//uint16_t SRC
+	//uint16_t DST
+	store 1,mem_mesh_queue_ele_len
+	pincrease -1
+	//-1的原因
+	//uint8_t AD length
+	istore 1,contw
+	setarg GAP_ADTYPE_MESH_MESSAGE
+	istore 1,contw
+	arg mem_mesh_send_upper_layer_IVI_and_NID,contr
+	call memcpy_fast
+	fetchr rega,2,mem_mesh_rega_temp
+	call ali_mesh_advertising_bearer_layer_init_queue_param
+	branch queue_push
+
+ali_mesh_advertising_bearer_layer_init_queue_param:
+	add rega,ELEMENT_DEVICE_QUEUE_BUFFER_PTR,contr
+	ifetch 2,contr
+	store 2,mem_queue_ptr
+	arg mem_mesh_queue_ele_temp,rega
+	rtn
+
+ali_mesh_advertising_bearer_layer_load_packet_from_advertising_queue:
+	arg ali_mesh_advertising_bearer_layer_load_packet_from_advertising_queue_deal,regc
+	branch ali_mesh_check_all_element_info
+
+ali_mesh_advertising_bearer_layer_load_packet_from_advertising_queue_deal:
+	add rega,ELEMENT_DEVICE_UPPER_ADV_FLAG,contr
+	ifetch 1,contr
+	rtnne PACKET_IN_BEARER
+	setarg PACKET_IN_ADVERTING
+	add rega,ELEMENT_DEVICE_UPPER_ADV_FLAG,contw
+	istore 1,contw
+	branch ali_mesh_control_ble_advertising_on_advertising
+
+
+/*
+	app 回复的发包拆包逻辑
+*/
+ali_mesh_advertising_bearer_layer_send_packet_by_app_bearer:
+	call ali_mesh_advertising_bearer_layer_generate_header
+	add temp,13,pdata
+	store 1,mem_mesh_adv_data_len
+	call ali_mesh_advertising_add_adtype_flags
+	add temp,9,pdata
+	istore 1,contw
+	setarg GAP_ADTYPE_MANUFACTURER_SPECIFIC
+	istore 1,contw
+	fetch 8,mem_mesh_receive_service_uuid_ios_data_company_id
+	istore 8,contw
+	copy rega,contr
+	copy temp,loopcnt
+	call memcpy
+	branch mesh_le_send_adv
+
+ali_mesh_advertising_bearer_layer_generate_header:
+	setarg COMPANY_ID_ALIBABA_AND_VID_GATT
+	store 3,mem_mesh_receive_service_uuid_ios_data_company_id
+	setarg PROVISIONING_SEND_IOS_DATA
+	store 1,mem_mesh_receive_service_uuid_ios_data_provisioning_type
+	fetch 1,mem_k2_NID
+	store 1,mem_mesh_receive_service_uuid_ios_data_NID
+	fetch 1,mem_mesh_queue_ele_gatt_msg_id
+	store 1,mem_mesh_receive_service_uuid_ios_data_msg_id
+	
+	fetch 1,mem_mesh_queue_ele_duration
+	isolate1 BIT_OF_APP_PACKAGE_NUM,pdata
+	call ali_mesh_advertising_bearer_layer_send_packet_by_app_bearer_calc_param
+	store 1,mem_mesh_receive_service_uuid_ios_data_package_num
+	storet 1,mem_mesh_receive_service_uuid_ios_data_length
+	rtn
+
+
+ali_mesh_advertising_bearer_layer_send_packet_by_app_bearer_calc_param:
+	arg mem_mesh_queue_ele_payload+2,rega
+	arg MAX_APP_MSSAGE_PAYLOAD_LENGTH,temp
+	setarg 0x21		//
+	nrtn true
+	arg mem_mesh_queue_ele_payload+20,rega		//MAX_APP_MSSAGE_PAYLOAD_LENGTH+2
+	fetcht 1,mem_mesh_queue_ele_len
+	increase -18,temp		//MAX_APP_MSSAGE_PAYLOAD_LENGTH
+	setarg 0x22
+	rtn
+
+
Index: program/mesh_protocol_stack/mesh_ble_core_advertising.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_ble_core_advertising.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_ble_core_advertising.prog	(working copy)
@@ -0,0 +1,151 @@
+
+
+
+//0x01 GAP_ADTYPE_FLAGS
+//input:no default write mem_mesh_adv_data
+ali_mesh_advertising_add_adtype_flags:
+	arg mem_mesh_adv_data,contw
+	setarg 0x02
+	istore 1,contw
+	setarg GAP_ADTYPE_FLAGS
+	istore 1,contw
+	setarg 0x02
+	istore 1,contw
+	rtn
+
+//0x01 GAP_ADTYPE_FLAGS
+//input:no default write mem_mesh_adv_data
+ali_mesh_advertising_add_adtype_16bit_complete:
+	arg MESH_PROVISIONING_UUID,temp
+	setarg 0x03
+	istore 1,contw
+	setarg GAP_ADTYPE_16BIT_COMPLETE
+	istore 1,contw
+	istoret 2,contw
+	rtn
+
+/*
+	mesh 硬件接收scan 扫描包
+*/
+mesh_receive_advertising:
+	branch mesh_le_scan_adv
+
+mesh_le_scan_adv:
+	call le_enable
+	call le_init_adv
+	call mesh_le_wait_adv
+	nrtn match
+	fetch 1,mem_le_adv_rcv
+	pincrease 1
+	store 1,mem_le_adv_rcv
+	fetch 2,mem_mesh_cb_receive_advertising
+	call callback_func
+	branch le_disable
+
+mesh_le_wait_adv:
+	call mesh_le_calc_next_scan_channel
+	branch le_receive_adv
+
+mesh_le_calc_next_scan_channel:
+	fetch 1,mem_mesh_adv_scan_channel
+	pincrease 1
+	store 1,mem_mesh_adv_scan_channel
+	store 1,mem_le_ch_mapped
+	rtnne 40
+	jam 37,mem_mesh_adv_scan_channel
+	jam 37,mem_le_ch_mapped
+	rtn
+
+
+/*
+	mesh 解析标准广播数据
+	只分析ADV_IND/ADV_NONCONN_IND两种广播包
+*/
+mesh_check_ble_rx_packet:
+	fetch 1,mem_le_rxbuf
+	and pdata,0x0f,pdata
+	beq ADV_IND,ali_mesh_match_advertising_packet
+	beq ADV_NONCONN_IND,ali_mesh_match_advertising_packet
+	rtn
+
+ali_mesh_match_advertising_packet:
+	ifetcht 1,contr	//length
+	sub temp,ADV_PACKET_MIN_LENGTH,null
+	rtn positive	//过滤短包，包长度太短导致解析错误
+	sub temp,ADV_PACKET_MAX_LENGTH,null
+	nrtn positive	//过滤长包，包长度太长导致内存覆盖
+	add temp,-6,rega	//rega:减去address length
+	add contr,6,regb	//regb:指针偏移到regb
+
+ali_mesh_find_adv_ind_packet:
+	ifetcht 1,regb //length
+	sub temp,AD_TYPE_MIN_LENGTH,null
+	rtn positive	//过滤短包，包长度太短导致解析错误
+	sub temp,AD_TYPE_MAX_LENGTH,null
+	nrtn positive	//过滤长包，包长度太长导致内存覆盖
+	copy temp,pdata
+	rtn blank
+	bpatchx patch3d_7,mem_patch3d
+	ifetch 1,contr
+	beq GAP_ADTYPE_MANUFACTURER_SPECIFIC,ali_mesh_receive_adtype_manufacturer_specific
+	beq GAP_ADTYPE_MESH_MESSAGE,ali_mesh_receive_adtype_mesh_message
+	beq GAP_ADTYPE_128BIT_COMPLETE,ali_mesh_receive_adtype_128bit_uuid_complete
+//按照广播格式查询所有扫描到的广播数据
+	add temp,1,pdata
+	isub rega,null
+	rtn positive
+	iadd regb,regb
+	sub temp,-1,pdata
+	iadd rega,rega
+	copy rega,pdata
+	rtn blank
+	branch ali_mesh_find_adv_ind_packet
+
+
+mesh_le_send_adv:
+	fetch 1,mem_le_adv_transmit
+	pincrease 1
+	store 1,mem_le_adv_transmit
+	bpatchx patch3e_0,mem_patch3e
+	call le_enable
+	arg 39,loopcnt
+	arg mem_le_txheader,contr
+	arg mem_le_txheader_mesh_temp,contw
+	call memcpy_fast
+	jam 37,mem_le_ch_mapped
+	arg 1800,stop_watch
+	disable match
+
+mesh_le_send_adv_loop:
+	call le_init_adv
+	call mesh_le_send_adv_nonconn_ind
+	random pdata 
+	arg 0x1ff,temp
+	iand temp,pdata
+	add pdata,100,pdata
+	call delay
+	fetch 1,mem_le_ch_mapped
+	pincrease 1
+	store 1,mem_le_ch_mapped
+	bne 40,mesh_le_send_adv_loop
+	
+	arg 39,loopcnt
+	arg mem_le_txheader,contw
+	arg mem_le_txheader_mesh_temp,contr
+	call memcpy_fast
+	branch le_disable
+
+mesh_le_send_adv_nonconn_ind:
+	arg ADV_NONCONN_IND,temp
+	storet 1,mem_le_txheader
+	fetcht 1,mem_mesh_adv_data_len
+	add temp,6,pdata
+	store 1,mem_le_txlen
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload
+	copy temp,loopcnt
+	arg mem_mesh_adv_data,contr
+	call memcpy_fast
+	branch le_transmit_norx
+
+
Index: program/mesh_protocol_stack/mesh_chip_peripherals.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_chip_peripherals.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_chip_peripherals.prog	(working copy)
@@ -0,0 +1,258 @@
+
+//input:mem_mesh_mic_cache_ptr is cache buffer ptr
+//data ptr is store mem_ccm_data_ptr
+//data length is store mem_ccm_data_len
+//cache space size is TRANSPORT_MIC_CACHE_SPACE_SIZE
+//cache space num is TRANSPORT_MIC_CACHE_SPACE_NUM
+//output:user is enable ,mean new packet
+ali_mesh_base_adt_cache:
+	bpatchx patch3e_1,mem_patch3e
+	fetcht 2,mem_ccm_data_ptr
+	fetch 1,mem_ccm_data_len
+	copy temp,contr
+	arg mem_k4_SALT,rega
+	arg mem_k4_T,alarm
+	call ali_mesh_encrypt_base_function_AES_CMAC
+	call disable_user
+	copy regc,pdata
+	iadd alarm,contr
+	fetcht 4,mem_k4_T
+	fetch 2,mem_mesh_mic_cache_ptr
+	copy pdata,rega
+//	arg mem_mesh_access_message_mic_cache,rega
+	arg TRANSPORT_MIC_CACHE_SPACE_NUM,loopcnt
+ali_mesh_base_adt_cache_loop:
+	ifetch 4,rega
+	branch ali_mesh_base_adt_cache_empty_space,blank
+	isub temp,null
+	rtn zero
+	increase TRANSPORT_MIC_CACHE_SPACE_SIZE,rega
+	loop ali_mesh_base_adt_cache_loop
+	fetch 2,mem_mesh_mic_cache_ptr
+	copy pdata,contw
+	add pdata,TRANSPORT_MIC_CACHE_SPACE_SIZE,contr
+//	arg mem_mesh_access_message_mic_cache,contw
+//	arg mem_mesh_access_message_mic_cache+TRANSPORT_MIC_CACHE_SPACE_SIZE,contr
+	arg TRANSPORT_MIC_CACHE_TOTAL_SIZE,loopcnt
+	call memcpy_fast
+	istoret 4,contw
+	branch enable_user
+ali_mesh_base_adt_cache_empty_space:
+	istoret 4,rega
+	branch enable_user
+
+/*
+	iic 读写eeprom接口
+	三元组、network key、aapplication key、device key、reset count
+	SEQ
+*/
+ali_mesh_chip_peripherals_load_data_from_eep:
+	call ali_mesh_chip_peripherals_load_three_tuple_from_eep
+	call ali_mesh_chip_peripherals_load_network_key_from_eep
+	call ali_mesh_chip_peripherals_load_application_key_from_eep
+	call ali_mesh_chip_peripherals_load_device_key_from_eep
+	call ali_mesh_chip_peripherals_load_reset_count_from_eep
+	call ali_mesh_chip_peripherals_load_seq_from_eep
+	branch ali_mesh_chip_peripherals_load_subscription_from_eep
+
+ali_mesh_chip_peripherals_load_three_tuple_from_eep:
+	arg MESH_EEP_THREE_TUPLE_LENGTH,temp
+	arg mem_mesh_three_tuple_ProductID,rega
+	arg MESH_EEP_THREE_TUPLE_OFFSET,regb
+	branch iicd_read_eep_data
+
+ali_mesh_chip_peripherals_load_network_key_from_eep:
+	arg MESH_EEP_NETWORK_KEY_LENGTH,temp
+	arg mem_mesh_Network_Key,rega
+	arg MESH_EEP_NETWORK_KEY_OFFSET,regb
+	call iicd_read_eep_data
+	fetch 1,mem_mesh_last_IV_Index_byte
+	store 1,mem_mesh_IV_Index+3
+	rtn
+
+ali_mesh_chip_peripherals_load_application_key_from_eep:
+	arg MESH_EEP_APPLICATION_KEY_LENGTH,temp
+	arg mem_mesh_application_key,rega
+	arg MESH_EEP_APPLICATION_KEY_OFFSET,regb
+	branch iicd_read_eep_data
+
+ali_mesh_chip_peripherals_load_device_key_from_eep:
+	arg MESH_EEP_DEVICE_KEY_LENGTH,temp
+	arg mem_mesh_Device_Key,rega
+	arg MESH_EEP_DEVICE_KEY_OFFSET,regb
+	branch iicd_read_eep_data
+
+ali_mesh_chip_peripherals_load_reset_count_from_eep:
+	rtn
+	arg MESH_EEP_RESET_COUNT_LENGTH,temp
+//	arg mem_mesh_switch_reset_count,rega
+	arg MESH_EEP_RESET_COUNT_OFFSET,regb
+	branch iicd_read_eep_data
+
+ali_mesh_chip_peripherals_load_seq_from_eep:
+	arg MESH_EEP_SEQ_LENGTH,temp
+	arg mem_mesh_send_message_SEQ,rega
+	arg MESH_EEP_SEQ_OFFSET,regb
+	branch iicd_read_eep_data
+
+ali_mesh_chip_peripherals_load_subscription_from_eep:
+	fetch 2,mem_mesh_core_feature
+	rtnbit1 MESH_FEATURE_DISABLE_SUBSCRIPTION
+	arg MESH_EEP_SUBSCRIPTION_TOTAL_LENGTH,temp
+	arg mem_mesh_subscription_eep_temp,rega
+	arg MESH_EEP_SUBSCRIPTION_OFFSET,regb
+	call iicd_read_eep_data
+	call mesh_get_element_info_config
+	arg mem_mesh_subscription_eep_temp,contr
+	add rega,ELEMENT_DEVICE_SUBSCRIPTION_LABEL,rega
+ali_mesh_chip_peripherals_load_subscription_from_eep_loop:
+	copy rega,contw
+	call memcpy16
+	copy regb,pdata
+	iadd rega,rega
+	loop ali_mesh_chip_peripherals_load_subscription_from_eep_loop
+	rtn
+
+mesh_receive_config_appkey_add_cb:
+	call ali_mesh_chip_peripherals_save_network_key_from_eep
+	call ali_mesh_chip_peripherals_save_application_key_from_eep
+	branch ali_mesh_chip_peripherals_save_device_key_from_eep
+
+ali_mesh_chip_peripherals_save_network_key_from_eep:
+	arg MESH_EEP_NETWORK_KEY_LENGTH,temp
+	arg mem_mesh_Network_Key,rega
+	arg MESH_EEP_NETWORK_KEY_OFFSET,regb
+	branch iicd_write_eep_data
+
+ali_mesh_chip_peripherals_save_application_key_from_eep:
+	arg MESH_EEP_APPLICATION_KEY_LENGTH,temp
+	arg mem_mesh_application_key,rega
+	arg MESH_EEP_APPLICATION_KEY_OFFSET,regb
+	branch iicd_write_eep_data
+
+ali_mesh_chip_peripherals_save_device_key_from_eep:
+	arg MESH_EEP_DEVICE_KEY_LENGTH,temp
+	arg mem_mesh_Device_Key,rega
+	arg MESH_EEP_DEVICE_KEY_OFFSET,regb
+	branch iicd_write_eep_data
+
+mesh_store_new_seq_data:
+ali_mesh_chip_peripherals_save_seq_from_eep:
+	arg MESH_EEP_SEQ_LENGTH,temp
+	arg mem_mesh_send_message_SEQ,rega
+	arg MESH_EEP_SEQ_OFFSET,regb
+	branch iicd_write_eep_data
+
+mesh_store_new_subscriptuion_list_data:
+	call ali_mesh_chip_peripherals_save_subscriptuion_list_from_eep
+	arg MESH_EEP_SUBSCRIPTION_TOTAL_LENGTH,temp
+	arg mem_mesh_subscription_eep_temp,rega
+	arg MESH_EEP_SUBSCRIPTION_OFFSET,regb
+	branch iicd_write_eep_data
+
+ali_mesh_chip_peripherals_save_subscriptuion_list_from_eep:
+	call mesh_get_element_info_config
+	arg mem_mesh_subscription_eep_temp,contw
+	add rega,ELEMENT_DEVICE_SUBSCRIPTION_LABEL,rega
+ali_mesh_chip_peripherals_save_subscriptuion_list_from_eep_loop:
+	copy rega,contr
+	call memcpy16
+	copy regb,pdata
+	iadd rega,rega
+	loop ali_mesh_chip_peripherals_save_subscriptuion_list_from_eep_loop
+	rtn
+
+//input:rega is tx data ptr
+//loopcnt is tx data length
+//regb is logging type
+logging_tx_debug:
+	arg LOGGING_DEBUG,temp
+	branch logging_tx_common
+
+
+//input:rega is tx data ptr
+//loopcnt is tx data length
+//regb is logging type
+logging_tx_info:
+	arg LOGGING_INFO,temp
+	branch logging_tx_common
+
+
+//input:rega is tx data ptr
+//loopcnt is tx data length
+//regb is logging type
+logging_tx_warning:
+	arg LOGGING_WARNING,temp
+	branch logging_tx_common
+
+
+//input:rega is tx data ptr
+//loopcnt is tx data length
+//regb is logging type
+logging_tx_error:
+	arg LOGGING_ERROR,temp
+	branch logging_tx_common
+
+
+//input:rega is tx data ptr
+//loopcnt is tx data length
+//regb is logging type
+logging_tx_critical:
+	arg LOGGING_CRITICAL,temp
+	branch logging_tx_common
+
+
+//input:rega is tx data ptr
+//loopcnt is tx data length
+//regb is logging type
+//temp is logging level
+logging_tx_common:
+	bpatchx patch3e_2,mem_patch3e
+	call push_stack
+	call uartb_prepare_tx_register_push
+	setarg LUA_LOG_PACKET_HEADER
+	istore 1,contwu
+	setarg LUA_LOG_PAKCET_TYPE
+	istore 1,contwu
+	add loopcnt,4,pdata
+	istore 1,contwu
+	istorer temp,2,contwu
+	istorer regb,2,contwu
+	copy rega,contr
+	call uart_copy_tx_bytes_fast
+	setarg LUA_LOG_PACKET_TRAIL
+	istore 1,contwu
+	call uartb_send_register_pop
+	branch pop_stack
+
+/*
+	function name:uart init by mem
+	input:
+		mem_module_uart_rx_buffer、mem_module_uart_rx_buffer_end
+		mem_module_uart_tx_buffer、mem_module_uart_tx_buffer_end
+		mem_module_uarta_baud_rate
+		bit0 of mem_module_flag
+*/
+mesh_uart_init:
+	call mesh_uart_init_buffer
+	arg 921600,temp
+	call uartb_calc_baud_rate_config
+	call uart_clock_select_main_freq_crystal
+	arg FUN_UART_CONTROL_ENABLE|FUN_UART_CONTROL_SETTING_RATE_BAUD,temp
+	storet 1,core_uartb_ctrl
+	rtn
+
+mesh_uart_init_buffer:
+	setarg mem_mesh_uart_log_rx_buff
+	store 2,mem_pdatatemp
+	setarg mem_mesh_uart_log_rx_buff_end
+	istore 2,contw
+	setarg mem_mesh_uart_log_tx_buff
+	istore 2,contw
+	setarg mem_mesh_uart_log_tx_buff_end
+	istore 2,contw
+	fetch 8,mem_pdatatemp
+	branch uartb_init_dma_mem
+
+
+
Index: program/mesh_protocol_stack/mesh_control_ble_advertising.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_control_ble_advertising.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_control_ble_advertising.prog	(working copy)
@@ -0,0 +1,228 @@
+
+//
+//mesh控制ble advertising广播逻辑的主流程
+ali_mesh_control_ble_adv_process:
+	call ali_mesh_control_ble_adv_tmall_packet
+	branch ali_mesh_control_ble_adv_app_packet
+
+//mesh 控制ble advertising 广播timer流程
+ali_mesh_control_ble_adv_timer_process:
+	call ali_mesh_advertising_unprovisioned_timer_interval_timer
+	branch ali_mesh_advertising_unprovisioned_timer
+
+//mesh打开ble advertising
+ali_mesh_control_ble_advertising_on_advertising:
+	jam DEVICE_BEACON_ON,mem_mesh_advertising_unprovisioned_device_beacon_switch
+	rtn
+
+//mesh关闭ble advertising
+ali_mesh_control_ble_advertising_off_advertising:
+	jam DEVICE_BEACON_OFF,mem_mesh_advertising_unprovisioned_device_beacon_switch
+	rtn
+
+
+//下面为static function
+
+/*
+	mesh app控制包回复
+*/
+ali_mesh_control_ble_adv_app_packet:
+	arg ali_mesh_control_ble_adv_app_packet_paired,regb
+	arg MESH_ADV_APP_MESSAGE_INTERVAL,rega
+	arg mesh_ble_adv_app,queue
+	branch ali_mesh_chip_timer_check_with_random_timer
+
+ali_mesh_control_ble_adv_app_packet_paired:
+	fetch 1,mem_mesh_provisioned_flag
+	rtnne PAIRED_STATUS					//非配网状态，不需要发送
+	arg ali_mesh_control_ble_adv_app_packet_paired_deal,regc
+	branch ali_mesh_check_all_element_info
+
+
+/*
+	mesh控制发送unprovisioned device beacon advertising
+	配网阶段包已经配网后tmall回复包
+*/
+ali_mesh_control_ble_adv_tmall_packet:
+	arg ali_mesh_control_ble_adv_tmall_packet_send_package,regb
+	arg MESH_ADV_TMALL_MESSAGE_INTERVAL,rega
+	arg mesh_ble_adv_tmall,queue
+	branch ali_mesh_chip_timer_check_with_random_timer
+
+//app 回复包的格式
+ali_mesh_control_ble_adv_app_packet_paired_deal:
+	add rega,ELEMENT_DEVICE_TRAN_PACKAGE_TYPE,contr
+	ifetch 1,contr
+	rtnbit0 BIT_UPPER_TRAN_APP_MESSAGE
+	call ali_mesh_advertising_bearer_layer_init_queue_param
+	call queue_get_new_ele
+	nrtn user
+	fetch 1,mem_mesh_queue_ele_len
+	pincrease -2	//uint8_t AD length & uint8_t AD type:GAP_ADTYPE_MESH_MESSAGE
+	store 1,mem_mesh_queue_ele_len	
+	//不会小于一包数据
+	fetch 1,mem_mesh_queue_ele_duration
+	//生命周期不减少
+	setflip BIT_OF_APP_PACKAGE_NUM,pdata
+	istore 1,regb
+	branch ali_mesh_advertising_bearer_layer_send_packet_by_app_bearer
+
+
+//控制不同状态发包情况
+ali_mesh_control_ble_adv_tmall_packet_send_package:
+	fetch 1,mem_mesh_provisioned_flag
+	beq PAIRED_STATUS,ali_mesh_control_ble_advertising_send_paired_packet
+	beq PAIRING_STATUS,ali_mesh_control_ble_advertising_send_pairing_packet
+	branch ali_mesh_control_ble_advertising_send_device_beacon_packet
+
+
+ali_mesh_control_ble_advertising_send_paired_packet:
+	arg ali_mesh_control_ble_advertising_send_paired_packet_deal,regc
+	branch ali_mesh_check_all_element_info
+
+ali_mesh_control_ble_advertising_send_paired_packet_deal:
+	call ali_mesh_advertising_bearer_layer_init_queue_param
+	call queue_get_new_ele
+	nrtn user
+	fetch 1,mem_mesh_queue_ele_duration
+	pincrease -1
+	istore 1,regb
+	bbit1 BIT_OF_ADV_IN_OFF,ali_mesh_control_ble_advertising_send_paired_packet_adv_in_off
+	and pdata,0x3f,pdata	//不判断最高位
+	call ali_mesh_control_ble_advertising_send_paired_packet_end_duration,blank	//周期到丢弃
+	fetchr rega,2,mem_mesh_rega_temp
+	add rega,ELEMENT_DEVICE_TRAN_PACKAGE_TYPE,contr
+	ifetch 1,contr
+	rtnbit0 BIT_UPPER_TRAN_TMALL_MESSAGE
+	arg mem_mesh_adv_data_len,contw
+	arg mem_mesh_queue_ele_len,contr
+	call memcpy32
+	branch mesh_le_send_adv
+
+
+ali_mesh_control_ble_advertising_send_paired_packet_adv_in_off:
+	and pdata,0x3f,pdata	//不判断最高位
+	nrtn blank
+	fetchr rega,2,mem_mesh_rega_temp
+	add rega,ELEMENT_DEVICE_UPPER_ADV_FLAG,contw
+	setarg NULL_PACKET_ADVERTISING
+	istore 1,contw
+	branch queue_init
+	
+
+ali_mesh_control_ble_advertising_send_paired_packet_end_duration:
+	arg mem_mesh_queue_ele_duration,rega
+	call queue_pop
+	call queue_empty
+	nrtn blank
+	//传入不广播数据
+	jam ADV_PAIRING_MESH_MESSAGE_INTERVAL,mem_mesh_queue_ele_duration
+	branch queue_push
+
+
+ali_mesh_control_ble_advertising_send_device_beacon_packet:
+	call ali_mesh_config_device_uuid_by_three_tuple
+	call ali_mesh_send_Unprovisioned_Beacons_tmall
+	call ali_mesh_advertising_send_Unprovisioned_Beacons_Gatt
+	call ali_mesh_control_ble_advertising_device_beacon_check_duration
+	nrtn zero			//in advertising beacon duration
+	fetch 1,mem_mesh_provisioned_flag
+	beq SILENCE_BEACON_STATUS,ali_mesh_end_advertising_silence_device_beacon_packet
+	beq UNPROVISIONED_BEACON_STATUS,ali_mesh_end_advertising_unprovisioned_device_beacon_packet
+	rtn
+
+//广播一次生存周期减1
+//output:zero is end of duration
+ali_mesh_control_ble_advertising_device_beacon_check_duration:
+	fetch 1,mem_mesh_advertising_unprovisioned_device_beacon_duration
+	add pdata,-1,pdata
+	store 1,mem_mesh_advertising_unprovisioned_device_beacon_duration
+	rtn
+
+//静默广播生存周期完成关闭广播
+ali_mesh_end_advertising_silence_device_beacon_packet:
+	jam ADV_SILENCE_DEVICE_BEACON_INTERVAL,mem_mesh_advertising_unprovisioned_device_beacon_interval
+	branch ali_mesh_control_ble_advertising_off_advertising
+	
+//未配网广播生存周期完成关闭广播
+ali_mesh_end_advertising_unprovisioned_device_beacon_packet:
+	jam ADV_UNPROVISIONED_DEVICE_BEACON_DURATION,mem_mesh_advertising_unprovisioned_device_beacon_interval
+	branch ali_mesh_control_ble_advertising_off_advertising
+
+
+ali_mesh_control_ble_advertising_send_pairing_packet:
+	call ali_mesh_advertising_timer
+	branch mesh_le_send_adv
+
+
+/*
+	注册定时器功能
+*/
+ali_mesh_chip_timer_check_with_random_timer:
+	random pdata
+	and pdata,0x07,pdata
+	iadd rega,rega
+//input:queue is timer id
+//rega is timer count
+//regb is cb ptr
+ali_mesh_chip_timer_check:
+	fetch 1,mem_mesh_advertising_unprovisioned_device_beacon_switch
+	rtnne DEVICE_BEACON_ON
+	call timer_check
+	nrtn blank
+	copy rega,pdata
+	call timer_init
+	copy regb,pdata
+	branch callback_func
+
+
+//静默广播定时器10min后进入静默广播状态
+ali_mesh_advertising_unprovisioned_timer:
+	arg mem_mesh_advertising_unprovisioned_device_beacon_timer,regc
+	arg ali_mesh_advertising_unprovisioned_timeout, regb
+	branch timer_single_step_2B
+
+//定时器超时如果当前处于未配网广播状态，进入静默广播
+ali_mesh_advertising_unprovisioned_timeout:
+	fetch 1,mem_mesh_provisioned_flag
+	rtnne UNPROVISIONED_BEACON_STATUS
+	fetch 1,mem_mesh_UUID_FeatureFlag
+	set1 BIT_SILENCE_ADV_FLAG,pdata
+	store 1,mem_mesh_UUID_FeatureFlag
+	jam SILENCE_BEACON_STATUS,mem_mesh_provisioned_flag
+	branch ali_mesh_send_silence_device_beacon_init_advertising
+
+
+//控制广播发送间隙的timer
+//不同状态广播间隔不一样
+ali_mesh_advertising_unprovisioned_timer_interval_timer:
+	arg mem_mesh_advertising_unprovisioned_device_beacon_interval,regc
+	arg ali_mesh_advertising_unprovisioned_timer_interval_timeout,regb
+	branch timer_single_step
+
+//控制广播发送超时
+//处于未配网广播或者静默广播状态，进入下一次广播
+//处于配网状态，清除配网状态
+ali_mesh_advertising_unprovisioned_timer_interval_timeout:
+	fetch 1,mem_mesh_provisioned_flag
+	beq SILENCE_BEACON_STATUS,ali_mesh_send_silence_device_beacon_init_advertising
+	beq UNPROVISIONED_BEACON_STATUS,ali_mesh_send_unprovisioned_device_beacon_init_advertising
+//	beq PAIRED_STATUS,ali_mesh_send_paired_packet_init_advertising
+	rtn
+
+//ali_mesh_send_paired_packet_init_advertising:
+//	jam NULL_PACKET_ADVERTISING,mem_mesh_upper_tran_layer_packet_advertising
+//	rtn
+
+//进入下一次未配网广播广播周期
+ali_mesh_send_unprovisioned_device_beacon_init_advertising:
+	jam ADV_UNPROVISIONED_DEVICE_BEACON_DURATION,mem_mesh_advertising_unprovisioned_device_beacon_duration
+	branch ali_mesh_control_ble_advertising_on_advertising
+
+//进入下一次静默广播广播周期
+ali_mesh_send_silence_device_beacon_init_advertising:
+	jam ADV_SILENCE_DEVICE_BEACON_DURATION,mem_mesh_advertising_unprovisioned_device_beacon_duration
+	branch ali_mesh_control_ble_advertising_on_advertising
+
+
+
Index: program/mesh_protocol_stack/mesh_encrypt_function.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_encrypt_function.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_encrypt_function.prog	(working copy)
@@ -0,0 +1,607 @@
+/*
+	mesh加密算法层，包含配网阶段的算法和配网后的算法
+*/
+
+
+/*
+	provision random输入，计算出provision confirmation等参数
+*/
+
+ali_mesh_encrypt_calc_random_data:
+	call ali_mesh_encrypt_calc_random_data_calc_ConfirmationKey
+	call ali_mesh_encrypt_calc_random_data_calc_AuthValueProv
+	call ali_mesh_encrypt_calc_random_data_calc_AuthValueDevice
+	call ali_mesh_encrypt_calc_random_data_calc_ConfirmationCloud
+	call ali_mesh_encrypt_calc_random_data_calc_ConfirmationDevice
+	branch ali_mesh_encrypt_calc_random_data_calc_DeviceKey
+
+//calc confirmation key
+//ConfirmationKey=SHA256(Random A||RandomB||"ConfirmationKey")[0:15]
+ali_mesh_encrypt_calc_random_data_calc_ConfirmationKey:
+	call ali_mesh_encrypt_load_randomAB_to_sha256
+	arg mem_mesh_sha256_ConfirmationKey_ascii,contr
+	arg 0xf,loopcnt
+	call ali_mesh_encrypt_base_function_sha256_load_data_without_hex2ascii
+	call ali_mesh_encrypt_base_function_sha256_calc
+	arg memresult,contr
+	arg mem_mesh_Confirmationkey,contw
+	branch memcpy16
+
+
+//calc Auth value prov
+//AuthValueProv = SHA256(PID,MAC,Secret,random B||random A)[0:15]
+ali_mesh_encrypt_calc_random_data_calc_AuthValueProv:
+	call ali_mesh_encrypt_load_three_tuple_to_sha256
+ifdef V1_2
+	call ali_mesh_encrypt_load_randomBA_to_sha256
+endif
+	call ali_mesh_encrypt_base_function_sha256_calc
+	arg memresult,contr
+	arg mem_mesh_AuthValueProv,contw
+	branch memcpy16
+
+//calc Auth Value Device
+//AuthValueDevice= SHA256(PID,MAC,Secret,random B||random A)[0:15]
+ali_mesh_encrypt_calc_random_data_calc_AuthValueDevice:
+	call ali_mesh_encrypt_load_three_tuple_to_sha256
+ifdef V1_2
+	call ali_mesh_encrypt_load_randomAB_to_sha256
+endif
+	call ali_mesh_encrypt_base_function_sha256_calc
+	arg memresult,contr
+	arg mem_mesh_AuthValueDevice,contw
+	branch memcpy16
+
+// calc Confirmation Cloud
+//Confirmation Cloud=AES-CMAC(Random B || Random A || AuthValueProv)
+//k=ConfirmationKey
+ali_mesh_encrypt_calc_random_data_calc_ConfirmationCloud:
+	fetch 8,mem_mesh_provisioning_random_A
+	store 8,mem_mesh_ConfirmationCloud_RandomA
+	fetch 8,mem_mesh_provisioning_random_B
+	store 8,mem_mesh_ConfirmationCloud_RandomB
+	
+	arg mem_mesh_calc_ConfirmationCloud_data,contr
+	arg mem_mesh_Confirmationkey,rega
+	arg mem_mesh_ConfirmationCloud,alarm
+	branch ali_mesh_encrypt_base_function_AES_CMAC_32Byte
+
+
+// calc confirmation Device
+//Confirmation Device=AES-CMAC(Random A || Random B || AuthValueDevice)
+//k=ConfirmationKey
+ali_mesh_encrypt_calc_random_data_calc_ConfirmationDevice:
+	arg mem_mesh_calc_ConfirmationDevice_data,contr
+	arg mem_mesh_Confirmationkey,rega
+	arg mem_mesh_ConfirmationDevice,alarm
+	branch ali_mesh_encrypt_base_function_AES_CMAC_32Byte
+
+
+//calc Device Key
+//DeviceKey = SHA256(ConfirmationCloud||"DeviceKey")[0:15]
+ali_mesh_encrypt_calc_random_data_calc_DeviceKey:
+	arg mem_mesh_ConfirmationCloud,contr
+	arg 0x10,loopcnt
+	call ali_mesh_encrypt_base_function_sha256_load_data_with_hex2ascii
+	arg mem_mesh_sha256_DeviceKey_ascii,contr
+	arg 9,loopcnt
+	call ali_mesh_encrypt_base_function_sha256_load_data_without_hex2ascii
+	call ali_mesh_encrypt_base_function_sha256_calc
+	arg memresult,contr
+	arg mem_mesh_Device_Key,contw
+	branch memcpy16
+
+
+ali_mesh_encrypt_load_randomBA_to_sha256:
+	call ali_mesh_encrypt_load_randomB_to_sha256
+ali_mesh_encrypt_load_randomA_to_sha256:
+	arg mem_mesh_provisioning_random_A,contr
+	branch ali_mesh_encrypt_base_function_sha256_load_data_64bit
+
+ali_mesh_encrypt_load_randomAB_to_sha256:
+	call ali_mesh_encrypt_load_randomA_to_sha256
+ali_mesh_encrypt_load_randomB_to_sha256:
+	arg mem_mesh_provisioning_random_B,contr
+	branch ali_mesh_encrypt_base_function_sha256_load_data_64bit
+
+
+ali_mesh_encrypt_load_three_tuple_to_sha256:
+	arg mem_mesh_three_tuple_ProductID,contr
+	arg 4,loopcnt
+	call ali_mesh_encrypt_base_function_sha256_load_data_with_hex2ascii_add_comma
+	arg mem_mesh_three_tuple_MAC,contr
+	arg 6,loopcnt
+	call ali_mesh_encrypt_base_function_sha256_load_data_with_hex2ascii_add_comma
+	arg mem_mesh_three_tuple_secret,contr
+	arg 0x10,loopcnt
+ifdef V1_2
+	branch ali_mesh_encrypt_base_function_sha256_load_data_with_hex2ascii_add_comma
+else
+	branch ali_mesh_encrypt_base_function_sha256_load_data_with_hex2ascii
+endif
+
+
+//calc provisioning data
+//Encrupted provisioning data = prov_data XOR SessionKey
+ali_mesh_encrypt_calc_provisioning_data:
+	call ali_mesh_encrypt_calc_provisioning_data_calc_SessionKey
+//	branch ali_mesh_encrypt_calc_provisioning_data_xor_prov_data
+ali_mesh_encrypt_calc_provisioning_data_xor_prov_data:
+	arg mem_mesh_Encrypt_Provisioning_Data,rega
+	arg memresult,regb
+	arg 0xb,loopcnt
+ali_mesh_encrypt_calc_provisioning_data_xor_prov_data_loop:
+	ifetch 2,rega
+	ifetcht 2,regb
+	ixor temp,pdata
+	istore 2,rega
+	increase 2,rega
+	increase 2,regb
+	loop ali_mesh_encrypt_calc_provisioning_data_xor_prov_data_loop
+	rtn
+
+
+//calc SessionKey
+//SessionKey = SHA256(ConfirmationCloud||"SessionKey")[0:15]
+//output:sessionKey in memresult
+ali_mesh_encrypt_calc_provisioning_data_calc_SessionKey:
+	arg mem_mesh_ConfirmationCloud,contr
+	arg 0x10,loopcnt
+	call ali_mesh_encrypt_base_function_sha256_load_data_with_hex2ascii
+	arg mem_mesh_sha256_SessionKey_ascii,contr
+	arg 0xa,loopcnt
+	call ali_mesh_encrypt_base_function_sha256_load_data_without_hex2ascii
+	branch ali_mesh_encrypt_base_function_sha256_calc
+
+
+
+ali_mesh_encrypt_calc_network_key_by_k2:
+	arg mem_mesh_Network_Key,contr
+	arg mem_k2_N,contw
+	call memcpy16
+
+/************k2 function*************/
+//input:mem_k2_N N data
+ali_mesh_encrypt_base_function_k2:
+/*******************generate T*************************/
+	arg mem_k2_N,contr
+	arg mem_k2_SALT,rega
+	arg mem_k2_T,alarm
+	call ali_mesh_encrypt_base_function_AES_CMAC_16Byte
+/*******************generate T1************************/
+	arg mem_k2_T1,alarm
+	arg 0x01,regb
+	setarg 0
+	call ali_mesh_encrypt_base_function_k2_AES_CMAC_T
+	fetch 1,mem_k2_T1+15
+	and pdata,0x7f,pdata
+	store 1,mem_k2_NID
+/*******************generate T2************************/
+	arg mem_k2_T2,alarm
+	arg 0x02,regb
+	setarg 0x10
+	arg mem_k2_T1,rega
+	call ali_mesh_encrypt_base_function_k2_AES_CMAC_T
+/*******************generate T3************************/
+	arg mem_k2_T3,alarm
+	arg 0x03,regb
+	setarg 0x10
+	arg mem_k2_T2,rega
+	branch ali_mesh_encrypt_base_function_k2_AES_CMAC_T
+
+ali_mesh_encrypt_base_function_k4:
+/*******************generate T*************************/
+	arg mem_mesh_application_key,contr
+	arg mem_k4_SALT,rega
+	arg mem_k4_T,alarm
+	call ali_mesh_encrypt_base_function_AES_CMAC_16Byte
+	arg mem_k4_id6_01,contr
+	arg mem_k4_T,rega
+	arg mem_k4_k4N,alarm
+	setarg 4
+	call ali_mesh_encrypt_base_function_AES_CMAC
+	fetch 1,mem_k4_k4N+15
+	and pdata,0x3f,pdata
+	set1 TRANSPORT_HEAD_BIT_AKF,pdata
+	store 1,mem_mesh_transport_AID
+	rtn
+
+
+//********* network PDU header obfuscation *********//
+ali_mesh_encrypt_obfuscation_deceypt_send_message:
+	arg mem_mesh_send_upper_layer_CTL_and_TTL,rega
+	fetch 7,mem_mesh_send_upper_layer_DST	
+	branch ali_mesh_encrypt_obfuscation_deceypt
+ali_mesh_encrypt_obfuscation_deceypt_recevie_message:
+	arg mem_mesh_message_TTL,rega
+	fetch 7,mem_mesh_message_DST
+ali_mesh_encrypt_obfuscation_deceypt:
+	store 7,mem_mesh_Privacy_Plaintext_Privacy_Random
+	setarg 0
+	store 5,mem_mesh_Privacy_Plaintext_Zero_String
+	call ali_mesh_encrypt_generate_PECB
+	fetch 6,mem_mesh_PECB
+	ifetcht 6,rega
+	ixor temp,pdata
+	istore 6,rega
+	rtn
+
+ali_mesh_encrypt_generate_PECB:
+ali_mesh_encrypt_generate_privacy_random:
+	fetch 4,mem_mesh_IV_Index
+	store 4,mem_mesh_Privacy_Plaintext_IV_Index
+// generate PECB with AES-128/ function e
+ali_mesh_encrypt_base_function_generate_PECB:
+	arg mem_k2_PrivacyKey,contr
+	call load_key
+	arg mem_mesh_Privacy_Plaintext,contr
+	call load_data128
+	call do_aes_ocb
+	arg mem_mesh_PECB,contw
+	branch store_aes_result
+
+
+/************sha256 function*************/
+//input  : (big endian)
+// data addr : contr
+// point : call clear_sha256_chunk
+ali_mesh_encrypt_base_function_sha256_load_data_64bit:
+	arg 8,loopcnt
+//input  : (big endian)
+// data addr : contr
+// data len : loopcnt
+// point : call clear_sha256_chunk
+ali_mesh_encrypt_base_function_sha256_load_data_with_hex2ascii:
+	call ali_mesh_encrypt_base_function_sha256_check_first_load_data
+	call ali_mesh_encrypt_base_function_hex2ascii
+	branch ali_mesh_encrypt_base_function_sha256_store_dataptr
+ali_mesh_encrypt_base_function_sha256_load_data_without_hex2ascii:
+	call ali_mesh_encrypt_base_function_sha256_check_first_load_data
+	call memcpy
+	branch ali_mesh_encrypt_base_function_sha256_store_dataptr
+ali_mesh_encrypt_base_function_sha256_load_data_with_hex2ascii_add_comma:
+	call ali_mesh_encrypt_base_function_sha256_check_first_load_data
+	call ali_mesh_encrypt_base_function_hex2ascii
+	setarg COMMA
+	istore 1,contw
+ali_mesh_encrypt_base_function_sha256_store_dataptr:
+	copy contw,pdata
+	store 2,mem_mesh_sha256_data_end_addr
+	rtn
+ali_mesh_encrypt_base_function_sha256_check_first_load_data:
+	copy contr,temp
+	copy loopcnt,rega
+	fetch 2,mem_mesh_sha256_data_end_addr
+	copy pdata,contw
+	fetch 1,mem_mesh_sha256_load_first_data_flag
+	call ali_mesh_encrypt_base_function_sha256_first_load_data,blank
+	copy temp,contr
+	copy rega,loopcnt
+	rtn
+ali_mesh_encrypt_base_function_sha256_first_load_data:
+	jam 1,mem_mesh_sha256_load_first_data_flag
+	call ali_mesh_encrypt_base_function_sha256_clear_data_chunk				//初始化sha256
+	arg mem_mesh_sha256_chunk_start,contw
+	rtn
+
+ali_mesh_encrypt_base_function_sha256_clear_data_chunk:
+	arg 0x20,loopcnt
+	arg mem_mesh_sha256_chunk_start,contw
+	branch memset0
+
+ // output :
+ // sha256 result : memresult(big endian)
+ali_mesh_encrypt_base_function_sha256_calc:
+ 	call ali_mesh_encrypt_base_function_sha256_load_data_end
+ 	arg MESH_ENCRYPT_SHA256_FUNCTION_INPUT,regb
+	arg mem_mesh_sha256_chunk_start,rega
+	fetchr loopcnt,8,mem_mesh_sha256_data_len_byte
+	call logging_tx_debug
+	call ali_mesh_encrypt_base_function_sha256_input_data_init_inverse
+
+	setarg mem_mesh_sha256_chunk_start
+	store 2,mem_mesh_sha256_chunk_ptr
+	call sha_init
+ali_mesh_encrypt_base_function_sha256_calc_loop:
+	fetch 2,mem_mesh_sha256_chunk_ptr
+	copy pdata,contr
+	arg memdat,contw
+	call memcpy64
+	call sha
+	fetch 2,mem_mesh_sha256_chunk_ptr
+	pincrease 64
+	store 2,mem_mesh_sha256_chunk_ptr
+	fetch 1,mem_mesh_sha256_chunk_count
+	pincrease -1
+	store 1,mem_mesh_sha256_chunk_count
+	nbranch ali_mesh_encrypt_base_function_sha256_calc_loop,blank
+	call sha_result
+	arg memresult,rega
+	arg 0x20,loopcnt
+	call inverse_data
+ 	arg MESH_ENCRYPT_SHA256_FUNCTION_RESULT,regb
+	arg memresult,rega
+	arg 0x20,loopcnt
+	branch logging_tx_debug
+
+
+ali_mesh_encrypt_base_function_sha256_load_data_end:
+	jam 0,mem_mesh_sha256_load_first_data_flag
+	fetch 2,mem_mesh_sha256_data_end_addr
+	copy pdata,contw
+	arg 0x80,temp	//第一个bit补1，后面补0
+	istoret 1,contw
+	arg mem_mesh_sha256_chunk_start,temp
+	isub temp,pdata
+	store 8,mem_mesh_sha256_data_len_byte
+	//计算bit数
+	lshift3 pdata,temp
+	storet 8,mem_mesh_sha256_data_len_bit
+	rshift4 pdata,regc
+	rshift2 regc,regc
+	and pdata,0x3f,pdata
+	sub pdata,55,null
+//55-(len mod 63)<0,内存填充448以后的，需要填充到第二块
+	ncall ali_mesh_encrypt_base_function_sha256_add_chunk,positive
+	add regc,1,pdata
+	store 1,mem_mesh_sha256_chunk_count
+	mul32 pdata,64,rega		//计算块的数量地址
+	lshift4 pdata,regc			//计算4byte包的数量
+	increase -1,regc			//最好一个包长度不交换
+	setarg mem_mesh_sha256_chunk_start + DECREASED_FOUR
+	iadd rega,rega
+	fetch 4,mem_mesh_sha256_data_len_bit
+	istore 4,rega
+	rtn
+
+
+//增加块数量
+ali_mesh_encrypt_base_function_sha256_add_chunk:
+	increase 1,regc
+	rtn
+	
+ali_mesh_encrypt_base_function_sha256_input_data_init_inverse:
+	arg mem_mesh_sha256_chunk_start,rega
+
+//每4个字节，需要高低位交换一下
+//input :
+// data addr : rega
+ali_mesh_encrypt_base_function_sha256_data_inverse_4Byte:
+	arg 4,loopcnt
+	call inverse_data
+	increase 2,rega	//下一块
+	add regc,-1,regc
+	nbranch ali_mesh_encrypt_base_function_sha256_data_inverse_4Byte,zero
+	rtn
+
+
+// input : 
+// data ptr : contr
+// data save ptr : contw 
+// data len : loopcnt
+ali_mesh_encrypt_base_function_hex2ascii:
+	ifetch 1,contr
+	rshift4 pdata,temp
+	call ali_mesh_encrypt_base_function_dialog2uchar
+	istoret 1,contw
+	and pdata,0x0f,temp
+	call ali_mesh_encrypt_base_function_dialog2uchar
+	istoret 1,contw
+	loop ali_mesh_encrypt_base_function_hex2ascii
+	rtn
+ali_mesh_encrypt_base_function_dialog2uchar:
+	sub temp,9,null
+	branch ali_mesh_encrypt_base_function_dialog2uchar_num,positive
+	add temp,87,temp
+	rtn
+ali_mesh_encrypt_base_function_dialog2uchar_num:	
+	add temp,48,temp
+	rtn
+
+
+ali_mesh_encrypt_base_function_AES_CMAC_32Byte:
+	setarg 0x20 
+	branch ali_mesh_encrypt_base_function_AES_CMAC
+
+ali_mesh_encrypt_base_function_AES_CMAC_16Byte:
+	setarg 0x10
+	branch ali_mesh_encrypt_base_function_AES_CMAC
+
+
+//pdata:data length
+//regb:last data
+ali_mesh_encrypt_base_function_k2_AES_CMAC_T:
+	fetcht 1,mem_k2_P_len
+	increase 1,temp
+	iadd temp,temp
+	storet 1,mem_AES_CMAC_data_length
+	copy rega,contr
+	copy pdata,loopcnt
+	call memcpy_fast
+	fetcht 1,mem_k2_P_len
+	copy temp,loopcnt
+	call memcpy
+	copy regb,pdata
+	istore 1,contw
+	arg mem_k2_T,rega
+	branch ali_mesh_encrypt_base_function_AES_CMAC + 3
+
+
+//input:
+//pdata:data length
+//contr:data prt
+//rega:key ptr
+//output:
+//alarm:output prt
+ali_mesh_encrypt_base_function_AES_CMAC:
+	store 1,mem_AES_CMAC_data_length
+	copy pdata,loopcnt
+	call memcpy_fast
+	copy rega,contr
+	arg mem_AES_CMAC_k,contw
+	call memcpy16
+ 	arg MESH_ENCRYPT_AES_CMAC_FUNCTION_INPUT_M,regb
+	arg memdat,rega
+	fetchr loopcnt,1,mem_AES_CMAC_data_length
+	call logging_tx_debug
+ 	arg MESH_ENCRYPT_AES_CMAC_FUNCTION_INPUT_K,regb
+	arg mem_AES_CMAC_k,rega
+	arg 16,loopcnt
+	call logging_tx_debug
+	call function_AES_CMAC
+	copy alarm,contw
+	call store_aes_result
+ 	arg MESH_ENCRYPT_AES_CMAC_FUNCTION_RESULT,regb
+	copy alarm,rega
+	arg 16,loopcnt
+	branch logging_tx_debug
+
+
+//////**AES-CCM**////////
+ali_B0_block_generate:
+ 	fetcht 1,mem_ccm_type
+ 	branch  ali_block_generate
+ali_A_block_generate:
+	force 0x01,temp
+ali_block_generate:
+	force regidx_data,regext_index
+	fetch 2,mem_nonce_ptr
+	copy pdata,contr
+	ifetch 3,contr
+	lshift8 pdata,pdata
+	ior temp, regext
+	increase 1,regext_index
+	ifetch 4,contr
+	copy pdata,regext
+	increase 1,regext_index
+	ifetch 4,contr
+	copy pdata,regext
+	increase 1,regext_index
+	byteswap rega,regext
+	lshift16 regext,regext
+	ifetch 2,contr
+	ior regext,regext
+	rtn
+ali_generate_mic:
+	fetch 1,mem_ccm_data_len
+	copy pdata,rega
+	call ali_B0_block_generate
+	call do_aes_ocb
+	force regidx_result,regext_index
+	deposit regext
+	copy rega,loopcnt
+	fetcht 2,mem_ccm_data_ptr
+	copy temp,contr
+	call padding_data
+	branch generate_mic_loop
+/*
+function name:ali_CCM_encrypt
+input:pdata is the encrypt data length
+temp is encrypt data ptr
+*/
+ali_CCM_encrypt_64Bit:
+	jam MIC_SIZE_64BIT,mem_ccm_type
+	branch ali_CCM_encrypt_function
+ali_CCM_encrypt:
+	jam MIC_SIZE_32BIT,mem_ccm_type
+	branch ali_CCM_encrypt_function
+ali_CCM_encrypt_function:
+	store 1,mem_ccm_data_len
+	storet 2,mem_ccm_data_ptr
+	bpatchx patch3e_3,mem_patch3e
+	call ali_generate_mic
+	force regidx_xor,regext_index
+	iforce regext
+	force regidx_result+1,regext_index
+	copy regext,pdata
+	force regidx_xor+1,regext_index
+	iforce regext
+	force 0,rega
+	copy temp,regc
+	call ali_A_block_generate
+	call do_aes_ctr
+	call ali_fetcht_ccm_mic
+	storet 8,mem_ccm_mic
+	fetch 1,mem_ccm_data_len
+	copy pdata,regb
+	call ali_aes_crypt_data
+	fetcht 1,mem_ccm_data_len
+	fetch 2,mem_ccm_data_ptr
+	iadd temp,rega
+	fetcht 8,mem_ccm_mic
+	istoret 4,rega
+	fetch 1,mem_ccm_type
+	sub pdata,MIC_SIZE_32BIT,pdata
+	rtn blank
+	istoret 8,rega
+	rtn
+/*
+function name:ali_CCM_decrypt_function
+input:pdata is the encrypt data length
+temp is encrypt data ptr
+*/
+ali_CCM_decrypt_64Bit:
+	jam MIC_SIZE_64BIT,mem_ccm_type
+	branch ali_CCM_decrypt_function
+ali_CCM_decrypt:
+	jam MIC_SIZE_32BIT,mem_ccm_type
+	branch ali_CCM_decrypt_function
+ali_CCM_decrypt_function:
+	store 1,mem_ccm_data_len
+	storet 2,mem_ccm_data_ptr
+	copy temp,regc
+	copy pdata,regb
+	iadd regc,contr
+	bpatchx patch3e_4,mem_patch3e
+	ifetch 8,contr
+	force regidx_xor,regext_index
+	iforce regext
+	force regidx_xor+1,regext_index
+	rshift32 pdata,pdata
+	iforce regext
+	force 0,rega
+	call ali_A_block_generate
+	call do_aes_ctr
+	call ali_fetcht_ccm_mic
+	storet 8,mem_ccm_mic
+	call ali_aes_crypt_data
+	call ali_generate_mic
+	call ali_fetcht_ccm_mic
+	fetch 1,mem_ccm_type
+	beq MIC_SIZE_64BIT,ali_CCM_decrypt_function_check_mic64
+	storet 4,mem_ccm_mic+4
+	fetch 4,mem_ccm_mic
+	fetcht 4,mem_ccm_mic+4
+	isub temp,pdata
+	rtn
+
+ali_CCM_decrypt_function_check_mic64:
+	fetch 8,mem_ccm_mic
+	isub temp,pdata
+	rtn
+
+ali_fetcht_ccm_mic:
+	force regidx_result,regext_index
+	deposit regext
+	force regidx_result+1,regext_index
+	copy regext,temp
+	lshift16 temp,temp
+	lshift16 temp,temp
+	ior temp,temp
+   	rtn
+ali_aes_crypt_data: 
+	increase 1,rega
+	call ali_A_block_generate
+	copy regc,contr
+	call aes_load_xor
+	call do_aes_ctr
+	call store_enc_data
+	increase 16,regc
+	increase -16,regb
+	branch ali_aes_crypt_data,positive
+	rtn
+//////**AES-CCM**////////
+
+
+
+
Index: program/mesh_protocol_stack/mesh_fast_pairing.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_fast_pairing.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_fast_pairing.prog	(working copy)
@@ -0,0 +1,526 @@
+
+
+/*
+	阿里极速配网协议配网阶段包的解析与组包
+*/
+
+
+/*
+	function name mesh_send_Unprovisioned_Beacons
+	input:three tuple data 
+	mem_mesh_three_tuple_ProductID
+	mem_mesh_three_tuple_MAC
+	mem_mesh_three_tuple_secret
+*/
+mesh_send_Unprovisioned_Beacons:
+	jam UNPROVISIONED_BEACON_STATUS,mem_mesh_provisioned_flag
+	jam 0x00,mem_mesh_Provisioning_State_Flag
+	jam 1,mem_mesh_advertising_unprovisioned_device_beacon_switch
+	rtn
+
+//初始化UUID 三元组参数和feature Flag
+ali_mesh_config_device_uuid_by_three_tuple:
+	setarg COMPANY_IDENTIFIERS_ALIBABA
+	store 2,mem_mesh_Device_UUID
+	fetch 1,mem_mesh_Device_PID
+	istore 1,contw
+	fetch 4,mem_mesh_three_tuple_ProductID
+	call inverse_data_4Byte
+	istore 4,contw
+	fetch 6,mem_le_lap
+	istore 6,contw
+	fetch 3,mem_mesh_UUID_FeatureFlag
+	istore 3,contw
+	rtn
+
+ali_mesh_send_Unprovisioned_Beacons_tmall:
+	call ali_mesh_init_adv_data_tmall_Unprovisioned_beacons_package
+	branch mesh_le_send_adv
+
+ali_mesh_init_adv_data_tmall_Unprovisioned_beacons_package:
+//mem Beacon Tmall Length
+	jam 0x15,mem_mesh_adv_data_len
+	setarg 0x14
+	store 1,mem_mesh_adv_data
+	setarg GAP_ADTYPE_MESH_BEACON
+	istore 1,contw
+	setarg UNPROVISIONED_DEVICE_BEACON
+	istore 1,contw
+ali_mesh_advertising_send_Unprovisioned_Beacons_store_device_uuid:
+	arg mem_mesh_Device_UUID,contr
+	call memcpy16
+	fetch 2,mem_mesh_OOB_information
+	istore 2,contw
+	rtn
+
+
+ali_mesh_advertising_send_Unprovisioned_Beacons_Gatt:
+	call ali_mesh_init_adv_data_gatt_Unprovisioned_beacons_package
+	branch mesh_le_send_adv
+
+ali_mesh_init_adv_data_gatt_Unprovisioned_beacons_package:
+	jam 0x1d,mem_mesh_adv_data_len
+	call ali_mesh_advertising_add_adtype_flags
+	call ali_mesh_advertising_add_adtype_16bit_complete
+	call ali_mesh_advertising_add_adtype_service_data
+	branch ali_mesh_advertising_send_Unprovisioned_Beacons_store_device_uuid
+
+//input:temp is uuid MESH_PROVISIONING_UUID
+ali_mesh_advertising_add_adtype_service_data:
+	setarg 0x15
+	istore 1,contw
+	setarg GAP_ADTYPE_SERVICE_DATA
+	istore 1,contw
+	istoret 2,contw
+	rtn
+
+/*
+
+input:
+	temp is len
+	contr is read ptr
+*/
+
+ali_mesh_receive_adtype_manufacturer_specific:
+	add temp,-1,loopcnt
+	call ali_mesh_receive_provisioning_package_check_header
+	nrtn user
+	ifetch 1,contr	//provisioning type
+	beq PROVISIONING_RANDOM,ali_mesh_advertising_receive_Privisioning_Random
+	beq PROVISIONING_DATA,ali_mesh_advertising_receive_Privisioning_Data
+	beq PROVISIONING_IOS_DATA,ali_mesh_advertising_receive_Privisioning_ios_Data
+	rtn
+
+
+//receive provisioning random
+ali_mesh_advertising_receive_Privisioning_Random:
+	call ali_mesh_advertising_receive_Privisioning_Random_check_states
+	nrtn user
+ali_mesh_advertising_calc_encrypt_random_data:
+	call ali_mesh_encrypt_calc_random_data
+//	call mesh_reset_adv_timer
+	call ali_mesh_advertising_send_Provisioning_Confirmation
+	branch loggint_tx_info_send_confirmation_packet
+//send provisioning confirmation
+ali_mesh_advertising_send_Provisioning_Confirmation:
+	arg PROVISIONING_PACKET_CONFIRMATION_MAC+PROVISIONING_PACKET_CONFIRMATION_DEVICE,temp
+	call ali_mesh_advertising_send_packet_common
+	setarg PROVISIONING_CONFIRMATION
+	istore 1,contw
+	fetch 2,mem_mesh_three_tuple_MAC+4
+	istore 2,contw
+	arg mem_mesh_ConfirmationDevice,contr
+	branch memcpy16
+
+//output:disable user mean is cannot true package
+ali_mesh_advertising_receive_Privisioning_Random_check_states:
+	call disable_user
+	ifetcht 2,contr
+	arg mem_mesh_provisioning_random_A,contw
+	call memcpy16
+	fetch 2,mem_mesh_three_tuple_MAC+4
+	isub temp,null
+	nrtn zero									//MAC地址不对
+
+	//ios APP 配网会先发送config
+//	fetch 1,mem_mesh_provisioned_flag
+//	rtnne UNPROVISIONED_BEACON_STATUS	//不处于静默广播状态
+		
+	fetch 1,mem_mesh_Provisioning_State_Flag
+	rtnbit1 RECEIVE_PROVISIONING_RANDOM
+	set1 RECEIVE_PROVISIONING_RANDOM,pdata			// FLAG bit1:Provisioning Confirmation
+	store 1,mem_mesh_Provisioning_State_Flag
+
+	jam PAIRING_STATUS,mem_mesh_provisioned_flag		//
+
+	call loggint_tx_info_receive_random_packet
+	branch enable_user
+
+//receive provisioning data
+ali_mesh_advertising_receive_Privisioning_Data:
+	copy contr,rega
+	fetch 1,mem_mesh_provisioned_flag
+	rtneq PAIRED_STATUS	//不处于已配网状态
+	fetch 1,mem_mesh_Provisioning_State_Flag
+	rtnbit0 RECEIVE_PROVISIONING_RANDOM
+	rtnbit1 RECEIVE_PROVISIONING_DATA
+	copy rega,contr
+	arg 0x16,loopcnt
+	arg mem_mesh_Encrypt_Provisioning_Data,contw
+	call memcpy
+	//没有收到random，重复收到data
+	call ali_mesh_encrypt_calc_provisioning_data
+	
+	fetcht 2,mem_mesh_provisioning_data_Mac_addr
+	fetch 2,mem_mesh_three_tuple_MAC+4
+	isub temp,null
+	nrtn zero
+ali_mesh_resolve_Privisioning_Data_package:
+	call loggint_tx_info_receive_data_packet
+	fetch 1,mem_mesh_Provisioning_State_Flag
+	set1 RECEIVE_PROVISIONING_DATA,pdata
+	store 1,mem_mesh_Provisioning_State_Flag
+
+	call ali_mesh_encrypt_calc_network_key_by_k2
+
+	fetch 1,mem_mesh_last_IV_Index_byte
+	store 1,mem_mesh_IV_Index+3
+	call ali_mesh_advertising_send_Provisioning_Complete
+	branch loggint_tx_info_send_complete_packet
+
+
+//send provisioning complete
+ali_mesh_advertising_send_Provisioning_Complete:
+	arg PROVISIONING_PACKET_COMPLETE_MAC,temp
+	call ali_mesh_advertising_send_packet_common
+	setarg PROVISIONING_COMPLETE
+	istore 1, contw
+	fetch 6,mem_mesh_three_tuple_MAC
+	istore 6,contw
+	rtn
+
+ali_mesh_advertising_receive_Privisioning_ios_Data:
+	arg MAX_LENGTH_PRIVISIONING_CONTROL_MSG_ANDROID,regb
+	branch ali_mesh_resolve_app_control_msg_package
+
+//tmall send provisioning packet head
+//input:temp is data lenth,不包括type字节
+ali_mesh_advertising_send_packet_common:
+	bpatchx patch3e_5,mem_patch3e
+	call ali_mesh_advertising_reset_adv_timer
+	setarg 0x8fff		//about 11s
+	store 2,mem_mesh_send_packet_timeout
+	call ali_mesh_control_ble_advertising_on_advertising
+	add temp,PROVISIONING_PACKET_LENGTH_AD_TYPE_COMPANY_ID_VID_PROVISIONING_TYPE+PROVISIONING_PACKET_LENGTH_FLAGS,pdata
+	store 1,mem_mesh_adv_data_len
+	call ali_mesh_advertising_add_adtype_flags
+	add temp,PROVISIONING_PACKET_AD_TYPE_COMPANY_ID_VID_PROVISIONING_TYPE,pdata
+	istore 1,contw
+	setarg GAP_ADTYPE_MANUFACTURER_SPECIFIC
+	istore 1,contw
+	setarg COMPANY_IDENTIFIERS_ALIBABA
+	byteswap pdata,pdata
+	istore 2,contw
+	fetch 1,mem_mesh_receive_VID
+	istore 1,contw
+	rtn
+
+
+//压力测试时，成功率比较高的时间
+//mesh广播超时11s左右，一个包最多发送11s
+ali_mesh_advertising_timer:
+//未配网设备，不开启定时器
+	fetch 4,mem_mesh_adv_last_time
+	nbranch ali_mesh_advertising_check_adv_timer,blank
+	branch ali_mesh_advertising_reset_adv_timer
+
+/*
+	if(newTime - lastTime)>8fff(about 11s)
+		stop adv
+*/
+ali_mesh_advertising_check_adv_timer:
+	deposit clkn_bt
+	fetcht 4,mem_mesh_adv_last_time
+	isub temp,temp
+	fetch 2,mem_mesh_send_packet_timeout
+	isub temp,null
+	rtn positive
+ali_mesh_advertising_adv_timer_timeout:
+	call ali_mesh_control_ble_advertising_off_advertising
+	fetch 2,mem_mesh_cb_pairing_fail
+	branch callback_func
+ali_mesh_advertising_reset_adv_timer:
+	deposit  clkn_bt
+	store 4,mem_mesh_adv_last_time
+	rtn
+
+
+logging_tx_debug_receive_provisioning_packet:
+	add contr,-3,rega
+	arg MESH_RECEIVE_PROVISIONING_PACKET,regb
+	branch logging_tx_debug
+
+loggint_tx_info_receive_random_packet:
+	arg 1,loopcnt
+	arg MESH_RECEIVE_PROVISIONING_RANDOM_PACKET,regb
+	arg mem_mesh_Provisioning_State_Flag,rega
+	branch logging_tx_info
+
+loggint_tx_info_send_confirmation_packet:
+	fetchr loopcnt,1,mem_mesh_adv_data_len
+	arg MESH_SEND_PROVISIONING_CONFIRMATION_PACKET,regb
+	arg mem_mesh_adv_data,rega
+	branch logging_tx_info
+
+loggint_tx_info_receive_data_packet:
+	arg 1,loopcnt
+	arg MESH_RECEIVE_PROVISIONING_DATA_PACKET,regb
+	arg mem_mesh_Provisioning_State_Flag,rega
+	branch logging_tx_info
+
+
+loggint_tx_info_send_complete_packet:
+	fetchr loopcnt,1,mem_mesh_adv_data_len
+	arg MESH_SEND_PROVISIONING_COMPLETE_PACKET,regb
+	arg mem_mesh_adv_data,rega
+	branch logging_tx_info
+
+
+
+ali_mesh_receive_adtype_128bit_uuid_complete:
+	call ali_mesh_receive_adtype_128bit_uuid_complete_store_uuid
+	nrtn user		//check compand ID & VID
+	fetch 1,mem_mesh_receive_service_uuid_ios_data_provisioning_type
+	beq PROVISIONING_IOS_DATA,ali_mesh_ios_gatt_packet_parse_provisioning_app_control
+ali_mesh_ios_gatt_packet_pairing_type:
+	fetch 1,mem_mesh_provisioned_flag
+	rtneq PAIRED_STATUS		//pairing status
+	rtneq SILENCE_BEACON_STATUS	//silence beacon status
+	fetch 2,mem_mesh_receive_service_uuid_mac
+	fetcht 2,mem_mesh_three_tuple_MAC+4
+	isub temp,null
+	nrtn zero						//check Mac legel
+	arg mem_mesh_receive_service_uuid_msg_id,rega
+	arg MAX_LENGTH_PRIVISIONING_PAIRING_MSG_IOS,regb
+	call ali_mesh_app_control_package_check_integrity
+	rtn user
+	bpatchx patch3e_6,mem_patch3e
+	fetch 1,mem_mesh_receive_service_uuid_provisioning_type
+	beq PROVISIONING_RANDOM,ali_mesh_ios_gatt_packet_parse_provisioning_random
+	beq PROVISIONING_DATA,ali_mesh_ios_gatt_packet_parse_provisioning_data
+	beq PROVISIONING_CONFIG,ali_mesh_ios_gatt_packet_parse_provisioning_config
+	rtn
+
+
+ali_mesh_ios_gatt_packet_parse_provisioning_random:
+	fetch 2,mem_mesh_three_tuple_MAC+4
+	store 2,mem_mesh_gatt_package_receive_MAC
+	arg mem_mesh_gatt_package_receive_MAC,contr
+	branch ali_mesh_advertising_receive_Privisioning_Random
+
+
+ali_mesh_ios_gatt_packet_parse_provisioning_data:
+//后期看能不能复用优化代码
+	fetch 1,mem_mesh_provisioned_flag
+	rtneq PAIRED_STATUS	//不处于已配网状态	
+	fetch 1,mem_mesh_Provisioning_State_Flag
+	rtnbit0 RECEIVE_PROVISIONING_RANDOM
+	rtnbit1 RECEIVE_PROVISIONING_DATA
+	arg mem_mesh_gatt_package_receive_msg_payload,contr
+	arg 0x14,loopcnt
+	arg mem_mesh_KeyFresh_and_Update_flag,contw
+	call memcpy
+	call ali_mesh_encrypt_calc_provisioning_data_calc_SessionKey
+	arg mem_mesh_KeyFresh_and_Update_flag,rega
+	arg memresult,regb
+	arg 0x0a,loopcnt
+	call ali_mesh_encrypt_calc_provisioning_data_xor_prov_data_loop
+	branch ali_mesh_resolve_Privisioning_Data_package
+
+
+ali_mesh_ios_gatt_packet_parse_provisioning_config:
+	fetch 1,mem_mesh_provisioned_flag
+	rtnne UNPROVISIONED_BEACON_STATUS
+	jam PAIRING_STATUS,mem_mesh_provisioned_flag
+
+ali_mesh_ios_gatt_packet_send_provisioning_config_ack:
+	arg PROVISIONING_CONFIG_ACK_MAC+PROVISIONING_CONFIG_ACK_FIELD,temp
+	call ali_mesh_advertising_send_packet_common
+	setarg PROVISIONING_CONFIG_ACK
+	istore 1,contw
+	fetch 2,mem_mesh_three_tuple_MAC+4
+	istore 2,contw
+	setarg PROVISIONING_CONFIG_ACK_NOTE
+	istore 1,contw
+	rtn
+
+ali_mesh_ios_gatt_packet_parse_provisioning_app_control:
+//	fetch 1,mem_mesh_provisioned_flag
+//	rtnne PAIRED_STATUS		//not pairing status
+	arg mem_mesh_receive_service_uuid_ios_data_NID,contr
+	arg MAX_LENGTH_PRIVISIONING_CONTROL_MSG_IOS,regb
+ali_mesh_resolve_app_control_msg_package:
+	bpatchx patch3e_7,mem_patch3e
+	ifetch 1,contr
+	copy contr,rega
+	fetcht 1,mem_k2_NID
+	isub temp,null
+	nrtn zero
+	call ali_mesh_advertising_reset_adv_timer				//接收到正确的APP包，reset timer
+	call ali_mesh_app_control_package_check_integrity
+	rtn user
+	jam MESH_MESSAGE_APP,mem_mesh_network_packet_type
+	fetcht 1,mem_mesh_gatt_package_receive_msg_total_length
+	increase 1,temp
+	arg mem_mesh_gatt_package_receive_msg_payload,contr
+	branch ali_mesh_network_layer_recevice_network_pdu
+
+
+ali_mesh_receive_adtype_128bit_uuid_complete_store_uuid:
+	arg mem_mesh_receive_service_uuid_company_id,contw
+	call memcpy16
+	arg mem_mesh_receive_service_uuid_company_id,rega
+	arg 16,loopcnt
+	call inverse_data
+	arg 16,loopcnt
+	arg mem_mesh_receive_service_uuid_company_id,contr
+	branch ali_mesh_receive_provisioning_package_check_header
+
+ali_mesh_receive_provisioning_package_check_header:
+	call disable_user
+	ifetcht 2,contr
+	setarg COMPANY_IDENTIFIERS_ALIBABA
+	byteswap pdata,pdata
+	isub temp,null
+	nrtn zero	//判断company id和VID是否正确
+	ifetch 1,contr
+	store 1,mem_mesh_receive_VID
+	call enable_user
+	branch logging_tx_debug_receive_provisioning_packet
+
+
+/*
+input:
+	regb max payload data size
+	rega is packet ptr
+output:
+	enable user is mean old packet
+	mem_mesh_fast_gatt_ios_msg_payload is output payload ptr
+*/
+ali_mesh_app_control_package_check_integrity:
+	bpatchx patch3f_0,mem_patch3f
+	call ali_mesh_app_control_package_check_MsgId_legal
+	branch ali_mesh_app_control_package_check_rev_complete
+
+
+ali_mesh_app_control_package_check_rev_complete:
+	add rega,GATT_PACKAGE_PACKAGE_NUM,contr
+	ifetcht 1,contr
+	rshift4 temp,pdata
+	beq 1,ali_mesh_gatt_package_check_integrity_unsegment
+ali_mesh_gatt_package_check_integrity_segment:
+	sub pdata,MAX_GATT_PACKAGE_NUM,null
+	nbranch enable_user,positive	//分段过多,包接收错误，不解析
+	copy pdata,loopcnt
+	call ali_mesh_gatt_package_check_integrity_segment_expect_package_num
+	and temp,0x0f,queue
+	isub queue,null		//是否为最后一包
+	call ali_mesh_gatt_package_check_integrity_segment_calc_total_length,zero
+	increase -1,queue
+	fetch 1,mem_mesh_gatt_package_receive_msg_num
+	qisolate1 pdata
+	branch enable_user,true		//小包重传
+	qset1 pdata
+	store 1,mem_mesh_gatt_package_receive_msg_num
+	add rega,GATT_PACKAGE_LENGTH,contr
+	ifetch 1,contr
+	copy pdata,loopcnt
+	copy regb,pdata
+	imul32 queue,pdata
+	arg mem_mesh_gatt_package_receive_msg_payload,contw
+	iadd contw,contw
+	call memcpy_fast
+	fetch 1,mem_mesh_gatt_package_receive_msg_num
+	isub regc,null
+	ncall enable_user,zero
+	nbranch ali_mesh_gatt_package_store_receive_msg_buffer,zero		//没有接收完整
+ali_mesh_gatt_package_check_integrity_segment_complete:
+	call ali_mesh_gatt_package_clear_receive_msg_buffer				//complete packet 
+	branch disable_user
+
+//计算包长度regb*(总包数-1)+最后一包长度
+ali_mesh_gatt_package_check_integrity_segment_calc_total_length:
+	pincrease -1
+	imul32 regb,pdata
+	add rega,GATT_PACKAGE_LENGTH,contr
+	ifetcht 1,contr
+	iadd temp,pdata
+	store 1,mem_mesh_gatt_package_receive_msg_total_length
+	rtn
+
+ali_mesh_gatt_package_check_integrity_segment_expect_package_num:
+	arg 0,regc
+ali_mesh_gatt_package_check_integrity_segment_expect_package_num_loop:
+	add loopcnt,-1,queue
+	qset1 regc
+	loop ali_mesh_gatt_package_check_integrity_segment_expect_package_num_loop
+	rtn
+
+
+ali_mesh_gatt_package_store_receive_msg_buffer:
+	fetch 2,mem_mesh_gatt_package_receive_msg_buffer_ptr
+	copy pdata,contw
+	arg mem_mesh_gatt_package_receive_msg_buffer_temp,contr
+	arg 33,loopcnt
+	branch memcpy_fast
+
+//单包不保存，每次上报接收到数据
+ali_mesh_gatt_package_check_integrity_unsegment:
+	ifetch 1,contr
+	copy pdata,loopcnt
+	store 1,mem_mesh_gatt_package_receive_msg_total_length
+	arg mem_mesh_gatt_package_receive_msg_payload,contw
+	call memcpy
+	branch disable_user
+
+
+//检测MSG ID是否合法
+ali_mesh_app_control_package_check_MsgId_legal:
+	jam GATT_RECEIVE_TIMEOUT,mem_mesh_gatt_receive_msg_timer
+	call ali_mesh_gatt_package_get_MsgId
+	//检查第一块buffer的id
+	fetcht 2,mem_mesh_gatt_packet_receive_msg_buffer1
+	isub temp,null
+	//与接收到的id相等
+	branch ali_mesh_gatt_package_load_receive_msg_buffer1,zero
+	sub temp,0,null
+	//id=0 意味为空
+	branch ali_mesh_gatt_package_load_receive_msg_buffer1,zero
+	//检查第二块buffer的id
+	fetcht 2,mem_mesh_gatt_packet_receive_msg_buffer2
+	isub temp,null
+	//与接收到的id相等
+	branch ali_mesh_gatt_package_load_receive_msg_buffer2,zero
+	sub temp,0,null
+	//id=0 意味为空
+	branch ali_mesh_gatt_package_load_receive_msg_buffer2,zero
+	//last package not receive complete, new package receive ,discard last package
+	call ali_mesh_gatt_package_clear_receive_msg_buffer
+	call ali_mesh_gatt_package_get_MsgId
+	branch ali_mesh_gatt_package_load_receive_msg_buffer1
+
+//if MsgId=0,set MsgId=0x100
+ali_mesh_gatt_package_get_MsgId:
+	ifetch 1,rega
+	rtn blank
+	set1 8,pdata
+	rtn
+
+ali_mesh_gatt_package_load_receive_msg_buffer1:
+	store 2,mem_mesh_gatt_packet_receive_msg_buffer1
+	setarg mem_mesh_gatt_packet_receive_msg_buffer1
+	branch ali_mesh_gatt_package_load_receive_msg_buffer
+ali_mesh_gatt_package_load_receive_msg_buffer2:
+	store 2,mem_mesh_gatt_packet_receive_msg_buffer2
+	setarg mem_mesh_gatt_packet_receive_msg_buffer2
+	branch ali_mesh_gatt_package_load_receive_msg_buffer
+ali_mesh_gatt_package_load_receive_msg_buffer:
+	store 2,mem_mesh_gatt_package_receive_msg_buffer_ptr
+	copy pdata,contr
+	arg mem_mesh_gatt_package_receive_msg_buffer_temp,contw
+	arg GATT_RECEIVE_MSG_BUFFER_SIZE,loopcnt
+	branch memcpy_fast
+
+
+ali_mesh_gatt_package_receive_timer:
+	arg mem_mesh_gatt_receive_msg_timer,regc
+	arg ali_mesh_gatt_package_clear_receive_msg_buffer, regb
+	branch timer_single_step
+
+ali_mesh_gatt_package_clear_receive_msg_buffer:
+	arg mem_mesh_gatt_packet_receive_msg_buffer1,contw
+	arg GATT_RECEIVE_MSG_BUFFER_SIZE+GATT_RECEIVE_MSG_BUFFER_SIZE,loopcnt
+	branch clear_mem
+
+
+
Index: program/mesh_protocol_stack/mesh_health_message.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_health_message.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_health_message.prog	(working copy)
@@ -0,0 +1,118 @@
+
+/*
+	mesh里面configuration和health指令的解析
+*/
+
+ali_mesh_access_layer_config_or_health_message_opcode:
+	fetch 1,mem_mesh_configuration_health_message_opcode
+	beq MESH_MESSAGE_OPCODE_CONFIG_NODE_RESET_NO_HEAD,ali_mesh_access_layer_config_or_health_message_opcode_node_reset
+	beq MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_ADD_NO_HEAD,ali_mesh_message_config_modle_subscription_add
+	beq MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_DELETE_NO_HEAD,ali_mesh_message_config_modle_subscription_delete
+	rtn
+
+
+ali_mesh_access_layer_config_or_health_message_opcode_node_reset:
+	call ali_mesh_access_layer_send_config_node_reset_status
+	fetch 2,mem_mesh_cb_receive_node_reset
+	branch callback_func
+ali_mesh_access_layer_send_config_node_reset_status:
+	setarg MESH_CONFIGURATION_AND_HEALTH_MESSAGE_OPCODE_HEADER
+	store 1,mem_mesh_access_layer_payload
+	setarg MESH_MESSAGE_OPCODE_CONFIG_NODE_RESET_STATUS_NO_HEAD
+	istore 1,contw
+	jam 2,mem_mesh_access_layer_payload_len
+	branch ali_mesh_upper_transport_layer_send_access_message
+
+
+ali_mesh_message_config_modle_subscription_add:
+	call ali_mesh_message_config_modle_subscription_status
+	fetch 2,mem_mesh_core_feature
+	rtnbit1 MESH_FEATURE_DISABLE_SUBSCRIPTION
+	call ali_mesh_message_config_modle_subscription_check_element
+	call ali_mesh_message_config_modle_subscription_add_value_address
+	fetch 2,mem_mesh_cb_subscriptuion_list_changed
+	branch callback_func
+
+	
+ali_mesh_message_config_modle_subscription_delete:
+	call ali_mesh_message_config_modle_subscription_status
+	fetch 2,mem_mesh_core_feature
+	rtnbit1 MESH_FEATURE_DISABLE_SUBSCRIPTION
+	call ali_mesh_message_config_modle_subscription_check_element
+	fetcht 2,mem_mesh_subscription_value_address
+	rshift8 temp,pdata
+	rshift4 pdata,pdata
+	beq 0x0c,ali_mesh_message_config_modle_subscription_delete_group_addr
+	call ali_mesh_message_config_modle_subscription_check_value_address
+	nrtn user
+	setarg 0
+	istore 2,rega
+	fetch 2,mem_mesh_cb_subscriptuion_list_changed
+	branch callback_func
+
+ali_mesh_message_config_modle_subscription_delete_group_addr:
+	setarg -1
+	istore SUBSCRIPTION_MAX_COUNT,rega
+	istore SUBSCRIPTION_MAX_COUNT,contw
+	fetch 2,mem_mesh_cb_subscriptuion_list_changed
+	branch callback_func
+
+ali_mesh_message_config_modle_subscription_check_value_address:
+	arg SUBSCRIPTION_MAX_COUNT,loopcnt
+ali_mesh_message_config_modle_subscription_check_value_address_loop:
+	ifetch 2,rega
+	arg 0xffff,regb
+	isub regb,null
+	branch enable_user,zero
+	isub temp,null
+	branch enable_user,zero
+ali_mesh_message_config_modle_subscription_check_value_address_loop_empty:
+	increase 2,rega
+	loop ali_mesh_message_config_modle_subscription_check_value_address_loop
+	call disable_user
+	rtn
+
+
+ali_mesh_message_config_modle_subscription_status:
+	setarg MESH_CONFIGURATION_AND_HEALTH_MESSAGE_OPCODE_HEADER
+	store 1,mem_mesh_access_layer_payload
+	setarg MESH_MESSAGE_OPCODE_CONFIG_MODEL_SUBSCRIPTION_STATUS_NO_HEAD
+	istore 1,contw
+	setarg MESH_SUCCESS
+	istore 1,contw
+	fetch 6,mem_mesh_subscription_element_address
+	istore 6,contw
+	jam 9,mem_mesh_access_layer_payload_len
+	branch ali_mesh_upper_transport_layer_send_access_message_without_cleat_tx_buffer
+
+ali_mesh_message_config_modle_subscription_check_element:
+	call mesh_get_element_info_config
+	add rega,ELEMENT_DEVICE_SUBSCRIPTION_LABEL,rega
+	fetch 2,mem_mesh_subscription_element_address
+	fetcht 2,mem_mesh_Unicast_Address
+	byteswap temp,temp
+	isub temp,pdata
+	imul32 regb,pdata
+	iadd rega,rega
+	rtn
+
+ali_mesh_message_config_modle_subscription_add_value_address:
+	fetcht 2,mem_mesh_subscription_value_address
+	arg SUBSCRIPTION_MAX_COUNT,loopcnt
+ali_mesh_message_config_modle_subscription_add_value_address_loop:
+	ifetch 2,rega
+	branch ali_mesh_message_config_modle_subscription_add_value_address_in,blank
+	arg 0xffff,regb
+	isub regb,null
+	branch ali_mesh_message_config_modle_subscription_add_value_address_in,zero
+	increase 2,rega
+	loop ali_mesh_message_config_modle_subscription_add_value_address_loop
+	rtn
+
+ali_mesh_message_config_modle_subscription_add_value_address_in:
+	byteswap temp,temp	//地址高低位交换后存入eeprom
+	istoret 2,rega
+	rtn
+
+
+
Index: program/mesh_protocol_stack/mesh_init_function.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_init_function.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_init_function.prog	(working copy)
@@ -0,0 +1,102 @@
+
+/*
+	mesh init 函数操作
+*/
+ali_mesh_init:
+
+	call init_memp
+
+	setarg mesh_check_ble_rx_packet
+	store 2,mem_mesh_cb_receive_advertising
+
+	setarg mesh_idle_process
+	store 2,mem_cb_idle_process
+
+	setarg ali_mesh_network_layer_relay_access_message
+	store 2,mem_mesh_cb_network_relay
+
+	setarg mesh_receive_config_appkey_add_cb
+	store 2,mem_mesh_cb_receive_config_appkey_add
+
+	setarg mesh_store_new_subscriptuion_list_data
+	store 2,mem_mesh_cb_subscriptuion_list_changed
+
+	setarg mesh_store_new_seq_data
+	store 2,mem_mesh_cb_seq_changed
+
+	setarg mesh_cb_event_timer
+	store 2,mem_cb_event_timer
+
+	setarg ali_mesh_access_layer_check_access_message_opcode
+	store 2,mem_mesh_cb_receive_access_message
+
+	rtn wake
+	
+	jam 36,mem_mesh_adv_scan_channel
+	call ali_mesh_ali_vendor_message_indication_info_reset_tid
+
+	bpatchx patch3f_1,mem_patch3f
+	call mesh_uart_init
+	call mesh_iic_init
+	arg mem_mesh_Network_Key,rega
+	arg MESH_CODE_INIT,regb
+	arg 1,loopcnt
+	call logging_tx_info
+
+	call ali_mesh_chip_peripherals_load_data_from_eep
+	call mesh_inverse_three_tuple_MAC
+	fetch 1,mem_mesh_Network_Key
+	beq 0xff,mesh_send_Unprovisioned_Beacons
+	call ali_mesh_encrypt_base_function_k4
+	call ali_mesh_encrypt_calc_network_key_by_k2
+	branch ali_mesh_ali_vendor_message_opcode_device_power_on
+
+
+mesh_inverse_three_tuple_MAC:
+	fetch 6,mem_mesh_three_tuple_MAC
+	call inverse_data_6Byte
+	store 6,mem_le_lap
+	rtn
+
+mesh_get_element_info_config:
+	fetchr loopcnt,1,mem_mesh_element_number
+	fetchr rega,2,mem_mesh_element_device_ptr
+	fetchr regb,2,mem_mesh_element_device_length
+	rtn
+
+
+mesh_idle_process:
+	call ali_mesh_time_function
+	call ali_mesh_control_ble_adv_process
+	call ali_mesh_upper_transport_layer_control_packet
+	call ali_mesh_advertising_bearer_layer_load_packet_from_advertising_queue
+	branch mesh_receive_advertising
+
+
+mesh_cb_event_timer:
+	call ali_mesh_control_ble_adv_timer_process
+	branch ali_mesh_gatt_package_receive_timer
+
+
+ali_mesh_check_all_element_info:
+	call mesh_get_element_info_config
+ali_mesh_check_all_element_info_loop:
+	call ali_mesh_more_element_push_stack
+	copy regc,pdata
+	call callback_func
+	call ali_mesh_more_element_pop_stack
+	copy regb,pdata
+	iadd rega,rega
+	loop ali_mesh_check_all_element_info_loop
+	rtn
+
+
+mesh_iic_init:
+	jam gpcfg_uartb_txd,core_gpio_conf
+	jam gpcfg_uartb_rxd|gpcfg_pullup,core_gpio_conf+3
+//	jam 0,0x8081
+	jam gpcfg_iic_scl,core_gpio_conf+2
+	jam gpcfg_iic_sda,core_gpio_conf+1
+	jam gpcfg_output_low,core_gpio_conf+4
+	branch clear_eeprom_size_2k
+
Index: program/mesh_protocol_stack/mesh_lower_transport_layer.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_lower_transport_layer.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_lower_transport_layer.prog	(working copy)
@@ -0,0 +1,144 @@
+/*
+	mesh中接收到lower transport包判断
+	是Unsegmented包，直接上传到upper transport layer
+	是Segmented包，重组后上传到upper transport layer
+*/
+
+ali_mesh_lower_transport_layer_receive_lower_transport_PDU:
+	bpatchx patch3f_2,mem_patch3f
+	fetch 1,mem_mesh_message_Transport_Head
+	bbit1 TRANSPORT_HEAD_BIT_SEG,ali_mesh_lower_transport_layer_receive_lower_transport_PDU_segmented_message
+	jam 0,mem_mesh_ASZMIC
+	branch ali_mesh_upper_transport_layer_receive_unsegmented_access_message
+
+//segmented message reassembly
+ali_mesh_lower_transport_layer_receive_lower_transport_PDU_segmented_message:
+	call ali_mesh_lower_transport_layer_receive_SegAccMess_resolve_SZMIC_SeqZero_SegON
+	call ali_mesh_lower_transport_layer_receive_segmented_access_message_check_blockAck
+	rtn user
+	call ali_mesh_lower_transport_layer_receive_segmented_access_message_store_segment
+	branch ali_mesh_lower_transport_layer_receive_segmented_access_message_decrypt_segment
+
+//提取SZMIC/SeqZero/SegO/SegN
+//分别存储到SZMIC、SegO、SegN、SeqZero
+ali_mesh_lower_transport_layer_receive_SegAccMess_resolve_SZMIC_SeqZero_SegON:
+	arg 3,loopcnt
+	arg mem_mesh_message_segment_access_SZMIC_SeqZero_SegO_SegN,rega
+	call inverse_data
+	fetch 3,mem_mesh_message_segment_access_SZMIC_SeqZero_SegO_SegN
+	and pdata,0x1f,temp
+	storet 1,mem_mesh_segmented_access_message_SegN
+	rshift4 pdata,pdata
+	rshift pdata,pdata
+	and pdata,0x1f,temp
+	storet 1,mem_mesh_segmented_access_message_SegO
+	rshift4 pdata,pdata
+	rshift pdata,pdata
+	arg 0x1fff,rega
+	iand rega,temp
+	copy pdata,regb
+	fetch 2,mem_mesh_segmented_access_message_SeqZero
+	isub temp,null
+	ncall ali_mesh_lower_transport_layer_receive_segmented_access_message_recover_SeqZero,zero
+	storet 2,mem_mesh_segmented_access_message_SeqZero
+	rshift8 regb,pdata
+	rshift4 pdata,pdata
+	rshift pdata,pdata
+	store 1,mem_mesh_segmented_access_message_SZMIC
+	store 1,mem_mesh_ASZMIC
+	rtn
+
+ali_mesh_lower_transport_layer_receive_segmented_access_message_recover_SeqZero:
+	setarg 0
+	store 4,mem_mesh_segmented_access_message_BlockAck
+	jam 0,mem_mesh_segmented_access_message_current_length
+	rtn
+
+
+//检查blockAck标志,返回值mem_mesh_segmented_access_message_receive_finish
+//1表示收到成功
+ali_mesh_lower_transport_layer_receive_segmented_access_message_check_blockAck:
+	call disable_user
+	fetch 1,mem_mesh_segmented_access_message_SegO
+	copy pdata,queue
+	fetch 4,mem_mesh_segmented_access_message_BlockAck
+	qisolate1 pdata
+	branch enable_user,true
+	qset1 pdata
+	store 4,mem_mesh_segmented_access_message_BlockAck
+	fetcht 1,mem_mesh_segmented_access_message_SegN
+	add temp,1,loopcnt
+ali_mesh_lower_transport_layer_receive_segmented_access_message_check_blockAck_loop:
+	add loopcnt,-1,queue
+	qisolate1 pdata
+	nrtn true
+	loop ali_mesh_lower_transport_layer_receive_segmented_access_message_check_blockAck_loop
+	jam 1,mem_mesh_segmented_access_message_receive_finish
+	rtn
+
+
+//存储segment m内容，放到mem_mesh_segmented_access_message_SegO
+ali_mesh_lower_transport_layer_receive_segmented_access_message_store_segment:
+	fetch 1,mem_mesh_message_Transport_NetMIC_length
+	pincrease -6	//DST(2) Head(1) SZMIC_SeqZero_SegO_SegN(3)
+	copy pdata,loopcnt 
+	fetcht 1,mem_mesh_segmented_access_message_current_length
+	iadd temp,temp
+	storet 1,mem_mesh_segmented_access_message_current_length
+	arg mem_mesh_segmented_access_message_Segment,contw
+	fetch 1,mem_mesh_segmented_access_message_SegO
+	mul32 pdata,12,pdata
+//	lshift3 pdata,pdata
+	iadd contw,contw
+	arg mem_mesh_message_Transport_segmented_access_messagePDU_Segment,contr
+	branch memcpy
+
+//判断是否收完包，收完包，clear中间标志
+ali_mesh_lower_transport_layer_receive_segmented_access_message_decrypt_segment:
+	fetch 1,mem_mesh_segmented_access_message_receive_finish
+	rtneq 0
+	setarg 0
+	store 5,mem_mesh_segmented_access_message_BlockAck
+	fetcht 2,mem_mesh_message_SEQ+1
+	byteswap temp,temp
+	setarg 0xe000
+	iand temp,temp
+	fetch 2,mem_mesh_segmented_access_message_SeqZero
+	ior temp,pdata
+	byteswap pdata,pdata
+	store 2,mem_mesh_message_SEQ+1	//计算Application Nonce需要使用到初始的SEQ
+	branch ali_mesh_upper_transport_layer_receive_segmented_access_message
+
+
+/*
+	mesh中发送lower transport layer判断
+	是Unsegmented message，直接下发到network transport layer
+//	是Segmented message，拆分后上传到network transport layer
+*/
+//Unsegmented access message写入SEG、AKF、AID
+ali_mesh_lower_transport_layer_send_unsegmented_access_message:
+	fetch 1,mem_mesh_upper_transport_layer_payload_len
+	add pdata,1,temp
+	copy pdata,loopcnt
+	storet 1,mem_mesh_lower_transport_layer_payload_len
+	fetch 1,mem_mesh_message_Transport_Head
+	set0 TRANSPORT_HEAD_BIT_SEG,pdata
+	store 1,mem_mesh_unsegmented_access_lower_transport_layer_head
+	arg mem_mesh_access_layer_payload,contr
+	call memcpy_fast
+	branch ali_mesh_network_layer_send_access_message
+
+//segmented access message写入SEG、AKF、AID
+//input:rega is current segment payload length
+//contr is current segment payload ptr
+ali_mesh_lower_transport_layer_send_segmented_access_message:
+	add rega,4,temp
+	copy rega,loopcnt
+	storet 1,mem_mesh_lower_transport_layer_payload_len
+	arg mem_mesh_segmented_access_lower_transport_layer_parameters,contw
+	call memcpy_fast
+	fetch 1,mem_mesh_message_Transport_Head
+	set1 TRANSPORT_HEAD_BIT_SEG,pdata
+	store 1,mem_mesh_segmented_access_lower_transport_layer_head
+	branch ali_mesh_network_layer_send_access_message
+
Index: program/mesh_protocol_stack/mesh_model_layer.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_model_layer.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_model_layer.prog	(working copy)
@@ -0,0 +1,136 @@
+
+
+/*
+	mesh model层指令解析总函数
+*/
+
+ali_mesh_model_layer_check_model_message_opcode:
+	fetch 1,mem_mesh_module_message_opcode
+ali_mesh_model_layer_check_generic_OnOff_message_opcde:
+	beq MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONOFF_GET_NO_HEAD,ali_mesh_model_layer_message_opcode_generic_onoff_get
+	beq MESH_MODULE_MESSAGE_OPCODE_GENERIC_ONOFF_SET_NO_HEAD,ali_mesh_model_layer_message_opcde_generic_onoff_set
+	beq MESH_MODULE_MESSAGE_OPCODE_SCENE_RECALL_NO_HEAD,ali_mesh_model_layer_message_opcde_scene_recall
+	beq MESH_MODULE_MESSAGE_OPCODE_LIGHT_LIGHTNESS_SET_NO_HEAD,ali_mesh_model_layer_message_opcde_light_lightness_set
+	beq MESH_MODULE_MESSAGE_OPCODE_LIGHT_CTL_SET_NO_HEAD,ali_mesh_model_layer_message_opcde_light_ctl_set
+	rtn
+
+
+ali_mesh_model_layer_message_opcode_generic_onoff_get:
+	arg ali_mesh_model_layer_message_opcode_generic_onoff_get_cb,regc
+	branch ali_mesh_more_element_check_element_address
+ali_mesh_model_layer_message_opcode_generic_onoff_get_cb:
+	//input queue is element number
+	//output pdata is element generic OnOff status
+	fetch 2,mem_mesh_cb_generic_onoff_get
+	call callback_func
+	store 1,mem_mesh_generic_onoff_set_payload_OnOff
+	branch ali_mesh_access_layer_send_generic_onoff_status
+
+
+ali_mesh_model_layer_message_opcde_generic_onoff_set:
+	arg ali_mesh_model_layer_message_opcde_generic_onoff_set_cb,regc
+	branch ali_mesh_more_element_check_element_address
+ali_mesh_model_layer_message_opcde_generic_onoff_set_cb:
+	call ali_mesh_access_layer_send_generic_onoff_status
+	fetch 2,mem_mesh_cb_generic_onoff_set
+	branch callback_func
+
+
+//模式设置
+ali_mesh_model_layer_message_opcde_scene_recall:
+	call ali_mesh_access_layer_send_scene_status
+	fetch 2,mem_mesh_cb_scene_recall
+	branch callback_func
+
+
+ali_mesh_model_layer_message_opcde_light_lightness_set:
+	fetch 2,mem_mesh_light_lightness_set_payload_lightness
+	call ali_mesh_model_layer_message_calc_lightness
+	store 1,mem_mesh_light_lightness_calc_lightness
+	call ali_mesh_access_layer_send_light_lightness_status
+	fetch 2,mem_mesh_cb_light_lightness_set
+	branch callback_func
+
+
+ali_mesh_model_layer_message_opcde_light_ctl_set:
+	fetch 2,mem_mesh_last_CTL_Temperature
+	fetcht 2,mem_mesh_CTL_Temperature
+	isub temp,null
+	rtn zero
+
+	fetch 2,mem_mesh_CTL_Temperature
+	call ali_mesh_model_layer_message_calc_temperature
+	store 1,mem_mesh_CTL_calc_temperature
+
+	fetch 2,mem_mesh_CTL_Temperature
+	store 2,mem_mesh_last_CTL_Temperature
+	fetch 2,mem_mesh_cb_light_lightness_get
+	call callback_func
+	storet 2,mem_mesh_CTL_Lightness
+	call ali_mesh_access_layer_send_light_ctl_stauts
+	fetch 2,mem_mesh_cb_light_ctl_set
+	branch callback_func
+
+
+//input: pdata is lightness set by ali
+//output: pdata is lightness 0-100
+ali_mesh_model_layer_message_calc_lightness:
+	rtn blank
+	mul32 pdata,ALI_MESH_LIGHTNESS_LEVEL,pdata
+	arg ALI_MESH_LIGHTNESS_MAX,temp
+	idiv temp
+	call wait_div_end
+	remainder temp
+	rshift8 temp,temp
+	quotient pdata
+	sub temp,0xff,null
+	nrtn zero
+	pincrease 1
+	rtn
+
+
+//input: temp is lightness 0-100
+//output: temp is lightness set by ali
+ali_mesh_model_layer_message_calc_actual_lightness:
+	arg ALI_MESH_LIGHTNESS_MAX,pdata
+	imul32 temp,pdata
+	div pdata,ALI_MESH_LIGHTNESS_LEVEL
+	call wait_div_end
+	quotient temp
+	rtn
+
+//input: pdata is temperature set by ali
+//output: pdata is temperature 0-100
+ali_mesh_model_layer_message_calc_temperature:
+	arg ALI_MESH_TEMPERATURE_MIN,temp
+	isub temp,rega
+	call ali_mesh_model_layer_message_calc_temperature_k
+	copy rega,pdata
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	rtn
+
+
+//input: temp is temperature 0-100
+//output: temp is temperature set by ali
+ali_mesh_model_layer_message_calc_actual_temperature:
+	copy temp,rega
+	call ali_mesh_model_layer_message_calc_temperature_k
+	copy rega,pdata
+	imul32 temp,pdata
+	arg ALI_MESH_TEMPERATURE_MIN,temp
+	iadd temp,temp
+	rtn
+
+ali_mesh_model_layer_message_calc_temperature_k:
+	setarg ALI_MESH_TEMPERATURE_MAX
+	arg ALI_MESH_TEMPERATURE_MIN,temp
+	isub temp,pdata
+	div pdata,ALI_MESH_TEMPERATURE_LEVEL
+	call wait_div_end
+	quotient temp
+	rtn
+
+
+
Index: program/mesh_protocol_stack/mesh_more_element_check.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_more_element_check.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_more_element_check.prog	(working copy)
@@ -0,0 +1,138 @@
+
+/*
+	多元素设置，检查是否发送给子元素的信息
+	输入:
+		temp is 包的DST地址
+*/
+ali_mesh_more_element_check_unicast_address:
+	arg 0,queue
+	fetchr loopcnt,1,mem_mesh_element_number
+	call disable_user
+	fetch 2,mem_mesh_Unicast_Address
+ali_mesh_more_element_check_unicast_address_loop:
+	isub temp,null
+	branch ali_mesh_more_element_found_unicast_address_element,zero
+	byteswap pdata,pdata
+	pincrease 1
+	byteswap pdata,pdata
+	increase 1,queue
+	loop ali_mesh_more_element_check_unicast_address_loop
+	rtn
+
+ali_mesh_more_element_found_unicast_address_element:
+	jam 0,mem_mesh_receive_group_address
+	storer queue,1,mem_mesh_receive_element_number
+	call ali_mesh_more_element_calc_queue_address
+	branch enable_user
+
+
+/*
+	多元素设置，检查是否发送给子元素组播的信息
+	输入:
+		temp is 包的DST地址
+*/
+ali_mesh_more_element_check_group_address:
+	arg 0,queue
+	arg 0,regc
+	call mesh_get_element_info_config
+	call disable_user
+ali_mesh_more_element_check_group_address_loop:
+	fetch 2,mem_mesh_core_feature
+	bbit0 MESH_FEATURE_DISABLE_SUBSCRIPTION,ali_mesh_more_element_check_subscription_address
+	ifetch 2,rega
+	isub temp,null
+	call ali_mesh_more_element_found_group_address_element,zero
+ali_mesh_more_element_check_address_common:
+	copy regb,pdata
+	iadd rega,rega
+	increase 1,queue
+	loop ali_mesh_more_element_check_group_address_loop
+	copy regc,pdata
+	rtn blank
+	store 1,mem_mesh_receive_group_address
+	branch enable_user
+
+ali_mesh_more_element_found_group_address_element:
+	qset1 regc
+	rtn
+
+ali_mesh_more_element_check_subscription_address:
+	add rega,ELEMENT_DEVICE_SUBSCRIPTION_LABEL,contr
+	arg SUBSCRIPTION_MAX_COUNT,alarm
+ali_mesh_more_element_check_subscription_address_loop:
+	ifetch 2,contr
+	isub temp,null
+	branch ali_mesh_more_element_found_subscription_address_element,zero
+	increase -1,alarm
+	branch ali_mesh_more_element_check_address_common,zero
+	branch ali_mesh_more_element_check_subscription_address_loop
+
+ali_mesh_more_element_found_subscription_address_element:
+	call ali_mesh_more_element_found_group_address_element
+	branch ali_mesh_more_element_check_address_common
+
+/*
+	多元素设置，检查哪些元素需要执行的操作
+	输入:
+		regc:对应的回调
+*/
+ali_mesh_more_element_check_element_address:
+	arg 0,queue
+	fetch 1,mem_mesh_receive_group_address
+	branch ali_mesh_more_element_check_element_address_no_group_address,blank
+	copy pdata,regb
+	fetchr loopcnt,1,mem_mesh_element_number
+ali_mesh_more_element_check_element_address_loop:
+	storer queue,1,mem_mesh_receive_element_number
+
+	qisolate1 regb
+	call ali_mesh_more_element_check_element_address_no_group_address,true
+	fetchr queue,1,mem_mesh_receive_element_number
+	increase 1,queue
+	loop ali_mesh_more_element_check_element_address_loop
+	rtn
+
+ali_mesh_more_element_check_element_address_no_group_address:
+	call ali_mesh_more_element_push_stack
+	call ali_mesh_more_element_calc_queue_address
+	copy regc,pdata
+	call callback_func
+	branch ali_mesh_more_element_pop_stack
+
+ali_mesh_more_element_push_stack:
+	storer loopcnt,2,mem_mesh_loopcnt_tmep
+	storer rega,2,mem_mesh_rega_temp
+	storer regb,2,mem_mesh_regb_temp
+	storer regc,2,mem_mesh_regc_temp
+	rtn
+
+ali_mesh_more_element_pop_stack:
+	fetchr loopcnt,2,mem_mesh_loopcnt_tmep
+	fetchr rega,2,mem_mesh_rega_temp
+	fetchr regb,2,mem_mesh_regb_temp
+	fetchr regc,2,mem_mesh_regc_temp
+	rtn
+
+
+/*
+	多元素设置，计算队列的指令长度
+	输入:
+		queue当前数据编号
+*/
+ali_mesh_more_element_calc_queue_address:
+	bpatchx patch3f_3,mem_patch3f
+	fetch 2,mem_mesh_Unicast_Address
+	byteswap pdata,pdata
+	iadd queue,pdata
+	byteswap pdata,pdata
+	store 2,mem_mesh_send_message_SRC
+	call mesh_get_element_info_config
+	copy queue,pdata
+	imul32 regb,pdata
+	iadd rega,rega
+	add rega,ELEMENT_DEVICE_UPPER_QUEUE_PTR,contr
+	ifetch 2,contr
+	store,2,mem_queue_ptr
+	rtn
+
+
Index: program/mesh_protocol_stack/mesh_network_layer.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_network_layer.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_network_layer.prog	(working copy)
@@ -0,0 +1,286 @@
+
+/*
+	mesh协议中network layer
+	主要是负责mesh中Network PDU内容合法性和解密
+*/
+
+ali_mesh_receive_adtype_mesh_message:
+	jam MESH_MESSAGE_TMALL,mem_mesh_network_packet_type
+
+/*
+	mesh中接收到network包处理函数
+*/
+//contr is read ptr
+//input:temp is len
+ali_mesh_network_layer_recevice_network_pdu:
+	sub temp,MESH_NETWORK_PACKET_MIN_LENGTH,null
+	rtn positive	//过滤短包，包长度太短导致解析错误
+	sub temp,MESH_NETWORK_PACKET_MAX_LENGTH,null
+	nrtn positive	//过滤长包，包长度太长导致内存覆盖
+	bpatchx patch3f_4,mem_patch3f
+	call ali_mesh_network_store_in_mem
+ali_mesh_network_layer_recevice_network_pdu_check_NID:
+	call ali_mesh_network_layer_check_NID_IVI
+	nrtn user
+ali_mesh_network_layer_recevice_network_pdu_deceypt_obfuscation:
+	call ali_mesh_encrypt_obfuscation_deceypt_recevie_message
+	//fetch 1,mem_mesh_message_TTL
+	//rtnbit1 BIT_CTL
+//	fetch 1,mem_mesh_message_TTL
+//	nrtn blank
+ali_mesh_network_layer_recevice_network_pdu_decrypt_NetMIC32:
+	call ali_mesh_network_load_network_nonce_and_EncryptionKey
+	fetch 1,mem_mesh_message_Transport_NetMIC_length
+	arg mem_mesh_message_DST,temp
+	call ali_CCM_decrypt
+	nrtn zero	//NetMIC error
+
+
+ali_mesh_network_layer_recevice_network_pdu_check_DST:
+	bpatchx patch3f_5,mem_patch3f
+	fetcht 2,mem_mesh_message_DST
+	call ali_mesh_more_element_check_unicast_address	//检查所有子元素的单播地址
+	branch ali_mesh_network_layer_recevice_network_pdu_check_SRC_and_SEQ,user
+	arg 29,loopcnt
+	arg mem_mesh_message_NID_temp,contw
+	arg mem_mesh_message_NID,contr
+	call memcpy
+	call ali_mesh_network_layer_recevice_network_pdu_check_DST_group_address
+	arg 29,loopcnt
+	arg mem_mesh_message_NID_temp,contr
+	arg mem_mesh_message_NID,contw
+	call memcpy
+	fetch 2,mem_mesh_cb_network_relay
+	branch callback_func
+
+ali_mesh_network_layer_recevice_network_pdu_check_DST_group_address:
+	call ali_mesh_more_element_check_group_address	//检查所有子元素的组播地址
+	branch ali_mesh_network_layer_recevice_network_pdu_check_SRC_and_SEQ,user
+	jam 0xff,mem_mesh_receive_group_address
+	setarg GROUP_ADDRESS_0XCFFF_little_endian
+	isub temp,null	//DST==0xCFFF Tmall规定的灯model的组播地址2
+	branch ali_mesh_network_layer_recevice_network_pdu_check_SRC_and_SEQ,zero
+	setarg GROUP_ADDRESS_0XFFFF_little_endian
+	isub temp,null	//DST==0xCFFF Tmall规定的82 01指令的组播地址，在线检测
+	branch ali_mesh_network_layer_recevice_network_pdu_check_SRC_and_SEQ,zero
+	rtn
+
+
+ali_mesh_network_layer_check_NID_IVI:
+	call disable_user
+	fetcht 1,mem_mesh_message_NID
+	rshift4 temp,pdata
+	rshift3 pdata,pdata
+	fetchr rega,1,mem_mesh_IV_Index+3
+	and rega,0x01,rega
+	isub rega,null
+	nrtn zero
+	and temp,0x7f,temp
+	fetch 1,mem_k2_NID
+	isub temp,null
+	nrtn zero	//判断NID是否相等;相等说明是同一个网络的包
+	branch enable_user
+
+//检查SRC和SEQ存储cache，是否有当前SRC设备信息
+ali_mesh_network_layer_recevice_network_pdu_check_SRC_and_SEQ:
+	arg mem_mesh_TMALL_cache_start,rega
+	arg CACHE_SPACE_NUM,loopcnt
+ali_mesh_network_layer_raverse_SRC_SEQ_cache:
+	fetcht 2,mem_mesh_message_SRC
+	ifetch 2,rega
+//cache存在空的空间,将SRC、SEQ存储到这个空间
+	branch ali_mesh_network_layer_find_empty_space,blank
+	
+	isub temp,null
+//cache已经存有该SRC的信息，导出SEQ信息
+	branch ali_mesh_network_layer_find_SRC_space,zero
+	increase CACHE_SPACE_SIZE,rega
+	loop ali_mesh_network_layer_raverse_SRC_SEQ_cache
+	arg mem_mesh_TMALL_cache_start,rega
+
+ali_mesh_network_layer_find_empty_space:
+	istoret 2,rega
+ali_mesh_network_layer_find_SRC_space:
+	storet 2,mem_mesh_send_message_DST
+	//接收时的SRC是发送时候的DST
+	add rega,2,regc
+	ifetch 3,regc
+	store 3,mem_mesh_last_message_SEQ
+	branch ali_mesh_network_layer_recevice_network_pdu_check_SEQ_legal
+
+
+//检查SEQ的合法性，过滤重复包
+ali_mesh_network_layer_recevice_network_pdu_check_SEQ_legal:
+//check SEQ
+	call ali_mesh_inverse_SEQ
+	//高低位交换
+	fetch 3,mem_mesh_last_message_SEQ
+	fetcht 3,mem_mesh_message_SEQ
+	isub temp,null
+	rtn positive	//lastMessageSEQ-currMessageSEQ>=0,返回
+	istoret 3,regc	
+	call ali_mesh_inverse_SEQ	//application nonce和Device nonce都需要用到SEQ
+	call logging_tx_debug_network_receive_packet
+	branch ali_mesh_lower_transport_layer_receive_lower_transport_PDU
+
+ali_mesh_inverse_SEQ:
+	arg mem_mesh_message_SEQ,rega
+	arg 3,loopcnt
+	branch inverse_data
+
+
+
+ali_mesh_network_load_network_nonce_and_EncryptionKey:
+	call ali_mesh_network_layer_load_network_nonce
+ali_mesh_upper_transport_layer_load_EncryptionKey:
+	arg mem_k2_EncryptionKey,contr
+	branch load_key
+ali_mesh_network_layer_load_network_nonce:
+	arg mem_mesh_Network_Nonce,contw
+	setarg NETWORK_NONCE
+	istore 1,contw
+	fetch 6,mem_mesh_message_TTL
+	istore 8,contw
+	branch mesh_generate_nonce
+
+
+ali_mesh_network_store_in_mem:
+	add temp,-12,pdata
+	//长度-12的原因
+	//uint8_t AD type:GAP_ADTYPE_MESH_MESSAGE
+	//uint8_t IVI & NID
+	//uint8_t CTL & TTL
+	//uint24_t SEQ
+	//uint16_t SRC
+	//uint32_t MIC
+	//AD_len减去上面内容，是实际DST & Transport PDU的长度
+	//问题:没有考虑MIC长度是64bit 的情况，目前不支持，后期支持需要修改
+	store 1,mem_mesh_message_Transport_NetMIC_length
+	arg 29,loopcnt
+	arg mem_mesh_message_NID,contw
+	call clear_mem
+	add temp,-1,loopcnt
+	arg mem_mesh_message_NID,contw
+	branch memcpy_fast
+	//统一copy到mem_mesh_message_NID
+
+ali_mesh_network_layer_relay_access_message:
+	call ali_mesh_network_layer_check_relay_states
+	nrtn user
+	call ali_mesh_network_layer_encrypt_relay_package
+	jam ADV_RELAY_MESH_MESSAGE_DURATION,mem_mesh_queue_ele_duration
+	fetch 1,mem_mesh_message_Transport_NetMIC_length
+	add pdata,13,temp
+	storet 1,mem_mesh_queue_ele_len
+	increase -1,temp
+	istoret 1,contw
+	setarg GAP_ADTYPE_MESH_MESSAGE
+	istore 1,contw
+	add temp,-1,loopcnt
+	fetch 7,mem_mesh_message_NID
+	arg mem_mesh_message_NID,contr
+	call memcpy
+	arg mem_mesh_queue_ele_temp,rega
+	branch queue_push
+
+//output:enable user is mean can relay packet
+ali_mesh_network_layer_check_relay_states:
+	call disable_user
+	fetch 1,mem_mesh_network_packet_type
+	rtneq MESH_MESSAGE_APP	//不relay APP的控制包
+	fetch 2,mem_mesh_core_feature
+	rtnbit1 MESH_FEATURE_DISABLE_RELAY
+	fetch 1,mem_mesh_provisioned_flag
+	rtnne PAIRED_STATUS	//无配网状态，不relay 接收到random就能解析数据
+	fetcht 2,mem_mesh_message_SRC
+	call ali_mesh_more_element_check_unicast_address
+	nrtn user					//不relay 元素的包的数据包
+	call ali_mesh_network_layer_check_network_mic_cache
+	nrtn user
+	call ali_mesh_network_layer_logging_tx_relay_info
+	fetch 1,mem_mesh_message_TTL
+	rtn blank
+	pincrease -1
+	rtn blank
+	store 1,mem_mesh_message_TTL
+	setarg mem_mesh_network_relay_queue
+	store 2,mem_queue_ptr
+	branch enable_user
+
+ali_mesh_network_layer_encrypt_relay_package:
+ 	call ali_mesh_network_load_network_nonce_and_EncryptionKey
+	fetch 1,mem_mesh_message_Transport_NetMIC_length
+	arg mem_mesh_message_DST,temp
+	call ali_CCM_encrypt
+	branch ali_mesh_encrypt_obfuscation_deceypt_recevie_message
+
+
+//user is enable ,mean new packet
+ali_mesh_network_layer_check_network_mic_cache:
+	setarg mem_mesh_transport_message_mic_cache
+	store 2,mem_mesh_mic_cache_ptr
+	branch ali_mesh_base_adt_cache
+
+
+ali_mesh_network_layer_logging_tx_relay_info:
+	arg 2,loopcnt
+	arg mem_mesh_message_DST,rega
+	arg MESH_NETWORK_RELAY_PACKET,regb
+	call logging_tx_info
+	fetchr loopcnt,1,mem_ccm_data_len
+	fetchr rega,2,mem_ccm_data_ptr
+	arg MESH_NETWORK_RELAY_PACKET,regb
+	branch logging_tx_debug
+
+
+/*
+	mesh中发送到network layer处理函数
+	不区分Unsegmented access message和Segmented access message
+	统一处理函数接口
+*/
+
+ali_mesh_network_layer_send_access_message:
+	bpatchx patch3f_6,mem_patch3f
+	call ali_mesh_network_layer_send_access_message_encrypt_NetMIC
+	call ali_mesh_network_layer_send_access_message_encrypt_obfuscation
+	branch ali_mesh_bearer_layer_send_packet_by_network_layer
+
+
+//DST在接收包时，已经写入mem_mesh_unsegmented_lower_transport_layer_DST
+//计算Netwrork MIC的值
+ali_mesh_network_layer_send_access_message_encrypt_NetMIC:
+	fetch 1,mem_mesh_lower_transport_layer_payload_len
+	add pdata,2,rega	//DST size
+	pincrease 4
+	store 1,mem_mesh_lower_transport_layer_payload_len
+	arg mem_mesh_send_upper_layer_DST,temp
+	branch ali_mesh_network_layer_encrypt_by_network_nonce
+
+//********* generate network nonce *********//
+//input:temp is encrypt ptr
+//rega is encrypt length
+ali_mesh_network_layer_encrypt_by_network_nonce:
+	call ali_mesh_network_load_network_nonce_and_EncryptionKey
+	copy rega,pdata
+	branch ali_CCM_encrypt
+
+
+ali_mesh_network_layer_send_access_message_encrypt_obfuscation:
+	branch ali_mesh_encrypt_obfuscation_deceypt_send_message
+
+
+
+mesh_generate_nonce:
+	fetch 4,mem_mesh_IV_Index
+	istore 4,contw
+	add contw,-13,pdata
+	store 2,mem_nonce_ptr
+	rtn
+
+logging_tx_debug_network_receive_packet:
+	fetch 1,mem_mesh_message_Transport_NetMIC_length
+	add pdata,11,loopcnt
+	arg mem_mesh_message_NID,rega
+	arg MESH_NETWORK_RECEIVE_PACKET,regb
+	branch logging_tx_debug
+
Index: program/mesh_protocol_stack/mesh_upper_transport_layer.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_upper_transport_layer.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/mesh_protocol_stack/mesh_upper_transport_layer.prog	(working copy)
@@ -0,0 +1,445 @@
+
+/*
+	mesh协议中upper transport layer
+	主要是负责mesh中upper transport layer数据的解密
+	Unsegmented access message和segmented access message
+	Control message
+*/
+
+/*
+	mesh中接收到unsegmented按照AKF标志，使用application nonce或者device nonce解密Unsegmented access message
+*/
+
+ali_mesh_upper_transport_layer_receive_unsegmented_access_message:
+	bbit0 TRANSPORT_HEAD_BIT_AKF,ali_mesh_uuper_transport_layer_decrypt_unsegment_access_by_device_key
+//application key和application nonce解密Unsegmented access message
+ali_mesh_uuper_transport_layer_decrypt_unsegment_access_by_application_key:
+	call ali_mesh_upper_transport_layer_load_application_nonce_and_application_key
+	branch ali_mesh_upper_transport_layer_decrypt_unsegmented_message
+//device key和device nonce解密Unsegmented access message
+ali_mesh_uuper_transport_layer_decrypt_unsegment_access_by_device_key:
+	call ali_mesh_upper_transport_layer_load_device_nonce_and_device_key
+	branch ali_mesh_upper_transport_layer_decrypt_unsegmented_message
+
+
+ali_mesh_upper_transport_layer_decrypt_unsegmented_message:
+	fetch 1,mem_mesh_message_Transport_NetMIC_length
+	pincrease -7	
+	//DST 16bit
+	//Head8bit (SEG 1bit /AKF 1bit/AID 6bit)
+	//Transport MIC 32bit
+	arg mem_mesh_message_Transport_unsegmented_access_messagePDU,alarm
+	call disable_user
+	branch ali_mesh_upper_transport_layer_decrypt_message
+
+
+/*
+	mesh中接收到segmented按照AKF标志，使用application nonce或者device nonce解密segmented access message
+*/
+ali_mesh_upper_transport_layer_receive_segmented_access_message:
+	fetch 1,mem_mesh_message_Transport_Head
+	bbit0 TRANSPORT_HEAD_BIT_AKF,ali_mesh_uuper_transport_layer_decrypt_segment_access_by_device_key
+ali_mesh_uuper_transport_layer_decrypt_segment_access_by_application_key:
+	call ali_mesh_upper_transport_layer_load_application_nonce_and_application_key
+	branch ali_mesh_upper_transport_layer_decrypt_segmented_message
+ali_mesh_uuper_transport_layer_decrypt_segment_access_by_device_key:
+	call ali_mesh_upper_transport_layer_load_device_nonce_and_device_key
+	branch ali_mesh_upper_transport_layer_decrypt_segmented_message
+
+
+ali_mesh_upper_transport_layer_decrypt_segmented_message:
+	fetch 1,mem_mesh_ASZMIC
+	ncall enable_user,blank
+	call disable_user,blank
+	fetch 1,mem_mesh_segmented_access_message_current_length
+	pincrease -4	//Transport MIC
+	jam 0,mem_mesh_segmented_access_message_current_length
+	arg mem_mesh_segmented_access_message_Segment,alarm
+
+//input:alarm:decrypt message ptr
+//pdata:decrypt message length
+ali_mesh_upper_transport_layer_decrypt_message:
+	copy alarm,temp
+	call ali_mesh_upper_transport_layer_decrypt_message_decrypt_transMIC
+	nrtn zero
+	arg 1,loopcnt
+	arg mem_ccm_data_len,rega
+	arg MESH_UPPER_RECEIVE_PACKET,regb
+	call logging_tx_info
+	call ali_mesh_upper_transport_layer_check_transport_mic_cache
+	nrtn user
+	fetch 2,mem_ccm_data_ptr
+	copy pdata,alarm
+	branch ali_mesh_access_layer_resolve_message
+
+ali_mesh_upper_transport_layer_decrypt_message_decrypt_transMIC:
+	nbranch ali_CCM_decrypt,user
+	pincrease -4
+	branch ali_CCM_decrypt_64Bit
+
+//user is enable ,mean new packet
+ali_mesh_upper_transport_layer_check_transport_mic_cache:
+	setarg mem_mesh_access_message_mic_cache
+	store 2,mem_mesh_mic_cache_ptr
+	branch ali_mesh_base_adt_cache
+
+
+//********* generate application nonce *********//
+ali_mesh_upper_transport_layer_load_application_nonce_and_application_key:
+	call ali_mesh_upper_transport_layer_load_application_nonce
+ali_mesh_upper_transport_layer_load_application_key:
+	arg mem_mesh_application_key,contr
+	branch load_key
+ali_mesh_upper_transport_layer_load_application_nonce:
+	arg mem_mesh_Application_Nonce,contw
+	setarg APPLICATION_NONCE
+	istore 1,contw
+	fetch 1,mem_mesh_ASZMIC
+	arg 0,temp
+	nsetflag blank,7,temp
+	istoret 1,contw
+	fetch 7,mem_mesh_message_SEQ
+	istore 7,contw
+	branch mesh_generate_nonce
+
+
+//********* generate device nonce *********//
+ali_mesh_upper_transport_layer_load_device_nonce_and_device_key:
+	call ali_mesh_upper_transport_layer_load_device_nonce
+ali_mesh_upper_transport_layer_load_device_key:
+	arg mem_mesh_Device_Key,contr
+	branch load_key
+ali_mesh_upper_transport_layer_load_device_nonce:
+	arg mem_mesh_Device_Nonce,contw
+	setarg DEVICE_NONCE
+	branch ali_mesh_upper_transport_layer_load_application_nonce + 2
+
+
+/*
+	mesh中upper transport layer，发送access layer传入的access  PDU
+*/
+// write data to // mem_mesh_access_layer_payload //
+// write data len to //mem_mesh_access_layer_payload_len //
+//upper层发送access mess，主要是计算transport MIC
+ali_mesh_upper_transport_layer_send_access_message:
+ali_mesh_upper_transport_layer_send_access_message_without_cleat_tx_buffer:
+	bpatchx patch3f_7,mem_patch3f
+	call ali_mesh_upper_transport_layer_clear_tx_buffer
+	call ali_mesh_loggint_tx_info_upper_send_packet
+	call ali_mesh_upper_transport_layer_send_access_message_add_NID_SRC_TTL_SEQ_DST
+
+	//queue control
+	call ali_mesh_upper_transport_layer_store_packet_header
+	rtn user
+	call ali_mesh_upper_transport_layer_store_unsegment_msg_original_access_pdu
+
+	arg mem_mesh_upper_tran_layer_queue_temp,rega
+	branch queue_push
+
+
+//output:user is enable mean send Attr Indication packet,but no in paired status
+ali_mesh_upper_transport_layer_store_packet_header:
+	call disable_user
+	arg UPPER_RETRY_COUNT_STATUS,temp
+	fetch 1,mem_mesh_provisioned_flag
+	iadd temp,temp		//APP 配网包，增加重传次数保证成功率
+	fetch 1,mem_mesh_network_packet_type
+	sub pdata,MESH_MESSAGE_APP,null
+	setflag zero,BIT_UPPER_FLAG_APP_CONTROL,temp
+	storet 1,mem_mesh_upper_tran_layer_temp_packet_flag
+	fetch 9,mem_mesh_send_upper_layer_IVI_and_NID
+	store 9,mem_mesh_upper_tran_layer_temp_packet_header_IVI_NID
+	fetch 1,mem_mesh_access_layer_payload_vendor_command
+	rtnne VENDOR_MESSAGE_ATTR_INDICATION
+	fetch 1,mem_mesh_provisioned_flag
+	bne PAIRED_STATUS,enable_user
+	fetch 1,mem_mesh_access_layer_payload_vendor_tid
+	store 1,mem_mesh_upper_tran_layer_temp_packet_TID
+	fetch 1,mem_mesh_upper_tran_layer_temp_packet_flag
+	pincrease UPPER_RETRY_COUNT_INDICATION
+	set1 BIT_UPPER_FLAG_VENDOR_INDICATION,pdata
+	store 1,mem_mesh_upper_tran_layer_temp_packet_flag
+	rtn
+
+
+ali_mesh_upper_transport_layer_store_unsegment_msg_original_access_pdu:
+	fetch 1,mem_mesh_access_layer_payload_len
+	copy pdata,loopcnt
+	store 1,mem_mesh_upper_tran_layer_temp_packet_length
+	fetch 1,mem_mesh_message_Transport_Head
+	store 1,mem_mesh_upper_tran_layer_temp_pakcet_AKF_AID
+	arg mem_mesh_upper_tran_layer_temp_pakcet_upper_tran_access_pdu,contw
+	arg mem_mesh_access_layer_payload,contr
+	branch memcpy
+
+
+/*
+	mesh中upper transport layer，控制包的发送和重传等
+*/
+ali_mesh_upper_transport_layer_control_packet:
+	arg ali_mesh_upper_transport_layer_control_packet_deal,regc
+	branch ali_mesh_check_all_element_info
+
+
+ali_mesh_upper_transport_layer_control_packet_deal:
+	add rega,ELEMENT_DEVICE_UPPER_ADV_FLAG,contr
+	ifetch 1,contr
+	nrtn blank
+	ifetch 2,contr
+	store 2,mem_queue_ptr
+	arg mem_mesh_upper_tran_layer_queue_temp,rega
+	call queue_get_new_ele
+	nrtn user													//查看发送队列有无数据
+	fetchr rega,2,mem_mesh_rega_temp
+
+	fetcht 1,mem_mesh_upper_tran_layer_temp_packet_flag
+	and temp,DATA_UPPER_FLAG_MAX_RETRY_COUNT,pdata
+	branch ali_mesh_upper_transport_layer_queue_pop,blank		//重传超时丢弃该包
+	add rega,ELEMENT_DEVICE_UPPER_ADV_FLAG,contw
+	setarg PACKET_IN_BEARER
+	istore 1,contw		//状态未丢弃
+
+	call ali_mesh_upper_transport_layer_control_packet_load_header	//加载packet header，message header
+
+	fetcht 1,mem_mesh_upper_tran_layer_temp_packet_flag
+	call ali_mesh_upper_transport_layer_control_packet_load_app_control	//APP控制还是tmall控制
+	add rega,ELEMENT_DEVICE_TRAN_PACKAGE_TID,contw
+	istore 1,contw
+	set1 BIT_UPPER_FLAG_RETRANSMIT,temp						//重传标志
+
+	increase -1,temp		//重传次数-1
+	istoret 1,regb			//存入队列位置
+	
+	fetcht 1,mem_mesh_upper_tran_layer_temp_packet_flag
+	isolate1 BIT_UPPER_FLAG_RETRANSMIT,temp
+	nbranch ali_mesh_upper_transport_layer_control_packet_encrypt_access,true
+	fetcht 1,mem_mesh_upper_tran_layer_temp_packet_length
+	storet 1,mem_mesh_upper_transport_layer_payload_len
+	copy temp,loopcnt
+	arg mem_mesh_access_layer_payload,contw
+	arg mem_mesh_upper_tran_layer_temp_pakcet_upper_tran_access_pdu,contr
+	call memcpy
+	sub temp,UNSEGMENTED_ACCESS_MESSAGE_MAX_UPPER_TRANSPORT_ACCESS_PDU_LEN,null
+	nbranch ali_mesh_upper_transport_layer_control_packet_segment_msg,positive
+ali_mesh_upper_transport_layer_control_packet_unsegment_msg:
+	branch ali_mesh_lower_transport_layer_send_unsegmented_access_message
+
+
+ali_mesh_upper_transport_layer_control_packet_segment_msg:
+	fetch 4,mem_mesh_upper_tran_layer_temp_segmented_pakcet_SeqZero
+	store 4,mem_mesh_segmented_lower_transport_layer_SegZero
+	branch ali_mesh_upper_transport_layer_split_segmented_msg_to_lower_tran_layer
+
+
+ali_mesh_upper_transport_layer_control_packet_load_header:
+	fetch 1,mem_mesh_upper_tran_layer_temp_pakcet_AKF_AID
+	store 1,mem_mesh_message_Transport_Head
+
+	fetch 9,mem_mesh_upper_tran_layer_temp_packet_header_IVI_NID
+	store 9,mem_mesh_send_upper_layer_IVI_and_NID
+	store 9,mem_mesh_message_NID
+	rtn
+
+
+ali_mesh_upper_transport_layer_control_packet_load_app_control:
+	setarg UPPER_TRAN_TMALL_AND_APP
+	call ali_mesh_store_tran_package_type
+	fetch 1,mem_mesh_upper_tran_layer_temp_packet_TID
+	isolate1 BIT_UPPER_FLAG_VENDOR_INDICATION,temp
+	rtn true		//indication packet send app & tmall
+	setarg UPPER_TRAN_TMALL_MESSAGE
+	call ali_mesh_store_tran_package_type
+	setarg 0
+	isolate1 BIT_UPPER_FLAG_APP_CONTROL,temp
+	nrtn true
+	setarg UPPER_TRAN_APP_MESSAGE
+	call ali_mesh_store_tran_package_type
+	branch enable_blank
+
+ali_mesh_store_tran_package_type:
+	add rega,ELEMENT_DEVICE_TRAN_PACKAGE_TYPE,contw
+	istore 1,contw
+	rtn
+
+
+ali_mesh_upper_transport_layer_queue_pop:
+	setarg 0
+	add rega,ELEMENT_DEVICE_TRAN_PACKAGE_TID,contw
+	istore 1,contw
+	arg mem_mesh_upper_tran_layer_queue_temp,rega
+	branch queue_pop
+
+ali_mesh_upper_transport_layer_control_packet_encrypt_access:
+	call ali_mesh_upper_transport_layer_send_access_message_calc_SEQ
+	call ali_mesh_upper_transport_layer_send_access_message_add_SEQ
+	fetch 9,mem_mesh_send_upper_layer_IVI_and_NID
+	store 9,mem_mesh_upper_tran_layer_temp_packet_header_IVI_NID
+	call ali_mesh_upper_transport_layer_control_packet_encrypt_access_load_payload
+	setarg 0
+	store 1,mem_mesh_ASZMIC
+	call ali_mesh_upper_transport_layer_calc_transport_mic
+
+	fetcht 1,mem_mesh_upper_transport_layer_payload_len
+	storet 1,mem_mesh_upper_tran_layer_temp_packet_length
+	copy temp,loopcnt
+	arg mem_mesh_access_layer_payload,contr
+	arg mem_mesh_upper_tran_layer_temp_pakcet_upper_tran_access_pdu,contw
+	call memcpy
+	
+	sub temp,UNSEGMENTED_ACCESS_MESSAGE_MAX_UPPER_TRANSPORT_ACCESS_PDU_LEN,null
+	nbranch ali_mesh_upper_transport_layer_control_packet_encrypt_access_segment_msg,positive
+ali_mesh_upper_transport_layer_control_packet_encrypt_access_unsegment_msg:
+//upper层发送unsegmented access mess，主要是计算transport MIC
+	arg mem_mesh_upper_tran_layer_temp_packet_transmit_delay,rega
+	call queue_store_new_ele
+	branch ali_mesh_lower_transport_layer_send_unsegmented_access_message
+
+ali_mesh_upper_transport_layer_control_packet_encrypt_access_segment_msg:
+	call ali_mesh_upper_transport_layer_send_segmented_access_message_get_SeqZero_SegON
+	fetch 4,mem_mesh_segmented_lower_transport_layer_SegZero
+	store 4,mem_mesh_upper_tran_layer_temp_segmented_pakcet_SeqZero
+	arg mem_mesh_upper_tran_layer_temp_packet_transmit_delay,rega
+	call queue_store_new_ele
+	branch ali_mesh_upper_transport_layer_split_segmented_msg_to_lower_tran_layer
+
+ali_mesh_upper_transport_layer_control_packet_encrypt_access_load_payload:
+	fetch 1,mem_mesh_upper_tran_layer_temp_packet_length
+	copy pdata,loopcnt
+	store 1,mem_mesh_access_layer_payload_len
+	fetch 1,mem_mesh_upper_tran_layer_temp_pakcet_AKF_AID
+	store 1,mem_mesh_message_Transport_Head
+	arg mem_mesh_upper_tran_layer_temp_pakcet_upper_tran_access_pdu,contr
+	arg mem_mesh_access_layer_payload,contw
+	branch memcpy
+
+ali_mesh_upper_transport_layer_split_segmented_msg_to_lower_tran_layer:
+	call ali_mesh_upper_transport_layer_send_segmented_access_message_calc_header
+	setarg mem_mesh_access_payload
+	store 2,mem_mesh_upper_transport_layer_payload_ptr
+ali_mesh_upper_transport_layer_send_segmented_access_message_loop:
+	call ali_mesh_upper_transport_layer_control_packet_load_header
+	call ali_mesh_upper_transport_layer_send_access_message_calc_SEQ
+	call ali_mesh_upper_transport_layer_send_access_message_add_SEQ
+
+	fetcht 1,mem_mesh_access_layer_payload_len
+	setarg SEGMENTED_ACCESS_MESSAGE_UNINT_PDU_LEN
+	call not_greater_than
+	copy pdata,rega
+	copy temp,pdata
+	isub rega,pdata
+	store 1,mem_mesh_access_layer_payload_len
+	fetch 2,mem_mesh_upper_transport_layer_payload_ptr
+	copy pdata,contr
+	iadd rega,temp
+	storet 2,mem_mesh_upper_transport_layer_payload_ptr
+	call ali_mesh_lower_transport_layer_send_segmented_access_message
+	fetch 1,mem_mesh_access_layer_payload_len
+	rtn blank
+	fetch 1,mem_mesh_segmented_lower_transport_layer_SegO
+	pincrease 1
+	store 1,mem_mesh_segmented_lower_transport_layer_SegO
+	call ali_mesh_upper_transport_layer_send_segmented_access_message_calc_header
+	branch ali_mesh_upper_transport_layer_send_segmented_access_message_loop
+
+
+
+//upper层计算transport mic值
+ali_mesh_upper_transport_layer_calc_transport_mic:
+	fetch 1,mem_mesh_message_Transport_Head
+	bbit0 TRANSPORT_HEAD_BIT_AKF,ali_mesh_upper_transport_layer_calc_transport_mic_by_DeviceKey
+ali_mesh_upper_transport_layer_calc_transport_mic_by_AppKey:
+	call ali_mesh_upper_transport_layer_load_application_nonce_and_application_key
+	branch ali_mesh_upper_transport_layer_calc_transport_mic_encrypt_AESCCM
+ali_mesh_upper_transport_layer_calc_transport_mic_by_DeviceKey:
+	call ali_mesh_upper_transport_layer_load_device_nonce_and_device_key
+ali_mesh_upper_transport_layer_calc_transport_mic_encrypt_AESCCM:
+	fetch 1,mem_mesh_access_layer_payload_len
+	add pdata,4,temp
+	storet 1,mem_mesh_upper_transport_layer_payload_len
+	arg mem_mesh_access_layer_payload,temp
+	branch ali_CCM_encrypt
+
+
+
+//累加SEQ的值
+ali_mesh_upper_transport_layer_send_access_message_calc_SEQ:
+	fetch 3,mem_mesh_send_message_SEQ
+	pincrease 1
+	store 3,mem_mesh_send_message_SEQ
+	fetch 1,mem_mesh_gatt_package_send_msg_id
+	pincrease 1
+	store 1,mem_mesh_gatt_package_send_msg_id
+	fetch 2,mem_mesh_cb_seq_changed
+	branch callback_func
+
+
+//存NID,TTL,SEQ,SRC,其中SEQ需要高低位交换
+ali_mesh_upper_transport_layer_send_access_message_add_NID_SRC_TTL_SEQ_DST:
+	fetch 1,mem_mesh_IV_Index+3
+	lshift4 pdata,pdata
+	lshift3 pdata,pdata
+	fetcht 1,mem_k2_NID
+	ior temp,pdata
+	store 1,mem_mesh_send_upper_layer_IVI_and_NID
+	fetch 1,mem_mesh_send_message_TTL
+	store 1,mem_mesh_send_upper_layer_CTL_and_TTL
+	fetch 2,mem_mesh_send_message_SRC
+	store 2,mem_mesh_send_upper_layer_SRC
+	fetch 2,mem_mesh_send_message_DST
+	store 2,mem_mesh_send_upper_layer_DST
+
+ali_mesh_upper_transport_layer_send_access_message_add_SEQ:
+	fetch 3,mem_mesh_send_message_SEQ
+	store 3,mem_mesh_send_upper_layer_SEQ
+	arg mem_mesh_send_upper_layer_SEQ,rega
+	arg 3,loopcnt
+	call inverse_data
+	fetch 8,mem_mesh_send_upper_layer_CTL_and_TTL
+	store 8,mem_mesh_message_TTL
+	rtn
+
+ali_mesh_upper_transport_layer_send_segmented_access_message_get_SeqZero_SegON:
+	fetch 1,mem_mesh_upper_transport_layer_payload_len
+	div pdata,SEGMENTED_ACCESS_MESSAGE_UNINT_PDU_LEN
+	call wait_div_end
+	quotient temp
+	remainder pdata
+	call ali_mesh_upper_transport_layer_send_segmented_access_message_sub_SegN_one,blank
+	storet 1,mem_mesh_segmented_lower_transport_layer_SegN
+	jam 0,mem_mesh_segmented_lower_transport_layer_SegO
+	fetch 3,mem_mesh_send_message_SEQ
+	arg 0x1fff,temp
+	iand temp,pdata
+	store 2,mem_mesh_segmented_lower_transport_layer_SegZero
+	rtn
+
+ali_mesh_upper_transport_layer_send_segmented_access_message_calc_header:
+	fetch 2,mem_mesh_segmented_lower_transport_layer_SegZero
+	lshift4 pdata,pdata
+	lshift pdata,pdata
+	fetcht 1,mem_mesh_segmented_lower_transport_layer_SegO
+	ior temp,pdata
+	lshift4 pdata,pdata
+	lshift pdata,pdata
+	fetcht 1,mem_mesh_segmented_lower_transport_layer_SegN
+	ior temp,pdata
+	store 3,mem_mesh_segmented_access_lower_transport_layer_SZMIC_SeqZero_SegO_SegN
+	arg 3,loopcnt
+	arg mem_mesh_segmented_access_lower_transport_layer_SZMIC_SeqZero_SegO_SegN,rega
+	branch inverse_data
+
+
+ali_mesh_upper_transport_layer_send_segmented_access_message_sub_SegN_one:
+	increase -1,temp
+	rtn
+
+ali_mesh_upper_transport_layer_clear_tx_buffer:
+	rtn
+
+
+ali_mesh_loggint_tx_info_upper_send_packet:
+	arg mem_mesh_access_layer_payload,rega
+	fetchr loopcnt,1,mem_mesh_access_layer_payload_len
+	arg MESH_UPPER_SEND_PACKET,regb
+	branch logging_tx_info
+
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/patch.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/patch.prog	(working copy)
@@ -0,0 +1,1922 @@
+
+
+	bbit1 8,pf_patch_ext
+	beq patch00_0,p_soft_reset
+	beq patch00_3,p_main_loop
+	beq patch10_3,p_set_sync_on
+	beq patch11_3,p_initialize_radio_cont	
+	beq patch13_7,p_init_param
+	beq patch15_6,p_app_init
+	beq patch16_0,p_app_evt_100ms_loop
+	beq patch18_3,p_mouse_start_work
+	beq patch18_7,p_mouse_app_enter_hibernate
+	beq patch19_1,p_mouse_setgpio_hibernate
+	beq patch19_2,p_mouse_lpm_before_common
+	beq patch19_4,p_mouse_adc_read_start
+	beq patch19_6,p_mouse_motion
+	beq patch19_7,p_mouse_dpi_process
+	beq patch1a_0,p_mouse_seting_dpi
+	beq patch1a_1,p_mouse_check_key_gpio
+	beq patch1a_4,p_mouse_sensor_poweron
+	beq patch1a_6,p_mouse_priority_bb_event
+	beq patch1b_1,p_mouse_bb_event_timer
+	beq patch1b_2,p_mouse_start_discovery
+	beq patch1b_6,p_mouse_idle
+	beq patch1d_0,p_hid_rx_process
+	branch loop
+
+pf_patch_ext:
+	beq patch26_3,p_adc_init_data
+	beq patch26_4,p_enable_adc
+	beq patch30_7,p_ui_timer_check		
+	beq patch34_1,p_le_slave_match
+	beq patch38_0,p_le_parse_l2cap
+	beq patch3b_5,p_g24_dispatch
+	beq patch3c_2,p_g24_pair_dispatch
+	beq patch3d_1,p_g24_reconn_dispatch
+	beq patch3d_2,p_g24_transmit_no_interrupt
+	beq patch3d_4,p_g24_lpm_wait
+	branch loop
+
+
+p_soft_reset:
+	clear_stack
+	call app_param_init
+	call mouse_xtal_init		// 16M / 24M
+	branch soft_reset+3
+
+/////////////////////////////////// adc//////////////////////////////////////
+p_main_loop:
+ifdef SIMPLE_PAIRING
+	call sp_calc_sequence
+endif
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256
+endif
+ifdef SIMPLE_PAIRING
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256_check
+endif
+endif
+	call le_advertising_dispatch+1
+	call idle_dispatch
+	call app_process_idle+1
+	call inquiry_dispatch+1
+	call inquiry_scan_dispatch+1
+	call page_scan_dispatch+1
+	call connection_dispatch+1
+	call g24_dispatch+2
+	call p_lpm_dispatch
+	branch main_loop
+	
+p_lpm_dispatch:
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	rtn blank
+	fetch 1,mem_lpm_mode
+	rtn blank
+	fetch 1,mem_ssp_enable
+	branch p_lpm_dispatch_next,blank
+	fetch 1,mem_sp_local_key_invalid	// simple pairing is not ready
+	rtn blank
+p_lpm_dispatch_next:
+	fetch 1,mem_sc_calc
+	nrtn blank	
+	branch lpm_dispatch_next+3
+
+p_set_sync_on:
+	jam 0x5,modem_en
+	nop 2
+	jam 0x0,modem_en					/* if called from tx or rx */
+	fetch 1,mem_fcomp_div
+	beq XTAL_24M,set_sync_on_24m
+p_set_sync_on_16m:
+	jam 0x29,core_syn_afc_cfg1
+	branch set_sync_on_16m	
+
+
+p_g24_load_ota_config_poweron:
+	call iicd_load_gpio_init
+	call p_g24_check_ota_data
+	branch p_g24_load_ota_config,user
+	rtn
+
+p_g24_load_ota_config:	
+	arg iicd_read_eep,regc
+	fetch 2,mem_g24_ota_config_addr
+	increase 3,pdata
+	byteswap pdata,pdata
+	store 2,mem_addr_mi
+	branch load_storage_loop
+	
+	
+p_adc_init_data:
+	arg mem_temp_block2,rega
+	arg 12,temp
+	setarg EFUSE_OFFSET_ADC_PARAM
+	call efuse_read_data
+	branch adc_init_data+6
+
+p_enable_adc:	
+	fetchr regb,1,core_rf_ldo_cfg6
+	jam 0x3d,core_rf_ldo_cfg6
+	jam 0xaa,core_rf_ldo_cfg5
+	jam 0x0c,core_rf_ldo_en0
+	fetch 1,core_clkpll_cfg6
+	set1 7,pdata
+	store 1,core_clkpll_cfg6
+	jam 0x04,core_rf_ldo_en1
+	nop 60
+	jam 0,core_syn_en
+	jam 6,core_rx_en0
+	call read_adc_mode
+	store 1,core_gpadc_ctrl
+//	jam 0x07,core_gpadc_ctrl
+	jam 0x03,core_sum_ctrl
+	nop 60
+	fetch 1,core_sum_en
+	set1 7,pdata
+	store 1,core_sum_en
+	nop 1000
+	fetch 2,core_adc_sum
+	store 2,mem_adc_current_value
+	fetch 1,core_sum_en
+	set0 7,pdata
+	store 1,core_sum_en
+	jam 0,core_gpadc_ctrl
+	
+	storer regb,1,core_rf_ldo_cfg6
+	rtn
+
+
+p_mouse_adc_read_start:
+	fetch 1,mem_24g_device_led_status
+	nrtn blank
+	call p_enable_adc
+	jam 0,mem_adc_read_timer
+	call vdd_calculate_by_mode
+	store 2,mem_mouse_vdd_now_vol
+	call p_mouse_voltage_alarm_led
+	branch mouse_adc_read_start+6
+	
+p_mouse_voltage_alarm_led:
+	fetch 2,mem_mouse_vdd_now_vol
+	fetcht 2,mem_mouse_vdd_full_compare_vol
+	isub temp,positive		//now-compare
+	branch p_mouse_voltage_alarm_led_all_on,positive	
+	fetcht 2,mem_mouse_vdd_empty_vol
+	isub temp,positive		//now-empty
+	branch p_mouse_voltage_alarm_led2_on_led1_off,positive
+	branch p_mouse_voltage_alarm_led_all_off
+		
+p_mouse_voltage_alarm_led2_on_led1_off:
+	call p_mouse_voltage_alarm_led2_on
+	branch p_mouse_voltage_alarm_led1_off
+
+p_mouse_voltage_alarm_led_all_off:
+p_mouse_voltage_alarm_led2_off:
+	fetcht 1,mem_voltage_alarm_led2
+	call gpio_out_inactive
+p_mouse_voltage_alarm_led1_off:
+	fetcht 1,mem_voltage_alarm_led1
+	branch gpio_out_inactive
+
+p_mouse_voltage_alarm_led_all_on:
+p_mouse_voltage_alarm_led1_on:
+	fetcht 1,mem_voltage_alarm_led1
+	call gpio_out_active
+p_mouse_voltage_alarm_led2_on:
+	fetcht 1,mem_voltage_alarm_led2
+	branch gpio_out_active
+
+p_app_evt_100ms_loop:
+	fetch 1,mem_app_evt_timer_count
+	rtn blank
+	increase -1,pdata
+	store 1,mem_app_evt_timer_count
+	call ui_button_polling
+	call app_lpm_wake_auto_lock_timer
+	call app_unsniff_delay_timer
+	call app_discovery_timer
+	call flash_write_spi_sm_timer
+ifdef SPI2	
+	call flash_write_spi2_sm_timer
+endif	
+//	call adc_wait_timer
+	fetch 2,mem_cb_event_timer
+	call callback_func
+	branch p_app_evt_100ms_loop
+
+/////////////////////////////////// adc//////////////////////////////////////
+
+
+p_initialize_radio_cont:
+
+	jam 0xe6,core_syn_aac_cfg1
+
+	call initialize_syn_afc_cfg1
+	call initialize_rf_ldo_cfg1
+	call initialize_rc_cal
+
+	jam 0x09,core_rx_bq_cfg0
+
+	jam 5,core_clkpll_cfg0
+	jam 0x94,core_rx_iqadc_cfg
+
+	jam 0x0b,core_rf_ldo_cfg2
+	jam 0x05,core_rf_ldo_cfg3
+	jam 0x90,core_syn_pfd_lkd_cfg
+
+	jam 0x00,core_syn_loopdiv_dsm_cfg
+	jam 0x40,core_rx_ctrl1
+
+	branch initialize_radio_cont+8
+
+
+
+p_init_param:
+	jam 0,mem_lmo_tid2			// classic can't reconnect
+	branch init_param_next+1
+
+/////////////////////////////////// g24 250Hz use lpm//////////////////////////////////////
+p_app_init:
+p_mouse_init:
+	ncall p_g24_load_ota_config_poweron,wake
+	ncall p_mouse_le_name_load,wake
+	call enable_authrom
+	call p_mouse_setting_config
+	call mouse_init_sunt
+	rtn wake
+	call mouse_dpi_config
+	call mouse_usb_check_enable
+	call mouse_drawing_optima_init
+	call p_mouse_cb_fuction
+	call p_mouse_sensor_powerdown
+	branch mouse_init+8
+
+p_mouse_le_name_load:
+	fetch 8,mem_le_name_patch
+	rtn blank
+
+	fetch 1,mem_le_name_patch_len
+	copy pdata,rega
+	sub pdata,11,null
+	nbranch p_mouse_le_name_patch_len_overflow,positive
+
+	arg mem_le_name_patch,contr	
+	arg mem_le_adv_swift_pair+9,contw
+	copy rega,loopcnt
+	call memcpy
+	
+	arg mem_le_name_patch,contr
+	arg mem_le_scan_data+2,contw
+	copy rega,loopcnt
+	call memcpy
+	
+	arg mem_le_name_patch,contr
+	arg mem_le_name,contw
+	copy rega,loopcnt
+	branch memcpy
+
+p_mouse_le_name_patch_len_overflow:
+	call p_mouse_le_swift_pair_disable
+	fetch 1,mem_le_name_patch_len
+	increase 1,pdata
+	store 1,mem_le_adv_swift_pair
+	jam 9,mem_le_adv_swift_pair+1
+	arg mem_le_name_patch,contr
+	arg mem_le_adv_swift_pair+2,contw
+	copy rega,loopcnt
+	call memcpy
+
+	fetch 1,mem_le_name_patch_len
+	increase 1,pdata
+	store 1,mem_le_scan_data
+	jam 9,mem_le_scan_data+1
+	arg mem_le_name_patch,contr
+	arg mem_le_scan_data+2,contw
+	copy rega,loopcnt
+	call memcpy
+
+	arg mem_le_name_patch_len,contr
+	arg mem_le_name_len,contw
+	copy rega,loopcnt
+	increase 1,loopcnt
+	branch memcpy
+	
+p_mouse_le_swift_pair_disable:
+	arg mem_le_adv_swift_pair,contw
+	arg 20,loopcnt
+	branch clear_mem
+
+p_mouse_setting_config:
+	rtn wake
+	call g24_transmit_init
+	call g24_chmap_param_init
+	call mouse_gpio_init
+	call mouse_param_init
+	call p_g24_short_sleep_set_8ms
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_24G_250Hz,mouse_setting_config_next
+	call p_g24_short_sleep_set_4ms
+	branch mouse_setting_config_next
+
+p_g24_short_sleep_set_8ms:
+	setarg 58000
+	store 3,mem_24g_short_sleep_set
+	rtn
+p_g24_short_sleep_set_4ms:
+	setarg 6000
+	store 3,mem_24g_short_sleep_set
+	rtn
+
+p_mouse_cb_fuction:
+	setarg p_mouse_24g_package_data
+	store 2,mem_cb_24g_transmit_data
+	setarg p_mouse_24g_search_dongle
+	store 2,mem_cb_24g_search_receiver
+	branch mouse_cb_fuction+4
+
+p_mouse_24g_package_data:		// 250Hz
+	rtnmark0 mark_24g
+	fetch 1,mem_g24_ota_mode
+	nbranch p_mouse_24g_package_ota,blank
+	call mouse_motion
+	nrtn user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_KEYBOARD,p_mouse_24g_mouse_package_data
+	fetch 1,mem_customer_key
+	nbranch mouse_24g_keyboard_package_data,blank
+p_mouse_24g_mouse_package_data:
+	call mouse_data_xy_release
+	fetch 1,mem_24g_data_type
+	bbit1 1,p_mouse_24g_mouse_package_data_now	// last package is keyboard data
+	fetcht 1,mem_24g_txbuf+1
+	fetch 1,mem_mouse_key
+	ior temp,pdata
+	store 1,mem_mouse_key
+	fetcht 1,mem_24g_txbuf+6
+	fetch 1,mem_mouse_z
+	iadd temp,pdata
+	store 1,mem_mouse_z
+	fetcht 1,mem_24g_txbuf+7
+	fetch 1,mem_mouse_tz
+	iadd temp,pdata
+	store 1,mem_mouse_tz	
+p_mouse_24g_mouse_package_data_now:	
+	jam TYPE_MS,mem_24g_data_type
+	arg 7,rega	//length
+	arg mem_mouse_key,regb //tx buff
+	branch g24_transmit_by_interrupt_enable
+
+p_mouse_24g_search_dongle:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_24G_SEARCH_DONGLE
+	fetch 1,mem_mouse_long_mult_flag
+	rtn blank
+	fetch 1,mem_24g_abort_pac
+	rtn blank
+	fetch 1,mem_mouse_search_dongle_interval
+	increase 1,pdata
+	and_into 3,pdata
+	store 1,mem_mouse_search_dongle_interval
+	nrtn blank	//400ms
+	jam 0,mem_mouse_search_dongle_ch
+p_mouse_24g_search_dongle_loop:
+	fetch 1,mem_mouse_search_dongle_ch
+	increase 1,pdata
+	store 1,mem_mouse_search_dongle_ch
+	sub pdata,G24_CH_NUMBER,null
+	nbranch p_mouse_24g_search_dongle_loop_end,positive
+	call g24_reconn_data_prep
+	call g24_transmit_receive_ack
+	nbranch p_mouse_24g_search_dongle_loop_retry,sync
+	nbranch p_mouse_24g_search_dongle_loop_retry,user3
+	call mouse_24g_search_dongle_success
+p_mouse_24g_search_dongle_loop_end:
+	call g24_txbuf_clear
+	fetch 1,mem_mouse_search_dongle_count
+	increase 1,pdata
+	store 1,mem_mouse_search_dongle_count
+	beq G24_CH_POLL_COUNT,p_mouse_24g_search_dongle_check
+	rtn	
+
+p_mouse_24g_search_dongle_loop_retry:
+	call g24_ch
+	branch p_mouse_24g_search_dongle_loop
+
+p_mouse_24g_search_dongle_check:
+	jam 0,mem_mouse_search_dongle_count
+	fetch 1,mem_mouse_search_dongle_action
+	rtnbit1 G24_DISCONN_STATE
+	set1 G24_DISCONN_STATE,pdata
+	store 1,mem_mouse_search_dongle_action
+	fetch 2,mem_mouse_24g_search_dongle_time_init		
+	store 2,mem_mouse_no_data_timer
+	branch p_mouse_sensor_powerdown
+
+p_g24_transmit_no_interrupt:
+	call g24_txdata_prep
+	nbranch p_g24_nodata_transmit,user
+p_g24_transmit_start:
+	call p_g24_transmit_process
+	call power_ctrl_start
+	fetch 1,mem_sensor_shutdown_flag
+	nbranch p_g24_short_sleep,blank
+	fetch 8,mem_24g_long_sleep_set
+	store 8,mem_24g_enter_hibernate
+	fetch 2,mem_24g_long_sleep_param_update_timer_init
+	store 2,mem_24g_long_sleep_param_update_timer
+p_g24_short_sleep:
+	call g24_lpm_wait
+	nrtn user
+	call clear_wake
+	fetch 3,mem_24g_short_sleep_set
+	branch g24_long_sleep2
+
+p_g24_transmit_process:
+	jam 0,mem_24g_retry
+p_g24_transmit_loop:
+	fetchr timeup,2,mem_param_rx_setup
+	until clkn_rt,meet
+	call g24_transmit_receive_ack
+	fetch 1,mem_24g_no_ack	//tx noack
+	beq no_ack_24g,g24_transmit_no_ack
+	nbranch p_g24_retransmit,sync
+	nbranch p_g24_retransmit,user3
+	call g24_ackpayload_parse
+	call p_g24_mouse_parse_rx
+	call p_mouse_wakeup_24g
+	branch g24_transmit_no_ack
+
+p_mouse_wakeup_24g:
+	fetch 1,mem_sensor_shutdown_flag
+	ncall p_mouse_wakeup_24g_from_long_sleep,blank
+	jam 0,mem_sensor_shutdown_flag
+	rtn	
+	
+p_mouse_wakeup_24g_from_long_sleep:
+	call mouse_init_sensor_wakeup
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL
+p_mouse_wheel_set_wakeup:
+	fetch 1,mem_whee_a_data_gpio
+	arg gpcfg_pullup,temp
+ 	call gpio_config_function_int
+	fetch 1,mem_whee_b_data_gpio
+	arg gpcfg_pullup,temp
+ 	branch gpio_config_function_int
+
+p_g24_retransmit:	
+	fetch 1,mem_24g_abort_pac
+	nrtn blank
+	fetch 2,mem_24g_txfail_cnt
+	increase 1,pdata
+	store 2,mem_24g_txfail_cnt	
+	fetch 1,mem_24g_txfail_cnt+1
+	bbit1 1,g24_tx_attempt_fail
+	call g24_transmit_hop_process
+	call p_delay_40ms
+	branch p_g24_transmit_loop
+
+p_delay_40ms:
+	fetch 1,mem_24g_txfail_cnt+1
+	sub pdata,0x00,null
+	rtn positive
+	arg 40,loopcnt
+	branch delay_ms_wait
+		
+/////////////////////////////////// g24 250Hz use lpm//////////////////////////////////////
+	
+p_mouse_app_enter_hibernate:	// 1.3mA hibernate after sensroe reset
+	setarg PAN_REG_CONFIG
+	call twspi_read
+	bbit1 3,mouse_app_enter_hibernate+3
+	call p_mouse_sensor_reset
+	call p_mouse_sensor_powerdown
+	branch mouse_app_enter_hibernate+3
+
+p_mouse_setgpio_hibernate:
+	call mouse_set_sdio_high
+	call clear_wake
+	call p_mouse_logo_led_off
+	call mouse_before_hibernate_wheel_gpio_set
+	fetcht 1,mem_matrix_public_gpio		// enable b4/b5/dpi wakeup
+	call gpio_out_active
+	fetcht 1,mem_matrix_public_gpio
+	call gpio_clr_wake
+	fetch 1,mem_mouse_sensor_sdio_gpio
+	arg gpcfg_output_high,temp
+	call gpio_config_function_int
+	arg 3,temp
+	call mouse_gpio_config_input_pu
+	call mouse_lpm_before_common
+	call gpio_pd_idle
+	arg 19,temp
+	call mouse_gpio_config_input_pu
+	call p_mouse_gpio_set_high_impedance
+	call p_mouse_adc_gpio_set_before_hibernate
+	branch p_mouse_wheel_gpio_set_before_hibernate
+	
+p_mouse_gpio_set_high_impedance:
+	fetch 3,mem_mouse_set_high_impedance_bit_set
+	store 3,mem_pdatatemp
+	arg 20,loopcnt
+	arg 0,temp
+p_mouse_gpio_set_high_impedance_bit_loop:	
+	fetch 3,mem_pdatatemp
+	isolate1 0,pdata
+	call gpio_set_high_impedance,true
+	fetch 3,mem_pdatatemp
+	rshift pdata,pdata
+	store 3,mem_pdatatemp
+	increase 1,temp
+	loop p_mouse_gpio_set_high_impedance_bit_loop
+	rtn
+
+p_mouse_adc_gpio_set_before_hibernate:	
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_ADC
+	fetch 1,mem_adc_config_flag_init
+	rtnne ADC_CONFIG_GPIO
+	fetch 1,mem_adc_channel_gpio	
+	arg gpcfg_no_ie,temp
+ 	branch gpio_config_function_int
+
+p_mouse_wheel_gpio_set_before_hibernate:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL
+p_mouse_wheel_clr_wakeup:
+	fetcht 1,mem_whee_a_data_gpio
+	call gpio_clr_wake
+	fetcht 1,mem_whee_b_data_gpio
+	call gpio_clr_wake
+		
+	fetch 1,mem_whee_a_data_gpio
+	arg gpcfg_pulldown,temp
+	call gpio_config_function_int
+	fetch 1,mem_whee_b_data_gpio
+	arg gpcfg_pulldown,temp
+	branch gpio_config_function_int
+
+p_mouse_lpm_before_common:
+	fetcht 1,mem_whee_a_data_gpio		//reinit gpio pu after disable wheel wakeup
+	call gpio_config_input
+	fetcht 1,mem_whee_b_data_gpio
+	call gpio_config_input
+	
+	call mouse_wheel_check
+	fetch 1,mem_mouse_sensor_sclk_gpio	// set sclk high
+	arg gpcfg_output_high,temp
+ 	call gpio_config_function_int
+	branch mouse_lpm_before_common_next
+
+p_mouse_24g_hibernate_set:
+	jam 0,mem_24g_attempt_fail_flag
+	call g24_transmit_next_packet
+	setarg -1
+	store 4,mem_24g_enter_hibernate
+	setarg 0
+	store 7,mem_mouse_key
+	jam 1,mem_sensor_shutdown_flag
+	call p_mouse_sensor_powerdown
+	branch p_g24_long_sleep
+
+p_g24_nodata_transmit:
+	fetch 1,mem_24g_abort_pac
+	call p_g24_send_abort_packet,blank
+	fetch 1,mem_24g_transmit_by_interrupt
+	rtneq G24_TX_TIMER_INT_ENABLE
+	call g24_search_receiver
+p_g24_long_sleep:
+	call g24_lpm_wait
+	nrtn user
+	fetch 1,mem_sensor_shutdown_flag
+	ncall mouse_setgpio_hibernate,blank
+	fetch 4,mem_24g_enter_hibernate
+	branch g24_long_sleep2
+
+p_g24_send_abort_packet:
+	jam TYPE_MS,mem_24g_data_type
+	jam 1,mem_24g_abort_pac
+	call g24_transmit_rf_ctrl_clear
+	store 1,mem_24g_txbuf
+	setarg 0
+	store 7,mem_24g_txbuf+1
+	fetch 4,mem_24g_device_addr
+	store 4,mem_24g_txbuf+8
+	jam 12,mem_24g_datalen
+	fetch 1,mem_24g_data_type
+	set1 bit_abort,pdata
+	store 1,mem_24g_data_type
+	call g24_transmit_prep
+	branch p_g24_transmit_start
+	
+p_mouse_priority_bb_event:
+	copy regc,pdata
+	beq BT_EVT_BB_CONNECTED,p_mouse_bb_event_connected
+	beq BT_EVT_24G_ATTEMPT_SUCCESS,p_mouse_24g_attempt_success
+	beq BT_EVT_24G_PAIRING_COMPLETE,p_mouse_24g_pairing_complete
+	beq BT_EVT_24G_ATTEMPT_FAIL,p_mouse_24g_attempt_fail
+	beq BT_EVT_LE_START_ENC,p_mouse_le_ll_start_encryt
+	beq BT_EVT_LE_PARSE_CONN_PARAM_ACCEPTED,p_mouse_le_parse_conn_param_accepted
+	beq BT_EVT_LE_DISCONNECTED,p_mouse_le_bb_disconnected
+	beq BT_EVT_LE_CONNECTED,p_mouse_le_bb_event_connected
+	branch mouse_priority_bb_event+2
+
+p_mouse_bb_event_connected:
+	call p_mouse_logo_led_blink_disable
+	call mouse_no_data_timer_init
+	branch mouse_bb_event_connected
+	
+p_mouse_le_bb_event_connected:
+	call p_mouse_logo_led_blink_disable
+	branch mouse_le_bb_event_connected
+
+p_mouse_le_bb_disconnected:
+	setarg 0
+	store 2,mem_le_battery_level_updata_timer
+	jam 0,mem_mouse_le_bb_connected_flag
+	setarg LE_INTERVAL_7_5MS
+	store 2,mem_le_interval_min
+	store 2,mem_le_interval_min+2
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_BT_125Hz,mouse_le_bb_disconnected_next+2
+	setarg LE_INTERVAL_8_75MS
+	branch mouse_le_bb_disconnected_next
+
+p_mouse_le_ll_start_encryt:
+	fetch 1,mem_mouse_le_reconnect_flag
+	beq 1,p_mouse_le_ll_reconn_start_encryt
+	jam 20,mem_le_start_encrypt_timer
+	branch mouse_le_ll_enable_start_enc_flag
+p_mouse_le_ll_reconn_start_encryt:
+	call mouse_updata_le_param
+	jam 5,mem_le_start_encrypt_timer
+	branch mouse_le_ll_enable_start_enc_flag
+
+p_mouse_le_parse_conn_param_accepted:
+	fetch 1,mem_le_new_conninterval
+	sub pdata,LE_INTERVAL_15MS,null
+	nbranch mouse_le_conn_param_lpm_disable,positive
+	store 2,mem_le_interval_min
+	store 2,mem_le_interval_min+2
+	fetch 1,mem_le_new_connslavelatency
+	branch mouse_le_lpm_mult_reinit,blank
+	fetcht 1,mem_lpm_mult_init
+	isub temp,null
+	branch mouse_le_lpm_mult_reinit,positive
+	fetch 1,mem_le_new_connslavelatency
+	store 1,mem_lpm_mult_init						// mouse_le_lpm_mult_reinit function will reinit mem_lpm_mult
+	branch mouse_le_conn_param_lpm_enable
+
+
+p_mouse_24g_pairing_complete:
+	call p_mouse_logo_led_blink_disable
+	call mouse_no_data_timer_init
+	branch mouse_24g_pairing_complete
+
+p_mouse_24g_attempt_success:
+	fetch 4,mem_24g_addr
+	store 4,mem_24g_receiver_addr
+	store 4,mem_mouse_24g_addr		// if need store 24g address to eeprom/flash,need get mem_24g_addr
+	call g24_ch_syncword_crc8_init
+	call mouse_device_poweron_timer_init
+	call mouse_no_data_timer_init
+	branch mouse_24g_attempt_success
+
+
+p_mouse_24g_attempt_fail:
+	fetch 1,mem_24g_attempt_fail_flag
+	nbranch p_mouse_24g_hibernate_set,blank
+	fetch 1,mem_24g_reconn_type
+	beq FAST_CONN_AND_3_0_ADDR,p_mouse_24g_fast_conn_attempt_fail
+	beq PAIR_AND_3_0_ADDR,p_mouse_24g_auto_pair_attempt_fail
+	beq RECEIVER_AND_3_0_ADDR,p_mouse_reconn_dongle_attempt_fail
+	branch mouse_24g_attempt_fail_enter_hibernate
+
+p_mouse_24g_fast_conn_attempt_fail:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag 
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_24g_start_auto_pair
+	bbit1 MOUSE_ENABLE_AUTO_24G_PARING,mouse_24g_start_auto_pair
+	bbit0 MOUSE_ENABLE_24G_AUTO_PAIR_NERVER_BEEN_PAIRED,mouse_24g_reconn_dongle_start
+	fetch 4,mem_mouse_24g_addr		// auto pair first time
+	fetcht 4,mem_mouse_compare_addr_ff
+	isub temp,null
+	branch p_mouse_24g_start_pair_mode,zero
+	branch mouse_24g_reconn_dongle_start
+
+p_mouse_24g_start_pair_mode:
+	jam 0,mem_24g_reconn_type
+	branch mouse_24g_start_pair_mode
+
+p_mouse_24g_auto_pair_attempt_fail:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag 
+	bbit0 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,p_mouse_24g_attempt_fail_enter_hibernate
+	fetch 1,mem_device_number
+	beq 1,p_mouse_24g_attempt_fail_enter_hibernate		//24g first mode and only 2.4g device
+	branch mouse_24g_first_bluetooth_reconnect
+
+p_mouse_reconn_dongle_attempt_fail:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,p_mouse_24g_attempt_fail_enter_hibernate
+	bbit1 MOUSE_ENABLE_EEPROM,p_mouse_24g_attempt_fail_enter_hibernate
+	bbit1 MOUSE_ENABLE_FLASH,p_mouse_24g_attempt_fail_enter_hibernate
+	branch mouse_24g_start_auto_pair+1
+
+p_mouse_24g_attempt_fail_enter_hibernate:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL,mouse_24g_attempt_fail_enter_hibernate
+	branch p_mouse_24g_hibernate_set
+	
+p_g24_pair_dispatch:
+	jam DEFAULT_24G_DEVICE,mem_24g_reconn_type
+	fetch 2,mem_24g_pair_count
+	increase 1,pdata
+	store 2,mem_24g_pair_count
+	fetch 1,mem_24g_pair_count
+	and pdata,0xff,pdata
+	beq 0,g24_pair_dispatch+1
+	rtn
+
+p_g24_reconn_dispatch:
+	fetch 2,mem_24g_reconn_count
+	arg 0x01f8,temp
+	iand temp,pdata
+	branch p_g24_reconn_dispatch_next,blank
+	fetch 2,mem_24g_reconn_count
+	increase 1,pdata
+	store 2,mem_24g_reconn_count
+	rtn
+p_g24_reconn_dispatch_next:
+	call g24_reconn_data_prep
+	call g24_transmit_receive_ack
+	nbranch p_g24_reconn_device_fail,sync
+	nbranch p_g24_reconn_device_fail,user3
+	call g24_ackpayload_parse
+	branch g24_reconn_receiver_succ
+	
+p_g24_reconn_device_fail:
+	fetch 1,mem_24g_fast_conn_enable
+	branch g24_ch,blank
+	fetch 2,mem_24g_reconn_count
+	increase 1,pdata
+	store 2,mem_24g_reconn_count
+	fetch 1,mem_24g_reconn_count+1
+	isolate1 1,pdata	// each 8 times switch
+	fetch 1,mem_24g_reconn_type
+	beq FAST_CONN_AND_RECEIVER,g24_reconn_fast_conn_and_receiver
+	beq FAST_CONN_AND_3_0_ADDR,g24_reconn_fast_conn_and_3_0
+	beq RECEIVER_AND_3_0_ADDR,g24_reconn_receiver_and_3_0
+	beq PAIR_AND_3_0_ADDR,p_g24_reconn_pair_and_3_0
+	branch g24_reconn_receiver_addr
+
+p_g24_reconn_pair_and_3_0:
+	branch g24_reconn_device_3_0_addr,true
+	branch g24_pair_init_param
+
+p_g24_dispatch:
+	rtnmark1 mark_adc_enable
+	bmark1 mark_24g_rxmode,g24_receive_dispatch
+p_g24_transmit_dispatch:
+	rtnmark0 mark_24g
+	fetch 1,mem_24g_conn_sm
+	bbit1 STATE_24G_OTA,p_g24_ota_dispatch
+	bbit1 STATE_24G_PAIR,g24_pair_dispatch
+	bbit1 STATE_24G_RECONN,g24_reconn_dispatch
+	fetch 1,mem_24g_transmit_by_interrupt
+	beq G24_TX_TIMER_INT_ENABLE,p_g24_transmit_by_interrupt
+	branch g24_transmit_no_interrupt
+
+p_g24_transmit_by_interrupt:
+	call g24_timer_check
+	nbranch p_g24_transmit_dispatch,user
+	call g24_interval_calibrate
+	fetch 2,mem_24g_transmit_by_interrupt_exit_count
+	increase 1,pdata
+	store 2,mem_24g_transmit_by_interrupt_exit_count
+	branch g24_transmit_no_interrupt
+
+p_mouse_start_work:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_24g_first_start_auto_pair_mode
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,p_mouse_24g_start_mode
+	branch mouse_start_work+5
+
+p_mouse_24g_start_mode:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_24G,mouse_24g_mode_setup_error
+	call mouse_wakeup_from_power_check	// wake from hibernate :enble user
+	branch mouse_24g_reconn_dongle_start,user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_AUTO_24G_PARING,mouse_24g_reconn_general_dongle
+	bbit0 MOUSE_ENABLE_24G_POWER_ON_PAIRING,mouse_24g_reconn_general_dongle
+	call mouse_key_check_once		// pdata output:00
+	and rega,0x07,pdata
+	branch mouse_24g_start_mode+9
+
+///////////////////dpi led adjust////////////////////////////////////////////////////////////////////
+p_mouse_seting_dpi:
+	call mouse_setting_dpi_4_level
+	call p_mouse_dpi_led_blink_delay
+	branch mouse_seting_sensor_type
+
+p_mouse_dpi_led_blink_delay:
+	fetch 1,mem_dpi_led_gpio
+	rtneq GPIO_DISABLE
+	fetch 2,mem_mouse_discovery_timer
+	nrtn blank
+	fetch 2,mem_24g_pair_timeout
+	nrtn blank
+	fetch 2,mem_24g_reconn_timeout
+	nrtn blank
+	fetch 1,mem_mouse_device_poweron_timer_count
+	nrtn blank
+	fetch 1,mem_mouse_dpi_led_delay_count_init
+	branch p_mouse_dpi_led_blink_init,blank
+	store 1,mem_mouse_dpi_led_delay_count  //delay 1s led blink
+	rtn
+
+
+p_mouse_bb_event_timer:
+	call mouse_adc_read
+	call mouse_low_voltage_led_timer
+	//24g
+	call g24_pair_timeout_timer
+	call g24_reconn_timeout_timer
+	call mouse_24g_long_sleep_param_update_timer
+	//led
+	call mouse_device_poweron_timer
+	call p_mouse_dpi_led_blink_delay_timer
+
+	call mouse_dpi_key_check_long_press
+	call mouse_bt_discovery_check
+	call p_mouse_commbination_key_process
+	call mouse_check_discovery_timeout_timer
+	//ble
+	call mouse_check_direct_timeout_timer
+	call mouse_le_enable_att_list_timer
+	call p_mouse_le_battery_updata_timer
+	call mouse_le_send_smp_security_request_timer
+	//bt
+	call mouse_check_hid_handshake_timer
+	call mouse_bt_check_sniff_req_timeout_timer
+	call mouse_check_reconnect_delay_long_sleep		//delete 3.0,reconnect fail
+	call mouse_current_mult_update_timer
+	call mouse_wheel_trigger_timer
+	call mouse_store_information_delay_timer
+	call p_mouse_logo_led_on_timer
+	call p_mouse_logo_blink
+	call p_mouse_check_no_data_timeout_timer
+	branch p_mouse_g24_ota_reset_timer
+	
+p_mouse_g24_ota_reset_timer:
+	arg mem_g24_ota_reset_timer,regc
+	arg soft_reset_chip,regb
+	branch timer_single_step
+	
+p_mouse_logo_led_blink_enable:
+	jam 5,mem_mouse_logo_led_blink_timer	//500ms on,500ms off
+	jam ON,mem_mouse_logo_led_blink_flag	//enable flag 
+	rtn
+p_mouse_logo_led_blink_disable:
+	jam 0,mem_mouse_logo_led_blink_timer	
+	jam OFF,mem_mouse_logo_led_blink_flag	
+	rtn
+
+p_mouse_logo_blink:
+	fetch 1,mem_mouse_logo_led_blink_flag
+	rtn blank
+p_mouse_logo_led_blink_start:
+	arg mem_mouse_logo_led_blink_timer,regc
+	arg p_mouse_logo_led_blink_timeout,regb
+	branch timer_single_step
+
+p_mouse_logo_led_blink_timeout:
+	jam 5,mem_mouse_logo_led_blink_timer	//500ms on,500ms off
+	fetch 1,mem_mouse_logo_led_state
+	beq ON,p_mouse_logo_led_off
+	branch p_mouse_logo_led_on
+
+p_mouse_logo_led_on_timer:
+	fetch 1,mem_mouse_logo_led_gpio
+	rtneq GPIO_DISABLE
+	fetch 2,mem_mouse_no_data_timer
+	rtn blank
+	fetch 2,mem_mouse_no_data_timeout
+	fetcht 2,mem_mouse_no_data_timer
+	isub temp,temp
+	fetch 2,mem_mouse_logo_led_on_time_init
+	isub temp,pdata
+	branch p_mouse_logo_led_on,positive
+p_mouse_logo_led_off:
+	jam OFF,mem_mouse_logo_led_state
+	fetcht 1,mem_mouse_logo_led_gpio
+	branch gpio_out_inactive
+
+p_mouse_logo_led_on:
+	jam ON,mem_mouse_logo_led_state
+	fetcht 1,mem_mouse_logo_led_gpio
+	call gpio_out_active
+
+p_mouse_dpi_led_blink_delay_timer:
+	arg mem_mouse_dpi_led_delay_count,regc
+	arg p_mouse_dpi_led_blink_init,regb
+	branch timer_single_step	
+	
+p_mouse_dpi_led_blink_init:	//result:    level3: 2  3  1     level4: 3  4  1  2
+	fetch 1,mem_config_sensor_type
+	beq P3212,mouse_dpi_led_blink_init		//result:    level3: 1  2  3     level4: 2  3  4  1
+	beq KA8G2,mouse_dpi_led_blink_init	//result:    level3: 1  2  3     level4: 2  3  4  1
+	fetch 1,mem_dpi_led_gpio
+	store 1,mem_mouse_struct_led_gpio
+	fetch 2,mem_mouse_dpi_led_blink_time
+	store 2,mem_mouse_on_time
+	store 2,mem_mouse_off_time
+	arg 0,rega
+	fetcht 1,mem_mouse_dpi
+	increase 2,temp	// 2 3 4 (5)
+	sub temp,3,null
+	call p_mouse_dpi_led_blink_init_level_4,positive
+	ncall p_mouse_dpi_led_blink_count_clean,positive
+	branch mouse_dpi_led_blink_init_end
+
+p_mouse_dpi_led_blink_init_level_4:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_DPI_LEVEL_4
+	increase 1,temp  	// 2-->3   3-->4
+	rtn
+
+p_mouse_dpi_led_blink_count_clean:
+	increase -3,temp		// 4-->1  5-->2
+	rtn
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+p_mouse_commbination_key_process:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,p_mouse_24g_commbination_key_process
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_COMMBINATION_KEY_BY_BT_DISCOVERY
+	fetcht 1,mem_mouse_commbination_key_bt
+	branch p_mouse_commbination_key_start
+
+p_mouse_24g_commbination_key_process:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_COMMBINATION_KEY_BY_24G_PAIRING
+	fetcht 1,mem_mouse_commbination_key_24g
+p_mouse_commbination_key_start:
+	storet 1,mem_mouse_commbination_key
+	call mouse_check_key_gpio
+	and pdata,0x07,pdata
+	fetcht 1,mem_mouse_commbination_key
+	isub temp,null
+	branch p_mouse_commbination_key_down,zero
+	branch mouse_commbination_key_up
+
+		
+p_mouse_commbination_key_down:		// enter hibernate when reconnect
+	call p_mouse_combination_ui_timer
+	fetch 1,mem_commbination_key_statue
+	rtneq COMMBINATION_KEY_STATE_DOWN
+	jam COMMBINATION_KEY_STATE_DOWN,mem_commbination_key_statue
+	rtn
+
+p_mouse_combination_ui_timer:
+	arg p_mouse_24g_start_pair_mode,regb
+	branch mouse_combination_ui_timer+1
+
+p_mouse_le_battery_updata_timer:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_LE_BATTERY_SERVICE_CANCEL
+	branch mouse_le_battery_updata_timer
+
+
+p_mouse_check_no_data_timeout_timer:
+	fetch 1,mem_usb_addr
+	rtnbit1 7
+	arg mem_mouse_no_data_timer,regc
+	arg p_mouse_check_no_data_timeout,regb
+	branch timer_single_step_2B
+
+p_mouse_check_no_data_timeout:
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,p_mouse_24g_hibernate_set
+	branch mouse_disconnect	
+
+p_mouse_start_discovery:
+	fetch 2,mem_ui_state_map
+	isolate1 UI_STATE_BLE_ADV,pdata
+	call mouse_stop_le_adv,true		//reconnect adv
+	fetch 2,mem_ui_state_map
+	isolate1 UI_STATE_BT_RECONNECT,pdata
+	call mouse_cancel_reconnect,true
+	setarg 0
+	store 2,mem_le_battery_level_updata_timer
+	call p_mouse_logo_led_blink_enable
+	branch mouse_start_discovery+1
+
+
+p_ui_timer_check:		// 100ms timer will return 4 or 5 times when power on
+	fetch 1,mem_power_on_flag
+	ncall ui_timer_init,blank
+	jam 0,mem_power_on_flag
+	branch ui_timer_check+1
+
+p_hid_rx_process:
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	ifetch 1,contr
+	store 1,mem_l2cap_rcv_hidtype
+	and pdata,0x0f,temp
+	rshift4 pdata,pdata //hidtype
+	beq hid_type_set_idle,p_hid_rx_process_handshake
+	branch hid_rx_process+7
+
+p_hid_rx_process_handshake:
+	arg 1,rega//payload length
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_ctrl_remote_cid
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	jam 1,mem_ui_data_txbuff_length
+	fetch 1,mem_hid_control_state
+	set1 l2cap_channel_hid_handshake_done,pdata
+	store 1,mem_hid_control_state
+	jam BT_EVT_HID_HANDSHAKE,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+p_le_slave_match:
+	fetch 1,mem_le_md_count
+	pincrease 1
+	store 1,mem_le_md_count
+	beq LE_MD_MAX_COUNT,le_slave_cont
+	call le_acknowledge
+	call le_prepare_tx
+	fetch 1,mem_le_tx_phy
+	call le_enable_phy_by_pdata
+	call le_transmit
+	branch le_slave_match+10
+
+p_le_parse_l2cap:
+	ifetch 2,contr
+	beq LE_L2CAP_CID_ATT,p_le_parse_att
+	branch le_parse_l2cap+10
+		
+p_le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+	beq ATTOP_READ_REQUEST,p_le_parse_att_read_request
+	beq ATTOP_WRITE_REQUEST,p_le_parse_att_write_request	
+	branch le_parse_att+2
+	
+p_le_parse_att_read_request:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_LE_BATTERY_SERVICE_CANCEL,le_parse_att_read_request
+	call le_check_encrypt_state
+	fetcht 2,mem_le_att_handle
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_READ_AUTH,p_le_send_att_read_response_check_auth
+//input:temp is handle
+p_le_send_att_read_response:
+	fetch 2,mem_le_att_handle
+	beq 0x30,le_send_att_error_response_notfound
+	fetcht 2,mem_le_att_handle
+	branch le_send_att_read_response
+
+p_le_send_att_read_response_check_auth:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch p_le_send_att_read_response,zero
+	nbranch p_le_send_att_read_response,user
+	branch le_send_att_read_response_error_insufficient_auth
+
+
+p_le_parse_att_write_request:		// mac os 10.9.5 reconnect can't move
+	copy contr,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-3,regb
+	call le_writeatt_cb
+	fetch 1,mem_mouse_bluetooth_fast_conn_flag
+	beq 0xff,le_send_att_write_response_check_auth	
+	fetch 1,mem_mouse_le_reconnect_flag
+	branch le_send_att_write_response_check_auth,blank
+	fetch 1,mem_le_connect_status_flag
+	bbit1 LL_START_ENC_FLAG,le_send_att_write_response_check_auth
+	setarg 0x001a		
+	fetcht 2,mem_le_att_handle
+	isub temp,null
+	nbranch le_send_att_write_response_check_auth,zero
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+
+p_g24_lpm_wait:			// ice connect led
+	fetch 1,mem_24g_device_led_status
+	ncall g24_transmit_by_interrupt_enable,blank
+	enable user
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	branch disable_user,blank
+	fetch 1,mem_lpm_mode
+	branch disable_user,blank
+	branch g24_setgpio_lpm_before
+
+p_mouse_motion:
+	disable user
+	setarg 0
+	store 6,mem_mouse_x
+	call mouse_check_sensor_data
+	call mouse_dpi_config
+	call mouse_zwheel
+	call mouse_t_zwheel
+	call mouse_key
+	fetch 1,mem_mouse_key
+	and_into 0x1f,pdata
+	store 1,mem_mouse_key
+	nbranch mouse_drawing_optima_init,user
+	call p_mouse_drawing_optima
+	branch mouse_no_data_timer_init
+
+p_mouse_drawing_optima:
+	fetch 1,mem_config_sensor_type
+	rtneq P3212
+	branch mouse_drawing_optima
+
+p_mouse_sensor_poweron:
+	call mouse_sensor_spi_init
+	fetch 1,mem_config_sensor_type
+	beq KA8G2,p_mouse_ka8g2_sensor_init
+	call mouse_sensor_reset
+	arg mem_sensor_poweron_init,regc
+	call mouse_sensor_wr_seq
+	branch mouse_dpi_config
+	
+p_mouse_ka8g2_sensor_init:
+	call p_mouse_ka8g2_sensor_reset
+	arg mem_ka8g2_sensor_poweron_init,regc
+	call mouse_sensor_wr_seq
+	branch mouse_dpi_config
+
+p_mouse_sensor_reset:
+	fetch 1,mem_config_sensor_type
+	beq KA8G2,p_mouse_ka8g2_sensor_reset
+	branch mouse_sensor_reset
+p_mouse_ka8g2_sensor_reset:
+	setarg 0x9706		// reset to factory settings
+	call twspi_write
+	nop 12000
+	rtn
+
+p_mouse_sensor_powerdown:
+	call mouse_init_sunt
+	call mouse_sensor_spi_init
+	fetch 1,mem_config_sensor_type
+	beq KA8G2,p_mouse_ka8g2_sensor_powerdown
+	setarg 0x0806
+	branch twspi_write
+p_mouse_ka8g2_sensor_powerdown:
+	setarg 0x1f06		
+	branch twspi_write
+
+
+//////////////////////////////modify key start///////////////////////////////////////////////
+p_mouse_check_key_gpio:	//when mem_matrix_public_gpio=0xff
+	fetch 1,mem_sensor_shutdown_flag
+	ncall mouse_check_key_gpio_once,blank
+	arg 0,rega
+	call p_mouse_check_lkey_gpio
+	call p_mouse_check_rkey_gpio
+	call p_mouse_check_mkey_gpio
+	call p_mouse_check_bkkey_gpio
+	call p_mouse_check_fwkey_gpio
+	branch mouse_check_key_gpio_next
+
+p_mouse_check_lkey_gpio:
+	fetch 1,mem_lbutton_gpio
+	call p_mouse_gpio_config_output_high
+	call mouse_check_lkey_gpio
+	fetcht 1,mem_lbutton_gpio
+	branch mouse_gpio_config_input_pu
+p_mouse_check_rkey_gpio:
+	fetch 1,mem_rbutton_gpio
+	call p_mouse_gpio_config_output_high
+	call mouse_check_rkey_gpio
+	fetcht 1,mem_rbutton_gpio
+	branch mouse_gpio_config_input_pu
+p_mouse_check_mkey_gpio:
+	jam MOUSE_M_KEY,mem_mouse_key_temp
+	fetch 1,mem_mouse_mkey_press_status
+	copy pdata,regc
+p_mouse_3io6key_mkey_check:
+	fetch 1,mem_mbutton_gpio
+	call p_mouse_gpio_config_output_low
+	fetcht 1,mem_mbutton_gpio
+	call mouse_3io6key_check
+	store 1,mem_mouse_mkey_press_status
+	fetcht 1,mem_mbutton_gpio
+	branch mouse_gpio_config_input_pu
+	
+p_mouse_check_bkkey_gpio:
+	fetch 1,mem_bk_button_gpio
+	rtneq GPIO_DISABLE
+	jam MOUSE_BK_KEY,mem_mouse_key_temp
+	fetch 1,mem_mouse_bkkey_press_status
+	copy pdata,regc
+	fetcht 1,mem_bk_button_gpio
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,p_mouse_3io6key_bk_check
+	branch mouse_check_bkkey_gpio_next
+p_mouse_3io6key_bk_check:
+	fetch 1,mem_bk_button_gpio
+	call p_mouse_gpio_config_output_low
+	fetcht 1,mem_bk_button_gpio
+	branch mouse_3io6key_bk_check	
+
+p_mouse_check_fwkey_gpio:
+	fetch 1,mem_fw_button_gpio
+	rtneq GPIO_DISABLE
+	jam MOUSE_FW_KEY,mem_mouse_key_temp
+	fetch 1,mem_mouse_fwkey_press_status
+	copy pdata,regc
+	fetcht 1,mem_fw_button_gpio
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,p_mouse_3io6key_fw_check
+	branch mouse_check_fwkey_gpio_next
+p_mouse_3io6key_fw_check:
+	fetch 1,mem_fw_button_gpio
+	call p_mouse_gpio_config_output_low
+	fetcht 1,mem_fw_button_gpio
+	branch mouse_3io6key_fw_check
+
+//input:pdata gpio number
+p_mouse_gpio_config_output_high:
+	arg gpcfg_output_high,temp
+	branch gpio_config_function_int
+		
+//input:pdata gpio number
+p_mouse_gpio_config_output_low:
+	arg gpcfg_output_low,temp
+	branch gpio_config_function_int	
+
+p_mouse_idle:
+	call mouse_low_voltage_led_no_enter_lpm
+	call ui_check_paring_button
+	call p_mouse_dpi_check
+	call p_mouse_dpi_another_gpio_check
+	branch mouse_idle+4
+p_mouse_dpi_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC,mouse_dpi_check_connect_adc
+	fetch 1,mem_dpi_button_gpio
+	rtneq GPIO_DISABLE
+	arg 0,rega
+	jam MOUSE_DPI_KEY,mem_mouse_key_temp
+	fetcht 1,mem_dpi_button_gpio
+	call p_mouse_dpi_key_check
+	branch mouse_dpi_check_next
+
+p_mouse_dpi_key_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_GND,mouse_dpi_key_connect_gnd
+	fetch 1,mem_mouse_dpikey_press_status
+	copy pdata,regc
+	fetch 1,mem_matrix_public_gpio
+	beq GPIO_DISABLE,p_mouse_3io6key_dpi_check
+	branch mouse_dpi_key_check_next
+p_mouse_3io6key_dpi_check:
+	fetch 1,mem_dpi_button_gpio
+	call p_mouse_gpio_config_output_low
+	fetcht 1,mem_dpi_button_gpio
+	branch mouse_3io6key_check
+
+p_mouse_dpi_another_gpio_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_DOUBLE_DPI_KEY
+	fetch 1,mem_dpi_another_button_gpio
+	call p_mouse_gpio_config_output_high
+	call p_mouse_dpi_another_check
+	fetcht 1,mem_dpi_another_button_gpio
+	branch mouse_gpio_config_input_pu	
+	
+p_mouse_dpi_another_check:
+	jam MOUSE_DPI_ANOTHER_KEY,mem_mouse_key_temp_patch
+	fetcht 1,mem_dpi_another_button_gpio
+	fetch 1,mem_dpi_another_press_status
+	call p_mouse_check_key_connect_gnd_new
+	store 1,mem_dpi_another_press_status
+	fetch 1,mem_dpi_another_button_down_enable
+	branch p_mouse_dpi_another_up,blank
+p_mouse_dpi_another_down:
+	fetch 1,mem_dpi_another_button_state
+	rtneq DPI_BUTTON_STATE_DOWN
+	jam DPI_BUTTON_STATE_DOWN,mem_dpi_another_button_state
+	//fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	//rtnbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON
+	//rtnbit1 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY
+	branch mouse_dpi_process
+
+p_mouse_dpi_another_up:
+	fetch 1,mem_dpi_another_button_state
+	rtneq DPI_BUTTON_STATE_UP
+	jam DPI_BUTTON_STATE_UP,mem_dpi_another_button_state
+	//fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	//bbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON,mouse_dpi_up_next
+	//bbit1 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY,mouse_dpi_up_next
+	rtn
+
+p_mouse_check_key_connect_gnd_new:	
+	lshift pdata,pdata
+	copy pdata,regb
+	call gpio_get_bit
+	setflag true,0,regb
+	and regb,0x07,pdata
+	fetcht 1,mem_mouse_key_temp_patch
+	copy temp,queue
+	beq 0x07,p_mouse_key_press		//  about 17~22ms three times
+	beq 0x00,p_mouse_key_release
+	rtn
+
+p_mouse_key_press:
+	jam 1,mem_dpi_another_button_down_enable
+	rtn
+p_mouse_key_release:
+	jam 0,mem_dpi_another_button_down_enable
+	rtn
+
+p_mouse_dpi_process:
+	call mouse_dpi_ghost_check
+	rtn user
+	fetch 1,mem_mouse_dpi
+	copy pdata,temp
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_DOUBLE_DPI_KEY,p_mouse_double_dpi_check
+	copy temp,pdata
+	increase 1,pdata
+	and pdata,0x03,pdata
+p_mouse_dpi_store:
+	store 1,mem_mouse_dpi
+	call mouse_seting_dpi
+	branch mouse_store_device_info_delay
+
+p_mouse_double_dpi_check:
+	fetch 1,mem_dpi_another_button_down_enable
+	nbranch p_mouse_another_dpi_button_down,blank
+p_mouse_dpi_increase:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_DPI_LEVEL_4,p_mouse_dpi_increase_level_4
+	copy temp,pdata
+	rtneq MOUSE_DPI_LEVEL3
+p_mouse_dpi_increase_level:
+	increase 1,pdata
+	branch p_mouse_dpi_store
+
+p_mouse_dpi_increase_level_4:
+	copy temp,pdata
+	rtneq MOUSE_DPI_LEVEL4
+	branch p_mouse_dpi_increase_level
+
+p_mouse_another_dpi_button_down:
+p_mouse_dpi_decrease:
+	copy temp,pdata
+	rtneq MOUSE_DPI_LEVEL1
+	increase -1,pdata
+	branch p_mouse_dpi_store
+	
+//////////////////////////////modify key end///////////////////////////////////////////////
+
+
+
+p_g24_parse_rx_ota_sm:
+	fetch 1,mem_g24_ota_mode
+	rtn blank
+	fetch 1,mem_g24_ota_sm
+	beq G24_OTA_SM_TX_VERSION,p_g24_ota_sm_tx_version
+	beq G24_OTA_SM_TX_INFO,p_g24_ota_sm_tx_info
+	beq G24_OTA_SM_TX_CONFIG,p_g24_ota_sm_tx_config
+	beq G24_OTA_SM_TX_SET_CONFIG_END,p_g24_ota_sm_tx_config_end
+	beq G24_OTA_SM_TX_DATA,p_g24_ota_sm_tx_data
+	beq G24_OTA_SM_TX_RESET,p_g24_ota_sm_tx_reset
+	rtn
+
+p_g24_ota_sm_tx_reset:
+	jam G24_OTA_SM_TX_RESET_OK,mem_g24_ota_sm
+	rtn
+	
+p_g24_ota_sm_tx_version:
+	jam G24_OTA_SM_TX_VERSION_OK,mem_g24_ota_sm
+	rtn
+	
+p_g24_ota_sm_tx_info:
+	jam G24_OTA_SM_TX_INFO_OK,mem_g24_ota_sm
+	rtn	
+
+p_g24_ota_sm_tx_config:
+	jam G24_OTA_SM_TX_CONFIG_OK,mem_g24_ota_sm
+	rtn	
+	
+p_g24_ota_sm_tx_config_end:
+	jam G24_OTA_SM_TX_SET_CONFIG_END_OK,mem_g24_ota_sm
+	rtn		
+
+p_g24_ota_sm_tx_data:
+	jam G24_OTA_SM_TX_DATA_OK,mem_g24_ota_sm
+	rtn		
+	
+	
+p_g24_mouse_parse_rx:
+	fetch 1,mem_24g_rxdata_length
+	branch  p_g24_parse_rx_ota_sm, blank
+	copy pdata,regb //len
+//	fetch 1,mem_g24_ota_mode
+//	nbranch p_g24_mouse_parse_rx_mode_ota,blank
+	jam 0,mem_24g_rxdata_length
+	fetch 1,mem_24g_rxpayload
+	beq DATATYPE_OTA,p_g24_rx_ota	//mouse
+	rtn
+
+
+p_g24_ota_mode_enable:
+	jam 1,mem_g24_ota_mode
+//	jam CLEAR_INIT,mem_24g_mode_init
+	jam 0,mem_lpm_mode
+	branch p_ota_init
+	
+
+p_g24_ota_dispatch:
+
+	rtn
+	
+
+p_g24_ota_transmit:
+	jam DATATYPE_OTA,mem_24g_txbuf
+	call g24_transmit_prep
+	call g24_transmit_receive_ack
+	nrtn sync
+	nrtn user3
+	call g24_txbuf_clear
+	branch g24_ackpayload_parse
+	
+	
+p_g24_rx_ota:
+	fetch 1,mem_24g_rxpayload
+	rtnne DATATYPE_OTA
+	ifetch 1,contr
+//	store 1,mem_g24_ota_tx_opcode
+	ifetcht 1,contr
+	sub temp,G24_OTA_TARGET_MOUSE,null
+	nbranch assert,zero
+	beq G24_OTA_CMD_VERSION,p_g24_mouse_ota_process_version
+	beq  G24_OTA_CMD_INFO,p_g24_mouse_ota_process_info
+	beq  G24_OTA_CMD_CONFIG,p_g24_mouse_ota_process_config
+	beq G24_OTA_CMD_SET_CONFIG_END,p_g24_mouse_ota_process_set_config_end
+	beq G24_OTA_CMD_DATA,p_g24_mouse_ota_process_data
+	beq G24_OTA_CMD_RESET,p_g24_mouse_ota_process_reset
+	beq G24_OTA_CMD_PING,p_g24_mouse_ota_process_ping
+	branch assert
+	
+p_g24_mouse_ota_process_ping:
+	rtn
+
+p_g24_mouse_ota_process_version:
+//	call  g24_transmit_prep
+	call p_g24_ota_mode_enable 
+	jam G24_OTA_SM_RX_VERSION,mem_g24_ota_sm	
+	rtn
+	
+p_g24_mouse_ota_process_info:
+	jam G24_OTA_SM_RX_INFO,mem_g24_ota_sm
+	rtn
+	
+p_g24_mouse_ota_process_config:
+	jam G24_OTA_SM_RX_CONFIG,mem_g24_ota_sm
+	rtn
+	
+
+p_g24_mouse_ota_process_set_config_end:
+	jam G24_OTA_SM_RX_SET_CONFIG_END,mem_g24_ota_sm
+
+	ifetch 2,contr
+	ifetcht 2,contr
+	fetchr rega, 2,mem_g24_ota_rx_alllen
+	isub rega,null
+	nbranch p_g24_mouse_ota_process_fail,zero
+	fetch 2,mem_g24_ota_rx_sum
+	isub temp,null
+	nbranch p_g24_mouse_ota_process_fail,zero
+	call p_g24_check_ota_data_all
+	nbranch p_g24_mouse_ota_process_fail,user
+	branch p_g24_mouse_ota_process_ok	
+
+p_g24_check_ota_data_all:
+	call p_g24_check_ota_data
+	nrtn user	
+	fetch 2,mem_g24_ota_rx_sum
+	isub alarm,null
+	nbranch disable_user,zero	
+	fetcht 2,mem_temp_block6
+	fetch 2,mem_g24_ota_rx_alllen
+	increase -5,pdata
+	isub temp,null
+	nbranch disable_user,zero
+	branch enable_user
+	
+
+p_g24_check_ota_data:
+	fetch 2,mem_g24_ota_config_addr
+	byteswap pdata,pdata
+	store 2,mem_addr_mi
+	arg 3,temp
+	arg mem_temp_block5,rega
+	call iicd_read_eep	
+
+	fetch 1,mem_temp_block5
+	bne  G24_OTA_DATA_HEADER,disable_user
+	ifetcht 2,contr
+//	fetch 2,mem_g24_ota_rx_alllen
+//	increase -5,pdata
+//	isub temp,null
+//	nbranch disable_user,zero
+	storet 2,mem_pdatatemp //len
+	storet 2,mem_temp_block6 //len
+	
+	fetch 1,mem_temp_block5
+	arg 0xffff,rege //crc
+	arg 0,temp
+	arg mem_temp_block5,contr
+	arg 3,loopcnt
+	call p_g24_mouse_data_sum
+	copy temp,alarm
+	
+	fetch 2,mem_g24_ota_config_addr
+	add pdata,3,regf
+	call p_g24_check_ota_data_loop
+
+	byteswap regf,pdata
+	store 2,mem_addr_mi
+	arg 2,temp
+	arg mem_temp_block5,rega
+	call iicd_read_eep	
+	fetch 2,mem_temp_block5
+	isub rege, null
+	nbranch disable_user,zero
+	fetch 1,mem_temp_block5
+	iadd alarm,alarm
+	ifetch 1,contr
+	iadd alarm,alarm
+	setarg 0xffff
+	iand alarm,alarm
+	branch enable_user
+	
+p_g24_check_ota_data_loop:
+	fetch 2,mem_pdatatemp
+	rtn blank
+	copy pdata,temp
+	sub pdata,16,null
+	branch p_g24_check_ota_data_loopend,positive
+	increase -16,pdata
+	arg 0x10,temp //len
+p_g24_check_ota_data_loop2:
+	store 2,mem_pdatatemp
+	copy temp,regext
+	copy regf,pdata
+	byteswap pdata,pdata
+	store 2,mem_addr_mi
+	arg mem_temp_block5,rega
+	call iicd_read_eep
+	copy regf,pdata
+	iadd regext,regf
+	copy regext,loopcnt
+	copy rege,pdata
+	arg mem_temp_block5,contr
+	icrc contr
+	copy pdata,rege
+	copy regext,loopcnt
+	arg mem_temp_block5,contr
+	copy alarm,temp
+	call p_g24_mouse_data_sum
+	copy temp,alarm
+	branch p_g24_check_ota_data_loop
+
+p_g24_check_ota_data_loopend:
+	setarg 0
+	branch p_g24_check_ota_data_loop2
+	
+
+	
+p_g24_mouse_ota_process_data:
+	jam G24_OTA_SM_RX_DATA,mem_g24_ota_sm
+
+	ifetch 1,contr
+	copy contr,rega
+	fetcht 1,mem_g24_ota_rx_data_count
+	isub temp,null
+	branch p_g24_mouse_ota_process_ok,zero //retrasmit
+	call p_g24_cmd_ota_data_check_count
+	nbranch p_g24_mouse_ota_process_fail,user
+	sub regb,4,null
+	branch p_g24_mouse_ota_process_fail,positive
+	increase -4,regb
+	
+	storer regb,2,mem_hold_contw
+	storer rega,2,mem_hold_contr
+	call iicd_eeprom_write_enable
+	call 	p_dongle_usb_cmd_ota_write_data
+	call iicd_eeprom_write_disable
+	fetchr regb,2,mem_hold_contw
+	fetchr rega,2,mem_hold_contr
+	
+	fetch 2,mem_g24_ota_rx_alllen
+	iadd regb,pdata
+	store 2,mem_g24_ota_rx_alllen
+	copy regb,loopcnt
+	arg 0,temp
+	copy rega,contr
+	call p_g24_mouse_data_sum	
+	fetch 2,mem_g24_ota_rx_sum
+	iadd temp,pdata
+	store 2,mem_g24_ota_rx_sum
+
+p_g24_mouse_ota_process_ok:	
+	jam G24_OTA_STATUS_SUCCESS,mem_g24_ota_rtn_state
+	rtn
+	
+p_g24_mouse_ota_process_fail:	
+	jam G24_OTA_STATUS_FAIL,mem_g24_ota_rtn_state
+	rtn
+
+p_dongle_usb_cmd_ota_write_data:
+//	fetch 1,mem_g24_ota_config_type
+	fetch 2,mem_g24_ota_config_addr
+	rtn blank
+	fetcht 2,mem_g24_ota_rx_alllen
+	iadd temp,pdata
+	copy regb,temp
+	branch iicd_write_ota_data 
+	
+
+p_g24_mouse_ota_process_reset:
+	fetch 1,mem_g24_ota_sm
+	rtneq G24_OTA_SM_RX_RESET
+	rtneq G24_OTA_SM_TX_RESET
+	rtneq G24_OTA_SM_TX_RESET_OK
+	jam 5,mem_g24_ota_reset_timer
+	jam G24_OTA_SM_RX_RESET,mem_g24_ota_sm
+	rtn
+	
+	
+p_g24_cmd_ota_data_check_count:
+	fetcht 1,mem_g24_ota_rx_data_count
+	store 1,mem_g24_ota_rx_data_count
+	beq 0,p_g24_cmd_ota_data_check_count_0
+	isub temp,pdata
+	beq  1,enable_user	
+	branch disable_user
+	
+p_g24_cmd_ota_data_check_count_0:	
+	sub temp,0xff,null
+	branch enable_user,zero
+	branch disable_user
+
+p_g24_mouse_data_sum:
+	ifetch 1,contr
+	iadd temp,temp
+	loop p_g24_mouse_data_sum
+	rtn
+	
+
+//input loopcnt :len ; contr :data ptr 
+//ouput pdata :crc
+p_g24_mouse_ota_crc:
+	setarg 0xffff
+	icrc contr
+	rtn
+	
+p_g24_mouse_ota_check_crc:
+	fetchr loopcnt, 1,mem_24g_rxdata_length
+	sub loopcnt,2,null
+	branch disable_user,positive
+	arg mem_24g_rxpayload,pdata
+	iadd loopcnt,contr
+	increase -2,contr
+	ifetcht 2,contr // rx crc
+	arg mem_24g_rxpayload,contr	
+	call p_g24_mouse_ota_crc
+	isub temp,null
+	branch enable_user,zero
+	branch disable_user
+
+
+p_g24_mouse_ota_check_data:
+	ifetch 1,contr
+	bne 0x5a,p_g24_mouse_ota_load_fail
+	copy rega,1,contr
+	fetcht  2,contr
+p_g24_mouse_ota_check_data_loop:
+	sub temp,3,null
+	branch p_g24_mouse_ota_load_fail,positive
+	increase 2,contr
+	ifetchr loopcnt, 1,contr
+	sub loopcnt,0,null
+	nbranch p_g24_mouse_ota_load_fail,zero
+	copy loopcnt,pdata
+	iadd contr,contr
+	copy temp,pdata
+	increase 3,loopcnt
+	isub loopcnt,temp
+	nbranch p_g24_mouse_ota_check_data_loop,zero
+	ifetcht 2,contr //crc
+	add rega,1,contr
+	ifetch 2,contr 
+	add pdata,2,loopcnt
+	add rega,1,contr
+	call p_g24_mouse_ota_crc
+	isub temp,null
+	nbranch p_g24_mouse_ota_load_fail,zero	
+p_g24_mouse_ota_load_success:
+	branch enable_user
+
+	
+p_g24_mouse_ota_load_fail:
+	branch disable_user
+
+p_g24_mouse_ota_get_otaaddr:
+	fetch 2,mem_g24_ota_config_addr
+	copy pdata,contr
+	call p_g24_mouse_ota_check_data
+	nbranch p_g24_mouse_ota_config_end,user
+	fetchr rega, 2,mem_g24_ota_config_addr
+	add rega,1,contr
+	ifetch 2,contr
+	increase 5,pdata //header 1, len 2, crc 2
+	iadd rega,pdata
+	store 2,mem_g24_ota_config_addr
+	branch p_g24_mouse_ota_get_otaaddr
+
+p_g24_mouse_ota_config_end:
+	fetch 2,mem_g24_ota_storage_size
+	fetcht 2,mem_g24_ota_config_addr
+	isub temp,pdata	
+	rtn
+
+
+p_ota_init:
+	setarg 0
+	store 2,mem_g24_ota_rx_alllen
+	store 2,mem_g24_ota_rx_sum
+	store 1,mem_g24_ota_rx_data_count
+	store 1,mem_g24_ota_sm
+	rtn
+
+p_mouse_24g_package_ota:
+	call disable_user
+	fetch 1,mem_g24_ota_sm
+	beq G24_OTA_SM_RX_VERSION,p_mouse_24g_package_ota_version
+	beq G24_OTA_SM_RX_INFO,p_mouse_24g_package_ota_info
+	beq G24_OTA_SM_RX_CONFIG,p_mouse_24g_package_ota_config
+	beq G24_OTA_SM_RX_SET_CONFIG_END,p_mouse_24g_package_ota_set_config_end
+	beq G24_OTA_SM_RX_DATA,p_mouse_24g_package_ota_data
+	beq G24_OTA_SM_RX_RESET,p_mouse_24g_package_ota_reset
+	branch p_mouse_24g_package_ping
+	
+p_mouse_24g_package_ota_version:
+	jam DATATYPE_OTA,mem_24g_txbuf
+	jam G24_OTA_CMD_VERSION,mem_24g_txbuf+1
+	jam G24_OTA_STATUS_SUCCESS,mem_24g_txbuf+2
+	jam G24_OTA_TARGET_MOUSE,mem_24g_txbuf+3
+	setarg G24_OTA_VERSION
+	store 2,mem_24g_txbuf+4
+	jam TYPE_MS,mem_24g_data_type
+	jam 6,mem_24g_datalen
+//	arg 6,rega	//length
+//	arg mem_g24_ota_txbuf,regb //tx buff	
+//	branch enable_user
+	jam G24_OTA_SM_TX_VERSION,mem_g24_ota_sm
+	rtn
+
+p_mouse_24g_package_ota_info:
+	jam DATATYPE_OTA,mem_24g_txbuf
+	jam G24_OTA_CMD_INFO,mem_24g_txbuf+1
+	jam G24_OTA_STATUS_SUCCESS,mem_24g_txbuf+2
+	jam G24_OTA_TARGET_MOUSE,mem_24g_txbuf+3
+	fetch 2,core_chipid
+	store 2,mem_24g_txbuf+4
+	setarg 0x6661
+	istore 2,contw
+	setarg 1
+	istore 6,contw
+	setarg 0
+	istore 2,contw
+	istore 2,contw
+	call p_mouse_24g_storage_type
+	istore 1,contw
+	setarg 0
+	istore 1,contw
+	fetcht 2,mem_g24_ota_config_addr
+	istoret 2,contw
+	fetch 2,mem_g24_ota_storage_size
+	lshift8 pdata,pdata
+	rshift  pdata,pdata 
+	isub temp,pdata
+	nbranch  p_dongle_usb_cmd_ota_info_dongle_empty,positive
+p_dongle_usb_cmd_ota_info_dongle_common:	
+	istore 2,contw	
+	jam 24,mem_24g_datalen	
+	jam TYPE_MS,mem_24g_data_type
+	jam G24_OTA_SM_TX_INFO,mem_g24_ota_sm
+	rtn	
+	
+p_dongle_usb_cmd_ota_info_dongle_empty:
+	setarg 0
+	branch p_dongle_usb_cmd_ota_info_dongle_common
+	
+p_mouse_24g_package_ota_config:
+	jam G24_OTA_SM_TX_CONFIG,mem_g24_ota_sm
+	jam G24_OTA_CMD_CONFIG,mem_24g_txbuf+1
+	jam 4,mem_24g_datalen
+	branch p_mouse_24g_package_ota_common_ok
+
+p_mouse_24g_package_ota_reset:
+	jam G24_OTA_SM_TX_RESET,mem_g24_ota_sm
+	jam G24_OTA_CMD_RESET,mem_24g_txbuf+1
+	jam 4,mem_24g_datalen
+	branch p_mouse_24g_package_ota_common_ok	
+
+p_mouse_24g_storage_type:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_EEPROM,p_mouse_24g_storage_type_eeprom
+	bbit1 MOUSE_ENABLE_FLASH,p_mouse_24g_storage_type_flash
+	setarg G24_OTA_STORAGE_ERROR
+	rtn
+	
+p_mouse_24g_storage_type_eeprom:
+	setarg G24_OTA_STORAGE_EEPROM
+	rtn
+	
+p_mouse_24g_storage_type_flash:
+	setarg G24_OTA_STORAGE_FLASH
+	rtn
+	
+
+p_mouse_24g_package_ota_common_ok:
+	jam TYPE_MS,mem_24g_data_type
+	jam DATATYPE_OTA,mem_24g_txbuf
+	jam G24_OTA_STATUS_SUCCESS,mem_24g_txbuf+2
+	jam G24_OTA_TARGET_MOUSE,mem_24g_txbuf+3
+	rtn
+
+p_mouse_24g_package_ota_common_fail:
+	jam G24_OTA_STATUS_FAIL,mem_24g_txbuf+2
+	jam TYPE_MS,mem_24g_data_type
+	jam DATATYPE_OTA,mem_24g_txbuf
+	jam G24_OTA_TARGET_MOUSE,mem_24g_txbuf+3
+	rtn
+
+	
+p_mouse_24g_package_ota_data:
+	jam G24_OTA_SM_TX_DATA_OK,mem_g24_ota_sm
+	
+	jam G24_OTA_CMD_DATA,mem_24g_txbuf+1
+	fetch 1,mem_g24_ota_rx_data_count
+	store 1,mem_24g_txbuf+4	
+	jam 5,mem_24g_datalen
+	jam TYPE_MS,mem_24g_data_type
+	jam DATATYPE_OTA,mem_24g_txbuf
+	fetch 1,mem_g24_ota_rtn_state
+	store 1,mem_24g_txbuf+2
+	jam G24_OTA_TARGET_MOUSE,mem_24g_txbuf+3
+	rtn
+
+
+p_mouse_24g_package_ota_set_config_end:
+	jam G24_OTA_SM_TX_SET_CONFIG_END_OK,mem_g24_ota_sm
+	jam G24_OTA_CMD_SET_CONFIG_END,mem_24g_txbuf+1
+	jam 4,mem_24g_datalen
+	
+	jam TYPE_MS,mem_24g_data_type
+	jam DATATYPE_OTA,mem_24g_txbuf
+	fetch 1,mem_g24_ota_rtn_state
+	store 1,mem_24g_txbuf+2
+	jam G24_OTA_TARGET_MOUSE,mem_24g_txbuf+3
+	rtn
+
+	
+p_mouse_24g_package_ping:
+	jam DATATYPE_OTA,mem_24g_txbuf
+	jam G24_OTA_CMD_PING,mem_24g_txbuf+1
+	jam G24_OTA_STATUS_SUCCESS,mem_24g_txbuf+2
+	jam G24_OTA_TARGET_MOUSE,mem_24g_txbuf+3
+//	jam DATATYPE_OTA,mem_24g_txbuf
+//	jam G24_OTA_CMD_PING,mem_24g_txbuf+1
+	jam TYPE_MS,mem_24g_data_type
+	jam 4,mem_24g_datalen
+	rtn
+	
+p_mouse_24g_package_data_ota:
+	copy pdata,rega //length
+	jam 0,mem_g24_ota_prepare_send_len
+	jam TYPE_MS,mem_24g_data_type
+	arg mem_g24_ota_txbuf,regb //tx buff		
+	rtn
+
Index: program/peripherals.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/peripherals.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/peripherals.prog	(working copy)
@@ -0,0 +1,3179 @@
+
+/* ===================== two wire SPI gpio ======================= */
+
+//pdata:gpio number
+twspi_reset:
+	bpatchx patch24_0,mem_patch24
+	and_into 0xff,pdata
+	arg core_gpio_conf,contw
+	iadd contw,contw
+	copy contw,rega
+	arg gpcfg_output_low,temp
+	istoret 1,contw
+	call twspi_disable
+	nop 30
+	copy rega,contw
+	arg gpcfg_output_high,temp
+	istoret 1,contw
+	branch twspi_enable
+
+twspi_disable:
+	fetch 1,core_aes_en
+	and_into 0xfb,pdata
+	store 1,core_aes_en
+	rtn
+
+twspi_enable:
+	fetch 1,core_aes_en
+	or_into 0x04,pdata
+	store 1,core_aes_en
+	rtn
+
+twspi_write:
+	branch spid_write_reg
+
+twspi_read:
+	branch spid_read_reg
+
+ifdef SPI2
+twspi2_reset:
+	and_into 0xff,pdata
+	arg core_gpio_conf,contw
+	iadd contw,contw
+	copy contw,rega
+	arg gpcfg_output_low,temp
+	istoret 1,contw
+	call twspi2_disable
+	nop 30
+	copy rega,contw
+	arg gpcfg_output_high,temp
+	istoret 1,contw
+	branch twspi2_enable
+
+twspi2_disable:
+	fetch 1,core_aes_en
+	and_into 0xf7,pdata
+	store 1,core_aes_en
+	rtn
+
+twspi2_enable:
+	fetch 1,core_aes_en
+	or_into 0x08,pdata
+	store 1,core_aes_en
+	rtn
+
+twspi2_write:
+	branch spid2_write_reg
+
+twspi2_read:
+	branch spid2_read_reg
+endif
+/* ===================== code loading ======================= */
+aes_disable:
+	fetch 1,core_aes_en
+	and_into 0xfd,pdata   	// disable aes
+	store 1,core_aes_en
+	rtn
+
+read_function_aes:
+	nbranch read_function,user
+	fetch 1,core_aes_en
+	or_into 0x2,pdata   	// enable aes 
+	store 1,core_aes_en
+read_function:
+	copy temp,null
+	branch read_fuction_zero,zero
+	copy regc,pc
+read_fuction_zero:
+	isolate0 0,null
+	branch set_ucode_status
+	
+/* return temp = block length */
+get_block_header:
+	force 4,temp
+get_block_header0:
+	arg mem_ucode_buf,rega
+	call aes_disable	// disable aes for header
+	call read_function
+	arg 0x55aa,rega
+	fetch 2,mem_ucode_buf
+	ifetcht 2,contr
+	isub rega,null
+	rtn	
+
+
+read_first_block:
+	arg 2,temp
+	arg mem_ucode_ptr,rega
+	call read_function
+	fetch 2,mem_ucode_ptr
+	store 2,mem_addr_mi
+	call get_iv,user
+	rtn
+	
+get_iv:
+	arg 16,temp
+	arg mem_ucode_keybuf,rega
+	call aes_disable	// disable aes for iv
+	call read_function
+	arg mem_ucode_keybuf,contr
+	arg 16,loopcnt
+	call aes_load_data
+	call aes_init
+	call aes_clear_data
+	branch do_aes_cbc					/* generate first IV */
+
+load_storage:
+	disable match
+	call get_block_header
+	nrtn zero
+	enable match
+	jam 0x80, core_ucode_ctrl
+	jam 0,core_ucode_hi
+	jam 0,core_ucode_low
+	arg core_ucode_data,rega
+	call read_function_aes
+	jam 0x0, core_ucode_ctrl
+load_storage_loop:
+	arg 6,temp
+	call get_block_header0
+	nrtn zero
+	ifetch 2,contr
+	iforce rega
+	call read_function
+	branch load_storage_loop
+
+load_storage_efuse:
+//	disable match
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_OFFSET
+	arg mem_tmp_buffer,contr
+	iadd contr,contr	//code addr
+//	enable match
+	jam 0x80,core_ucode_ctrl
+	jam 0,core_ucode_hi
+	jam 0,core_ucode_low
+	arg core_ucode_data,rega
+	ifetchr loopcnt,1,contr
+	sub loopcnt,0,null
+	ncall load_efuse_read_code_loop,zero
+	jam 0x0,core_ucode_ctrl
+load_storage_efuse_loop:
+	ifetch 1,contr
+	rtn blank
+	copy pdata,loopcnt
+	ifetchr regb,2,contr
+	copy regb,contw
+	call memcpy_loop
+	branch load_storage_efuse_loop
+		
+load_efuse_read_code_loop:
+	ifetch 1,contr
+	istore 1,rega
+	loop load_efuse_read_code_loop
+	rtn
+
+	/* only load memory data from eeprom */
+reload_eeprom:
+	call clean_mem
+	setarg 0x1000
+	store 2,mem_addr_mi
+	arg iicd_read_eep,regc
+	arg 2,loopcnt
+reload_eeprom_loop:
+	call get_block_header
+	nrtn zero
+	fetch 2,mem_addr_mi
+	byteswap pdata,pdata
+	iadd temp,pdata
+	byteswap pdata,pdata
+	store 2,mem_addr_mi
+	loop reload_eeprom_loop
+	branch load_storage_loop
+
+
+loadcode:
+	call clean_mem
+	jam 0x25,core_clkoff			// disable debug uart
+	
+	setarg 0
+	arg mem_tmp_buffer,rega
+	arg 64,temp
+	call efuse_read_data
+	call loadcode_efuse_check
+	call app_read_efuse_app_vsel
+	disable user
+	
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_UCODE
+	bbit0 UCODE_FLAG_ENC, loadcode_efuse
+
+	jam lock_otp,core_misc_ctrl	// disable further read/write of key
+	set1 mark_otp_encrypt,mark	
+	force regidx_key,regext_index
+	call aes_clear
+	force regidx_key,regext_index
+	fetchr regext,4,mem_tmp_buffer+EFUSE_OFFSET_KEY_ADDR
+	
+	enable user					// set user for aes
+loadcode_efuse:
+	fetch 4,mem_tmp_buffer
+	branch loadcode_iic,blank
+	store 3,mem_efuse_header
+	call app_lpm_peripheral_lock_check
+	call load_storage_efuse
+loadcode_iic:
+	jam 0,mem_loadcode_times
+loadcode_iic_2:	
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_UCODE
+	bbit1 UCODE_FLAG_SKIP_EEP,loadcode_spi
+	call loadcode_check_times
+	call iicd_load_gpio_init
+	call clear_eeprom_size_2k
+	call loadcode_iic_by_eeprom
+	nbranch loadcode_iic_eeprom_2k,match
+	fetch 1,mem_ucode_status
+	bbit0 0,loadcode_iic_2			// crc error, try again
+	branch loadcode_hci
+loadcode_iic_eeprom_2k:
+	call set_eeprom_size_2k
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_UCODE
+	bbit1 UCODE_FLAG_SKIP_EEP,loadcode_spi
+	call loadcode_iic_by_eeprom
+	nbranch loadcode_spi,match
+	fetch 1,mem_ucode_status
+	bbit0 0,loadcode_iic_2			// crc error, try again
+	branch loadcode_hci
+
+iicd_load_gpio_init:
+	fetch 1,mem_eeprom_sda_gpio
+	fetcht 1,mem_eeprom_scl_gpio
+	isub temp,null
+	nbranch iicd_read_init_pin,zero
+iicd_load_default_gpio:
+	jam 2,mem_eeprom_wp_gpio
+	jam 1,mem_eeprom_scl_gpio
+	jam 0,mem_eeprom_sda_gpio
+	branch iicd_read_init_pin
+	
+loadcode_spi:
+	jam 0,mem_loadcode_times
+loadcode_spi_loop:
+	call loadcode_check_times
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_UCODE
+	bbit1 UCODE_FLAG_SKIP_FLASH, loadcode_hci
+	call spid_init_flash
+	nop 200						// some flash will fail if no delay here
+	call spid_flash_release_form_powerdown
+	nop 100
+	arg spid_load_flash,regc
+	call read_first_block
+	call load_storage
+	nbranch loadcode_hci,match
+	fetch 1,mem_ucode_status
+	bbit0 0,loadcode_spi_loop			// crc error, try again
+
+loadcode_hci:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_UCODE
+	bbit0 UCODE_FLAG_HCI,clear_key_buf
+	call clear_key_buf
+	branch hci_init
+	
+clear_key_buf:
+	setarg 0
+	store 4,mem_tmp_buffer+EFUSE_OFFSET_KEY_ADDR
+	force regidx_key,regext_index
+	call aes_clear
+	jam 0x21,core_clkoff		// enable debug uart
+	rtn
+
+//input pdata
+//output pdata
+loadcode_efuse_check_xor:
+	rshift4 pdata,temp
+	and pdata,0x0f,pdata
+	ixor temp,pdata
+	rtn
+
+loadcode_efuse_check:
+	fetch 4,mem_tmp_buffer
+	rtn blank
+ 	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_UCODE
+	call loadcode_efuse_check_xor
+	bne 0x0f, loadcode_error
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_DEVICE_LOCK
+	call loadcode_efuse_check_xor
+	bne 0x0f, loadcode_error
+
+loadcode_efuse_check_sum:	
+	fetch 1,mem_tmp_buffer
+	ifetcht 1,contr
+	iadd temp,pdata
+	ifetcht 1,contr
+	iadd temp,pdata
+	ifetcht 1,contr
+	iadd temp,rega
+	arg mem_tmp_buffer,pdata
+	iadd temp,contr
+	copy rega,pdata
+	ifetchr loopcnt,1,contr
+	iadd loopcnt,pdata
+	call cal_sum
+	call loadcode_efuse_check_sum_loop
+	ifetcht 1,contr
+	and pdata,0xff,pdata
+	isub temp,null
+	nbranch loadcode_error,zero
+	rtn	
+	
+loadcode_efuse_check_sum_loop:	
+	ifetchr loopcnt,1,contr
+	sub loopcnt,0,null
+	rtn zero
+	iadd loopcnt,pdata
+	increase 2,loopcnt
+	call cal_sum
+	branch loadcode_efuse_check_sum_loop
+
+loadcode_iic_by_eeprom:
+	setarg 0x0
+	store 2,mem_addr_mi
+	arg iicd_read_eep,regc
+	call iic_init_600khz
+	call read_first_block
+	branch load_storage
+
+
+loadcode_check_times:
+	fetch 1,mem_loadcode_times
+	increase 1,pdata
+	sub pdata,3,null
+	nbranch loadcode_error,positive
+	store 1,mem_loadcode_times
+	rtn
+
+loadcode_error:
+//	call clear_key_buf
+	branch app_lpm_mpu_lock_br_ble
+
+
+/* true flag is set into status */
+set_ucode_status:
+	fetch 1,mem_ucode_status
+	lshift pdata,pdata
+	setflag true,0,pdata
+	isolate0 15,rega
+	rtn true
+	store 1,mem_ucode_status
+	rtn
+
+	/* queue is bit position of hw done status */
+decrypt_code:
+	fetch 1,core_aes_en
+	rtnbit0 1
+	branch decrypt_code_skip	/* skip to key generation at first for speed */
+decrypt_code_loop:
+	fetch 1,core_dma_status
+	qisolate1 pdata
+	rtn true
+decrypt_code_skip:
+	fetch 1,core_misc_status
+	bbit0 1,decrypt_code_loop
+	call do_aes_cbc
+	branch decrypt_code_loop
+
+	/* loopcnt is ucode instruction count, pdata is buffer ptr */
+save_ucode:
+	copy loopcnt,temp
+	storet 2,mem_patch_len
+	jam 0x80, core_ucode_ctrl
+	jam 0,core_ucode_hi
+	jam 0,core_ucode_low
+	store 2,mem_patch_ptr
+	iforce contw
+	lshift2 loopcnt,loopcnt
+save_ucode_loop:
+	fetch 1,core_ucode_data
+	istore 1,contw
+	loop save_ucode_loop
+	jam 0x0, core_ucode_ctrl
+	rtn
+
+
+load_ucode:
+	fetch 2,mem_patch_ptr
+	rtn blank
+	jam 0x80, core_ucode_ctrl
+	jam 0,core_ucode_hi
+	jam 0,core_ucode_low
+	fetcht 2,mem_patch_len
+	lshift2 temp,loopcnt
+	iforce contr
+load_ucode_loop:
+	ifetch 1,contr
+	store 1,core_ucode_data
+	loop load_ucode_loop
+	jam 0x0, core_ucode_ctrl
+	rtn
+
+
+/* ===================== LOCK ======================= */
+
+app_read_efuse_app_vsel:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_APP_VSEL
+	bbit1 6,lpm_write_sel_vdd5v
+	branch lpm_write_sel_vdd3v3
+
+app_read_efuse_sys_config:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_DEVICE_OPTION
+	and_into 0x0f,pdata	//bit3-0
+	rtn blank
+	store 1,mem_device_option
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_XTAL_OFFSET
+	store 1,mem_lpm_ctrim
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_XTAL_CNT
+	store 1,mem_lpm_xtalcnt
+	rtn
+
+app_read_efuse_dig_aon_vsel:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_DIG_AON_VSEL
+	and_into 0x30,pdata	//bit5-4
+	rshift4 pdata,pdata
+	rtn blank
+	store 1,mem_dig_aon_vsel
+	rtn
+
+app_read_efuse_syn_afc_cfg1:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_TX_VCO_CURRENT
+	and_into 0x0f,pdata	//bit3-0
+	rtn blank
+	store 1,mem_syn_afc_cfg1
+	rtn
+
+app_read_efuse_rf_ldo_cfg1:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_LDO_CFG1
+	and_into 0x30,pdata	//bit5-4
+	rshift4 pdata,pdata
+	rtn blank
+	store 1,mem_rf_ldo_cfg1
+	rtn
+
+app_read_efuse_rc_cal:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_RC_CAL
+	rtn blank
+	store 1,mem_rc_cal
+	rtn
+
+app_read_efuse_agc:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_AGC_SEL
+	bbit1 7,app_disable_soft_agc	//bit7
+	jam 0x88,mem_gain_table
+	jam 0x66,mem_gain_table+1
+	jam 0x44,mem_gain_table+2
+	fetch 2,mem_tmp_buffer+EFUSE_OFFSET_AGC_TABLE
+	rtn blank
+	store 2,mem_gain_table+1
+	rtn
+
+app_disable_soft_agc:
+	jam 0xff,mem_gain_fix
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_AGC_SEC_EN
+	and_into 0x40,pdata	//bit6
+	rshift3 pdata,pdata
+	store 1,mem_gain_second_agc_en	//0x00 or 0x08
+	rtn 
+
+
+app_lpm_efuse_lock_prep:
+	jam 0x73,0x8002
+	until null,lpo_edge
+	until null,lpo_edge
+	fetch 2,core_ucode_flag
+	set0 13,pdata
+	store 2,core_lpm_reg
+	branch lpm_write2_ctrl_option
+
+/* ===================== LOCK ======================= */
+
+app_lpm_peripheral_lock_check:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_DEVICE_LOCK
+	and pdata,0x0f,pdata
+	beq dvc_op_module,app_lpm_peripheral_lock_module
+	beq dvc_op_hci,app_lpm_peripheral_lock_hci
+	beq dvc_op_dongle,app_lpm_peripheral_lock_dongle
+	beq dvc_op_test,app_lpm_peripheral_lock_test
+	beq dvc_op_mouse,app_lpm_peripheral_lock_mouse
+	beq dvc_op_shutter,app_lpm_peripheral_lock_shutter
+	beq dvc_op_ali_mesh,app_lpm_peripheral_lock_mesh
+	beq dvc_op_hci_boot,app_lpm_peripheral_lock_hciboot
+	beq dvc_op_remote_car,app_lpm_peripheral_lock_remote_car
+	beq dvc_op_car,app_lpm_peripheral_lock_car
+	beq dvc_op_antilost,app_lpm_peripheral_lock_antilost
+ifdef COMPILE_ESL
+	beq dvc_op_esl,app_lpm_peripheral_lock_esl
+endif	
+	rtn
+	
+app_lpm_peripheral_lock_module:
+app_lpm_peripheral_lock_hci:
+app_lpm_peripheral_lock_hciboot:
+	call app_lpm_efuse_lock_prep
+	call app_lpm_mpu_lock_mesh
+	branch lpm_write_lock
+	
+app_lpm_peripheral_lock_dongle:
+	call app_lpm_efuse_lock_prep
+	arg module_init,pdata //module
+	arg ui_soft_switch_power_off,temp  //shutter
+	call app_mpu_s0_lock
+	branch lpm_write_lock
+
+app_lpm_peripheral_lock_test:
+	call app_lpm_efuse_lock_prep
+	branch lpm_write_lock
+
+app_lpm_peripheral_lock_mouse:
+	call app_lpm_efuse_lock_prep
+	arg antilost_init,pdata //antilost
+	arg module_set_state,temp  //module
+	call app_mpu_s0_lock
+	branch lpm_write_lock
+	
+app_lpm_peripheral_lock_shutter:
+	call app_lpm_efuse_lock_prep
+	arg antilost_init,pdata  //antilost
+	arg remote_car_moto_data_enable_user,temp //car remote
+	call app_mpu_s0_lock
+	branch lpm_write_lock
+	
+app_lpm_peripheral_lock_mesh:
+	call app_lpm_efuse_lock_prep
+	call app_lpm_mpu_lock_app
+	branch lpm_write_lock
+	
+app_lpm_peripheral_lock_remote_car:
+	call app_lpm_efuse_lock_prep
+	arg antilost_init,pdata  //antilost
+	arg mouse_low_voltage_led_no_enter_lpm_blink,temp //mouse
+	call app_mpu_s0_lock
+	branch lpm_write_lock
+
+app_lpm_peripheral_lock_car:
+	call app_lpm_efuse_lock_prep
+	arg dongle_init,pdata  //dongle
+	arg ui_soft_switch_power_off,temp //shutter
+	call app_mpu_s0_lock
+	branch lpm_write_lock
+	
+app_lpm_peripheral_lock_antilost:
+	call app_lpm_efuse_lock_prep
+	arg car_init,pdata  //dongle
+	arg ui_soft_switch_power_off,temp //shutter
+	call app_mpu_s0_lock
+	branch lpm_write_lock
+
+app_lpm_mpu_lock_mesh:	
+	arg ali_mesh_access_layer_resolve_message,pdata
+	arg ali_mesh_upper_transport_layer_clear_tx_buffer,temp
+	branch app_mpu_s0_lock
+
+
+ifdef COMPILE_ESL
+app_lpm_peripheral_lock_esl:
+	call app_lpm_efuse_lock_prep
+	arg module_init,pdata //module
+	arg ui_soft_switch_power_off,temp  //shutter
+	call app_mpu_s0_lock
+	branch lpm_write_lock
+endif
+
+app_lpm_mpu_lock_module:
+	call app_lpm_efuse_lock_prep
+	arg module_init,pdata
+	arg module_set_state,temp
+app_mpu_s0_lock:
+	store 2,core_mpu_s0_saddr
+	storet 2,core_mpu_s0_eaddr
+	rtn
+	
+app_lpm_mpu_lock_app:	
+	arg antilost_init,pdata  //antilost
+	arg ui_soft_switch_power_off,temp //shutter
+	branch app_mpu_s0_lock
+
+app_lpm_mpu_lock_br:	
+	arg parse_lmp,pdata
+	arg remote_auth,temp
+	branch app_mpu_s1_lock
+
+app_lpm_mpu_lock_ble:	
+	arg le_parse_att,pdata
+	arg le_send_ll_one_lenth,temp
+app_mpu_s1_lock:
+	store 2,core_mpu_s1_saddr
+	storet 2,core_mpu_s1_eaddr
+	rtn
+	
+app_lpm_mpu_lock_24g:	
+	arg g24_prep,pdata
+	arg power_ctrl_pac_succ_cnt_reinit,temp
+	branch app_mpu_s1_lock
+	
+app_lpm_mpu_lock_br_ble:
+	call app_lpm_mpu_lock_br
+	arg le_parse_att,pdata
+	arg le_send_ll_one_lenth,temp
+	branch app_mpu_s0_lock
+
+app_lpm_mpu_mode_lock:
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_PERIPHERALS_LOCK
+	and pdata,0xc0,pdata
+	beq 0xc0,app_lpm_mpu_lock_br_ble
+	bbit1 EFUSE_LE_LOCK_BIT,app_lpm_mpu_lock_ble
+	bbit1 EFUSE_BR_LOCK_BIT,app_lpm_mpu_lock_br
+	rtn
+
+
+lpm_write_lock:
+	call app_lpm_mpu_mode_lock
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_PERIPHERALS_LOCK
+	and pdata,0x1f,rega
+	fetch 1,mem_tmp_buffer+EFUSE_OFFSET_UCODE
+	and pdata,0x0f,pdata
+	fetcht 1,mem_tmp_buffer+EFUSE_OFFSET_DEVICE_LOCK
+	and temp,0x0f,temp
+	lshift4 temp,temp
+	ior temp,pdata
+	lshift8 rega,rega
+	ior rega,pdata
+	set1 lpmreg_rom_lock_bit,pdata
+	set1 lpmreg_ice_mode_bit,pdata
+	store 4,core_lpm_reg
+	call lpm_write2_ctrl_option
+	jam 8,core_encrypt
+	rtn
+
+//lpm_rom_lock:
+//	fetch 2,core_ucode_flag
+//	set1 lpmreg_rom_lock_bit,pdata
+//	store 4,core_lpm_reg
+lpm_write2_ctrl_option:
+	setarg lpmreg_sel_option
+lpm_write2:
+	until null,lpo_edge
+	store 1,core_lpm_wr2
+	until null,lpo_edge
+	until null,lpo_edge
+	rtn
+
+//lpm_write_ice_disable:
+//	fetch 2,core_ucode_flag
+//	set0 lpmreg_ice_mode_bit,pdata
+//	store 4,core_lpm_reg
+//	branch lpm_write2_ctrl_option
+	
+
+/* ===================== SPI dma ======================= */
+
+spid_init:
+	bpatchx patch24_1,mem_patch24
+spid_init_common:
+	fetch 1,mem_spi_init_clk
+	store 1,core_spid_ctrl	// A7530 should at least 34, or write fail
+	fetch 1,mem_spi_init_delay_time
+	store 1,core_spid_delay	// 4us delay
+	setarg mem_spid_tbuf
+	store 2,core_spid_txaddr
+	setarg mem_spid_rbuf
+	store 2,core_spid_rxaddr
+	branch twspi_disable
+	
+
+
+/* pdata 6:0 is reg address, 15:8 is data to write */
+spid_write_reg:
+	set1 7,pdata
+	store 2,mem_spid_tbuf
+	bpatchx patch24_2,mem_patch24
+	jam 2,core_spid_txlen
+	jam 0,core_spid_rxlen
+	jam spid_start,core_misc_ctrl
+	branch wait_spid_done
+
+/* pdata 6:0 is reg address, temp is bytes to read */
+spid_read_reg:
+	force 1,temp
+spid_read_regs:	
+	store 1,mem_spid_tbuf
+	bpatchx patch24_3,mem_patch24
+	jam 1,core_spid_txlen
+	storet 2,core_spid_rxlen
+	jam spid_start,core_misc_ctrl
+	call wait_spid_done
+	fetch 1,mem_spid_rbuf
+	rtn
+
+
+wait_spid_done:
+	fetch 2,mem_afh_error_total
+	increase 1,pdata
+	store 2,mem_afh_error_total
+	fetch 1,core_dma_status
+	bbit0 spid_done,wait_spid_done
+	rtn
+
+	
+
+
+
+
+/**
+ ******************************************************************************
+ ** \brief  write flash
+ **
+ ** \param [in]  rega: 2byte write ptr    
+ **			pdata:3byte flash address  
+ ** 			temp:2byte write data length
+ **
+ ** \retval user  0: flash buys 1:write flash setting complate
+ **
+ ******************************************************************************/
+
+flash_write:
+	disable user
+	copy pdata,regb
+	fetch 1,mem_spi_write_flash_sm
+	rtnne FLASH_SM_NO_BUYS
+	enable user
+	copy regb,pdata
+	branch spid_flash_write_start
+
+
+flash_write_spi_sm_timer:
+	fetch 1,mem_spi_write_flash_sm 	
+	beq FLASH_SM_START,spid_flash_write_start
+	beq FLASH_SM_ERASE_SECTOR,spid_flash_erase_sector
+	beq FLASH_SM_WAIT_ERASE_SECTOR,spid_flash_wait_erase_sector
+	beq FLASH_SM_WRITE_DATA,spid_flash_write_data
+	beq FLASH_SM_WAIT_WRITE_DATA,spid_flash_wait_write_data
+	rtn
+
+spid_flash_write_start:
+	store 3,mem_spi_write_addr
+	copy rega,pdata
+	store 2,mem_spi_write_ptr
+	storet 2,mem_spi_write_len
+	jam FLASH_SM_ERASE_SECTOR,mem_spi_write_flash_sm
+	branch spid_init_flash
+spid_flash_erase_sector:
+	call spid_init_flash
+	jam FLASH_SM_WAIT_ERASE_SECTOR,mem_spi_write_flash_sm
+	call spid_unlock_flash
+	arg mem_spid_tbuf,rega
+	jam 4,core_spid_txlen
+	fetch 3,mem_spi_write_addr
+	arg FLASH_COMMAND_SECTOR_ERASE,temp
+	branch spid_write_flash_common
+	
+spid_flash_wait_erase_sector:
+	call spid_init_flash
+	call wait_spid_flash_done
+	jam FLASH_SM_WRITE_DATA,mem_spi_write_flash_sm
+	rtn
+
+
+spid_flash_write_data:
+	call spid_init_flash
+	jam FLASH_SM_WAIT_WRITE_DATA,mem_spi_write_flash_sm
+	call spid_unlock_flash
+	call spid_flash_data_preserve
+	call spid_write_flash
+	branch spid_flash_data_recover
+spid_flash_wait_write_data:
+	call spid_init_flash
+	call spid_unlock_flash
+	setarg FLASH_READ_SATUS
+	call spid_read_reg
+	rtnbit1 FLASH_STATUS_WIP
+	jam FLASH_SM_NO_BUYS,mem_spi_write_flash_sm
+	fetch 2,mem_cb_spi_flash_write_complate
+	branch callback_func
+spid_flash_data_recover:
+	fetch 4,mem_temp
+	fetcht 2,mem_spi_write_ptr
+spid_flash_data_recover_comm:
+	increase -4,temp
+	istore 4,temp
+	rtn
+spid_flash_data_preserve:
+	fetcht 2,mem_spi_write_ptr
+	copy temp,rega
+	increase -4,temp
+	ifetch 4,temp
+	store 4,mem_temp
+	fetcht 2,mem_spi_write_len
+	fetch 3,mem_spi_write_addr
+	rtn
+
+spid_init_flash:
+	call spi_gpio_init
+	call twspi_disable
+	setarg 0
+	store 4,mem_spid_tbuf
+	rtn
+
+spid_unlock_flash:
+	jam FLASH_COMMAND_WRITE_ENABLE,mem_spid_tbuf
+spid_sendcmd_common:	
+	setarg 0
+	store 2,core_spid_rxlen
+	setarg 1
+	store 2,core_spid_txlen
+	setarg mem_spid_tbuf
+	store 2,core_spid_txaddr
+	jam spid_start,core_misc_ctrl
+	branch wait_spid_done
+	
+spid_flash_release_form_powerdown:
+	jam FLASH_COMMAND_RELEASE_FROM_POWERDOWN,mem_spid_tbuf
+	branch spid_sendcmd_common
+	
+spid_flash_powerdown:
+	jam FLASH_COMMAND_POWERDOWN,mem_spid_tbuf
+	branch spid_sendcmd_common
+	
+/* pdata is flash address, rega pointers to txdata(4 ahead bytes should be left), temp is length */
+spid_write_flash:
+
+	increase 4,temp
+	storet 2,core_spid_txlen
+	arg FLASH_COMMAND_WRITE_DATA,temp
+	increase -4,rega
+//	branch spid_write_flash_common
+spid_write_flash_common:
+	istoret 1,rega
+	rshift16 pdata,temp
+	istoret 1,contw
+	rshift8 pdata,temp
+	istoret 1,contw
+	istore 1,contw
+	deposit rega
+	store 2,core_spid_txaddr
+	setarg 0
+	store 2,core_spid_rxlen
+	jam spid_start,core_misc_ctrl
+	call wait_spid_done
+	branch wait_spid_flash_done
+
+
+/* temp is length, rega pointers to buf   */
+spid_read_flash:
+	storet 2,core_spid_rxlen
+	rshift16 pdata,temp
+	storet 1,mem_addr_hi
+	rshift8 pdata,temp
+	storet 1,mem_addr_mi
+	store 1,mem_addr_lo
+	setarg 4
+	store 2,core_spid_txlen
+	jam FLASH_COMMAND_READ_DATA,mem_spid_tbuf
+	setarg mem_spid_tbuf
+	store 2,core_spid_txaddr
+	deposit rega
+	store 2,core_spid_rxaddr
+	fetch 1,core_spid_ctrl
+	isolate0 15,rega
+	setflag true,6,pdata
+	store 1,core_spid_ctrl
+	jam spid_start,core_misc_ctrl
+spid_read_flash_wait:
+	fetch 1,core_dma_status
+	bbit1 7,spid_read_flash_wait			// waiting for spid write
+	arg spid_done,queue
+	branch wait_spid_done
+
+wait_spid_flash_done:
+	setarg 2000
+	call sleep
+	call spid_unlock_flash
+	setarg mem_spid_rbuf
+	store 2,core_spid_rxaddr
+	setarg FLASH_READ_SATUS
+	call spid_read_reg
+	bbit1 FLASH_STATUS_WIP,wait_spid_flash_done
+	rtn
+
+
+/* temp is length, rega pointers to buf  */
+spid_load_flash:
+	storet 2,core_spid_rxlen
+	setarg 4
+	store 2,core_spid_txlen
+	jam 3,mem_spid_tbuf
+	setarg mem_spid_tbuf
+	store 2,core_spid_txaddr
+	deposit rega
+	store 2,core_spid_rxaddr
+	fetch 1,core_spid_ctrl
+	isolate0 15,rega
+	setflag true,6,pdata
+	store 1,core_spid_ctrl
+	jam spid_start,core_misc_ctrl
+spi_load_flash_wait:
+	fetch 1,core_dma_status
+	bbit1 7,spi_load_flash_wait			// waiting for spid write
+	arg spid_done,queue
+	call decrypt_code
+	call wait_spid_done
+	isolate1 spid_crcok,pdata
+	call set_ucode_status
+	fetch 1,mem_addr_hi
+	lshift16 pdata,regb
+	fetch 1,mem_addr_mi
+	lshift8 pdata,pdata
+	ior regb,regb
+	fetch 1,mem_addr_lo
+	ior regb,pdata
+	iadd temp,pdata
+	store 1,mem_addr_lo
+	rshift8 pdata,pdata
+	store 1,mem_addr_mi
+	rshift8 pdata,pdata
+	store 1,mem_addr_hi
+	rtn
+	
+spi_gpio_init:
+	fetch 1,mem_spi_cs_gpio
+	fetcht 1,mem_spi_so_gpio
+	isub temp,null
+	nbranch spi_pin_set,zero
+	call spi_gpio_default_init
+	
+spi_pin_set:
+	fetch 1,mem_spi_cs_gpio
+	arg gpcfg_spid_ncs,temp
+	call gpio_config_function_int
+	fetch 1,mem_spi_sclk_gpio
+	arg gpcfg_spid_sck,temp
+	call gpio_config_function_int
+	fetch 1,mem_spi_si_gpio
+	arg gpcfg_spid_mosi,temp
+	call gpio_config_function_int
+	fetch 1,mem_spi_so_gpio
+	arg gpcfg_spid_miso,temp
+	branch gpio_config_function_int
+
+spi_gpio_default_init:
+	jam 14,mem_spi_cs_gpio
+	jam 13,mem_spi_si_gpio
+	jam 16,mem_spi_so_gpio
+	jam 15,mem_spi_sclk_gpio
+	jam 17,mem_spi_wp_gpio
+	jam 18,mem_spi_hold_gpio
+	rtn
+
+
+/* ===================== SPI2 dma ======================= */
+ifdef SPI2
+spid2_init:
+	branch spid2_init_common
+spid2_init_common:
+	fetch 1,mem_spi_init_clk
+	store 1,core_spid2_ctrl	// A7530 should at least 34, or write fail
+	fetch 1,mem_spi_init_delay_time
+	store 1,core_spid2_delay	// 4us delay
+	setarg mem_spid2_tbuf
+	store 2,core_spid2_txaddr
+	setarg mem_spid2_rbuf
+	store 2,core_spid2_rxaddr
+	branch twspi2_disable
+/* pdata 6:0 is reg address, 15:8 is data to write */
+spid2_write_reg:
+	set1 7,pdata
+	store 2,mem_spid2_tbuf
+	jam 2,core_spid2_txlen
+	jam 0,core_spid2_rxlen
+	jam spid2_start,core_misc_ctrl
+	branch wait_spid2_done
+/* pdata 6:0 is reg address, temp is bytes to read */
+spid2_read_reg:
+	force 1,temp
+spid2_read_regs:
+	store 1,mem_spid2_tbuf
+	jam 1,core_spid2_txlen
+	storet 2,core_spid2_rxlen
+	jam spid2_start,core_misc_ctrl
+	call wait_spid2_done
+	fetch 1,mem_spid2_rbuf
+	rtn
+wait_spid2_done:
+	fetch 2,mem_afh_error_total
+	increase 1,pdata
+	store 2,mem_afh_error_total
+	fetch 1,core_perf_status
+	bbit0 spid_done,wait_spid2_done
+	rtn
+spid2_init_flash:
+	call spi2_gpio_init
+	setarg 0
+	store 4,mem_spid2_tbuf
+	fetch 1,core_spid2_ctrl
+	set1 3,pdata
+	store 1,core_spid2_ctrl
+	rtn
+spid2_unlock_flash:
+	setarg 0
+	store 2,core_spid2_rxlen
+	setarg 1
+	store 2,core_spid2_txlen
+	setarg mem_spid2_tbuf
+	store 2,core_spid2_txaddr
+	jam FLASH_COMMAND_WRITE_ENABLE,mem_spid2_tbuf
+	jam spid2_start,core_misc_ctrl
+	branch wait_spid2_done
+flash_write_spi2_sm_timer:
+	fetch 1,mem_spi2_write_flash_sm 	
+	beq FLASH_SM_START,spid2_flash_write_start
+	beq FLASH_SM_ERASE_SECTOR,spid2_flash_erase_sector
+	beq FLASH_SM_WAIT_ERASE_SECTOR,spid2_flash_wait_erase_sector
+	beq FLASH_SM_WRITE_DATA,spid2_flash_write_data
+	beq FLASH_SM_WAIT_WRITE_DATA,spid2_flash_wait_write_data
+	rtn
+spid2_flash_write_start:
+	store 3,mem_spi2_write_addr
+	copy rega,pdata
+	store 2,mem_spi2_write_ptr
+	storet 2,mem_spi2_write_len
+	jam FLASH_SM_ERASE_SECTOR,mem_spi2_write_flash_sm
+	branch spid2_init_flash
+spid2_flash_erase_sector:
+	call spid2_init_flash
+	jam FLASH_SM_WAIT_ERASE_SECTOR,mem_spi2_write_flash_sm
+	call spid2_unlock_flash
+	arg mem_spid2_tbuf,rega
+	jam 4,core_spid2_txlen
+	fetch 3,mem_spi2_write_addr
+	arg FLASH_COMMAND_SECTOR_ERASE,temp
+	branch spid2_write_flash_common
+spid2_flash_wait_erase_sector:
+	call spid2_init_flash
+	call wait_spid2_flash_done
+	jam FLASH_SM_WRITE_DATA,mem_spi2_write_flash_sm
+	rtn
+spid2_flash_write_data:
+	call spid2_init_flash
+	jam FLASH_SM_WAIT_WRITE_DATA,mem_spi2_write_flash_sm
+	call spid2_unlock_flash
+	call spid2_flash_data_preserve
+	call spid2_write_flash
+	branch spid2_flash_data_recover
+spid2_flash_wait_write_data:
+	call spid2_init_flash
+	call spid2_unlock_flash
+	setarg FLASH_READ_SATUS
+	call spid2_read_reg
+	rtnbit1 FLASH_STATUS_WIP
+	jam FLASH_SM_NO_BUYS,mem_spi2_write_flash_sm
+	fetch 2,mem_cb_spi2_flash_write_complate
+	branch callback_func
+spid2_flash_data_recover:
+	fetch 4,mem_temp
+	fetcht 2,mem_spi2_write_ptr
+	branch spid_flash_data_recover_comm
+spid2_flash_data_preserve:
+	fetcht 2,mem_spi2_write_ptr
+	copy temp,rega
+	increase -4,temp
+	ifetch 4,temp
+	store 4,mem_temp
+	fetcht 2,mem_spi2_write_len
+	fetch 3,mem_spi2_write_addr
+	rtn
+spid2_write_flash:
+	increase 4,temp
+	storet 2,core_spid2_txlen
+	arg FLASH_COMMAND_WRITE_DATA,temp
+	increase -4,rega
+spid2_write_flash_common:
+	istoret 1,rega
+	rshift16 pdata,temp
+	istoret 1,contw
+	rshift8 pdata,temp
+	istoret 1,contw
+	istore 1,contw
+	deposit rega
+	store 2,core_spid2_txaddr
+	setarg 0
+	store 2,core_spid2_rxlen
+	jam spid2_start,core_misc_ctrl
+	call wait_spid2_done
+	branch wait_spid2_flash_done	
+spid2_read_flash:
+	storet 2,core_spid2_rxlen
+	rshift16 pdata,temp
+	storet 1,mem_addr_hi2
+	rshift8 pdata,temp
+	storet 1,mem_addr_mi2
+	store 1,mem_addr_lo2
+	setarg 4
+	store 2,core_spid2_txlen
+	jam FLASH_COMMAND_READ_DATA,mem_spid2_tbuf
+	setarg mem_spid2_tbuf
+	store 2,core_spid2_txaddr
+	deposit rega
+	store 2,core_spid2_rxaddr
+	fetch 1,core_spid2_ctrl
+	isolate0 15,rega
+	setflag true,6,pdata
+	store 1,core_spid2_ctrl
+	jam spid2_start,core_misc_ctrl
+spid2_read_flash_wait:
+	fetch 1,core_perf_status
+	bbit1 7,spid2_read_flash_wait			// waiting for spid write
+	arg spid_done,queue
+	branch wait_spid2_done
+wait_spid2_flash_done:
+	setarg 2000
+	call sleep
+	call spid2_unlock_flash
+	setarg mem_spid2_rbuf
+	store 2,core_spid2_rxaddr
+	setarg FLASH_READ_SATUS
+	call spid2_read_reg
+	bbit1 FLASH_STATUS_WIP,wait_spid2_flash_done
+	rtn
+spi2_gpio_init:
+	fetch 1,mem_spi2_cs_gpio
+	arg gpcfg_spid2_ncs,temp
+	call gpio_config_function_int
+	fetch 1,mem_spi2_sclk_gpio
+	arg gpcfg_spid2_sck,temp
+	call gpio_config_function_int
+	fetch 1,mem_spi2_si_gpio
+	arg gpcfg_spid2_mosi,temp
+	call gpio_config_function_int
+	fetch 1,mem_spi2_so_gpio
+	arg gpcfg_spid2_miso,temp
+	branch gpio_config_function_int
+endif
+/*****************************************************************************
+*soft reset chip
+*****************************************************************************/
+soft_reset_chip:
+	jam 1,core_reset
+	rtn
+
+
+
+/* ===================== I2C dma ======================= */
+
+/* scl high time: scl_high + 2 clks, scl low time:scl_low + 6 clks
+data setup time: data_setup + 2 clks, data hold time: scl_low-setup-hold+4 clks */
+iic_init_600khz:
+	jam 5,core_iicd_scl_low
+ 	jam 7,core_iicd_scl_high
+	jam 7,core_iicd_start_setup
+	jam 7,core_iicd_start_hold
+	jam 7,core_iicd_stop_setup
+	jam 5,core_iicd_data_setup
+	jam 0,core_iicd_data_hold
+	rtn
+	
+iic_init_360khz:	//360khz
+	jam 12,core_iicd_scl_low
+	jam 13,core_iicd_scl_high
+	jam 13,core_iicd_start_setup
+	jam 13,core_iicd_start_hold
+	jam 13,core_iicd_stop_setup
+	jam 12,core_iicd_data_setup
+	jam 0,core_iicd_data_hold	
+  	rtn
+
+iicd_init_pin:
+	call iicd_eeprom_write_enable
+iicd_init_pin_scl_sda:
+	fetch 1,mem_eeprom_scl_gpio
+	arg gpcfg_iic_scl|gpcfg_pullup,temp
+	call gpio_config_function_int
+	fetch 1,mem_eeprom_sda_gpio
+	arg gpcfg_iic_sda|gpcfg_pullup,temp
+	branch gpio_config_function_int
+
+iicd_read_init_pin:
+	call iicd_eeprom_write_disable
+	branch iicd_init_pin_scl_sda
+
+wait_iicd_done:
+	fetch 1,core_dma_status
+	bbit0 iicd_done,wait_iicd_done
+	rtn
+
+	/* pdata is iic addr, rega points to buf, temp is length */
+iicd_read_data:
+	store 1,mem_iicd_addr
+	setarg mem_iicd_addr
+	store 2,core_iicd_txaddr
+	setarg 1
+	store 2,core_iicd_txlen
+	storet 2,core_iicd_rxlen
+	storer rega,2,core_iicd_rxaddr
+	jam 1,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	branch wait_iicd_done
+
+	/* rega points to buf, temp is length */
+iic_write_data:
+	setarg 0
+	store 2,core_iicd_rxlen
+	store 2,core_iicd_rxaddr
+	storet 2,core_iicd_txlen
+	storer rega,2,core_iicd_txaddr
+	jam 1,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	branch wait_iicd_done
+
+set_eeprom_size_2k:
+	set1 mark_eeprom_size,mark
+	jam 0x08,mem_eeprom_block_size
+	rtn
+
+clear_eeprom_size_2k:
+	set0 mark_eeprom_size,mark
+	jam 0x20,mem_eeprom_block_size
+	rtn
+
+
+iicd_read_eep_data_size_2k:
+ 	fetch 1,mem_eeprom_base
+	iadd regb,pdata
+	store 1,mem_addr_mi
+	branch iicd_read_eep_size_2k
+
+iicd_read_eep_size_2k_lcadcode:
+	fetch 2,mem_addr_mi
+	byteswap pdata,pdata
+	store 1,mem_addr_mi
+	
+//length:temp 
+//mem ptr:rega
+//eeprom addr:pdata
+iicd_read_eep_size_2k:
+ 	setarg 3
+	store 2,core_iicd_txlen
+	jam 0xa0,mem_iicd_tbuf
+	jam 0xa1,mem_iicd_tbuf+2
+	branch iicd_read_eep_common
+
+
+//length:temp 
+//mem ptr:rega
+//eeprom addr:regb
+iicd_write_protect_eep_data:
+	storet 2,mem_temp
+	call iicd_eeprom_write_enable
+	fetcht 2,mem_temp
+	call iicd_write_eep_data
+	branch iicd_eeprom_write_disable
+	
+iicd_eeprom_write_enable:
+	fetch 1,mem_eeprom_wp_gpio
+	rtneq GPIO_DISABLE
+	bbit0 6,iicd_wp_gpio_output_low
+	setarg 150000
+	call sleep
+iicd_wp_gpio_output_low:
+	fetcht 1,mem_eeprom_wp_gpio
+	branch gpio_out_active
+	
+iicd_eeprom_write_disable:
+	fetcht 1,mem_eeprom_wp_gpio
+	branch gpio_out_inactive
+	
+//length:temp 
+//mem ptr:rega
+//eeprom addr offset:regb
+iicd_read_eep_data:
+	bpatchx patch24_4,mem_patch24
+	bmark1 mark_eeprom_size,iicd_read_eep_data_size_2k
+	fetch 2,mem_eeprom_base
+	iadd regb,pdata
+	byteswap pdata,pdata
+	store 2,mem_addr_mi
+
+/* rega pointers to buf, temp is length  */
+iicd_read_eep:
+	bpatchx patch24_5,mem_patch24
+	bmark1 mark_eeprom_size,iicd_read_eep_size_2k_lcadcode
+	setarg 4
+	store 2,core_iicd_txlen
+	jam 0xa0,mem_iicd_tbuf
+	jam 0xa1,mem_iicd_tbuf+3
+iicd_read_eep_common:	
+	setarg mem_iicd_tbuf
+	store 2,core_iicd_txaddr
+	storet 2,core_iicd_rxlen
+	storer rega,2,core_iicd_rxaddr
+	setarg 2
+	isolate0 15,rega
+	setflag true,0,pdata
+	store 1,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	arg iicd_done,queue
+	call decrypt_code
+	call wait_iicd_done
+	isolate1 iicd_crcok,pdata
+	call set_ucode_status
+	bmark1 mark_eeprom_size,iicd_read_eep_load_code_size_2k
+	fetch 2,mem_addr_mi
+	byteswap pdata,pdata
+	iadd temp,pdata
+	byteswap pdata,pdata
+	store 2,mem_addr_mi
+	rtn
+
+iicd_read_eep_load_code_size_2k:
+	fetch 1,mem_addr_mi
+	iadd temp,pdata
+	byteswap pdata,pdata
+	store 2,mem_addr_mi
+	rtn
+	
+
+//length:temp 
+//mem ptr:rega
+//eeprom addr offset:regb
+iicd_write_eep_data:
+	fetch 2,mem_eeprom_base
+	iadd regb,pdata
+
+//cuur ptr:pdata length:temp buf:rega
+iicd_write_ota_data:
+	store 2,mem_pdatatemp //curr ptr
+	bpatchx patch24_6,mem_patch24
+	storet 2,mem_temp	//len
+	storer rega,2,mem_contr
+iicd_write_eep_loop:
+	call iicd_eep_transparency
+
+	fetcht 2,mem_regb
+	fetchr rega,2,mem_contr
+	fetch 2,mem_pdatatemp
+	
+	call iicd_write_eep
+	
+	fetch 2,mem_regb
+	fetcht 2,mem_contr
+	iadd temp,temp
+	storet 2,mem_contr
+	fetcht 2,mem_pdatatemp
+	iadd temp,temp
+	storet 2,mem_pdatatemp
+	fetch 2,mem_temp
+	nbranch iicd_write_eep_loop,blank
+	rtn
+	
+//in:
+//1.size 2.len 3.src 4.des
+//mem_regc page's area
+//mem_pdatatemp curr ptr
+//mem_temp all len      
+//mem_regb curr len
+iicd_eep_transparency:
+	bpatchx patch24_7,mem_patch24
+	fetch 1,mem_eeprom_block_size
+	increase -1,pdata
+	fetcht 2,mem_pdatatemp
+	ior temp,pdata
+	increase 1,pdata
+	store 3,mem_regc
+
+	fetch 2,mem_temp
+	iadd temp,pdata
+
+	fetcht 3,mem_regc
+	isub temp,pdata
+	nbranch iicd_eep_deal_short_packet,positive
+	store 2,mem_temp
+	fetch 3,mem_regc
+	fetcht 2,mem_pdatatemp
+	isub temp,pdata
+	store 2,mem_regb
+	rtn
+iicd_eep_deal_short_packet:
+	fetch 2,mem_temp
+	store 2,mem_regb
+	setarg 0
+	store 2,mem_temp
+	rtn
+
+iicd_write_eep_size_2k:
+	copy regb,pdata
+	increase 2,temp
+	storet 2,core_iicd_txlen
+	increase -2,rega
+	ifetcht 3,rega
+	copy temp,regb
+	arg 0xa0,temp
+	istoret 1,rega
+	istore 1,contw
+	branch iicd_write_eep_common
+
+	/* pdata is eeprom address, rega pointers to txdata(3 ahead bytes should be left), temp is length */
+iicd_write_eep:
+	copy pdata,regb
+	bpatchx patch25_0,mem_patch25
+	bmark1 mark_eeprom_size,iicd_write_eep_size_2k
+	copy regb,pdata
+	increase 3,temp
+	storet 2,core_iicd_txlen
+	increase -3,rega
+	ifetcht 3,rega
+	copy temp,regb
+	arg 0xa0,temp
+	istoret 1,rega
+	byteswap pdata,pdata
+	istore 2,contw
+iicd_write_eep_common:	
+	storer rega,2,core_iicd_txaddr
+	setarg 0
+	store 2,core_iicd_rxlen
+	jam 1,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	call wait_iicd_done
+	istorer regb,3,rega
+iic_check_eeprom_standby:
+	bpatchx patch25_1,mem_patch25
+	jam 0,mem_iicd_tbuf+3
+iic_check_eeprom_standby_wait:
+	setarg 1
+	store 2,core_iicd_txlen
+	jam 0xa0,mem_iicd_tbuf
+	setarg mem_iicd_tbuf
+	store 2,core_iicd_txaddr
+	setarg 0
+	store 2,core_iicd_rxlen
+	store 2,core_iicd_rxaddr
+	setarg 3
+	store 1,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	call wait_iicd_done
+	fetch 1,core_dma_status
+	rtnbit0 iicd_ack
+	nop 1500
+	fetch 1,mem_iicd_tbuf+3
+	increase 1,pdata
+	store 1,mem_iicd_tbuf+3
+	sub pdata,40,null
+	nrtn positive//polling timeout 6ms
+	branch iic_check_eeprom_standby_wait
+
+/* ===================== efuse ======================= */
+//pdata: efuse address, rega :points to data, temp : count 
+efuse_read_data:
+	copy temp,loopcnt
+	copy pdata,temp
+	bpatchx patch25_2,mem_patch25
+	lshift3 temp,temp
+	call efuse_vdd_on
+	jam 0x80,core_efuse_ctrl
+efuse_read_loop:
+	jam 0x86,core_efuse_ctrl
+	storet 2,core_efuse_addr
+	increase 8,temp
+	jam 0x87,core_efuse_ctrl
+	fetch 1,core_efuse_rdata
+	istore 1,rega
+	increase 1,rega
+	loop efuse_read_loop
+	jam 0x86,core_efuse_ctrl
+	jam 0x80,core_efuse_ctrl
+	jam 0x0,core_efuse_ctrl
+	branch efuse_vdd_off
+
+//temp = efuse address, rega pointers data, loopcnt is count 
+efuse_program:
+	call efuse_vdd_fsource_on
+	jam 0x80,core_efuse_ctrl
+	lshift3 temp,temp
+	copy rega,contr
+efuse_program_loop:
+	ifetch 1,contr
+	arg 8,regb
+efuse_program_bit_loop:
+	and pdata,1,null
+	ncall efuse_program_bit,zero
+	rshift pdata,pdata
+	increase 1,temp
+	increase -1,regb
+	nbranch efuse_program_bit_loop,zero
+	loop efuse_program_loop
+	jam 0x80,core_efuse_ctrl
+	jam 0x0,core_efuse_ctrl
+	branch efuse_vdd_off
+    
+
+efuse_lna_pa_ldo_on:
+	fetch 1,core_rf_ldo_en0
+	set1 1,pdata
+	store 1,core_rf_ldo_en0
+	nop 200
+	fetch 1,core_rf_ldo_en1
+	set1 0,pdata
+	store 1,core_rf_ldo_en1
+	nop 2000
+	rtn
+
+efuse_vdd_fsource_on:
+	call efuse_lna_pa_ldo_on
+	fetch 1,core_rf_ldo_en1
+	set0 5,pdata
+	set1 4,pdata
+	set1 3,pdata
+	store 1,core_rf_ldo_en1
+	nop 500
+	rtn
+	
+efuse_vdd_on:
+	call efuse_lna_pa_ldo_on
+	fetch 1,core_rf_ldo_en1
+	set1 5,pdata
+	set1 4,pdata
+	set0 3,pdata
+	store 1,core_rf_ldo_en1
+	nop 500
+	rtn
+	
+efuse_vdd_off:
+	bpatchx patch25_3,mem_patch25
+	fetch 1,core_rf_ldo_en1
+	set0 5,pdata
+	set0 4,pdata
+	set0 3,pdata
+	set0 0,pdata	
+	store 1,core_rf_ldo_en1
+	nop 200
+	fetch 1,core_rf_ldo_en0
+	set0 1,pdata
+	store 1,core_rf_ldo_en0
+	rtn
+
+efuse_program_bit:
+	jam 0x80,core_efuse_ctrl
+	nop 10
+	storet 2,core_efuse_addr
+	jam 0x81,core_efuse_ctrl
+	nop 110
+	rtn
+
+/* ===================== uart dma ======================= */
+uarta_init_dma_mem:
+	call enable_user
+	branch uart_init_dma_mem
+uartb_init_dma_mem:
+	call disable_user
+	branch uart_init_dma_mem
+/*
+function name:uart_init_dma_mem
+input:
+	pdata is dma memory config
+	bit[0-15]:rx start memory address
+	bit[16-31]:rx ending memory address
+	bit[32-47]:tx start memory address
+	bit[48-63]:tx ending memory address
+	user is choice uart road
+	enable is mean check uart A
+	disable user is mean check uart B
+*/
+uart_init_dma_mem:
+	rshift16 pdata,temp
+	call uarta_init_rx,user
+	ncall uartb_init_rx,user
+	rshift32 pdata,pdata
+	rshift16 pdata,temp
+	call uarta_init_tx,user
+	ncall uartb_init_tx,user
+	nbranch uartb_init_dma_turn_on_clk,user
+	fetch 2,core_clkoff
+	set0 CLOCK_OFF_UART,pdata
+	store 2,core_clkoff
+	rtn
+uartb_init_dma_turn_on_clk:
+	fetch 2,core_clkoff
+	set0 CLOCK_OFF_UARTB,pdata
+	store 2,core_clkoff
+	rtn
+
+
+/*
+function name:uarta_init_baud_rate
+input:
+	pdata is uart A baud rate
+*/
+uarta_init_baud_rate:
+	store uart_baud_len,core_uart_baud
+	rtn
+
+
+/*
+function name:uartb_init_baud_rate
+input:
+	uartb_init_baud_rate is uart B baud rate
+*/
+uartb_init_baud_rate:
+	store uart_baud_len,core_uartb_baud
+	rtn
+
+/*
+function name:uarta_calc_baud_rate_config
+input:
+	temp is uart A baud rate,Decimal data
+	E.g:115200 input arg 115200,temp
+*/
+uarta_calc_baud_rate_config:
+	call uart_calc_baud_rate_config
+	branch uarta_init_baud_rate
+
+/*
+function name:uartb_calc_baud_rate_config
+input:
+	temp is uart B baud rate,Decimal data
+	E.g:115200 input arg 115200,temp
+*/
+uartb_calc_baud_rate_config:
+	call uart_calc_baud_rate_config
+	branch uartb_init_baud_rate
+
+/*
+function name:uart_calc_baud_rate_config
+input:
+	temp is uart baud rate,Decimal data
+	E.g:115200 input arg 115200,temp
+output:
+	pdata is CPU config uart baud rate
+*/
+uart_calc_baud_rate_config:
+	call uart_calc_baud_rate_config_choice_uart_clock
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	rtn
+
+uart_calc_baud_rate_config_choice_uart_clock:
+	fetch 1,core_uart_clksel
+	bbit0 UART_CLOCK_SELECT_BIT,uart_calc_baud_rate_config_choice_uart_clock_crystal
+	setarg uart_clock_freq_48M
+	rtn
+uart_calc_baud_rate_config_choice_uart_clock_crystal:
+	setarg uart_clock_freq_24M
+	rtn
+
+uart_clock_select_main_freq_crystal:
+	fetch 1,core_uart_clksel
+	and pdata,UART_CLOCK_SELECT_CRYSTAL,pdata
+	store 1,core_uart_clksel
+	rtn
+
+uart_clock_select_main_freq_dpll:
+	fetch 1,core_uart_clksel
+	or pdata,UART_CLOCK_SELECT_DPLL,pdata
+	store 1,core_uart_clksel
+	rtn
+
+
+	// pdata: tx buffer start, temp: tx buffer end
+uarta_init_tx:
+	store 2,core_uart_tsaddr
+	store 2,core_uart_twptr
+	storet 2,core_uart_teaddr
+	rtn
+
+	// pdata: tx buffer start, temp: tx buffer end
+uartb_init_tx:
+	store 2,core_uartb_tsaddr
+	store 2,core_uartb_twptr
+	storet 2,core_uartb_teaddr
+	rtn
+
+	// pdata: rx buffer start, temp: rx buffer end
+uarta_init_rx:
+	store 2,core_uart_rsaddr
+	store 2,core_uart_rrptr
+	storet 2,core_uart_readdr
+	rtn
+
+	// pdata: rx buffer start, temp: rx buffer end
+uartb_init_rx:
+	store 2,core_uartb_rsaddr
+	store 2,core_uartb_rrptr
+	storet 2,core_uartb_readdr
+	rtn
+
+
+uarta_prepare_tx:
+	fetchr contus,2,core_uart_tsaddr
+	fetchr contue,2,core_uart_teaddr
+	fetchr contu,2,core_uart_twptr
+	rtn
+
+uartb_prepare_tx:
+	fetchr contus,2,core_uartb_tsaddr
+	fetchr contue,2,core_uartb_teaddr
+	fetchr contu,2,core_uartb_twptr
+	rtn
+
+uarta_prepare_rx:
+	fetchr contus,2,core_uart_rsaddr
+	fetchr contue,2,core_uart_readdr
+	fetchr contu,2,core_uart_rrptr
+	rtn
+
+uartb_prepare_rx:
+	fetchr contus,2,core_uartb_rsaddr
+	fetchr contue,2,core_uartb_readdr
+	fetchr contu,2,core_uartb_rrptr
+	rtn
+
+uarta_send:
+	storer contu,2,core_uart_twptr
+	rtn
+
+uartb_send:
+	storer contu,2,core_uartb_twptr
+	rtn
+
+uarta_rxdone:
+	storer contu,2,core_uart_rrptr
+	rtn
+
+uartb_rxdone:
+	storer contu,2,core_uartb_rrptr
+	rtn
+
+uarta_clear_current_rx:
+	call uarta_prepare_rx
+	fetch 2,core_uart_rxitems
+	iadd contu,contu
+	branch uarta_rxdone
+
+uartb_clear_current_rx:
+	call uartb_prepare_rx
+	fetch 2,core_uartb_rxitems
+	iadd contu,contu
+	branch uartb_rxdone
+
+uarta_prepare_tx_register_push:
+	call uart_register_push
+	branch uarta_prepare_tx
+
+uartb_prepare_tx_register_push:
+	call uart_register_push
+	branch uartb_prepare_tx
+
+uarta_send_register_pop:
+	call uarta_send
+	branch uart_register_pop
+
+uartb_send_register_pop:
+	call uartb_send
+	branch uart_register_pop
+
+
+uart_register_push:
+	storer contu,2,mem_contu
+	storer contus,2,mem_contue
+	storer contue,2,mem_contus
+	rtn
+
+uart_register_pop:
+	fetchr contu,2,mem_contu
+	fetchr contus,2,mem_contue
+	fetchr contue,2,mem_contus
+	rtn
+
+
+uart_copy_tx_bytes_fast:
+	deposit loopcnt
+	rtn blank
+uart_copy_tx_bytes_fast_loop:
+	increase -8,loopcnt
+	call uart_tx_8_bytes,positive
+	rtn zero
+	branch uart_copy_tx_bytes_fast_loop,positive
+	increase 8,loopcnt
+uart_copy_tx_bytes_fast_loop_four:
+	increase -4,loopcnt
+	call uart_tx_4_bytes,positive
+	rtn zero
+	branch uart_copy_tx_bytes_fast_loop_four,positive
+	increase 4,loopcnt
+	branch uart_copy_tx_bytes
+
+uart_tx_16_bytes:
+	call uart_tx_8_bytes
+uart_tx_8_bytes:
+	ifetch 8,contr
+	istore 8,contu
+	rtn
+
+uart_tx_4_bytes:
+	ifetch 4,contr
+	istore 4,contu
+	rtn
+
+uart_copy_tx_bytes:
+	deposit loopcnt
+	rtn blank
+uart_copy_tx_bytes_loop:
+	ifetch 1,contr
+	istore 1,contu
+	loop uart_copy_tx_bytes_loop
+	rtn
+
+uart_copy_rx_bytes_fast:
+	deposit loopcnt
+	rtn blank
+uart_copy_rx_bytes_fast_loop:
+	increase -8,loopcnt
+	call uart_rx_8_bytes,positive
+	rtn zero
+	branch uart_copy_rx_bytes_fast_loop,positive
+	increase 8,loopcnt
+uart_copy_rx_bytes_fast_loop_four:
+	increase -4,loopcnt
+	call uart_rx_4_bytes,positive
+	rtn zero
+	branch uart_copy_rx_bytes_fast_loop_four,positive
+	increase 4,loopcnt
+	branch uart_copy_rx_bytes
+
+uart_rx_16_bytes:
+	call uart_rx_8_bytes
+uart_rx_8_bytes:
+	ifetch 8,contu
+	istore 8,contw
+	rtn
+
+uart_rx_4_bytes:
+	ifetch 4,contu
+	istore 4,contw
+	rtn
+
+
+uart_copy_rx_bytes:
+	deposit loopcnt
+	rtn blank
+uart_copy_rx_bytes_loop:
+	ifetch 1,contu
+	istore 1,contw
+	loop uart_copy_rx_bytes_loop
+	rtn
+
+
+/* ===================== eeprom data ======================= */
+
+app_store_nvram_event:
+	jam BT_EVT_STORE_NVRAM,mem_fifo_temp
+	branch ui_ipc_send_event
+
+check_51cmd_store_reconn_info:
+check_51cmd_update_device_record:
+	bpatchx patch25_4,mem_patch25
+	fetch 1,mem_nv_data_number
+	rtn blank		// not nv data
+	call check_nvram
+	call init_device_list,zero
+	call disable_user2
+	call nvram_find_addr_from_bd_list
+write_device_record:
+	fetch 1,mem_nv_data_number
+	icopy regc
+	fetcht 2,mem_nv_data_ptr
+	storet 2,mem_list_item_ptr
+write_device_loop_find:
+	copy regc,pdata
+	branch app_store_nvram_event,blank  //EEPROM
+	increase -1,regc
+	copy temp,rega
+	ifetch 1,rega
+	fetcht 1,mem_select_list_item
+	isub temp,null
+	call set_index_finded_device,zero
+	branch write_device_loop_find0,positive
+	ifetch 1,rega
+	increase 1,pdata
+	istore 1,rega
+write_device_loop_find0:
+	fetcht 2,mem_list_item_ptr
+	increase NV_DATA_LEN,temp
+	storet 2,mem_list_item_ptr
+	branch write_device_loop_find
+
+set_index_finded_device:
+	setarg 0
+	istore 1,rega
+	fetch 1,mem_temp_reconn_record
+	istore 1,contw	
+	bne REC_3_MODE,set_index_finded_device_ble_mode
+	arg mem_link_key,regb
+set_index_find_device_MASTER_ADDR:
+	ifetch 6,contr
+	istore 8,contw
+	setarg 0
+	istore 8,contw
+	copy regb,contr
+store_rec_data_common:
+	call memcpy16
+	force 1,null
+	rtn
+
+set_index_finded_device_ble_mode:
+	beq REC_4_MODE_RANDOM_RESOLVABLE_PRIVATE_ADDRESS,set_index_finded_device_IRK
+	beq REC_4_MODE_RANDOM_NON_RESOLVABLE_PRIVATE_ADDRESS,set_index_finded_device_EDIV
+	arg mem_le_ltk,regb
+	branch set_index_find_device_MASTER_ADDR
+
+set_index_finded_device_IRK:
+	arg mem_le_irk,contr
+	call memcpy16
+store_ble_rec_data_common:
+	arg mem_le_ltk,contr
+	branch store_rec_data_common
+
+set_index_finded_device_EDIV:
+	arg mem_le_rand,contr
+	call memcpy16
+	branch store_ble_rec_data_common
+
+
+//enable user2 reconnect
+//disable user2 pairing
+nvram_find_addr_from_bd_list:
+	call disable_user
+	fetch 1,mem_nv_data_number
+	rtn blank		// not nv data
+	bpatchx patch25_5,mem_patch25
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_CONNECTED,find_addr_from_bd_list_SPP_mode
+	rtnbit0 UI_STATE_BLE_CONNECTED
+find_addr_from_bd_list_ble_mode:
+	fetch 1,mem_le_conn_peer_addr_type
+	beq MASTER_PUBLIC_ADDR,find_addr_from_bd_list_public_device_addr
+	fetch 1,mem_le_plap+5
+	compare 0xc0,pdata,0xc0
+	branch find_addr_from_bd_list_static_addr,true
+	compare 0x40,pdata,0xc0
+	branch find_addr_from_bd_list_random_addr,true
+	branch find_addr_from_bd_list_random_non_resolvable_private_address_sc_or_legacy
+
+find_addr_from_bd_list_static_addr:
+	branch find_addr_from_bd_list_static_addr_reconnect,user2
+	fetch 1,mem_le_preq_init_key_distribution
+	bbit0 LE_INITATOR_IRK_BIT,find_addr_from_bd_list_public_device_addr
+	branch find_addr_from_bd_list_static_addr_sc_or_legacy
+
+find_addr_from_bd_list_static_addr_reconnect:
+	call find_addr_from_bd_list_public_device_addr
+	rtn user
+	branch find_addr_from_bd_list_static_addr_sc_or_legacy
+
+
+find_addr_from_bd_list_static_addr_sc_or_legacy:
+find_addr_from_bd_list_random_non_resolvable_private_address_sc_or_legacy:
+	fetch 1,mem_le_pairing_mode
+	bbit1 LE_PAIRING_MODE_SECURE_CONNECT_BIT,find_addr_from_bd_list_random_non_resolvable_private_address_sc
+	branch find_addr_from_bd_list_random_non_resolvable_private_address
+
+find_addr_from_bd_list_static_addr_sc:
+find_addr_from_bd_list_random_non_resolvable_private_address_sc:
+	fetch 6,mem_le_plap
+	store 8,mem_le_rand
+	branch find_addr_from_bd_list_random_non_resolvable_private_address
+
+
+find_addr_from_bd_list_public_device_addr:
+	jam REC_4_MODE_STATIC_ADDRESS,mem_temp_reconn_record
+	fetch 6,mem_le_plap
+	branch find_addr_from_bd_list_common
+	
+find_addr_from_bd_list_random_non_resolvable_private_address:	
+	jam REC_4_MODE_RANDOM_NON_RESOLVABLE_PRIVATE_ADDRESS,mem_temp_reconn_record
+	branch find_addr_from_bd_list_common
+
+//input :pdata EDIV and rands
+find_addr_from_bd_list_random_addr:
+	jam REC_4_MODE_RANDOM_RESOLVABLE_PRIVATE_ADDRESS,mem_temp_reconn_record
+	branch find_addr_from_bd_list_common
+	
+//input :pdata EDIV and rands
+find_addr_from_bd_list_SPP_mode:
+	jam REC_3_MODE,mem_temp_reconn_record
+	fetch 6,mem_plap
+find_addr_from_bd_list_common:
+	store 6,mem_temp_lap
+	fetch 2,mem_nv_data_ptr
+	ifetcht 1,pdata
+	pincrease 1
+	store 2,mem_list_item_ptr
+	storet 1,mem_select_list_item
+	fetch 1,mem_nv_data_number
+	icopy regc
+nvram_find_addr_from_list:
+	fetch 2,mem_list_item_ptr
+	copy pdata,rega
+	call nvram_find_addr_from_list_compare
+	rtn user
+	fetcht 2,mem_list_item_ptr
+	increase NV_DATA_LEN,temp
+	storet 2,mem_list_item_ptr
+	increase -1,temp
+	ifetch 1,temp
+	store 1,mem_select_list_item
+	increase -1,regc
+	nbranch nvram_find_addr_from_list,zero
+	fetch 1,mem_nv_data_number
+	pincrease DECREASED_ONE
+	store 1,mem_select_list_item
+	rtn
+nvram_find_addr_from_list_compare:
+	fetch 1,mem_temp_reconn_record
+	bne REC_3_MODE,find_addr_from_list_compare_ble_mode
+find_master_addr_from_list_compare:
+	arg mem_temp_reconn_record,regb
+	arg 7,loopcnt
+	call string_compare
+	branch enable_user,zero
+	rtn
+
+find_addr_from_list_compare_ble_mode:
+	beq REC_4_MODE_RANDOM_RESOLVABLE_PRIVATE_ADDRESS,find_irk_form_list_compare
+	beq REC_4_MODE_RANDOM_NON_RESOLVABLE_PRIVATE_ADDRESS,find_ediv_form_list_compare
+	branch find_master_addr_from_list_compare
+
+find_irk_form_list_compare:
+	ifetcht 1,rega
+	isub temp,null
+	nrtn zero
+	arg mem_le_prand,contw
+	arg 16,loopcnt
+	call clear_mem
+	fetch 3,mem_le_plap+3
+	store 3,mem_le_prand
+	call genernate_master_MacAddress
+	fetch 2,mem_le_aes_128+13
+	byteswap pdata,pdata
+	lshift8 pdata,temp
+	ifetch 1,contr
+	iadd temp,pdata
+	fetcht 3,mem_le_plap
+	isub temp,null
+	branch enable_user,zero
+	rtn
+
+
+genernate_master_MacAddress:
+	arg mem_le_prand ,contr
+	call load_data128
+//	arg mem_le_irk,contr
+	ifetch 1,rega
+	call load_regext
+	force 0x38,aes_ctrl
+	force 0x0,aes_ctrl
+	call wait_aes
+	arg mem_le_aes_128,contw
+	branch store_aes_result
+
+find_ediv_form_list_compare:
+	ifetcht 1,rega
+	isub temp,null
+	nrtn zero
+	copy contr,rega
+	add contr,8,regc
+	arg mem_le_rand,regb
+	arg 8,loopcnt
+	call string_compare
+	branch enable_user,zero
+	copy regc,rega
+	arg mem_le_irk,regb
+	arg 8,loopcnt
+	call string_compare
+	branch enable_user,zero
+	rtn
+
+check_nvram:
+	fetch 2,mem_nv_data_ptr
+	ifetcht 1,pdata
+	pincrease NV_DATA_LEN
+	ifetch 1,pdata
+	isub temp,null
+	rtn
+
+init_device_list:
+	fetch 1,mem_nv_data_number
+	icopy loopcnt
+	fetcht 2,mem_nv_data_ptr
+	setarg 0
+init_device_list_loop:
+	istore 1,temp
+	increase NV_DATA_LEN,temp
+	pincrease 1
+	loop init_device_list_loop
+	rtn
+
+load_device_list:
+	bpatchx patch25_6,mem_patch25
+	call enable_user2
+	call nvram_find_addr_from_bd_list
+	fetch 1,mem_state
+	setflag user,state_combkey,pdata	/* we have link key */
+	store 1,mem_state
+	nbranch clear_key_exists,user
+	add rega,10,contr
+	arg mem_link_key,contw
+	call  memcpy16
+	branch check_link_key_load
+clear_key_exists:
+	jam 0,mem_link_key_exists
+	rtn
+
+load_device_list_mode_4:
+	fetch 9,mem_le_ediv
+	branch clear_ltk_exists,blank
+	call enable_user2
+	call nvram_find_addr_from_bd_list
+	nbranch clear_ltk_exists,user
+	fetch 2,mem_list_item_ptr
+	add pdata,1,contr
+	arg mem_le_irk,contw
+	call  memcpy16
+	arg mem_le_ltk,contw
+	call  memcpy16
+	jam 1,mem_ltk_exists
+	rtn
+
+clear_ltk_exists:
+	jam 0,mem_ltk_exists
+	rtn
+
+
+eeprom_store_le_reconn_info:
+	jam REC_4_MODE,mem_record_bt_mode
+	branch eeprom_store_reconn_info
+eeprom_store_bd_reconn_info:
+	jam REC_3_MODE,mem_record_bt_mode
+eeprom_store_reconn_info:
+	fetch 1,mem_device_option
+	beq dvc_op_module,check_51cmd_update_device_record
+	beq dvc_op_mouse,mouse_store_remote_bdaddr
+	rtn
+	
+
+check_link_key_load:
+	fetch 8,mem_link_key
+	fetcht 8,mem_link_key+8
+	ior temp,pdata
+	rtn blank
+	jam 1,mem_link_key_exists
+	rtn
+	
+
+/* =============== GPIO CONTROL ================= */
+
+
+//temp [4:0]=GPIO number, 0-31, 
+gpio_set_wake_by_current_state:
+	bpatchx patch25_7,mem_patch25
+	set1 gpio_active_bit,temp
+	call gpio_get_bit
+	nsetflag true,gpio_active_bit,temp
+
+//temp [4:0]=GPIO number, 0-31, [7]=0, low active
+gpio_set_wake:
+	bpatchx patch26_0,mem_patch26
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	rtn zero
+	isolate0 gpio_active_bit,temp
+	and temp,0x1f,queue
+	fetch 4,mem_gpio_wakeup_low
+	qsetflag true,pdata
+	store 4,mem_gpio_wakeup_low
+	fetch 4,mem_gpio_wakeup_high
+	nqsetflag true,pdata
+	store 4,mem_gpio_wakeup_high
+	rtn
+	
+//temp [4:0]=GPIO number, 0-31, [7]=0, low active
+gpio_clr_wake:
+	bpatchx patch26_1,mem_patch26
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	rtn zero
+	isolate0 gpio_active_bit,temp
+	and temp,0x1f,queue
+	fetch 4,mem_gpio_wakeup_low
+	qset0 pdata
+	store 4,mem_gpio_wakeup_low
+	fetch 4,mem_gpio_wakeup_high
+	qset0 pdata
+	store 4,mem_gpio_wakeup_high
+	rtn
+
+gpio_config_input_nowake:
+	call gpio_clr_wake
+	branch gpio_config_input_without_wake
+
+//temp [4:0]=GPIO number, 0-31, [7]=0, low active
+gpio_config_input:
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	rtn zero
+	ncall gpio_set_wake,wake
+gpio_config_input_without_wake:
+	call gpio_addr
+	setarg 0
+	isolate1 gpio_active_bit,temp
+	nsetflag true,6,pdata
+	setflag true,7,pdata
+	branch gpio_write
+
+//temp is gpio number, return true if gpio active
+gpio_get_bit:
+	arg core_gpio_in,contw
+	and temp,0x07,queue
+	rshift3 temp,pdata
+	and_into 3,pdata
+	iadd contw,contw
+	ifetch 1,contw
+	isolate1 gpio_active_bit,temp
+	branch gpio_get_bit_reverse,true
+	qisolate0 pdata
+	rtn
+gpio_get_bit_reverse:
+	qisolate1 pdata
+	rtn
+
+//temp [5:0]=GPIO number, 0-39, [7]=0, low active. set gpio to inactive state
+gpio_out_inactive:
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	rtn zero
+	isolate1 gpio_active_bit,null
+	branch gpio_out_flag
+
+gpio_config_output:
+gpio_out_active:
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	rtn zero
+	isolate0 gpio_active_bit,null
+
+//temp is gpio number,  [7]=1,set out equa true flag if gpio active
+gpio_out_flag:
+	setarg 0
+	nsetflag true,gpio_active_bit,pdata
+	ixor temp,temp
+
+//temp is gpio number,0-31, [7]=out bit value
+gpio_out:
+	call gpio_addr
+	setarg gpcfg_output_high
+	isolate1 gpio_active_bit,temp
+	setflag true,0,pdata
+	branch gpio_write
+
+//check output status
+gpio_check_active:
+	call gpio_addr
+	ifetch 1,contw
+	bbit1 0,gpio_check_active_high
+	isolate0 gpio_active_bit,temp
+	rtn
+gpio_check_active_high:
+	isolate0 gpio_active_bit,temp
+	rtn
+
+gpio_set_analog:
+	call gpio_addr
+	setarg gpcfg_no_ie
+gpio_write:
+	istore 1,contw
+	rtn
+
+gpio_set_high_impedance:
+	call gpio_addr
+	setarg gpcfg_high_impedance
+	branch gpio_write
+
+//set all unused gpio to pull down mode to save power
+gpio_pd_idle:
+	arg core_gpio_conf,contr
+	arg 19,loopcnt
+gpio_pd_idle_loop:
+	ifetch 1,contr
+	nbranch gpio_pd_idle_configured,blank
+	setarg 0x80
+	add contr,-1,contw
+	istore 1,contw
+gpio_pd_idle_configured:
+	loop gpio_pd_idle_loop
+	rtn
+
+gpio_addr:
+	and temp,0x3f,pdata
+	arg core_gpio_conf,contw
+	iadd contw,contw
+	rtn
+
+gpio_config_param:
+	and pdata,0xff,temp
+	rshift8 pdata,pdata
+	branch gpio_config_function_int
+
+//pdata: gpio number bit7=1, temp: function type
+gpio_config_function:
+	rtnbit0 gpio_active_bit
+gpio_config_function_int:
+	and_into 0x3f,pdata
+	arg core_gpio_conf,contw
+	iadd contw,contw
+	istoret 1,contw
+	rtn
+
+//temp:gpio num
+gpio_get_config:
+	and_into 0x3f,temp
+	setarg core_gpio_conf
+	iadd temp,contr
+	ifetch 1,contr
+	rtn
+
+gpio_set_before_lpm_common:
+	bpatchx patch26_2,mem_patch26
+	rtn
+
+
+//The default as shutter and remote
+gpio_set_before_lpm:
+	arg 20,loopcnt
+	arg core_gpio_conf,contr
+setgpio_loop:
+	copy contr,contw
+	ifetch 1,contr
+	beq gpcfg_qspi_ncs,setgpio_pullup
+	beq gpcfg_qspi_sck,setgpio_pullup
+	beq gpcfg_qspi_io0,setgpio_pullup
+	beq gpcfg_qspi_io1,setgpio_pullup
+	beq gpcfg_qspi_io2,setgpio_pullup
+	beq gpcfg_qspi_io3,setgpio_pullup
+	beq gpcfg_spid_miso,setgpio_pullup
+	beq gpcfg_spid_ncs,setgpio_pullup
+	beq gpcfg_spid_sck,setgpio_pullup
+	beq gpcfg_spid_mosi,setgpio_pullup
+	beq gpcfg_spid_sdio,setgpio_pullup
+	beq gpcfg_iic_scl,setgpio_pullup
+	beq gpcfg_iic_sda,setgpio_pullup
+	beq gpcfg_input,setgpio_pullup
+setgpio_loop_end:
+	loop setgpio_loop
+	rtn
+setgpio_pullup:
+	setarg gpcfg_pullup
+	istore 1,contw
+	branch setgpio_loop_end
+setgpio_pulldown:
+	setarg gpcfg_pulldown
+	istore 1,contw	
+	branch setgpio_loop_end
+
+/*************************************ADC*************************************/
+
+
+//mem_adc_config_flag 0:vinlpm 1:Hvin 2: GPIO
+adc_init_data:
+	bpatchx patch26_3,mem_patch26
+	arg mem_temp_block2,rega
+	arg 12,temp
+	setarg EFUSE_OFFSET_ADC_PARAM
+	call efuse_read_data
+	call enable_adc
+	call adc_init_wait_count
+adc_init_cal_data:
+	fetch 8,mem_temp_block2+3
+	branch adc_init_cal_data_default,blank
+	arg mem_temp_block2+3,contr
+	arg mem_3v_adc_io_data,contw
+	arg 3,loopcnt
+adc_init_cal_data_loop:	
+	ifetch 3,contr	
+	lshift4 pdata,temp
+	istoret 2,contw
+	rshift8 pdata,temp
+	istoret 2,contw
+	loop adc_init_cal_data_loop
+	rtn 
+	
+adc_init_cal_data_default:
+	setarg 0x469a
+	store 2,mem_3v_adc_io_data
+	setarg 0xab77
+	store 2,mem_1v_adc_io_data
+	setarg 0x73d0
+	store 2,mem_3v_adc_vinlpm_data
+	setarg 0x9658
+	store 2,mem_2v_adc_vinlpm_data
+	rtn	
+	
+adc_init_wait_count:
+	fetch 1,mem_temp_block2
+	nrtn blank
+	jam 12,mem_adc_wait_count
+	rtn	
+
+
+adc_wait_timer:
+	arg mem_app_adc_read_count,regc
+	arg enable_adc,regb
+	branch timer_single_step
+	
+idle_read_adc_wait:
+	rtnmark0 mark_adc_enable
+	and clkn_bt,0xff,pdata
+	fetcht 1,mem_start_adc_clkn
+	call get_diff
+	fetch 1,mem_adc_wait_count
+	isub rega,null
+	rtn positive
+	fetch 2,core_adc_sum
+	store 2,mem_adc_current_value
+	set0 mark_adc_enable,mark
+	jam 50,mem_app_adc_read_count
+	fetch 1,core_sum_en
+	set0 7,pdata
+	store 1,core_sum_en
+	jam 0,core_gpadc_ctrl
+	rtn
+
+	
+// zero: disable adc
+enable_adc_check:
+	bbit0 state_insniff,context_search_next
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,enable_adc_check_le
+//	bbit1 mode_master, context_search_next
+	add rega,coffset_tsniff,contr
+	ifetch 2,contr
+	arg 0xffff,temp
+	isub temp,null
+	branch enable_zero,zero
+	branch context_search_next
+	
+enable_adc_check_le:
+	ifetch 1,rega
+	bbit0 lestate_got_first_packet,enable_zero
+	bbit1 lestate_update_param,enable_zero
+	bbit1 lestate_update_map,enable_zero
+	bbit1 lestate_update_phy,enable_zero
+	add rega,coffset_le_event_cnt,contr
+	ifetch 2,contr
+	sub pdata,7,null
+	branch enable_zero,positive
+	branch context_search_next
+	
+enable_adc_wait:
+	jam 1,mem_app_adc_read_count
+	rtn
+	
+enable_adc:	
+	bpatchx patch26_4,mem_patch26
+	arg enable_adc_check,regc
+	call context_search
+	branch enable_adc_wait,zero
+	jam 0xaa,core_rf_ldo_cfg5
+	jam 0x0c,core_rf_ldo_en0
+	fetch 1,core_clkpll_cfg6
+	set1 7,pdata
+	store 1,core_clkpll_cfg6
+	jam 0x04,core_rf_ldo_en1
+	nop 60
+	jam 0,core_syn_en
+	jam 6,core_rx_en0
+	call read_adc_mode
+	store 1,core_gpadc_ctrl
+//	jam 0x07,core_gpadc_ctrl
+	jam 0x03,core_sum_ctrl
+	nop 60
+	fetch 1,core_sum_en
+	set1 7,pdata
+	store 1,core_sum_en
+//	nop 500  // 1/24ms
+//	fetch 2,core_adc_sum
+//	store 2,mem_adc_current_value
+	set1 mark_adc_enable,mark
+	copy clkn_bt,pdata
+	store 1,mem_start_adc_clkn
+	rtn
+	
+read_adc_mode:	
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_VINLPM,adc_mode_vdcdc
+	beq ADC_CONFIG_HVIN,adc_adc_mode_vbat
+//	beq ADC_CONFIG_GPIO,adc_check_gpio
+adc_check_gpio:
+	fetch 1,mem_adc_channel
+	lshift3 pdata,pdata
+	or pdata,7,pdata
+	rtn
+
+adc_mode_vdcdc:
+	setarg 0x57
+	rtn
+	
+adc_adc_mode_vbat:
+	setarg 0x4f
+	rtn
+
+vdd_calculate_by_mode:
+	bpatchx patch26_5,mem_patch26
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_VINLPM,vdd_calculate_vinlpm
+	beq ADC_CONFIG_HVIN,vdd_calculate_hvin
+	beq ADC_CONFIG_GPIO,vdd_calculate_io
+	rtn
+
+vdd_calculate_vinlpm:
+	setarg 100
+	store 2,mem_reference_voltage //diff
+	fetcht 2,mem_3v_adc_vinlpm_data
+	fetch 2,mem_2v_adc_vinlpm_data
+	arg 300,regc
+	branch vdd_calculate
+
+vdd_calculate_hvin:
+	setarg 200
+	store 2,mem_reference_voltage //diff
+	fetcht 2,mem_5v_adc_hvin_data
+	fetch 2,mem_3v_adc_hvin_data
+	arg 500,regc
+	branch vdd_calculate
+
+vdd_calculate_io:
+	setarg 200
+	store 2,mem_reference_voltage //diff
+	fetcht 2,mem_3v_adc_io_data
+	fetch 2,mem_1v_adc_io_data
+	arg 300,regc //max vol
+	
+vdd_calculate:
+	isub temp,rega
+	fetch 2,mem_adc_current_value
+	isub temp,pdata
+	nbranch vdd_calculate1,positive
+	fetcht 2,mem_reference_voltage
+	imul32 temp,regb
+	copy regc,pdata
+	imul32 rega,pdata
+	isub regb,pdata
+vdd_calculate2:
+	idiv rega
+	call wait_div_end
+	quotient pdata	
+	rtn
+
+vdd_calculate1:
+	copy temp,pdata
+	fetcht 2,mem_adc_current_value
+	isub temp,pdata
+	fetcht 2,mem_reference_voltage
+	imul32 temp,regb
+	copy regc,pdata
+	imul32 rega,pdata
+	iadd regb,pdata
+	branch vdd_calculate2
+
+
+/*	typedef struct
+*	{
+*		uint16 full_vol
+*		uint16 empty_vol
+*		uint16 low_vol
+*		uint16 now_vol
+*	}bat_calculate;
+*/
+//out:	pdata->bat percent
+adc_bat_percent_lowpower_out:
+	ifetch 8,rega
+	store 8,mem_pdatatemp
+	fetch 2,mem_pdatatemp
+	fetcht 2,mem_pdatatemp+2
+	isub temp,rega
+	fetch 2,mem_pdatatemp+6
+	isub temp,regb
+	fetcht 2,mem_pdatatemp+4
+	isub temp,null
+	ncall adc_set_low_power_flag,positive
+	mul32 regb,100,pdata
+	idiv rega
+	call wait_div_end
+	quotient pdata
+	call adc_set_no_power_flag,blank
+	rtn
+adc_set_low_power_flag:
+	fetch 1,mem_adc_power_flag
+	set1 0,pdata
+	store 1,mem_adc_power_flag
+	rtn
+
+adc_clear_low_power_flag:
+	fetch 1,mem_adc_power_flag
+	set0 0,pdata
+	store 1,mem_adc_power_flag
+	rtn	
+	
+adc_set_no_power_flag:
+	fetcht 1,mem_adc_power_flag
+	set1 1,temp
+	storet 1,mem_adc_power_flag
+	rtn
+
+adc_clear_no_power_flag:
+	fetcht 1,mem_adc_power_flag
+	set0 1,temp
+	storet 1,mem_adc_power_flag
+	rtn	
+
+
+
+/****************************************key scan***************************************/
+keyscan_key_init:
+	fetch 2,mem_key_num_ptr
+	ifetch 1,pdata
+keyscan_key_init_next:
+	rtn blank
+	copy pdata,loopcnt
+//	copy contr,rega
+	fetch 2,mem_keyscan_ptr
+	increase 3,pdata	//mem_key_conf0_pin
+	copy pdata,rega
+keyscan_key_init_lp1:
+	ifetcht 1, rega
+	call gpio_config_input
+	increase KEY_CONF_STRUCT_LEN,rega
+	loop keyscan_key_init_lp1
+keyscan_key_init_end:
+	rtn
+	
+keyscan_scan_key:
+	fetch 2,mem_keyscan_ptr
+	increase 3,pdata	//mem_key_conf0_pin
+	copy pdata,rega
+//	arg mem_key_conf0_pin,rega
+	force 0,regb
+	setarg 0
+	store 2,mem_key_value_temp
+keyscan_scan_key_lp1:
+	ifetcht 1, rega
+	call gpio_get_bit
+	bpatchx patch26_6,mem_patch26
+	fetch 2,mem_key_value_temp
+	copy regb,queue
+	qsetflag true,pdata
+	store 2, mem_key_value_temp
+	increase KEY_CONF_STRUCT_LEN,rega
+	increase 1,regb
+	fetch 2,mem_key_num_ptr
+	ifetch 1,pdata
+keyscan_scan_key_lp1_next:
+	ixor regb,null
+	nbranch keyscan_scan_key_lp1,zero
+	fetch 2,mem_key_value_temp
+	fetcht 2,mem_key_value_retention
+	ixor temp,null
+	rtn zero
+	enable user
+	rtn
+
+keyscan_process_lpm_before:
+	fetch 2,mem_key_num_ptr
+	ifetch 1,pdata
+keyscan_process_lpm_before_next:
+	rtn blank
+	copy pdata,loopcnt
+	fetch 2,mem_keyscan_ptr 
+	increase 3,pdata	//mem_key_conf0_pin
+	copy pdata,rega
+keyscan_process_lpm_before_lp1:
+	ifetcht 1, rega
+	call gpio_set_wake_by_current_state
+	increase KEY_CONF_STRUCT_LEN,rega
+	loop keyscan_process_lpm_before_lp1
+keyscan_process_lpm_before_end:
+	rtn
+
+keyscan_key_process:
+	arg key_scan_timer,queue
+	call timer_check
+	nrtn blank
+	setarg 0x20
+	arg key_scan_timer,queue
+	call timer_init
+	disable user
+	call keyscan_process_lpm_before
+	bpatchx patch26_7,mem_patch26
+	fetch 2,mem_key_num_ptr
+	ifetch 1,pdata
+keyscan_key_process_next:
+	rtn blank
+	call keyscan_scan_key
+	nbranch lpm_button_clean_wake_lock,user
+	call lpm_button_get_wake_lock
+	disable user
+	fetch 2,mem_key_value_temp
+	store 2,mem_key_value_temp4
+	jam 0,mem_key_value_temp6
+	force 0,queue
+keyscan_key_lp1:
+	fetch 2, mem_key_value_retention
+	rshift pdata,temp
+	storet 2,mem_key_value_retention
+	and pdata,0x01,pdata
+	fetcht 2, mem_key_value_temp4
+	and temp,0x01,rega
+	rshift temp,temp
+	storet 2,mem_key_value_temp4
+	ixor rega,null
+	ncall keyscan_send_key_data,zero
+	fetch 2,mem_key_num_ptr
+	ifetch 1,pdata
+keyscan_key_lp1_next:
+	fetcht 1, mem_key_value_temp6
+	increase 1,temp
+	storet 1, mem_key_value_temp6
+	copy temp,queue
+	ixor queue,null
+	nbranch keyscan_key_lp1,zero
+	fetch 2,mem_key_value_temp
+	store 2,mem_key_value_retention
+	rtn
+keyscan_send_key_data:
+	bpatchx patch27_0,mem_patch27
+	fetch 2,mem_keyscan_ptr
+	increase 1,pdata
+	ifetch 2,pdata
+	branch callback_func
+
+
+/*************************************pwm*************************************/
+
+//rega:clk select(0:system clk; 1:system clk undivied; 2:lpo)
+/*rega:clk select
+			0x00:select system clock 12M;
+			0x40:select undivied system clock 24M/48M;
+			0x80:select lpo clock:33K
+*/
+pwm_init:
+	fetch 1,core_clksel
+	ior rega,pdata
+	store 1,core_clksel
+	fetch 2,core_clkoff
+	set0 CLOCK_OFF_PWM,pdata
+	store 2,core_clkoff
+delay_nop100:
+	nop 100
+	rtn
+
+/*	typedef struct
+*	{
+*		uint8 gpio_num
+*		uint8 pwm_channel
+*		uint24 frequency
+*		uint8 duty_cycle   //0-100
+*	}PWM_Style;
+	addr: mem_pdatatemp
+*/
+pwm_clk_set:
+	fetch 1,core_clksel
+	bbit1 6,pwm_24m_clk_set
+	bbit1 7,pwm_33k_clk_set
+pwm_12m_clk_set:
+	setarg PWM_12MHZ
+	rtn
+pwm_24m_clk_set:
+	setarg PWM_24MHZ
+	rtn
+pwm_33k_clk_set:
+	setarg PWM_33KHZ
+	rtn
+/*
+	mem_pdatatemp+1:
+	bit0~bit2:pwm_channel
+	bit4:pwm_init_value(1:high;0:low)
+*/
+pwm_cont_set:
+	fetch 1,mem_pdatatemp+1
+	bbit1 4,pwm_cont_set1
+	bbit0 4,pwm_cont_set0
+	rtn
+pwm_cont_set1:
+	enable user
+	and pdata,0x0f,queue
+	call pwm_set_value
+	quotient regb
+	copy temp,pdata
+	isub regb,rega
+	rtn
+
+pwm_cont_set0:
+	disable user
+	and pdata,0x0f,queue
+	call pwm_set_value
+	quotient rega
+	copy temp,pdata
+	isub rega,regb
+	rtn
+
+pwm_set_value:
+	fetch 1,core_pwm_init
+   	qsetflag user,pdata
+	store 1,core_pwm_init
+	rtn
+
+pwm_out_set:
+	fetcht 3,mem_pdatatemp+2
+	call pwm_clk_set
+	idiv temp
+	call wait_div_end
+	quotient temp
+	fetch 1,mem_pdatatemp+5
+	imul32 temp,pdata
+	div pdata,100
+	call wait_div_end
+	call pwm_cont_set
+	fetch 1,mem_pdatatemp+1
+	call pwm_duty_cycle_set
+	fetch 1,mem_pdatatemp
+	fetcht 1,mem_pdatatemp+1
+	and_into 0x0f,temp
+	lshift8 temp,temp
+	ior temp,pdata
+	branch pwm_enable
+
+//rega:pcnt ;regb:ncnt ;pdata:pwm channel select
+pwm_duty_cycle_set:
+	and_into 0x0f,pdata
+	arg core_pwm_pcnt0,contw
+	mul32 pdata,4,pdata
+	iadd contw,contw
+	copy rega,pdata
+	istore 2,contw
+	copy regb,pdata
+	istore 2,contw
+	rtn
+
+
+//pdata:gpio select & pwm channel select
+/*********************************************
+setarg 0x0108
+0x01:pwm channel select
+0x08:gpio select
+*********************************************/
+pwm_enable:
+	enable user
+	call pwm_srst_set
+	branch pwm_gpio_set
+pwm_disable:
+	disable user
+	call pwm_select_channel
+pwm_gpio_set:
+	copy temp,pdata
+	lshift8 pdata,pdata
+	add queue,gpcfg_pwm_out0,temp
+	ior temp,pdata
+	call gpio_config_param
+pwm_set_select:
+	fetch 1,core_pwm_en
+	jam 0x00,core_pwm_en
+	nop 1200
+   	qsetflag user,pdata
+   	store 1,core_pwm_en
+	rtn
+pwm_select_channel:
+	copy pdata,temp
+	rshift8 pdata,pdata
+	copy pdata,queue
+	rtn
+	
+//pwm immediately stop set
+pwm_srst_powerdown:
+	disable user
+pwm_srst_set:
+	call pwm_select_channel
+	fetch 1,core_pwm_srst
+   	nqsetflag user,pdata
+   	store 1,core_pwm_srst
+	branch pwm_gpio_set
+
+/*************WATCH DOG API*************************/
+/*
+	function name:wdt_init_config 
+	input:kick dog time (pdata)
+*/
+wdt_init_config:
+	arg 0x2710,temp
+	imul32 temp,pdata
+	arg 0x1312d,temp
+	idiv temp
+	call wait_div_end
+	quotient temp
+	setarg 2048
+	isub temp,pdata
+	copy pdata,temp
+	and_into 0x0f,temp
+	storet 1,core_write_wdt2
+	copy pdata,temp
+	rshift4 temp,temp
+	storet 1,core_write_wdt
+	rtn
+
+wdt_set_enable:
+	enable user
+	branch wdt_init_set
+wdt_set_disable:
+	disable user
+wdt_init_set:
+	fetch 1,core_config
+   	setflag user,3,pdata
+	store 1,core_config
+	rtn
+
+/*************NEC API*************************/
+/*
+	function name:nec_init_config 
+	input:
+		pdata is nec buffer address
+		bit[0-15]:rx start memory address
+		bit[16-31]:rx ending memory address
+		temp is nec control config
+		E.M 0x31 is 12M system clock is 2us temp
+*/
+nec61212_init:
+	arg FUN_NEC_ENABLE|FUN_NEC_CLK_DIVIDE_24,temp
+	
+
+nec_init_config:
+	store 4,core_nec_start_addr
+	store 2,core_nec_rptr
+	storet 1,core_nec_control
+	rtn
+
+//return:pdata is buffer size
+nec_check_rxbuff_size:
+	fetch 2,core_nec_rxitem
+	rtn
+/*	fetcht 2,core_nec_rptr
+	fetch 2,core_nec_wptr
+	isub temp,pdata
+	rtn positive
+	sub pdata,0,rega
+	fetcht 2,core_nec_start_addr
+	fetch 2,core_nec_end_addr
+	pincrease 1
+	isub temp,pdata
+	isub rega,pdata
+	rtn
+*/
+
+nec_prepare_read:
+	fetchr contu,2,core_nec_rptr
+	fetchr contus,2,core_nec_start_addr
+	fetchr contue,2,core_nec_end_addr
+	rtn
+
+nec_read_done:
+	storer contu,2,core_nec_rptr
+	rtn
+
+//regc is callback function
+//output
+//user is disable mean data stop
+//rege is 0 mean repeat
+//rege is no zero mean data
+nec_parse_nec61212:
+	call enable_user
+	arg 0,rege
+	call nec_check_rxbuff_size
+	beq 2,nec_parse_nec61212_check_timeout
+	sub pdata,4,null
+	rtn positive
+	call nec_prepare_read
+	ifetcht 2,contu
+	setarg NEC61212_DATA2REPEAT_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	nbranch nec_parse_nec61212_check_repeat_data,positive
+	copy regd,temp
+	setarg NEC61212_REPEAT2REPEAT_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	nbranch nec_parse_nec61212_check_repeat_data,positive
+	
+	copy regd,temp
+	setarg NEC61212_BOOT_CODE_START_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	branch nec_parse_nec61212_error_data,positive
+	ifetcht 2,contu
+	setarg NEC61212_BOOT_CODE_END_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	branch nec_parse_nec61212_error_data,positive
+	call nec_check_rxbuff_size
+	sub pdata,133,null
+	rtn positive
+	arg 32,loopcnt
+nec_parse_nec61212_data:
+	ifetcht 2,contu
+	setarg NEC61212_DATA_BIT_1_START_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	branch nec_parse_nec61212_error_data,positive
+	ifetcht 2,contu
+	setarg NEC61212_DATA_BIT_1_END_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	nbranch nec_parse_nec61212_add_bit1,positive
+	copy regd,temp
+	setarg NEC61212_DATA_BIT_0_END_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	nbranch nec_parse_nec61212_add_bit0,positive
+
+
+nec_parse_nec61212_error_data:
+	copy regd,temp
+	setarg NEC61212_TIMEOUT_TIME
+	isub temp,null
+	branch nec_parse_nec61212_check_timeout_cb,zero
+	branch nec_read_done
+
+nec_parse_nec61212_add_bit1:
+	set1 32,rege
+nec_parse_nec61212_add_bit0:
+	rshift rege,rege
+	loop nec_parse_nec61212_data
+	branch nec_parse_nec61212_check_stop_bit
+
+nec_parse_nec61212_check_repeat_data:
+	call nec_check_rxbuff_size
+	sub pdata,7,null
+	rtn positive
+	ifetcht 2,contu
+	setarg NEC61212_REPEAT_START_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	branch nec_parse_nec61212_error_data,positive
+	ifetcht 2,contu
+	setarg NEC61212_REPEAT_END_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	branch nec_parse_nec61212_error_data,positive
+nec_parse_nec61212_check_stop_bit:
+	ifetcht 2,contu
+	setarg NEC61212_STOP_TIME
+	call nec_check_pulse_range_legal_default_deviation
+	branch nec_parse_nec61212_error_data,positive
+	call nec_read_done
+	copy regc,pdata
+	branch callback_func
+
+nec_parse_nec61212_check_timeout:
+	call nec_prepare_read
+	ifetcht 2,contu
+	setarg NEC61212_TIMEOUT_TIME
+	isub temp,null
+	nrtn zero
+nec_parse_nec61212_check_timeout_cb:
+	call nec_read_done
+	call disable_user
+	copy regc,pdata
+	branch callback_func
+
+
+
+//检查数据是否合法，宽度范围
+//输入:temp 当前实际检查到的时间 2us为单位
+//pdata 理论时间，us为单位
+nec_check_pulse_range_legal_default_deviation:
+	arg 10,regb
+
+//检查数据是否合法，宽度范围
+//输入:temp 当前实际检查到的时间 2us为单位
+//pdata 理论时间，us为单位
+//regb允许偏差值，百分比
+// |temp-pdata| / pdata < regb
+//输出:positive is 1 mean error
+//0 mean true
+nec_check_pulse_range_legal:
+	copy temp,regd
+	imul32 regb,regb		//换算成实际偏差
+	lshift temp,temp		//时间单位换算成us
+	isub temp,rega
+	ncall nec_check_pulse_range_legal_data_negative,positive
+	mul32 rega,100,pdata
+	isub regb,null
+	rtn
+
+nec_check_pulse_range_legal_data_negative:
+	sub rega,0,rega
+	rtn
+
+
+
+select_system_clk_24M:
+	jam SYSTEM_CLK_24M,mem_system_clk
+	jam clksel_dpll_24M,core_clksel
+	setarg 7499
+	store 2,core_halfslot
+calc_new_param:
+	arg 11,loopcnt
+	arg mem_param_tx_setup,rega
+calc_new_param_loop:
+	ifetch 2,rega
+	lshift pdata,pdata
+	istore 2,rega
+	increase 2,rega
+	loop calc_new_param_loop
+	rtn
+
+calc_new_le_time:
+	lshift stop_watch,stop_watch
+	rtn
+
+select_system_clk_12M_xtal:
+	jam clksel_xtal,core_clksel
+select_system_clk_12M_common:
+	jam SYSTEM_CLK_12M,mem_system_clk
+	setarg 3749
+	store 2,core_halfslot
+	rtn
+
+select_system_clk_12M_dpll:
+	jam clksel_dpll,core_clksel
+	branch select_system_clk_12M_common
+	
+
+/*****************************50HZ*****************************/
+/*
+(input):
+pdata:ac data buf start address
+temp:ac data buf length
+mem_ac_detect_gpio:choice gpio[0-19]
+mem_ac_detect_control:[7:2]ac detect clk divide number,[15:8]ac detect window (ms)
+
+(output):
+true=1,  50hz single disappear true=0,50hz detected
+
+*/
+ifdef AC_50HZ
+ac_50hz_check:
+	store 2,core_ac_saddr
+	storet 1,core_ac_buf_len
+	fetch 1,mem_ac_detect_gpio
+	arg gpcfg_ac_input,temp
+	call gpio_config_function_int
+	fetch 2,mem_ac_detect_control  
+	set1 0,pdata                 //ac detect enable[0]
+	store 2,core_ac_ctrl
+ac_50hz_check_wait:		
+	fetch 1,core_perf_status
+	isolate1 6,pdata
+	rtn 
+endif
+	
+
+
+
Index: program/rfcomm.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/rfcomm.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/rfcomm.prog	(working copy)
@@ -0,0 +1,873 @@
+
+ifdef COMPILE_RFCOMM
+rfcomm_init:
+	rtn wake
+	jam 0,mem_rfcomm_send_more_pkt
+	jam BITS9600,memRemoteRPNBitRate        
+	jam DATABITS8,memRemotePRNDataBits      
+	jam 0x11,memRemotePRNXon
+	jam 0x13,memRemotePRNXoff
+	setarg 0
+	store 3,memRemotePRNStopBit
+	store 1,mem_spp_state                  
+	jam 0,memui_reconnect_mode
+	//branch rfcomm_init_spp
+rfcomm_init_spp:
+	setarg 0
+	store 1,mem_spp_state
+	store 1,mem_remote_spp_channel
+	store 1,mem_pn_dlci
+	fetch 1,mem_rfcomm_credit_flag
+	beq CREDIT_ENABLE,rfcomm_init_spp_with_credit
+	jam 0x50,mem_credit_given
+	rtn
+
+rfcomm_init_spp_with_credit:
+	jam 0x00,mem_credit_given
+	rtn
+
+set_CR_bit:
+	or_into 0x02,temp
+	rtn
+
+
+/*below added by koufan*/
+
+/*rfcomm_send */
+
+
+
+	/*rfcomm_calculate_FCS_sabm*/
+	/*input: address in temp*/
+	/*output: FCS in pdata  */
+rfcomm_calculate_FCS_sabm:
+	copy temp,pdata
+	reverse pdata,pdata //address
+	store 1,memFCStemp3
+	force INI_TX_SABM,pdata
+	reverse pdata,pdata
+	store 1,memFCStemp2
+	force 0x01,pdata                        
+	reverse pdata,pdata
+	store 1,memFCStemp1
+	call caculate_fcs
+	copy temp,pdata                        
+	rtn
+rfcomm_calculate_FCS_ua:
+	reverse pdata,pdata //address
+	store 1,memFCStemp3
+	force   RSP_TX_UA, pdata
+	reverse pdata, pdata
+	store   1, memFCStemp2
+	force   0x01, pdata
+	reverse pdata, pdata
+	store   1, memFCStemp1
+	branch caculate_fcs
+	/* FCS return from temp                */
+rfcomm_calculate_FCS_dlci0:
+	fetch 1,mem_rfcomm_initiator
+	branch rfcomm_calculate_FCS_dlci0_res,blank
+	setarg 0x70 //FCS of initiator
+	rtn
+rfcomm_calculate_FCS_dlci0_res:
+	setarg 0xaa//FCS of responder
+	rtn
+	
+rfcomm_save_FCS_uih:
+	reverse pdata, pdata //address 
+	store 1,memFCStemp3                     /* contw distroided                    */
+	force RSP_RX_UIH,pdata 
+	call caculate_UIHdata_fcs
+	fetcht 2,mem_contw_temp
+	copy temp,contw
+	istore 1,contw                      /* save FCS for later use              */
+	copy contw,temp
+	storet 2,mem_contw_temp
+	force RSP_RX_UIH_WDATA,pdata             /* P/F =1 + RSP_RX_UIH                 */
+	call caculate_UIHdata_fcs
+	fetcht 2,mem_contw_temp
+	copy temp,contw
+	istore 1,contw             /* save FCS for later use              */
+	rtn	
+/**********************************************************************/
+/* This subroutine caculates the FCS for UIH data                     */
+/* Input:                                                             */
+/*        the address byte at memFCStemp3(bit reversed), control byte */
+/*        at pdata (not bit reversed)                                 */
+/* Output:                                                            */
+/*        pdata: the FCS                                              */
+/**********************************************************************/  
+caculate_UIHdata_fcs:
+	reverse pdata,pdata
+	store   1,memFCStemp2
+	fetch   2, memFCStemp2                     
+	lshift8 pdata,pdata
+	store 3,mem_mod2div_temp
+	arg     0x107,rega
+	arg 0xf,regb
+	call mod2div
+	xor_into     0xd7, pdata
+	invert  pdata,pdata
+	reverse pdata,pdata
+	rtn
+	
+/**********************************************************************/
+/* This subroutine caculates the FCS                                  */
+/* Input:                                                             */
+/*        the address byte at memFCStemp3, control byte at memFCStemp2*/  
+/*        lenght at memFCStemp1 (all above data are bit reversed)     */
+/* Output:                                                            */
+/*        temp: the FCS                                               */
+/**********************************************************************/     
+caculate_fcs:
+	fetch 3, memFCStemp1                    /* load 3 bytes start at memFCStemp1   */
+	store 3,mem_mod2div_temp
+	arg 0x107,rega
+	arg 0xf,regb  //24bit(memFCStemp1+..+memFCStemp3) - 9bit(rega) = 15bit
+	call mod2div
+	lshift8 pdata,pdata 
+	arg 0x7, regb  //16bit(lshift8 pdata,pdata ) - 9bit(rega) = 7bit
+	call mod2div
+	xor_into     0x2b, pdata		//0x3d
+	invert  pdata, pdata                        
+	reverse pdata, pdata                      /* FCS at pdata                        */
+	copy    pdata, temp
+	rtn
+
+mod2div:
+	arg 0,regc
+	copy regb,loopcnt
+	call right_shift_n // right shift pdata (regB)bit
+	icopy temp
+mod2div_loop:
+	//jam 1,0x1fff
+//mod2div_loop1:
+	//fetch 1,0x1fff
+	//nbranch mod2div_loop1,blank
+	copy temp,pdata
+	lshift regc,regc//quotient
+	bbit0 8, mod2div_not_enough_reduction//the high bit of 0x107
+	ixor rega,temp// temp----remainer
+	increase 1,regc// quotient
+mod2div_not_enough_reduction: //Minuend smaller than Subtrahend
+	lshift temp,temp
+	fetch 3,mem_mod2div_temp
+	increase -1,regb
+	compare 0xff,regb,0xff
+	branch mod2div_end,true
+	copy regb,loopcnt
+	call right_shift_n // right shift pdata (regb)bit
+	isolate1 0,pdata
+	setflag true,0,temp //move a new bit from Dividend(queue) into Minuend(pdata)
+	branch mod2div_loop
+mod2div_end:
+	//output:remainer in pdata
+	rshift  temp,pdata
+	rtn
+
+get_rfcomm_snd_adss:
+	fetcht 1,mem_pn_dlci
+dlci_to_address_cmd:
+	//input DLCI from temp
+	lshift2 temp,temp
+	set1 RFCOMM_ADDRESS_EXT_LEN,temp
+	fetch 1,mem_rfcomm_initiator
+	ncall set_CR_bit,blank
+	storet 1,mem_rfcomm_send_adss
+	rtn
+
+channel_to_dlci:
+	//input channel from temp
+	lshift temp,temp
+	fetch 1,mem_rfcomm_initiator
+	setflag blank,0,temp //direction in dlci
+	//output dlci to temp
+	rtn
+rfcomm_rx_process_DLCI0_sabm:
+	fetcht 1,mem_current_channel //address
+	jam 0xd7,mem_current_fcs //FCS
+	call rfcomm_send_ua
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_RFCOMM_ONLY_SABM,pdata
+	set1 L2CAP_CHANNEL_RFCOMM_ONLY_UA,pdata
+	store 1,mem_rfcomm_state
+	jam 0,mem_rfcomm_initiator
+	branch rfcomm_rx_process_end
+rfcomm_rx_process_DLCI0_ua:
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_RFCOMM_ONLY_UA,pdata
+	store 1,mem_rfcomm_state
+	branch rfcomm_rx_process_end
+
+	
+rfcomm_rx_process:
+	bpatchx patch27_1,mem_patch27
+	fetch 1,memui_reconnect_mode
+	beq NO_RECONNECTION,rfcomm_rx_process_remote_page
+	branch rfcomm_rx_process_reconn
+
+rfcomm_rx_process_remote_page:
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_head_struct
+	fetch 1,mem_current_channel
+	beq 0,parse_dlci0_rp
+	branch parse_uih_rp
+parse_dlci0_rp:
+	bpatchx patch27_2,mem_patch27
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_SABM,rfcomm_rx_process_DLCI0_sabm
+	beq RFCOMM_FRAME_TYPE_UA,rfcomm_rx_process_DLCI0_ua
+	beq RFCOMM_FRAME_TYPE_UIH,parse_DLCI0_rp_uih
+	beq RFCOMM_FRAME_TYPE_DISCONN,parse_uih_rp_spp_disconn_send_event
+	rtn
+
+
+parse_DLCI0_rp_uih:
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_uih_head_struct
+	fetch 1,mem_uih_cmd_type
+	beq UIH_PARAM_NEG_CMD,parse_DLCI0_rp_uih_pn_cmd
+	beq UIH_PARAM_NEG_RES,parse_DLCI0_rp_uih_pn_res
+	beq UIH_MODEM_STATUS_CMD,parse_DLCI0_rp_uih_ms_cmd
+	beq UIH_MODEM_STATUS_RES,parse_DLCI0_rp_uih_ms_res
+	beq UIH_PARAM_CMD_REMOVE_PORT,parse_DLCI0_rp_uih_cmd_port	
+	branch rfcomm_rx_process_end
+	
+parse_DLCI0_rp_uih_pn_cmd:
+	call parse_DLCI0_rp_uih_pn_res_common
+
+	branch parse_DLCI0_rp_uih_pn_cmd_spp
+
+parse_DLCI0_rp_uih_pn_cmd_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_PN_CMD,pdata
+	set1 RFCOMM_CHANNEL_STATE_PN_RES,pdata
+	store 1,mem_spp_state
+	call rfcomm_send_param_neg_res
+	branch rfcomm_rx_process_end
+	
+parse_DLCI0_rp_uih_pn_res:
+	call parse_DLCI0_rp_uih_pn_res_common
+	branch rfcomm_rx_process_end
+
+parse_DLCI0_rp_uih_pn_res_common:
+	call get_param_payload_ptr
+	branch  get_rfcomm_prarmer_negotiation
+
+get_rfcomm_param_modem_status:
+	call get_param_payload_ptr
+	ifetch 1,contr
+	rshift3 pdata,pdata
+	store 1,mem_ms_channel
+	ifetch 1,contr
+	store 1,mem_ms_param
+	rtn
+
+
+get_rfcomm_head_struct:
+	ifetch 1,contr
+	store 1,mem_current_adss
+	rshift3 pdata,pdata
+	store 1,mem_current_channel
+	ifetch 1,contr
+	store 1,mem_current_frame_type
+get_rfcomm_current_length:
+	call get_rfcomm_length_common
+	storet 2,mem_current_length
+	copy contr,pdata
+	store 2,mem_rfcomm_uih_payload_ptr
+	rtn
+
+get_rfcomm_uih_head_struct:
+	ifetch 1,contr
+	rshift pdata,pdata
+	store 1,mem_uih_cmd_type
+	call get_rfcomm_length_common
+	storet 2,mem_uih_length
+	copy contr,pdata
+	store 2,mem_param_payload_ptr
+	rtn
+
+
+get_param_payload_ptr:
+	fetch 2,mem_param_payload_ptr
+	copy pdata,contr
+	rtn
+
+get_rfcomm_length_common:
+	ifetch 1,contr
+	copy pdata,temp
+	rshift temp,temp
+	rtnbit1 0
+	ifetch 1,contr
+	lshift3 pdata,pdata
+	lshift4 pdata,pdata
+	iadd temp,temp
+	rtn
+
+get_rfcomm_prarmer_negotiation:
+	ifetch 1,contr
+	store 1,mem_pn_dlci
+	ifetch 1,contr
+	store 1,mem_pn_credit_flow_type_info
+	ifetch 1,contr
+	store 1,mem_pn_priority
+	ifetch 1,contr
+	store 1,mem_pn_acknowledg_timer
+	ifetch 2,contr
+	store 2,mem_pn_max_frame_size
+	ifetch 1,contr
+	store 1,mem_pn_max_retrans
+	ifetch 1,contr
+	store 1,mem_remote_credits
+	rtn
+
+
+parse_DLCI0_rp_uih_ms_cmd:
+	call get_rfcomm_param_modem_status
+
+	branch parse_DLCI0_rp_uih_ms_cmd_spp
+
+parse_DLCI0_rp_uih_ms_cmd_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_RCV_MS_CMD,pdata
+	set1 RFCOMM_CHANNEL_STATE_SND_MS_RES,pdata
+	store 1,mem_spp_state
+	fetcht 1,mem_pn_dlci
+	lshift2 temp,temp
+	or_into 3,temp
+	call rfcomm_send_modem_status_res
+	jam MORE_PKT_MSC_CMD_SPP,mem_rfcomm_send_more_pkt
+	branch rfcomm_rx_process_end
+	
+parse_DLCI0_rp_uih_ms_res:
+	jam BT_EVT_SPP_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	call get_rfcomm_param_modem_status
+	fetch 1,mem_ms_channel
+	sub pdata,1,null
+	branch parse_DLCI0_rp_uih_MS_RES_spp,zero
+	branch assert
+parse_DLCI0_rp_uih_ms_res_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_RCV_MS_RES,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+
+parse_DLCI0_rp_uih_cmd_port:
+	call get_param_payload_ptr
+	ifetch 1,contr
+	store 1,mem_rpn_dlci
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x000e
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_rfcomm_initiator
+	//setarg 5
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch27_3,mem_patch27
+	setarg 0x15ef
+	istore 2,contw
+	setarg 0x1191
+	istore 2,contw
+	//fetch 1,mem_pn_dlci
+	//setarg 0x0b
+	fetch 1,mem_rpn_dlci
+	istore 1,contw //DLCI
+	setarg 0x000007
+	istore 5,contw
+//	setarg 0 //max frame size
+//	istore 2,contw 
+	setarg 0x01 //max retrans
+	istore 2,contw
+//	setarg 0x00
+//	istore 1,contw // init credits
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	rtn
+
+
+
+parse_uih_rp:
+	branch parse_uih_rp_spp
+
+parse_uih_rp_spp:
+	bpatchx patch27_4,mem_patch27
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_UA,parse_uih_rp_spp_ua
+	beq RFCOMM_FRAME_TYPE_SABM,parse_uih_rp_spp_sabm
+	beq RFCOMM_FRAME_TYPE_UIH,parse_uih_spp_uih
+	beq RFCOMM_FRAME_TYPE_UIH_CREDITS,parse_uih_spp_uih_credits
+	beq RFCOMM_FRAME_TYPE_DISCONN,parse_uih_rp_spp_disconn
+	rtn
+parse_uih_rp_spp_ua:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_UA,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+parse_uih_rp_spp_sabm:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_UA,pdata
+	set1 RFCOMM_CHANNEL_STATE_SABM,pdata
+	store 1,mem_spp_state
+	fetch 1,mem_current_adss
+	call rfcomm_calculate_FCS_ua
+	store 1,mem_current_fcs
+	call rfcomm_send_ua
+	fetch 1,mem_current_adss
+	rshift2 pdata,pdata
+	store 1,mem_pn_dlci
+	lshift2 pdata,pdata
+	set0 RFCOMM_ADDRESS_CR,pdata
+	set1 RFCOMM_ADDRESS_EXT_LEN,pdata 
+	arg mem_HIUfcs_spp,temp // mem_HIUfcs_HF_WCredits in regb++
+	storet 2,mem_contw_temp
+	call rfcomm_save_FCS_uih
+	branch rfcomm_rx_process_end
+	
+parse_uih_spp_uih_credits:
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	increase 1,pdata
+	store 2,mem_rfcomm_uih_payload_ptr
+	ifetch 1,contr //remote credits
+	fetcht 1,mem_remote_credits
+	iadd temp,pdata
+	store 1,mem_remote_credits
+parse_uih_spp_uih:
+	call rfcomm_increase_credit_given
+parse_uih_spp_uih_cont:
+	call get_rfcomm_snd_adss
+	call rfcomm_send_uih_without_payload
+	call spp_process_rx_data
+	branch rfcomm_rx_process_end
+
+parse_uih_rp_spp_disconn_send_event:
+	jam BT_EVT_SPP_DISCONNECTED,mem_fifo_temp
+	call ui_ipc_send_event	
+parse_uih_rp_spp_disconn:
+	call rfcomm_init_spp
+	fetch 1,mem_current_adss
+	call rfcomm_calculate_FCS_ua
+	store 1,mem_current_fcs
+	call rfcomm_send_ua
+	branch rfcomm_rx_process_end
+	
+///////////////////////////////////////////
+///////////////////////////////////////////
+///////////////////////////////////////////
+rfcomm_rx_process_reconn:
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_head_struct
+	fetch 1,mem_current_channel
+	beq 0,parse_DLCI0_reconn
+	branch parse_uih_reconn
+		
+parse_DLCI0_reconn:
+	bpatchx patch27_5,mem_patch27
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_SABM,rfcomm_rx_process_DLCI0_sabm
+	beq RFCOMM_FRAME_TYPE_UA,rfcomm_rx_process_DLCI0_ua
+	beq RFCOMM_FRAME_TYPE_UIH,parse_DLCI0_reconn_uih
+	branch rfcomm_rx_process_end
+parse_DLCI0_reconn_uih:
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_uih_head_struct
+	fetch 1,mem_uih_cmd_type
+	beq UIH_PARAM_NEG_CMD,parse_DLCI0_reconn_uih_pn_cmd
+	beq UIH_PARAM_NEG_RES,parse_DLCI0_reconn_uih_pn_cmd
+	beq UIH_MODEM_STATUS_CMD,parse_DLCI0_reconn_uih_ms_cmd
+	beq UIH_MODEM_STATUS_RES,parse_DLCI0_reconn_uih_ms_res
+	branch rfcomm_rx_process_end
+
+parse_DLCI0_reconn_uih_pn_cmd:
+	call parse_DLCI0_rp_uih_pn_res_common
+	fetch 1,mem_pn_dlci
+	rshift pdata,pdata
+	fetcht 1,mem_remote_spp_channel
+	isub temp,null
+	branch parse_DLCI0_reconn_uih_pn_cmd_spp,zero
+	branch assert
+parse_DLCI0_reconn_uih_pn_cmd_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_PN_RES,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+
+parse_DLCI0_reconn_uih_ms_cmd:
+	call get_rfcomm_param_modem_status
+	fetch 1,mem_ms_channel
+	fetcht 1,mem_remote_spp_channel
+	isub temp,null
+	branch parse_DLCI0_reconn_uih_ms_cmd_spp,zero
+	branch assert
+	branch rfcomm_rx_process_end
+parse_DLCI0_reconn_uih_ms_cmd_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_RCV_MS_CMD,pdata
+	set1 RFCOMM_CHANNEL_STATE_SND_MS_RES,pdata
+	store 1,mem_spp_state
+	fetcht 1,mem_pn_dlci
+	lshift2 temp,temp
+	or_into 3,temp
+	call rfcomm_send_modem_status_res
+	branch rfcomm_rx_process_end
+	
+parse_DLCI0_reconn_uih_ms_res:
+	call get_rfcomm_param_modem_status
+	fetch 1,mem_ms_channel
+	fetcht 1,mem_remote_spp_channel
+	isub temp,null
+	branch parse_DLCI0_reconn_uih_ms_res_spp,zero
+	branch assert
+parse_DLCI0_reconn_uih_ms_res_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_RCV_MS_RES,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+
+parse_uih_reconn:
+	fetch 1,mem_current_channel
+	fetcht 1,mem_remote_spp_channel
+	isub temp,null
+	branch parse_uih_reconn_spp,zero
+	branch assert
+	branch rfcomm_rx_process_end
+
+parse_uih_reconn_spp:
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_UA,parse_uih_reconn_spp_ua
+	beq RFCOMM_FRAME_TYPE_UIH,parse_uih_spp_uih
+	beq RFCOMM_FRAME_TYPE_UIH_CREDITS,parse_uih_spp_uih_credits
+	beq RFCOMM_FRAME_TYPE_DISCONN,parse_uih_reconn_spp_disconn
+parse_uih_reconn_spp_ua:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_UA,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+parse_uih_reconn_spp_sabm:
+	branch parse_uih_reconn_spp_sabm//loop
+parse_uih_reconn_spp_disconn:
+	branch parse_uih_rp_spp_disconn
+rfcomm_rx_process_end:
+	rtn
+	
+rfcomm_send_more_pkt:
+	fetch 1,mem_rfcomm_send_more_pkt
+	rtn blank
+	beq MORE_PKT_MSC_CMD_SPP,rfcomm_send_more_pkt_msc_cmd_spp
+	branch assert
+	
+rfcomm_send_more_pkt_msc_cmd_spp:
+	jam 0,mem_rfcomm_send_more_pkt
+	call l2cap_malloc_rfcomm_channel
+	arg SPP_SLAVE_CHANNEL,temp
+	fetcht 1,mem_pn_dlci
+	lshift2 temp,temp
+rfcomm_send_more_pkt_msc_cmd_spp0:
+	or_into 0x03,temp
+	arg 0xaa,rega
+	call rfcomm_send_modem_status_cmd
+	call l2cap_get_rfcomm_tx_buff
+	copy contw,contr
+	ifetch 2, contr
+	branch assert,blank
+	rtn
+
+rfcomm_send_sabm:
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x0004
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_current_adss
+	istore 1,contw //address
+	bpatchx patch27_6,mem_patch27
+	setarg 0x013f
+	istore 2,contw
+	fetch 1,mem_current_fcs
+	istore 1,contw
+	rtn
+rfcomm_send_ua:
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x0004
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_current_adss
+	istore 1,contw //address
+	bpatchx patch27_7,mem_patch27
+	setarg 0x0173
+	istore 2,contw
+	fetch 1,mem_current_fcs
+	istore 1,contw
+	rtn
+rfcomm_send_param_neg_cmd:
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x000e
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_rfcomm_initiator
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch28_0,mem_patch28
+	setarg 0x15ef
+	istore 2,contw
+	setarg 0x1183
+	istore 2,contw
+	copy temp,pdata //DLCI in temp
+	istore 1,contw
+	setarg 0x0000f0
+	istore 3,contw
+	setarg RFCOMM_MAX_FRAME_SIZE
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	setarg 0x01		//change here later
+	istore 1,contw
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	jam 0x10,mem_credit_given
+	rtn
+rfcomm_send_param_neg_res:
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x000e
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_rfcomm_initiator
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch28_1,mem_patch28
+	setarg 0x15ef
+	istore 2,contw
+	setarg 0x1181
+	istore 2,contw
+	fetch 1,mem_pn_dlci
+	istore 1,contw //DLCI
+	setarg 0x0000e0
+	istore 3,contw
+	fetch 2,mem_rfcomm_max_frame_size
+	istore 2,contw 
+	setarg 0x00 //max retrans
+	istore 1,contw
+	fetch 1,mem_rfcomm_credit_init_data
+	istore 1,contw // init credits
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	rtn
+rfcomm_send_modem_status_cmd:
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x0008
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_rfcomm_initiator
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch28_2,mem_patch28
+	setarg 0x09ef
+	istore 2,contw
+	setarg 0x05e3
+	istore 2,contw
+	copy temp,pdata //DLCI adress
+	istore 1,contw
+	setarg 0x8d
+	istore 1,contw
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	rtn
+
+rfcomm_send_modem_status_res:
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x0008
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	copy temp,timeup
+	fetch 1,mem_rfcomm_initiator
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch28_3,mem_patch28
+	setarg 0x09ef
+	istore 2,contw
+	setarg 0x05e1
+	istore 2,contw
+	copy timeup,pdata //DLCI address in temp
+	istore 1,contw
+	setarg 0x8d
+	istore 1,contw
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	rtn
+
+rfcomm_send_uih_without_payload:
+	bpatchx patch28_4,mem_patch28
+	fetch 1,mem_credit_given
+	rtn blank
+	fetch 2,core_uart_rxitems
+	nrtn blank
+	copy rega,pdata
+	store 1,mem_pdatatemp+1
+	storet 1,mem_pdatatemp
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x05
+	istore 2,contw
+	fetch 2,mem_RFCOMM_remote_CID
+	istore 2,contw
+	fetch 1,mem_rfcomm_send_adss
+	istore 1,contw
+	setarg 0x01ff
+	istore 2,contw
+	fetch 1,mem_credit_given
+	istore 1,contw
+	fetch 1,mem_HIUfcs_SPP_WCredits
+	istore 1,contw
+	jam 0,mem_credit_given
+	rtn
+	
+rfcomm_increase_credit_given:
+	bpatchx patch28_5,mem_patch28
+	fetch 1,mem_rfcomm_credit_flag
+	rtneq CREDIT_ENABLE
+	fetch 2,mem_current_length
+	rtn blank
+	fetch 1,mem_credit_given
+	increase 1,pdata
+	store 1,mem_credit_given
+	rtn
+
+spp_process_rx_data:
+	fetch 2,mem_cb_receive_spp_data
+	branch callback_func
+
+spp_tx_rfcomm_packet:
+	bpatchx patch28_6,mem_patch28
+	//credit
+	fetch 1,mem_remote_credits
+	rtn blank
+	increase -1,pdata
+	store 1,mem_remote_credits
+	fetch 2,mem_pn_max_frame_size
+	fetcht 2,mem_current_packet_length
+	isub temp,null
+	branch ssp_tx_rfcomm_from_uart,positive
+	store 2,mem_current_packet_length
+ssp_tx_rfcomm_from_uart:
+	fetch 1,mem_credit_given
+	branch ssp_tx_rfcomm_from_uart_without_credit,blank
+	jam 1,mem_rfcomm_send_offset
+	fetch 1,mem_HIUfcs_SPP_WCredits
+	store 1,mem_rfcomm_send_fcs
+	setarg RSP_RX_UIH_WDATA
+	store 1,mem_rfcomm_send_frame_type
+	branch ssp_tx_rfcomm_from_uart_common
+ssp_tx_rfcomm_from_uart_without_credit:
+	jam 0,mem_rfcomm_send_offset
+	fetch 1,mem_HIUfcs_SPP
+	store 1,mem_rfcomm_send_fcs
+	setarg RSP_TX_UIH
+	store 1,mem_rfcomm_send_frame_type
+ssp_tx_rfcomm_from_uart_common:
+	bpatchx patch28_7,mem_patch28
+	fetch 2,mem_current_packet_length
+	sub pdata,127,null
+	branch ssp_tx_rfcomm_from_uart_common0,positive
+	fetch 1,mem_rfcomm_send_offset
+	increase 1,pdata
+	store 1,mem_rfcomm_send_offset
+ssp_tx_rfcomm_from_uart_common0:
+	call get_rfcomm_snd_adss
+	fetch 2,mem_current_packet_length
+	increase 8,pdata	//fcs + rfcommhead + l2caphead == 8
+	fetcht 1,mem_rfcomm_send_offset
+	iadd temp,rega
+	//rfcomm payload
+	call l2cap_malloc
+	store 2,mem_rfcomm_tx_buff_ptr
+	increase 4,pdata
+	store 2,mem_rfcomm_tx_payload_ptr
+	copy pdata,contw
+	fetch 1,mem_rfcomm_send_adss
+	istore 1,contw
+	fetch 1,mem_rfcomm_send_frame_type
+	istore 1,contw
+	call ssp_tx_write_length
+	call ssp_tx_write_given_credit
+	bpatchx patch29_0,mem_patch29
+	fetch 2,mem_nl_rx_data_src		//src
+	copy pdata,contu
+	fetch 2,mem_current_packet_length
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes_fast
+	copy contw,temp
+	copy contu,pdata
+	store 2,mem_nl_rx_data_src
+	copy temp,contw	
+	fetch 1,mem_rfcomm_send_fcs
+	istore 1,contw
+	fetch 2,mem_rfcomm_tx_buff_ptr
+	copy pdata,contw
+	fetch 2,mem_current_packet_length
+	fetcht 1,mem_rfcomm_send_offset
+	iadd temp,pdata
+	increase 4,pdata
+	istore 2,contw
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw
+	jam 0,mem_credit_given	//whatever mem_credit_given is set to 0
+	fetch 2,mem_nl_rx_len_all
+	beq 0,module_hci_command_tx_spp_tx_complete
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	rtn
+
+ssp_tx_write_length:
+	bpatchx patch29_1,mem_patch29
+	fetch 2,mem_current_packet_length
+	sub pdata,0x7f,null
+	nbranch ssp_tx_write_long_packet,positive
+	lshift pdata,pdata
+	set1 0,pdata
+	istore 1,contw
+	rtn
+ssp_tx_write_long_packet:
+	fetch 2,mem_current_packet_length
+	rshift3 pdata,pdata
+	rshift4 pdata,temp
+	and_into 0x7f,pdata
+	lshift pdata,pdata
+	set0 0,pdata
+	istore 1,contw
+	istoret 1,contw
+	rtn
+ssp_tx_write_given_credit:
+	fetch 1,mem_credit_given
+	rtn blank
+	istore 1,contw
+	rtn
+
+	
+
+
+else
+
+endif
Index: program/scheduler.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/scheduler.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/scheduler.prog	(working copy)
@@ -0,0 +1,460 @@
+scheduler_process:
+	bpatchx patch29_2,mem_patch29
+	call check_51cmd
+	call app_process_bb_event
+	call process_conn_sm
+/* check the connection state sequence byte */
+	bpatchx patch29_3,mem_patch29
+ifdef SIMPLE_PAIRING
+	call sp_calc_sequence
+	call simple_pairing_sequence
+	call master_simple_paring_sequence
+endif
+//return if it is hci mode. 'cause the following is host part.
+//notify BB to tx a l2cap packet
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	//for conn to MTK 
+	call l2cap_call_proc_sigal_pending
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	bpatchx patch29_4,mem_patch29
+//to generat a new l2cap packet
+	call process_upper_sm
+	call l2cap_send_config_req
+ifdef COMPILE_RFCOMM
+	call rfcomm_send_more_pkt//use this function to send msc_cmd after msc_rep sent
+endif
+scheduler_process0:
+	call scheduler_tx_disconnect_hid //may not used
+	bpatchx patch29_5,mem_patch29
+//	call l2cap_malloc_is_fifo_full
+//	nrtn blank
+	branch app_process_bt
+	
+scheduler_tx_disconnect_hid:
+	fetch 1,mem_CONTROL_tasks		
+	bbit1 L2CAP_DISCONNECT_INTERRUPT,L2CAP_disconnect_interrupt_req
+	bbit1 L2CAP_DISCONNECT_CONTROL,L2CAP_disconnect_control_req
+	rtn
+	
+scheduler_tx_l2cap_pkt:
+	bpatchx patch29_6,mem_patch29
+	call l2cap_malloc_is_fifo_empty
+	rtn blank //empty
+	fetch 1,mem_op
+	rtnbit1 op_txl2cap
+	call l2cap_malloc_fifo_out
+	store 2,mem_txptr
+	copy pdata,contr
+	ifetch 2,contr
+	increase 4,pdata
+	store 2,mem_tx_len
+	jam 6,mem_tx_lch//start pkt
+	bpatchx patch29_7,mem_patch29
+	fetch 2,mem_l2cap_tx_multi_offset
+	branch scheduler_tx_l2cap_start_pkt,blank
+	fetch 1,mem_op
+	rtnbit0 op_pkt_comp
+	set0 op_pkt_comp,pdata
+	store 1,mem_op
+	jam 5,mem_tx_lch//continue pkt
+	fetcht 2,mem_l2cap_tx_multi_offset
+	fetch 2,mem_txptr
+	iadd temp,pdata
+	store 2,mem_txptr
+	fetch 2,mem_tx_len
+	isub temp,pdata
+	store 2,mem_tx_len
+scheduler_tx_l2cap_start_pkt:
+	fetch 2,mem_tx_len
+	branch assert,blank
+	arg l2cap_max_pkt_len,temp //max len of dh3 pkt
+	isub temp,pdata
+	branch scheduler_Tx_l2cap_last_pkt,zero
+	nbranch scheduler_Tx_l2cap_last_pkt,positive
+	storet 2,mem_tx_len //l2cap_max_pkt_len
+	fetch 2,mem_l2cap_tx_multi_offset
+	iadd temp,pdata
+	store 2,mem_l2cap_tx_multi_offset
+	branch scheduler_Tx_l2cap_pkt_end
+scheduler_Tx_l2cap_last_pkt:
+	setarg 0
+	store 2,mem_l2cap_tx_multi_offset
+scheduler_Tx_l2cap_pkt_end:
+	fetch 1,mem_op
+	set1 op_txl2cap,pdata
+	store 1,mem_op
+	rtn
+
+scheduler_start_upper_sm:
+	fetch 1,mem_UI_profile_supported
+	bbit1 support_HID,scheduler_start_upper_sm_hid
+	jam UPPERSM_RECONN_SDP_CONN,mem_upper_sm_reconn
+	rtn
+scheduler_start_upper_sm_hid:
+	jam UPPERSM_RECONN_HID_CTRL_CONN,mem_upper_sm_reconn
+	rtn
+	
+process_upper_sm:
+	fetch 1,memui_reconnect_mode
+	nbranch process_upper_sm_reconn,blank
+process_upper_sm_remote_page:
+	fetch 1,mem_upper_sm_remote_page
+	//beq UPPERSM_RP_IDLE,process_upper_sm_rp_idle
+	rtn blank
+	//nothing to do when remote page to create a connection.
+	jam 0,mem_upper_sm_remote_page
+process_upper_sm_rp_wait:
+	rtn
+
+
+process_upper_sm_reconn:
+	bpatchx patch2a_0,mem_patch2a
+	fetch 1,mem_upper_sm_reconn
+	rtn blank
+	beq UPPERSM_RECONN_SDP_CONN,process_upper_sm_reconn_sdp_conn
+	beq UPPERSM_RECONN_SDP_CONN_WAIT,process_upper_sm_reconn_sdp_conn_wait
+	beq UPPERSM_RECONN_SDP_CFG,process_upper_sm_reconn_sdp_cfg
+	beq UPPERSM_RECONN_SDP_CFG_WAIT,process_upper_sm_reconn_sdp_cfg_wait
+	beq UPPERSM_RECONN_SS_SPP,process_upper_sm_reconn_ss_spp
+	beq UPPERSM_RECONN_SS_SPP_WAIT,process_upper_sm_reconn_ss_spp_wait
+	beq UPPERSM_RECONN_SDP_DISCONN,process_upper_sm_reconn_sdp_disconn
+	beq UPPERSM_RECONN_SDP_DISCONN_WAIT,process_upper_sm_reconn_sdp_disconn_wait
+	beq UPPERSM_RECONN_HID_CTRL_CONN,process_upper_sm_reconn_hid_ctrl_conn
+	beq UPPERSM_RECONN_HID_CTRL_CONN_WAIT,process_upper_sm_reconn_hid_ctrl_conn_wait
+	beq UPPERSM_RECONN_HID_CTRL_CFG,process_upper_sm_reconn_hid_ctrl_cfg
+	beq UPPERSM_RECONN_HID_CTRL_CFG_WAIT,process_upper_sm_reconn_hid_ctrl_cfg_wait
+	beq UPPERSM_RECONN_HID_INT_CONN,process_upper_sm_reconn_hid_int_conn
+	beq UPPERSM_RECONN_HID_INT_CONN_WAIT,process_upper_sm_reconn_hid_int_conn_wait
+	beq UPPERSM_RECONN_HID_INT_CFG,process_upper_sm_reconn_hid_int_cfg
+	beq UPPERSM_RECONN_HID_INT_CFG_WAIT,process_upper_sm_reconn_hid_int_cfg_wait
+	beq UPPERSM_RECONN_RFCOMM_CONN,process_upper_sm_reconn_rfcomm_conn
+	beq UPPERSM_RECONN_RFCOMM_CONN_WAIT,process_upper_sm_reconn_rfcomm_conn_wait
+	beq UPPERSM_RECONN_RFCOMM_CFG,process_upper_sm_reconn_rfcomm_cfg
+	beq UPPERSM_RECONN_RFCOMM_CFG_WAIT,process_upper_sm_reconn_rfcomm_cfg_wait
+	beq UPPERSM_RECONN_RFCOMM_SABM,process_upper_sm_reconn_rfcomm_sabm
+	beq UPPERSM_RECONN_RFCOMM_SABM_WAIT,process_upper_sm_reconn_rfcomm_sabm_wait
+	beq UPPERSM_RECONN_SPP_CMD_PN,process_upper_sm_reconn_spp_cmd_pn
+	beq UPPERSM_RECONN_SPP_CMD_PN_WAIT,process_upper_sm_reconn_spp_cmd_pn_wait
+	beq UPPERSM_RECONN_SPP_SABM,process_upper_sm_reconn_spp_sabm
+	beq UPPERSM_RECONN_SPP_SABM_WAIT,process_upper_sm_reconn_spp_sabm_wait
+	beq UPPERSM_RECONN_SPP_CMD_MS,process_upper_sm_reconn_spp_cmd_ms
+	beq UPPERSM_RECONN_SPP_CMD_MS_WAIT,process_upper_sm_reconn_spp_cmd_ms_wait
+process_upper_sm_reconn_wait:
+	rtn
+process_upper_sm_reconn_sdp_conn:
+	call upper_sm_send_sdp_conn //return n-user if sending failed
+	jam UPPERSM_RECONN_SDP_CONN_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	store 1,mem_sdp_state
+	rtn
+process_upper_sm_reconn_sdp_cfg:
+	jam UPPERSM_RECONN_SDP_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_sdp_state
+	rtnbit1 L2CAP_CHANNEL_STATE_SND_CFG_REQ
+	jam UPPERSM_RECONN_SDP_CFG,mem_upper_sm_reconn
+	call upper_sm_send_sdp_cfg //return n-user if sending failed
+	jam UPPERSM_RECONN_SDP_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_sdp_state
+	rtn
+process_upper_sm_reconn_ss_spp:
+	call l2cap_malloc_is_fifo_empty
+	nrtn blank
+	call upper_sm_send_ss_spp
+	jam UPPERSM_RECONN_SS_SPP_WAIT,mem_upper_sm_reconn
+	rtn
+process_upper_sm_reconn_sdp_disconn:
+	call upper_sm_send_sdp_disconn
+	jam UPPERSM_RECONN_SDP_DISCONN_WAIT,mem_upper_sm_reconn
+	rtn
+process_upper_sm_reconn_hid_ctrl_conn:
+	call upper_sm_send_hid_ctrl_conn
+	jam UPPERSM_RECONN_HID_CTRL_CONN_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	store 1,mem_hid_control_state
+	rtn
+process_upper_sm_reconn_hid_ctrl_cfg:    
+	call upper_sm_send_hid_ctrl_cfg
+	jam UPPERSM_RECONN_HID_CTRL_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_hid_control_state
+	rtn
+process_upper_sm_reconn_hid_int_conn:
+	call upper_sm_send_hid_int_conn
+	jam UPPERSM_RECONN_HID_INT_CONN_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	store 1,mem_hid_interrupt_state
+	rtn
+process_upper_sm_reconn_hid_int_cfg:    
+	call upper_sm_send_hid_int_cfg
+	jam UPPERSM_RECONN_HID_INT_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_hid_interrupt_state
+	rtn
+process_upper_sm_reconn_rfcomm_conn:
+	call upper_sm_send_rfcomm_conn
+	jam UPPERSM_RECONN_RFCOMM_CONN_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	store 1,mem_rfcomm_state
+	rtn
+process_upper_sm_reconn_rfcomm_cfg: 
+	call upper_sm_send_rfcomm_cfg
+	jam UPPERSM_RECONN_RFCOMM_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_rfcomm_state
+	rtn
+process_upper_sm_reconn_rfcomm_sabm:
+	call upper_sm_send_rfcomm_sabm
+	jam UPPERSM_RECONN_RFCOMM_SABM_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_RFCOMM_ONLY_SABM,pdata
+	store 1,mem_rfcomm_state
+	rtn
+process_upper_sm_reconn_spp_cmd_pn: 
+	call upper_sm_send_spp_cmd_pn
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_PN_CMD,pdata
+	store 1,mem_spp_state
+	jam UPPERSM_RECONN_SPP_CMD_PN_WAIT,mem_upper_sm_reconn
+	rtn
+process_upper_sm_reconn_spp_sabm:   
+	call upper_sm_send_spp_sabm
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_SABM,pdata
+	store 1,mem_spp_state
+	jam UPPERSM_RECONN_SPP_SABM_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_remote_spp_channel //address in pdata
+	lshift3 pdata,pdata
+	or_into 3,pdata
+	arg mem_HIUfcs_SPP,temp // mem_HIUfcs_spp_WCredits in regb++
+	storet 2,mem_contw_temp
+	branch rfcomm_save_FCS_uih
+process_upper_sm_reconn_spp_cmd_ms: 
+	call upper_sm_send_spp_cmd_ms
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_SND_MS_CMD,pdata
+	store 1,mem_spp_state
+	jam UPPERSM_RECONN_SPP_CMD_MS_WAIT,mem_upper_sm_reconn
+	rtn
+
+process_upper_sm_reconn_sdp_conn_wait:
+	fetch 1,mem_sdp_state
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES
+	jam UPPERSM_RECONN_SDP_CFG,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_sdp_cfg_wait:
+	fetch 1,mem_sdp_state
+	rtnne L2CAP_CHANNEL_SETUP_COMPLETE
+	jam UPPERSM_RECONN_SS_SPP ,mem_upper_sm_reconn
+process_upper_sm_reconn_ss_spp_wait:
+	fetch 1,mem_message_to_uppersm
+	rtnne RECIEVE_SS_REASULT_HF
+	jam 0,mem_message_to_uppersm
+	jam UPPERSM_RECONN_SDP_DISCONN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_sdp_disconn_wait:
+	fetch 1,mem_sdp_state
+	nrtn blank
+	fetch 1,mem_UI_profile_supported
+	bbit1 support_HID,process_upper_sm_reconn_setup_hid
+	bbit1 support_SPP,process_upper_sm_reconn_setup_rfcomm
+	branch process_upper_sm_reconn_termination
+process_upper_sm_reconn_hid_ctrl_conn_wait:
+	fetch 1,mem_hid_control_state
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES
+	jam UPPERSM_RECONN_HID_CTRL_CFG,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_hid_ctrl_cfg_wait:
+	fetch 1,mem_hid_control_state
+	rtnne L2CAP_CHANNEL_SETUP_COMPLETE
+	jam UPPERSM_RECONN_HID_INT_CONN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_hid_int_conn_wait:  
+	fetch 1,mem_hid_interrupt_state
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES
+	jam UPPERSM_RECONN_HID_INT_CFG,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_hid_int_cfg_wait:  
+	fetch 1,mem_hid_interrupt_state
+	rtnne L2CAP_CHANNEL_SETUP_COMPLETE
+	fetch 1,mem_UI_profile_supported
+	bbit1 support_SPP,process_upper_sm_reconn_setup_rfcomm
+	branch process_upper_sm_reconn_termination
+process_upper_sm_reconn_rfcomm_conn_wait: 
+	fetch 1,mem_rfcomm_state
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES
+	jam UPPERSM_RECONN_RFCOMM_CFG,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_rfcomm_cfg_wait:
+	fetch 1,mem_rfcomm_state
+	rtnne L2CAP_CHANNEL_SETUP_COMPLETE
+	jam UPPERSM_RECONN_RFCOMM_SABM,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_rfcomm_sabm_wait:  
+	fetch 1,mem_rfcomm_state
+	rtnne L2CAP_CHANNEL_RFCOMM_DLCI0_OPENED
+	fetch 1,mem_UI_profile_supported
+	bbit1 support_SPP,process_upper_sm_reconn_setup_spp
+	branch process_upper_sm_reconn_termination
+process_upper_sm_reconn_spp_cmd_pn_wait:
+	fetch 1,mem_spp_state
+	rtnbit0 RFCOMM_CHANNEL_STATE_PN_RES
+	jam UPPERSM_RECONN_SPP_SABM,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_spp_sabm_wait:
+	fetch 1,mem_spp_state
+	rtnbit0 RFCOMM_CHANNEL_STATE_UA
+	jam UPPERSM_RECONN_SPP_CMD_MS ,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_spp_cmd_ms_wait: 
+	fetch 1,mem_spp_state
+	rtnne RFCOMM_CHANNEL_SETUP_COMPLETE
+	branch process_upper_sm_reconn_termination
+
+process_upper_sm_reconn_setup_hid:
+	jam UPPERSM_RECONN_HID_CTRL_CONN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+
+process_upper_sm_reconn_setup_rfcomm:
+	jam UPPERSM_RECONN_RFCOMM_CONN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_setup_spp:
+	jam UPPERSM_RECONN_SPP_CMD_PN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+
+
+
+process_upper_sm_reconn_termination:
+	jam 0,mem_upper_sm_reconn
+	rtn
+upper_sm_send_sdp_conn:
+	bpatchx patch2a_1,mem_patch2a
+	call l2cap_malloc_signal_channel
+	setarg PSM_SDP
+	copy pdata,temp
+	setarg L2CAP_SDP_channel
+	copy pdata,timeup
+	branch ML2CAP_send_signal_connect_req
+	
+upper_sm_send_sdp_cfg:
+	bpatchx patch2a_2,mem_patch2a
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_SDP_remote_CID
+	copy pdata,temp
+	branch ML2CAP_send_signal_config_req
+	
+upper_sm_send_sdp_disconn:
+	bpatchx patch2a_3,mem_patch2a
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_SDP_remote_CID
+	copy pdata,temp
+	arg L2CAP_SDP_channel,timeup
+	call ML2CAP_send_signal_disconn_req
+	fetch 1,mem_sdp_state
+	set0 L2CAP_CHANNEL_STATE_RCV_CFG_RES ,pdata
+	store 1,mem_sdp_state
+	rtn
+//service search
+upper_sm_send_ss_spp:
+	bpatchx patch2a_4,mem_patch2a
+	call l2cap_malloc_sdp_channel
+	call sdp_send_spp_request
+	branch MSDP_send_req_done
+
+upper_sm_send_rfcomm_conn:
+	bpatchx patch2a_5,mem_patch2a
+	call l2cap_malloc_signal_channel
+	setarg PSM_RFCOMM
+	copy pdata,temp
+	setarg L2CAP_RFCOMM_channel
+	copy pdata,timeup
+	branch ML2CAP_send_signal_connect_req
+
+upper_sm_send_rfcomm_cfg:
+	bpatchx patch2a_6,mem_patch2a
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_rfcomm_remote_cid
+	copy pdata,temp
+	branch ML2CAP_send_signal_config_req
+
+upper_sm_send_hid_ctrl_conn:
+	bpatchx patch2a_7,mem_patch2a
+	call l2cap_malloc_signal_channel
+	setarg PSM_HID_control
+	copy pdata,temp
+	setarg L2CAP_HID_Control_channel
+	copy pdata,timeup
+	branch ML2CAP_send_signal_connect_req
+
+upper_sm_send_hid_ctrl_cfg:
+	bpatchx patch2b_0,mem_patch2b
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_hid_ctrl_remote_cid
+	copy pdata,temp
+	branch ML2CAP_send_signal_config_req
+
+upper_sm_send_hid_int_conn:
+	bpatchx patch2b_1,mem_patch2b
+	call l2cap_malloc_signal_channel
+	setarg PSM_HID_interrupt
+	copy pdata,temp
+	setarg L2CAP_HID_interrupt_channel
+	copy pdata,timeup
+	branch ML2CAP_send_signal_connect_req
+	
+upper_sm_send_hid_int_cfg:
+	bpatchx patch2b_2,mem_patch2b
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_hid_int_remote_cid
+	copy pdata,temp
+	branch ML2CAP_send_signal_config_req
+
+upper_sm_send_rfcomm_sabm:
+	bpatchx patch2b_3,mem_patch2b
+	call l2cap_malloc_rfcomm_channel
+	//force 3,temp //address
+	jam 3,mem_current_adss
+	jam 0x1c,mem_current_fcs
+	call rfcomm_send_sabm
+	jam 1,mem_rfcomm_initiator
+	rtn
+
+upper_sm_send_spp_cmd_pn:
+	bpatchx patch2b_4,mem_patch2b
+	call l2cap_malloc_rfcomm_channel
+	fetcht 1,mem_remote_spp_channel
+	call channel_to_dlci
+	storet 1,mem_pn_dlci
+	branch rfcomm_send_param_neg_cmd
+
+upper_sm_send_spp_sabm:
+	bpatchx patch2b_5,mem_patch2b
+	call l2cap_malloc_rfcomm_channel
+	fetcht 1,mem_pn_dlci
+	call dlci_to_address_cmd
+	call rfcomm_calculate_FCS_sabm //sabm fcs use once only,not need to save
+	store 1,mem_current_fcs
+	fetcht 1,mem_pn_dlci
+	call dlci_to_address_cmd
+	storet 1,mem_current_adss
+	branch rfcomm_send_sabm
+
+upper_sm_send_spp_cmd_ms:
+	bpatchx patch2b_6,mem_patch2b
+	call l2cap_malloc_rfcomm_channel
+	fetcht 1,mem_pn_dlci
+	call dlci_to_address_cmd //address in temp
+	branch rfcomm_send_modem_status_cmd
+
+
+
Index: program/sdp.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/sdp.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/sdp.prog	(working copy)
@@ -0,0 +1,1206 @@
+/**********************************************************************/
+/* Subroutine: sdp_process                                         */
+/* Process Service Discovery Request                                  */
+/* Called from L2CAP, check PDUID, branch to different req processings*/
+/*                                                                    */  
+/* Input:       mem_L2CAP_Rx_payload                                  */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length	      */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process:
+	bpatchx patch2b_7,mem_patch2b
+	fetch 2,mem_l2cap_payload_ptr
+	iforce contr
+//	ifetchr regb,1,contr				/* PDUID */
+//	storer regb,1,mem_sdp_pduid
+	ifetch 1,contr
+	copy pdata,regb
+	store 1,mem_sdp_pduid
+	ifetch 2,contr
+	store 2,mem_sdp_transactionid			/* save transaction id */
+	ifetch 1,contr				/* higher byte of parameter length */
+	lshift8 pdata,timeup				
+	ifetch 1,contr				/* lower byte of parameter length */
+	iadd timeup,timeup				/* parameter length stored in "timeup" */
+	bpatchx patch2c_0,mem_patch2c
+	copy contr,temp
+	arg 4,loopcnt
+	arg mem_sdp_handle_list,contw
+	call memset0
+	copy temp,contr 
+	deposit regb						/* PDUID  */
+	beq SDP_ERROR_RES,sdp_process_error_res
+	beq SDP_SEARCH_REQ,sdp_process_ss_req
+	beq SDP_SEARCH_RES,sdp_process_ss_res
+	beq SDP_ATTRIBUTE_REQ,sdp_process_sa_req
+	beq SDP_ATTRIBUTE_RES,sdp_process_sa_res
+	beq SDP_SEARCHATTRIB_REQ,sdp_process_ssa_req
+	beq SDP_SEARCHATTRIB_RES,sdp_process_ssa_res
+	branch sdp_insufficient_resource
+
+/**********************************************************************/
+/* ss_req			                              */
+/* Processing Service Search Request                                  */
+/* Call: ask_serviceclassid, empty_response                     */
+/*                                                                    */  
+/* Input:       mem_L2CAP_Rx_payload pointer in contr                 */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length	      */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process_ss_req:
+	bpatchx patch2c_1,mem_patch2c
+	call ask_serviceclassid
+	compare 1,temp,0xff
+	branch ss_empty_rsp,true
+	compare 0xff,temp,0xff
+	branch sdp_invalid_request_syntax,true
+
+	ifetch 2,contr				/* max aservice record count */
+	store 2,mem_sdp_record_maxcnt
+	increase -2,timeup
+
+	increase -1,timeup				/* continuation state 1 byte (0) */
+	nbranch sdp_invalid_pdu_size,zero		/* invalid pdu size */
+	arg mem_sdp_uuid_search_ptr,timeup
+	ifetch 2,timeup
+	rtn blank
+	call search_all_uuid
+	call l2cap_get_sdp_tx_payload			/* put the pointer to Tx buffer  */
+	force 3,pdata						/* PDUID 3, Service Search Response */
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid			/* write transaction id */
+	istore 2,contw
+	lshift2 queue,pdata
+	add pdata,5,pdata
+	add pdata,5,regc
+	byteswap pdata,pdata
+	istore 2,contw							/* write parLength */
+	deposit queue
+	byteswap pdata,pdata
+	istore 2,contw							/* write TotSrvRecCount */
+	istore 2,contw							/* write CurSrvRecCount */
+	arg mem_sdp_handle_list,contr
+	copy queue,loopcnt
+	branch ss_req_blank,zero
+ss_req_loop:	
+	ifetch 4,contr
+	istore 4,contw
+	loop ss_req_loop
+ss_req_blank:	
+	force 0,pdata
+	istore 1,contw							/* continuation state */
+	deposit regc
+	store 2,mem_sdp_tx_pkt_length
+//	branch assert,blank
+	rtn
+
+/**********************************************************************/
+/* sa_req			                              */
+/* Processing Service Attribute Request                               */
+/* Call: ask_attributeid, empty_response (if 3 stored attr.     */
+/* not asked) or answer_attributelist                              */  
+/* Input:       mem_L2CAP_Rx_payload pointer in contr                 */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length	      */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process_sa_req:
+	bpatchx patch2c_2,mem_patch2c
+	ifetch 4,contr				/* service record handle */
+	store 4,mem_sdp_record_handle	 
+	increase -4,timeup
+	call sdp_store_maxbyte
+	store 2,mem_sdp_attribute_maxbyte
+	increase -2,timeup
+	call dataelementtype6		/* result: data size stored in rega */
+	branch sdp_invalid_request_syntax,zero
+	compare 5,rega,0xff  // length
+	//branch sa_req_all,true
+	branch sa_judge_wholerange,true
+sa_isnot_wholerange:
+	arg mem_sdp_attrib_list,contw
+	force 0,queue
+	branch sa_req_loop
+sa_judge_wholerange:
+	ifetch 1,contr
+	bne SDP_ATTRIBUTE_RANGE,sdp_invalid_request_syntax
+	ifetch 2,contr
+	nbranch sa_judge_wholerange_false1,blank
+	ifetch 1,contr
+	bne 0xff,sa_judge_wholerange_false2
+	ifetch 1,contr
+	bne 0xff,sa_judge_wholerange_false3		//also exist potential bug because mem_sdp_attrib_list length is only 7f
+	branch sa_req_all
+sa_judge_wholerange_false3:
+	increase -5,contr
+	branch sa_isnot_wholerange
+sa_judge_wholerange_false2:
+	increase -4,contr
+	branch sa_isnot_wholerange
+sa_judge_wholerange_false1:
+	increase -3,contr
+	branch sa_isnot_wholerange
+sa_req_loop:	
+	ifetch 1,contr
+	beq SDP_ATTRIBUTE_ID, sa_req_one_id
+	beq SDP_ATTRIBUTE_RANGE, sa_req_range
+sa_req_range:
+	ifetch 2, contr
+	istore 2, contw
+	increase 1,queue
+	byteswap pdata,regb
+	ifetch 2, contr
+	byteswap pdata,pdata
+sa_req_range_id_increase:	
+	increase 1, regb
+	isub regb, null
+	nbranch sa_req_range_id_finish,positive
+	copy pdata, regc
+	byteswap regb,pdata
+	istore 2, contw
+	increase 1,queue
+	copy regc, pdata
+	branch sa_req_range_id_increase
+sa_req_range_id_finish:
+	increase -5,timeup
+	increase -5,rega
+	branch sa_req_check_next_id
+sa_req_one_id:
+	ifetch 2,contr
+	istore 2,contw //save the attribute id in mem_sdp_attrib_list
+	increase 1,queue
+	increase -3,timeup
+	increase -3,rega
+sa_req_check_next_id:	
+	nbranch sdp_invalid_request_syntax,positive
+	nbranch sa_req_loop,zero //another attribute 
+	increase -1,timeup
+	nbranch sdp_invalid_request_syntax,zero
+	
+	call l2cap_get_sdp_tx_payload
+	increase 10,contw
+	arg mem_sdp_attrib_list,rega
+sa_req_handle_attributelist_next:
+	copy queue,pdata
+	branch sa_req_handle_attributelist_end,blank
+	ifetch 2,rega
+	branch sa_req_handle_attributelist_end,blank
+	iforce regb /* regb is the attribute ID */
+	fetch 4,mem_sdp_record_handle	
+	iforce temp
+	call search_handle_attrib
+	copy contr,pdata
+	branch sa_req_handle_attributelist_notfound,blank
+	increase -3,contr
+	ifetch 3,contr
+	istore 3,contw
+	call sdp_data_len
+	iforce loopcnt	
+	call memcpy
+sa_req_handle_attributelist_notfound:
+	increase 2,rega
+	increase -1, queue
+	branch sa_req_handle_attributelist_next
+
+sa_req_handle_attributelist_end:	
+	arg SDP_ATTRIBUTE_RES,rega
+	call ssa_req_range_lastfreg_common
+	fetch 2,mem_sdp_tx_pkt_length	
+	beq 11,sa_empty_rsp
+	branch  ssa_req_range_attrbutes_length_no_continue
+
+
+sdp_store_continue_common:
+	ifetch 1, contr
+	beq 0, sdp_store_continue_0byte
+	beq 1,sdp_store_continue_1byte
+	beq 2, sdp_store_continue_2byte
+sdp_store_continue_0byte:	
+	increase -1,timeup				/* continuation state byte (0) */
+	branch sdp_store_continue_end
+sdp_store_continue_1byte:
+	ifetch 1, contr
+	increase -2,timeup				/* continuation state byte (1) */
+	branch sdp_store_continue_end
+sdp_store_continue_2byte:
+	ifetch 2, contr
+	byteswap pdata,pdata
+	increase -3,timeup				/* continuation state byte (2) */
+sdp_store_continue_end:
+	store 2, mem_sdp_continue_byte	
+	rtn
+	
+sa_req_all:	
+	increase -5,timeup
+	call sdp_store_continue_common
+	nbranch sdp_invalid_pdu_size,zero
+	fetcht 4,mem_sdp_record_handle		
+	call search_handle
+	nbranch sdp_invalid_service_record_handle,zero
+	copy contr,rega
+	call l2cap_get_sdp_tx_payload
+	copy rega,contr
+	increase 3,contw//arg mem_SDP_Tx_payload+3,contw
+	copy contr,timeup //sdp start pointer
+	call sdp_get_data
+	copy pdata, rega //sdp total length
+//	fetchr regb,2,mem_sdp_continue_byte
+	fetch 2,mem_sdp_continue_byte
+	copy pdata,regb
+	copy rega,pdata
+	isub regb,regb //total_length - continue_byte in regb
+	fetch 2, mem_sdp_attribute_maxbyte
+	isub regb, null
+	nbranch sa_req_all_fragment_sdp, positive
+	// the last fragment
+	disable user
+	fetch 2, mem_sdp_continue_byte
+	branch sa_req_all_fisrt_fragment,blank
+	iadd timeup, contr //set the read pointer
+	increase 3,regb //include the total length field, 3 bytes
+	copy regb, loopcnt
+	copy loopcnt, pdata
+	increase 3, pdata
+	byteswap pdata,pdata
+	istore 2, contw
+	copy loopcnt, pdata
+	byteswap pdata,pdata
+	istore 2, contw
+	branch sa_req_all_answer_attributelist_full_loop
+sa_req_all_fisrt_fragment:
+	add rega,6,loopcnt
+	branch sa_req_all_parlength_continue_byte, user
+	byteswap loopcnt,pdata
+	branch sa_req_all_parlength_continue_byte_end
+sa_req_all_parlength_continue_byte:
+	copy loopcnt, pdata
+	increase 2, pdata
+	byteswap pdata,pdata
+sa_req_all_parlength_continue_byte_end:
+	istore 2,contw				/* ParLength */
+	increase -3,loopcnt
+	byteswap loopcnt,pdata			
+	istore 2,contw				/* AttrListByteCount */
+	copy timeup,contr
+	branch sa_req_all_answer_attributelist_full_loop
+sa_req_all_fragment_sdp:
+	enable user
+//	fetchr rega,2,mem_sdp_attribute_maxbyte
+	fetch 2,mem_sdp_attribute_maxbyte
+	copy pdata,rega
+	copy rega,loopcnt
+	fetch 2, mem_sdp_continue_byte
+	branch sa_req_all_fisrt_fragment,blank
+	iadd timeup, contr
+	copy rega,pdata
+	increase 5,pdata
+	byteswap pdata,pdata	
+	istore 2, contw
+	copy rega,pdata
+	byteswap pdata,pdata
+	istore 2, contw
+sa_req_all_answer_attributelist_full_loop:
+	call memcpy
+	nbranch sa_req_all_last_frag_continue, user
+	force 2,pdata
+	istore 1,contw
+	copy contr, pdata
+	isub timeup, pdata
+	byteswap pdata,pdata
+	istore 2, contw   // continuation length
+	branch sa_req_all_frag_end
+sa_req_all_last_frag_continue:
+	force 0,pdata
+	istore 1,contw
+sa_req_all_frag_end:	
+	arg SDP_ATTRIBUTE_RES,rega
+	branch ssa_req_range_common	
+	
+/**********************************************************************/
+/* ssa_req                          		      */
+/* Processing Service Search Attribute Request                        */
+/* Call: ask_serviceclassid, ask_attributeid, empty_response */
+/*       or answer_attributelist                                   */  
+/* Input:       contr                                                 */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length             */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process_ssa_req:
+	bpatchx patch2c_3,mem_patch2c
+	call ask_serviceclassid
+	compare 0xff,temp,0xff
+	branch sdp_invalid_request_syntax,true
+	call sdp_store_maxbyte
+	store 2,mem_sdp_attribute_maxbyte
+	increase -2,timeup
+	call dataelementtype6
+	arg mem_sdp_attrib_list,contw
+	force 0,queue
+ssa_req_loop:	
+	ifetch 1,contr 
+	beq SDP_ATTRIBUTE_RANGE,ssa_req_range
+	ifetch 2,contr 
+	istore 2,contw //save the attribute id in mem_sdp_attrib_list
+	increase 1,queue
+	increase -3,timeup
+	increase -3,rega
+	nbranch sdp_invalid_request_syntax,positive
+	nbranch ssa_req_loop,zero
+	increase -1,timeup
+	nbranch sdp_invalid_request_syntax,zero
+	call l2cap_get_sdp_tx_payload
+	increase 13,contw//arg mem_SDP_Tx_payload+13,contw
+	fetch 2,mem_sdp_uuid_search_ptr
+	iforce regc
+	arg mem_sdp_attrib_list,rega
+ssa_req_attributelist_next:	
+	ifetch 2,rega
+	branch ssa_req_attributelist_end,blank
+	iforce regb						/* regb is the attribute ID */
+	call search_attrib
+	branch ssa_req_attributelist_notfound,blank
+	increase -3,contr
+	ifetch 3,contr
+	istore 3,contw
+	call sdp_data_len
+	iforce loopcnt	
+  	call memcpy
+ssa_req_attributelist_notfound:
+	increase 2,rega
+	branch ssa_req_attributelist_next
+
+ssa_req_attributelist_end:
+	call ssa_req_range_lastfreg
+	fetch 2,mem_sdp_tx_pkt_length	
+	beq 14,ssa_empty_rsp
+	call ssa_req_range_attrbutes_length_no_continue
+	branch ssa_req_range_attrbutes_length_no_continue
+
+
+sdp_store_maxbyte:	
+	ifetch 2,contr				 
+	byteswap pdata,pdata
+	increase -3,pdata	
+	arg 200,temp
+	isub temp,null
+	nrtn positive
+	setarg 200
+	rtn
+	
+
+ssa_req_range:
+	increase 4,contr
+	increase -5,timeup
+	increase -5,rega
+	nbranch sdp_invalid_request_syntax,zero
+	call 	sdp_store_continue_common
+	nbranch sdp_invalid_pdu_size,zero
+	arg mem_sdp_uuid_search_ptr,timeup
+	call search_all_uuid  
+	deposit queue
+	branch ssa_empty_rsp,blank
+	store 1,mem_handle_humber
+//	storer regb,2,mem_sdp_all_length
+	copy regb,pdata
+	store 2,mem_sdp_all_length
+	arg 0,queue
+	arg 0,rega
+	call l2cap_get_sdp_tx_payload
+	increase 10,contw 
+ssa_req_range_find_handle:
+	call ssa_req_range_get_length	
+	nbranch assert,user
+	copy contr,timeup
+	copy pdata,regc
+	iadd rega,rega
+//	copy pdata,rega 
+//	fetch 2,mem_sdp_all_length
+	fetch 2,mem_sdp_continue_byte
+	copy pdata,regb
+	branch ssa_req_range_first_freg,blank
+ssa_req_range_later_freg_with_continue:
+	copy rega,pdata
+	isub regb,regb //total_length - continue_byte in rega
+	branch ssa_req_range_next_handle,zero
+	nbranch ssa_req_range_next_handle,positive
+	fetch 2, mem_sdp_attribute_maxbyte
+	isub regb, null
+	branch ssa_req_range_maxbyte_with_continue,zero
+	nbranch ssa_req_range_maxbyte_with_continue, positive  
+	
+ // data length < =maxbyte 
+ssa_req_range_send_not_maxbyte:
+ 	copy regb,loopcnt
+	call ssa_req_range_maxbyte_with_continue_cpy
+ 	fetch 1,mem_handle_humber
+	increase 1,queue
+	isub queue,null
+	branch ssa_req_range_lastfreg,zero
+	branch ssa_req_range_freg_with_continue
+	
+ssa_req_range_maxbyte_with_continue:
+ 	copy pdata,loopcnt
+ 	call ssa_req_range_maxbyte_with_continue_cpy
+ 	branch ssa_req_range_freg_with_continue
+ 	
+ssa_req_range_maxbyte_with_continue_cpy:
+	increase -3,contw   
+	copy loopcnt,temp
+ 	copy regc,pdata
+	isub regb,pdata
+	iadd timeup,contr
+ 	branch memcpy
+
+ssa_req_range_next_handle:
+	fetch 1,mem_handle_humber
+	increase 1,queue
+	isub queue,null
+	rtn zero //
+	branch ssa_req_range_find_handle
+
+ssa_req_range_get_length:	
+	call disable_user
+	arg mem_sdp_handle_list,contr
+	lshift2 queue,pdata
+	iadd contr,contr
+	ifetcht 4, contr
+	call search_handle
+	nrtn zero
+	call sdp_data_len
+	branch enable_user
+
+ssa_req_range_first_freg:
+	fetch 2, mem_sdp_attribute_maxbyte
+	isub rega, null
+	nbranch ssa_req_range_firstfreg_maxbyte_with_continue,positive
+	copy rega,loopcnt
+	copy loopcnt,temp
+	copy timeup,contr
+	call memcpy
+	fetch 2,mem_sdp_all_length
+	isub rega,null
+	branch ssa_req_range_freg_no_continue,zero
+ssa_req_range_firstfreg_not_maxbyte_with_continue:
+	call ssa_req_range_freg_with_continue
+	branch ssa_req_range_attrbutes_length
+	
+ssa_req_range_freg_no_continue:
+	call ssa_req_range_lastfreg
+	branch ssa_req_range_attrbutes_length
+	
+ssa_req_range_lastfreg:
+	arg SDP_SEARCHATTRIB_RES,rega  //PUD ID
+ssa_req_range_lastfreg_common:
+	force 0,pdata
+	istore 1,contw
+	call ssa_req_range_common
+	fetcht 2,mem_sdp_tx_pkt_length
+	increase -5,temp
+	byteswap temp,pdata
+	istore 2, contw
+	increase -3,temp
+	byteswap temp,pdata
+	istore 2, contw  //attribute length
+	rtn
+
+ssa_req_range_firstfreg_maxbyte_with_continue:
+	copy pdata,loopcnt
+	copy loopcnt,temp
+	copy timeup,contr
+	call memcpy
+	call ssa_req_range_freg_with_continue
+ssa_req_range_attrbutes_length:	
+	setarg 0x36
+	istore 1,contw
+	fetch 2,mem_sdp_all_length
+	byteswap pdata,pdata
+	istore 2, contw 
+	rtn	
+
+ssa_req_range_attrbutes_length_no_continue:	
+	setarg 0x36
+	istore 1,contw
+	increase -3,temp
+	byteswap temp,pdata
+	istore 2, contw 
+	rtn	
+
+ssa_req_range_freg_with_continue:
+	arg SDP_SEARCHATTRIB_RES,rega  //PUD ID
+	setarg 2
+	istore 1,contw	
+	fetch 2,mem_sdp_continue_byte
+	iadd temp,temp
+	byteswap temp,pdata
+	istore 2,contw
+	call ssa_req_range_common
+	fetcht 2,mem_sdp_tx_pkt_length
+	increase -5,temp
+	byteswap temp,pdata
+	istore 2, contw
+	increase -5,temp
+	byteswap temp,pdata
+	istore 2, contw 
+	rtn	
+
+ssa_req_range_common:
+	fetch 2,mem_sdp_tx_payload_ptr
+	isub contw,pdata
+	sub pdata,0,pdata
+	store 2,mem_sdp_tx_pkt_length
+	call l2cap_get_sdp_tx_payload 
+	copy rega,pdata  //PUD ID
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid
+	istore 2,contw
+	rtn
+
+
+
+
+/**********************************************************************/
+/* ssa_res			                      */
+/* Processing Service Search Attribute Response                       */
+/* Call: dataelementtype6, attribute_reading                    */
+/* Input:       contr                                                 */
+/* Output:      mem_sdp_record_handle,mem_sdp_search_failed           */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process_ssa_res:
+sdp_process_ss_res:
+sdp_process_sa_res:
+sdp_process_error_res:
+	rtn
+/*
+sdp_process_ss_res:
+	bpatchx patch2c_4,mem_patch2c
+	ifetch 2,contr
+	ifetch 2,contr
+	byteswap pdata,pdata
+	bne 1,assert
+	ifetch 4,contr
+	store 4,mem_sdp_record_handle
+	fetchr regc,2,mem_sdp_l2capch_ptr
+	add regc,offset_lc_state,regc
+	ifetch 1,regc
+	set1 L2CAP_CHANNEL_STATE_RECV_SEARCH_RES,pdata
+	istore 1,regc
+	rtn
+	
+sdp_process_sa_res:
+	bpatchx patch2c_5,mem_patch2c
+	fetchr regc,2,mem_sdp_l2capch_ptr
+	add regc,offset_lc_state,regc
+	ifetch 1,regc
+	set1 L2CAP_CHANNEL_STATE_RECV_ATTRIB_RES,pdata
+	istore 1,regc
+	copy temp,contr
+	ifetch 2,contr
+	call search_rfcomm_cn
+	store 1,mem_profile_channel	
+	rtn
+*/
+
+				    
+
+sdp_invalid_service_record_handle:		
+	setarg 0x0200
+	store 2,mem_sdp_error_code
+	branch sdp_error_response
+sdp_invalid_pdu_size:				
+	setarg 0x0400
+	store 2,mem_sdp_error_code
+	branch sdp_error_response
+sdp_insufficient_resource:			
+	setarg 0x0600
+	store 2,mem_sdp_error_code
+	branch sdp_error_response
+sdp_invalid_request_syntax:			
+	setarg 0x0300
+	store 2,mem_sdp_error_code
+sdp_error_response:	
+	call l2cap_get_sdp_tx_payload
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid			
+	istore 2,contw
+	setarg 0x0200					
+	istore 2,contw
+	fetch 2,mem_sdp_error_code			
+	istore 2,contw
+	jam  7,mem_sdp_tx_pkt_length
+	rtn
+
+
+//store uuid in mem_sdp_uuid_search_ptr,
+//return temp 0xff if wrong 
+ask_serviceclassid:  
+	arg 0,regb
+	force 0,temp					/* use "temp" to mark syntax error or to mark 128 bit uuid */
+	arg mem_sdp_uuid_search_ptr,contw
+	call dataelementtype6
+	branch asksrv_error,zero
+classidloop:
+	increase 1,regb
+	ifetch 1,contr
+	increase -1,rega
+	increase -1,timeup
+	compare 0x18,pdata,0xf8			/* 5 MSB: b00011: uuid */
+	nbranch asksrv_error,true
+	compare 0x04,pdata,0x07			/* 3 LSB: b100 128 bits uuid */
+	nbranch cmp032,true
+	force 1,temp					/* mark it as 128 bit uuid */
+skip2bytes:
+	ifetch 1,contr
+	increase -1,rega	
+	increase -1,timeup
+	bne 0x00, frstbwrong
+	ifetch 1,contr
+	increase -1,rega	
+	increase -1,timeup
+	beq 0x00, cmpuuid
+	branch scndbwrong
+frstbwrong:  
+	increase 1,contr
+	increase -1,rega	
+	increase -1,timeup
+scndbwrong:  
+	increase 2,contr				/* skip 2 bytes, first 2 bytes already wrong */
+	increase -2,rega	
+	increase -2,timeup
+	compare 0x00,temp,0xff                        /* 128 bits or 32 bits ? */
+	branch loopornot,true
+	increase 12,contr				/* skip 12 bytes, first 2 bytes already wrong */
+	increase -12,rega	
+	increase -12,timeup
+	branch loopornot
+cmp032:
+	compare 0x02,pdata,0x07			/* 3 LSB: b010 32 bits uuid */
+	nbranch cmp016,true
+	branch skip2bytes			
+cmp016:
+	compare 0x01,pdata,0x07			/* 3 LSB: b001 16 bit uuid */
+	nbranch asksrv_error,true
+cmpuuid:
+	increase -2,rega
+	increase -2,timeup
+	ifetch 2,contr				/* higher order byte */
+	sub regb,4,null
+	branch uuidsize,zero //max store uuids =3 
+	istore 2,contw
+uuidsize:
+	compare 0x00,temp,0xff			/* is this 128 bits uuid */
+	branch loopornot,true
+	copy contr,temp
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x10, wrong12b
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x80, wrong12b
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x80, wrong12b
+	ifetch 1,contr
+	bne 0x5f, wrong12b
+	ifetch 1,contr
+	bne 0x9b, wrong12b
+	ifetch 1,contr
+	bne 0x34, wrong12b
+	ifetch 1,contr
+	beq 0xfb, chck12dn
+wrong12b:
+	copy temp,contr  
+wrong12b1:
+	increase 12,contr				/* skip 12 bytes */
+	force 0x00,queue
+	force 0x00,temp
+	branch chck12dn
+
+chck12dn:
+	increase -12,timeup
+	increase -12,rega
+loopornot:
+	force 0x00,temp
+	compare 0x00,rega,0xff
+	nbranch classidloop,true
+	force 0,pdata
+	istore 2,contw			/* end list with null */
+	rtn
+asksrv_error:
+	arg 0xff,temp
+	rtn
+
+/**********************************************************************/
+/* Subroutine: dataelementtype6                                    */
+/* Parse Data Element Sequence, obtain the data size                  */
+/* Input:  SDP Rx Buf Pointer in contr, parameter count in timeup     */
+/* Output: data length in rega, data pointer in contr             */
+/*         and  parameter count in timeup, return with zero flag set: */
+/*         syntax error                                               */
+/**********************************************************************/     
+dataelementtype6:
+	bpatchx patch2c_6,mem_patch2c
+	ifetch 1,contr
+	increase -1,timeup
+	compare 0x30,pdata,0xf8			/* 5 MSB: b00110: type 6 */
+	nbranch dsize_error,true
+	compare 0x07,pdata,0x07			/* 3 LSB: b111: 32 bits */
+	branch dsize32,true
+	compare 0x06,pdata,0x07			/* 3 LSB: b110: 16 bits */
+	branch dsize16,true
+	compare 0x05,pdata,0x07			/* 3 LSB: b101: 8 bits */
+	nbranch dsize_error,true
+//	ifetchr rega,1,contr				/* data length in reg A */
+	ifetch 1,contr
+	copy pdata,rega
+	increase -1,timeup
+	branch dsize
+dsize32:
+	increase 2,contr				 
+	increase -2,timeup
+dsize16:
+	ifetch 2,contr
+	byteswap pdata,rega
+	increase -2,timeup
+dsize:
+	force 0x01,pdata
+	rtn
+dsize_error:
+	force 0x00,pdata
+	rtn
+
+/**********************************************************************/
+/* Subroutine: sa_empty_rsp                                      */
+/* Send empty response                                                */
+/*                                                                    */
+/* Input:       mem_sdp_pduid, mem_sdp_transactionid                  */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length             */
+/*                                                                    */
+/**********************************************************************/     
+ss_empty_rsp:
+	setarg SDP_SEARCH_RES
+	store 1, mem_sdp_pduid
+	branch empty_response
+sa_empty_rsp:
+	setarg SDP_ATTRIBUTE_RES
+	store 1, mem_sdp_pduid
+	branch empty_response
+ssa_empty_rsp:
+	setarg SDP_SEARCHATTRIB_RES
+	store 1, mem_sdp_pduid
+empty_response:
+	call l2cap_get_sdp_tx_payload			/* empty attribute list */
+//	fetchr regb,1,mem_sdp_pduid				/* PDUID */
+//	istorer regb,1,contw
+	fetch 1,mem_sdp_pduid
+	copy pdata,regb
+	istore 1,contw 
+	fetch 2,mem_sdp_transactionid			/* copy back transaction id */
+	istore 2,contw
+	setarg 0x0500
+	istore 2, contw
+	compare SDP_ATTRIBUTE_RES,regb,0xff			 
+	branch fullsearch,true
+	compare SDP_SEARCHATTRIB_RES,regb,0xff			 
+	branch fullsearch,true
+	setarg 0x000000
+	istore 5,contw
+	branch outempty
+
+fullsearch:					/* pduid must be 5 or 7 */
+	setarg 0x350200
+	istore 5,contw
+outempty:
+	jam 10,mem_sdp_tx_pkt_length
+	rtn
+
+//return length in pdata(whole element ,include header and data ), contr not change
+sdp_data_len:
+	call store_contw
+	call store_contr
+	call sdp_get_data
+	call get_contw
+	call get_contr
+	copy temp,pdata
+	rtn
+
+//return data length in pdata, contr is data pionter,return length in temp(whole element ,include header and data )
+sdp_get_data:
+	ifetch 1,contr
+	and pdata,0x7,loopcnt
+	rshift3 pdata,pdata
+	bne 0,sdp_get_data_type_not0
+sdp_get_data_type0:	
+	force 1,pdata
+	force 1,temp
+	rtn
+	
+sdp_get_data_type_not0_sizeindex01234:
+	call left_shift_n
+	add pdata,1,temp  //add header length
+	rtn
+sdp_get_data_type_not0:
+	deposit loopcnt
+	sub pdata,4,null
+	branch sdp_get_data_type_not0_sizeindex01234,positive
+	beq 5,sdp_get_data_type_not0_sizeindex5
+	beq 6,sdp_get_data_type_not0_sizeindex6
+	beq 7,sdp_get_data_type_not0_sizeindex7
+	rtn
+	
+sdp_get_data_type_not0_sizeindex5:
+	ifetch 1,contr
+	add pdata,2,temp  //add header length
+	rtn
+sdp_get_data_type_not0_sizeindex6:
+	ifetch 2,contr
+	byteswap pdata,pdata
+	add pdata,3,temp  //add header length
+	rtn
+sdp_get_data_type_not0_sizeindex7:
+	ifetch 2,contr	
+	byteswap pdata,pdata
+	ifetcht 2,contr	
+	byteswap temp,temp
+	lshift16 temp,temp
+	iadd temp,pdata
+	add pdata,5,temp  //add header length
+	rtn
+
+/* find with uuids
+input uuids pionter in timeup
+return handles in mem_sdp_handle_list; handles number in queue if found 
+return regb all length*/
+search_all_uuid:
+	bpatchx patch2c_7,mem_patch2c
+	force 0,queue
+	arg 0,regb
+	arg mem_sdp_handle_list,contw
+search_all_uuid_llop:
+	ifetch 2,timeup
+ 	rtn blank
+	call search_uuid
+	copy queue,pdata
+	rtneq SDP_MAX_HANDLE_NUMBER 
+	increase 2,timeup
+ 	branch search_all_uuid_llop
+	
+search_uuid:
+//	arg 0,regb
+	iforce regc
+//	force 0,queue
+	fetch 2, mem_ui_uuid_table
+	iforce contr
+search_uuid_next:
+	copy queue,pdata
+	rtneq SDP_MAX_HANDLE_NUMBER   
+	disable user
+	ifetch 1,contr
+	rtn blank
+	iforce loopcnt
+search_uuid_loop:	
+	ifetch 2,contr
+	isub regc,null
+	nbranch search_uuid_not_found,zero
+	enable user					// uuid match
+search_uuid_not_found:
+	loop search_uuid_loop
+	ifetcht 4,contr					// get handle 
+	copy contr,rega
+	nbranch search_uuid_nomatch,user
+	arg mem_sdp_handle_list,contr
+	arg SDP_MAX_HANDLE_NUMBER,loopcnt 
+search_uuid_check_same_handle:
+	ifetch 4,contr
+	branch search_uuid_store_handle,blank
+	isub temp,null
+	branch search_uuid_nomatch,zero
+	loop search_uuid_check_same_handle
+	rtn 
+search_uuid_store_handle:
+	istoret 4,contw
+	increase 1,queue
+	copy rega,contr
+	call sdp_data_len
+	iadd regb,regb
+	iadd contr,contr		 
+	branch search_uuid_next
+search_uuid_nomatch:	
+	copy rega,contr
+	call sdp_get_data
+	iadd contr,contr			// next paragraph 
+	branch search_uuid_next
+
+/* temp is handle,
+return zero  if found
+return data pointer in contr 
+*/
+search_handle:
+	bpatchx patch2d_0,mem_patch2d
+	fetch 2,mem_ui_uuid_table
+	iforce contr
+search_handle_loop:	
+	ifetch 1,contr
+	branch disable_zero,blank
+	lshift pdata,pdata
+	iadd contr,contr
+	ifetch 4,contr
+	isub temp,null
+	rtn zero
+	deposit contw
+	store 2,mem_contw
+	storet 8,mem_temp
+	call sdp_get_data
+	iadd contr,contr
+	copy contr,pdata
+	fetcht 2,mem_contw
+	copy temp,contw
+	fetcht 8,mem_temp
+	copy pdata,contr
+	branch search_handle_loop
+
+/**
+* input regb and regc.regb is the attribute ID and regc is UUID.
+* set contr if find attribute or 0 if not
+*/
+search_attrib:
+	bpatchx patch2d_1,mem_patch2d
+	fetch 2,mem_ui_uuid_table
+	iforce contr
+search_attrib_next:
+	ifetch 1,contr
+	branch search_attrib_end, blank
+	iforce loopcnt
+search_attrib_loop:	
+	ifetch 2,contr
+	isub regc,null						/* regc is UUID, compare it */
+	branch search_attrib_found_uuid,zero
+	loop search_attrib_loop
+	increase 4,contr
+	call sdp_get_data
+	iadd contr,contr			/* next paragraph */
+	branch search_attrib_next	
+search_attrib_found_uuid:
+	increase -1,loopcnt
+	lshift loopcnt,pdata
+	iadd contr,contr
+	increase 4,contr
+	call sdp_get_data
+	iadd contr,timeup					/* attribute list end */
+search_attrib_loop_attribs:	
+	increase 1,contr
+	ifetch 2,contr
+	isub regb,null
+	//force 0x1,pdata,zero
+//	setflag zero, 0,pdata
+//	copy timeup, timeup
+	branch disable_blank,zero			/* attribute found */
+	call sdp_data_len
+	iadd contr,contr
+	deposit timeup
+	isub contr,null
+	branch search_attrib_end, zero /*attribute end, not found the attribute, return contr = 0*/
+	branch search_attrib_loop_attribs	
+search_attrib_end:
+	force 0,contr
+	force 0,pdata
+	rtn
+	
+
+//search the attribute according the record handle
+//record handle in temp, attribute in regb
+//set the contr to zero if not found
+search_handle_attrib:	
+	bpatchx patch2d_2,mem_patch2d
+	fetch 2,mem_ui_uuid_table
+	iforce contr
+search_handle_attrib_next:
+	ifetch 1,contr
+	branch search_handle_attrib_end, blank
+	lshift pdata,pdata
+	iadd contr, contr
+	ifetch 4,contr
+	isub temp,null						/* regc is UUID, compare it */
+	branch search_handl_attrib_found_handle,zero
+	call sdp_get_data
+	iadd contr,contr			/* next paragraph */
+	branch search_handle_attrib_next	
+search_handl_attrib_found_handle:
+	call sdp_get_data
+	iadd contr,timeup					/* attribute list end */
+search_handle_attrib_loop_attribs:	
+	increase 1,contr
+	ifetch 2,contr
+	isub regb,null
+	rtn zero							/* attribute found */
+	call sdp_data_len
+	iadd contr,contr
+	deposit timeup
+	isub contr,null
+	branch search_handle_attrib_end, zero /*attribute end, not found the attribute, return contr = 0*/
+	branch search_handle_attrib_loop_attribs
+search_handle_attrib_end:
+	force 0,contr
+	rtn	
+
+
+//enable user if find rfcomm channel number, pdata is channel number
+search_rfcomm_cn:
+	arg 0x0400,regb  // attribute protocol edscriptor list
+	call search_handl_attrib_found_handle
+	arg 0x0300,regb  // uuid rfcomm
+	call search_uuid_in_data
+	nrtn user
+	sub rega,3,null
+	branch disable_user,positive
+	ifetch 1,contr
+	bne 0x08,disable_user
+	ifetch 1,contr
+	rtn
+	
+ //input timeup is lenth
+ //input contr is data ptr
+ //return contr is end of uuid; enable user if found uuid
+search_uuid_in_data:
+	bpatchx patch2d_3,mem_patch2d
+	call sdp_get_data
+	copy pdata,rega
+search_uuid_in_data_loop:	
+	ifetch 1,contr
+	and pdata,0x7,loopcnt
+	rshift3 pdata,pdata
+	sub pdata,3,null
+	branch search_uuid_in_data_found_uuid,zero
+	copy loopcnt,pdata
+	beq 5,search_uuid_in_data_found_element_index5
+	beq 6,search_uuid_in_data_found_element_index6
+	beq 7,search_uuid_in_data_found_element_index7
+	increase -1,contr
+	call sdp_get_data
+	iadd contr,contr
+	copy rega,pdata
+	isub temp,rega
+	branch disable_user,zero
+	branch search_uuid_in_data_loop
+	
+search_uuid_in_data_found_element_index5:
+	increase -2,rega
+	increase 1,contr
+	branch search_uuid_in_data_loop
+search_uuid_in_data_found_element_index6:
+	increase -3,rega
+	increase 2,contr
+	branch search_uuid_in_data_loop
+search_uuid_in_data_found_element_index7:
+	increase -5,rega
+	increase 4,contr
+	branch search_uuid_in_data_loop		
+	
+search_uuid_in_data_found_uuid:
+	increase -1,rega
+	copy loopcnt,pdata
+	beq 1,search_uuid_in_data_type_uuid_16
+	beq 2,search_uuid_in_data_type_uuid_32
+	beq 4,search_uuid_in_data_type_uuid_128
+	branch disable_user 
+search_uuid_in_data_type_uuid_128:
+	increase -12,rega
+search_uuid_in_data_type_uuid_32:
+	ifetch 2,contr
+	increase -2,rega
+search_uuid_in_data_type_uuid_16:
+	ifetch 2,contr
+	isub regb,null
+	branch enable_user,zero
+	increase -2,rega
+	branch disable_user,zero
+	branch search_uuid_in_data_loop
+
+/*
+//rega:l2cap len ,mem_search_uuid:uuid to search
+sdp_send_search_req:
+	call l2cap_malloc_sdp_req
+	setarg SDP_SEARCH_REQ
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid_local
+	byteswap pdata,pdata
+	istore 2,contw
+	increase -5,rega
+	byteswap rega,rega
+	//istorer rega,2,contw
+	copy rega,pdata
+	istore 2,contw
+	setarg 0x0335
+	istore 2,contw
+	setarg 0x19
+	istore 1,contw
+	fetch 2,mem_search_uuid
+	istore 2,contw
+	setarg 0x0008
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	rtn
+
+//rega:l2cap len
+sdp_send_attribute_req:
+	call l2cap_malloc_sdp_req
+	setarg SDP_ATTRIBUTE_REQ
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid_local
+	byteswap pdata,pdata
+	istore 2,contw
+	increase -5,rega
+	byteswap rega,rega
+//	istorer rega,2,contw
+	copy rega,pdata
+	istore 2,contw
+	fetch 4,mem_sdp_record_handle
+	istore 4,contw
+	setarg 0x2c01
+	istore 2,contw
+	setarg 0x0535
+	istore 2,contw
+	setarg 0x0a
+	istore 1,contw
+	setarg 0
+	istore 2,contw
+	setarg -1
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	rtn
+*/	
+	
+
+sdp_send_spp_request:
+	call l2cap_get_sdp_tx_payload
+	copy pdata,contw
+	setarg 6//Search Attr Req
+	istore 1,contw
+	setarg sdp_tid_spp					
+	istore 2,contw
+	setarg 0x0f00 //length15
+	istore 2,contw
+	setarg 0x1a0535
+	istore 3,contw
+	setarg 0x0111
+	lshift16 pdata,pdata //UUID
+	istore 4,contw
+	setarg 0x2600 //max return len
+	istore 2,contw
+	setarg 0x0335
+	istore 2,contw
+	setarg 0x0009
+	istore 2,contw
+	setarg 0x0004
+	istore 2,contw
+	jam 0x14,mem_sdp_tx_pkt_length
+	rtn
+
Index: program/security.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/security.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/security.prog	(working copy)
@@ -0,0 +1,2058 @@
+
+ifdef SECURE_CONNECTION
+	
+function_g2:
+	bpatchx patch2d_4,mem_patch2d
+	jam 80,mem_AES_CMAC_data_length
+	arg memdat,contw
+	arg mem_le_srand,contr
+	call memcpy16
+	arg mem_sc_pubkey_local_x_256,contr
+	call memcpy32
+	arg mem_le_pubkey_remote_x_256,contr
+	call memcpy32
+	call inverse_memdat	
+	arg mem_le_mrand,contr
+	call store_inverse_k	
+	call function_AES_CMAC	
+
+	arg mem_AES_CMAC_temp,contw
+	call load_inverse_result
+	setarg 1000000
+	copy pdata,rega
+	fetch 4,mem_AES_CMAC_temp
+	idiv rega
+	call wait_div_end
+	remainder pdata
+	store 4,mem_gkey
+//call ice_break
+	rtn
+
+function_f6_eb:
+	jam 65,mem_AES_CMAC_data_length
+	arg memdat,contw
+	call store_addr_common_a
+	call store_addr_common_b
+	fetch 3,mem_le_pres+1
+	istore 3,contw
+//	arg mem_le_r,contr
+//	call memcpy16	
+	call get_r
+	
+	arg mem_le_mrand,contr
+	call memcpy16
+	arg mem_le_srand,contr
+	call memcpy16
+	call inverse_memdat
+	arg mem_le_mackey ,contr
+	arg mem_AES_CMAC_k,contw
+	call memcpy16
+//	call p_store_inverse_k	
+	branch function_AES_CMAC
+//	arg mem_AES_CMAC_temp,contw
+//	branch p_load_inverse_result
+
+get_r:
+	fetch 4,mem_le_tk
+	istore 4,contw
+	call memset0_4
+	branch memset0_8
+
+function_f6_ea:
+	bpatchx patch2d_5,mem_patch2d
+	jam 65,mem_AES_CMAC_data_length
+	arg memdat,contw
+	call store_addr_common_b
+	call store_addr_common_a
+	fetch 3,mem_le_preq+1
+	istore 3,contw
+//	arg mem_le_r,contr
+//	call memcpy16	
+	call get_r
+	arg mem_le_srand,contr
+	call memcpy16
+	arg mem_le_mrand,contr
+	call memcpy16
+	call inverse_memdat
+	arg mem_le_mackey ,contr
+	arg mem_AES_CMAC_k,contw
+	call memcpy16
+//	call p_store_inverse_k	
+	call function_AES_CMAC
+	arg mem_AES_CMAC_temp,contw
+	branch load_inverse_result
+
+function_f5:
+	jam 32,mem_AES_CMAC_data_length
+	arg mem_le_dhkey_256 ,contr
+	arg memdat,contw
+	call memcpy32
+	call inverse_memdat
+	arg mem_le_slat,contr
+	call store_inverse_k	
+	call function_AES_CMAC
+	arg mem_AES_CMAC_k,contw
+	call store_aes_result
+	arg 1,temp
+	call function_f5_common
+	arg mem_le_ltk,contw
+	call load_inverse_result
+	arg 0,temp
+	call function_f5_common
+	arg mem_le_mackey,contw
+//	branch p_load_inverse_result
+	branch store_aes_result
+
+
+function_f5_common:
+	bpatchx patch2d_6,mem_patch2d
+	jam 53,mem_AES_CMAC_data_length
+	setarg 0x100
+	store 2,memdat
+	call store_addr_common_b
+	call store_addr_common_a
+	arg mem_le_srand,contr
+	call memcpy16
+	arg mem_le_mrand,contr
+	call memcpy16
+//	fetch 4,mem_le_keyid 0x62746c65
+	setarg 0x6c65
+	istore 2,contw
+	setarg 0x6274
+	istore 2,contw
+	istoret 1,contw   //counter
+	call inverse_memdat	
+	branch function_AES_CMAC
+
+store_addr_common_b:
+	fetch 6,mem_le_lap
+	istore 6,contw
+	fetch 1,mem_le_conn_own_addr_type
+	istore 1,contw
+	rtn
+
+store_addr_common_a:
+	fetch 6,mem_le_plap
+	istore 6,contw
+//	setarg 0x2dcfc1
+//	istore 3,contw
+//	setarg 0xa71370
+//	istore 3,contw
+	fetch 1,mem_le_conn_peer_addr_type
+	istore 1,contw
+	rtn
+
+function_f4_ca:
+	jam 65,mem_AES_CMAC_data_length
+	fetch 1,mem_passkey_1bit
+	store 1,memdat
+	arg mem_sc_pubkey_local_x_256,contr
+	call memcpy32
+	arg mem_le_pubkey_remote_x_256,contr
+	call memcpy32
+	call inverse_memdat
+	arg mem_le_mrand,contr
+	call store_inverse_k	
+	branch function_AES_CMAC
+	
+
+function_f4_cb:
+	jam 65,mem_AES_CMAC_data_length
+	fetch 1,mem_passkey_1bit
+	store 1,memdat
+	arg mem_le_pubkey_remote_x_256,contr
+	call memcpy32
+	arg mem_sc_pubkey_local_x_256,contr
+	call memcpy32
+	call inverse_memdat
+	arg mem_le_srand,contr
+	call store_inverse_k	
+	branch function_AES_CMAC
+
+function_AES_CMAC:
+	bpatchx patch2d_7,mem_patch2d
+	call function_AES_CMAC_Generate_Subkey
+//call ice_break
+//	jam 65,mem_AES_CMAC_data_length
+//call ice_break
+	fetch 1,mem_AES_CMAC_data_length
+	copy pdata,temp
+function_ceil16:
+	increase 15,pdata
+	rshift4 pdata,pdata
+	copy pdata,regb
+	branch function_AES_CMAC_set_flag_0_balnk,blank
+	and temp,0x0f,pdata
+	nbranch function_AES_CMAC_set_flag_0,blank
+//	flag =1;
+	arg mem_AES_CMAC_k1,regc
+	arg memdat,pdata
+	increase -16,pdata
+//	iadd temp,pdata
+//	isub rega,rega
+	iadd temp,rega	
+	arg mem_AES_CMAC_M_last,contw
+	arg 4,loopcnt	
+	call xor_loop
+//call ice_break
+//	arg mem_f4_k1,contr
+//	call load_key
+	branch function_AES_CMAC_aes
+
+function_AES_CMAC_set_flag_0_balnk:
+	arg 1,regb
+	arg 0,rega
+//	arg mem_f4_test_data,pdata
+	branch function_AES_CMAC_set_flag_0_common
+//call ice_break
+
+function_AES_CMAC_set_flag_0:
+//	flag = 0;
+	and temp,0x0f,rega
+function_AES_CMAC_set_flag_0_common:
+	arg memdat,pdata
+	iadd temp,pdata
+	isub rega,contr
+//call ice_break
+	arg mem_AES_CMAC_temp,contw
+	call function_AES_CMAC_padding
+//call ice_break
+	arg mem_AES_CMAC_k2,regc
+	arg mem_AES_CMAC_temp,rega
+	arg mem_AES_CMAC_M_last,contw
+	arg 4,loopcnt	
+	call xor_loop	
+//call ice_break
+
+//	arg mem_f4_k2,contr
+//	call load_key
+
+//	branch p_function_f4_aes
+function_AES_CMAC_aes:
+//	arg mem_f4_k,contr
+//	call load_key
+//	arg mem_AES_CMAC_xor,contr
+//	call load_data128
+	call aes_clear_data
+	call aes_init	
+//	arg mem_f4_k,contr
+//	call load_key
+	arg memdat,contr
+function_AES_CMAC_aes_loop:
+//generate_mic_loop:
+	increase -1,regb
+	deposit regb
+	branch function_AES_CMAC_aes_loop_end,blank
+	call load_data128
+	call do_aes_cbc
+	branch function_AES_CMAC_aes_loop
+//generate_mic_end:
+function_AES_CMAC_aes_loop_end:	
+	arg mem_AES_CMAC_temp,contw
+	call store_aes_result
+	arg mem_AES_CMAC_M_last,contr
+	call load_data128
+	call aes_init	
+	arg mem_AES_CMAC_temp,contr
+	call load_data128	
+	branch do_aes_cbc
+
+
+
+load_inverse_result:
+//	arg mem_AES_CMAC_temp,contw
+	copy contw,rega
+	call store_aes_result
+//	arg mem_AES_CMAC_temp,rega
+	arg 16,loopcnt
+	branch inverse_data
+	
+store_inverse_k:
+	arg mem_AES_CMAC_k,contw
+	call memcpy16
+inverse_k:	
+	arg 16,loopcnt
+	arg mem_AES_CMAC_k,rega	
+	branch inverse_data
+	
+inverse_memdat:
+	fetch 1,mem_AES_CMAC_data_length
+	copy pdata,loopcnt
+	arg memdat,rega
+	branch inverse_data
+
+bn_lshift_0_inverse:
+	ifetch 1,rega
+	lshift pdata,pdata
+	isolate1 0,regc
+	setflag true,0,pdata	
+	isolate1 8,pdata
+	setflag true,0,regc	
+	istore 1,rega
+         increase -1,rega
+	loop bn_lshift_0_inverse
+	rtn	
+
+function_AES_CMAC_k1_inverse:
+	arg mem_AES_CMAC_k1,rega
+function_AES_CMAC_inverse_common:
+	increase 15,rega
+	force 16,loopcnt
+	force 0,regc
+	branch  bn_lshift_0_inverse	
+
+function_AES_CMAC_k2_inverse:
+	arg mem_AES_CMAC_k2,rega
+	branch function_AES_CMAC_inverse_common
+	
+
+function_AES_CMAC_Generate_Subkey:
+	arg mem_AES_CMAC_k,contr
+	call load_key
+//	arg mem_AES_CMAC_xor,contr
+//	call aes_load_xor
+	force regidx_xor,regext_index
+	call aes_clear
+	call aes_clear_data
+	call do_aes_ocb
+	
+//	force 0x38,aes_ctrl
+//	force 0x0,aes_ctrl
+//	call wait_aes
+	arg mem_AES_CMAC_k1,contw
+	call store_aes_result
+function_AES_CMAC_k1:
+	bpatchx patch2e_0,mem_patch2e
+	fetch 1,mem_AES_CMAC_k1
+	isolate1 7,pdata
+	nbranch function_AES_CMAC_k1_0,true	
+	call function_AES_CMAC_k1_inverse
+	
+//p_function_f4_k1_xor:
+	arg mem_AES_CMAC_k1,regc
+//	arg mem_AES_CMAC_rb,rega
+	arg mem_AES_CMAC_k1,contw
+//	arg 3,loopcnt
+//	call xor_loop
+	call function_AES_CMAC_xor_rb
+	branch function_AES_CMAC_k2
+function_AES_CMAC_k1_0:	
+	call function_AES_CMAC_k1_inverse
+function_AES_CMAC_k2:
+//call ice_break
+	arg mem_AES_CMAC_k1,contr
+	arg mem_AES_CMAC_k2,contw
+	call memcpy16
+	fetch 1,mem_AES_CMAC_k2
+	isolate1 7,pdata
+	nbranch function_AES_CMAC_k2_inverse,true		
+	call function_AES_CMAC_k2_inverse
+//p_function_f4_k2_xor:
+	arg mem_AES_CMAC_k2,regc
+//	arg mem_AES_CMAC_rb,rega
+	arg mem_AES_CMAC_k2,contw
+//	arg 3,loopcnt
+//	branch xor_loop	
+
+
+//rb:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 87 
+function_AES_CMAC_xor_rb:
+	arg 3,loopcnt
+function_AES_CMAC_xor_rb_loop:	
+	arg 0,temp
+	call function_AES_CMAC_xor_loop_common	
+	increase 4,regc
+	loop  function_AES_CMAC_xor_rb_loop
+	arg 0x8700,temp
+	lshift16 temp,temp
+function_AES_CMAC_xor_loop_common:	
+	ifetch   4,regc
+	ixor  temp,pdata
+	istore   4,contw	
+	rtn
+		
+
+
+
+//input rega :length <16	contr,contw
+function_AES_CMAC_padding:
+	bpatchx patch2e_1,mem_patch2e
+	arg 16,loopcnt
+	arg 0,pdata
+function_AES_CMAC_padding_loop:
+	isub rega,null
+	branch function_AES_CMAC_padding_beq_length,zero
+	branch function_AES_CMAC_padding_big_length,positive
+	ifetcht 1,contr
+	istoret 1,contw
+function_AES_CMAC_padding_loop2:	
+	increase 1,pdata
+	loop function_AES_CMAC_padding_loop
+	rtn
+function_AES_CMAC_padding_beq_length:	
+	arg 0x80,temp
+function_AES_CMAC_padding_common:
+	istoret 1,contw
+	branch  function_AES_CMAC_padding_loop2
+
+function_AES_CMAC_padding_big_length:
+	arg 0,temp
+	branch function_AES_CMAC_padding_common
+
+endif
+	
+generate_kinit:
+	call function_e22
+	arg mem_input_store,contr
+	arg mem_kinit,contw		/* Kinit is ready */
+	branch memcpy16
+
+
+function_e21:	/* rega pointers to bdaddr */
+	disable user
+	call function_expand
+	arg mem_random_number,contr
+	arg mem_x,contw
+	force 15,loopcnt
+	call memcpy			
+	ifetch 1,contr
+	xor_into 6,pdata
+	istore 1,contw
+	setarg mem_y
+	store 2,memp_ar_input
+	setarg mem_x
+	store 2,memp_ar_key
+	set1 mark_ar2,mark
+	branch function_ar
+
+
+	
+function_e22:		/* rega pointers to bdaddr */
+	fetcht 1,mem_pin_length
+	force 16,regb			/* total 16 bytes */
+	add temp,6,regc		/* regc is l' */
+	sub regc,16,null		
+	branch function_e22_pin_init,positive 
+	force 16,regc
+function_e22_pin_init:			/* generate x from pin and bdaddr */
+	arg mem_x,contw
+function_e22_genx_pin:
+	arg mem_pin,contr
+	copy temp,loopcnt
+	disable user
+function_e22_genx_loop:
+	ifetch 1,contr
+	istore 1,contw
+	increase -1,regb
+	branch function_e22_genx_end,zero
+	loop function_e22_genx_loop
+	branch function_e22_genx_pin,user
+	enable user
+	force 6,loopcnt
+	copy rega,contr
+	branch function_e22_genx_loop
+function_e22_genx_end:
+	arg mem_random_number,contr
+	arg mem_y,contw
+	call memcpy16
+	fetch 1,mem_y15
+	ixor regc,pdata
+	store 1,mem_y15	/* inpy[15] = rand_num[15]^l'; */
+	setarg mem_y
+	store 2,memp_ar_input
+	setarg mem_x
+	store 2,memp_ar_key
+	set1 mark_ar2,mark
+	branch function_ar
+
+
+
+
+function_e1:	/* rega pointers to bdaddr */
+	disable user
+	call function_expand
+	branch function_hash
+
+function_e3:
+	arg mem_aco,rega
+	enable user
+	call function_expand
+	call function_hash
+	arg mem_input_store,contr
+	arg mem_kc,contw
+	branch memcpy16
+
+	/* costs 41769 clocks */
+function_hash:
+	setarg mem_random_number
+	store 2,memp_ar_input
+	setarg mem_link_key
+	store 2,memp_ar_key
+	set0 mark_ar2,mark
+	call function_ar
+	arg mem_input_store,rega
+	arg mem_random_number,regb
+	arg mem_x,contw
+	call xor16
+	arg mem_x,rega
+	arg mem_y,regb
+	copy regb,contw
+	enable user
+	call add16
+	call key_offset
+	setarg mem_y
+	store 2,memp_ar_input
+	setarg mem_x
+	store 2,memp_ar_key
+	set1 mark_ar2,mark
+	branch function_ar
+	
+
+	/* totally costs 20700 clocks */
+function_ar:
+	jam 0,mem_ar_hround
+	fetch 2,memp_ar_key
+	iforce contr
+	arg mem_key_store,contw
+	call memcpy16
+	fetch 2,memp_ar_input
+	iforce contr
+	arg mem_input_store,contw
+	call memcpy16
+	
+function_ar_loop:
+	call key_scheduling
+	disable user
+	bmark0 mark_ar2,function_ar_original
+	fetch 1,mem_ar_hround
+	bne 4,function_ar_original
+	fetch 2,memp_ar_input
+	iforce regb
+	call xor_mod32_ar2
+function_ar_original:
+	call xor_mod32
+	call el_boxes
+	fetch 1,mem_ar_hround
+	increase 1,pdata
+	store 1,mem_ar_hround
+
+	call key_scheduling
+	enable user
+	call xor_mod32
+	call pht
+	call permute
+	call pht
+	call permute
+	call pht
+	call permute
+	call pht
+	fetch 1,mem_ar_hround
+	increase 1,pdata
+	store 1,mem_ar_hround
+	bne 16,function_ar_loop
+	call key_scheduling
+	disable user
+	branch xor_mod32
+	
+/* input round number and temp key in mem_key_store, and output the next temp key in mem_key_store */
+/* round key is generated and store in mem_round_key */
+key_scheduling:
+	fetch 1,mem_ar_hround
+	arg mem_key_store,contr
+	branch key_sched_zero,blank
+	iforce regb      			/* regb is half round */
+	force 17,loopcnt
+	copy contr,contw
+key_rotateloop:
+	ifetch 1,contr
+	lshift3 pdata,temp
+	rshift2 pdata,pdata
+	rshift3 pdata,pdata
+	ior temp,pdata
+	istore 1,contw
+	loop key_rotateloop
+	setarg mem_key_store
+	iadd regb,contr
+	force 16,loopcnt    
+	arg mem_round_key,contw
+key_select_octet_loop:
+	ifetch 1,contr
+	istore 1,contw
+	compare mem_key_store_end,contr,0xff
+	nbranch key_select_octet_nwrap,true
+	increase -17,contr
+key_select_octet_nwrap:
+	loop key_select_octet_loop
+	force 0,rega         /* rega is index of octet within row */
+	add regb,-1,regc    /* this is the row index, half_round#1 is 0 */
+	lshift2 regc,regc
+	lshift2 regc,regc
+	call enable_authrom
+	setarg mem_b_box
+	iadd regc,regc       /* regc hold the starting address of the row */
+	arg mem_round_key,contw
+	force 16,loopcnt
+bias_round_key_loop:
+	ifetcht 1,regc
+	ifetch 1,contw
+	iadd temp,pdata
+	istore 1,contw
+	increase 1,regc
+	loop bias_round_key_loop
+	branch disable_authrom
+
+key_sched_zero:    /* round 0, key1 */
+	force 16,loopcnt
+	force 0,temp
+create_byte_16_loop:
+	ifetch 1,contr
+	ixor temp,temp
+	loop create_byte_16_loop
+	deposit temp
+	istore 1,contr    	/* store the byte #16 */
+	arg mem_key_store,contr
+	arg mem_round_key,contw
+	branch memcpy16
+
+xor_mod32:     /* xor on 0,3, add on 1,2. if user is set, invert. x in rega and y in regb, out in contw */
+	arg mem_round_key,regb
+xor_mod32_ar2:
+	force 16,loopcnt
+	arg mem_input_store,rega
+	copy rega,contw
+xor_mod32_loop:	
+	ifetcht 1,rega
+	ifetch 1,regb
+	ixor temp,alarm
+	and loopcnt,3,regc
+	nbranch xor_mod32_invert,user
+	xor_into 3,regc
+xor_mod32_invert:
+	sub regc,1,regc
+	branch xor_even,positive
+	iadd temp,alarm
+xor_even:
+	deposit alarm
+	istore 1,contw
+	increase 1,rega
+	increase 1,regb
+	loop xor_mod32_loop
+	rtn
+
+el_boxes:
+	call enable_authrom
+	force 16,loopcnt
+	arg mem_input_store,rega
+el_box_loop:	
+	ifetch 1,rega
+	arg mem_e_box,contr
+	and loopcnt,3,regc
+	sub regc,1,null
+	branch e_boxes,positive
+	arg mem_l_box,contr
+e_boxes:
+	iadd contr,contr
+	ifetch 1,contr
+	istore 1,rega
+	increase 1,rega
+	loop el_box_loop
+	branch disable_authrom
+
+pht:				
+	force 8,loopcnt
+	arg mem_input_store,contr
+	copy contr,contw
+pht_loop:
+	ifetch 1,contr
+	iforce rega
+	ifetch 1,contr
+	iforce regb
+	lshift rega,pdata
+	iadd regb,pdata
+	istore 1,contw
+	deposit rega
+	iadd regb,pdata
+	istore 1,contw
+	loop pht_loop
+	rtn
+
+/* 8 11 12 15 2 1 6 5 10 9 14 13 0 7 4 3 */
+permute:			
+	setarg 0x8ae42c
+	iforce temp
+	force 7,loopcnt
+	call permute_exchange
+	setarg 0xd751b
+	iforce temp
+	force 5,loopcnt
+	call permute_exchange
+	fetch 1,mem_input_store+15
+	iforce rega
+	fetch 1,mem_input_store+3
+	store 1,mem_input_store+15
+	deposit rega
+	store 1,mem_input_store+3
+	rtn
+
+permute_exchange:
+	and temp,0xf,regb
+permute_loop:
+	and temp,0xf,pdata
+	arg mem_input_store,contw
+	iadd contw,contw
+	ifetch 1,contw
+	iforce regc
+	deposit rega
+	istore 1,contw
+	copy regc,rega
+	rshift4 temp,temp
+	loop permute_loop	
+	setarg mem_input_store
+	iadd regb,contw
+	deposit rega
+	istore 1,contw
+	rtn
+
+add16:
+	enable user
+	branch xor_add16
+
+xor16:
+	disable user
+xor_add16:	/* if user is set, do add, else do xor */
+	force 16,loopcnt	/* rega and regb pointers to src, contw is result */
+xoradd_loop:
+	ifetcht 1,rega
+	ifetch 1,regb
+	branch xoradd_add,user
+	ixor temp,pdata
+	branch xoradd_store
+xoradd_add:	
+	iadd temp,pdata
+xoradd_store:	
+	istore 1,contw
+	increase 1,rega
+	increase 1,regb
+	loop xoradd_loop
+	rtn
+
+	
+function_expand:		/* rega pointers to bdaddr, or aco and user is set */
+	arg mem_y,contw
+	ifetch 6,rega
+	istore 6,contw
+	branch expand_12,user
+	ifetch 6,rega
+	branch expand_cont
+expand_12:
+	ifetch 6,contr
+expand_cont:
+	istore 6,contw
+	ifetch 4,rega
+	istore 4,contw
+	rtn
+
+key_offset:
+	arg mem_link_key,contr
+	arg mem_x,contw
+	arg 0,temp
+	setarg 0x8395a7
+	call concatenate_temp24
+	setarg 0xb3c1df
+	call concatenate_temp24
+	setarg 0xe5e9
+	call concatenate_temp16
+	copy temp,regab
+	disable user
+	call key_addxor
+	copy regab,temp
+	enable user
+	branch key_addxor
+
+key_addxor:
+	force 8,loopcnt
+key_addxor_loop:	
+	ifetch 1,contr
+	compare 1,loopcnt,1
+	branch key_high,user
+	branch key_xor,true
+key_add:	
+	iadd temp,pdata
+	branch key_store
+key_high:
+	branch key_add,true
+key_xor:
+	ixor temp,pdata
+key_store:
+	istore 1,contw
+	rshift8 temp,temp
+	loop key_addxor_loop
+	rtn
+
+copy_aco:
+	fetch 6,mem_input_store+4
+	store 6,mem_aco
+	ifetch 6,contr
+	istore 6,contw
+	rtn
+	
+concatenate_temp24:
+	lshift8 temp,temp
+concatenate_temp16:
+	lshift16 temp,temp
+	ior temp,temp
+	rtn
+
+ifdef TESTING
+test_security:
+	fetch 1,0xff
+	branch test_security,blank
+
+	/* inrand */
+	setarg 0x1BC683
+	store 3,0x0
+	setarg 0x122980
+	istore 3,contw
+	setarg 0xD0DB17
+	istore 3,contw
+	setarg 0x2B1D78
+	istore 3,contw
+	setarg 0x2743A6
+	istore 3,contw
+	setarg 0xD8
+	istore 1,contw
+
+	/* comb A */
+	setarg 0xA6D0C9
+	store 3,0x10
+	setarg 0xA9E86C
+	istore 3,contw
+	setarg 0x9E89D5
+	istore 3,contw
+	setarg 0xC61838
+	istore 3,contw
+	setarg 0x6F0318
+	istore 3,contw
+	setarg 0x9F
+	istore 1,contw
+
+	/* comb B */
+	setarg 0x7F6833
+	store 3,0x20
+	setarg 0xE62E1B
+	istore 3,contw
+	setarg 0x9F67FC
+	istore 3,contw
+	setarg 0x8D3712
+	istore 3,contw
+	setarg 0x0B846C
+	istore 3,contw
+	setarg 0x4A
+	istore 1,contw
+
+	/* auth rand A */
+	setarg 0xFBB686
+	store 3,0x30
+	setarg 0x19FE7F
+	istore 3,contw
+	setarg 0x16A439
+	istore 3,contw
+	setarg 0xF4F6A4
+	istore 3,contw
+	setarg 0x10D61D
+	istore 3,contw
+	setarg 0xDE
+	istore 1,contw
+
+	/* auth rand B */
+	setarg 0x735B0C
+	store 3,0x40
+	setarg 0xA7F06B
+	istore 3,contw
+	setarg 0x04625E
+	istore 3,contw
+	setarg 0x3463B0
+	istore 3,contw
+	setarg 0xB8F17A
+	istore 3,contw
+	setarg 0x7C
+	istore 1,contw
+
+	/* address A */
+	setarg 0xf91330
+	store 3,0xb0
+	setarg 0x664c7d
+	istore 3,contw
+
+	/* address B */
+	setarg 0xdc7100
+	store 3,0xb8
+	setarg 0x2ea003
+	istore 3,contw
+
+	/* sres A */
+	setarg 0x2EEE19
+	store 3,0x50
+	setarg 0x7E
+	istore 1,contw
+
+	/* sres B */
+	setarg 0x4231A4
+	store 3,0x58
+	setarg 0xD1
+	istore 1,contw
+
+	/* linkA */
+	setarg 0xa6a026
+	store 3,0x60
+	setarg 0x2569d2
+	istore 3,contw
+	setarg 0xab4a9d
+	istore 3,contw
+	setarg 0x5e87c0
+	istore 3,contw
+	setarg 0x792aa9
+	istore 3,contw
+	setarg 0x4b
+	istore 1,contw
+
+	/* linkB */
+	setarg 0xa1f07d
+	store 3,0x70
+	setarg 0xec97a6
+	istore 3,contw
+	setarg 0xae31eb
+	istore 3,contw
+	setarg 0x6fe3c4
+	istore 3,contw
+	setarg 0xa1ae1a
+	istore 3,contw
+	setarg 0x3a
+	istore 1,contw
+
+	/* linkkey */
+	setarg 0x07505b
+	store 3,0x80
+	setarg 0xc9fe74
+	istore 3,contw
+	setarg 0x057b76
+	istore 3,contw
+	setarg 0x316404
+	istore 3,contw
+	setarg 0xd884b3
+	istore 3,contw
+	setarg 0x71
+	istore 1,contw
+
+	/* K */
+	setarg 0x0c333f
+	store 3,0x90
+	setarg 0x41de70
+	istore 3,contw
+	setarg 0x9b05a2
+	istore 3,contw
+	setarg 0xb954a2
+	istore 3,contw
+	setarg 0xb37516
+	istore 3,contw
+	setarg 0x36
+	istore 1,contw
+
+	/* kinit */
+	setarg 0x5ff91a
+	store 3,0xa0
+	setarg 0x39b5a4
+	istore 3,contw
+	setarg 0x258f2d
+	istore 3,contw
+	setarg 0x5d4a85
+	istore 3,contw
+	setarg 0x656ad3
+	istore 3,contw
+	setarg 0xab
+	istore 1,contw
+
+	arg 0,contr
+	arg mem_random_number,contw
+	call memcpy16
+	setarg 0x3131
+	store 2,mem_pin
+	istore 2,contw
+	jam 4,mem_pin_length
+	arg 0xb8,rega
+	call function_e22
+	arg mem_input_store,contr
+	arg mem_kinit,contw
+	call memcpy16
+	arg 0x10,rega
+	arg mem_kinit,regb
+	arg mem_random_number,contw
+	call xor16
+	arg 0xb0,rega
+	call function_e21
+	arg 0x60,regb
+	call compare16
+error_lka:
+	nbranch error_lka,zero
+	arg mem_input_store,contr
+	arg mem_link_key,contw	
+	call memcpy16
+	arg 0x20,rega
+	arg mem_kinit,regb
+	arg mem_random_number,contw
+	call xor16
+	arg 0xb8,rega
+	call function_e21
+	arg 0x70,regb
+	call compare16
+error_lkb:
+	nbranch error_lkb,zero
+	arg mem_input_store,rega
+	arg mem_link_key,regb
+	arg mem_link_key,contw
+	call xor16
+	arg 0x30,contr
+	arg mem_random_number,contw
+	call memcpy16
+	arg 0xb8,rega
+	call function_e1
+	arg 0x50,regb
+	force 4,loopcnt
+	call compare_key
+error_sresa:
+	nbranch error_sresa,zero
+	arg 0x40,contr
+	arg mem_random_number,contw
+	call memcpy16
+	arg 0xb0,rega
+	call function_e1
+	arg 0x58,regb
+	force 4,loopcnt
+	call compare_key
+error_sresb:
+	nbranch error_sresb,zero
+	branch loop1
+	
+	arg 0,contr
+	arg mem_random_number,contw
+	call memcpy16
+	force 12,loopcnt
+	call memcpy
+	arg 0x1c,contr
+	arg mem_link_key,contw
+	call memcpy16
+	arg 0x10,rega
+	call function_e3
+	branch loop1
+
+compare16:
+	force 16,loopcnt
+compare_key:
+	arg mem_input_store,rega
+	branch compare_loop
+
+compare_loop:
+	ifetch 1,rega
+	ifetcht 1,regb
+	isub temp,null
+	nrtn zero
+	increase 1,rega
+	increase 1,regb
+	loop compare_loop
+	force 0,pdata
+	rtn
+
+endif
+
+
+loop1:	
+	branch loop1
+
+/* ==================== LE security ================= */
+
+generate_stk:
+	bpatchx patch2e_2,mem_patch2e
+	call function_s1
+	arg mem_le_ltk,contw
+	branch store_aes_result
+
+	/* contr = rand pointer */
+authenticate_rconfirm:
+	arg mem_le_srand,contw
+	branch authenticate_mconfirm,master
+	arg mem_le_mrand,contw
+authenticate_mconfirm:
+	copy contr,rega
+	call memcpy16
+	call function_c1
+	arg mem_le_rconfirm,contr
+	branch compare_res
+
+generate_confirm:
+	arg mem_le_mrand,rega
+	branch generate_mrand,master
+	arg mem_le_srand,rega
+generate_mrand:
+	copy rega,contw
+	call generate_random
+	branch function_c1
+
+generate_sk:
+	arg mem_le_skdm,contr
+	call load_data128
+	arg mem_le_ltk,contr
+	call load_regext
+	force 0x38,aes_ctrl
+	force 0x0,aes_ctrl
+	call wait_aes
+	arg mem_le_sk,contw
+	branch store_aes_result
+
+
+//input temp:counter; rega:len	
+ccm_b0:
+	force regidx_xor,regext_index				
+	force 0x49,pdata
+	branch iv_common
+	
+	/* temp=packet counter, rega = length or block counter*/
+first_block_counter:
+	force 0x49,pdata
+	branch first_block
+first_block_data:
+	force 1,pdata
+first_block:
+	force regidx_data,regext_index			
+iv_common:
+	lshift8 temp,regext
+	ior regext,regext
+	increase 1,regext_index
+	rshift8 temp,regext
+	rshift16 regext,regext
+	fetch 2,mem_ccm_iv
+	lshift16 pdata,pdata
+	ior regext,regext				/* octet3&octet4 of counter and low 16 bit of IV */
+	increase 1,regext_index
+	ifetchr regext, 4,contr					/* IV2-IV5 */
+	increase 1,regext_index
+	ifetch 2,contr					/* IV6-IV7 */
+	byteswap rega,regext
+	lshift16 regext,regext
+	ior regext,regext
+	increase 1,regext_index
+	rtn
+
+
+	/* temp=packet counter, regc pointers to data */	
+generate_mic:
+	add regc,1,contr
+	ifetch 1,contr
+	iforce rega
+	call first_block_counter		//B0
+	call do_aes_ocb
+
+	force regidx_data,regext_index			/* B1 */
+	ifetch 1,regc
+	and_into 0x3,pdata
+	lshift16 pdata,regext
+	set1 8,regext
+	call clear_hidata	//B1
+	call do_aes_cbc
+
+	copy rega,loopcnt
+	add regc,2,contr
+	call padding_data	//数据填充
+generate_mic_loop:
+	call aes_load_data
+	call do_aes_cbc
+	deposit loopcnt
+	branch generate_mic_end,blank
+	branch generate_mic_loop
+generate_mic_end:
+	force regidx_result,regext_index
+	deposit regext
+	store 4,mem_le_mic
+	rtn
+
+aes_crypt_data:
+	increase 1,rega
+	call first_block_data
+	copy regc,contr
+	call aes_load_xor
+	call do_aes_ctr
+	call store_enc_data
+	increase 16,regc
+	increase -16,regb
+	branch aes_crypt_data,positive
+	rtn
+
+/*
+ccm_br_enc:
+	arg mem_kc,contr  //mem_kc  key 
+	call load_key
+	
+	fetcht 5,mem_ccm_pcnt_tx
+	call generate_mic_br
+	force regidx_xor,regext_index
+	iforce regext
+	force 0,rega					
+	call first_block_data_br
+	call do_aes_ctr
+
+	fetch 2,mem_ccm_len
+ 	add pdata,-1,regb
+	iadd regc,contw
+	force regidx_result,regext_index
+	deposit regext
+	istore 4,contw	
+	store 4,mem_le_mic
+
+	call aes_crypt_data_br
+//	fetch 2,mem_ccm_len
+//	increase 4,pdata
+//	store 2,mem_ccm_len
+	fetcht 5,mem_ccm_pcnt_tx
+	increase 1,temp
+	storet 5,mem_ccm_pcnt_tx
+	rtn
+
+
+ccm_br_decrypt:
+	call disable_user2
+	copy contw,pdata
+	fetcht 2,mem_len
+	increase 4,temp
+	isub temp,pdata
+	store 2,mem_ccm_rx_ptr
+	
+	arg mem_kc,contr  //mem_kc  key // iv
+	call load_key
+	fetch 2,mem_ccm_rx_ptr
+	copy pdata,regc
+	fetch 2,mem_len
+	iadd regc,contr
+	add pdata,-1,regb	
+	ifetch 4,contr   //mic
+	force regidx_xor,regext_index
+	iforce regext
+	force 0,rega					
+	fetcht 5,mem_ccm_pcnt_rx
+	call first_block_data_br
+	call do_aes_ctr
+	force regidx_result,regext_index
+	deposit regext
+	store 4,mem_le_peer_mic
+	call aes_crypt_data_br
+
+	fetch 1,mem_lch_code
+	and pdata,0x3,pdata
+	store 1,mem_llid
+	fetch 1,mem_rx_type
+	copy pdata,type
+	fetch 2,mem_len
+	copy pdata,rega
+	fetch 2,mem_ccm_rx_ptr
+	copy pdata,regc
+	fetcht 5,mem_ccm_pcnt_rx	
+	call generate_mic_br
+	fetcht 4,mem_le_peer_mic
+	isub temp,pdata				
+	nrtn blank
+	fetch 4,mem_ccm_last_mic			
+	isub temp,pdata
+	rtn blank
+	storet 4,mem_ccm_last_mic
+	fetch 5,mem_ccm_pcnt_rx
+	increase 1,pdata
+	store 5,mem_ccm_pcnt_rx
+	branch enable_user2
+
+	//temp=packet counter, regc pointers to data, rega len	
+generate_mic_br:
+
+	call first_block_counter_br
+	call do_aes_ocb
+
+	force regidx_data,regext_index			
+	and type,0x0f,pdata
+	lshift3 pdata,pdata
+	ior am_addr,pdata  //lt_addr
+	lshift8 pdata,regext
+	fetch 1,mem_llid
+	lshift16 pdata,pdata
+	ior regext,regext
+	call clear_hidata
+	call do_aes_cbc
+
+	copy rega,loopcnt  //data length
+//	add regc,2,contr    // data ptr
+	copy regc,contr
+	call padding_data
+generate_mic_br_loop:
+	call aes_load_data
+	call do_aes_cbc
+	deposit loopcnt
+	branch generate_mic_br_end,blank
+	branch generate_mic_br_loop
+generate_mic_br_end:
+	force regidx_result,regext_index
+	deposit regext
+	store 4,mem_le_mic  //T
+	rtn	
+	
+aes_crypt_data_br:
+	increase 1,rega
+	call first_block_data_br
+	copy regc,contr
+	call aes_load_xor
+	call do_aes_ctr
+	call store_enc_data
+	increase 16,regc
+	increase -16,regb
+	branch aes_crypt_data_br,positive
+	rtn
+	
+	// temp=packet counter, rega = length or block counter
+first_block_counter_br:
+	force 0x49,pdata
+	branch first_block_br
+	
+first_block_data_br:
+	force 1,pdata
+first_block_br:
+	force regidx_data,regext_index			 
+	lshift8 temp,regext
+	ior regext,regext
+	increase 1,regext_index
+	rshift8 temp,regext
+	rshift16 regext,regext
+	fetch 2,mem_ccm_iv  //iv
+	lshift16,pdata,pdata
+	ior regext,regext				
+	increase 1,regext_index
+	ifetch 4,contr					
+	iforce regext
+	increase 1,regext_index
+	ifetch 2,contr					
+	byteswap rega,regext  
+	lshift16 regext,regext
+	ior regext,regext
+	increase 1,regext_index
+	rtn
+*/
+
+/*
+le_encrypt:
+	arg mem_le_txheader,regc
+	fetcht 5,mem_ccm_pcnt_tx
+	call generate_mic
+	force regidx_xor,regext_index
+	iforce regext
+	force 0,rega					 
+	call first_block_data
+	call do_aes_ctr
+	arg mem_le_txpayload,regc
+	fetch 1,mem_le_txlen
+	add pdata,-1,regb
+	iadd regc,contw
+	force regidx_result,regext_index
+	deposit regext
+	istore 4,contw	
+	call aes_crypt_data
+	fetch 1,mem_le_txlen
+	increase 4,pdata
+	store 1,mem_le_txlen
+	fetcht 5,mem_ccm_pcnt_tx
+	increase 1,temp
+	set0 LE_CCM_DIRECTIONBIT,temp
+	storet 5,mem_ccm_pcnt_tx
+	rtn
+
+le_decrypt:
+	fetch 1,mem_le_rxbuf+1
+	arg mem_le_rxbuf+2,regc
+	add pdata,-1,regb
+	increase -4,pdata				
+	store 1,mem_le_rxbuf+1
+	iadd regc,contr
+	ifetch 4,contr
+	force regidx_xor,regext_index
+	iforce regext
+	force 0,rega					
+	fetcht 5,mem_ccm_pcnt_rx
+	call first_block_data	//generate nonce
+	call do_aes_ctr
+	force regidx_result,regext_index
+	deposit regext
+	store 4,mem_le_peer_mic
+	call aes_crypt_data
+	arg mem_le_rxbuf,regc
+	call generate_mic
+	fetcht 4,mem_le_peer_mic
+	isub temp,pdata				
+	nrtn blank
+	fetch 4,mem_ccm_last_mic			
+	isub temp,pdata
+	rtn blank
+	storet 4,mem_ccm_last_mic
+	fetch 5,mem_ccm_pcnt_rx
+	increase 1,pdata
+	set1 LE_CCM_DIRECTIONBIT,pdata
+	store 5,mem_ccm_pcnt_rx
+	force 0,pdata
+	rtn
+*/
+
+
+//input regc input playload addr; 
+ccm_br_enc_new:
+	call ccm_init_common
+	bpatchx patch2e_3,mem_patch2e
+	arg mem_kc,contr   
+	call load_key
+	
+	jam 0,core_ccm_aad0 
+	and type,0x0f,pdata
+	lshift3 pdata,pdata
+	ior am_addr,pdata  
+	store 1,core_ccm_aad1
+	fetch 1,mem_llid
+	store 1,core_ccm_aad2
+
+	storer regc,2,core_ccm_input_playload_addr
+	storer regc,2,core_ccm_output_playload_addr
+	
+	fetchr rega,2,mem_ccm_len
+	fetcht 5,mem_ccm_pcnt_tx			
+	call ccm_br_check_0_length_continuation
+	call ccm_b0
+	jam 2,core_ccm_ctrl
+	jam 3,core_ccm_ctrl
+
+	fetch 2,mem_ccm_len
+	store 2,core_ccm_inptr
+	increase 4,pdata
+	store 2,mem_ccm_len
+	copy regc,pdata
+	iadd rega,rega
+	call wait_ccm_done
+	arg regidx_result,regext_index
+	istorer regext, 4 ,rega
+	storer regext, 4,mem_le_mic
+	rtn
+
+ccm_br_pcnt_tx_add:
+	fetch 5,mem_ccm_pcnt_tx
+	increase 1,pdata
+	store 5,mem_ccm_pcnt_tx
+	branch ccm_br_pcnt_tx_set
+
+
+ccm_br_check_0_length_continuation:
+	fetch 1,mem_llid
+	rtnne LLID_L2CAP_CONT
+	fetch 2,mem_ccm_len
+	nrtn blank
+	set1 BR_CCM_0_LENGTH_CONTINUATION,temp
+	rtn
+
+
+ccm_br_pcnt_tx_set:
+	fetch 1,mem_ccm_pcnt_tx+4
+ 	and pdata,0x0f,pdata
+ 	or pdata,0x20,pdata
+ 	store 1,mem_ccm_pcnt_tx+4
+ 	rtn
+ 	
+ccm_br_pcnt_rx_set:
+	fetch 1,mem_ccm_pcnt_rx+4
+ 	and pdata,0x0f,pdata
+ 	store 1,mem_ccm_pcnt_rx+4
+ 	rtn
+ 	
+ccm_br_decrypt_new:
+	copy contw,pdata
+	fetcht 2,mem_len
+	increase 4,temp
+	isub temp,pdata
+	store 2,mem_ccm_rx_ptr
+	store 2,core_ccm_input_playload_addr
+	store 2,core_ccm_output_playload_addr
+
+	call disable_user2
+	call ccm_init_common
+	arg mem_kc,contr 
+	call load_key
+	
+	jam 0,core_ccm_aad0 
+	fetch 1,mem_rx_type
+	and pdata,0x0f,pdata
+	lshift3 pdata,pdata
+	ior am_addr,pdata  
+	store 1,core_ccm_aad1
+	fetch 1,mem_lch_code
+	and pdata,0x3,pdata
+	store 1,mem_llid
+	store 1,core_ccm_aad2
+	
+	fetchr rega, 2,mem_len
+	storer rega,2,mem_ccm_len
+	fetch 2,mem_ccm_rx_ptr
+	iadd rega,contr
+	force regidx_data,regext_index
+	ifetchr regext, 4,contr
+	storer  regext,4,mem_le_peer_mic
+	fetcht 5,mem_ccm_pcnt_rx		
+	call ccm_br_check_0_length_continuation
+	call ccm_b0
+	jam 6,core_ccm_ctrl
+	jam 7,core_ccm_ctrl
+
+	fetch 2,mem_len
+	store 2,core_ccm_inptr
+	call wait_ccm_done
+	fetch 1,core_misc_status
+	rtnbit0 7
+	branch enable_user2
+
+
+ccm_br_pcnt_rx_add:	
+	rtnmark1 mark_old_packet
+	fetcht 4,mem_le_peer_mic
+//	fetch 4,mem_ccm_last_mic			
+//	isub temp,pdata
+///	rtn blank
+	storet 4,mem_ccm_last_mic
+	fetch 5,mem_ccm_pcnt_rx
+	increase 1,pdata
+	store 5,mem_ccm_pcnt_rx
+	branch ccm_br_pcnt_rx_set
+
+
+ 	
+le_decrypt_new:
+ 	call ccm_init_common
+	jam 0,core_ccm_aad0 
+	jam 1,core_ccm_aad1
+	fetch 1,mem_le_rxbuf_data_header
+	and_into 0x3,pdata
+	store 1,core_ccm_aad2
+	
+	setarg mem_le_rxbuf_data_payload
+	store 2,core_ccm_input_playload_addr
+	store 2,core_ccm_output_playload_addr
+
+	fetchr rega, 1,mem_le_rxbuf_data_length
+	increase -4,rega
+	nbranch disable_blank,positive
+	storer rega, 1,mem_le_rxbuf_data_length
+	setarg mem_le_rxbuf_data_payload
+	iadd rega,contr
+	force regidx_data,regext_index
+	ifetchr regext, 4,contr
+	storer  regext,4,mem_le_peer_mic
+	fetcht 5,mem_ccm_pcnt_rx				
+	call ccm_b0
+	jam 6,core_ccm_ctrl
+	jam 7,core_ccm_ctrl
+	fetch 1,mem_le_rxbuf_data_length
+	store 2,core_ccm_inptr
+	call wait_ccm_done
+	fetch 1,core_misc_status
+	bbit0 7, disable_blank
+	fetcht 4,mem_le_peer_mic
+	fetch 4,mem_ccm_last_mic			/* reduntdant packet? */
+	isub temp,pdata
+	rtn blank
+	storet 4,mem_ccm_last_mic
+	fetch 5,mem_ccm_pcnt_rx
+	increase 1,pdata
+	set1 LE_CCM_DIRECTIONBIT,pdata
+	store 5,mem_ccm_pcnt_rx
+	force 0,pdata
+	rtn
+
+
+le_encrypt_new:
+	call le_encrypt_new_start
+	setarg mem_le_txpayload
+	iadd rega,rega
+	call wait_ccm_done
+	arg regidx_result,regext_index
+	istorer regext, 4 ,rega
+	rtn
+
+
+le_encrypt_new_start:
+	call ccm_init_common
+	bpatchx patch2e_4,mem_patch2e
+	jam 0,core_ccm_aad0 
+	jam 1,core_ccm_aad1
+	fetch 1,mem_le_txheader
+	and_into 0x3,pdata
+	store 1,core_ccm_aad2
+	fetch 2,mem_contr
+	store 2,core_ccm_input_playload_addr
+	setarg mem_le_txpayload
+	store 2,core_ccm_output_playload_addr
+	
+	fetchr rega,1,mem_le_txlen
+	fetcht 5,mem_ccm_pcnt_tx				
+	call ccm_b0
+	jam 2,core_ccm_ctrl
+	jam 3,core_ccm_ctrl
+	
+	fetch 1,mem_le_txlen
+	store 2,core_ccm_inptr
+	increase 4,pdata
+	store 1,mem_le_txlen
+	fetch 5,mem_ccm_pcnt_tx
+	increase 1,pdata
+ 	set0 LE_CCM_DIRECTIONBIT,pdata
+	store 5,mem_ccm_pcnt_tx
+	rtn
+
+
+ccm_wait_enc:
+	fetch 2,core_ccm_outptr
+	isub temp,null
+	rtn zero 
+	nrtn blank
+//	call assert
+	branch ccm_wait_enc
+
+ccm_check_enc_done:
+	fetch 1,core_misc_status
+	bbit0 6,assert
+ccm_enc_done:
+	setarg mem_le_txpayload
+	iadd temp,contw	
+	arg regidx_result,regext_index
+	istorer regext, 4 ,contw	
+	branch ccm_ctrl_clr
+	
+ccm_init_common:
+	bpatchx patch2e_5,mem_patch2e
+	force regidx_result,regext_index
+	call aes_clear
+	call aes_clear_data
+ 	setarg 0
+	store 2,core_ccm_inptr
+	rtn
+	
+wait_ccm_done:
+	fetch 1,core_misc_status
+	bbit0 6,wait_ccm_done
+ccm_ctrl_clr:
+	jam 0,core_ccm_ctrl
+	rtn
+
+
+wait_aes:
+	nbranch wait_aes,aes_ready
+	rtn
+
+do_aes_ocb:
+	force 0x30,aes_ctrl
+	force 0x0,aes_ctrl
+	branch wait_aes
+
+do_aes_cbc:
+	force 0x32,aes_ctrl
+	force 0x2,aes_ctrl
+	branch wait_aes
+
+do_aes_ctr:
+	force 0x34,aes_ctrl
+	force 0x4,aes_ctrl
+	branch wait_aes
+
+	
+aes_init:
+	force 1,aes_ctrl
+	force 0,aes_ctrl
+	rtn
+function_s1:
+	force regidx_data,regext_index
+	fetch 4,mem_le_mrand
+	iforce regext
+	increase 1,regext_index
+	ifetch 4,contr
+	iforce regext
+	increase 1,regext_index
+	fetch 4,mem_le_srand
+	iforce regext
+	increase 1,regext_index
+	ifetch 4,contr
+	iforce regext
+	increase 1,regext_index
+	call aes_clear
+	increase -4,regext_index
+	fetch 4,mem_le_tk
+	copy pdata,regext
+	increase 4,regext_index
+	force 0x38,aes_ctrl
+	force 0x8,aes_ctrl
+	branch wait_aes
+
+	/* rega pointers to random number */
+function_c1:
+	bpatchx patch2e_6,mem_patch2e
+	fetch 6,mem_le_lap
+	fetcht 6,mem_le_plap
+	branch function_c1_master,master
+	fetch 6,mem_le_plap
+	fetcht 6,mem_le_lap
+function_c1_master:
+	force regidx_xor,regext_index
+	copy temp,regext
+	increase 1,regext_index
+	rshift32 temp,regext
+	lshift16 pdata,pdata
+	ior regext,regext
+	increase 1,regext_index
+	rshift32 pdata,regext
+	increase 1,regext_index
+	force 0,regext					/* p2 = ia || ra */
+	force 0,pdata
+	fetch 1,mem_le_conn_peer_addr_type
+	fetcht 1,mem_le_adv_own_addr_type
+	nbranch function_c1_irat,master
+	//conn as master
+	fetch 1,mem_le_conn_own_addr_type
+	fetcht 1,mem_le_conn_peer_addr_type
+function_c1_irat:
+	store 1,mem_le_iat
+	storet 1,mem_le_rat
+	force regidx_data,regext_index
+	arg mem_le_iat,regb
+	force 4,loopcnt
+function_c1_loop1:
+	ifetch 4,rega		
+	ifetcht 4,regb
+	ixor temp,regext
+	increase 1,regext_index
+	increase 4,rega
+	increase 4,regb
+	loop function_c1_loop1		/* p1 ^ r */
+	call aes_clear				/* k = 0 */
+	increase -4,regext_index
+	fetch 4,mem_le_tk
+	copy pdata,regext
+	increase 4,regext_index
+	force 0x38,aes_ctrl
+	force 0xc,aes_ctrl
+	call wait_aes
+
+	call aes_clear_data
+	force 0x3a,aes_ctrl
+	force 0x8,aes_ctrl
+	branch wait_aes
+
+padding_data:
+	compare 0,loopcnt,3
+	rtn true
+	deposit contr
+	iadd loopcnt,contw
+	force 0,pdata
+padding_loop:
+	istore 1,contw
+	increase 1,loopcnt
+	compare 0,loopcnt,3
+	rtn true
+	branch padding_loop
+
+aes_load_data:
+	force regidx_data,regext_index
+load_data_loop:
+	deposit loopcnt
+	branch load_data_padding,blank
+	ifetch 4,contr
+	increase -4,loopcnt
+load_data_padding:
+	iforce regext
+	increase 1,regext_index
+	compare regidx_key,regext_index,0xf
+	rtn true
+	branch load_data_loop
+
+aes_load_xor:
+	force regidx_xor,regext_index
+	branch load_regext
+load_key:
+	force regidx_key,regext_index
+	branch load_regext
+load_data128:
+	force regidx_data,regext_index
+load_regext:
+	force 4,loopcnt
+load_regext_loop:
+	ifetch 4,contr
+	iforce regext
+	increase 1,regext_index
+	loop load_regext_loop
+	rtn
+
+load_sk:
+	arg mem_le_sk,contr
+	branch load_key
+
+clear_hidata:
+	force 4,loopcnt
+	branch clear_data_rest
+
+aes_clear_data:
+	force regidx_data,regext_index
+aes_clear:
+	force 4,loopcnt
+clear_loop:
+	force 0,regext
+clear_data_rest:
+	increase 1,regext_index
+	loop clear_loop
+	rtn
+
+store_aes_result:
+	force regidx_result,regext_index
+	force 4,loopcnt
+send_aes_result_loop:
+	deposit regext
+	istore 4,contw
+	increase 1,regext_index
+	loop send_aes_result_loop
+	rtn
+
+store_enc_data:
+	force regidx_result,regext_index
+	copy regc,contw
+	add regb,1,loopcnt
+	sub loopcnt,15,null
+	branch store_enc_loop,positive
+	force 16,loopcnt
+store_enc_loop:
+	deposit regext
+	sub loopcnt,3,null
+	branch store_enc_byte,positive
+	istore 4,contw
+	increase -4,loopcnt
+	rtn zero
+	increase 1,regext_index
+	branch store_enc_loop
+store_enc_byte:
+	istore 1,contw
+	rshift8 pdata,pdata
+	loop store_enc_byte
+	rtn
+	
+	/* contr pointers to value to be compared */
+compare_res:
+	force regidx_result,regext_index
+	force 4,loopcnt
+compare_res_loop:
+	ifetch 4,contr
+	isub regext,null
+	nrtn zero
+	increase 1,regext_index
+	loop compare_res_loop
+	force 0,null
+	rtn
+
+enable_authrom:
+	fetch 1,core_clkoff
+	set0 CLOCK_OFF_AUTH_ROM,pdata
+	store 1,core_clkoff
+	rtn
+
+disable_authrom:
+	fetch 1,core_clkoff
+	set1 CLOCK_OFF_AUTH_ROM,pdata
+	store 1,core_clkoff
+	rtn
+
+//24 mem_p :ff ff ff ff ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+//24 mem_a: fc ff ff ff ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+//24 mem_b: b1 b9 46 c1 ec de b8 fe 49 30 24 72 ab e9 a7 0f e7 80 9c e5 19 05 21 64
+//24 mem_gx :12 10 ff 82 fd 0a ff f4 00 88 a1 43 eb 20 bf 7c f6 90 30 b0 0e a8 8d 18
+//24 mem_gy :11 48 79 1e a1 77 f9 73 d5 cd 24 6b ed 11 10 63 78 da c8 ff 95 2b 19 07
+//32 memh0   :19 cd e0 5b ab d9 83 1f 8c 68 05 9b 7f 52 0e 51 3a f5 4f a5 72 f3 6e 3c 85 ae 67 bb 67 e6 09 6a //use for sha
+init_memp:
+	arg mem_p,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3ffff
+	setsect 3,0x3fbff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3ffff
+	setsect 3,0x3ffff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3cfff
+	setsect 3,0x3ffff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3ffef
+	setsect 3,0x3ffff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3ffff
+	setsect 3,0x3ffff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x26c7f
+	setsect 2,0x146b
+	setsect 3,0x37bb3
+	istore 9,contw
+	setsect 0,0x1feb8
+	setsect 1,0x10c12
+	setsect 2,0x2b722
+	setsect 3,0x29fa6
+	istore 9,contw
+	setsect 0,0xe70f
+	setsect 1,0x16720
+	setsect 2,0x519e
+	setsect 3,0x19084
+	istore 9,contw
+	setsect 0,0x31012
+	setsect 1,0x360bf
+	setsect 2,0x3f0af
+	setsect 3,0x3d3
+	istore 9,contw
+	setsect 0,0x3a188
+	setsect 1,0x3ad0
+	setsect 2,0x3cbf2
+	setsect 3,0x243d9
+	istore 9,contw
+	setsect 0,0x2b030
+	setsect 1,0x36a03
+	setsect 2,0x11188
+	setsect 3,0x1e520
+	istore 9,contw
+	setsect 0,0x3a11e
+	setsect 1,0xfe5d
+	setsect 2,0xdd57
+	setsect 3,0x1ac93
+	istore 9,contw
+	setsect 0,0x11ed
+	setsect 1,0x218c4
+	setsect 2,0x8da7
+	setsect 3,0x257ff
+	istore 9,contw
+	setsect 0,0x3192b
+	setsect 1,0x34641
+	setsect 2,0x1be0c
+	setsect 3,0x366ad
+	istore 9,contw
+	setsect 0,0x1f83
+	setsect 1,0x15a23
+	setsect 2,0x3f9b0
+	setsect 3,0x3949
+	istore 9,contw
+	setsect 0,0x13a51
+	setsect 1,0x153fd
+	setsect 2,0x3372a
+	setsect 3,0xf1bb
+	istore 9,contw
+	setsect 0,0x3ae85
+	setsect 1,0x1eed9
+	setsect 2,0x9e66
+	setsect 3,0x1a8
+	istore 8,contw
+	rtn
+	
+ifdef SECURE_CONNECTION
+
+// mem_p_256:ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 ff ff ff ff
+// mem_a_256: fc ff ff ff ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff b1 b9 46 c1 ec de b8 fe
+// mem_gx_256: 96 c2 98 d8 45 39 a1 f4 a0 33 eb 2d 81 7d 03 77 f2 40 a4 63 e5 e6 bc f8 47 42 2c e1 f2 d1 17 6b
+// mem_gy_256: f5 51 bf 37 68 40 b6 cb ce 5e 31 6b 57 33 ce 2b 16 9e 0f 7c 4a eb e7 8e 9b 7f 1a fe e2 42 e3 4f
+// mem_le_slat :be 83 60 5a db 0b 37 60 38 a5 f5 aa 91 83 88 6c
+init_memp_256:
+ 	arg mem_p_256,contw
+        setsect 0,0x3ffff
+        setsect 1,0x3ffff
+        setsect 2,0x3ffff
+        setsect 3,0x3ffff
+        istore 9,contw
+        setsect 0,0x3ffff
+        setsect 1,0x3f
+        setsect 2,0x0
+        setsect 3,0x0
+        istore 9,contw
+        setsect 0,0x0
+        setsect 1,0x0
+        setsect 2,0x1000
+        setsect 3,0x0
+        istore 9,contw
+        setsect 0,0x3ff00
+        setsect 1,0x3ffff
+        setsect 2,0x3ffcf
+        setsect 3,0x3ffff
+        istore 9,contw
+        setsect 0,0x3ffff
+        setsect 1,0x3ffff
+        setsect 2,0x3ffff
+        setsect 3,0x3ff
+        istore 9,contw
+        setsect 0,0x0
+        setsect 1,0x0
+        setsect 2,0x0
+        setsect 3,0x0
+        istore 9,contw
+        setsect 0,0x10000
+        setsect 1,0x0
+        setsect 2,0x3f000
+        setsect 3,0x3ffff
+        istore 9,contw
+        setsect 0,0x296ff
+        setsect 1,0x22630
+        setsect 2,0x3945d
+        setsect 3,0x3d284
+        istore 9,contw
+        setsect 0,0x333a0
+        setsect 1,0x4b7a
+        setsect 2,0x37d8
+        setsect 3,0x3c9dc
+        istore 9,contw
+        setsect 0,0x3a440
+        setsect 1,0x1b958
+        setsect 2,0x38bce
+        setsect 3,0x1091f
+        istore 9,contw
+        setsect 0,0x2e12c
+        setsect 1,0x1f47c
+        setsect 2,0x356b1
+        setsect 3,0x2fd47
+        istore 9,contw
+        setsect 0,0x6837
+        setsect 1,0x2ed90
+        setsect 2,0x1ecec
+        setsect 3,0x1acc5
+        istore 9,contw
+        setsect 0,0x23357
+        setsect 1,0x18af3
+        setsect 2,0xf9e1
+        setsect 3,0x129f0
+        istore 9,contw
+        setsect 0,0x2e7eb
+        setsect 1,0x3e6e3
+        setsect 2,0x3e1a7
+        setsect 3,0x10b8b
+        istore 9,contw
+        setsect 0,0x24fe3
+        setsect 1,0x20ef
+        setsect 2,0x1b5a6
+        setsect 3,0xdc2f
+        istore 9,contw
+        setsect 0,0x13860
+        setsect 1,0x2bd69
+        setsect 2,0x391a
+        setsect 3,0x1b222
+        istore 9,contw
+        rtn
+endif
+
Index: program/sim.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/sim.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/sim.prog	(working copy)
@@ -0,0 +1,626 @@
+simstart:
+	force 8,radio_ctrl
+	force 0,radio_ctrl
+	jam 0xff,rfen_ck
+	jam 5,core_clksel
+	jam 0,core_clkoff
+	jam 0,core_clkoff+1
+//	call sim_gpio
+//	jam 0xa0,0x90a
+//	jam 0x8f,0x90d
+//	branch sim_usb
+//	branch sim_iic
+//	branch sim_clk
+//	call sim_cal
+//	call sim_uart
+//	branch sim_c1
+//	branch loop
+//	call sim_spi
+//	call sim_eep
+//	branch test_tx
+	branch sim_le
+//	branch sim_250k
+	branch sim_main
+sim_lpm:
+	fetch 1,0x9ffd
+	beq 1,sim_assert
+	setarg 0
+	store 8,mem_gpio_wakeup_low
+	arg 30,temp
+	branch lpm_sleep
+sim_lpm_sleep:
+	jam 1,mem_context
+	branch sim_lpm_wait,wake
+	jam 0x70,core_bist_ctrl
+	jam ccnt_start,core_misc_ctrl
+sim_lpm_wait:
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	branch sim_lpm_wait,blank
+	call lpm_recover_clk,wake
+	jam 0x1b,mem_lpm_ldocnt
+	arg sim_assert,loopcnt
+	fetch 1,core_gpio_wakeup_low+2
+	bbit0 2,sim_lpm_loop
+	until null,lpo_edge
+	jam 0x20,core_misc_ctrl
+	until null,lpo_edge
+sim_lpm_loop:
+	fetch 1,core_misc_status
+	bbit1 6,sim_lpm_loop
+	fetch 1,core_gpio_in+3
+	compare 0x20,pdata,0x20
+	setarg 0
+	setflag true,29,pdata
+	setflag true,30,pdata
+	store 4,mem_gpio_wakeup_low
+	setarg 0
+	nsetflag true,29,pdata
+	nsetflag true,30,pdata
+	store 4,mem_gpio_wakeup_high
+	arg 300,temp
+	branch lpm_sleep
+
+sim_assert:
+	branch sim_assert
+
+
+sim_main:
+	call init_param
+	setarg 0
+	store 2,core_clkoff
+	setarg 0xff00
+	store 2,core_lpm_reg+2
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	fetch 1,mem_sim_slave
+	beq 1,sim_slave
+	jam dvc_op_hci,mem_device_option
+	fetch 6,mem_lap
+	store 6,mem_hci_plap
+	setarg 0xbdbdbd
+	store 3,mem_lap
+	istore 3,contw
+	jam hci_cmd_create_conn,mem_hci_cmd
+	force 0x10,pdata
+	add pdata,-2,clkn_bt
+	store 4,mem_page_clk
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn
+	jam 0,mem_scan_mode
+sim_loop:
+	call idle_dispatch
+	fetch 1,mem_context
+	bbit0 state_inconn,sim_skip
+	set1 mark_tx_l2cap,mark
+	fetch 1,mem_context + coffset_op		
+	set1 op_txl2cap,pdata
+	store 1,mem_context + coffset_op
+	jam 0,mem_context + coffset_lmp_to_send
+	jam 0,mem_lmo_opcode2
+	setarg 300
+	store 2,mem_tx_len
+	setarg mem_tmp_buffer
+	store 2,mem_txptr
+	jam 6,mem_tx_lch
+	jam 1,mem_hci_conn_handle
+sim_skip:
+	call connection_dispatch
+	branch sim_loop		
+
+sim_slave:
+	jam 2,mem_scan_mode
+	call page_scan_dispatch
+	branch sim_skip
+
+sim_le:
+//	jam lemode_2m,mem_le_mode
+//  jam lemode_lr_s2,mem_le_mode
+//  jam lemode_lr_s8,mem_le_mode
+	fetch 1,mem_sim_slave
+	beq 1,sim_le_slave
+	jam 1,mem_le_scan_enable
+sim_le_loop:
+	call le_advertising_dispatch
+	branch sim_le_loop
+
+sim_le_slave:
+	jam 1,mem_le_adv_enable
+	nop 1000
+	branch sim_le_loop
+
+sim_usb:
+	call usb_init
+sim_usb_loop:
+	call usb_isr
+	branch sim_usb_loop
+
+sim_uart:
+	jam 0x67,mem_h5tx_buf
+	setarg mem_h5tx_buf
+	add pdata,0x80,temp
+	call uarta_init_tx
+	increase 0x80,pdata
+	increase 0x80,temp
+	call uartb_init_rx
+	jam gpcfg_uart_txd,core_gpio_conf
+	jam gpcfg_uartb_rxd | gpcfg_pullup,core_gpio_conf + 1
+	jam 0x81,core_uart_ctrl
+	jam 0x81,core_uartb_ctrl
+	setarg 0x30
+	store 2,core_uart_baud
+	store 2,core_uartb_baud
+	fetch 1,mem_sim_slave
+	beq 1,sim_uart_slave
+	call uarta_prepare_tx
+	call sim_uart_wait+3
+	setarg 0x1357d9a
+	istore 4,contu
+	arg 0xaa69,rega
+	istorer rega,2,contu
+	setarg 0xfedcb3
+	istore 3,contu
+	storer contu,2,core_uart_twptr
+sim_uart_wait:
+	fetch 1,core_uart_status
+	bbit1 uart_status_tx_busy,sim_uart_wait
+	nop 200
+	rtn
+
+sim_uart_slave:
+	fetch 1,core_uartb_status
+	bbit1 uart_status_rx_fifo_empty,sim_uart_slave
+	fetch 1,core_uartb_rxitems
+	bne 9,sim_uart_slave
+	fetcht 8,mem_h5tx_buf
+	call uartb_prepare_rx
+	ifetch 8,contu
+	isub temp,null
+	nbranch assert,zero
+	rtn
+
+
+
+sim_cal:
+
+	call tx_iq_precomp
+	fetchr regf,2,mem_omega
+	ifetchr regf,2,contr
+	ifetchr regf,2,contr
+	fetchr regf,2,mem_b1
+	ifetchr regf,2,contr
+	fetchr regf,2,mem_b2
+	ifetchr regf,2,contr
+	arg 0x1000,timeup
+	call tx_iq_cal
+	jam 1,core_ice_ctrl
+
+	arg 0x1000,timeup
+	call rx_iq_comp
+	jam 1,core_ice_ctrl
+	
+
+ifdef NULL
+
+sim_iic:
+	call iicd_init_12m
+	setarg 3
+	store 2,core_iicd_txlen
+	setarg 0x1f051e
+	store 3,mem_iicd_addr
+	setarg mem_iicd_addr
+	store 2,core_iicd_txaddr
+	setarg 1
+	store 2,core_iicd_rxlen
+	jam 3,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	call wait_iicd_done
+	nop 300
+	setarg 0xd321d2
+	store 3,mem_iicd_addr
+	jam iicd_start,core_misc_ctrl
+	call wait_iicd_done
+s_loop:
+	branch s_loop
+
+sim_gpio:
+	jam 0xc0,core_gpio_pu3
+	call lpm_disable_exen_output
+	fetch 4,core_gpio_in
+	bbit0 4,sim_gpio + 2
+	nop 3
+	fetch 4,core_gpio_in
+	nop 3
+	fetch 4,core_gpio_in
+	rtn
+
+
+	
+sim_250k:
+	call init_250k
+	fetch 1,0x8001
+	bbit1 7,sim_250k_rx
+	call tx_radio_freq
+	call start_transmitter	/* get ready for that id packet */
+	nop 600
+	enable encode_fec0
+	set1 TXGFSK,radio_ctrl
+	force 0,pdata
+	inject mod,9
+	setarg 0xaa
+	inject mod,8
+	preload access
+	inject mod,32
+	setarg 0x1da861
+	inject mod,24
+	setarg 0x94445b
+	inject mod,24
+	setarg 0x1275f
+	inject mod,24
+	branch loop
+sim_250k_rx:
+	call rx_radio_freq
+	call start_receiver	/* wait for that id packet from master */
+	enable decode_fec0
+	correlate null,never
+	parse demod,bucket,72
+	branch loop
+
+	
+
+
+
+
+sim_spi:
+	call spid_init_flash
+	call spid_unlock_flash
+	call spid_init
+	setarg 0x35
+	call spid_read_reg
+	nop 200
+	force 4,temp
+	setarg 0x42
+	branch spid_read_regs
+
+sim_eep:
+	call iicd_init_12m
+	setarg 3
+	store 2,core_iicd_txlen
+	setarg 0x1f051e
+	store 3,mem_iicd_addr
+	setarg mem_iicd_addr
+	store 2,core_iicd_txaddr
+	setarg 1
+	store 2,core_iicd_rxlen
+	jam 3,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	call wait_iicd_done
+	nop 200
+	setarg 0x18f7a3b
+	store 4,mem_iicd_addr
+	arg mem_iicd_addr,rega
+	arg 4,temp
+	setarg 0x1235
+	call iicd_write_eep
+	nop 300
+	arg mem_ucode_keybuf,rega
+	arg 1,temp
+	setarg 0x3512
+	store 2,mem_addr_mi
+	call iicd_read_eep
+	arg 1,temp
+	setarg 0x3512
+	store 2,mem_addr_mi
+	call iicd_read_eep
+	nop 200
+	setarg 0xa1
+	arg 3,temp
+	arg mem_ucode_keybuf,rega
+	branch iicd_read_data
+
+sim_otp:
+	setarg 0x123456
+	store 3,0x800
+	setarg 0x10
+	arg 0x800,rega
+	arg 0x10,loopcnt
+	branch otp_write
+
+sim_clk:
+	add lpo_time,12,alarm
+	snooze
+clock_loop:
+	nop 100
+	jam 1,core_config
+	setflag user,0,pdata
+	random pdata
+	and_into 0x1f,pdata
+	store 1,core_clksel
+	nop 70
+	jam 2,core_kick
+	nop 200
+	branch clock_loop
+	jam 2,core_clksel
+	setarg 1500
+	call sleep
+	jam 0x42,core_clksel
+	add lpo_time,200,alarm
+	snooze
+	branch 0x4000
+
+sim_c1:
+	setarg 0xb4b5b6
+	store 3,mem_le_lap
+	setarg 0xb1b2b3
+	istore 3,contw
+	setarg 0xa4a5a6
+	store 3,mem_le_plap
+	setarg 0xa1a2a3
+	istore 3,contw
+	setarg 0x101
+	store 4,mem_le_preq
+	setarg 0x70710
+	istore 3,contw
+	setarg 0x302
+	store 4,mem_le_pres
+	setarg 0x50008
+	istore 3,contw
+
+	arg regidx_key,regext_index
+	arg 4,loopcnt
+sim_clear_key_loop:
+	arg 0,regext
+	increase 1,regext_index
+	loop sim_clear_key_loop
+
+	setarg 0x702EE0
+	store 3,mem_le_rconfirm
+	setarg 0x274EC6
+	istore 3,contw
+	setarg 0x0E6388
+	istore 3,contw
+	setarg 0x56AD6F
+	istore 3,contw
+	setarg 0x83D521
+	istore 3,contw
+	setarg 0x57	
+	istore 1,contw
+	arg mem_le_rconfirm,rega
+	call aes_init
+	call function_c1
+	branch loop
+endif
+
+
+
+
+
+//iic read function
+//function name:sim_iic_read_eep_data
+//input:
+//temp:the length that simulation iic want to read eeprom data
+//rega:the memmory point that simulation iic read data store
+//regb:the eeprom address offset
+//mark_eeprom_size:select 02 or other
+//output:nc
+sim_iic_read_eep_data:
+	fetch 2,mem_eeprom_base
+	iadd regb,pdata
+	byteswap pdata,pdata
+	store 2,mem_addr_mi
+	copy temp,regb
+	
+	call sim_iic_start
+	setarg 0xa0
+	call sim_iic_send_byte
+	fetch 1,mem_addr_mi
+	call sim_iic_send_byte
+	bmark1 mark_eeprom_size,sim_iic_read_eep_data_2k
+	fetch 1,mem_addr_mi + 1
+	call sim_iic_send_byte
+sim_iic_read_eep_data_2k:
+	call sim_iic_stop
+
+	call sim_iic_start
+	setarg 0xa1
+	call sim_iic_send_byte
+
+sim_iic_read_eep_data_loop:
+	call sim_iic_read_byte
+	istore 1,rega
+	increase 1,rega
+	increase -1,regb
+	nbranch sim_iic_read_eep_data_loop,zero
+	branch sim_iic_stop
+
+
+//iic write data function
+//function name:sim_iic_write_eep_data
+//input:
+//temp:the length that simulation iic want to write eeprom data
+//rega:the memmory point that simulation iic write data read
+//regb:the eeprom address
+//mark_eeprom_size:select 02 or other
+//output:nc
+sim_iic_write_eep_data:
+	byteswap regb,pdata
+	store 2,mem_addr_mi
+	copy temp,regb
+
+	call sim_iic_start
+	setarg 0xa0
+	call sim_iic_send_byte
+
+	fetch 1,mem_addr_mi
+	call sim_iic_send_byte
+	bmark1 mark_eeprom_size,sim_iic_write_eep_data_loop
+	fetch 1,mem_addr_mi + 1
+	call sim_iic_send_byte
+sim_iic_write_eep_data_loop:
+	ifetch 1,rega
+	call sim_iic_send_byte
+	increase 1,rega
+	increase -1,regb
+	nbranch sim_iic_write_eep_data_loop,zero
+	branch sim_iic_stop
+//	bmark1 mark_eeprom_size
+
+//use reg:pdata,contr,contw,loopcnt
+sim_iic_wait_ack:
+	arg 10,loopcnt
+	call sim_iic_release_sda
+	call sim_iic_scl_output_high	//scl = 1
+	call sim_iic_delay				//delay 2.5us
+sim_iic_wait_ack_loop:
+	call sim_iic_read_sda_level
+	branch sim_iic_scl_output_low,blank	//scl = 0
+	loop sim_iic_wait_ack_loop
+	branch sim_iic_scl_output_low		//scl = 0	
+
+
+//use reg:pdata,contr,contw,rega,queue
+sim_iic_ack_slave:
+	call sim_iic_scl_output_low		//scl = 0	
+	call sim_iic_sda_output_low		//sda = 0
+	call sim_iic_delay				//delay 2.5us
+	call sim_iic_scl_output_high	//scl = 1
+	call sim_iic_delay				//delay 2.5us
+	branch sim_iic_scl_output_low	//scl = 0	
+
+
+//output:pdata receive byte data
+//use reg:pdata,contr,contw,loopcnt,regc,rega
+sim_iic_read_byte:
+	arg 8,loopcnt
+	arg 0,regc
+	call sim_iic_release_sda
+sim_iic_read_byte_loop:
+	call sim_iic_scl_output_high	//scl = 1
+	call sim_iic_delay				//delay 2.5us
+	lshift regc,regc	
+	call sim_iic_read_sda_level
+	iadd regc,regc
+	call sim_iic_delay				//delay 2.5us
+	call sim_iic_scl_output_low		//scl = 0	
+	loop sim_iic_read_byte_loop
+	call sim_iic_ack_slave
+	copy regc,pdata
+	rtn
+
+//input:pdata send byte data
+//use reg:pdata,contr,contw,loopcnt,regc,rega
+sim_iic_send_byte:
+	arg 8,loopcnt
+	copy pdata,regc
+	call sim_iic_scl_output_low		//scl = 0	
+sim_iic_send_byte_loop:
+	isolate1 7,regc
+	call sim_iic_sda_output_high,true	//sda = 1
+	ncall sim_iic_sda_output_low,true	//sda = 0
+	lshift regc,regc
+	call sim_iic_delay				//delay 2.5us
+	call sim_iic_scl_output_high	//scl = 1
+	call sim_iic_delay				//delay 2.5us
+	call sim_iic_scl_output_low		//scl = 0	
+	call sim_iic_delay				//delay 2.5us
+	loop sim_iic_send_byte_loop
+	branch sim_iic_wait_ack
+
+
+//use reg:pdata,contr,contw,rega
+sim_iic_start:
+	call sim_iic_sda_output_high	//sda = 1
+	call sim_iic_scl_output_high	//scl = 1
+	call sim_iic_delay				//delay 2.5us
+	call sim_iic_sda_output_low		//sda = 0
+	call sim_iic_delay				//delay 2.5us
+	branch sim_iic_scl_output_low		//scl = 0
+
+
+//use reg:pdata,contr,contw,rega
+sim_iic_stop:
+	call sim_iic_sda_output_low		//sda = 0
+	call sim_iic_scl_output_high	//scl = 1
+	call sim_iic_delay				//delay 2.5us
+	call sim_iic_sda_output_high	//sda = 1
+	branch sim_iic_delay				//delay 2.5us
+
+
+//scl = 1
+sim_iic_scl_output_high:
+	enable user
+	fetch 1,SIM_IIC_SCL_GPIO_NUM
+	branch sim_iic_config_gpio
+
+//scl = 0
+sim_iic_scl_output_low:
+	disable user
+	fetch 1,SIM_IIC_SCL_GPIO_NUM
+	branch sim_iic_config_gpio
+
+//sda = 1
+sim_iic_sda_output_high:
+	enable user
+	fetch 1,SIM_IIC_SDA_GPIO_NUM
+	branch sim_iic_config_gpio
+
+//sda = 0
+sim_iic_sda_output_low:
+	disable user
+	fetch 1,SIM_IIC_SDA_GPIO_NUM
+	branch sim_iic_config_gpio
+
+//input:pdata the gpio number
+//input:user flag, if enable user,config gpio output high level; if disable user, config gpio output low level
+//use reg:pdata,contr,contw,queue,rega
+sim_iic_config_gpio:
+	and pdata,0x07,queue
+	rshift3 pdata,pdata
+	arg core_gpio_conf,temp
+	iadd temp,temp
+	ifetch 1,temp
+	qset1 pdata
+	istore 1,temp
+	increase 4,temp
+	ifetch 1,temp
+	qsetflag user,pdata
+	istore 1,temp
+	rtn
+
+
+sim_iic_release_sda:
+	fetch 1,SIM_IIC_SDA_GPIO_NUM
+	and pdata,0x07,queue
+	rshift3 pdata,pdata
+	arg core_gpio_conf,temp
+	iadd temp,temp
+	ifetch 1,temp
+	qset0 pdata
+	istore 1,temp
+	rtn	
+
+//get sda level
+//output:if sda high level ,pdata is 1;if sda low level ,pdata is 0
+//use reg:pdata,contr,contw,queue,rega,temp
+sim_iic_read_sda_level:
+	nop 4
+	fetch 1,SIM_IIC_SDA_GPIO_NUM
+	and pdata,0x07,queue
+	rshift3 pdata,pdata
+	arg core_gpio_in,temp
+	iadd temp,temp
+	setarg 0
+	ifetcht 1,temp
+	qisolate1 temp
+	setflag true,0,pdata
+	rtn	
+
+//delay 2.5us
+sim_iic_delay:
+//	nop 1
+	rtn
+
+/**********************************/
+
+
+
+
Index: program/simple_pairing.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/simple_pairing.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/simple_pairing.prog	(working copy)
@@ -0,0 +1,2919 @@
+
+publickey_init:
+	fetch 1,mem_ssp_enable
+	nbranch sp_initialize,blank
+	branch sp_initialize_256
+
+sp_calc_sequence_256_check:
+	bpatchx patch2e_7,mem_patch2e
+	fetch 1,mem_ssp_enable
+	rtn blank
+	fetch 1,mem_sp_local_key_invalid
+	rtnne SP_KEY_VALID
+	fetch 1,mem_secure_connections_enable
+	rtn blank
+	fetch 1,mem_sc_local_key_invalid
+	rtneq SP_KEY_VALID_256
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_CONNECTED,stop_publickey_calc_256
+	fetch 1,mem_sc_calc
+	beq SP_CALC_STANDBY,sp_initialize_256
+	rtn
+stop_publickey_calc_256:
+	jam SP_CALC_STANDBY,mem_sc_calc	
+	rtn
+
+
+sp_br_secure_connection_enable:
+	fetch 1,mem_secure_connections_enable
+	set1 SECURE_CONNECTIONS_BR_BIT,pdata
+	store 1,mem_secure_connections_enable
+	rtn
+	
+sp_br_secure_connection_disable:
+	fetch 1,mem_secure_connections_enable
+	set0 SECURE_CONNECTIONS_BR_BIT,pdata
+	store 1,mem_secure_connections_enable
+	rtn
+	
+ifdef SIMPLE_PAIRING
+
+sp_initialize:
+	bpatchx patch2f_0,mem_patch2f
+	fetch 1,mem_ssp_enable 
+	nbranch sp_pubkey_calc, blank
+sp_reset:
+	call sp_clear_flags
+	jam SP_KEY_INVALID,mem_sp_local_key_invalid
+	jam SP_CALC_STANDBY,mem_sp_calc
+	rtn
+	
+sp_wait_pubkey_calc_done:
+	fetch 1,mem_ssp_enable
+	rtn blank
+	fetch 1,mem_sp_local_key_invalid
+	rtneq SP_KEY_VALID
+	call sp_calc_sequence
+	branch sp_wait_pubkey_calc_done
+	
+sp_clear_flags:
+	bpatchx patch2f_1,mem_patch2f
+	setarg mem_sp_state_end
+	arg mem_sp_state_start,contw
+	isub contw,loopcnt
+	call clear_mem
+	setarg mem_sp_state_xmem_end
+	arg mem_sp_state_xmem,contw
+	isub contw,loopcnt
+	branch clear_mem
+
+sp_generate_local_key:
+	jam SP_FLAG_COMMIT,mem_sp_flag  
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,sp_generate_local_key0_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,sp_generate_local_key0_192
+	rtn	
+	
+sp_generate_local_key0_256:
+	fetch 1,mem_sc_local_key_invalid
+	beq SP_KEY_VALID_256,sp_start_send_pubkey_256
+	branch sp_pubkey_calc_256
+sp_start_send_pubkey_256:
+	call sp_dhkey_calc_256
+	fetch 1,mem_master_sp_state
+	nrtn blank
+	jam SP_STAT_KEY_SEND,mem_sp_state
+	rtn
+	
+sp_master_generate_local_key:
+	fetch 1,mem_sp_local_key_invalid
+	beq SP_KEY_VALID,sp_dhkey_calc
+	branch assert
+	
+sp_generate_local_key0_192:
+	fetch 1,mem_sp_local_key_invalid
+	beq SP_KEY_VALID,sp_start_send_pubkey
+	branch sp_pubkey_calc
+    
+sp_start_send_pubkey:
+	call sp_dhkey_calc
+	fetch 1,mem_master_sp_state
+	nrtn blank
+	jam SP_STAT_KEY_SEND,mem_sp_state
+	rtn
+
+
+sp_calc_check_publickey_256:
+	call sp_calc_b256
+	arg mem_le_pubkey_remote_y_256,rega
+	arg mem_t7_256,contw
+	call bn_sqrmod_256   
+	arg mem_le_pubkey_remote_x_256,rega
+	arg mem_t2_256,contw
+	call bn_sqrmod_256   
+  	arg mem_t2_256,rega
+	arg mem_le_pubkey_remote_x_256,regb
+	arg mem_t2_256,contw
+	call bn_mulmod_256	
+  	arg mem_a_256,rega
+	arg mem_le_pubkey_remote_x_256,regb
+	arg mem_t3_256,contw
+	call bn_mulmod_256	
+  	arg mem_t3_256,rega
+	arg mem_t2_256,regb
+	arg mem_t2_256,contw
+	call bn_addmod_256	 
+  	arg mem_t0_256,rega
+	arg mem_t2_256,regb
+	arg mem_t0_256,contw
+	call bn_addmod_256	 
+	arg 32,loopcnt
+  	arg mem_t7_256,rega
+	arg mem_t0_256,regb
+	branch  string_compare
+	
+sp_calc_b256:
+	arg mem_gy_256,rega
+	arg mem_t0_256,contw
+	call bn_sqrmod_256   
+	arg mem_gx_256,rega
+	arg mem_t2_256,contw
+	call bn_sqrmod_256    
+  	arg mem_t2_256,rega
+	arg mem_gx_256,regb
+	arg mem_t2_256,contw
+	call bn_mulmod_256	
+  	arg mem_a_256,rega
+	arg mem_gx_256,regb
+	arg mem_t3_256,contw
+	call bn_mulmod_256	 
+  	arg mem_t3_256,rega
+	arg mem_t2_256,regb
+	arg mem_t2_256,contw
+	call bn_addmod_256	 
+  	arg mem_t0_256,rega
+	arg mem_t2_256,regb
+	arg mem_t0_256,contw
+	branch  bn_submod_256	
+	
+sp_calc_check_publickey:
+	call sp_calc_b
+	arg mem_sp_pubkey_remote_y,rega
+	arg mem_t7_256,contw
+	call bn_sqrmod 
+	arg mem_sp_pubkey_remote_x,rega
+	arg mem_t2_256,contw
+	call bn_sqrmod
+  	arg mem_t2_256,rega
+	arg mem_sp_pubkey_remote_x,regb
+	arg mem_t2_256,contw
+	call bn_mulmod	
+  	arg mem_a,rega
+	arg mem_sp_pubkey_remote_x,regb
+	arg mem_t3_256,contw
+	call bn_mulmod	
+  	arg mem_t3_256,rega
+	arg mem_t2_256,regb
+	arg mem_t2_256,contw
+	call bn_addmod	 
+  	arg mem_t0_256,rega
+	arg mem_t2_256,regb
+	arg mem_t0_256,contw
+	call bn_addmod	 
+ 	arg 24,loopcnt
+ 	arg mem_t7_256,rega
+	arg mem_t0_256,regb
+	branch  string_compare
+	
+sp_calc_b:
+	arg mem_gy,rega
+	arg mem_t0_256,contw
+	call bn_sqrmod   
+	arg mem_gx,rega
+	arg mem_t2_256,contw
+  	call bn_sqrmod
+  	arg mem_t2_256,rega
+	arg mem_gx,regb
+	arg mem_t2_256,contw
+	call bn_mulmod	
+	arg mem_a,rega
+	arg mem_gx,regb
+	arg mem_t3_256,contw
+	call bn_mulmod	 
+  	arg mem_t3_256,rega
+	arg mem_t2_256,regb
+	arg mem_t2_256,contw
+	call bn_addmod	 
+  	arg mem_t0_256,rega
+	arg mem_t2_256,regb
+	arg mem_t0_256,contw
+	branch  bn_submod	
+
+   
+sp_calculate_commitment:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,sp_calculate_commitment_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,sp_calculate_commitment_192
+	rtn
+
+sp_calculate_commitment_256:
+	fetch 1,mem_sc_calc
+	bne SP_CALC_STANDBY,sp_calculate_commitment_wait_dhkey_calc
+	call sp_local_random_key_generator
+	arg mem_sp_prarm_stack,contw
+	setarg mem_sp_random_local_end
+	istore 2,contw
+	setarg mem_sc_pubkey_local_x_256+32
+	istore 2,contw
+	setarg mem_le_pubkey_remote_x_256+32
+	istore 2,contw
+//	branch sp_calculate_commitment0
+sp_calculate_commitment0_256:
+	call function_f1_256
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_COMMIT_CALC,master_sp_calculate_commitment0
+	jam SP_FLAG_COMMIT,mem_sp_flag
+	jam SP_STAT_COMMIT_SEND,mem_sp_state
+	rtn
+	
+sp_calculate_commitment_192:	
+	fetch 1,mem_sp_calc
+	bne SP_CALC_STANDBY,sp_calculate_commitment_wait_dhkey_calc
+	call sp_local_random_key_generator
+	arg mem_sp_prarm_stack,contw
+	setarg mem_sp_random_local_end
+	istore 2,contw
+	setarg mem_sp_pubkey_local_x_end
+	istore 2,contw
+	setarg mem_sp_pubkey_remote_x_end
+	istore 2,contw
+	branch sp_calculate_commitment0
+master_sp_calculate_commitment:
+	arg mem_sp_prarm_stack,contw
+	setarg mem_sp_random_remote_end
+	istore 2,contw
+	setarg mem_sp_pubkey_remote_x_end
+	istore 2,contw
+	setarg mem_sp_pubkey_local_x_end
+	istore 2,contw
+sp_calculate_commitment0:
+	call function_f1_192
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_COMMIT_CALC,master_sp_calculate_commitment0
+	jam SP_FLAG_COMMIT,mem_sp_flag
+	jam SP_STAT_COMMIT_SEND,mem_sp_state
+	rtn
+master_sp_calculate_commitment0:
+	jam SP_STAT_COMMITMENT_COMPARE,mem_master_sp_state
+	call sp_master_generate_local_key
+	branch master_set_mem_master_sp_flag 
+
+sp_local_random_key_generator:
+	arg mem_sp_random_local,contw
+	force 8,queue
+	branch random_generator
+  
+sp_calculate_commitment_wait_dhkey_calc:
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	rtn
+    
+sp_confirm_check:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,sp_confirm_check_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,sp_confirm_check_192
+sp_confirm_check_wait:
+	jam SP_STAT_CONFIRM_CHECK,mem_sp_state
+	jam SP_FLAG_COMMIT,mem_sp_flag  
+	rtn
+
+sp_confirm_check_256:	
+	fetch 1,mem_sp_dhkey_invalid
+	bne SP_KEY_VALID_256,sp_confirm_check_wait
+	branch sp_confirm_check_common
+	
+sp_confirm_check_192:	
+	fetch 1,mem_sp_dhkey_invalid
+	bne SP_KEY_VALID,sp_confirm_check_wait
+sp_confirm_check_common:	
+	arg      mem_addr_value,contw
+	fetch    6,mem_lap
+	istore   6,contw
+	fetch    6,mem_plap
+	istore   6,contw
+	fetch    3,mem_sp_iocap_remote
+	istore   3,contw 
+
+	call     function_f3a
+
+	arg      mem_sp_calc_result_high,rega
+	arg      mem_sp_check_result,regb    
+	force    4,queue 
+	call     compare4
+	nbranch  sp_confirm_check_failed,true  
+
+	call sp_confirm_check_success
+	jam LMP_DHKey_Check,mem_lmi_opcode2
+	branch tid_set_reply
+    
+sp_confirm_check_success:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_CONFIRM_CHECK,sp_confirm_check_success_master
+	jam SP_STAT_CONFIRM_CALC,mem_sp_state
+	jam SP_FLAG_COMMIT,mem_sp_flag  
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	rtn
+sp_confirm_check_success_master:
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam SP_STATE_END,mem_master_sp_state
+	branch master_set_mem_master_sp_flag
+	//accept opcode?
+	
+sp_confirm_check_failed:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_CONFIRM_CHECK,sp_confirm_check_failed_master
+	jam SP_STAT_NULL,mem_sp_state
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	//accept opcode?
+	jam      AUTHENTICATION_FAILURE_ERROR,mem_lmo_reason2 
+	rtn
+sp_confirm_check_failed_master:
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	jam SP_STAT_NULL,mem_master_sp_state
+	rtn
+    
+sp_confirm_calc:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,sp_confirm_calc_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,sp_confirm_calc_192
+	rtn
+	
+sp_confirm_calc_256:	
+	fetch 1,mem_sp_dhkey_invalid
+	beq SP_KEY_VALID_256,sp_confirm_calc_ready
+	jam 	SP_STAT_CONFIRM_CALC,mem_master_sp_state
+	branch master_set_mem_master_sp_flag
+	
+sp_confirm_calc_192:
+	fetch 1,mem_sp_dh_ready
+	beq SP_FLAG_COMMIT, sp_confirm_calc_ready
+	jam 	SP_STAT_CONFIRM_CALC,mem_master_sp_state
+	branch master_set_mem_master_sp_flag
+	
+sp_confirm_calc_ready:
+	arg      mem_addr_value,contw
+	fetch    6,mem_plap
+	istore   6,contw
+	fetch    6,mem_lap
+	istore   6,contw
+	fetch    3,mem_lmp_io_cap_payload_iocap
+	istore   3,contw 
+
+	call     function_f3b
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_CONFIRM_CALC,sp_confirm_calc_master
+	jam      SP_STAT_CONFIRM_SEND,mem_sp_state
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	rtn
+sp_confirm_calc_master:
+	jam      SP_STAT_CONFIRM_SEND,mem_master_sp_state
+	jam      SP_FLAG_COMMIT,mem_master_sp_flag
+	rtn   
+
+sp_master_key_prarm_push:
+	arg mem_sp_prarm_stack,contw
+	fetch    6,mem_plap
+	istore   6,contw
+	fetch    6,mem_lap
+	istore   6,contw
+	setarg mem_sp_random_local_end
+	istore 2,contw
+	setarg mem_sp_random_remote_end
+	istore 2,contw
+	branch sp_link_key_calc
+sp_link_key_prarm_push:
+	jam      SP_STAT_DONE,mem_sp_state    
+	arg mem_sp_prarm_stack,contw
+	fetch    6,mem_lap
+	istore   6,contw
+	fetch    6,mem_plap
+	istore   6,contw
+	setarg mem_sp_random_remote_end
+	istore 2,contw
+	setarg mem_sp_random_local_end
+	istore 2,contw
+sp_link_key_calc:
+    /*calculate Link key here */
+	arg      mem_addr_value,contw
+	fetch    6,mem_sp_prarm_stack
+	istore   6,contw
+	fetch    6,mem_sp_prarm_stack+6
+	istore   6,contw
+	
+	call     function_f2    
+
+	/*handle linkkey  */
+	jam 1,mem_link_key_exists
+	arg mem_link_key,contw
+	arg mem_sp_calc_result_high,contr
+	call memcpy16
+	branch  generate_linkkey_continue
+
+//FF18A5F4EFD25E622B140CCFD6F15D0027DC8D91865F9107
+sp_debug_private:
+  	arg mem_sp_private_key,contw
+        setsect 0,0x118ff
+        setsect 1,0x3fd29
+        setsect 2,0x1ed2e
+        setsect 3,0xad89
+        istore 9,contw
+        setsect 0,0x30c14
+        setsect 1,0x75b3
+        setsect 2,0x5df
+        setsect 3,0x3709c
+        istore 9,contw
+        setsect 0,0x2918d
+        setsect 1,0x57e1
+        setsect 2,0x79
+        istore 6,contw
+        rtn
+	
+    
+sp_pubkey_calc:
+	bpatchx patch2f_2,mem_patch2f
+	fetch    1,mem_sp_local_key_invalid
+	rtnne SP_KEY_INVALID
+	fetch    1,mem_sp_calc
+	rtnne  SP_CALC_STANDBY
+//	call init_memp
+	arg      mem_sp_private_key,contw 
+	force    11,queue
+	call     random_generator
+	random   pdata
+	rshift   pdata,pdata
+	istore   2,contw 
+
+	fetch 1,mem_sp_debug_mode
+	ncall sp_debug_private,blank
+	 
+	arg      mem_k,contw
+	arg      mem_sp_private_key,contr	
+	call     memcpy24 //mem_sp_private_key=>mem_k 24BYTES
+
+	arg      mem_ax,contw
+	arg      mem_gx,contr
+	call     memcpy48 //mem_gx=>mem_ax 48bytes
+
+	arg      mem_az,contw
+	call     bn_zero
+	jam      1,mem_az //0=>mem_az 24bytes
+
+	call     eckp_calc_init
+	jam SP_CALC_PUBKEY,mem_sp_calc
+	rtn    
+	
+sp_pubkey_generated:
+	arg      mem_sp_pubkey_local,contw
+	arg      mem_bx,contr
+	call     memcpy48   
+	jam      SP_KEY_VALID,mem_sp_local_key_invalid
+	jam      SP_CALC_STANDBY,mem_sp_calc
+	rtn
+
+sp_dhkey_calc:
+	bpatchx patch2f_3,mem_patch2f
+	fetch    1,mem_sp_dhkey_invalid
+	rtnne  SP_KEY_INVALID
+	fetch    1,mem_sp_calc
+	rtnne  SP_CALC_STANDBY
+
+	arg      mem_k,contw
+	arg      mem_sp_private_key,contr	
+	call     memcpy24
+
+	arg      mem_ax,contw
+	arg      mem_sp_pubkey_remote,contr
+	call     memcpy48
+
+	arg      mem_az,contw
+	call     bn_zero
+	jam      1,mem_az
+
+	call     eckp_calc_init
+	jam      SP_CALC_DHKEY,mem_sp_calc
+	rtn 	
+	
+sp_dhkey_generated:
+	jam SP_FLAG_COMMIT,mem_sp_dh_ready
+	arg mem_sp_dhkey,contw
+	arg mem_bx,contr
+	call memcpy24
+	jam SP_KEY_VALID,mem_sp_dhkey_invalid
+	jam SP_CALC_STANDBY,mem_sp_calc
+	rtn
+
+random_generator:
+	increase -1,queue
+	nrtn     positive
+	random   pdata
+	istore   2,contw  
+	branch   random_generator
+compare4:
+	increase -1,queue
+	nbranch  compare4_success,positive
+	ifetch   4,rega
+	copy     pdata,temp
+	ifetch   4,regb
+	iflip    temp,pdata
+	nbranch  compare4_failed,zero
+	increase 4,rega
+	increase 4,regb
+	branch   compare4
+compare4_failed:
+	disable  true
+	rtn
+compare4_success:
+	enable   true
+	rtn
+
+/*************************************************/
+/** Message state machine routines ***************/
+/*************************************************/
+// simple pairing support 
+
+simple_pairing_sequence:
+	bpatchx patch2f_4,mem_patch2f
+         fetch 1,mem_sp_flag
+         rtn blank
+	call lmo_fifo_check
+	nrtn blank
+	jam      SP_FLAG_STANDBY,mem_sp_flag
+	fetch    1,mem_sp_state
+	beq  SP_STAT_KEY_SEND,sp_send_LMP_ENCAPSULATED_HEADER
+	beq  SP_STAT_COMMIT_SEND,sp_send_LMP_SIMPLE_PAIRING_COMFIRM
+	beq  SP_STAT_RANDOM_SEND,sp_send_LMP_SIMPLE_PAIRING_NUMBER
+	beq  SP_STAT_CONFIRM_SEND,sp_send_LMP_DHKEY_CHECK
+	beq  SP_STAT_KEY_GENERATE,sp_generate_local_key
+	beq  SP_STAT_COMMIT_CALC,sp_calculate_commitment
+	beq  SP_STAT_CONFIRM_CHECK,sp_confirm_check
+	beq  SP_STAT_CONFIRM_CALC,sp_confirm_calc
+	beq  SP_STAT_LINK_KEY_CALC,sp_link_key_prarm_push
+	//beq  SP_STAT_FEATURE_EXT_SEND,send_LMP_FEATURES_REQ_EXT
+	rtn  
+
+master_simple_paring_sequence:
+	bpatchx patch2f_5,mem_patch2f
+	fetch 1,mem_master_sp_flag
+	rtn blank
+	call lmo_fifo_check
+	nrtn blank
+	jam SP_FLAG_STANDBY,mem_master_sp_flag
+	fetch 1,mem_master_sp_state
+	beq SP_MASTER_STAT_START_SKIP,sp_master_send_io_cap_get
+	beq SP_MASTER_STAT_START_DONE,sp_master_send_io_cap_send
+	beq SP_STAT_KEY_SEND,sp_master_send_LMP_ENCAPSULATED_HEADER
+	beq SP_STAT_COMMIT_CALC,master_sp_calculate_commitment
+	beq SP_STAT_COMMITMENT_COMPARE,sp_master_commitment_compare
+	beq SP_STAT_RANDOM_SEND,sp_master_send_LMP_SIMPLE_PAIRING_NUMBER
+	beq SP_STAT_CONFIRM_CALC,sp_confirm_calc
+	beq SP_STAT_CONFIRM_SEND,master_sp_send_lmp_dhkey_check
+	beq SP_STAT_CONFIRM_CHECK,sp_confirm_check
+	beq SP_STATE_END,master_sp_sm_end
+	rtn
+
+master_set_mem_master_sp_flag:
+	jam SP_FLAG_COMMIT,mem_master_sp_flag
+	rtn
+	
+master_clear_mem_master_sp_flag:
+	jam SP_FLAG_STANDBY,mem_master_sp_flag
+	rtn
+sp_calc_sequence:
+	bpatchx patch2f_6,mem_patch2f
+	fetch 1,mem_ssp_enable
+	rtn blank
+	fetch 1,mem_sp_calc
+	rtn blank
+	increase 0x80,pdata
+	store    1,mem_sp_calc
+	rtnbit1 7
+	fetch    1,mem_ec_loopc
+	branch   sp_calc_sequence_done,blank
+	branch   eckp_calc
+
+sp_calc_sequence_done:    
+	call ecunmapz
+	fetch 1,mem_sp_calc
+	beq  SP_CALC_PUBKEY,sp_pubkey_generated
+	beq  SP_CALC_DHKEY,sp_dhkey_generated
+	rtn
+
+
+bn_testbit:
+	and pdata,7,queue
+	rshift3 pdata,pdata
+	iadd contr,contr
+	ifetch 1,contr
+	qisolate0 pdata
+	rtn
+
+
+ec_copy:
+	call memcpy24
+	call memcpy24
+	branch memcpy24
+	
+	
+bn_eq_zero:
+	ifetch 8,contr
+	nrtn blank
+	ifetch 8,contr
+	nrtn blank
+	ifetch 8,contr
+	rtn
+	
+	
+	/* return zero if eq */
+
+bn_eq_0:	
+	ifetch 4,rega
+	iforce temp
+	ifetch 4,regb
+	isub temp,null
+	nrtn zero
+	increase 4,rega
+	increase 4,regb
+	loop bn_eq_0
+	rtn
+
+	/* return positive if A >= B */
+bn_bigeq:
+	force 6,loopcnt
+	increase 20,rega
+	increase 20,regb
+bn_bigeq_0:	
+	ifetch 4,regb
+	iforce temp
+	ifetch 4,rega
+	isub temp,pdata
+	nrtn positive
+	nrtn blank
+	increase -4,rega
+	increase -4,regb
+	loop bn_bigeq_0
+	rtn
+
+bn_add:
+	force 6,loopcnt
+	force 0,regc
+bn_add_0:	
+	ifetch 4,rega
+	iforce temp
+	ifetch 4,regb
+	iadd temp,pdata
+	iadd regc,pdata
+	istore 4,contw
+	isolate1 32,pdata
+	setflag true,0,regc
+	increase 4,rega
+	increase 4,regb
+	loop bn_add_0
+	rtn
+
+bn_sub:
+	force 6,loopcnt
+	force 0,regc
+bn_sub_0:	
+	ifetch 4,regb
+	iforce temp
+	ifetch 4,rega
+	isub temp,pdata
+	isub regc,pdata
+	istore 4,contw
+	isolate1 32,pdata
+	setflag true,0,regc
+	increase 4,rega
+	increase 4,regb
+	loop bn_sub_0
+	rtn
+
+bn_rshift6:
+	force 6,loopcnt
+	increase 20,rega
+bn_rshift:
+	force 0,regc
+bn_rshift_0:	
+	ifetch 4,rega
+	isolate1 0,pdata
+	setflag true,1,regc
+	rshift pdata,pdata
+	isolate1 0,regc
+	setflag true,31,pdata
+	istore 4,rega
+	increase -4,rega
+	rshift regc,regc
+	loop bn_rshift_0
+	rtn
+
+bn_lshift:
+	force 6,loopcnt
+	force 0,regc
+bn_lshift_0:	
+	ifetch 4,rega
+	isolate1 31,pdata
+	setflag true,1,regc
+	lshift pdata,pdata
+	isolate1 0,regc
+	setflag true,0,pdata
+	istore 4,rega
+	increase 4,rega
+	rshift regc,regc
+	loop bn_lshift_0
+	rtn
+	
+bn_lshiftmod:
+	call bn_lshift
+bn_lshiftmod_ismod:	
+	isolate1 0,regc
+	branch bn_lshiftmod_0,true
+	arg mem_p,regb
+	copy rega,regc
+	increase -24,rega
+	call bn_bigeq
+	nrtn positive
+	copy regc,rega
+bn_lshiftmod_0:
+	increase -24,rega
+	arg mem_p,regb
+	copy rega,contw
+	branch bn_sub
+	
+
+bn_addmod:
+	call bn_add
+	copy contw,rega
+	branch bn_lshiftmod_ismod
+	
+bn_submod:
+	call bn_sub
+	isolate0 0,regc
+	rtn true
+	arg mem_p,regb
+	add contw,-24,rega
+	copy rega,contw
+	branch bn_add
+	
+
+bn_p192mod:
+	copy contw,timeup				/* save result ptr */
+	copy rega,alarm				/* temp save rega */
+	arg mem_tmp2,regb
+	copy regb,contw
+	add rega,24,contr
+	ifetch 8,contr
+	istore 8,contw
+	istore 8,contw
+	force 0,pdata
+	istore 8,contw
+	copy timeup,contw
+	call bn_addmod
+	arg mem_tmp2,regb
+	copy regb,contw
+	force 0,pdata
+	istore 8,contw
+	add alarm,32,contr
+	ifetch 8,contr
+	istore 8,contw
+	istore 8,contw
+	copy timeup,rega
+	copy rega,contw
+	call bn_addmod
+	arg mem_tmp2,regb
+	copy regb,contw
+	add alarm,40,contr
+	ifetch 8,contr
+	istore 8,contw
+	istore 8,contw
+	istore 8,contw
+	copy timeup,rega
+	copy rega,contw
+	branch bn_addmod
+		
+
+bn_load:
+	force 6,loopcnt
+bn_load_0:	
+	ifetch 4,contr
+	iforce regext
+	increase 1,regext_index
+	loop bn_load_0
+	rtn
+
+
+	/* cost 1562 clks */	
+bn_mulmod:
+	copy contw,timeup					/* save result ptr */
+	arg mem_tmp1,contw
+	call bn_zero
+	arg mem_tmp1,contw
+	copy rega,contr
+	force 0,regext_index
+	call bn_load
+	copy regb,contr
+	call bn_load
+	force 0,regb
+bn_mulmod_1:	
+	force 0,temp
+	force 6,regc
+bn_mulmod_0:
+	ifetch 4,contw					/* d[i+j] */
+	iforce rega
+	copy regb,regext_index
+	deposit regext
+	copy regc,regext_index
+	imul32 regext,pdata
+	iadd rega,pdata					/* uv = a[i]*b[j] + d[i+j] */
+	iadd temp,pdata					/* uv += u */
+	istore 4,contw					/* ->d[i+j] */
+	rshift32 pdata,temp				/* temp = u = uv >> 32 */
+	increase 1,regc
+	compare 12,regc,0xff
+	nbranch bn_mulmod_0,true
+	deposit temp
+	istore 4,contw					/* d[i + 12] = u */
+	increase -24,contw
+	increase 1,regb
+	compare 6,regb,0xff
+	nbranch bn_mulmod_1,true
+	arg mem_tmp1,rega
+	copy timeup,contw
+	branch bn_p192mod
+
+	
+bn_sqrmod:
+	copy rega,regb
+	branch bn_mulmod
+
+bn_rshifteven:
+	copy rega,alarm
+bn_rshifteven_1:
+	copy alarm,rega
+	ifetch 1,rega
+	isolate1 0,pdata
+	rtn true
+	call bn_rshift6
+	ifetch 1,regb
+	isolate0 0,pdata
+	branch bn_rshifteven_0,true
+	arg mem_p,rega
+	copy regb,contw
+	call bn_add
+	ifetch 1,regb
+	iadd regc,pdata
+	istore 1,regb						/* [6] */
+	increase -24,regb
+bn_rshifteven_0:
+	add regb,24,rega
+	force 7,loopcnt
+	call bn_rshift
+	branch bn_rshifteven_1
+
+	/* cost 141910 clks */
+bn_invmod:
+	copy contw,timeup					/* save result ptr */
+	arg mem_tmp0,contw				/* x */
+	call bn_zero
+	force 0,pdata
+	store 4,mem_tmp5
+	store 4,mem_t2
+	jam 1,mem_tmp0
+	arg mem_tmp1,contw				/* y */
+	call bn_zero
+	arg mem_p,contr
+	arg mem_tmp2,contw				/* a */
+	call memcpy24
+	copy rega,contr
+	arg mem_tmp3,contw				/* b */
+	call memcpy24
+bn_invmod_2:	
+	arg mem_tmp3,contr
+	call bn_eq_zero
+	branch bn_invmod_0,blank
+	arg mem_tmp3,rega
+	arg mem_tmp0,regb
+	call bn_rshifteven
+
+	arg mem_tmp2,rega
+	arg mem_tmp1,regb
+	call bn_rshifteven
+	arg mem_tmp3,rega
+	arg mem_tmp2,regb
+	call bn_bigeq
+	branch bn_invmod_1,positive
+	arg mem_tmp2,rega
+	arg mem_tmp3,regb
+	copy rega,contw
+	call bn_sub
+	arg mem_tmp0,rega
+	arg mem_tmp1,regb
+	copy regb,contw
+	call bn_add
+	ifetch 1,rega
+	iadd regc,regc
+	ifetch 1,regb
+	iadd regc,pdata
+	istore 1,regb
+	branch bn_invmod_2
+bn_invmod_1:
+	arg mem_tmp3,rega
+	arg mem_tmp2,regb
+	copy rega,contw
+	call bn_sub
+	arg mem_tmp1,rega
+	arg mem_tmp0,regb
+	copy regb,contw
+	call bn_add
+	ifetch 1,rega
+	iadd regc,regc
+	ifetch 1,regb
+	iadd regc,pdata
+	istore 1,regb
+	branch bn_invmod_2
+bn_invmod_0:
+	arg mem_tmp0,contw
+	call bn_zero
+	fetch 1,mem_tmp5
+	store 1,mem_tmp0
+	store 1,mem_tmp0a
+	arg mem_tmp0,rega
+	arg mem_tmp1,regb
+	copy regb,contw
+	call bn_addmod
+	arg mem_p,rega
+	arg mem_tmp1,regb
+	copy timeup,contw
+	branch bn_submod
+	
+
+
+	/* cost 64742 clks */
+ecdbl:
+	arg mem_cz,rega
+	arg mem_t2,contw
+	call bn_sqrmod
+	arg mem_t2,rega
+	arg mem_t3,contw
+	call bn_sqrmod
+	arg mem_a,rega
+	arg mem_t3,regb
+	arg mem_t3,contw
+	call bn_mulmod		/* t3=a*z4	*/
+	arg mem_cx,rega
+	arg mem_t2,contw
+	call bn_sqrmod
+	arg mem_t2,contr
+	arg mem_t1,contw
+	call memcpy24
+	arg mem_t1,rega
+	call bn_lshiftmod
+	arg mem_t2,rega
+	arg mem_t1,regb
+	arg mem_t2,contw
+	call bn_addmod
+	arg mem_t2,rega
+	arg mem_t3,regb
+	arg mem_t2,contw
+	call bn_addmod		/* t2=3*x2 + z*z4		D  */
+	arg mem_cx,contr
+	arg mem_t1,contw
+	call memcpy24
+	arg mem_cy,rega
+	arg mem_t3,contw
+	call bn_sqrmod
+	arg mem_t1,rega
+	call bn_lshiftmod
+	arg mem_t1,rega
+	call bn_lshiftmod
+	arg mem_t1,rega		
+	arg mem_t3,regb
+	arg mem_t1,contw
+	call bn_mulmod		/* t1=4x*y2	B	*/
+	arg mem_t3,rega
+	arg mem_t0,contw
+	call bn_sqrmod
+	arg mem_t0,rega
+	call bn_lshiftmod
+	arg mem_t0,rega
+	call bn_lshiftmod		
+	arg mem_t0,rega		
+	call bn_lshiftmod		/* t0=8*y4		C */
+	arg mem_cy,contr
+	arg mem_t3,contw
+	call memcpy24
+	arg mem_t3,rega
+	call bn_lshiftmod
+	arg mem_t3,rega
+	arg mem_cz,regb
+	arg mem_cz,contw
+	call bn_mulmod		
+	arg mem_t2,rega
+	arg mem_t3,contw
+	call bn_sqrmod
+	arg mem_t3,rega
+	arg mem_t1,regb
+	arg mem_t3,contw
+	call bn_submod
+	arg mem_t3,rega
+	arg mem_t1,regb
+	arg mem_cx,contw
+	call bn_submod
+	arg mem_t1,rega
+	arg mem_cx,regb
+	arg mem_t3,contw
+	call bn_submod
+	arg mem_t3,rega
+	arg mem_t2,regb
+	arg mem_t3,contw
+	call bn_mulmod		
+	arg mem_t3,rega
+	arg mem_t0,regb
+	arg mem_cy,contw
+	branch bn_submod
+	
+
+	/* cost 104904	clks */
+ecadd:
+	arg mem_az,rega
+	arg mem_t7,contw
+	call bn_sqrmod
+	arg mem_cx,rega
+	arg mem_t7,regb
+	arg mem_t0,contw
+	call bn_mulmod		/* n1=t0=xa*zb2  */
+	arg mem_az,rega
+	arg mem_t7,regb
+	arg mem_t7,contw
+	call bn_mulmod	
+	arg mem_cy,rega
+	arg mem_t7,regb
+	arg mem_t1,contw
+	call bn_mulmod		/* n2=t1=ya*zb3 */
+	arg mem_cz,rega
+	arg mem_t7,contw
+	call bn_sqrmod
+	arg mem_ax,rega
+	arg mem_t7,regb
+	arg mem_t2,contw
+	call bn_mulmod		/* n3=t2=xb*za2 */
+	arg mem_cz,rega
+	arg mem_t7,regb
+	arg mem_t7,contw
+	call bn_mulmod	
+	arg mem_ay,rega
+	arg mem_t7,regb
+	arg mem_t3,contw
+	call bn_mulmod		/* n4=t3=yb*za3 */
+	arg mem_t0,rega
+	arg mem_t2,regb
+	arg mem_t7,contw
+	call bn_submod		/* n5=t7=n1-n3=t0-t2 */
+	arg mem_t0,rega
+	arg mem_t2,regb
+	arg mem_t0,contw
+	call bn_addmod		/* n7=t0=n1+n3=t0+t2 */
+	arg mem_t1,rega
+	arg mem_t3,regb
+	arg mem_t2,contw
+	call bn_submod		/* n6=t2=n2-n4=t1-t3 */
+	arg mem_t1,rega
+	arg mem_t3,regb
+	arg mem_t1,contw
+	call bn_addmod		/* n8=t1=n2+n4=t1+t3 */
+	arg mem_t1,rega
+	arg mem_t7,regb
+	arg mem_t1,contw
+	call bn_mulmod		/* t1=n8*n5 */
+	arg mem_cz,rega
+	arg mem_az,regb
+	arg mem_t3,contw
+	call bn_mulmod	
+	arg mem_t3,rega
+	arg mem_t7,regb
+	arg mem_cz,contw
+	call bn_mulmod		/* z=za*zb*n5 */
+	arg mem_t7,rega
+	arg mem_t7,contw
+	call bn_sqrmod		/* t7=n5^2 */
+	arg mem_t7,rega
+	arg mem_t0,regb
+	arg mem_t3,contw
+	call bn_mulmod		/* t3=n5^2*n7 */
+	arg mem_t7,rega
+	arg mem_t1,regb
+	arg mem_t1,contw
+	call bn_mulmod		/* t1=n8*n5^3 */
+	arg mem_t2,rega
+	arg mem_cx,contw
+	call bn_sqrmod		
+	arg mem_cx,rega
+	arg mem_t3,regb
+	arg mem_cx,contw
+	call bn_submod		/* x=n6^2-n5^2*n7 */
+	arg mem_cx,contr
+	arg mem_t7,contw
+	call memcpy24
+	arg mem_t7,rega
+	call bn_lshiftmod		/* t7=2*x */
+	arg mem_t3,rega
+	arg mem_t7,regb
+	arg mem_t3,contw
+	call bn_submod		/* t3=n9 */
+	arg mem_t3,rega
+	arg mem_t2,regb
+	arg mem_t2,contw
+	call bn_mulmod		/* t2=n9*n6 */
+	arg mem_t2,rega
+	arg mem_t1,regb
+	arg mem_cy,contw
+	call bn_submod	
+	arg mem_cy,rega
+	arg mem_p,regb
+	arg mem_cy,contw
+	force 0,regc
+	fetch 1,mem_cy
+	isolate1 0,pdata
+	call bn_add,true
+	copy regc,alarm
+	arg mem_cy,rega
+	call bn_rshift6
+	fetch 1,mem_cy5
+	isolate1 0,alarm
+	setflag true,7,pdata
+	store 1,mem_cy5
+	rtn
+
+	/* cost 22276983 clks */
+
+eckp_0:	
+	fetch 1,mem_ec_loopc
+	increase -1,pdata
+	nrtn positive
+	store 1,mem_ec_loopc
+	fetch 1,mem_ec_infinite
+	call ecdbl,blank
+	fetch 1,mem_ec_loopc
+	arg mem_k,contr
+	call bn_testbit
+	branch eckp_0,true
+	fetch 1,mem_ec_infinite
+	nbranch eckp_1,blank
+	call ecadd
+	branch eckp_0
+eckp_1:
+	jam 0,mem_ec_infinite
+	arg mem_ax,contr
+	arg mem_cx,contw
+	call ec_copy
+	branch eckp_0
+
+	/* cost 162522 clks */
+ecunmapz:
+	arg mem_cz,rega
+	arg mem_t3,contw
+	call bn_invmod			/* t3 = 1/z */
+	arg mem_t3,rega
+	arg mem_t1,contw		
+	call bn_sqrmod			/* t1 = 1/z2 */
+	arg mem_cx,rega
+	arg mem_t1,regb
+	arg mem_bx,contw
+	call bn_mulmod
+	arg mem_t3,rega
+	arg mem_t1,regb
+	arg mem_t2,contw			
+	call bn_mulmod			/* t2 = 1/z3 */
+	arg mem_cy,rega
+	arg mem_t2,regb
+	arg mem_by,contw
+	branch bn_mulmod		
+	
+	
+
+sha_endian_swap2:	
+	ifetch 4,contr
+	force 4,rega
+	increase 3,contw
+sha_endian_loop:	
+	istore 1,contw
+	rshift8 pdata,pdata
+	increase -2,contw
+	increase -1,rega
+	nbranch sha_endian_loop,zero
+	increase 5,contw
+	loop sha_endian_swap2
+	rtn	
+
+
+sha_getw:
+	lshift2 queue,pdata
+	iadd timeup,contr
+	ifetch 4,contr
+	rtn
+	
+sha_r:
+	force 16,alarm
+	arg memdat,timeup
+sha_r_loop:	
+	add alarm,-7,queue
+	call sha_getw
+	iforce temp						/* W[t - 7] */
+	add alarm,-16,queue
+	call sha_getw
+	iadd temp,temp					/* W[t-7] + W[t-16] */
+	add alarm,-2,queue
+	call sha_getw
+	shasx pdata,1,pdata
+	iadd temp,temp					/* S1(W[t -  2]) + W[t-7] + W[t-16] */
+	add alarm,-15,queue
+	call sha_getw
+	shasx pdata,0,pdata
+	iadd temp,temp					/* S0(W[t - 15]) + S1(W[t -  2]) + W[t-7] + W[t-16] */
+	lshift2 alarm,pdata
+	iadd timeup,contw
+	istoret 4,contw
+	increase 1,alarm
+	compare 64,alarm,0xff
+	nbranch sha_r_loop,true
+	rtn
+	
+
+sha_init:
+	arg memh0,contr
+	force 7,regext_index
+sha_init_0:	
+	ifetch 4,contr
+	iforce regext
+	increase -1,regext_index
+	branch sha_init_0,positive
+	rtn
+
+sha:
+	bpatchx patch2f_7,mem_patch2f
+	call sha_r		/* preprocessing data into R() */
+	arg memahbak,contw
+	force 0,regext_index
+sha_0:	
+	deposit regext
+	istore 4,contw
+	increase 1,regext_index
+	compare 8,regext_index,0xff
+	nbranch sha_0,true
+	call enable_authrom
+	arg memk,timeup
+	arg memdat,alarm
+	force 64,loopcnt
+sha_loop:	
+	ifetcht 4,alarm
+	ifetch 4,timeup
+	increase 4,timeup
+	increase 4,alarm
+	iadd temp,pdata			/* x+K */
+	force 7,regext_index
+	iadd regext,temp			/* x+K+h */
+	force 4,regext_index
+	shasx regext,3,pdata
+	iadd temp,temp			/* temp = s3(e)+x+K+h */
+	force 5,regext_index
+	deposit regext
+	force 6,regext_index
+	ixor regext,pdata
+	force 4,regext_index
+	iand regext,pdata			/* (e & (f ^ g)) */
+	force 6,regext_index
+	ixor regext,pdata			/* F1(e, f, g) = g ^ (e & (f ^ g)) */
+	iadd temp,temp			/* temp1 = h + S3(e) + F1(e,f,g) + K + x */
+	force 7,regext_index
+	copy temp,regext			/* save to H */
+	force 3,regext_index
+	deposit regext
+	iadd temp,regext			/* save to D */
+	force 0,regext_index
+	deposit regext
+	force 1,regext_index
+	iand regext,temp			/* a & b */
+	ior regext,pdata			/* a | b */			
+	force 2,regext_index
+	iand regext,pdata			/* (c & (a | b)) */
+	ior temp,temp				/* F0:(a & b) | (c & (a | b)) */
+	force 0,regext_index
+	shasx regext,2,pdata
+	iadd temp,pdata			/* temp2 = S2(a) + F0(a,b,c) */
+	force 7,regext_index
+	iadd regext,regext			/* h = temp1 + temp2 */
+	regexrot					/* rotate move h,a-g => a-h */
+	loop sha_loop
+	arg memahbak,contr
+	force 0,regext_index
+sha_1:	
+	ifetch 4,contr
+	iadd regext,regext
+	increase 1,regext_index
+	compare 8,regext_index,0xff
+	nbranch sha_1,true
+	branch disable_authrom
+
+	
+sha_result:
+	arg   memresult,contw
+	force 7,regext_index
+sha_regext_save:
+	deposit regext
+	istore  4,contw 
+	increase -1,regext_index
+	branch   sha_regext_save,positive
+	rtn	
+
+pad_xor:
+//	arg memx_end,contr
+	arg      memdat,contw
+	increase -4,contr
+	sub      loopcnt,16,rega
+pad_xor_0:	    
+	ifetch   4,contr
+	ixor     temp,pdata
+	istore   4,contw	
+	increase -8,contr	
+	loop  pad_xor_0
+	copy     rega,loopcnt
+	deposit  temp
+pad_xor_1:	
+	istore 4,contw
+	loop pad_xor_1
+	rtn
+
+g_noninit_number_confirm:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,g_noninit_number_confirm_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,g_noninit_number_confirm_192
+	rtn
+
+g_noninit_number_confirm_192:	
+	call g_noninit0_192
+	call sha_result
+	branch g_common0
+
+g_noninit_number_confirm_256:	
+	call g_noninit0_256
+	call sha_result
+	branch g_common0
+
+g_noninit_192:
+	call g_noninit0_192
+	branch g_common0
+	
+g_noninit0_192:
+ 	arg      mem_sp_pubkey_remote_x_end,contr
+	arg      memdat,contw
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sp_pubkey_local_x_end,contr
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sp_random_remote_end,contr
+	call     memcpy_dword_swap4
+	call     sha_init
+	call     sha	
+ 	arg      mem_sp_random_local_end,contr
+	arg      memdat,contw
+	branch g_common_192
+	
+g_init_192:
+ 	arg      mem_sp_pubkey_local_x_end,contr
+	arg      memdat,contw
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sp_pubkey_remote_x_end,contr
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sp_random_local_end,contr
+	call     memcpy_dword_swap4
+	call     sha_init
+	call     sha	
+ 	arg      mem_sp_random_remote_end,contr
+	arg      memdat,contw
+	call g_common_192
+	branch g_common0
+	
+g_common_192:	
+	call     memcpy_dword_swap4
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	force    5,loopcnt
+	call memset0
+	setarg 640
+	istore 4,contw
+	branch sha
+g_common0:
+	fetch 4,memresult
+//	store 4,mem_gkey
+	arg 1000,rega
+	idiv rega
+	call wait_div_end
+	remainder pdata
+	store 4,mem_gkey
+	quotient pdata
+	arg 1000,rega
+	idiv rega
+	call wait_div_end
+	remainder pdata
+	arg 1000,rega
+	imul32 rega,pdata
+	fetcht 4,mem_gkey
+	iadd temp,pdata
+	store 4,mem_gkey
+	rtn
+	
+noninit_number_confirm:
+	call g_noninit0_256
+	call sha_result
+	branch g_common0
+
+	
+g_noninit0_256:
+ 	arg      mem_le_pubkey_remote_x_256+32,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sc_pubkey_local_x_256+32,contr
+	force    8,loopcnt
+	call     memcpy_dword_swap
+//	arg      mem_sp_random_remote_end,contr
+//	call     memcpy_dword_swap4
+	call     sha_init
+	call     sha	
+ 	arg      mem_sp_random_remote_end,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	arg      mem_sp_random_local_end,contr
+	branch g_common_256
+	
+g_common_256:	
+	call     memcpy_dword_swap4
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	force    3,loopcnt
+	call memset0
+	setarg 768
+	istore 4,contw
+	branch sha
+
+function_f1_192_no_key:
+	jam 0,mem_passkey_1bit
+	branch function_f1_192_common
+	
+function_f1_192:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f1_192_no_key
+function_f1_192_common:
+	bpatchx patch30_0,mem_patch30
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	fetch 2,mem_sp_prarm_stack
+	copy pdata,contr
+	force    4,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	fetch 2,mem_sp_prarm_stack+2
+	copy pdata,contr
+	arg      memdat,contw
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	fetch 2,mem_sp_prarm_stack+4
+	copy pdata,contr
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	istore   3,contw
+	
+	fetch 1,mem_passkey_1bit
+	
+	istore   1,contw
+	force    0,pdata
+	istore   8,contw
+	setarg   0x0388
+	istore   4,contw
+function_f1_common2:	
+	call     sha
+	call     sha_result
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	fetch 2,mem_sp_prarm_stack
+	copy pdata,contr
+	force    4,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      memahsave_end,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	call		bn_zero
+	setarg   0x0300
+	istore   4,contw
+	call     sha
+	branch     sha_result
+	
+	
+function_f2_192:
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	fetch 2,mem_sp_prarm_stack+12
+	copy pdata,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	fetch 2,mem_sp_prarm_stack+14
+	copy pdata,contr
+	call     memcpy_dword_swap4
+
+	setarg   0x62746c
+	lshift8  pdata,pdata
+	or_into       0x6b,pdata       
+	istore   4,contw
+	arg      mem_addr_value_end,contr
+	force    3,loopcnt
+	call     memcpy_dword_swap
+	
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	force    0,pdata
+	istore   8,contw
+	setarg   0x0380
+	istore   4,contw
+	call     sha
+
+	call     sha_result
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_sp_dhkey_end,contr 
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      memahsave_end,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	call bn_zero
+	setarg   0x0300
+	istore   4,contw
+	call     sha
+	branch     sha_result
+	
+
+function_f3a_192:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f3a_no_pin
+function_f3a_common:
+	bpatchx patch30_1,mem_patch30
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      mem_sp_random_remote_end,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	arg      mem_sp_random_local_end,contr
+	call     memcpy_dword_swap4
+	branch function_f3_common
+
+function_f3a_no_pin:
+	setarg 0
+	store 4,mem_pin
+	branch function_f3a_common
+
+function_f3b_no_pin:
+	setarg 0
+	store 4,mem_pin
+	branch function_f3b_common
+
+
+function_f3b_192:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f3b_no_pin
+function_f3b_common:
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+
+	arg      mem_sp_random_local_end,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	arg      mem_sp_random_remote_end,contr
+	call     memcpy_dword_swap4
+function_f3_common:    
+	setarg   0x0    
+	istore   8,contw
+	istore   4,contw
+	fetch 4,mem_pin
+	istore   4,contw
+	
+	copy     contw,temp
+	jam      0x80,mem_addr_padding
+	copy     temp,contw
+	arg      mem_addr_iocap_end,contr
+	call     memcpy_dword_swap4
+
+	call     sha
+    
+	arg      memdat,contw
+	force 7,loopcnt
+	call memset0
+	istore   4,contw
+	setarg   0x03F8
+	istore   4,contw
+	call     sha
+	call     sha_result
+	
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_sp_dhkey_end,contr 
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      memahsave_end,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	call bn_zero
+	setarg   0x0300
+	istore   4,contw
+	call     sha	
+	branch     sha_result
+		
+/*
+eckp:
+	jam 192,mem_ec_loopc
+	jam 1,mem_ec_infinite
+*/
+eckp_calc_init:
+	jam      192,mem_ec_loopc
+eckp_calc_init_1:    
+	fetch    1,mem_ec_loopc
+	rtn      blank
+	increase -1,pdata
+	store    1,mem_ec_loopc 	
+	arg      mem_k,contr
+	call     bn_testbit
+	branch eckp_calc_init_1,true
+	arg      mem_ax,contr
+	arg      mem_cx,contw
+	branch     ec_copy	
+	
+eckp_calc:
+	call     ecdbl  
+	fetch    1,mem_ec_loopc
+	increase -1,pdata
+	store    1,mem_ec_loopc
+	arg      mem_k,contr
+	call     bn_testbit
+	rtn	true
+	branch     ecadd                
+	             
+memcpy_dword_swap4:
+	force 4,loopcnt
+memcpy_dword_swap:
+	increase -4,contr
+memcpy_dword_swap_loop:
+	ifetch   4,contr
+	istore   4,contw
+	increase -8,contr
+	loop   memcpy_dword_swap_loop 
+    	rtn
+
+
+function_f1_no_key_256:
+	jam 0,mem_passkey_1bit
+	branch function_f1_common_256
+
+function_f1_256:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f1_no_key_256
+function_f1_common_256:
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	fetch 2,mem_sp_prarm_stack
+	copy pdata,contr
+	force    4,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	fetch 2,mem_sp_prarm_stack+2
+	copy pdata,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	fetch 2,mem_sp_prarm_stack+4
+	copy pdata,contr
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	call     sha
+	arg      memdat,contw	
+	setarg   0x800000
+	istore   3,contw
+	fetch 1,mem_passkey_1bit
+	istore   1,contw
+	arg 7,loopcnt
+	call	memset0
+	
+	setarg   0x0408  //len bit
+	istore   4,contw
+	branch function_f1_common2
+
+function_f3a:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,function_f3a_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,function_f3a_192
+	rtn
+	
+function_f3a_256:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f3a_no_pin_256
+function_f3a_common_256:
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    8,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      mem_sp_random_remote_end,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	arg      mem_sp_random_local_end,contr
+	call     memcpy_dword_swap4
+//	branch function_f3_common
+function_f3_common_256:    
+	setarg   0x0    
+	istore   8,contw
+	istore   4,contw
+	fetch 4,mem_pin
+	istore   4,contw
+	
+	copy     contw,temp
+	jam      0x80,mem_addr_padding
+	copy     temp,contw
+	arg      mem_addr_iocap_end,contr
+	call     memcpy_dword_swap4
+
+	call     sha
+    
+	arg      memdat,contw
+	force 7,loopcnt
+	call memset0
+	istore   4,contw
+	setarg   0x03F8
+	istore   4,contw
+	call     sha
+	call     sha_result
+	
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_sp_dhkey_end,contr 
+	force    8,loopcnt
+sha_end_common:
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      memahsave_end,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	call bn_zero
+	setarg   0x0300
+	istore   4,contw
+	call     sha	
+	branch     sha_result
+	
+
+function_f3a_no_pin_256:
+	setarg 0
+	store 4,mem_pin
+	branch function_f3a_common_256
+
+function_f3b_no_pin_256:
+	setarg 0
+	store 4,mem_pin
+	branch function_f3b_common_256
+
+function_f3b:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,function_f3b_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,function_f3b_192
+	rtn
+
+function_f3b_256:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f3b_no_pin_256
+function_f3b_common_256:
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    8,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+
+	arg      mem_sp_random_local_end,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	arg      mem_sp_random_remote_end,contr
+	call     memcpy_dword_swap4
+	branch function_f3_common_256
+
+
+function_f2:
+	fetch 1,mem_encapsulated_minor_type
+	beq ENCAPSULATED_MINOR_TYPE_P256,function_f2_256
+	beq ENCAPSULATED_MINOR_TYPE_P192,function_f2_192
+	rtn
+	
+function_f2_256:
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    8,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	fetch 2,mem_sp_prarm_stack+12
+	copy pdata,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	fetch 2,mem_sp_prarm_stack+14
+	copy pdata,contr
+	call     memcpy_dword_swap4
+
+	setarg   0x62746c
+	lshift8  pdata,pdata
+	or_into       0x6b,pdata       
+	istore   4,contw
+	arg      mem_addr_value_end,contr
+	force    3,loopcnt
+	call     memcpy_dword_swap
+	
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	force    0,pdata
+	istore   8,contw
+	setarg   0x0380
+	istore   4,contw
+	call     sha
+
+	call     sha_result
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_sp_dhkey_end,contr 
+	force    8,loopcnt
+	branch sha_end_common
+
+
+function_h3:
+	fetch    6,mem_lap
+	store   6,mem_addr_value
+	fetch    6,mem_plap
+	istore   6,contw
+	
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_link_key+16 ,contr
+	force    4,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	setarg   0x627461
+	lshift8  pdata,pdata
+	or_into       0x6b,pdata       
+	store   4,memdat
+	
+	arg      mem_addr_value+12,contr
+	force    3,loopcnt
+	call     memcpy_dword_swap
+	
+	arg mem_ccm_iv+8,contr
+	arg 2,loopcnt
+	call     memcpy_dword_swap
+	
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	arg 4,loopcnt
+	call memset0
+
+	setarg   704
+	istore   4,contw
+	call     sha
+
+	call     sha_result
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_link_key+16,contr 
+	force    4,loopcnt
+	branch sha_end_common
+
+
+function_h4:
+	fetch    6,mem_lap
+	store   6,mem_addr_value
+	fetch    6,mem_plap
+	istore   6,contw
+	
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_link_key+16 ,contr
+	force    4,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	setarg   0x627464
+	lshift8  pdata,pdata
+	or_into       0x6b,pdata       
+	store   4,memdat
+	
+	arg      mem_addr_value+12,contr
+	force    3,loopcnt
+	call     memcpy_dword_swap
+	
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	arg 5,loopcnt
+	call memset0
+
+	setarg   640
+	istore   4,contw
+	call     sha
+
+	call     sha_result
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_link_key+16,contr 
+	force    4,loopcnt
+	branch sha_end_common
+
+
+function_h5:
+	arg mem_sp_calc_result_high,contr
+	arg mem_input_store,contw
+	call memcpy16
+	setarg mem_sp_random_remote+16
+	store 2,mem_sp_prarm_stack
+	setarg mem_random_number+16
+	istore 2,contw
+	
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_input_store+16 ,contr
+	force    4,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+
+	arg memdat,contw
+	fetch 2, mem_sp_prarm_stack
+	copy pdata,contr
+	call     memcpy_dword_swap4
+	fetch 2,     mem_sp_prarm_stack+2
+	copy pdata,contr
+	call     memcpy_dword_swap4
+	
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	
+	arg 3,loopcnt
+	call memset0
+
+	setarg   768
+	istore   4,contw
+	call     sha
+
+	call     sha_result
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_input_store+16,contr 
+	force    4,loopcnt
+	branch sha_end_common
+
+
+
+
+else
+sp_initialize:
+	rtn
+
+endif
+	
+
+ifdef SECURE_CONNECTION
+
+sp_initialize_256:	
+	bpatchx patch30_2,mem_patch30
+	fetch 1,mem_secure_connections_enable
+	nbranch sp_pubkey_calc_256,blank
+//	call sp_clear_flags
+sc_reset:
+	jam SP_CALC_STANDBY,mem_sc_calc
+	jam SP_KEY_INVALID,mem_sc_local_key_invalid
+	rtn
+	
+	
+    	
+sp_wait_pubkey_calc_256_done:
+	fetch 1,mem_secure_connections_enable
+	rtn blank
+	fetch 1,mem_sc_local_key_invalid
+	rtneq SP_KEY_VALID_256
+	call sp_calc_sequence_256
+	branch sp_wait_pubkey_calc_256_done
+
+
+//BD1A3CCD:A6B89958:99B740EB:7B60FF4A:503F10D2:E3B3C974:385FC5A3:D4F6493F
+sp_debug_private_256:
+	arg mem_sc_private_key_256,contw
+        setsect 0,0x1abd
+        setsect 1,0x1b34f
+        setsect 2,0x19b8a
+        setsect 3,0x26562
+        istore 9,contw
+        setsect 0,0x340b7
+        setsect 1,0x1efa
+        setsect 2,0xaff6
+        setsect 3,0xfd41
+        istore 9,contw
+        setsect 0,0x3d210
+        setsect 1,0x26cf8
+        setsect 2,0x3874c
+        setsect 3,0x3157c
+        istore 9,contw
+        setsect 0,0x2d4a3
+        setsect 1,0x3d27d
+        setsect 2,0x3
+        istore 5,contw
+        rtn
+	
+
+sp_pubkey_calc_256:
+	fetch    1,mem_sc_local_key_invalid
+	rtnne SP_KEY_INVALID
+	fetch    1,mem_sc_calc
+	rtnne  SP_CALC_STANDBY
+	call init_memp_256
+	arg      mem_sc_private_key_256,contw 
+	force    15,queue
+	call     random_generator
+	random   pdata
+	rshift   pdata,pdata
+	istore   2,contw 
+	
+	fetch 1,mem_sp_debug_mode
+	ncall sp_debug_private_256,blank
+	
+	arg      mem_k_256,contw
+	arg      mem_sc_private_key_256,contr	
+	call     memcpy32 //mem_sp_private_key=>mem_k 
+
+	arg      mem_ax_256,contw
+	arg      mem_gx_256,contr
+	call     memcpy64 //mem_gx=>mem_ax 
+	
+	arg      mem_az_256,contw
+	call      clear_mem_256
+	jam      1,mem_az_256 //0=>mem_az 
+
+	call     eckp_calc_init_256
+	jam SP_CALC_PUBKEY_256,mem_sc_calc
+	rtn    
+
+sp_pubkey_generated_256:
+	arg      mem_sc_pubkey_local_x_256,contw
+	arg      mem_bx_256,contr
+	call     memcpy64   
+	jam      SP_KEY_VALID_256,mem_sc_local_key_invalid
+	jam      SP_CALC_STANDBY,mem_sc_calc
+	rtn
+	
+
+
+sp_dhkey_calc_256:
+	fetch    1,mem_sp_dhkey_invalid
+	rtnne  SP_KEY_INVALID
+	fetch    1,mem_sc_calc
+	rtnne  SP_CALC_STANDBY
+
+	arg      mem_k_256,contw
+	arg      mem_sc_private_key_256,contr	
+	call     memcpy32
+
+	arg      mem_ax_256,contw
+	arg      mem_le_pubkey_remote_x_256,contr
+	call     memcpy64
+
+	arg      mem_az_256,contw
+	call     clear_mem_256
+	jam      1,mem_az_256 //0=>mem_az 
+
+	call     eckp_calc_init_256
+	jam     SP_CALC_DHKEY_256,mem_sc_calc
+	rtn 
+
+
+sp_dhkey_generated_256:
+//	jam SP_FLAG_COMMIT,mem_sp_dh_ready
+	arg mem_le_dhkey_256,contw
+	arg mem_bx_256,contr
+	call memcpy32
+	jam SP_KEY_VALID_256,mem_sp_dhkey_invalid
+	jam SP_CALC_STANDBY,mem_sc_calc
+	rtn
+
+
+
+sp_calc_sequence_256:
+	fetch 1,mem_secure_connections_enable
+	rtn blank
+	fetch 1,mem_sc_calc
+	rtn blank
+	increase 0x80,pdata
+	store    1,mem_sc_calc
+	rtnbit1 7
+	fetch    2,mem_ec_loopc
+	branch   sp_calc_sequence_done_256,blank
+	branch   eckp_calc_256
+
+sp_calc_sequence_done_256:    
+	bpatchx patch30_3,mem_patch30
+	call ecunmapz_256
+	fetch 1,mem_sc_calc
+	beq  SP_CALC_PUBKEY_256,sp_pubkey_generated_256
+	beq  SP_CALC_DHKEY_256,sp_dhkey_generated_256
+	rtn
+
+
+eckp_calc_256:
+	call     ecdbl_256  
+	fetch    2,mem_ec_loopc
+	increase -1,pdata
+	store    2,mem_ec_loopc
+	arg      mem_k_256,contr
+	call     bn_testbit
+	rtn	true
+	branch     ecadd_256   
+
+eckp_calc_init_256:
+	bpatchx patch30_4,mem_patch30
+	setarg 256
+	store 2,mem_ec_loopc
+eckp_calc_init_256_1:    
+	fetch    2,mem_ec_loopc
+	rtn      blank
+	increase -1,pdata
+	store    2,mem_ec_loopc
+	arg      mem_k_256,contr
+	call     bn_testbit
+	branch eckp_calc_init_256_1,true
+	arg      mem_ax_256,contr
+	arg      mem_cx_256,contw
+	branch     memcpy96	
+
+
+ecunmapz_256:
+	arg mem_cz_256,rega
+	arg mem_t3_256,contw
+	call bn_invmod_256			/* t3 = 1/z */
+	arg mem_t3_256,rega
+	arg mem_t1_256,contw		
+	call bn_sqrmod_256			/* t1 = 1/z2 */
+	arg mem_cx_256,rega
+	arg mem_t1_256,regb
+	arg mem_bx_256,contw
+	call bn_mulmod_256
+	arg mem_t3_256,rega
+	arg mem_t1_256,regb
+	arg mem_t2_256,contw			
+	call bn_mulmod_256			/* t2 = 1/z3 */
+	arg mem_cy_256,rega
+	arg mem_t2_256,regb
+	arg mem_by_256,contw
+	branch bn_mulmod_256	
+	
+ecdbl_256:
+	arg mem_cz_256,rega
+	arg mem_t2_256,contw
+	call bn_sqrmod_256
+	arg mem_t2_256,rega
+	arg mem_t3_256,contw
+	call bn_sqrmod_256
+//call ice_break
+	arg mem_a_256,rega
+	arg mem_t3_256,regb
+	arg mem_t3_256,contw
+	call bn_mulmod_256		/* t3=a*z4	*/
+	arg mem_cx_256,rega
+	arg mem_t2_256,contw
+	call bn_sqrmod_256
+//call ice_break
+	arg mem_t2_256,contr
+	arg mem_t1_256,contw
+	call memcpy32
+	arg mem_t1_256,rega
+	call bn_lshiftmod_256
+	arg mem_t2_256,rega
+	arg mem_t1_256,regb
+	arg mem_t2_256,contw
+	call bn_addmod_256
+//call ice_break
+	arg mem_t2_256,rega
+	arg mem_t3_256,regb
+	arg mem_t2_256,contw
+	call bn_addmod_256		/* t2=3*x2 + z*z4		D  */
+//call ice_break
+	arg mem_cx_256,contr
+	arg mem_t1_256,contw
+	call memcpy32
+	arg mem_cy_256,rega
+	arg mem_t3_256,contw
+	call bn_sqrmod_256
+	arg mem_t1_256,rega
+	call bn_lshiftmod_256
+	arg mem_t1_256,rega
+	call bn_lshiftmod_256
+	arg mem_t1_256,rega		
+	arg mem_t3_256,regb
+	arg mem_t1_256,contw
+	call bn_mulmod_256		//S = 4X1Y1^2/* t1=4x*y2	B	*/
+	arg mem_t3_256,rega
+	arg mem_t0_256,contw
+	call bn_sqrmod_256
+	arg mem_t0_256,rega
+	call bn_lshiftmod_256
+	arg mem_t0_256,rega
+	call bn_lshiftmod_256		
+	arg mem_t0_256,rega		
+	call bn_lshiftmod_256	//T = 8Y1^4	/* t0=8*y4		C */
+	arg mem_cy_256,contr
+	arg mem_t3_256,contw
+	call memcpy32
+	arg mem_t3_256,rega
+	call bn_lshiftmod_256
+	arg mem_t3_256,rega
+	arg mem_cz_256,regb
+	arg mem_cz_256,contw
+	call bn_mulmod_256		//z = 2Y1Z1
+
+
+	arg mem_t2_256,rega
+	arg mem_t3_256,contw
+	call bn_sqrmod_256   // M ^2
+//call ice_break
+	arg mem_t3_256,rega
+	arg mem_t1_256,regb
+	arg mem_t3_256,contw
+	call bn_submod_256  // t2^2 - 4*cx *cy^2 
+	arg mem_t3_256,rega
+	arg mem_t1_256,regb
+	arg mem_cx_256,contw
+	call bn_submod_256   //X2
+	arg mem_t1_256,rega
+	arg mem_cx_256,regb
+	arg mem_t3_256,contw
+	call bn_submod_256   //S-X2
+	arg mem_t3_256,rega
+	arg mem_t2_256,regb
+	arg mem_t3_256,contw
+	call bn_mulmod_256	//M(S-X2)	
+	arg mem_t3_256,rega
+	arg mem_t0_256,regb
+	arg mem_cy_256,contw
+	branch bn_submod_256  //M(S-X2)-T Y2	
+
+ecadd_256:
+
+	arg mem_az_256,rega
+	arg mem_t7_256,contw
+	call bn_sqrmod_256
+	arg mem_cx_256,rega
+	arg mem_t7_256,regb
+	arg mem_t0_256,contw
+	call bn_mulmod_256		/* n1=t0=xa*zb2 U1 = X1Z0^2*/
+
+
+	arg mem_az_256,rega
+	arg mem_t7_256,regb
+	arg mem_t7_256,contw
+	call bn_mulmod_256	
+	arg mem_cy_256,rega
+	arg mem_t7_256,regb
+	arg mem_t1_256,contw
+	call bn_mulmod_256		/* n2=t1=ya*zb3   S1 = Y1Z0^3*/
+
+
+	arg mem_cz_256,rega
+	arg mem_t7_256,contw
+	call bn_sqrmod_256
+	arg mem_ax_256,rega
+	arg mem_t7_256,regb
+	arg mem_t2_256,contw
+	call bn_mulmod_256		/* n3=t2=xb*za2  U0 = X0Z1^2*/
+
+	arg mem_cz_256,rega
+	arg mem_t7_256,regb
+	arg mem_t7_256,contw
+	call bn_mulmod_256	
+	arg mem_ay_256,rega
+	arg mem_t7_256,regb
+	arg mem_t3_256,contw
+	call bn_mulmod_256		/* n4=t3=yb*za3 S0 = Y0Z1^3*/
+
+
+//	arg mem_t0_256,rega
+//	arg mem_t2_256,regb
+	arg mem_t0_256,regb
+	arg mem_t2_256,rega
+	arg mem_t7_256,contw
+	call bn_submod_256		/* n5=t7=n1-n3=t0-t2   W=U1-U0*/
+	arg mem_t0_256,rega
+	arg mem_t2_256,regb
+	arg mem_t0_256,contw
+	call bn_addmod_256		/* n7=t0=n1+n3=t0+t2    T=U1+U0 */
+//	arg mem_t1_256,rega
+//	arg mem_t3_256,regb
+	arg mem_t1_256,regb
+	arg mem_t3_256,rega
+	arg mem_t2_256,contw
+	call bn_submod_256		/* n6=t2=n2-n4=t1-t3  S1-S0 */
+	arg mem_t1_256,rega
+	arg mem_t3_256,regb
+	arg mem_t1_256,contw
+	call bn_addmod_256		/* n8=t1=n2+n4=t1+t3 M=S1+S0*/
+	arg mem_t1_256,rega
+	arg mem_t7_256,regb
+	arg mem_t1_256,contw
+	call bn_mulmod_256		/* t1=n8*n5     MW */
+	arg mem_cz_256,rega
+	arg mem_az_256,regb
+	arg mem_t3_256,contw
+	call bn_mulmod_256	      //Z0Z1
+	arg mem_t3_256,rega
+	arg mem_t7_256,regb
+	arg mem_cz_256,contw
+	call bn_mulmod_256		/* z=za*zb*n5   Z0Z1W */
+
+	arg mem_t7_256,rega
+	arg mem_t7_256,contw
+	call bn_sqrmod_256		/* t7=n5^2 */
+	arg mem_t7_256,rega
+	arg mem_t0_256,regb
+	arg mem_t3_256,contw
+	call bn_mulmod_256		/* t3=n5^2*n7 */
+	arg mem_t7_256,rega
+	arg mem_t1_256,regb
+	arg mem_t1_256,contw
+	call bn_mulmod_256		/* t1=n8*n5^3 */
+	arg mem_t2_256,rega
+	arg mem_cx_256,contw
+	call bn_sqrmod_256		
+	arg mem_cx_256,rega
+	arg mem_t3_256,regb
+	arg mem_cx_256,contw
+	call bn_submod_256		/* x=n6^2-n5^2*n7 */
+	arg mem_cx_256,contr
+	arg mem_t7_256,contw
+	call memcpy32
+	arg mem_t7_256,rega
+	call bn_lshiftmod_256		/* t7=2*x */
+	arg mem_t3_256,rega
+	arg mem_t7_256,regb
+	arg mem_t3_256,contw
+	call bn_submod_256		/* t3=n9 */
+	arg mem_t3_256,rega
+	arg mem_t2_256,regb
+	arg mem_t2_256,contw
+	call bn_mulmod_256		/* t2=n9*n6 */
+	arg mem_t2_256,rega
+	arg mem_t1_256,regb
+	arg mem_cy_256,contw
+	call bn_submod_256	
+	arg mem_cy_256,rega
+	arg mem_p_256,regb
+	arg mem_cy_256,contw
+	force 0,regc
+	fetch 1,mem_cy_256
+	isolate1 0,pdata
+	call bn_add_256,true
+	copy regc,alarm
+	arg mem_cy_256,rega
+	call bn_rshift_256
+	fetch 1,mem_cy5_256
+	isolate1 0,alarm
+	setflag true,7,pdata
+	store 1,mem_cy5_256
+	rtn	
+
+bn_invmod_256:
+	copy contw,timeup					 
+	arg mem_tmp0_256,contw			 
+	call clear_mem_256
+	force 0,pdata
+//	store 4,mem_tmp52
+	store 4,mem_t2_256
+	jam 1,mem_tmp0_256      //y1
+	arg mem_tmp1_256,contw	//y2			 
+	call clear_mem_512      
+	arg mem_p_256,contr
+	arg mem_tmp2_256,contw		//j		 
+	call memcpy32
+	copy rega,contr
+	arg mem_tmp3_256,contw		//i		 
+	call memcpy32
+	
+//	arg mem_tmp22,rega
+//	arg mem_tmp32,regb
+//	call p_bn_bigeq_256
+//	branch assert,positive
+bn_invmod_256_2:	
+	arg mem_tmp3_256,contr
+	call bn_eq_zero_256
+	branch bn_invmod_256_0,blank
+//call ice_break    	
+//fetch 1,0x4ffe
+//increase 1,pdata
+//store 1,0x4ffe
+	arg mem_tmp3_256,rega
+	arg mem_tmp0_256,regb
+	call bn_rshifteven_256
+	arg mem_tmp2_256,rega
+	arg mem_tmp1_256,regb
+	call bn_rshifteven_256
+	
+	arg mem_tmp3_256,rega
+	arg mem_tmp2_256,regb
+	call bn_bigeq_256
+	branch bn_invmod_256_1,positive
+	arg mem_tmp2_256,rega
+	arg mem_tmp3_256,regb
+	copy rega,contw
+	call bn_sub_256
+	arg mem_tmp0_256,rega
+	arg mem_tmp1_256,regb
+	copy regb,contw
+	call bn_add_256
+	ifetch 1,rega
+	iadd regc,regc
+	ifetch 1,regb
+	iadd regc,pdata
+	istore 1,regb
+	branch bn_invmod_256_2
+bn_invmod_256_1:
+	arg mem_tmp3_256,rega
+	arg mem_tmp2_256,regb
+	copy rega,contw
+	call bn_sub_256
+	arg mem_tmp1_256,rega
+	arg mem_tmp0_256,regb
+	copy regb,contw
+	call bn_add_256
+	ifetch 1,rega
+	iadd regc,regc
+	ifetch 1,regb
+	iadd regc,pdata
+	istore 1,regb
+	branch bn_invmod_256_2
+bn_invmod_256_0:
+//call ice_break
+	arg mem_tmp1_256,rega
+	copy timeup,contw
+	call  bn_p256mod
+//call ice_break
+	arg mem_p_256,rega
+	copy timeup,regb
+	copy timeup,contw
+	branch bn_submod_256
+
+
+bn_mulmod_256:
+	copy contw,timeup					/* save result ptr */
+	
+	force 0,regext_index
+	
+	arg mem_tmp1_256,contw
+	call clear_mem_512
+	arg mem_regext,contw
+	call clear_mem_512
+//	jam 0,mem_regext_index
+
+//	arg mem_tmp12,contw
+	copy rega,contr
+//	force 0,regext_index
+	jam 0,mem_regext
+	setarg 0
+	call bn_load_mem
+	copy regb,contr
+	call bn_load_256
+//	force 0,regb
+//	jam 0,mem_regb
+	force 0,queue
+	arg mem_tmp1_256,contw	
+bn_mulmod_256_1:	
+//	copy regb,pdata
+//	store 1,
+	arg mem_regext,temp
+	copy queue,regb
+	lshift2 regb,pdata
+//	lshift4 pdata,pdata
+	iadd temp,regb	
+	force 0,temp
+	force 0,regc
+bn_mulmod_256_0:
+//	copy contw,pdata
+//	store 2,mem_contw
+//call ice_break
+//	copy pdata,contw
+	ifetch 4,contw					/* d[i+j] */
+	iforce rega
+//	copy regb,regext_index
+//	deposit regext
+	ifetch 4,regb
+	copy regc,regext_index
+	imul32 regext,pdata
+	iadd rega,pdata					/* uv = a[i]*b[j] + d[i+j] */
+	iadd temp,pdata					/* uv += u */
+	istore 4,contw					/* ->d[i+j] */
+	rshift32 pdata,temp				/* temp = u = uv >> 32 */
+	increase 1,regc
+	compare 8,regc,0xff
+	nbranch bn_mulmod_256_0,true
+//call ice_break
+	deposit temp
+	istore 4,contw					/* d[i + 12] = u */
+	increase -32,contw
+//	fetch 1,mem_regb
+//	copy pdata,regb
+	increase 1,queue
+	compare 8,queue,0xff
+	nbranch bn_mulmod_256_1,true
+	arg mem_tmp1_256,rega
+	copy timeup,contw
+	branch bn_p256mod
+
+bn_p256mod:
+	bpatchx patch30_5,mem_patch30
+	copy contw,timeup				/* save result ptr */
+	copy rega,alarm				/* temp save rega */
+	arg mem_tmp2_256,regb
+	copy regb,contw
+	call memset0_4	
+	istore 8,contw
+	add rega,44,contr
+	call memcpy8
+	call memcpy12
+	copy regb,rega
+	call  bn_lshiftmod_256 //2S1
+	arg mem_tmp2_256,regb
+	copy alarm,rega   
+	copy timeup,contw
+	call bn_addmod_256 //T+2S1
+//call ice_break	
+	arg mem_tmp2_256,regb
+	copy regb,contw
+	call memset0_4	
+	istore 8,contw
+	add alarm,48,contr
+	call memcpy16
+	call memset0_4	
+	copy regb,rega
+	call  bn_lshiftmod_256 //2S2
+//call ice_break	
+//	arg 0,regb
+
+	arg mem_tmp2_256,regb
+	copy timeup,rega   
+	copy rega,contw	
+	call bn_addmod_256  //+2S2
+//call ice_break	
+//	arg 0,regb
+		
+	arg mem_tmp2_256,regb
+	copy regb,contw
+	add alarm,32,contr
+	call memcpy12
+	call memset0_4	
+	istore 8,contw
+	add alarm,56,contr
+	call memcpy8
+	copy timeup,rega
+	copy rega,contw
+	call bn_addmod_256 //+S3
+//call ice_break	
+//	arg 0,regb
+
+	arg mem_tmp2_256,regb
+	copy regb,contw
+	add alarm,36,contr
+	call memcpy12
+	add alarm,52,contr	
+	call memcpy12
+	add alarm,52,contr
+	call memcpy4
+	add alarm,32,contr
+	call memcpy4
+	copy timeup,rega
+	copy rega,contw
+	call bn_addmod_256 //+S4	
+//call ice_break	
+//	arg 1,regb
+	arg mem_tmp2_256,regb
+	copy regb,contw
+	add alarm,44,contr
+	call memcpy12
+	call memset0_4	
+	istore 8,contw
+	add alarm,32,contr
+	call memcpy4
+	add alarm,40,contr
+	call memcpy4
+	copy timeup,rega
+	copy rega,contw
+	call bn_submod_256 //-D1	
+//call ice_break	
+//	arg 2,regb
+	arg mem_tmp2_256,regb
+	copy regb,contw
+	add alarm,48,contr
+	call memcpy8
+	call memcpy8
+	force 0,pdata
+	istore 8,contw
+	add alarm,36,contr
+	call memcpy4
+	add alarm,44,contr
+	call memcpy4
+	copy timeup,rega
+	copy rega,contw
+	call bn_submod_256 //-D2	
+//call ice_break	
+//	arg 3,regb
+	arg mem_tmp2_256,regb
+	copy regb,contw
+	add alarm,52,contr
+	call memcpy12
+	add alarm,32,contr
+	call memcpy12
+	call memset0_4	
+	add alarm,48,contr
+	call memcpy4
+	copy timeup,rega
+	copy rega,contw
+	call bn_submod_256 //-D3
+//call ice_break	
+//	arg 4,regb
+	arg mem_tmp2_256,regb
+	copy regb,contw
+	add alarm,56,contr
+	call memcpy8
+	call memset0_4	
+	add alarm,36,contr
+	call memcpy12
+	call memset0_4	
+	add alarm,52,contr
+	call memcpy4
+	copy timeup,rega
+	copy rega,contw
+	branch  bn_submod_256 //-D4	
+
+
+bn_load_mem:
+	force 32,loopcnt
+	arg mem_regext,contw
+	iadd contw,contw
+	branch memcpy
+
+bn_load_256:
+	force 8,loopcnt
+	branch bn_load_0
+
+bn_sqrmod_256:
+	copy rega,regb
+	branch bn_mulmod_256
+
+bn_add_256:
+	force 8,loopcnt
+ 	branch bn_add+1
+
+bn_addmod_256:
+	call bn_add_256
+	copy contw,rega
+	branch bn_lshiftmod_ismod_256
+
+bn_lshiftmod_256:
+	call bn_lshift_256
+bn_lshiftmod_ismod_256:	
+	isolate1 0,regc
+	branch bn_lshiftmod_p_256,true
+	arg mem_p_256,regb
+	copy rega,regc
+	increase -32,rega
+	call bn_bigeq_256
+	nrtn positive
+	copy regc,rega
+	branch sub_p2_256
+	
+bn_lshiftmod_p_256:
+	call sub_p2_256
+//	nrtn true
+	copy rega,regc
+	increase -32,rega
+	arg mem_p_256,regb
+	call bn_bigeq_256
+	nrtn positive
+	copy regc,rega
+	branch sub_p2_256
+		
+	
+sub_p2_256:
+	increase -32,rega
+	arg mem_p_256,regb
+	copy rega,contw
+	branch bn_sub_256
+	
+
+
+	
+bn_submod_256:
+	call bn_sub_256
+//	isolate1 0,regc
+	branch  bn_submod_256_np,true
+//	copy rega,regc
+//	increase -32,rega
+	add contw,-32,rega
+	arg mem_p_256,regb
+	call bn_bigeq_256
+	nrtn positive
+	arg mem_p_256,regb
+	add contw,-32,rega
+//	copy regc,rega
+	copy rega,contw
+	branch  bn_sub_256
+bn_submod_256_np:	
+	add contw,-32,rega
+	arg mem_p_256,regb
+	copy rega,contw
+	call bn_add_256
+//	isolate1 0,regc
+	rtn true
+	add contw,-32,rega
+	arg mem_p_256,regb
+	copy rega,contw
+	branch bn_add_256	
+
+
+ 
+bn_sub_256:
+	force 8,loopcnt
+	branch bn_sub+1
+
+bn_rshift_256:
+	force 8,loopcnt
+	increase 28,rega
+	branch bn_rshift
+
+bn_lshift_256:
+	force 8,loopcnt
+	force 0,regc
+	branch bn_lshift_0
+
+bn_bigeq_256:
+	force 8,loopcnt
+	increase 28,rega
+	increase 28,regb
+	branch bn_bigeq_0
+
+
+bn_eq_zero_256:
+	ifetch 8,contr
+	nrtn blank
+	branch bn_eq_zero
+
+
+
+	
+bn_rshifteven_256:
+	copy rega,alarm
+bn_rshifteven_256_1:
+	copy alarm,rega
+	ifetch 1,rega
+	isolate1 0,pdata
+	rtn true
+	call bn_rshift_256
+	ifetch 1,regb
+	isolate0 0,pdata
+	branch bn_rshifteven_256_0,true
+	arg mem_p_256,rega
+	copy regb,contw
+	call bn_add_256
+	ifetch 1,regb
+	iadd regc,pdata
+	istore 1,regb						 
+	increase -32,regb
+bn_rshifteven_256_0:
+	add regb,32,rega
+	force 9,loopcnt
+	call bn_rshift
+	branch bn_rshifteven_256_1		
+
+else
+sp_initialize_256:
+	rtn
+
+endif
+
+
Index: program/ui.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ui.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/ui.prog	(working copy)
@@ -0,0 +1,755 @@
+ui_init:
+	call lpm_disable_exen_output
+	rtn wake
+	call ui_button_init
+	call ui_timer_init
+	branch ui_led_init_global
+
+ui_dispatch:
+	call ui_led_dispatch
+	branch ui_timer_check
+	
+ui_button_init:
+	fetch 1,mem_ui_button_gpio
+	rtneq UI_BUTTON_GPIO_DISABLE
+	iforce temp
+	call gpio_config_output
+	fetcht 1,mem_ui_button_gpio
+	call gpio_out_inactive
+	nop 100
+	fetcht 1,mem_ui_button_gpio
+	call gpio_config_input
+	branch ui_button_polling
+
+
+	
+ui_button_polling:
+	bpatchx patch30_6,mem_patch30
+	fetch 1,mem_ui_button_gpio
+	rtneq UI_BUTTON_GPIO_DISABLE
+	copy pdata,temp
+	call gpio_get_bit
+	nbranch ui_button_up,true
+	//fall through
+ui_button_down:
+	call ui_button_check_long_press
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BTN_DOWN,pdata
+	store 2,mem_ui_state_map
+	fetch 1,mem_ui_button_last_state
+	rtneq UI_BUTTON_STATE_DOWN
+	jam UI_BUTTON_STATE_DOWN,mem_ui_button_last_state
+	//Down Edge
+	fetch 1,mem_ui_button_timeout
+	store 1,mem_ui_button_timer //start long press timer
+	call lpm_button_get_wake_lock
+	jam BT_EVT_BUTTON_DOWN,mem_fifo_temp
+	branch ui_ipc_send_event
+ui_button_up:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BTN_DOWN,pdata
+	store 2,mem_ui_state_map
+	fetch 1,mem_ui_button_last_state
+	rtneq UI_BUTTON_STATE_UP
+	jam UI_BUTTON_STATE_UP,mem_ui_button_last_state
+	//Up Edge
+	jam 0,mem_ui_button_timer//stop long press timer
+	call lpm_button_clean_wake_lock
+	jam BT_EVT_BUTTON_UP,mem_fifo_temp
+	branch ui_ipc_send_event
+
+ui_button_check_long_press:
+	fetch 1,mem_ui_button_timer
+	rtn blank
+	increase -1,pdata
+	store 1,mem_ui_button_timer
+	nrtn blank
+	//Long Press
+	jam BT_EVT_BUTTON_LONG_PRESSED,mem_fifo_temp
+	branch ui_ipc_send_event
+
+lpm_button_get_wake_lock:
+	arg wake_lock_button,queue
+	branch lpm_get_wake_lock
+	
+lpm_button_clean_wake_lock:
+	arg wake_lock_button,queue
+	branch lpm_put_wake_lock
+
+
+
+/***********************ui led function****************************/
+/******************
+led function
+
+ui_led_init_global
+ui_led_on_global
+
+ui_led_off_global
+//input:rega :struct number
+ui_led_blink_start_global
+
+//input:rega :struct number
+//contr: the point that want to set led style address
+ui_led_set_style_global
+
+******************/
+//input:rega :struct number
+//output:regb :current strutct starting pointer
+calc_curr_struct_prt:
+	fetch 2,mem_ui_led_struct_ptr
+	mul32 rega,LED_OFFSET_LENGTH,regb
+	iadd regb,regb
+	rtn
+
+
+ui_led_init_global:
+	fetch 1,mem_ui_led_struct_num
+	rtn blank
+	copy pdata,loopcnt
+	fetch 2,mem_ui_led_struct_ptr
+	copy pdata,regb
+ui_led_init_loop:
+	add regb,LED_OFFSET_LED_GPIO,regc
+	ifetcht 1,regc
+	call gpio_config_output
+	call ui_led_off_static
+	increase LED_OFFSET_LENGTH,regb
+	loop ui_led_init_loop
+	rtn
+
+	
+//input:rega :struct number
+ui_led_on_global:
+	call calc_curr_struct_prt
+	setarg UI_LED_STATE_LIGHTING
+	istore 1,regb
+	call ui_led_stop_timer
+	branch ui_led_on_static
+
+	
+//input:rega :struct number
+ui_led_blink_stop_global:
+ui_led_off_global:
+	call calc_curr_struct_prt
+	setarg UI_LED_STATE_DARKING
+	istore 1,regb
+	call ui_led_stop_timer
+	branch ui_led_off_static
+
+
+//input:rega :struct number
+ui_led_blink_start_global:
+	call calc_curr_struct_prt
+	setarg UI_LED_STATE_BLINK_START
+	istore 1,regb
+	setarg LED_INFINITE_FLASH_NUM
+	istore 1,contw
+	branch ui_led_off_static
+
+
+//input:rega :struct number
+//REGC: the point that want to set led style address
+ui_led_set_style_global:
+	call calc_curr_struct_prt
+	arg LED_OFFSET_LENGTH,loopcnt
+	copy regc,contr
+	copy regb,contw
+	branch memcpy_fast
+
+
+
+ui_led_dispatch:
+	fetch 1,mem_ui_led_struct_num
+	rtn blank
+	arg 0,rega
+ui_led_blink_polling:
+	call ui_led_change_style_by_type
+	increase 1,rega
+	fetch 1,mem_ui_led_struct_num
+	isub rega,null
+	rtn zero
+	branch ui_led_blink_polling
+
+
+ui_led_off_static:
+	add regb,LED_OFFSET_LED_GPIO,regc
+	ifetcht 1,regc
+	fetch 1,mem_device_option
+	beq dvc_op_mouse,mouse_ui_led_off_static
+	branch gpio_out_inactive
+
+
+ui_led_on_static:
+	add regb,LED_OFFSET_LED_GPIO,regc
+	ifetcht 1,regc
+	fetch 1,mem_device_option
+	beq dvc_op_mouse,mouse_ui_led_on_static
+	branch gpio_out_active
+
+
+//input:rega :struct number
+ui_led_change_style_by_type:
+	add rega,ui_led_blink,queue
+	call timer_check
+	nrtn blank			//timer out
+	
+	call calc_curr_struct_prt
+
+	ifetch 1,regb			//led type
+
+	beq UI_LED_STATE_LIGHTING,ui_led_on_static
+	beq UI_LED_STATE_DARKING,ui_led_off_static
+	beq UI_LED_STATE_BLINK_STOP,ui_led_off_static
+	beq UI_LED_STATE_BLINK_DARKING,ui_led_blink_state_darking
+ui_led_blink_state_lighting:
+	call ui_led_on_static
+	add regb,LED_OFFSET_CB_LEDON,regc
+	call push_stack
+	ifetch 2,regc
+	call callback_func
+	call pop_stack
+	setarg UI_LED_STATE_BLINK_DARKING
+	istore 1,regb
+	add regb,LED_OFFSET_ON_TIME,regc
+	ifetch 2,regc
+	branch ui_led_blink_timer_start
+	
+
+ui_led_blink_state_darking:
+	call ui_led_off_static
+	add regb,LED_OFFSET_CB_LEDOFF,regc
+	call push_stack
+	ifetch 2,regc
+	call callback_func
+	call pop_stack
+	
+	add regb,LED_OFFSET_BLINK_COUNT,regc
+	ifetch 1,regc
+	beq LED_INFINITE_FLASH_NUM,ui_led_blink_infinite
+	increase -1,pdata
+	istore 1,regc
+	branch ui_led_blink_stop_global,blank		//End of flicker
+ui_led_blink_infinite:
+	setarg UI_LED_STATE_BLINK_LIGHTING
+	istore 1,regb
+	add regb,LED_OFFSET_OFF_TIME,regc
+	ifetch 2,regc
+ui_led_blink_timer_start:
+	add rega,ui_led_blink,queue
+	branch timer_init
+
+ui_led_stop_timer:
+	setarg 0
+	branch ui_led_blink_timer_start
+
+/***********************ui led function ending****************************/
+
+
+
+ui_timer_timeout:
+	setarg 0x1000
+	lshift16 pdata,pdata
+	iadd regb,regb
+	rtn
+	
+ui_timer_check:
+	bpatchx patch30_7,mem_patch30
+	arg 0,rega
+	fetcht 4,mem_ui_timer_last_btclk
+	copy clkn_bt,regb
+	copy regb,pdata
+	isub temp,null
+	ncall ui_timer_timeout,positive
+ui_timer_check_loop:
+	copy regb,pdata
+	increase 160,temp    //320btclk = 100ms
+	increase 160,temp
+	isub temp,null
+	nbranch ui_timer_check_end,positive
+	increase 1,rega   //increase 1 every 100ms count
+	and rega,0x0f,pdata
+	nbranch ui_timer_check_loop,blank
+	arg 0,rega  //reset timer if it's longer than 1.5s between 2 checks
+	call ui_timer_check_send_evt
+ui_timer_init:
+	copy clkn_bt,pdata
+	store 4,mem_ui_timer_last_btclk
+	rtn
+ui_timer_check_end:
+	copy rega,pdata
+	rtn blank
+	increase -160,temp    //320btclk = 100ms
+	increase -160,temp
+	set0 28,temp
+	storet 4,mem_ui_timer_last_btclk
+ui_timer_check_send_evt:
+	branch app_evt_timer
+
+	
+
+//**********************************************************//
+//************UI Inter-Processor Communication*******//
+//**********************************************************//
+ui_ipc_get_lock:
+	jam 1,mem_ipc_lock_bt
+ui_ipc_get_lock_wait:
+	fetch 1,mem_ipc_lock_c51
+	nbranch ui_ipc_get_lock_wait,blank
+	rtn
+	
+ui_ipc_put_lock:
+	jam 0,mem_ipc_lock_bt
+	rtn
+	
+
+	
+ui_ipc_send_event:
+	bpatchx patch31_0,mem_patch31
+	call ui_ipc_get_lock
+	copy rega,pdata
+	store 4,mem_ipc_rega_temp
+	arg mem_ipc_fifo_bt2c51,rega
+	call fifo_in
+	fetch 4,mem_ipc_rega_temp
+	copy pdata,rega
+	branch ui_ipc_put_lock
+
+ui_ipc_send_cmd:
+	bpatchx patch31_1,mem_patch31
+	call ui_ipc_get_lock
+	copy rega,pdata
+	store 4,mem_ipc_rega_temp	
+	arg mem_ipc_fifo_c512bt,rega
+	call fifo_in
+	fetch 4,mem_ipc_rega_temp
+	copy pdata,rega	
+	branch ui_ipc_put_lock
+
+ui_ipc_clean_all_fifo:
+	setarg 0
+	store UTIL_FIFO_LEN,mem_ipc_fifo_c512bt
+	store UTIL_FIFO_LEN,mem_ipc_fifo_bt2c51
+	rtn
+	
+check_51cmd:
+	bpatchx patch31_2,mem_patch31
+	fetch 1,mem_hci_cmd
+	nrtn blank
+	arg mem_ipc_fifo_c512bt,rega
+	call fifo_is_empty
+	rtn blank
+	jam IPC_CONTINUE_PROCESS,mem_ipc_skip_continue_proc
+	call check_51cmd_once
+	fetch 1,mem_ipc_skip_continue_proc
+	branch check_51cmd,blank
+	rtn
+
+check_51cmd_once:
+	call ui_ipc_get_lock
+	arg mem_ipc_fifo_c512bt,rega
+	call fifo_out
+	copy pdata,temp
+	call ui_ipc_put_lock
+	bpatchx patch31_3,mem_patch31
+	copy temp,pdata
+	rtn blank
+ 	beq BT_CMD_START_DISCOVERY,check_51cmd_start_discovery
+  	beq BT_CMD_STOP_DISCOVERY,check_51cmd_stop_discovery
+  	beq BT_CMD_RECONNECT,check_51cmd_reconnect
+	beq BT_CMD_START_ADV,check_51cmd_adv
+	beq BT_CMD_STOP_ADV,check_51cmd_stop_adv
+	beq BT_CMD_START_DIRECT_ADV,check_51cmd_direct_adv
+	beq BT_CMD_STOP_DIRECT_ADV,check_51cmd_stop_direct_adv
+	beq BT_CMD_LED_OFF,check_51cmd_led_off
+	beq BT_CMD_LED_ON,check_51cmd_led_on
+	beq BT_CMD_LED_BLINK,check_51cmd_led_start_blink
+	beq BT_CMD_LE_START_CONN,check_51cmd_le_start_con
+	beq BT_CMD_LE_START_SCAN,check_51cmd_start_scan
+	beq BT_CMD_LE_STOP_SCAN,check_51cmd_stop_scan
+	beq BT_CMD_ENTER_HIBERNATE,check_51cmd_hibernate
+	beq BT_CMD_BB_RECONN_CANCEL,check_51cmd_bb_reconn_cancel
+	//context related, process in context
+	store 1,mem_fifo_temp
+	call lmo_fifo_check
+	nbranch check_51cmd_restore,blank  //process this cmd next time while lmo fifo is full
+check_51cmd_once_continue:
+	fetch 1,mem_fifo_temp
+	bmark0 mark_context,check_51cmd_check_idle
+	bpatchx patch31_4,mem_patch31
+	fetch 1,mem_fifo_temp
+	beq BT_CMD_DISCONNECT,check_51cmd_disconnect
+  	beq BT_CMD_ENTER_SNIFF,check_51cmd_enter_sniff
+  	beq BT_CMD_EXIT_SNIFF,check_51cmd_exit_sniff
+  	beq BT_CMD_SET_PIN_CODE,check_51cmd_pincode
+	beq BT_CMD_LE_DISCONNECT,check_51cmd_le_disconnect
+	beq BT_CMD_LE_SMP_SECURITY_REQUEST,check_51cmd_le_smp_sec_req
+	beq BT_CMD_LE_UPDATE_CONN,check_51cmd_ble_update_connect_param
+	beq BT_CMD_ROLE_SWITCH,check_51cmd_role_switch
+	beq BT_CMD_STORE_RECONN_INFO_LE,eeprom_store_le_reconn_info
+	beq BT_CMD_STORE_RECONN_INFO_BT,eeprom_store_bd_reconn_info
+	beq BT_CMD_DHKEY_NOT_ACCEPT,check_51cmd_dhkey_not_accept
+	beq BT_CMD_STORE_RECONN_INFO,check_51cmd_store_reconn_info
+	rtn
+
+check_51cmd_check_idle:
+	store 1,mem_fifo_temp
+  	call context_check_idle
+	branch check_51cmd_restore,zero
+	call context_search_plap
+	nrtn zero
+check_51cmd_restore:
+	jam IPC_SKIP_CONTINUE_PROCESS,mem_ipc_skip_continue_proc
+	branch ui_ipc_send_cmd
+
+  
+ /******************** 51COMMAND*********************/
+//command opcode 0x01	
+check_51cmd_start_discovery:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_DISCOVERY,pdata
+	store 2,mem_ui_state_map
+	jam 3,mem_scan_mode
+	rtn
+
+
+//command opcode 0x02	
+check_51cmd_stop_discovery:
+	jam 0,mem_hid_handshake_timer_count
+	jam 0,mem_scan_mode
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_DISCOVERY,pdata
+	store 2,mem_ui_state_map
+	rtn	
+
+
+//command opcode 0x03	
+check_51cmd_reconnect:	
+	jam hci_cmd_create_conn,mem_hci_cmd
+	rtn	
+
+
+//command opcode 0x04
+check_51cmd_disconnect:
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam OTHER_END_TERMINATED,mem_disconn_reason_send
+	rtn
+
+
+//command opcode 0x05
+check_51cmd_enter_sniff:
+	jam LMP_SNIFF_REQ,mem_lmo_opcode2
+	arg mem_sniff_payload,contw
+	setarg 0
+	isolate1 27,clke_bt
+	setflag true,1,pdata		/* use init 2 if bit27 of clke is 1 */
+	istore 1,contw	
+	setarg 0	/* dsniff */
+	istore 2,contw
+	fetch 6,mem_sniff_param_interval
+	istore 6,contw
+	rtn	
+
+
+//command opcode 0x06
+check_51cmd_exit_sniff:
+	jam LMP_UNSNIFF_REQ,mem_lmo_opcode2
+	rtn
+
+
+//command opcode 0x10
+check_51cmd_pincode:
+	jam pincode_state_pincode_ready,mem_pincode_state
+//enable ssp master sm
+	fetch 1,mem_op
+	bbit1 op_inrand_req,check_51cmd_pincode_pair_passive
+	call tid_initiate
+	jam LMP_IN_RAND,mem_lmo_opcode2
+	rtn
+check_51cmd_pincode_pair_passive:
+	set0 op_inrand_req,pdata
+	store 1,mem_op
+	call lmp_accept_inrand
+	setarg 0
+	setflag master,smap_lmptid,pdata		
+	store 1,mem_lmo_tid2
+	rtn
+
+
+//command opcode 0x13
+check_51cmd_adv:
+	jam ON,mem_le_adv_enable
+	jam ADV_IND,mem_le_adv_type
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+
+//command opcode 0x14
+check_51cmd_stop_adv:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+	jam OFF,mem_le_adv_enable
+	rtn
+
+
+//command opcode 0x15
+check_51cmd_direct_adv:
+	jam ON,mem_le_adv_enable
+	jam ADV_DIRECT_IND,mem_le_adv_type
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+
+//command opcode 0x16
+check_51cmd_stop_direct_adv:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+	jam OFF,mem_le_adv_enable
+	rtn
+
+
+//command opcode 0x17
+check_51cmd_le_disconnect:
+	setarg 20 // 100ms
+	store 2,mem_le_superto
+	store 2,mem_le_init_superto
+	branch le_send_terminate_ind_user_terminated
+
+
+//command opcode 0x18
+check_51cmd_ble_update_connect_param:
+	branch le_l2cap_tx_update_req
+
+
+//command opcode 19
+check_51cmd_led_off:
+	arg 0,rega
+	branch ui_led_off_global
+
+
+//command opcode 20
+check_51cmd_led_on:
+	arg 0,rega
+	branch ui_led_on_global
+
+
+//command opcode 21
+check_51cmd_led_start_blink:
+	arg 0,rega
+	call calc_curr_struct_prt
+	ifetch 1,regb
+	beq UI_LED_STATE_BLINK_START,check_51cmd_led_start_blink_in_blink
+	beq UI_LED_STATE_BLINK_LIGHTING,check_51cmd_led_start_blink_in_blink
+	beq UI_LED_STATE_BLINK_DARKING,check_51cmd_led_start_blink_in_blink
+	branch ui_led_blink_start_global
+
+check_51cmd_led_start_blink_in_blink:
+	ifetch 1,contr
+	rtneq LED_INFINITE_FLASH_NUM
+	branch ui_led_blink_start_global
+
+
+//command opcode 0x22
+check_51cmd_le_start_con:
+	jam ON,mem_le_scan_enable
+	jam hci_cmd_le_create_conn,mem_hci_cmd
+//	fetch 6,mem_app_peer_addr
+//	store 6,mem_le_conn_peer_addr
+	rtn
+
+
+//command opcode 0x23
+check_51cmd_start_scan:
+	jam ON,mem_le_scan_enable
+	rtn
+
+
+//command opcode 0x24
+check_51cmd_stop_scan:
+	jam OFF,mem_le_scan_enable
+	jam 0,mem_hci_cmd
+	rtn
+
+
+//command opcode 0x25
+check_51cmd_hibernate:
+	fetch 2,mem_cb_before_hibernate
+	call callback_func
+	fetch 1,mem_ui_button_gpio
+	beq UI_BUTTON_GPIO_DISABLE,check_51cmd_hibernate_btn_disabled
+	copy pdata,temp
+	call gpio_config_input
+check_51cmd_hibernate_btn_disabled:
+	call ui_ipc_clean_all_fifo
+	branch lpm_hibernate	
+
+
+//command opcode 0x27
+check_51cmd_le_smp_sec_req:
+	branch le_send_smp_security_request
+
+
+//command opcode 0x29
+check_51cmd_role_switch:
+  	jam LMP_SLOT_OFFSET,mem_lmo_opcode2
+	set1 mark_switch_initiated,mark
+	nrtn master
+	jam SWITCH_FLAG_INIT,mem_switch_flag
+	jam LMP_SWITCH_REQ ,mem_lmo_opcode2
+	fetch 1,mem_connection_options
+	set0 CONNECTION_SWITCH,pdata
+	store 1,mem_connection_options
+	rtn
+
+
+//command opcode 0x30
+check_51cmd_bb_reconn_cancel:
+	force page_length_timer,queue
+	branch timer_stop
+
+
+//command opcode 0x33
+check_51cmd_dhkey_not_accept:
+	call tid_set_reply
+	jam LMP_DHKey_Check,mem_lmi_opcode2
+	branch lmp_reject_pdu_not_allowed	
+
+
+ui_check_paring_button:
+	fetch 1,mem_ui_state_map
+	rtnbit0 UI_STATE_BTN_DOWN
+	rtnbit0 UI_STATE_BT_RECONNECT
+	branch check_51cmd_bb_reconn_cancel
+
+
+
+///////////queue function////////////
+queue_init:
+	fetch 2,mem_queue_ptr
+	add pdata,QUEUE_OFFSET_CURR_NUM,contw
+	setarg 0
+	istore 3,contw
+	rtn
+	
+//input:rega:the address of the data to which you want to input queue
+//output:if user is disable,mean queue no have space
+queue_push:
+	call disable_user
+	call queue_full
+	rtn blank
+	fetch 2,mem_queue_ptr
+	add pdata,QUEUE_OFFSET_CURR_NUM,regb
+	ifetcht 1,regb
+	increase 1,temp
+	istoret 1,regb	//number add 
+	
+	ifetcht 1,pdata	//temp:each length
+	copy temp,loopcnt
+	add pdata,QUEUE_OFFSET_WRITE_PTR,regb
+	ifetch 1,regb
+	imul32 temp,pdata	//offset
+	iadd contr,contw
+	copy rega,contr
+calc_queue_next_ptr:
+	call memcpy
+	call queue_get_size
+	pincrease -1
+	ifetcht 1,regb
+	increase 1,temp
+	iand temp,temp
+	istoret 1,regb
+	branch enable_user
+
+
+//input:rega:the address of the data to which you want to output queue
+//output:if user is disable,mean queue no have data
+queue_pop:
+	call disable_user
+	call queue_empty
+	rtn blank
+	fetch 2,mem_queue_ptr
+	add pdata,QUEUE_OFFSET_CURR_NUM,regb
+	ifetcht 1,regb
+	increase -1,temp
+	istoret 1,regb
+	ifetcht 1,pdata		//each size
+	copy temp,loopcnt
+	add pdata,QUEUE_OFFSET_READ_PTR,regb
+	ifetch 1,regb
+	imul32 temp,pdata	//offset
+	iadd contr,contr
+	increase 1,contr
+	copy rega,contw
+	branch calc_queue_next_ptr
+
+
+//function:no pop element,only copy element in rega
+//input:rega:the address of the data to which you want to output queue
+//output:if user is disable,mean queue no have data
+//regb is new ptr
+queue_get_new_ele:
+	call disable_user
+	call queue_empty
+	rtn blank
+	fetch 2,mem_queue_ptr
+	ifetcht 1,pdata		//each size
+	copy temp,loopcnt
+	add pdata,QUEUE_OFFSET_READ_PTR,regb
+	ifetch 1,regb
+	imul32 temp,pdata	//offset
+	iadd contr,contr
+	increase 1,contr
+	copy contr,regb
+	copy rega,contw
+	call memcpy
+	branch enable_user
+
+queue_store_new_ele:
+	call disable_user
+	call queue_empty
+	rtn blank
+	fetch 2,mem_queue_ptr
+	ifetcht 1,pdata		//each size
+	copy temp,loopcnt
+	add pdata,QUEUE_OFFSET_READ_PTR,regb
+	ifetch 1,regb
+	imul32 temp,pdata	//offset
+	iadd contr,contr
+	add contr,2,contw
+	copy rega,contr
+	increase -1,loopcnt
+	call memcpy
+	branch enable_user
+
+//output:if blank is 1,mean queue is empty
+queue_empty:
+	fetch 2,mem_queue_ptr
+	add pdata,QUEUE_OFFSET_CURR_NUM,contr
+	ifetch 1,contr
+	rtn
+
+//output:if blank is 1,mean queue is full
+queue_full:
+	call queue_get_size
+	ifetcht 1,contr
+	isub temp,pdata
+	rtn
+
+//output:pdata is queue size
+queue_get_size:
+	fetch 2,mem_queue_ptr
+	add pdata,QUEUE_OFFSET_LENGTH,contr
+	ifetch 1,contr
+	rtn
+
+///////////queue function end////////////
+
+
+
+
Index: program/usb.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/usb.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/usb.prog	(working copy)
@@ -0,0 +1,1067 @@
+ ifdef COMPILE_USB
+
+usb_isr:
+	bpatchx patch31_5,mem_patch31
+	fetch 1,core_usb_status
+	isolate1 USB_STATUS_RESET,pdata
+	call usb_init,true
+	fetch 1,core_usb_status
+	store 1,core_usb_status
+	store 1,mem_usb_status
+	call usb_nak_state_judge
+	call usb_rx
+	call usb0_tx
+	call usb_tx
+	branch usb_nak_state
+
+usb_init:
+	bpatchx patch31_6,mem_patch31
+	call enable_authrom
+	call usb_init_param
+	jam 0x00,core_usb_config
+ifdef SIM
+	nop 10
+else
+	nop 10000
+endif
+	jam 0xc0,core_usb_trig
+	fetch 2,core_clkoff
+	set0 CLOCK_OFF_USB,pdata
+	store 2,core_clkoff
+	jam 0x0,core_usb_hmode
+	jam 0x3c,core_usb_config
+	setarg mem_usb_rxbuf
+	store 2,core_usb_rx_saddr
+	store 2,core_usb_rxptr
+	setarg mem_usb_rxbuf_end
+	store 2,core_usb_rx_eaddr
+	jam 0x4,core_usb_hmode
+	jam 0,core_usb_addr
+	jam 0xff,core_usb_status
+	setarg mem_usb_clear_mem_end
+	arg mem_usb_clear_mem_start,contw
+	isub contw,loopcnt
+	branch clear_mem
+	
+usb_offline_check_init:
+	fetcht 1,mem_usb_offline_check_gpio
+	branch gpio_config_input
+usb_offline_state:
+	fetch 1,mem_usb_device_enumeration_endflag
+	rtn blank
+	fetcht 1,mem_usb_offline_check_gpio
+	call gpio_get_bit
+	branch usb_init,true
+	rtn
+
+usb_init_param:
+	jam DEV_DEFAULT,mem_usb0_state
+	setarg 0x0
+	store 1,mem_remain
+	store 2,mem_usb_zero_packet
+	pincrease 1
+	store 2,mem_usb_ones_packet
+	pincrease 1
+	store 2,mem_usb_two_packet
+	arg mem_string0,contw
+	setarg 0x030404
+	istore 3,contw
+	setarg 0x0409
+	istore 2,contw
+	arg mem_string1,contw
+	setsect 0,0x15906
+	setsect 1,0x210d2
+	setsect 2,0x10494
+	setsect 3,0x1
+	istore 9,contw
+	arg mem_string2,contw
+	setsect 0,0x1570f
+	setsect 1,0x15c9a
+	setsect 2,0x256c6
+	setsect 3,0x1cdcd
+	istore 9,contw
+	setsect 0,0x14420
+	setsect 1,0x25d99
+	setsect 2,0x25636
+	setsect 3,0x1
+	istore 7,contw
+	arg mem_string3,contw
+	setsect 0,0x1620a
+	setsect 1,0xc8c
+	setsect 2,0x30333
+	setsect 3,0xc0c0
+	istore 9,contw
+	setsect 0,0x3130
+	istore 2,contw
+	setarg USB_KBDATA_VENDOR_DEFINE_ADDR
+	store 2,mem_hidreportdesc_kb
+	setarg USB_MSDATA_ADDR
+	store 2,mem_hidreportdesc_m
+	arg USB_DEVICEDATA_ADDR,contr
+	arg mem_devicedesc,contw
+	arg 19,loopcnt
+	call memcpy	
+	arg USB_CONFDATA_ADDR,contr
+	arg mem_confdesc,contw
+	arg 60,loopcnt
+	call memcpy
+usb_config_cb:
+	fetch 2,mem_cb_usb_config
+	branch callback_func
+
+usb_tx_interval_config:
+	fetch 1,mem_usb_tx_interval
+	rtn blank
+	store 1,mem_confdesc+34
+	store 1,mem_confdesc+59
+	rtn
+
+usb_nak_state:
+	arg TIMER_NAK,queue
+	call timer_check
+	nrtn blank
+	fetch 1 ,mem_usb_wakestate_onetime_flag
+	nrtn blank
+	fetch 1,mem_usb_device_enumeration_endflag
+	ncall usb_mac_wakeup_judge,blank
+	rtn
+
+usb_nak_state_judge:
+	fetch 1,mem_usb_status
+	bbit1 USB_STATUS_NAK,usb_nak_state_timer_init
+	rtn
+	
+usb_nak_state_timer_init:
+	call usb0_attached_state_judge
+	call timer_reinit
+	setarg TIMER_NAK_DELAY
+	arg TIMER_NAK,queue
+	branch timer_init
+	
+usb0_attached_state_judge:
+	fetch 1,mem_usb_state
+	bne USB_CONNECTED,usb_clear_halt_dispose
+	jam 0,mem_usb_wakestate_onetime_flag
+	jam 0,mem_usb_mac_wakeup_trig
+	rtn
+
+usb_clear_halt_dispose:
+	fetch 1,mem_usb_clear_halt
+	rtn blank
+	jam 0,mem_usb_clear_halt
+	jam USB_CONNECTED,mem_usb_state
+	jam 1,mem_usb_device_enumeration_endflag
+	rtn
+
+usb_rx_no_data:
+	fetch 1,mem_usb_status
+	bbit1 USB_STATUS_SETUP,usb_class_type
+	rtn
+
+usb_rx_data:
+	fetch 1,core_usb_txbusy
+	rtnbit1 USB_STATUS_RXEMPTY
+	fetchr contus,2,core_usb_rx_saddr
+	fetchr contue,2,core_usb_rx_eaddr
+	fetchr contu,2,core_usb_rxptr
+	ifetch 2,contu
+	rshift8 pdata,temp
+	rshift4 temp,temp					// temp is endpoint
+	arg 0xfff,contr
+	iand contr,loopcnt
+	copy loopcnt,rega
+usb_rx_read:
+	ifetch 1,contu
+	istore 1,contw
+	loop usb_rx_read
+	storer contu,2,core_usb_rxptr
+	storer rega,2,mem_usb_read_len
+	rtn
+usb_data_rx:
+	rtn 
+
+usb_rx:
+	bpatchx patch31_7,mem_patch31
+	fetch 1,mem_usb_status
+	rtnbit0 USB_STATUS_RXREADY
+	arg mem_usb_setup,contw
+	call usb_rx_data
+	copy temp,pdata
+	beq 0,usb0_rx
+	branch usb_data_rx
+usb0_rx:
+	fetch 1,mem_usb_read_len
+	sub pdata,7,null
+	rtn positive
+usb_class_type:
+	bpatchx patch32_0,mem_patch32
+	set0 mark_isstr,mark
+	fetch 1,mem_usb_setup_bmRequestType
+	and_into 0x80,pdata
+	beq IN_DEVICE,usb_in_device
+	beq OUT_DEVICE,usb_out_device
+	branch assert
+
+usb_in_device:
+	fetch 1,mem_usb_setup_bmRequestType
+	rshift4 pdata,pdata
+	rshift pdata,pdata
+	and_into 0x03,pdata
+	beq STANDARD_REQ,usb_in_standard_req
+	beq CLASS_REQ,usb_in_class_req
+	beq MANUFACTURER_REQ,usb_in_manufacturer_req
+	branch assert
+
+usb_out_device:
+	fetch 1,mem_usb_setup_bmRequestType
+	rshift4 pdata,pdata
+	rshift pdata,pdata
+	and_into 0x03,pdata
+	beq STANDARD_REQ,usb_out_standard_req
+	beq CLASS_REQ,usb_out_class_req	
+	beq MANUFACTURER_REQ,usb_out_manufacturer_req
+	branch assert
+
+usb_in_standard_req:
+	fetch 1,mem_usb_setup_bRequest
+	beq GET_CONFIGURATION,usb0_request_get_configuration
+	beq GET_DESCRIPTOR,usb0_request_get_descriptor
+	beq GET_INTERFACE,usb0_request_get_interface
+	beq GET_STATUS,usb0_request_get_status
+	branch usb0_force_stall
+
+usb_in_class_req:
+	fetch 1,mem_usb_setup_bRequest
+	beq GET_IDLE,usb_get_idle
+	beq GET_REPORT,usb_get_report
+	beq GET_PROTOCOL,usb_get_protocol_req
+	branch usb0_force_stall
+
+usb_in_manufacturer_req:
+	branch usb0_force_stall
+
+usb_out_standard_req:
+	fetch 1,mem_usb_setup_bRequest
+	beq CLEAR_FEATURE,usb0_request_clear_feature
+	beq SET_FEATURE,usb0_request_set_feature
+	beq SET_ADDRESS,usb0_request_set_address
+	beq SET_CONFIGURATION,usb0_request_set_configuration
+	beq SET_INTERFACE,usb0_request_set_interface
+	beq SET_DESCRIPTOR,usb0_force_stall
+	branch usb0_force_stall
+
+usb_out_class_req:
+	fetch 1,mem_usb_setup_bRequest
+	beq SET_IDLE,usb_set_idle
+	beq SET_REPORT,usb_set_report
+	beq SET_PROTOCOL,usb_set_protocol_req
+	branch usb0_force_stall
+
+usb_out_manufacturer_req:
+	branch usb0_force_stall
+
+usb0_force_stall:
+	fetch 1,core_usb_stall
+	set1 0,pdata
+	store 1,core_usb_stall
+	branch usb0_reply_zerolen
+	
+usb0_reply_zerolen:
+	jam 0x10,core_usb_trig
+	rtn
+
+usb0_request_get_configuration:
+	fetch 1,mem_usb_setup_bmRequestType
+	bne IN_DEVICE,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex+1
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLength
+	bne 1,usb0_force_stall
+	fetch 1,mem_usb_setup_bLengthH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue+1
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb0_state
+	beq DEV_CONFIGURED,usb0_request_get_cfg_dev_cfg
+	beq DEV_ADDRESS,usb0_request_get_cfg_dev_addr
+	branch usb0_force_stall
+//Return current config : 1
+usb0_request_get_cfg_dev_cfg:
+	arg 1,regb
+	branch usb_send_ones_packet
+//Config do not work, return default config : 0
+usb0_request_get_cfg_dev_addr:
+	arg 1,regb
+	branch usb_send_zero_packet
+
+usb0_request_get_descriptor:
+	bpatchx patch32_1,mem_patch32
+//	set0 mark_isstr,mark
+	fetch 1,mem_usb_setup_bValueH
+	beq DSC_DEVICE,dsc_device_info
+	beq DSC_CONFIG,dsc_config_info	
+	beq DSC_STRING,dsc_string_info
+	beq DSC_HID,dsc_hid_info
+	beq DSC_HID_REPORT,dsc_hid_report_info
+	branch usb0_force_stall
+
+dsc_hid_info:
+	jam 0,mem_usb_get_protocol_flag
+	fetch 1,mem_usb_setup_wIndex
+	beq 0,dsc_hid_info_interface0
+	beq 1,dsc_hid_info_interface1
+	branch usb0_force_stall
+//class_descriptor hid_descriptor--keyboard 
+dsc_hid_info_interface0:
+	fetchr regb,1,mem_confdesc+19
+	arg mem_confdesc+19,rega
+	branch usb0_respond
+//class_descriptor hid_descriptor--mouse 
+dsc_hid_info_interface1:
+	fetchr regb,1,mem_confdesc+44
+	arg mem_confdesc+44,rega
+	branch usb0_respond
+
+dsc_device_info:
+//input : pdata : data poniter 
+//input : temp: data len
+//sets the data pointer and len to correct descriptor
+	fetch 1,mem_usb_set_high_addr_flag
+	ncall usb_set_high_addr,blank
+	setarg mem_devicedesc
+	fetcht 1,mem_devicedesc
+dsc_info_set_data_len:
+	store 2,mem_dsc_info_data_pointer
+	storet 1,mem_dsc_info_len
+	fetch 1,mem_usb_setup_bLength
+	isub temp,null
+	nbranch dsc_info_set_current_data_len,positive
+dsc_info_set_initial_data_len:
+	fetch 1,mem_dsc_info_len
+dsc_info_set_data_size_completed:	
+	iforce regb
+	fetch 2,mem_dsc_info_data_pointer
+	add pdata,1,pdata
+	iforce rega
+	branch usb0_respond
+dsc_info_set_current_data_len:
+	fetch 1,mem_usb_setup_bLength
+	branch dsc_info_set_data_size_completed
+
+usb_set_high_addr:
+	fetch 1,core_usb_addr
+	ncall usb0_set_addr,blank
+	jam 0,mem_usb_set_high_addr_flag
+	rtn
+usb0_set_addr:
+	fetch 1,core_usb_addr
+   	set1 7,pdata
+    	store 1,core_usb_addr
+    	rtn
+
+dsc_config_info:
+	setarg mem_confdesc
+	fetcht 1,mem_confdesc
+	branch dsc_info_set_data_len
+
+dsc_string_info:
+	fetch 1,mem_usb_setup_bValue
+	sub pdata,3,null
+	nbranch usb0_force_stall,positive
+	fetch 1,mem_usb_setup_bValue
+	arg mem_string0,rega
+	beq 0,usb0_respond_length	
+	set1 mark_isstr,mark
+	arg mem_string1,rega
+	beq 1,usb0_respond_length
+	arg mem_string2,rega
+	beq 2,usb0_respond_length
+	arg mem_string3,rega
+	beq 3,usb0_respond_length
+	rtn
+
+dsc_hid_report_info:
+	fetch 2,mem_usb_setup_wIndex
+	beq 1,dsc_hid_report_info0
+	fetchr rega,2,mem_hidreportdesc_kb
+	branch usb0_respond_length
+dsc_hid_report_info0:
+	jam 1,mem_usb_device_enumeration_endflag
+	jam USB_GOT_REPORT_REQ,mem_usb_state
+	fetchr rega,2,mem_hidreportdesc_m
+	branch usb0_respond_length
+
+
+usb0_request_get_interface:
+	fetch 1,mem_usb0_state
+	bne DEV_CONFIGURED,usb0_force_stall		
+	fetch 1,mem_usb_setup_bmRequestType
+	bne IN_INTERFACE,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValueH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLength
+	bne 1,usb0_force_stall
+	fetch 1,mem_usb_setup_bLengthH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex+1
+	bne 0,usb0_force_stall
+	arg 1,regb
+	branch usb_send_zero_packet
+
+
+usb0_request_get_status:
+	fetch 1,mem_usb0_state
+	beq DEV_DEFAULT,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValueH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLength
+	bne 2,usb0_force_stall
+	fetch 1,mem_usb_setup_bLengthH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex+1
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bmRequestType
+	beq IN_DEVICE,usb0_get_status_in_device
+	beq IN_INTERFACE,usb0_get_status_in_interface
+	beq IN_ENDPOINT,usb0_get_status_in_endpoint
+	branch usb0_force_stall
+
+
+Usb0_SDsystem_dispose:
+	jam 1,mem_sdsystem_wakeup_flag
+	branch usb_send_two_packet
+
+usb0_get_status_in_device:
+	fetch 1,mem_usb_setup_wIndex
+	bne 0,usb0_force_stall
+	arg 2,regb
+	fetch 1,mem_usb_remote_wakeup
+	beq 0x01,Usb0_SDsystem_dispose
+//regb:length
+usb_send_zero_packet:
+	arg mem_usb_zero_packet,rega
+	branch usb0_respond
+usb_send_ones_packet:
+	arg mem_usb_ones_packet,rega
+	branch usb0_respond
+usb_send_two_packet:
+	arg mem_usb_two_packet,rega
+	branch usb0_respond
+
+usb0_get_status_in_interface:
+	fetch 1,mem_usb0_state
+	bne DEV_CONFIGURED,usb0_force_stall
+	arg 2,regb
+	branch usb_send_zero_packet
+
+usb0_get_status_in_endpoint:
+	fetch 1,mem_usb0_state
+	bne DEV_CONFIGURED,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex
+	beq IN_EP1,usb0_get_status_in_ep_in_ep1
+	beq IN_EP2,usb0_get_status_in_ep_in_ep2
+	beq IN_EP3,usb0_get_status_in_ep_in_ep3
+	and_into 0x7f,pdata
+	beq 0x00,usb0_get_status_in_ep_in_ep0
+	branch usb0_force_stall
+	
+usb0_get_status_in_ep_in_ep0:
+	fetch 1,mem_usb_ep0_stall_status
+usb0_get_status_in_ep_in_ack:
+	arg 2,regb
+	beq 1,usb_send_ones_packet
+	branch usb_send_zero_packet
+usb0_get_status_in_ep_in_ep1:
+	fetch 1,mem_usb_ep1_stall_status
+	branch usb0_get_status_in_ep_in_ack
+usb0_get_status_in_ep_in_ep2:
+	fetch 1,mem_usb_ep2_stall_status
+	branch usb0_get_status_in_ep_in_ack
+usb0_get_status_in_ep_in_ep3:
+	fetch 1,mem_usb_ep3_stall_status
+	branch usb0_get_status_in_ep_in_ack
+
+usb_get_idle:
+	jam 1,mem_usb_idle_flag
+	arg mem_usb_idle_rate,rega
+	arg 1,regb
+	branch usb0_respond
+
+usb_get_report:
+	fetch 2,mem_usb_setup_bValue
+	arg PC_GET_REPORT,temp
+	isub temp,null
+	nbranch usb0_force_stall,zero
+//	set0 mark_isstr,mark
+usb_get_report_dispose:	
+	fetch 1,mem_usb0_data_ready_report
+	nbranch usb_get_report_data_success,blank
+	jam PC_GET_NONDATA,mem_usb0_get_report_data
+usb_get_report_send_data:
+	fetch 1,mem_usb_setup_bLength
+	iforce regb
+	arg mem_usb0_get_report_data,rega
+	call usb0_respond
+usb_get_report_data_release:	
+	arg mem_usb0_get_report_data,contw
+	arg 8,loopcnt
+	branch memset0
+usb_get_report_data_success:
+	jam 0,mem_usb0_data_ready_report
+	jam PC_GET_DATA,mem_usb0_get_report_data
+	branch usb_get_report_send_data
+
+usb_get_protocol_req:
+	fetch 1,mem_usb_setup_bLength
+	bne 1,usb0_force_stall
+	jam 1,mem_usb_get_protocol_flag
+	arg 1,regb //length
+	fetch 1,mem_usb_set_protocol_value
+	beq 0,usb_get_report_protocol
+	beq 1,usb_get_boot_protocol
+	branch usb_send_zero_packet
+usb_get_report_protocol:
+	branch usb_send_ones_packet
+usb_get_boot_protocol:
+	branch usb_send_zero_packet
+
+
+
+//in device
+usb0_request_clear_feature:
+	fetch 1,mem_usb0_state
+	bne DEV_CONFIGURED,usb0_force_stall
+	fetch 1,mem_usb_setup_bLength
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLengthH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValueH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex+1
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bmRequestType
+	beq OUT_DEVICE,usb0_request_clear_feature_out_device
+	beq OUT_INTERFACE,usb0_request_clear_feature_out_interface
+	beq OUT_ENDPOINT,usb0_request_clear_feature_out_endpoint
+	branch usb0_force_stall
+
+usb0_request_clear_feature_out_device:
+	fetch 1,mem_usb_setup_bValue
+	bne DEVICE_REMOTE_WAKEUP,usb0_force_stall
+	fetch 1,core_usb_config
+	set0 7,pdata
+	store 1,core_usb_config
+	jam 0,mem_usb_remote_wakeup
+	jam 1,mem_usb_clear_remote_wakeup
+	fetch 1,mem_sdsystem_wakeup_flag
+	branch usb0_reply_zerolen,blank
+	jam 0,mem_sdsystem_wakeup_flag
+	jam 0,mem_usb_clear_remote_wakeup
+	jam USB_CONNECTED,mem_usb_state
+	branch usb0_reply_zerolen
+
+usb0_request_clear_feature_out_interface:
+	branch usb0_force_stall
+
+usb0_request_clear_feature_out_endpoint:
+	fetch 1,mem_usb_setup_bValue
+	bne ENDPOINT_HALT,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex
+	beq IN_EP1,usb0_force_stall_ep1_in_off
+	beq IN_EP2,usb0_force_stall_ep2_in_off
+	beq IN_EP3,usb0_force_stall_ep3_in_off
+	and_into 0x7f,pdata
+	beq 0x00,usb0_force_stall_ep0_in_off
+	branch usb0_force_stall
+
+usb0_force_stall_ep0_in_off:
+	jam 0,mem_usb_ep0_stall_status
+	branch usb0_reply_zerolen
+usb0_force_stall_ep1_in_off:
+	jam 0,mem_usb_ep1_stall_status
+usb0_force_stall_ep1_in_off_reply:	
+	jam 1,mem_usb_clear_halt
+	branch usb0_reply_zerolen
+usb0_force_stall_ep2_in_off:
+	jam 0,mem_usb_ep2_stall_status
+	branch usb0_force_stall_ep1_in_off_reply
+usb0_force_stall_ep3_in_off:
+	jam 0,mem_usb_ep3_stall_status
+	branch usb0_force_stall_ep1_in_off_reply
+
+
+usb0_request_set_feature:
+	fetch 1,mem_usb_setup_bLength
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLengthH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bmRequestType
+	beq OUT_DEVICE,usb0_request_set_feature_out_device
+	beq OUT_INTERFACE,usb0_request_set_feature_out_interface
+	beq OUT_ENDPOINT,usb0_request_set_feature_out_endpoint
+	branch usb0_force_stall
+
+usb0_request_set_feature_out_device:
+	fetch 1,mem_usb_setup_bValue
+	bne DEVICE_REMOTE_WAKEUP,usb0_force_stall
+	fetch 1,core_usb_config
+	set1 7,pdata
+	store 1,core_usb_config
+	jam 1,mem_usb_remote_wakeup
+	jam USB_SLEEP,mem_usb_state
+	jam 0,mem_usb_tx_win_enable
+	call usb0_reply_zerolen
+usb_wakeup_timer_reinit:
+	call timer_reinit
+	setarg TIMER_WAKEUP_DELAY
+	arg TIMER_WAKEUP,queue
+	branch timer_init
+	
+usb0_request_set_feature_out_interface:
+	branch usb0_force_stall
+
+usb0_request_set_feature_out_endpoint:
+	fetch 1,mem_usb_setup_bValue
+	bne ENDPOINT_HALT,usb0_force_stall
+	fetch 1,mem_usb_setup_bValueH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex
+	beq IN_EP1,usb0_force_stall_ep1_in_on
+	beq IN_EP2,usb0_force_stall_ep2_in_on
+	beq IN_EP3,usb0_force_stall_ep3_in_on
+	and_into 0x7f,pdata
+	beq 0x00,usb0_force_stall_ep0_in_on
+	branch usb0_force_stall
+
+usb0_force_stall_ep0_in_on:
+	jam 1,mem_usb_ep0_stall_status
+	branch usb0_reply_zerolen
+usb0_force_stall_ep1_in_on:
+	jam 1,mem_usb_ep1_stall_status
+	branch usb0_reply_zerolen
+usb0_force_stall_ep2_in_on:
+	jam 1,mem_usb_ep2_stall_status
+	branch usb0_reply_zerolen
+usb0_force_stall_ep3_in_on:
+	jam 1,mem_usb_ep3_stall_status
+	branch usb0_reply_zerolen
+
+
+usb0_request_set_address:
+	fetch 1,mem_usb_setup_bmRequestType
+	bne OUT_DEVICE,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex+1
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLength
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLengthH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValueH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue
+	and_into 0x80,pdata
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue
+	bne 0,usb_usb0_state_set_dev_addr
+usb_usb0_state_set_dev_default:	
+	jam DEV_DEFAULT,mem_usb0_state
+usb0_request_set_wait_address:
+	fetch 1,mem_usb_setup_bValue
+	store 1,core_usb_addr
+	call usb0_reply_zerolen
+	jam 1,mem_usb_set_high_addr_flag
+	rtn
+usb_usb0_state_set_dev_addr:
+	jam DEV_ADDRESS,mem_usb0_state
+	branch usb0_request_set_wait_address
+
+
+usb0_request_set_configuration:
+	fetch 1,mem_usb0_state
+	beq DEV_DEFAULT,usb0_force_stall
+	fetch 1,mem_usb_setup_bmRequestType
+	bne OUT_DEVICE,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex+1
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLength
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLengthH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue+1
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue
+	sub pdata,USB_MAX_NUM_CFG,null
+	nbranch usb0_force_stall,positive
+	fetch 1,mem_usb0_state
+	beq DEV_ADDRESS,usb0_request_set_cfg_addr_state
+	beq DEV_CONFIGURED,usb0_request_set_cfg_cfg_state
+	branch usb0_force_stall
+ // This software only supports config = 0,1
+usb0_request_set_cfg_addr_state:
+usb0_request_set_cfg_cfg_state:
+	fetch 1,mem_usb_setup_bValue	//1:Configured state   0:Address state
+	beq 0,usb0_request_set_cfg_stay_addr_state
+	jam DEV_CONFIGURED,mem_usb0_state
+	branch usb0_reply_zerolen
+usb0_request_set_cfg_stay_addr_state:
+	jam DEV_ADDRESS,mem_usb0_state
+	branch usb0_reply_zerolen
+
+
+usb0_request_set_interface:
+	fetch 1,mem_usb0_state
+	bne DEV_CONFIGURED,usb0_force_stall		
+	fetch 1,mem_usb_setup_bmRequestType
+	bne OUT_INTERFACE,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValueH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLength
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bLengthH
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_wIndex+1
+	bne 0,usb0_force_stall
+	branch usb0_reply_zerolen
+
+
+usb_set_idle:
+	bpatchx patch32_2,mem_patch32
+	jam 1,mem_usb_idle_flag
+	fetch 1,mem_usb_setup_bValueH
+	store 1,mem_usb_idle_rate
+	fetch 1,mem_usb_setup_wIndex
+	sub pdata,1,null
+	call usb_clear_remote_wakeup_set0,zero
+	fetch 1,mem_usb_state
+	bne USB_RESUME,usb0_reply_zerolen
+	jam USB_CONNECTED,mem_usb_state
+	call usb0_reply_zerolen
+	nop 30000
+	nop 30000
+	rtn
+usb_clear_remote_wakeup_set0:
+	jam 1,mem_usb_device_enumeration_endflag
+	jam 0,mem_usb_clear_remote_wakeup
+	jam USB_RESUME,mem_usb_state
+	rtn
+
+
+usb_set_report:
+	arg mem_usb0_set_report_data,contw
+	call usb_rx_data
+	jam 1,mem_usb0_get_set_report
+	call usb_set_report_resume_judge
+	fetch 2,mem_usb_setup_bValue
+	store 2,mem_usb_setup_bValue_temp
+	call usb0_reply_zerolen
+	fetch 1,mem_device_option
+	rtnne dvc_op_dongle
+	fetch 1,mem_usb_tx_win_enable
+	rtn blank
+	fetch 1,mem_usb0_set_report_data
+	store 1,mem_24g_led_status
+	jam KB_LED_ACKPAYLOAD,mem_24g_ackpayload_enable
+	rtn
+
+	
+usb_set_report_resume_judge:
+	fetch 2,mem_usb_setup_bValue
+	arg PC_SET_REPORT_bValue,temp
+	isub temp,null
+	nrtn zero
+	fetch 2,mem_usb_setup_wIndex
+	arg PC_SET_REPORT_wIndex,temp
+	isub temp,null
+	nrtn zero
+	fetch 2,mem_usb_setup_bLength
+	arg PC_SET_REPORT_bLength,temp
+	isub temp,null
+	nrtn zero
+	jam 1,mem_usb_tx_win_enable
+	rtn
+
+
+usb_set_protocol_req:
+	fetch 1,mem_usb_setup_bLength
+	bne 0,usb0_force_stall
+	fetch 1,mem_usb_setup_bValue
+	beq BOOT_PROTOCOL,usb_set_boot_protocol
+	beq REPORT_PROTOCOL,usb_set_report_protocol
+	branch usb0_force_stall
+usb_set_boot_protocol:
+	jam 0,mem_usb_set_protocol_status
+	jam 1,mem_usb_set_protocol_value
+	branch usb0_reply_zerolen
+usb_set_report_protocol:
+	jam 1,mem_usb_tx_mac_enable
+	jam 1,mem_usb_set_protocol_status
+	jam 0,mem_usb_set_protocol_value
+	branch usb0_reply_zerolen
+
+
+usb0_respond_length:
+	ifetchr regb,1,rega
+	increase 1,rega
+//rega=*buff,regb=size
+usb0_respond:
+	bpatchx patch32_3,mem_patch32
+	set1 mark_usb_first_resp,mark
+	bmark0 mark_isstr,usb0_respond_nostr
+	increase 1,regb
+	lshift regb,regb
+usb0_respond_nostr:
+	storer rega,2,mem_bufptr
+	storer regb,1,mem_remain
+	branch usb0_tx
+
+usb_no_respond_data:
+	arg 0,queue
+	branch usb_trig
+
+
+
+//mem_bufptr=*buff,mem_remain=size,loopcnt=i,rega=len
+usb0_tx:
+	bpatchx patch32_4,mem_patch32
+	fetch 1,core_usb_txbusy
+	rtnbit1 0
+	fetch 1,mem_remain
+	rtn blank
+	copy pdata,loopcnt
+	iforce temp
+	fetch 2,mem_usb_setup_bLength
+	sub pdata,EP0_PACKET_SIZE,null
+	branch usb0_tx_short,positive
+	sub loopcnt,EP0_PACKET_SIZE,null
+	branch usb0_tx_info,positive
+	force EP0_PACKET_SIZE,loopcnt
+	branch usb0_tx_info
+usb0_tx_short:
+	isub loopcnt,null
+	branch usb0_tx_info,positive
+	iforce loopcnt
+	store 1,mem_remain
+usb0_tx_info:
+	fetch 1,mem_remain
+	isub loopcnt,pdata
+	store 1,mem_remain
+	add loopcnt,-1,pdata
+	store 1,mem_usb_txbuf
+	bmark0 mark_isstr,usb0_tx_nostr
+	rshift pdata,pdata
+	add loopcnt,-1,pdata
+	store 1,mem_usb_txbuf
+	bmark0 mark_usb_first_resp,usb0_tx_nostr
+	set0 mark_usb_first_resp,mark
+	istoret 1,contw
+	setarg 3
+	istore 1,contw
+	increase -1,loopcnt
+	copy loopcnt,pdata
+	nbranch usb0_tx_nostr,zero
+	increase 1,loopcnt
+usb0_tx_nostr:
+	fetch 2,mem_bufptr
+	copy pdata,contr
+usb0_tx0:
+	ifetch 1,contr
+	istore 1,contw
+	bmark0 mark_isstr,usb0_tx1
+	setarg 0
+	istore 1,contw
+usb0_tx1:
+	loop usb0_tx0
+	copy contr,pdata
+	store 2,mem_bufptr				//mem_bufptr += len
+	setarg mem_usb_txbuf
+	store 2,core_usb_tx_saddr0
+	arg 0,queue
+	call usb_trig
+	fetch 1,mem_remain
+	nrtn blank
+	fetch 1,mem_usb_state
+	rtnne USB_GOT_REPORT_REQ
+	jam USB_CONNECTED,mem_usb_state
+	rtn
+
+
+
+usb_tx_ep1:
+	arg 1,queue
+	arg mem_usb_txbuf1,rega
+	storer rega,2,core_usb_tx_saddr1
+usb_tx_buf:
+	add loopcnt,-1,pdata
+	istore 1,rega
+usb_tx_loop:
+	ifetch 1,contr
+	istore 1,contw
+	loop usb_tx_loop
+usb_trig:
+	setarg 0
+	qset1 pdata
+	store 1,core_usb_trig
+	rtn
+
+usb_tx_ep2:
+	arg 2,queue
+	arg mem_usb_txbuf2,rega
+	storer rega,2,core_usb_tx_saddr2
+	branch usb_tx_buf
+
+usb_tx:
+	bpatchx patch32_5,mem_patch32
+	fetch 1,mem_usb_tx_enable
+	rtn blank
+	fetch 1,mem_usb_device_enumeration_endflag
+	branch usb_tx_fifo_release,blank
+	fetch 1,mem_usb_state
+	beq USB_SLEEP,usb_windows_wakeup
+	bne USB_CONNECTED,usb_tx_fifo_release
+	fetch 1,mem_usb_clear_remote_wakeup
+	nbranch usb_tx_fifo_release,blank
+	call usb_tx_data_ep1
+	branch usb_tx_data_ep2
+
+usb_tx_data_ep1:
+	fetch 1,core_usb_txbusy
+	rtnbit1 1
+	fetch 1,mem_usb_tx_enable
+	rtnbit0 1
+	fetch 1,mem_usb_tx_enable
+	set0 1,pdata
+	store 1,mem_usb_tx_enable
+	fetch 1,mem_usb_ep1_data
+	rtn blank
+	beq USB_EP1_KB,usb_tx_kb_normal_data
+	branch assert
+
+usb_tx_data_ep2:
+	fetch 1,core_usb_txbusy
+	rtnbit1 2
+	fetch 1,mem_usb_tx_enable
+	rtnbit0 2
+	fetch 1,mem_usb_tx_enable
+	set0 2,pdata
+	store 1,mem_usb_tx_enable
+	fetch 1,mem_usb_ep2_data
+	rtn blank
+	beq USB_EP2_MS,usb_tx_ms_data
+	beq USB_EP2_MULTIKEY,usb_tx_kb_multikey_data
+	beq USB_EP2_SYSTEMKEY,usb_tx_kb_systemkey_data
+	branch assert
+
+usb_tx_fifo_release:
+	//clear mem_usb_mouse_data/mem_usb_kb_data/mem_usb_kb_multikey/mem_usb_kb_system
+	arg mem_usb_mouse_data,contw
+	arg 8,loopcnt
+	branch memset0
+	
+usb_tx_ms_data:
+	fetch 1,mem_usb_idle_flag
+	fetcht 1,mem_usb_get_protocol_flag
+	iand temp,pdata
+	branch usb_tx_ms_data_normal_mode,blank
+	fetcht 1,mem_usb_set_protocol_status
+	iadd temp,pdata
+	beq MAC_BOOT_MODE,usb_tx_ms_data_mac_boot_mode
+	branch usb_tx_ms_data_normal_mode
+
+usb_tx_ms_data_mac_boot_mode:
+	jam 0,mem_usb_ep2_data
+usb_tx_ms_data_mac_boot_regroup:
+	fetch 1,mem_usb_mouse_data+1	//key
+	beq R_KEY,usb_tx_mac_boot_ms_regroup_r_or_lrkey
+	beq LR_KEY,usb_tx_mac_boot_ms_regroup_r_or_lrkey
+	fetch 1,mem_usb_mouse_data+1	//key
+	store 1,mem_usb_mouse_data
+	fetch 1,mem_usb_mouse_data+2	//x low
+	istore 1,contw
+	fetch 1,mem_usb_mouse_data+4	//y low
+	istore 1,contw
+	fetch 1,mem_usb_mouse_data+6	//wheel
+	istore 1,contw
+	arg 4,loopcnt
+	arg mem_usb_mouse_data,contr
+	branch usb_tx_ep2
+	
+usb_tx_ms_data_normal_mode:
+	jam 0,mem_usb_ep2_data
+usb_tx_mac_boot_ms_regroup_r_or_lrkey:	
+	arg 8,loopcnt		
+	arg mem_usb_mouse_data,contr
+	branch usb_tx_ep2
+
+usb_tx_kb_multikey_data:
+	jam 0,mem_usb_ep2_data
+	arg 3,loopcnt
+	arg mem_usb_kb_multikey,contr
+	branch usb_tx_ep2
+
+usb_tx_kb_normal_data:
+	jam 0,mem_usb_ep1_data
+	arg 8,loopcnt
+	arg mem_usb_kb_data,contr
+	branch usb_tx_ep1
+
+usb_tx_kb_systemkey_data:
+	jam 0,mem_usb_ep2_data
+	arg 2,loopcnt
+	arg mem_usb_kb_system,contr
+	branch usb_tx_ep2
+
+usb_inwake_state_tx_dispose:
+	fetch 1,mem_usb_state
+	beq USB_CONNECTED,usb_mac_wakeup_trig
+	rtn
+usb_mac_wakeup_trig:
+	fetch 1,core_usb_config
+	set1 7,pdata
+	store 1,core_usb_config
+	jam 1,mem_usb_mac_wakeup_trig
+	rtn
+
+usb_mac_wakeup_judge:
+	fetch 1,mem_usb_state
+	rtneq USB_SLEEP
+	beq USB_CONNECTED,usb_mac_wakeup
+	rtn
+usb_mac_wakeup:
+	fetch 1,mem_usb_mac_wakeup_trig
+	rtn blank
+	jam 1,mem_usb_wakestate_onetime_flag
+	branch usb_wakeup
+
+usb_windows_wakeup:
+	arg TIMER_WAKEUP,queue
+	call timer_check
+	nrtn blank
+usb_wakeup:
+	fetch 1,core_usb_config
+	rtnbit0 7	//endpoint wakeup enable
+	jam 0xfc,core_usb_config
+	nop 30000
+	jam 0x3c,core_usb_config
+	rtn
+
+
+endif
+
Index: program/utility.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/utility.prog	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/program/utility.prog	(working copy)
@@ -0,0 +1,1175 @@
+
+right_shift_n: //rshiftN pdata,pdata
+	sub loopcnt,0,null
+	rtn zero
+right_shift_n_loop: 
+	rshift pdata,pdata
+	loop right_shift_n_loop
+	rtn
+
+/* lshift. 0:1 byte; 1:2byte; 2:4byte; 3:8byte; 4:16byte*/
+left_shift_n:
+	force 1,pdata
+	sub loopcnt,0,null
+	rtn zero
+left_shift_n_loop:
+	lshift pdata,pdata
+	loop left_shift_n_loop
+	rtn
+push_stack:
+	storer contw,2, mem_contw
+	storet 8,mem_temp
+	storer timeup,4,mem_timeup
+	call push_stack_rega_b_c
+	storer contr,2, mem_contr
+	storer loopcnt,2, mem_loopcnt
+	storer queue,2,mem_queue
+	rtn
+
+push_stack_rega_b_c:
+	storer rega,4, mem_rega
+	storer regb,4, mem_regb
+	storer regc,3, mem_regc
+	rtn
+
+pop_stack:
+	fetch 2, mem_contw
+	iforce contw
+	fetcht 8,mem_temp
+	fetchr timeup,4,mem_timeup
+	call pop_stack_rega_b_c
+	fetchr loopcnt,2,mem_loopcnt
+	fetchr queue,2,mem_queue
+	fetch 2,mem_contr
+	iforce contr
+	rtn
+
+pop_stack_rega_b_c:
+	fetchr rega,4, mem_rega
+	fetchr regb,4, mem_regb
+	fetchr regc,3,mem_regc
+	rtn
+
+get_contw:
+	fetch 2,mem_contw
+	copy pdata,contw
+	rtn
+get_contr:
+	fetch 2,mem_contr
+	copy pdata,contr
+	rtn
+store_contw:
+	copy contw,pdata
+	store 2,mem_contw
+	rtn
+store_contr:
+	copy contr,pdata
+	store 2,mem_contr
+	rtn	
+	
+
+//
+save_cont_pointers:
+	copy contw,pdata
+	store 2,mem_hold_contw
+	copy contr,pdata
+	store 2,mem_hold_contr
+	rtn
+load_cont_pointers:
+	fetch 2,mem_hold_contw
+	copy pdata,contw
+	fetch 2,mem_hold_contr
+	copy pdata,contr
+	rtn
+
+
+//input pdata,temp 1byte
+//output rega:diff
+get_diff:
+	isub temp,rega
+	rtn positive
+	arg 0x100,rega
+	iadd rega,pdata
+	isub temp,rega
+	rtn	
+
+memcpy96:
+	call memcpy32
+memcpy64:
+	call memcpy32
+	branch memcpy32
+memcpy20:
+	call memcpy8
+memcpy12:
+	call memcpy8
+memcpy4:
+	ifetch 4,contr
+	istore 4,contw
+	rtn	
+memcpy8:
+	ifetch 8,contr
+	istore 8,contw
+	rtn	
+
+memcpy48:
+	call memcpy16
+memcpy32:
+	call memcpy8
+memcpy24:
+	call memcpy8
+memcpy16:
+	call memcpy8
+	branch memcpy8
+
+delay:
+	increase -1,pdata
+	nop 38
+	nbranch delay,blank
+	rtn
+
+
+delay_10ms:
+	arg 10,loopcnt
+delay_ms_wait:
+	nop 12000
+	loop delay_ms_wait
+	rtn
+
+bn_zero:
+	force 3,loopcnt
+memset0:
+	force 0,pdata
+memset8:
+	istore 8,contw
+	loop memset8
+	rtn
+
+
+memset0_16:
+	call memset0_8
+memset0_8:
+	force 0,pdata
+	istore 8,contw
+	rtn
+memset0_4:
+	force 0,pdata
+	istore 4,contw
+	rtn	
+	
+clear_mem_256:
+	force 4,loopcnt
+	branch memset0 
+clear_mem_512:
+	force 8,loopcnt
+	branch memset0 
+
+clear_mem:
+	deposit loopcnt
+	rtn blank
+	setarg 0
+clear_mem_loop:
+	istore 1,contw
+	loop clear_mem_loop
+	rtn
+	
+
+clear_temp_block:
+	arg 32,loopcnt
+	arg mem_temp_block0,contw
+	branch clear_mem
+	
+xor_loop:
+	ifetch   4,regc
+	ifetcht 4,rega
+	ixor     temp,pdata
+	istore   4,contw	
+	increase 4,rega
+	increase 4,regc
+	loop  xor_loop
+	rtn
+	
+// 11 22 -> 22 11; 11 22 33 -> 33 22 11 
+// rega:data addr ;loopnct:length
+inverse_data:
+	bpatchx patch32_6,mem_patch32
+	copy loopcnt,pdata
+	sub pdata,1,null
+	rtn positive
+	iadd rega,regb	
+	increase -1,regb
+	rshift loopcnt,loopcnt
+inverse_loop:
+	ifetcht 1,rega
+	ifetch 1,regb
+	istore 1,rega
+	istoret 1,regb
+	increase -1,regb
+	increase 1,rega
+	loop inverse_loop
+	rtn
+
+/*
+	function name:inverse_data_6Byte or le2be_6Byte
+	input: pdata is data that want change
+	output:pdata is Converted data
+	used Resources:temp,contr
+*/
+le2be_6Byte:
+inverse_data_6Byte:
+	rshift32 pdata,temp
+	call inverse_data_4Byte
+	byteswap temp,temp
+	lshift16 pdata,pdata
+	ior temp,pdata
+	rtn
+
+
+/*
+	function name:inverse_data_4Byte or le2be_4Byte
+	input: pdata is data that want change
+	output:pdata is Converted data
+	used Resources:contr
+*/
+le2be_4Byte:
+inverse_data_4Byte:
+	rshift16 pdata,contr
+	byteswap contr,contr
+	byteswap pdata,pdata
+	lshift16 pdata,pdata
+	ior contr,pdata
+	rtn
+
+
+memcpy_fast:
+	deposit loopcnt
+	rtn blank
+memcpy_fast_loop:
+	increase -8,loopcnt
+	call memcpy8,positive
+	rtn zero
+	branch memcpy_fast_loop,positive
+	increase 8,loopcnt
+memcpy_fast_loop_four:
+	increase -4,loopcnt
+	call memcpy4,positive
+	rtn zero
+	branch memcpy_fast_loop_four,positive
+	increase 4,loopcnt
+	branch memcpy
+ 
+memcpy:
+	deposit loopcnt
+	rtn blank
+memcpy_loop:
+	ifetch 1,contr
+	istore 1,contw
+	loop memcpy_loop
+	rtn
+
+timer_stop:
+	setarg 0
+timer_init:
+	rshift clkn_bt,temp
+	storet 4,mem_last_clkn
+	arg mem_timers,contw
+	iforce temp
+	lshift queue,pdata
+	iadd contw,contw
+	istoret 2,contw
+	bpatchx patch32_7,mem_patch32
+	rtn
+
+timer_check_timeout:
+	arg 0x800,timeup
+	lshift16 timeup,timeup
+	iadd timeup,pdata
+	rtn
+
+
+timer_reinit:
+	arg 0,queue
+timer_check:
+	bpatchx patch33_0,mem_patch33
+	fetcht 4,mem_last_clkn
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn	
+	isub temp,null
+	ncall timer_check_timeout,positive	
+	isub temp,timeup
+	copy timeup,temp
+	arg mem_timers,contr
+	copy contr,contw
+	arg 16,loopcnt
+timer_loop:
+	ifetch 2,contr
+	isub temp,pdata
+	branch timer_counting,positive
+	force 0,pdata
+timer_counting:
+	istore 2,contw
+	loop timer_loop	
+	arg mem_timers,contr
+	lshift queue,pdata
+	iadd contr,contr
+	ifetch 2,contr
+	rtn
+
+
+
+	/* pdata 28+16 bit add temp 26+16 bit, result in temp */
+clk_add:
+	iadd temp,temp
+	copy temp, loopcnt
+	fetch 2,mem_param_rt_rthalfslot
+	isub loopcnt,pdata
+	rtn positive
+	sub pdata,0,pdata
+	rshift16 temp,temp
+	increase 1,temp
+	lshift16 temp,temp
+	ior temp,temp
+	rtn
+
+clk_diff_rt:
+	call clk_diff
+	branch clk2rt
+
+/* pdata -temp -> pdata, all are 28+16 bits, set user if negative */
+clk_diff:
+	disable user
+	isub temp,pdata
+	branch clk_diff_pos,positive
+	enable user
+	sub pdata,0,pdata
+clk_diff_pos:
+	rtnbit0 15
+	copy pdata,regab
+	arg 0x10000,temp
+	fetch 2,mem_param_rt_rthalfslot
+	isub temp,pdata
+	iadd regab,pdata
+	set0 64,pdata
+	rtn
+
+	
+
+clk2rt:
+	fetcht 2,mem_param_rt_rthalfslot
+	iforce contr
+	rshift16 pdata,pdata
+	imul32 temp,pdata
+	iadd contr,pdata
+	rtn
+
+	/* pdata = clks in, temp = lpo out */
+clk2lpo:
+	lshift8 pdata,pdata
+	lshift4 pdata,pdata
+	fetcht 3,mem_clks_per_lpo
+	idiv temp
+	call wait_div_end
+	quotient temp
+	rtn
+
+	/* rt clk -> bt+rt clk */
+clk2bt:
+	fetcht 2,mem_param_rt_rthalfslot
+	idiv temp
+	call get_div_result
+	lshift16 pdata,pdata
+	remainder temp
+	ior temp,temp
+	rtn
+
+
+
+//input:contu 
+//output:temp
+//used register: temp regab
+string2dec_from_uart:
+	arg 0,temp
+string2dec_from_uart_done:
+         copy temp,regab
+	ifetch 1,contu
+	call uchar2dialog	
+	copy regab,temp
+	call swap
+	arg 10,regb
+	imul32 regb,pdata
+	iadd temp,pdata
+	copy pdata,temp
+	loop string2dec_from_uart_done
+	rtn
+	
+
+
+uchar2dialog:
+	arg 0x3a,temp
+	isub temp,null
+	nbranch uchar2dialog_number,positive
+	arg 0x61,temp
+	isub temp,null
+	branch uchar2dialog_a2f,positive
+	arg 0x37,temp
+	isub temp,pdata
+	rtn
+uchar2dialog_number:
+	arg 0x30,temp
+	isub temp,pdata
+	rtn
+uchar2dialog_a2f:
+	arg 0x57,temp
+	isub temp,pdata
+	rtn
+
+pn9:
+	copy temp,alarm
+	setarg 0x1ff
+	force 0,regb
+pn9_loop:	
+	rshift3 pdata,rega
+	rshift rega,rega
+	ixor rega,rega
+	isolate1 0,rega
+	setflag true,9,pdata
+	rshift temp,temp
+	isolate1 0,pdata
+	setflag true,7,temp
+	rshift pdata,pdata
+	increase 1,regb
+	compare 0,regb,0x7
+	nbranch pn9_loop,true
+	istoret 1,contw
+	loop pn9_loop
+	copy alarm,temp
+	rtn
+
+	// contr: rxdata, loopcnt is count. result in quotient
+calc_average:
+	setarg 0
+	copy loopcnt,rega
+calc_average_loop:
+	ifetcht 2,contr
+	iadd temp,pdata
+	loop calc_average_loop
+	idiv rega
+
+get_div_result:
+	call wait_div_end
+	quotient pdata
+	rtn
+
+wait_div_end:	
+	rtn modone
+	branch wait_div_end
+
+
+
+//input:
+//	count:loopcnt str1:rega str2:regb
+//output:
+//	same:set flag zero ,diff not set flag zero
+// using:
+//	reg:temp null flag:zero
+compare_loop:
+string_compare:
+	ifetch 1,rega
+	ifetcht 1,regb
+	isub temp,null
+	nrtn zero
+	increase 1,rega
+	increase 1,regb
+	loop string_compare
+	force 0,null
+	rtn
+
+	/* pdata = temp if pdata > temp */
+ceiling:
+	isub temp,null
+	nrtn positive
+	deposit temp
+	rtn
+	
+swap:
+	iadd temp,pdata
+	isub temp,temp
+	isub temp,pdata
+	rtn
+
+clean_mem:
+	arg 0x200,loopcnt
+	arg 0x4000,contw
+	branch memset0				// clear xram at boot
+
+	//cb function ptr in pdata
+callback_func:
+	rtn blank
+	copy pdata,pc	//rtn through cb functon.
+	//branch assert
+
+wait_uarttx:
+	fetch 2,core_uart_txitems
+	nbranch wait_uarttx,blank
+	rtn
+
+ice_break:
+	jam 0x1,core_ice_ctrl
+	rtn
+
+ice_setbp:
+	store 2,core_ice_break0
+	fetch 1,core_ice_ctrl
+	set1 4,pdata
+	store 1,core_ice_ctrl
+	rtn
+ice_setbp2:
+	store 2,core_ice_break1
+	fetch 1,core_ice_ctrl
+	set1 6,pdata
+	store 1,core_ice_ctrl
+	rtn
+	
+ice_set_write_bp:
+	store 2,core_ice_break0
+	jam 0x30,core_ice_ctrl
+	rtn
+	
+test_no_white:
+	fetch 1,core_config
+	set1 whiteoff_bit,pdata
+	store 1,core_config			/* whitening off */
+	rtn
+
+test_enable_white:
+	fetch 1,core_config
+	set0 whiteoff_bit,pdata
+	store 1,core_config			/* whitening on */
+	rtn
+
+check_uart_tx_buff:
+	fetch 2,core_uart_txitems
+	arg UART_AIR_CONTROL_THRESHOLD,temp
+pdata_sub_temp:
+	isub temp,null
+	rtn
+
+	//fuction fifo_in
+	//rega pointer to fifo memory , *(rega+len) is the end of fifo
+	//mem_fifo_temp data into fifo
+	//assert if fifo was full
+fifo_in:
+	bpatchx patch33_1,mem_patch33
+	ifetcht UTIL_FIFO_LEN,rega
+	and temp,0xff,pdata
+	nbranch fifo_in_push,blank
+	rshift8 temp,pdata
+	istore UTIL_FIFO_LEN,rega
+fifo_in_push:
+	increase UTIL_FIFO_LEN+UTIL_FIFO_OFFSET,rega
+	ifetch 1,rega
+	nbranch assert,blank //fifo full
+	fetch 1,mem_fifo_temp
+	istore 1,rega
+	rtn
+	
+	//fuction fifo_out
+	//rega pointer to fifo memory
+	//pdata  data from fifo, blank mains fifo empty
+fifo_out:
+	bpatchx patch33_2,mem_patch33
+	arg UTIL_FIFO_LEN,loopcnt
+	ifetch UTIL_FIFO_LEN,rega
+	rtn blank
+fifo_out_loop:
+	ifetch 1,rega
+	nbranch fifo_out_end,blank
+	increase 1,rega
+	loop fifo_out_loop
+	branch assert
+fifo_out_end:
+	arg 0,temp
+	istoret 1,rega
+	rtn
+
+	//fuction fifo_is_empty
+	//rega pointer to fifo memory
+	//blank--- fifo is empty
+fifo_is_empty:
+	ifetch UTIL_FIFO_LEN,rega
+	rtn
+
+	//fuction fifo_is_full
+	//rega pointer to fifo memory
+	//blank--- fifo is NOT full
+fifo_is_full:
+	ifetch 1,rega
+	rtn
+	//rega pointer to fifo memory
+	//blank--- fifo is NOT near full
+fifo_is_near_full:
+	ifetch 2,rega
+	rtn
+
+	//rega pointer to fifo memory
+	//count output via pdata
+fifo_content_count:
+	arg 0,temp
+fifo_content_count_loop:
+	fetch 1,contr
+	loop fifo_content_count_loop,blank
+	increase 1,temp
+	loop fifo_content_count_loop
+	copy temp,pdata
+	rtn
+
+//input pdata, temp, return small in pdata	
+not_greater_than:
+	isub temp,null
+	nrtn positive
+copy_temp2pdata:
+	copy temp,pdata
+	rtn
+
+
+disable_positive:
+	force -1,null
+	rtn
+enable_positive:
+disable_zero:
+	force 1,null
+	rtn
+enable_zero:
+	force 0,null
+	rtn
+
+enable_user:
+	enable user
+	rtn
+	
+disable_user:
+	disable user
+	rtn
+	
+enable_user2:
+	enable user2
+	rtn
+	
+disable_user2:
+	disable user2
+	rtn
+
+enable_user7:
+	enable user7
+	rtn
+
+disable_blank:
+	setarg 1
+	rtn
+
+enable_blank:
+set_pdata_0:
+	setarg 0
+	rtn
+
+//input pdata :sum
+//output pdata :sum
+cal_sum:
+	sub loopcnt,0,null
+	rtn zero
+cal_sum_loop:
+	ifetcht 1,contr
+	iadd temp,pdata
+	loop cal_sum_loop
+	rtn
+
+	
+reverse_byte:
+	copy loopcnt,pdata
+	rtn blank
+	copy contr,pdata
+	iadd loopcnt,pdata
+	increase -1,pdata
+	copy pdata,contr	
+reverse_loop:
+	ifetch 1,contr
+	increase -2,contr
+	istore 1,contw
+	loop reverse_loop
+	rtn
+
+calc_k12:
+	copy timeup,regb
+
+	// regb:rxdata1, enable user for K1, result stored in contw 8 bytes
+calc_k:
+	arg mem_local_sig,regc
+	force 36,loopcnt
+	force 0,rege
+	force 0,regf
+rxcal_k1_loop:
+	call complex_mult16to8
+	preload rega
+	iadd rege,rege
+	preload temp
+	iadd regf,regf
+	increase 4,regb
+	increase 2,regc
+	loop rxcal_k1_loop
+	preload rege
+	arg 36,temp
+	call signed_div
+	istore 4,contw
+	preload regf
+	call signed_div
+	istore 4,contw
+	rtn
+
+	// regb points to 32bit complex, regc points to 16bit complex, result in rega+temp
+complex_mult16to8:
+	ifetchr nap,2,regb
+	ifetchr fhs_misc,1,regc
+	call signed_ext16by8
+	imults temp,rega
+	ifetchr fhs_misc,1,contr
+	branch complex_not_conj,user
+	sub fhs_misc,0,fhs_misc
+complex_not_conj:
+	add regb,2,contr
+	ifetchr nap,2,contr
+	call signed_ext16by8
+	imults temp,regd
+	preload rega
+	isub regd,rega			// ac-bd
+	ifetchr nap,2,regb
+	preload nap
+	imults temp,regd
+	ifetchr nap,2,contr
+	ifetchr fhs_misc,1,regc
+	call signed_ext16by8
+	imults temp,temp
+	preload regd
+	iadd temp,temp
+	rtn
+
+	// regb points to 64bit complex, regc points to 64bit complex, result in rege+regf
+complex_mult32to32:
+	ifetch 4,regb
+	ifetchr rega,4,regc
+	imults rega,rege			// ac
+	ifetchr rega,4,contr
+	aligned rega,regf			// d
+	add regb,4,contr
+	ifetch 4,contr
+	imults rega,temp			// bd
+	preload rege
+	isub temp,rege			// ac-bd
+	ifetch 4,regb
+	imults regf,regf			// ad
+	ifetch 4,contr
+	ifetchr rega,4,regc
+	imults rega,pdata
+	iadd regf,regf				// ad+bc
+	rtn
+
+
+lshift14:
+	lshift16 pdata,pdata
+rshift2:
+	rshift2 pdata,pdata
+	rtn
+
+lshift6:
+	lshift8 pdata,pdata
+	branch rshift2
+
+calc_vok:
+	imul32 pdata,pdata
+rshift7:
+	rshift4 pdata,pdata
+	rshift3 pdata,pdata
+	rtn		
+
+
+	// nap:16bit signed, fhs_misc:8bit signed, output to pdata/temp
+signed_ext16by8:
+	preload nap
+	aligned fhs_misc,temp
+	rtn	
+
+
+abs32:
+	rtnbit0 31
+	force 0,temp
+	set1 32,temp
+	increase -1,temp
+	ixor temp,pdata
+	pincrease 1
+	rtn	
+
+	// pdata 32bit is input, result in regb
+sqrt:
+	iforce rega
+	arg 0,regd
+	set1 30,regd
+	arg 0,regb
+	arg 16,loopcnt
+sqrt_loop:
+	deposit regd
+	iadd regb,pdata
+	rshift regb,regb
+	isub rega,pdata
+	branch sqrt_less,zero
+	branch sqrt_greater,positive
+sqrt_less:
+	sub pdata,0,rega
+	deposit regd
+	ior regb,regb
+sqrt_greater:
+	rshift2 regd,regd
+	loop sqrt_loop
+	rtn	
+	
+	// pdata:dividend, temp:divisor
+signed_div:
+	set0 mark_temp,mark
+	bbit0 63,signed_div_unsigna
+	set1 mark_temp,mark
+	sub pdata,0,pdata
+signed_div_unsigna:
+	isolate0 63,temp
+	branch signed_div_unsignb,true
+	setflip mark_temp,mark
+	sub temp,0,temp
+signed_div_unsignb:
+	idiv temp
+	call get_div_result
+	rtnmark0 mark_temp
+	sub pdata,0,pdata
+	rtn	
+
+	// timeup: rxdata, result in regc(a) and regf(c22)
+rx_iq_comp:
+	call calc_k1
+	call calc_k2
+	call calc_absk12_sqr
+	call calc_g
+	call calc_a
+	branch calc_c22
+
+calc_k1:
+	enable user
+	arg mem_tmp_buffer,contw
+	branch calc_k12
+
+calc_k2:
+	disable user
+	branch calc_k12
+
+calc_absk12_sqr:
+	fetch 4,mem_tmp_buffer
+	fetcht 4,mem_tmp_buffer+8
+	iadd temp,pdata
+	call abs32
+	iforce temp
+	imul32 temp,rege
+	fetch 4,mem_tmp_buffer+4
+	fetcht 4,mem_tmp_buffer+12
+	isub temp,pdata
+	call abs32
+	iforce temp
+	imul32 temp,pdata
+	iadd rege,pdata
+	store 8,mem_tmp_buffer+16			// abs(K1+K2)^2
+	rtn
+
+
+calc_g:
+	arg mem_tmp_buffer,regb
+	arg mem_tmp_buffer+8,regc
+	call complex_mult32to32
+	preload rege
+	sub pdata,0,pdata
+	lshift16 pdata,pdata
+	lshift2 pdata,pdata
+	fetcht 8,mem_tmp_buffer+16
+	idiv48 temp
+	arg 0x10000,rega
+	call get_div_result
+	iadd rega,pdata
+	call sqrt
+	copy regb,rege						// g
+	rtn
+
+calc_a:
+	rshift32 temp,pdata
+	imul32 regb,rega
+	deposit regb							
+	imul32 temp,temp
+	lshift16 rega,pdata
+	lshift16 pdata,pdata
+	iadd temp,temp
+	preload regf
+	sub pdata,0,pdata
+	lshift16 pdata,pdata
+	lshift pdata,pdata
+	idiv48 temp
+	branch get_div_result					// a
+
+calc_c22:
+	rshift pdata,regc						// c21
+	imul32 pdata,temp
+	setarg 0x10000
+	isub temp,pdata
+	call sqrt
+	deposit regb
+	imul32 rege,temp
+	setarg 0
+	set1 28,pdata
+	idiv48 temp
+	call wait_div_end
+	quotient temp
+	setarg 0x1000
+	isub temp,regf						// c22
+	rtn
+
+tx_iq_precomp:
+	call calc_vok1
+	call calc_sumvok
+	call calc_ad_bc
+	call calc_omega
+	call calc_b1
+	branch calc_b2
+
+calc_vok1:	
+	fetch 1,mem_vdk
+	call calc_vok
+	store 1,mem_vok
+	rtn
+
+calc_sumvok:
+	iforce regc						// Vok(1)
+	imul32 pdata,temp
+	ifetch 1,contr
+	call calc_vok
+	istore 1,contw
+	iadd regc,rega					// sum(Vok)
+	rtn
+
+calc_ad_bc:
+	imul32 pdata,pdata
+	iadd temp,regb					// sum(Vok.^2)
+	deposit rega
+	imul32 rega,temp
+	lshift regb,pdata
+	isub temp,temp					// ad-bc
+	rtn
+
+
+calc_omega:
+	setarg 0x400000
+	idiv temp
+	call get_div_result
+	store 2,mem_omega
+	lshift16 rega,pdata
+	rshift2 pdata,pdata
+	idiv temp
+	call get_div_result
+	istore 2,contw
+	lshift8 regb,pdata
+	rshift pdata,pdata
+	idiv temp
+	call get_div_result
+	istore 2,contw
+	rtn
+	
+	
+calc_b1:
+	lshift16 regc,pdata
+	rshift2 pdata,pdata
+	idiv regb
+	call get_div_result
+	store 2,mem_b1
+	fetch 1,mem_vdk
+	call lshift6
+	idiv rega
+	call get_div_result
+	istore 2,contw
+	rtn
+	
+calc_b2:
+	fetch 1,mem_vok+1
+	call lshift14
+	idiv regb
+	call get_div_result
+	store 2,mem_b2
+	fetch 1,mem_vdk+1
+	call lshift6
+	idiv rega
+	call get_div_result
+	istore 2,contw
+	rtn	
+	
+	
+	// timeup: m_k
+tx_iq_cal:
+	arg mem_q,contw
+	arg 2,loopcnt
+	call memset0
+	arg 4,queue
+tx_iq_cal_loop:
+	call calc_mk1
+	call calc_d
+	call calc_c
+	call calc_est1
+	call calc_est2
+	call calc_u1
+	call calc_u2
+	call calc_qest
+	increase 32,timeup
+	increase -1,queue
+	nbranch tx_iq_cal_loop,zero
+
+calc_tx_c22:
+	fetch 4,mem_q
+	arg 0x100,contr
+	iadd contr,rege
+	fetch 4,mem_q+4
+	imults pdata,temp
+	setarg 0x10000
+	isub temp,pdata
+	call sqrt
+	deposit regb
+	imults rege,temp
+	setarg 0
+	set1 28,pdata
+	call signed_div
+	arg 0x1000,temp
+	isub temp,pdata
+	sub pdata,0,pdata						// c22
+	rtn
+	
+calc_mk1:
+	copy timeup,contr
+	arg 8,loopcnt
+ 	branch calc_average
+
+calc_d:
+ 	iforce regb					// M_k(1)
+	arg 8,loopcnt
+ 	branch calc_average
+
+calc_c:
+ 	iadd regb,regc				// D
+ 	fetcht 1,mem_vok+1
+ 	imul32 temp,temp
+ 	fetch 1,mem_vok
+ 	imul32 regb,pdata
+ 	iadd temp,pdata
+	rshift4 pdata,pdata
+	rshift3 pdata,rega				// C
+	rtn
+
+calc_est1:
+	fetch 2,mem_omega+2
+	imul32 regc,temp
+	fetch 2,mem_omega
+	imul32 rega,pdata
+	isub temp,regb				// est(1)
+	rtn
+
+calc_est2:
+	fetch 2,mem_omega+2
+	imul32 rega,temp
+	ifetch 2,contr
+	imul32 regc,pdata
+	isub temp,rega				// est(2)
+	rtn
+
+calc_u1:
+ 	fetch 1,mem_vok
+ 	call mults_rshift7
+	iadd rega,regf					// floor(est(1)*Vok(1)/2^7 + est(2))
+	copy timeup,regc
+	arg mem_u1,contw
+	branch theta_mul
+
+calc_u2:
+ 	fetch 1,mem_vok+1
+ 	call mults_rshift7
+	iadd rega,regf					// floor(est(1)*Vok(2)/2^7 + est(2))
+	add timeup,16,regc
+	arg mem_u2,contw
+	branch theta_mul
+
+calc_qest:
+	aligned regb,regf
+	fetchr regb,2,mem_b1
+	fetchr regc,2,mem_b2
+	arg mem_u1,rega
+	arg mem_u2,nap
+	arg mem_q,contw
+	call calc_q			
+	call calc_q
+	fetchr regb,2,mem_b1+2
+	fetchr regc,2,mem_b2+2
+	call calc_q
+	branch calc_q
+
+calc_q:
+	ifetch 4,rega
+	copy contr,rega
+	imults regb,rege
+	ifetch 4,nap
+	copy contr,nap
+	imults regc,pdata
+	iadd rege,pdata
+	lshift8 pdata,pdata
+	copy regf,temp
+	call signed_div
+	ifetchr rege,4,contw
+	isub rege,pdata
+	sub pdata,0,regd
+	istorer regd,4,contw
+	rtn	
+
+mults_rshift7:
+	imults regb,temp
+	preload temp
+	branch rshift7
+
+
+	
+	// regc points to m_k, contw points to result
+theta_mul:
+	arg 4,debug
+	arg mem_theta,nap
+theta_mul_loop0:
+	arg 0,rege
+	arg 8,loopcnt
+theta_mul_loop1:
+	ifetch 2,regc
+	copy contr,regc
+	isub regf,pdata
+	ifetchr fhs_misc,1,nap
+	copy contr,nap
+	aligned fhs_misc,temp
+	imults temp,pdata
+	iadd rege,rege
+	loop theta_mul_loop1
+	rshift8 rege,pdata
+	rshift pdata,pdata
+	istore 4,contw
+	increase -16,regc
+	increase -1,debug
+	nbranch theta_mul_loop0,zero
+	rtn
+
+clear_wake:
+	setarg 0
+	set1 19,pdata	//enable ice low wakeup
+	store 8,mem_gpio_wakeup_low
+	rtn
+
+
+
+
Index: sched/1308.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/sched/1308.dat	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/sched/1308.dat	(working copy)
@@ -0,0 +1,2 @@
+
+
Index: sched/mouse.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/sched/mouse.dat	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/sched/mouse.dat	(working copy)
@@ -0,0 +1,489 @@
+mem_device_option:08	#08 mouse
+
+mem_lpm_config:88 1f ce	#4khz
+mem_fcomp_div:18
+
+mem_rf_init_data:ff
+mem_rf_init_ptr:mem_rf_init_data
+mem_lpm_xtalcnt:70
+
+
+mem_dig_aon_vsel:00
+#hw agc
+mem_gain_fix:ff
+mem_gain_second_agc_en:00
+
+mem_mouse_flag:
+#mouse flag byte1
+#bit0 MOUSE_SELECT_DEVICE_FLAG
+#bit1 MOUSE_24G_PAIRING_FLAG
+#bit2 MOUSE_STORE_EEPROM_FLAG
+#bit3 MOUSE_BT_CANNEL_RECONN_FLAG
+#bit4 MOUSE_LOW_VOLTAGE_FLAG
+#bit5 MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG
+#bit6 MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG
+14
+
+#mouse flag byte2
+#bit0 MOUSE_ENABLE_BLE_RANDOM_ADDRE
+#bit1 MOUSE_ENABLE_2K_EEPROM
+#bit2 MOUSE_ENABLE_INIT_DELAY
+#bit3 MOUSE_ENABLE_WAKEUP_FROM_POWER
+#bit4 MOUSE_ENABLE_16M
+#bit5 MOUSE_ENABLE_USB
+09
+
+#mouse flag byte3
+#bit0 MOUSE_ENABLE_SPI2
+#bit1 MOUSE_ENABLE_24G
+#bit2 MOUSE_ENABLE_FLASH
+#bit3 MOUSE_ENABLE_EEPROM
+#bit4 MOUSE_ENABLE_ADC
+#bit5 MOUSE_ENABLE_KEYBOARD
+#bit6 MOUSE_ENABLE_24G_SEARCH_DONGLE
+5a
+
+#mouse flag byte4
+#bit0 MOUSE_ENABLE_24G_250Hz
+#bit1 MOUSE_ENABLE_24G_500Hz
+#bit2 MOUSE_ENABLE_24G_1000
+#bit3 MOUSE_ENABLE_BT_125Hz
+#bit4 MOUSE_ENABLE_DPI_LEVEL_4
+#bit5 MOUSE_ENABLE_USB_250
+#bit6 MOUSE_ENABLE_USB_500
+#bit7 MOUSE_ENABLE_USB_1000
+00
+
+#mouse flag byte5
+#bit0 MOUSE_ENABLE_POWER_ON_LED
+#bit1 MOUSE_ENABLE_LOW_VOLTAGE_LED
+#bit2 MOUSE_ENABLE_LOW_VOLTAGE_USE_MODE_LED
+#bit3 MOUSE_ENABLE_LOW_VOLTAGE_LED_BLINK_N_SECOND
+#bit4 MOUSE_ENABLE_4_LED
+#bit5 MOUSE_ENABLE_DPI_FOR_4_LED
+#bit6 MOUSE_ENABLE_BT2_FOR_4_LED
+#bit7 MOUSE_ENABLE_LOW_V_FOR_4_LED
+03
+
+#mouse flag byte6 
+#bit0 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON
+#bit1 MOUSE_ENABLE_SELECT_DEVICE_BY_PB_BUTTON
+#bit2 MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_GPIO
+#bit3 MOUSE_ENABLE_SELECT_DEVICE_BY_SWITCH_ADC
+#bit4 MOUSE_ENABLE_DPI_KEY_CONNECT_GND
+#bit5 MOUSE_ENABLE_PB_BUTTON_CONNECT_GND
+#bit6 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC
+#bit7 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING
+04
+
+#mouse flag byte7
+#bit0 MOUSE_ENABLE_AUTO_24G_PARING
+#bit1 MOUSE_ENABLE_24G_POWER_ON_PAIRING
+#bit2 MOUSE_ENABLE_COMMBINATION_KEY_BY_24G_PAIRING
+#bit3 MOUSE_ENABLE_BT_RECONNECT_TIMEOUT_ENTER_DISCOVERY
+#bit4 MOUSE_ENABLE_PB_BUTTON_SHORT_PRESS_ENTER_DISCOVERY
+#bit5 MOUSE_ENABLE_COMMBINATION_KEY_BY_BT_DISCOVERY
+#bit6 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY
+#bit7 MOUSE_ENABLE_PB_BUTTON_LONG_PRESS_DISCONVERY
+09
+
+#mouse flag byte8
+#bit0 MOUSE_ENABLE_SMOOTHER
+#bit1 MOUSE_ENABLE_XY_OFFSET
+#bit2 MOUSE_ENABLE_24G_AUTO_PAIR_NERVER_BEEN_PAIRED
+#bit3 MOUSE_ENABLE_LE_BATTERY_SERVICE_CANCEL
+#bit4 MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL
+#bit5 MOUSE_ENABLE_DOUBLE_DPI_KEY
+03
+
+
+mem_mouse_discovery_timeout:b0 04	#2min
+mem_mouse_24g_pair_timeout_init:58 02  #1min	    24g reconn timer&pair timer
+mem_mouse_direct_timeout:64  #05s
+mem_mouse_24g_reconn_timeout_init:64 #10s
+
+mem_mouse_24g_pair_tx_power:94 #-20dBm
+mem_rssi_dis_min_24g_init:85
+mem_rssi_dis_max_24g_init:90
+mem_rssi_hex_received_max_value_init:63
+mem_rssi_dis_min_ble_init:75
+mem_rssi_dis_max_ble_init:80
+
+mem_bk_button_gpio:ff
+mem_fw_button_gpio:ff
+mem_dpi_button_gpio:0d
+mem_dpi_another_button_gpio:ff
+mem_matrix_public_gpio:ff
+mem_sensor_motion_gpio:ff
+mem_customer_key_gpio:ff
+mem_whee_a_data_gpio:04
+mem_whee_b_data_gpio:05
+mem_config_device_24g_led_gpio:ff
+mem_config_device_bt1_led_gpio:ff
+mem_select_sensor_angle_gpio:08
+
+mem_lbutton_gpio:0c
+mem_rbutton_gpio:0d
+mem_mbutton_gpio:0c
+mem_config_select_device_button_gpio:ff
+mem_whee_ta_data_gpio:ff
+mem_whee_tb_data_gpio:ff
+mem_device_switch_gpio:0a
+mem_mouse_sensor_sclk_gpio:07
+mem_mouse_sensor_sdio_gpio:06
+mem_config_low_voltage_alarm_gpio:ff
+mem_config_device_bt2_led_gpio:ff
+mem_dpi_led_gpio:ff #03
+
+mem_sensor_angle_default:02	#00--6CLK   01--9CLK   02--12CLK   03--3CLK
+mem_sensor_angle_switch:00	#00--6CLK   01--9CLK   02--12CLK   03--3CLK
+mem_config_sensor_dpi:00		#00--1200   01--1600
+
+mem_mouse_logo_led_gpio:0b
+mem_mouse_logo_led_on_time_init:58 02	#1min
+mem_mouse_logo_led_blink_timer:05
+
+mem_usb_offline_check_gpio:ff
+
+
+mem_customer_key_press:
+#03 ea 00 00 00 00 00 00 00 #VOL DOWN
+#02 01 00 00 00 00 00 00 00 #POWERDOWN
+00 05 00 04 00 00 00 00 00#CTRL+ALT+A
+
+mem_customer_key_release:
+#03 00 00 00 00 00 00 00 00 #MEDIA RELEASE
+#02 00 00 00 00 00 00 00 00 #SYSTEM CRTL RELEASE
+00 00 00 00 00 00 00 00 00#STANDARD KEY RELEASE
+
+mem_lpm_mode:01
+
+
+mem_mouse_bluetooth_type:03	#03 bt3.0+ble   #02 ble   #01 bt3.0
+mem_device_number:02  #max device number   value:01,02,03
+
+mem_device_flag:
+00
+34
+ff ff ff ff ff ff
+mem_device2_type:
+34
+ff ff ff ff ff ff
+mem_device3_type:
+33
+ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff	# 3.0 fast  conn
+
+
+mem_mouse_page_to:00 40		# 16384*0.625ms=10s
+mem_mouse_fast_direct_timeout:0a #1s
+mem_mouse_fast_page_to:60 06	# 1600*0.625ms = 1s
+mem_mouse_24g_power_on_fast_conn_timer:0a 00 #1s
+mem_mouse_24g_search_dongle_time_init: 64 00
+mem_mouse_no_data_timeout:70 17 #10min
+
+mem_mouse_device_poweron_timer_count_init:14	#2s
+mem_mouse_dpi_led_delay_count_init:0a	#1s
+mem_mouse_dpi_led_blink_time: 90 01		#200ms on,200ms off
+mem_mouse_disconvey_led_blink_time: e8 03	#500ms on,500ms off
+mem_mouse_low_v_led_blink_time:90 01		#200ms on,200ms off
+
+
+#bit0:mouse_key_l    bit1:mouse_key_r  bit2:mouse_key_m
+mem_mouse_commbination_key_bt:07
+mem_mouse_commbination_key_24g:06
+
+mem_store_information_delay_timer_init:02
+
+mem_voltage_alarm_led1:03
+mem_voltage_alarm_led2:08
+mem_mouse_vdd_full_compare_vol:3e 01	#3.29V
+#adc start
+mem_adc_config_flag_init:00		#00-vinlpm   01-hvin   02-gpio
+mem_adc_channel:05 		#00-gpio4   01-gpio5   02-gpio6  03-gpio7    04-gpio9  05-gpio10  06-gpio11  07-gpio12
+#mem_mouse_vdd_full_vol:05 01		#1.5V
+#9f 00#mem_mouse_vdd_empty_vol  :0.9V
+#b1 00#mem_mouse_vdd_low_vol   :1.0V
+mem_mouse_vdd_full_vol:47 01		#3.3V
+23 01#mem_mouse_vdd_empty_vol  :3.0V
+30 01#mem_mouse_vdd_low_vol   :3.2V
+mem_mouse_vdd_button_press_vol:10 00
+mem_mouse_vdd_switch_gnd_24g_vol:52 00
+mem_mouse_vdd_switch_gnd_full_vol:35 00
+mem_mouse_vdd_switch_gnd_shutdown_voltage:21 00
+mem_mouse_vdd_switch_gnd_low_voltage:25 00
+mem_adc_read_time_init:0a 	#1s
+mem_adc_low_volatage_led_blink_timer:64 00	#10s
+#adc end
+
+mem_mouse_set_high_impedance_bit_set:00 00  00
+mem_sensor_reset_gpio:ff
+
+mem_power_on_flag:01
+
+mem_lpm_mult:20
+mem_lpm_mult_init:20
+
+mem_app_connection_options:06
+mem_lap:15 a0 c8 12 23 51
+mem_local_name_length:
+'BT3.0 Mouse
+mem_sniff_param_interval:
+0e 00 
+01 00 ##mem_sniff_param_attempt:01 00
+02##mem_sniff_param_timeout:00 00
+
+
+mem_unsniff2sniff_timer:0a
+mem_ssp_enable:01
+##mem_all_uuid_16bits:
+##06
+##03#Type: Complete list of 16-bit UUIDs
+##0011 0100 1002 1124  1200  0001
+mem_all_uuid_128bits:00
+mem_ptt:00
+
+
+mem_lmp_io_cap_payload_iocap:03 00 04
+mem_ui_profile_supported:01
+mem_eir_enable:01
+
+mem_le_adv_data_len:1f
+mem_le_adv_data:
+#flag 
+02 01 05
+
+#uuid
+03 03 12 18
+
+#appearance
+03 19 c2 03
+
+mem_le_adv_swift_pair:
+#microsoft swift pair
+06 ff 06 00 03 00 80
+#name
+'\09BT5.2 Mouse
+
+mem_le_scan_data_len:1f
+mem_le_scan_data:
+#name
+'\09BT5.2 Mouse
+
+
+mem_le_name_len:
+'BT5.2 Mouse
+
+mem_le_name_patch_len:	#max 18bytes
+'BT5.2 Mouse
+
+mem_le_interval_min:
+07 00 #min interval
+07 00 #max interval
+20 00 #latency
+2c 01 #timeout
+
+
+mem_le_adv_ind:03 12 18
+mem_le_adv_direct_ind:ff 00 00
+
+mem_le_adv_interval:00 00
+mem_le_adv_type:00 
+mem_le_adv_own_addr_type:00
+mem_le_adv_channel_map:07 
+mem_local_rx_max_octets:fb 00 48 08 fb 00 48 08  # 1b
+
+mem_le_lap:8e b1 3a 0e 8e ed
+
+
+mem_le_keyboard_handle:15 00
+mem_le_notify_handle:19 00
+mem_le_multimedia_handle:1d 00
+mem_le_systemctrl_handle:21 00
+mem_le_battery_level_handle:30 00
+mem_le_pairing_handle:2d 00
+
+mem_le_battery_level_updata_timer_init:96 #15s
+
+
+mem_spi_ncs_gpio:ff
+mem_ui_button_gpio:ff
+mem_ui_button_timeout:1e
+
+
+mem_mouse_dpi_seting:
+03##mem_320x_dpi_0  	1200/1300
+04##mem_320x_dpi_1  	1600
+01##mem_320x_dpi_2   800
+02##mem_320x_dpi_3  	1000
+
+20##mem_3212_dpi_0	1200
+2a##mem_3212_dpi_1	1600
+3f ##mem_3212_dpi_2	2400
+15##mem_3212_dpi_3   800
+
+14##mem_ka8g2_dpi_0	1200
+1b##mem_ka8g2_dpi_1	1600
+11##mem_ka8g2_dpi_2	1000
+0e##mem_ka8g2_dpi_3	800
+
+mem_sensor_3212_init:
+09 5a
+26 34
+19 04
+09 00
+ff ff
+
+mem_sensor_3204_init:
+09 5a
+0d f0
+1d e3
+7d d2
+ff ff
+
+mem_sensor_3205_init:
+09 5a
+0d 10
+1d ed
+7d 80
+ff ff
+
+mem_sensor_32xx_init:
+1b 35
+28 b4
+29 46
+2a 96
+2b 8c
+2c 6e
+2d 64
+38 5f
+39 0f
+3a 32
+3b 47
+42 10
+ff ff
+
+mem_sensor_32xx_init_1:
+54 2e
+55 f2
+61 f4
+63 70
+75 52 
+76 41
+77 ed
+78 23
+79 46
+7a e5
+7c 48
+7e 77
+7f 01
+0b 00
+7f 00
+09 00
+ff ff
+
+mem_sensor_8650_init:
+09 5a
+ff 27
+ab 40
+be d1
+a0 41
+a1 12
+a5 84
+a7 ff
+b5 d0
+b6 00
+ff 00
+09 00
+ff ff
+
+mem_sensor_ka8ul_init:
+09 5a
+0d 10
+0e c5
+5b 9a
+10 38
+11 42
+28 28
+41 23
+49 39
+4a b0
+4b a0
+4c 90
+4d 70
+09 00
+ff ff
+
+mem_sensor_8009_init:
+09 5a
+06 02
+09 69
+0d 48
+0e 9f
+0f ba
+09 00
+ff ff
+
+mem_sensor_ka8g2_init:
+09 a5
+46 34
+60 07
+69 04
+7d 20
+7e 00
+09 00
+ff ff
+
+mem_sensor_poweron_init:
+09 5a
+0b f3
+09 00
+ff ff
+
+mem_ka8g2_sensor_poweron_init:
+09 a5
+0b f3
+09 00
+ff ff	
+
+mem_ui_led_struct_ptr:mem_mouse_led_type
+mem_ui_led_struct_num:01
+
+  
+#24g init
+mem_24g_tx_phy:01#0x01:1M/0x02:2M/0x04:S2/0x84:S8
+mem_24g_rx_phy:01#0x01:1M/0x02:2M/0x04:S2/0x84:S8
+mem_24g_data_type:01        #mouse 1,kb 2
+mem_24g_max_retry:06#max tx retry
+mem_24g_rx_window:c0 12     #400us  ## e0 2e#1ms #transmitter long range min:520us
+mem_24g_interval:19
+mem_24g_interval_min:19
+mem_24g_interval_max:1c
+mem_24g_ch_map1:00 13 2c 42
+mem_24g_ch_map2:06 15 36 48
+mem_24g_ch_map3:0f 1a 3a 4c
+mem_24g_ch_map4:11 23 31 4d
+mem_24g_pair_switch:00
+mem_24g_pair_addr:20 15 10 05
+mem_24g_pair_ch:4e
+mem_24g_fast_conn_enable:01
+mem_24g_fast_conn_addr:0f 0f 0f 0f
+mem_24g_short_sleep_set:0c f8 00
+mem_24g_long_sleep_set:00 77 01
+mem_24g_enter_hibernate:00 48 60
+mem_rssi_buff_index:07
+mem_rssi_signal_buf_ptr:mem_mouse_rssi_signal_buf
+mem_power_ctrl_pac_succ_cnt_init:80
+mem_24g_long_sleep_param_update_timer_init:14 00
+mem_24g_transmit_by_interrupt_exit_count_init:50 00
+
+mem_24g_long_sleep_set1:00 a6 0e
+
+mem_flash_base:00 50 00
+mem_eeprom_base:80 1f
+mem_eeprom_block_size:80
+
+mem_tx_power:01#3dbm
+
+
+
Index: util/crc16.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: util/crc16.exe
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: util/crc16.pl
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/util/crc16.pl	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/util/crc16.pl	(working copy)
@@ -0,0 +1,27 @@
+$debug = 0;
+$crc = 0xffff;
+$i = 0;
+$offset = 0xffff;
+$source_file = $ARGV[0];
+$offset = $ARGV[1];
+
+open(EEP,"$source_file") or die $!;
+
+while (<EEP>) {    
+	$c = hex();
+
+  if($i >= $offset){
+  	if($debug){printf "%02x\t", $c;}
+  	$crc  = ($crc >> 8) | ($crc << 8);
+		$crc ^= $c & 0xff;
+		$crc ^= ($crc & 0xff) >> 4;
+		$crc ^= $crc << 12;
+		$crc ^= ($crc & 0xff) << 5;
+		$crc &= 0xffff;
+  }
+  $i ++;
+  if($debug){printf "%02x\t", $crc;}
+  printf "%02x\n", $c;
+}
+
+printf "%02x\n%02x\n", (($crc >> 8) & 0xff),($crc & 0xff);
Index: util/eeprom2fulleeprom.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: util/eeprom2fulleeprom.exe
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: util/eeprom2fulleeprom.pl
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/util/eeprom2fulleeprom.pl	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/util/eeprom2fulleeprom.pl	(working copy)
@@ -0,0 +1,18 @@
+
+
+
+$source_file = $ARGV[0];
+$eeprom_size = $ARGV[1];
+
+open(EEP,"$source_file") or die("cannot open files");
+for ($i = 1 ;$i<=$eeprom_size*128-2;$i++)
+{
+
+    while (<EEP>) { 
+        $c = hex();
+        printf "%02x\n", $c;
+        $i++;
+    }
+
+	printf "FF\n";
+}
Index: util/mergepatch.pl
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/util/mergepatch.pl	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/util/mergepatch.pl	(working copy)
@@ -0,0 +1,276 @@
+#!/usr/bin/perl
+$defs = "";
+
+sub alloc {
+	my($end, %mc) = @_;
+	my(%eadr) = ();
+	my($tstr, $str, $i, $j, $addr);
+	my($tstr) = "";
+	
+	foreach $i (sort keys %mc) {
+		if($i =~ /(.+)_(.+)/ && exists($eadr{$1})) {
+			$addr = $eadr{$1};
+		} else {
+			$addr = $end;
+		}
+		for($j = 0;$j <= $#{$mc{$i}};$j++) {
+			if($mc{$i}[$j] =~ /^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/) {
+				$str = sprintf "0x%04x %s%s\n", $addr, $2, $3;
+				$var{$2} = $addr;
+				$addr += $1;
+				$tstr .= $str;
+			}
+		}
+		$eadr{$i} = $addr;
+	}
+	if($addr > 0x4000) {
+		$xend = $addr if($addr > $xend);
+	} else {
+		$bend = $addr if($addr > $bend);
+	}
+	return $tstr . "\n";
+}
+
+
+sub malloc {
+	$path="output/bt_format.meta";
+	open file, $path;
+	@f = <file>;
+	close file;
+	open file, ">$path";
+	$path =~ s/\/.*//;
+	open file1, ">output/memmap.format";
+	$xaddr = 0x4000;
+	$addr = 0;
+	if($#ARGV == 1) {
+		$addr = hex($ARGV[0]);
+		$xaddr = hex($ARGV[1]);
+	}
+	for($i = 0, $ocnt = 0;$i < @f;$i++) { 
+		$_ = $f[$i];
+		$start = 1 if(/^\s*memalloc\s*\(\s*$/);		# allocate from 0
+		$start = 2 if(/^\s*xmemalloc\s*\(\s*$/);	# allocate from 4000
+		$start = 3 if(/^\s*omemalloc\s*\(\s*$/);	# allocate after all xmemalloc, mutex from each other(obsolete, for compatibility)
+		if(/^\s*([ax]*)memalloc\s+([a-zA-Z_0-9]+)\s*\(\s*$/) {
+			$start = $1 eq 'a' ? 5 : $1 eq 'x' ? 6 : 7;
+			$basev = $2;
+		}
+		if($start) {
+			if(/^\s*([a-zA-Z0-9_]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/ && exists($def2{$1})) {		# macro for size
+				$_ = sprintf("%s %s %s", $def2{$1}, $2, $3);
+			}
+			if(/^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/) {
+				if($start == 1) {
+					$str = sprintf "0x%04x %s%s\n", $addr, $2, $3;
+					$var{$2} = $addr;
+					$addr += $1;
+					$bstr .= $str;
+				} elsif($start == 2) {
+					$str = sprintf "0x%04x %s%s\n", $xaddr, $2, $3;
+					$var{$2} = $xaddr;
+					$xaddr += $1;
+					$xstr .= $str;
+				} else {
+					push @ostr, $_;
+				}
+			}
+			if(/^\s*\)\s*$/) {
+				if(@ostr > 0) {
+					if($start == 3) {
+						push @{$xmalloc{$ocnt}}, @ostr;
+						$ocnt++;
+					} elsif($start == 5) {
+						push @aaddr,$basev;
+						push @amalloc,[@ostr];
+					} elsif($start == 6) {
+						push @{$xmalloc{$basev}}, @ostr;
+					} elsif($start == 7) {
+						push @{$malloc{$basev}}, @ostr;
+					} 
+				}
+				$start = 0;
+				@ostr = ();
+			}
+		} else {
+			$def2{$2} = $1 if(/^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/);
+			$sstr .= $_;
+		}
+	}
+	
+#--------------------- o/x/memalloc process -----------------------
+	$bend = $addr, $xend = $xaddr;
+	$bstr .= alloc($addr, %malloc);
+	$xstr .= alloc($xaddr, %xmalloc);
+
+#--------------------- amemalloc process -----------------------
+	for($i = 0;$i <= $#aaddr;$i++) {
+		for($j = 0, $addr = $aaddr[$i] =~ /^0x([0-9a-f]+)/ ? hex($1) : $var{$aaddr[$i]};$addr != 0 && $j <= $#{$amalloc[$i]};$j++) {
+			if($amalloc[$i][$j] =~ /^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/) {
+				$str = sprintf "0x%04x %s%s\n", $addr, $2, $3;
+				$addr += $1;
+				if($addr < 0x4000) {
+					$bstr .= $str;
+				} else  {
+					$xstr .= $str;
+				}
+			}
+		}
+	}
+
+	
+	print file $bstr, $xstr, $sstr;
+	print file1 $bstr, $xstr;
+	close file;
+	close file1;
+	printf "\nLast allocated address is %04x\n", $bend;
+	printf "\nLast allocated xmem address is %04x\n", $xend;
+}
+
+
+sub parseif {
+	my($fname) = @_;
+	open file, $fname;
+	@f = <file>;
+	close file;
+	open file, ">$fname";
+	@valid = (1);
+	for($i = 0;$i < @f;$i++) { 
+		$_ = $f[$i];
+		s/\/\*.*\*\///g;
+		$comment = 1 if(/\/\*/ && !/\/\//);
+		if($comment) {
+			$comment = 0 if(/\*\//);
+			next;
+		}
+		$defs .= $1 . " " if(/^define\s+(\w+)\s*/);
+		if(/^\s*ifdef\s+(\w+)\s*/) {
+			push @valid, ($defs =~ /(^|\s)$1(\s|$)/ ? 1 : 0) & $valid[$#valid];
+		} elsif(/^\s*ifndef\s+(\w+)\s*/) {
+			push @valid, ($defs =~ /(^|\s)$1(\s|$)/ ? 0 : 1) & $valid[$#valid];
+		} elsif(/^\s*else/) {
+			printf "%s\nelse without if at line %d\n", $f[$i - 3], $i if($#valid == 0);
+			if($#valid == 0) {
+				for($j = -10;$j < 10;$j++) {
+					print $f[$i + $j];
+				}
+				last;
+ 				$i = $i;
+			}
+			$valid[$#valid] = (1 - $valid[$#valid]) & $valid[$#valid - 1];
+		} elsif(/^\s*endif/) {
+			printf "%s\nendif without if at line %d\n", $_, $i if($#valid == 0);
+			if($#valid == 0) {
+				for($j = -10;$j < 10;$j++) {
+					print $f[$i + $j];
+				}
+				last;
+ 				$i = $i;
+			}
+			pop @valid;
+		} elsif($valid[$#valid]) {
+			if(/^include\s+(.+)\s*/) {
+				open file2, "program/$1";
+				@f2 = <file2>;
+				close file2;
+				splice(@f, $i + 1, 0, @f2);
+			} else {
+				print file $_;
+			}
+		}
+	}
+	close file;
+}
+
+sub genpatch
+{
+	print "genpatch\n";
+	$patched = 0;
+	open file,"program/patch.prog";
+	while(<file>) {
+		if(/^\s*beq\s+patch([0-9a-f]+)_([0-7]),/) {
+			$a = hex($1), $b = hex($2);
+			$bits[$a] |= 1 << $b;
+			$patched = 1;
+		}
+	}
+	close file;
+	return if(!$patched);
+	open file,"output/sched.rom";
+	@sched = <file>;
+	close file;
+	for($j = 0;$j < 0x40;$j++) { 
+		$s .= sprintf ("%02x   #mem_patch%02x\n", $bits[$j], $j);
+	}
+	$s .= "\n\n";
+	for($i = $skip = 0;$i < @sched;$i++) {
+		$_ = $sched[$i];
+		if($skip > 0 && /:/) {
+			splice(@sched, $skip, $i - $skip, $s);
+			last;
+		}
+		$skip = $i + 1 if(/^mem_patch00:\s*$/);
+	}
+	if($skip == 0) {
+		$s = "mem_patch00:\n" . $s;
+		splice(@sched, 0, 0, $s);
+	}
+	open file,">output/sched.rom";
+	for($i = 0;$i < @sched;$i++) { print file $sched[$i]; }
+	close file;
+}
+
+sub zcode {
+	open file, "output/bt_program23.meta";
+	@f = <file>;
+	close file;
+	for($i = $label = $line = 0, $z = 1;$i < @f;$i++) {
+		$_ = $f[$i];
+		$line = $i - 1 if(/^org\s+0x[23]000/ && $line == 0);
+		if(/^org z\s*$/) {
+			$z += 0x10000;
+			$f[$i] = sprintf("org 0x%x\n", $z);
+			$label = 1;
+		}
+		if(/^(\w+):\s*$/ && $label == 1) {
+			$lab{$1} = $z;
+			$label = 2;
+		}
+	}
+	return if($z == 1);
+	for($i = 0;$i < @f;$i++) {
+		$_ = $f[$i];
+		$label = "";
+		if(/^\s*(branch|nbranch|call|ncall)\s+(\w+)\s*$/ || /^\s*(branch|nbranch|call|ncall)\s+(\w+)\s*,\s*(\w+)\s*$/) {
+			$label = $2;
+		}
+		if(/^\s*(bmark|beq|bne|bbit[01])\s+(\w+)\s*,\s*(\w+)\s*$/) {
+			$label = $3;
+		}
+		if(exists($lab{$label})) {
+			$nlabel = "jmpz_" . $label;
+			$f[$i] =~ s/$label/eval "$nlabel"/e;
+			if($lab{$label} > 100) {
+				$f[$line] .= sprintf("%s:\n\tsetarg 0x%x\n\tbranch p_zcode_entrance_2Bytes_common\n\n", $nlabel, int($lab{$label}/0x1000));
+				$lab{$label} = 1;
+			}
+		}
+	}
+	open file, ">output/bt_program23.meta";
+	for($i = 0;$i < @f;$i++) {
+		if($f[$i] =~ /^\s*bbit1 8,pf_patch_ext\s*$/) {
+			printf file ("p_start:\n\tbranch p_patch_array\n\np_zcode:\n");
+			for($j = 0;$j < 63;$j++) {
+				printf file "\tnop %d\n", $j + 1;
+			}
+			printf file "p_patch_array:\n";
+		}
+		print file $f[$i];
+	}
+	close file;
+}
+
+parseif("output/bt_program23.meta");
+parseif("output/bt_format.meta");
+genpatch() if($defs !~ / SIM /);
+malloc();
+zcode();
Index: util/patch.pl
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/util/patch.pl	(nonexistent)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/YJX_223_logo_multi_2ch/util/patch.pl	(working copy)
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+
+
+
+@dirs = (".");
+while(@dirs){
+   $d = $dirs[0];
+   opendir folder, $d || die "Can not open this directory";
+   @filelist = readdir folder; 
+   closedir folder;
+   foreach (@filelist) {
+      $f = $d . "/" . $_;
+      next if($_ eq "." || $_ eq "..");
+      push(@dirs, $f) if(-d $f) ;
+      push(@files,$f) if(-f $f);
+    }
+   shift @dirs;
+}
+
+for($i = 0;$i < @files;$i++) {
+	if($files[$i] =~ /bt\.prog/) {
+		($files[$i],$files[0]) = ($files[0],$files[$i]);
+		last;
+	}
+}
+
+
+for($i = $byte = $bit = 0;$i < @files;$i++) {
+	next if($files[$i] =~ /patch\.prog|sim\.prog/ || $files[$i] !~ /\.prog/);
+	open(FILE, $files[$i]) or next;
+	@file = <FILE>;
+	close FILE;
+	open(FILE, "> $files[$i]");
+	for($j = 0;$j < @file;$j++) {
+		$_ = $file[$j];
+		if(/bpatch.*,.*/) {
+			printf FILE "\t%s patch%02x_%d,mem_patch%02x\n", $byte > 31 ? "bpatchx" : "bpatch" , $byte, $bit, $byte;
+			if(++$bit > 7)
+			{
+				$bit = 0;
+				$byte++;
+			}
+		} else {
+			print FILE $_;
+		}
+	}
+	close(FILE);
+}
+printf "Total patches : %d, last patch number is:%02x bit %d\n", $byte*8+$bit, $byte, $bit;
