Index: a.bat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/a.bat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/a.bat	(working copy)
@@ -0,0 +1,10 @@
+e pu
+e 8043 00
+
+e hu output/romcode.rom 3800
+e ku
+e pu
+e hu output/ramcode.rom 0
+e pu
+e su output/sched.rom
+e cu
\ No newline at end of file
Index: do.bat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/do.bat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/do.bat	(working copy)
@@ -0,0 +1,88 @@
+@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
+@set eeprom_fill=0
+@set sched_optimize=1
+@set device_option=basic_mouse_24g
+@rem set device_option=basic_mouse_24g_ble
+@rem set device_option=enhanced_mouse_24g
+@rem set device_option=enhanced_mouse_24g_ble
+@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\app_light\remoter\*.prog) do @set light_progs=!light_progs! %%f
+for %%f in (program\app_light\fan\*.prog) do @set light_progs=!light_progs! %%f
+for %%f in (program\app_light\common\*.prog) do @set light_progs=!light_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% %light_progs% > output\bt_program23.meta
+
+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\app_light_format\*.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
+
+perl util/mergepatch.pl 
+
+if "%device_option%" equ "basic_mouse_24g" (
+  copy sched\1306.dat + sched\mouse_basic.dat output\sched.rom
+) else if "%device_option%" equ "basic_mouse_24g_ble" (
+  copy sched\1306.dat + sched\mouse_basic.dat + sched\ble.dat output\sched.rom
+) else if "%device_option%" equ "enhanced_mouse_24g" (
+  copy sched\1306.dat + sched\mouse_enhanced.dat output\sched.rom
+) else if "%device_option%" equ "enhanced_mouse_24g_ble" (
+  copy sched\1306.dat + sched\mouse_enhanced.dat + sched\ble.dat output\sched.rom
+) else (
+
+cd ..
+echo **********************************
+echo Error: illegal device_option !
+echo **********************************
+goto end
+) 
+
+
+
+cd output
+osiuasm bt_program23 -O-W
+
+
+if "%sched_optimize%" equ "1" (
+echo ***********optimizing sched begin***********
+perl ../util/deletenote.pl ../output/sched.rom
+perl ../util/transform_name2addr.pl ../output\sched.rom ../output/sched.rom ../output/memmap.format
+perl ../util/sortsched.pl ../output/sched.rom ../output/sched.rom
+)
+
+
+geneep -n 
+::geneep -n -k key.dat
+
+
+if "%eeprom_fill%" equ "1" (
+echo ***********filling eeprom begin***********
+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 
+)
+
+
+echo ***********generating authrom begin***********
+perl ../util/mergepatch.pl mouse_ble_att_list usb_kbdata_vendor_define usb_kbdata usb_msdata usb_devicedata usb_confdata  ble_shutter_dy_gatt_list  ble_shutter_dy_mousekey_value_list frmt_xbox
+perl ../util/romcrc.pl romcode.rom
+
+
+:end
+
Index: eotp.bat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/eotp.bat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/eotp.bat	(working copy)
@@ -0,0 +1,6 @@
+call do eep
+e pu
+e 8043 00
+e otp output/eeprom.dat 0
+e otr 0 20
+e ku
Index: format/app.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app.format	(working copy)
@@ -0,0 +1,318 @@
+
+memalloc(
+
+/* load code */
+1 mem_ucode_device_flag
+1 mem_peripheral_lock_flag
+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_app_evt_timer_count
+1 mem_load_delay
+1 mem_load_check_sum
+)
+
+xmemalloc(
+
+/*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_idle_process
+2 mem_cb_bb_event_process
+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_before_lpm_sleep
+
+2 mem_eeprom_base
+
+//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
+
+
+//adc
+4 mem_gpio_h_k19_b13
+4 mem_gpio_l_k19_b13
+4 mem_hvin_k19_b13
+1 mem_app_adc_read_count
+1 mem_start_adc_clkn
+2 mem_adc_delay
+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
+
+
+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_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_set_cdb_on
+1 mem_syn_cal_ctrl
+
+1 mem_dig_aon_vsel
+1 mem_syn_afc_cfg1
+1 mem_rf_ldo_cfg1
+1 mem_rc_cal
+
+1 mem_nec_decode_error_value
+
+ifdef AC_50HZ
+1 mem_ac_detect_gpio
+0 mem_ac_detect_control
+1 mem_ac_detect_div
+1 mem_ac_detect_window
+endif
+
+1 mem_wdt_always_work
+
+1 mem_power_ctrl_disable
+)
+//adc read
+(
+1 ADC_CONFIG_HVIN
+3 ADC_CONFIG_GPIO_L
+4 ADC_CONFIG_GPIO_H
+)
+
+(
+34 NV_DATA_LEN
+-1 DECREASED_ONE
+)
+
+(
+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
+
+)
+
+
+(
+3 OTP_UFLAG_AES
+2 OTP_UFLAG_SKIP_EEP
+1 OTP_UFLAG_SKIP_FLASH
+0 OTP_UFLAG_HCI
+)
+
+//OTP
+(
+0 OTP_OFFSET_UCODE_FLAG
+
+0x7d0 OTP_OFFSET_DEVICE_FLAG  
+0x7d1 OTP_OFFSET_PERIPHERALS_LOCK
+0x7d2 OTP_OFFSET_APP_VDD_SEL
+0x7d3 OTP_OFFSET_LOADCODE_DELAY
+0x7d4 OTP_OFFSET_LOADCODE_CHECKSUM
+
+0x7e0 OTP_OFFSET_ADC_PARAM
+0x7f0 OTP_OFFSET_UCODE_KEY
+)
+
+
+(
+//OTP_OFFSET_PERIPHERALS_LOCK
+0 OTP_SPI_LOCK_BIT
+2 OTP_UART_LOCK_BIT
+4 OTP_IIC_LOCK_BIT
+)
+
+
+
+/*mem_device_option*/
+(
+4 dvc_op_dongle
+5 dvc_op_test
+7 dvc_op_mouse_24g
+8 dvc_op_mouse
+9 dvc_op_shutter
+0x0a dvc_op_shutter_dy
+0x0b dvc_op_light
+0x0c dvc_op_car
+0x0f dvc_op_car_lock_app_and_ble
+   
+)
+
+
+(
+7 gpio_active_bit
+)
+
+(
+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
+7 APP_DISC_BLE
+)
+
+//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 MOUSE_BLE_ATT_LIST_ADDR
+0x9272 USB_KBDATA_VENDOR_DEFINE_ADDR
+0x928d USB_KBDATA_ADDR
+0x92cd USB_MSDATA_ADDR
+0x9371 USB_DEVICEDATA_ADDR
+0x9384 USB_CONFDATA_ADDR
+0x93c0 BLE_SHUTTER_DY_GATT_LIST_ADDR
+0x9535 BLE_SHUTTER_DY_MOUSEKEY_VALUE_LIST_ADDR
+0x97b5 FRMT_XBOX_ADDR
+0x97fc mem_sim_slave
+)
+
+(//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_car.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_car.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_car.format	(working copy)
@@ -0,0 +1,335 @@
+
+
+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
+
+
+4 mem_car_24g_commom_addr
+4 mem_car_24g_commom_addr_temp
+4 mem_car_24g_commom_addr_read
+1 mem_car_save_addr_flag
+400 mem_ble_att_list
+)
+
+(
+//20ms
+0x0020	FAST_ADV_INTERVAL_VALUE_CAR
+)
+
+(
+0x19 ATT_CAR_CONTROL_HANDLE
+0x19 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
+)
+
+(
+0x700 OTP_OFFSET_CAR_COMMOM_START_ADDR 
+0x7cc OTP_OFFSET_CAR_COMMOM_END_ADDR 
+)
+
Index: format/app_dongle.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_dongle.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_dongle.format	(working copy)
@@ -0,0 +1,132 @@
+
+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
+1 mem_dg_kb_bind_success
+1 mem_dg_pc_sleep_flag
+1 mem_dg_usb_device_iserial_number
+1 mem_dg_24g_tx_power_default
+)
+
+
+//otp address offset
+(
+0x5A DONGLE_KB_BIND_SUCCESS
+0x1fdf 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
+)
+
+(
+640 TIMER_NODATA_DELAY	//200ms
+
+384 TIMER_MS_BLANK_DELAY
+
+384 TIMER_KB_MUL_BLANK_DELAY
+
+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
+4 DG_ENABLE_KB_ICON
+3 DG_ENABLE_24G_2M
+)
+
Index: format/app_light_format/dflp_mmap.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/dflp_mmap.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/dflp_mmap.format	(working copy)
@@ -0,0 +1,186 @@
+
+
+xmemalloc ftd_rlmp_dflp(
+	//value load from otp
+	0 mem_ftd_fan_cfg_catch
+	1 mem_fan_protocol_select_flag
+	1 mem_fan_tx_pin
+	1 mem_fan_yc_identify_flag
+	1 mem_customer_id
+	1 mem_customer_id_v2
+	1 mem_id_universal
+	1 mem_manufacture_id_temp
+	1 mem_light_device_flag
+	1 mem_ble_ch_mapped
+
+	
+	//base value
+	2 mem_ble_v2_decoder
+	1 mem_light_speed_temp
+	1 mem_light_blink_count
+	2 mem_pairing_timeout
+	1 mem_light_pairing_enable
+	1 mem_light_last_packetnum
+	6 mem_yc_fan_ble_addr
+	6 mem_recv_addr
+
+	//for 433 trans code
+	2 mem_fan_tx_bits_loop
+	1 mem_fan_opcode
+	1 mem_fan_tx_cnt
+	8 mem_fan_433code_packet   //预留8字节
+	2 mem_fan_tx_loop
+	2 mem_fan_tx_loop2
+	1 mem_fan_433_opcode
+	1 mem_fan_tx_gpio
+	2 mem_fan_tx_gpio_reg
+
+	2 mem_433_tx_cb
+	2 mem_fan_packet_indiscriminate_cb
+
+	
+	//v1 v2 
+	0 mem_ble_parameter
+	2 mem_ble_parameter_cmd
+	4 mem_ble_parameter_para
+	2 mem_ble_parameter_addr
+	1 mem_ble_parameter_group
+	3 mem_fan_addr_433
+
+	
+)
+
+memalloc ftd_rlmp_dflp(
+	0 mem_base_start
+	
+	0 mem_flash_paired_addr_base
+	2 mem_flash_paired_addr0
+	1 mem_flash_paired_addr0_group
+	2 mem_flash_paired_addr1
+	1 mem_flash_paired_addr1_group
+	2 mem_flash_paired_addr2
+	1 mem_flash_paired_addr2_group
+	2 mem_flash_paired_addr3
+	1 mem_flash_paired_addr3_group
+	2 mem_flash_paired_addr4
+	1 mem_flash_paired_addr4_group
+	2 mem_flash_paired_addr5
+	1 mem_flash_paired_addr5_group
+	2 mem_flash_paired_addr6
+	1 mem_flash_paired_addr6_group
+	2 mem_flash_paired_addr7
+	1 mem_flash_paired_addr7_group
+	2 mem_flash_paired_addr8
+	1 mem_flash_paired_addr8_group
+	2 mem_flash_paired_addr9
+	1 mem_flash_paired_addr9_group
+
+	0 mem_msg_cnt_base
+	1 mem_addr0_msg_cnt
+	1 mem_addr1_msg_cnt
+	1 mem_addr2_msg_cnt
+	1 mem_addr3_msg_cnt
+	1 mem_addr4_msg_cnt
+	1 mem_addr5_msg_cnt
+	1 mem_addr6_msg_cnt
+	1 mem_addr7_msg_cnt
+	1 mem_addr8_msg_cnt
+	1 mem_addr9_msg_cnt
+	1 mem_msg_cnt_base1
+	
+	1 mem_msg_addr_save
+	30 mem_msg_before_queue
+	3 mem_count_and_random
+	1 mem_msg_cnt_judgment_window_time
+	1 mem_msg_judgment_window_time
+
+	0 mem_base_end
+
+)
+
+(
+// FET2 433 cmd code
+
+
+	0x06 FAN_433_MASTER_ON_AND_OFF
+	0x10 FAN_433_TAP_POSOTION_1
+	0X12 FAN_433_TAP_POSOTION_2
+	0X1C FAN_433_TAP_POSOTION_3
+	0X0A FAN_433_TAP_POSOTION_4
+	0X0F FAN_433_TAP_POSOTION_5
+	0X0C FAN_433_TAP_POSOTION_6
+	0X16 FAN_433_TAP_POSOTION_0
+	0X17 FAN_433_FAN_SPEED_INC
+	0X1B FAN_433_FAN_SPEED_DEC
+	0X15 FAN_433_NATURAL_WIND
+	0X03 FAN_433_PAIRING
+	0X04 FAN_433_TURNIING_FORWARD
+	0X11 FAN_433_TURNING_REVERSE
+	0x07 FAN_433_WIND_REVERSE
+	0x02 FAN_433_TIMING_TO_OFF_1HOUR
+	0X09 FAN_433_TIMING_TO_OFF_2HOUR
+	0X19 FAN_433_TIMING_TO_OFF_4HOUR
+	0X1A FAN_433_TIMING_TO_OFF_8HOUR
+	0X14 FAN_433_LAMP_ON_ONLY
+	0X18 FAN_433_LAMP_OFF_ONLY	
+	0x08 FAN_433_LAMP_ON_AND_OFF
+	0x13 FAN_433_DEFLECTOR_ON_AND_OFF
+	0x0D FAN_433_DEFLECTOR_ON
+	0x0E FAN_433_DEFLECTOR_OFF
+	0X05 FAN_433_COLOR_SWITCH
+	0X1E FAN_433_SLEEP_WIND
+	0X1f FAN_433_BUZZ
+	0x1D FAN_433_CLEAR
+)
+
+(
+0 FAN_SPEED_FLAG_OFF
+1 FAN_SPEED_FLAG_LOW
+2 FAN_SPEED_FLAG_MIDDLE
+3 FAN_SPEED_FLAG_HIGH
+
+0x01 BLE_DEV_TYPE_LAMP
+0x02 BLE_DEV_TYPE_FAN
+0x04 BLE_DEV_TYPE_FAN_LAMP
+
+	
+60 FAN_BLE_CMD_TIMING_TO_OFF_1HOUR
+120 FAN_BLE_CMD_TIMING_TO_OFF_2HOUR
+240 FAN_BLE_CMD_TIMING_TO_OFF_4HOUR
+480 FAN_BLE_CMD_TIMING_TO_OFF_8HOUR
+
+255 FAN_BLE_CMD_TIMING_TO_OFF_8HOUR_V1
+)
+
+
+(
+0x55 REMOTER_MARKER
+)
+
+(
+0x528718 FTD_REMOTER_ID_CODE
+0x08f9ff FTD_ANDRIOD4913_ID_CODE
+0xf87703 FTD_B65F_ID_CODE
+0x08f903 FTD_IOS4913_ID_CODE
+)
+
+(
+0x00 BLE_PARA_NORMAL_MODE
+0x01 BLE_PARA_SLEEP_MODE
+0x02 BLE_PARA_NATURAL_MODE
+0x03 BLE_PARA_FAN_MODE_MAX
+)
+
+(
+	4 FAN_433CODE_LEN    /*unit: bytes*/
+	3 FAN_RETRANSMISSION_TIMES
+
+	6400 	FAN_HEADER_LOW_DELAY	//FAN_8ms_DELAY_CNT
+	599 	FAN_1_HIGH_DELAY		//FAN_0_75ms_DELAY_CNT
+	200 	FAN_1_LOW_DELAY			//FAN_0_25ms_DELAY_CNT
+	200 	FAN_0_HIGH_DELAY		//FAN_0_25ms_DELAY_CNT
+	599 	FAN_0_LOW_DELAY			//FAN_0_75ms_DELAY_CNT
+	200     FAN_END_HIGH_DELAY		//FAN_0_25ms_DELAY_CNT
+	559     FAN_END_LOW_DELAY		//FAN_0_25ms_DELAY_CNT
+)
+
Index: format/app_light_format/dlmp_mmap.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/dlmp_mmap.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/dlmp_mmap.format	(working copy)
@@ -0,0 +1,57 @@
+
+
+
+
+xmemalloc ftd_dlmp(
+
+	2 mem_cb_light_ac_detecting
+	2 mem_cb_light_gradual_dimmer
+	2 mem_light_pwm_freq_w
+	2 mem_light_pwm_freq_y
+	2 mem_light_pwm_freq_l
+	2 mem_light_W_aim_pcnt
+	2 mem_light_Y_aim_pcnt
+	2 mem_light_L_aim_pcnt
+	1 mem_light_gradual_step_w 
+	1 mem_light_gradual_step_y 
+	1 mem_light_gradual_step_l 
+	2 mem_light_mix_change_delay_time
+	1 mem_temp_flag
+	1 mem_light_pwm_enable_flag
+	1 mem_light_gpio_pin_w
+	1 mem_light_gpio_pin_y
+	1 mem_light_gpio_pin_l
+
+
+)
+
+
+
+
+(
+3000 LIGHT_PWM_L_FREQ   /*WY的PWM频率,frequency = 12M / LIGHT_PWM_L_FREQ*/
+1 LIGHT_GRADUAL_STEP_L /* 灯光渐变时的pcnt步进 */
+
+6000 LIGHT_PWM_W_FREQ   /*WY的PWM频率,frequency = 12M / LIGHT_PWM_WY_FREQ*/
+12000 LIGHT_PWM_Y_FREQ   /*WY的PWM频率,frequency = 12M / LIGHT_PWM_WY_FREQ*/
+1 LIGHT_GRADUAL_STEP_WY /* 灯光渐变时的pcnt步进 */
+
+0x04 LIGHT_W_GPIO
+0x809c LIGHT_W_PCNT
+0x809e LIGHT_W_NCNT
+0 PWM_W_ENABLE_BIT  /*pwm channel,用偶数pwm channel*/
+
+0x05 LIGHT_Y_GPIO
+0x80a0 LIGHT_Y_PCNT
+0x80a2 LIGHT_Y_NCNT
+1 PWM_Y_ENABLE_BIT  /*pwm channel,用奇数pwm channel*/
+
+0x06 LIGHT_L_GPIO
+0x80a4 LIGHT_L_PCNT
+0x80a6 LIGHT_L_NCNT
+2 PWM_L_ENABLE_BIT  /*pwm channel,用奇数pwm channel*/
+
+)
+
+
+
Index: format/app_light_format/protocol_V2.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/protocol_V2.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/protocol_V2.format	(working copy)
@@ -0,0 +1,50 @@
+
+
+
+(
+0x0009 LIGHT_CMD_TURN_ON_AND_OFF_V2
+0x0010 LIGHT_CMD_TURN_ON_V2
+0x0011 LIGHT_CMD_TURN_OFF_V2
+0x0012 LIGHT_CMD_AIDED_LIGHT_TURN_ON_V2
+0x0013 LIGHT_CMD_AIDED_LIGHT_TURN_OFF_V2
+0x0015 FAN_CMD_WIND_DIRECTION_V2
+0x0016 FAN_CMD_DEFLECTOR_V2
+0x0021 LIGHT_CMD_LIGHT_CTL_V2
+0x0023 LIGHT_CMD_NIGHT_LIGHT_V2
+0X001b LIGHT_CMD_FTD_RGB_FORWARD_AND_REVERSE_V2
+0x001c LIGHT_CMD_RGB_TURN_ON_OFF_V2
+0X001d LIGHT_CMD_FTD_RGB_LOOP_V2
+0x001e LIGHT_CMD_RGB_AUTO_TURN_ON_V2
+0x001f LIGHT_CMD_RGB_AUTO_TURN_OFF_V2
+0x0022 LIGHT_CMD_RGB_MANUAL_V2
+0x0030 FAN_CMD_WIND_SPEED_CTL_V2
+0x0031 FAN_CMD_WIND_SPEED_V2
+0x0033 FAN_CMD_MODE_SEL_V2
+0x0041 CMD_TIMING_OFF
+0x0045 CMD_CLEAR_CODE
+0x0046 LIGHT_CMD_KEYPRESS_DRIVE_RETENTION_V2
+0x0047 LIGHT_CMD_BACK_TO_RETENTION_STATE_V2
+0x006f FAN_CMD_MASTER_ON_AND_OFF_V2
+0x0028 CMD_PAIRING
+0x0022 LIGHT_CMD_RGB_COLOR_SWITCH_V2
+0x0068 LIGHT_CMD_BATH_V2
+0x0067 LIGHT_CMD_AIR_CHANGE_V2
+0X0066 LIGHT_CMD_HEATING_V2
+0X0032 LIGHT_CMD_FAN_TURN_ON
+0X0031 LIGHT_CMD_FAN_TURN_OFF
+0x006f LIGHT_CMD_FTD_MASSTER_OFF_V2
+0x0079 LIGHT_CMD_SWITCH_MODE_V2
+0x0071 LIGHT_CMD_EXPAND_CODE_0X71_V2
+0x0090 LIGHT_CMD_FTD_CURTAIN_ON_OFF_V2
+0x00e9 LIGHT_CMD_FTD_GENERAL_STOP_V2
+0x00ff LIGHT_CMD_TEST_MODE_V2
+0X0024 LIGHT_CMD_HELP_SLEEP_V2
+
+0 PRODUCT_SUBTYPE
+
+
+1 PRODUCT_MAINTYPE_LIGHT
+
+
+)
+
Index: format/app_light_format/rlmp_common.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/rlmp_common.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/rlmp_common.format	(working copy)
@@ -0,0 +1,420 @@
+
+
+//防debug error, 临时宏定义
+(
+8070 core_gpio_pu0
+)
+
+
+(
+0x08 LIGHT_CLEAR_CODE_ROW_GPIO
+29     LIGHT_AID_ROW_GPIO
+25 KEYBOARD_MAX_KEYS_NUM
+
+11 LIGHT_LT8KEY_COLOR_SWITCH
+5   LIGHT_LT8KEY_NIGHT_LIGHT
+10 LIGHT_LT8KEY_LIGHTEN
+4   LIGHT_LT8KEY_DARKEN
+7   LIGHT_LT8KEY_TO_W
+1   LIGHT_LT8KEY_TO_Y
+12 LIGHT_LT8KEY_TURN_ON
+6   LIGHT_LT8KEY_TURN_OFF
+
+24   LIGHT_ZS3KEY_KEY_ON
+18 LIGHT_ZS3KEY_KEY_OFF
+12 LIGHT_ZS3KEY_KEY_SWTICH
+
+19 LIGHT_LB12KEY_KEY_TEST_NIGHT_LIGHT
+21 LIGHT_LB12KEY_KEY_TEST_AIDED
+10 LIGHT_LB12KEY_KEY_TEST_LIGHTEN
+23 LIGHT_LB12KEY_KEY_TEST_TO_W
+4 LIGHT_LB12KEY_KEY_TEST_COLOR_SWITCH
+12 LIGHT_LB12KEY_KEY_TEST_TO_Y
+22 LIGHT_LB12KEY_KEY_TEST_DARKEN
+11 LIGHT_LB12KEY_KEY_TEST_TURN_ON
+24 LIGHT_LB12KEY_KEY_TEST_TURN_OFF
+5 LIGHT_LB12KEY_KEY_TEST_PAIRING
+7 LIGHT_LB12KEY_KEY_TEST_50PERCENT
+6 LIGHT_LB12KEY_KEY_TEST_100PERCENT
+
+13 LIGHT_LB12KEY_KEY_NIGHT_LIGHT
+21 LIGHT_LB12KEY_KEY_AIDED
+5 LIGHT_LB12KEY_KEY_LIGHTEN
+12 LIGHT_LB12KEY_KEY_TO_W
+6 LIGHT_LB12KEY_KEY_COLOR_SWITCH
+24 LIGHT_LB12KEY_KEY_TO_Y
+11 LIGHT_LB12KEY_KEY_DARKEN
+8 LIGHT_LB12KEY_KEY_TURN_ON
+23 LIGHT_LB12KEY_KEY_TURN_OFF
+20 LIGHT_LB12KEY_KEY_PAIRING
+2 LIGHT_LB12KEY_KEY_50PERCENT
+3 LIGHT_LB12KEY_KEY_100PERCENT
+
+15 LIGHT_KEY_AID2
+14 LIGHT_KEY_NIGHT_LIGHT
+4 LIGHT_KEY_RGB_AUTO
+16 LIGHT_KEY_TURN_OFF
+17 LIGHT_KEY_TURN_ON
+9 LIGHT_KEY_TO_W
+8 LIGHT_KEY_LIGHTEN
+7 LIGHT_KEY_PAIRING
+10 LIGHT_KEY_DARKEN
+3  LIGHT_KEY_AIDED1
+2 LIGHT_KEY_COLOR_SWITCH
+1 LIGHT_KEY_TO_Y
+13 LIGHT_KEY_RGB_MANUAL
+
+6 LIGHT_KLD13KEY_KEY_NIGHT_LIGHT
+18 LIGHT_KLD13KEY_KEY_RGB_AUTO
+13 LIGHT_KLD13KEY_KEY_TURN_OFF
+7 LIGHT_KLD13KEY_KEY_TURN_ON
+10 LIGHT_KLD13KEY_KEY_TO_W
+21 LIGHT_KLD13KEY_KEY_LIGHTEN
+11 LIGHT_KLD13KEY_KEY_PAIRING
+8 LIGHT_KLD13KEY_KEY_DARKEN
+24  LIGHT_KLD13KEY_KEY_AIDED
+16 LIGHT_KLD13KEY_KEY_COLOR_SWITCH
+20 LIGHT_KLD13KEY_KEY_TO_Y
+12 LIGHT_KLD13KEY_KEY_RGB_MANUAL
+17 LIGHT_KLD13KEY_KEY_50_AND_100PERCENT
+
+21 LIGHT_SJD_KEY_ON_OFF_ALTERNANT
+15 LIGHT_SJD_KEY_TIMING_15MINS
+19 LIGHT_SJD_KEY_TIMING_30MINS
+14 LIGHT_SJD_KEY_TIMING_60MINS
+20 LIGHT_SJD_KEY_ON
+13 LIGHT_SJD_KEY_OFF
+
+18 LIGHT_RHZ12KEY_KEY_ON_AND_OFF
+13 LIGHT_RHZ12KEY_KEY_SCENE1
+6 LIGHT_RHZ12KEY_KEY_SCENE2
+12 LIGHT_RHZ12KEY_KEY_COLOR_SWITCH
+17 LIGHT_RHZ12KEY_KEY_NIGHT_LIGHT
+4 LIGHT_RHZ12KEY_KEY_50PERCENT
+10 LIGHT_RHZ12KEY_KEY_100PERCENT
+7 LIGHT_RHZ12KEY_KEY_PAIRING
+16 LIGHT_RHZ12KEY_KEY_TO_Y
+11  LIGHT_RHZ12KEY_KEY_TO_W
+1 LIGHT_RHZ12KEY_KEY_LIGHTEN
+5 LIGHT_RHZ12KEY_KEY_DARKEN
+
+
+0x28 LIGHT_CMD_PAIRING_CODE
+0x45 LIGHT_CMD_CLEAR_CODE
+0x09 LIGHT_CMD_TURN_ON_AND_OFF
+0x10 LIGHT_CMD_TURN_ON
+0x11 LIGHT_CMD_TURN_OFF
+0x23 LIGHT_CMD_NIGHT_LIGHT
+0x24 LIGHT_CMD_HELP_SLEEP
+0x21 LIGHT_CMD_COLOR_SWTICH
+0x12 LIGHT_CMD_AID_TURN_ON
+0x13 LIGHT_CMD_AID_TURN_OFF
+0x04 LIGHT_CMD_LIGHTEN
+0x05 LIGHT_CMD_DARKEN
+0x06 LIGHT_CMD_TO_W
+0x07 LIGHT_CMD_TO_Y
+0x1b LIGHT_CMD_FTD_RGB_FORWARD_AND_REVERSE
+0x1c LIGHT_CMD_RGB_ON_OFF
+0x1d LIGHT_CMD_FTD_RGB_LOOP
+0x1e LIGHT_CMD_RGB_1E
+0x1f LIGHT_CMD_RGB_1F
+0x22 LIGHT_CMD_RGB_MANNUL
+0x41 LIGHT_CMD_DELAY_OFF
+0xc0 LIGHT_CMD_CHANGE_POWERON_STATE
+0x46 LIGHT_CMD_KEYPRESS_DRIVE_RETENTION
+0x47 LIGHT_CMD_BACK_TO_RETENTION_STATE
+0x48 LIGHT_CMD_KPS_DRIVE_RTT_NOT_INC_POWER_ON1
+0x49 LIGHT_CMD_BACK_TO_RTT_STATE_NOT_INC_POWER_ON1
+0x4a LIGHT_CMD_KPS_DRIVE_RTT_NOT_INC_POWER_ON2
+0x4b LIGHT_CMD_BACK_TO_RTT_STATE_NOT_INC_POWER_ON2
+0x46 LIGHT_CMD_SCENE_SET
+0x47 LIGHT_CMD_SCENE_GET
+0x48 LIGHT_CMD_SCENE_RESET
+0x6f LIGHT_CMD_FTD_MASSTER_ON_OFF
+0x7a FAN_LIGHT_COLOR_CTL
+0x79 LIGHT_CMD_SWITCH_MODE
+0x71 LIGHT_CMD_EXPAND_CODE_0X71
+0xff LIGHT_CMD_TEST_MODE
+
+0X67 LIGHT_CMD_AIR_CHANGE
+0X66 LIGHT_CMD_HEATING
+0X32 LIGHT_CMD_FAN_TURN_ON_V2
+0X31 LIGHT_CMD_FAN_TURN_OFF_V2
+0x33 LIGHT_CMD_FAN_WIND_TYPE_V2
+0x34 LIGHT_CMD_FAN_SHAKE_HEAD_V2
+
+0x21 LIGHT_CMD_FTD_COLOR_STATE_CHANGE
+0x14 LIGHT_CMD_FTD_LIGHTEN_RESERVED
+0x28 LIGHT_CMD_FTD_DARKEN_RESERVED
+0x18 LIGHT_CMD_FTD_Y_RESERVED
+0x24 LIGHT_CMD_FTD_W_RESERVED
+0x01 LIGHT_CMD_FTD_50PERCENT_RESERVED
+0x02 LIGHT_CMD_FTD_100PERCENT_RESERVED
+0x03 LIGHT_CMD_FTD_30PERCENT_RESERVED
+0x04 LIGHT_CMD_FTD_80PERCENT_RESERVED
+
+0x40 LIGHT_CMD_FTD_COLOR_SWTICH_RESERVED
+0x73 LIGHT_CB_DATA_PART_PCNT_50PERCENT
+0x7f LIGHT_FTD_DATA_PART_PCNT_50PERCENT
+0xc0 LIGHT_FTD_DATA_PART_PCNT_75PERCENT
+0x81 LIGHT_DATA_PART_81
+0x80 LIGHT_DATA_PART_80
+0xff LIGHT_DATA_PART_FF
+0x4e LIGHT_CB_DATA_PART_PCNT_30PERCENT
+0x40 LIGHT_CB_DATA_PART_PCNT_25PERCENT
+0xcc LIGHT_CB_DATA_PART_PCNT_80PERCENT
+0x22 LIGHT_CMD_RGB_COLOR_SWITCH
+
+0x90 LIGHT_CMD_FTD_CURTAIN_ON_OFF
+0xe9 LIGHT_CMD_FTD_GENERAL_STOP
+
+//LIGHT_CMD_CHANGE_POWERON_STATE W-data
+0x00 LIGHT_PARAMETER_POWER_STATE_OFF
+0x01 LIGHT_PARAMETER_POWER_STATE_ON
+0x02 LIGHT_PARAMETER_POWER_STATE_REVERSE
+0x46 LIGHT_CMD_FTD_SCENE_SET
+0x47 LIGHT_CMD_FTD_SCENE_SWITCH
+0x05 LIGHT_CMD_FTD_SCENE_REMOTER_COPY
+
+9 	LIGHT_LONG_PRESS_TIMEOUT_0_9S
+15     LIGHT_PAIRING_TIMEOUT
+50     LIGHT_CLAER_CODE_TIMEOUT_5S
+30     LIGHT_LONG_PRESS_TIMEOUT_3S
+20     LIGHT_LONG_PRESS_TIMEOUT_2S
+
+
+1 KSCAN_ANALYSIS_INTERVAL
+1 KEY_PRESS_LED_ON_TIME
+
+0x01feff LIGHT_FTD_CLEAR_CODE_ADDR
+20 LIGHT_CLEAR_CODE_TIMER
+
+160     LIGHT_KSCAN_ENABLE_TIMEOUT
+13       LIGHT_KSCAN_INTERVAL
+15       LIGHT_CLEAR_CODE_ENABLE_TIMEOUT
+
+8 LIGHT_WIRELESS_SWITCH_GPIO_KEY1
+4 LIGHT_WIRELESS_SWITCH_GPIO_KEY12
+5 LIGHT_WIRELESS_SWITCH_GPIO_KEY3
+0x28 LIGHT_WIRELESS_SWITCH_CMD_PAIRING
+
+0x65 OPCODE_BATH_FAN
+0x61 OPCODE_BATH_TIMING_CLOSE
+0x66 OPCODE_BATH_WARM
+0x67 OPCODE_BATH_VENTILATION
+0x68 OPCODE_BATH_BATH
+0x69 OPCODE_DRY
+0x6f OPCODE_BATH_SWITCH_OFF
+0xa0 OPCODE_SPEED
+0xb0 OPCODE_SWING
+
+2 BATH_KEY_WARM
+8 BATH_KEY_ON_AND_OFF
+3 BATH_KEY_VENTILATION
+1 BATH_KEY_SPEED_DOWN
+7 BATH_KEY_FAN
+9 BATH_KEY_SPEED_UP
+12 BATH_KEY_SWING
+10 BATH_KEY_MASTET_OFF
+14 BATH_KEY_TIMING_OFF
+
+160 LIGHT_BLINK_INTERVAL_100ms
+
+0x30 FAN_CMD_SPEED_CHANGE
+0x32 FAN_CMD_SPEED_32
+0x31 FAN_CMD_SPEED_31
+0X34 FAN_CMD_SHAKE_HEAD_ON_OFF
+0x51 FAN_CMD_TIMING_TO_OFF
+0x15 FAN_CMD_DIRECTION
+0x6f FAN_CMD_MASTER_ON_AND_OFF
+0x33 FAN_CMD_MODE
+0x10 FAN_CMD_LAMP_ON
+0x11 FAN_CMD_LAMP_OFF
+0x28 FAN_CMD_PAIRING
+0x16 FAN_CMD_DEFLECTOR
+0xa0 FAN_TURN_ON_FLAG_BYTE_Y
+0x17 FAN_CMD_DIRECTION_ON_AND_OFF
+0x18 FAN_CMD_DEFLECTOR_ON_AND_OFF
+
+39 FTD_PDU_LEN
+
+23 GEM_PDU_LEN
+3 GEM_LONG_KEYPRESS
+
+37 KEY_PDU_LEN
+
+
+(
+0x1a WY_RGB_SWITCH
+0x01 WY_RGB_SWITCH_RGB
+0x02 WY_RGB_SWITCH_RGB_AND_RGB
+0x03 WY_RGB_SWITCH_WY
+0x001a WY_RGB_SWITCH_V2
+0x01 WY_RGB_SWITCH_RGB_RESERVED
+0x02 WY_RGB_SWITCH_RGB_AND_RGB_RESERVED
+0x03 WY_RGB_SWITCH_WY_RESERVED
+)
+
+0x79 FAN_LIGHT_MODE_SWITCH
+0x80 FAN_MEM_SELET_CMD
+
+5 CONTINUOUS_KEY_PRESS_TIRG_CNT_5
+
+5 SHORT_PRESS_TIMEOUT
+
+0xa0 LIGHT_LIGHTEN_RELEASE_ADV_FLAG
+0xa1 LIGHT_DARKEN_RELEASE_ADV_FLAG
+0xa2 LIGHT_TO_W_RELEASE_ADV_FLAG
+0xa3 LIGHT_TO_Y_RELEASE_ADV_FLAG
+0xa4 FAN_SPEED_SLOW_RELEASE_ADV_FLAG
+0xa5 FAN_SPEED_HIGHER_RELEASE_ADV_FLAG
+0xa6 QIH_SPEC_FUNC_COLOR_CTL_RELEASE_ADV_FLAG
+0xa7 BABY_CAR_GO_FTD_ADV_FLAG
+0xa8 BABY_CAR_BACK_FTD_ADV_FLAG
+0xa9 BABY_CAR_LEFT_FTD_ADV_FLAG
+0xb0 BABY_CAR_RIGHT_FTD_ADV_FLAG
+0xb1 LIGHT_COLOR_SWITCH_RELEASE_ADV_FLAG
+
+17 FAN_XQ_21KEY_FAN_AND_LIGHT_OFF 
+16 FAN_XQ_21KEY_LIGHT_ON_AND_OFF
+3  FAN_XQ_21KEY_TURNING_FORWARD
+15 FAN_XQ_21KEY_TURNING_REVERSE
+2 FAN_XQ_21KEY_LIGHT_COLOR_SWITCH
+14 FAN_XQ_21KEY_LIGHT_NIGHT_LIGHT
+9 FAN_XQ_21KEY_LIGHT_TO_W
+8 FAN_XQ_21KEY_LIGHT_LIGHTEN
+7 FAN_XQ_21KEY_LIGHT_PAIRING
+10 FAN_XQ_21KEY_LIGHT_DARKEN
+1 FAN_XQ_21KEY_LIGHT_TO_Y
+4 FAN_XQ_21KEY_TURN_OFF_TIMER_1H
+13 FAN_XQ_21KEY_TURN_OFF_TIMER_2H
+6 FAN_XQ_21KEY_FAN_SPEED1
+22 FAN_XQ_21KEY_FAN_SPEED2
+11 FAN_XQ_21KEY_FAN_SPEED3
+23 FAN_XQ_21KEY_FAN_SPEED4
+19 FAN_XQ_21KEY_FAN_SPEED5
+21 FAN_XQ_21KEY_FAN_SPEED6
+18 FAN_XQ_21KEY_FAN_STOP1
+24 FAN_XQ_21KEY_FAN_STOP2
+)
+
+
+(
+0x807d core_gpio13_conf
+)
+
+(
+11 ENTER_LPM_LEISURE_IO_CONFIG_NUM
+3 ENTER_LPM_LEISURE_IO_CONFIG_START
+)
+
+
+(
+0x80 LIGHT_CMD_SOLAR_ON
+0x80 LIGHT_CMD_SOLAR_OFF
+0x82 LIGHT_CMD_SOLAR_LIGHTNESS_LIGHTEN
+0x82 LIGHT_CMD_SOLAR_LIGHTNESS_DARKEN
+0x81 LIGHT_CMD_SOLAR_MODE_RADAR
+0x81 LIGHT_CMD_SOLAR_MODE_LIGHTNESS
+0x81 LIGHT_CMD_SOLAR_MODE_RAIN
+0x83 LIGHT_CMD_SOLAR_TIMMING_OFF
+0x84 LIGHT_CMD_SOLAR_AMBIENT
+)
+(
+0x05 GEM_LIGHT_ON_CODE
+0x09 GEM_LIGHT_OFF_CODE	
+0x0C GEM_LIGHT_ON_GROUP1_CODE
+0x0E GEM_LIGHT_OFF_GROUP1_CODE
+0x01 GEM_LIGHT_ON_GROUP2_CODE
+0x04 GEM_LIGHT_OFF_GROUP2_CODE
+0x0D GEM_LIGHT_ON_GROUP3_CODE
+0x0F GEM_LIGHT_OFF_GROUP3_CODE
+0x08 GEM_LIGHT_ON_GROUP4_CODE
+0x06 GEM_LIGHT_OFF_GROUP4_CODE
+0x13 GEM_LIGHT_AIDED_LIGHT_CODE
+0x10 GEM_LIGHT_NIGHT_LIGHT_CODE
+0x11 GEM_LIGHT_ENERGY_SAVE_LIGHT_CODE
+0x12 GEM_LIGHT_TIMING_OFF_CODE
+0x14 GEM_LIGHT_RGB_AUTO_CODE
+0x15 GEM_LIGHT_RGB_STEP_CODE
+0x02 GEM_LIGHT_LIGHTEN_CODE
+0x03 GEM_LIGHT_DARKEN_CODE
+0x0B GEM_LIGHT_TO_W_CODE
+0x0A GEM_LIGHT_TO_Y_CODE
+0x07 GEM_LIGHT_COLOR_SWITCH_CODE
+0x16 GEM_COLOR_SWITCH_W
+0x17 GEM_COLOR_SWITCH_Y
+)
+(
+//科云
+0x6f LIGHT_ON_CODE1
+0x60 LIGHT_OFF_CODE1
+0x6f LIGHT_PAIRING_CODE1
+0x6f LIGHT_CLEAR_CODE_CODE1
+0x66 LIGHT_LIGHTEN_CODE1
+0x65 LIGHT_DARKEN_CODE1
+0x6a LIGHT_TO_W_CODE1
+0x69 LIGHT_TO_Y_CODE1
+0x68 LIGHT_TIMING_CODE1
+0x6e LIGHT_AUX_LAMP_ON_AND_OFF_CODE1
+0x6d LIGHT_COLOR_SWITCH_CODE1
+0xa1 LIGHT_NIGHT_LIGHT_CODE1
+0xa3 LIGHT_50PER_CODE1
+0xa3 LIGHT_100PER_CODE1
+
+0xd1 LIGHT_ON_CODE2
+0xd1 LIGHT_OFF_CODE2
+0x55 LIGHT_PAIRING_CODE2
+0xaa LIGHT_CLEAR_CODE_CODE2
+0xd1 LIGHT_LIGHTEN_CODE2
+0xd1 LIGHT_DARKEN_CODE2
+0xd1 LIGHT_TO_W_CODE2
+0xd1 LIGHT_TO_Y_CODE2
+0x46 LIGHT_TIMING_CODE2
+0xf0 LIGHT_AUX_LAMP_ON_AND_OFF_CODE2
+0x01 LIGHT_COLOR_SWITCH_WY_CODE2
+0x02 LIGHT_COLOR_SWITCH_W_CODE2
+0x03 LIGHT_COLOR_SWITCH_Y_CODE2
+0xd1 LIGHT_NIGHT_LIGHT_CODE2
+0x0 LIGHT_50PER_CODE2
+0x1111 LIGHT_100PER_CODE2
+
+
+
+0x6f LIGHT_JYM_CMD_PAIRING
+0x6f LIGHT_JYM_CMD_CLEAR
+0x66 LIGHT_JYM_CMD_LIGHTEN
+0x65 LIGHT_JYM_CMD_DARKEN
+0x69 LIGHT_JYM_CMD_TO_Y
+0x6a LIGHT_JYM_CMD_TO_W
+0x68 LIGHT_JYM_CMD_TIMING_OFF
+0x6e LIGHT_JYM_CMD_AUX_LAMP
+0x6d LIGHT_JYM_CMD_WHITE_LAMP
+0x6d LIGHT_JYM_CMD_WY_LAMP
+0x6d LIGHT_JYM_CMD_YELLOW_LAMP
+0x6f LIGHT_JYM_CMD_ON
+0x60 LIGHT_JYM_CMD_OFF
+0x62 LIGHT_JYM_CMD_MODEL
+0x6e LIGHT_JYM_CMD_NIGHT_LIGHT
+0x6c LIGHT_JYM_CMD_RGB
+
+0x55 LIGHT_JYM_DATA_PAIRING
+0xaa LIGHT_JYM_DATA_CLEAR
+0x00 LIGHT_JYM_DATA_LIGHTEN
+0x00 LIGHT_JYM_DATA_DARKEN
+0x00 LIGHT_JYM_DATA_TO_Y
+0x00 LIGHT_JYM_DATA_TO_W
+0x46 LIGHT_JYM_DATA_TIMING_OFF
+0xf0 LIGHT_JYM_DATA_AUX_LAMP
+0x02 LIGHT_JYM_DATA_WHITE_LAMP
+0x01 LIGHT_JYM_DATA_WY_LAMP
+0x03 LIGHT_JYM_DATA_YELLOW_LAMP
+0x00 LIGHT_JYM_DATA_ON
+0x00 LIGHT_JYM_DATA_OFF
+0x00 LIGHT_JYM_DATA_MODEL_APPLY
+0x80 LIGHT_JYM_DATA_MODEL_STORE
+0x00 LIGHT_JYM_DATA_NIGHT_LIGHT
+0x00 LIGHT_JYM_DATA_RGB
+)
+
+
Index: format/app_light_format/rlmp_mmap.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/rlmp_mmap.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_light_format/rlmp_mmap.format	(working copy)
@@ -0,0 +1,275 @@
+
+
+
+xmemalloc ftd(
+64 mem_ble_v2_xbox
+39 mem_ble_v2_pdu
+
+1 mem_ble_v2_customer_id
+1 mem_ble_v2_packet_num
+1 mem_ble_v2_subtype
+1 mem_ble_v2_maintype
+4 mem_ble_v2_addr
+1 mem_ble_v2_group_index
+2 mem_ble_v2_cmd	
+4 mem_ble_v2_para
+
+1 mem_ble_customer_id
+1 mem_ble_count
+1 mem_ble_sub_type
+1 mem_ble_main_type
+4 mem_ble_addr
+1 mem_ble_group
+2 mem_ble_cmd
+4 mem_ble_para
+3 mem_ble_rfu
+1 mem_ble_relay
+1 mem_ble_is_app
+
+/***********************BLE Protocol V2****************************/
+2 mem_adv_CRC_False_initValue
+2 mem_CRC16_polynomial
+2 mem_ble_pack_cb
+0 mem_ble_v2_tx_end_dummy
+
+1 mem_ftd_device_option
+
+
+//gem
+1 mem_light_gm_tx_addr_type
+1 mem_light_gm_tx_len
+13 mem_light_gm_tx_header
+0 mem_light_gm_tx
+1 mem_light_gm_tx_press_time
+1 mem_light_gm_tx_remoter_ID
+2 mem_light_gm_tx_remoter_addr
+1 mem_light_gm_tx_group_num
+1 mem_light_gm_tx_code
+1 mem_light_gm_tx_count
+1 mem_light_gm_tx_sum
+
+2 mem_gem_cnt_inces_timeout
+2 mem_gem_long_keypress_timeout
+1 mem_gem_long_cnt_enable
+
+//科云
+0 mem_light_KY_tx
+23 mem_light_KY_tx_header
+1 mem_light_KY_tx_len
+1 mem_light_KY_tx_code1
+4 mem_light_KY_tx_remoter_ID
+1 mem_light_KY_tx_group_num
+1 mem_light_KY_tx_code2
+2 mem_light_KY_tx_sum
+2 mem_light_KY_tx_CRC
+2 mem_light_KY_tx_count
+1 mem_light_group_num
+
+/**************************JUYUAN MICRO***************************/
+12 mem_light_JYM_whitening_header
+0 mem_light_JYM_tx
+8 mem_light_JYM_tx_header
+1 mem_light_JYM_tx_len
+1 mem_light_JYM_tx_cmd
+4 mem_light_JYM_tx_ID
+1 mem_light_JYM_tx_group
+1 mem_light_JYM_tx_data
+1 mem_light_JYM_tx_count
+2 mem_light_JYM_tx_sum
+2 mem_light_JYM_tx_CRC
+37 mem_light_JYM_tx_temp
+1 mem_adv_cnts
+
+)
+
+
+
+xmemalloc ftd_rlmp(
+/******************kscan***********************/
+8 mem_kscan_record_keypress
+1 mem_kscan_row_nums
+1 mem_kscan_col_nums
+8 mem_kscan_row_gpio_pin
+8 mem_kscan_col_gpio_pin
+1 mem_kscan_row_scanned
+1 mem_kscan_col_scanned
+1 mem_keypress_analysis_flag
+2 mem_kscan_avoid_shake_delay_time
+1 mem_scan_col
+1 mem_kscan_enable
+2 mem_long_press_adv_timeout
+2 mem_kscan_analysis_interval_timeout
+/******************kscan***********************/
+
+2 mem_FTD_adv_raw_device_add_temp
+1 mem_set_clear_code_timeout_enable
+1 mem_light_lpm_enable
+1 mem_light_manufacture_id
+1 mem_light_indicator_led
+1 mem_groups_num
+1 mem_light_last_key
+1 mem_light_different_key_press_flag
+
+0 mem_FTD_adv_raw
+1 mem_FTD_adv_raw_cmd
+2 mem_FTD_adv_raw_device_add
+3 mem_FTD_adv_raw_data
+1 mem_FTD_adv_raw_packet_num
+1 mem_FTD_adv_raw_reserved
+8 mem_FTD_adv_raw_encryption
+
+2 mem_long_press_timeout
+1 mem_light_num_of_long_press
+1 mem_light_color_switch_cnt
+1 mem_light_brightness_switch_flag
+1 mem_light_rgb_hand_actuated_flag
+1 mem_rgb_switch
+1 mem_light_rgb_auto_flag
+1 mem_rgb_on_and_off
+1 mem_light_group1_on_and_off_flag
+1 mem_light_group2_on_and_off_flag
+1 mem_light_group3_on_and_off_flag
+1 mem_light_group4_on_and_off_flag
+1 mem_light_current_key
+2 mem_ble_light_adv_timeout
+1 mem_light_on_off_alternant
+1 mem_fan_speed
+1 mem_fan_direction_alternant
+1 mem_fan_on_off_flag
+128 mem_ble_xboxes
+
+/***********************FTD raw data****************************/
+0 mem_adv_packet
+23 mem_adv_packet_header
+14 mem_adv_packet_payload
+2 mem_adv_packet_tailer
+/***********************FTD raw data****************************/
+
+/***********************whitening****************************/
+39 mem_light_whitening_buffer
+2 mem_light_whitening_k
+1 mem_light_for_loop_cnt1
+1 mem_light_for_loop_cnt2
+1 mem_light_recvd_len
+1 mem_light_whitening_i
+4 mem_light_whitening_i1
+4 mem_light_whitening_i2
+4 mem_light_whitening_i3
+4 mem_light_whitening_i4
+1 mem_light_whitening_n
+
+4 mem_light_para1
+5 mem_light_para2
+8 mem_light_for_loop_lshift
+8 mem_light_integer_1_lshift_temp
+/***********************whitening****************************/
+
+2 mem_light_lpm_enable_timeout
+1 mem_indicator_turn_on_enable
+2 mem_indicator_led_turn_on_timeout
+1 mem_light_on_and_off_flag
+1 mem_fan_deflector_flag
+1 mem_light_aid_swtich_flag
+1 mem_light_manufacture_id2
+1 mem_light_manufacture_id2_v2
+
+39 mem_light_whitening_buffer_2
+39 mem_ble_v2_pdu_2
+1 mem_light_rgb_on_and_off_flag
+1 mem_rgb_loop_on_and_off
+1 mem_r_g_b_switch_flag
+1 mem_adv_manufacturer_switch_flag
+1 mem_adv_manufacturer_switch_flag1
+1 mem_adv_manufacturer_switch_flag2
+1 mem_adv_manufacturer_switch_flag3
+1 mem_fan_on_and_off_flag
+
+1 mem_light_release_adv_flag
+
+1 mem_light_blink_state_flag
+1 mem_light_indicator_led_blink_enable
+2 mem_light_continuous_kps_cnt_reset_timeout
+1 mem_light_key1_continuous_kps_cnt  
+1 mem_light_key2_continuous_kps_cnt 
+1 mem_light_key3_continuous_kps_cnt 
+1 mem_light_key4_continuous_kps_cnt 
+1 mem_light_key5_continuous_kps_cnt 
+1 mem_light_key6_continuous_kps_cnt 
+1 mem_light_key7_continuous_kps_cnt  
+1 mem_light_key8_continuous_kps_cnt 
+1 mem_light_key9_continuous_kps_cnt 
+1 mem_light_key10_continuous_kps_cnt  
+1 mem_light_key11_continuous_kps_cnt 
+1 mem_light_key12_continuous_kps_cnt 
+1 mem_light_key13_continuous_kps_cnt  
+1 mem_light_key14_continuous_kps_cnt 
+1 mem_light_key15_continuous_kps_cnt 
+1 mem_light_key16_continuous_kps_cnt 
+2 mem_16groups_on_off
+1 mem_group_flag
+
+1 mem_channel_enable
+1 mem_channel_num
+1 mem_scene_enable
+
+1 mem_special_agreemeet_enable
+
+2 mem_light_short_keypress_timeout
+1 mem_light_color_and_lgtness_long_press_adv_enable
+
+1 mem_airchange_speed
+1 mem_fan_tap_speed
+1 mem_light_airchange_flag
+1 mem_light_warm_wake_flag
+1 mem_light_warm_powerful_flag
+1 mem_light_fan_on_and_off
+1 mem_light_bath_on_off_flag
+
+1 mem_long_press_protect_enble_flag
+1 mem_long_press_protect_cnt
+1 mem_long_press_protect_start_flag
+8 mem_kscan_press_row_gpio
+
+1 mem_light_fan_on_and_off_flag
+4 mem_light_lpm_gpio_config_flag
+1 mem_light_lpm_gpio_config_io_temp
+
+1 mem_light_timing_of_alter_flag
+
+/*ble rx protocol*/
+	0 mem_light_adv_packet
+	1 mem_light_adv_packet_cmd
+	2 mem_light_adv_packet_addr
+	3 mem_light_adv_packet_data
+	1 mem_light_adv_packet_packetnum
+	1 mem_light_adv_packet_reserve
+	6 mem_light_adv_packet_encry
+	2 mem_light_adv_packet_CRC
+/*ble rx protocol*/
+
+2 mem_scene_led_timeout
+1 mem_scene_led_cnt
+1 mem_ble_rx_on_and_off
+1 mem_long_press_scene_timeout
+1 mem_le_adv_scan_channel
+4 mem_le_lap_addr
+4 mem_le_lap_addr_temp
+4 mem_le_lap_v2_addr
+1 mem_light_scene_mode
+1 mem_le_addr_change_flag
+
+2 mem_rmt_keydown_cb
+2 mem_rmt_released_cb
+2 mem_rmt_long_press_cb
+2 mem_rmt_continuous_keydown_cb
+2 mem_rmt_continuous_kps_time
+2 mem_light_adv_time
+2 mem_claer_code_time
+1 mem_ble_v2_customer_id_copy
+
+// 1 mem_scene_combination_flag
+)
+
+
+
+
Index: format/app_mouse.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_mouse.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_mouse.format	(working copy)
@@ -0,0 +1,709 @@
+
+memalloc usb_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
+
+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
+
+0 mem_mouse_param_config
+1 mem_lbutton_gpio
+1 mem_mbutton_gpio
+1 mem_rbutton_gpio
+1 mem_bk_button_gpio
+1 mem_fw_button_gpio
+1 mem_dpi_button_gpio
+1 mem_whee_a_data_gpio
+1 mem_whee_b_data_gpio
+1 mem_mouse_sensor_sclk_gpio
+1 mem_mouse_sensor_sdio_gpio
+1 mem_select_sensor_angle_gpio
+1 mem_sensor_angle_default
+1 mem_sensor_angle_switch
+1 mem_config_sensor_dpi	
+1 mem_whee_ta_data_gpio
+1 mem_whee_tb_data_gpio
+1 mem_matrix_public_gpio
+1 mem_config_select_device_button_gpio
+1 mem_customer_key_gpio
+1 mem_sensor_motion_gpio
+1 mem_device_switch_gpio
+1 mem_mouse_reuse_2ice_gpio
+1 mem_config_low_voltage_alarm_gpio
+1 mem_config_device_24g_led_gpio
+1 mem_config_device_bt1_led_gpio
+1 mem_config_device_bt2_led_gpio	
+1 mem_dpi_led_gpio
+1 mem_dpi_another_button_gpio
+1 mem_firebutton_gpio
+1 mem_mouse_1io2led_multi_24g_gpio
+1 mem_mouse_1io2led_multi_bt1_gpio
+1 mem_mouse_1io2led_multi_bt2_gpio
+1 mem_mouse_logo_led_gpio
+0 mem_mouse_param_config_end
+
+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
+38 mem_sensor_8650_init
+30 mem_sensor_ka8ul_init
+16 mem_sensor_8009_init
+16 mem_sensor_ka8g2_init
+12 mem_sensor_p6520_init
+8 mem_sensor_poweron_init
+8 mem_sensor_ka8g2_poweron_init
+	
+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_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_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
+1 mem_24g_long_sleep_set_level
+
+2 mem_tx_power_factory_param
+
+//dpi another button
+1 mem_mouse_another_dpi_connect_vin_flag
+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
+
+//firebutton
+1 mem_mouse_firebutton_connect_vin_flag
+1 mem_fire_key_status
+4 mem_fire_key_delay
+1 mem_fire_key_flag
+
+//le name config
+1 mem_le_name_len_temp
+19 mem_le_name_temp
+
+//1io2led multi
+1 mem_mouse_1io2led_led_enable
+1 mem_mouse_multi_led_blink_enable
+1 mem_mouse_bt_led_recon_effect_flag
+1 mem_mouse_multi_led_type
+1 mem_mouse_multi_led_poweron2s_flag_init
+1 mem_mouse_multi_led_poweron2s_flag
+1 mem_mouse_multi_led_powon2s_timer_init
+1 mem_mouse_multi_led_powon2s_timer
+1 mem_mouse_multi_led_blink_timer_init
+1 mem_mouse_multi_led_blink_timer
+1 mem_mouse_multi_led_state
+
+//log led
+2 mem_mouse_logo_led_on_time_init
+
+//le conn param
+1 mem_mouse_le_send_conn_param_update
+1 mem_mouse_le_send_conn_param_update_timer
+
+
+//lost-packet compensation
+3 mem_mouse_24g_short_sleep_set_4ms
+3 mem_mouse_24g_long_sleep_set_4ms
+1 mem_mouse_24g_fast_hop_count_4ms
+3 mem_mouse_24g_short_sleep_set_8ms
+3 mem_mouse_24g_long_sleep_set_8ms
+1 mem_mouse_24g_fast_hop_count_8ms
+
+4 mem_mouse_24g_tsniff
+4 mem_mouse_24g_tsniff_4ms
+4 mem_mouse_24g_tsniff_8ms
+3 mem_mouse_24g_short_sleep_set_init
+
+1 mem_mouse_24g_tx_count
+6 mem_mouse_24g_tx_time_last
+4 mem_mouse_24g_tx_time_last_delt
+5 mem_mouse_24g_tx_time_sum
+1 mem_mouse_24g_tx_time_sum_count
+1 mem_mouse_24g_tx_time_offset
+1 mem_mouse_24g_sleep_miss
+4 mem_mouse_24g_sleep_time_temp
+4 mem_mouse_24g_sleep_miss_temp
+
+1 mem_mouse_sleep_deal_type
+
+1 mem_mouse_24g_long_sleep_flag
+
+
+1 mem_mouse_dpi_last
+1 mem_mouse_dpi_temp
+1 mem_mouse_otp_dpi_value
+
+4 mem_mouse_24g_addr_last
+4 mem_mouse_24g_addr_temp
+
+1 mem_mouse_ice_sdio_for_sensor_angle
+1 mem_mouse_logo_enable_gpio0
+
+)
+
+
+(
+//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
+0x17 MOUSE_ENABLE_OTP
+
+//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_24G_2M_PHY
+0x3e MOUSE_ENABLE_DOUBLE_DPI_KEY
+0x3f MOUSE_ENABLE_24G_NEW_REVISION
+
+//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
+(
+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
+)
+
+(
+0 MULTI_LED_ON
+1 MULTI_LED_BLINK
+)
+
+
+//otp address offset
+(
+0x760 OTP_OFFSET_DPI
+0x78f OTP_OFFSET_DPI_END
+
+0x790 OTP_OFFSET_24G_ADDR
+0x7cf OTP_OFFSET_24G_ADDR_END		
+
+0x7ee OTP_OFFSET_APP_INITLAG
+)
+
+
Index: format/app_shutter.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_shutter.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_shutter.format	(working copy)
@@ -0,0 +1,250 @@
+
+
+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
+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
+
+1 mem_shutter_soft_switch_first_power_on
+1 mem_shutter_dy_conf
+380 mem_shutter_le_uuid_sup
+40 mem_shutter_key_value_list
+
+)
+
+
+
+
+(
+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
+313		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
+
+)
+
+(
+0 SHUTTER_TYPE
+1 SHUTTER_DY_TYPE
+)
Index: format/app_shutter_dy.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_shutter_dy.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/app_shutter_dy.format	(working copy)
@@ -0,0 +1,238 @@
+
+
+xmemalloc shutter_dy(
+
+////////////////////////////////////
+//shutter common config
+
+//timers
+1 mem_shutter_1s_timer
+2 mem_shutter_timer_625us
+
+//patch variable
+11 mem_rf_init_data_new
+2 mem_key_value_xmem
+250 mem_shutter_le_hid_map
+//380 mem_shutter_le_uuid_sup
+2 mem_shutter_le_map_len_android
+2 mem_shutter_le_map_len_ios
+16 mem_le_search_service_uuid
+1 mem_iphone_flag
+1 mem_send_data_delay
+4 mem_key_send_clk
+10 mem_shutter_key_state0
+10 mem_shutter_key_state1
+10 mem_shutter_key_state2
+10 mem_shutter_key_state3
+10 mem_shutter_key_state4
+10 mem_shutter_key_state5
+10 mem_shutter_key_state6
+10 mem_key0_release_new	
+10 mem_key1_release_new
+10 mem_key2_release_new
+10 mem_key3_release_new
+10 mem_key4_release_new
+10 mem_key5_release_new
+10 mem_key6_release_new
+3 mem_key0_long_press
+3 mem_key1_long_press
+3 mem_key2_long_press
+3 mem_key3_long_press
+3 mem_key4_long_press
+3 mem_key5_long_press
+3 mem_key6_long_press
+3 mem_key0_long_release	
+3 mem_key1_long_release
+3 mem_key2_long_release
+3 mem_key3_long_release
+3 mem_key4_long_release
+3 mem_key5_long_release
+3 mem_key6_long_release
+2 mem_combine_key0
+2 mem_combine_key1
+2 mem_combine_key2
+2 mem_combine_key3
+2 mem_combine_key4
+2 mem_combine_key5
+2 mem_combine_key_state0
+10 mem_combine_key0_press
+10 mem_combine_key1_press
+10 mem_combine_key2_press
+10 mem_combine_key3_press
+10 mem_combine_key4_press
+10 mem_combine_key5_press
+10 mem_combine_key_release
+4 mem_shutter_move_data
+10 mem_key0_press_i
+10 mem_key1_press_i
+10 mem_key2_press_i
+10 mem_key3_press_i
+10 mem_key4_press_i
+10 mem_key5_press_i
+10 mem_key0_release_new_i
+10 mem_key1_release_new_i
+10 mem_key2_release_new_i
+10 mem_key3_release_new_i
+10 mem_key4_release_new_i
+10 mem_key5_release_new_i
+10 mem_key6_release_new_i
+3 mem_key0_long_release_i
+3 mem_key1_long_release_i
+3 mem_key2_long_release_i
+3 mem_key3_long_release_i
+3 mem_key4_long_release_i
+3 mem_key5_long_release_i
+3 mem_key6_long_release_i
+10 mem_key3_release_new_t
+10 mem_key3_release_new_i_t
+1 mem_key3_press_count
+1 mem_shutter_like_timeout
+1 mem_shutter_key_pressed
+1 mem_shutter_combine_key_release
+700 mem_shutter_mousekey_value_list
+1 mem_shutter_back_count
+1 mem_shutter_le_conned
+0 mem_move_config
+1 mem_shutter_iphone_beyond_x_count
+1 mem_shutter_iphone_beyond_y_count
+2 mem_shutter_move_data_x
+2 mem_shutter_move_data_y
+1 mem_last_shutter_le_iphone_flag
+0 mem_move_config_end
+1 mem_shutter_back_count_cache
+1 mem_shutter_iphone_beyond_x_cache
+1 mem_shutter_iphone_beyond_y_cache
+8 mem_shutter_iphone_move_mid
+1 mem_shutter_long_key_released_flag
+1 mem_shutter_move_mid_timer
+1 mem_shutter_pairing_success
+2 mem_combine_key_release_value
+1 mem_last_press_key_value
+1 mem_shutter_first_move
+1 mem_move_mode_set
+1 mem_move_mode_key_index
+1 mem_move_mode_trigger_enable
+5 mem_shutter_android_move_mid
+8 mem_shutter_iphone_up_mid
+8 mem_shutter_iphone_like_mid
+1 mem_shutter_key_num_conf
+7 mem_shutter_dy_key_conf
+11 mem_le_dy_adv_data
+12 mem_le_dy_scan_data
+8 mem_ble_shutter_dy_interval_min_new
+8 mem_shutter_ble_discovery_time_conf
+2 mem_queue_dy_each_size
+10 mem_dy_key0_press
+10 mem_dy_key1_press
+10 mem_dy_key2_press
+10 mem_dy_key3_press
+10 mem_dy_key4_press
+10 mem_dy_key5_press
+10 mem_dy_key6_press
+7 mem_shutter_led_on_light_dark_led_conf
+7 mem_shutter_led_off_light_dark_led_conf
+4 mem_shutter_reconn_blink_on_time_conf
+4 mem_shutter_discovery_blink_on_time_conf
+2 mem_shutter_efuse_start_offset
+2 mem_shutter_efuse_end_offset
+
+0 mem_initial_move_conf
+2 mem_android_initial_move_x
+2 mem_android_initial_move_y
+2 mem_iphone_initial_move_x
+2 mem_iphone_initial_move_y
+//淇敼澧炲姞淇濆瓨鍙傛暟
+0 mem_otp_move_config
+//1 mem_shutter_iphone_beyond_x_count
+//1 mem_shutter_iphone_beyond_y_count
+2 mem_otp_shutter_move_data_x
+2 mem_otp_shutter_move_data_y
+1 mem_otp_last_shutter_le_iphone_flag
+0 mem_otp_move_config_end
+2 mem_otp_write_offset_addr
+2 mem_otp_read_offset_addr
+2 mem_otp_read_ios_android_addr
+2 mem_shutter_temp_count
+1 mem_shutter_first_read_flag
+1 mem_shutter_valid_data_flag
+0 mem_shutter_end
+)
+
+
+(
+10 MAX_QUEUE_NUM_COMBINEKEY
+10 MAX_QUEUE_NUM_RELEASE
+3 MAX_QUEUE_NUM_LONG_RELEASE
+10 MAX_QUEUE_NEW_PRESS
+
+10 EVERY_PAYLOAD_LEN
+)
+
+
+(
+0x24	GATT_KEYBOARD_WRITE_HANDLE_NEW
+)
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+
+(//Data Rom Buffer Addr
+640		BT_DY_KEY_VALUE_LIST_SIZE
+)
+
+//otp address offset
+(
+0x05   SHUTTER_PARA_TOTAL_NUM
+//0x7b0  SHUTTER_EFUSE_START_OFFECT	//璧峰鍦板潃
+//0x680  SHUTTER_EFUSE_END_OFFECT	       //缁撴潫鍦板潃
+)
+
+
+(
+//uart config
+115200 UART_BAUD
+)
+
+(
+10 SHUTTER_KEY_CONF_SATE_BYTES
+0 KEY_STATE_PRESS_CLK_OFFSET
+4 KEY_STATE_PRESS_COUNT_OFFSET
+5 KEY_STATE_RELEASE_CLK_OFFSET
+9 KEY_STATE_LONGPRESS_OFFSET
+4 KEY_STATE_PRESS_CLK_LENGTH
+1 KEY_STATE_PRESS_COUNT_LENGTH
+4 KEY_STATE_RELEASE_CLK_LENGTH
+1 KEY_STATE_LONGPRESS_LENGTH
+)
+
+(
+0  SHUTTER_RIGHT_KEY_NUM
+1  SHUTTER_LIKE_KEY_NUM
+2  SHUTTER_DOWN_KEY_NUM
+3  SHUTTER_PHOTO_KEY_NUM
+4  SHUTTER_UP_KEY_NUM
+5  SHUTTER_LEFT_KEY_NUM
+6  SHUTTER_MOVE_KEY_NUM
+)
+
+(
+//0xaa ANDROID_INITIAL_MOVE_X //170
+//0x78 ANDROID_INITIAL_MOVE_Y //120
+//0x69 IPHONE_INITIAL_MOVE_X
+//0x38 IPHONE_INITIAL_MOVE_Y
+0X0a ANDROID_EVERY_MOVE_SIZE
+0x07 IPHONE_EVERY_MOVE_SIZE
+0x62 IPHONE_ONCE_MAX_MOVE_VALUE
+)
+
+(
+0x00 MOVE_COMBINE_KEY
+0x01 MOVE_SINGLE_KEY
+)
+
+(
+//6key or 7key conf
+6 SHUTTER_SIX_KEY
+7 SHUTTER_SEVEN_KEY
+)
+
Index: format/ble_protocol_stack/le.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ble_protocol_stack/le.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ble_protocol_stack/le.format	(working copy)
@@ -0,0 +1,441 @@
+
+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
+
+/* ========= 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(
+1 mem_version
+2 mem_company_id
+2 mem_sub_version
+
+2 mem_le_dsniff
+2 mem_le_conn_interval
+1 mem_le_tx_ifs_defference
+1 mem_le_tx2m_delay
+
+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_le_l2cap_parse_cb
+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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ble_protocol_stack/le_advertising.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ble_protocol_stack/le_l2cap_att.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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_signalling.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ble_protocol_stack/le_l2cap_signalling.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ble_protocol_stack/le_l2cap_smp.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ble_protocol_stack/le_ll.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/bt.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/bt.format	(working copy)
@@ -0,0 +1,691 @@
+
+	width = 32
+	const length = 12000
+
+	/* ========= memory ============== */
+memalloc(
+ 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_current_context
+1 mem_le_ch_mapped
+1 mem_last_freq
+1 mem_rssi
+2 mem_context_ptr
+2 mem_rx_window
+
+
+/* lpo related */
+1 mem_lpm_adjust
+6 mem_sync_clke
+1 mem_lpm_current_mult
+4 mem_gpio_wakeup_low
+4 mem_gpio_wakeup_high
+
+
+4 mem_clkn_bt
+4 mem_clke_bt
+4 mem_dpll_clkn
+
+2 mem_slot_offset
+
+
+1 mem_select_list_item
+0 mem_temp_reconn_record
+1 mem_record_bt_mode
+2 mem_list_item_ptr
+
+1 mem_rssi_hex
+
+
+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 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  */
+83 mem_context
+1 mem_current_amaddr
+1 mem_lpm_mode
+1 mem_device_option
+4 mem_last_clkn
+
+	/* parameters */
+1 mem_fcomp_div
+2 mem_rx_window_sniff
+2 mem_rf_init_ptr
+
+
+1 mem_rf_rccal
+1 mem_handle_num
+
+
+	/* lpm related */
+2 mem_chip_functions
+2 mem_lpm_wake_lock
+2 mem_lpm_interval
+1 mem_lpm_overhead
+1 mem_lpm_hibernate_switch
+1 mem_sniff_unint_lost
+4 mem_sleep_counter   
+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
+
+0 mem_lpm_ctrl3
+1 mem_lpm_ctrl3_app_vsel
+1 mem_lpm_ctrl3_aon_vsel
+1 mem_lpm_ctrl3_core_byp
+1 mem_lpm_ctrl3_core_vsel
+
+13 mem_saved_gpio	 
+3 mem_saved_gsel
+8 mem_saved_mark
+1 mem_saved_spidctrl
+2 mem_patch_ptr
+2 mem_patch_len
+
+32 mem_timers
+
+
+/* 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_tx_power
+1 mem_modem_rssi
+1 mem_gain_fix
+3 mem_gain_table
+1 mem_gain_second_agc_en
+1 mem_system_clk
+
+1 mem_rf_init_data
+1 mem_xtal_freq
+)
+
+(//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
+0xaa TX_POWER_FACTORY
+)
+
+
+	/* 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 */
+	
+	/* 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
+	
+83 context_size
+1 context_num
+)
+
+(
+0 lpm_flag_wake
+1 lpm_flag_loadcode
+)
+
+/* ========= parameters ============== */
+(
+0x0a00 param_snooze_setup_orig
+0x5353 param_snooze_ahead_orig
+
+/* 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
+
+-13 param_lpm_fix
+7 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
+
+
+0x000a04 param_lmp_version
+0x12e9 param_lmp_subversion
+0x0012 param_tisw
+0x0012 param_tpsw
+0x1000 param_tisi
+0x0800 param_tpsi
+39 param_fcomp_div
+2 param_fcomp_mul
+
+)
+
+
+/* ========== 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 */
+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 ============= */
+(
+5  mark_loopback
+9  mark_context
+13 mark_lpm_mult_enable
+14 mark_usb_first_resp
+15 mark_old_packet
+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
+50 mark_ble_encryption
+51 mark_first_packet
+)
+
+(
+1 reload_type_otp
+2 reload_type_spi
+3 reload_type_iic
+)
+
+
+/* ============== soft timers ============== */
+(
+0 le_adv_interval_timer
+2 le_scan_interval_timer
+9 key_scan_timer
+7 smp_pairing_timer
+11  ui_led_blink  
+
+8 G24_TIMER_NODATA
+13 G24_TIMER_MS_BLANK
+12 G24_TIMER_KB_MUL_BLANK
+14 G24_TIMER_KB_BLANK
+
+1 USB_TIMER_NAK
+15 USB_TIMER_WAKEUP
+)
+
+(
+
+27 hci_cmd_le_create_conn
+29 hci_cmd_le_disconn
+30 hci_cmd_le_att_req
+)
+
+
+
+/* ============== mode ==========*/
+(
+0 mode_le
+1 mode_master
+)
+
+(
+0 state_inconn
+1 state_insniff
+)
+(
+3 op_disconn
+)
+
+
+
+// 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
+(
+2 lpmreg2_sel_option
+4 lpmreg2_sel_mpu_s0
+8 lpmreg2_sel_mpu_s1
+)
+
+(
+8 lpmreg_spi_lock_bit
+0x0a lpmreg_uart_lock_bit
+0x0c lpmreg_iic_lock_bit
+0x0d lpmreg_rom_lock_bit
+0x0e lpmreg_ice_mode_bit
+
+0x01 lpmreg_spi_lock
+0x04 lpmreg_uart_lock
+0x10 lpmreg_iic_lock
+0x20 lpmreg_rom_lock
+0x40 lpmreg_ice_mode
+)
+
+//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
+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
+)
+
+(
+0 bt_disabled
+1 ble_disabled
+2 module_disable
+)
+
Index: format/command.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/command.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/debug.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/debug.format	(working copy)
@@ -0,0 +1,6 @@
+xmemalloc(
+
+1 mem_rf_debug_rx_gpio
+1 mem_rf_debug_tx_gpio
+)
+
Index: format/fcc_auth.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/fcc_auth.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/fcc_auth.format	(working copy)
@@ -0,0 +1,80 @@
+
+
+
+
+/*
+为了不额外占用memalloc的空间，所以与mem_input_store复用
+*/
+amemalloc mem_input_store(
+	0 mem_fcc_param_new	
+	1 mem_fcc_ch_new   
+	1 mem_fcc_mod_new 
+	1 mem_fcc_txrx_new 
+	1 mem_fcc_btble_new  
+	1 mem_fcc_data_new  
+	1 mem_fcc_data_length_new    
+	1 mem_fcc_hop_new    
+	1 mem_fcc_tx_power_new
+
+	0 mem_fcc_param
+	1 mem_fcc_ch                    /*frequence set: default:0x00(2402Mhz); frequence = 2402MHz + mem_fcc_ch*/
+	1 mem_fcc_mod                 /*data rate:default:0x01(1Mbps) */
+	1 mem_fcc_txrx                  /*tx rx mode select:tx: 01; rx:02*/
+	1 mem_fcc_btble                /*BT and BLE select: BT3.0:01; BLE:02*/
+	1 mem_fcc_data                 /*carrier: 0x22; data: 0*/
+	1 mem_fcc_data_length     /*DH1:0x19; DH3:0x78; DH5:0xf0*/
+	1 mem_fcc_hop                  /*fixed freq:0x02; hop freq:0x01*/
+	1 mem_fcc_tx_power         /*同mem_tx_power*/
+
+	2 mem_fcc_config_cb
+
+)
+
+
+(
+0x0b00 mem_pn9  
+1022 mem_pn9_size
+)
+
+(
+8 FCC_PARA_LEN
+)
+
+//data rate
+(
+0x01 FCC_DATA_RATE_1Mbps
+)
+//tx rx mode select
+(
+0x01 FCC_TX
+0x02 FCC_RX
+)
+//BT or BLE
+(
+0x02 FCC_BLE_MODE
+0x01 FCC_BT_MODE
+)
+
+//carrier or data
+(
+0x22 FCC_CARRIER
+0 FCC_DATA
+)
+
+//data length
+(
+0x19 FCC_LEN_DH1
+0x78 FCC_LEN_DH3
+0xf0 FCC_LEN_DH5
+)
+
+//fixed or hop frequence
+(
+0x02 FCC_FIXED_FREQ
+0x01 FCC_HOP_FREQ
+)
+(
+0x890d core_tx_test_mode
+)
+
+
Index: format/g24_protocol_stack/24g.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g.format	(working copy)
@@ -0,0 +1,80 @@
+
+xmemalloc g24(
+6 mem_24g_lap
+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
+
+1 mem_24g_disable_fec1
+1 mem_24g_off_type
+)
+
+
+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
+)
+
+
+(
+0 ERR_NULL
+1 ERR_SYNC_TO
+2 ERR_HEC
+3 ERR_LR_LEN
+4 ERR_TYPE
+5 ERR_LEN_OVER
+6 ERR_CRC
+)
+
+
+
Index: format/g24_protocol_stack/24g_pair.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_pair.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_pair.format	(working copy)
@@ -0,0 +1,52 @@
+
+
+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
+2 mem_24g_pair_count
+)
+
+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
+1 mem_24g_device1_bind_disable
+1 mem_24g_device2_bind_disable
+
+)
+
+(//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
+)
+
+(
+5 BIND_MODE_CONTINUE
+)
Index: format/g24_protocol_stack/24g_receiver.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_receiver.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_receiver.format	(working copy)
@@ -0,0 +1,50 @@
+
+
+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
+
+1 mem_24g_mode_B_S_switch
+1 mem_24g_mode_B_S_switch_init
+2 mem_24g_mode_B_S_switch_cnt
+1 mem_24g_mode_B_S_switch_exit
+1 mem_24g_B_S_time_slice
+1 mem_24g_B_S_mode_switch_disable
+
+1 mem_24g_bind_device_living
+)
+
+
+(
+0 bit_ack_24g
+)
+
+
Index: format/g24_protocol_stack/24g_reconn.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_reconn.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_rssi.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_transmitter.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_transmitter.format	(working copy)
@@ -0,0 +1,67 @@
+
+
+xmemalloc g24_tx(
+2 mem_cb_24g_transmit_data
+2 mem_cb_24g_search_receiver
+2 mem_cb_24g_lpm_before
+2 mem_cb_24g_transmit_short_sleep
+2 mem_cb_24g_transmit_long_sleep
+
+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
+2 mem_24g_retransmit
+)
+
+(
+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
+)
+
+(//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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/g24_protocol_stack/24g_txpower_ctrl.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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/l2cap.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/l2cap.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/l2cap.format	(working copy)
@@ -0,0 +1,40 @@
+
+
+
+xmemalloc(
+0 mem_l2cap_xmem_start
+
+//*******************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
+
+2 mem_l2cap_lpm_txbuf_ptr
+0 mem_l2cap_xmem_end
+
+)
+
+
+//mem_l2cap_lpm_txbuf
+(
+256 l2cap_lpm_txbuf_len
+)
+
+(
+4 L2CAP_TX_FIFO_SIZE
+8 L2CAP_TX_BUFF_CNT
+
+)
+
+
Index: format/memblocks.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/memblocks.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/memblocks.format	(working copy)
@@ -0,0 +1,35 @@
+//
+//
+//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.
+
+
+
+//l2cap RX buffers
+(
+0xf00 mem_le_l2cap_buf		//0x100
+)
+
+//l2cap TX buffers
+(
+0xd00 mem_ble_tx_buff0
+0x60 mem_ble_l2cap_tx_buff_size
+)
+
+
+//uart buffer
+(
+0xc00 mem_h5rx_buf//0x400
+0xeff mem_h5rx_buf_end
+0xf00 mem_h5tx_buf
+0xfff mem_h5tx_buf_end
+)
+
+
+(
+0x4c00 mem_savelist
+)
+
Index: format/patch.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/patch.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/regs.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/regs.format	(working copy)
@@ -0,0 +1,532 @@
+(
+	0x8000 core_chipid
+	0x8003 core_kick
+	0x8004 core_write_wdt
+	0x8005 core_lpm_wr
+	0x8006 core_misc_ctrl
+	0x8007 core_otp_rdata
+	0x800a core_ccm_ctrl
+	0x800b core_write_wdt2
+	0x8010 core_reset
+	0x8011 core_encrypt
+	0x8012 core_lpm_wr2
+	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_otp_addr
+	0x8046 core_otp_din
+	0x8047 core_otp_ctrl
+	0x8048 core_otpd_addr
+	0x804a core_otpd_len
+	0x804b core_otpd_ctrl
+	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_nec_start_addr
+	0x8063 core_nec_end_addr
+	0x8065 core_nec_rptr
+	0x8067 core_nec_control
+	0x8068 core_ccm_input_playload_addr
+	0x806a core_ccm_output_playload_addr
+	0x806c core_ccm_aad0
+	0x806d core_ccm_aad1
+	0x806e core_ccm_aad2
+	0x806f core_aes_en
+	0x8070 core_gpio_conf
+	0x807e core_keybuf_saddr
+	0x8080 core_spid_ctrl
+	0x8081 core_spid_delay
+	0x8082 core_spid_txlen
+	0x8084 core_spid_txaddr
+	0x8086 core_spid_rxaddr
+	0x8088 core_spid_rxlen
+	0x808a core_iicd_ctrl
+	0x808b core_iicd_scl_low
+	0x808c core_iicd_scl_high
+	0x808d core_iicd_start_setup
+	0x808e core_iicd_start_hold
+	0x808f core_iicd_stop_setup
+	0x8090 core_iicd_data_setup
+	0x8091 core_iicd_data_hold
+	0x8092 core_iicd_txlen
+	0x8094 core_iicd_txaddr
+	0x8096 core_iicd_rxaddr
+	0x8098 core_iicd_rxlen
+	0x809a core_pwm_en
+	0x809b core_pwm_init
+	0x809c core_pwm_pcnt0
+	0x809e core_pwm_ncnt0
+	0x80a0 core_pwm_pcnt1
+	0x80a2 core_pwm_ncnt1
+	0x80a4 core_pwm_pcnt2
+	0x80a6 core_pwm_ncnt2
+	0x80a8 core_pwm_pcnt3
+	0x80aa core_pwm_ncnt3
+	0x80ac core_pwm_pcnt4
+	0x80ae core_pwm_ncnt4
+	0x80b0 core_pwm_pcnt5
+	0x80b2 core_pwm_ncnt5
+	0x80b4 core_pwm_pcnt6
+	0x80b6 core_pwm_ncnt6
+	0x80b8 core_pwm_pcnt7
+	0x80ba core_pwm_ncnt7
+	0x80bc core_ac_ctrl
+	0x80bf core_ac_saddr
+	0x80c1 core_ccm_inptr
+	0x80c3 core_pwm_sync
+	0x80c5 core_pwm_autoload
+	0x80c6 core_sum_ctrl
+	
+	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
+	0x811e core_ucode_flag
+	0x811f core_peripheral_lock
+	0x8120 core_nec_wptr
+	0x8122 core_current_otp_addr
+	0x8124 core_spid_remain
+	0x8126 core_iicd_remain
+	0x8128 core_dma_status
+	0x8129 core_perf_status
+	0x812a core_adc_in
+	0x812c core_nec_rxitem
+	0x8130 core_lpm_ctrl
+	0x8134 core_lpm_xtalcnt
+	0x8135 core_lpm_buckcnt
+	0x8136 core_lpm_ldocnt
+	0x8137 core_lpm_latch
+	0x8138 core_lpm_ctrl2
+	0x813c core_gpio_wakeup_low
+	0x8140 core_gpio_wakeup_high
+	0x8144 core_aes_decode_key_init
+	0x8145 core_clk_counter
+	0x814c core_adc_sum
+	0x814e core_mpu_s0_saddr
+	0x8150 core_mpu_s0_eaddr
+	0x8152 core_mpu_s1_saddr
+	0x8154 core_mpu_s1_eaddr
+	
+	0x8203 core_ice_ctrl
+	0x8204 core_ice_status
+	0x8205 core_ice_break0
+	0x8207 core_ice_break1
+  
+
+	0x8900 modem_en
+	0x8960 core_rf_rx_agc_ctrl
+	0x8961 core_rf_rx_gain_fix
+	0x8968 core_agc_wb_sat_th
+	0x8969 core_agc_nb_sat_th
+	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
+
+	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         
+	0x8aa0 rfen_chgpump
+	0x8aa1 rfen_chgpump_ctrl1
+	0x8aa2 rfen_chgpump_ctrl2
+
+	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
+
+	
+
+
+
+    
+    
+)
+
+(
+1 otpd_start
+)
+
+(
+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
+(
+  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
+  
+  8 gpcfg_uart_txd
+  9 gpcfg_uart_rxd
+  10 gpcfg_uart_rts
+  11 gpcfg_uart_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
+  
+  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
+)
+
+(
+14 GPIO_NUMBER
+)
+
Index: format/security.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/security.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/security.format	(working copy)
@@ -0,0 +1,52 @@
+
+memalloc (
+16 mem_input_store
+
+2 mem_ec_loopc
+1 mem_aes_cmac_data_length
+/* ecc calculation */
+32 mem_ax_256 //32 bytes
+32 mem_ay_256 // 32 bytes
+32 mem_az_256 // 32 bytes
+32 mem_bx_256 // 32 bytes
+32 mem_by_256 // 31 bytes
+
+32 mem_bz_256  //32 bytes
+32 mem_cx_256  //32 bytes
+31 mem_cy_256  // 32 bytes
+1 mem_cy5_256 // 1 byte
+32 mem_cz_256 // 32 bytes
+32 mem_k_256 //32 bytes
+32  mem_tmp1_256 //32 bytes
+
+32 mem_tmp5_256
+32  mem_tmp2_256
+0 mem_tmp3_256
+32 mem_t1_256
+0 mem_tmp0_256
+0 mem_dat
+32 mem_t0_256
+32 mem_t2_256
+32 mem_t3_256
+32 mem_t7_256
+
+
+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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/simple_pairing.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/simple_pairing.format	(working copy)
@@ -0,0 +1,68 @@
+
+ifdef SECURE_CONNECTION
+
+memalloc(
+0 mem_sp_state_start
+1 mem_sp_dhkey_invalid
+4 mem_gkey
+0 mem_sp_state_end
+
+32 mem_le_pubkey_remote_x_256
+32 mem_le_pubkey_remote_y_256
+32 mem_le_dhkey_256
+
+16 mem_sp_confirm_remote
+)
+
+xmemalloc(
+1 mem_sc_only_mode
+1 mem_sp_debug_mode
+1 mem_secure_connections_enable
+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
+
+
+0 mem_sp_state_xmem
+1 mem_authentication_passkey_times
+1 mem_passkey_1bit
+0 mem_sp_state_xmem_end
+)
+endif
+
+/* simple pairing status flag */
+(
+  0x00   SP_FLAG_STANDBY
+  0x02   LE_SP_FLAG_COMMIT_256
+
+)
+
+/* simple pairing calc flag */
+(
+  0x00   SP_CALC_STANDBY
+  0x03   SP_CALC_PUBKEY_256
+  0x04   SP_CALC_DHKEY_256
+)
+
+
+
+/* simple paring invalid flag */
+(
+  0x00   SP_KEY_INVALID
+  0x03   SP_KEY_VALID_256
+
+)
+
+
+//mem_secure_connections_enable
+(
+0 SECURE_CONNECTIONS_LE_BIT
+1 SECURE_CONNECTIONS_BR_BIT
+)
+
+
+  
Index: format/ui.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ui.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/ui.format	(working copy)
@@ -0,0 +1,148 @@
+/*****************************************************************************/
+/* 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(
+1 mem_ipc_skip_continue_proc
+) 
+
+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_ui_state_map
+
+1 mem_ui_button_timeout
+1 mem_ui_button_gpio
+1 mem_ui_led_init_state_set
+
+1 mem_ui_led_struct_num
+2 mem_ui_led_struct_ptr
+
+)
+
+
+//mem_ui_state_map
+(
+9 UI_STATE_BLE_CONNECTED
+10 UI_STATE_BLE_WRITE_RCV
+11 UI_STATE_BLE_ADV
+12 UI_STATE_BTN_DOWN
+)
+
+
+
+/* memui_Commands */
+(
+0 BT_CMD_STANDBY
+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
+31 BT_CMD_STORE_RECONN_INFO_LE
+34 BT_CMD_START_24G
+35 BT_CMD_STOP_24G
+36 BT_CMD_PAIR_24G
+)
+
+(
+0x00 BT_EVT_NULL
+0x0F BT_EVT_DISCOVERY_STOPED
+0x10 BT_EVT_BUTTON_LONG_PRESSED
+0x14 BT_EVT_LE_CONNECTED
+0X15 BT_EVT_LE_DISCONNECTED
+0x17 BT_EVT_BUTTON_ENTER_HIBERNATE
+0x25 BT_EVT_BUTTON_ADJUST_DPI
+0x28 BT_EVT_LE_WRITE_REQUEST
+0x29 BT_EVT_LE_ENC_INFO
+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
+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
+)
+
+
+(
+	160 UI_HUNDRED_MILLISECOND_TIME
+	0XFF UI_BUTTON_GPIO_DISABLE
+)
+
+(
+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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/usb.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/usb.format	(working copy)
@@ -0,0 +1,273 @@
+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
+2 mem_hidreportdesc_ep3
+28 mem_hidreportdesc_ep3_list
+19 mem_devicedesc
+100 mem_confdesc
+5 mem_string0
+30 mem_string1
+30 mem_string2
+30 mem_string3
+2 mem_cb_usb_config
+2 mem_cb_usb_ep3_process
+1 mem_usb_ep3_enable
+
+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
+1 mem_usb_sdsystem_wakeup_flag_judge
+
+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_usb_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
+64 mem_usb_txbuf3
+64 mem_usb_rxbuf_temp
+1 mem_usb_ep3_out_data_len
+1 mem_usb_ep3_in_data_len
+1 mem_usb_ep3_out_data_flag
+64 mem_usb_ep3_in_data
+64 mem_usb_ep3_out_data
+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
+)
+
+(
+0 USB_EP0_IN_FIFO_BUSY
+1 USB_EP1_IN_FIFO_BUSY
+2 USB_EP2_IN_FIFO_BUSY
+3 USB_EP3_IN_FIFO_BUSY
+4 USB_DN_STATUS
+5 USB_DP_STATUS
+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
+)
+
+(
+640 TIMER_NAK_DELAY
+5000 TIMER_WAKEUP_DELAY
+)
+
Index: format/utility.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/utility.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/format/utility.format	(working copy)
@@ -0,0 +1,74 @@
+
+memalloc(
+
+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_le_adv_channel_map_temp
+0 mem_le_data_len_temp	//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_tx_buf_temp //48byte
+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
+)
+
+
+//util fifo param
+(
+
+8 UTIL_FIFO_LEN
+-1 UTIL_FIFO_OFFSET
+)
+
+
Index: output/auth.rom
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/auth.rom	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/auth.rom	(working copy)
@@ -0,0 +1,2037 @@
+01
+00
+02
+00
+28
+02
+00
+18
+02
+00
+02
+03
+28
+01
+0a
+03
+00
+02
+00
+2a
+14
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+04
+00
+02
+03
+28
+01
+02
+05
+00
+02
+01
+2a
+02
+c2
+03
+06
+00
+02
+03
+28
+01
+02
+07
+00
+02
+04
+2a
+08
+06
+00
+06
+00
+64
+00
+2c
+01
+08
+00
+02
+00
+28
+02
+01
+18
+09
+00
+02
+03
+28
+01
+20
+0a
+00
+02
+05
+2a
+00
+0b
+00
+02
+02
+29
+02
+00
+00
+0c
+00
+02
+00
+28
+02
+0a
+18
+0d
+00
+02
+03
+28
+01
+02
+0e
+00
+02
+29
+2a
+06
+59
+69
+43
+68
+69
+70
+0f
+00
+02
+03
+28
+01
+02
+10
+00
+02
+50
+2a
+07
+02
+35
+12
+22
+aa
+01
+00
+11
+00
+02
+00
+28
+02
+12
+18
+12
+00
+02
+03
+28
+01
+06
+13
+00
+02
+4e
+2a
+01
+01
+14
+00
+02
+03
+28
+01
+12
+15
+00
+02
+4d
+2a
+08
+00
+00
+00
+00
+00
+00
+00
+00
+16
+00
+02
+02
+29
+02
+00
+00
+17
+00
+02
+08
+29
+02
+02
+01
+18
+00
+02
+03
+28
+01
+1a
+19
+00
+02
+4d
+2a
+07
+00
+00
+00
+00
+00
+00
+00
+1a
+00
+02
+02
+29
+02
+00
+00
+1b
+00
+02
+08
+29
+02
+01
+01
+1c
+00
+02
+03
+28
+01
+12
+1d
+00
+02
+4d
+2a
+02
+00
+00
+1e
+00
+02
+02
+29
+02
+00
+00
+1f
+00
+02
+08
+29
+02
+03
+01
+20
+00
+02
+03
+28
+01
+12
+21
+00
+02
+4d
+2a
+02
+00
+00
+22
+00
+02
+02
+29
+02
+00
+00
+23
+00
+02
+08
+29
+02
+04
+01
+24
+00
+02
+03
+28
+01
+0e
+25
+00
+02
+4d
+2a
+02
+00
+00
+26
+00
+02
+08
+29
+02
+02
+02
+27
+00
+02
+03
+28
+01
+02
+28
+00
+02
+4b
+2a
+bd
+05
+01
+09
+02
+a1
+01
+85
+01
+09
+01
+a1
+00
+05
+09
+19
+01
+29
+08
+15
+00
+25
+01
+75
+01
+95
+08
+81
+02
+05
+01
+09
+30
+09
+31
+16
+01
+f8
+26
+ff
+07
+75
+10
+95
+02
+81
+06
+09
+38
+15
+81
+25
+7f
+75
+08
+95
+01
+81
+06
+05
+0c
+0a
+38
+02
+95
+01
+81
+06
+c0
+c0
+05
+01
+09
+06
+a1
+01
+85
+02
+75
+01
+95
+08
+05
+07
+19
+e0
+29
+e7
+15
+00
+25
+01
+81
+02
+95
+01
+75
+08
+81
+03
+95
+05
+75
+01
+05
+08
+19
+01
+29
+05
+91
+02
+95
+01
+75
+03
+91
+03
+95
+06
+75
+08
+15
+00
+26
+ff
+00
+05
+07
+19
+00
+29
+ff
+81
+00
+c0
+05
+0c
+09
+01
+a1
+01
+85
+03
+19
+00
+2a
+ff
+03
+15
+00
+26
+ff
+03
+95
+01
+75
+10
+81
+00
+c0
+05
+01
+09
+80
+A1
+01
+85
+04
+15
+00
+25
+01
+75
+01
+95
+03
+19
+81
+29
+83
+81
+02
+95
+01
+75
+05
+81
+03
+C0
+29
+00
+02
+03
+28
+01
+1a
+2a
+00
+02
+33
+2a
+08
+00
+00
+00
+00
+00
+00
+00
+00
+2b
+00
+02
+02
+29
+02
+01
+00
+2c
+00
+02
+03
+28
+01
+02
+2d
+00
+02
+4a
+2a
+04
+01
+01
+00
+03
+2e
+00
+02
+00
+28
+02
+0f
+18
+2f
+00
+02
+03
+28
+01
+12
+30
+00
+02
+19
+2a
+01
+64
+31
+00
+02
+02
+29
+02
+00
+00
+32
+00
+02
+03
+28
+01
+04
+33
+00
+02
+4c
+2a
+00
+00
+00
+1a
+06
+bc
+ff
+09
+88
+a1
+01
+85
+04
+19
+00
+2a
+ff
+00
+15
+00
+26
+ff
+00
+75
+08
+95
+01
+81
+00
+c0
+3f
+05
+01
+09
+06
+a1
+01
+75
+01
+95
+08
+05
+07
+19
+e0
+29
+e7
+15
+00
+25
+01
+81
+02
+95
+01
+75
+08
+81
+03
+95
+05
+75
+01
+05
+08
+19
+01
+29
+05
+91
+02
+95
+01
+75
+03
+91
+03
+95
+06
+75
+08
+15
+00
+25
+ff
+05
+07
+19
+00
+29
+ff
+81
+00
+c0
+a3
+05
+01
+09
+02
+a1
+01
+85
+01
+09
+01
+a1
+00
+05
+09
+19
+01
+29
+05
+15
+00
+25
+01
+95
+05
+75
+01
+81
+02
+95
+01
+75
+03
+81
+01
+05
+01
+09
+30
+09
+31
+16
+01
+F8
+26
+FF
+07
+75
+10
+95
+02
+81
+06
+09
+38
+15
+81
+25
+7f
+75
+08
+95
+01
+81
+06
+05
+0c
+0a
+38
+02
+95
+01
+81
+06
+c0
+c0
+05
+01
+09
+80
+a1
+01
+85
+02
+05
+01
+19
+81
+29
+88
+15
+00
+25
+01
+95
+08
+75
+01
+81
+06
+c0
+05
+0c
+09
+01
+a1
+01
+85
+03
+15
+00
+26
+80
+03
+19
+00
+2a
+80
+03
+75
+10
+95
+01
+81
+00
+c0
+06
+00
+ff
+09
+0e
+a1
+01
+85
+BA
+95
+1f
+75
+08
+26
+ff
+00
+15
+00
+09
+01
+91
+02
+85
+BA
+95
+1f
+75
+08
+26
+ff
+00
+15
+00
+09
+01
+81
+02
+C0
+12
+12
+01
+00
+02
+00
+00
+00
+40
+51
+31
+20
+10
+02
+00
+01
+02
+00
+01
+3b
+09
+02
+3b
+00
+02
+01
+00
+a0
+32
+09
+04
+00
+00
+01
+03
+01
+01
+00
+09
+21
+00
+02
+00
+01
+22
+1a
+00
+07
+05
+81
+03
+40
+00
+02
+09
+04
+01
+00
+01
+03
+01
+02
+00
+09
+21
+00
+02
+00
+01
+22
+a3
+00
+07
+05
+82
+03
+40
+00
+02
+01
+00
+02
+00
+28
+02
+01
+18
+02
+00
+02
+03
+28
+01
+20
+03
+00
+02
+05
+2a
+01
+00
+04
+00
+02
+02
+29
+02
+00
+00
+05
+00
+02
+00
+28
+02
+00
+18
+06
+00
+02
+03
+28
+01
+02
+07
+00
+02
+00
+2a
+13
+43
+68
+69
+70
+73
+65
+61
+2d
+42
+4c
+45
+20
+20
+20
+20
+20
+20
+20
+20
+08
+00
+02
+03
+28
+01
+02
+09
+00
+02
+01
+2a
+02
+c1
+03
+0a
+00
+02
+03
+28
+01
+02
+0b
+00
+02
+04
+2a
+08
+06
+00
+06
+00
+64
+00
+2c
+01
+0c
+00
+02
+00
+28
+02
+0a
+18
+0d
+00
+02
+03
+28
+01
+02
+0e
+00
+02
+50
+2a
+07
+01
+05
+0e
+00
+0a
+02
+40
+0f
+00
+02
+00
+28
+02
+12
+18
+10
+00
+02
+03
+28
+01
+06
+11
+00
+02
+4e
+2a
+01
+01
+12
+00
+02
+03
+28
+01
+10
+13
+00
+02
+4d
+2a
+07
+00
+00
+00
+00
+00
+00
+00
+14
+00
+02
+02
+29
+02
+00
+00
+15
+00
+02
+08
+29
+02
+01
+01
+16
+00
+02
+03
+28
+01
+10
+17
+00
+02
+4d
+2a
+03
+00
+00
+00
+18
+00
+02
+02
+29
+02
+00
+00
+19
+00
+02
+08
+29
+02
+04
+01
+1a
+00
+02
+03
+28
+01
+10
+1b
+00
+02
+4d
+2a
+02
+00
+00
+1c
+00
+02
+02
+29
+02
+00
+00
+1d
+00
+02
+08
+29
+02
+03
+01
+1e
+00
+02
+03
+28
+01
+10
+1f
+00
+02
+4d
+2a
+03
+00
+00
+00
+20
+00
+02
+02
+29
+02
+00
+00
+21
+00
+02
+08
+29
+02
+05
+01
+22
+00
+02
+03
+28
+01
+12
+23
+00
+02
+4d
+2a
+02
+00
+00
+24
+00
+02
+02
+29
+02
+00
+00
+25
+00
+02
+08
+29
+02
+02
+01
+26
+00
+02
+03
+28
+01
+02
+27
+00
+02
+4b
+2a
+01
+00
+28
+00
+02
+03
+28
+01
+02
+29
+00
+02
+4a
+2a
+04
+11
+01
+00
+01
+2a
+00
+02
+03
+28
+01
+04
+2b
+00
+02
+4c
+2a
+01
+00
+2c
+00
+02
+00
+28
+02
+0f
+18
+00
+00
+03
+1f
+00
+ec
+0f
+00
+00
+00
+00
+00
+03
+1f
+00
+14
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+00
+c0
+fe
+00
+00
+00
+00
+03
+1f
+00
+00
+40
+01
+00
+00
+00
+00
+03
+1f
+00
+00
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+00
+00
+00
+00
+00
+00
+00
+02
+1b
+00
+e9
+00
+00
+00
+00
+00
+00
+02
+1b
+00
+ea
+00
+00
+00
+00
+00
+00
+02
+1b
+00
+00
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+28
+80
+11
+00
+00
+00
+00
+03
+1f
+00
+ae
+8f
+11
+00
+00
+00
+00
+03
+1f
+00
+00
+e0
+fc
+00
+00
+00
+00
+03
+1f
+00
+00
+00
+05
+00
+00
+00
+00
+03
+17
+00
+01
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+3c
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+ff
+17
+80
+00
+00
+00
+00
+03
+1f
+00
+d8
+0f
+00
+00
+00
+00
+00
+03
+17
+00
+00
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+01
+f8
+7f
+00
+00
+00
+00
+03
+1f
+00
+00
+40
+fc
+00
+00
+00
+00
+03
+1f
+00
+01
+18
+80
+00
+00
+00
+00
+03
+1f
+00
+3c
+40
+0b
+00
+00
+00
+00
+03
+1f
+00
+00
+c0
+03
+00
+00
+00
+00
+03
+1f
+00
+3c
+40
+ec
+00
+00
+00
+00
+03
+1f
+00
+3c
+80
+0c
+00
+00
+00
+00
+03
+1f
+00
+00
+10
+80
+00
+00
+00
+00
+03
+1f
+00
+3c
+80
+07
+00
+00
+00
+00
+03
+1f
+00
+96
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+6a
+0f
+00
+00
+00
+00
+00
+03
+1f
+00
+02
+d0
+ff
+00
+00
+00
+00
+03
+1f
+00
+02
+30
+00
+00
+00
+00
+00
+03
+1f
+00
+64
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+00
+b0
+f9
+00
+00
+00
+00
+07
+13
+00
+07
+06
+70
+07
+ac
+0d
+01
+07
+13
+00
+07
+06
+70
+07
+80
+0c
+01
+07
+13
+00
+07
+06
+70
+07
+54
+0b
+01
+07
+13
+00
+07
+06
+70
+07
+28
+0a
+01
+07
+13
+00
+07
+06
+70
+07
+fc
+08
+01
+07
+13
+00
+00
+06
+70
+07
+78
+05
+00
+07
+13
+00
+07
+07
+70
+07
+70
+07
+01
+07
+13
+00
+00
+07
+70
+07
+70
+07
+00
+07
+13
+00
+07
+05
+10
+0c
+70
+04
+01
+07
+13
+00
+07
+05
+48
+0b
+70
+04
+01
+07
+13
+00
+07
+05
+F0
+0A
+70
+04
+01
+07
+13
+00
+07
+05
+C4
+09
+70
+04
+01
+07
+13
+00
+07
+05
+6C
+07
+70
+04
+01
+07
+13
+00
+07
+05
+40
+04
+70
+04
+01
+07
+13
+00
+07
+05
+E8
+02
+70
+04
+01
+07
+13
+00
+00
+05
+00
+02
+70
+04
+00
+07
+13
+00
+00
+06
+70
+07
+ac
+0e
+00
+07
+13
+00
+00
+05
+10
+0d
+70
+04
+00
+03
+17
+00
+00
+fa
+00
+00
+00
+00
+00
+03
+17
+00
+00
+28
+00
+00
+00
+00
+00
+03
+17
+00
+00
+d2
+00
+00
+00
+00
+00
+03
+17
+00
+00
+32
+00
+00
+00
+00
+00
+03
+17
+00
+00
+00
+fa
+00
+00
+00
+00
+03
+17
+00
+00
+00
+05
+00
+00
+00
+00
+03
+17
+00
+00
+00
+f0
+00
+00
+00
+00
+03
+17
+00
+00
+00
+0f
+00
+00
+00
+00
+02
+23
+00
+30
+00
+00
+00
+00
+00
+00
+02
+23
+00
+00
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+a0
+30
+e8
+00
+00
+00
+00
+03
+1f
+00
+3c
+40
+07
+00
+00
+00
+00
+03
+1f
+00
+41
+40
+0b
+00
+00
+00
+00
+b7
+fd
+93
+26
+36
+3f
+f7
+cc
+34
+a5
+e5
+f1
+71
+d8
+31
+15
+04
+c7
+23
+c3
+18
+96
+05
+9a
+07
+12
+80
+e2
+eb
+27
+b2
+75
+8c
+a1
+89
+0d
+bf
+e6
+42
+68
+41
+99
+2d
+0f
+b0
+54
+bb
+16
+9b
+c2
+51
+2f
+53
+1a
+6a
+83
+b5
+02
+6e
+10
+16
+ab
+a3
+42
Index: output/eeprom.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/eeprom.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/eeprom.dat	(working copy)
@@ -0,0 +1,1747 @@
+00
+02
+aa
+55
+aa
+04
+c2
+84
+00
+0f
+c0
+1b
+80
+74
+c0
+0b
+80
+12
+c0
+0c
+00
+2e
+c0
+10
+00
+49
+c0
+1e
+80
+c4
+c0
+23
+00
+d6
+c0
+26
+00
+e1
+c0
+29
+01
+02
+c0
+2d
+00
+9a
+c0
+2f
+00
+6c
+c0
+2f
+80
+70
+c0
+38
+00
+4b
+c0
+71
+80
+bf
+20
+20
+3a
+8a
+c0
+30
+80
+cd
+c1
+7f
+80
+00
+20
+20
+3a
+8a
+6f
+e0
+c1
+16
+c0
+01
+80
+1e
+c0
+03
+00
+20
+c0
+05
+3a
+00
+c0
+4a
+00
+24
+c0
+4f
+00
+2b
+c0
+55
+3a
+0f
+70
+8a
+3b
+2c
+70
+8a
+3c
+17
+70
+8a
+39
+8a
+70
+8a
+3a
+0f
+20
+20
+39
+f4
+70
+8a
+3b
+48
+20
+20
+00
+1a
+70
+8a
+3b
+70
+70
+8a
+3c
+1f
+70
+8a
+39
+c9
+20
+20
+00
+1c
+70
+8a
+39
+85
+70
+8a
+3a
+04
+70
+8a
+14
+a3
+70
+8a
+15
+0a
+70
+8a
+3b
+18
+70
+8a
+3c
+0f
+20
+60
+00
+00
+70
+8a
+39
+83
+70
+8a
+3a
+02
+20
+20
+00
+26
+70
+8a
+75
+03
+70
+8a
+85
+00
+70
+89
+6f
+10
+6f
+e0
+c3
+ef
+20
+5a
+6d
+31
+70
+8a
+03
+05
+70
+8a
+7a
+94
+20
+40
+3a
+44
+20
+40
+3a
+3f
+20
+40
+3a
+3a
+70
+8a
+8b
+e6
+70
+8a
+83
+90
+70
+8a
+0e
+0b
+70
+8a
+0f
+05
+70
+89
+68
+76
+70
+89
+69
+76
+6f
+e0
+c0
+9a
+c0
+84
+00
+41
+70
+8a
+08
+34
+70
+8a
+01
+ff
+20
+00
+00
+64
+70
+8a
+02
+0e
+70
+8a
+00
+03
+20
+40
+00
+19
+70
+8a
+9a
+28
+70
+8a
+9b
+3f
+20
+20
+3a
+35
+20
+40
+3c
+18
+20
+20
+3b
+48
+70
+80
+80
+73
+20
+40
+6e
+b3
+20
+40
+00
+55
+20
+40
+57
+a0
+20
+75
+80
+00
+20
+40
+59
+bd
+20
+40
+56
+2e
+20
+40
+5c
+c5
+20
+40
+00
+8e
+20
+20
+52
+34
+20
+75
+80
+00
+20
+40
+52
+5e
+c4
+0b
+80
+00
+20
+40
+01
+18
+d8
+40
+00
+02
+df
+e0
+07
+ee
+da
+20
+46
+3d
+20
+40
+68
+c5
+6f
+e1
+46
+3d
+d8
+40
+aa
+55
+98
+46
+7c
+00
+20
+22
+80
+66
+20
+40
+5b
+76
+df
+20
+00
+02
+da
+20
+46
+3d
+df
+e0
+07
+ee
+20
+20
+68
+83
+20
+40
+00
+69
+70
+45
+e5
+00
+20
+20
+5b
+81
+6f
+e0
+c5
+c0
+67
+e0
+c6
+3f
+20
+60
+00
+00
+18
+42
+7e
+00
+20
+7a
+00
+00
+c1
+7f
+80
+00
+20
+20
+5f
+23
+18
+42
+7e
+00
+20
+7a
+00
+00
+c1
+7f
+80
+00
+20
+20
+5f
+30
+6f
+e0
+c9
+11
+20
+3a
+52
+c8
+6f
+e0
+c5
+be
+67
+e0
+c5
+d5
+6f
+e0
+c5
+bd
+c1
+7f
+80
+00
+20
+40
+69
+2d
+6f
+e0
+c5
+bd
+d8
+40
+00
+3e
+20
+40
+6b
+bd
+6f
+e0
+c5
+c8
+d8
+40
+00
+3e
+20
+40
+6b
+bd
+68
+48
+c5
+bc
+20
+40
+54
+7f
+68
+48
+c5
+bc
+20
+40
+6b
+85
+20
+40
+d2
+d2
+20
+40
+54
+7b
+68
+48
+c5
+bc
+20
+40
+6b
+7c
+20
+40
+69
+31
+68
+48
+c5
+bd
+20
+40
+6b
+ae
+68
+48
+c5
+c8
+20
+20
+6b
+ae
+58
+00
+5f
+ad
+67
+e1
+45
+43
+58
+00
+00
+93
+67
+e1
+45
+45
+20
+20
+52
+3d
+20
+40
+4d
+15
+24
+74
+00
+00
+20
+40
+74
+e0
+70
+49
+05
+01
+20
+20
+5f
+a6
+20
+40
+74
+e0
+20
+20
+3c
+18
+20
+40
+54
+9b
+24
+74
+00
+00
+6f
+e0
+c9
+05
+70
+49
+05
+00
+24
+5a
+00
+98
+6f
+e4
+48
+64
+c3
+0a
+de
+39
+20
+40
+00
+a5
+6f
+e0
+c8
+44
+24
+3a
+00
+aa
+20
+20
+5e
+39
+6f
+e0
+c5
+78
+1f
+e1
+7e
+18
+24
+3a
+57
+2d
+20
+40
+57
+30
+20
+20
+57
+2a
+20
+40
+00
+b1
+70
+44
+d4
+02
+da
+20
+00
+09
+6f
+e0
+c8
+45
+24
+3a
+5e
+54
+da
+40
+48
+8d
+20
+60
+00
+00
+6f
+e0
+c5
+78
+c2
+81
+80
+ba
+c2
+82
+00
+b5
+20
+60
+00
+00
+58
+00
+00
+00
+67
+e0
+c8
+84
+67
+e0
+c8
+8d
+58
+6f
+00
+00
+20
+20
+5c
+9e
+58
+00
+00
+00
+67
+e0
+c8
+84
+67
+e0
+c8
+8d
+58
+72
+00
+00
+20
+20
+5c
+9e
+18
+42
+7e
+00
+c2
+80
+80
+c2
+20
+20
+3c
+e3
+70
+8a
+6d
+89
+20
+20
+3c
+e9
+20
+40
+53
+39
+6f
+e0
+c9
+12
+c0
+00
+80
+c8
+70
+80
+70
+80
+6f
+e0
+80
+17
+79
+20
+7e
+05
+67
+e0
+80
+17
+20
+40
+3c
+18
+20
+20
+5a
+f0
+78
+34
+7c
+00
+20
+40
+3b
+1b
+6f
+e1
+c0
+be
+20
+3a
+74
+ca
+6f
+e0
+c0
+94
+20
+3a
+74
+ca
+6f
+e0
+c8
+99
+24
+7a
+00
+00
+20
+20
+4d
+1c
+1a
+62
+7e
+00
+67
+e0
+c8
+50
+1f
+e3
+fe
+00
+1f
+e2
+24
+00
+18
+42
+26
+00
+20
+40
+54
+7b
+1a
+62
+04
+00
+20
+40
+6b
+85
+7d
+20
+a4
+00
+20
+40
+57
+53
+20
+20
+57
+3f
+1a
+62
+7e
+00
+c0
+1e
+00
+e5
+c0
+1d
+00
+f1
+20
+20
+59
+14
+6f
+e2
+44
+da
+67
+e2
+45
+33
+67
+e2
+46
+40
+20
+40
+4b
+ce
+20
+40
+5e
+1b
+20
+40
+5a
+a9
+20
+40
+58
+c4
+70
+47
+68
+00
+70
+45
+47
+00
+70
+45
+2d
+00
+68
+4a
+45
+33
+20
+20
+5e
+17
+6f
+e0
+c5
+4b
+24
+3a
+5d
+80
+6f
+e0
+c5
+2d
+c0
+01
+5d
+f4
+c0
+02
+00
+f8
+c0
+01
+80
+fd
+20
+20
+5d
+ed
+6f
+e4
+48
+64
+c3
+17
+dd
+ed
+6f
+e0
+c8
+6c
+c0
+00
+dd
+ed
+20
+20
+5d
+cb
+6f
+e4
+48
+64
+c3
+17
+dd
+ed
+c2
+89
+dd
+ed
+c2
+89
+5d
+ed
+20
+20
+5d
+c4
+20
+40
+5b
+90
+c4
+0b
+80
+00
+df
+e0
+07
+90
+1f
+e2
+24
+00
+20
+40
+01
+24
+6f
+e2
+49
+0d
+20
+3a
+01
+10
+67
+e2
+49
+09
+1a
+40
+a4
+04
+df
+e0
+07
+cf
+9a
+46
+7c
+00
+24
+61
+00
+00
+1a
+42
+7e
+00
+20
+20
+01
+06
+6f
+e2
+49
+09
+68
+4a
+46
+40
+98
+46
+7c
+00
+20
+62
+80
+00
+df
+20
+00
+04
+da
+20
+46
+40
+1a
+42
+7e
+00
+20
+20
+68
+83
+df
+e0
+07
+90
+1f
+e2
+24
+00
+20
+40
+01
+24
+6f
+e2
+49
+0d
+20
+3a
+01
+27
+67
+e2
+49
+09
+1a
+40
+a4
+04
+df
+e0
+07
+cf
+9a
+46
+7c
+00
+24
+21
+01
+27
+1a
+42
+7e
+00
+20
+20
+01
+1a
+d8
+40
+00
+04
+da
+20
+49
+0d
+20
+20
+68
+c5
+6f
+e2
+49
+09
+67
+e2
+46
+40
+20
+60
+00
+00
+4a
+97
+aa
+55
+06
+00
+3c
+44
+14
+27
+32
+41
+51
+61
+aa
+55
+01
+00
+de
+01
+5a
+aa
+55
+0d
+00
+02
+40
+80
+01
+01
+00
+80
+20
+40
+10
+04
+c4
+00
+00
+01
+aa
+55
+01
+00
+1c
+40
+08
+aa
+55
+01
+00
+2c
+40
+02
+aa
+55
+02
+00
+94
+40
+01
+08
+aa
+55
+02
+00
+9d
+40
+1e
+41
+aa
+55
+08
+00
+c4
+40
+88
+0b
+ce
+35
+3f
+0c
+33
+03
+aa
+55
+03
+00
+cd
+40
+9d
+10
+22
+aa
+55
+07
+00
+18
+41
+ff
+04
+00
+00
+08
+00
+ff
+aa
+55
+04
+00
+c4
+43
+a0
+0f
+00
+03
+aa
+55
+04
+00
+ea
+43
+01
+00
+20
+d3
+aa
+55
+06
+00
+36
+44
+1e
+ff
+00
+00
+da
+45
+aa
+55
+04
+00
+d4
+44
+01
+00
+c0
+12
+aa
+55
+03
+00
+fa
+44
+00
+48
+60
+aa
+55
+01
+00
+1d
+45
+07
+aa
+55
+05
+00
+2e
+45
+01
+0f
+0f
+0f
+0f
+aa
+55
+02
+00
+3b
+45
+6f
+47
+aa
+55
+04
+00
+66
+45
+50
+00
+2c
+01
+aa
+55
+01
+00
+72
+45
+7d
+aa
+55
+01
+00
+9f
+45
+0a
+aa
+55
+2f
+00
+a5
+45
+04
+00
+00
+58
+02
+00
+64
+9e
+85
+90
+63
+75
+80
+20
+01
+03
+06
+06
+03
+01
+05
+0a
+08
+09
+0d
+01
+02
+00
+ff
+ff
+07
+ff
+ff
+ff
+ff
+0c
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+aa
+55
+01
+00
+6d
+46
+05
+aa
+55
+0c
+00
+7d
+46
+03
+04
+01
+02
+20
+2a
+3f
+15
+14
+1b
+11
+0e
+aa
+55
+0a
+00
+8c
+46
+09
+5a
+26
+34
+19
+04
+09
+00
+ff
+ff
+aa
+55
+0a
+00
+a0
+46
+09
+5a
+0d
+10
+1d
+ed
+7d
+80
+ff
+ff
+aa
+55
+64
+00
+e6
+46
+09
+5a
+ff
+27
+ab
+40
+b3
+56
+9b
+e6
+a8
+12
+a9
+c0
+be
+e6
+a5
+af
+a0
+21
+a1
+02
+b8
+10
+b9
+0b
+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
+10
+00
+56
+47
+09
+5a
+0b
+f3
+09
+00
+ff
+ff
+09
+a5
+0b
+f3
+09
+00
+ff
+ff
+aa
+55
+09
+00
+64
+48
+00
+09
+e2
+00
+00
+00
+03
+1b
+01
+aa
+55
+12
+00
+72
+48
+02
+00
+64
+00
+70
+17
+14
+00
+90
+01
+e8
+03
+90
+01
+64
+00
+00
+05
+aa
+55
+03
+00
+9a
+48
+02
+5b
+01
+aa
+55
+23
+00
+c3
+48
+14
+00
+03
+00
+00
+58
+02
+00
+00
+18
+6a
+00
+80
+bb
+00
+05
+40
+19
+01
+00
+77
+01
+0b
+00
+00
+00
+00
+80
+bb
+00
+00
+00
+77
+01
+00
+aa
+55
+01
+00
+11
+49
+01
+55
+aa
+aa
+55
+44
+a1
+d7
+e7
Index: output/memmap.format
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/memmap.format	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/memmap.format	(working copy)
@@ -0,0 +1,1950 @@
+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_current_context
+0x0007 mem_le_ch_mapped
+0x0008 mem_last_freq
+0x0009 mem_rssi
+0x000a mem_context_ptr
+0x000c mem_rx_window
+0x000e mem_lpm_adjust
+0x000f mem_sync_clke
+0x0015 mem_lpm_current_mult
+0x0016 mem_gpio_wakeup_low
+0x001a mem_gpio_wakeup_high
+0x001e mem_clkn_bt
+0x0022 mem_clke_bt
+0x0026 mem_dpll_clkn
+0x002a mem_slot_offset
+0x002c mem_select_list_item
+0x002d mem_temp_reconn_record
+0x002d mem_record_bt_mode
+0x002e mem_list_item_ptr
+0x0030 mem_rssi_hex
+0x0031 mem_param_tx_setup
+0x0033 mem_param_rf_setup
+0x0035 mem_param_conn_access
+0x0037 mem_param_clke_cal
+0x0039 mem_param_pll_setup
+0x003b mem_param_rx_setup
+0x003d mem_param_dpll_start_delay
+0x003f mem_param_rt_rthalfslot
+0x0041 mem_param_clke_cal_le_1m
+0x0043 mem_param_clke_cal_le_2m
+0x0045 mem_param_clke_cal_le_coded
+0x0047 mem_le_rxbuf
+0x014b mem_le_mic
+0x014f mem_le_peer_mic
+0x0153 mem_le_mrand
+0x0163 mem_le_state
+0x0164 mem_le_mode
+0x0165 mem_le_tsniff
+0x0167 mem_le_anchor
+0x016b mem_le_clk_offset
+0x0171 mem_le_receive_window
+0x0173 mem_le_plap
+0x0179 mem_le_conn_handle
+0x017a mem_le_arq
+0x017b mem_le_ch
+0x017c mem_le_hop
+0x017d mem_le_event_count
+0x017f mem_le_supervision_timer
+0x0183 mem_le_instant
+0x0185 mem_le_channels
+0x0186 mem_le_op
+0x0187 mem_le_access
+0x018b mem_le_crcinit
+0x018e mem_le_window_size
+0x018f mem_le_slave_latency
+0x0191 mem_le_superto
+0x0193 mem_le_channel_map
+0x0198 mem_le_rx_phy
+0x0199 mem_le_tx_phy
+0x019a mem_le_update_new_param
+0x01a3 mem_le_sk
+0x01b3 mem_le_peer_sca
+0x01b4 mem_le_err_code
+0x01b5 mem_le_ll_pairing_fail_reason
+0x01b6 mem_le_testtype
+0x01b7 mem_cmd_le_create_conn
+0x01b8 mem_ucode_device_flag
+0x01b9 mem_peripheral_lock_flag
+0x01ba mem_ucode_status
+0x01bb mem_spid_tbuf
+0x01bc mem_iicd_tbuf
+0x01bc mem_addr_hi
+0x01bd mem_addr_mi
+0x01be mem_addr_lo
+0x01bf mem_iicd_addr
+0x01c0 mem_spid_rbuf
+0x01c4 mem_ucode_buf
+0x01c6 mem_ucode_len
+0x01c8 mem_sched_addr
+0x01ca mem_ucode_ptr
+0x01cc mem_ucode_keybuf
+0x01dc mem_app_evt_timer_count
+0x01dd mem_load_delay
+0x01de mem_load_check_sum
+0x01df mem_input_store
+0x01ef mem_ec_loopc
+0x01f1 mem_aes_cmac_data_length
+0x01f2 mem_ax_256//32 bytes
+0x0212 mem_ay_256// 32 bytes
+0x0232 mem_az_256// 32 bytes
+0x0252 mem_bx_256// 32 bytes
+0x0272 mem_by_256// 31 bytes
+0x0292 mem_bz_256//32 bytes
+0x02b2 mem_cx_256//32 bytes
+0x02d2 mem_cy_256// 32 bytes
+0x02f1 mem_cy5_256// 1 byte
+0x02f2 mem_cz_256// 32 bytes
+0x0312 mem_k_256//32 bytes
+0x0332 mem_tmp1_256//32 bytes
+0x0352 mem_tmp5_256
+0x0372 mem_tmp2_256
+0x0392 mem_tmp3_256
+0x0392 mem_t1_256
+0x03b2 mem_tmp0_256
+0x03b2 mem_dat
+0x03b2 mem_t0_256
+0x03d2 mem_t2_256
+0x03f2 mem_t3_256
+0x0412 mem_t7_256
+0x0432 mem_p_256
+0x0452 mem_a_256
+0x0472 mem_gx_256
+0x0492 mem_gy_256
+0x04b2 mem_le_slat
+0x04c2 mem_ipc_skip_continue_proc
+0x04c3 mem_fifo_temp
+0x04c4 mem_pdatatemp
+0x04cc mem_temp//8 bytes
+0x04d4 mem_timeup// 4 bytes
+0x04d8 mem_rega//4 bytes
+0x04dc mem_regb//4 bytes
+0x04e0 mem_regc//3 bytes
+0x04e3 mem_contr//2 bytes
+0x04e5 mem_contw//2 bytes
+0x04e7 mem_contus
+0x04e9 mem_contue
+0x04eb mem_contu
+0x04ed mem_queue
+0x04ef mem_loopcnt
+0x04f1 mem_wakup_from_power_flag
+0x04f2 mem_saved_gpio_in
+0x04f6 mem_module_rx_error_data_buffer
+0x04f6 mem_le_adv_channel_map_temp
+0x04f6 mem_le_data_len_temp//1byte
+0x04f6 mem_event_cmd_response_content//2byte
+0x04f6 mem_le_prand//16byte
+0x04f6 mem_AES_CMAC_k//16 bytes
+0x04f6 mem_regext_index//1 bytes
+0x04f6 mem_temp_block0
+0x04f7 mem_le_data_temp//15bytes
+0x04f7 mem_temp_block1
+0x0506 mem_le_tx_buf_temp//48byte
+0x0506 mem_le_aes_128//16byte
+0x0506 mem_regext//64 bytes
+0x0506 mem_AES_CMAC_k1//16 bytes
+0x0506 mem_temp_block2
+0x0516 mem_AES_CMAC_k2//16 bytes
+0x0516 mem_temp_block3
+0x0526 mem_AES_CMAC_temp// 16 bytes
+0x0526 mem_temp_block4
+0x0536 mem_AES_CMAC_M_last// 16 bytes
+0x0536 mem_module_uart_cmd
+0x0537 mem_module_uart_opcode
+0x0538 mem_module_uart_len
+0x0539 mem_module_temp_nl_discard_packet
+0x053a mem_temp_block5
+0x0546 mem_le_mackey//16 bytes
+0x0546 mem_app_receive_temp
+0x0546 mem_key_value_temp
+0x0548 mem_key_value
+0x054a mem_key_value_temp1
+0x054b mem_key_value_temp2
+0x054c mem_key_value_temp3
+0x054d mem_key_value_temp4
+0x054e mem_key_value_temp5
+0x054f mem_key_value_temp6
+0x0550 mem_temp_block6
+0x0556 mem_scale_ratio
+0x0559 mem_xcnt
+0x055c mem_scale_ratio_temp
+0x055e mem_base_start
+0x055e mem_flash_paired_addr_base
+0x055e mem_flash_paired_addr0
+0x0560 mem_flash_paired_addr0_group
+0x0561 mem_flash_paired_addr1
+0x0563 mem_flash_paired_addr1_group
+0x0564 mem_flash_paired_addr2
+0x0566 mem_flash_paired_addr2_group
+0x0567 mem_flash_paired_addr3
+0x0569 mem_flash_paired_addr3_group
+0x056a mem_flash_paired_addr4
+0x056c mem_flash_paired_addr4_group
+0x056d mem_flash_paired_addr5
+0x056f mem_flash_paired_addr5_group
+0x0570 mem_flash_paired_addr6
+0x0572 mem_flash_paired_addr6_group
+0x0573 mem_flash_paired_addr7
+0x0575 mem_flash_paired_addr7_group
+0x0576 mem_flash_paired_addr8
+0x0578 mem_flash_paired_addr8_group
+0x0579 mem_flash_paired_addr9
+0x057b mem_flash_paired_addr9_group
+0x057c mem_msg_cnt_base
+0x057c mem_addr0_msg_cnt
+0x057d mem_addr1_msg_cnt
+0x057e mem_addr2_msg_cnt
+0x057f mem_addr3_msg_cnt
+0x0580 mem_addr4_msg_cnt
+0x0581 mem_addr5_msg_cnt
+0x0582 mem_addr6_msg_cnt
+0x0583 mem_addr7_msg_cnt
+0x0584 mem_addr8_msg_cnt
+0x0585 mem_addr9_msg_cnt
+0x0586 mem_msg_cnt_base1
+0x0587 mem_msg_addr_save
+0x0588 mem_msg_before_queue
+0x05a6 mem_count_and_random
+0x05a9 mem_msg_cnt_judgment_window_time
+0x05aa mem_msg_judgment_window_time
+0x05ab mem_base_end
+0x055e mem_tst_pktcnt_sync
+0x0560 mem_tst_pktcnt_hec
+0x0562 mem_tst_pktcnt_crc
+0x0564 mem_tst_pktcnt_dmh
+0x0566 mem_tmp_buffer_head
+0x0569 mem_tmp_buffer
+0x05b9 mem_tester_emulate
+0x05ba mem_temp_payload
+0x05ba test_mode_scenario
+0x05bb test_mode_hopping_mode
+0x05bc test_mode_tx_freq
+0x05bd test_mode_rx_freq
+0x05be test_mode_power_mode
+0x05bf test_mode_poll_period
+0x05c0 test_mode_packet_type
+0x05c1 test_mode_data_length
+0x05c3 mem_test_mode_old_debug_config
+0x05c4 mem_tester_cnt
+0x055e mem_usb_status
+0x055f mem_usb_fifo_empty
+0x0560 mem_usb_read_len
+0x0562 mem_usb_txbuf
+0x05a3 mem_usb_txbuf1
+0x05ad mem_usb_txbuf2
+0x05b7 mem_usb_rxbuf
+0x05f7 mem_usb_rxbuf_end
+0x05f8 mem_bufptr
+0x05fa mem_remain
+0x05fb mem_hidreportdesc_kb
+0x05fd mem_hidreportdesc_m
+0x05ff mem_hidreportdesc_ep3
+0x0601 mem_hidreportdesc_ep3_list
+0x061d mem_devicedesc
+0x0630 mem_confdesc
+0x0694 mem_string0
+0x0699 mem_string1
+0x06b7 mem_string2
+0x06d5 mem_string3
+0x06f3 mem_cb_usb_config
+0x06f5 mem_cb_usb_ep3_process
+0x06f7 mem_usb_ep3_enable
+0x06f8 mem_usb_tx_interval
+0x06f9 mem_usb_vid_pid
+0x0702 mem_usb_zero_packet
+0x0704 mem_usb_ones_packet
+0x0706 mem_usb_two_packet
+0x0708 mem_usb0_state
+0x0709 mem_usb_offline_check_gpio
+0x070a mem_usb_sdsystem_wakeup_flag_judge
+0x070b mem_usb_clear_mem_start
+0x070b mem_usb_setup
+0x070b mem_usb_setup_bmRequestType
+0x070c mem_usb_setup_bRequest
+0x070d mem_usb_setup_bValue
+0x070e mem_usb_setup_bValueH
+0x070f mem_usb_setup_wIndex
+0x0711 mem_usb_setup_bLength
+0x0712 mem_usb_setup_bLengthH
+0x0713 mem_usb0_set_report_data
+0x0753 mem_usb0_get_report_data
+0x0793 mem_usb_setup_bValue_temp
+0x0795 mem_usb0_get_set_report
+0x0796 mem_usb0_data_ready_report
+0x0797 mem_usb_tx_win_enable
+0x0798 mem_usb_tx_mac_enable
+0x0799 mem_usb_idle_flag
+0x079a mem_usb_idle_rate
+0x079b mem_usb_get_protocol_flag
+0x079c mem_usb_set_protocol_status
+0x079d mem_usb_set_protocol_value
+0x079e mem_usb_state
+0x079f mem_usb_remote_wakeup
+0x07a0 mem_usb_clear_remote_wakeup
+0x07a1 mem_usb_sdsystem_wakeup_flag
+0x07a2 mem_usb_ep0_stall_status
+0x07a3 mem_usb_ep1_stall_status
+0x07a4 mem_usb_ep2_stall_status
+0x07a5 mem_usb_ep3_stall_status
+0x07a6 mem_dsc_info_data_pointer
+0x07a8 mem_dsc_info_len
+0x07a9 mem_usb_ep1_data
+0x07aa mem_usb_ep2_data
+0x07ab mem_usb_tx_enable
+0x07ac mem_usb_device_enumeration_endflag
+0x07ad mem_usb_wakestate_onetime_flag
+0x07ae mem_usb_mac_wakeup_trig
+0x07af mem_usb_set_high_addr_flag
+0x07b0 mem_usb_clear_halt
+0x07b1 mem_usb_mouse_data
+0x07c1 mem_usb_kb_data
+0x07d1 mem_usb_kb_multikey
+0x07e1 mem_usb_kb_system
+0x07f1 mem_usb_test_cnt
+0x07f3 mem_usb_test_kb
+0x07fd mem_usb_txbuf3
+0x083d mem_usb_rxbuf_temp
+0x087d mem_usb_ep3_out_data_len
+0x087e mem_usb_ep3_in_data_len
+0x087f mem_usb_ep3_out_data_flag
+0x0880 mem_usb_ep3_in_data
+0x08c0 mem_usb_ep3_out_data
+0x0900 mem_usb_clear_mem_end
+0x0900 mem_dg_rssi_noise_buffer
+0x0a00 mem_dg_rssi_noise_dg_buffer
+0x0b00 mem_dg_rssi_noise_ms_buffer
+0x0c00 mem_dg_rssi_noise_kb_buffer
+0x0900 mem_init_cnt
+0x0902 mem_data_pre
+0x0904 mem_data_current
+0x0906 mem_data_sum
+0x0909 mem_data_value
+
+0x019a mem_le_new_param
+0x019a mem_le_new_transmitwindowsize
+0x019b mem_le_new_transmitwindowoffset
+0x019d mem_le_new_conninterval
+0x019f mem_le_new_connslavelatency
+0x01a1 mem_le_new_connsupervisiontimeout
+0x019a mem_le_new_map
+0x019a mem_le_new_m2s_phy
+0x019b mem_le_new_s2m_phy
+0x0047 mem_le_rxbuf_data_header
+0x0048 mem_le_rxbuf_data_length
+0x0049 mem_le_rxbuf_data_payload
+0x0047 mem_le_rxbuf_data_ll_header
+0x0048 mem_le_rxbuf_data_ll_length
+0x0049 mem_le_rxbuf_data_ll_opcode
+0x004a mem_le_rxbuf_data_ll_control_data
+0x0047 mem_le_rxbuf_adv_header
+0x0048 mem_le_rxbuf_adv_length
+0x0049 mem_le_rxbuf_adv_payload
+0x0047 mem_le_rxbuf_adv_scan_req_header
+0x0048 mem_le_rxbuf_adv_scan_req_length
+0x0049 mem_le_rxbuf_adv_scan_req_scan_address
+0x004f mem_le_rxbuf_adv_scan_req_adv_address
+0x0047 mem_le_rxbuf_adv_connect_ind_header
+0x0048 mem_le_rxbuf_adv_connect_ind_length
+0x0049 mem_le_rxbuf_adv_connect_ind_init_address
+0x004f mem_le_rxbuf_adv_connect_ind_adv_address
+0x0055 mem_le_rxbuf_adv_connect_ind_access_address
+0x0059 mem_le_rxbuf_adv_connect_ind_crc_init
+0x005c mem_le_rxbuf_adv_connect_ind_win_size
+0x005d mem_le_rxbuf_adv_connect_ind_win_offset
+0x005f mem_le_rxbuf_adv_connect_ind_interval
+0x0061 mem_le_rxbuf_adv_connect_ind_latency
+0x0063 mem_le_rxbuf_adv_connect_ind_timeout
+0x0065 mem_le_rxbuf_adv_connect_ind_channel_map
+0x006a mem_le_rxbuf_adv_connect_ind_hop_and_sca
+0x0506 mem_le_search_handle_start
+0x0508 mem_le_search_handle_end
+0x050a mem_le_att_offset
+0x050a mem_le_search_att_type_length
+0x050b mem_le_search_att_type
+0x051b mem_le_curr_att_len
+0x051c mem_le_cur_attlist_start_ptr
+0x051e mem_le_cur_handle_start
+0x0520 mem_le_cur_handle_end
+0x0522 mem_le_cur_uuid_length
+0x0523 mem_le_cur_uuid
+0x0047 mem_le_rxbuf_data_att_header
+0x0048 mem_le_rxbuf_data_att_length
+0x0049 mem_le_rxbuf_data_att_l2cap_length
+0x004b mem_le_rxbuf_data_att_cid
+0x004d mem_le_rxbuf_data_att_opcode
+0x004e mem_le_rxbuf_data_att_payload
+0x0047 mem_le_rxbuf_data_continue_header
+0x0048 mem_le_rxbuf_data_continue_length
+0x0049 mem_le_rxbuf_data_continue_payload
+0x0047 mem_le_rxbuf_data_att_write_header
+0x0048 mem_le_rxbuf_data_att_write_length
+0x0049 mem_le_rxbuf_data_att_write_l2cap_length
+0x004b mem_le_rxbuf_data_att_write_cid
+0x004d mem_le_rxbuf_data_att_write_opcode
+0x004e mem_le_rxbuf_data_att_write_handle
+0x0050 mem_le_rxbuf_data_att_write_payload
+0x0047 mem_le_rxbuf_data_prepare_att_write_header
+0x0048 mem_le_rxbuf_data_prepare_att_write_length
+0x0049 mem_le_rxbuf_data_prepare_att_write_l2cap_length
+0x004b mem_le_rxbuf_data_prepare_att_write_cid
+0x004d mem_le_rxbuf_data_prepare_att_write_opcode
+0x004e mem_le_rxbuf_data_prepare_att_write_handle
+0x0050 mem_le_rxbuf_data_prepare_att_write_offset
+0x0052 mem_le_rxbuf_data_prepare_att_write_payload
+0x01df mem_fcc_param_new
+0x01df mem_fcc_ch_new
+0x01e0 mem_fcc_mod_new
+0x01e1 mem_fcc_txrx_new
+0x01e2 mem_fcc_btble_new
+0x01e3 mem_fcc_data_new
+0x01e4 mem_fcc_data_length_new
+0x01e5 mem_fcc_hop_new
+0x01e6 mem_fcc_tx_power_new
+0x01e7 mem_fcc_param
+0x01e7 mem_fcc_ch
+0x01e8 mem_fcc_mod
+0x01e9 mem_fcc_txrx
+0x01ea mem_fcc_btble
+0x01eb mem_fcc_data
+0x01ec mem_fcc_data_length
+0x01ed mem_fcc_hop
+0x01ee mem_fcc_tx_power
+0x01ef mem_fcc_config_cb
+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
+0x4093 mem_current_amaddr
+0x4094 mem_lpm_mode
+0x4095 mem_device_option
+0x4096 mem_last_clkn
+0x409a mem_fcomp_div
+0x409b mem_rx_window_sniff
+0x409d mem_rf_init_ptr
+0x409f mem_rf_rccal
+0x40a0 mem_handle_num
+0x40a1 mem_chip_functions
+0x40a3 mem_lpm_wake_lock
+0x40a5 mem_lpm_interval
+0x40a7 mem_lpm_overhead
+0x40a8 mem_lpm_hibernate_switch
+0x40a9 mem_sniff_unint_lost
+0x40aa mem_sleep_counter
+0x40ae mem_sleep_counter_all
+0x40b2 mem_sleep_clkn
+0x40b8 mem_sniff_rcv
+0x40bb mem_sniff_lost
+0x40be mem_clks_per_lpo
+0x40c1 mem_lpm_mult
+0x40c2 mem_lpm_mult_timeout
+0x40c3 mem_lpm_mult_cnt
+0x40c4 mem_lpm_config
+0x40c4 mem_lpm_xtal_ib
+0x40c5 mem_lpm_ctrim
+0x40c6 mem_lpm_padding
+0x40c7 mem_lpm_xtalcnt
+0x40c8 mem_lpm_buckcnt
+0x40c9 mem_lpm_ldocnt
+0x40ca mem_lpm_isogate
+0x40cb mem_lpm_isogate_final
+0x40cc mem_lpm_ctrl3
+0x40cc mem_lpm_ctrl3_app_vsel
+0x40cd mem_lpm_ctrl3_aon_vsel
+0x40ce mem_lpm_ctrl3_core_byp
+0x40cf mem_lpm_ctrl3_core_vsel
+0x40d0 mem_saved_gpio
+0x40dd mem_saved_gsel
+0x40e0 mem_saved_mark
+0x40e8 mem_saved_spidctrl
+0x40e9 mem_patch_ptr
+0x40eb mem_patch_len
+0x40ed mem_timers
+0x410d mem_hci_cmd
+0x410e mem_hci_conn_handle
+0x410f mem_hci_plap
+0x4112 mem_hci_puap
+0x4113 mem_hci_pnap
+0x4115 mem_loadcode_times
+0x4116 mem_tx_power
+0x4117 mem_modem_rssi
+0x4118 mem_gain_fix
+0x4119 mem_gain_table
+0x411c mem_gain_second_agc_en
+0x411d mem_system_clk
+0x411e mem_rf_init_data
+0x411f mem_xtal_freq
+0x4120 mem_version
+0x4121 mem_company_id
+0x4123 mem_sub_version
+0x4125 mem_le_dsniff
+0x4127 mem_le_conn_interval
+0x4129 mem_le_tx_ifs_defference
+0x412a mem_le_tx2m_delay
+0x412b mem_le_txheader
+0x412c mem_le_txlen
+0x412d mem_le_txpayload
+0x422d mem_le_name_len
+0x422e mem_le_name
+0x424c mem_le_ltk
+0x425c mem_ltk_exists
+0x425d mem_le_rconfirm
+0x426d mem_le_srand
+0x427d mem_le_iat
+0x427e mem_le_rat
+0x427f mem_le_preq
+0x4280 mem_le_preq_iocap
+0x4281 mem_le_preq_oob
+0x4282 mem_le_preq_auth
+0x4283 mem_le_preq_max_keysize
+0x4284 mem_le_preq_init_key_distribution
+0x4285 mem_le_preq_resp_key_distribution
+0x4286 mem_le_pres
+0x4287 mem_le_pres_iocap
+0x4288 mem_le_pres_oob
+0x4289 mem_le_pres_auth
+0x428a mem_le_pres_max_keysize
+0x428b mem_le_pres_init_key_distribution
+0x428c mem_le_pres_resp_key_distribution
+0x428d mem_le_notify_handle
+0x428f mem_le_search_uuid_length
+0x4290 mem_le_search_uuid
+0x42a0 mem_le_conn_param
+0x42a0 mem_le_conn_peer_addr_type
+0x42a1 mem_le_conn_peer_addr
+0x42a7 mem_le_conn_own_addr_type
+0x42a8 mem_le_interval_min
+0x42aa mem_le_interval_max
+0x42ac mem_le_latency
+0x42ae mem_le_timeout
+0x42b0 mem_le_lap
+0x42b3 mem_le_uap
+0x42b4 mem_le_nap
+0x42b6 mem_le_local_mtu
+0x42b8 mem_le_remote_mtu
+0x42ba mem_le_skdm
+0x42c2 mem_le_skds
+0x42ca mem_le_init_superto
+0x42cc mem_ui_le_uuid_table
+0x42ce mem_le_secure_connect_flag
+0x42cf mem_le_secure_connect_state
+0x42d0 mem_le_sc_confirm_gkey_flag
+0x42d1 mem_le_pairing_state
+0x42d2 mem_le_enc_state
+0x42d3 mem_le_pairing_mode
+0x42d4 mem_le_tk
+0x42d8 mem_le_ediv
+0x42da mem_le_rand
+0x42e2 mem_le_irk
+0x42f2 mem_le_transmit_window
+0x42f6 mem_le_configuration
+0x42f7 mem_le_fixed_ltk
+0x4307 mem_le_pairing_handle
+0x4309 mem_le_packet_llid
+0x430a mem_le_l2cap_size
+0x430c mem_le_packet_len_recved
+0x430e mem_le_payload_ptr
+0x4310 mem_le_signaling_identifier
+0x4311 mem_le_l2cap_signaling_conn_param_update_rsp_result
+0x4313 mem_le_md_count
+0x4314 mem_le_l2cap_parse_cb
+0x4316 mem_ble_l2cap_tx_buff0_ptr
+0x4318 mem_ble_l2cap_tx_buff_size_ptr
+0x431a mem_le_scan_enable
+0x431b mem_le_scan_interval
+0x431d mem_le_scan_window
+0x431f mem_le_adv_data_len
+0x4320 mem_le_adv_data
+0x433f mem_le_scan_data_len
+0x4340 mem_le_scan_data
+0x435f mem_le_adv_enable
+0x4360 mem_le_adv_param
+0x4360 mem_le_adv_interval
+0x4362 mem_le_adv_type
+0x4363 mem_le_adv_own_addr_type
+0x4364 mem_le_adv_direct_addr
+0x436a mem_le_adv_channel_map
+0x436b mem_le_scan_params
+0x436b mem_le_scan_type
+0x436c mem_le_scan_own_addr_type
+0x436d mem_le_l2cap_att_states
+0x436e mem_le_att_opcode
+0x436f mem_le_att_handle
+0x4371 mem_le_search_res
+0x4372 mem_le_local_feature
+0x437a mem_le_tx_phys
+0x437b mem_le_rx_phys
+0x437c mem_remote_rx_max_octets
+0x437e mem_remote_rx_max_time
+0x4380 mem_remote_tx_max_octets
+0x4382 mem_remote_tx_max_time
+0x4384 mem_local_rx_max_octets
+0x4386 mem_local_rx_max_time
+0x4388 mem_local_tx_max_octets
+0x438a mem_local_tx_max_time
+0x438c mem_cb_check_wakelock
+0x438e mem_cb_before_hibernate
+0x4390 mem_cb_before_lpm
+0x4392 mem_cb_le_process
+0x4394 mem_cb_idle_process
+0x4396 mem_cb_bb_event_process
+0x4398 mem_cb_att_write
+0x439a mem_cb_ble_transmit
+0x439c mem_cb_event_timer
+0x439e mem_cb_bt_set_mult
+0x43a0 mem_cb_spi_flash_write_complate
+0x43a2 mem_cb_before_lpm_sleep
+0x43a4 mem_eeprom_base
+0x43a6 mem_wake_up_delay_timer
+0x43a7 mem_app_connection_options
+0x43a8 mem_app_disconn_reason
+0x43aa mem_app_disconn_reason_flag
+0x43ac mem_xrecord_mode
+0x43ad mem_eeprom_block_size
+0x43ae mem_spi_init_clk
+0x43af mem_spi_init_delay_time
+0x43b0 mem_spi_ncs_gpio
+0x43b1 mem_nv_data_ptr
+0x43b3 mem_nv_data_number
+0x43b4 mem_queue_ptr
+0x43b6 mem_gpio_h_k19_b13
+0x43ba mem_gpio_l_k19_b13
+0x43be mem_hvin_k19_b13
+0x43c2 mem_app_adc_read_count
+0x43c3 mem_start_adc_clkn
+0x43c4 mem_adc_delay
+0x43c6 mem_adc_config_flag
+0x43c7 mem_adc_channel
+0x43c8 mem_adc_current_value
+0x43ca mem_adc_power_flag//bit0:low power falg ; bit1:no power flag
+0x43cb mem_spi_write_addr
+0x43ce mem_spi_write_ptr
+0x43d0 mem_spi_write_len
+0x43d2 mem_spi_write_flash_sm
+0x43d3 mem_spi_cs_gpio
+0x43d4 mem_spi_si_gpio
+0x43d5 mem_spi_so_gpio
+0x43d6 mem_spi_sclk_gpio
+0x43d7 mem_spi_wp_gpio
+0x43d8 mem_spi_hold_gpio
+0x43d9 mem_eeprom_wp_gpio
+0x43da mem_eeprom_scl_gpio
+0x43db mem_eeprom_sda_gpio
+0x43dc mem_kscan_ptr
+0x43de mem_key_num_ptr
+0x43de mem_keyscan_ptr
+0x43e0 mem_key_value_retention
+0x43e2 mem_power_param_ptr
+0x43e4 mem_efuse_header
+0x43e7 mem_seqi
+0x43e8 mem_set_cdb_on
+0x43e9 mem_syn_cal_ctrl
+0x43ea mem_dig_aon_vsel
+0x43eb mem_syn_afc_cfg1
+0x43ec mem_rf_ldo_cfg1
+0x43ed mem_rc_cal
+0x43ee mem_nec_decode_error_value
+0x43ef mem_wdt_always_work
+0x43f0 mem_power_ctrl_disable
+0x43f1 mem_rf_debug_rx_gpio
+0x43f2 mem_rf_debug_tx_gpio
+0x43f3 mem_l2cap_xmem_start
+0x43f3 mem_used_map
+0x43f4 mem_tx_fifo0
+0x43f4 mem_tx_fifo0_map
+0x43f5 mem_tx_fifo0_ptr
+0x43f7 mem_tx_fifo1
+0x43f7 mem_tx_fifo1_map
+0x43f8 mem_tx_fifo1_ptr
+0x43fa mem_tx_fifo2
+0x43fa mem_tx_fifo2_map
+0x43fb mem_tx_fifo2_ptr
+0x43fd mem_tx_fifo3
+0x43fd mem_tx_fifo3_map
+0x43fe mem_tx_fifo3_ptr
+0x4400 mem_tx_fifo_end
+0x4400 mem_l2cap_lpm_txbuf_ptr
+0x4402 mem_l2cap_xmem_end
+0x4402 mem_ccm_pcnt_tx
+0x4407 mem_ccm_pcnt_rx
+0x440c mem_ccm_last_mic
+0x4410 mem_ccm_iv
+0x4410 mem_ccm_ivm
+0x4414 mem_ccm_ivs
+0x4418 mem_ccm_len
+0x441a mem_ccm_rx_ptr
+0x441c mem_ipc_lock_bt
+0x441d mem_ipc_lock_c51
+0x441e mem_ipc_fifo_bt2c51
+0x4426 mem_ipc_fifo_c512bt
+0x442e mem_ui_button_timer
+0x442f mem_ui_button_last_state
+0x4430 mem_ui_timer_last_btclk
+0x4434 mem_ui_state_map
+0x4436 mem_ui_button_timeout
+0x4437 mem_ui_button_gpio
+0x4438 mem_ui_led_init_state_set
+0x4439 mem_ui_led_struct_num
+0x443a mem_ui_led_struct_ptr
+0x443c mem_ble_v2_xbox
+0x447c mem_ble_v2_pdu
+0x44a3 mem_ble_v2_customer_id
+0x44a4 mem_ble_v2_packet_num
+0x44a5 mem_ble_v2_subtype
+0x44a6 mem_ble_v2_maintype
+0x44a7 mem_ble_v2_addr
+0x44ab mem_ble_v2_group_index
+0x44ac mem_ble_v2_cmd
+0x44ae mem_ble_v2_para
+0x44b2 mem_ble_customer_id
+0x44b3 mem_ble_count
+0x44b4 mem_ble_sub_type
+0x44b5 mem_ble_main_type
+0x44b6 mem_ble_addr
+0x44ba mem_ble_group
+0x44bb mem_ble_cmd
+0x44bd mem_ble_para
+0x44c1 mem_ble_rfu
+0x44c4 mem_ble_relay
+0x44c5 mem_ble_is_app
+0x44c6 mem_adv_CRC_False_initValue
+0x44c8 mem_CRC16_polynomial
+0x44ca mem_ble_pack_cb
+0x44cc mem_ble_v2_tx_end_dummy
+0x44cc mem_ftd_device_option
+0x44cd mem_light_gm_tx_addr_type
+0x44ce mem_light_gm_tx_len
+0x44cf mem_light_gm_tx_header
+0x44dc mem_light_gm_tx
+0x44dc mem_light_gm_tx_press_time
+0x44dd mem_light_gm_tx_remoter_ID
+0x44de mem_light_gm_tx_remoter_addr
+0x44e0 mem_light_gm_tx_group_num
+0x44e1 mem_light_gm_tx_code
+0x44e2 mem_light_gm_tx_count
+0x44e3 mem_light_gm_tx_sum
+0x44e4 mem_gem_cnt_inces_timeout
+0x44e6 mem_gem_long_keypress_timeout
+0x44e8 mem_gem_long_cnt_enable
+0x44e9 mem_light_KY_tx
+0x44e9 mem_light_KY_tx_header
+0x4500 mem_light_KY_tx_len
+0x4501 mem_light_KY_tx_code1
+0x4502 mem_light_KY_tx_remoter_ID
+0x4506 mem_light_KY_tx_group_num
+0x4507 mem_light_KY_tx_code2
+0x4508 mem_light_KY_tx_sum
+0x450a mem_light_KY_tx_CRC
+0x450c mem_light_KY_tx_count
+0x450e mem_light_group_num
+0x450f mem_light_JYM_whitening_header
+0x451b mem_light_JYM_tx
+0x451b mem_light_JYM_tx_header
+0x4523 mem_light_JYM_tx_len
+0x4524 mem_light_JYM_tx_cmd
+0x4525 mem_light_JYM_tx_ID
+0x4529 mem_light_JYM_tx_group
+0x452a mem_light_JYM_tx_data
+0x452b mem_light_JYM_tx_count
+0x452c mem_light_JYM_tx_sum
+0x452e mem_light_JYM_tx_CRC
+0x4530 mem_light_JYM_tx_temp
+0x4555 mem_adv_cnts
+0x4556 mem_cb_light_ac_detecting
+0x4558 mem_cb_light_gradual_dimmer
+0x455a mem_light_pwm_freq_w
+0x455c mem_light_pwm_freq_y
+0x455e mem_light_pwm_freq_l
+0x4560 mem_light_W_aim_pcnt
+0x4562 mem_light_Y_aim_pcnt
+0x4564 mem_light_L_aim_pcnt
+0x4566 mem_light_gradual_step_w
+0x4567 mem_light_gradual_step_y
+0x4568 mem_light_gradual_step_l
+0x4569 mem_light_mix_change_delay_time
+0x456b mem_temp_flag
+0x456c mem_light_pwm_enable_flag
+0x456d mem_light_gpio_pin_w
+0x456e mem_light_gpio_pin_y
+0x456f mem_light_gpio_pin_l
+0x4556 mem_kscan_record_keypress
+0x455e mem_kscan_row_nums
+0x455f mem_kscan_col_nums
+0x4560 mem_kscan_row_gpio_pin
+0x4568 mem_kscan_col_gpio_pin
+0x4570 mem_kscan_row_scanned
+0x4571 mem_kscan_col_scanned
+0x4572 mem_keypress_analysis_flag
+0x4573 mem_kscan_avoid_shake_delay_time
+0x4575 mem_scan_col
+0x4576 mem_kscan_enable
+0x4577 mem_long_press_adv_timeout
+0x4579 mem_kscan_analysis_interval_timeout
+0x457b mem_FTD_adv_raw_device_add_temp
+0x457d mem_set_clear_code_timeout_enable
+0x457e mem_light_lpm_enable
+0x457f mem_light_manufacture_id
+0x4580 mem_light_indicator_led
+0x4581 mem_groups_num
+0x4582 mem_light_last_key
+0x4583 mem_light_different_key_press_flag
+0x4584 mem_FTD_adv_raw
+0x4584 mem_FTD_adv_raw_cmd
+0x4585 mem_FTD_adv_raw_device_add
+0x4587 mem_FTD_adv_raw_data
+0x458a mem_FTD_adv_raw_packet_num
+0x458b mem_FTD_adv_raw_reserved
+0x458c mem_FTD_adv_raw_encryption
+0x4594 mem_long_press_timeout
+0x4596 mem_light_num_of_long_press
+0x4597 mem_light_color_switch_cnt
+0x4598 mem_light_brightness_switch_flag
+0x4599 mem_light_rgb_hand_actuated_flag
+0x459a mem_rgb_switch
+0x459b mem_light_rgb_auto_flag
+0x459c mem_rgb_on_and_off
+0x459d mem_light_group1_on_and_off_flag
+0x459e mem_light_group2_on_and_off_flag
+0x459f mem_light_group3_on_and_off_flag
+0x45a0 mem_light_group4_on_and_off_flag
+0x45a1 mem_light_current_key
+0x45a2 mem_ble_light_adv_timeout
+0x45a4 mem_light_on_off_alternant
+0x45a5 mem_fan_speed
+0x45a6 mem_fan_direction_alternant
+0x45a7 mem_fan_on_off_flag
+0x45a8 mem_ble_xboxes
+0x4628 mem_adv_packet
+0x4628 mem_adv_packet_header
+0x463f mem_adv_packet_payload
+0x464d mem_adv_packet_tailer
+0x464f mem_light_whitening_buffer
+0x4676 mem_light_whitening_k
+0x4678 mem_light_for_loop_cnt1
+0x4679 mem_light_for_loop_cnt2
+0x467a mem_light_recvd_len
+0x467b mem_light_whitening_i
+0x467c mem_light_whitening_i1
+0x4680 mem_light_whitening_i2
+0x4684 mem_light_whitening_i3
+0x4688 mem_light_whitening_i4
+0x468c mem_light_whitening_n
+0x468d mem_light_para1
+0x4691 mem_light_para2
+0x4696 mem_light_for_loop_lshift
+0x469e mem_light_integer_1_lshift_temp
+0x46a6 mem_light_lpm_enable_timeout
+0x46a8 mem_indicator_turn_on_enable
+0x46a9 mem_indicator_led_turn_on_timeout
+0x46ab mem_light_on_and_off_flag
+0x46ac mem_fan_deflector_flag
+0x46ad mem_light_aid_swtich_flag
+0x46ae mem_light_manufacture_id2
+0x46af mem_light_manufacture_id2_v2
+0x46b0 mem_light_whitening_buffer_2
+0x46d7 mem_ble_v2_pdu_2
+0x46fe mem_light_rgb_on_and_off_flag
+0x46ff mem_rgb_loop_on_and_off
+0x4700 mem_r_g_b_switch_flag
+0x4701 mem_adv_manufacturer_switch_flag
+0x4702 mem_adv_manufacturer_switch_flag1
+0x4703 mem_adv_manufacturer_switch_flag2
+0x4704 mem_adv_manufacturer_switch_flag3
+0x4705 mem_fan_on_and_off_flag
+0x4706 mem_light_release_adv_flag
+0x4707 mem_light_blink_state_flag
+0x4708 mem_light_indicator_led_blink_enable
+0x4709 mem_light_continuous_kps_cnt_reset_timeout
+0x470b mem_light_key1_continuous_kps_cnt
+0x470c mem_light_key2_continuous_kps_cnt
+0x470d mem_light_key3_continuous_kps_cnt
+0x470e mem_light_key4_continuous_kps_cnt
+0x470f mem_light_key5_continuous_kps_cnt
+0x4710 mem_light_key6_continuous_kps_cnt
+0x4711 mem_light_key7_continuous_kps_cnt
+0x4712 mem_light_key8_continuous_kps_cnt
+0x4713 mem_light_key9_continuous_kps_cnt
+0x4714 mem_light_key10_continuous_kps_cnt
+0x4715 mem_light_key11_continuous_kps_cnt
+0x4716 mem_light_key12_continuous_kps_cnt
+0x4717 mem_light_key13_continuous_kps_cnt
+0x4718 mem_light_key14_continuous_kps_cnt
+0x4719 mem_light_key15_continuous_kps_cnt
+0x471a mem_light_key16_continuous_kps_cnt
+0x471b mem_16groups_on_off
+0x471d mem_group_flag
+0x471e mem_channel_enable
+0x471f mem_channel_num
+0x4720 mem_scene_enable
+0x4721 mem_special_agreemeet_enable
+0x4722 mem_light_short_keypress_timeout
+0x4724 mem_light_color_and_lgtness_long_press_adv_enable
+0x4725 mem_airchange_speed
+0x4726 mem_fan_tap_speed
+0x4727 mem_light_airchange_flag
+0x4728 mem_light_warm_wake_flag
+0x4729 mem_light_warm_powerful_flag
+0x472a mem_light_fan_on_and_off
+0x472b mem_light_bath_on_off_flag
+0x472c mem_long_press_protect_enble_flag
+0x472d mem_long_press_protect_cnt
+0x472e mem_long_press_protect_start_flag
+0x472f mem_kscan_press_row_gpio
+0x4737 mem_light_fan_on_and_off_flag
+0x4738 mem_light_lpm_gpio_config_flag
+0x473c mem_light_lpm_gpio_config_io_temp
+0x473d mem_light_timing_of_alter_flag
+0x473e mem_light_adv_packet
+0x473e mem_light_adv_packet_cmd
+0x473f mem_light_adv_packet_addr
+0x4741 mem_light_adv_packet_data
+0x4744 mem_light_adv_packet_packetnum
+0x4745 mem_light_adv_packet_reserve
+0x4746 mem_light_adv_packet_encry
+0x474c mem_light_adv_packet_CRC
+0x474e mem_scene_led_timeout
+0x4750 mem_scene_led_cnt
+0x4751 mem_ble_rx_on_and_off
+0x4752 mem_long_press_scene_timeout
+0x4753 mem_le_adv_scan_channel
+0x4754 mem_le_lap_addr
+0x4758 mem_le_lap_addr_temp
+0x475c mem_le_lap_v2_addr
+0x4760 mem_light_scene_mode
+0x4761 mem_le_addr_change_flag
+0x4762 mem_rmt_keydown_cb
+0x4764 mem_rmt_released_cb
+0x4766 mem_rmt_long_press_cb
+0x4768 mem_rmt_continuous_keydown_cb
+0x476a mem_rmt_continuous_kps_time
+0x476c mem_light_adv_time
+0x476e mem_claer_code_time
+0x4770 mem_ble_v2_customer_id_copy
+0x4771 mem_ftd_fan_cfg_catch
+0x4771 mem_fan_protocol_select_flag
+0x4772 mem_fan_tx_pin
+0x4773 mem_fan_yc_identify_flag
+0x4774 mem_customer_id
+0x4775 mem_customer_id_v2
+0x4776 mem_id_universal
+0x4777 mem_manufacture_id_temp
+0x4778 mem_light_device_flag
+0x4779 mem_ble_ch_mapped
+0x477a mem_ble_v2_decoder
+0x477c mem_light_speed_temp
+0x477d mem_light_blink_count
+0x477e mem_pairing_timeout
+0x4780 mem_light_pairing_enable
+0x4781 mem_light_last_packetnum
+0x4782 mem_yc_fan_ble_addr
+0x4788 mem_recv_addr
+0x478e mem_fan_tx_bits_loop
+0x4790 mem_fan_opcode
+0x4791 mem_fan_tx_cnt
+0x4792 mem_fan_433code_packet//预留8字节
+0x479a mem_fan_tx_loop
+0x479c mem_fan_tx_loop2
+0x479e mem_fan_433_opcode
+0x479f mem_fan_tx_gpio
+0x47a0 mem_fan_tx_gpio_reg
+0x47a2 mem_433_tx_cb
+0x47a4 mem_fan_packet_indiscriminate_cb
+0x47a6 mem_ble_parameter
+0x47a6 mem_ble_parameter_cmd
+0x47a8 mem_ble_parameter_para
+0x47ac mem_ble_parameter_addr
+0x47ae mem_ble_parameter_group
+0x47af mem_fan_addr_433
+0x443c mem_24g_lap
+0x4442 mem_24g_rxbuf
+0x4464 mem_24g_txbuf
+0x4484 mem_24g_txpayload
+0x44a8 mem_24g_rxpayload
+0x44c8 mem_24g_rxdata_length
+0x44c9 mem_24g_pid
+0x44ca mem_24g_no_ack
+0x44cb mem_24g_sta_crc
+0x44ce mem_24g_last_crc
+0x44d1 mem_24g_sta_pid
+0x44d2 mem_24g_last_pid
+0x44d3 mem_24g_datalen
+0x44d4 mem_24g_data_type
+0x44d5 mem_24g_txlen
+0x44d6 mem_24g_rx_window
+0x44d8 mem_24g_ch
+0x44d9 mem_24g_current_ch_number
+0x44da mem_24g_addr
+0x44de mem_24g_ch_map1
+0x44e2 mem_24g_ch_map2
+0x44e6 mem_24g_ch_map3
+0x44ea mem_24g_ch_map4
+0x44ee mem_24g_tx_btclk
+0x44f2 mem_24g_interval
+0x44f3 mem_24g_interval_min
+0x44f4 mem_24g_interval_max
+0x44f5 mem_24g_syncword
+0x44f7 mem_24g_syncword_crc8
+0x44f8 mem_24g_get_syncword_crc8
+0x44f9 mem_24g_pair_switch
+0x44fa mem_24g_enter_hibernate
+0x4502 mem_24g_rx_phy
+0x4503 mem_24g_tx_phy
+0x4504 mem_24g_ch_map_update
+0x4505 mem_24g_ch_update_map1
+0x4509 mem_24g_ch_update_map2
+0x450d mem_24g_ch_update_map3
+0x4511 mem_24g_ch_update_map4
+0x4515 mem_24g_disable_fec1
+0x4516 mem_24g_off_type
+0x4517 mem_24g_pair_addr
+0x451b mem_24g_pair_ch
+0x451c mem_24g_pair_tx_power
+0x451d mem_rssi_buff_index
+0x451e mem_24g_device1_bind_step
+0x451f mem_24g_device2_bind_step
+0x4520 mem_24g_bind_device_status
+0x4521 mem_24g_bind_payload
+0x4529 mem_24g_device1_bind_disable
+0x452a mem_24g_device2_bind_disable
+0x452b mem_cb_24g_receive_process
+0x452d mem_cb_24g_ackpayload
+0x452f mem_cb_24g_data_device1
+0x4531 mem_cb_24g_data_device2
+0x4533 mem_24g_rxdata_temp
+0x4555 mem_24g_abort_packet
+0x4556 mem_24g_hop_btclk
+0x455a mem_24g_hop_interval
+0x455b mem_24g_pair_mode
+0x455c mem_24g_ackpayload_enable
+0x455d mem_24g_hop_packet
+0x455e mem_24g_mode_switch
+0x455f mem_24g_nodata_timer_enable
+0x4560 mem_24g_mode_init
+0x4561 mem_24g_work_mode
+0x4562 mem_24g_time_slice
+0x4563 mem_24g_self_last_ch
+0x4564 mem_24g_self_ch_number
+0x4565 mem_24g_self_config_ch_once
+0x4566 mem_24g_device1_last_ch
+0x4567 mem_24g_device1_ch_number
+0x4568 mem_24g_device1_config_ch_once
+0x4569 mem_24g_device2_last_ch
+0x456a mem_24g_device2_ch_number
+0x456b mem_24g_device2_config_ch_once
+0x456c mem_24g_led_status
+0x456d mem_24g_bind_mode_continue
+0x456e mem_tx_power_temp
+0x456f mem_24g_mode_B_S_switch
+0x4570 mem_24g_mode_B_S_switch_init
+0x4571 mem_24g_mode_B_S_switch_cnt
+0x4573 mem_24g_mode_B_S_switch_exit
+0x4574 mem_24g_B_S_time_slice
+0x4575 mem_24g_B_S_mode_switch_disable
+0x4576 mem_24g_bind_device_living
+0x4577 mem_24g_transmitter_addr
+0x457b mem_24g_device1_addr
+0x457f mem_24g_device2_addr
+0x4583 mem_rssi_noise_avg
+0x4584 mem_rssi_noise_index
+0x4585 mem_rssi_noise_self_avg
+0x4586 mem_rssi_noise_device1_avg
+0x4587 mem_rssi_noise_device2_avg
+0x4588 mem_rssi_noise_self_index
+0x4589 mem_rssi_noise_device1_index
+0x458a mem_rssi_noise_device2_index
+0x458b mem_rssi_noise_buffer_ptr
+0x458d mem_rssi_noise_self_buffer_ptr
+0x458f mem_rssi_noise_device1_buffer_ptr
+0x4591 mem_rssi_noise_device2_buffer_ptr
+0x4593 mem_car_hard_soft_switch
+0x4594 mem_car_queue_each_size
+0x4595 mem_car__queue_length
+0x4596 mem_car_queue_curr_num
+0x4597 mem_car_queue_read_ptr
+0x4598 mem_car_queue_write_ptr
+0x4599 mem_car_queue_ele
+0x4611 mem_car_pop_queue_buff
+0x4625 mem_car_led_num
+0x4626 mem_car_led_map
+0x4630 mem_car_style1_led_type
+0x4631 mem_car_style1_blink_count
+0x4632 mem_car_style1_struct_led_gpio
+0x4633 mem_car_style1_on_time
+0x4635 mem_car_style1_off_time
+0x4637 mem_car_style1_cb_ledon
+0x4639 mem_car_style1_cb_ledoff
+0x463b mem_car_style2_led_type
+0x463c mem_car_style2_blink_count
+0x463d mem_car_style2_struct_led_gpio
+0x463e mem_car_style2_on_time
+0x4640 mem_car_style2_off_time
+0x4642 mem_car_style2_cb_ledon
+0x4644 mem_car_style2_cb_ledoff
+0x4646 mem_le_receive_data
+0x4646 mem_le_receive_packet_head
+0x4648 mem_le_receive_cmd
+0x4649 mem_le_receive_length
+0x464b mem_le_receive_payload
+0x4655 mem_le_receive_checksum
+0x4656 mem_motor1_status
+0x4657 mem_motor1_speed
+0x4658 mem_motor2_status
+0x4659 mem_motor2_speed
+0x465a mem_motor3_status
+0x465b mem_motor3_speed
+0x465c mem_motor1_pwm_set
+0x465c mem_motor1_pwm_pin1_set
+0x465d mem_motor1_pwm_pin2_set
+0x465e mem_motor1_pwm_pin_set
+0x465f mem_motor1_pwm_channel_set
+0x4660 mem_motor1_pwm_freq_set
+0x4663 mem_motor1_pwm_dute_set
+0x4664 mem_motor2_pwm_set
+0x4664 mem_motor2_pwm_pin1_set
+0x4665 mem_motor2_pwm_pin2_set
+0x4666 mem_motor2_pwm_pin_set
+0x4667 mem_motor2_pwm_channel_set
+0x4668 mem_motor2_pwm_freq_set
+0x466b mem_motor2_pwm_dute_set
+0x466c mem_motor3_pwm_set
+0x466c mem_motor3_pwm_pin1_set
+0x466d mem_motor3_pwm_pin2_set
+0x466e mem_motor3_pwm_pin_set
+0x466f mem_motor3_pwm_channel_set
+0x4670 mem_motor3_pwm_freq_set
+0x4673 mem_motor3_pwm_dute_set
+0x4674 mem_motor_select_p_n
+0x4675 mem_car_motor_status
+0x4676 mem_car_motor_speed
+0x4677 mem_motor_pwm_set
+0x4677 mem_motor_pwm_pin1_set
+0x4678 mem_motor_pwm_pin2_set
+0x4679 mem_motor_pwm_pin_set
+0x467a mem_motor_pwm_channel_set
+0x467b mem_motor_pwm_freq_set
+0x467e mem_motor_pwm_dute_set
+0x467f mem_ir_rx_gpio
+0x4680 mem_ir_data
+0x4682 mem_ir_rx_buf
+0x4684 mem_ir_receive_clkn
+0x4688 mem_ir_notify_data
+0x468b mem_ir_notify_data_head
+0x4690 mem_ir_notify_data_payload
+0x4692 mem_ir_notify_data_check_sum
+0x4693 mem_car_ir_breakdown_check_timer
+0x4694 mem_car_ir_breakdown_flag
+0x4695 mem_car_led_control
+0x4695 mem_car_led1_status
+0x4696 mem_car_led2_status
+0x4697 mem_car_led3_status
+0x4698 mem_car_led4_status
+0x4699 mem_car_led5_status
+0x469a mem_car_led6_status
+0x469b mem_car_led7_status
+0x469c mem_car_led8_status
+0x469d mem_car_led_control_timer
+0x469e mem_car_led_blink_status
+0x469f mem_car_led_no
+0x46a0 mem_car_info_request
+0x46a3 mem_car_info_request_head
+0x46a8 mem_car_info_request_payload
+0x46b0 mem_car_info_request_checksum
+0x46b1 mem_car_config_param
+0x46b1 mem_car_config_setting_flag
+0x46b2 mem_car_config_device_select
+0x46b3 mem_car_config_motor_layout
+0x46b4 mem_car_config_ir_enable
+0x46b5 mem_car_config_ir_rx_gpio
+0x46b6 mem_car_config_pairing_led_conn_status
+0x46b7 mem_car_config_pairing_led_gpio
+0x46b8 mem_car_config_led_num
+0x46b9 mem_car_config_blood_led_gpio
+0x46b9 mem_car_config_blood_led1_gpio
+0x46ba mem_car_config_blood_led2_gpio
+0x46bb mem_car_config_blood_led3_gpio
+0x46bc mem_car_config_blood_led4_gpio
+0x46bd mem_car_config_blood_led5_gpio
+0x46be mem_car_config_blood_led6_gpio
+0x46bf mem_car_config_blood_led7_gpio
+0x46c0 mem_car_config_blood_led8_gpio
+0x46c1 mem_car_config_bat_notify_enable
+0x46c2 mem_car_config_low_voltage_led_gpio
+0x46c3 mem_car_config_low_voltage_percent
+0x46c4 mem_car_config_soft_switch_enable
+0x46c5 mem_car_config_soft_switch_gpio
+0x46c6 mem_car_notify_vdd_count
+0x46c7 mem_car_notify_vdd_timer
+0x46c8 mem_car_notify_vdd_value_last
+0x46c9 mem_car_notify_vdd_percent
+0x46ca mem_car_working_flag
+0x46cb mem_low_bat_flag
+0x46cc mem_notify_bat_packet
+0x46cf mem_notify_bat_head
+0x46d4 mem_notify_bat_payload
+0x46d5 mem_notify_bat_check_sum
+0x46d6 mem_vdd_notify_flag
+0x46d7 mem_car_current_vdd_value_temp
+0x46d9 mem_car_last_vdd_value
+0x46db mem_vdd_calculate_set
+0x46db mem_vdd_full_vol
+0x46dd mem_vdd_empty_vol
+0x46df mem_vdd_low_vol
+0x46e1 mem_vdd_now_vol
+0x46e3 mem_car_24g_status
+0x46e4 mem_car_24g_no_data_timeout_count
+0x46e6 mem_car_24g_no_data_timeout_timer
+0x46e8 mem_car_24g_ir_receive_attack_count
+0x46e9 mem_car_24g_go_die_flag
+0x46ea mem_car_attack_shake_timer
+0x46eb mem_car_attack_shake_flag
+0x46ec mem_car_soft_power
+0x46ec mem_car_power_state
+0x46ed mem_car_power_timer
+0x46ee mem_car_power_off_timeout
+0x46ef mem_car_power_starting_timeout
+0x46f0 mem_car_power_off_cb
+0x46f2 mem_car_power_starting_cb
+0x46f4 mem_car_power_standby_cb
+0x46f6 mem_car_ui_button_up_cb
+0x46f8 mem_car_le_att_list
+0x48ec mem_car_moto1_blank_timer
+0x48ed mem_car_moto2_blank_timer
+0x48ee mem_car_moto3_blank_timer
+0x48ef mem_car_motor_gpio_num
+0x48f0 mem_car_motor_gpio_map
+0x48f0 mem_car_motor_left_gpio
+0x48f1 mem_car_motor_right_gpio
+0x48f2 mem_car_motor_front_gpio
+0x48f3 mem_car_motor_back_gpio
+0x48f4 mem_car_gpio
+0x48f5 mem_car_app_send_speed
+0x48f6 mem_rssi_sum
+0x48f8 mem_check_rssi_high_count
+0x48fa mem_rssi_data
+0x4902 mem_car_24g_received_pac
+0x4903 mem_car_24g_bind_enable_delay_count
+0x4904 mem_car_keyscan
+0x4904 mem_car_key_num
+0x4905 mem_cb_car_keyscan
+0x4907 mem_car_enter_lpm_timer_count
+0x4909 mem_car_enter_lpm_timer
+0x490b mem_car_enter_lpm_flag
+0x490c mem_car_24g_ch_polling
+0x490d mem_car_rssi_noise_buffer
+0x4915 mem_car_rssi_noise_car_buffer
+0x491d mem_car_rssi_noise_remote_buffer
+0x4925 mem_car_24g_commom_addr
+0x4929 mem_car_24g_commom_addr_temp
+0x492d mem_car_24g_commom_addr_read
+0x4931 mem_car_save_addr_flag
+0x4932 mem_ble_att_list
+0x4593 mem_dg_kb_bind_flag
+0x4594 mem_dg_kb_data_sta_data
+0x459c mem_dg_kb_data_last_data
+0x45a4 mem_dg_kb_multikey_sta_data
+0x45a7 mem_dg_kb_multikey_last_data
+0x45aa mem_dg_kb_system_sta_data
+0x45ad mem_dg_kb_system_last_data
+0x45b0 mem_dg_kb_blank_data_enable
+0x45b1 mem_dg_kb_mul_blank_data_enable
+0x45b2 mem_dg_ms_blank_data_enable
+0x45b3 mem_dg_sys_config
+0x45b4 mem_dg_usb_vid_pid
+0x45bd mem_dg_usb_tx_interval
+0x45be mem_dg_usb_device_name
+0x45dc mem_dg_kb_bind_success
+0x45dd mem_dg_pc_sleep_flag
+0x45de mem_dg_usb_device_iserial_number
+0x45df mem_dg_24g_tx_power_default
+0x451e mem_rssi_hex_received
+0x451f mem_24g_pair_sm
+0x4520 mem_24g_pair_no_ack
+0x4521 mem_24g_pair_timeout_init
+0x4523 mem_24g_pair_timeout
+0x4525 mem_24g_pair_count
+0x4527 mem_24g_reconn_timeout_init
+0x4529 mem_24g_reconn_timeout
+0x452b mem_24g_reconn_count
+0x452d mem_24g_reconn_type
+0x452e mem_24g_fast_conn_enable
+0x452f mem_24g_fast_conn_addr
+0x4533 mem_24g_receiver_addr
+0x4537 mem_24g_fast_conn_temp_ch
+0x4538 mem_24g_receiver_temp_ch
+0x4539 mem_24g_device_temp_ch
+0x453a mem_rssi_signal_index
+0x453b mem_rssi_signal_buf_ptr
+0x453d mem_cb_24g_transmit_data
+0x453f mem_cb_24g_search_receiver
+0x4541 mem_cb_24g_lpm_before
+0x4543 mem_cb_24g_transmit_short_sleep
+0x4545 mem_cb_24g_transmit_long_sleep
+0x4547 mem_24g_conn_sm
+0x4548 mem_24g_ensure
+0x4549 mem_24g_txfail_cnt
+0x454b mem_24g_attempt_fail_flag
+0x454c mem_24g_retry
+0x454d mem_24g_abort_pac
+0x454e mem_24g_max_retry
+0x454f mem_24g_device_addr
+0x4553 mem_24g_short_sleep_set
+0x4556 mem_24g_long_sleep_set
+0x455e mem_24g_long_sleep_set1
+0x4562 mem_24g_pac_index
+0x4563 mem_24g_transmit_by_interrupt
+0x4564 mem_24g_transmit_by_interrupt_exit_count
+0x4566 mem_24g_transmit_by_interrupt_exit_count_init
+0x4568 mem_24g_long_sleep_param_update_timer_init
+0x456a mem_24g_long_sleep_param_update_timer
+0x456c mem_24g_fast_hop_count
+0x456d mem_24g_retransmit
+0x456f mem_rssi_avg_received
+0x4570 mem_power_ctrl_level
+0x4571 mem_power_ctrl_pac_succ_cnt
+0x4572 mem_power_ctrl_pac_succ_cnt_init
+0x4573 mem_rssi_dis_min_24g
+0x4574 mem_rssi_dis_max_24g
+0x4575 mem_rssi_hex_received_max_value
+0x4576 mem_rssi_dis_min_ble
+0x4577 mem_rssi_dis_max_ble
+0x4578 mem_mouse_key
+0x4579 mem_mouse_x
+0x457b mem_mouse_y
+0x457d mem_mouse_z
+0x457e mem_mouse_tz
+0x457f mem_mouse_xy_h
+0x4580 mem_mouse_key_last
+0x4581 mem_wheel_tb_old_pinlevel
+0x4582 mem_wheel_tb_new_pinlevel
+0x4583 mem_wheel_tog
+0x4584 mem_mouse_tz_data
+0x4585 mem_mwheel_b_old_pinlevel
+0x4586 mem_mwheel_b_new_pinlevel
+0x4587 mem_mwheel_tog
+0x4588 mem_mouse_z_data
+0x4589 mem_mouse_wheel_trigger
+0x458a mem_mouse_wheel_trigger_timer
+0x458b mem_mouse_vdd_calculate_set
+0x458b mem_mouse_vdd_full_vol
+0x458d mem_mouse_vdd_empty_vol
+0x458f mem_mouse_vdd_low_vol
+0x4591 mem_mouse_vdd_now_vol
+0x4593 mem_mouse_vdd_button_press_vol
+0x4595 mem_mouse_vdd_switch_gnd_24g_vol
+0x4597 mem_mouse_vdd_switch_gnd_full_vol
+0x4599 mem_mouse_vdd_switch_gnd_shutdown_voltage
+0x459b mem_mouse_vdd_switch_gnd_low_voltage
+0x459d mem_adc_mux_status
+0x459e mem_adc_read_timer
+0x459f mem_adc_read_time_init
+0x45a0 mem_adc_low_volatage_led_timer_count
+0x45a1 mem_adc_low_volatage_led_blink_enable
+0x45a2 mem_mouse_adc_last_low_voltage_flag
+0x45a3 mem_mouse_adc_button_press_flag
+0x45a4 mem_adc_channel_gpio
+0x45a5 mem_adc_config_flag_init
+0x45a6 mem_mouse_discovery_timeout
+0x45a8 mem_mouse_24g_pair_timeout_init
+0x45aa mem_mouse_direct_timeout
+0x45ab mem_mouse_24g_reconn_timeout_init
+0x45ac mem_mouse_24g_pair_tx_power
+0x45ad mem_rssi_dis_min_24g_init
+0x45ae mem_rssi_dis_max_24g_init
+0x45af mem_rssi_hex_received_max_value_init
+0x45b0 mem_rssi_dis_min_ble_init
+0x45b1 mem_rssi_dis_max_ble_init
+0x45b2 mem_mouse_enable_flag
+0x45b3 mem_mouse_param_config
+0x45b3 mem_lbutton_gpio
+0x45b4 mem_mbutton_gpio
+0x45b5 mem_rbutton_gpio
+0x45b6 mem_bk_button_gpio
+0x45b7 mem_fw_button_gpio
+0x45b8 mem_dpi_button_gpio
+0x45b9 mem_whee_a_data_gpio
+0x45ba mem_whee_b_data_gpio
+0x45bb mem_mouse_sensor_sclk_gpio
+0x45bc mem_mouse_sensor_sdio_gpio
+0x45bd mem_select_sensor_angle_gpio
+0x45be mem_sensor_angle_default
+0x45bf mem_sensor_angle_switch
+0x45c0 mem_config_sensor_dpi
+0x45c1 mem_whee_ta_data_gpio
+0x45c2 mem_whee_tb_data_gpio
+0x45c3 mem_matrix_public_gpio
+0x45c4 mem_config_select_device_button_gpio
+0x45c5 mem_customer_key_gpio
+0x45c6 mem_sensor_motion_gpio
+0x45c7 mem_device_switch_gpio
+0x45c8 mem_mouse_reuse_2ice_gpio
+0x45c9 mem_config_low_voltage_alarm_gpio
+0x45ca mem_config_device_24g_led_gpio
+0x45cb mem_config_device_bt1_led_gpio
+0x45cc mem_config_device_bt2_led_gpio
+0x45cd mem_dpi_led_gpio
+0x45ce mem_dpi_another_button_gpio
+0x45cf mem_firebutton_gpio
+0x45d0 mem_mouse_1io2led_multi_24g_gpio
+0x45d1 mem_mouse_1io2led_multi_bt1_gpio
+0x45d2 mem_mouse_1io2led_multi_bt2_gpio
+0x45d3 mem_mouse_logo_led_gpio
+0x45d4 mem_mouse_param_config_end
+0x45d4 mem_config_sensor_type
+0x45d5 mem_config_sensor_angle
+0x45d6 mem_wire_usb_interval
+0x45d7 mem_usb_addr
+0x45d8 mem_mouse_usb_vdd_status
+0x45d9 mem_mouse_usb_keyboard_flag
+0x45da mem_mouse_led_type
+0x45db mem_mouse_blink_count
+0x45dc mem_mouse_struct_led_gpio
+0x45dd mem_mouse_on_time
+0x45df mem_mouse_off_time
+0x45e1 mem_mouse_cb_ledon
+0x45e3 mem_mouse_cb_ledoff
+0x45e5 mem_mouse_information_start
+0x45e5 mem_device_flag
+0x45e6 mem_device1_type
+0x45e7 mem_device1_addr
+0x45ed mem_device1_link_key
+0x45fd mem_device1_locall_addr
+0x4603 mem_device2_type
+0x4604 mem_device2_addr
+0x460a mem_device2_link_key
+0x461a mem_device2_locall_addr
+0x4620 mem_device3_type
+0x4621 mem_mouse_compare_addr_ff
+0x4621 mem_device3_addr
+0x4627 mem_device3_link_key
+0x4637 mem_device3_locall_addr
+0x463d mem_store_flag
+0x463f mem_mouse_dpi
+0x4640 mem_mouse_24g_addr
+0x4644 mem_random_addr_increase_count
+0x4646 mem_mouse_retention
+0x4665 mem_mouse_information_end
+0x4665 mem_flash_base
+0x4668 mem_write_flash_head_temp
+0x466c mem_store_information_delay_timer
+0x466d mem_store_information_delay_timer_init
+0x466e mem_sensor_id1
+0x466f mem_sensor_id2
+0x4670 mem_sensor_shutter_hi
+0x4671 mem_sensor_shutter_lo
+0x4672 mem_sensor_smart_flag
+0x4673 mem_sensor_squal_reg
+0x4674 mem_sensor_iqc
+0x4675 mem_mouse_move_flag
+0x4676 mem_mouse_asm_flag
+0x4677 mem_mouse_x_pre
+0x4679 mem_mouse_y_pre
+0x467b mem_mouse_data_xtemp
+0x467c mem_mouse_data_ytemp
+0x467d mem_mouse_dpi_seting
+0x467d mem_320x_dpi_0
+0x467e mem_320x_dpi_1
+0x467f mem_320x_dpi_2
+0x4680 mem_320x_dpi_3
+0x4681 mem_3212_dpi_0
+0x4682 mem_3212_dpi_1
+0x4683 mem_3212_dpi_2
+0x4684 mem_3212_dpi_3
+0x4685 mem_ka8g2_dpi_0
+0x4686 mem_ka8g2_dpi_1
+0x4687 mem_ka8g2_dpi_2
+0x4688 mem_ka8g2_dpi_3
+0x4689 mem_mouse_cpi_count
+0x468a mem_mouse_dpi_button_state
+0x468b mem_mouse_dpi_long_press_flag
+0x468c mem_sensor_3212_init
+0x4696 mem_sensor_3204_init
+0x46a0 mem_sensor_3205_init
+0x46aa mem_sensor_32xx_init
+0x46c4 mem_sensor_32xx_init_1
+0x46e6 mem_sensor_8650_init
+0x470c mem_sensor_ka8ul_init
+0x472a mem_sensor_8009_init
+0x473a mem_sensor_ka8g2_init
+0x474a mem_sensor_p6520_init
+0x4756 mem_sensor_poweron_init
+0x475e mem_sensor_ka8g2_poweron_init
+0x4766 mem_mouse_clear_sensor_data_flag
+0x4767 mem_bluetooth_125hz_cnt
+0x4768 mem_mouse_long_mult_flag
+0x4769 mem_mouse_current_mult_timer
+0x476a mem_reconn_times
+0x476b mem_reconn_times_init
+0x476c mem_mouse_no_data_timer
+0x476e mem_device_flag_temp
+0x476f mem_mouse_rssi_signal_buf
+0x4777 mem_btclk_sensor
+0x477b mem_mouse_bluetooth_fast_conn_flag
+0x477c mem_mouse_discovery_timer
+0x477e mem_mouse_bluetooth_reconnect_timeout
+0x477f mem_mouse_need_soft_reset
+0x4780 mem_mouse_le_bb_connected_flag
+0x4781 mem_mouse_le_reconnect_flag
+0x4782 mem_mouse_send_secutiry_request_timer
+0x4783 mem_mouse_le_lap_temp
+0x4786 mem_le_adv_ind
+0x4789 mem_le_adv_direct_ind
+0x478c mem_le_adv_swift_pair
+0x47a0 mem_le_data_len
+0x47a1 mem_le_keyboard_handle
+0x47a3 mem_le_multimedia_handle
+0x47a5 mem_le_systemctrl_handle
+0x47a7 mem_le_battery_level_handle
+0x47a9 mem_le_battery_level_percentage
+0x47aa mem_le_battery_level_updata_timer_init
+0x47ac mem_le_battery_level_updata_timer
+0x47ae mem_mouse_le_conn_param_reject
+0x47af mem_le_tx_buffer0_omemalloc
+0x47cf mem_le_tx_buffer1_omemalloc
+0x47ef mem_le_tx_buffer2_omemalloc
+0x480f mem_le_tx_buffer3_omemalloc
+0x482f mem_le_connect_status_flag
+0x4830 mem_le_start_encrypt_timer
+0x4831 mem_mouse_direct_timer
+0x4832 mem_device_addr_temp
+0x4839 mem_mouse_bt_boot_mode
+0x483a mem_mouse_bt_boot_data
+0x483f mem_bt_send_max_slot_req_accept_after_switch
+0x4840 mem_mouse_bt_send_first_package_timer
+0x4841 mem_mouse_bt_send_first_package_flag
+0x4842 mem_lmi_opcode_temp
+0x4843 mem_lpm_mult_init
+0x4844 mem_customer_key
+0x4845 mem_customer_data_trigger
+0x4846 mem_customer_data_trigger_last
+0x4847 mem_mouse_lkey_press_status
+0x4848 mem_mouse_rkey_press_status
+0x4849 mem_mouse_mkey_press_status
+0x484a mem_mouse_bkkey_press_status
+0x484b mem_mouse_fwkey_press_status
+0x484c mem_mouse_dpikey_press_status
+0x484d mem_mouse_pbkey_press_status
+0x484e mem_mouse_customerkey_press_status
+0x484f mem_mouse_key_temp
+0x4850 mem_mouse_key_status
+0x4851 mem_mouse_matrix_key_cow_count
+0x4852 mem_mouse_matrix_key_row_count
+0x4853 mem_mouse_ghost_flag
+0x4854 mem_bt_discovery_count
+0x4855 mem_select_device_count
+0x4856 mem_mouse_commbination_key
+0x4857 mem_select_device_button_statue
+0x4858 mem_commbination_key_statue
+0x4859 mem_combination_ui_button_count
+0x485a mem_mouse_search_dongle_interval
+0x485b mem_mouse_search_dongle_ch
+0x485c mem_mouse_search_dongle_count
+0x485d mem_mouse_search_dongle_action
+0x485e mem_24g_enter_lpm_timer
+0x485f mem_mouse_24g_enter_lpm_enable
+0x4860 mem_mouse_device_poweron_timer_count
+0x4861 mem_mouse_dpi_led_delay_count
+0x4862 mem_mouse_led_off_4_led
+0x4863 mem_24g_device_led_status
+0x4864 mem_mouse_flag
+0x486c mem_device_number
+0x486d mem_mouse_page_to
+0x486f mem_mouse_fast_direct_timeout
+0x4870 mem_mouse_fast_page_to
+0x4872 mem_mouse_24g_power_on_fast_conn_timer
+0x4874 mem_mouse_24g_search_dongle_time_init
+0x4876 mem_mouse_no_data_timeout
+0x4878 mem_mouse_device_poweron_timer_count_init
+0x4879 mem_mouse_dpi_led_delay_count_init
+0x487a mem_mouse_dpi_led_blink_time
+0x487c mem_mouse_disconvey_led_blink_time
+0x487e mem_mouse_low_v_led_blink_time
+0x4880 mem_adc_low_volatage_led_blink_timer
+0x4882 mem_mouse_commbination_key_bt
+0x4883 mem_mouse_commbination_key_24g
+0x4884 mem_customer_key_press
+0x488d mem_customer_key_release
+0x4896 mem_mouse_set_high_impedance_bit_set
+0x4899 mem_sensor_shutdown_flag
+0x489a mem_24g_long_sleep_set_level
+0x489b mem_tx_power_factory_param
+0x489d mem_mouse_another_dpi_connect_vin_flag
+0x489e mem_dpi_another_press_status
+0x489f mem_dpi_another_button_state
+0x48a0 mem_dpi_another_button_down_enable
+0x48a1 mem_mouse_key_temp_patch
+0x48a2 mem_mouse_firebutton_connect_vin_flag
+0x48a3 mem_fire_key_status
+0x48a4 mem_fire_key_delay
+0x48a8 mem_fire_key_flag
+0x48a9 mem_le_name_len_temp
+0x48aa mem_le_name_temp
+0x48bd mem_mouse_1io2led_led_enable
+0x48be mem_mouse_multi_led_blink_enable
+0x48bf mem_mouse_bt_led_recon_effect_flag
+0x48c0 mem_mouse_multi_led_type
+0x48c1 mem_mouse_multi_led_poweron2s_flag_init
+0x48c2 mem_mouse_multi_led_poweron2s_flag
+0x48c3 mem_mouse_multi_led_powon2s_timer_init
+0x48c4 mem_mouse_multi_led_powon2s_timer
+0x48c5 mem_mouse_multi_led_blink_timer_init
+0x48c6 mem_mouse_multi_led_blink_timer
+0x48c7 mem_mouse_multi_led_state
+0x48c8 mem_mouse_logo_led_on_time_init
+0x48ca mem_mouse_le_send_conn_param_update
+0x48cb mem_mouse_le_send_conn_param_update_timer
+0x48cc mem_mouse_24g_short_sleep_set_4ms
+0x48cf mem_mouse_24g_long_sleep_set_4ms
+0x48d2 mem_mouse_24g_fast_hop_count_4ms
+0x48d3 mem_mouse_24g_short_sleep_set_8ms
+0x48d6 mem_mouse_24g_long_sleep_set_8ms
+0x48d9 mem_mouse_24g_fast_hop_count_8ms
+0x48da mem_mouse_24g_tsniff
+0x48de mem_mouse_24g_tsniff_4ms
+0x48e2 mem_mouse_24g_tsniff_8ms
+0x48e6 mem_mouse_24g_short_sleep_set_init
+0x48e9 mem_mouse_24g_tx_count
+0x48ea mem_mouse_24g_tx_time_last
+0x48f0 mem_mouse_24g_tx_time_last_delt
+0x48f4 mem_mouse_24g_tx_time_sum
+0x48f9 mem_mouse_24g_tx_time_sum_count
+0x48fa mem_mouse_24g_tx_time_offset
+0x48fb mem_mouse_24g_sleep_miss
+0x48fc mem_mouse_24g_sleep_time_temp
+0x4900 mem_mouse_24g_sleep_miss_temp
+0x4904 mem_mouse_sleep_deal_type
+0x4905 mem_mouse_24g_long_sleep_flag
+0x4906 mem_mouse_dpi_last
+0x4907 mem_mouse_dpi_temp
+0x4908 mem_mouse_otp_dpi_value
+0x4909 mem_mouse_24g_addr_last
+0x490d mem_mouse_24g_addr_temp
+0x4911 mem_mouse_ice_sdio_for_sensor_angle
+0x4912 mem_mouse_logo_enable_gpio0
+0x443c mem_shutter_bluetooth_type
+0x443d mem_shutter_config_eeprom_offset_addr
+0x443f mem_shutter_config_eeprom_start_flag
+0x4441 mem_shutter_config_user_size
+0x4442 mem_shutter_config_label
+0x4443 mem_shutter_config_otp_addr
+0x4445 mem_classic_shutter_random_mac_offset_addr
+0x4447 mem_ble_shutter_enable_notify
+0x4448 mem_ble_shutter_reconn_adv_interval
+0x444a mem_ble_shutter_discovery_adv_interval
+0x444c mem_ble_shutter_reconn_timeout
+0x444e mem_ble_shutter_reconn_timer
+0x4450 mem_ble_shutter_reconn_blink_on_time
+0x4452 mem_ble_shutter_reconn_blink_off_time
+0x4454 mem_ble_shutter_discovery_blink_on_time
+0x4456 mem_ble_shutter_discovery_blink_off_time
+0x4458 mem_ble_shutter_interval_min
+0x445a mem_ble_shutter_interval_max
+0x445c mem_ble_shutter_latency
+0x445e mem_ble_shutter_timeout
+0x4460 mem_ble_shutter_interval_min_new
+0x4462 mem_ble_shutter_interval_max_new
+0x4464 mem_ble_shutter_latency_new
+0x4466 mem_ble_shutter_timeout_new
+0x4468 mem_classic_shutter_discovery_timeout
+0x446a mem_classic_shutter_connect_timeout
+0x446c mem_ble_shutter_discovery_timeout
+0x446e mem_ble_shutter_connect_timeout
+0x4470 mem_shutter_sleep_timeout
+0x4472 mem_shutter_sleep_timer
+0x4474 mem_shutter_hard_soft_switch_case
+0x4475 mem_shutter_soft_switch_button_gpio
+0x4476 mem_shutter_soft_switch_power_state
+0x4477 mem_shutter_soft_switch_poweron_time
+0x4478 mem_shutter_soft_switch_poweroff_time
+0x4479 mem_shutter_soft_switch_poweron_callback_function
+0x447b mem_shutter_soft_switch_poweroff_callback_function
+0x447d mem_shutter_keyscan
+0x447d mem_shutter_key_num
+0x447e mem_cb_shutter_keycan
+0x4480 mem_shutter_key_conf0
+0x4481 mem_shutter_key_conf1
+0x4482 mem_shutter_key_conf2
+0x4483 mem_shutter_key_conf3
+0x4484 mem_shutter_key_conf4
+0x4485 mem_shutter_key_conf5
+0x4486 mem_shutter_key_conf6
+0x4487 mem_shutter_key_conf7
+0x4488 mem_key0_press
+0x448d mem_key1_press
+0x4492 mem_key2_press
+0x4497 mem_key3_press
+0x449c mem_key4_press
+0x44a1 mem_key5_press
+0x44a6 mem_key6_press
+0x44ab mem_key7_press
+0x44b0 mem_key0_release
+0x44b5 mem_key1_release
+0x44ba mem_key2_release
+0x44bf mem_key3_release
+0x44c4 mem_key4_release
+0x44c9 mem_key5_release
+0x44ce mem_key6_release
+0x44d3 mem_key7_release
+0x44d8 mem_ble_data_buffer1
+0x44dd mem_ble_data_buffer2
+0x44e2 mem_ble_data_buffer3
+0x44e7 mem_ble_data_buffer4
+0x44ec mem_ble_data_buffer5
+0x44f1 mem_ble_data_buffer6
+0x44f6 mem_ble_data_buffer7
+0x44fb mem_ble_data_buffer8
+0x4500 mem_ble_data_buffer9_58
+0x4532 mem_classic_data_buffer
+0x4537 mem_classic_data_buffer1
+0x453c mem_classic_data_buffer2
+0x4541 mem_classic_data_buffer3
+0x4546 mem_classic_data_buffer4
+0x454b mem_classic_data_buffer5
+0x4550 mem_classic_data_buffer6
+0x4555 mem_classic_data_buffer7
+0x455a mem_classic_data_buffer8
+0x455f mem_classic_data_buffer9_58
+0x4591 mem_queue_each_size
+0x4592 mem_queue_length
+0x4593 mem_queue_curr_num
+0x4594 mem_queue_read_ptr
+0x4595 mem_queue_write_ptr
+0x4596 mem_queue_ele
+0x45b6 mem_shutter_nv_data
+0x4660 mem_shutter_led_struct_app_led
+0x4660 mem_shutter_led_struct_app_led_type
+0x4661 mem_shutter_led_struct_app_led_blink_count
+0x4662 mem_shutter_led_struct_app_led_gpio
+0x4663 mem_shutter_led_struct_app_led_on_time
+0x4665 mem_shutter_led_struct_app_led_off_time
+0x4667 mem_shutter_led_struct_app_led_on_callback
+0x4669 mem_shutter_led_struct_app_led_off_callback
+0x466b mem_shutter_power_off_led_style
+0x466b mem_shutter_power_off_led_style_type
+0x466c mem_shutter_power_off_led_style_blink_count
+0x466d mem_shutter_power_off_led_style_gpio
+0x466e mem_shutter_power_off_led_style_on_time
+0x4670 mem_shutter_power_off_led_style_off_time
+0x4672 mem_shutter_power_off_led_style_on_callback
+0x4674 mem_shutter_power_off_led_style_off_callback
+0x4676 mem_shutter_soft_swtich_botton_down
+0x4677 mem_shutter_soft_swtich_led_struct_temp
+0x4682 mem_shutter_power_off_timeout
+0x4683 mem_shutter_power_off_timer
+0x4684 mem_shutter_key_conf0_temp
+0x4686 mem_shutter_led_struct_app_led_gpio_temp
+0x4687 mem_shutter_hard_soft_switch_case_temp
+0x4688 mem_shutter_soft_switch_button_gpio_temp
+0x4689 mem_shutter_soft_switch_first_power_on
+0x468a mem_shutter_dy_conf
+0x468b mem_shutter_le_uuid_sup
+0x4807 mem_shutter_key_value_list
+0x482f mem_shutter_1s_timer
+0x4830 mem_shutter_timer_625us
+0x4832 mem_rf_init_data_new
+0x483d mem_key_value_xmem
+0x483f mem_shutter_le_hid_map
+0x4939 mem_shutter_le_map_len_android
+0x493b mem_shutter_le_map_len_ios
+0x493d mem_le_search_service_uuid
+0x494d mem_iphone_flag
+0x494e mem_send_data_delay
+0x494f mem_key_send_clk
+0x4953 mem_shutter_key_state0
+0x495d mem_shutter_key_state1
+0x4967 mem_shutter_key_state2
+0x4971 mem_shutter_key_state3
+0x497b mem_shutter_key_state4
+0x4985 mem_shutter_key_state5
+0x498f mem_shutter_key_state6
+0x4999 mem_key0_release_new
+0x49a3 mem_key1_release_new
+0x49ad mem_key2_release_new
+0x49b7 mem_key3_release_new
+0x49c1 mem_key4_release_new
+0x49cb mem_key5_release_new
+0x49d5 mem_key6_release_new
+0x49df mem_key0_long_press
+0x49e2 mem_key1_long_press
+0x49e5 mem_key2_long_press
+0x49e8 mem_key3_long_press
+0x49eb mem_key4_long_press
+0x49ee mem_key5_long_press
+0x49f1 mem_key6_long_press
+0x49f4 mem_key0_long_release
+0x49f7 mem_key1_long_release
+0x49fa mem_key2_long_release
+0x49fd mem_key3_long_release
+0x4a00 mem_key4_long_release
+0x4a03 mem_key5_long_release
+0x4a06 mem_key6_long_release
+0x4a09 mem_combine_key0
+0x4a0b mem_combine_key1
+0x4a0d mem_combine_key2
+0x4a0f mem_combine_key3
+0x4a11 mem_combine_key4
+0x4a13 mem_combine_key5
+0x4a15 mem_combine_key_state0
+0x4a17 mem_combine_key0_press
+0x4a21 mem_combine_key1_press
+0x4a2b mem_combine_key2_press
+0x4a35 mem_combine_key3_press
+0x4a3f mem_combine_key4_press
+0x4a49 mem_combine_key5_press
+0x4a53 mem_combine_key_release
+0x4a5d mem_shutter_move_data
+0x4a61 mem_key0_press_i
+0x4a6b mem_key1_press_i
+0x4a75 mem_key2_press_i
+0x4a7f mem_key3_press_i
+0x4a89 mem_key4_press_i
+0x4a93 mem_key5_press_i
+0x4a9d mem_key0_release_new_i
+0x4aa7 mem_key1_release_new_i
+0x4ab1 mem_key2_release_new_i
+0x4abb mem_key3_release_new_i
+0x4ac5 mem_key4_release_new_i
+0x4acf mem_key5_release_new_i
+0x4ad9 mem_key6_release_new_i
+0x4ae3 mem_key0_long_release_i
+0x4ae6 mem_key1_long_release_i
+0x4ae9 mem_key2_long_release_i
+0x4aec mem_key3_long_release_i
+0x4aef mem_key4_long_release_i
+0x4af2 mem_key5_long_release_i
+0x4af5 mem_key6_long_release_i
+0x4af8 mem_key3_release_new_t
+0x4b02 mem_key3_release_new_i_t
+0x4b0c mem_key3_press_count
+0x4b0d mem_shutter_like_timeout
+0x4b0e mem_shutter_key_pressed
+0x4b0f mem_shutter_combine_key_release
+0x4b10 mem_shutter_mousekey_value_list
+0x4dcc mem_shutter_back_count
+0x4dcd mem_shutter_le_conned
+0x4dce mem_move_config
+0x4dce mem_shutter_iphone_beyond_x_count
+0x4dcf mem_shutter_iphone_beyond_y_count
+0x4dd0 mem_shutter_move_data_x
+0x4dd2 mem_shutter_move_data_y
+0x4dd4 mem_last_shutter_le_iphone_flag
+0x4dd5 mem_move_config_end
+0x4dd5 mem_shutter_back_count_cache
+0x4dd6 mem_shutter_iphone_beyond_x_cache
+0x4dd7 mem_shutter_iphone_beyond_y_cache
+0x4dd8 mem_shutter_iphone_move_mid
+0x4de0 mem_shutter_long_key_released_flag
+0x4de1 mem_shutter_move_mid_timer
+0x4de2 mem_shutter_pairing_success
+0x4de3 mem_combine_key_release_value
+0x4de5 mem_last_press_key_value
+0x4de6 mem_shutter_first_move
+0x4de7 mem_move_mode_set
+0x4de8 mem_move_mode_key_index
+0x4de9 mem_move_mode_trigger_enable
+0x4dea mem_shutter_android_move_mid
+0x4def mem_shutter_iphone_up_mid
+0x4df7 mem_shutter_iphone_like_mid
+0x4dff mem_shutter_key_num_conf
+0x4e00 mem_shutter_dy_key_conf
+0x4e07 mem_le_dy_adv_data
+0x4e12 mem_le_dy_scan_data
+0x4e1e mem_ble_shutter_dy_interval_min_new
+0x4e26 mem_shutter_ble_discovery_time_conf
+0x4e2e mem_queue_dy_each_size
+0x4e30 mem_dy_key0_press
+0x4e3a mem_dy_key1_press
+0x4e44 mem_dy_key2_press
+0x4e4e mem_dy_key3_press
+0x4e58 mem_dy_key4_press
+0x4e62 mem_dy_key5_press
+0x4e6c mem_dy_key6_press
+0x4e76 mem_shutter_led_on_light_dark_led_conf
+0x4e7d mem_shutter_led_off_light_dark_led_conf
+0x4e84 mem_shutter_reconn_blink_on_time_conf
+0x4e88 mem_shutter_discovery_blink_on_time_conf
+0x4e8c mem_shutter_efuse_start_offset
+0x4e8e mem_shutter_efuse_end_offset
+0x4e90 mem_initial_move_conf
+0x4e90 mem_android_initial_move_x
+0x4e92 mem_android_initial_move_y
+0x4e94 mem_iphone_initial_move_x
+0x4e96 mem_iphone_initial_move_y
+0x4e98 mem_otp_move_config
+0x4e98 mem_otp_shutter_move_data_x
+0x4e9a mem_otp_shutter_move_data_y
+0x4e9c mem_otp_last_shutter_le_iphone_flag
+0x4e9d mem_otp_move_config_end
+0x4e9d mem_otp_write_offset_addr
+0x4e9f mem_otp_read_offset_addr
+0x4ea1 mem_otp_read_ios_android_addr
+0x4ea3 mem_shutter_temp_count
+0x4ea5 mem_shutter_first_read_flag
+0x4ea6 mem_shutter_valid_data_flag
+0x4ea7 mem_shutter_end
+
Index: output/otp.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/otp.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/otp.dat	(working copy)
@@ -0,0 +1,8 @@
+00
+02
+aa
+55
+00
+00
+b3
+23
Index: output/ramcode.rom
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/ramcode.rom	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/ramcode.rom	(working copy)
@@ -0,0 +1,298 @@
+c284000f
+c01b8074
+c00b8012
+c00c002e
+c0100049
+c01e80c4
+c02300d6
+c02600e1
+c0290102
+c02d009a
+c02f006c
+c02f8070
+c038004b
+c07180bf
+20203a8a
+c03080cd
+c17f8000
+20203a8a
+6fe0c116
+c001801e
+c0030020
+c0053a00
+c04a0024
+c04f002b
+c0553a0f
+708a3b2c
+708a3c17
+708a398a
+708a3a0f
+202039f4
+708a3b48
+2020001a
+708a3b70
+708a3c1f
+708a39c9
+2020001c
+708a3985
+708a3a04
+708a14a3
+708a150a
+708a3b18
+708a3c0f
+20600000
+708a3983
+708a3a02
+20200026
+708a7503
+708a8500
+70896f10
+6fe0c3ef
+205a6d31
+708a0305
+708a7a94
+20403a44
+20403a3f
+20403a3a
+708a8be6
+708a8390
+708a0e0b
+708a0f05
+70896876
+70896976
+6fe0c09a
+c0840041
+708a0834
+708a01ff
+20000064
+708a020e
+708a0003
+20400019
+708a9a28
+708a9b3f
+20203a35
+20403c18
+20203b48
+70808073
+20406eb3
+20400055
+204057a0
+20758000
+204059bd
+2040562e
+20405cc5
+2040008e
+20205234
+20758000
+2040525e
+c40b8000
+20400118
+d8400002
+dfe007ee
+da20463d
+204068c5
+6fe1463d
+d840aa55
+98467c00
+20228066
+20405b76
+df200002
+da20463d
+dfe007ee
+20206883
+20400069
+7045e500
+20205b81
+6fe0c5c0
+67e0c63f
+20600000
+18427e00
+207a0000
+c17f8000
+20205f23
+18427e00
+207a0000
+c17f8000
+20205f30
+6fe0c911
+203a52c8
+6fe0c5be
+67e0c5d5
+6fe0c5bd
+c17f8000
+2040692d
+6fe0c5bd
+d840003e
+20406bbd
+6fe0c5c8
+d840003e
+20406bbd
+6848c5bc
+2040547f
+6848c5bc
+20406b85
+2040d2d2
+2040547b
+6848c5bc
+20406b7c
+20406931
+6848c5bd
+20406bae
+6848c5c8
+20206bae
+58005fad
+67e14543
+58000093
+67e14545
+2020523d
+20404d15
+24740000
+204074e0
+70490501
+20205fa6
+204074e0
+20203c18
+2040549b
+24740000
+6fe0c905
+70490500
+245a0098
+6fe44864
+c30ade39
+204000a5
+6fe0c844
+243a00aa
+20205e39
+6fe0c578
+1fe17e18
+243a572d
+20405730
+2020572a
+204000b1
+7044d402
+da200009
+6fe0c845
+243a5e54
+da40488d
+20600000
+6fe0c578
+c28180ba
+c28200b5
+20600000
+58000000
+67e0c884
+67e0c88d
+586f0000
+20205c9e
+58000000
+67e0c884
+67e0c88d
+58720000
+20205c9e
+18427e00
+c28080c2
+20203ce3
+708a6d89
+20203ce9
+20405339
+6fe0c912
+c00080c8
+70807080
+6fe08017
+79207e05
+67e08017
+20403c18
+20205af0
+78347c00
+20403b1b
+6fe1c0be
+203a74ca
+6fe0c094
+203a74ca
+6fe0c899
+247a0000
+20204d1c
+1a627e00
+67e0c850
+1fe3fe00
+1fe22400
+18422600
+2040547b
+1a620400
+20406b85
+7d20a400
+20405753
+2020573f
+1a627e00
+c01e00e5
+c01d00f1
+20205914
+6fe244da
+67e24533
+67e24640
+20404bce
+20405e1b
+20405aa9
+204058c4
+70476800
+70454700
+70452d00
+684a4533
+20205e17
+6fe0c54b
+243a5d80
+6fe0c52d
+c0015df4
+c00200f8
+c00180fd
+20205ded
+6fe44864
+c317dded
+6fe0c86c
+c000dded
+20205dcb
+6fe44864
+c317dded
+c289dded
+c2895ded
+20205dc4
+20405b90
+c40b8000
+dfe00790
+1fe22400
+20400124
+6fe2490d
+203a0110
+67e24909
+1a40a404
+dfe007cf
+9a467c00
+24610000
+1a427e00
+20200106
+6fe24909
+684a4640
+98467c00
+20628000
+df200004
+da204640
+1a427e00
+20206883
+dfe00790
+1fe22400
+20400124
+6fe2490d
+203a0127
+67e24909
+1a40a404
+dfe007cf
+9a467c00
+24210127
+1a427e00
+2020011a
+d8400004
+da20490d
+202068c5
+6fe24909
+67e24640
+20600000
Index: output/romcode.rom
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/romcode.rom	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/output/romcode.rom	(working copy)
@@ -0,0 +1,18432 @@
+20403ac3
+44804000
+20800000
+20404d91
+20403a12
+20406a13
+20403a93
+2040665f
+4480c000
+20406ebb
+20403aba
+20404d89
+2055bb65
+44814000
+204041e9
+20403827
+20404d99
+20403815
+20404788
+20403b8e
+2020380d
+2040381a
+c6848000
+793f8009
+2040383e
+20203d00
+4481c000
+20403864
+2422b822
+20403833
+1a208c01
+efe08006
+c2803c76
+20600000
+70000600
+20403844
+1f227c00
+20628000
+20203a8a
+6fe0c10d
+207a0000
+c00db830
+2040385d
+20628000
+20403860
+20628000
+70410d00
+20600000
+7001b71b
+70410d00
+20600000
+44824000
+79200009
+1a227e00
+67e1000a
+18007253
+d8a00163
+1a208c01
+efe08006
+1a220c00
+c2807419
+20600000
+4482c000
+6fe1000a
+98000a00
+18007253
+d8c00163
+20207419
+df200001
+68488006
+18408401
+2841fe01
+2420b84a
+d8400000
+60488006
+184ffe53
+da204040
+9a20a200
+efe08011
+c280b851
+c3800000
+c2003846
+20600000
+44834000
+da603871
+20403867
+24628000
+1a227e00
+67e1000a
+18007c00
+20600000
+da6038a8
+20203867
+6848c10e
+da60387a
+20203867
+4483c000
+684b410f
+da603874
+20203867
+da603880
+20203867
+da6038c3
+44844001
+da204040
+df200001
+efe08011
+1a627a00
+4484c001
+1a20a253
+c200386a
+18007c01
+20600000
+c280386c
+18007c00
+20600000
+c300386c
+1a208c10
+efe30006
+98467c00
+20628000
+2020386c
+c300386c
+1a208c16
+efe08006
+98467c00
+20628000
+2020386c
+c300b86c
+204038b0
+20403898
+98467e00
+1fe0fe01
+20213892
+18c22400
+67e484cc
+44854001
+6fe484cc
+1a420c00
+1fe0fe05
+2020388d
+2421386c
+18424200
+204038bc
+18007c00
+20600000
+98002400
+1a208c02
+efe10006
+203a388e
+204038bc
+20203881
+1ff11600
+196c9600
+2022b8a2
+29601e0f
+24608000
+18511600
+196c9600
+24628000
+7920041c
+20600000
+18511600
+196c9600
+29601e0f
+24608000
+79207e1c
+20600000
+c300386c
+18007c00
+20600000
+c300386c
+1a208c01
+efe08006
+c280386c
+20600000
+1a208c01
+e8408006
+1c427e00
+284ffe01
+1a208c04
+e8420006
+20608000
+1a208c08
+efe30006
+20403905
+1d027e00
+20600000
+1a208c02
+1a208a04
+efe10006
+98409600
+19627e00
+e7e20005
+20203d4d
+c300b86c
+204038b0
+9b60fe00
+9b60fe00
+98e0fe00
+98467c00
+2421386c
+18007c00
+20600000
+4485c001
+784efc00
+784e7c00
+7846fc00
+78467c00
+7844fc00
+78477c00
+7843fc00
+2030b913
+37d38200
+20000064
+20203913
+44864001
+78487c00
+18423600
+20403866
+78547c00
+24628000
+18003600
+202074c8
+4486c001
+37d10200
+1b427e00
+98000c00
+1ff17e00
+9c467200
+1f217203
+2422b8ea
+18007e00
+202038ee
+6849003f
+18007e00
+9840fe00
+c20038ec
+98c0fe00
+1fe6fc0c
+20407472
+67e1002a
+20600000
+44874001
+1b427e00
+1b220400
+98467c00
+7d217e2c
+98460400
+6fe1003f
+284c000f
+2020b901
+18426000
+d8410000
+6fe1003f
+98467e00
+9e008400
+604b016b
+20600000
+78587c00
+6fe3016b
+9b20e000
+1e00e00a
+6fe1003f
+9e067e00
+2fec000f
+2020b911
+58010000
+6b01003f
+9b067e00
+9e00e000
+1e023400
+20600000
+18007c00
+2020390f
+4487c001
+204065a2
+18002a08
+18002a00
+7850fc00
+78507c00
+782f7c00
+70890005
+20000002
+70890000
+20403925
+708a1600
+708a0a80
+6ff08a09
+793ffe07
+67f08a09
+708a0b00
+20600000
+44884002
+70890005
+20000002
+70890000
+6fe0c09a
+c00c392c
+c0043941
+708a10aa
+708a11aa
+708a1215
+708a0a78
+6ff08a09
+79207e07
+67f08a09
+708a0b04
+2000003c
+708a167a
+708a1700
+708a1800
+708a1900
+708a1a00
+708a112a
+708a0a78
+6ff08a09
+793ffe07
+67f08a09
+708a4300
+20600000
+708a8729
+708a8be6
+708a10aa
+708a11aa
+708a1215
+708a0a78
+6ff08a09
+79207e07
+67f08a09
+708a0b04
+2000003c
+708a163a
+708a1700
+708a1800
+708a1900
+708a1a00
+708a112a
+708a0a38
+2020393c
+4488c002
+6fe0c09a
+1fe67c18
+2042b95e
+2442b964
+60488008
+1840fe00
+c516b95d
+1840fe01
+20203989
+708a4300
+708a3d04
+708a3e00
+708a8403
+708a8940
+20600000
+708a4330
+708a3d06
+708a3e00
+708a8420
+708a8915
+20600000
+44894002
+2040659c
+6fe0c118
+c07fb973
+d8c04119
+98c08c00
+efe08006
+67f08961
+70896027
+6848c11c
+6ff08960
+9841fe00
+67f08960
+708a10aa
+708a112a
+708a1213
+708a0a7f
+6ff08a09
+793ffe07
+67f08a09
+2000003c
+708a171f
+708a18f8
+708a1918
+708a1000
+708a1120
+2000000a
+70890004
+20000002
+7089000c
+20600000
+4489c002
+d8c00960
+98c0fe00
+6848c09a
+20203998
+448a4002
+6fe0c09a
+1fe67c18
+2042b9bb
+2442b9c2
+58000960
+9a20fe00
+1fe3fe00
+6848c09a
+184f8403
+18438400
+9846fc00
+20407475
+1807fe00
+67f08a3f
+18077e00
+1ff07e00
+1fed7e00
+9846fc00
+20407475
+1807fe00
+67f08a42
+1fecfe00
+67f08a41
+1fecfe00
+67f08a40
+68588a43
+184104f0
+60588a43
+2000000c
+6fe0c09a
+c00c39af
+c00439b5
+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
+448ac002
+708a3d12
+60488008
+1840a202
+2040398e
+200003c0
+448b4002
+708a10aa
+708a112a
+708a1210
+708a0a7f
+6ff08a09
+793ffe07
+67f08a09
+708a0b07
+2000003c
+708a190d
+708a1af9
+708a1000
+708a1120
+2000000a
+70890001
+20000002
+70890003
+448bc002
+6fe0c116
+c001b9f2
+c002b9f7
+c00339fa
+c003b9fd
+c0053a00
+c041ba03
+c042ba06
+c04a3a09
+c04f3a0c
+c0553a0f
+708a396a
+708a3a07
+708a14a3
+708a1507
+20600000
+708a3966
+708a3a0b
+708a14aa
+708a150a
+20600000
+708a396c
+708a3a0d
+202039f4
+708a396b
+708a3a0f
+202039f4
+708a39a7
+708a3a0f
+202039f4
+708a39b6
+708a3a0f
+202039f4
+708a3968
+708a3a05
+202039ef
+708a3960
+708a3a05
+202039ef
+708a3953
+708a3a01
+202039ef
+708a394c
+708a3a00
+202039ef
+6fe1489b
+67f10a39
+202039ef
+70804206
+6fe1409d
+c3073a13
+98000c00
+d8408a00
+efe08006
+c07fba1d
+98418a00
+efe08006
+e7e08005
+20203a17
+448c4003
+6fe0c3ef
+205a6d31
+708a0305
+708a7a94
+20403a44
+20403a3f
+20403a3a
+708a8be6
+708a8390
+708a0e0b
+708a0f05
+70896876
+70896976
+6fe0c09a
+c0843a2e
+708a0834
+708a01ff
+20000064
+708a020e
+708a0003
+204039ed
+708a9a2b
+708a9b13
+20403a71
+20000064
+70804205
+70411d0c
+20203d00
+6fe0c3eb
+243a3a3d
+58000029
+67f08a87
+20600000
+6fe0c3ec
+243a3a42
+58000000
+67f08a0d
+20600000
+6fe0c3ed
+203a3a47
+580000d3
+67f08a6c
+20600000
+448cc003
+6ff089a2
+2feffe06
+7920fe07
+67e0c117
+6ff089a3
+1fe1040f
+18438400
+1ff1fe00
+98408400
+184fa203
+6fe0c117
+20403a5f
+1fe67e00
+9a20fe00
+1fe0fff7
+1fe17fff
+2feffe08
+2420ba5d
+58000000
+67e08030
+20203a64
+2feffe07
+24608000
+d840ff00
+9841fe00
+20600000
+6fe08030
+20403a68
+67e08009
+20600000
+1fe17eff
+1fe6fc0a
+20407472
+1ff27e00
+18070400
+9841fe00
+20600000
+58000f0f
+20203c04
+5800080f
+20203c04
+1fe20400
+448d4003
+18427e00
+2040746b
+1c307e00
+79207e2c
+20407451
+793ffe2c
+20403a82
+20407451
+20740000
+2040745e
+98003600
+37c18200
+20600000
+1b220400
+20748000
+1b420400
+20600000
+1c427e00
+20748000
+1d027e00
+20600000
+448dc003
+20203a8a
+207a0000
+1fe37e00
+1fe0fffd
+1fe0ffff
+2422ba8f
+18007e00
+20600000
+58000000
+67e30000
+d8a00163
+df20000a
+204073dd
+7004c300
+7001b600
+58000e43
+67e10031
+58000600
+67e10033
+58000600
+67e10035
+58000d00
+67e1003b
+580003bb
+67e10037
+58000500
+67e10039
+580007d0
+67e1003d
+58000ea6
+67e1003f
+580001e0
+67e10041
+58000120
+67e10043
+5800011a
+67e10045
+448e4003
+20758000
+7041298b
+58000d00
+67e14316
+58000060
+67e14318
+1c437e00
+67e24096
+20600000
+20758000
+448ec003
+6ff08a0a
+79207e03
+67f08a0a
+200004b0
+793ffe03
+67f08a0a
+20600000
+5800ee21
+67f10050
+6ff2011c
+67e204f2
+67e204f2
+70804783
+6ff08133
+67e084f1
+6ff08136
+c301e7ba
+7835fc00
+c303bad8
+7855fc00
+1ce27e00
+243a3ad8
+6ff08133
+c2813ad8
+d85fffff
+605a004c
+70800510
+37df8200
+37d98200
+70800520
+37d98200
+70800502
+6ff20138
+67f2004c
+6ff08139
+1fe17ee0
+67f0804d
+37d98200
+70800502
+6ff18134
+67f1804c
+efe08006
+1fe1feef
+e7e08005
+37d98200
+70800502
+6ff0804f
+79207e04
+67f0804f
+37d98200
+2055bb0b
+6ff0804e
+793ffe03
+67f0804e
+2055e845
+2435e7ba
+c6958000
+70800608
+20600000
+6fe0c3ea
+c000baff
+c0013b03
+c001bb07
+6fe0c0cd
+1fe17ee0
+67e0c0cd
+20600000
+6fe0c0cd
+1fe17ee0
+1fe1fe1d
+20203afd
+6fe0c0cd
+1fe17ee0
+1fe1fe1b
+20203afd
+6fe0c0cd
+1fe17ee0
+1fe1fe17
+20203afd
+6fe0c0e8
+67f08080
+6fe440d0
+67f40070
+efe28006
+e7e28005
+680440e0
+20600000
+600440e0
+6ff40070
+67e440d0
+efe28006
+e7e28005
+6ff08080
+67e0c0e8
+20600000
+6ff0806f
+1feb7e00
+1fe17e0f
+243a3b25
+6fe1c0be
+247a0000
+6ff0806f
+1fe1fe30
+67f0806f
+70800680
+6ff08129
+c4008000
+6ff18145
+67e1c0be
+20600000
+448f4003
+1b427e00
+2040744f
+684a40ae
+18467cff
+20610000
+1fed7e00
+1ff27e00
+9846fc00
+20407472
+d84000c8
+20407480
+67e0800e
+24343b39
+1fe67e00
+6849c0be
+9840fe00
+67e1c0be
+58000000
+67e240ae
+20600000
+448fc003
+d85fffff
+20403c18
+6fe0c0a8
+67e0c0cb
+6fe0c0c9
+79207e07
+67e0c0c9
+44904004
+6fe143a2
+20407487
+37d98200
+70800501
+20403af7
+37d98200
+70800502
+58000f0f
+20403bfa
+6fe240ae
+9840fe00
+67e240ae
+20403b13
+37d98200
+70800502
+6a4240cc
+6fe2c0c7
+67f2004c
+632340b2
+37d98200
+70800520
+1fef7e00
+67f0804f
+37d98200
+6252004c
+70800510
+37d98200
+605a004c
+37df8200
+4490c004
+58000000
+1ce27c00
+2022bb70
+6ff08134
+68588135
+98467c00
+20213b6e
+18427e00
+9ce67e00
+1fe0fe01
+1fe0fe07
+37d98200
+9e20fe00
+684a40aa
+9840fe00
+6849c0be
+984ffe00
+1fecfe00
+1ff1fe00
+1fe0fff3
+6849003f
+9846fc00
+20407472
+1ff07e00
+18070400
+9841fe00
+684b40b2
+20407444
+37d98200
+18423200
+6fe34048
+20403905
+1b427e00
+67e304c4
+1ce27e00
+e7e08005
+6ff0811d
+1fe1fef0
+e7e08005
+20600000
+44914004
+20403b1b
+6fe1c0be
+207a0000
+6fe0c094
+207a0000
+da6038ab
+20403867
+20628000
+20403c29
+247a0000
+2040385b
+2422bbb9
+20758000
+4491c004
+68488015
+6fe14042
+984ffe00
+18518400
+184b0400
+98467e00
+684a4044
+9840fe00
+6848c0a7
+98467e00
+1ff06000
+6fe1404e
+1fe37e00
+2040746b
+1e027e00
+20407451
+1b420400
+2040744f
+20740000
+20407464
+44924004
+6fe0c0c7
+98467c00
+20213b3c
+604a40aa
+20404db1
+684a40aa
+20203b47
+4492c004
+6fe0c35f
+243a3bbd
+20600000
+6fe140a5
+207a0000
+6848c0a7
+98467e00
+d8401d4c
+984ffe00
+20203bb0
+6fe1439e
+20407487
+243a3bdc
+70001500
+c586bbdc
+6fe0c0c3
+203a3be0
+1fe0ffff
+67e0c0c3
+20600000
+7040a900
+6fe1c0b8
+1fe0fe01
+67e1c0b8
+20600000
+44934004
+70001500
+6fe1c0bb
+1fe0fe01
+67e1c0bb
+6fe0c0a9
+1fe0fe01
+67e0c0a9
+20600000
+70001500
+6fe0c0c2
+67e0c0c3
+20600000
+6848c0c1
+60488015
+20600000
+6fe0c0c7
+247a0000
+70804206
+58000f0c
+20403c04
+58030d40
+20403a8c
+37d98200
+1e226000
+20403a6f
+70804204
+2000000a
+37d98200
+1e227e00
+9e067e00
+1fe0fe30
+d84000ff
+20407480
+67e0c0c7
+20007530
+20007530
+20007530
+20600000
+d8a00fff
+98a10a00
+6fe0c0c4
+1fe17ef0
+1fed7e00
+98a1fe00
+67f1004c
+efe10006
+e7e10005
+20600000
+20403bfa
+4493c004
+58000001
+20203c09
+58000002
+37d98200
+67f08005
+37d98200
+37d98200
+20600000
+44944005
+6ff20138
+67f2004c
+6ff08138
+1fe17e41
+6848c0cc
+9841fe00
+67f0804c
+58000020
+20203c09
+4494c005
+6fe20016
+67f2004c
+58000004
+20403c09
+6fe2001a
+67f2004c
+58000008
+20203c09
+6fe140a3
+f9207e00
+67e140a3
+20600000
+6fe140a3
+f93ffe00
+67e140a3
+20600000
+44954005
+20404daf
+6fe140a3
+1fe22200
+6fe1c3fd
+7d3a2201
+6fe4441e
+7d3a220f
+6fe44426
+7d3a220e
+6fe0c10d
+7d3a2208
+1a227e00
+67e140a3
+20600000
+6ff10112
+7d3a2206
+6ff1010e
+7d3a2205
+20600000
+6ff20130
+793ffe1b
+67f2004c
+20403c05
+20203a8a
+6ff20134
+793ffe14
+67f2004c
+20203c08
+44eb401a
+7855fc00
+70017901
+70016303
+70017a01
+5fffffff
+67e1017d
+18007e00
+67e0817b
+67e08186
+67e1c0b8
+67e1c0bb
+20403fa1
+70412b01
+70412c00
+70019801
+70019901
+70436d00
+2020407e
+44ebc01a
+7834fc00
+70016403
+70436f01
+70050601
+5800ffff
+67e10508
+18007e00
+67e2c407
+79207e27
+67e2c402
+20203c46
+44ec401b
+7854fc00
+58000017
+67e142b8
+1fe0fe04
+67e1437c
+70016401
+70435f00
+70001500
+20403ccf
+6fe10191
+67e142ca
+6fe10165
+1feffe05
+1ff1fe00
+67e10191
+20203c46
+44ecc01b
+20403cf9
+6fe08163
+2feffe04
+79208032
+20404d9e
+6fe08164
+c280bc7f
+20203c91
+44ed401b
+7834fc00
+20404074
+20213c8e
+20403d3f
+20403fb6
+7856fc00
+20403e74
+24768000
+6fe08005
+1fe0fe01
+67e08005
+20403f67
+7854fc00
+20600000
+20403cc4
+7854fc00
+20600000
+44edc01b
+70431300
+793f8030
+78577c00
+20404074
+20213cc4
+6fe08198
+20403ce0
+20403d3f
+20403d96
+242c3cb5
+20403cd3
+2036bca0
+c5183ca0
+20203caf
+44ee401b
+6fe0c313
+1fe0fe01
+67e0c313
+c0063caf
+20403f67
+20403fb6
+6fe08199
+20403ce0
+20403e85
+20404019
+6fe1439a
+20407487
+20403cb9
+20343cbe
+44eec01b
+2040468a
+20404681
+20406f91
+6fe08186
+c281bcc4
+44ef401b
+204038cc
+20404147
+202038f3
+78547c00
+c51574c8
+c514f4c8
+c51874c8
+20600000
+44efc01b
+78377c00
+20403e78
+2036bca0
+c5183ca0
+20203caf
+44f0401c
+20403cca
+20404dee
+20403ccf
+7004c315
+20206f7b
+d8a043f3
+204073e1
+70017900
+70016400
+70016300
+44f0c01c
+7042d200
+7042d100
+20600000
+44f1401c
+6fe08005
+1fe0fe01
+67e08005
+6fe08163
+c3818000
+79207e03
+67e08163
+6fe142ca
+67e10191
+58000000
+67e242f2
+20600000
+1fe20400
+44f1c01c
+18427e00
+c2803cf9
+c280bce9
+c3013cf9
+c283bcf6
+c2813cef
+20203cf9
+20403cf9
+7920002d
+793f802f
+70890103
+70892084
+20600000
+20403cf9
+7920002f
+793f802e
+70890105
+70892080
+70893020
+20600000
+20403cef
+7920002e
+20600000
+44f2401c
+793f802d
+793f802f
+70890101
+70892080
+70893003
+20600000
+44f2c01c
+793f8032
+70890101
+70892080
+70893003
+20600000
+44f3401c
+7844fc00
+7843fc00
+6fe1818b
+98001e00
+6fe08007
+1fed8400
+79200401
+18431c00
+20600000
+20403d19
+20403954
+6fe10039
+20403a8c
+2020396a
+2036b9cf
+c51839cf
+20403d19
+202039c9
+44f3c01c
+20403925
+6fe081b6
+243a3d2c
+6fe08007
+1fe67c24
+20213d26
+18000400
+c1128000
+18000418
+c1130000
+1800044e
+20600000
+1fe67c0a
+20213d29
+1fe0fe01
+1fe3fe00
+1fe08402
+20600000
+6fe08007
+1fe38400
+20600000
+d84001f4
+207a0000
+d84000fa
+c1008000
+d8400096
+c1010000
+d8400064
+c1018000
+d840004b
+c1020000
+d8400032
+c1028000
+d8400028
+c1030000
+d8400014
+20600000
+44f4401d
+78287c00
+6fe20187
+98001200
+20403d74
+58000200
+2034bd48
+6fe10171
+1fe37e00
+68490039
+9840fe00
+20403a73
+1b427e00
+20600000
+44f4c01d
+204073a4
+672104ef
+1a208c01
+efe08006
+c4000000
+1a208a1a
+efe10005
+1fe0fe01
+e7e10005
+20403ee6
+20403f08
+20403f11
+20403d5e
+204073b3
+6f2104ef
+20600000
+1a208c19
+efe08006
+1a208a18
+e8408005
+9840fe00
+1fe67c24
+20213d66
+1fe0ffdb
+e7e08005
+20600000
+1a208c30
+efe28006
+18000400
+18007225
+c3003d6e
+18408401
+1fe37e00
+c2003d6c
+1840ffff
+1a208a22
+e7e08005
+20600000
+44f5401d
+6fe0817b
+98000e00
+684a8193
+a84fffff
+2020bd89
+6fe08185
+98e67e00
+20213d7f
+1fe60fff
+20203d7a
+18e27200
+18000e00
+a84fffff
+2020bd84
+1f20f201
+1f227e00
+203a3d89
+18e08e01
+1f20f3ff
+20203d81
+18e27e00
+67e08007
+20600000
+2034bd8f
+37c18200
+20600000
+d9600ea0
+34730200
+20600000
+78487c00
+6fe1431d
+1fe21600
+20203d9c
+44f5c01d
+20403e02
+78287c00
+6fe10171
+684a42f2
+98409600
+20403d10
+44f6401d
+20403d06
+c597bda4
+783cfc00
+2000001e
+20403d06
+19699600
+7856fc00
+7826fc00
+7830fc00
+78507c00
+19623600
+37c18400
+20373dad
+1b420400
+604b000f
+242c3e3e
+78287c00
+6fe0c129
+d8404e20
+98408400
+6fe0c11d
+984fb600
+204065a4
+20373dbb
+20403e43
+6fe08163
+c301bdbb
+684b000f
+2055bb2a
+20403a49
+7823fc00
+7824fc00
+09800008
+19897e00
+67e08047
+09800008
+19897e00
+67e08048
+1fe27200
+2022bde1
+c5193dcc
+09800008
+19897e00
+e7e08005
+c2003dc7
+20203de1
+18a22400
+44f6c01d
+20403f60
+6a208048
+1a20a3fc
+24213e36
+20403e07
+1a420a00
+d8400000
+6f208048
+1f20f3fc
+2022bddf
+09800008
+19897e00
+e7e08005
+18408401
+18417c0f
+2042be25
+c2003dd8
+20403e2d
+1a420a00
+44f7401d
+09800018
+1fef7e00
+1ff17e00
+e7e18005
+78287c00
+20403e51
+20233e3a
+c5993df3
+6fe08048
+203a3df3
+1fe0fffc
+67e08048
+20406de7
+6ff08108
+c303be36
+1800700c
+65e2014f
+204065a3
+7836fc00
+793f8030
+44f7c01d
+20406de9
+6fe08198
+7d3e7e07
+67e08198
+20403e00
+44f8401e
+68488008
+1840a202
+2020398e
+7846fc00
+20203925
+c6990000
+20406e84
+1800700c
+20406e8c
+20206e8b
+44f8c01e
+70806c00
+70806d01
+6fe08047
+1fe17e03
+67f0806e
+58000049
+67f10068
+67f1006a
+6a208048
+1a20a3fc
+684ac407
+280ffe0f
+2040be1b
+20406d54
+58000000
+67f100c1
+70800a06
+70800a07
+20600000
+18467c00
+2022be20
+184085ff
+79200427
+20600000
+58ffffff
+1ff07e00
+d840ffff
+98418400
+20600000
+18a22400
+6fe08048
+1fe0fffc
+98467c00
+20628000
+605900c1
+1a420a00
+20600000
+09800020
+1fef7e00
+1fecfe00
+e7e20005
+18a22400
+18007000
+1fe25e00
+605900c1
+20600000
+20203e40
+20403e51
+204038cc
+20203df3
+204065a5
+c5183e3e
+79200030
+20203df6
+793f8030
+20203e40
+44f9401e
+20406de9
+202038cc
+c517be49
+c516be4d
+6fe10041
+1fe25200
+1c225000
+20600000
+6fe10045
+1fe25200
+1c20d001
+20600000
+6fe10043
+1fe25200
+1c225000
+20600000
+6fe08048
+1fe08405
+18498400
+6fe08198
+c517be58
+c2803e5a
+c280be5b
+203e3e5d
+20203e60
+20203e65
+18430400
+20203e65
+18408403
+18438400
+20203e62
+18408403
+18498400
+58000028
+98408400
+20203e65
+6fe0c11d
+984f8400
+da204e20
+9a2ffe00
+98460400
+1b627e00
+98463600
+20600000
+20403e85
+68488008
+20403954
+2040396a
+78287c00
+d960157c
+20203d9d
+44f9c01e
+6fe08199
+20403ce0
+20403e85
+6fe08198
+20403ce0
+68488008
+20403954
+2040396a
+78287c00
+d960157c
+c597bd9d
+d9602134
+20203d9d
+44fa401e
+20403e85
+202038cc
+44fac01e
+20403d06
+20403d15
+204065aa
+79202a00
+782efc00
+78307c00
+7850fc00
+20403d8c
+785d7c00
+c517bec8
+c516beda
+19317e00
+1fecfe00
+1ff1fe00
+08008628
+7823fc00
+7824fc00
+44fb401e
+6fe0c12b
+08008608
+efe08006
+1fe27200
+08008608
+1f267c00
+2022bea6
+6ff0800a
+203a3ea2
+c5193ebd
+d8c0412d
+efe08006
+08008608
+c2003ea3
+78247c00
+08008618
+78447c00
+c597bead
+7843fc00
+58000000
+08008603
+37d38200
+20000064
+44fbc01e
+784efc00
+785c7c00
+20403925
+204065a8
+6fe0c12b
+1fe17e03
+c1818000
+6fe0c2d2
+c0013fa1
+c1828000
+6fe0c12d
+c002bf9c
+20600000
+1f20f3fc
+1f220400
+20406dd4
+d8c0412d
+efe08006
+08008608
+c2003ec1
+20406dd9
+1de27e00
+08008620
+20203ea6
+df20000a
+5800003c
+08008608
+c2003ec9
+784efc00
+783c7c00
+19317e00
+1ff17e00
+1ff1fe00
+08008620
+c5173ed7
+58000001
+08008605
+783d7c00
+20203e95
+58000000
+08008605
+20203e95
+6fe0c11d
+6848c12a
+9840fe00
+20403a8c
+19317e00
+1fecfe00
+1ff18400
+18427e00
+08008608
+18427e00
+08008628
+20203e95
+da603eea
+da403f00
+d8e00005
+20203f3f
+1a208c04
+e8420006
+1a208c37
+efe08006
+1a208a2b
+e7e08005
+efe10006
+1febfe00
+98409600
+1a208a04
+19627e00
+e7e20005
+efe10006
+1febfe00
+1a208a02
+e7e10005
+efe10006
+1a208a2c
+e7e10005
+efe10006
+67e142ca
+20204081
+efe08011
+793ffe03
+e7e08011
+622104d8
+7004c344
+20406f7b
+6a2104d8
+20600000
+da600000
+da403f0c
+d8e00006
+20203f3f
+1a208c37
+efe28006
+1a208a30
+e7e28005
+20203d68
+da600000
+da403f15
+d8e00007
+20203f3f
+1a208c37
+efe08006
+20403f22
+e7e08005
+1a208c38
+efe08006
+20403f30
+e7e08005
+622104d8
+7004c342
+20406f7b
+6a2104d8
+20600000
+205a3f2a
+1a208a35
+24748000
+6848c37a
+284ffe07
+7920fe07
+1a208a36
+20600000
+1a208c35
+efe08006
+24748000
+1a208c36
+efe08006
+20600000
+205a3f39
+6848c37a
+284ffe07
+7920fe07
+1a208a36
+24748000
+793ffe07
+1a208a35
+20600000
+1a208c36
+efe08006
+24748000
+1a208c35
+efe08006
+20600000
+44fc401f
+efe08011
+afec0000
+20608000
+1a208c1a
+e8410006
+1a208c20
+efe10006
+98467e00
+2022bf4f
+24213f54
+1fe67c01
+2022bf4d
+20600000
+1a627e00
+20207487
+efe08011
+f93ffe00
+e7e08011
+1a427e00
+20207487
+1a208c1a
+efe10006
+1a208c20
+efe10006
+98467e00
+d840ffff
+98467c00
+2022bf4f
+d840f000
+98467c00
+24213f4f
+20600000
+6848817a
+6fe08047
+1fe37e00
+9842fe00
+2feffe02
+7920800f
+20600000
+44fcc01f
+2040407e
+c6180000
+20403f8e
+6fe08047
+2feffe04
+7920802a
+1fe37e00
+9842fe00
+2feffe02
+7920800f
+c6078000
+6fe08048
+203a3f80
+6fe08163
+c3023f80
+684a014f
+6fe2440c
+98467c00
+2022ba8a
+604a440c
+6fe2c407
+1fe0fe01
+79207e27
+67e2c407
+6848817a
+79400402
+6048817a
+6fe0c2f6
+c4030000
+44fd401f
+6fe08048
+207a0000
+6fe08047
+2fe00601
+2020c592
+2fe00602
+2020c580
+20600000
+44fdc01f
+6848817a
+284c0005
+20608000
+6fe08047
+1fe3fe00
+9842fe00
+c4018000
+793f8405
+79400403
+6048817a
+28400603
+24608000
+20600000
+6fe08163
+79207e04
+67e08163
+79200032
+20600000
+44fe401f
+7042d200
+dfe00000
+67e2440c
+67e2c402
+79207e27
+67e2c407
+6fe08163
+793ffe04
+67e08163
+793f8032
+20600000
+da200001
+6fe08047
+c3830000
+da200000
+20600000
+18c20a00
+6849437c
+18a20c00
+20600000
+44fec01f
+6fe0817a
+c3828000
+20403fd7
+204041b4
+203a3ffb
+efe10006
+e8410006
+18422200
+9a267e00
+20403fb2
+204074be
+1fe20400
+e8208006
+1a227e00
+98c0fe00
+67e104e3
+20403feb
+20403ffd
+204041b4
+efe10006
+1fe22200
+18c22600
+e8410006
+18422400
+9a467e00
+20403fb2
+204074be
+9a40fe00
+e7e10013
+9a267c00
+24628000
+202041ce
+20403fde
+c6148000
+6fe0c2f6
+c3013fe9
+204041b8
+203a3fe9
+20203fe7
+204041b4
+203a3fe9
+efe10006
+e8410006
+98462200
+20403fb2
+18427e00
+9a267c00
+20213fe9
+79200029
+20600000
+793f8029
+20600000
+1a227e00
+207a0000
+d8200001
+20600000
+44ff401f
+18408401
+204040af
+18c08dfe
+efe10006
+d8402902
+98467c00
+24628000
+18c08c01
+18c22200
+efe08006
+20600000
+18000400
+18000201
+44ffc01f
+6048c12c
+6848817a
+79200405
+18417efc
+9821fe00
+67e0817a
+1fe17e1f
+280ffe29
+7920fe04
+67e0c12b
+6fe0c12b
+28200601
+2420c00d
+6fe0c12c
+207a0000
+c5194013
+6f20c12c
+6fe104e3
+1fe20c00
+d8a0412d
+2020740c
+20406e84
+20206dbb
+d8e00000
+20203c21
+d8e00000
+20203c25
+47004020
+c6078000
+c6180000
+6fe08047
+1fe17e03
+67e0c309
+6fe08048
+207a0000
+58000049
+67e1430e
+4700c020
+6fe0c309
+c001c6c3
+20404034
+24344015
+20404017
+58000000
+67e1430c
+6fe14314
+243a7487
+6fe1430e
+1fe08c02
+efe10006
+c002432f
+c00345e3
+c002c5b7
+20600000
+6fe0c309
+c0014043
+c000c05a
+20600000
+204074c8
+d8400004
+9fe67c00
+20628000
+d8400005
+9fe67c00
+20628000
+d8400006
+9fe67c00
+20628000
+202074ca
+6fe1430e
+1fe20c00
+efe10006
+67e1430a
+efe10006
+20404038
+24740000
+68488048
+6049430c
+6fe1430a
+1fe0fe04
+98467c00
+2022f4c8
+6f208048
+d8a00f00
+6fe1430e
+1fe20c00
+2040740c
+202074ca
+204074c8
+6fe1430c
+247a0000
+202074ca
+20404056
+24740000
+6fe1430c
+d8a00f00
+98a0a200
+68488048
+9840fe00
+67e1430c
+6f208048
+1a220a00
+6fe1430e
+1fe20c00
+2040740c
+58000f00
+67e1430e
+6fe1430a
+1fe0fe04
+6849430c
+98467c00
+2022f4c8
+202074ca
+204073c0
+d8a0428f
+2020457a
+6fe14398
+20207487
+47014020
+684a017f
+20403a86
+98461600
+19627e00
+68490191
+18520400
+18438400
+98467e00
+20600000
+20403a86
+67e2017f
+20600000
+4701c020
+1a208c50
+efe08006
+20403d2f
+1a208c02
+efe10006
+984ffe00
+6849003f
+984ffe00
+d84f4240
+9846fc00
+d8400682
+6fe0c11d
+984f8400
+1a208c2b
+efe08006
+984ffe00
+9840fe00
+67e242f2
+6fe1409b
+20407475
+18078400
+9840fe00
+1a208a0e
+e7e10005
+20600000
+47024020
+6fe10506
+98002400
+6fe10508
+98002600
+6fe142cc
+98000c00
+202074c8
+efe10006
+1fe17eff
+207a0000
+9a467c00
+24610000
+9a667c00
+20628000
+202140ad
+18007c01
+20600000
+18007e00
+20600000
+204040b2
+2022c0bf
+20600000
+4702c020
+6fe142cc
+98000c00
+efe10006
+1fe17eff
+207a0000
+98467c00
+20628000
+efe08006
+98c08c00
+efe08006
+98c08c00
+202040b5
+efe08006
+98c08c00
+20600000
+47034020
+6fe142cc
+98000c00
+efe10006
+1fe17eff
+207a0000
+efe08006
+98c08c00
+18c08dfe
+efe10006
+98467c00
+20628000
+efe08006
+98c08c00
+202040c5
+6fe142cc
+98000c00
+efe10006
+1fe17eff
+207a0000
+1fe08401
+efe08006
+98c08c00
+efe08006
+98c08c00
+18c20a00
+202040d3
+6fe1051c
+202040e1
+4703c020
+6fe142cc
+98000c00
+efe10006
+1fe17eff
+203a40ec
+98467c00
+2022c0ed
+efe08006
+98c08c00
+efe08006
+98c08c00
+202040e2
+202074d6
+efe08006
+67e08522
+1fe27200
+d8a00523
+2040740c
+efe08006
+67e0851b
+204073c0
+202074d8
+47044021
+204040f9
+2020410b
+d8402a00
+204040c2
+207a0000
+efe08006
+18c20a00
+6848c22d
+18427200
+98467c00
+24214108
+98460400
+d8c0422e
+2040740c
+18427200
+2442c143
+20600000
+1fe27200
+d8c0422e
+2020740c
+da60433f
+da204320
+20404118
+58000000
+79347e00
+67e084c4
+da60435f
+da204340
+20404118
+20740000
+6fe084c4
+203a3a8a
+20600000
+4704c021
+204074c8
+204073f2
+da400000
+d8a004f7
+20404132
+6fe0c22d
+1fe08401
+9a40a200
+1a20a202
+1a267c1f
+24214130
+e0408005
+d8400009
+e0408005
+98007200
+2040740c
+1a222400
+1a427e00
+67e084f6
+d8c004f6
+5fffffe0
+9a608a00
+202073d0
+204074ca
+2020412a
+efe08011
+207a0000
+1fe0fe01
+e8408006
+18467c09
+2022c141
+9a40a400
+1a220c00
+98007200
+2040740c
+18c22200
+1a227e00
+9a667c00
+20610000
+20204132
+9a20a200
+2020413d
+58000020
+e7e08005
+c2004143
+20600000
+47054021
+7855fc00
+2037414b
+2436c15a
+20403bce
+6fe1409b
+67e10171
+6fe0c2f6
+c282bbdc
+c507bbdc
+6fe08048
+243a3bdc
+6fe0c12c
+243a3bdc
+6fe08163
+c282bbdc
+c283bbdc
+c2833bdc
+20203bc4
+6fe0c0a9
+1fe67c1e
+24213bd3
+6849409b
+18430400
+6fe10171
+9840fe00
+67e10171
+20203bd3
+d8e00000
+2020417b
+d8e00000
+2020417f
+d8e00001
+2020417b
+d8e00001
+2020417f
+d8e00002
+2020417b
+d8e00002
+2020417f
+d8e00003
+2020417b
+d8e00003
+2020417f
+d8e00004
+2020417b
+d8e00004
+2020417f
+d8e00005
+2020417b
+d8e00005
+2020417f
+6fe0c2f6
+f9207e00
+67e0c2f6
+20600000
+6fe0c2f6
+f93ffe00
+67e0c2f6
+20600000
+58112233
+67e1c2f7
+58445566
+e7e18005
+58778899
+e7e18005
+58001122
+e7e18005
+58334455
+e7e18005
+58000066
+e7e08005
+20600000
+59000302
+67e24286
+58010010
+67e1c28a
+7042d301
+20600000
+da200000
+d8200001
+202041a9
+4705c021
+d8200003
+204041a9
+1a427e00
+e7e08005
+20600000
+47064021
+18000202
+1a20a204
+204041a9
+1a20a3fc
+1a227e00
+e7e10005
+1a427e00
+e7e10005
+20600000
+4706c021
+1a20a205
+2040667e
+1a20a3fb
+1a227e00
+e7e10005
+58000000
+e7e10005
+18227e00
+e7e08005
+20600000
+47074021
+204066b8
+1fe20c00
+20600000
+6fe143fb
+20600000
+204041bd
+1fe20c00
+20600000
+6fe143fe
+20600000
+204041b4
+18c08c05
+20600000
+204041b4
+18c08c09
+20600000
+204041ba
+18c08c09
+20600000
+204041ba
+18c08c05
+20600000
+202066ce
+202066d1
+202066d4
+202066bd
+67e44384
+202041e0
+184122ff
+204041d6
+184ca200
+6220c37b
+202041d7
+6220c37a
+2a2ffe01
+2040c1dc
+2a2ffe02
+2040c1de
+20600000
+d8e00008
+202041e1
+d8e0000b
+202041e1
+d8e00005
+6fe44372
+f9207e00
+67e44372
+20600000
+20404167
+20404190
+20404183
+2020416f
+70019801
+70019901
+20403cf9
+204041ef
+2040426c
+20203d00
+4707c021
+6fe0c31a
+c1808000
+d8e00002
+2040742e
+247a0000
+6fe1431b
+6849431d
+98467e00
+d8e00002
+20407420
+7854fc00
+20404296
+2040420e
+24768000
+47084022
+6fe30049
+67e30173
+6fe08002
+1fe0fe01
+67e08002
+20404215
+20748000
+204042bd
+24768000
+6fe08004
+1fe0fe01
+67e08004
+6fe4804f
+67e484f6
+20600000
+4708c022
+20404308
+20403d92
+6fe08001
+1fe0fe01
+67e08001
+20600000
+47094022
+6fe081b7
+c18d8000
+6fe30173
+684b42a1
+98467c00
+24628000
+20403853
+24628000
+20404225
+20403c59
+70410d00
+7001b300
+70431a00
+7001b700
+2020383e
+4709c022
+18007fff
+38080001
+67e28193
+da200163
+20403d68
+18007204
+d8a00187
+204074e4
+6fe142ae
+67e10191
+180a7e00
+1fe17e0f
+1fe67c04
+20214230
+67e0817c
+470a4022
+68494127
+60490165
+18422600
+1c40fe07
+9a66fc00
+20407475
+18072200
+9a267e00
+9a60fe00
+68494125
+9840fe00
+67e20167
+9c462200
+1a20a3fa
+da402205
+6fe0c2a7
+7d3a2406
+6fe0c2a0
+7d3a2407
+1a427e00
+67e1412b
+6fe342b0
+e7e30005
+6fe30173
+e7e30005
+6fe20187
+e7e20005
+180a7e00
+e7e10005
+180a7e00
+e7e08005
+18007e02
+e7e08005
+1a2b7e00
+e7e10005
+1a6b7e00
+e7e10005
+470ac022
+58000000
+e7e10005
+6fe142ae
+e7e10005
+6fe28193
+e7e28005
+6fe0817c
+d84000a0
+9841fe00
+e7e08005
+20403e82
+5800412b
+1fe08c12
+efe18006
+67e1818b
+20600000
+70000724
+7004f600
+20404290
+20404271
+20204293
+470b4022
+6fe0c35f
+207a0000
+d8e00000
+2040742e
+247a0000
+78287c00
+20404296
+20404308
+2040429f
+2436c283
+6fe08003
+1fe0fe01
+67e08003
+6fe08047
+1fe17e0f
+c001c2ce
+c002c2e0
+470bc022
+6fe084f6
+6848c36a
+98467c00
+2422c271
+180a7e00
+d84001ff
+98417e00
+1fe0fefa
+204073d4
+d8e00000
+6fe14360
+20207420
+d8a00506
+d8c0412b
+202073cf
+d8c00506
+d8a0412b
+202073cf
+470c4023
+7854fc00
+588e89be
+1fed7e00
+1fe1fed6
+98001200
+58555555
+67e1818b
+20600000
+470cc023
+6fe0c362
+6848c363
+18520400
+184b8400
+98408400
+6048c12b
+c000c2b0
+6848c31f
+1840fe06
+67e0c12c
+6fe342b0
+67e3412d
+18427200
+d8c04320
+2040740c
+202042b6
+5800000c
+67e0c12c
+6fe342b0
+67e3412d
+6fe3410f
+e7e30005
+470d4023
+6fe08000
+1fe0fe01
+67e08000
+db600708
+7856fc00
+20203e6d
+470dc023
+6fe0c36b
+c1808000
+6fe08000
+1fe0fe01
+67e08000
+d8400c03
+6fe0c36c
+7d3a0406
+1a227e00
+7d3a0407
+6049412b
+6fe342b0
+e7e30005
+6fe30173
+e7e30005
+20203e6d
+6fe3004f
+684b42b0
+98467c00
+24628000
+d8400004
+6fe0c363
+7d3a0406
+6048c12b
+6848c33f
+1840fe06
+67e0c12c
+6fe342b0
+67e3412d
+d8c04340
+18427200
+2040740c
+20403e82
+20204283
+6fe3004f
+684b42b0
+98467c00
+24628000
+20403fad
+6220c2a0
+6fe30049
+67e30173
+6fe40055
+67e40187
+6849005d
+470e4023
+184b8400
+6fe1005f
+1febfe00
+67e10165
+67e20167
+98467e00
+1fe0d1fe
+6fe48061
+67e4818f
+6fe0806a
+1fe1041f
+6048817c
+1ff18400
+18430400
+604881b3
+da200163
+20404081
+da200163
+20403d68
+20403c65
+20403853
+24628000
+470ec023
+204038f3
+204045d4
+7004c314
+20406f7b
+2020383e
+470f4023
+6fe08007
+c012c30e
+c0134314
+c013c31a
+2020431a
+6848c36a
+284ffe01
+2020c325
+284ffe02
+2020c32a
+20204320
+6848c36a
+284ffe02
+2020c32a
+284ffe00
+2020c320
+20204325
+6848c36a
+284ffe00
+2020c320
+284ffe01
+2020c325
+2020432a
+70000725
+6fe084f6
+79207e00
+67e084f6
+20600000
+70000726
+6fe084f6
+79207e01
+67e084f6
+20600000
+70000727
+6fe084f6
+79207e02
+67e084f6
+20600000
+efe18006
+67e1c36e
+c0014346
+c001c34e
+c0024351
+c003437a
+c00443c7
+c0054445
+c0064474
+c008448a
+c00944cd
+c00b44f3
+c00c4506
+c00f450b
+c029450f
+20600000
+18002203
+20404535
+58000002
+e7e08005
+6fe142b6
+e7e10005
+20600000
+2040434e
+18002203
+20404535
+58000003
+e7e08005
+6fe142b6
+e7e10005
+20600000
+1fecfe00
+67e142b8
+20600000
+20404569
+204074c8
+20204354
+d9600003
+2040409b
+204040a3
+203a4378
+24214375
+18c08dfe
+204073c0
+204073b7
+24344368
+204073a4
+204074ca
+616204d4
+18002214
+20404535
+696204d4
+204073b3
+58000005
+e7e08005
+58000001
+e7e08005
+204073ba
+efe10006
+1fe17eff
+e7e10005
+efe08006
+1fe27200
+20407419
+204073bd
+196097ff
+2022c378
+efe08006
+98c08c00
+20204356
+efe08006
+98c08c00
+20204372
+20344528
+2020455c
+20404569
+efe10006
+67e14290
+204073c0
+d8a0050a
+6fe1430a
+1fe0fff9
+2040457c
+2020438d
+78547c00
+68490506
+6fe10508
+98467c00
+2421438a
+18427e00
+c1800000
+78347c00
+7001b401
+2020452a
+20404383
+20740000
+68494290
+58002800
+98467c00
+2022c394
+20204528
+70437100
+68490506
+604904cc
+204040df
+243a4528
+684904cc
+204040df
+243a43ad
+18c22200
+6fe0851b
+1fe27200
+6848850a
+98467c00
+2422c3a9
+da40050b
+20407477
+2022c3b0
+6fe10523
+68494290
+98467c00
+2022c3b8
+6fe104cc
+1fe0fe01
+67e104cc
+20204399
+6fe0c371
+c000c3b8
+20204528
+6fe10523
+68494290
+98467c00
+2422c3a9
+70437101
+684904cc
+6049051e
+202043a9
+6fe0c371
+c00043a9
+70437102
+684904cc
+184085ff
+60490520
+da200005
+20404535
+58000007
+e7e08005
+6fe1051e
+e7e10005
+6fe10520
+e7e10005
+20600000
+20404569
+20404577
+202043ca
+68490506
+604904cc
+2040409b
+204040b2
+18c08dfe
+18c27e00
+67e1051c
+6849050b
+58002a00
+98467c00
+2022c431
+58002803
+98467c00
+2422c41d
+d9600002
+2040453c
+242143fa
+684904cc
+204040dd
+243a43fa
+20404540
+2422c3f8
+243443fc
+78547c00
+da200014
+20404535
+58000009
+e7e08005
+18a26000
+18a08a01
+2040440a
+20404538
+204040dd
+20404411
+6fe08522
+1fe0a205
+e2208030
+1a267c07
+2442f4cc
+2042f4ce
+2040456e
+9a26fc00
+20407475
+18079600
+196097ff
+2022c3fa
+20404538
+202043d9
+20344528
+2020455c
+2040454c
+20404538
+204040dd
+204044bb
+243a43fa
+204073b7
+6fe104cc
+1fe0ffff
+e7e10005
+20404558
+20404411
+196097ff
+2022c3fa
+202043f8
+6fe104cc
+e7e10005
+6fe0851b
+1fe27200
+204073ba
+2040740c
+202073bd
+204073b7
+6fe104cc
+e7e10005
+204073bd
+6fe08522
+1fe27200
+204073b7
+204073ba
+9f260c00
+18c08dff
+2040740c
+202073bd
+204040c2
+203a4528
+18c22600
+18c08dfb
+efe10006
+67e104cc
+da200014
+20404535
+58000009
+e7e08005
+efe08013
+1fe27200
+1fe0fe02
+e7e08005
+6fe104cc
+e7e10005
+1a608c01
+2040740c
+204073bd
+2020455c
+d8402a00
+204040c2
+207a0000
+18c08dfb
+efe10006
+67e104cc
+da200014
+20404535
+58000009
+e7e08005
+6fe0c22d
+1fe27200
+1fe0fe02
+e7e08005
+6fe104cc
+e7e10005
+d8c0422e
+2040740c
+204073bd
+2020455c
+204044ec
+6849436f
+6fe0c2f6
+c281c46a
+204040b2
+2422c528
+20544470
+20740000
+204040bf
+18c08dfe
+efe10006
+d8402a00
+98467c00
+2022c460
+efe08006
+1fe67c16
+20214457
+18007e16
+1fe22600
+204073c0
+1a60a201
+20404535
+5800000b
+e7e08005
+1a627200
+204073ba
+20207419
+204073c0
+6fe0c22d
+1fe0a201
+20404535
+5800000b
+e7e08005
+6fe0c22d
+1fe27200
+d8c0422e
+20207419
+6fe14307
+98467c00
+2422c449
+24344449
+7001b405
+2020452a
+18c08dfe
+efe10006
+c287446e
+202074ca
+efe10006
+67e1050a
+da200014
+20404535
+5800000d
+e7e08005
+6fe1050a
+98002200
+6849436f
+204040af
+203a4528
+efe08006
+9a267200
+24214528
+1f267c16
+20214485
+18007216
+1a227e00
+98c08c00
+2040740c
+204073bd
+2020455c
+20404569
+20404577
+2020448d
+d9600002
+68490506
+604904cc
+204040b2
+18c08dfe
+18c27e00
+67e1051c
+2040453c
+242144c3
+684904cc
+204040dd
+243a44c6
+20404540
+2422c4b9
+19627e00
+c00044c6
+243444af
+78547c00
+da200014
+20404535
+58000011
+e7e08005
+6fe0851b
+1fe0a204
+e2208005
+204073bd
+1a267c06
+2442f4cc
+2042f4ce
+2040456e
+9a26fc00
+20407475
+18079600
+202044b5
+204044bd
+243a44c6
+6fe104cc
+1fe0ffff
+67e10520
+20404552
+6fe104cc
+67e1051e
+2040454c
+196097ff
+20404538
+20204494
+6fe08522
+202044be
+6fe0851b
+203644c1
+1fe0fffe
+20600000
+1fe0fff0
+20600000
+6fe104cc
+67e10520
+202044ca
+6fe104cc
+1fe0ffff
+67e10520
+202044ca
+20344528
+20404552
+2020455c
+18c22200
+6fe1430a
+1fe0a5fd
+20404072
+470fc023
+204044ec
+6849436f
+204040b2
+2422c4ea
+205444e6
+20740000
+6fe0c2f6
+c30244e1
+6849436f
+6fe14307
+98467c00
+2422c4e1
+204044ec
+243444e1
+2020446e
+18002201
+20404535
+58000013
+e7e08005
+20600000
+18c08dfe
+efe10006
+c287c46e
+202074ca
+7001b401
+2020452a
+47104024
+204074ca
+6fe0c2d3
+c1000000
+6fe0c040
+c3820000
+202074c8
+18c0a202
+6fe1430a
+1fe0a5fb
+20404072
+202044f8
+6fe1430a
+1fe22200
+20404535
+58000017
+e7e08005
+6fe1436f
+e7e10005
+6fe1430a
+1fe0f3fb
+6fe1430e
+1fe08c07
+efe10006
+e7e10005
+2020740c
+18002201
+20404535
+58000019
+e7e08005
+20600000
+6fe0c36d
+793ffe00
+67e0c36d
+20600000
+18c22200
+6fe1430a
+1fe0a5fd
+20204072
+18422600
+1a20a203
+20404535
+1a20a3fd
+5800001b
+e7e08005
+1a620400
+e0410005
+20600000
+6fe0c36d
+79207e00
+67e0c36d
+18422600
+1a20a203
+20404535
+1a20a3fd
+5800001d
+e7e08005
+1a620400
+e0410005
+20600000
+4710c024
+7001b40a
+18002205
+20404535
+58000001
+e7e08005
+6fe0c36e
+e7e08005
+6fe1436f
+e7e10005
+6fe081b4
+e7e08005
+20600000
+47114024
+18002404
+2020419f
+684904cc
+18408401
+604904cc
+20600000
+684904cc
+6fe10508
+98467c00
+20600000
+4711c024
+6848850a
+da20050b
+6fe08522
+1fe27200
+98467c00
+24628000
+da400523
+20207477
+6848c28f
+da204290
+20204543
+47124024
+6fe0851b
+67e084f6
+1fe27200
+204073ba
+2020740c
+4712c024
+204073b7
+6fe1051e
+e7e10005
+6fe10520
+e7e10005
+6fe084f6
+1fe27200
+2040740c
+202073bd
+47134024
+204073b7
+204041c5
+18a27e00
+98c62200
+204041c8
+1a227e00
+e7e10006
+1a20a204
+204041ba
+1a227e00
+e7e08006
+20600000
+1fecfe00
+67e10506
+efe10006
+67e10508
+20600000
+4713c024
+6fe142b8
+1fe0fffe
+684942b6
+184085fe
+204074be
+d84000f0
+204074be
+20600000
+47144025
+204073c0
+d8a0050a
+6fe1430a
+1fe0fffb
+e7e08005
+1fe27200
+204073ba
+2020740c
+6fe1004b
+c1820000
+6fe0c36d
+79207e01
+67e0c36d
+6fe1804d
+67e1c36e
+7920000f
+c009459b
+c02945a0
+c00c4506
+c0014346
+c00f450b
+793f800f
+6fe0c36d
+793ffe01
+67e0c36d
+20600000
+6fe0c36d
+c4008000
+7920000f
+204045ab
+204045b1
+2054458e
+6fe0c36e
+c00944d1
+20600000
+204045a0
+2020459d
+204045b1
+24740000
+202044d1
+4714c025
+204045a4
+da200050
+20204072
+6fe08048
+1fe0a5f9
+1fe0fffc
+67e1430c
+68490049
+6049430a
+20600000
+6a408048
+6fe1430c
+9a408400
+6049430c
+da200049
+20204072
+204074ca
+6fe1430c
+6849430a
+98467c00
+24628000
+202074c8
+efe08006
+e8408006
+e8410006
+c009c5bc
+20600000
+efe10006
+67e14311
+7004c340
+20206f7b
+da20000c
+da600012
+204045c8
+58000008
+e7e10005
+6fe442a8
+e7e40005
+20600000
+204045d0
+da400005
+2040419f
+1a627e00
+e7e08005
+6fe0c310
+e7e08005
+20600000
+6fe0c310
+1fe0fe01
+67e0c310
+c1800000
+70431001
+20600000
+6fe0c2d3
+c00045db
+c000c5de
+c00145e0
+20600000
+70428900
+70428703
+20600000
+70428905
+202045dc
+70428905
+70428700
+20600000
+efe08006
+c000c5f5
+c001c616
+c0024625
+c002c630
+c003c680
+c0044670
+c004c67c
+c0054680
+c005c680
+20600000
+18002202
+204046c0
+5800000b
+e7e08005
+6fe0c289
+e7e08005
+20600000
+67e0c27f
+efe30006
+e7e30005
+6fe0c2d3
+c0004636
+20404611
+7042d103
+6fe0c280
+c0004603
+c000c603
+c001c603
+6fe0c2d3
+c0014606
+c1418000
+dfe00000
+67e242d4
+20600000
+6fe0c2f6
+c280460f
+da2042d4
+1a220a00
+df200003
+204074e4
+6fe142d6
+1fe17e07
+67e142d6
+7004c334
+20206f7b
+18002207
+204046c0
+6fe3c286
+e7e38005
+20600000
+7042d105
+d8a0425d
+204073d2
+6fe0c2d3
+c002461c
+2020461e
+7004c343
+20206f7b
+7042d106
+20406d45
+18002211
+204046c0
+58000003
+e7e08005
+20206e91
+18c22200
+1a220c00
+20406d3d
+2022c638
+7001b504
+18002202
+204046c0
+58000005
+e7e08005
+6fe081b5
+e7e08005
+47154025
+18000e07
+2040741f
+7042d100
+7004c330
+20206f7b
+7001b505
+2020462a
+20406d39
+7004c331
+20406f7b
+70425c01
+7042d109
+18002211
+204046c0
+58000004
+e7e08005
+d8c0426d
+202073d2
+18002211
+204046c0
+58000006
+e7e08005
+6fe0c2f6
+c280c64b
+d8c0424c
+202073d2
+d8c042f7
+202073d2
+d8a042d8
+1800720a
+204074e4
+1800220b
+204046c0
+58000007
+e7e08005
+6fe142d8
+e7e10005
+6fe442da
+e7e40005
+20600000
+18002211
+204046c0
+58000008
+e7e08005
+58000000
+e7e40005
+e7e40005
+20600000
+18002208
+204046c0
+58000009
+e7e08005
+6fe0c2a7
+e7e08005
+6fe342b0
+e7e30005
+20600000
+7001b508
+2020462a
+6fe0c28b
+6848c28b
+98417e00
+20600000
+d8a042e2
+204073d2
+2040466c
+2fec0001
+2020c66a
+20600000
+204074ca
+6fe0c2a0
+c1000000
+6fe0c284
+c4008000
+202074c8
+2040466c
+2fec0001
+2020c66a
+20600000
+20600000
+6fe0c2d1
+c17f8000
+d8400003
+98467c00
+24610000
+d8e00007
+2040742e
+247a0000
+2020466a
+4715c025
+204041cc
+247a0000
+6fe0c2d1
+c0004697
+c000c69d
+c0014697
+c001c69f
+c004c6a3
+c005c6ae
+c00646b0
+c006c6b7
+20600000
+6fe0c2d2
+c1820000
+7042d2ff
+7042d1ff
+7004c33f
+20206f7b
+7042d102
+202045ee
+7042d104
+58017700
+d8e00007
+20207420
+6fe0c2d2
+c00246a6
+20600000
+6fe0c2d3
+c283c6ac
+7042d10b
+20404643
+7004c329
+20206f7b
+7042d10c
+202046aa
+7042d10c
+2020464d
+6fe0c285
+6848c28c
+98417e00
+2fec0001
+2020c6b9
+7042d10d
+20204659
+20404661
+202046b9
+47164025
+18000e07
+2040741f
+7042d2ff
+7042d1ff
+7004c33e
+20206f7b
+47174025
+18002406
+2020419f
+6fe08049
+c00046da
+c000c6e2
+c00146ea
+c001c6ee
+c002470c
+c002c711
+c0034715
+c003c71a
+c004471b
+c004c71c
+c005471d
+c005c721
+c0064722
+c006c724
+c0094725
+c009c726
+c00a4727
+c00ac729
+c00b4734
+c00c4735
+6a608049
+20204758
+efe48006
+67e4819a
+efe10006
+67e10183
+6fe08163
+79207e05
+67e08163
+20600000
+efe28006
+67e2819a
+efe10006
+67e10183
+6fe08163
+79207e06
+67e08163
+20600000
+58000014
+67e10191
+67e142ca
+20600000
+efe40006
+67e442da
+efe10006
+67e142d8
+efe40006
+67e442ba
+efe20006
+67e24410
+20404745
+4717c025
+6fe0c2d1
+c004c700
+6fe0c2f6
+c280c703
+6fe0c3b3
+245a6b4d
+6fe0c25c
+c0004708
+7042d201
+20404753
+20206d4b
+70425c01
+d8c042f7
+d8a0424c
+204073d2
+20204700
+7042d200
+7042d100
+7004c341
+20206f7b
+efe40006
+67e442c2
+efe20006
+67e24414
+20206d4b
+6fe08163
+79207e04
+67e08163
+20600000
+20748000
+7004c332
+20406f7b
+7042d204
+20204756
+20600000
+2020475d
+20600000
+7042d202
+20404764
+7004c333
+20206f7b
+20600000
+20748000
+20204766
+20600000
+20204772
+20600000
+20404729
+20204776
+efe40006
+67e4437c
+6fe1437c
+68494388
+204074be
+67e1437c
+6fe14380
+68494384
+204074be
+67e14380
+20600000
+2020477c
+efe10006
+67e1019a
+efe10006
+67e10183
+207a0000
+6fe08163
+79207e07
+67e08163
+20600000
+da600013
+da200002
+da400002
+20404199
+1a627e00
+e7e08005
+20600000
+d8a042c2
+18007208
+204074e4
+d8a04414
+18007204
+204074e4
+da20000d
+da400004
+20404199
+6fe442c2
+e7e40005
+6fe24414
+e7e20005
+20600000
+7042d205
+da400005
+20204786
+da400006
+20204786
+da200002
+da400007
+20404199
+e2608005
+20600000
+da200009
+da400009
+20404199
+6fe44372
+1fe1fe01
+e7e40005
+20600000
+da40000b
+20204786
+da200006
+da40000c
+20404199
+6fe2c120
+e7e28005
+20600000
+da200002
+da40000d
+20404199
+58000006
+e7e08005
+20600000
+da400013
+20204786
+da400014
+20204777
+da400015
+da200009
+20404199
+6fe44384
+e7e40005
+20600000
+da200003
+da400017
+20404199
+6fe0c37a
+1fe17e07
+e7e08005
+6fe0c37b
+1fe17e07
+e7e08005
+20600000
+da200001
+20204199
+47184026
+c513ca1e
+20204c62
+4718c026
+7844fc00
+7843fc00
+58555555
+98001e00
+6fe0c4d8
+20203d0c
+47194026
+6fe0c502
+20403ce0
+6fe244da
+98001200
+20403925
+6848c4d8
+20403d11
+2040478b
+c597c79f
+783cfc00
+2000001e
+2040478b
+7857fc00
+7826fc00
+7830fc00
+78507c00
+78287c00
+6fe144d6
+98003600
+37c18400
+242c47f9
+204065a4
+c517c7ae
+6fe0c515
+243a47ae
+7846fc00
+7825fc00
+7823fc00
+7824fc00
+204047f6
+67e0c4f8
+6848c4f7
+98467c00
+2422c801
+4719c026
+7858fc00
+280ffe2f
+2040c7e8
+2038c803
+204047f6
+67e0c442
+c513c7c1
+6fe0c442
+6848c4d4
+a8400e00
+2420c805
+204047f6
+280ffe2f
+2040c7f1
+e7e08005
+1fe97e00
+1fe67c1f
+24214807
+1fe27200
+2022c7cd
+204047f6
+e7e08005
+c20047ca
+c513c7d2
+18a22200
+204047f6
+67e0c51e
+1a220a00
+09800018
+1fef7e00
+1ff17e00
+e7e18005
+6fe0c515
+243a47e6
+7845fc00
+280ffe27
+2040cc37
+20234809
+204065a3
+471a4026
+7837fc00
+20403dfc
+c6138000
+6fe0c51e
+6848c575
+98467c00
+204174c0
+20204c3a
+7846fc00
+202047d9
+204047f6
+1fe67c01
+202174d0
+1fe0fffe
+c513c7ef
+203a74d0
+1fe0ffff
+67e084cc
+20600000
+1fe17e07
+684884cc
+18498400
+9841fe00
+20600000
+09800008
+19897e00
+20600000
+70451601
+280ffe27
+2040cc52
+471ac026
+20403d00
+784dfc00
+7845fc00
+202038cc
+70451602
+202047fc
+70451603
+202047fc
+70451604
+202047fc
+70451605
+202047fc
+70451606
+202047fc
+20403925
+6848c4d8
+202039c9
+471b4026
+6fe0c503
+20403ce0
+6fe244da
+98001200
+2040478b
+2040480b
+79202a00
+782efc00
+78307c00
+7850fc00
+204065aa
+785d7c00
+c517c840
+c516c852
+19317e00
+1fecfe00
+1ff1fe00
+08008628
+471bc026
+c517c827
+6fe0c515
+243a4827
+784efc00
+782dfc00
+7823fc00
+7824fc00
+6fe0c4d5
+98007200
+d8c04484
+efe08006
+08008608
+c200482c
+78247c00
+08008618
+78447c00
+c597c836
+7843fc00
+58000000
+08008603
+37d38200
+20000064
+785d7c00
+784efc00
+6fe0c515
+243a483d
+784dfc00
+785c7c00
+20403925
+202065a8
+df20000a
+5800003c
+08008608
+c2004841
+784efc00
+783c7c00
+19317e00
+1ff17e00
+1ff1fe00
+08008620
+c517484f
+58000001
+08008605
+783d7c00
+20204821
+58000000
+08008605
+20204821
+6fe0c11d
+1fe37200
+20000002
+c2004854
+19317e00
+1fecfe00
+1ff18400
+18427e00
+08008608
+18427e00
+08008628
+20204821
+471c4027
+6fe0c503
+c281487f
+6fe0c4d3
+1fe0fe03
+67e0c4d5
+6fe0c4f7
+67e0c484
+6fe0c4d4
+e7e08005
+6fe0c4d3
+1fe9fe00
+6848c4c9
+18410403
+18438400
+9841fe00
+6848c4ca
+9840fe00
+e7e08005
+6fe0c4d3
+98007200
+d8c04464
+20407419
+471cc027
+c6938000
+6fe08030
+e7e08005
+6fe0c503
+c3810000
+6fe0c4d5
+1fe0fe01
+67e0c4d5
+20600000
+6fe0c4d3
+1fe0fe04
+c593c883
+1fe0fe01
+67e0c4d5
+6fe0c4f7
+67e0c484
+6fe0c4d5
+1fe0fffe
+e7e08005
+6fe0c4d4
+e7e08005
+58000000
+20204869
+471d4027
+6fe0c443
+1fe97e00
+67e0c4c8
+1fe0fe01
+d8c04443
+98c08c00
+efe18006
+67e1c4cb
+6fe0c443
+1fe37e00
+1fe17e03
+67e0c4d1
+20600000
+471dc027
+6848c4d9
+204048a0
+6048c4d9
+20600000
+471e4027
+204048a5
+18408401
+18410403
+20600000
+471ec027
+6fe0c4da
+1fe17e03
+1fefa204
+580044de
+9a20fe00
+98408c00
+efe08006
+67e0c4d8
+20600000
+67e244da
+471f4027
+da200000
+df200004
+d8c044da
+efe08006
+9a20a200
+c20048b4
+1a227e00
+67e144f5
+6fe0c4f5
+6848c4f6
+9840fe00
+67e0c4f7
+20600000
+471fc027
+204074ca
+684a44ee
+1c427e00
+98467c00
+244148ce
+1fe22400
+6fe244ee
+6848c4f2
+98408400
+1a427e00
+98467c00
+24610000
+793ffe1c
+67e244ee
+202074c8
+20628000
+79207e1c
+20600000
+58000000
+67e244ee
+20600000
+47204028
+38001300
+3805908b
+380b6150
+380c3d20
+67e4c4de
+38003a1a
+3804c453
+3808d312
+380c0001
+e7e38005
+6fe0c504
+207a0000
+d8c04505
+d8a044de
+202073d2
+4720c028
+584e001e
+67e1c506
+58032303
+e7e18005
+58250642
+e7e18005
+58094c06
+e7e18005
+583c0927
+e7e18005
+70450401
+20600000
+47214028
+d8406978
+c513c8f8
+d84012c0
+6fe0c502
+c30148f8
+d8402ee0
+604944d6
+20600000
+70450201
+70450301
+20600000
+70450202
+70450302
+20600000
+4721c028
+70451b4e
+58101520
+67e1c517
+58000005
+e7e08005
+20600000
+da604523
+da404cdb
+20204dd3
+79200026
+6fe0c547
+793ffe02
+79207e01
+67e0c547
+58000000
+67e14529
+6fe14521
+67e14523
+70452000
+2040494f
+7044c900
+6fe0c51b
+67e0c4d8
+6fe0c51c
+67e0c116
+6fe24517
+202048af
+47224028
+70452d00
+6fe14525
+1fe0fe01
+67e14525
+6fe0c525
+1fe17eff
+247a0000
+6fe0c51f
+c07fc971
+c000c92b
+c001492d
+c001c933
+c0024939
+20600000
+704464ff
+2020493a
+6fe0c4f9
+203a4931
+6fe2454f
+204048af
+704464aa
+2020493a
+70446455
+6fe0c4f9
+203a493a
+6fe24533
+67e24466
+2020493c
+70446422
+6fe2454f
+67e24466
+6fe0c4d4
+1fe17e07
+67e0c465
+70446a00
+7044d307
+2040485e
+20404cb0
+246c0000
+24778000
+20404bef
+20404ccf
+4722c028
+6fe0c51f
+c17f8000
+c000c954
+c0014956
+c001c95c
+c0024964
+20600000
+70451f02
+6fe0c4f9
+207a0000
+70451f01
+20600000
+70451f02
+20204cab
+6fe0c4f9
+203a495a
+6fe244aa
+67e24533
+70451f03
+20204cab
+6fe0c4f9
+203a4962
+6fe244aa
+684a454f
+98467c00
+24628000
+70451f04
+20204cab
+6fe0c4f9
+203a496a
+6fe244aa
+684a4533
+98467c00
+24628000
+70451fff
+7004c339
+20406f7b
+58000000
+67e14523
+6fe244aa
+204048af
+6fe0c547
+793ffe01
+67e0c547
+20204cab
+70456101
+70456000
+20600000
+6fe0c560
+c3808000
+79207e01
+67e0c560
+58000000
+67e1c51e
+67e0c529
+67e0c52a
+67e24577
+70455c01
+20204915
+70455c01
+7044d308
+d8c04521
+d8a04464
+202073cc
+47234028
+20404a39
+20404792
+2437ca39
+20404997
+20404a6c
+20404a14
+2040521d
+6fe0c4f9
+207a0000
+6fe24577
+207a0000
+202048af
+20404a39
+202047fc
+70456d05
+d8c04442
+d8a04533
+204073cc
+4723c028
+6fe0c535
+c05549a2
+c02ac9b3
+c01149d4
+c07fcc0e
+20600000
+6fe0c536
+c000c9a6
+c00149ae
+20600000
+6fe0c529
+247a0000
+70451e01
+70452101
+70452280
+6fe3443c
+67e34523
+20600000
+6fe0c52a
+247a0000
+70451f01
+70452102
+202049aa
+6fe0c4f9
+203a49b9
+6fe24537
+684a443c
+98467c00
+24628000
+6fe0c536
+c000c9bd
+c00149ca
+20600000
+6fe0c529
+247a0000
+6fe0c51e
+c000c9c2
+20600000
+70451e02
+6fe0c4f9
+203a49a9
+70452101
+70452280
+6fe24577
+67e24523
+202074c8
+6fe0c52a
+247a0000
+6fe0c51f
+c000c9cf
+20600000
+70451f02
+6fe0c4f9
+203a49b1
+70452102
+202049c6
+6fe0c4f9
+203a49da
+6fe24537
+684a4577
+98467c00
+24628000
+6fe0c536
+c000c9de
+c00149ec
+20600000
+6fe0c529
+247a0000
+6fe0c51e
+c00149e3
+20600000
+70452901
+20404a08
+204049a9
+6fe0c520
+1fe1fe01
+67e0c520
+58000000
+67e1451e
+20600000
+6fe0c52a
+247a0000
+6fe0c51f
+c08049f1
+20600000
+70452a01
+20404a0e
+204049b1
+6fe0c520
+1fe1fe02
+67e0c520
+204049e9
+20205217
+6fe0c561
+c1808000
+6fe0c55b
+247a0000
+6fe0c445
+c000ca01
+c0014a05
+20600000
+6fe0c576
+c4000000
+7857fc00
+20600000
+6fe0c576
+c4008000
+20204a03
+6fe0c55b
+247a0000
+6fe0c576
+1fe1fe01
+67e0c576
+20600000
+6fe0c55b
+247a0000
+6fe0c576
+1fe1fe02
+67e0c576
+20600000
+6fe0c520
+207a0000
+6fe0c536
+c000ca08
+c0014a0e
+20600000
+79200027
+6fe0c116
+67e0c56e
+20204c45
+6fe1452b
+20207487
+47244029
+7044d300
+6fe0c55c
+207a0000
+6fe1452d
+20207487
+20404a69
+2437ca39
+20404a5b
+24344a39
+6fe0c4c8
+203a4a39
+1fe0fe02
+98007200
+d8c04442
+d8a04533
+20407419
+70455e00
+6fe0c55b
+205a4a76
+4724c029
+6fe0c535
+c000ca3f
+c0014a4e
+c07fca3d
+47254029
+d8a04442
+df200042
+202073ec
+20404a16
+20204c0e
+20404a08
+20404ba2
+6fe0c555
+6848c533
+284ffe03
+7920fe00
+67e0c555
+c000ca54
+6fe0c55d
+6848c533
+284ffe04
+7920fe00
+67e0c55d
+6fe1452f
+20207487
+20404a0e
+6848c533
+284ffe03
+2020ca59
+6fe14531
+20207487
+6fe0c095
+1fe67c0c
+2042cebb
+6fe2453d
+20204c14
+6fe2453d
+20204c18
+204074ca
+6fe0c4d1
+6848c4d2
+98467c00
+2442f4c8
+6fe0c4d1
+67e0c4d2
+6fe1c4cb
+6849c4ce
+98467c00
+2442f4c8
+6fe1c4cb
+67e1c4ce
+20600000
+20404a39
+20404792
+24778000
+6fe0c442
+67e0c4d4
+2040488d
+6fe0c443
+2feffe00
+2020ca75
+20404a20
+2040485e
+2040480e
+202047fc
+70455f01
+58000280
+d8e00008
+20207420
+4725c029
+70455e01
+70456200
+7044f2ff
+202048d1
+47264029
+6fe0c55e
+207a0000
+204048be
+24740000
+20404a8c
+6fe0c562
+1fe0fe01
+1fe17e01
+67e0c562
+c0004a91
+c000ca94
+20600000
+6fe0c56d
+207a0000
+1fe0ffff
+67e0c56d
+20600000
+6fe0c56d
+247a0000
+20204ad6
+6fe0c56d
+247a0000
+20204975
+6fe0c575
+247a0000
+6fe0c573
+205a4ac5
+6fe0c570
+c3800000
+79207e00
+67e0c570
+70456f01
+70457400
+58000000
+67e14571
+7044f260
+202048d1
+4726c029
+6fe0c561
+c1000000
+6fe0c575
+247a0000
+6fe0c573
+247a0000
+6fe0c56f
+207a0000
+204048be
+24740000
+6fe14571
+1fe0fe01
+67e14571
+d84007d0
+98467c00
+20214ac1
+20404a8c
+6fe0c574
+1fe0fe01
+1fe17e01
+67e0c574
+c0004abe
+c000c975
+20600000
+6fe0c56d
+243a4975
+20204b88
+70457301
+20204b88
+70456f00
+20600000
+70456f01
+20600000
+47274029
+6fe0c560
+c3800000
+79207e00
+67e0c560
+6fe0c56e
+67e0c116
+70455c00
+7007ab00
+70455501
+7044c900
+6fe2443c
+204048af
+2040489b
+20204a39
+70455c00
+70456100
+70456000
+20600000
+6fe0c561
+c1800000
+20404ac7
+20404b8c
+20204a26
+4727c029
+6fe0c561
+c1808000
+20404978
+20404988
+6fe0c55b
+247a0000
+6fe0c520
+207a0000
+70455e00
+20404ad6
+20404a76
+202048d1
+6fe0c560
+c3838000
+79207e07
+67e0c560
+70456200
+70455c01
+58000000
+67e1c588
+67e3c565
+20404b7a
+24628000
+6fe0c4d9
+67e0c564
+6fe0c4d8
+67e0c563
+20600000
+4728402a
+6fe0c561
+c1838000
+20404aec
+20404b22
+20404a69
+2437ca39
+20404b7a
+2042ca28
+6fe0c555
+205a4ac3
+70456100
+6fe0c560
+79207e00
+67e0c560
+6fe0c55c
+1fe67c02
+2442cb78
+20404a39
+20404a76
+20404b7a
+2022cb1b
+6fe244da
+684a457f
+98467c00
+2022cb1e
+6fe244da
+684a457b
+98467c00
+2022cb20
+20600000
+6fe0c564
+67e0c4d9
+20600000
+6fe0c56a
+20204b1c
+6fe0c567
+20204b1c
+4728c02a
+6fe0c562
+1fe0fe01
+1fe17e03
+67e0c562
+c0004b46
+c000cb60
+c0014b2c
+c001cb60
+20600000
+204049a9
+6fe2457b
+203a4b22
+204048af
+6fe0c568
+205a4b41
+6fe0c566
+67e0c4d8
+6848c589
+6a21458f
+20404c1a
+6048c589
+20404c23
+6048c586
+18467c50
+24610000
+6848c567
+204048a0
+6048c567
+67e0c566
+20600000
+70456801
+d8400000
+204048a5
+67e0c566
+20600000
+204049b1
+6fe2457f
+203a4b22
+204048af
+6fe0c56b
+205a4b5b
+6fe0c569
+67e0c4d8
+6848c58a
+6a214591
+20404c1a
+6048c58a
+20404c23
+6048c587
+18467c50
+24610000
+6848c56a
+204048a0
+6048c56a
+67e0c569
+20600000
+70456b01
+d8400000
+204048a5
+67e0c569
+20600000
+204049a9
+6fe2443c
+204048af
+6fe0c565
+205a4b74
+6fe0c563
+67e0c4d8
+6848c588
+6a21458d
+20404c1a
+6048c588
+20404c23
+6048c585
+18467c50
+24610000
+6848c564
+204048a0
+6048c564
+67e0c563
+20600000
+70456501
+6fe0c563
+67e0c4d8
+20600000
+70455c00
+20600000
+6fe244da
+684a443c
+98467c00
+20600000
+6fe0c55c
+c1010000
+6fe0c55f
+207a0000
+d8e00008
+2040742e
+247a0000
+70455f00
+70456d00
+20404a97
+4729402a
+70456107
+70456000
+20204a39
+4729c02a
+6fe0c555
+c000cc59
+6fe0c55d
+c000cba0
+684a4556
+1c427e00
+98467c00
+244148ce
+1fe22400
+6fe24556
+6848c55a
+98408400
+1a427e00
+98467c00
+24610000
+793ffe1c
+67e24556
+70455501
+2020489b
+70455d00
+2020489b
+1c427e00
+67e24556
+20600000
+da604529
+da404cdb
+20204dd3
+472a402a
+79200026
+6fe0c547
+793ffe01
+79207e02
+67e0c547
+6fe0c52e
+203a4bbd
+6fe0c52d
+c000cbb5
+c0014bb5
+c001cbc4
+c0024bc4
+6fe0c51c
+67e0c116
+6848c537
+6048c4d9
+6fe2452f
+20404bce
+6048c537
+20600000
+70411603
+6848c538
+6048c4d9
+6fe24533
+20404bce
+6048c538
+20600000
+70411603
+6848c539
+6048c4d9
+6fe2454f
+20404bce
+6048c539
+20600000
+6fe244aa
+207a0000
+67e24533
+204048af
+2020489b
+472ac02a
+6fe1452b
+d84001f8
+98417e00
+203a4bd9
+6fe1452b
+1fe0fe01
+67e1452b
+20600000
+20404bf3
+20404cb0
+242c4bfa
+2437cbfa
+20404ccf
+6fe24517
+684a44da
+98467c00
+2022c90a
+6fe2454f
+684a44da
+98467c00
+2042cbcb
+6fe0c547
+793ffe02
+67e0c547
+58000000
+67e14523
+67e1452b
+67e14529
+7004c33c
+20406f7b
+472b402a
+df200004
+d8a04464
+202073dd
+704464ff
+6fe0c4d4
+67e0c465
+6fe2454f
+67e24466
+7044d306
+2020485e
+6fe0c52e
+203a489b
+6fe1452b
+1fe0fe01
+67e1452b
+2feffe09
+6fe0c52d
+c000cc06
+c0014c08
+c001cc0a
+c0024c0c
+20204bbd
+2020cbbd
+20204bb5
+2020cbc4
+20204bb5
+2020cbc4
+20204bbd
+2020cbc4
+20204915
+6fe0c536
+c000cc12
+c0014c16
+20600000
+6fe24537
+67e24577
+67e2457b
+20600000
+6fe24537
+67e24577
+67e2457f
+20600000
+472bc02a
+1a227e00
+98408a00
+6fe08009
+e7e08005
+18408401
+6fe0c51d
+98410400
+20600000
+472c402b
+6fe0c51d
+1fe0fe01
+67e104ef
+1fe27200
+1a220c00
+dfe00000
+e8408006
+9840fe00
+c2004c2a
+684904ef
+9846fc00
+20407475
+18078400
+c6138000
+18427e00
+c6930000
+20403a68
+1fe20400
+20600000
+20203a49
+6fe1453b
+20204c4c
+1fe22200
+6848c53a
+6fe1453b
+98408a00
+1a227e00
+e7e08005
+18408401
+6fe0c51d
+98410400
+6048c53a
+20600000
+6fe1458b
+20404c4c
+6fe1458d
+20404c4c
+6fe1458f
+20404c4c
+6fe14591
+207a0000
+1fe20a00
+6fe0c51d
+1fe0fe01
+1fe27200
+202073ec
+20404c37
+207a0000
+6848c584
+6a21458b
+20404c1a
+6048c584
+20600000
+6a21458b
+20404c23
+6048c583
+18467c50
+24610000
+2020489b
+6fe2443c
+67e2454f
+20204c38
+c6930000
+6fe0c547
+c280c91c
+c2814bd0
+6fe0c563
+c000cd21
+472cc02b
+20404c84
+24344d00
+20404c99
+20404d49
+6fe0c095
+c0045d98
+6fe44556
+67e444fa
+6fe14568
+67e1456a
+6fe14543
+20207487
+472d402b
+20404d15
+24740000
+20404d1f
+204074e0
+6fe1c553
+20204c81
+472dc02b
+20404d15
+24740000
+20404d1f
+6fe444fa
+20407464
+604a40aa
+20203b47
+20404c87
+24740000
+2020485e
+6fe1453d
+20407487
+20344c8d
+6fe3c465
+207a0000
+202074c8
+70454d00
+1a20fe01
+67e0c4d3
+20404c95
+67e0c464
+1a420c00
+1a227200
+20207419
+6fe0c4d4
+1fe17e07
+67e0c4d4
+20600000
+58000000
+67e0c54c
+67e1456d
+20404cb0
+6fe0c4ca
+c000cca5
+242c4cbe
+2437ccbe
+20404ccf
+6fe0c095
+1fe67c08
+2042dfdc
+20404d7b
+20404bef
+6fe0c4c9
+1fe0fe01
+67e0c4c9
+20404cf3
+472e402b
+58000000
+67e0c548
+67e14549
+20600000
+472ec02b
+7857fc00
+2040480e
+6fe0c4ca
+c000c7fc
+18002a00
+6fe244da
+98001200
+68488008
+20403954
+2040396a
+2040479a
+2057c7fc
+20600000
+6fe0c095
+c0844cc3
+6fe0c77f
+247a0000
+20405bf7
+6fe0c54d
+247a0000
+6fe14549
+1fe0fe01
+67e14549
+6fe0c54a
+c2824cd7
+20404cdd
+6fe1456d
+1fe0fe01
+67e1456d
+20204c9c
+472f402b
+2040488d
+6fe0c4c8
+207a0000
+98007200
+d8c04444
+d8a044a8
+20207419
+472fc02b
+58000000
+67e14549
+70454b01
+7004c33a
+20206f7b
+4730402c
+6848c54c
+6fe0c56c
+98467c00
+24214cfb
+18408401
+6048c54c
+6fe0c56c
+c002ccea
+6fe0c54c
+c0034cf5
+c0064cf5
+20600000
+6fe0c54c
+c001ccf5
+c0034cf5
+20600000
+c517ccf1
+67e0c485
+20600000
+67e0c486
+20600000
+6fe0c4d4
+c4020000
+6fe0c4d4
+793ffe04
+67e0c4d4
+20404cee
+20404d7f
+2020489b
+20404d6f
+20404d7f
+2020489b
+6fe1453f
+20207487
+6fe0c54d
+205a4d07
+6fe0c563
+c1008000
+20404cfe
+6fe14545
+20207487
+7044d401
+70454d01
+20404c95
+67e0c464
+58000000
+67e3c465
+6fe2454f
+67e2446c
+7044d30c
+6fe0c4d4
+79207e03
+67e0c4d4
+2040485e
+20204c6b
+4730c02c
+78347c00
+20403b1b
+6fe1c0be
+203a74ca
+6fe0c094
+203a74ca
+6fe0c563
+c000f4ca
+20600000
+6fe14541
+20207487
+204048be
+24740000
+20404d36
+6fe14564
+1fe0fe01
+67e14564
+68494566
+98467c00
+2042cd2b
+20204c68
+70456300
+58000000
+67e14564
+58000064
+67e14566
+70456200
+6fe0c4f3
+67e0c4f2
+20600000
+6fe0c4f4
+20204d32
+6fe0c562
+1fe0fe01
+67e0c562
+c0024d34
+c002cd30
+20600000
+70456301
+58000000
+67e14564
+20600000
+df200002
+d8c044da
+204074c8
+5800ffff
+e8410006
+98467c00
+2442f4ca
+c2004d44
+20600000
+4731402c
+6fe0c3f0
+247a0000
+6fe14434
+c3858000
+6a21453b
+20404c23
+6048c56f
+6fe0c574
+c5134d54
+6fe0c577
+98467c00
+24214d6e
+6fe0c571
+1fe67c02
+24214d5c
+6fe0c571
+c0004d6f
+20600000
+6fe0c571
+6848c572
+98467c00
+24628000
+70457100
+6848c56f
+6fe0c573
+c5134d65
+6fe0c576
+98467c00
+24610000
+6fe0c570
+c0004d76
+1fe0ffff
+67e0c570
+c0004d76
+70411600
+20600000
+70457100
+6fe0c570
+c0014d74
+1fe0fe01
+67e0c570
+c000cd6c
+70411606
+20600000
+70411685
+20600000
+70457001
+70457100
+20600000
+6fe0c571
+1fe0fe01
+67e0c571
+20600000
+6fe0c571
+1fe67c02
+24414d87
+6fe0c571
+c1000000
+1fe0ffff
+67e0c571
+20600000
+70457103
+20600000
+44b8400e
+6fe0c095
+203a4d89
+c00250b8
+c004e028
+c00561ec
+c004522c
+20600000
+20758000
+20406bdd
+6fe0c095
+c004e157
+c0056157
+c00250c3
+c0045275
+20600000
+20406ec0
+20406f91
+20404da0
+6fe14394
+20207487
+6fe14392
+20207487
+44b8c00e
+da20441e
+204074a5
+207a0000
+1fe22600
+20404da9
+20204dad
+da600000
+20600000
+c0084dbc
+c00a4db3
+c00acdb7
+20600000
+6fe14396
+20207487
+6fe1438c
+20207487
+6fe14390
+20207487
+6fe14434
+79207e09
+67e14434
+20600000
+70436d00
+6fe14434
+793ffe09
+67e14434
+20204e19
+6fe143aa
+79207e00
+67e143aa
+20600000
+67e081dc
+44b9400e
+6fe081dc
+207a0000
+1fe0ffff
+67e081dc
+20406ecc
+20404dfa
+20406957
+6fe1439c
+20407487
+20204dc1
+efe08013
+207a0000
+1fe0ffff
+e7e08013
+247a0000
+1a427e00
+20207487
+efe10013
+207a0000
+1fe0ffff
+e7e10013
+247a0000
+1a427e00
+20207487
+684943e2
+1840a601
+da404dde
+20204dcc
+20404e2f
+c000cde1
+20204e13
+58000002
+e7e08013
+1840a408
+efe10012
+20207487
+20404de8
+20204e13
+58000000
+67e143a8
+20600000
+58000000
+67e143aa
+20600000
+6fe143aa
+79207e07
+67e143a8
+58000000
+67e143aa
+20600000
+d8e00009
+20203c21
+d8e00009
+20203c25
+7043a605
+20204df4
+da6043a6
+da404df6
+20204dcc
+7004c30f
+20206f84
+7004c310
+20206f84
+7004c30e
+20206f84
+7004c30d
+20206f84
+7004c317
+20206f84
+7004c318
+20206f84
+7004c316
+20206f84
+7004c311
+20206f84
+7004c315
+20206f84
+7004c314
+20206f84
+7004c313
+20206f84
+7004c319
+20206f84
+7004c31f
+20206f84
+7920000d
+20600000
+793f800d
+20600000
+20404e2f
+c0014e25
+58000001
+e7e08013
+1840a203
+1840a406
+e8408011
+1a60a601
+e0408013
+20204de4
+58000000
+e7e08013
+6fe14434
+c304ce2b
+2040473e
+20404e0b
+684943e2
+1840a202
+1840a404
+20204e21
+684943e2
+1840a600
+efe08013
+20600000
+20404e2f
+c0804e36
+20204e13
+1840a40a
+20204de4
+7046ec02
+70435f01
+58000020
+20406145
+d8a04235
+6fe0c2b0
+1fe104f0
+18518400
+20404e4e
+e0408005
+1fe1040f
+20404e4e
+e0408005
+204040f9
+6f20c22d
+d8a04322
+d8c0422e
+20407419
+6f20c22d
+d8a04342
+d8c0422e
+20207419
+18467c09
+20214e52
+18408437
+20600000
+18408430
+20600000
+6fe0c6b9
+c0ffce64
+6fe0c6b7
+c0ffce67
+6fe0c6c2
+c0ffce69
+6f20c625
+da204626
+1a220c00
+efe08006
+18c22200
+c07fce62
+1fe20400
+20406b96
+c2004e5c
+20600000
+6fe446b9
+67e44628
+20204e56
+67e0c626
+20204e58
+67e0c627
+20204e5a
+2040500a
+20405088
+da200000
+20406caf
+20404e54
+20404ebd
+20404e83
+6fe0c8ef
+1fe27200
+580048f0
+1fe22200
+1a220c00
+efe08006
+18c22200
+c07fce7d
+1fe20400
+67e0c8f4
+20404e7f
+c2004e76
+20600000
+6fe0c8f4
+c17f8000
+98000400
+20206b96
+7046c864
+20600000
+20404e88
+204074e0
+20206c75
+20406fd6
+df200014
+d8c08070
+18c20a00
+efe08006
+c00fce97
+c0104e97
+c010ce97
+c0114e97
+c011ce97
+c0164e97
+c016ce97
+c0004e97
+c2004e8b
+20204e9d
+58000040
+e7e08005
+20204e95
+58000080
+e7e08005
+20204e95
+6fe0c8ef
+1fe27200
+d8c048f0
+efe08006
+79207e07
+d840003e
+20406bbc
+c2004ea0
+20600000
+20206c81
+20404ebf
+20404eaa
+20204ea6
+6fe14434
+c3848000
+6fe0c902
+c000ceaf
+20600000
+6fe0c6e3
+c1008000
+7046e301
+20404eb9
+20404ebb
+20204ed2
+6fe14907
+67e14909
+70490b00
+20600000
+58000000
+20204eb6
+da200000
+20206f0b
+da200000
+20206f10
+6fe14434
+c4048000
+204041cc
+247a0000
+da204611
+20407015
+24740000
+d8c04611
+20206149
+1a627e00
+c016ce33
+c0084e1b
+c00a4ece
+c00aced8
+20600000
+20404eb9
+20404ebb
+793f8027
+20204ed4
+6fe146e4
+67e146e6
+7046c714
+70409400
+20404e01
+20204e17
+79200027
+20404eb5
+20404fbf
+20404fb3
+58000000
+67e2c695
+20406ff8
+7046570a
+7046590a
+70465b0a
+7040c102
+58000020
+20406145
+20204e03
+20404f60
+20404f63
+20404f66
+20404ef3
+20204eeb
+da604903
+da400000
+20204dcc
+da604909
+da404ef1
+20204dd3
+70490b01
+20600000
+da6046e6
+da404ef6
+20204dd3
+7046e302
+70490200
+20204edc
+6fe0c6c1
+207a0000
+da6046c7
+da404efe
+20204dcc
+6fe0c6c6
+67e0c6c7
+6fe0c6ca
+247a0000
+20406c11
+67e146e1
+da2046db
+20406c31
+6848c6c8
+98467c00
+20214f0b
+67e0c6c8
+1fe20400
+6048c6c9
+6fe0c6c3
+98467c00
+20414f16
+6048c6d4
+df200006
+d8c046cf
+20404f1d
+67e0c6d5
+da2046cc
+20206ffd
+6fe0c6cb
+247a0000
+7046cb01
+da200001
+20206f10
+da200001
+20206f0b
+da200000
+efe08006
+9a20a200
+c2004f1e
+1a217eff
+20600000
+6fe0c36e
+c0094f26
+20600000
+6fe1436f
+c00ccf3d
+20600000
+4495c005
+efe28011
+67e28546
+6fe10546
+d8406b5a
+98467c00
+24628000
+6fe10549
+1ff0fe00
+67e10549
+1fe27200
+1a20a205
+1a220c00
+d8a0054b
+20407419
+efe08006
+67e08555
+da200548
+da40054b
+20600000
+58000000
+67e2c64b
+67e2c650
+20404f29
+1a420c00
+d8a0464b
+df20000a
+20407419
+44964005
+efe08011
+c0014f6f
+c001cf84
+c0024f8b
+c002cf8b
+c003cffb
+c0044ffe
+20600000
+20404f3d
+6fe08548
+c0024f53
+c002cf53
+20600000
+6fe0c64b
+245a4f5a
+6fe0c64d
+245a4f5c
+6fe0c64f
+207a0000
+203a4f5e
+7048ec05
+20600000
+7048ed05
+20600000
+7048ee05
+20600000
+da6048ec
+da404f69
+20204dcc
+da6048ed
+da404f6b
+20204dcc
+da6048ee
+da404f6d
+20204dcc
+70464b00
+20204f8b
+70464d00
+20204f8b
+70464f00
+20204f8b
+6fe0c64b
+67e0c656
+6fe0c64c
+67e0c658
+20204f95
+6fe0c64b
+67e0c658
+20204fa3
+6fe0c657
+20404f7c
+6fe0c64c
+67e0c656
+20204fa1
+c0014f80
+c001cf82
+67e0c657
+20600000
+70465705
+20600000
+7046570a
+20600000
+6fe0c64b
+20404f7c
+6fe0c657
+20404fef
+20404ff2
+7004c500
+20206cd4
+6fe0c6e9
+247a0000
+6fe3464b
+67e34656
+6fe0c657
+6848c659
+98417e00
+6848c65b
+98417e00
+205a4fa7
+4496c005
+6fe14434
+2feffe09
+2440ceb5
+20404fa1
+20404fa3
+20204f9c
+6fe0c656
+6848c658
+9840fe00
+243a6fd8
+20206fd6
+d8c04656
+20204fa9
+d8c04658
+20204fae
+d8c0465a
+20204fcb
+7046ca00
+20600000
+efe08006
+c0004fb3
+c000cfb7
+c0014fbb
+20600000
+efe08006
+c0004fbf
+c0014fc3
+c000cfc7
+20600000
+6848c8f0
+20406b92
+6848c8f1
+20206b92
+6848c8f0
+20406b96
+6848c8f1
+20206b92
+6848c8f0
+20406b92
+6848c8f1
+20206b96
+6848c8f2
+20406b92
+6848c8f3
+20206b92
+6848c8f2
+20406b96
+6848c8f3
+20206b92
+6848c8f2
+20406b92
+6848c8f3
+20206b96
+44974005
+efe08006
+c0004fd8
+c000cfd1
+c0014fd3
+20600000
+70467400
+20204fd4
+70467401
+efe08006
+67e0c676
+efe40012
+20204fdd
+efe08012
+20406d17
+1a40a401
+efe08012
+20206d17
+67e44677
+7046ca01
+6fe0c674
+c0004feb
+6fe0c678
+67e0c679
+6fe0c677
+20406d17
+6fe0c676
+20404fef
+67e0c67e
+6fe34679
+67e304c4
+20206cc0
+6fe0c677
+67e0c679
+6fe0c678
+20204fe4
+1feffe05
+1fe0fe32
+20600000
+d8402ee0
+984ffe00
+1fe6fc64
+20407475
+18078400
+18422200
+58002ee0
+98462400
+20600000
+6fe4464b
+67e44695
+20600000
+6fe0c6b2
+67e0c6a8
+6fe0c6b3
+67e0c6a9
+6fe0c6b4
+67e0c6aa
+df20000d
+d8c046a3
+20404f1d
+67e0c6b0
+da2046a0
+20206ffd
+58000000
+67e44521
+20404a1a
+204048f1
+20204a7a
+20405013
+2040501b
+2040505c
+202050ab
+20404a7f
+6fe0c561
+c1808000
+6fe0c903
+243a4ad6
+6fe0c6e3
+c0014ad6
+20600000
+6fe0c561
+c1800000
+2040502a
+2037d028
+6fe0c90b
+207a0000
+6fe0c90c
+1fe0fe01
+67e0c90c
+c0025028
+2040489b
+2040503b
+2437d01f
+70490c00
+20600000
+6fe0c561
+c1800000
+2040502f
+20404b8c
+2020503b
+6fe0c560
+c3800000
+79207e00
+67e0c560
+6fe0c56e
+67e0c116
+70455c00
+7007ab00
+70455501
+7044c900
+6fe24925
+20204ad2
+20404a69
+2437ca39
+20404a5b
+24344a39
+6fe0c4c8
+203a4a39
+1fe0fe02
+98007200
+d8c04442
+d8a04533
+20407419
+70455e00
+6fe0c55b
+205a4a76
+6fe0c535
+c07fd04d
+c000d04f
+20204a36
+20406fd8
+20204c0e
+20404ba2
+6fe0c555
+6848c533
+284ffe03
+7920fe00
+67e0c555
+c000d057
+20204a46
+6fe0c095
+1fe67c0c
+2042efd8
+6fe2453d
+20204c14
+6fe0c561
+c1808000
+20404978
+204050a1
+20404988
+6fe0c520
+243a5069
+20404b7e
+6fe0c55f
+207a0000
+58000000
+67e2457b
+20600000
+70455e00
+da200000
+20406fd8
+20404ad6
+204048d1
+6fe2443c
+67e24925
+6fe0c931
+245a5074
+6fe24925
+202048af
+6fe0c931
+207a0000
+6fe0c578
+67e0c928
+6fe0c43d
+67e0c927
+6fe0c577
+67e0c926
+6fe0c43c
+67e0c925
+20405091
+6fe24925
+684a4929
+98467c00
+20628000
+1a627e00
+da204925
+df200004
+20406883
+20600000
+6fe2443c
+67e24925
+6fe0c931
+207a0000
+20405091
+6fe24929
+207a0000
+67e24925
+20600000
+6fe0c931
+207a0000
+da600700
+1a627e00
+da204929
+d8400004
+204068c5
+6fe2492d
+207a0000
+67e24929
+1a627e00
+d84007cc
+98467c00
+20610000
+1a60a604
+20205094
+6fe2457b
+207a0000
+202048af
+6fe14434
+c3848000
+6fe146e4
+67e146e6
+70490201
+da204536
+20204f4e
+6fe0c90b
+207a0000
+204050b3
+24740000
+6fe1c4fa
+20407464
+604a40aa
+20203b47
+78347c00
+20403b1b
+6fe1c0be
+203a74ca
+20204e87
+580050cc
+67e1452b
+580051b4
+67e1452f
+580051c5
+67e14531
+5800518b
+67e1452d
+580050db
+67e106f3
+2020703f
+4497c005
+204050d1
+7045dc00
+70457600
+20404a1a
+20404900
+204048d4
+20406d2f
+20206d37
+6fe0c55b
+c000517b
+c000d106
+c007d102
+20600000
+44984006
+58001fdf
+da204593
+d8400001
+202068c5
+4498c006
+df200001
+da204593
+dfe01fdf
+20206883
+6fe0c5b3
+c28250df
+6fe0c593
+c0ad50e3
+7045935a
+6ff2137a
+79207e1d
+67e20626
+6fe0c5de
+67e0862e
+204050fc
+2040708d
+204050e9
+202050f2
+6fe086f9
+207a0000
+6fe0c593
+c02d50f0
+6fe206fa
+67e20626
+20600000
+6fe206fe
+202050ee
+6fe0c593
+c02d50f8
+58009272
+67e105fb
+70064a1a
+20600000
+5800928d
+67e105fb
+70064a3f
+20600000
+6fe0c5be
+207a0000
+d8c045be
+d8a006b7
+df20001e
+20207419
+20404ad6
+20405183
+2040513f
+20205103
+20404ad6
+20405183
+20404adf
+2040513f
+20205107
+2040510e
+2040511e
+20205130
+44994006
+6fe0c5b2
+207a0000
+d8e0000d
+2040742e
+247a0000
+7045b200
+58000001
+67e087b1
+58000000
+e7e38005
+7007aa20
+6fe087ab
+79207e02
+67e087ab
+20600000
+4499c006
+6fe0c5b0
+207a0000
+d8e0000e
+2040742e
+247a0000
+7045b000
+d8a007c1
+df200002
+204073dd
+6fe407c1
+67e4459c
+7007c100
+7007a910
+6fe087ab
+79207e01
+67e087ab
+20600000
+449a4006
+6fe0c5b1
+207a0000
+d8e0000c
+2040742e
+247a0000
+7045b100
+d8a007d1
+df200002
+204073dd
+7007d103
+6fe187d1
+67e1c5a7
+7007aa21
+2020511a
+449ac006
+20406d37
+6fe0879f
+205a5195
+20407033
+6fe0887f
+243a5157
+6fe08795
+207a0000
+70079500
+6fe10793
+d84002ba
+98467c00
+24628000
+6fe08713
+c1dd0000
+6fe08714
+c050515c
+c050d162
+c053516e
+c053d170
+c054d176
+70079600
+20600000
+70087f00
+6fe0887d
+207a0000
+6fe106f5
+20207487
+6fe08715
+c040d15f
+20205155
+20404975
+70079601
+20600000
+6fe08715
+c000d167
+c042516a
+c053d16c
+20205155
+6fe0c520
+67e08754
+20205160
+20404ad7
+20205167
+700754a1
+20205160
+70075415
+20205160
+6fe0c561
+c0005174
+c000d16c
+20600000
+700754a0
+20205160
+70075400
+70075500
+70075601
+70075707
+20205160
+20404a7a
+20404a7f
+20404aa5
+20405183
+20404adf
+20404afc
+2040513f
+2020517c
+449b4006
+6fe0c561
+c1800000
+20404ada
+2040510b
+6fe0c55b
+247a0000
+20204b7e
+6fe0c4d4
+c000d18e
+c0015197
+6fe0c5dd
+c280519d
+20205199
+6fe0c095
+c1820000
+7045dd03
+20600000
+7045dd00
+20600000
+6fe0c5dd
+c280d1a1
+6fe0c55c
+c000d1a8
+c001d1ac
+20600000
+6fe0c5dd
+793ffe00
+67e0c5dd
+202051a4
+6fe0c5dd
+793ffe01
+67e0c5dd
+7044d301
+580000ff
+67e0c464
+20600000
+70455c01
+204049f9
+24778000
+20204983
+6fe0c444
+c000d1a8
+c07fd1a8
+70079700
+7044d301
+6fe0c56c
+67e0c464
+20600000
+58000001
+67e087b1
+6fe3c536
+e7e38005
+6fe0c536
+245a51bd
+6fe0c536
+205a51c1
+20205119
+7045b201
+58000180
+d8e0000d
+20207420
+7045b200
+58000000
+d8e0000d
+20207420
+6fe0c536
+c00051ca
+c00151fd
+c001d1e5
+20204a39
+6fe0c538
+67e0c55c
+70453800
+d8a007c1
+d8c04537
+df200008
+20407419
+6fe407c1
+245a51dd
+6fe407c1
+205a51e1
+6fe407c1
+67e44594
+684c459c
+98467c00
+2442d12b
+6fe44594
+67e4459c
+20204a39
+7045b001
+58000180
+d8e0000e
+20207420
+7045b000
+58000000
+d8e0000e
+20207420
+d8a007d1
+d8c04536
+df200003
+20407419
+6fe107d2
+245a51f5
+6fe107d2
+205a51f9
+6fe187d1
+67e1c5a4
+6849c5a7
+98467c00
+2442d13d
+6fe1c5a4
+67e1c5a7
+20204a39
+7045b101
+58000180
+d8e0000c
+20207420
+7045b100
+58000000
+d8e0000c
+20207420
+d8a007e1
+d8c04536
+df200002
+20407419
+6fe107e1
+245a520d
+6fe107e1
+205a5211
+6fe107e1
+67e145aa
+684945ad
+98467c00
+2442d215
+6fe145aa
+67e145ad
+20204a39
+7045b101
+58000180
+d8e0000c
+20207420
+7045b100
+58000000
+d8e0000c
+20207420
+7007aa22
+2020511a
+6fe0c095
+c1820000
+6fe0c593
+c12d0000
+7045dc01
+20600000
+6fe0c095
+c1820000
+6fe0c5dc
+207a0000
+7004cc00
+7045935a
+204050d6
+204050d1
+6fe084cc
+1fe0fe01
+67e084cc
+c07fea09
+6fe0c593
+c0ad5222
+20206a09
+20406eb3
+2040525e
+204057a0
+20758000
+204059bd
+2040562e
+20405cc5
+20405239
+2040583e
+6fe14434
+c2865b08
+20405c3d
+202052eb
+58005fad
+67e14543
+58005fa2
+67e14545
+58005e91
+67e143a2
+58005e31
+67e1453d
+58005e59
+67e1453f
+5800536c
+67e14541
+5800596a
+67e14392
+58005367
+67e14390
+58005912
+67e14396
+58005be9
+67e14394
+5800532c
+67e1438e
+58005952
+67e14398
+58005a1e
+67e1439c
+58005494
+67e143a0
+58005318
+67e1438c
+58005f98
+67e1439a
+58005f9f
+67e1439e
+580059e8
+67e14314
+20600000
+20758000
+20404c5f
+204048d4
+20406024
+20405447
+20405296
+20405ab3
+204055da
+2040575f
+204041e5
+6fe44864
+c289dbd3
+c2895b94
+20600000
+70409a08
+6fe44864
+c3860000
+70409a18
+20600000
+204048fa
+6fe44864
+c41e8000
+202048fd
+6fe145a8
+67e14521
+6fe0c5ab
+67e14527
+6fe2c5ad
+67e2c573
+6fe0c5ac
+67e0c51c
+6fe0c5b2
+2feffe00
+2040dc81
+6fe0c5b2
+2feffe02
+2040dc83
+6fe0c5b2
+2feffe01
+2040dc85
+6fe0c5b2
+2feffe03
+2040dc87
+6fe0c5b2
+2feffe04
+2040dc89
+6fe0c5b2
+2feffe05
+2040dc93
+6fe0c504
+245a48e4
+2040526c
+204053a6
+20405271
+20405d72
+20204900
+58009000
+67e142cc
+7040c203
+7040a708
+70485700
+70485700
+70485800
+58000200
+67e140a5
+7042b617
+7042b817
+58000a77
+67e143ae
+38001224
+38044000
+38080000
+e7e28005
+580047af
+67e14316
+58000010
+67e14318
+20405ef7
+20405ea2
+204053b9
+6fe44864
+c30dd2b3
+58000006
+67e142a8
+67e142aa
+204052e0
+6fe44864
+c30c52b7
+204052d5
+6fe1c553
+67e1c8e6
+6fe0c5e5
+67e0c76e
+6fe1c2b3
+67e1c783
+6fe0c5a5
+1fe17efe
+67e0c5a5
+67e0c3c6
+58000000
+67e3c578
+6fe0c436
+67e0c854
+67e0c855
+2040410b
+449bc006
+6fe0c5be
+67e0c5d5
+6fe0c5bd
+c17f8000
+6848c5bd
+2040547f
+6848c5bd
+20406b85
+2040d2d2
+2020547b
+6fe0c5bf
+67e0c5d5
+20600000
+6fe1c8cc
+67e1c553
+6fe1c8cf
+67e1c556
+6fe0c8d2
+67e0c56c
+6fe248de
+67e248da
+58100c0c
+67e1c4f2
+20600000
+6fe1c8d3
+67e1c553
+6fe1c8d6
+67e1c556
+6fe0c8d9
+67e0c56c
+6fe248e2
+67e248da
+581c1919
+67e1c4f2
+20600000
+449c4007
+6fe44864
+c297ddba
+6fe0c5e5
+c0005daa
+204052ff
+243458e5
+449cc007
+6fe0c8bf
+245a5ab8
+da2045e6
+6fe0c5e5
+1fe0ffff
+1feffe1d
+9a20a200
+efe08011
+67e0c3ac
+6fe0c3ac
+c01a5309
+202058e5
+449d4007
+78547c00
+6fe44864
+c305d306
+6fe084f1
+c3015306
+78347c00
+6fe0c76b
+67e0c76a
+20600000
+70478101
+6848c86f
+6fe0c77b
+c07fd30e
+6848c5aa
+6048c831
+20404e19
+6fe1c789
+67e1c324
+204059b2
+58000004
+e7e08006
+d8c04340
+204059b9
+20206fc0
+c5134df4
+6fe0c766
+203a4df4
+6fe0c7ae
+c000cdf4
+6fe0c589
+243a4df4
+20204df6
+6fe0c5aa
+67e0c77e
+20600000
+20405ef7
+449dc007
+58000006
+2040674e
+c281d32a
+2040582b
+2040583e
+20405338
+20204e13
+449e4007
+6ff20130
+79207e1a
+67f2004c
+20403c05
+20406eb7
+20405ef7
+20405543
+20405338
+20405bcb
+6848c5c6
+20206b6e
+449ec007
+204058e3
+204074e0
+20405afd
+20405af0
+20405543
+6848c5c3
+20406b96
+6848c5c3
+20406b6e
+6fe0c5bc
+20405759
+6848c5c8
+2040547f
+2040536c
+2040535e
+d840000d
+2040547f
+20405483
+20405357
+2020534d
+6fe44864
+c41e0000
+6848c5b9
+20406b6e
+6848c5ba
+20406b6e
+6848c5b9
+2040547b
+6848c5ba
+2020547b
+6fe44864
+c40a0000
+6fe0c5a5
+c1820000
+6fe0c5a4
+d84000c0
+20206bbd
+d8c08070
+df20000d
+efe08006
+243a5365
+58000080
+18c08bff
+e7e08005
+c2005360
+20600000
+c6130000
+2040536c
+6fe08015
+247a0000
+20206b6e
+449f4007
+6848c5b9
+20406b7c
+6848c5ba
+20406b7c
+204054b6
+6fe0c5bb
+20405759
+20406745
+6848c5b3
+20406b62
+6848c5b5
+20406b62
+6848c5b4
+20406b62
+6848c5b6
+20406b62
+6848c5b7
+20406b62
+6848c5b8
+20406b62
+6848c5c4
+20406b62
+6848c5c5
+20406b62
+6848c5b9
+20406b5e
+6848c5ba
+20406b5e
+6848c5c1
+20406b5e
+6848c5c2
+20406b5e
+6848c5c6
+20206b62
+6fe14434
+c284d392
+20600000
+1a227e00
+243a4177
+20204179
+6fe0c3c6
+c1820000
+449fc007
+6848c3c7
+18467c03
+202153a3
+18408405
+6048c5a4
+18422200
+20406bc4
+c01fdf45
+20405f43
+1a220400
+20206bae
+18408404
+6048c5a4
+2020539d
+6fe0c5a5
+c00253af
+c000d3b4
+7045a501
+582c0172
+67e1c58b
+58014001
+e7e18005
+20600000
+585d0099
+67e1c58b
+58007100
+e7e18005
+20600000
+58c8012c
+67e1c58b
+5800dc00
+e7e18005
+20600000
+6fe44864
+c40a0000
+70459d01
+c3970000
+c3958000
+70459d00
+20600000
+6fe0c59e
+1fe0fe01
+67e0c59e
+6848c59f
+98467c00
+20600000
+6fe44864
+c40a0000
+20405395
+6fe0c59d
+203a53dd
+6fe0c3c6
+c00253d2
+70459d03
+204053c0
+202153d4
+204053d9
+202053e3
+70459d02
+202053e3
+20405397
+7043c604
+6fe0c863
+245a53d9
+202053e3
+70459e00
+6fe0c5a5
+67e0c3c6
+20600000
+6fe0c3c6
+c08253e1
+6fe0c863
+247a0000
+204053c0
+24610000
+44a04008
+6fe0c863
+247a0000
+70459e00
+20406be2
+20406c11
+67e14591
+6fe0c3c6
+c08253f2
+68494591
+184ffe08
+1fe6fc0a
+20407472
+9840fe00
+67e14591
+da20458b
+20405404
+6fe0c3ca
+c2815445
+c280d323
+c30053fc
+7045a201
+202053fa
+d8e00004
+20205c8b
+d8e00004
+20405c8f
+7045a00c
+6fe0c5a2
+207a0000
+7045a200
+6848c5c9
+20205f14
+44a0c008
+efe40011
+67e404c4
+6fe0c59d
+c000541b
+c001540b
+c001d43a
+6fe44864
+c3175411
+6fe104ca
+68494593
+98467c00
+2421543d
+6fe44864
+c315d41b
+7045a300
+6fe104ca
+68494595
+98467c00
+2421541a
+20405c46
+2020541b
+20405c4a
+20405441
+20406c4d
+20406c45
+6fe104ca
+684904c6
+98467c00
+24416c49
+684904c8
+98467c00
+24416c41
+6fe104ca
+684904c4
+98467c00
+20215436
+684904c6
+98467e00
+24215438
+203a5438
+1fefa264
+6fe104c4
+684904c6
+98460400
+1a227e00
+9846fc00
+20407472
+67e0c7a9
+20600000
+7047a964
+20600000
+7047a900
+20600000
+6fe0c3c6
+c002540b
+2020541b
+6848c3ca
+79200402
+6048c3ca
+20600000
+6848c3ca
+793f8402
+6048c3ca
+20600000
+7045a301
+20600000
+20405afd
+20405af0
+6848c3d9
+20406b96
+6848c5b3
+2040547f
+6848c5b5
+2040547f
+6848c5b4
+2040547f
+6848c5b6
+2040547f
+6848c5b7
+2040547f
+6848c5b8
+2040547f
+6848c5c3
+2040547f
+6848c5c4
+2040547f
+6848c5c5
+2040547f
+6848c5b9
+2040547f
+6848c5ba
+2040547f
+6848c5c1
+2040547f
+6848c5c2
+2040547f
+6848c5c6
+2040547f
+6848c5c7
+2040547f
+6848c5c9
+20406b96
+6848c5ca
+20406b96
+6848c5cb
+20406b96
+6848c5cc
+20406b96
+6848c5cd
+20406b96
+6848c5bd
+2020547f
+18467cff
+20628000
+18410e7f
+6ff2011c
+afefffff
+2020d47f
+18467cff
+20628000
+79200407
+20206b7c
+18467cff
+20628000
+793f8407
+20206b7c
+6fe1c896
+67e184c4
+df20000e
+d8400000
+6fe184c4
+2feffe00
+2040ebae
+6fe184c4
+1fe3fe00
+67e184c4
+18408401
+c2005487
+20600000
+20405495
+7043ae73
+20405494
+20206749
+20206939
+6fe0c5bb
+d8400021
+20406bbd
+6fe0c5bc
+d8400023
+20206bbd
+44a14008
+78547c00
+58000000
+67e34579
+20405847
+58000089
+2040674d
+2040562e
+204054ac
+204054b1
+2040567b
+6fe0c578
+1fe17e1f
+67e0c578
+24345cc5
+20405cb4
+20205aa9
+6fe0c588
+207a0000
+67e0c57d
+70458800
+202074c8
+6fe0c584
+207a0000
+67e0c57e
+70458400
+202074c8
+204054c3
+204054ff
+6fe0c582
+6848c581
+67e0c581
+98467c00
+2422cdf8
+6fe0c586
+6848c585
+67e0c585
+98467c00
+2422cdf8
+20600000
+6fe0c5c1
+c17f8000
+da200000
+6848c5c1
+20406b85
+7920a200
+6848c5c2
+20406b85
+7920a201
+1a227e00
+67e0c582
+c000d4d3
+c00154d7
+6fe0c583
+c283d4e3
+20600000
+6fe0c581
+c00054db
+c001d4dd
+20600000
+6fe0c581
+c00054df
+c001d4e1
+20600000
+70458382
+20600000
+70458381
+20600000
+70458380
+20600000
+70458383
+20600000
+6fe0c583
+793ffe07
+67e0c583
+c00054eb
+c000d4ee
+c00154f1
+c001d4f4
+20600000
+6fe0c582
+c001d4f7
+20600000
+6fe0c582
+c00054f7
+20600000
+6fe0c582
+c001d4fb
+20600000
+6fe0c582
+c00054fb
+20600000
+6fe0c584
+1fe0fe01
+67e0c584
+20600000
+6fe0c584
+1fe0ffff
+67e0c584
+20600000
+6fe0c5b9
+c17f8000
+da200000
+6848c5b9
+20406b85
+7920a200
+6848c5ba
+20406b85
+7920a201
+1a227e00
+67e0c586
+c000d50f
+c0015513
+6fe0c587
+c283d51f
+20600000
+6fe0c585
+c0005517
+c001d519
+20600000
+6fe0c585
+c000551b
+c001d51d
+20600000
+70458782
+20600000
+70458781
+20600000
+70458780
+20600000
+70458783
+20600000
+6fe0c587
+793ffe07
+67e0c587
+c0005527
+c000d52a
+c001552d
+c001d530
+20600000
+6fe0c586
+c001d533
+20600000
+6fe0c586
+c0005533
+20600000
+6fe0c586
+c001d537
+20600000
+6fe0c586
+c0005537
+20600000
+6fe0c588
+1fe0fe01
+67e0c588
+20600000
+6fe0c588
+1fe0ffff
+67e0c588
+20600000
+6848c5b9
+20406b5e
+6848c5ba
+20406b5e
+6848c5c1
+20406b5e
+6848c5c2
+20206b5e
+6848c5b9
+20405475
+6848c5ba
+20405475
+6848c5c1
+20405475
+6848c5c2
+20205475
+6fe1457d
+207a0000
+70458901
+70458a0a
+20600000
+da60458a
+da405553
+20204dcc
+70458900
+20600000
+6fe44864
+c2975580
+6fe0c5b8
+c17f8000
+da200000
+70484f05
+6848c5b8
+20405564
+67e0c84c
+6fe0c5c3
+c07fd578
+20405710
+1a227e00
+c282d582
+20205589
+6fe44864
+c296557e
+6fe0c84c
+1fe22600
+6fe0c5c3
+c07fd574
+6fe0c853
+243a557b
+20406b85
+6848c5c3
+2020d57e
+6848c5c3
+20406b96
+6848c5b8
+6fe0c84c
+2020573b
+6fe0c5b8
+2040575c
+6848c5b8
+20205747
+6848c5b8
+2040547f
+20205561
+70468a00
+70484c00
+20600000
+6fe0c84c
+2020573b
+6fe0c5a3
+203a5589
+6fe0c68a
+c1008000
+70468a01
+6fe44864
+c3940000
+c39b0000
+202055e2
+6fe0c68a
+c1000000
+70468a00
+6fe44864
+c2945590
+c29b5590
+20600000
+6fe0c68b
+243a5594
+6fe0c855
+245a55e2
+70468b00
+6fe0c436
+67e0c855
+67e0c854
+20600000
+6fe44864
+c41f0000
+6fe0c89d
+243a55a2
+6fe0c5ce
+20405759
+204055b2
+6848c5ce
+2020547f
+6fe0c5ce
+793ffe07
+67e0c5ce
+2040575c
+7048a100
+6848c5ce
+6fe0c89e
+204055cb
+204055b6
+6848c5ce
+2020547f
+2040547f
+6fe0c89f
+c1008000
+70489f01
+202055e2
+7048a100
+6848c5ce
+6fe0c89e
+204055c1
+67e0c89e
+6fe0c8a0
+203a55bd
+6fe0c89f
+c1008000
+70489f01
+202055e2
+6fe0c89f
+c1000000
+70489f00
+20600000
+1fe3fe00
+1fe22400
+20406b85
+7920a400
+1a417e07
+6848c8a1
+18420e00
+c003d5d6
+c00055d8
+20600000
+1fe3fe00
+1fe22400
+2040547b
+20406b85
+7920a400
+1a417e07
+6848c8a1
+18420e00
+c003d5d6
+c00055d8
+20600000
+7048a001
+20600000
+7048a000
+20600000
+6fe44864
+c41f0000
+6fe0c5ce
+c283d5e0
+70489d00
+20600000
+70489d01
+20600000
+44a1c008
+204055ef
+20740000
+6fe0c63f
+1fe20400
+6fe44864
+c29f55f8
+18427e00
+1fe0fe01
+1fe17e03
+67e0c63f
+20405635
+20205b8c
+78547c00
+6fe44864
+c3960000
+c3970000
+6fe0c847
+207a0000
+6fe0c848
+207a0000
+202074c8
+6fe0c8a0
+243a5615
+6fe44864
+c28e5609
+18427e00
+c1008000
+c0005605
+c0015603
+20600000
+58000002
+202055ec
+58000000
+202055ec
+58000001
+202055ec
+58000003
+202055ec
+18427e00
+c1008000
+c0005605
+c0015607
+c001d603
+20600000
+18427e00
+c1010000
+c0005607
+c000d603
+c001d601
+20600000
+6fe44864
+c28e560f
+18427e00
+c1010000
+c0005601
+c000d603
+20600000
+6fe44864
+c2945620
+c29b5627
+20600000
+6fe0c68a
+c1808000
+da604855
+da405625
+20204dcc
+70468b01
+20205c52
+6fe0c68a
+c1808000
+da604854
+da40562c
+20204dcc
+70468b01
+20205a3e
+20205638
+6fe44864
+c38e0000
+6fe0c63f
+c1818000
+70463f00
+20600000
+44a24008
+2040562f
+20405ebd
+6fe0c5d4
+c001d65a
+c005d66e
+6fe0c63f
+c0005642
+c000d640
+c0015644
+c001d646
+6848c67e
+20205647
+6848c67d
+20205647
+6848c67f
+20205647
+6848c680
+6fe0c5d4
+c0025656
+c002d656
+c0045658
+c003d658
+c0035656
+6048c689
+58000006
+2040674e
+1fe104f8
+6fe0c689
+9840fe00
+1fed7e00
+1fe0fe06
+2020674d
+184085ff
+2020564d
+18408402
+2020564d
+6fe0c63f
+c0005661
+c000d65f
+c0015663
+c001d665
+6fe0c682
+20205666
+6fe0c681
+20205666
+6fe0c683
+20205666
+6fe0c684
+67e0c689
+1fed7e00
+1fe22200
+1fe0fe0d
+2040674d
+1a227e00
+1fe0fe0e
+2020674d
+6fe0c63f
+c0005675
+c000d673
+c0015677
+c001d679
+6fe0c686
+20205666
+6fe0c685
+20205666
+6fe0c687
+20205666
+6fe0c688
+20205666
+20405766
+6fe0c8a8
+243a577d
+6fe0c8a3
+243a577c
+204056b9
+20405691
+2040538f
+2040568c
+1a227e00
+6848c580
+67e0c580
+67e0c578
+9842fe00
+1fe67c00
+20628000
+202074c8
+c6930000
+1a227e00
+207a0000
+67e0c578
+202074c8
+70485100
+70485200
+70485300
+1fe20400
+204056a1
+204056a4
+204056a7
+204056aa
+6fe0c852
+207a0000
+6fe0c851
+207a0000
+70485301
+6fe0c580
+1fe22200
+20600000
+18417e09
+c004d6b2
+20600000
+18417e14
+c00a56b2
+20600000
+18417e18
+c00c56b0
+20600000
+18417e07
+c001d6b0
+c002d6b0
+c00356b0
+c003d6b0
+20600000
+70485201
+20600000
+70485101
+20600000
+204056c6
+204056b9
+58000000
+67e1c847
+20600000
+44a2c008
+6fe0c899
+245a56c6
+da200000
+204056c9
+204056d2
+204056db
+204056e4
+20405700
+20405766
+2040571d
+1a227e00
+20600000
+58030303
+67e1c847
+20600000
+6fe0c5b3
+20405759
+70484f00
+6848c5b3
+6fe0c847
+2040573b
+67e0c847
+6848c5b3
+2020547f
+6fe0c5b5
+20405759
+70484f01
+6848c5b5
+6fe0c848
+2040573b
+67e0c848
+6848c5b5
+2020547f
+6fe0c5b4
+20405759
+70484f02
+6848c5b4
+6fe0c849
+2040573b
+67e0c849
+6848c5b4
+2020547f
+6fe0c5b6
+c17f8000
+70484f03
+6fe0c84a
+1fe22600
+6848c5b6
+6fe0c5c3
+c07fd6f9
+20406b85
+2020d6f5
+6848c5c3
+20406b96
+6848c5b6
+6fe0c84a
+2040573b
+67e0c84a
+20205710
+6848c5c3
+6fe0c84a
+2040573b
+202056f3
+6fe0c5b6
+2040575c
+6848c5b6
+20405747
+67e0c84a
+6848c5b6
+2020547f
+6fe0c5b7
+c17f8000
+70484f04
+6fe0c84b
+1fe22600
+6848c5b7
+6fe0c5c3
+c07fd716
+20406b85
+2020d712
+6848c5c3
+20406b96
+6848c5b7
+6fe0c84b
+2040573b
+67e0c84b
+6848c5c3
+2020547f
+6848c5c3
+6fe0c84b
+2040573b
+2020570f
+6fe0c5b7
+2040575c
+6848c5b7
+20405747
+67e0c84b
+6848c5b7
+2020547f
+70484400
+6fe44864
+c40a8000
+6fe0c5c5
+c17f8000
+70484f07
+6848c5c5
+6fe0c84e
+2040573b
+67e0c84e
+1a227e00
+c283d72d
+20405730
+6fe0c845
+67e0c846
+20600000
+70484501
+20405733
+2020572a
+70484500
+6fe0c846
+207a0000
+70484401
+20600000
+20406b85
+6848c84f
+18420e00
+2020d745
+f93fa200
+20600000
+1fe3fe00
+1fe22400
+20406b85
+7920a400
+1a417e07
+6848c84f
+18420e00
+c003d745
+c0005739
+20600000
+f9202200
+20600000
+44a34008
+1a627e00
+67e0c850
+1fe3fe00
+1fe22400
+18422600
+2040547b
+1a620400
+20406b85
+7d20a400
+20405753
+20205740
+6848c850
+18410401
+1a417e01
+98467c00
+2422d90d
+20600000
+c17f8000
+d840003f
+20206bbd
+c17f8000
+d840003e
+20206bbd
+6fe0c5cf
+c17f8000
+c283d764
+7048a200
+20600000
+7048a201
+20600000
+da400000
+6fe0c5cf
+c17f8000
+6fe0c8a2
+243a5773
+6848c5cf
+2040547f
+6848c5cf
+20406b85
+7920a400
+1a427e00
+67e0c8a8
+20600000
+6fe0c5cf
+793ffe07
+67e0c5cf
+6848c5cf
+2040547b
+6848c5cf
+20406b85
+7d20a400
+20205770
+c0025795
+20405798
+6fe248a4
+d84000a0
+98408400
+1c427e00
+98467c00
+24610000
+67e248a4
+6fe0c8a3
+c000578b
+c000d78e
+c0015791
+c001d793
+20600000
+7048a301
+70457801
+202074c8
+7048a302
+70457800
+202074c8
+7048a303
+2020578c
+7048a300
+2020578f
+7048a300
+70457800
+20600000
+684a48a4
+1c427e00
+98467c00
+2441579d
+20600000
+58000000
+67e248a4
+20600000
+44a3c008
+20405490
+20758000
+20405838
+44a44009
+204057af
+c01857b6
+c018d817
+c02c5820
+204057ac
+20001af4
+202057a4
+6848c5bb
+20406735
+20205495
+58000001
+2040674e
+67e0c66f
+58000000
+2040674e
+67e0c66e
+20600000
+6fe0c66f
+c02d57bf
+c06c57c5
+c068d7d4
+c06957dd
+c00157e4
+c02a57ed
+c0285814
+202057a4
+7045d405
+2040582b
+204073d8
+da6046e6
+204057e6
+2020562e
+58000016
+2040674e
+1fe67cbd
+2422d7a0
+58000019
+2040674e
+1fe67c55
+2422d7a0
+5800001b
+2040674e
+1fe67c1d
+2422d7a0
+7045d406
+da60472a
+202057e6
+7045d400
+da6046a0
+204057e6
+da6046aa
+204057e6
+58000943
+2040674d
+da6046c4
+202057e6
+7045d402
+da604696
+204057e6
+da6046aa
+204057e6
+da6046c4
+202057e6
+7045d403
+da60468c
+efe10013
+d840ffff
+98467c00
+20628000
+2040674d
+1a60a602
+202057e6
+20405829
+58009a5b
+2040674d
+5800000d
+2040674e
+1fe67c12
+2022d801
+1fe67c0a
+2422d804
+5800000e
+2040674e
+1fe67ce5
+2422d7a4
+58000010
+2040674e
+1fe67ca5
+2022d801
+20405811
+7045d408
+20600000
+7045d409
+da60470c
+202057e6
+1fe67c10
+2422d7a4
+5800000e
+2040674e
+1fe67cc5
+2422d7a4
+58000010
+2040674e
+1fe67c38
+2422d7a4
+20405811
+7045d40a
+20600000
+5800005b
+2040674d
+20205827
+7045d407
+da60474a
+202057e6
+20405838
+6fe0c66f
+c038581e
+c000581c
+202057a4
+7045d401
+20600000
+7045d404
+20600000
+20405838
+6fe0c66f
+c02cd824
+202057b6
+7045d40b
+da60473a
+202057e6
+58000009
+2020674d
+58005a09
+2020674d
+d8408006
+6fe0c5d4
+c085d82f
+d8409706
+18427e00
+2040674d
+20002ee0
+20600000
+da604756
+6fe0c5d4
+c1858000
+da60475e
+20600000
+44a4c009
+20405490
+2040582b
+20405833
+204057e6
+2020562e
+44a54009
+204057a0
+20405490
+d8400806
+6fe0c5d4
+c085d845
+d8401f06
+18427e00
+2020674d
+6fe0c3d2
+c1800000
+6fe0c5d4
+c0005853
+c000d853
+c0045853
+c0015853
+c001d877
+c0025853
+c003589c
+c005d895
+20205853
+204058be
+78547c00
+6fe0c5c6
+c07fd85a
+6848c5c6
+20406b85
+24608000
+58000000
+2040674e
+c098586d
+58000002
+2040674e
+c4038000
+204058d5
+6fe0c579
+204058cd
+67e14579
+6fe0c57b
+204058cd
+67e1457b
+6fe0c5d5
+c000586f
+c000d871
+c0015873
+c001d875
+20600000
+c018d85d
+202057ac
+204058a7
+202058dc
+204058af
+202058dc
+204058ab
+202058dc
+204058b7
+202058dc
+204058be
+6fe0c5c6
+c07fd87d
+6848c5c6
+20406b85
+24608000
+58000000
+2040674e
+c09857ac
+58000002
+2040674e
+c4038000
+204058d5
+20405893
+67e0c57f
+1ff1fe00
+204058d1
+67e0c57a
+6fe0c57f
+1fe17e0f
+204058d1
+67e0c57c
+6fe0c5d5
+c00058a7
+c000d8af
+c00158ab
+c001d8b7
+20600000
+58000012
+2020674e
+204058be
+6fe0c5c6
+c07fd89b
+6848c5c6
+20406b85
+24608000
+20205880
+204058be
+78547c00
+58000002
+2040674e
+c4038000
+58000008
+2040674e
+203a5860
+58000000
+67e34579
+20600000
+6fe14579
+1fe67e00
+67e14579
+202074c8
+6fe1457b
+1fe67e00
+67e1457b
+202074c8
+6fe1457b
+1fe67e00
+67e1457b
+6fe14579
+1fe67e00
+67e14579
+204058b9
+202074c8
+204058b9
+202074c8
+6fe1457b
+68494579
+67e14579
+6049457b
+20600000
+6fe0c675
+205a58d5
+70467501
+20600000
+70476601
+2040416b
+202057a0
+6fe0c5c6
+c1ff8000
+6fe0c768
+c1808000
+58000000
+67e0c768
+67e24579
+202058c4
+c4038000
+d840ff00
+9841fe00
+20600000
+c4018000
+d84000f0
+9841fe00
+20600000
+dfe00003
+2040674e
+67e14579
+dfe00004
+2040674e
+67e1457b
+20600000
+6848c5bc
+20406b85
+20608000
+5800000a
+2040674e
+200003e8
+202058dc
+58008100
+2020674d
+70477bff
+7043ac34
+580f0f0f
+67e1c2b0
+67e1c2b3
+202052fc
+44a5c009
+20405b61
+204058f9
+6fe0c5e5
+c000d8f2
+c00158f4
+20600000
+6fe345e7
+202058f5
+6fe34604
+684b4621
+98467c00
+2022db08
+202052f2
+70477b5a
+20600000
+6fe14434
+c284ce0b
+20205b29
+58000000
+67e1476c
+6fe14434
+c284ce0b
+20600000
+6fe44864
+c40d8000
+2434590b
+6fe0c767
+1fe0fe01
+1fe17e0f
+67e0c767
+247a0000
+70476700
+202074ca
+6fe0c5c6
+c1ff8000
+7040c100
+7047691e
+20600000
+44a64009
+1a627e00
+c00a5921
+c00ad932
+c0085b03
+c018d93b
+c014d93d
+c019593f
+c01f4e15
+c020594b
+c01cde21
+c01d5de5
+c01e5e0c
+c022595a
+20600000
+6fe0c8bd
+245a5abd
+70476800
+204058c4
+70478001
+20405dd3
+6fe0c781
+243a592a
+70478214
+6fe143aa
+793ffe00
+67e143aa
+70483100
+6fe147aa
+67e147ac
+20405aa9
+20205b29
+58000000
+67e147ac
+67e0c8ca
+67e0c8cb
+67e0c780
+7047ae00
+70476600
+2040416d
+20205a0f
+d8e00002
+20205947
+7004c312
+20206f84
+6fe0c781
+c000d943
+70483014
+20205945
+2040593d
+7048300a
+d8e00001
+20205947
+6fe0c82f
+f9207e00
+67e0c82f
+20600000
+6fe0c8ca
+247a0000
+7048ca01
+7048cb1e
+20600000
+7047ae01
+20600000
+6fe0c781
+247a0000
+6fe0c36f
+1fe67e22
+24628000
+70483000
+d8e00000
+20205947
+6fe0819d
+1fe67c0c
+24215950
+6fe0819f
+6848c843
+98467c00
+20215964
+6fe0819f
+67e0c0c1
+20205966
+6fe0c843
+67e0c0c1
+7047ae00
+20600000
+70482f00
+20600000
+44a6c009
+204041cc
+247a0000
+6fe0c77b
+c07fd972
+6fe0c82f
+1fe17e03
+c1818000
+6fe0c766
+205a58c2
+6fe44864
+c280d9a2
+c28059a2
+c282d9a2
+c28359a2
+2040549b
+20405903
+24740000
+2040590d
+204058c5
+2040554b
+6fe44864
+c30ad983
+6fe0c844
+c000d984
+202059a4
+6fe0c845
+203a5994
+6fe44885
+67e404c4
+6fe0c884
+c001d996
+c0015999
+7047a008
+684947a1
+6fe0c7a0
+1fe22200
+20404513
+6848c7a0
+18427200
+d8c004c4
+20207419
+6fe4488e
+20205987
+7047a003
+684947a3
+2020598d
+7047a002
+684947a5
+2020598d
+da200001
+684947a7
+20404513
+6fe0c7a9
+e7e08005
+20600000
+58000000
+67e3c578
+7047a007
+6fe3c578
+67e384c4
+6849428d
+2020598d
+70478100
+6fe1c786
+67e1c324
+204059b2
+58000005
+e7e08006
+d8c0478c
+204059b9
+20206fc0
+da204320
+efe08011
+207a0000
+98c0a200
+efe08006
+c1008000
+202059b3
+d8a0432b
+df200013
+20407419
+2020410b
+6fe448aa
+207a0000
+6fe0c8a9
+1fe22200
+1fe67c0b
+242159cf
+d8c048aa
+d8a04795
+1a227200
+20407419
+d8c048aa
+d8a04342
+1a227200
+20407419
+d8c048aa
+d8a0422e
+1a227200
+20207419
+204059e5
+6fe0c8a9
+1fe0fe01
+67e0c78c
+70478d09
+d8c048aa
+d8a0478e
+1a227200
+20407419
+6fe0c8a9
+1fe0fe01
+67e0c340
+70434109
+d8c048aa
+d8a04342
+1a227200
+20407419
+d8c048a9
+d8a0422d
+1a227200
+1f20f201
+20207419
+d8a0478c
+df200014
+202073ec
+6fe1430e
+1fe08c02
+efe10006
+c00259ed
+20204031
+efe18006
+67e1c36e
+c00559f2
+c0095a00
+20204331
+6fe44864
+c31dc445
+204044ec
+6849436f
+6fe0c2f6
+c281d9fb
+6fe1436f
+c0184528
+20204449
+6fe14307
+98467c00
+2422d9f8
+243459f8
+2020446e
+18c22200
+6fe1430a
+1fe0a5fd
+20404072
+6fe0c77b
+c07fc4d1
+6fe0c781
+203a44d1
+6fe0c82f
+c280c4d1
+5800001a
+6849436f
+98467c00
+2422c4d1
+2020446e
+20405a14
+6fe143a8
+c283da1a
+c2804de8
+20205b08
+58000000
+67e44581
+e7e20005
+70467500
+70425c00
+20600000
+20405968
+6fe143a8
+c2804de8
+20205324
+44a74009
+204053c6
+20405f47
+20404907
+20404ba5
+20405d6b
+20405e9a
+20405ecb
+20405ac1
+20405af3
+2040561c
+20405a36
+20405a46
+20405a69
+20405a6e
+20405a7c
+20405a8c
+20405a7f
+20405a89
+20405a99
+20405a9c
+20405550
+20405aac
+20205aa3
+6fe44864
+c29bda39
+20600000
+6fe0c857
+c1808000
+da604854
+da405a3e
+20204dcc
+6fe0c5e5
+c1000000
+6fe44864
+c3830000
+d8e00006
+20405c8b
+20404dbc
+20205b03
+6fe0c5e5
+c0005a4c
+6fe44864
+c41a8000
+6848c882
+20205a4f
+6fe44864
+c4190000
+6848c883
+6048c856
+204056b9
+1fe17e07
+6848c856
+98467c00
+2022da5b
+6fe0c436
+67e0c859
+6fe0c858
+c1000000
+70485800
+20600000
+20405a60
+6fe0c858
+c1008000
+70485801
+20600000
+da405dd8
+da604859
+6fe0c5e5
+c0004dcc
+da405a3e
+20404dcc
+6fe0c859
+c000dc7d
+20600000
+da60477c
+da405a6c
+20204dd3
+20405b29
+20205324
+da604831
+da405a74
+20404dd3
+6fe0c831
+c000cdff
+20600000
+6fe0c77b
+c07fd8eb
+6fe0c76a
+243a5ca9
+6fe44864
+c299db08
+c297ddd0
+20205324
+da604830
+da405958
+20204dcc
+6fe0c780
+207a0000
+da604782
+da405a84
+20204dcc
+6fe0c781
+247a0000
+6fe0c2d1
+c1800000
+2020469d
+da6048cb
+da40593d
+20204dcc
+6fe44864
+c39d8000
+da6047ac
+da405a91
+20204dcc
+6fe147aa
+67e147ac
+2020599c
+6fe0c82f
+c3810000
+2040593d
+d8e00000
+20205947
+da60477e
+da405324
+20204dcc
+da604769
+da405a9f
+20204dcc
+6fe0c843
+67e0c0c1
+70476801
+20600000
+da60476c
+da405aa6
+20204dd3
+6fe0c5e5
+c0005d80
+202058fe
+6fe14876
+67e1476c
+20600000
+da60466c
+da405aaf
+20204dcc
+20405b8f
+6fe0c77f
+243a5c5c
+20600000
+6fe0c8c3
+67e0c8c4
+6fe0c8c1
+67e0c8c2
+20600000
+7048be01
+7048c001
+6fe0c8c5
+67e0c8c6
+20600000
+7048be01
+7048c600
+7048c000
+20600000
+6fe0c8be
+207a0000
+6fe0c8c0
+c000dad1
+6fe0c8c2
+243a5ac9
+7048be00
+20600000
+6fe0c8c4
+203a5ace
+1fe0ffff
+67e0c8c4
+20205ad8
+7048c200
+7048be00
+20205ae4
+da6048c6
+da405ad4
+20204dcc
+6fe0c8c5
+67e0c8c6
+6fe0c8c7
+c000dae4
+7048c701
+6fe0c5e5
+c0005ade
+c000dae0
+c0015ae2
+20600000
+6848c5d0
+20206b96
+6848c5d1
+20206b96
+6848c5d2
+20206b96
+7048c700
+6fe0c5e5
+c0005aea
+c000daec
+c0015aee
+20600000
+6848c5d0
+20206bae
+6848c5d1
+20206bae
+6848c5d2
+20206bae
+20405aea
+20405aec
+20205aee
+6fe0c5d3
+c17f8000
+6fe1476c
+207a0000
+6fe14876
+6849476c
+98460400
+6fe148c8
+98467e00
+20215b01
+6848c5d3
+6fe0c8bd
+c000ebae
+20206b92
+6848c5d3
+20206b96
+280ffe26
+2040dda6
+204058fe
+20405968
+20205b08
+44a7c009
+6fe14434
+2feffe0b
+2040db2f
+204058f9
+6fe14434
+c285db17
+6fe44864
+c3045b17
+68494644
+18408401
+60494644
+604942b1
+180a7e00
+67e0c2b0
+6fe1c783
+67e1c2b3
+20404e19
+6fe145a6
+67e1477c
+58000000
+67e1476c
+67e147ac
+67e0c831
+67e0c77e
+67e0c860
+67e0c766
+d8e00002
+20405c8b
+20405c7f
+204059a9
+20405f7f
+20205e1e
+44a8400a
+d8e00006
+20405c8f
+70477e00
+20405b2f
+20205efb
+58000000
+67e0c831
+67e1477c
+20206fc6
+44a8c00a
+6fe44864
+c4010000
+20405ea2
+d8e00002
+20405c8f
+20405b3c
+20405b4b
+20205b8c
+6fe0802d
+c01a5b3f
+20600000
+67e0c832
+6fe30173
+67e34833
+6fe3c832
+d8c045e6
+df200003
+e8438006
+98467c00
+2022db5b
+18c08c16
+c2005b45
+20600000
+da2045e6
+6fe0c5e5
+1fe0ffff
+1feffe1d
+9a20a200
+6fe0802d
+e7e08011
+c01a5b54
+20600000
+6fe30173
+e7e30005
+d8c0424c
+204073d2
+6fe342b0
+e7e30005
+20600000
+18c08dfa
+18c20a00
+684b4833
+18408403
+e0430005
+20600000
+da2045e6
+6fe0c5e5
+c1000000
+1fe0ffff
+1feffe1d
+9a20a200
+efe08011
+67e0c3ac
+c01a5b6b
+20600000
+efe30006
+67e3410f
+d8a0424c
+204073d2
+efe30006
+67e342b0
+20600000
+6fe1463d
+d840aa55
+98467c00
+2022db80
+6049463d
+20405b85
+6fe0c76e
+67e0c5e5
+6fe0c5c0
+67e0c63f
+6fe2452f
+67e24533
+67e244da
+20600000
+20405b61
+6fe24640
+67e24533
+67e244da
+20600000
+6fe342b0
+67e345fd
+1fe0ff00
+67e3461a
+1fe0ff00
+67e34637
+20600000
+6fe0c66d
+67e0c66c
+20600000
+44a9400a
+6fe44864
+c289dbdd
+c2895ba1
+20600000
+2040698c
+20405ba8
+20405b9b
+204069b0
+20405baf
+20405b72
+20205490
+58004665
+d84045e5
+98460400
+6fe1c665
+da2045e5
+20600000
+2040698c
+20405ba8
+20405bbd
+20405b9b
+20405bc0
+20405baf
+20205490
+7004ccab
+20406cb5
+20406992
+da204668
+684884cc
+20405bb1
+20206cb5
+7004ccb9
+20205ba9
+e0408011
+1ff10400
+e0408005
+1fec8400
+e0408005
+e7e08005
+1a227e00
+67f10084
+58000000
+67f10088
+70800602
+20206953
+6fe1c665
+67e1c3cb
+20206966
+1fe22600
+1a227e00
+1fe0fffc
+1fe22400
+efe20012
+67e24668
+1a627e00
+2040699f
+6fe24668
+e7e20012
+20600000
+6fe44864
+c4090000
+20405baf
+20406749
+6848c3d3
+20406b92
+6848c3d8
+2020547b
+20406a22
+6fe44864
+2feffe09
+2440ea3c
+20405bd9
+20205b72
+d8400080
+da2045e5
+da400000
+20206a59
+d8400080
+da2045e5
+da400000
+20206a4b
+d8400001
+da20463f
+da40005a
+20206a4b
+d8400001
+da20463f
+da40005a
+20206a59
+44a9c00a
+20405f81
+20406ff5
+20405555
+20405599
+20405bf2
+20405c3d
+20405c72
+202054b6
+6fe44864
+c294dbf7
+c29bdbf7
+20600000
+70484d03
+6fe0c5c4
+c17f8000
+da200000
+70484f06
+6848c5c4
+20405c07
+67e0c84d
+6fe0c5c3
+c07fdc04
+20405710
+1a227e00
+c2835c28
+20205c1d
+6848c5c4
+2040547f
+20205c01
+6fe44864
+c296dc13
+6fe0c84d
+1fe22600
+6fe0c5c3
+c07fd747
+6fe0c853
+243a5c10
+20205c15
+70485700
+70484d00
+20600000
+6fe0c84d
+2020573b
+20406b85
+6848c5c3
+2020dc13
+6848c5c3
+20406b96
+6848c5c4
+6fe0c84d
+2020573b
+6fe0c857
+c1000000
+70485700
+6fe44864
+c39a0000
+6fe0c854
+1fe67c14
+24415c52
+6fe0c436
+67e0c854
+20600000
+44aa400a
+20405c35
+20740000
+6fe0c857
+c1008000
+70485701
+6fe44864
+c29a5a3e
+6fe0c831
+207a0000
+6fe0c5aa
+67e0c831
+20600000
+78547c00
+6fe44864
+c3968000
+6fe0c847
+207a0000
+6fe0c848
+207a0000
+202074c8
+6fe44864
+c2955c41
+c295d3c6
+20600000
+6848c5c7
+2040547f
+6848c5c7
+20406b85
+2020dc4a
+6fe0c5e5
+c1008000
+7045e501
+202058fb
+6fe44864
+c315dc4e
+6fe34597
+67e3458b
+6fe0c5e5
+c1000000
+7045e500
+20205da6
+44aac00a
+6fe0c86c
+c1008000
+20405c5e
+6048c5e5
+20405c75
+204058fb
+20405c77
+70477f01
+20205b8c
+20405c75
+20206a09
+6848c5e5
+18408401
+6fe44864
+c288dc65
+18467c02
+24415c6c
+20600000
+6fe0c86c
+1fe0ffff
+98467c00
+24415c6a
+20600000
+d8400000
+20600000
+d8400001
+20600000
+d8400001
+da2045e5
+da400000
+20206a4b
+6fe44864
+c41a0000
+20205bf7
+d8e00000
+20205c8b
+d8e00000
+20205c8f
+d8e00003
+20205c8b
+d8e00003
+20205c8f
+d8e00005
+20205c8b
+d8e00005
+20205c8f
+d8e00014
+20205c8b
+d8e00018
+20205c8b
+d8e00016
+20205c8b
+d8e0000c
+20205c8b
+d8e0001c
+20205c8b
+6fe44864
+f9207e00
+67e44864
+20600000
+6fe44864
+f93ffe00
+67e44864
+20600000
+d8e00015
+20405c8b
+58000000
+67e44884
+67e4488d
+6fe0c5b2
+1fe17ec0
+c0205ca0
+c0405ca2
+c0605ca7
+58070008
+67e44885
+20600000
+58040005
+20205c9e
+58022303
+67e44884
+58000003
+67e4488d
+20600000
+5800cd03
+20205ca3
+44ab400a
+6fe0c76a
+1fe0ffff
+67e0c76a
+6848c5e5
+18467c01
+2442dc5e
+6048c5e5
+20405c6e
+20405b4b
+202052f2
+44abc00a
+6fe0c5d4
+c1018000
+6fe44864
+c41c0000
+6fe24579
+207a0000
+20405d5b
+58000003
+20405d51
+205a5d4d
+245a5d4f
+58000002
+20405d56
+205a5d4d
+6fe0c676
+c000dcca
+6fe44864
+c41c0000
+df200005
+d8a04676
+202073ec
+20405cde
+6fe14677
+67e10902
+6fe14579
+67e10904
+20405d17
+6fe10902
+67e14677
+6fe10904
+67e14579
+6fe14679
+67e10902
+6fe1457b
+67e10904
+20405d1f
+6fe10902
+67e14679
+6fe10904
+67e1457b
+20600000
+6fe44864
+c41c8000
+44ac400b
+6fe14677
+67e10909
+20405cf2
+67e14677
+6fe14579
+67e10909
+20405d00
+67e14579
+6fe14679
+67e10909
+20405cf2
+67e14679
+6fe1457b
+67e10909
+20405d00
+67e1457b
+20600000
+6fe0890a
+203a5cf5
+20205cfa
+6fe08909
+20405d0d
+67e08909
+6fe10909
+20600000
+6fe08909
+20405d49
+20405d0d
+205a74d6
+20405d45
+20205cf8
+6fe0890a
+203a5d03
+20205d07
+6fe08909
+20405d12
+67e08909
+20205cf8
+6fe08909
+20405d49
+20405d12
+205a74d6
+20405d45
+20205cf8
+1feffe04
+1fe6fc05
+20407475
+1807fe00
+20600000
+1feffe0c
+1fe6fc0a
+20407475
+1807fe00
+20600000
+6fe10902
+68490904
+9840fe00
+6848c67b
+9840fe00
+1fe10401
+6048c67b
+20205d27
+6fe10902
+68490904
+9840fe00
+6848c67c
+9840fe00
+1fe10401
+6048c67c
+20205d27
+67e18906
+2feffe10
+2020dd31
+6fe08907
+c07fdd38
+6fe08906
+1fe37e00
+67e10902
+67e10904
+20600000
+6fe08907
+c0005d35
+6fe18906
+20205d2d
+70090800
+6fe08906
+20205d2d
+6fe08906
+20405d43
+67e08902
+67e08904
+203a5d41
+580000ff
+67e08903
+67e08905
+20600000
+58000000
+20205d3e
+20405d49
+1fe37e00
+20405d4a
+1fe67e00
+67e08909
+20600000
+1fe67e00
+67e084d8
+6fe084d8
+20600000
+70467600
+20600000
+70467601
+20600000
+9a267c00
+242174d6
+9a467c00
+242174d6
+202074d8
+9a267c00
+24610000
+9a467c00
+24610000
+202074d8
+6fe14579
+20405d62
+1fe22200
+6fe1457b
+20405d62
+1fe22400
+20600000
+67e10904
+6fe08905
+c07fdd68
+6fe08904
+1fe17eff
+20600000
+6fe10904
+1fe67e00
+20205d66
+da60456a
+da405d6e
+20204dcc
+6fe2455e
+67e244fa
+70476801
+20600000
+6fe0c89a
+c0005d7a
+c000dd7c
+c0015d77
+c001dd7e
+580ea600
+67e2455e
+20600000
+5805e740
+20205d78
+580927c0
+20205d78
+58124f80
+20205d78
+44acc00b
+70454b00
+20404ca6
+5fffffff
+67e244fa
+58000000
+67e3c578
+70489901
+2040583e
+20405338
+20205fa2
+6fe0c899
+245a5d8f
+70489900
+20600000
+204057a3
+6fe44864
+c41e0000
+6fe0c5b9
+d8400040
+20406bbd
+6fe0c5ba
+d8400040
+20206bbd
+20405d9c
+6fe0c899
+243a5fad
+20204c6f
+6fe24533
+684a452f
+98467c00
+2022dda1
+20205da4
+70411800
+704116aa
+20600000
+704118ff
+20600000
+793f8026
+70454700
+d8e00001
+20205c8f
+6fe44864
+c308ddb7
+204052ff
+20345dfc
+6fe44864
+c2985dbc
+c318ddbc
+204056b4
+1a217e07
+6848c883
+98467c00
+2022ddd8
+20205dbc
+6fe0c76a
+243a5ca9
+20600000
+204052ff
+20345dc8
+6fe0c8bd
+245a5ab8
+7045e500
+6fe14872
+67e14529
+70452d02
+20204ba8
+20405e1e
+6fe14521
+67e14529
+70452d04
+20204ba8
+6fe0c5e5
+c0005dfc
+204058f9
+20405da6
+20405ef7
+7045e501
+20405b61
+202052f2
+204052ff
+20345324
+20205b08
+204052ff
+20740000
+6fe44864
+c297db8c
+20600000
+70452d00
+d8e00001
+20405c8b
+58000000
+67e14529
+20405b29
+20405f7f
+20405e1e
+7044d401
+6fe44864
+c30ac90a
+7044d402
+2020490a
+6fe0c54b
+243a5d80
+6fe0c52d
+c0015df4
+c0025e02
+c001de07
+6fe44864
+c29e5d80
+20405efb
+20405da6
+6fe0c76a
+243a5ca9
+6fe0c5e5
+c0005324
+20600000
+6fe44864
+c297ddc3
+c2985dc3
+c31d5dfc
+6fe24640
+684a4621
+98467c00
+2022ddd8
+6fe0c8bd
+245a5ab8
+6fe14527
+67e14529
+70452d03
+20204ba8
+6fe44864
+c317ddeb
+6fe0c86c
+c000ddeb
+20205dcb
+6fe44864
+c317ddeb
+c289ddeb
+c2895deb
+20205dc4
+6fe244da
+67e24533
+67e24640
+20404bce
+20405e1b
+20405aa9
+204058c4
+70476800
+70454700
+70452d00
+6fe24533
+6fe2452f
+98467c00
+20628000
+20205dd3
+6fe0c8bd
+203a5ea2
+20205abd
+6fe0c8bd
+203a5ea8
+20205ab8
+20405aa9
+d8e00001
+20405c8f
+20405e1b
+58000000
+67e14523
+67e14529
+67e0c547
+67e0c675
+67e0c52d
+204058c4
+204058d5
+6fe244da
+67e24533
+67e24640
+20205b8c
+44ad400b
+c6930000
+2040549b
+24740000
+6fe44864
+c30ade39
+6fe0c844
+243a5e4e
+204058c5
+6fe0c4d4
+c280de48
+6848c465
+6fe0c578
+9841fe00
+67e0c578
+6848c46a
+6fe0c57d
+9840fe00
+67e0c57d
+6848c46b
+6fe0c57e
+9840fe00
+67e0c57e
+7044d401
+da200007
+da404578
+6fe1457d
+207a0000
+20204d3c
+7044d402
+da200009
+6fe0c845
+243a5e54
+da40488d
+20600000
+da404884
+20600000
+58000000
+67e1c85d
+20600000
+6fe44864
+c40b0000
+6fe0c768
+207a0000
+6fe0c54d
+207a0000
+6fe0c85a
+1fe0fe01
+1fe17e03
+67e0c85a
+247a0000
+70485b00
+44adc00b
+6fe0c85b
+1fe0fe01
+67e0c85b
+1fe67c08
+24215e71
+20404bf3
+20404cb0
+242c5e77
+2437de77
+20405e8a
+20405e81
+20404bef
+6fe0c85c
+1fe0fe01
+67e0c85c
+c0085e79
+20600000
+2040489b
+20205e65
+70485c00
+6fe0c85d
+c3800000
+79207e00
+67e0c85d
+6fe14874
+67e1476c
+2020583e
+6fe0c54d
+203a5e56
+70485c00
+6fe0c85d
+c4000000
+793ffe00
+67e0c85d
+20405aa9
+202057a3
+20404ccf
+6fe0c443
+2fe1f008
+24608000
+6fe0c444
+c07fdd80
+20600000
+6fe0c5e5
+c0803b51
+6fe0c515
+207a0000
+70804202
+6ff08130
+1fe17efc
+67f0804c
+20203c05
+6fe44864
+c4100000
+6fe0c860
+207a0000
+1fe0ffff
+67e0c860
+203a5efb
+20205f09
+6fe44864
+c4100000
+20405f7f
+6fe0c878
+67e0c860
+20600000
+70486000
+6fe1487c
+67e145dd
+67e145df
+6fe0c5e5
+c0005eb1
+c000deb3
+c0015eb5
+20600000
+6fe0c5ca
+20205eb6
+6fe0c5cb
+20205eb6
+6fe0c5cc
+67e084cc
+20405efb
+6fe084cc
+67e0c5dc
+da200000
+7045da01
+20206f10
+6fe0c5cd
+c17f8000
+6fe1477c
+247a0000
+6fe14523
+247a0000
+6fe14529
+247a0000
+6fe0c860
+247a0000
+6fe0c879
+203a5ece
+67e0c861
+20600000
+da604861
+da405ece
+20204dcc
+6fe0c5cd
+67e0c5dc
+6fe1487a
+67e145dd
+67e145df
+6fe0c5d4
+c001dee2
+c005dee2
+da200000
+6848c63f
+18408402
+18467c03
+20415ede
+20215eeb
+184085fd
+20205eeb
+6fe44864
+c40e0000
+18408401
+20600000
+da200000
+6848c63f
+18408401
+6fe44864
+c30e5eeb
+18408401
+18467c04
+20215eeb
+d8400001
+6048c5db
+7045da01
+20600000
+78547c00
+6fe0c5cd
+6848c5dc
+98467c00
+24628000
+6fe0c5db
+207a0000
+7045a100
+202074c8
+20405f07
+20405f00
+20405f03
+20205f05
+6fe0c5e5
+c0005f00
+c000df03
+c0015f05
+20600000
+70486300
+6848c5ca
+20205f14
+6848c5cb
+20205f14
+6848c5cc
+20205f14
+6848c5cd
+20205f14
+6fe0c5e5
+c0005f0e
+c000df10
+c0015f12
+20600000
+6848c5ca
+20205f1b
+6848c5cb
+20205f1b
+6848c5cc
+20205f1b
+44ae400b
+18427e00
+c17f8000
+1fe20400
+6048c5dc
+da200000
+20206f0b
+44aec00b
+18427e00
+c17f8000
+1fe20400
+6048c5dc
+da200000
+20206f06
+44af400b
+6fe0c5ca
+98467c00
+2042df43
+6fe44864
+c3126b92
+20405f34
+20405f38
+20405f3c
+6fe0c862
+203a6b92
+70486200
+20206bae
+44afc00b
+6fe0c5ca
+98467c00
+2042df45
+20206b96
+6fe44864
+c4130000
+6fe0c5cc
+20205f3f
+6fe44864
+c4128000
+6fe0c5cd
+20205f3f
+6fe44864
+c4138000
+6fe0c5c9
+98467c00
+24628000
+70486201
+20600000
+70486300
+20600000
+70486301
+20600000
+6fe1477c
+247a0000
+6fe14523
+247a0000
+6fe14529
+247a0000
+6fe0c860
+247a0000
+20405eee
+20740000
+6fe44864
+c4108000
+c4020000
+c291df6d
+6fe0c5a0
+1fe0fe01
+67e0c5a0
+1fe67c14
+24415f5f
+c0015f61
+c0025f67
+c0035f61
+c0045f67
+20600000
+7045a001
+20205f67
+6fe44864
+c2915f09
+6fe0c5c9
+c17f8000
+6848c5c9
+20205f1b
+6fe44864
+c2915efb
+6fe0c5c9
+c17f8000
+6848c5c9
+20205f14
+6fe14876
+6849476c
+98460400
+6fe14880
+98467c00
+24215f7f
+6fe0c5a1
+247a0000
+7045a101
+20205f77
+6fe1487e
+67e145dd
+67e145df
+6fe44864
+c2915eac
+6fe0c5c9
+c17f8000
+20205eb6
+7045a100
+20205f67
+6fe44864
+c4108000
+c4020000
+c291df93
+6fe0c5a0
+1fe67c0a
+20215f8f
+6fe0c5e5
+c0005f8c
+70409401
+20600000
+6fe44864
+c38c0000
+20204d2b
+6fe0c5e5
+c0004d3c
+70409400
+20600000
+6fe0c5a1
+243a5f8f
+20205f88
+6fe08009
+20204c3a
+20405f96
+20204d49
+6fe0c82f
+2fe00603
+2420f4d6
+20404e17
+202074d8
+6fe14434
+c284df9a
+20600000
+20404d15
+24740000
+6fe0c863
+247a0000
+20404d1f
+7048fb00
+20406024
+6fe0c899
+245a5338
+6fe244fa
+20204c81
+6fe0c904
+203a4c75
+20404d15
+24740000
+6fe0c863
+247a0000
+6fe0c8fb
+7048fb00
+1fe67c00
+2422dfd6
+6849456d
+18467c00
+2022dfcc
+6fe248f0
+203a5fcc
+684a48da
+98460400
+604a4900
+24215fcf
+6fe1c553
+98467e00
+24215fda
+d8400600
+98467c00
+24215fda
+67e248fc
+20405fd3
+6fe248fc
+20407464
+604a40aa
+20203b47
+20405fd3
+6fe1c553
+20205fc6
+18460400
+6fe1c553
+9840fe00
+20205fc6
+58000000
+67e24900
+20600000
+6fe248f0
+684a4900
+9840fe00
+20205fbc
+7048fb01
+20600000
+20405fde
+20205d8b
+6fe0c904
+207a0000
+6fe0c563
+c000e020
+6fe0c8e9
+203a6020
+1b227e00
+684b48ea
+67e348ea
+2040744f
+67e248f0
+6fe0c8fb
+247a0000
+6fe1456d
+247a0000
+6fe248f0
+684ac8f4
+9840fe00
+67e2c8f4
+6848c8e9
+6fe0c8f9
+98467c00
+2022dff8
+18408401
+6048c8e9
+20600000
+7048e901
+d8400000
+6fe2c8f4
+604ac8f4
+6848c8f9
+9846fc00
+20407475
+1807a200
+6fe248da
+6848c8fa
+98460400
+184085d8
+1a227e00
+98467e00
+20216013
+1fe67e00
+1feb7e00
+6849c553
+98408400
+44b0400c
+6fe1c8e6
+da201800
+9a20fe00
+98467c00
+2421601e
+6049c553
+20600000
+1feb0400
+6fe1c553
+98460400
+44b0c00c
+6fe1c8e6
+da201800
+9a267e00
+98467c00
+2021601e
+6049c553
+20600000
+67e1c553
+20600000
+7048e901
+1b227e00
+67e348ea
+20600000
+58000000
+67e0c8e9
+67e2c8f4
+20600000
+20406eb3
+20758000
+580060a1
+67e14394
+58006053
+67e14396
+58006104
+67e14398
+58006088
+67e1439c
+580060df
+67e1447e
+2040603c
+44b1400c
+20406110
+6fe0c474
+c000604a
+6fe0c475
+67e0c437
+2020611f
+580060a5
+67e1438e
+580060a3
+67e14390
+580060ba
+67e14479
+58006118
+67e1447b
+70412007
+2040410b
+20406107
+20406c51
+20406ff8
+20206ef8
+704437ff
+70447601
+202060ba
+6fe0c476
+c0014df4
+204066de
+6fe0c3f3
+243a4df4
+20204df6
+1a627e00
+c00a605c
+c00ae060
+c01fe063
+c0206069
+c0086134
+c016606f
+c016e07a
+20600000
+204060a7
+58000000
+67e1444e
+20204e11
+20406ff8
+70444700
+202060ba
+20406ff8
+70444701
+6fe44458
+67e442a8
+20404e17
+202045c0
+6fe14311
+c1000000
+6fe44460
+207a0000
+67e442a8
+202045c0
+6fe0c474
+c1000000
+6fe0c476
+c1808000
+20406075
+20204e0f
+70467601
+df20000b
+d8a04677
+d8c04660
+20207419
+6fe0c474
+c1000000
+6fe0c476
+c000e07f
+20206130
+6fe0c676
+c1808000
+70467600
+6fe14434
+c284ce11
+df20000b
+d8c04677
+d8a04660
+20207419
+2040608b
+20406092
+2020609c
+da604472
+da40608e
+20204dd3
+70447602
+20404e11
+204060c8
+2020611c
+da604683
+da406095
+20204dcc
+6fe14434
+c284e11c
+6fe0c660
+c000e11c
+c002611c
+c002e11c
+20204e13
+6fe0c476
+c1808000
+da60444e
+da4060ab
+20204dd3
+204060f0
+20206c81
+20406bc9
+20206c75
+20406bc9
+20206eb7
+6fe1446e
+67e14470
+67e14472
+20204e01
+6fe0c476
+c1808000
+6fe14434
+c3848000
+6fe1446c
+67e14470
+67e14472
+6fe1444a
+20406145
+20404e0d
+6fe24454
+67e24663
+6fe14434
+c3858000
+20204e03
+6fe0c476
+c1808000
+6fe1444e
+6849444c
+6049444e
+247a0000
+6fe14448
+20406145
+20404e0d
+6fe24450
+67e24663
+6fe14434
+c3858000
+20204e03
+6fe14434
+c284ce0b
+202060a7
+204074ca
+6fe14434
+c284e0cf
+20600000
+6fe0c447
+207a0000
+202074c8
+204074ca
+6fe14434
+c3848000
+202074c8
+202060ba
+78567c00
+6fe14470
+67e14472
+204060d2
+203460d6
+204060cb
+24740000
+202074cc
+204060d7
+24760000
+1a227e00
+203a60e6
+20404e0f
+da604488
+202060e8
+20404e11
+da6044b0
+dfe00005
+98effe00
+9a60a600
+efe08013
+207a0000
+204060fc
+1a60a601
+202060eb
+6fe14434
+c284e0f3
+20600000
+204041cc
+247a0000
+204060ff
+24740000
+1fe0ffff
+1feffe05
+d84044d8
+98408c00
+20206149
+67e084c4
+da2004c4
+20206ffd
+da2004c4
+20407015
+24740000
+6fe084c4
+20600000
+6fe1436f
+c00c6063
+20600000
+70468202
+58200008
+67e24458
+592c0005
+e7e20005
+7042b617
+5800001b
+67e14307
+202041e5
+df200028
+d8a044d8
+d8c04807
+2020740c
+df200280
+d8a04b10
+d8c09535
+2020740c
+da200000
+da60466b
+20406f16
+204060c8
+6fe0c682
+67e0c683
+20600000
+58000000
+2040612b
+70442f01
+20406ec2
+20406ecc
+6fe0c689
+203a6128
+6fe084f1
+c3016137
+6fe14434
+c3860000
+20204e13
+684943e2
+e7e08002
+efe08005
+67e0c436
+20600000
+6fe143e2
+efe0803f
+c1800000
+20204e13
+684943e2
+efe08002
+c000e13f
+58000001
+684943e2
+e7e08002
+18408c02
+efe08006
+e7e08036
+efe10006
+20207487
+58000002
+2040612b
+18408c05
+efe10006
+203a4e13
+20207487
+67e140a5
+1fe0fffc
+67e14360
+20600000
+efe08006
+1fe22200
+e8410006
+204073c0
+20404513
+1a227200
+204073ba
+20207419
+5800468b
+67e142cc
+20600000
+580093c0
+67e142cc
+20600000
+6fe14684
+67e14480
+6fe0c686
+67e0c662
+67e0c66d
+6fe0c687
+67e0c474
+6fe0c688
+67e0c475
+58000030
+67e14445
+58000000
+67e1443d
+58000002
+67e14488
+67e1448d
+58000006
+67e144b0
+67e144b5
+58000007
+67e14492
+58000008
+67e144ba
+58004476
+67e143e2
+58201400
+67e1c476
+70409401
+58000100
+67e140a5
+7040a708
+7040c105
+7040c202
+58000096
+67e14450
+e7e10005
+58000296
+67e14454
+e7e10005
+38000010
+38048008
+380ac000
+380c0004
+67e44460
+70443901
+58004660
+67e1443a
+58000000
+67e14660
+380001a0
+38040068
+38080000
+380c0000
+67e44663
+58000301
+67e1466b
+380001a0
+380400e8
+38080000
+380c0000
+67e4466e
+5800000e
+67e14448
+58000140
+67e1444a
+67e14360
+58000050
+67e1444c
+70436a07
+70435f00
+380000fb
+3806c212
+3808800f
+380c0021
+67e44384
+38000bb8
+380402ee
+67e2446c
+58004591
+67e143b4
+58002001
+67e14591
+70431f1f
+38010102
+380480c1
+38098120
+380c640c
+67e4c320
+380003c1
+e7e10005
+70433f1f
+3802090d
+38074c15
+380a8532
+380dd1d5
+67e4c340
+38026574
+3804001c
+e7e18005
+5800447d
+67e143de
+70447d02
+580045b6
+67e143b1
+7043b305
+6fe0c68a
+c0006151
+c000e154
+20600000
+6fe34e00
+67e34480
+70447d06
+5800447d
+67e143de
+20600000
+6fe3ce00
+67e3c480
+70447d07
+5800447d
+67e143de
+20600000
+6fe0cdff
+c00361c4
+c003e1ca
+20600000
+44b1c00c
+6fe44e26
+67e4446c
+58000096
+67e1444c
+6fe3ce76
+67e3c660
+6fe3ce7d
+67e3c66b
+6fe24e84
+67e24450
+6fe24e88
+67e24454
+5800000e
+67e14448
+58000140
+67e1444a
+67e14360
+580093c0
+67e142cc
+20406114
+6fe44e1e
+67e44460
+20600000
+20406eb3
+20758000
+204061d0
+204061d4
+58006436
+67e14314
+58006204
+67e14394
+5800625d
+67e14396
+58006426
+67e14398
+58006235
+67e1439c
+5800627d
+67e1447e
+2040603c
+58000027
+67e14307
+6fe44460
+67e44458
+2040620e
+44b2400c
+20206037
+2040621b
+d8e00009
+2040742e
+247a0000
+58000020
+d8e00009
+20407420
+78547c00
+20406c75
+202062e0
+5800001f
+1feffe0a
+d8404b10
+9840a200
+1a20a203
+d8400062
+e0408011
+1a20a20b
+dfe00fff
+98467e00
+1ff27e00
+e7e10011
+20600000
+6fe14434
+c284e220
+d8a04593
+df200023
+202073ec
+204041cc
+247a0000
+20407027
+207a0000
+684a494f
+1c427e00
+98460400
+20628000
+2421622c
+6fe0c94e
+98467c00
+20610000
+1c427e00
+67e2494f
+204060ff
+24740000
+1fe0ffff
+1feffe0a
+d8404b10
+98408c00
+20206149
+20406596
+2040623a
+20406251
+2040608b
+20206257
+da604de1
+da40623d
+20204dcc
+20407027
+247a0000
+6fe1483d
+247a0000
+20406499
+203a624b
+18e27e00
+2fe00e04
+2020e24d
+18e27e00
+2fe00e01
+2020e24f
+da604dd8
+202060eb
+da604dea
+202060eb
+da604def
+202060eb
+da604df7
+202060eb
+da604b0d
+da406254
+20204dcc
+df20000a
+d8a0495d
+202073ec
+da604683
+da40625a
+20204dcc
+6fe14434
+c284e11c
+20204e13
+1a627e00
+c00a6271
+c00ae26d
+c018e264
+c1200000
+c0196429
+20206053
+704de201
+204064c2
+6fe14e90
+67e14dd0
+68494e92
+58000fff
+98467e00
+67e14dd2
+20600000
+704dcd00
+704de200
+2040631e
+20206060
+1c427e00
+67e2494f
+20406492
+2020605c
+78567c00
+6fe14470
+67e14472
+204060d2
+203460d6
+204060cb
+24740000
+202074cc
+20406275
+24760000
+1a227e00
+203a62ac
+704b0e01
+20404e0f
+204062a1
+204062d3
+20610000
+18e27e00
+6848cde5
+98467c00
+2442e29b
+18e27e00
+67e0cde5
+6848cde8
+98467c00
+2022e299
+6fe0cde9
+243a6294
+2040649b
+dfe0000a
+202062cc
+204064be
+18e27e00
+c000e291
+204063a3
+20206356
+704de601
+20206356
+44b2c00c
+6fe0cde9
+203a6241
+18e27e00
+c000e241
+20600000
+dfe0000a
+98effe00
+da604953
+9a60a600
+1c427e00
+e7e20013
+1a60a604
+efe08013
+1fe0fe01
+e7e08013
+20600000
+44b3400c
+6fe0cde9
+205a4e11
+dfe0000a
+98effe00
+da604953
+9a60a600
+e8420013
+18467c00
+20628000
+1c427e00
+98460400
+24416f56
+1a608c09
+efe08006
+243a62d8
+1a60a605
+1c427e00
+e7e20013
+20600000
+1a608c04
+efe08006
+202062c3
+204062dd
+6fe0cde9
+243a62cf
+204062d3
+20610000
+204064a1
+18e27e00
+c001e4a9
+dfe0000a
+98effe00
+9a60a600
+202060eb
+18e27e00
+c000e2c6
+c001e2c6
+20600000
+2040702f
+e8408006
+98467e00
+1fe67c0a
+20600000
+704de001
+204062dd
+da6049f4
+dfe00003
+202062cc
+df20000a
+1a620a00
+202073ec
+6fe1483d
+67e143e0
+2040632a
+6fe143e0
+67e1483d
+d8e00000
+6fe0c47d
+1fe27200
+da604953
+1f227e00
+67e104cc
+1a627e00
+67e104e0
+18e27e00
+67e104ce
+20406320
+6fe104e0
+1fe22600
+6fe104ce
+1fe20e00
+204062fd
+6fe104ce
+1fe08e01
+6fe104e0
+1fe0a60a
+6fe104cc
+1fe27200
+c20062e9
+20600000
+efe20013
+207a0000
+1fe20400
+1c427e00
+98460400
+24610000
+580009c4
+98467c00
+20610000
+1c427e00
+e7e20013
+1a60a609
+58000001
+e7e08013
+6fe0cde0
+207a0000
+704de000
+44b3c00c
+6fe0cde7
+c0006313
+c000e316
+20600000
+da6049df
+dfe00003
+202062cc
+18e27e00
+6848cde8
+98467c00
+2422e313
+6fe0cde9
+79407e00
+67e0cde9
+247a0000
+704de900
+20204e11
+1a60a405
+efe20012
+207a0000
+1fe20400
+1c427e00
+98460400
+24416f56
+580003e8
+98467c00
+202062c0
+6fe143de
+efe0803f
+207a0000
+58000000
+67e10546
+20406c5d
+24346ef1
+20406eef
+78547c00
+44b4400d
+6fe0cde7
+c000e339
+2040638a
+2040633e
+20740000
+6fe10546
+67e1054d
+70054f00
+18000e00
+20206c95
+d8e00000
+da404a09
+dfe00002
+98effe00
+9a40a400
+efe10012
+207a0000
+68490546
+9842fc00
+2022e34a
+18e08e01
+2020633f
+67e14a15
+20404e0f
+da604a17
+dfe0000a
+98effe00
+9a60a600
+20406352
+20206395
+204064be
+efe08013
+207a0000
+204063a3
+204064be
+2040636b
+20406376
+20406380
+dfe00005
+204060fc
+20406499
+207a0000
+70494e78
+dfe00006
+202060fc
+6848cdcc
+20406499
+207a0000
+6848cdcf
+18408401
+6fe0cde6
+207a0000
+6848cdcc
+704de600
+20600000
+20406361
+18427e00
+207a0000
+67e0cdd5
+dfe00013
+204060fc
+6fe0cdd5
+1fe0ffff
+67e0cdd5
+207a0000
+2020636f
+6fe0cdce
+207a0000
+67e0cdd6
+dfe00020
+204060fc
+6fe0cdd6
+1fe0ffff
+67e0cdd6
+207a0000
+20206379
+6fe0cdcf
+207a0000
+67e0cdd7
+dfe00021
+204060fc
+6fe0cdd7
+1fe0ffff
+67e0cdd7
+207a0000
+20206383
+6fe14a15
+207a0000
+68490546
+18467c00
+2022e398
+98467c00
+20628000
+60494a15
+6fe14de3
+98467c00
+2042ce11
+6fe10546
+67e143e0
+202074c8
+20404e11
+da604a53
+20406352
+58000000
+67e14a15
+70482f32
+20406395
+6fe0c47d
+1feff20a
+d8a04953
+202073ec
+44b4c00d
+6fe0cde7
+c000e3a8
+c00063ae
+20600000
+18e27e00
+c002e3d7
+c00063f4
+c00263fc
+c001641f
+20600000
+efe08013
+c000e3d7
+c00163f4
+c001e3fc
+c002641f
+c002e3b5
+20600000
+20406499
+243a63bf
+58000004
+1feffe0a
+d8404b10
+98408a00
+18a08a03
+6fe1ca5d
+e7e18005
+20600000
+58000004
+1feffe0a
+d8404b10
+98408a00
+18a08a03
+6fe14dd0
+e7e18005
+18a08a07
+6fe14dd2
+1ff27e00
+1fed7e00
+e7e18005
+20600000
+6fe0cdce
+207a0000
+1fe0ffff
+67e0cdce
+dfe00062
+20600000
+d840000a
+20406499
+207a0000
+d8400007
+20600000
+204063d2
+6fe14dd0
+98467c00
+244163cc
+24610000
+98467e00
+67e14dd0
+44b5400d
+6fe14dd0
+68494dd2
+184d0400
+18520400
+9840fe00
+67e1ca5d
+202063b5
+6fe14dd0
+d8400062
+98460400
+24610000
+18427e00
+6848cdce
+18467c03
+2022e3f1
+18408401
+6048cdce
+202063dd
+704dce00
+dfe00000
+202063dd
+20406499
+245a63e6
+204063d2
+6fe14dd0
+9840fe00
+d8400fff
+20407480
+202063dd
+204063d2
+6fe14dd2
+98467e00
+67e14dd2
+68494dd2
+20406499
+203a63de
+58000fff
+98467e00
+d8400062
+98460400
+242163de
+58000fff
+98467e00
+6848cdcf
+18467c05
+2022e410
+18408401
+6048cdcf
+2020641d
+704dcf00
+58000fff
+2020641d
+20406499
+203a6411
+6fe0cdcf
+203a6411
+1fe0ffff
+67e0cdcf
+58000fff
+d8400062
+98467e00
+9a20fe00
+67e14dd2
+202063de
+204063d2
+6fe14dd2
+9840fe00
+d8400fff
+98462200
+20216413
+2020641d
+6fe1436f
+c0126063
+20600000
+da200017
+da400004
+2040419f
+58000006
+e7e08005
+58000001
+e7e10005
+5800ffff
+e7e10005
+58002800
+e7e10005
+d8c0493d
+202073d2
+6fe1430e
+1fe08c02
+efe10006
+c002643d
+c00345e3
+c002c5b7
+20600000
+efe18006
+67e1c36e
+c003e46d
+c000e48e
+c005645c
+c0066444
+20204331
+efe10006
+67e1050a
+da200014
+20404535
+5800000d
+e7e08005
+6fe1050a
+98002200
+6849436f
+6fe14307
+98467c00
+2422c47d
+20406499
+243a6454
+6fe14939
+20206455
+6fe1493b
+d8c0483f
+9a267200
+24214528
+1f267c16
+20214485
+18007216
+20204485
+6849436f
+6fe0c2f6
+c281e460
+20204449
+6fe14307
+98467c00
+2422c449
+204044ec
+24346467
+7001b405
+2020452a
+6fe14307
+98467c00
+2422c449
+d8c0483f
+18007e16
+20204457
+44b5c00d
+704dcc05
+70494d01
+704dd401
+70494ef0
+704de10a
+704de601
+204064fe
+6fe0cde2
+207a0000
+204064c2
+d8400062
+6fe14e94
+da204dd0
+da404dce
+20406487
+d8400062
+6fe14e96
+da204dd2
+da404dcf
+20406487
+58000fff
+68494dd2
+98467e00
+67e14dd2
+20600000
+9846fc00
+20407475
+1807fe00
+18070400
+e7e08012
+e0410011
+20600000
+18c08dfe
+efe08006
+c0036497
+20600000
+704dcc01
+70494d00
+704dd400
+70494e0a
+20600000
+20406492
+202064fe
+6fe0c94d
+20600000
+da604e30
+20406499
+207a0000
+70494e78
+da604a61
+20600000
+da604999
+20406499
+207a0000
+da604a9d
+70494e0c
+18e27e00
+c1008000
+20600000
+44b6400d
+6fe0cb0c
+79407e00
+67e0cb0c
+c00064b2
+c000e4b0
+20600000
+204064b9
+202060eb
+204064b4
+202060eb
+da6049b7
+20406499
+207a0000
+da604abb
+20600000
+da604af8
+20406499
+207a0000
+da604b02
+20600000
+6fe0cdcd
+247a0000
+704dcd01
+202063de
+58000000
+67e3cdce
+20600000
+20406499
+c000e4cd
+c00064df
+20600000
+6fe0ce9c
+c000e4e6
+c00064f8
+20600000
+6fe0cdce
+1feffe62
+1fe20400
+6fe14dd0
+9840fe00
+67e14e98
+6fe0cdcf
+1feffe62
+1fe20400
+6fe14dd2
+1fe22200
+58000fff
+9a267e00
+9840fe00
+67e14e9a
+20406499
+67e0ce9c
+20600000
+6fe14dd0
+67e14e98
+6fe14dd2
+67e14e9a
+20406499
+67e0ce9c
+20600000
+6fe14e98
+1fe6fc62
+20407475
+1807fe00
+18070400
+67e0cdce
+18427e00
+67e14dd0
+6fe14e9a
+1fe6fc62
+20407475
+1807fe00
+18070400
+67e0cdcf
+58000fff
+98467e00
+67e14dd2
+20600000
+6fe14e98
+67e14dd0
+6fe14e9a
+67e14dd2
+20600000
+2020657b
+20206562
+20406521
+6fe14e9f
+2040658e
+704ea500
+6fe2ce98
+704ea600
+704ea300
+20406525
+6fe0cea3
+c1000000
+202064ff
+6fe14e8c
+1fe0fffb
+67e14e9f
+20600000
+6fe14e9f
+1fe0fffb
+67e14e9f
+20600000
+6fe14e9f
+1fe0fe05
+67e14e9f
+20600000
+6fe14ea1
+1fe0fe05
+67e14ea1
+6fe14ea1
+1fe20400
+6fe14e8c
+98467e00
+d8400005
+98467c00
+24216545
+20600000
+6fe0cea5
+c000e50a
+c000650e
+20600000
+da400000
+1a420400
+6fe14e98
+a843fe00
+2440e535
+da400000
+1a420400
+6fe14e9a
+a843fe00
+2440e535
+da400000
+1a420400
+6fe0ce9c
+a841fe00
+2440e535
+20600000
+6fe0cea3
+1fe0fe01
+67e0cea3
+20600000
+704ea301
+20406516
+6fe14ea1
+2040658e
+20406499
+1fe20400
+6fe0ce9c
+a841fe00
+2040e560
+6fe0cea3
+c1000000
+20206539
+44b6c00d
+20406560
+20406499
+203a654a
+20206551
+6fe14e90
+67e14dd0
+68494e92
+58000fff
+98467e00
+67e14dd2
+202064fd
+d8400062
+6fe14e94
+da204dd0
+da404dce
+20406487
+d8400062
+6fe14e96
+da204dd2
+da404dcf
+20406487
+58000fff
+68494dd2
+98467e00
+67e14dd2
+202064fd
+704ea300
+20600000
+44b7400d
+704ea501
+204064ff
+6fe14e8e
+1fe20400
+6fe14e9f
+98467e00
+d8400000
+98467c00
+24610000
+6fe14e9f
+1fe20400
+6fe14e8c
+1fe0fffb
+98467e00
+6fe14e9f
+67e14ea1
+20406539
+6fe14ea1
+2442e58e
+704ea300
+20406525
+6fe0cea3
+c1000000
+202064c9
+44b7c00d
+704ea501
+204064ff
+68494e8e
+6fe14e9f
+98467e00
+d8400000
+98467c00
+24610000
+68494e9f
+6fe14e8c
+98467e00
+d8400000
+98467c00
+24610000
+6fe14e9f
+67e14e9d
+204064c5
+20206591
+d8400005
+da204e98
+202068c9
+df200005
+da204e98
+6fe14e9d
+1fe20400
+20206883
+da60482f
+da4064fd
+20204dcc
+6fe0c3f1
+d840003e
+20206bbc
+6fe0c3f1
+d840003f
+20206bbc
+2040659c
+20406599
+2020659c
+204065a0
+20206599
+202065a0
+204065a0
+202065a2
+20206599
+6fe0c3f2
+2020659a
+6fe0c3f2
+2020659d
+204065a8
+204065aa
+202065a8
+204065f8
+202065b1
+44b9c00e
+7001e801
+7001ea01
+7001ec19
+7001ed02
+6fe101ef
+20407487
+6fe401e7
+67e401df
+6fe081ee
+67e0c116
+6fe081e9
+c000e5bf
+c0016650
+684881e7
+6fe081ea
+c00165c3
+c000e5df
+44ba400e
+2040663d
+204039c9
+2040660b
+79202a00
+782efc00
+78307c00
+7850fc00
+20403d8c
+6fe081eb
+67f0890d
+202065cf
+44bac00e
+6fe081e8
+c000e5d2
+6fe081ec
+c00ce5d6
+c03c65d9
+c07865dc
+df200035
+d8c00b00
+2020662e
+df2000cb
+d8c00b00
+2020662e
+df200162
+d8c00b00
+2020662e
+44bb400e
+2040663d
+204039c9
+7843fc00
+782efc00
+78307c00
+684881e8
+18422a00
+6fe081eb
+67f0890d
+c00065cf
+44bbc00e
+6fe081ec
+1fe27200
+d8c00b00
+efe08006
+08008608
+c20065ee
+6fe101ef
+20407487
+6fe401e7
+684c01df
+98467c00
+2022e5ea
+202065b1
+df2003fe
+d8a00b00
+580001ff
+18002400
+1fe92200
+1a232200
+9a22a200
+2a2ffe00
+7920fe09
+18430400
+2feffe00
+79208407
+1fe37e00
+1a40a401
+2a400e00
+2420e5fc
+e0408005
+c20065fc
+20600000
+44bc400f
+793f802f
+70890103
+70892084
+708925a7
+70893003
+70893740
+708a6d85
+708a6d89
+6fe08164
+c3968000
+70890101
+70892080
+708a6d05
+708a6d09
+7920002f
+70890105
+70893024
+7089340a
+20600000
+44bcc00f
+18002a08
+18002a00
+7850fc00
+78507c00
+782f7c00
+70890005
+20000002
+70890000
+2040663d
+708a1600
+708a0a10
+708a0b00
+20600000
+2020661f
+efe08006
+08008608
+c200662e
+2040662d
+78287c00
+db600350
+2021e5b1
+6fe101ef
+20407487
+6fe401e7
+684c01df
+98467c00
+2022e634
+2040662d
+202065b1
+44bd400f
+70890005
+20000002
+70890000
+708a10aa
+708a11aa
+708a1215
+708a0af8
+708a0b04
+20000078
+708a167a
+708a1700
+708a1800
+708a1900
+708a1a00
+708a112a
+708a0a78
+708a4300
+20600000
+20406659
+44bdc00f
+6fe101ef
+20407487
+6fe401e7
+684c01df
+98467c00
+2022e651
+202065b1
+44be400f
+2040662d
+20403954
+58000500
+20403a8c
+2020396a
+2035e664
+58004402
+d8a043f3
+98a67200
+204073ec
+20600000
+44bec00f
+204066de
+6fe0c3f3
+c00074d8
+c000f4d8
+c00174d8
+c001f4d8
+c040f4d8
+c06074d8
+c04074d8
+c02074d8
+20600000
+d8e00000
+da400000
+18e67c07
+24610000
+aa2fffff
+2020e678
+2020667c
+18427e00
+203a667c
+f9202400
+184085ff
+18e08e01
+20206673
+6b014316
+6d614318
+204074ca
+20206682
+44bf400f
+204066ce
+243a3a8a
+204066de
+df200008
+6848c3f3
+1f260e08
+a84fffff
+2020e68f
+20406696
+2421668f
+204066ac
+20206693
+1d627e00
+9b00b000
+c2006687
+20203a8a
+1b027e00
+1b020a00
+20600000
+44bfc00f
+1f260e08
+d8400000
+d9600000
+18e27e00
+c00466a7
+6fe0c3f3
+afefffff
+2020e6a7
+f9201600
+1d627e00
+98408400
+18e08e01
+1a227e00
+98467c00
+2022e6a7
+2021669a
+18427e00
+9a267c00
+24628000
+f9201600
+20600000
+44c04010
+204066ce
+243a3a8a
+204066d4
+203a66b5
+6fe4c3f7
+67e4c3f4
+58000000
+e7e18005
+6160c3fd
+630143fe
+20600000
+44c0c010
+204066d7
+18c08c01
+efe10006
+20600000
+44c14010
+204066d7
+18c20a00
+18c20400
+58000000
+e7e18005
+20600000
+44c1c010
+204066d4
+203a3a8a
+6fe1c3fa
+67e1c3fd
+6fe1c3f7
+67e1c3fa
+6fe1c3f4
+67e1c3f7
+20600000
+44c24010
+6fe1c3f4
+20600000
+44c2c010
+6fe1c3f7
+20600000
+44c34010
+6fe1c3fd
+20600000
+204066d4
+203a66dc
+d8c043f4
+efe18006
+203a66da
+18c08dfd
+20600000
+44c3c010
+df200004
+d8c043f4
+d8400000
+efe18006
+1fe17eff
+98418400
+c20066e2
+6048c3f3
+20600000
+203a3a8a
+1fe20a00
+20600000
+44c44011
+da400000
+da2043f4
+1a20a3fe
+1a20a202
+58004400
+9a267c00
+2022e6fb
+efe08011
+1a20a201
+203a66ef
+e8410011
+efe10002
+9a40a400
+1a40a404
+202066ef
+1a427e00
+20600000
+d8e0000c
+20203c21
+d8e0000c
+20203c25
+204066de
+6fe0c3f3
+207a0000
+204066eb
+d8400100
+98467c00
+202166fd
+204066ff
+6fe14400
+18c20a00
+da2043f4
+58004400
+9a267c00
+20628000
+efe08011
+1a20a201
+243a6715
+e7e10005
+1a20a202
+2020670c
+efe10011
+1a20a202
+1fe20c00
+efe10006
+e7e10005
+1fe27200
+1f20f202
+20407419
+2020670c
+204066de
+6fe0c3f3
+207a0000
+da2043f5
+1a20a3fd
+18c20a00
+6fe14400
+18a20c00
+1a20a203
+58004401
+9a267c00
+20628000
+efe10006
+203a6726
+1fe0fe04
+1fe27200
+18c22400
+efe10011
+1fe20a00
+1a420c00
+18c08dfe
+20407419
+20206726
+44c4c011
+18427e00
+1fe17eff
+1fe67c0d
+24213a8a
+d8a08070
+98a08a00
+18a22200
+d840003e
+e0408005
+20406745
+2000001e
+1a220a00
+d840003f
+e0408005
+20206749
+6ff08081
+1fe17e7f
+67f08081
+20600000
+6ff08081
+1fe1fe80
+67f08081
+20600000
+20206943
+2020694a
+6ff0806f
+1fe17efd
+67f0806f
+20600000
+24346757
+6ff0806f
+1fe1fe02
+67f0806f
+18427c00
+2022e75a
+1a627a00
+2fcc0000
+20206834
+18000404
+da2001c4
+2040674f
+20406757
+da2055aa
+6fe101c4
+e8410006
+9a267c00
+20600000
+20546777
+d8400002
+da2001ca
+20406757
+6fe101ca
+67e101bd
+2054676d
+20600000
+d8400010
+da2001cc
+2040674f
+20406757
+d8c001cc
+df200010
+20406e6f
+20406df6
+20406e8b
+20206df0
+70802300
+2040674f
+20206e8b
+58000000
+67e104ed
+7856fc00
+2040675c
+24628000
+7836fc00
+70802380
+70802200
+70802400
+da208025
+20406753
+70802300
+6fe081ba
+c4000000
+d8400006
+2040675d
+2422e799
+efe10006
+98002200
+20406757
+20406790
+20206788
+6fe104ed
+df200006
+d8c001c4
+204074da
+6f2101c6
+1a220c00
+204074da
+67e104ed
+20600000
+6fe081de
+c02d67a7
+da20aa55
+6fe101c4
+9a267c00
+2422e7a9
+da2055aa
+6fe101c6
+9a267c00
+2422e7a9
+6fe101c8
+684904ed
+98467c00
+2422e7a9
+7920220f
+2020675a
+7001ba00
+20600000
+6ff1011e
+67e101b8
+793ffe0e
+247a0000
+580007d0
+da2001b8
+d8400002
+204068c9
+6fe081ca
+1ff18400
+6fe081b8
+1ff27e00
+9841fe00
+67e081b8
+202068de
+70805025
+20407484
+78547c00
+7001ba00
+20406856
+204068d6
+58000000
+da2001ca
+d8400002
+204068c9
+204067ab
+580007d3
+da2001dd
+d8400002
+204068c9
+6fe081b8
+c301e7d4
+580007f0
+da2001cc
+d8400010
+204068c9
+70800608
+7920002b
+d8c001cc
+20406e7b
+78347c00
+70411500
+20406825
+24216831
+20546777
+6fe101ca
+1ff0fe00
+d84007ff
+98417e00
+2022e7e6
+2040687f
+da6068cc
+2054676d
+2040677a
+2436e7e6
+6fe081ba
+2fe00603
+2420e7d5
+204067f4
+20406873
+70411500
+20406825
+24216831
+20406817
+20406a3c
+6fe081b8
+c2816800
+2040681f
+2436e7f7
+6fe081ba
+2fe00603
+2420e7e8
+20206800
+580001ff
+dfa00000
+20600000
+20406a39
+6fe081b8
+c2816800
+2040681f
+2436e800
+6fe081ba
+2fe00603
+2420e7e8
+20206810
+70411500
+20406825
+24216831
+6fe081b8
+c280e810
+2040698c
+200000c8
+2040699b
+20000064
+da6069cf
+20406765
+2040677a
+2436e810
+6fe081ba
+2fe00603
+2420e801
+58000000
+67e401cc
+67e401d4
+18007004
+20406e8c
+70805021
+20600000
+6fe0c3db
+6848c3da
+98467c00
+2422ea22
+7043d902
+7043da01
+7043db00
+20206a22
+58000000
+67e101bd
+da606a5f
+20406a0b
+20406765
+2020677a
+2040682b
+6fe0c115
+1fe0fe01
+1fe67c03
+67e0c115
+20600000
+6fe0c115
+207a0000
+6fe081dd
+207a0000
+1fe27200
+202073d9
+20406810
+2040748a
+20600000
+6fe081ba
+1fe3fe00
+7920fe00
+2a2c000f
+20608000
+67e081ba
+20600000
+6ff0806f
+c4008000
+20206841
+6ff08128
+afefffff
+20608000
+6ff08108
+c300e83e
+20406df0
+2020683e
+6fe140e9
+207a0000
+70802380
+70802200
+70802400
+684940eb
+184bf200
+98000c00
+efe08006
+67f08025
+c200684d
+70802300
+20600000
+708aa004
+708aa131
+708aa201
+20206859
+708aa00c
+708aa1fb
+708aa203
+67e104d4
+44c54011
+708a01ff
+6ff08a0b
+67e084d6
+1fe1fe04
+67f08a0b
+6ff08a13
+67e084d7
+708a1311
+200003e8
+6ff08a02
+1fe1fe01
+67f08a02
+708a0003
+44c5c011
+6ff08aa0
+1fe1fed0
+67f08aa0
+20001770
+6ff08aa0
+1fe1fe20
+67f08aa0
+20002ee0
+6fe104d4
+20600000
+44c64011
+708aa004
+708aa143
+708aa201
+6ff08a02
+1fe17efe
+67f08a02
+6fe084d6
+67f08a0b
+6fe084d7
+67f08a13
+20600000
+1fe9fe00
+67f10045
+70804b00
+20600000
+20406852
+2040687f
+204068b1
+e8408011
+1a20a201
+18000e00
+a84c0000
+2020e8a8
+6ff08046
+79207e06
+79207e07
+67f08046
+70804702
+70804782
+793ffe07
+67f08046
+7080478a
+2000000b
+708047ca
+20000021
+7080474a
+200000c8
+708047ca
+20000016
+7080478a
+20000021
+70804782
+20000001
+70804792
+2000000a
+708047b2
+6ff08007
+70804792
+20000001
+70804782
+afec0000
+2020e889
+6ff10045
+1fe0fe01
+67f10045
+18e08e01
+28e01e08
+2420e889
+c2006886
+70804783
+20206873
+70804782
+2000000c
+70804780
+70804782
+20000096
+20600000
+204068b1
+708047a2
+1a227e00
+67f10048
+7920040b
+2fec000f
+7920840f
+6059004a
+70800701
+20600000
+6ff08128
+c300e8c1
+70804783
+20600000
+44c6c011
+20406856
+204068c9
+20206873
+2040687f
+204068b7
+202068c1
+20406856
+6ff10122
+67f10045
+204068b7
+d8e00001
+2040683b
+204068c1
+2feffe00
+20406834
+20206873
+580007d2
+da2040cc
+d8400001
+204068c9
+6fe0c0cc
+243a68dd
+7040cc04
+20203c0e
+6fe101b8
+1ff1fe00
+207a0000
+6fe081b8
+1ff1fe00
+c00268ec
+c005e8f0
+c00468f4
+c003e8f8
+c004e8fc
+c00568fc
+c0066900
+c007e907
+2020691b
+dfe0522c
+d8406596
+2040690e
+20206903
+dfe04e38
+d8406596
+2040690e
+20206920
+dfe06028
+d8406596
+2040690e
+20206903
+dfe04296
+d8404786
+2040690e
+20206903
+dfe04e38
+d8406024
+2040690e
+20206903
+dfe050b8
+d8406596
+2040690e
+dfe074e8
+d8407de4
+20406914
+20206920
+dfe050b8
+d8406596
+2040690e
+dfe04296
+d8404786
+20406914
+20206920
+18500400
+9841fe00
+67f2004c
+20206935
+dfe0432f
+d8404786
+18500400
+9841fe00
+67f2004c
+20206937
+dfe0478b
+d84048fa
+20206914
+20406918
+dfe0432f
+d8404786
+2040690e
+20206920
+6fe101b8
+79207e0d
+79207e0e
+67f2004c
+20406927
+70801108
+20600000
+58000002
+37d98200
+67f08012
+37d98200
+37d98200
+20600000
+6ff1011e
+793ffe0e
+67f2004c
+20206927
+6ff1011e
+79207e0e
+67f2004c
+20206927
+58000004
+20206928
+58000008
+20206928
+44c74011
+6fe0c3ae
+67f08080
+6fe0c3af
+67f08081
+580001bb
+67f10084
+580001c0
+67f10086
+20206745
+79207e07
+67e101bb
+44c7c011
+70808202
+70808800
+70800602
+20206953
+18000401
+67e081bb
+44c84012
+70808201
+60590088
+70800602
+20406953
+6fe081c0
+20600000
+20000005
+6ff08128
+c301e953
+20600000
+6fe0c3d2
+c000e95e
+c0016964
+c001e96c
+c0026970
+c002e977
+20600000
+67e1c3cb
+1a227e00
+67e143ce
+604943d0
+7043d202
+2020698c
+2040698c
+7043d203
+20406992
+da2001bb
+70808204
+6fe1c3cb
+d8400020
+202069a3
+2040698c
+204069c6
+7043d204
+20600000
+44c8c012
+2040698c
+7043d205
+20406992
+20406984
+2040699f
+2020697f
+2040698c
+20406992
+58000005
+2040694a
+c3800000
+7043d200
+6fe143a0
+20207487
+6fe204cc
+684943ce
+184085fc
+e7e20002
+20600000
+684943ce
+18422200
+184085fc
+efe20002
+67e204cc
+684943d0
+6fe1c3cb
+20600000
+44c94012
+204069f1
+20406745
+58000000
+67e201bb
+20600000
+7001bb06
+58000000
+67f10088
+58000001
+67f10082
+580001bb
+67f10084
+70800602
+20206953
+7001bbab
+20206993
+7001bbb9
+20206993
+18408404
+60590082
+d8400002
+1a20a3fc
+e0408011
+1ff10400
+e0408005
+1fec8400
+e0408005
+e7e08005
+1a227e00
+67f10084
+58000000
+67f10088
+70800602
+20406953
+202069c6
+60590088
+1ff10400
+604881bc
+1fec8400
+604881bd
+67e081be
+58000004
+67f10082
+7001bb03
+580001bb
+67f10084
+1a227e00
+67f10086
+6ff08080
+2a2c000f
+7920fe06
+67f08080
+70800602
+6ff08128
+c283e9c2
+d8e00003
+20206953
+580007d0
+20403a8c
+20406992
+580001c0
+67f10086
+58000005
+2040694a
+c28069c6
+20600000
+60590088
+58000004
+67f10082
+7001bb03
+580001bb
+67f10084
+1a227e00
+67f10086
+6ff08080
+2a2c000f
+7920fe06
+67f08080
+70800602
+6ff08128
+c283e9dc
+d8e00003
+2040683b
+20406953
+2feffe02
+20406834
+6fe081bc
+1ff02400
+6fe081bd
+1fed7e00
+9a41a400
+6fe081be
+9a41fe00
+9840fe00
+67e081be
+1fecfe00
+67e081bd
+1fecfe00
+67e081bc
+20600000
+6fe0c3d3
+6848c3d5
+98467c00
+2422e9f6
+20406a02
+6fe0c3d3
+d8400020
+20406bbd
+6fe0c3d6
+d8400021
+20406bbd
+6fe0c3d4
+d8400022
+20406bbd
+6fe0c3d5
+d840001f
+20206bbd
+7043d301
+7043d403
+7043d500
+7043d602
+7043d70b
+7043d80a
+20600000
+70801001
+20600000
+70808b05
+70808c07
+70808d07
+70808e07
+70808f07
+70809005
+70809100
+20600000
+70808b0c
+70808c0d
+70808d0d
+70808e0d
+70808f0d
+7080900c
+70809100
+20600000
+20406a50
+6fe0c3da
+d840006c
+20406bbd
+6fe0c3db
+d840006d
+20206bbd
+20406a57
+20206a1c
+6ff08128
+c302ea24
+20600000
+67e081bf
+580001bf
+67f10094
+58000001
+67f10092
+60590098
+62310096
+70808a01
+70800604
+20206a24
+58000000
+67f10098
+67f10096
+60590092
+62310094
+70808a01
+70800604
+20206a24
+79200028
+7043ad08
+20600000
+793f8028
+7043ad20
+20600000
+6fe0c3a4
+9a40fe00
+67e081bd
+20206a46
+6fe101bd
+1ff0fe00
+67e081bd
+58000003
+67f10092
+7001bca0
+7001bea1
+20206a65
+604904cc
+20406a50
+684904cc
+20406a7f
+20206a57
+6fe0c3d9
+c17f8000
+c3036a55
+580249f0
+20403a8c
+6848c3d9
+20206b96
+6848c3d9
+20206b92
+44c9c012
+c5146a3f
+6fe143a4
+9a40fe00
+1ff0fe00
+67e101bd
+44ca4012
+c5146a43
+58000004
+67f10092
+7001bca0
+7001bfa1
+580001bc
+67f10094
+60590098
+62310096
+58000002
+2a2c000f
+7920fe00
+67f0808a
+70800604
+d8e00005
+2040683b
+20406a24
+2feffe04
+20406834
+c5146a7a
+6fe101bd
+1ff0fe00
+9840fe00
+1ff0fe00
+67e101bd
+20600000
+6fe081bd
+9840fe00
+1ff0fe00
+67e101bd
+20600000
+6fe143a4
+9a40fe00
+67e104c4
+44cac012
+604904cc
+622104e3
+20406a94
+684904dc
+6a2104e3
+6fe104c4
+20406ab5
+6fe104dc
+684904e3
+98408400
+604904e3
+684904c4
+98408400
+604904c4
+6fe104cc
+243a6a85
+20600000
+44cb4012
+6fe0c3ad
+1fe0ffff
+684904c4
+9841fe00
+1fe0fe01
+67e184e0
+6fe104cc
+9840fe00
+684984e0
+98467e00
+24216aa6
+67e104cc
+6fe184e0
+684904c4
+98467e00
+67e104dc
+20600000
+6fe104cc
+67e104dc
+58000000
+67e104cc
+20600000
+1a427e00
+18408402
+60590092
+1a20a3fe
+e8418011
+18422400
+d84000a0
+e0408011
+e7e08005
+20206ac2
+1fe22400
+44cbc012
+c5146aab
+1a427e00
+18408403
+60590092
+1a20a3fd
+e8418011
+18422400
+d84000a0
+e0408011
+1ff0fe00
+e7e10005
+62310094
+58000000
+67f10098
+70808a01
+70800604
+20406a24
+e2418011
+44cc4013
+7001bf00
+58000001
+67f10092
+7001bca0
+580001bc
+67f10094
+58000000
+67f10098
+67f10096
+58000003
+67f0808a
+70800604
+20406a24
+6ff08128
+c4030000
+200005dc
+6fe081bf
+1fe0fe01
+67e081bf
+1fe67c28
+24610000
+20206acb
+44ccc013
+204074ca
+6fe0c3b3
+207a0000
+6fe14434
+c4048000
+6fe0c2a0
+c0006afb
+6fe08178
+2fe180c0
+2020eaee
+2fe18040
+2020eb00
+20206af5
+20366af2
+6fe0c284
+c300eafb
+20206af5
+20406afb
+20740000
+20206af5
+6fe0c2d3
+c283eaf8
+20206afe
+6fe30173
+67e442da
+20206afe
+70002d35
+6fe30173
+20206b01
+70002d37
+20206b01
+70002d36
+44cd4013
+6fe143b1
+e840803f
+1fe0fe01
+67e1002e
+6048802c
+6fe0c3b3
+1fe22600
+6fe1002e
+1fe22200
+20406b19
+20740000
+6849002e
+18408422
+6049002e
+184085ff
+efe08002
+67e0802c
+1a60a7ff
+2422eb09
+6fe0c3b3
+1fe0ffff
+67e0802c
+20600000
+6fe0802d
+c099eb20
+da40002d
+df200007
+20407477
+2022f4c8
+20600000
+c01b6b23
+c01beb3e
+20206b1b
+e8408011
+98467c00
+24628000
+d8a004f6
+df200010
+204073ec
+6fe18176
+67e184f6
+20406b35
+6fe10513
+1ff0fe00
+1fed0400
+efe08006
+9840fe00
+68498173
+98467c00
+2022f4c8
+20600000
+d8c004f6
+20406e7d
+efe08011
+20406e7e
+18006c38
+18006c00
+20406deb
+d8a00506
+20206e91
+e8408011
+98467c00
+24628000
+18c22200
+18c0a608
+da4042da
+df200008
+20407477
+2022f4c8
+1a622200
+da4042e2
+df200008
+20407477
+2022f4c8
+20600000
+204074cc
+20406ae0
+24346b58
+6fe1002e
+1fe08c01
+d8a042e2
+204073d2
+d8a0424c
+204073d2
+70425c01
+20600000
+70425c00
+20600000
+70002d34
+6fe0c095
+c0045b33
+20600000
+44cdc013
+79200407
+20406b85
+7d208407
+44ce4013
+18467cff
+20628000
+284c0007
+18410e1f
+6fe20016
+f920fe00
+67e20016
+6fe2001a
+fd20fe00
+67e2001a
+20600000
+44cec013
+18467cff
+20628000
+284c0007
+18410e1f
+6fe20016
+f93ffe00
+67e20016
+6fe2001a
+f93ffe00
+67e2001a
+20600000
+20406b6e
+20206b7f
+18467cff
+20628000
+2455eb62
+20406bb3
+58000000
+284ffe07
+7d20fe06
+7920fe07
+20206bac
+44cf4013
+d8a0811c
+18410e07
+18497e00
+1fe17e03
+98a08a00
+efe08005
+284ffe07
+2020eb90
+afec0000
+20600000
+afefffff
+20600000
+18467cff
+20628000
+2fcffe07
+20206b99
+18467cff
+20628000
+2fcc0007
+58000000
+7d20fe07
+98428400
+20406bb3
+5800003f
+284ffe07
+7920fe00
+20206bac
+18467cff
+2022f4d2
+20406bb3
+efe08005
+c2806ba8
+284c0007
+20600000
+284ffe07
+20600000
+20406bb3
+580000c0
+e7e08005
+20600000
+18467cff
+20628000
+20406bb3
+58000000
+20206bac
+18417e3f
+1fe67c0d
+24213a8a
+d8a08070
+98a08a00
+20600000
+1fe104ff
+1fecfe00
+20206bbd
+c4038000
+1fe17e3f
+1fe67c0d
+24213a8a
+d8a08070
+98a08a00
+e0408005
+20600000
+1841043f
+58008070
+98408c00
+efe08006
+20600000
+df20000e
+d8c08070
+18c20a00
+efe08006
+c00febd7
+c0106bd7
+c010ebd7
+c0116bd7
+c011ebd7
+c0166bd7
+c016ebd7
+c0006bd7
+c2006bcb
+20600000
+58000040
+e7e08005
+20206bd5
+58000080
+e7e08005
+20206bd5
+44cfc013
+580007e0
+da2043b6
+d840000c
+202068c5
+44d04014
+6a508a12
+708a123d
+708a11aa
+708a0a0c
+6ff08a09
+79207e07
+67f08a09
+708a0b04
+2000003c
+708a1600
+708a1706
+20406c02
+67f08a97
+7080c603
+2000003c
+6ff08053
+79207e07
+67f08053
+200003e8
+6fe143c4
+6848c3c6
+18467c01
+2042ba8c
+6ff1014c
+67e143c8
+6ff08053
+793ffe07
+67f08053
+708a9700
+62508a12
+20600000
+44d0c014
+6fe0c3c6
+c001ec09
+c0026c0b
+c000ec07
+5800004f
+20600000
+da200002
+20206c0c
+da200006
+6fe0c3c7
+1fe9fe00
+1fe1fe01
+9a21fe00
+20600000
+44d14014
+6fe0c3c6
+c001ec19
+c0026c17
+6fe243be
+20206c1a
+6fe243b6
+20206c1a
+6fe243ba
+67e204cc
+20406c28
+684943c8
+984ffe00
+1ff17e00
+1ff18400
+6fe204cc
+20406c2c
+98467e00
+d84003e8
+984ffe00
+1ff17e00
+1ff1fe00
+20600000
+da3fe000
+9a217e00
+1fe97e00
+20600000
+da201fff
+9a217e00
+1fed7e00
+1febfe00
+20600000
+efe40011
+67e404c4
+6fe104c4
+684904c6
+98462200
+6fe104ca
+98462400
+684904c8
+98467c00
+24416c41
+1a4ffe64
+9a26fc00
+20407475
+1807fe00
+205a6c49
+20600000
+6fe0c3ca
+79207e00
+67e0c3ca
+20600000
+6fe0c3ca
+793ffe00
+67e0c3ca
+20600000
+6848c3ca
+79200401
+6048c3ca
+20600000
+6848c3ca
+793f8401
+6048c3ca
+20600000
+6fe143de
+efe0803f
+207a0000
+1fe27200
+6fe143de
+1fe0fe03
+1fe22200
+e8408011
+20406b7c
+1a20a201
+c2006c58
+20600000
+6fe143de
+1fe0fe03
+1fe22200
+18002400
+58000000
+67e10546
+e8408011
+20406b85
+44d1c014
+6fe10546
+1a420e00
+f920fe00
+67e10546
+1a20a201
+1a40a401
+6fe143de
+efe0803f
+9a42fc00
+2422ec63
+6fe10546
+684943e0
+9842fc00
+20628000
+202074c8
+6fe143de
+efe0803f
+207a0000
+1fe27200
+6fe143de
+1fe0fe03
+1fe22200
+e8408011
+20406b5e
+1a20a201
+c2006c7c
+20600000
+d8e00009
+2040742e
+247a0000
+58000020
+d8e00009
+20407420
+78547c00
+20406c75
+44d24014
+6fe143de
+efe0803f
+207a0000
+20406c5d
+24346ef1
+20406eef
+78547c00
+6fe10546
+67e1054d
+70054f00
+18000e00
+6fe143e0
+1fe30400
+604943e0
+1fe17e01
+6849054d
+18412201
+18430400
+6049054d
+9a22fc00
+2442ecaa
+6fe143de
+efe0803f
+6848854f
+18408401
+6048854f
+18420e00
+98e2fc00
+2422ec95
+6fe10546
+67e143e0
+20600000
+44d2c014
+6fe143de
+1fe0fe01
+efe1003f
+20207487
+6ff08042
+9a21fe00
+67f08042
+6ff10050
+793ffe0d
+67f10050
+20000064
+20600000
+6ff08042
+c2836cbc
+c283ecbe
+58b71b00
+20600000
+596e3600
+20600000
+580080e8
+20600000
+684984c6
+20406cb7
+9846fc00
+20407475
+18078400
+6fe084c9
+984ffe00
+1fe6fc64
+20407475
+1807a200
+18427e00
+9a262400
+6fe084c5
+20406cd4
+6fe084c4
+684884c5
+1841040f
+184d0400
+9841fe00
+20206d14
+98000e00
+20406ce2
+20206cd7
+6ff080c5
+f9207e00
+67f080c5
+68588042
+284ffe07
+2040ece0
+f93ffe00
+67f080c5
+20600000
+200001e0
+20600000
+1fe17e0f
+d8a0809c
+1feffe04
+98a08a00
+1a227e00
+e7e10005
+1a427e00
+e7e10005
+20600000
+1a4c8e00
+20406d09
+1a4c8e00
+20406d03
+1a2c8e00
+7820fc00
+20406d04
+1a227e00
+20406d0f
+1a427e00
+20206d14
+1a227e00
+20406d17
+1a427e00
+20406d17
+1a2c8e00
+7840fc00
+20406d04
+1a4c8e00
+7840fc00
+20406d0a
+1a4c8e00
+7840fc00
+20206d04
+28effe07
+18e10e0f
+6ff080c3
+f920fe00
+67f080c3
+20600000
+28effe06
+18e10e0f
+6ff0809b
+f920fe00
+67f0809b
+20600000
+20406d1f
+1fed7e00
+18e08410
+9841fe00
+20206bb9
+78347c00
+20406d0f
+20206d1a
+78547c00
+20406d1f
+20206d1a
+18e10e0f
+6ff0809a
+f9347e00
+67f0809a
+20600000
+1fec8e00
+18e10e0f
+20600000
+1fe20400
+44d34014
+20406d2f
+58000800
+98467e00
+1fe20400
+18518400
+60588004
+20000578
+1fe20400
+1841040f
+6058800b
+20600000
+78367c00
+20206d33
+44d3c014
+78567c00
+6ff08043
+79367e03
+67f08043
+20600000
+5800007d
+20206d22
+44d74015
+20406e22
+d8a0424c
+20206e91
+d8a0426d
+2034ed40
+d8a00153
+18c22200
+204073d2
+20406e37
+d8c0425d
+20206eaa
+da200153
+2034ed48
+da20426d
+1a220a00
+204074e3
+20206e37
+d8c042ba
+20406e7d
+d8c0424c
+20406e7e
+18006c38
+18006c00
+20406deb
+d8a001a3
+20206e91
+18007008
+18007e49
+20206d5b
+18007e49
+20206d5a
+18007e01
+18007000
+184d5e00
+9de1de00
+1f00f001
+184cde00
+1df15e00
+6fe14410
+1ff07e00
+9de1de00
+1f00f001
+ede20006
+1f00f001
+efe10006
+1a30de00
+1df05e00
+9de1de00
+1f00f001
+20600000
+1a608c01
+efe08006
+98002200
+20406d57
+20406ded
+18007000
+efe08013
+1fe17e03
+1ff05e00
+79205e08
+20406e86
+20406df0
+1a227200
+1a608c02
+20406e65
+20406e6f
+20406df0
+1f227e00
+203a6d80
+20206d7b
+1800700c
+1de27e00
+67e2014b
+20600000
+1a20a201
+20406d59
+1a620c00
+20406e79
+20406df3
+20406e98
+1a60a610
+1a40a5f0
+20216d84
+20600000
+20406de0
+70806c00
+70806d01
+6fe08047
+1fe17e03
+67f0806e
+58000049
+67f10068
+67f1006a
+6a208048
+1a20a3fc
+242174d6
+62208048
+58000049
+9a208c00
+18007000
+ede20006
+65e2014f
+684ac407
+20406d54
+70800a06
+70800a07
+6fe08048
+67f100c1
+20406de7
+6ff08108
+c303f4d6
+684a014f
+6fe2440c
+98467e00
+207a0000
+604a440c
+6fe2c407
+1fe0fe01
+79207e27
+67e2c407
+18007e00
+20600000
+20406dbb
+5800412d
+9a20a200
+20406de7
+df00000c
+e5e20011
+20600000
+20406de0
+44d7c015
+70806c00
+70806d01
+6fe0c12b
+1fe17e03
+67f0806e
+6fe104e3
+67f10068
+5800412d
+67f1006a
+6a20c12c
+684ac402
+20406d54
+70800a02
+70800a03
+6fe0c12c
+67f100c1
+1fe0fe04
+67e0c12c
+6fe2c402
+1fe0fe01
+793ffe27
+67e2c402
+20600000
+6ff1011a
+98467c00
+20628000
+247a0000
+20206dd4
+6ff08108
+c3033a8a
+5800412d
+98408a00
+df00000c
+e5e20005
+20206de9
+44d84016
+1800700c
+20406e8c
+20406e8b
+58000000
+67f100c1
+20600000
+6ff08108
+c3036de7
+70800a00
+20600000
+243bedeb
+20600000
+18006c30
+18006c00
+20206deb
+18006c32
+18006c02
+20206deb
+18006c34
+18006c04
+20206deb
+18006c01
+18006c00
+20600000
+6ff08144
+c302edf9
+20600000
+67f1007e
+18006cc0
+18006c80
+20206df9
+18007000
+1a420c00
+18007204
+20406e0f
+18006d80
+18006c80
+20406deb
+1800700c
+1a620a00
+18007204
+1de27e00
+e7e20005
+1f00f001
+c2006e0a
+20600000
+efe10006
+e8410006
+18500400
+9841de00
+1f00f001
+c2006e0f
+20600000
+18007008
+1a220c00
+18007204
+20406e0f
+18007000
+1a420c00
+18007204
+20406e0f
+18006d82
+18006c82
+20406deb
+20206e07
+18007000
+6fe20153
+98005e00
+1f00f001
+efe20006
+98005e00
+1f00f001
+6fe2426d
+98005e00
+1f00f001
+efe20006
+98005e00
+1f00f001
+20406e8c
+1f00f1fc
+6fe242d4
+1fe25e00
+1f00f004
+18006c38
+18006c08
+20206deb
+44d8c016
+6fe342b0
+684b0173
+2034ee3d
+6fe30173
+684b42b0
+18007008
+18425e00
+1f00f001
+184f5e00
+1ff07e00
+9de1de00
+1f00f001
+1fef5e00
+1f00f001
+18005e00
+18007e00
+6fe0c2a0
+6848c363
+2434ee4d
+6fe0c2a7
+6848c2a0
+67e0c27d
+6048c27e
+18007000
+da40427d
+18007204
+efe20011
+e8420012
+9842de00
+1f00f001
+1a20a204
+1a40a404
+c2006e52
+20406e8c
+1f00f1fc
+6fe242d4
+1fe25e00
+1f00f004
+18006c38
+18006c0c
+20406deb
+20406e8b
+18006c3a
+18006c08
+20206deb
+2f200600
+20608000
+18c27e00
+9f208a00
+18007e00
+e7e08005
+1f20f201
+2f200600
+20608000
+20206e6a
+18007000
+1f227e00
+203a6e74
+efe20006
+1f20f3fc
+98005e00
+1f00f001
+2f001e04
+20608000
+20206e70
+18007008
+20206e7e
+18007004
+20206e7e
+18007000
+18007204
+efe20006
+98005e00
+1f00f001
+c2006e7f
+20600000
+d8c001a3
+20206e7b
+18007204
+20206e8e
+18007000
+18007210
+20206e8d
+18007000
+18007204
+18005e00
+1f00f001
+c2006e8d
+20600000
+1800700c
+18007204
+1de27e00
+e7e20005
+1f00f001
+c2006e93
+20600000
+1800700c
+1a620a00
+1a40f201
+1f267c0f
+20216e9e
+18007210
+1de27e00
+1f267c03
+20216ea6
+e7e20005
+1f20f3fc
+20628000
+1f00f001
+20206e9e
+e7e08005
+1fecfe00
+c2006ea6
+20600000
+1800700c
+18007204
+efe20006
+9de67c00
+24628000
+1f00f001
+c2006eac
+18007c00
+20600000
+6ff08050
+793ffe00
+67f08050
+20600000
+6ff08050
+79207e00
+67f08050
+20600000
+20758000
+20403c42
+20406ec2
+20406f6b
+20206ef8
+20406f1b
+20206f5a
+6fe0c437
+c17f8000
+98000400
+20406b96
+6848c437
+20406b92
+20000064
+6848c437
+20406b7c
+20206ecc
+44dc4017
+6fe0c437
+c17f8000
+1fe20400
+20406b85
+2420eede
+20406ee8
+6fe14434
+79207e0c
+67e14434
+6fe0c42f
+c1000000
+70442f00
+6fe0c436
+67e0c42e
+20406eef
+7004c32c
+20206f7b
+6fe14434
+793ffe0c
+67e14434
+6fe0c42f
+c1008000
+70442f01
+70442e00
+20406ef1
+7004c32d
+20206f7b
+6fe0c42e
+207a0000
+1fe0ffff
+67e0c42e
+247a0000
+7004c310
+20206f7b
+d8e00007
+20203c21
+d8e00007
+20203c25
+44dcc017
+6fe1443a
+1a2fa40b
+9a40a400
+20600000
+6fe0c439
+207a0000
+1fe27200
+6fe1443a
+1fe22400
+1a40a602
+e8408013
+20406f03
+1a40a40b
+c2006efd
+20600000
+6fe0c438
+203a6b92
+20206b96
+20406ef3
+58000002
+e7e08012
+20406f54
+20206f29
+20406ef3
+58000003
+e7e08012
+20406f54
+20206f24
+20406ef3
+58000001
+e7e08012
+580000ff
+e7e08005
+20206f24
+20406ef3
+df20000b
+1a620c00
+1a420a00
+2020740c
+6fe0c439
+207a0000
+da200000
+20406f2e
+1a20a201
+6fe0c439
+9a267c00
+20628000
+20206f1e
+1a40a602
+e8408013
+6fe0c095
+c0045f22
+20206b92
+1a40a602
+e8408013
+6fe0c095
+c0045f2f
+20206b96
+1a208e0b
+2040742e
+247a0000
+20406ef3
+efe08012
+c0016f29
+c001ef24
+c0006f24
+c002ef42
+20406f29
+1a40a607
+2040739c
+efe10013
+20407487
+204073a8
+58000005
+e7e08012
+1a40a603
+efe10013
+20206f52
+20406f24
+1a40a609
+2040739c
+efe10013
+20407487
+204073a8
+1a40a601
+efe08013
+c07fef4e
+1fe0ffff
+e7e08013
+203a6f0b
+58000004
+e7e08012
+1a40a605
+efe10013
+1a208e0b
+20207420
+58000000
+20206f52
+58001000
+1ff07e00
+9a40a400
+20600000
+44dd4017
+da200000
+684a4430
+1c422400
+1a427e00
+98467c00
+24416f56
+1a427e00
+184084a0
+184084a0
+98467c00
+24216f6e
+1a20a201
+1a217e0f
+243a6f61
+da200000
+20406f74
+1c427e00
+67e24430
+20600000
+1a227e00
+207a0000
+18408560
+18408560
+793f841c
+604a4430
+20204dc0
+70441c01
+6fe0c41d
+243a6f76
+20600000
+70441c00
+20600000
+44ddc017
+20406f75
+1a227e00
+67e204d8
+da20441e
+20407499
+6fe204d8
+1fe22200
+20206f79
+44de4017
+20406f75
+1a227e00
+67e204d8
+da204426
+20407499
+6fe204d8
+1fe22200
+20206f79
+58000000
+67e44426
+67e4441e
+20600000
+44dec017
+6fe0c10d
+247a0000
+da204426
+204074b1
+207a0000
+7004c200
+20406f9c
+6fe084c2
+203a6f91
+20600000
+20406f75
+da204426
+204074a5
+1fe20400
+20406f79
+44df4017
+18427e00
+207a0000
+c006efc0
+c0076fc6
+c007efcb
+c0086fc6
+c009efd6
+c00a6fd8
+c00aefda
+c00b6fe4
+c00befe7
+c00c6fe9
+c00cefec
+67e084c3
+6fe084c3
+c584efb9
+44dfc017
+6fe084c3
+c008efd1
+c00deff4
+c0096fd5
+c00feb5a
+20600000
+67e084c3
+2040385b
+2022efbe
+20403860
+24628000
+7004c201
+20206f84
+70435f01
+70436200
+6fe14434
+79207e0b
+67e14434
+20600000
+6fe14434
+793ffe0b
+67e14434
+70435f00
+20600000
+70435f01
+70436201
+6fe14434
+79207e0b
+67e14434
+20600000
+58000014
+67e10191
+67e142ca
+2020473e
+202045c0
+da200000
+20206f0b
+da200000
+20206f06
+da200000
+20406ef3
+efe08012
+c000efe1
+c0026fe1
+c002efe1
+20206f10
+efe08006
+c17f8000
+20206f10
+70431a01
+70410d1b
+20600000
+70431a01
+20600000
+70431a00
+70410d00
+20600000
+6fe1438e
+20407487
+6fe0c437
+c07feff2
+1fe20400
+20406b7c
+20406f8d
+20203b3f
+202045ee
+6fe0c434
+c4060000
+20600000
+6fe143b4
+1fe08a02
+58000000
+e7e18005
+20600000
+44e04018
+204074ca
+2040702b
+207a0000
+6fe143b4
+1fe0a402
+e8408012
+18408401
+e0408012
+e840803f
+18427200
+1fe0a404
+efe08012
+984ffe00
+98c08a00
+1a220c00
+20407419
+2040702f
+1fe0ffff
+e8408012
+18408401
+98410400
+e0408012
+202074c8
+44e0c018
+204074ca
+20407027
+207a0000
+6fe143b4
+1fe0a402
+e8408012
+184085ff
+e0408012
+e840803f
+18427200
+1fe0a403
+efe08012
+984ffe00
+98c08c00
+18c08c01
+1a220a00
+2020700d
+6fe143b4
+1fe08c02
+efe08006
+20600000
+2040702f
+e8408006
+98467e00
+20600000
+6fe143b4
+1fe08c01
+efe08006
+20600000
+44e14018
+6ff08c23
+2feffe03
+2040f03f
+6ff08c23
+67f08c23
+67e0855e
+2040709a
+204070c1
+204072d2
+2040731a
+20207092
+44e1c018
+20406eb3
+20407056
+708c0000
+20002710
+708c18c0
+6ff10050
+793ffe0a
+67f10050
+708c1100
+708c003c
+580005b7
+67f10c03
+67f10c07
+580005f7
+67f10c05
+708c1104
+708c0200
+708c23ff
+58000900
+d8a0070b
+98a67200
+202073ec
+70070802
+58000000
+67e085fa
+67e10702
+1fe0fe01
+67e10704
+1fe0fe01
+67e10706
+d8a00694
+58030404
+e7e18005
+58000409
+e7e10005
+d8a00699
+38015906
+380610d2
+38090494
+380c0001
+e7e48005
+d8a006b7
+3801570f
+38055c9a
+380a56c6
+380dcdcd
+e7e48005
+38014420
+38065d99
+380a5636
+380c0001
+e7e38005
+d8a006d5
+3801620a
+38040c8c
+380b0333
+380cc0c0
+e7e48005
+38003130
+e7e10005
+58009272
+67e105fb
+580092cd
+67e105fd
+d8c09371
+d8a0061d
+df200013
+20407419
+20407087
+6fe106f3
+20207487
+6fe086f7
+247a0000
+df20003c
+d8a00630
+d8c09384
+20207419
+6fe086f8
+207a0000
+67e08652
+67e0866b
+20600000
+d8e00001
+2040742e
+247a0000
+6fe087ad
+247a0000
+6fe087ac
+245a738b
+20600000
+6fe0855e
+c281709d
+20600000
+204070a2
+2040742d
+58000280
+d8e00001
+20207420
+6fe0879e
+c08170a7
+7007ad00
+7007ae00
+20600000
+6fe087b0
+207a0000
+7007b000
+70079e02
+7007ac01
+20600000
+6fe0855e
+c28070d8
+20600000
+6ff08c24
+c3830000
+69510c03
+6a110c05
+68710c07
+efe10003
+1fec8400
+18518400
+d8c00fff
+98c17200
+1f222200
+efe08003
+e7e08005
+c20070bb
+60710c07
+62210560
+20600000
+44e24018
+6fe0855e
+c4028000
+d8a0083d
+204070b0
+6f210560
+6720887d
+d8c0083d
+18427e00
+c00070d1
+c001f0cd
+20600000
+d8a008c0
+20407419
+70087f01
+20600000
+d8a0070b
+20407419
+6fe08560
+c00070ad
+c000f0df
+1fe67c07
+20610000
+44e2c018
+793f8023
+6fe0870b
+1fe17e80
+c04070e3
+c00070eb
+20203a8a
+6fe0870b
+c3838000
+204072a7
+20207116
+6fe0870b
+1ff1fe00
+1fe37e00
+1fe17e03
+c00070f3
+c000f0fa
+c0017100
+20203a8a
+6fe0870b
+1ff1fe00
+1fe37e00
+1fe17e03
+c0007101
+c000f10a
+c0017110
+20203a8a
+44e34018
+6fe0870c
+c0047118
+c003712e
+c0057181
+c0007193
+20207111
+44e3c018
+6fe0870c
+c00171c8
+c000f1cc
+c001f1dd
+20207111
+20207111
+44e44019
+6fe0870c
+c000f1e7
+c001f218
+c002f243
+c004f25c
+c005f277
+c003f111
+20207111
+44e4c019
+6fe0870c
+c0057288
+c004f29a
+c005f2b9
+20207111
+20207111
+44e54019
+6ff08c19
+79207e00
+67f08c19
+20207116
+708c1810
+20600000
+6fe0870b
+c0c07111
+6fe0870f
+c0807111
+6fe08710
+c0807111
+6fe08711
+c080f111
+6fe08712
+c0807111
+6fe0870d
+c0807111
+6fe0870e
+c0807111
+6fe08708
+c002712a
+c001f12c
+20207111
+da400001
+202071ad
+da400001
+202071ab
+44e5c019
+6fe0870e
+c000f145
+c001715e
+c001f161
+c010f136
+c011716f
+20207111
+70079b00
+6fe0870f
+c000713c
+c000f13f
+c0017142
+20207111
+6a408643
+da200643
+202072c8
+6a40865c
+da20065c
+202072c8
+6a408675
+da200675
+202072c8
+6fe087af
+245a7156
+5800061d
+6848861d
+67e107a6
+604887a8
+6fe08711
+98467c00
+24217154
+6fe087a8
+98002400
+6fe107a6
+1fe0fe01
+98002200
+202072c8
+6fe08711
+2020714f
+6ff08c02
+245a715a
+7007af00
+20600000
+6ff08c02
+79207e07
+67f08c02
+20600000
+58000630
+68488630
+20207149
+6fe0870d
+1fe67c03
+24217111
+6fe0870d
+da200694
+c00072c6
+79200023
+da200699
+c000f2c6
+da2006b7
+c00172c6
+da2006d5
+c001f2c6
+20600000
+6fe1070f
+c0007174
+c000f176
+c001717a
+20207111
+6a2105fb
+202072c6
+6fe086f7
+205a717e
+6a2105fd
+202072c6
+6fe086f7
+245a717e
+6a2105ff
+202072c6
+7007ac01
+70079e01
+20600000
+6fe08708
+c0827111
+6fe0870b
+c0c0f111
+6fe0870d
+c0807111
+6fe0870e
+c0807111
+6fe08711
+c080f111
+6fe08712
+c0807111
+6fe0870f
+c0807111
+6fe08710
+c0807111
+da400001
+202071ab
+6fe08708
+c0017111
+6fe0870d
+c0807111
+6fe0870e
+c0807111
+6fe08711
+c0817111
+6fe08712
+c0807111
+6fe08710
+c0807111
+6fe0870b
+c04071a6
+c040f1b1
+c04171b5
+20207111
+7007a101
+202071af
+6fe0870f
+c0807111
+da400002
+6fe0879f
+c000f1a4
+da200702
+202072c8
+da200704
+202072c8
+da200706
+202072c8
+6fe08708
+c0827111
+da400002
+202071ab
+6fe08708
+c0827111
+6fe0870f
+c040f1c2
+c04171c4
+c041f1c6
+1fe17e7f
+c00071be
+20207111
+6fe087a2
+da400002
+c000f1ad
+202071ab
+6fe087a3
+202071bf
+6fe087a4
+202071bf
+6fe087a5
+202071bf
+70079901
+da20079a
+da400001
+202072c8
+6fe1070d
+d84001ba
+98467c00
+2422f111
+6fe08796
+243a71da
+70075300
+6fe08711
+98002400
+da200753
+204072c8
+d8a00753
+df200008
+202073dd
+70079600
+70075301
+202071d3
+6fe08711
+c080f111
+70079b01
+da400001
+6fe0879d
+c00071e5
+c000f1e6
+202071ab
+202071ad
+202071ab
+6fe08708
+c0827111
+6fe08711
+c0807111
+6fe08712
+c0807111
+6fe0870e
+c0807111
+6fe08710
+c0807111
+6fe0870b
+c00071f6
+c000f205
+c0017206
+20207111
+6fe0870d
+c080f111
+6ff08c00
+793ffe07
+67f08c00
+70079f00
+7007a001
+6fe087a1
+203a7116
+7007a100
+6fe0870a
+203a7116
+7007a000
+70079e02
+20207116
+20207111
+6fe0870d
+c0807111
+6fe0870f
+c040f211
+c0417214
+c041f216
+1fe17e7f
+c000720f
+20207111
+7007a200
+20207116
+7007a300
+7007b001
+20207116
+7007a400
+20207212
+7007a500
+20207212
+6fe08711
+c0807111
+6fe08712
+c0807111
+6fe0870b
+c0007221
+c000f22f
+c0017230
+20207111
+6fe0870d
+c080f111
+20405191
+6ff08c00
+79207e07
+67f08c00
+70079f01
+70079e03
+70079700
+20407116
+2040742d
+58001388
+d8e0000f
+20207420
+20207111
+6fe0870d
+c0807111
+6fe0870e
+c0807111
+6fe0870f
+c040f23d
+c041723f
+c041f241
+1fe17e7f
+c000723b
+20207111
+7007a201
+20207116
+7007a301
+20207116
+7007a401
+20207116
+7007a501
+20207116
+6fe0870b
+c0807111
+6fe0870f
+c0807111
+6fe08710
+c0807111
+6fe08711
+c0807111
+6fe08712
+c0807111
+6fe0870e
+c0807111
+6fe0870d
+1fe17e80
+c0807111
+6fe0870d
+c080725a
+70070802
+6fe0870d
+67f08c02
+20407116
+7007af01
+20600000
+70070803
+20207255
+6fe08708
+c0017111
+6fe0870b
+c0807111
+6fe0870f
+c0807111
+6fe08710
+c0807111
+6fe08711
+c0807111
+6fe08712
+c0807111
+6fe0870e
+c0807111
+6fe0870d
+1fe67c01
+24217111
+6fe08708
+c001f271
+c0027271
+20207111
+6fe0870d
+c0007275
+70070804
+20207116
+70070803
+20207116
+6fe08708
+c0827111
+6fe0870b
+c080f111
+6fe0870d
+c0807111
+6fe0870e
+c0807111
+6fe08711
+c0807111
+6fe08712
+c0807111
+6fe0870f
+c0807111
+6fe08710
+c0807111
+20207116
+44e64019
+70079901
+6fe0870e
+67e0879a
+6fe0870f
+1fe67c01
+2042f296
+6fe0879e
+c0827116
+70079e02
+20407116
+20007530
+20007530
+20600000
+7007ac01
+7007a000
+70079e04
+20600000
+20003a98
+d8a00713
+204070b0
+70079501
+204072ab
+6fe1070d
+67e10793
+20407116
+6fe0c095
+c1820000
+6fe08797
+207a0000
+6fe08713
+67e0c56c
+70079700
+70455c03
+20600000
+6fe1070d
+d8400200
+98467c00
+24628000
+6fe1070f
+d8400000
+98467c00
+24628000
+6fe10711
+d8400001
+98467c00
+24628000
+70079701
+20600000
+6fe08711
+c0807111
+6fe0870d
+c00072bf
+c000f2c2
+20207111
+70079c00
+70079d01
+20207116
+70079801
+70079c01
+70079d00
+20207116
+ea408011
+1a20a201
+44e6c019
+7920000e
+c591f2cd
+1a40a401
+1a43a400
+622105f8
+624085fa
+202072d2
+d8e00000
+20207312
+44e74019
+6ff08c24
+c3800000
+6fe085fa
+207a0000
+1fe27200
+98000400
+6fe10711
+1fe67c40
+202172e0
+1f267c40
+202172e4
+18007240
+202072e4
+9f267c00
+202172e4
+98007200
+67e085fa
+6fe085fa
+9f267e00
+67e085fa
+1f20ffff
+67e08562
+c591f2f6
+1fe37e00
+1f20ffff
+67e08562
+c58772f6
+793f800e
+e0408005
+58000003
+e7e08005
+1f20f3ff
+1f227e00
+2422f2f6
+1f20f201
+6fe105f8
+1fe20c00
+efe08006
+e7e08005
+c591f2fd
+58000000
+e7e08005
+c20072f8
+18c27e00
+67e105f8
+58000562
+67f10c09
+d8e00000
+20407312
+6fe085fa
+247a0000
+6fe0879e
+c1808000
+70079e02
+20600000
+d8e00001
+da2005a3
+62310c0b
+1f20ffff
+e7e08011
+efe08006
+e7e08005
+c200730f
+58000000
+f9207e00
+67f08c18
+20600000
+d8e00002
+da2005ad
+62310c0d
+2020730d
+44e7c019
+6fe087ab
+207a0000
+6ff08c24
+1fe17e0f
+243a7383
+6fe087ac
+203a7356
+6fe0879e
+c001f393
+c0817356
+6fe087a0
+243a7356
+2040732a
+20407335
+20207342
+6ff08c24
+c3808000
+6fe087ab
+c4008000
+6fe087ab
+793ffe01
+67e087ab
+6fe087a9
+207a0000
+c008737b
+20203a8a
+6ff08c24
+c3810000
+6fe087ab
+c4010000
+6fe087ab
+793ffe02
+67e087ab
+6fe087aa
+207a0000
+c010735c
+c010f377
+c011737f
+20203a8a
+6fe086f7
+207a0000
+6ff08c24
+c3818000
+6fe087ab
+c4018000
+6fe087ab
+793ffe03
+67e087ab
+6f20887e
+df200020
+d8c00880
+d8e00003
+da2007fd
+62310c0f
+2020730d
+6fe087ab
+79207e03
+67e087ab
+20600000
+d8a007b1
+df200008
+204073dd
+d8a00880
+df200008
+202073dd
+6fe08799
+6848879b
+98417e00
+203a7373
+6848879c
+9840fe00
+c000f364
+20207373
+7007aa00
+6fe087b2
+c0017374
+c001f374
+6fe087b2
+67e087b1
+6fe087b3
+e7e08005
+6fe087b5
+e7e08005
+6fe087b7
+e7e08005
+df200004
+d8c007b1
+20207316
+7007aa00
+df200008
+d8c007b1
+20207316
+7007aa00
+df200003
+d8c007d1
+20207316
+7007a900
+df200008
+d8c007c1
+2020730a
+7007aa00
+df200002
+d8c007e1
+20207316
+6fe0879e
+c0017386
+20600000
+6ff08c00
+79207e07
+67f08c00
+7007ae01
+20600000
+6fe0879e
+c1018000
+c001738f
+20600000
+6fe087ae
+207a0000
+7007ad01
+20207396
+d8e0000f
+2040742e
+247a0000
+6ff08c00
+c4038000
+708c00fc
+20007530
+708c003c
+20600000
+60a104e5
+604c04cc
+616204d4
+204073a4
+60c104e3
+672104ef
+60e104ed
+20600000
+622204d8
+624204dc
+626184e0
+20600000
+44e8401a
+6fe104e5
+98000a00
+684c04cc
+696204d4
+204073b3
+6f2104ef
+68e104ed
+6fe104e3
+98000c00
+20600000
+6a2204d8
+6a4204dc
+6a6184e0
+20600000
+6fe104e5
+1fe20a00
+20600000
+6fe104e3
+1fe20c00
+20600000
+18a27e00
+67e104e5
+20600000
+18c27e00
+67e104e3
+20600000
+204073d0
+204073d0
+202073d0
+204073cc
+efe08006
+e7e08005
+efe18006
+e7e18005
+20600000
+efe40006
+e7e40005
+20600000
+204073d2
+204073cc
+204073cc
+204073cc
+202073cc
+1fe0ffff
+20000026
+243a73d4
+20600000
+df20000a
+20002ee0
+c20073d9
+20600000
+18007203
+18007e00
+e7e40005
+c20073de
+20600000
+204073e2
+18007e00
+e7e40005
+20600000
+18007e00
+e7e20005
+20600000
+18007204
+202073dd
+18007208
+202073dd
+1f227e00
+207a0000
+58000000
+e7e08005
+c20073ef
+20600000
+df200020
+d8a004f6
+202073ec
+efe20013
+e8420011
+9842fe00
+e7e20005
+1a20a204
+1a60a604
+c20073f5
+20600000
+44e8c01a
+1f227e00
+1fe67c01
+20610000
+9a20a400
+1a40a5ff
+1f237200
+e8408011
+efe08012
+e7e08011
+e0408012
+1a40a5ff
+1a20a201
+c2007404
+20600000
+1f227e00
+207a0000
+1f20f3f8
+204173cc
+20628000
+2021740e
+1f20f208
+1f20f3fc
+204173c7
+20628000
+20217413
+1f20f204
+20207419
+1f227e00
+207a0000
+efe08006
+e7e08005
+c200741b
+20600000
+58000000
+67e104c4
+44e9401a
+2040742e
+684904c4
+d8a040ed
+18e3fe00
+98a08a00
+e0410005
+20600000
+d9600800
+19701600
+9960fe00
+20600000
+d8e00000
+44e9c01a
+684a4096
+1c437e00
+67e24096
+98467c00
+24417429
+98461600
+19620400
+d8c040ed
+18c20a00
+df200010
+efe10006
+98467e00
+2021743d
+18007e00
+e7e10005
+c2007439
+d8c040ed
+18e3fe00
+98c08c00
+efe10006
+20600000
+98408400
+18427200
+6fe1003f
+9f267e00
+20610000
+1fe67e00
+18510400
+18408401
+18500400
+98418400
+20600000
+20407451
+2020745e
+78547c00
+98467e00
+20217456
+78347c00
+1fe67e00
+c4078000
+1fe22800
+d8410000
+6fe1003f
+98467e00
+9a80fe00
+793ffe40
+20600000
+6849003f
+98000c00
+1ff17e00
+984ffe00
+98c0fe00
+20600000
+1fed7e00
+1ff27e00
+6849c0be
+9846fc00
+20407475
+18078400
+20600000
+6849003f
+9846fc00
+20407472
+1ff07e00
+18070400
+98418400
+20600000
+20407475
+1807fe00
+20600000
+207a8000
+20207475
+efe08011
+e8408012
+98467c00
+24628000
+1a20a201
+1a40a401
+c2007477
+18007c00
+20600000
+98467c00
+24610000
+18427e00
+20600000
+df200200
+d8a04000
+202073dd
+207a0000
+1fe27a00
+20406d31
+70820301
+20600000
+67f10205
+6ff08203
+79207e04
+67f08203
+20600000
+67f10207
+6ff08203
+79207e06
+67f08203
+20600000
+67f10205
+70820330
+20600000
+44ea401a
+e8440011
+18417eff
+243a749f
+184cfe00
+e7e40011
+1a20a207
+efe08011
+243a3a8a
+6fe084c3
+e7e08011
+20600000
+44eac01a
+df200008
+efe40011
+207a0000
+efe08011
+243a74ae
+1a20a201
+c20074a9
+20203a8a
+d8400000
+e0408011
+20600000
+efe40011
+20600000
+efe08011
+20600000
+efe10011
+20600000
+d8400000
+6fe08006
+c20074b8
+18408401
+c20074b8
+18427e00
+20600000
+98467c00
+24610000
+18427e00
+20600000
+18007dff
+20600000
+18007c01
+20600000
+18007c00
+20600000
+78347c00
+20600000
+78547c00
+20600000
+78367c00
+20600000
+78567c00
+20600000
+7838fc00
+20600000
+7840fc00
+20600000
+7820fc00
+20600000
+58000001
+20600000
+58000000
+20600000
+1f267c00
+20628000
+e8408006
+9840fe00
+c20074dc
+20600000
+58000000
+67e40016
+20600000
+df200010
+180a7e00
+e7e08005
+c20074e4
+20600000
+70459601
+2040778d
+7044cd42
+7044ce15
+7044dd55
+6fe0c4e2
+1fe0fe01
+67e0c4e2
+204074f6
+20407ad5
+df200017
+d8c044cd
+d8a0464f
+2020740c
+d8400000
+d8c044dc
+df200007
+efe08006
+98408400
+c20074f9
+6048c4e3
+20600000
+6fe0c4e8
+207a0000
+7044e800
+6fe14594
+207a0000
+6fe0c4dc
+1fe0fe01
+67e0c4dc
+c000f50c
+c004f50c
+204074e8
+58000003
+67e144e4
+20600000
+6fe0c4e1
+1fe0fe40
+67e0c4e1
+204074e8
+20207511
+58000003
+67e144e4
+20600000
+7044e107
+7044dc00
+202074e8
+6fe0c4a3
+245a7977
+7044e111
+7044dc00
+202074e8
+7044e112
+7044dc00
+202074e8
+7044e113
+7044dc00
+202074e8
+7044e105
+7044e000
+7044dc00
+202074e8
+7044e109
+7044dc00
+7044e000
+202074e8
+7044e114
+7044dc00
+202074e8
+7044e115
+7044dc00
+202074e8
+6fe0c4a3
+245a79ad
+7044e10c
+7044e001
+7044dc00
+202074e8
+6fe0c4a3
+245a79b5
+7044e10e
+7044e001
+7044dc00
+202074e8
+6fe0c4a3
+245a79af
+7044e101
+7044e002
+7044dc00
+202074e8
+6fe0c4a3
+245a79b7
+7044e104
+7044e002
+7044dc00
+202074e8
+6fe0c4a3
+245a79b1
+7044e10d
+7044e003
+7044dc00
+202074e8
+6fe0c4a3
+245a79b9
+7044e10f
+7044e003
+7044dc00
+202074e8
+6fe0c4a3
+245a79b3
+7044e108
+7044e004
+7044dc00
+202074e8
+6fe0c4a3
+245a79bb
+7044e106
+7044e004
+7044dc00
+202074e8
+6fe0c724
+c000f514
+704706b1
+2020774f
+6fe0c4a3
+245a7960
+7044e116
+7044dc00
+7044e000
+202074e8
+6fe0c4a3
+245a7966
+7044e117
+7044dc00
+7044e000
+202074e8
+70470600
+6fe0c4a3
+245a792a
+7044e10a
+202074e8
+70470600
+6fe0c4a3
+245a792c
+7044e10b
+202074e8
+70470600
+6fe0c4a3
+245a792e
+7044e103
+202074e8
+70470600
+6fe0c4a3
+245a7930
+7044e102
+202074e8
+6fe0c4a3
+245a7948
+7044e110
+7044dc00
+202074e8
+20407de0
+204075aa
+204075b5
+4738c02e
+70457d01
+70457e01
+4739402e
+6fe142b0
+1ff27e00
+d840ffff
+98417e00
+203a75bc
+d840fff0
+98467c00
+2022f5be
+4739c02e
+1ff0fe00
+67e1457b
+67e144de
+da20ffff
+1a300400
+5800ffff
+98418400
+6fe242b0
+205a75ba
+98467c00
+2042f5ba
+67e244a7
+58007b9d
+67e1439c
+580079bd
+67e14394
+202076cc
+473a402e
+6f20c55e
+684a4738
+d8c04560
+473ac02e
+efe08006
+98000e00
+f9200400
+c20075ae
+604a4738
+20600000
+473b402e
+6f20c55f
+684a4738
+d8c04568
+202075ae
+58111213
+20600000
+dfe00010
+20207598
+dfe0ffe0
+20207598
+473bc02e
+6fe242b0
+67e24525
+704529d1
+6fe0c52b
+1fe0fe01
+67e0c52b
+d8400000
+d8c04524
+df200008
+20407603
+18508400
+6049452c
+da604523
+df20000b
+58000000
+67e144c6
+20407b57
+6fe144c6
+67e1452e
+df200017
+d8c044e9
+d8a0464f
+2040740c
+df20000d
+d8c04523
+d8a04666
+2040740c
+70467a25
+70467b33
+20407b7b
+df200025
+d8c0464f
+d8a04530
+2020740c
+efe08006
+1fedfe00
+e7e08005
+c20075e3
+20600000
+473c402f
+20407ad5
+20407600
+18508400
+60494508
+da604500
+df20000a
+58000000
+67e144c6
+20407b57
+6fe144c6
+67e1450a
+6fe1450c
+1ff0fe00
+1fe0fe01
+1ff0fe00
+67e1450c
+df200025
+d8c044e9
+d8a0464f
+2040740c
+70467a25
+70467b33
+20207b7b
+d8400000
+d8c04501
+df200007
+efe08006
+98408400
+c2007603
+20600000
+da400033
+20600000
+6fe0c50e
+67e0c505
+20600000
+204079ab
+70452468
+70452a46
+204075c0
+70450168
+70450746
+202075e8
+7045246e
+70452af0
+204075c0
+7045016e
+704507f0
+202075e8
+2040792a
+70452469
+70452a00
+204075c0
+70450169
+70450700
+202075e8
+2040792c
+7045246a
+70452a00
+204075c0
+7045016a
+70450700
+202075e8
+2040792e
+70452465
+70452a00
+204075c0
+70450165
+70450700
+202075e8
+20407930
+70452466
+70452a00
+204075c0
+70450166
+70450700
+202075e8
+70452460
+70452a00
+704529d2
+204075c0
+70450160
+704507d1
+704506d2
+202075e8
+70452460
+70452a00
+704529d4
+204075c0
+70450160
+704507d1
+704506d4
+202075e8
+70452460
+70452a00
+70452903
+204075c0
+70450160
+580000d1
+67e14507
+70450e03
+202075e8
+70452460
+70452a00
+70452904
+204075c0
+70450160
+580000d1
+67e14507
+70450e04
+202075e8
+7045246f
+70452a00
+704529d2
+204075c0
+7045016f
+704507d1
+704506d2
+202075e8
+7045246f
+70452a00
+704529d4
+204075c0
+7045016f
+704507d1
+704506d4
+202075e8
+7045246f
+70452a00
+70452903
+204075c0
+7045016f
+580000d1
+67e14507
+70450e03
+202075e8
+7045246f
+70452a00
+70452904
+204075c0
+7045016f
+580000d1
+67e14507
+70450e04
+202075e8
+704529d2
+704506d2
+2020768f
+704529d4
+704506d4
+2020768f
+70452903
+70450603
+2020768f
+70452904
+70450604
+2020768f
+2040794f
+7045246f
+70452aaa
+204075c0
+7045016f
+580000aa
+67e14507
+202075e8
+704506d1
+704529d1
+2040794a
+7045246f
+70452a55
+204075c0
+7045016f
+70450755
+70450e00
+20407609
+202075e8
+20407948
+7045246e
+70452a00
+204075c0
+704501a1
+70450700
+202075e8
+6fe0c597
+c00076a4
+c000f6ac
+c00176b4
+20600000
+20407959
+70459701
+7045246d
+70452a01
+204075c0
+7045016d
+70450701
+202075e8
+20407960
+70459702
+7045246d
+70452a02
+204075c0
+7045016d
+70450702
+202075e8
+20407966
+70459700
+7045246d
+70452a03
+204075c0
+7045016d
+70450703
+202075e8
+70452460
+70452a00
+704529d1
+204075c0
+70450160
+70450700
+704506d1
+202075e8
+7045246f
+70452a00
+704529d1
+204075c0
+7045016f
+70450700
+704506d1
+202075e8
+473cc02f
+6fe14579
+247a0000
+204076da
+473d402f
+da204560
+6fe0c55e
+98007200
+e8408011
+20406b7c
+1a20a201
+c20076d4
+20002ee0
+20600000
+da204568
+6fe0c55f
+98007200
+e8408011
+18418480
+2040773e
+1a20a201
+c20076dd
+20002ee0
+20600000
+6fe14579
+247a0000
+70457200
+58000000
+67e44556
+70457000
+da604560
+e8408013
+20406b85
+2040f706
+e8408013
+20406b7c
+204076da
+1a60a601
+6fe0c570
+1fe0fe01
+67e0c570
+6848c55e
+98467c00
+242176eb
+20600000
+473dc02f
+6fe0c570
+1fe0fe01
+6848c55f
+18408401
+984ffe00
+98000e00
+6fe44556
+f9207e00
+67e44556
+20600000
+df200001
+20600000
+473e402f
+6fe14573
+98007200
+205a7704
+204073d9
+e8408013
+20406b85
+24608000
+20002ee0
+e8408013
+20406b85
+24608000
+20002ee0
+e8408013
+20406b85
+24608000
+20407739
+e8408013
+20406b85
+2020f6f9
+473ec02f
+e8408013
+18418480
+2040773e
+70457100
+da204568
+e8408011
+20406b85
+2040f72b
+1a20a201
+6fe0c571
+1fe0fe01
+67e0c571
+6848c55f
+98467c00
+24217720
+20600000
+473f402f
+6fe0c570
+6848c55f
+18408401
+984ffe00
+6848c571
+18408401
+9840fe00
+98000e00
+7820fc00
+6fe44556
+f920fe00
+67e44556
+20600000
+473fc02f
+da204568
+6fe0c55f
+98007200
+202076d4
+79400407
+20206b96
+6fe0c724
+c000f770
+704706a0
+2020774f
+6fe0c724
+c000f767
+704706a1
+2020774f
+6fe0c724
+c000f75e
+704706a2
+2020774f
+6fe0c724
+c000f755
+704706a3
+47404030
+6fe14722
+247a0000
+70435f00
+70472205
+20600000
+2040792a
+6fe0c721
+c000f570
+c0017619
+70470600
+70458421
+70458b18
+20407779
+20207ae8
+2040792c
+6fe0c721
+c000f575
+c0017620
+70470600
+70458421
+70458b24
+20407779
+20207ae8
+2040792e
+6fe0c721
+c000f57a
+c0017627
+70470600
+70458421
+70458b28
+20407779
+20207ae8
+20407930
+6fe0c721
+c000f57f
+c001762e
+70470600
+70458421
+70458b14
+20407779
+20207ae8
+4740c030
+58000000
+67e1c587
+20207ac4
+70459601
+2040778d
+70470601
+20600000
+70459602
+2040778d
+70470602
+20600000
+70459603
+2040778d
+70470603
+20600000
+70459604
+2040778d
+70470604
+20600000
+47414030
+6fe14594
+247a0000
+6fe1476e
+67e14594
+1fe0fe01
+67e146a6
+6fe0c721
+1fe67c01
+2022f511
+20600000
+20407948
+70458423
+20207ac2
+70458100
+7044ab00
+58000001
+67e146a9
+7046a801
+4741c030
+2040794a
+70435f01
+6fe1476c
+1febfe00
+67e145a2
+1fe0fe01
+67e146a6
+6fe0c57f
+67e0c58b
+70458428
+6fe0c58a
+1fe0fe01
+67e0c58a
+70458981
+6fe0c4a6
+1fe67c03
+2042fad1
+6fe0c4a6
+1fe67c05
+2042fad3
+204077b7
+20207ae8
+6fe1457b
+d840f0ff
+98417e00
+67e14587
+20207ade
+47424030
+2040794f
+7046a801
+70435f01
+58000001
+1febfe00
+67e146a9
+6fe1476c
+1febfe00
+67e145a2
+1fe0fe01
+67e146a6
+70458445
+5801feff
+67e1c585
+6fe0c58a
+1fe0fe01
+67e0c58a
+6fe0c4a6
+1fe67c03
+2042fad1
+6fe0c4a6
+1fe67c05
+2042fad3
+20207ae8
+70459600
+2040778d
+70458100
+20407951
+6fe0c721
+c000f522
+c00176c4
+7046ab01
+70458410
+20407ade
+20207ac2
+70459600
+2040778d
+202077e5
+6fe0c6ab
+203a77d7
+20407954
+70458100
+6fe0c721
+c000f526
+c00176bc
+7046ab00
+70458411
+20407ade
+20207ac2
+70459600
+2040778d
+20407957
+70458409
+20207ac2
+70458421
+704587ff
+704588ff
+70458b40
+20600000
+70458421
+704587ff
+70458b40
+20600000
+70458421
+704588ff
+70458b40
+20600000
+6fe0c597
+1fe67c03
+2042f807
+c000780a
+c000f812
+c001781a
+20600000
+58000000
+67e0c597
+20600000
+6fe0c597
+1fe0fe01
+67e0c597
+20407959
+6fe0c721
+c000f514
+204077f3
+20207ac2
+6fe0c597
+1fe0fe01
+67e0c597
+20407960
+6fe0c721
+c000f514
+204077f8
+20207ac2
+6fe0c597
+1fe0fe01
+67e0c597
+20407966
+6fe0c721
+c000f514
+204077fc
+20207ac2
+6fe0c6ad
+c000782b
+2040796c
+7046ad00
+6fe0c721
+c000f51f
+c0017613
+70458413
+20207ac2
+2040796e
+7046ad01
+6fe0c721
+c000f51f
+c0017613
+70458412
+20207ac2
+6fe0c598
+c000783b
+20407970
+70458421
+704587ff
+704588ff
+70459800
+70458b02
+20207ac2
+20407977
+70458b01
+70458421
+7045877f
+7045887f
+70459801
+20207ac2
+6fe0c721
+1fe67c01
+2042f52a
+7046fe01
+6fe0c59b
+c000784c
+2040797e
+7045841f
+70459b00
+20207ac2
+20407980
+7045841e
+70459b01
+20207ac2
+6fe0c721
+1fe67c01
+2042f52d
+70458422
+6fe0c599
+c000787a
+c000f876
+c0017872
+c001f86d
+c0027868
+c002f863
+c003785d
+20600000
+2040799d
+70459900
+704587ff
+704588ff
+704589ff
+20207ac2
+20407998
+70459906
+704587ff
+704589ff
+20207ac2
+20407993
+70459905
+704588ff
+704589ff
+20207ac2
+2040798e
+70459904
+704587ff
+704588ff
+20207ac2
+2040798a
+70459903
+704589ff
+20207ac2
+20407986
+70459902
+704588ff
+20207ac2
+20407982
+70459901
+704587ff
+20207ac2
+204079a3
+70458701
+70458441
+20207ac2
+70459601
+2040778d
+204079ad
+70459d01
+70458410
+70458101
+20207ac2
+70459602
+2040778d
+204079af
+70459e01
+70458410
+70458102
+20207ac2
+70459603
+2040778d
+70459f01
+70458410
+70458103
+20207ac2
+70459604
+2040778d
+204079b3
+7045a001
+70458410
+70458104
+20207ac2
+70459601
+2040778d
+6fe0c59d
+203a7884
+204079b5
+70459d00
+70458411
+70458101
+20207ac2
+70459602
+2040778d
+6fe0c59e
+203a788b
+204079b7
+70459e00
+70458411
+70458102
+20207ac2
+70459603
+2040778d
+6fe0c59f
+203a7892
+204079b9
+70459f00
+70458411
+70458103
+20207ac2
+70459604
+2040778d
+6fe0c5a0
+203a7898
+204079bb
+7045a000
+70458411
+70458104
+20207ac2
+70458101
+7044ab01
+2020779d
+70458102
+7044ab02
+2020779d
+70458103
+7044ab03
+2020779d
+70458104
+7044ab04
+2020779d
+20407909
+7045846f
+70458700
+20207ac2
+6fe0c5a6
+203a78d5
+7045a600
+202078da
+2040790c
+7045a601
+70458415
+70458701
+20207ac2
+2040790d
+70458415
+70458700
+20207ac2
+20407910
+70458433
+70458702
+20207ac2
+20407914
+58000001
+67e0c587
+70458432
+70458806
+20207ac2
+2040791a
+58000002
+202078e4
+2040791c
+58000003
+202078e4
+2040791e
+58000004
+202078e4
+20407920
+58000005
+202078e4
+20407922
+58000006
+202078e4
+70459601
+2040778d
+20407924
+70458431
+70458700
+20207ac2
+6fe0c6ac
+203a7904
+20407927
+7046ac00
+70458416
+70458700
+20207ac2
+20407926
+7046ac01
+70458416
+70458701
+20207ac2
+5800006f
+67e144ac
+20207935
+7044af01
+58000015
+67e144ac
+20207935
+7044af02
+58000033
+67e144ac
+20207935
+58000001
+67e0c4b0
+58000031
+67e144ac
+7044af20
+20207935
+58000002
+20207915
+58000003
+20207915
+58000004
+20207915
+58000005
+20207915
+58000006
+20207915
+58000000
+20207915
+7044af01
+58000016
+67e144ac
+20207935
+7044af18
+20207932
+7044af24
+20207932
+7044af28
+20207932
+7044af14
+20207932
+58000021
+67e144ac
+20207935
+4742c030
+20407de4
+6fe0c6af
+245a793a
+20600000
+47434030
+df200027
+d8c0447c
+d8a046d7
+2040740c
+6fe0c6af
+67e0c4a3
+6fe0c4a4
+1fe0ffff
+67e0c4a4
+20407de4
+6fe0c770
+67e0c4a3
+20600000
+58000023
+2020794b
+58000028
+67e144ac
+58000000
+67e244ae
+20207935
+58000045
+2020794b
+7044ab00
+58000010
+2020794b
+7044ab00
+58000011
+2020794b
+58000009
+2020794b
+58000021
+67e144ac
+7044ae00
+7044af40
+7044b0ff
+7044b1ff
+20207935
+58000021
+67e144ac
+7044ae00
+7044af40
+7044b0ff
+20207935
+58000021
+67e144ac
+7044ae00
+7044af40
+7044b1ff
+20207935
+58000013
+2020794b
+58000012
+2020794b
+58000021
+67e144ac
+7044ae00
+7044af02
+7044b0ff
+7044b1ff
+20207935
+58000021
+67e144ac
+7044ae00
+7044af01
+7044b07f
+7044b17f
+20207935
+5800001f
+2020794b
+5800001e
+2020794b
+58000022
+67e144ac
+7044afff
+20207935
+58000022
+67e144ac
+7044b0ff
+20207935
+58000022
+67e144ac
+7044b1ff
+20207935
+58000022
+67e144ac
+7044afff
+7044b0ff
+20207935
+58000022
+67e144ac
+7044afff
+7044b1ff
+20207935
+58000022
+67e144ac
+7044b0ff
+7044b1ff
+20207935
+58000022
+67e144ac
+7044afff
+7044b0ff
+7044b1ff
+20207935
+58000001
+7044a601
+67e144af
+58000041
+67e144ac
+7044ae00
+7044b100
+20207935
+58000000
+202079a4
+7044ab01
+20207952
+7044ab02
+20207952
+7044ab03
+20207952
+7044ab04
+20207952
+7044ab01
+20207955
+7044ab02
+20207955
+7044ab03
+20207955
+7044ab04
+20207955
+4743c030
+204076cc
+204076e4
+6fe44556
+245a79f7
+204079ea
+6fe0c706
+245a79dc
+204079ce
+6fe0c35f
+205a79fd
+6fe0c6a8
+245a7a05
+6fe0c6a8
+205a7a0a
+47444031
+20207a10
+4744c031
+6fe0c721
+1fe67c01
+2042f4fe
+6fe44556
+207a0000
+58000000
+67e1c587
+67e244ae
+70458b00
+6fe0c706
+245a79dc
+6fe14762
+20207487
+6fe14764
+20207487
+47454031
+6fe44556
+1fe20400
+df200019
+d8e00000
+204079f2
+18e27e00
+67e0c5a1
+58000000
+67e44556
+4745c031
+20207bca
+6fe0c572
+247a0000
+70458200
+70472400
+58000000
+67e14594
+67e144e4
+20600000
+afefffff
+20608000
+18e08e01
+c20079f2
+20600000
+70457201
+7046a801
+58000001
+67e146a9
+70457901
+20600000
+47464031
+6fe0c572
+247a0000
+58000000
+67e146a9
+7046a800
+4746c031
+20600000
+47474031
+6fe0c580
+207a0000
+6848c580
+2020773e
+4747c031
+6fe0c580
+207a0000
+6848c580
+18418480
+2020773e
+6fe146a6
+247a0000
+6fe146a9
+247a0000
+47484032
+20407a1a
+20407a2a
+4748c032
+d85fffff
+20203b47
+47494032
+df20000b
+70473c03
+6848c73c
+18420e00
+6fe24738
+afefffff
+2020fa24
+18418480
+20406b7c
+6fe0c73c
+1fe0fe01
+67e0c73c
+c2007a1d
+70807d40
+20600000
+4749c032
+6848c55e
+18422200
+da400000
+d8400000
+604c0016
+d8c04560
+20407a35
+7920040d
+604a0016
+20600000
+efe08006
+98000e00
+f9200400
+1a40a401
+1a227e00
+9a467c00
+20628000
+20207a35
+474a4032
+6fe0c721
+c0017a84
+6fe0c4a3
+243a7a65
+6fe0c721
+c000fa6b
+6fe0c57f
+243a7a6b
+6fe0c6ae
+243a7a73
+6fe0c6af
+243a7a79
+58000000
+67e24701
+20600000
+474ac032
+df200027
+d8a0412b
+d8c0464f
+2040740c
+202042b6
+474b4032
+df200027
+d8a0412b
+d8c0447c
+2040740c
+202042b6
+474bc032
+df200027
+d8a0412b
+d8c046b0
+2040740c
+202042b6
+474c4033
+df200027
+d8a0412b
+d8c046d7
+2040740c
+202042b6
+474cc033
+6fe0c701
+c001fa42
+1fe0fe01
+67e0c701
+20207a53
+474d4033
+6fe0c702
+c001fa46
+1fe0fe01
+67e0c702
+6fe0c721
+c000fa7f
+20207a4d
+474dc033
+6fe0c703
+c001fa48
+1fe0fe01
+67e0c703
+20207a59
+474e4033
+6fe0c704
+c001fa4a
+1fe0fe01
+67e0c704
+20207a5f
+df200017
+d8a0412b
+d8c0464f
+2040740c
+202042b6
+6fe0c555
+1fe0fe01
+67e0c555
+1fe67c03
+20217a53
+1fe67c06
+20217a90
+1fe67c09
+20217a95
+58000000
+67e0c555
+20207a53
+df200025
+d8a0412b
+d8c04530
+2040740c
+202042b6
+df200025
+d8a0412b
+d8c0464f
+2040740c
+202042b6
+474ec033
+6fe0c71f
+205a7aa4
+2feffe00
+2020faa7
+2feffe01
+2020fab0
+2feffe02
+2020fab9
+20600000
+6fe0c71e
+67e0c71f
+20600000
+474f4033
+6fe0c71f
+793ffe00
+67e0c71f
+6848c36a
+79200400
+6048c36a
+70000725
+20204309
+474fc033
+6fe0c71f
+793ffe01
+67e0c71f
+6848c36a
+79200401
+6048c36a
+70000726
+20204309
+47504034
+6fe0c71f
+793ffe02
+67e0c71f
+6848c36a
+79200402
+6048c36a
+70000727
+20204309
+20407ac4
+20207ae8
+4750c034
+20407ad5
+47514034
+6fe0c58a
+1fe0fe01
+67e0c58a
+6fe0c4a6
+1fe67c03
+2042fad1
+6fe0c4a6
+1fe67c05
+2042fad3
+20207ade
+70458983
+20600000
+70458988
+20600000
+4751c034
+70435f01
+7046a901
+7046a801
+6fe1476c
+67e145a2
+1fe0fe01
+67e146a6
+20600000
+47524034
+6fe0c57c
+d84000f0
+98417e00
+6848c581
+9840fe00
+67e0c57c
+6fe1457b
+67e14585
+20600000
+4752c034
+6fe0c57f
+245a7b01
+6fe0c584
+1fe67c28
+2042fafe
+20407b1b
+d8a0463f
+d8c04584
+df20000e
+2040740c
+df200027
+d8c04628
+d8a0464f
+2040740c
+70467a27
+70467b53
+20407b73
+6fe0c57f
+67e0c659
+47534034
+20600000
+6fe0c57f
+67e0c58b
+20600000
+4753c034
+6fe0c584
+1fe67c28
+2042fb18
+20407b1b
+d8a0463f
+d8c04584
+df20000e
+2040740c
+df200027
+d8c04628
+d8a0464f
+2040740c
+70467a27
+70467b53
+20407b73
+df200027
+d8c0464f
+d8a046b0
+2040740c
+6fe0c6ae
+67e0c6ba
+20600000
+6fe0c6ae
+67e0c58b
+20600000
+47544035
+70458c01
+70458d00
+180a7e00
+1fec8400
+6048c58e
+67e0c58f
+1fe47e00
+67e144c6
+6fe0c58f
+6848c58c
+9842fe00
+67e0c58c
+6848c58d
+9842fe00
+67e0c58d
+4754c035
+da604584
+df20000c
+20407b37
+6fe144c6
+da20ff00
+9a210400
+184c8400
+6048c590
+6fe0c4c6
+67e0c591
+20600000
+6fe0c721
+c0017b57
+20207b3a
+47554035
+e8408013
+184d0400
+6fe144c6
+98428400
+d8e00000
+20407b45
+604944c6
+1a60a601
+c2007b3a
+20600000
+18427e00
+1feca200
+1a31a200
+1a292200
+1fe38400
+1a227e00
+245a7b50
+18e08e01
+18e27e00
+c0847b45
+20600000
+6fe144c8
+1fe22200
+18427e00
+9a22fe00
+da20ffff
+9a210400
+20600000
+4755c035
+6fe144c6
+e8408013
+1a60a601
+184d8400
+184d0400
+9842fe00
+1f222400
+df200008
+2feffe0f
+1fe3fe00
+2420fb65
+684944c8
+9842fe00
+c2007b60
+1a427200
+c2007b59
+67e144c6
+6848c4c6
+184d8400
+6fe0c4c7
+1fedfe00
+6048c4c7
+67e0c4c6
+20600000
+47564035
+20407b7b
+20207b76
+4756c035
+20407b76
+20207b7b
+47574035
+d8c0464f
+d8a0464f
+df200027
+20207b83
+4757c035
+df200027
+da60464f
+da400053
+6fe0c721
+1fe67c02
+2042f607
+20207b89
+47584036
+efe08006
+1fedfe00
+e7e08005
+c2007b83
+20600000
+4758c036
+20407b8e
+1a60a601
+c2007b89
+20600000
+47594036
+da200001
+1a43a400
+2a4ffe07
+2040fb97
+1a23a200
+1a227e00
+c3840000
+20207b90
+4759c036
+efe08013
+9a22fe00
+e7e08013
+1a42a411
+20600000
+6fe0c721
+1fe67c01
+2042fbcd
+20407bc3
+20407ba9
+20407bad
+20407bc0
+20407bb2
+20407bb7
+20407bbb
+475a4036
+20600000
+da604579
+da407bac
+20204dd3
+20600000
+da6045a2
+da407bb0
+20204dd3
+70435f00
+20600000
+da6046a9
+da407bb5
+20204dd3
+7046a800
+20600000
+da6046a6
+da407bba
+20204dd3
+20600000
+da604722
+da407bbe
+20204dd3
+70472401
+20600000
+da604594
+da407bc6
+20204dd3
+da604709
+da407bc8
+20204dd3
+6fe14766
+20207487
+6fe14768
+20207487
+6fe1476a
+67e14709
+20600000
+da6044e4
+da407bd0
+20204dd3
+6fe14594
+207a0000
+7044e801
+20600000
+4731c02c
+20207bd7
+20600000
+4732402c
+20403cf9
+7854fc00
+20404296
+20407be1
+24768000
+6fe08002
+1fe0fe01
+67e08002
+20207c5d
+20407be3
+20203d92
+6fe0c779
+67e08007
+20600000
+58000003
+20207d54
+58000008
+20207d54
+6fe34788
+684b4782
+98467c00
+20600000
+6fe0c773
+203a7bf6
+6fe0c778
+c000fbf6
+6fe0c777
+c0287bf6
+20407bea
+2022fbe8
+58000014
+20207d54
+6fe0c773
+203a7c00
+6fe0c778
+c000fc00
+6fe0c777
+c0287c00
+20407bea
+2022fbe8
+58000018
+20207d54
+58000006
+20207d54
+6fe0c7a9
+c1a00000
+58000005
+20207d54
+6fe147a9
+243a7c0c
+5800001b
+20207d54
+58000017
+20207d54
+6fe0c7aa
+c0007c20
+c000fc22
+c0017c26
+c001fc2a
+20600000
+6fe0c7a9
+c0107c17
+20207c0e
+6fe0c7aa
+c0007c20
+c000fc22
+c0017c24
+c001fc26
+c0027c28
+c002fc2a
+c0037c2c
+20600000
+58000016
+20207d54
+58000010
+20207d54
+58000012
+20207d54
+5800001c
+20207d54
+5800000a
+20207d54
+5800000f
+20207d54
+5800000c
+20207d54
+6fe0c7a9
+203a7c32
+58000011
+20207d54
+58000004
+20207d54
+58000007
+20207d54
+58000013
+20207d54
+6fe0c7a9
+203a7c3c
+5800000d
+20207d54
+5800000e
+20207d54
+4732c02c
+6fe0c7a9
+c000fc43
+c0017c45
+20600000
+5800001e
+20207d54
+58000015
+20207d54
+6fe147a9
+c07ffc56
+4733402c
+6fe147a9
+c0707c56
+c01e7c50
+c03c7c52
+c0787c54
+20600000
+58000002
+20207d54
+58000009
+20207d54
+58000019
+20207d54
+5800001a
+20207d54
+58007bd4
+67e14394
+58007d43
+67e1439c
+20207d59
+6fe0c771
+c0007c63
+6fe1477a
+20407487
+20347cb5
+20600000
+4733c02c
+6fe08052
+c02afc97
+70477700
+58000000
+67e34788
+68498053
+58528718
+98467c00
+70477800
+2022fc79
+70477801
+5808f9ff
+98467c00
+2022fc79
+5808f903
+98467c00
+2022fc79
+70477802
+58f87703
+98467c00
+24628000
+d8c00047
+d8a0464f
+df200027
+20407419
+70467b53
+70467a27
+20407b70
+6fe0c778
+c000fc95
+d8c04666
+d8a0473e
+df20000e
+2040740c
+6fe14748
+1ff0fe00
+1fe47e00
+67e144c6
+da60473e
+df20000c
+58001021
+67e144c8
+20407b3a
+6fe144c6
+1ff0fe00
+6849474a
+98467c00
+24628000
+20207ca8
+d8c04667
+20207c83
+4734402d
+d8a04788
+d8c00049
+df200006
+2040740c
+6fe08051
+67e0c777
+6848c774
+98467c00
+2022fc69
+6848c775
+98467c00
+2022fc69
+6848c776
+98467c00
+2022fc69
+20600000
+4734c02d
+6fe0c73e
+67e147a6
+6fe14741
+67e147a9
+6fe0c73f
+67e0c7ad
+6fe0c740
+67e0c7ac
+6fe0c740
+1fe17e0f
+67e0c7ae
+20207cc3
+4735402d
+6fe144b6
+1ff27e00
+67e147ac
+6fe344bb
+67e347a6
+6fe0c4ba
+67e0c7ae
+6fe0c4c5
+67e0c778
+6fe0c4b2
+67e0c777
+6fe0c4b3
+67e0c744
+4735c02d
+6fe147a4
+20407487
+20407cec
+20740000
+6fe147a6
+c0147be6
+c004fbe8
+c0087bee
+c008fbf8
+c037fc02
+c0187c08
+c00afc2e
+c00bfc34
+c00b7c38
+c00c7c36
+c019fc3e
+6fe0c771
+c0007cd8
+c000fce6
+20600000
+6fe147a6
+c028fc47
+c020fc47
+6fe14741
+67e147aa
+6fe147a6
+c018fc0e
+c0197c17
+6fe0c745
+67e0c7a9
+6fe147a6
+c010fc04
+4736402d
+20600000
+6fe147a6
+c018fc14
+c020fc49
+c010fc04
+4736c02d
+20600000
+4737402d
+204074ca
+684947ac
+d8e00009
+df20000a
+1f26260a
+18e27e00
+9a667c00
+20217cf8
+1a667c03
+24217cf8
+20207d03
+d8c0055e
+1a6ffe03
+98c08c00
+efe10006
+98467c00
+2422fd03
+ea208006
+6fe0c7ae
+203a7d13
+9a267c00
+2022fd13
+c2007cf1
+da200576
+df200009
+efe18011
+1a208403
+e7e18002
+1a20a3fd
+c2007d06
+6fe1c7ac
+67e1855e
+6fe08584
+67e08585
+6fe4057c
+67e4057d
+70057c00
+20207cec
+1f220400
+60488587
+d840057c
+1f267e0a
+98408400
+18422200
+e8408002
+6fe0c744
+98467c00
+2022f4c8
+20217d24
+1fe0ff00
+98467e00
+1fe17eff
+1fe67c06
+20217d24
+20600000
+6fe0c744
+67e085a6
+6fe1006a
+67e105a7
+684985a6
+d8c00588
+df20000a
+efe18006
+98467c00
+2022f4c8
+c2007d2b
+7005aa1e
+6fe185a0
+67e185a3
+6fe40590
+684c0598
+67e40593
+604c059b
+6fe40588
+67e4058b
+6fe185a6
+67e18588
+6fe08587
+1fe27200
+d840057c
+1f267e0a
+98408400
+6fe0c744
+e7e08002
+7005a91e
+20600000
+4737c02d
+20207d45
+20407d47
+20207d4d
+da6005aa
+da407d4a
+20204dcc
+df20001e
+d8a00588
+202073ec
+da6005a9
+da407d50
+20204dcc
+70478100
+df20000a
+d8a0057c
+202073ec
+67e0c790
+6fe147a2
+20207487
+6848c79f
+2020773e
+6848c79f
+18418480
+2020773e
+4738402e
+20407dbf
+20407d60
+20207dce
+dfe00004
+1fe9fe00
+67e1478e
+1fe20e00
+18e08fff
+684a4792
+6fe1478e
+207a0000
+1fe0ffff
+67e1478e
+a84fffff
+2020fd72
+20407dc8
+18e08fff
+6fe1478e
+684a4792
+243a7d66
+20600000
+20407dc2
+20207d6d
+6fe1479c
+207a0000
+1fe0ffff
+67e1479c
+20407d5c
+20207d74
+20407d9b
+58000003
+67e1479c
+20207d74
+6fe0c777
+6848c776
+98467c00
+2022fd87
+6fe0c778
+c0007d85
+20207d87
+58000000
+20207d88
+58000080
+6848c7ae
+1841227f
+9a21fe00
+1ff18400
+6048c7b1
+1fe17e0f
+1ff27e00
+6848c7ad
+184122f0
+1a31a200
+9a21fe00
+67e0c7b0
+18417e0f
+1ff27e00
+6848c7ac
+18518400
+9841fe00
+67e0c7af
+20600000
+6fe1c7af
+1ff27e00
+1fed7e00
+6848c790
+18498400
+18520400
+9841a200
+20407db7
+1ff27e00
+9a21a200
+20407da9
+9a21fe00
+67e24792
+20600000
+df200004
+1a222400
+de000000
+1a4126ff
+1a617ef0
+1ff1fe00
+9e02e000
+1a617e0f
+9e02e000
+1a4ca400
+c2007dac
+1e02e00a
+1e017e0f
+20600000
+6fe0c791
+1fe0fe01
+1fe17e07
+67e0c791
+20600000
+2000000c
+c2007dbc
+20600000
+20407d59
+df201900
+20207dbc
+20407d57
+df200257
+20407dbc
+20407d59
+df2000c8
+20207dbc
+20407d57
+df2000c8
+20407dbc
+20407d59
+df200257
+20207dbc
+20407d57
+df2000c8
+20407dbc
+20407d59
+df20022f
+20207dbc
+6fe1479a
+207a0000
+1fe0ffff
+67e1479a
+20407dc2
+20207dd4
+6fe1479a
+207a0000
+1fe0ffff
+67e1479a
+20407dc8
+20207dda
+20406eb3
+d8a0443c
+d8c097b5
+202073c4
+58002542
+67e1447c
+5810255d
+67e1c47e
+58109e3a
+67e1c481
+58000000
+67e1c49c
+58020102
+67e1c484
+58f0161b
+67e1c487
+58001008
+67e1c48a
+6fe0c4a4
+1fe0fe01
+67e0c4a4
+6fe144ca
+20207487
+5800ffff
+20600000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00020001
+18000228
+03020002
+030a0128
+2a000200
+00000014
+00000000
+00000000
+00000000
+00000000
+02000400
+02012803
+01020005
+03c2022a
+03020006
+07020128
+2a040200
+06000608
+2c006400
+02000801
+01022800
+02000918
+20012803
+0502000a
+000b002a
+02290202
+000c0000
+02280002
+000d180a
+01280302
+02000e02
+59062a29
+69684369
+02000f70
+02012803
+50020010
+3502072a
+01aa2212
+02001100
+12022800
+02001218
+06012803
+4e020013
+1401012a
+28030200
+00151201
+082a4d02
+00000000
+00000000
+02020016
+00000229
+08020017
+01020229
+03020018
+191a0128
+2a4d0200
+00000007
+00000000
+0202001a
+00000229
+0802001b
+01010229
+0302001c
+1d120128
+2a4d0200
+1e000002
+29020200
+1f000002
+29080200
+20010302
+28030200
+00211201
+022a4d02
+00220000
+02290202
+00230000
+02290802
+00240104
+01280302
+0200250e
+00022a4d
+02002600
+02022908
+02002702
+02012803
+4b020028
+0105bd2a
+01a10209
+01090185
+090500a1
+08290119
+01250015
+08950175
+01050281
+31093009
+26f80116
+107507ff
+06810295
+81153809
+08757f25
+06810195
+380a0c05
+81019502
+05c0c006
+a1060901
+75028501
+05089501
+29e01907
+250015e7
+95028101
+81087501
+75059503
+19080501
+91052901
+75019502
+95039103
+15087506
+00ff2600
+00190705
+0081ff29
+090c05c0
+8501a101
+2a001903
+001503ff
+9503ff26
+81107501
+0105c000
+01A18009
+00150485
+01750125
+81190395
+02818329
+05750195
+29C00381
+28030200
+002a1a01
+082a3302
+00000000
+00000000
+0202002b
+00010229
+0302002c
+2d020128
+2a4a0200
+00010104
+02002e03
+0f022800
+02002f18
+12012803
+19020030
+3164012a
+29020200
+32000002
+28030200
+00330401
+002a4c02
+061a0000
+8809ffbc
+048501a1
+ff2a0019
+26001500
+087500ff
+00810195
+01053fc0
+01a10609
+08950175
+e0190705
+0015e729
+02810125
+08750195
+05950381
+08050175
+05290119
+01950291
+03910375
+08750695
+ff250015
+00190705
+0081ff29
+0105a3c0
+01a10209
+01090185
+090500a1
+05290119
+01250015
+01750595
+01950281
+01810375
+30090105
+01163109
+07FF26F8
+02951075
+38090681
+7f258115
+01950875
+0c050681
+9502380a
+c0068101
+090105c0
+8501a180
+19010502
+15882981
+95012500
+81017508
+0c05c006
+01a10109
+00150385
+19038026
+03802a00
+01951075
+06c00081
+0e09ff00
+BA8501a1
+08751f95
+1500ff26
+91010900
+95BA8502
+2608751f
+001500ff
+02810109
+011212C0
+00000200
+31514000
+00021020
+01000201
+3b02093b
+00010200
+040932a0
+03010000
+09000101
+00020021
+001a2201
+03810507
+09020040
+01000104
+00020103
+02002109
+a3220100
+82050700
+02004003
+00020001
+18010228
+03020002
+03200128
+2a050200
+00040001
+02290202
+00050000
+02280002
+00061800
+01280302
+02000702
+43132a00
+73706968
+422d6165
+2020454c
+20202020
+00082020
+01280302
+02000902
+c1022a01
+02000a03
+02012803
+0402000b
+0006082a
+00640006
+000c012c
+02280002
+000d180a
+01280302
+02000e02
+01072a50
+0a000e05
+000f4002
+02280002
+00101812
+01280302
+02001106
+01012a4e
+03020012
+13100128
+2a4d0200
+00000007
+00000000
+02020014
+00000229
+08020015
+01010229
+03020016
+17100128
+2a4d0200
+00000003
+02020018
+00000229
+08020019
+01040229
+0302001a
+1b100128
+2a4d0200
+1c000002
+29020200
+1d000002
+29080200
+1e010302
+28030200
+001f1001
+032a4d02
+20000000
+29020200
+21000002
+29080200
+22010502
+28030200
+00231201
+022a4d02
+00240000
+02290202
+00250000
+02290802
+00260102
+01280302
+02002702
+00012a4b
+03020028
+29020128
+2a4a0200
+00011104
+02002a01
+04012803
+4c02002b
+2c00012a
+28000200
+00180f02
+001f0300
+00000fec
+03000000
+0014001f
+00000000
+001f0300
+00fec000
+03000000
+4000001f
+00000001
+001f0300
+00000000
+03000000
+0000001f
+00000000
+001b0200
+000000e9
+02000000
+00ea001b
+00000000
+001b0200
+00000000
+03000000
+8028001f
+00000011
+001f0300
+00118fae
+03000000
+e000001f
+000000fc
+001f0300
+00050000
+03000000
+00010017
+00000000
+001f0300
+0000003c
+03000000
+17ff001f
+00000080
+001f0300
+00000fd8
+03000000
+00000017
+00000000
+001f0300
+007ff801
+03000000
+4000001f
+000000fc
+001f0300
+00801801
+03000000
+403c001f
+0000000b
+001f0300
+0003c000
+03000000
+403c001f
+000000ec
+001f0300
+000c803c
+03000000
+1000001f
+00000080
+001f0300
+0007803c
+03000000
+0096001f
+00000000
+001f0300
+00000f6a
+03000000
+d002001f
+000000ff
+001f0300
+00003002
+03000000
+0064001f
+00000000
+001f0300
+00f9b000
+07000000
+06070013
+0dac0770
+00130701
+07700607
+07010c80
+06070013
+0b540770
+00130701
+07700607
+07010a28
+06070013
+08fc0770
+00130701
+07700600
+07000578
+07070013
+07700770
+00130701
+07700700
+07000770
+05070013
+04700c10
+00130701
+0b480507
+07010470
+05070013
+04700AF0
+00130701
+09C40507
+07010470
+05070013
+0470076C
+00130701
+04400507
+07010470
+05070013
+047002E8
+00130701
+02000500
+07000470
+06000013
+0eac0770
+00130700
+0d100500
+03000470
+fa000017
+00000000
+00170300
+00002800
+03000000
+d2000017
+00000000
+00170300
+00003200
+03000000
+00000017
+000000fa
+00170300
+00050000
+03000000
+00000017
+000000f0
+00170300
+000f0000
+02000000
+00300023
+00000000
+00230200
+00000000
+03000000
+30a0001f
+000000e8
+001f0300
+0007403c
+03000000
+4041001f
+0000000b
+93fdb700
+f73f3626
+e5a534cc
+31d871f1
+23c70415
+059618c3
+8012079a
+b227ebe2
+89a18c75
+42e6bf0d
+2d994168
+bb54b00f
+51c29b16
+6a1a532f
+6e02b583
+a3ab1610
+00000042
+00000000
+0000b842
\ No newline at end of file
Index: program/app.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app.prog	(working copy)
@@ -0,0 +1,325 @@
+app_init:
+	bpatch patch0e_0,mem_patch0e
+	fetch 1,mem_device_option
+	branch app_init,blank				/* wait ram to be initialized */
+	beq dvc_op_dongle,dongle_init
+	beq dvc_op_shutter,shutter_init
+	beq dvc_op_shutter_dy,shutter_dy_init
+//	beq dvc_op_car,car_init
+//	beq dvc_op_remote_car,remote_car_init
+	beq dvc_op_mouse,mouse_init
+	rtn
+
+
+app_param_init:
+	rtn wake
+	call adc_init_data
+	fetch 1,mem_device_option
+	beq dvc_op_shutter,shutter_default_init
+	beq dvc_op_shutter_dy,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_process_idle:
+	call ui_dispatch
+	call check_51cmd
+	call app_process_bb_event
+	fetch 2,mem_cb_idle_process
+	branch callback_func
+
+app_process_ble:
+	fetch 2,mem_cb_le_process
+	branch callback_func
+
+app_process_bb_event:
+	bpatch patch0e_1,mem_patch0e
+	//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_BUTTON_LONG_PRESSED,app_evt_button_long_pressed
+	beq BT_EVT_LE_CONNECTED,app_le_event_bb_connected
+	beq BT_EVT_LE_DISCONNECTED,app_le_event_bb_disconn
+	rtn
+
+
+
+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_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_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_evt_timer:
+	store 1,mem_app_evt_timer_count
+app_evt_100ms_loop:
+	bpatch patch0e_2,mem_patch0e
+	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 flash_write_spi_sm_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_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_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_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_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_ble_store_reconn_info:
+	jam BT_CMD_STORE_RECONN_INFO_LE,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
+
+
+
+
Index: program/app_car.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_car.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_car.prog	(working copy)
@@ -0,0 +1,972 @@
+ifdef COMPILE_CAR
+
+//car_init:
+//	call enable_authrom
+//	rtn wake
+//	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 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
+//	
+
+//	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_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
+	fetchr loopcnt,1,mem_le_name_len
+	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
+	fetchr loopcnt,1,mem_le_name_len
+	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
+	fetchr loopcnt,1,mem_car_led_num
+	arg mem_car_led_map,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
+	call car_g24_load_commom_addr
+	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 car_gpio_set_before_hibernate
+	call clear_wake
+car_le_process_lpm_before:
+	branch keyscan_process_lpm_before
+
+car_gpio_set_before_hibernate:
+	 call check_51cmd_led_off
+car_gpio_set_before_lpm_common:
+	arg 20,loopcnt
+	arg core_gpio_conf,contr
+car_setgpio_loop:
+	copy contr,contw
+	ifetch 1,contr
+	beq gpcfg_spid_miso,car_setgpio_pullup
+	beq gpcfg_spid_ncs,car_setgpio_pullup
+	beq gpcfg_spid_sck,car_setgpio_pullup
+	beq gpcfg_spid_mosi,car_setgpio_pullup
+	beq gpcfg_spid_sdio,car_setgpio_pullup
+	beq gpcfg_iic_scl,car_setgpio_pullup
+	beq gpcfg_iic_sda,car_setgpio_pullup
+	beq gpcfg_input,car_setgpio_pullup
+car_setgpio_loop_end:
+	loop car_setgpio_loop
+	branch car_motor_setgpio
+//	rtn
+car_setgpio_pullup:
+	setarg gpcfg_pullup
+	istore 1,contw
+	branch car_setgpio_loop_end
+car_setgpio_pulldown:
+	setarg gpcfg_pulldown
+	istore 1,contw	
+	branch car_setgpio_loop_end
+car_motor_setgpio:	
+	fetch 1,mem_car_motor_gpio_num
+	copy pdata,loopcnt
+	arg mem_car_motor_gpio_map,contr
+car_motor_setgpio_loop:
+	ifetch 1,contr
+	set1 7,pdata
+	arg gpcfg_output_low,temp
+	call gpio_config_function
+	loop car_motor_setgpio_loop
+	rtn
+	 
+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
+	branch 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 adc_calculate
+	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 patch05_3,mem_patch05
+	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 patch05_4,mem_patch05
+	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
+	rtn blank
+	branch car_moto3_enable_blank_data_timer,blank
+
+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 patch05_5,mem_patch05
+	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 patch05_6,mem_patch05
+	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
+	call g24_rx_window_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_bind_work
+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 car_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 car_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_work_mode_start:
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_WORK
+	call car_g24_work_init
+	call g24_ch_process
+	branch car_g24_receive_packet_start
+car_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
+	fetch 4,mem_car_24g_commom_addr
+	branch g24_work_init+11
+car_g24_receive_packet_start:	
+	call g24_receive_transmit_ack
+	nbranch g24_rx_interrupt_clear,user3
+p_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_ATTEMP,car_g24_data_attemp	//reconn packet
+	beq DATATYPE_DEVICE1,car_g24_data_device1	//mouse
+	branch g24_receive_packet_parse+14
+car_g24_data_attemp:
+	call check_51cmd_led_on
+	branch g24_data_attemp	
+car_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,car_g24_data_attemp_device1_abort
+	branch g24_data_device1+7
+car_g24_data_attemp_device1_abort:
+	fetch 1,mem_device_option
+	sub pdata,dvc_op_car,null
+	call check_51cmd_led_on,zero
+	fetch 4,mem_24g_rxdata_temp+10
+	branch g24_store_device1_addr
+	
+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 check_51cmd_led_on
+	call g24_switch_work_mode
+	call g24_timer_init
+
+        fetch 4,mem_24g_lap
+        store 4,mem_car_24g_commom_addr
+        fetch 1,mem_car_save_addr_flag
+        ncall car_g24_save_commom_addr,blank
+		
+	fetch 4,mem_car_24g_commom_addr
+	branch g24_update_addr_and_synccrc8
+
+car_g24_save_commom_addr:
+
+        fetch 1,mem_car_save_addr_flag
+        rtn blank
+	fetch 1,mem_24g_transmitter_addr+1	//Tx lap H
+	store 1,mem_car_24g_commom_addr+3
+
+	fetch 1,mem_24g_lap+1				//Rx lap H
+	store 1,mem_car_24g_commom_addr+2
+
+	fetch 1,mem_24g_transmitter_addr	//Tx lap L
+	store 1,mem_car_24g_commom_addr+1
+
+	fetch 1,mem_24g_lap					//Rx lap L
+	store 1,mem_car_24g_commom_addr
+ifdef CAR_TEST_FUNCTION
+        rtn
+endif // CAR_TEST_FUNCTION  	
+	call car_g24_search_commom_addr
+	fetch 4,mem_car_24g_commom_addr
+	fetcht 4,mem_car_24g_commom_addr_temp 
+	isub temp,null
+	rtn zero        
+        copy regc,pdata
+        arg mem_car_24g_commom_addr,rega
+        arg 4,loopcnt        
+        call otp_write
+        rtn
+car_g24_load_commom_addr:
+
+        fetch 4,mem_24g_lap
+        store 4,mem_car_24g_commom_addr
+        fetch 1,mem_car_save_addr_flag
+        rtn blank
+ifdef CAR_TEST_FUNCTION
+        rtn
+endif // CAR_TEST_FUNCTION         
+        call car_g24_search_commom_addr
+        fetch 4,mem_car_24g_commom_addr_temp
+        rtn blank
+        store 4,mem_car_24g_commom_addr
+        rtn
+
+/* regc=otp start address and output */        
+car_g24_search_commom_addr:
+ifdef CAR_TEST_FUNCTION
+        rtn
+endif // CAR_TEST_FUNCTION 
+        fetch 1,mem_car_save_addr_flag
+        rtn blank
+        arg OTP_OFFSET_CAR_COMMOM_START_ADDR,regc
+car_g24_search_commom_addr_loop:
+        copy regc,pdata
+        arg mem_car_24g_commom_addr_temp,rega
+        arg 4,temp
+        call otpd_read_data_with_pwr_operation
+        fetch 4,mem_car_24g_commom_addr_read
+        rtn blank    
+        store 4,mem_car_24g_commom_addr_temp
+        copy regc,pdata
+        arg OTP_OFFSET_CAR_COMMOM_END_ADDR,temp
+        isub temp,null
+        rtn positive        
+        increase 4,regc
+        branch car_g24_search_commom_addr_loop
+        
+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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_dongle.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_dongle.prog	(working copy)
@@ -0,0 +1,548 @@
+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
+	branch usb_init
+
+
+dongle_default_init:
+	bpatch patch05_7,mem_patch05
+	//sys init
+	call dongle_read_kb_bind_status
+//	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_24g_tx_power_default
+//	store 1,mem_tx_power
+	//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
+//	jam TX_POWER_F5DB,mem_24g_pair_tx_power
+	jam 0,mem_dg_kb_bind_success
+	jam 0,mem_24g_bind_device_living
+//	call g24_enable_1M
+//	fetch 1,mem_dg_sys_config
+//	isolate1 DG_ENABLE_24G_2M,pdata
+//	call g24_enable_2M,true
+	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
+	//watchdog init
+	call wdt_set_enable
+	branch wdt_kick_128ms
+
+
+//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:
+	bpatch patch06_0,mem_patch06
+	setarg DONGLE_KB_BIND_EFUSE_OFFECT
+	arg mem_dg_kb_bind_flag,rega
+	arg 1,temp
+	branch otpd_read_data_with_pwr_operation
+
+dongle_write_kb_bind_status:
+	bpatch patch06_1,mem_patch06
+	arg 1,loopcnt
+	arg mem_dg_kb_bind_flag,rega
+	arg DONGLE_KB_BIND_EFUSE_OFFECT,pdata
+	branch otp_write
+
+dongle_usb_config:
+	fetch 1,mem_dg_sys_config
+	bbit1 DG_ENABLE_KB_ICON,dongle_usb_config_kb
+	fetch 1,mem_dg_kb_bind_flag
+	bne DONGLE_KB_BIND_SUCCESS,dongle_usb_config_param
+dongle_usb_config_kb:
+	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:
+	fetch 1,mem_dg_usb_device_iserial_number
+	store 1,mem_devicedesc+17
+	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:
+	bpatch patch06_2,mem_patch06
+	fetch 1,mem_dg_ms_blank_data_enable
+	rtn blank
+	arg G24_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:
+	bpatch patch06_3,mem_patch06
+	fetch 1,mem_dg_kb_blank_data_enable
+	rtn blank
+	arg G24_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
+	fetch 8,mem_usb_kb_data
+	store 8,mem_dg_kb_data_last_data
+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:
+	bpatch patch06_4,mem_patch06
+	fetch 1,mem_dg_kb_mul_blank_data_enable
+	rtn blank
+	arg G24_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
+	fetch 3,mem_usb_kb_multikey
+	store 3,mem_dg_kb_multikey_last_data	
+dongle_usb_tx_multikey_data:
+	jam USB_EP2_MULTIKEY,mem_usb_ep2_data
+	branch dongle_usb_tx_enable_ep2
+
+dongle_usb_dispatch:
+	bpatch patch06_5,mem_patch06
+	call wdt_kick_128ms
+	fetch 1,mem_usb_remote_wakeup
+	call dongle_clear_pc_sleep_flag,blank
+	call usb_isr
+	fetch 1,mem_usb_ep3_out_data_flag
+	nbranch dongle_usb_rx_ep3,blank
+	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
+dongle_usb0_data_ready_report_set0:
+	jam 0,mem_usb0_data_ready_report
+	rtn
+
+dongle_usb_rx_ep3:
+	jam 0,mem_usb_ep3_out_data_flag
+	fetch 1,mem_usb_ep3_out_data_len
+	rtn blank
+	fetch 2,mem_cb_usb_ep3_process
+	branch callback_func
+
+
+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_auto_bind:
+	call g24_mode_switch_init
+dongle_auto_bind_loop:
+	call g24_mode_switch_bind_work
+	call g24_mode_switch_bind_search
+	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 patch06_6,mem_patch06
+	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_data_type
+	beq DATATYPE_DEVICE1,dongle_ackpayload_prep_mouse
+	beq DATATYPE_DEVICE2,dongle_ackpayload_prep_keyboard
+dongle_ackpayload_prep_mouse:
+	fetch 1,mem_dg_pc_sleep_flag
+	bbit1 0,dongle_pc_sleep_ackpayload_prep_mouse
+	branch dongle_ackpayload_prep_end
+
+dongle_set_pc_sleep_flag:
+	fetch 1,mem_device_option
+	rtnne dvc_op_dongle
+	jam 3,mem_dg_pc_sleep_flag
+	rtn
+dongle_clear_pc_sleep_flag:
+	jam 0,mem_dg_pc_sleep_flag
+	rtn
+
+dongle_ackpayload_prep_keyboard:
+	fetch 1,mem_dg_pc_sleep_flag
+	bbit1 1,dongle_pc_sleep_ackpayload_prep_keyboard
+dongle_ackpayload_prep_end:
+	fetch 1,mem_24g_ackpayload_enable
+	beq BIND_ACKPAYLOAD,dongle_g24_bind_ackpayload_prep
+	beq KB_LED_ACKPAYLOAD,dongle_g24_kb_led_ackpayload_prep
+	rtn
+
+dongle_pc_sleep_ackpayload_prep_mouse:
+	fetch 1,mem_dg_pc_sleep_flag
+	set0 0,pdata
+	store 1,mem_dg_pc_sleep_flag
+	branch dongle_pc_sleep_ackpayload_prep
+
+dongle_pc_sleep_ackpayload_prep_keyboard:
+	fetch 1,mem_dg_pc_sleep_flag
+	set0 1,pdata
+	store 1,mem_dg_pc_sleep_flag
+dongle_pc_sleep_ackpayload_prep:
+	jam 0x01,mem_24g_datalen
+	setarg 0xff
+	store 1,mem_24g_txbuf
+	rtn
+
+
+dongle_g24_bind_ackpayload_prep:
+	jam 1,mem_24g_ackpayload_enable
+	call g24_binding_device_check	//works on auto pair only
+	nrtn user3
+	branch g24_bind_ackpayload_prep
+
+dongle_g24_kb_led_ackpayload_prep:
+	fetch 1,mem_24g_rxbuf+2
+	beq DATATYPE_DEVICE1,dongle_g24_bind_ackpayload_prep
+	beq DATATYPE_ATTEMP,dongle_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 G24_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 G24_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 G24_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 G24_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 G24_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 G24_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 G24_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 G24_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
+
+
+dongle_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
+dongle_prep_soft_reset:
+	jam 1,mem_dg_kb_bind_success
+	rtn
+
+
+dongle_kb_bind_soft_reset:
+	fetch 1,mem_device_option
+	rtnne dvc_op_dongle
+	fetch 1,mem_dg_kb_bind_success
+	rtn blank
+	jam 0,mem_temp
+dongle_wirte_efuse_bind_status:	
+	jam DONGLE_KB_BIND_SUCCESS,mem_dg_kb_bind_flag
+	call dongle_write_kb_bind_status
+	call dongle_read_kb_bind_status
+	fetch 1,mem_temp
+	increase 1,pdata
+	store 1,mem_temp
+	beq 0xff,soft_reset_chip
+	fetch 1,mem_dg_kb_bind_flag
+	bne DONGLE_KB_BIND_SUCCESS,dongle_wirte_efuse_bind_status
+	branch soft_reset_chip
+
+
+endif
+
+
Index: program/app_light/common/frmt_fml_ble.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/common/frmt_fml_ble.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/common/frmt_fml_ble.prog	(working copy)
@@ -0,0 +1,34 @@
+
+frmt_ble_para_init:
+	call enable_authrom
+	arg mem_ble_v2_xbox,contw
+	arg FRMT_XBOX_ADDR,contr
+	branch memcpy64
+	
+frmt_ble_data_set:
+	setarg 0x2542
+	store 2,mem_ble_v2_pdu
+	setarg 0x10255d
+	store 3, mem_ble_v2_pdu+2
+	setarg 0x109e3a
+	store 3, mem_ble_v2_pdu+5
+	setarg 0x00
+	store 3,mem_ble_v2_pdu+32
+	setarg 0x020102
+	store 3,mem_ble_v2_pdu+8
+	setarg 0xF0161B
+	store 3,mem_ble_v2_pdu+11
+	setarg 0x001008
+	store 3,mem_ble_v2_pdu+14
+
+	fetch 1,mem_ble_v2_packet_num
+	pincrease 1
+	store 1,mem_ble_v2_packet_num
+	
+	fetch 2,mem_ble_pack_cb
+	branch callback_func
+	
+frtm_ble_setdefault:
+	setarg 0xffff
+	rtn
+	
Index: program/app_light/fan/fdflp_fml_fan.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan.prog	(working copy)
@@ -0,0 +1,33 @@
+
+
+
+fan_idle_process:
+	bpatchx patch2c_3,mem_patch2c
+	branch fan_le_scan_process
+
+fan_apl_event_timer:
+	rtn
+
+	
+fan_le_scan_process:
+	bpatchx patch2c_4,mem_patch2c
+	call le_enable
+	disable master
+	call le_init_adv
+ 	call p_le_wait_adv
+	nrtn match
+	fetch 1,mem_le_adv_rcv
+	increase 1,pdata
+	store 1,mem_le_adv_rcv
+	branch fan_apl_ble_rx_v1_or_v2
+
+p_le_wait_adv:
+	call p_le_next_scan_chanel
+	branch le_receive_adv
+
+p_le_next_scan_chanel:
+	fetch 1,mem_ble_ch_mapped
+	store 1, mem_le_ch_mapped 
+	rtn
+
+
Index: program/app_light/fan/fdflp_fml_fan_ctl.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_ctl.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_ctl.prog	(working copy)
@@ -0,0 +1,195 @@
+
+
+ifdef FUNC_FAN_MODULE
+fan_apl_pair:
+	setarg FAN_433_PAIRING
+	branch fan_fml_fet_ctl
+
+fan_apl_light_on_and_off:
+	setarg FAN_433_LAMP_ON_AND_OFF
+	branch fan_fml_fet_ctl
+
+fan_apl_is_yc_remoter:
+	fetch 6, mem_recv_addr
+	fetcht 6, mem_yc_fan_ble_addr     //如果是YC的遥控器，就转发0x16
+	isub temp, null
+	rtn
+
+fan_apl_light_on:
+	fetch 1,mem_fan_yc_identify_flag
+	branch fan_apl_light_on_only,blank
+	fetch 1,mem_light_device_flag
+	beq 1,fan_apl_light_on_only
+	fetch 1,mem_manufacture_id_temp
+	beq 0x50,fan_apl_light_on_only
+	
+	call fan_apl_is_yc_remoter
+	branch fan_apl_light_on_and_off, zero
+fan_apl_light_on_only:
+	setarg FAN_433_LAMP_ON_ONLY
+	branch fan_fml_fet_ctl
+
+fan_apl_light_off:
+	fetch 1,mem_fan_yc_identify_flag
+	branch fan_apl_light_off_only,blank
+	fetch 1,mem_light_device_flag
+	beq 1,fan_apl_light_off_only
+	fetch 1,mem_manufacture_id_temp
+	beq 0x50,fan_apl_light_off_only
+	
+	call fan_apl_is_yc_remoter
+	branch fan_apl_light_on_and_off, zero
+fan_apl_light_off_only:
+	setarg FAN_433_LAMP_OFF_ONLY
+	branch fan_fml_fet_ctl
+
+fan_apl_master_off:
+	setarg FAN_433_MASTER_ON_AND_OFF
+	branch fan_fml_fet_ctl
+
+fan_apl_light_color_switch:
+	fetch 1, mem_ble_parameter_para+1
+	rtnne LIGHT_CMD_FTD_COLOR_SWTICH_RESERVED
+	setarg FAN_433_COLOR_SWITCH
+	branch fan_fml_fet_ctl
+
+
+fan_apl_speed_30:
+	fetch 2, mem_ble_parameter_para+1
+	nbranch fan_apl_speed_opcode_30_incse, blank
+fan_apl_speed_opcode_30_decse:
+	setarg FAN_433_FAN_SPEED_DEC
+	branch fan_fml_fet_ctl
+fan_apl_speed_opcode_30_incse:
+	setarg FAN_433_FAN_SPEED_INC
+	branch fan_fml_fet_ctl
+
+
+fan_apl_speed_31_v1:
+	fetch 1, mem_ble_parameter_para+2
+	beq FAN_SPEED_FLAG_OFF, fan_apl_speed_32_to_0_and_deflector_off
+	beq FAN_SPEED_FLAG_LOW, fan_apl_speed_32_to_1
+	beq FAN_SPEED_FLAG_MIDDLE, fan_apl_speed_32_to_3
+	beq FAN_SPEED_FLAG_HIGH, fan_apl_speed_32_to_5
+	rtn
+	
+fan_apl_speed_31_v2:
+	fetch 1, mem_ble_parameter_para+1
+	beq 0x20, fan_apl_speed_32
+	branch fan_apl_speed_31_v1
+
+
+fan_apl_speed_32:
+	fetch 1, mem_ble_parameter_para+2
+	beq FAN_SPEED_FLAG_OFF, fan_apl_speed_32_to_0_and_deflector_off
+	beq 1, fan_apl_speed_32_to_1
+	beq 2, fan_apl_speed_32_to_2
+	beq 3, fan_apl_speed_32_to_3
+	beq 4, fan_apl_speed_32_to_4
+	beq 5, fan_apl_speed_32_to_5
+	beq 6, fan_apl_speed_32_to_6
+	rtn
+
+fan_apl_speed_32_to_0_and_deflector_off:	
+fan_apl_speed_32_to_0:
+	setarg FAN_433_TAP_POSOTION_0
+	branch fan_fml_fet_ctl
+
+fan_apl_speed_32_to_1:
+	setarg FAN_433_TAP_POSOTION_1
+	branch fan_fml_fet_ctl
+
+fan_apl_speed_32_to_2:
+	setarg FAN_433_TAP_POSOTION_2
+	branch fan_fml_fet_ctl
+
+fan_apl_speed_32_to_3:
+	setarg FAN_433_TAP_POSOTION_3
+	branch fan_fml_fet_ctl
+
+fan_apl_speed_32_to_4:
+	setarg FAN_433_TAP_POSOTION_4
+	branch fan_fml_fet_ctl
+
+fan_apl_speed_32_to_5:
+	setarg FAN_433_TAP_POSOTION_5
+	branch fan_fml_fet_ctl
+
+fan_apl_speed_32_to_6:
+	setarg FAN_433_TAP_POSOTION_6
+	branch fan_fml_fet_ctl
+	
+	
+fan_apl_wind_direction:
+	fetch 1, mem_ble_parameter_para+1
+	branch fan_fml_wind_direction_forward_433, blank
+fan_fml_wind_direction_reverse_433:
+	setarg FAN_433_TURNING_REVERSE
+	branch fan_fml_fet_ctl
+fan_fml_wind_direction_forward_433:
+	setarg FAN_433_TURNIING_FORWARD
+	branch fan_fml_fet_ctl
+
+fan_apl_wind_direction_on_and_off:
+	setarg FAN_433_WIND_REVERSE
+	branch fan_fml_fet_ctl
+
+fan_apl_deflector_ctl_on_and_off:
+	setarg FAN_433_DEFLECTOR_ON_AND_OFF
+	branch fan_fml_fet_ctl
+
+fan_apl_deflector_ctl:
+	fetch 1, mem_ble_parameter_para+1
+	branch fan_apl_deflector_off, blank
+fan_apl_deflector_on:
+	setarg FAN_433_DEFLECTOR_ON
+	branch fan_fml_fet_ctl
+fan_apl_deflector_off:
+	setarg FAN_433_DEFLECTOR_OFF
+	branch fan_fml_fet_ctl
+
+fan_apl_mode:	
+	bpatchx patch2c_5,mem_patch2c
+	fetch 1, mem_ble_parameter_para+1
+
+ 	beq BLE_PARA_SLEEP_MODE, fan_fml_mode_sleep_wind
+	beq BLE_PARA_NATURAL_MODE, fan_apl_mode_natural_wind
+	rtn
+	
+fan_fml_mode_sleep_wind:
+	setarg FAN_433_SLEEP_WIND
+	branch fan_fml_fet_ctl
+
+fan_apl_mode_natural_wind:
+	setarg FAN_433_NATURAL_WIND
+	branch fan_fml_fet_ctl
+
+
+fan_apl_timing_to_off:
+	fetch 2, mem_ble_parameter_para+1
+	beq FAN_BLE_CMD_TIMING_TO_OFF_8HOUR_V1, fan_fml_timing_to_off_8hour
+fan_apl_timing_to_off_v2:
+	bpatchx patch2c_6,mem_patch2c
+	fetch 2, mem_ble_parameter_para+1
+	beq FAN_BLE_CMD_TIMING_TO_OFF_8HOUR, fan_fml_timing_to_off_8hour
+	beq FAN_BLE_CMD_TIMING_TO_OFF_1HOUR, fan_fml_timing_to_off_1hour
+	beq FAN_BLE_CMD_TIMING_TO_OFF_2HOUR, fan_fml_timing_to_off_2hour
+	beq FAN_BLE_CMD_TIMING_TO_OFF_4HOUR, fan_fml_timing_to_off_4hour
+	rtn
+fan_fml_timing_to_off_1hour:
+	setarg FAN_433_TIMING_TO_OFF_1HOUR
+	branch fan_fml_fet_ctl
+fan_fml_timing_to_off_2hour:
+	setarg FAN_433_TIMING_TO_OFF_2HOUR
+	branch fan_fml_fet_ctl
+fan_fml_timing_to_off_4hour:
+	setarg FAN_433_TIMING_TO_OFF_4HOUR
+	branch fan_fml_fet_ctl
+fan_fml_timing_to_off_8hour:
+	setarg FAN_433_TIMING_TO_OFF_8HOUR
+	branch fan_fml_fet_ctl
+	
+endif
+
+
+
Index: program/app_light/fan/fdflp_fml_fan_init.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_init.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_init.prog	(working copy)
@@ -0,0 +1,11 @@
+
+
+fan_init:
+	setarg fan_idle_process
+	store 2,mem_cb_idle_process	
+	setarg fan_apl_cb_event_timer
+	store 2, mem_cb_event_timer
+	branch fan_fml_tx_low_level_init
+
+
+
Index: program/app_light/fan/fdflp_fml_fan_main.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_main.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_main.prog	(working copy)
@@ -0,0 +1,327 @@
+
+
+//------------------------------收包------------------------------
+/*选择V1或V2*/
+fan_apl_ble_rx_v1_or_v2:
+ifdef FUNC_FAN_MODULE
+	fetch 1,mem_fan_protocol_select_flag
+	beq 0, fan_apl_ble_rx_packet
+endif
+//	call fan_fml_ble_v2_decoder
+	fetch 2, mem_ble_v2_decoder
+	call callback_func
+//	
+	branch fan_apl_ble_rx_packet_v2_cb,user
+	rtn
+
+ifdef FUNC_FAN_MODULE
+fan_apl_ble_rx_packet:
+	bpatchx patch2c_7,mem_patch2c
+	fetch 1, mem_le_rxbuf+11     //added, at 20200113
+	beq REMOTER_MARKER, fan_apl_ble_rx_packet_is_remoter
+	jam 0 ,mem_manufacture_id_temp
+	
+	setarg 0
+	store 6,mem_recv_addr
+fan_apl_ble_rx_packet_id_valid:
+	fetcht 3, mem_le_rxbuf+12   //adv data begin
+	setarg FTD_REMOTER_ID_CODE
+	isub temp, null
+	jam 0, mem_light_device_flag   //0: remoter;  !0:app
+	branch  fan_apl_ble_rx_packet_preamble_valid, zero
+
+	jam 1, mem_light_device_flag  //0: remoter;  !0:app
+	setarg FTD_ANDRIOD4913_ID_CODE
+	isub temp, null
+	branch  fan_apl_ble_rx_packet_preamble_valid, zero
+	setarg FTD_IOS4913_ID_CODE
+	isub temp, null
+	branch  fan_apl_ble_rx_packet_preamble_valid, zero
+	
+	jam 2, mem_light_device_flag  //0: remoter;  !0:app
+	setarg FTD_B65F_ID_CODE
+	isub temp, null
+	nrtn zero
+fan_apl_ble_rx_packet_preamble_valid:
+	arg mem_le_rxbuf, contr
+	arg mem_light_whitening_buffer, contw
+	arg FTD_PDU_LEN, loopcnt
+	call memcpy
+	
+	jam 83, mem_light_whitening_i     //channel 37
+	jam 39, mem_light_recvd_len
+	call frmt_light_BLE_whitening_and_reverse
+	fetch 1, mem_light_device_flag
+	beq 1, fan_apl_ble_rx_packet_protocol_4913
+	arg mem_light_whitening_buffer+23, contr
+fan_apl_ble_rx_packet_get_protocol:	
+	arg mem_light_adv_packet, contw
+	arg 14, loopcnt
+	call memcpy_fast
+fan_apl_ble_rx_packet_validity_checkout:
+	fetch 2, mem_light_adv_packet+10
+	byteswap pdata, pdata
+	invert pdata, pdata
+	store 2, mem_adv_CRC_False_initValue
+	arg mem_light_adv_packet, regc   
+	arg 0x0c, loopcnt
+	setarg 0x1021
+	store 2,mem_CRC16_polynomial
+	call frmt_CRC16_CCITT_False
+	fetch 2, mem_adv_CRC_False_initValue
+	byteswap pdata, pdata
+	fetcht 2, mem_light_adv_packet_encry+4
+	isub temp, null
+	nrtn zero
+	
+	branch fan_apl_ble_rx_packet_v1_cb
+
+fan_apl_ble_rx_packet_protocol_4913:
+	arg mem_light_whitening_buffer+24, contr
+	branch fan_apl_ble_rx_packet_get_protocol
+
+fan_apl_ble_rx_packet_is_remoter:	
+	bpatchx patch2d_0,mem_patch2d
+	arg mem_recv_addr, contw
+	arg mem_le_rxbuf+2, contr
+	arg 6, loopcnt
+	call memcpy_fast
+	
+	fetch 1, mem_le_rxbuf+10
+	store 1, mem_manufacture_id_temp
+
+	fetcht 1,mem_customer_id
+	isub temp,null
+	branch fan_apl_ble_rx_packet_id_valid,zero
+
+	fetcht 1,mem_customer_id_v2
+	isub temp,null
+	branch fan_apl_ble_rx_packet_id_valid,zero
+
+	fetcht 1,mem_id_universal
+	isub temp,null
+	branch fan_apl_ble_rx_packet_id_valid,zero
+	rtn	
+
+	
+/*callback*/
+fan_apl_ble_rx_packet_v1_cb:
+	bpatchx patch2d_1,mem_patch2d
+	fetch 1, mem_light_adv_packet_cmd
+	store 2, mem_ble_parameter_cmd
+	fetch 2, mem_light_adv_packet_data
+	store 2, mem_ble_parameter_para+1 
+	
+	fetch 1, mem_light_adv_packet_addr
+	store 1,mem_ble_parameter_addr+1
+	fetch 1, mem_light_adv_packet_addr+1
+	store 1,mem_ble_parameter_addr
+
+	fetch 1, mem_light_adv_packet_addr+1
+	and pdata,0x0f,pdata
+	store 1,mem_ble_parameter_group
+	
+	branch fan_apl_ble_rx_packet_cb_common
+endif
+
+fan_apl_ble_rx_packet_v2_cb:
+	bpatchx patch2d_2,mem_patch2d
+	fetch 2,mem_ble_addr
+	lshift4 pdata,pdata
+	store 2,mem_ble_parameter_addr
+	fetch 6,mem_ble_cmd
+	store 6, mem_ble_parameter
+	fetch 1,mem_ble_group
+	store 1,mem_ble_parameter_group
+	fetch 1,mem_ble_is_app
+	store 1,mem_light_device_flag
+	fetch 1,mem_ble_customer_id
+	store 1,mem_manufacture_id_temp
+	fetch 1,mem_ble_count
+	store 1,mem_light_adv_packet_packetnum
+fan_apl_ble_rx_packet_cb_common:
+	bpatchx patch2d_3,mem_patch2d
+	fetch 2, mem_fan_packet_indiscriminate_cb
+	call callback_func
+//	call fan_apl_ble_rx_packet_indiscriminate
+	
+fan_apl_ble_rx_cmd_execution:
+	
+ifdef FUNC_FAN_MODULE
+
+	call fan_apl_ble_cmd_handler_customer_message
+	rtn user
+	
+	fetch 2, mem_ble_parameter_cmd
+
+	beq LIGHT_CMD_PAIRING_CODE, fan_apl_pair
+
+	beq LIGHT_CMD_TURN_ON_AND_OFF, fan_apl_light_on_and_off
+	beq LIGHT_CMD_TURN_ON, fan_apl_light_on
+	beq LIGHT_CMD_TURN_OFF, fan_apl_light_off
+
+	beq FAN_CMD_MASTER_ON_AND_OFF, fan_apl_master_off
+	beq FAN_CMD_SPEED_CHANGE, fan_apl_speed_30
+
+	beq FAN_CMD_DIRECTION, fan_apl_wind_direction
+	beq FAN_CMD_DIRECTION_ON_AND_OFF , fan_apl_wind_direction_on_and_off
+	beq FAN_CMD_DEFLECTOR,fan_apl_deflector_ctl
+	beq FAN_CMD_DEFLECTOR_ON_AND_OFF ,fan_apl_deflector_ctl_on_and_off
+	beq FAN_CMD_MODE, fan_apl_mode
+	
+	fetch 1,mem_fan_protocol_select_flag
+	beq 0, fan_apl_main_v1
+	beq 1, fan_apl_main_v2
+endif
+	rtn
+
+
+
+ifdef FUNC_FAN_MODULE
+//--------------------------响应风扇功能--------------------------
+/*V1 主函数*/
+fan_apl_main_v1:	
+	fetch 2,mem_ble_parameter_cmd
+	beq FAN_CMD_TIMING_TO_OFF, fan_apl_timing_to_off
+	beq LIGHT_CMD_DELAY_OFF, fan_apl_timing_to_off
+
+	fetch 2, mem_light_adv_packet_data
+	store 2, mem_ble_parameter_para+2
+	fetch 2, mem_ble_parameter_cmd
+	beq FAN_CMD_SPEED_31,fan_apl_speed_31_v1
+	beq FAN_CMD_SPEED_32,fan_apl_speed_32
+
+	fetch 1, mem_light_adv_packet_reserve
+	store 1, mem_ble_parameter_para+1
+	fetch 2, mem_ble_parameter_cmd
+	beq LIGHT_CMD_COLOR_SWTICH, fan_apl_light_color_switch
+	bpatchx patch2d_4,mem_patch2d
+	rtn
+
+	
+/*V2 主函数*/
+fan_apl_main_v2:
+	fetch 2,mem_ble_parameter_cmd
+	beq FAN_CMD_SPEED_31,fan_apl_speed_31_v2
+	beq LIGHT_CMD_DELAY_OFF, fan_apl_timing_to_off_v2
+	beq LIGHT_CMD_COLOR_SWTICH, fan_apl_light_color_switch
+	bpatchx patch2d_5,mem_patch2d
+	rtn
+endif
+
+fan_apl_ble_cmd_handler_customer_message:
+	bpatchx patch2d_6,mem_patch2d
+	call disable_user
+	fetcht 2,mem_ble_parameter_addr
+	arg 9,queue
+	arg 10,loopcnt
+fan_apl_ble_rx_packet_addr_check_loop:
+	sub loopcnt,10,regc
+	deposit queue
+	isub regc,null
+	branch fan_apl_ble_rx_packet_addr_check,positive
+fan_apl_ble_rx_packet_other_addr_check_continue:
+	sub regc,3,null
+	nbranch fan_apl_ble_rx_packet_addr_check,positive
+	branch fan_apl_ble_rx_packet_addr_check_end
+	
+fan_apl_ble_rx_packet_addr_check:
+	arg mem_flash_paired_addr_base,contr
+	mul32 regc,3,pdata
+	iadd contr,contr
+	ifetch 2,contr
+	isub temp, null
+	nbranch fan_apl_ble_rx_packet_addr_check_end, zero
+
+	ifetchr rega,1,contr
+	fetch 1,mem_ble_parameter_group
+
+	branch fan_apl_ble_rx_packet_cnt_check,blank
+	isub rega,null
+	branch fan_apl_ble_rx_packet_cnt_check,zero
+fan_apl_ble_rx_packet_addr_check_end:	
+	loop fan_apl_ble_rx_packet_addr_check_loop
+	
+	arg mem_flash_paired_addr8,rega
+	arg 9,loopcnt
+fan_apl_ble_rx_packet_addr_move_loop:
+	ifetch 3,rega
+	add rega,3,temp
+	istore 3,temp
+	increase -3,rega
+	loop fan_apl_ble_rx_packet_addr_move_loop
+	fetch 3,mem_ble_parameter_addr
+	store 3,mem_flash_paired_addr0
+//同时cnt队列也相应往后面移动
+	fetch 1,mem_addr8_msg_cnt
+	store 1,mem_addr9_msg_cnt
+	fetch 8,mem_msg_cnt_base
+	store 8,mem_addr1_msg_cnt
+	jam 0,mem_msg_cnt_base
+	branch fan_apl_ble_cmd_handler_customer_message
+
+	
+fan_apl_ble_rx_packet_cnt_check:
+	copy loopcnt,temp
+	storet 1,mem_msg_addr_save
+/*cnt判断机制，根据loopcnt的值判断是什么设备，再mem_ble_v2_count是否有效*/
+	arg mem_msg_cnt_base,temp
+	sub loopcnt,10,pdata
+	iadd temp,temp
+	copy temp,rega
+	ifetcht 1,temp
+	fetch 1,mem_light_adv_packet_packetnum
+	isub temp, null
+//	rtn zero 
+	branch enable_user,zero
+	branch fan_apl_ble_rx_check_packetnum_vaild_v2,positive
+/*当cnt小于上次的cnt，判断符不符合6-(cnt+256-last_cnt)>0*/
+	add pdata,0x100,pdata
+	isub temp,pdata
+	and pdata,0xff,pdata
+	sub pdata,6,null
+	branch fan_apl_ble_rx_check_packetnum_vaild_v2,positive
+	rtn
+
+fan_apl_ble_rx_check_packetnum_vaild_v2:	
+fan_apl_ble_rx_relay_check:
+	fetch 1,mem_light_adv_packet_packetnum
+	store 1,mem_count_and_random
+	fetch 2,mem_le_rxbuf+35
+	store 2,mem_count_and_random+1
+	fetcht 3,mem_count_and_random
+	arg mem_msg_before_queue,contr
+	arg 10,loopcnt
+fan_apl_msg_check_count_random_loop:
+	ifetch 3,contr
+	isub temp,null
+//	rtn zero
+	branch enable_user,zero
+	loop fan_apl_msg_check_count_random_loop
+fan_apl_msg_enqueue:
+	jam 30,mem_msg_judgment_window_time//窗口
+	fetch 3,mem_msg_before_queue+24
+	store 3,mem_msg_before_queue+27
+	
+	fetch 8,mem_msg_before_queue+8
+	fetcht 8,mem_msg_before_queue+16
+	store 8,mem_msg_before_queue+11
+	storet 8,mem_msg_before_queue+19	
+	
+	fetch 8,mem_msg_before_queue
+	store 8,mem_msg_before_queue+3
+	
+	fetch 3,mem_count_and_random
+	store 3,mem_msg_before_queue
+
+	fetch 1,mem_msg_addr_save
+	copy pdata,loopcnt
+	arg mem_msg_cnt_base,temp
+	sub loopcnt,10,pdata
+	iadd temp,temp
+	fetch 1,mem_light_adv_packet_packetnum
+	istore 1,temp
+	jam 30,mem_msg_cnt_judgment_window_time
+
+	rtn
+	
\ No newline at end of file
Index: program/app_light/fan/fdflp_fml_fan_timer.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_timer.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_timer.prog	(working copy)
@@ -0,0 +1,30 @@
+
+fan_apl_cb_event_timer:
+	bpatchx patch2d_7,mem_patch2d
+	branch fan_apl_ble_msg_cache_clear_time
+
+
+
+fan_apl_ble_msg_cache_clear_time:
+	call fan_apl_ble_msg_cache_clear_timer
+	branch fan_apl_ble_msg_cnt_cache_clear_timer
+	
+fan_apl_ble_msg_cache_clear_timer:
+	arg mem_msg_judgment_window_time,regc
+	arg fan_apl_ble_msg_cache_clear_timeout, regb
+	branch timer_single_step
+fan_apl_ble_msg_cache_clear_timeout:
+	arg 30,loopcnt
+	arg mem_msg_before_queue,contw
+	branch clear_mem
+	
+fan_apl_ble_msg_cnt_cache_clear_timer:
+	arg mem_msg_cnt_judgment_window_time,regc
+	arg fan_apl_ble_msg_cnt_cache_clear_timeout, regb
+	branch timer_single_step
+fan_apl_ble_msg_cnt_cache_clear_timeout:
+	jam 0,mem_light_last_packetnum
+	arg 10,loopcnt
+	arg mem_msg_cnt_base,contw
+	branch clear_mem
+
Index: program/app_light/fan/fdflp_fml_fan_tx.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_tx.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/fan/fdflp_fml_fan_tx.prog	(working copy)
@@ -0,0 +1,207 @@
+
+
+fan_fml_fet_ctl:
+	store 1,mem_fan_opcode
+	fetch 2,mem_433_tx_cb
+	branch callback_func
+
+
+fan_fml_tx_high_level:
+	fetcht 1,mem_fan_tx_gpio
+	branch gpio_config_output_patch
+
+fan_fml_tx_low_level_init:
+fan_fml_tx_low_level:
+	fetcht 1,mem_fan_tx_gpio
+	or temp, 0x80, temp
+	branch gpio_config_output_patch
+
+//para: mem_opcode
+fan_fml_function_once:   
+	bpatchx patch2e_0,mem_patch2e
+	call fan_fml_tx_header_signal
+	call fan_fml_function_once_433code
+	branch fan_fml_tx_end_signal
+
+fan_fml_function_once_433code:
+	arg FAN_433CODE_LEN, pdata
+	lshift3 pdata, pdata
+	store 2, mem_fan_tx_bits_loop
+	copy pdata, queue
+	increase -1, queue
+	fetcht FAN_433CODE_LEN, mem_fan_433code_packet
+fan_fml_function_once_433code_loop:
+	fetch 2, mem_fan_tx_bits_loop
+	rtn blank
+	pincrease -1
+	store 2, mem_fan_tx_bits_loop
+	qisolate1 temp
+	branch fan_fml_1_signal_temp,true
+	call fan_fml_0_signal
+fan_fml_function_once_tx_bit_loop_continue:
+	increase -1, queue
+	fetch 2, mem_fan_tx_bits_loop	
+	fetcht FAN_433CODE_LEN, mem_fan_433code_packet
+	nbranch fan_fml_function_once_433code_loop, blank
+	rtn
+
+fan_fml_1_signal_temp:
+	call fan_fml_1_signal
+	branch fan_fml_function_once_tx_bit_loop_continue
+
+
+// para1: mem_opcode 
+// para2: mem_tx_loop2       retransmission times
+fan_fml_function_loop:
+	fetch 2, mem_fan_tx_loop2
+	rtn blank
+	pincrease -1
+	store 2, mem_fan_tx_loop2
+	call fan_fml_function_once
+	branch fan_fml_function_loop
+
+
+p_fan_fml_fet_ctl:
+	call fan_fml_get_433_code
+	setarg FAN_RETRANSMISSION_TIMES
+	store 2,mem_fan_tx_loop2
+	branch fan_fml_function_loop
+
+
+//433D-òé?°20bit
+fan_apl_ble_rx_packet_indiscriminate:
+	fetch 1,mem_manufacture_id_temp
+	fetcht 1,mem_id_universal
+	isub temp,null
+	branch fan_apl_ble_433_packet_type1,zero
+	fetch 1,mem_light_device_flag
+	beq 0,fan_apl_ble_433_packet_type0
+	branch fan_apl_ble_433_packet_type1
+
+fan_apl_ble_433_packet_type0:
+	setarg 0
+	branch fan_apl_ble_433_packet_common
+fan_apl_ble_433_packet_type1:
+	setarg 0x80
+fan_apl_ble_433_packet_common:
+	fetcht 1, mem_ble_parameter_group
+	and temp, 0x7f, rega
+	ior rega,pdata
+	rshift4 pdata,temp
+	storet 1,mem_fan_addr_433+2
+
+	and pdata,0x0f,pdata
+	lshift4 pdata,pdata
+	fetcht 1, mem_ble_parameter_addr+1
+	and temp, 0xf0, rega
+	rshift4 rega,rega
+	ior rega,pdata
+	store 1,mem_fan_addr_433+1
+
+	and temp,0x0f, pdata
+	lshift4 pdata,pdata
+	fetcht 1, mem_ble_parameter_addr
+	rshift4 temp,temp
+	ior temp,pdata
+	store 1,mem_fan_addr_433
+
+	rtn
+
+
+//433×é?? μ??·-opcode-
+fan_fml_get_433_code:
+	fetch 3,mem_fan_addr_433
+	lshift4 pdata, pdata
+	lshift8 pdata, pdata
+	fetcht 1, mem_fan_opcode
+	lshift3 temp, temp
+	lshift4 temp, temp
+	ior temp, rega
+	call fan_fml_get_433_code_packet_num_get
+	lshift4 pdata, pdata
+	ior rega, rega
+	call fan_fml_get_433_code_get_check_code
+	ior rega, pdata
+	store FAN_433CODE_LEN, mem_fan_433code_packet
+	rtn
+
+//output: pdata
+fan_fml_get_433_code_get_check_code:
+	arg 4, loopcnt
+	copy rega, regb
+	arg 0, alarm
+fan_fml_get_433_code_get_check_code_loop:
+	and regb, 0xff, regc
+	and regc, 0xf0, pdata
+	rshift4 pdata, pdata
+	ixor alarm, alarm
+	and regc, 0x0f, pdata
+	ixor alarm, alarm
+	rshift8 regb, regb	
+	loop fan_fml_get_433_code_get_check_code_loop
+	xor alarm, 0x0a, alarm
+	and alarm, 0x0f, pdata
+	rtn
+
+//output: pdata
+fan_fml_get_433_code_packet_num_get:
+	fetch 1, mem_fan_tx_cnt
+	pincrease 1
+	and pdata, 0x07, pdata
+	store 1, mem_fan_tx_cnt
+	rtn
+
+//para: loopcnt      unit: 1us
+fan_fml_delay_us:
+	nop 12
+	loop fan_fml_delay_us
+	rtn
+
+fan_fml_tx_header_signal:
+	call fan_fml_tx_low_level
+	arg FAN_HEADER_LOW_DELAY,loopcnt
+	branch fan_fml_delay_us
+	
+fan_fml_1_signal:
+	call fan_fml_tx_high_level
+	arg FAN_1_HIGH_DELAY, loopcnt
+	call fan_fml_delay_us
+	call fan_fml_tx_low_level
+	arg FAN_1_LOW_DELAY, loopcnt
+	branch fan_fml_delay_us
+	
+fan_fml_0_signal:
+	call fan_fml_tx_high_level
+	arg FAN_0_HIGH_DELAY, loopcnt
+	call fan_fml_delay_us
+	call fan_fml_tx_low_level
+	arg FAN_0_LOW_DELAY, loopcnt
+	branch fan_fml_delay_us	
+
+fan_fml_tx_end_signal:	
+	call fan_fml_tx_high_level
+	arg FAN_END_HIGH_DELAY,loopcnt
+	call fan_fml_delay_us
+	call fan_fml_tx_low_level
+	arg FAN_END_LOW_DELAY,loopcnt
+	branch fan_fml_delay_us
+
+	
+fan_fml_1_signal_loop:
+	fetch 2, mem_fan_tx_loop
+	rtn blank
+	pincrease -1	
+	store 2, mem_fan_tx_loop
+	call fan_fml_1_signal
+	branch fan_fml_1_signal_loop
+
+
+fan_fml_0_signal_loop:
+	fetch 2, mem_fan_tx_loop
+	rtn blank
+	pincrease -1
+	store 2, mem_fan_tx_loop
+	call fan_fml_0_signal
+	branch fan_fml_0_signal_loop
+
+
Index: program/app_light/remoter/frmt_fml_remoter_gem.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_gem.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_gem.prog	(working copy)
@@ -0,0 +1,235 @@
+
+
+frmt_gem_adv_pdu_common:   
+	jam 1, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+	jam 66,mem_light_gm_tx_addr_type
+	jam 21,mem_light_gm_tx_len
+	
+	jam 0x55, mem_light_gm_tx_remoter_ID
+	fetch 1, mem_light_gm_tx_count
+	pincrease 1
+	store 1, mem_light_gm_tx_count
+	call frmt_gem_pud_sum
+	call frmt_light_flag_set_short_press
+	arg GEM_PDU_LEN, loopcnt
+	arg mem_light_gm_tx_addr_type, contr
+	arg mem_light_whitening_buffer, contw
+	branch memcpy_fast
+	
+	
+frmt_gem_pud_sum:
+	arg 0, temp
+	arg mem_light_gm_tx_press_time , contr
+	arg 7, loopcnt
+frmt_gem_pud_sum_loop:
+	ifetch 1, contr
+	iadd temp, temp
+	loop frmt_gem_pud_sum_loop
+	storet 1,mem_light_gm_tx_sum
+	rtn
+
+
+frmt_light_gem_long_press_cnt:
+	fetch 1,mem_gem_long_cnt_enable
+	rtn blank
+	jam 0,mem_gem_long_cnt_enable
+	fetch 2,mem_long_press_timeout
+	rtn blank
+	fetch 1,mem_light_gm_tx_press_time
+	pincrease 1
+	store 1,mem_light_gm_tx_press_time
+	beq 1,frmt_light_gem_long_press_code_increase
+	beq 9,frmt_light_gem_long_press_code_increase
+	call frmt_gem_adv_pdu_common
+	setarg GEM_LONG_KEYPRESS
+	store 2,mem_gem_cnt_inces_timeout
+	rtn
+
+frmt_light_gem_long_press_code_increase:	
+	fetch 1,mem_light_gm_tx_code
+	pincrease 0x40
+	store 1,mem_light_gm_tx_code
+	call frmt_gem_adv_pdu_common
+	branch gem_long_keypress_time
+
+gem_long_keypress_time:
+	setarg GEM_LONG_KEYPRESS
+	store 2,mem_gem_cnt_inces_timeout
+	rtn
+
+gem_light_color_switch:
+	jam GEM_LIGHT_COLOR_SWITCH_CODE, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+	
+gem_light_energy_saving_light:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_pcnt_50_percent_V2,blank
+	jam GEM_LIGHT_ENERGY_SAVE_LIGHT_CODE, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+
+gem_light_timing_off:
+	jam GEM_LIGHT_TIMING_OFF_CODE, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+gem_light_aid_turn_onoff:
+	jam GEM_LIGHT_AIDED_LIGHT_CODE, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+gem_light_master_on:
+	jam GEM_LIGHT_ON_CODE, mem_light_gm_tx_code
+	jam 0, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+gem_light_master_off:
+	jam GEM_LIGHT_OFF_CODE, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	jam 0, mem_light_gm_tx_group_num
+	branch frmt_gem_adv_pdu_common
+
+gem_light_rgb_auto:
+	jam GEM_LIGHT_RGB_AUTO_CODE, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+
+gem_light_rgb_step:
+	jam GEM_LIGHT_RGB_STEP_CODE, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+	
+
+gem_light_group1_on:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_group1_on_V2,blank
+	jam GEM_LIGHT_ON_GROUP1_CODE, mem_light_gm_tx_code
+	jam 1, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+gem_light_group1_off:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_group1_off_V2,blank
+	jam GEM_LIGHT_OFF_GROUP1_CODE, mem_light_gm_tx_code
+	jam 1, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+
+gem_light_group2_on:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_group2_on_V2,blank
+	jam GEM_LIGHT_ON_GROUP2_CODE, mem_light_gm_tx_code
+	jam 2, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+gem_light_group2_off:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_group2_off_V2,blank
+	jam GEM_LIGHT_OFF_GROUP2_CODE, mem_light_gm_tx_code
+	jam 2, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+
+gem_light_group3_on:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_group3_on_V2,blank
+	jam GEM_LIGHT_ON_GROUP3_CODE, mem_light_gm_tx_code
+	jam 3, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+gem_light_group3_off:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_group3_off_V2,blank
+	jam GEM_LIGHT_OFF_GROUP3_CODE, mem_light_gm_tx_code
+	jam 3, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+
+gem_light_group4_on:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_group4_on_V2,blank
+	jam GEM_LIGHT_ON_GROUP4_CODE, mem_light_gm_tx_code
+	jam 4, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+gem_light_group4_off:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_group4_off_V2,blank
+	jam GEM_LIGHT_OFF_GROUP4_CODE, mem_light_gm_tx_code
+	jam 4, mem_light_gm_tx_group_num
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+
+
+gem_light_color_switch_short_press:
+	fetch 1, mem_light_color_and_lgtness_long_press_adv_enable
+	beq 1, gem_light_color_switch
+	jam LIGHT_COLOR_SWITCH_RELEASE_ADV_FLAG, mem_light_release_adv_flag
+	branch frmt_light_light_color_and_lightness_change_common
+
+gem_light_color_switch_W:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_color_switch_W_V2,blank
+	jam GEM_COLOR_SWITCH_W, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	jam 0, mem_light_gm_tx_group_num
+	branch frmt_gem_adv_pdu_common
+
+gem_light_color_switch_Y:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_color_switch_Y_V2,blank
+	jam GEM_COLOR_SWITCH_Y, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	jam 0, mem_light_gm_tx_group_num
+	branch frmt_gem_adv_pdu_common
+
+gem_light_to_Y:
+	jam 0, mem_light_release_adv_flag
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_to_Y_V2,blank
+	jam GEM_LIGHT_TO_Y_CODE, mem_light_gm_tx_code
+	branch frmt_gem_adv_pdu_common
+
+gem_light_to_W:
+	jam 0, mem_light_release_adv_flag
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_to_W_V2,blank
+	jam GEM_LIGHT_TO_W_CODE, mem_light_gm_tx_code
+	branch frmt_gem_adv_pdu_common
+
+gem_light_darken:
+	jam 0, mem_light_release_adv_flag
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_darken_V2,blank
+	jam GEM_LIGHT_DARKEN_CODE, mem_light_gm_tx_code
+	branch frmt_gem_adv_pdu_common	
+
+gem_light_lighten:
+	jam 0, mem_light_release_adv_flag
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_lighten_V2,blank
+	jam GEM_LIGHT_LIGHTEN_CODE, mem_light_gm_tx_code
+	branch frmt_gem_adv_pdu_common	
+
+gem_light_night_light:
+	fetch 1,mem_ble_v2_customer_id
+	ncall frmt_light_night_light_V2,blank
+	jam GEM_LIGHT_NIGHT_LIGHT_CODE, mem_light_gm_tx_code
+	jam 0,mem_light_gm_tx_press_time
+	branch frmt_gem_adv_pdu_common
+	
+
+
+
Index: program/app_light/remoter/frmt_fml_remoter_init.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_init.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_init.prog	(working copy)
@@ -0,0 +1,86 @@
+
+
+remoter_init:	
+	call frmt_ble_para_init
+// call ice_break
+	call frmt_enter_lpm_gpio_config_flag_init_row
+	call frmt_enter_lpm_gpio_config_flag_init_col
+	bpatchx patch2e_1,mem_patch2e
+
+	jam 1, mem_set_clear_code_timeout_enable
+	jam 1, mem_light_lpm_enable
+
+
+frmt_apl_ble_scene_rewrite_lap:
+	bpatchx patch2e_2,mem_patch2e
+	fetch 2, mem_le_lap
+	lshift4 pdata, pdata
+	arg 0xffff, temp
+	iand temp, pdata    //因为左移过后原本的高四位，只是被左移了，仍然存在于16bit往左的高位，应该把它们去掉
+	branch frmt_light_set_addr_to_0010 , blank
+	arg 0xfff0, temp
+	isub temp, null
+	branch frmt_light_set_addr_to_ffe0, zero
+frmt_lightc_init_continue:	
+	bpatchx patch2e_3,mem_patch2e
+	byteswap pdata, pdata    //20200417
+	store 2, mem_FTD_adv_raw_device_add_temp
+	store 2, mem_light_gm_tx_remoter_addr
+
+	arg 0xffff,rega
+	lshift16 rega, temp
+	setarg 0xffff
+	ior temp, temp
+	fetch 4, mem_le_lap
+	call frmt_light_addr_default_v2, blank
+	isub temp, null
+	call frmt_light_addr_default_v2, zero
+	store 4, mem_ble_v2_addr
+
+	setarg frmt_apl_cb_event_timer
+	store 2, mem_cb_event_timer
+	
+	setarg frmt_main
+	store 2,mem_cb_idle_process
+	branch  frmt_kscan_init
+
+
+frmt_enter_lpm_gpio_config_flag_init_row:
+	bpatchx patch2e_4,mem_patch2e
+	fetchr loopcnt ,1, mem_kscan_row_nums
+//	iforce loopcnt
+	fetcht 4, mem_light_lpm_gpio_config_flag
+	arg mem_kscan_row_gpio_pin, contr
+frmt_enter_lpm_gpio_config_flag_init_loop:
+	bpatchx patch2e_5,mem_patch2e
+	ifetch 1, contr
+	iforce queue
+	qset1 temp
+	loop frmt_enter_lpm_gpio_config_flag_init_loop
+	storet 4, mem_light_lpm_gpio_config_flag
+	rtn
+
+frmt_enter_lpm_gpio_config_flag_init_col:
+	bpatchx patch2e_6,mem_patch2e
+	fetchr loopcnt,1, mem_kscan_col_nums
+//	iforce loopcnt
+	fetcht 4, mem_light_lpm_gpio_config_flag
+	arg mem_kscan_col_gpio_pin, contr
+	branch frmt_enter_lpm_gpio_config_flag_init_loop
+
+frmt_light_addr_default_v2:
+	setarg 0x111213
+	rtn
+
+frmt_light_set_addr_to_0010:
+	arg 0x0010, pdata
+	branch frmt_lightc_init_continue
+
+frmt_light_set_addr_to_ffe0:
+	arg 0xffe0, pdata
+	branch frmt_lightc_init_continue
+
+//key_light_set_addr_to_7878:
+//	arg 0x7878, temp
+//	rtn
+	
Index: program/app_light/remoter/frmt_fml_remoter_key.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_key.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_key.prog	(working copy)
@@ -0,0 +1,380 @@
+
+//关于adv的时间和lpm需要重新重点计算   pairing 和 clear等等
+
+frmt_jym_pdu_common:      
+	bpatchx patch2e_7,mem_patch2e
+	fetch 4, mem_le_lap
+	store 4, mem_light_JYM_tx_ID
+	jam 0xd1, mem_light_JYM_tx_group
+	fetch 1, mem_light_JYM_tx_count
+	pincrease 1
+	store 1, mem_light_JYM_tx_count
+	
+	arg 0, temp
+	arg mem_light_JYM_tx_cmd, contr
+	arg 8, loopcnt
+	call frmt_light_sum_cal_loop
+	byteswap temp, temp
+	storet 2,mem_light_JYM_tx_sum
+
+	//call ice_break
+	arg mem_light_JYM_tx_len, regc
+	arg 11, loopcnt
+	setarg 0
+	store 2, mem_adv_CRC_False_initValue
+	call key_CRC16_CCITT_False1
+	fetch 2, mem_adv_CRC_False_initValue
+	store 2, mem_light_JYM_tx_CRC
+
+
+/***************************************
+mem_light_JYM_tx_header_temp中，pre1本来是50 55 55，但是白化的时候，需要reverse，
+所以初始化的时候，就直接reverse好了，为:0a aa aa
+****************************************/
+	arg 23, loopcnt      //只copy 23个byte，第24个byte是协议中的len
+	arg mem_light_KY_tx, contr  
+	arg mem_light_whitening_buffer, contw
+	call memcpy_fast
+
+	arg 13, loopcnt
+	arg mem_light_JYM_tx_len, contr  
+	arg mem_light_whitening_buffer+23, contw
+	call memcpy_fast
+	
+	jam 37, mem_light_recvd_len
+	jam 51, mem_light_whitening_i
+	call frmt_light_ble_whitening
+
+	arg 37, loopcnt
+	arg mem_light_whitening_buffer, contr
+	arg mem_light_JYM_tx_temp , contw
+	branch memcpy_fast
+	
+frmt_reverse:
+	ifetch 1, contr
+	reverse pdata, pdata
+	istore 1, contw
+	loop frmt_reverse
+	rtn
+
+key_pdu_common:		
+	bpatchx patch2f_0,mem_patch2f
+	call frmt_light_flag_set_short_press
+	call frmt_light_sum_cal
+	byteswap temp, temp
+	storet 2, mem_light_KY_tx_sum
+	arg mem_light_KY_tx_len, regc
+	arg 10, loopcnt
+	setarg 0
+	store 2, mem_adv_CRC_False_initValue 
+	call key_CRC16_CCITT_False1
+	fetch 2, mem_adv_CRC_False_initValue
+	store 2, mem_light_KY_tx_CRC
+	fetch 2, mem_light_KY_tx_count
+	byteswap pdata, pdata
+	pincrease 1
+	byteswap pdata, pdata
+	store 2, mem_light_KY_tx_count
+	
+	arg 37, loopcnt
+	arg mem_light_KY_tx, contr
+	arg mem_light_whitening_buffer, contw
+	call memcpy_fast
+	jam 37, mem_light_recvd_len
+	jam 51, mem_light_whitening_i
+	branch frmt_light_ble_whitening
+	
+
+frmt_light_sum_cal:
+	arg 0, temp
+	arg mem_light_KY_tx_code1, contr
+	arg 7, loopcnt
+frmt_light_sum_cal_loop:
+	ifetch 1, contr
+	iadd temp, temp
+	loop frmt_light_sum_cal_loop
+	rtn
+
+key_whitening_i_get:
+	arg 51, regb
+	rtn
+
+/***************************科云功能****************************/
+//mem_light_group_num
+frmt_light_group_num_set:
+	fetch 1, mem_light_group_num
+	store 1, mem_light_KY_tx_remoter_ID+3 
+	rtn
+
+frmt_light_timing_off_KY:
+	call frmt_light_timing_30s_V2
+	jam LIGHT_JYM_CMD_TIMING_OFF, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_TIMING_OFF, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_TIMING_CODE1, mem_light_KY_tx_code1
+	jam 0x46, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_Aux_lamp_on_and_off_KY:
+	jam LIGHT_JYM_CMD_AUX_LAMP, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_AUX_LAMP, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_AUX_LAMP_ON_AND_OFF_CODE1, mem_light_KY_tx_code1
+	jam 0xf0, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_to_Y:	
+	call frmt_light_to_Y_V2
+	jam LIGHT_JYM_CMD_TO_Y, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_TO_Y, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_TO_Y_CODE1, mem_light_KY_tx_code1
+	jam 0, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_to_W:	
+	call frmt_light_to_W_V2
+	jam LIGHT_JYM_CMD_TO_W, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_TO_W, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_TO_W_CODE1, mem_light_KY_tx_code1
+	jam 0, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_darken:
+	call frmt_light_darken_V2
+	jam LIGHT_JYM_CMD_DARKEN, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_DARKEN, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_DARKEN_CODE1, mem_light_KY_tx_code1
+	jam 0, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_lighten:
+	call frmt_light_lighten_V2
+	jam LIGHT_JYM_CMD_LIGHTEN, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_LIGHTEN, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_LIGHTEN_CODE1, mem_light_KY_tx_code1
+	jam 0, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_group1_off:
+	jam LIGHT_JYM_CMD_OFF, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_OFF, mem_light_JYM_tx_data
+	jam 0xd2,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_OFF_CODE1, mem_light_KY_tx_code1
+	jam LIGHT_OFF_CODE2, mem_light_KY_tx_code2
+	jam 0xd2,mem_light_KY_tx_group_num
+	branch key_pdu_common
+
+key_light_group2_off:	
+	jam LIGHT_JYM_CMD_OFF, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_OFF, mem_light_JYM_tx_data
+	jam 0xd4,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_OFF_CODE1, mem_light_KY_tx_code1
+	jam LIGHT_OFF_CODE2, mem_light_KY_tx_code2
+	jam 0xd4,mem_light_KY_tx_group_num
+	branch key_pdu_common
+
+key_light_group3_off:
+	jam LIGHT_JYM_CMD_OFF, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_OFF, mem_light_JYM_tx_data
+	jam 3,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_OFF_CODE1, mem_light_KY_tx_code1
+	setarg LIGHT_OFF_CODE2
+	store 2, mem_light_KY_tx_code2
+	jam 3,mem_light_group_num
+	branch key_pdu_common
+
+key_light_group4_off:
+	jam LIGHT_JYM_CMD_OFF, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_OFF, mem_light_JYM_tx_data
+	jam 4,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_OFF_CODE1, mem_light_KY_tx_code1
+	setarg LIGHT_OFF_CODE2
+	store 2, mem_light_KY_tx_code2
+	jam 4,mem_light_group_num
+	branch key_pdu_common
+
+key_light_group1_on:
+	jam LIGHT_JYM_CMD_ON, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_ON, mem_light_JYM_tx_data
+	jam 0xd2,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_ON_CODE1, mem_light_KY_tx_code1
+	jam LIGHT_ON_CODE2, mem_light_KY_tx_code2
+	jam 0xd2,mem_light_KY_tx_group_num
+	branch key_pdu_common
+
+key_light_group2_on:
+	jam LIGHT_JYM_CMD_ON, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_ON, mem_light_JYM_tx_data
+	jam 0xd4,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_ON_CODE1, mem_light_KY_tx_code1
+	jam LIGHT_ON_CODE2, mem_light_KY_tx_code2
+	jam 0xd4,mem_light_KY_tx_group_num
+	branch key_pdu_common
+
+key_light_group3_on:
+	jam LIGHT_JYM_CMD_ON, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_ON, mem_light_JYM_tx_data
+	jam 3,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_ON_CODE1, mem_light_KY_tx_code1
+	setarg LIGHT_ON_CODE2
+	store 2, mem_light_KY_tx_code2
+	jam 3,mem_light_group_num
+	branch key_pdu_common
+
+key_light_group4_on:
+	jam LIGHT_JYM_CMD_ON, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_ON, mem_light_JYM_tx_data
+	jam 4,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_ON_CODE1, mem_light_KY_tx_code1
+	setarg LIGHT_ON_CODE2
+	store 2, mem_light_KY_tx_code2
+	jam 4,mem_light_group_num
+	branch key_pdu_common
+
+key_light_pairing_group1:	
+	jam 0xd2,mem_light_JYM_tx_group
+	jam 0xd2,mem_light_KY_tx_group_num
+	branch key_light_master_pairing_process
+
+key_light_pairing_group2:	
+	jam 0xd4,mem_light_JYM_tx_group
+	jam 0xd4,mem_light_KY_tx_group_num
+	branch key_light_master_pairing_process
+
+key_light_pairing_group3:	
+	jam 3,mem_light_JYM_tx_group
+	jam 3,mem_light_KY_tx_group_num
+	branch key_light_master_pairing_process
+
+key_light_pairing_group4:	
+	jam 4,mem_light_JYM_tx_group
+	jam 4,mem_light_KY_tx_group_num
+	branch key_light_master_pairing_process
+
+
+key_light_clear_code:
+	call frmt_light_clear_code_V2
+	jam LIGHT_JYM_CMD_CLEAR, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_CLEAR, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_CLEAR_CODE_CODE1, mem_light_KY_tx_code1
+	setarg LIGHT_CLEAR_CODE_CODE2
+	store 2, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_master_pairing:
+	jam 0xd1,mem_light_KY_tx_group_num
+	jam 0xd1,mem_light_JYM_tx_group
+key_light_master_pairing_process:
+	call frmt_light_master_pairing_V2
+	jam LIGHT_JYM_CMD_PAIRING, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_PAIRING, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+ 
+	jam LIGHT_PAIRING_CODE1, mem_light_KY_tx_code1
+	jam LIGHT_PAIRING_CODE2, mem_light_KY_tx_code2
+	jam 0, mem_light_group_num
+	call frmt_light_group_num_set
+	branch key_pdu_common
+
+key_light_night_light:
+	call frmt_light_night_light_V2
+	jam LIGHT_JYM_CMD_NIGHT_LIGHT, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_NIGHT_LIGHT, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_NIGHT_LIGHT_CODE1, mem_light_KY_tx_code1
+	jam 0, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_color_switch:
+	fetch 1,mem_light_color_switch_cnt
+	beq 0,key_light_color_switch_WY
+	beq 1,key_light_color_switch_W
+	beq 2,key_light_color_switch_Y
+	rtn
+
+key_light_color_switch_WY:
+	call frmt_light_color_switch_WY_V2
+	jam 1, mem_light_color_switch_cnt
+	jam LIGHT_JYM_CMD_WY_LAMP, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_WY_LAMP, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_COLOR_SWITCH_CODE1, mem_light_KY_tx_code1
+	jam LIGHT_COLOR_SWITCH_WY_CODE2, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_color_switch_W:
+	call frmt_light_color_switch_W_V2
+	jam 2, mem_light_color_switch_cnt
+	jam LIGHT_JYM_CMD_WHITE_LAMP, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_WHITE_LAMP, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_COLOR_SWITCH_CODE1, mem_light_KY_tx_code1
+	jam LIGHT_COLOR_SWITCH_W_CODE2, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_color_switch_Y:
+	call frmt_light_color_switch_Y_V2
+	jam 0, mem_light_color_switch_cnt
+	jam LIGHT_JYM_CMD_YELLOW_LAMP, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_YELLOW_LAMP, mem_light_JYM_tx_data
+	call frmt_jym_pdu_common
+
+	jam LIGHT_COLOR_SWITCH_CODE1, mem_light_KY_tx_code1
+	jam LIGHT_COLOR_SWITCH_Y_CODE2, mem_light_KY_tx_code2
+	branch key_pdu_common
+
+key_light_master_off:
+	jam LIGHT_JYM_CMD_OFF, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_OFF, mem_light_JYM_tx_data
+	jam 0xd1,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_OFF_CODE1, mem_light_KY_tx_code1
+	jam 0, mem_light_KY_tx_code2
+	jam 0xd1,mem_light_KY_tx_group_num
+	branch key_pdu_common
+
+key_light_master_on:
+	jam LIGHT_JYM_CMD_ON, mem_light_JYM_tx_cmd
+	jam LIGHT_JYM_DATA_ON, mem_light_JYM_tx_data
+	jam 0xd1,mem_light_JYM_tx_group
+	call frmt_jym_pdu_common
+	
+	jam LIGHT_ON_CODE1, mem_light_KY_tx_code1
+	jam 0, mem_light_KY_tx_code2
+	jam 0xd1,mem_light_KY_tx_group_num
+	branch key_pdu_common
+
+
+
Index: program/app_light/remoter/frmt_fml_remoter_keyscan.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_keyscan.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_keyscan.prog	(working copy)
@@ -0,0 +1,186 @@
+
+/*
+按键检测
+*/
+frmt_kscan_init:
+	bpatchx patch2f_1,mem_patch2f
+
+	fetch 2, mem_kscan_analysis_interval_timeout   
+	nrtn blank
+
+	call frmt_kscan_col_state_init
+frmt_kscan_row_state_init:  //pull up, input
+	bpatchx patch2f_2,mem_patch2f
+
+	arg mem_kscan_row_gpio_pin, rega
+
+	fetch 1, mem_kscan_row_nums
+	iforce loopcnt
+frmt_kscan_input_pull_up_loop:	
+	ifetcht 1, rega
+	call gpio_config_input
+	increase 1, rega
+	loop frmt_kscan_input_pull_up_loop
+	nop 12000	
+	rtn
+
+frmt_kscan_recover_col_output_low:	
+frmt_kscan_col_state_init:  //output low
+	arg mem_kscan_col_gpio_pin, rega
+	fetch 1, mem_kscan_col_nums
+	iforce loopcnt
+frmt_kscan_output_low_loop:
+	ifetcht 1, rega
+	or temp, 0x80, temp
+	call gpio_config_output_patch
+	increase 1, rega
+	loop frmt_kscan_output_low_loop
+	nop 12000
+	rtn
+
+	
+/**************************************************
+gpio数可配置
+gpio pin脚可配置
+行列可配置，最大8*8
+
+mem_kscan_row_nums:行数
+mem_kscan_col_nums:列数
+mem_kscan_col_gpio_pin:列GPIO
+mem_kscan_row_gpio_pin:行GPIO
+
+mem_kscan_avoid_shake_delay_time: 消抖时间，如果为0，没有消抖。消抖时间:X * 3.5us
+
+**************************************************/
+frmt_kscan:
+	fetch 2, mem_kscan_analysis_interval_timeout   
+// 	call ice_break
+	nrtn blank
+	jam 0, mem_keypress_analysis_flag
+
+	setarg 0
+	store 8, mem_kscan_record_keypress
+frmt_kscan_get_row_state:
+	jam 0, mem_kscan_row_scanned
+	arg mem_kscan_row_gpio_pin, regc
+
+frmt_kscan_get_row_state_loop:
+	ifetcht 1, regc
+	call gpio_get_bit
+	call frmt_kscan_avoid_shake_and_record_key, true  //low , in
+
+	ifetcht 1, regc        //current row recover to pull up
+	call gpio_config_input
+	call frmt_kscan_recover_col_output_low  
+	
+	increase 1, regc
+	fetch 1, mem_kscan_row_scanned
+	pincrease 1
+	store 1, mem_kscan_row_scanned
+	fetcht 1, mem_kscan_row_nums
+	isub temp, null
+	nbranch frmt_kscan_get_row_state_loop, positive
+	rtn
+	
+frmt_kscan_press_GND_related:
+	bpatchx patch2f_3,mem_patch2f
+
+	fetch 1, mem_kscan_row_scanned
+	pincrease 1
+	fetcht 1, mem_kscan_col_nums
+	increase 1, temp
+	imul32 temp, pdata
+	iforce queue
+	fetch 8, mem_kscan_record_keypress
+	qset1 pdata
+	store 8, mem_kscan_record_keypress
+	rtn
+	
+frmt_kscan_set_default_avoid_shake_time:
+	arg 1, loopcnt
+	rtn
+	
+frmt_kscan_avoid_shake_and_record_key:
+	bpatchx patch2f_4,mem_patch2f
+
+	fetch 2, mem_kscan_avoid_shake_delay_time
+	iforce loopcnt
+	call frmt_kscan_set_default_avoid_shake_time, blank
+	call delay_ms_wait
+	ifetcht 1, regc
+	call gpio_get_bit
+	nrtn true
+	nop 12000 
+
+	ifetcht 1, regc
+	call gpio_get_bit
+	nrtn true
+	nop 12000 
+	
+	ifetcht 1, regc
+	call gpio_get_bit
+	nrtn true
+
+	call frmt_kscan_all_col_pull_up
+	ifetcht 1, regc //deal with GND
+	call gpio_get_bit
+	branch frmt_kscan_press_GND_related, true
+	
+frmt_kscan_check_col_elec_level:
+	bpatchx patch2f_5,mem_patch2f
+
+	ifetcht 1, regc
+	or temp, 0x80, temp
+	call gpio_config_output_patch
+	jam 0, mem_kscan_col_scanned	
+	arg mem_kscan_col_gpio_pin, rega
+frmt_kscan_check_col_elec_level_loop:  
+	ifetcht 1, rega
+	call gpio_get_bit  //only "pdata" , "temp"
+	call frmt_kscan_record_keypress, true  
+	
+	increase 1, rega
+	fetch 1, mem_kscan_col_scanned
+	pincrease 1
+	store 1, mem_kscan_col_scanned
+	fetcht 1, mem_kscan_col_nums
+	isub temp, null
+	nbranch frmt_kscan_check_col_elec_level_loop, positive	
+	rtn
+
+
+frmt_kscan_record_keypress:
+	bpatchx patch2f_6,mem_patch2f
+
+	fetch 1, mem_kscan_row_scanned
+	fetcht 1, mem_kscan_col_nums
+	increase 1, temp
+	imul32 temp, pdata
+	//nop 10000
+	fetcht 1, mem_kscan_col_scanned
+	increase 1, temp
+	iadd temp, pdata
+	iforce queue
+	enable true
+	fetch 8, mem_kscan_record_keypress
+	qsetflag true, pdata
+	store 8, mem_kscan_record_keypress
+
+// 	call ice_break
+// 	fetcht 8, mem_kscan_record_keypress
+// 	setarg LIGHT_ND21KEY_KEY_PAIRING2_COMBINATION
+// 	isub temp, null
+// 	call ice_break, zero
+	rtn
+frmt_kscan_all_col_pull_up:
+	bpatchx patch2f_7,mem_patch2f
+
+	arg mem_kscan_col_gpio_pin, rega
+	fetch 1, mem_kscan_col_nums
+	iforce loopcnt
+	branch frmt_kscan_input_pull_up_loop
+
+gpio_config_output_patch:	
+	setflip 7, temp
+	branch gpio_config_output
+
Index: program/app_light/remoter/frmt_fml_remoter_lib.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_lib.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_lib.prog	(working copy)
@@ -0,0 +1,546 @@
+
+
+
+frmt_light_lighten_short_press:
+	fetch 1, mem_light_color_and_lgtness_long_press_adv_enable
+	beq 1, frmt_light_lighten
+	jam LIGHT_LIGHTEN_RELEASE_ADV_FLAG, mem_light_release_adv_flag
+	branch frmt_light_light_color_and_lightness_change_common
+
+frmt_light_darken_short_press:
+	fetch 1, mem_light_color_and_lgtness_long_press_adv_enable
+	beq 1, frmt_light_darken
+	jam LIGHT_DARKEN_RELEASE_ADV_FLAG, mem_light_release_adv_flag
+	branch frmt_light_light_color_and_lightness_change_common
+
+frmt_light_to_W_short_press:
+	fetch 1, mem_light_color_and_lgtness_long_press_adv_enable
+	beq 1, frmt_light_to_W
+	jam LIGHT_TO_W_RELEASE_ADV_FLAG, mem_light_release_adv_flag
+	branch frmt_light_light_color_and_lightness_change_common
+
+frmt_light_to_Y_short_press:
+	fetch 1, mem_light_color_and_lgtness_long_press_adv_enable
+	beq 1,frmt_light_to_Y
+	jam LIGHT_TO_Y_RELEASE_ADV_FLAG, mem_light_release_adv_flag
+frmt_light_light_color_and_lightness_change_common:
+	bpatchx patch30_0,mem_patch30
+	fetch 2, mem_light_short_keypress_timeout
+	nrtn blank
+	jam 0, mem_le_adv_enable
+	jam SHORT_PRESS_TIMEOUT, mem_light_short_keypress_timeout
+	rtn	
+
+frmt_light_to_Y:
+	call frmt_light_to_Y_V2
+	fetch 1,mem_special_agreemeet_enable
+	beq 1, gem_light_to_Y
+	beq 2,key_light_to_Y
+	jam 0, mem_light_release_adv_flag
+	jam LIGHT_CMD_FTD_COLOR_STATE_CHANGE, mem_FTD_adv_raw
+	jam 0x18, mem_FTD_adv_raw_reserved
+	call frmt_light_set_PDU_common_short_press_with_3Bytes_data_reset		
+	branch frmt_adv_rear_6bytes_and_whitening
+
+
+frmt_light_to_W:
+	call frmt_light_to_W_V2
+	fetch 1,mem_special_agreemeet_enable
+	beq 1, gem_light_to_W
+	beq 2,key_light_to_W
+	jam 0, mem_light_release_adv_flag
+	jam LIGHT_CMD_FTD_COLOR_STATE_CHANGE, mem_FTD_adv_raw
+	jam 0x24, mem_FTD_adv_raw_reserved
+	call frmt_light_set_PDU_common_short_press_with_3Bytes_data_reset
+	branch frmt_adv_rear_6bytes_and_whitening
+
+frmt_light_darken:
+	call frmt_light_darken_V2
+	fetch 1,mem_special_agreemeet_enable
+	beq 1, gem_light_darken
+	beq 2, key_light_darken
+	jam 0, mem_light_release_adv_flag
+	jam LIGHT_CMD_FTD_COLOR_STATE_CHANGE, mem_FTD_adv_raw
+	jam 0x28, mem_FTD_adv_raw_reserved
+	call frmt_light_set_PDU_common_short_press_with_3Bytes_data_reset
+	branch frmt_adv_rear_6bytes_and_whitening
+
+frmt_light_lighten:
+	call frmt_light_lighten_V2
+	fetch 1,mem_special_agreemeet_enable
+	beq 1, gem_light_lighten
+	beq 2, key_light_lighten
+	jam 0, mem_light_release_adv_flag	
+	jam LIGHT_CMD_FTD_COLOR_STATE_CHANGE, mem_FTD_adv_raw
+	jam 0x14, mem_FTD_adv_raw_reserved
+	call frmt_light_set_PDU_common_short_press_with_3Bytes_data_reset
+	branch frmt_adv_rear_6bytes_and_whitening
+
+frmt_light_set_PDU_common_short_press_with_3Bytes_data_reset:
+	bpatchx patch30_1,mem_patch30
+	setarg 0    //clear data part (3 Bytes)
+	store 3, mem_FTD_adv_raw_data	
+	branch frmt_light_set_PDU_common_short_press
+
+
+
+frmt_light_release_set1_and_long_press_set1:
+	jam 1, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+	jam 1, mem_light_release_adv_flag
+	rtn
+
+frmt_light_release_set2_and_long_press_set2:
+	jam 2, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+	jam 2, mem_light_release_adv_flag
+	rtn
+
+frmt_light_release_set3_and_long_press_set3:
+	jam 3, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+	jam 3, mem_light_release_adv_flag
+	rtn
+
+frmt_light_release_set4_and_long_press_set4:
+	jam 4, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+	jam 4, mem_light_release_adv_flag
+	rtn
+
+frmt_light_long_press_flag_reset:
+	bpatchx patch30_2,mem_patch30
+	fetch 2, mem_long_press_timeout
+	nrtn blank
+	fetch 2,mem_claer_code_time
+	store 2, mem_long_press_timeout
+	pincrease 1
+	store 2, mem_light_lpm_enable_timeout
+	fetch 1,mem_special_agreemeet_enable
+	sub pdata,1,null
+	branch gem_long_keypress_time,zero	
+	rtn
+
+frmt_light_night_light:
+	call frmt_light_night_light_V2
+	jam LIGHT_CMD_NIGHT_LIGHT, mem_FTD_adv_raw
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press	
+
+frmt_light_master_pairing:
+	jam 0, mem_groups_num
+	jam 0, mem_ble_v2_group_index
+
+frmt_light_pairing_process:
+	setarg KEY_PRESS_LED_ON_TIME
+	store 2, mem_indicator_led_turn_on_timeout
+	jam 1, mem_indicator_turn_on_enable
+frmt_light_pairing_process_without_led_flag_set:	
+	bpatchx patch30_3,mem_patch30
+	call frmt_light_master_pairing_V2
+	jam 1, mem_le_adv_enable
+	fetch 2, mem_light_adv_time
+	lshift2 pdata, pdata
+	store 2, mem_ble_light_adv_timeout
+	pincrease 1
+	store 2, mem_light_lpm_enable_timeout	
+	
+	fetch 1, mem_light_manufacture_id
+	store 1, mem_FTD_adv_raw_reserved
+	jam LIGHT_CMD_PAIRING_CODE, mem_FTD_adv_raw
+
+	fetch 1, mem_FTD_adv_raw_packet_num
+	pincrease 1
+	store 1, mem_FTD_adv_raw_packet_num
+	jam 0x81, mem_FTD_adv_raw_data+2
+	
+	fetch 1,mem_ble_v2_maintype
+	sub pdata,3,null
+	call frmt_fan_lamp,zero
+	fetch 1,mem_ble_v2_maintype
+	sub pdata,5,null
+	call frmt_solar_lamp,zero
+	
+	call frmt_light_groups_pairing_address_set_set
+	branch frmt_adv_rear_6bytes_and_whitening
+	
+frmt_light_groups_pairing_address_set_set:
+	fetch 2, mem_FTD_adv_raw_device_add_temp
+	arg 0xf0ff, temp
+	iand temp, pdata
+	store 2, mem_FTD_adv_raw_data
+	branch frmt_light_groups_address_set
+
+frmt_light_clear_code:
+// 	call ice_break	
+	bpatchx patch30_4,mem_patch30
+	call frmt_light_clear_code_V2
+	jam 1, mem_indicator_turn_on_enable
+
+	jam 1, mem_le_adv_enable
+	setarg KEY_PRESS_LED_ON_TIME
+	lshift2 pdata, pdata
+	store 2, mem_indicator_led_turn_on_timeout
+	fetch 2,mem_light_adv_time
+	lshift2 pdata, pdata
+
+	store 2, mem_ble_light_adv_timeout
+	pincrease 1
+	store 2, mem_light_lpm_enable_timeout
+	jam LIGHT_CMD_CLEAR_CODE, mem_FTD_adv_raw
+	setarg LIGHT_FTD_CLEAR_CODE_ADDR
+	store 3, mem_FTD_adv_raw_device_add
+	fetch 1, mem_FTD_adv_raw_packet_num
+	pincrease 1
+	store 1, mem_FTD_adv_raw_packet_num
+	
+	fetch 1,mem_ble_v2_maintype
+	sub pdata,3,null
+	call frmt_fan_lamp,zero
+	fetch 1,mem_ble_v2_maintype
+	sub pdata,5,null
+	call frmt_solar_lamp,zero
+	branch frmt_adv_rear_6bytes_and_whitening
+
+frmt_light_master_on_and_long_press_set0:
+	jam 0, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+frmt_light_master_on:
+	jam 0, mem_groups_num
+	call frmt_light_master_on_V2
+	fetch 1,mem_special_agreemeet_enable
+	beq 1, gem_light_master_on
+	beq 2, key_light_master_on
+frmt_light_on_without_group_set:
+	jam 1, mem_light_on_and_off_flag
+	jam LIGHT_CMD_TURN_ON, mem_FTD_adv_raw
+	call frmt_light_groups_address_set
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_master_off_and_long_press_set0:
+	jam 0, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+	branch frmt_light_master_off
+frmt_light_master_on_and_off:
+	fetch 1, mem_light_on_and_off_flag
+	branch frmt_light_master_on, blank
+frmt_light_master_off:
+	call frmt_light_master_off_V2
+	jam 0, mem_groups_num
+	fetch 1,mem_special_agreemeet_enable
+	beq 1, gem_light_master_off	
+	beq 2, key_light_master_off	
+frmt_light_off_without_group_set:
+	jam 0, mem_light_on_and_off_flag	
+	jam LIGHT_CMD_TURN_OFF, mem_FTD_adv_raw
+	call frmt_light_groups_address_set
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_on_and_off_1opcode_and_long_press_set0:
+	jam 0, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+frmt_light_on_and_off_1opcode:
+	call frmt_light_on_and_off_1opcode_v2
+	jam LIGHT_CMD_TURN_ON_AND_OFF, mem_FTD_adv_raw
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_color_switch_WY_only_payload_set:
+	jam LIGHT_CMD_COLOR_SWTICH, mem_FTD_adv_raw
+	jam LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data
+	jam LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+1
+	jam LIGHT_CMD_FTD_COLOR_SWTICH_RESERVED, mem_FTD_adv_raw_reserved
+	rtn
+frmt_light_color_switch_W_only_payload_set:
+	jam LIGHT_CMD_COLOR_SWTICH, mem_FTD_adv_raw
+	jam LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data
+	jam LIGHT_CMD_FTD_COLOR_SWTICH_RESERVED, mem_FTD_adv_raw_reserved
+	rtn
+	
+frmt_light_color_switch_Y_only_payload_set:
+	jam LIGHT_CMD_COLOR_SWTICH, mem_FTD_adv_raw
+	jam LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+1
+	jam LIGHT_CMD_FTD_COLOR_SWTICH_RESERVED, mem_FTD_adv_raw_reserved
+	rtn
+
+frmt_light_color_switch:
+	fetch 1,mem_light_color_switch_cnt
+	sub pdata,3,null
+	call frmt_color_switch_cnt_set0,zero
+	beq 0,frmt_light_color_switch_WY
+	beq 1,frmt_light_color_switch_W
+	beq 2,frmt_light_color_switch_Y
+	rtn
+frmt_color_switch_cnt_set0:
+	setarg 0
+	store 1,mem_light_color_switch_cnt
+	rtn
+frmt_light_color_switch_WY:
+	fetch 1, mem_light_color_switch_cnt
+	pincrease 1
+	store 1,mem_light_color_switch_cnt
+	call frmt_light_color_switch_WY_V2
+	fetch 1,mem_special_agreemeet_enable
+	beq 1,gem_light_color_switch
+	call frmt_light_color_switch_WY_only_payload_set
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press	
+frmt_light_color_switch_W:
+	fetch 1, mem_light_color_switch_cnt
+	pincrease 1
+	store 1,mem_light_color_switch_cnt
+	call frmt_light_color_switch_W_V2
+	fetch 1,mem_special_agreemeet_enable
+	beq 1,gem_light_color_switch
+	call frmt_light_color_switch_W_only_payload_set
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+frmt_light_color_switch_Y:
+	fetch 1, mem_light_color_switch_cnt
+	pincrease 1
+	store 1,mem_light_color_switch_cnt
+	call frmt_light_color_switch_Y_V2
+	fetch 1,mem_special_agreemeet_enable
+	beq 1,gem_light_color_switch
+	call frmt_light_color_switch_Y_only_payload_set
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_aid_turn_on_and_off:
+	fetch 1,mem_light_aid_swtich_flag  // 0:on   1:off
+	beq 0, frmt_light_aid_turn_on
+frmt_light_aid_turn_off:
+	call frmt_light_aid_turn_off_V2
+	jam 0, mem_light_aid_swtich_flag
+	fetch 1,mem_special_agreemeet_enable
+	beq 1,gem_light_aid_turn_onoff
+	beq 2,key_light_Aux_lamp_on_and_off_KY
+	jam LIGHT_CMD_AID_TURN_OFF, mem_FTD_adv_raw 
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press	
+frmt_light_aid_turn_on:
+	call frmt_light_aid_turn_on_V2
+	jam 1,mem_light_aid_swtich_flag
+	fetch 1,mem_special_agreemeet_enable
+	beq 1,gem_light_aid_turn_onoff
+	beq 2,key_light_Aux_lamp_on_and_off_KY
+	jam LIGHT_CMD_AID_TURN_ON, mem_FTD_adv_raw
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_pcnt_50_and_100percent:
+	fetch 1,mem_light_brightness_switch_flag
+	beq 0, frmt_light_pcnt_50_percent
+frmt_light_pcnt_100_percent:
+	call frmt_light_pcnt_100_percent_V2
+	jam LIGHT_CMD_COLOR_SWTICH, mem_FTD_adv_raw
+	jam LIGHT_DATA_PART_FF,  mem_FTD_adv_raw_data
+	jam LIGHT_DATA_PART_FF,  mem_FTD_adv_raw_data+1
+	jam 0, mem_light_brightness_switch_flag
+	jam 2, mem_FTD_adv_raw_reserved	
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+frmt_light_pcnt_50_percent:
+	call frmt_light_pcnt_50_percent_V2
+	jam 1, mem_FTD_adv_raw_reserved
+	jam LIGHT_CMD_COLOR_SWTICH, mem_FTD_adv_raw
+	jam LIGHT_FTD_DATA_PART_PCNT_50PERCENT,  mem_FTD_adv_raw_data
+	jam LIGHT_FTD_DATA_PART_PCNT_50PERCENT,  mem_FTD_adv_raw_data+1
+	jam 1, mem_light_brightness_switch_flag
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_rgb_auto:
+	fetch 1,mem_special_agreemeet_enable
+	sub pdata,1,null
+	call gem_light_rgb_auto,zero
+	jam 1,mem_light_rgb_on_and_off_flag
+	fetch 1,mem_light_rgb_auto_flag
+	beq 0,frmt_light_rgb_circulation_1e
+frmt_light_rgb_circulation_1f:						//off
+	call frmt_light_rgb_circulation_1f_V2
+	jam LIGHT_CMD_RGB_1F, mem_FTD_adv_raw 
+	jam 0, mem_light_rgb_auto_flag
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+frmt_light_rgb_circulation_1e:						//on
+	call frmt_light_rgb_circulation_1e_V2
+	jam LIGHT_CMD_RGB_1E, mem_FTD_adv_raw 
+	jam 1, mem_light_rgb_auto_flag
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press	
+
+frmt_light_rgb_manual:
+	fetch 1,mem_special_agreemeet_enable
+	sub pdata,1,null
+	call gem_light_rgb_step,zero
+	jam LIGHT_CMD_RGB_MANNUL, mem_FTD_adv_raw
+	fetch 1, mem_light_rgb_hand_actuated_flag
+	beq 0,frmt_light_rgb_manual0
+	beq 1,frmt_light_rgb_manual1
+	beq 2,frmt_light_rgb_manual2
+	beq 3,frmt_light_rgb_manual3
+	beq 4,frmt_light_rgb_manual4
+	beq 5,frmt_light_rgb_manual5
+	beq 6,frmt_light_rgb_manual6
+	rtn
+frmt_light_rgb_manual6:	
+	call frmt_light_rgb_manual6_V2
+	jam 0, mem_light_rgb_hand_actuated_flag
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+1
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+2
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_rgb_manual5:
+	call frmt_light_rgb_manual5_V2
+	jam 6, mem_light_rgb_hand_actuated_flag
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+2
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_rgb_manual4:
+	call frmt_light_rgb_manual4_V2
+	jam 5, mem_light_rgb_hand_actuated_flag
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+1
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+2
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_rgb_manual3:
+	call frmt_light_rgb_manual3_V2
+	jam 4, mem_light_rgb_hand_actuated_flag
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+1
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press	
+
+frmt_light_rgb_manual2:
+	call frmt_light_rgb_manual2_V2
+	jam 3, mem_light_rgb_hand_actuated_flag
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+2
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_rgb_manual1:
+	call frmt_light_rgb_manual1_V2
+	jam 2, mem_light_rgb_hand_actuated_flag
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data+1
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_rgb_manual0:
+	call frmt_light_rgb_manual0_V2
+	jam 1, mem_light_rgb_hand_actuated_flag
+	jam  LIGHT_DATA_PART_FF, mem_FTD_adv_raw_data
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_timing_1min:
+	call frmt_light_timing_1min_V2
+	jam 1, mem_FTD_adv_raw_data	
+frmt_light_timing_off:
+	jam LIGHT_CMD_DELAY_OFF, mem_FTD_adv_raw
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_group1_on_and_long_press_set1:
+	jam 1, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset	
+frmt_light_group1_on:
+	call frmt_light_group1_on_V2
+	jam 1, mem_light_group1_on_and_off_flag
+	jam LIGHT_CMD_TURN_ON, mem_FTD_adv_raw
+	jam 1, mem_groups_num
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_group2_on_and_long_press_set2:
+	jam 2, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset	
+frmt_light_group2_on:
+	call frmt_light_group2_on_V2
+	jam 1, mem_light_group2_on_and_off_flag
+	jam LIGHT_CMD_TURN_ON, mem_FTD_adv_raw
+	jam 2, mem_groups_num
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_group3_on_and_long_press_set3:
+	jam 3, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset	
+frmt_light_group3_on:
+	jam 1, mem_light_group3_on_and_off_flag
+	jam LIGHT_CMD_TURN_ON, mem_FTD_adv_raw
+	jam 3, mem_groups_num
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+	
+frmt_light_group4_on_and_long_press_set4:
+	jam 4, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset	
+frmt_light_group4_on:
+	call frmt_light_group4_on_V2
+	jam 1, mem_light_group4_on_and_off_flag
+	jam LIGHT_CMD_TURN_ON, mem_FTD_adv_raw
+	jam 4, mem_groups_num
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+	
+frmt_light_group1_on_and_off_and_long_press_set1:
+	jam 1, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+frmt_light_group1_on_and_off:
+	fetch 1, mem_light_group1_on_and_off_flag
+	branch frmt_light_group1_on, blank
+frmt_light_group1_off:
+	call frmt_light_group1_off_V2
+	jam 0, mem_light_group1_on_and_off_flag
+	jam LIGHT_CMD_TURN_OFF, mem_FTD_adv_raw
+	jam 1, mem_groups_num
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+
+frmt_light_group2_on_and_off_and_long_press_set2:
+	jam 2, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+frmt_light_group2_on_and_off:
+	fetch 1, mem_light_group2_on_and_off_flag
+	branch frmt_light_group2_on, blank
+frmt_light_group2_off:	
+	call frmt_light_group2_off_V2
+	jam 0, mem_light_group2_on_and_off_flag
+	jam LIGHT_CMD_TURN_OFF, mem_FTD_adv_raw
+	jam 2, mem_groups_num
+	//call p_light_groups_address_set
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_group3_on_and_off_and_long_press_set3:
+	jam 3, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+frmt_light_group3_on_and_off:
+	fetch 1, mem_light_group3_on_and_off_flag
+	branch frmt_light_group3_on, blank
+frmt_light_group3_off:
+	call frmt_light_group3_off_V2
+	jam 0, mem_light_group3_on_and_off_flag
+	jam LIGHT_CMD_TURN_OFF, mem_FTD_adv_raw
+	jam 3, mem_groups_num
+	//call p_light_groups_address_set	
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_group4_on_and_off_and_long_press_set4:
+	jam 4, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+frmt_light_group4_on_and_off:
+	fetch 1, mem_light_group4_on_and_off_flag
+	branch frmt_light_group4_on, blank
+frmt_light_group4_off:
+	call frmt_light_group4_off_V2
+	jam 0, mem_light_group4_on_and_off_flag
+	jam LIGHT_CMD_TURN_OFF, mem_FTD_adv_raw
+	jam 4, mem_groups_num
+	//call p_light_groups_address_set
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_light_pairing_group1:	
+	jam 1, mem_groups_num
+	jam 1, mem_ble_v2_group_index
+	branch frmt_light_pairing_process
+
+frmt_light_pairing_group2:	
+	jam 2, mem_groups_num
+	jam 2, mem_ble_v2_group_index
+	branch frmt_light_pairing_process
+
+frmt_light_pairing_group3:	
+	jam 3, mem_groups_num
+	jam 3, mem_ble_v2_group_index
+	branch frmt_light_pairing_process
+
+frmt_light_pairing_group4:	
+	jam 4, mem_groups_num
+	jam 4, mem_ble_v2_group_index
+	branch frmt_light_pairing_process
+
+
+	
Index: program/app_light/remoter/frmt_fml_remoter_lib_fan.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_lib_fan.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_lib_fan.prog	(working copy)
@@ -0,0 +1,91 @@
+
+frmt_fan_master_off:
+	call frmt_fan_master_off_v2
+	jam FAN_CMD_MASTER_ON_AND_OFF, mem_FTD_adv_raw
+	jam 0, mem_FTD_adv_raw_data	
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_fan_turning_forward_and_reverse:
+	fetch 1, mem_fan_direction_alternant
+	branch frmt_fan_turning_reverse, blank
+	jam 0, mem_fan_direction_alternant
+	branch frmt_fan_turning_forward
+frmt_fan_turning_reverse:
+	call frmt_fan_turing_reverse_v2
+	jam 1, mem_fan_direction_alternant
+	jam FAN_CMD_DIRECTION, mem_FTD_adv_raw
+	jam 1, mem_FTD_adv_raw_data
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+frmt_fan_turning_forward:
+	call frmt_fan_turing_forward_v2
+	jam FAN_CMD_DIRECTION, mem_FTD_adv_raw
+	jam 0, mem_FTD_adv_raw_data
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_fan_natural_wind:
+	call frmt_fan_natural_wind_v2
+	jam FAN_CMD_MODE, mem_FTD_adv_raw
+	jam 2, mem_FTD_adv_raw_data
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press	
+
+frmt_fan_tap_position_1:
+	call frmt_fan_tap_position_1_v2
+	setarg 1
+frmt_fan_tap_position_common:
+	store 1, mem_FTD_adv_raw_data
+	jam FAN_CMD_SPEED_32,mem_FTD_adv_raw
+	jam 6, mem_FTD_adv_raw_data+1	
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+frmt_fan_tap_position_2:
+	call frmt_fan_tap_position_2_v2
+	setarg 2
+	branch frmt_fan_tap_position_common
+	
+frmt_fan_tap_position_3:
+	call frmt_fan_tap_position_3_v2
+	setarg 3
+	branch frmt_fan_tap_position_common
+	
+frmt_fan_tap_position_4:
+	call frmt_fan_tap_position_4_v2
+	setarg 4
+	branch frmt_fan_tap_position_common
+	
+frmt_fan_tap_position_5:
+	call frmt_fan_tap_position_5_v2
+	setarg 5
+	branch frmt_fan_tap_position_common
+	
+frmt_fan_tap_position_6:
+	call frmt_fan_tap_position_6_v2
+	setarg 6
+	branch frmt_fan_tap_position_common
+
+frmt_fan_stop_fan_and_long_press_set1:
+	jam 1, mem_light_num_of_long_press
+	call frmt_light_long_press_flag_reset
+frmt_fan_stop_fan:
+	call frmt_fan_stop_fan_v2
+	jam FAN_CMD_SPEED_31,mem_FTD_adv_raw
+	jam 0, mem_FTD_adv_raw_data
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
+
+frmt_fan_deflector_on_and_off:
+	fetch 1, mem_fan_deflector_flag
+	branch frmt_fan_deflector_on, blank
+frmt_fan_deflector_off:
+	call frmt_fan_deflector_off_v2
+	jam 0, mem_fan_deflector_flag
+	jam FAN_CMD_DEFLECTOR, mem_FTD_adv_raw
+	jam 0, mem_FTD_adv_raw_data
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press	
+	
+frmt_fan_deflector_on:
+	call frmt_fan_deflector_on_v2
+	jam 1, mem_fan_deflector_flag
+	jam FAN_CMD_DEFLECTOR, mem_FTD_adv_raw
+	jam 1, mem_FTD_adv_raw_data
+	branch frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press
+
Index: program/app_light/remoter/frmt_fml_remoter_lib_fan_v2.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_lib_fan_v2.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_lib_fan_v2.prog	(working copy)
@@ -0,0 +1,65 @@
+
+
+frmt_fan_master_off_v2:
+	setarg FAN_CMD_MASTER_ON_AND_OFF_V2
+	store 2, mem_ble_v2_cmd
+	branch frmt_ble_v2_encoder_pack
+
+frmt_fan_turing_reverse_v2:
+	jam 1, mem_ble_v2_para+1
+frmt_fan_turing_forward_v2:
+	setarg FAN_CMD_WIND_DIRECTION_V2
+	store 2, mem_ble_v2_cmd
+	branch frmt_ble_v2_encoder_pack
+
+frmt_fan_natural_wind_v2:
+	jam 0x02, mem_ble_v2_para+1
+frmt_fan_mode_sel_common_v2:
+	setarg FAN_CMD_MODE_SEL_V2
+	store 2, mem_ble_v2_cmd
+	branch frmt_ble_v2_encoder_pack
+
+frmt_fan_tap_position_1_v2:
+	setarg 1
+frmt_fan_tap_position_common_v2:
+	store 1, mem_ble_v2_para+2
+	setarg FAN_CMD_WIND_SPEED_V2
+	store 2, mem_ble_v2_cmd
+	jam 0x20, mem_ble_v2_para+1
+	branch frmt_ble_v2_encoder_pack
+
+frmt_fan_tap_position_2_v2:
+	setarg 2
+	branch frmt_fan_tap_position_common_v2
+	
+frmt_fan_tap_position_3_v2:
+	setarg 3
+	branch frmt_fan_tap_position_common_v2	
+
+frmt_fan_tap_position_4_v2:
+	setarg 4
+	branch frmt_fan_tap_position_common_v2	
+
+frmt_fan_tap_position_5_v2:
+	setarg 5
+	branch frmt_fan_tap_position_common_v2	
+	
+frmt_fan_tap_position_6_v2:
+	setarg 6
+	branch frmt_fan_tap_position_common_v2	
+
+frmt_fan_stop_fan_v2:
+	setarg 0
+	branch frmt_fan_tap_position_common_v2
+
+
+frmt_fan_deflector_on_v2:
+	jam 1, mem_ble_v2_para+1
+frmt_fan_deflector_off_v2:	
+	setarg FAN_CMD_DEFLECTOR_V2
+	store 2, mem_ble_v2_cmd
+	branch frmt_ble_v2_encoder_pack
+
+
+
+
Index: program/app_light/remoter/frmt_fml_remoter_lib_v2.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_lib_v2.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_lib_v2.prog	(working copy)
@@ -0,0 +1,236 @@
+
+frmt_light_to_Y_V2:
+	jam 0x18, mem_ble_v2_para+1
+	branch frmt_light_common
+
+frmt_light_to_W_V2:
+	jam 0x24, mem_ble_v2_para+1
+	branch frmt_light_common
+
+
+frmt_light_darken_V2:
+	jam 0x28, mem_ble_v2_para+1
+	branch frmt_light_common
+	
+
+frmt_light_lighten_V2:
+	jam 0x14, mem_ble_v2_para+1
+	branch frmt_light_common
+
+frmt_light_common:
+	setarg LIGHT_CMD_LIGHT_CTL_V2
+	store 2, mem_ble_v2_cmd
+	branch frmt_ble_v2_encoder_pack
+
+frmt_ble_v2_encoder_pack:
+	bpatchx patch30_5,mem_patch30
+	call frmt_ble_data_set
+	fetch 1,mem_light_manufacture_id2_v2
+	ncall frmt_have_id2_v2,blank
+	rtn
+	
+frmt_have_id2_v2:
+	bpatchx patch30_6,mem_patch30
+	arg FTD_PDU_LEN, loopcnt
+	arg mem_ble_v2_pdu, contr
+	arg mem_ble_v2_pdu_2, contw
+	call memcpy_fast
+
+	fetch 1,mem_light_manufacture_id2_v2
+	store 1,mem_ble_v2_customer_id
+	fetch 1,mem_ble_v2_packet_num
+	pincrease -1
+	store 1,mem_ble_v2_packet_num
+	call frmt_ble_data_set
+	fetch 1,mem_ble_v2_customer_id_copy
+	store 1,mem_ble_v2_customer_id
+	rtn
+
+frmt_light_night_light_V2:
+	setarg LIGHT_CMD_NIGHT_LIGHT_V2
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0	
+
+
+frmt_light_master_pairing_V2:
+	setarg CMD_PAIRING
+frmt_ble_v2_encoder_with_cmd_store_and_para_set0:
+	store 2, mem_ble_v2_cmd
+	setarg 0
+	store 4, mem_ble_v2_para
+	branch frmt_ble_v2_encoder_pack
+
+frmt_light_clear_code_V2:
+	setarg CMD_CLEAR_CODE
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0	
+
+frmt_light_master_on_V2:
+	jam 0, mem_ble_v2_group_index
+frmt_light_turn_on_common:	
+	setarg LIGHT_CMD_TURN_ON_V2
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0
+
+frmt_light_master_off_V2:
+	jam 0, mem_ble_v2_group_index
+frmt_light_turn_off_common:	
+	setarg LIGHT_CMD_TURN_OFF_V2
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0
+
+frmt_light_on_and_off_1opcode_v2:
+	setarg LIGHT_CMD_TURN_ON_AND_OFF_V2	
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0
+
+frmt_light_color_switch_WY_V2:
+	setarg LIGHT_CMD_LIGHT_CTL_V2
+	store 2, mem_ble_v2_cmd
+	jam 0, mem_ble_v2_para
+	jam LIGHT_CMD_FTD_COLOR_SWTICH_RESERVED, mem_ble_v2_para+1
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+2
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack
+
+frmt_light_color_switch_W_V2:
+	setarg LIGHT_CMD_LIGHT_CTL_V2
+	store 2, mem_ble_v2_cmd
+	jam 0, mem_ble_v2_para
+	jam LIGHT_CMD_FTD_COLOR_SWTICH_RESERVED, mem_ble_v2_para+1
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+2
+	branch frmt_ble_v2_encoder_pack
+
+frmt_light_color_switch_Y_V2:
+	setarg LIGHT_CMD_LIGHT_CTL_V2
+	store 2, mem_ble_v2_cmd
+	jam 0, mem_ble_v2_para
+	jam LIGHT_CMD_FTD_COLOR_SWTICH_RESERVED, mem_ble_v2_para+1
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack
+
+frmt_light_aid_turn_off_V2:
+	setarg LIGHT_CMD_AIDED_LIGHT_TURN_OFF_V2
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0
+
+frmt_light_aid_turn_on_V2:
+	setarg LIGHT_CMD_AIDED_LIGHT_TURN_ON_V2
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0
+
+frmt_light_pcnt_100_percent_V2:
+	setarg LIGHT_CMD_LIGHT_CTL_V2
+	store 2, mem_ble_v2_cmd
+	jam 0, mem_ble_v2_para
+	jam 0x02, mem_ble_v2_para+1
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+2
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack
+
+frmt_light_pcnt_50_percent_V2:
+	setarg LIGHT_CMD_LIGHT_CTL_V2
+	store 2, mem_ble_v2_cmd
+	jam 0, mem_ble_v2_para
+	jam 0x01, mem_ble_v2_para+1
+	jam LIGHT_FTD_DATA_PART_PCNT_50PERCENT, mem_ble_v2_para+2
+	jam LIGHT_FTD_DATA_PART_PCNT_50PERCENT, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack
+
+frmt_light_rgb_circulation_1f_V2:
+	setarg LIGHT_CMD_RGB_AUTO_TURN_OFF_V2
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0
+
+frmt_light_rgb_circulation_1e_V2:
+	setarg LIGHT_CMD_RGB_AUTO_TURN_ON_V2
+	branch frmt_ble_v2_encoder_with_cmd_store_and_para_set0
+
+frmt_light_rgb_manual0_V2:
+	setarg LIGHT_CMD_RGB_MANUAL_V2
+	store 2, mem_ble_v2_cmd
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+1
+	branch frmt_ble_v2_encoder_pack
+	
+frmt_light_rgb_manual1_V2:
+	setarg LIGHT_CMD_RGB_MANUAL_V2
+	store 2, mem_ble_v2_cmd
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+2
+	branch frmt_ble_v2_encoder_pack
+
+frmt_light_rgb_manual2_V2:
+	setarg LIGHT_CMD_RGB_MANUAL_V2
+	store 2, mem_ble_v2_cmd
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack
+	
+frmt_light_rgb_manual3_V2:
+	setarg LIGHT_CMD_RGB_MANUAL_V2
+	store 2, mem_ble_v2_cmd
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+1
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+2
+	branch frmt_ble_v2_encoder_pack	
+	
+frmt_light_rgb_manual4_V2:
+	setarg LIGHT_CMD_RGB_MANUAL_V2
+	store 2, mem_ble_v2_cmd
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+1
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack	
+
+frmt_light_rgb_manual5_V2:
+	setarg LIGHT_CMD_RGB_MANUAL_V2
+	store 2, mem_ble_v2_cmd
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+2
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack		
+
+frmt_light_rgb_manual6_V2:
+	setarg LIGHT_CMD_RGB_MANUAL_V2
+	store 2, mem_ble_v2_cmd
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+1
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+2
+	jam LIGHT_DATA_PART_FF, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack	
+
+frmt_light_timing_1min_V2:
+	setarg 0x01
+frmt_light_timing_off_common_V2:
+	jam PRODUCT_MAINTYPE_LIGHT,mem_ble_v2_maintype
+	store 2, mem_ble_v2_para+1
+	setarg CMD_TIMING_OFF
+	store 2, mem_ble_v2_cmd
+	jam 0, mem_ble_v2_para
+	jam 0, mem_ble_v2_para+3
+	branch frmt_ble_v2_encoder_pack
+
+frmt_light_timing_30s_V2:
+	setarg 0
+	branch frmt_light_timing_off_common_V2
+
+frmt_light_group1_on_V2:
+	jam 1, mem_ble_v2_group_index
+	branch frmt_light_turn_on_common	
+	
+frmt_light_group2_on_V2:
+	jam 2, mem_ble_v2_group_index
+	branch frmt_light_turn_on_common	
+	
+frmt_light_group3_on_V2:
+	jam 3, mem_ble_v2_group_index
+	branch frmt_light_turn_on_common	
+
+frmt_light_group4_on_V2:
+	jam 4, mem_ble_v2_group_index
+	branch frmt_light_turn_on_common
+
+frmt_light_group1_off_V2:
+	jam 1, mem_ble_v2_group_index
+	branch frmt_light_turn_off_common	
+	
+frmt_light_group2_off_V2:
+	jam 2, mem_ble_v2_group_index
+	branch frmt_light_turn_off_common	
+	
+frmt_light_group3_off_V2:
+	jam 3, mem_ble_v2_group_index
+	branch frmt_light_turn_off_common	
+
+frmt_light_group4_off_V2:
+	jam 4, mem_ble_v2_group_index
+	branch frmt_light_turn_off_common
+
+
+
Index: program/app_light/remoter/frmt_fml_remoter_main.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_main.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_main.prog	(working copy)
@@ -0,0 +1,401 @@
+
+
+frmt_main:
+	bpatchx patch30_7,mem_patch30
+	call frmt_kscan_init
+	call frmt_kscan	
+	fetch 8, mem_kscan_record_keypress
+	ncall frmt_kscan_available, blank
+// 	call ice_break
+	call frmt_judge_reset_last_key
+
+	fetch 1, mem_light_release_adv_flag
+	ncall p_light_released_cb, blank
+
+	call frmt_kscan_keypress_analysis_process
+
+	fetch 1, mem_le_adv_enable
+	call frmt_light_indicator_led_flag_set0, blank
+	
+	fetch 1, mem_indicator_turn_on_enable
+	ncall frmt_light_indicator_led, blank
+
+	fetch 1, mem_indicator_turn_on_enable
+	call frmt_light_indicator_led_off, blank
+
+	bpatchx patch31_0,mem_patch31
+
+// 	rtn		
+	branch frmt_app_enter_lpm 
+
+frmt_kscan_keypress_analysis_process:
+	bpatchx patch31_1,mem_patch31
+
+	fetch 1,mem_special_agreemeet_enable
+	sub pdata,1,null
+	call frmt_light_gem_long_press_cnt,zero
+//	fetch 2, mem_long_press_adv_timeout
+//	nrtn blank
+	fetch 8, mem_kscan_record_keypress
+// 	call ice_break
+	rtn blank
+	
+	setarg 0    //clear data part (3 Bytes)
+	store 3, mem_FTD_adv_raw_data
+	store 4, mem_ble_v2_para
+	jam 0, mem_FTD_adv_raw_reserved
+
+	fetch 1, mem_light_release_adv_flag
+	ncall p_light_released_cb, blank
+
+	fetch 2,mem_rmt_keydown_cb
+	branch callback_func
+
+	//branch p_frmt_kscan_keypress_combination_key			//组合键功能
+
+p_light_released_cb:
+	fetch 2,mem_rmt_released_cb
+	branch callback_func
+
+
+frmt_get_current_key:				//获得键值
+	bpatchx patch31_2,mem_patch31
+
+	fetch 8, mem_kscan_record_keypress
+	copy pdata, temp   
+	arg KEYBOARD_MAX_KEYS_NUM, loopcnt
+	arg 0, queue
+	call frmt_kscan_keypress_analysis_get_keypress   //queue is the key num
+	deposit queue   //copy queue to pdata
+	store 1, mem_light_current_key
+	setarg 0
+	store 8, mem_kscan_record_keypress
+	bpatchx patch31_3,mem_patch31
+	branch frmt_light_set_continuous_kps_cnt_reset_timeout    //, blank
+	
+
+frmt_judge_reset_last_key:
+	fetch 1, mem_keypress_analysis_flag
+	nrtn blank
+	
+	jam 0, mem_light_last_key
+	jam 0, mem_light_color_and_lgtness_long_press_adv_enable
+frmt_light_long_press_judge_reset:
+	setarg 0
+	store 2, mem_long_press_timeout
+	store 2,mem_gem_cnt_inces_timeout
+	rtn
+	
+frmt_kscan_keypress_analysis_get_keypress:
+	qisolate1 pdata  
+	rtn true
+	increase 1, queue
+	loop frmt_kscan_keypress_analysis_get_keypress
+	rtn 	
+
+frmt_kscan_available:
+	jam 1, mem_keypress_analysis_flag
+
+	jam 1, mem_indicator_turn_on_enable
+	setarg KEY_PRESS_LED_ON_TIME
+	store 2, mem_indicator_led_turn_on_timeout
+	jam KSCAN_ANALYSIS_INTERVAL, mem_kscan_analysis_interval_timeout
+	rtn
+
+
+frmt_light_indicator_led_flag_set0:
+	bpatchx patch31_4,mem_patch31
+	fetch 1, mem_keypress_analysis_flag
+	nrtn blank
+frmt_light_indicator_led_flag_set0_process:	
+	setarg 0
+	store 2, mem_indicator_led_turn_on_timeout
+	jam 0, mem_indicator_turn_on_enable
+	bpatchx patch31_5,mem_patch31
+	rtn
+
+frmt_light_indicator_led:		
+	bpatchx patch31_6,mem_patch31
+	fetch 1, mem_light_indicator_led
+	rtn blank
+frmt_light_indicator_led_debug:	
+	fetcht 1, mem_light_indicator_led
+	branch gpio_config_output_patch
+	
+
+frmt_light_indicator_led_off:
+	bpatchx patch31_7,mem_patch31
+	fetch 1, mem_light_indicator_led
+	rtn blank
+frmt_light_indicator_led_off_debug:
+	fetcht 1, mem_light_indicator_led
+	or temp, 0x80, temp
+	branch gpio_config_output_patch
+
+
+/************************************低功耗************************************/
+
+frmt_app_enter_lpm:	
+	fetch 2, mem_light_lpm_enable_timeout   
+	nrtn blank
+	fetch 2, mem_indicator_led_turn_on_timeout   
+	nrtn blank
+	bpatchx patch32_0,mem_patch32
+	call frmt_enter_lpm_gpio_config
+frmt_app_enter_lpm_1:
+	call frmt_wakeup_low_config
+
+	bpatchx patch32_1,mem_patch32
+	arg -1, temp   //
+	branch lpm_sleep
+
+/*
+1306AB:
+SDA：gpio0
+SCL：gpio1
+WP：gpio2
+ice: gpio19
+除开上面的IO, 其他没有被使用到矩阵键盘的IO下拉。
+*/
+frmt_enter_lpm_gpio_config:
+	bpatchx patch32_2,mem_patch32
+	arg ENTER_LPM_LEISURE_IO_CONFIG_NUM, loopcnt  //避开0,1,2, 19,4个IO 
+	jam ENTER_LPM_LEISURE_IO_CONFIG_START, mem_light_lpm_gpio_config_io_temp   //跳过012,3个IO.iic,wp.
+frmt_drop_down_unused_io_loopcnt:
+	fetcht 1, mem_light_lpm_gpio_config_io_temp
+	copy temp, queue
+	fetch 4, mem_light_lpm_gpio_config_flag    //为1不处理（说明IO被使用）
+	qisolate1 pdata
+	branch frmt_drop_down_unused_io_loopcnt_no_drop_down, true
+	or temp, 0x80, temp
+	call gpio_config_input
+frmt_drop_down_unused_io_loopcnt_no_drop_down:
+	fetch 1, mem_light_lpm_gpio_config_io_temp
+	pincrease 1
+	store 1, mem_light_lpm_gpio_config_io_temp
+	loop frmt_drop_down_unused_io_loopcnt
+	jam gpcfg_pullup, core_gpio13_conf
+	rtn
+
+frmt_wakeup_low_config:
+	bpatchx patch32_3,mem_patch32
+	fetcht 1, mem_kscan_row_nums
+	copy temp, rega
+	arg 0, regb
+	arg 0, temp
+	storet 8, mem_gpio_wakeup_low	
+	arg mem_kscan_row_gpio_pin, contr
+	call frmt_wakeup_low_config_loop
+	set1 13,temp
+	storet 4, mem_gpio_wakeup_low
+	rtn
+
+frmt_wakeup_low_config_loop:
+	ifetch 1, contr
+	iforce queue
+	qset1 temp
+
+	increase 1, regb
+	deposit rega
+	isub regb, null
+	rtn zero
+	branch frmt_wakeup_low_config_loop
+
+
+
+/************************************发包************************************/
+
+frmt_le_send_adv_ind:
+// call ice_break
+	bpatchx patch32_4,mem_patch32
+	fetch 1,mem_special_agreemeet_enable
+	beq 2,key_le_send_adv_ind
+	fetch 1,mem_ble_v2_customer_id
+	nbranch frmt_send_id1_v2,blank
+frmt_judge_send_id1_v1:
+	fetch 1,mem_special_agreemeet_enable
+	beq 1,frmt_send_id1_v1
+	fetch 1,mem_light_manufacture_id
+	nbranch frmt_send_id1_v1,blank
+frmt_judge_send_id2_v1:
+	fetch 1,mem_light_manufacture_id2
+	nbranch frmt_send_id2_v1,blank
+frmt_judge_send_id2_v2:
+	fetch 1,mem_light_manufacture_id2_v2
+	nbranch frmt_send_id2_v2,blank
+frmt_id_flag_set0:
+	setarg 0
+	store 4,mem_adv_manufacturer_switch_flag
+//	store 1,mem_adv_manufacturer_switch_flag1
+//	store 1,mem_adv_manufacturer_switch_flag2
+//	store 1,mem_adv_manufacturer_switch_flag3
+	rtn
+frmt_le_send_adv_ind_pdu1:	
+	bpatchx patch32_5,mem_patch32
+// 	jam 05,mem_light_whitening_buffer+2
+	arg FTD_PDU_LEN, loopcnt                	
+	arg mem_le_txheader, contw                 
+	arg mem_light_whitening_buffer, contr
+	call memcpy_fast
+	branch le_send_adv_transmit
+
+frmt_le_send_adv_ind_v2:
+	bpatchx patch32_6,mem_patch32
+	arg FTD_PDU_LEN, loopcnt                	
+	arg mem_le_txheader, contw                 
+	arg mem_ble_v2_pdu, contr
+	call memcpy_fast
+	branch le_send_adv_transmit
+
+frmt_le_send_adv_ind_pdu2:
+	bpatchx patch32_7,mem_patch32
+	arg FTD_PDU_LEN, loopcnt                
+	arg mem_le_txheader, contw                 
+	arg mem_light_whitening_buffer_2, contr
+	call memcpy_fast
+	branch le_send_adv_transmit
+
+frmt_le_send_adv_ind_v2_2:
+	bpatchx patch33_0,mem_patch33
+	arg FTD_PDU_LEN, loopcnt                	
+	arg mem_le_txheader, contw                 
+	arg mem_ble_v2_pdu_2, contr
+	call memcpy_fast
+	branch le_send_adv_transmit
+
+frmt_send_id1_v2:
+	bpatchx patch33_1,mem_patch33
+	fetch 1, mem_adv_manufacturer_switch_flag
+	beq 3,frmt_judge_send_id1_v1	
+	pincrease 1
+	store 1, mem_adv_manufacturer_switch_flag
+	branch frmt_le_send_adv_ind_v2
+
+frmt_send_id1_v1:
+	bpatchx patch33_2,mem_patch33
+
+	fetch 1, mem_adv_manufacturer_switch_flag1
+	beq 3,frmt_judge_send_id2_v1	
+	pincrease 1
+	store 1, mem_adv_manufacturer_switch_flag1
+	fetch 1,mem_special_agreemeet_enable
+	beq 1,gem_le_send_adv_ind
+	branch frmt_le_send_adv_ind_pdu1
+
+frmt_send_id2_v1:
+	bpatchx patch33_3,mem_patch33
+
+	fetch 1, mem_adv_manufacturer_switch_flag2
+	beq 3,frmt_judge_send_id2_v2	
+	pincrease 1
+	store 1, mem_adv_manufacturer_switch_flag2
+	branch frmt_le_send_adv_ind_pdu2
+
+frmt_send_id2_v2:
+	bpatchx patch33_4,mem_patch33
+
+	fetch 1, mem_adv_manufacturer_switch_flag3
+	beq 3,frmt_id_flag_set0	
+	pincrease 1
+	store 1, mem_adv_manufacturer_switch_flag3
+	branch frmt_le_send_adv_ind_v2_2
+
+gem_le_send_adv_ind:
+	arg GEM_PDU_LEN, loopcnt                   
+	arg mem_le_txheader, contw       
+	arg mem_light_whitening_buffer, contr   
+	call memcpy_fast
+	branch le_send_adv_transmit
+
+key_le_send_adv_ind:					//科云
+// call ice_break
+	fetch 1, mem_adv_cnts
+	pincrease 1
+	store 1, mem_adv_cnts
+	sub pdata,3,null
+	branch frmt_le_send_adv_ind_v2,positive
+	sub pdata, 6, null
+	branch key_le_send_adv_ind_KY1, positive
+	sub pdata, 9, null
+	branch key_le_send_adv_ind_KY,positive
+	setarg 0
+	store 1,mem_adv_cnts
+	branch frmt_le_send_adv_ind_v2
+	
+key_le_send_adv_ind_KY1:
+	arg KEY_PDU_LEN, loopcnt                   
+	arg mem_le_txheader, contw       
+	arg mem_light_JYM_tx_temp, contr   
+	call memcpy_fast
+	branch le_send_adv_transmit
+key_le_send_adv_ind_KY:	
+	arg KEY_PDU_LEN, loopcnt                   
+	arg mem_le_txheader, contw       
+	arg mem_light_whitening_buffer, contr   
+	call memcpy_fast
+	branch le_send_adv_transmit
+
+	
+/************************************通道************************************/
+frmt_le_next_adv_channel:
+	bpatchx patch33_5,mem_patch33
+
+	fetch 1,mem_channel_num
+	call frmt_channel_num_init,blank
+	
+//	fetch 1,mem_channel_num
+	isolate1 0,pdata
+	branch frmt_le_next_adv_channel_37,true
+
+//	fetch 1,mem_channel_num
+	isolate1 1,pdata
+	branch frmt_le_next_adv_channel_38,true
+
+//	fetch 1,mem_channel_num
+	isolate1 2,pdata
+	branch frmt_le_next_adv_channel_39,true	
+	rtn
+
+frmt_channel_num_init:
+	fetch 1,mem_channel_enable
+	store 1,mem_channel_num
+	rtn
+
+
+frmt_le_next_adv_channel_37:
+	bpatchx patch33_6,mem_patch33
+
+	fetch 1,mem_channel_num
+	set0 0,pdata
+	store 1,mem_channel_num
+	fetcht 1,mem_le_adv_channel_map
+	set1 BIT_ADV_CHANNEL_MAP_37,temp
+	storet 1, mem_le_adv_channel_map
+	jam 37, mem_le_ch_mapped
+	branch le_next_adv_channel+1
+
+frmt_le_next_adv_channel_38:
+	bpatchx patch33_7,mem_patch33
+
+	fetch 1,mem_channel_num
+	set0 1,pdata
+	store 1,mem_channel_num
+	fetcht 1,mem_le_adv_channel_map
+	set1 BIT_ADV_CHANNEL_MAP_38,temp
+	storet 1, mem_le_adv_channel_map
+	jam 38, mem_le_ch_mapped
+	branch le_next_adv_channel+1
+
+frmt_le_next_adv_channel_39:
+	bpatchx patch34_0,mem_patch34
+
+	fetch 1,mem_channel_num
+	set0 2,pdata
+	store 1,mem_channel_num
+	fetcht 1,mem_le_adv_channel_map
+	set1 BIT_ADV_CHANNEL_MAP_39,temp
+	storet 1, mem_le_adv_channel_map
+	jam 39, mem_le_ch_mapped
+	branch le_next_adv_channel+1
+
+	
Index: program/app_light/remoter/frmt_fml_remoter_obfuscate.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_obfuscate.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_obfuscate.prog	(working copy)
@@ -0,0 +1,445 @@
+
+
+frmt_adv_rear_6bytes_and_whitening_and_set_PDU_common_short_press:
+	call frmt_light_set_PDU_common_short_press
+	branch frmt_adv_rear_6bytes_and_whitening
+
+frmt_light_set_PDU_common_short_press:
+	bpatchx patch34_1,mem_patch34
+	call frmt_light_flag_set_short_press
+frmt_light_set_PDU_packet_num_and_addr:
+	bpatchx patch34_2,mem_patch34
+	fetch 1, mem_FTD_adv_raw_packet_num
+	pincrease 1
+	store 1, mem_FTD_adv_raw_packet_num
+
+	fetch 1,mem_ble_v2_maintype
+	sub pdata,3,null
+	call frmt_fan_lamp,zero
+	fetch 1,mem_ble_v2_maintype
+	sub pdata,5,null
+	call frmt_solar_lamp,zero
+	branch frmt_light_groups_address_set
+	
+frmt_fan_lamp:
+	jam 0x83, mem_FTD_adv_raw_data+2
+	rtn
+frmt_solar_lamp:
+	jam 0x88, mem_FTD_adv_raw_data+2
+	rtn
+	
+frmt_light_flag_set_short_press:
+// call ice_break
+	bpatchx patch34_3,mem_patch34
+	jam 1, mem_le_adv_enable
+	jam KEY_PRESS_LED_ON_TIME, mem_indicator_led_turn_on_timeout
+	jam 1, mem_indicator_turn_on_enable
+	fetch 2,mem_light_adv_time
+	store 2, mem_ble_light_adv_timeout
+	pincrease 1
+	store 2, mem_light_lpm_enable_timeout
+	rtn
+frmt_light_groups_address_set:   
+	bpatchx patch34_4,mem_patch34
+	fetch 1, mem_FTD_adv_raw_device_add_temp+1
+	arg 0xf0, temp
+	iand temp,pdata
+	fetcht 1,mem_groups_num
+	iadd temp, pdata
+	store 1, mem_FTD_adv_raw_device_add_temp+1
+	fetch 2, mem_FTD_adv_raw_device_add_temp
+	store 2, mem_FTD_adv_raw_device_add
+	rtn
+	
+/*
+pdu的白化和协议后六个bytes的混淆处理。
+*/
+
+
+
+frmt_adv_rear_6bytes_and_whitening:
+// call ice_break
+	bpatchx patch34_5,mem_patch34
+	fetch 1,mem_light_manufacture_id
+	ncall frmt_adv_rear_6bytes_and_whitening_pdu2,blank
+
+	fetch 1, mem_FTD_adv_raw
+	sub pdata, LIGHT_CMD_PAIRING_CODE, null
+	call frmt_light_pdu1_manufacturer_id_set, zero
+
+	call frmt_adv_rear_6bytes
+	arg mem_adv_packet_payload, contw 
+	arg mem_FTD_adv_raw, contr 
+	arg 14, loopcnt              
+	call memcpy_fast 	
+
+	arg FTD_PDU_LEN, loopcnt
+	arg mem_adv_packet, contr
+	arg mem_light_whitening_buffer, contw
+	call memcpy_fast
+
+	jam FTD_PDU_LEN, mem_light_recvd_len
+
+	jam 83, mem_light_whitening_i     //channel 37
+
+	call frmt_light_reverse_and_BLE_whitening
+// 	call ice_break
+	fetch 1, mem_light_manufacture_id
+	store 1, mem_light_whitening_buffer+10
+	bpatchx patch34_6,mem_patch34
+	rtn
+
+frmt_light_pdu1_manufacturer_id_set:
+	fetch 1, mem_light_manufacture_id
+	store 1, mem_FTD_adv_raw_reserved
+	rtn
+
+frmt_adv_rear_6bytes_and_whitening_pdu2:
+	bpatchx patch34_7,mem_patch34
+
+	fetch 1, mem_FTD_adv_raw
+	sub pdata, LIGHT_CMD_PAIRING_CODE, null
+	call frmt_light_pdu2_manufacturer_id_set, zero
+
+	call frmt_adv_rear_6bytes
+	arg mem_adv_packet_payload, contw 
+	arg mem_FTD_adv_raw, contr 
+	arg 14, loopcnt              
+	call memcpy_fast 	
+	
+	arg FTD_PDU_LEN, loopcnt
+	arg mem_adv_packet, contr
+	arg mem_light_whitening_buffer, contw
+	call memcpy_fast
+	
+	jam FTD_PDU_LEN, mem_light_recvd_len
+	jam 83, mem_light_whitening_i
+	call frmt_light_reverse_and_BLE_whitening
+	
+	arg FTD_PDU_LEN, loopcnt
+	arg mem_light_whitening_buffer, contr
+	arg mem_light_whitening_buffer_2, contw
+	call memcpy_fast
+	
+	fetch 1, mem_light_manufacture_id2
+	store 1, mem_light_whitening_buffer_2+10
+// 	call ice_break
+	rtn
+frmt_light_pdu2_manufacturer_id_set:
+	fetch 1, mem_light_manufacture_id2
+	store 1, mem_FTD_adv_raw_reserved
+	rtn
+	
+// frmt_fml_whitening_buffer_bytes_reverse:
+// 	arg mem_light_whitening_buffer, contr
+// 	arg mem_light_whitening_buffer, contw
+// 	arg FTD_PDU_LEN, loopcnt
+// frmt_fml_bytes_reverse_loop:
+// 	ifetch 1, contr
+// 	reverse pdata, pdata
+// 	istore 1, contw
+// 	loop frmt_fml_bytes_reverse_loop
+// 	rtn	
+frmt_adv_rear_6bytes:	
+	bpatchx patch35_0,mem_patch35
+
+	jam 1, mem_FTD_adv_raw+8
+
+	jam 0, mem_FTD_adv_raw+9
+	random pdata   
+	rshift8 pdata, temp
+	storet 1, mem_FTD_adv_raw+10 
+	store 1, mem_FTD_adv_raw+11
+	invert pdata, pdata
+	store 2, mem_adv_CRC_False_initValue
+	fetch 1, mem_FTD_adv_raw+11     //add, at 20200107
+	fetcht 1, mem_FTD_adv_raw+8
+	ixor temp, pdata
+	store 1, mem_FTD_adv_raw+8
+	fetcht 1, mem_FTD_adv_raw+9
+	ixor temp, pdata
+	store 1, mem_FTD_adv_raw+9
+//param:mem_adv_CRC_False_initValue
+frmt_CRC16_CCITT_False_FTD:
+	bpatchx patch35_1,mem_patch35
+
+	arg mem_FTD_adv_raw, regc 
+// 	call ice_break
+	arg 0x0c, loopcnt
+	call frmt_CRC16_CCITT_False_choose
+
+	fetch 2, mem_adv_CRC_False_initValue  
+	arg 0xff00, rega
+	iand rega, temp
+	rshift8 temp, temp
+	storet 1, mem_FTD_adv_raw+12
+	fetch 1, mem_adv_CRC_False_initValue
+	store 1, mem_FTD_adv_raw+13
+// 	call ice_break
+	rtn 
+
+frmt_CRC16_CCITT_False_choose:
+	fetch 1,mem_special_agreemeet_enable
+	beq 2,key_CRC16_CCITT_False1
+	branch frmt_CRC16_CCITT_False
+	
+/************************************crc16 CCIT************************************/
+
+
+frmt_CRC16_CCITT_False:
+	bpatchx patch35_2,mem_patch35
+	ifetcht 1, regc
+	lshift8 temp, temp
+	fetch 2, mem_adv_CRC_False_initValue
+	ixor temp, temp
+	arg 0x0, queue
+	call frmt_CRC16_deal_next_8bits
+	storet 2, mem_adv_CRC_False_initValue
+	increase 1, regc
+	loop frmt_CRC16_CCITT_False	
+	rtn
+
+frmt_CRC16_deal_next_8bits:
+	copy temp, pdata    //temp:crc Value
+	rshift8 pdata, rega
+	rshift4 rega, rega
+	rshift3 rega, rega
+	lshift pdata, temp
+	copy rega, pdata
+	ncall frmt_CRC16_xor_ploy, blank
+	increase 1, queue
+	copy queue, pdata
+	bne 0x08, frmt_CRC16_deal_next_8bits
+	rtn 
+	
+frmt_CRC16_xor_ploy:
+	fetch 2, mem_CRC16_polynomial
+	copy pdata, rega
+	copy temp, pdata
+	ixor rega, pdata
+	arg 0xffff, rega
+	iand rega, temp
+	rtn
+
+
+key_CRC16_CCITT_False1:
+	bpatchx patch35_3,mem_patch35
+	fetch 2, mem_adv_CRC_False_initValue //pdata crc
+	
+key_CRC16_CCITT_False_loop:
+	ifetcht 1, regc
+	increase 1, regc
+	reverse temp, temp
+	lshift8 temp, temp
+	ixor temp,pdata
+	
+key_CRC16_for_byte:
+	copy loopcnt,regb		
+	arg 8,loopcnt
+key_CRC16_for_byte_loop:
+	isolate1 15,pdata
+	lshift pdata,pdata
+	nbranch key_CRC16_for_byte_continue,true
+	fetcht 2, mem_CRC16_polynomial
+	ixor temp,pdata
+key_CRC16_for_byte_continue:
+	loop key_CRC16_for_byte_loop
+	copy regb,loopcnt
+	
+	loop key_CRC16_CCITT_False_loop
+	store 2,mem_adv_CRC_False_initValue
+	fetcht 1, mem_adv_CRC_False_initValue
+	reverse temp, temp
+	fetch 1, mem_adv_CRC_False_initValue+1
+	reverse pdata, pdata
+	storet 1, mem_adv_CRC_False_initValue+1  //交叉着存
+	store 1, mem_adv_CRC_False_initValue
+	rtn
+
+
+
+/************************************crc16 CCIT************************************/
+
+/*
+接收端使用
+*/
+frmt_light_BLE_whitening_and_reverse:
+	bpatchx patch35_4,mem_patch35
+	call frmt_light_BLE_whitening
+	branch frmt_fml_whitening_buffer_bytes_reverse
+
+
+/*
+发射端使用
+*/
+frmt_light_reverse_and_BLE_whitening:
+	bpatchx patch35_5,mem_patch35
+
+	call frmt_fml_whitening_buffer_bytes_reverse
+	branch frmt_light_BLE_whitening
+
+//para:mem_light_recvd_len
+//para:mem_light_whitening_i
+/***********************************************
+jam 115, mem_light_whitening_i     //channel 39
+jam 51, mem_light_whitening_i     //channel 38
+jam 83, mem_light_whitening_i     //channel 37
+***********************************************/
+// frmt_light_ble_whitening:
+// frmt_light_for_loop_end_with_len:
+// 	jam 0, mem_light_for_loop_cnt1
+// frmt_light_for_loop_end_with_len_loop:
+// 	setarg 0
+// 	store 2, mem_light_whitening_k
+// 	call frmt_light_for_loop_8_times
+
+// 	fetcht 1, mem_light_whitening_k
+// 	fetch 1, mem_light_for_loop_cnt1
+// 	arg mem_light_whitening_buffer, contw
+// 	iadd contw, contw
+// 	istoret 1, contw	
+
+// 	fetcht 1, mem_light_for_loop_cnt1
+// 	increase 1, temp
+// 	storet 1, mem_light_for_loop_cnt1
+// 	fetch 1, mem_light_recvd_len
+// 	isub temp, null
+// 	branch frmt_light_for_loop_end_with_len_loop, positive
+// // 	call ice_break
+// 	rtn
+
+// //通过i得到n；通过n得到i1；通过i1得到k；调出for(8)循环,取最终k得到原始数据。	
+// frmt_light_for_loop_8_times:
+// 	//call ice_break
+// 	jam 0, mem_light_for_loop_cnt2
+// frmt_light_for_loop_8_times_loop:
+// 	fetch 1, mem_light_whitening_i
+// 	store 1, mem_light_whitening_n
+// 	lshift pdata, pdata
+// 	store 4, mem_light_whitening_i2
+// 	iforce rega
+// 	rshift3 pdata, pdata
+// 	rshift4 pdata, pdata
+// 	and pdata, 1, temp
+// 	storet 4, mem_light_whitening_i3
+// 	fetch 4, mem_light_para1    //0xFFFFFFFE
+// 	iand rega, pdata
+// 	ior temp, pdata
+// 	store 4, mem_light_whitening_i4
+// 	lshift4 temp, temp
+// 	ixor temp, rega
+// 	and rega, 0x10,rega
+// 	fetcht 4, mem_light_para2   //0xFFFFFFEF ;  pdata:mem_light_whitening_i4
+// 	iand temp, pdata
+// 	ior rega, pdata
+// 	store 1, mem_light_whitening_i     //只需要store 1
+
+// 	fetch 1, mem_light_whitening_n
+// 	and pdata, 0x40, pdata
+// 	rshift3 pdata, pdata
+// 	rshift3 pdata, temp
+// 	storet 1, mem_light_whitening_i1
+// 	fetch 1, mem_light_for_loop_cnt2
+// 	call frmt_light_i1_lshift    //return temp
+
+// 	fetch 1, mem_light_for_loop_cnt1    //外循环的循环变量
+// 	arg mem_light_whitening_buffer, contr
+// 	iadd contr, contr
+// 	ifetch 1, contr
+// // ifdef FTD_PROTOCOL
+// // 	reverse pdata, pdata
+// // endif	
+
+// 	ixor temp, temp
+// 	fetch 1, mem_light_for_loop_cnt2
+// 	arg mem_light_integer_1_lshift_temp, contr
+// 	iadd contr, contr
+// 	ifetch 1, contr
+// 	iand temp, pdata
+// 	fetcht 2,  mem_light_whitening_k
+// 	ior temp, pdata
+// 	store 2, mem_light_whitening_k
+// 	
+// 	fetch 1, mem_light_for_loop_cnt2
+// 	pincrease 1
+// 	store 1, mem_light_for_loop_cnt2
+// 	bbit0 3, frmt_light_for_loop_8_times_loop
+// 	rtn
+
+// //pdata:  value of mem_light_for_loop_cnt2
+// //temp :  value of mem_light_whitening_i1
+// frmt_light_i1_lshift:
+// 	arg mem_light_for_loop_lshift,contr 
+// 	iadd contr,contr
+// 	ifetch 1,contr
+// 	and pdata,0x0f,loopcnt
+// frmt_light_i1_lshift_loop:	
+// 	sub loopcnt,0,null
+// 	rtn zero
+// 	lshift temp,temp
+// 	loop frmt_light_i1_lshift_loop
+// 	rtn
+
+
+frmt_fml_whitening_buffer_bytes_reverse:
+	bpatchx patch35_6,mem_patch35
+
+	arg mem_light_whitening_buffer, contr
+	arg mem_light_whitening_buffer, contw
+	arg FTD_PDU_LEN, loopcnt
+	branch frmt_fml_bytes_reverse_loop
+
+frmt_light_BLE_whitening:
+	bpatchx patch35_7,mem_patch35
+
+	arg FTD_PDU_LEN, loopcnt
+	arg mem_light_whitening_buffer, regc
+	arg 83, regb
+	fetch 1,mem_special_agreemeet_enable
+	sub pdata,2,null
+	call key_whitening_i_get,zero
+	branch frmt_ble_whitening
+
+frmt_fml_bytes_reverse_loop:
+	bpatchx patch36_0,mem_patch36
+
+	ifetch 1, contr
+	reverse pdata, pdata
+	istore 1, contw
+	loop frmt_fml_bytes_reverse_loop
+	rtn	
+/*
+loopcnt:length
+regc:pointer of whitening data
+regb:white init(seed)
+*/
+frmt_ble_whitening:
+
+frmt_ble_whitening_loop:
+	bpatchx patch36_1,mem_patch36
+	call frmt_ble_whitening_byte
+	increase 1, regc
+	loop frmt_ble_whitening_loop
+	rtn
+frmt_ble_whitening_byte:
+	bpatchx patch36_2,mem_patch36
+	arg 1, rega     //rega is m
+frmt_ble_whitening_byte_loop:
+	lshift regb, regb    //regb is seed
+	isolate1 7, regb
+	call frmt_ble_whitening_byte_xor, true
+	lshift rega, rega
+	deposit rega
+	rtnbit1 8
+	branch frmt_ble_whitening_byte_loop
+	
+frmt_ble_whitening_byte_xor:	
+	bpatchx patch36_3,mem_patch36
+	ifetch 1,regc
+	ixor rega, pdata
+	istore 1, regc
+	xor regb, 0x11, regb
+	rtn
+
+
+
Index: program/app_light/remoter/frmt_fml_remoter_timer.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_timer.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_light/remoter/frmt_fml_remoter_timer.prog	(working copy)
@@ -0,0 +1,99 @@
+
+
+frmt_apl_cb_event_timer:
+	fetch 1,mem_special_agreemeet_enable
+	sub pdata,1,null
+	call p_light_gem_long_press_cnt_timer,zero
+	call frmt_light_reset_continuous_kps_cnt_timer
+	call frmt_light_kscan_analysis_interval_timer
+	call frmt_light_le_adv_timer
+	call frmt_light_long_press_timer
+//	call frmt_light_long_press_adv_timer
+	call frmt_light_indicator_led_timer
+	call frmt_light_enter_lpm_timer
+	call frmt_light_color_and_lightness_long_press_timer
+	bpatchx patch36_4,mem_patch36
+	rtn
+
+frmt_light_kscan_analysis_interval_timer:  //100ms
+	arg mem_kscan_analysis_interval_timeout,regc
+	arg frmt_light_kscan_analysis_interval_timeout, regb
+	branch timer_single_step_2B
+frmt_light_kscan_analysis_interval_timeout:
+	rtn	
+
+frmt_light_le_adv_timer:  
+	arg mem_ble_light_adv_timeout,regc
+	arg frmt_light_le_adv_time_timeout, regb
+	branch timer_single_step_2B
+frmt_light_le_adv_time_timeout:
+// call ice_break
+	jam 0, mem_le_adv_enable  
+	rtn
+
+//frmt_light_long_press_adv_timer:
+//	arg mem_long_press_adv_timeout,regc
+//	arg frmt_light_long_press_adv_timeout, regb
+//	branch timer_single_step_2B
+//frmt_light_long_press_adv_timeout:
+//	rtn
+
+frmt_light_indicator_led_timer:
+	arg mem_indicator_led_turn_on_timeout,regc
+	arg frmt_light_indicator_led_timer_timeout, regb
+	branch timer_single_step_2B
+
+frmt_light_indicator_led_timer_timeout:
+	jam 0, mem_indicator_turn_on_enable
+	rtn
+
+frmt_light_enter_lpm_timer:
+	arg mem_light_lpm_enable_timeout,regc
+	arg frmt_light_enter_lpm_timeout, regb
+	branch timer_single_step_2B
+frmt_light_enter_lpm_timeout:
+	rtn
+
+frmt_light_color_and_lightness_long_press_timer:
+	arg mem_light_short_keypress_timeout,regc
+	arg frmt_light_color_and_lightness_long_press_timeout, regb
+	branch timer_single_step_2B
+frmt_light_color_and_lightness_long_press_timeout:
+	jam 1, mem_light_color_and_lgtness_long_press_adv_enable
+	rtn
+	
+frmt_light_long_press_timer:
+	arg mem_long_press_timeout,regc
+	arg p_light_long_press_timeout_cb, regb
+	branch timer_single_step_2B
+
+frmt_light_reset_continuous_kps_cnt_timer:
+	arg mem_light_continuous_kps_cnt_reset_timeout,regc
+	arg p_light_reset_continuous_kps_cnt_timeout_cb, regb
+	branch timer_single_step_2B
+
+p_light_long_press_timeout_cb:
+	fetch 2,mem_rmt_long_press_cb
+	branch callback_func
+
+p_light_reset_continuous_kps_cnt_timeout_cb:
+	fetch 2,mem_rmt_continuous_keydown_cb
+	branch callback_func
+
+
+frmt_light_set_continuous_kps_cnt_reset_timeout:
+	fetch 2,mem_rmt_continuous_kps_time
+	store 2,mem_light_continuous_kps_cnt_reset_timeout
+	rtn
+
+p_light_gem_long_press_cnt_timer:
+	arg mem_gem_cnt_inces_timeout,regc
+	arg p_light_gem_long_press_cnt_timeout, regb
+	branch timer_single_step_2B
+p_light_gem_long_press_cnt_timeout:
+	fetch 2,mem_long_press_timeout
+	rtn blank
+	jam 1,mem_gem_long_cnt_enable
+	rtn
+
+
Index: program/app_mouse.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_mouse.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_mouse.prog	(working copy)
@@ -0,0 +1,4867 @@
+
+ifdef COMPILE_MOUSE
+mouse_init:
+	call enable_authrom
+	call mouse_setting_config
+	call mouse_init_sunt
+	rtn wake
+	call mouse_le_name_load		//config tool
+	call mouse_dpi_config
+	call mouse_drawing_optima_init
+	call mouse_cb_fuction
+	call mouse_sensor_powerdown
+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_short_sleep
+	store 2,mem_cb_24g_transmit_short_sleep
+	setarg mouse_24g_long_sleep
+	store 2,mem_cb_24g_transmit_long_sleep
+	setarg mouse_24g_before_lpm_sleep
+	store 2,mem_cb_before_lpm_sleep
+	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_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_set_lpm_mult
+	store 2,mem_cb_bt_set_mult
+	setarg mouse_le_parse_l2cap
+	store 2,mem_le_l2cap_parse_cb
+	rtn
+
+
+mouse_setting_config:
+	rtn wake
+	call g24_transmit_init
+	call g24_chmap_param_init
+	call mouse_24g_send_time_long_wake
+	call mouse_gpio_init
+	call mouse_param_init
+	call mouse_device_multi_led_poweron2s_init	
+	call mouse_double_dpi_judge
+	call mouse_firebutton_connect_state_check
+	call le_set_fixed_ltk_justwork
+	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 XTAL_16M,mem_fcomp_div		// 0x08--16M 
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_16M
+	jam XTAL_24M,mem_fcomp_div		// 0x18--24M
+	rtn
+
+mouse_24g_phy_select:
+	call g24_enable_1M
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_24G_2M_PHY
+	branch g24_enable_2M
+
+mouse_default_init:
+	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 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
+	call mouse_adc_vol_init
+mouse_default_init_next:
+	call mouse_24g_phy_select
+	call mouse_24g_long_sleep_set
+	branch g24_pair_param_init
+	
+mouse_param_init:
+	setarg MOUSE_BLE_ATT_LIST_ADDR				//ble attlist start address
+	store 2,mem_ui_le_uuid_table
+	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
+	setsect 0,0x1224
+	setsect 1,0x4000
+	setsect 2,0x0
+	istore 5,contw
+//======================================================	
+	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
+	setarg LE_INTERVAL_7_5MS
+	store 2,mem_le_interval_min
+	store 2,mem_le_interval_min+2
+mouse_param_init_intervl_end:
+	call mouse_g24_interval_param_8ms
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_24G_250Hz,mouse_24g_short_sleep_set_end
+	call mouse_g24_interval_param_4ms
+mouse_24g_short_sleep_set_end:
+	fetch 3,mem_24g_short_sleep_set
+	store 3,mem_mouse_24g_short_sleep_set_init
+	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_adv
+mouse_sensor_set_angle:
+	bpatch patch06_7,mem_patch06
+	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_g24_interval_param_4ms:
+	fetch 3,mem_mouse_24g_short_sleep_set_4ms
+	store 3,mem_24g_short_sleep_set
+	fetch 3,mem_mouse_24g_long_sleep_set_4ms
+	store 3,mem_24g_long_sleep_set
+	fetch 1,mem_mouse_24g_fast_hop_count_4ms
+	store 1,mem_24g_fast_hop_count
+	fetch 4,mem_mouse_24g_tsniff_4ms
+	store 4,mem_mouse_24g_tsniff	
+mouse_report_rate_set_250hz:
+	setarg 0x100c0c
+	store 3,mem_24g_interval
+	rtn
+
+mouse_g24_interval_param_8ms:
+	fetch 3,mem_mouse_24g_short_sleep_set_8ms
+	store 3,mem_24g_short_sleep_set
+	fetch 3,mem_mouse_24g_long_sleep_set_8ms
+	store 3,mem_24g_long_sleep_set
+	fetch 1,mem_mouse_24g_fast_hop_count_8ms
+	store 1,mem_24g_fast_hop_count
+	fetch 4,mem_mouse_24g_tsniff_8ms
+	store 4,mem_mouse_24g_tsniff
+mouse_report_rate_set_125hz:
+	setarg 0x1c1919
+	store 3,mem_24g_interval
+	rtn
+
+//mouse_report_rate_set_500hz:
+//	setarg 0x080606
+//	store 3,mem_24g_interval
+//	rtn
+//mouse_report_rate_set_1000hz:
+//	setarg 0x040303
+//	store 3,mem_24g_interval
+//	rtn
+
+
+mouse_start_work:
+	bpatch patch07_0,mem_patch07
+	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_bluetooth_fast_conn_init,user
+mouse_start_reconnect_device:
+	bpatch patch07_1,mem_patch07
+	fetch 1,mem_mouse_bt_led_recon_effect_flag
+	ncall mouse_multi_led_blink_enable,blank
+	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_4_MODE,mouse4_0_check_reconn_target
+	branch mouse_bluetooth_fast_conn_init
+
+
+mouse_wakeup_from_power_check:
+	bpatch patch07_2,mem_patch07
+	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
+
+
+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
+
+
+/*****************system clk***********************************/
+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 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_power_down:
+	call mouse_device_led_all_off
+mouse_app_enter_hibernate:
+	bpatch patch07_3,mem_patch07
+	setarg PAN_REG_CONFIG
+	call twspi_read
+	bbit1 3,mouse_app_enter_hibernate_next
+	call mouse_sensor_reset
+	call mouse_sensor_powerdown
+mouse_app_enter_hibernate_next:
+	call mouse_setgpio_hibernate
+	branch app_enter_hibernate
+
+mouse_before_hibernate:
+	bpatch patch07_4,mem_patch07
+	fetch 4,core_lpm_ctrl
+	set1 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
+	fetcht 1,mem_sensor_motion_gpio
+	branch gpio_clr_wake
+
+
+mouse_setgpio_hibernate:
+	bpatch patch07_5,mem_patch07
+	call mouse_set_sdio_high
+	call clear_wake
+	call mouse_logo_led_off
+	call mouse_1io2led_all_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
+	call mouse_gpio_config_output_high
+	fetcht 1,mem_mouse_reuse_2ice_gpio
+	call mouse_gpio_config_input_pu
+	call mouse_lpm_before_common
+	call mouse_gpio_pd_idle
+	arg 13,temp
+	call mouse_gpio_config_input_pu
+	call mouse_gpio_set_high_impedance
+	call mouse_adc_gpio_set_before_hibernate
+	branch mouse_wheel_gpio_set_before_hibernate
+
+mouse_wheel_gpio_set_before_hibernate:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL
+mouse_wheel_gpio_clr_wakeup:	
+	fetcht 1,mem_whee_a_data_gpio
+	call gpio_clr_wake
+	fetcht 1,mem_whee_b_data_gpio
+	call gpio_clr_wake
+	fetcht 1,mem_whee_a_data_gpio
+	call mouse_gpio_config_input_pd
+	fetcht 1,mem_whee_b_data_gpio
+	branch mouse_gpio_config_input_pd
+	
+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_h
+	fetch 1,mem_adc_channel_gpio	
+	arg gpcfg_no_ie,temp
+ 	branch gpio_config_function_int
+	
+
+//set all unused gpio to pull down mode to save power	
+mouse_gpio_pd_idle:
+	arg core_gpio_conf,contr
+	arg 13,loopcnt
+mouse_gpio_pd_idle_loop:
+	ifetch 1,contr
+	nbranch mouse_gpio_pd_idle_configured,blank
+	setarg 0x80
+	add contr,-1,contw
+	istore 1,contw
+mouse_gpio_pd_idle_configured:
+	loop mouse_gpio_pd_idle_loop
+	rtn
+	
+	
+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 patch07_6,mem_patch07
+		
+	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 sdio high
+ 	call mouse_gpio_config_output_high
+	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
+	rtn
+mouse_set_ble_mult:
+	copy rega,pdata
+	nbranch le_set_config_short_mult,blank
+	branch le_clr_config_short_mult
+
+	
+/*****************system clk***********************************/
+	
+	
+/****************************adc**************************************/	
+mouse_adc_gpio_set:
+	fetch 1,mem_adc_config_flag
+	rtnne ADC_CONFIG_GPIO_h
+mouse_adc_gpio_check_output:
+	bpatch patch07_7,mem_patch07
+	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_h,mouse_adc_gpio_vol_init
+	beq ADC_CONFIG_HVIN,mouse_adc_gpio_vinlpm_init
+	jam ADC_CONFIG_HVIN,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_h,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_h,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_h,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 patch08_0,mem_patch08
+	fetch 1,mem_24g_device_led_status
+	nrtn blank
+	jam 0,mem_adc_read_timer
+	call enable_adc
+	call adc_calculate
+	store 2,mem_mouse_vdd_now_vol
+	fetch 1,mem_adc_config_flag
+	bne ADC_CONFIG_GPIO_h, 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 patch08_1,mem_patch08
+	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
+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_h,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
+	
+/****************************adc**************************************/	
+
+/****************************gpio******************************************/
+mouse_gpio_init:
+	call mouse_logo_led_off
+	call mouse_1io2led_all_off
+	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_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
+mouse_gpio_config_input_pd:
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	rtn zero
+	set1 gpio_active_bit,temp
+	branch gpio_config_input
+
+mouse_gpio_config_input_pu:
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	rtn zero 
+	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 14,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 patch08_2,mem_patch08
+	disable user
+	setarg 0
+	store 6,mem_mouse_x
+	call mouse_check_sensor_data
+	setarg 0x0089
+	call twspi_write	
+	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 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
+	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_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_dpi_check
+	fetch 1,mem_mouse_ghost_flag
+	nbranch mouse_dpi_check_end,blank
+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_3io6key_dpi_check:
+	fetch 1,mem_dpi_button_gpio
+	call mouse_gpio_config_output_low
+	fetcht 1,mem_dpi_button_gpio
+	branch mouse_3io6key_check
+
+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_check_connect_adc:
+	fetch 1,mem_mouse_adc_button_press_flag
+	branch mouse_dpi_up,blank
+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_another_gpio_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_DOUBLE_DPI_KEY
+	fetch 1,mem_mouse_another_dpi_connect_vin_flag
+	nbranch mouse_dpi_another_gpio_connect_vin_check,blank
+mouse_dpi_another_gpio_connect_gnd_check:	
+	fetch 1,mem_dpi_another_button_gpio
+	call mouse_gpio_config_output_high
+	call mouse_dpi_another_check
+	fetcht 1,mem_dpi_another_button_gpio
+	branch mouse_gpio_config_input_pu
+
+mouse_dpi_another_gpio_connect_vin_check:
+	fetch 1,mem_dpi_another_button_gpio
+	set0 gpio_active_bit,pdata
+	store 1,mem_dpi_another_button_gpio
+	call mouse_gpio_config_output_low
+	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 mouse_check_dpi_another_key_connect_vin
+	call mouse_dpi_another_state_check
+	fetcht 1,mem_dpi_another_button_gpio
+	branch mouse_gpio_config_input_pu
+
+mouse_dpi_another_down_new:
+	call mouse_gpio_config_input_pu
+	fetch 1,mem_dpi_another_button_state
+	rtneq DPI_BUTTON_STATE_DOWN
+	jam DPI_BUTTON_STATE_DOWN,mem_dpi_another_button_state
+	branch mouse_dpi_process
+	
+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 mouse_check_dpi_another_key_connect_gnd
+mouse_dpi_another_state_check:
+	store 1,mem_dpi_another_press_status
+	fetch 1,mem_dpi_another_button_down_enable
+	branch mouse_dpi_another_up,blank	
+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
+	branch mouse_dpi_process
+
+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
+	rtn
+
+mouse_check_dpi_another_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_patch
+	copy temp,queue
+	beq 0x07,mouse_dpi_another_key_press		//  about 17~22ms three times
+	beq 0x00,mouse_dpi_another_key_release
+	rtn
+
+mouse_check_dpi_another_key_connect_vin:	
+	lshift pdata,pdata
+	copy pdata,regb
+	call mouse_gpio_config_input_pd
+	call gpio_get_bit
+	setflag true,0,regb
+	and regb,0x07,pdata
+	fetcht 1,mem_mouse_key_temp_patch
+	copy temp,queue
+	beq 0x07,mouse_dpi_another_key_press		//  about 17~22ms three times
+	beq 0x00,mouse_dpi_another_key_release
+	rtn
+
+mouse_dpi_another_key_press:
+	jam 1,mem_dpi_another_button_down_enable
+	rtn
+mouse_dpi_another_key_release:
+	jam 0,mem_dpi_another_button_down_enable
+	rtn
+
+
+mouse_double_dpi_judge:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_DOUBLE_DPI_KEY
+	fetch 1,mem_dpi_another_button_gpio
+	bbit1 gpio_active_bit,mouse_another_dpi_connect_vin
+mouse_another_dpi_connect_gnd:
+	jam 0,mem_mouse_another_dpi_connect_vin_flag
+	rtn
+mouse_another_dpi_connect_vin:
+	jam 1,mem_mouse_another_dpi_connect_vin_flag
+	rtn
+
+	
+mouse_dpi_process:
+	bpatch patch08_3,mem_patch08
+	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,mouse_double_dpi_check
+	copy temp,pdata
+	increase 1,pdata
+	and pdata,0x03,pdata
+mouse_dpi_process_store:	
+	store 1,mem_mouse_dpi
+	call mouse_setting_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
+	branch enable_user
+	
+mouse_double_dpi_check:
+	fetch 1,mem_dpi_another_button_down_enable
+	nbranch mouse_another_dpi_button_down,blank
+mouse_dpi_increase:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_DPI_LEVEL_4,mouse_dpi_increase_level_4
+	copy temp,pdata
+	rtneq MOUSE_DPI_LEVEL2
+mouse_dpi_increase_level:
+	beq MOUSE_DPI_LEVEL1,mouse_dpi_level_3	//1600
+	beq MOUSE_DPI_LEVEL3,mouse_dpi_level_2 	//1200
+	rtn
+
+mouse_dpi_level_1:		//800
+	setarg MOUSE_DPI_LEVEL3
+	branch mouse_dpi_process_store
+mouse_dpi_level_2:		//1200
+	setarg MOUSE_DPI_LEVEL1
+	branch mouse_dpi_process_store
+mouse_dpi_level_3:		//1600
+	setarg MOUSE_DPI_LEVEL2
+	branch mouse_dpi_process_store
+mouse_dpi_level_4:		//1000
+	setarg MOUSE_DPI_LEVEL4
+	branch mouse_dpi_process_store
+
+mouse_dpi_increase_level_4:
+	copy temp,pdata			//0->1,2->3,3->0
+	rtneq MOUSE_DPI_LEVEL2
+	beq MOUSE_DPI_LEVEL1,mouse_dpi_level_3
+	beq MOUSE_DPI_LEVEL3,mouse_dpi_level_4
+	beq MOUSE_DPI_LEVEL4,mouse_dpi_level_2
+	rtn
+mouse_dpi_decrease_level_4:
+	copy temp,pdata			//0->3,1->0,3->2
+	rtneq MOUSE_DPI_LEVEL3
+	beq MOUSE_DPI_LEVEL1,mouse_dpi_level_4
+	beq MOUSE_DPI_LEVEL2,mouse_dpi_level_2
+	beq MOUSE_DPI_LEVEL4,mouse_dpi_level_1
+	rtn
+
+mouse_another_dpi_button_down:
+mouse_dpi_decrease:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_DPI_LEVEL_4,mouse_dpi_decrease_level_4
+	copy temp,pdata
+	rtneq MOUSE_DPI_LEVEL3
+mouse_dpi_decrease_level:
+	beq MOUSE_DPI_LEVEL1,mouse_dpi_level_1
+	beq MOUSE_DPI_LEVEL2,mouse_dpi_level_2
+	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_setting_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_setting_dpi:
+	bpatch patch08_4,mem_patch08
+	call mouse_setting_dpi_4_level
+	call mouse_dpi_led_blink_delay
+mouse_setting_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
+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_firekey_gpio
+	fetch 1,mem_fire_key_flag
+	nbranch mouse_fire_key_press,blank
+	fetch 1,mem_fire_key_status
+	nbranch mouse_fire_key_process,blank
+	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 patch08_5,mem_patch08
+	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
+	call mouse_check_firekey_gpio
+	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:
+	fetch 1,mem_lbutton_gpio
+	call mouse_gpio_config_output_high
+	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
+	fetcht 1,mem_lbutton_gpio
+	branch mouse_gpio_config_input_pu
+
+mouse_check_rkey_gpio:
+	fetch 1,mem_rbutton_gpio
+	call mouse_gpio_config_output_high
+	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
+	fetcht 1,mem_rbutton_gpio
+	branch mouse_gpio_config_input_pu
+	
+mouse_check_mkey_gpio:
+	fetch 1,mem_mbutton_gpio
+	call mouse_gpio_config_output_high
+	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
+	fetcht 1,mem_mbutton_gpio
+	branch mouse_gpio_config_input_pu
+
+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
+	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:
+	fetch 1,mem_bk_button_gpio
+	call mouse_gpio_config_output_low
+	fetcht 1,mem_bk_button_gpio
+	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
+	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
+mouse_matrix_public_gpio_reset:	
+	fetcht 1,mem_matrix_public_gpio
+	branch mouse_gpio_config_input_pu
+
+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:
+	fetch 1,mem_fw_button_gpio
+	call mouse_gpio_config_output_low
+	fetcht 1,mem_fw_button_gpio
+	call mouse_3io6key_check
+	store 1,mem_mouse_fwkey_press_status
+	fetcht 1,mem_fw_button_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
+mouse_key_release:
+	qset0 rega
+	rtn	
+
+mouse_check_key_connect_gnd:	
+	lshift pdata,pdata
+	copy pdata,regb
+	call gpio_get_bit
+	setflag true,0,regb
+mouse_check_key_connect_gnd_1:
+	and regb,0x07,pdata
+mouse_check_key_connect_gnd_next:
+	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_press:
+	qset1 rega
+	rtn
+
+mouse_3io6key_check:
+	bpatch patch08_6,mem_patch08
+	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_next
+
+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
+
+
+//input:pdata gpio number
+mouse_gpio_config_output_high:
+	rtneq GPIO_DISABLE
+	arg gpcfg_output_high,temp
+	branch gpio_config_function_int
+
+//input:pdata gpio number
+mouse_gpio_config_output_low:
+	rtneq GPIO_DISABLE
+	arg gpcfg_output_low,temp
+	branch gpio_config_function_int	
+
+
+
+mouse_firebutton_connect_state_check:
+	fetch 1,mem_firebutton_gpio
+	rtneq GPIO_DISABLE
+	bbit1 gpio_active_bit,mouse_firebutton_connect_vin
+mouse_firebutton_connect_gnd:	
+	jam 0,mem_mouse_firebutton_connect_vin_flag
+	rtn
+mouse_firebutton_connect_vin:
+	jam 1,mem_mouse_firebutton_connect_vin_flag
+	rtn
+
+mouse_check_firekey_gpio:
+	arg 0,regb
+	fetch 1,mem_firebutton_gpio
+	rtneq GPIO_DISABLE
+	fetch 1,mem_mouse_firebutton_connect_vin_flag
+	nbranch mouse_check_firekey_connect_vin,blank
+mouse_check_firekey_connect_gnd:
+	fetcht 1,mem_firebutton_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_firebutton_gpio
+	call gpio_get_bit
+	setflag true,0,regb
+mouse_firekey_state_store:	
+	copy regb,pdata
+	store 1,mem_fire_key_flag
+	rtn	
+
+mouse_check_firekey_connect_vin:
+	fetch 1,mem_firebutton_gpio
+	set0 gpio_active_bit,pdata
+	store 1,mem_firebutton_gpio
+	fetcht 1,mem_firebutton_gpio
+	call mouse_gpio_config_input_pd
+	fetcht 1,mem_firebutton_gpio
+	call gpio_get_bit
+	nsetflag true,0,regb
+	branch mouse_firekey_state_store
+
+mouse_fire_key_process: 
+	beq 4,mouse_fire_key_process_end
+mouse_fire_key_press:
+	call mouse_firekey_clkn_bt_timer_check 
+	fetch 4,mem_fire_key_delay
+	arg 0xa0,temp      
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	store 4,mem_fire_key_delay 
+	fetch 1,mem_fire_key_status
+	beq 0,mouse_fire_key_process_start
+	beq 1,mouse_fire_key_process_release1
+	beq 2,mouse_fire_key_process_start2
+	beq 3,mouse_fire_key_process_release2
+	rtn
+
+mouse_fire_key_process_start:
+	jam 1,mem_fire_key_status
+mouse_fire_key_down:
+	jam 1,mem_mouse_key
+	branch enable_user
+
+mouse_fire_key_process_release1:
+	jam 2,mem_fire_key_status
+mouse_fire_key_release:
+	jam 0,mem_mouse_key
+	branch enable_user
+
+mouse_fire_key_process_start2:
+	jam 3,mem_fire_key_status
+	branch mouse_fire_key_down
+
+mouse_fire_key_process_release2:
+	jam 0,mem_fire_key_status
+	branch mouse_fire_key_release
+	
+mouse_fire_key_process_end:
+	jam 0,mem_fire_key_status
+	jam 0,mem_mouse_key
+	rtn
+
+mouse_firekey_clkn_bt_timer_check:
+	fetcht 4,mem_fire_key_delay
+	copy clkn_bt,pdata
+	isub temp,null
+	ncall mouse_firekey_clkn_bt_timer_timeout,positive
+	rtn
+mouse_firekey_clkn_bt_timer_timeout:
+	setarg 0
+	store 4,mem_fire_key_delay
+	rtn
+
+	
+/*************************key***************************************/
+
+/**********************sensor******************************/	
+mouse_init_sunt:
+	bpatch patch08_7,mem_patch08
+	call mouse_sensor_spi_init
+	rtn wake
+mouse_init_sensor_wakeup:	
+	call mouse_sensor_poweron
+mouse_init_sensor:
+	bpatch patch09_0,mem_patch09
+	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:
+	fetcht 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
+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_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_reset:	
+	arg 0x8006,temp
+	fetch 1,mem_config_sensor_type
+	bne KA8G2,mouse_sensor_reset_end
+	arg 0x9706,temp
+mouse_sensor_reset_end:
+	copy temp,pdata
+	call twspi_write
+	nop 12000
+	rtn
+
+mouse_sensor_poweron_init:
+	arg mem_sensor_poweron_init,regc
+	fetch 1,mem_config_sensor_type
+	rtnne KA8G2
+	arg mem_sensor_ka8g2_poweron_init,regc
+	rtn
+	
+mouse_sensor_poweron:
+	bpatch patch09_1,mem_patch09
+	call mouse_sensor_spi_init
+	call mouse_sensor_reset
+	call mouse_sensor_poweron_init
+	call mouse_sensor_wr_seq
+	branch mouse_dpi_config
+
+mouse_sensor_powerdown:
+	bpatch patch09_2,mem_patch09
+	call mouse_init_sunt
+	call mouse_sensor_spi_init
+	arg 0x0806,temp
+	fetch 1,mem_config_sensor_type
+	bne KA8G2,mouse_sensor_powerdown_end
+	arg 0x1f06,temp
+mouse_sensor_powerdown_end:
+	copy temp,pdata
+	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_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_bluetooth_fast_conn_init:
+	jam 0xff,mem_mouse_bluetooth_fast_conn_flag
+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_buletooth_fast_conn_end:
+	bpatch patch09_3,mem_patch09
+	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_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_BLE_CONNECTED,app_ble_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
+	rtn
+	
+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
+	branch disable_user
+
+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 patch09_4,mem_patch09
+	copy regc,pdata
+	beq BT_EVT_LE_CONNECTED,mouse_le_bb_event_connected
+	beq BT_EVT_LE_DISCONNECTED,mouse_le_bb_disconnected
+	beq BT_EVT_BUTTON_LONG_PRESSED,mouse_bb_event_discovery_btn
+	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,app_ble_store_reconn_info
+	beq BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP,mouse_le_conn_param_update_rsp_recieved
+	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:
+	fetch 1,mem_mouse_1io2led_led_enable
+	ncall mouse_multi_led_on_enable,blank
+	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:
+	setarg 0
+	store 2,mem_le_battery_level_updata_timer
+	store 1,mem_mouse_le_send_conn_param_update
+	store 1,mem_mouse_le_send_conn_param_update_timer
+	store 1,mem_mouse_le_bb_connected_flag
+	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
+	jam 20,mem_le_start_encrypt_timer	
+	branch mouse_le_ll_enable_start_enc_flag
+mouse_le_ll_reconn_start_encryt:
+	call mouse_updata_le_param
+	jam 10,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_conn_param_update_rsp_recieved:
+	fetch 1,mem_mouse_le_send_conn_param_update
+	nrtn blank
+	jam 1,mem_mouse_le_send_conn_param_update
+	jam 30,mem_mouse_le_send_conn_param_update_timer
+	rtn
+	
+mouse_le_conn_param_lpm_disable:
+	jam LE_LPM_DISABLE,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
+mouse_le_conn_param_lpm_enable:
+	jam LE_LPM_ENABLE,mem_mouse_le_conn_param_reject
+	rtn
+	
+/*
+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 patch09_5,mem_patch09
+	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
+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_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_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
+
+mouse_le_name_load:
+	fetch 8,mem_le_name_temp
+	rtn blank
+	fetch 1,mem_le_name_len_temp
+	copy pdata,rega
+	sub pdata,11,null
+	nbranch mouse_le_name_len_overflow,positive
+	arg mem_le_name_temp,contr	
+	arg mem_le_adv_swift_pair+9,contw
+	copy rega,loopcnt
+	call memcpy
+	arg mem_le_name_temp,contr
+	arg mem_le_scan_data+2,contw
+	copy rega,loopcnt
+	call memcpy
+	arg mem_le_name_temp,contr
+	arg mem_le_name,contw
+	copy rega,loopcnt
+	branch memcpy
+mouse_le_name_len_overflow:
+	call mouse_le_swift_pair_disable
+	fetch 1,mem_le_name_len_temp
+	increase 1,pdata
+	store 1,mem_le_adv_swift_pair
+	jam 9,mem_le_adv_swift_pair+1
+	arg mem_le_name_temp,contr
+	arg mem_le_adv_swift_pair+2,contw
+	copy rega,loopcnt
+	call memcpy
+	fetch 1,mem_le_name_len_temp
+	increase 1,pdata
+	store 1,mem_le_scan_data
+	jam 9,mem_le_scan_data+1
+	arg mem_le_name_temp,contr
+	arg mem_le_scan_data+2,contw
+	copy rega,loopcnt
+	call memcpy
+	arg mem_le_name_len_temp,contr
+	arg mem_le_name_len,contw
+	copy rega,loopcnt
+	increase 1,loopcnt
+	branch memcpy
+mouse_le_swift_pair_disable:
+	arg mem_le_adv_swift_pair,contw
+	arg 20,loopcnt
+	branch clear_mem
+
+mouse_le_parse_l2cap:
+	fetch 2,mem_le_payload_ptr
+	add pdata,2,contr	//l2cap length
+	ifetch 2,contr
+	beq LE_L2CAP_CID_ATT,mouse_le_parse_att
+	branch le_parse_l2cap+4
+
+mouse_le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+	beq ATTOP_READ_REQUEST,mouse_le_parse_att_read_request
+	beq ATTOP_WRITE_REQUEST,mouse_le_parse_att_write_request	
+	branch le_parse_att+2
+
+mouse_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,mouse_le_send_att_read_response_check_auth
+//input:temp is handle
+mouse_le_send_att_read_response:
+	fetch 2,mem_le_att_handle
+	beq 0x30,le_send_att_error_response_notfound
+	branch le_send_att_read_response
+
+mouse_le_send_att_read_response_check_auth:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch mouse_le_send_att_read_response,zero
+	nbranch mouse_le_send_att_read_response,user
+	branch le_send_att_read_response_error_insufficient_auth
+
+mouse_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
+	branch le_send_att_read_response_error_insufficient_auth
+	
+/***************************le*************************/
+
+
+
+mouse_bb_disconnected:
+	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
+	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 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 100ms timer*****************/
+mouse_bb_event_timer:
+	bpatch patch09_6,mem_patch09
+	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
+	call mouse_led_multi_timer
+	call mouse_logo_led_on_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
+	call mouse_le_send_conn_param_update_timer
+	//bt
+	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
+	rtn
+
+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_send_conn_param_update_timer:
+	arg mem_mouse_le_send_conn_param_update_timer,regc
+	arg mouse_updata_le_param,regb
+	branch timer_single_step
+
+mouse_le_battery_updata_timer:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_LE_BATTERY_SERVICE_CANCEL
+	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_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:	
+	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_device_multi_led_poweron2s_init:
+	fetch 1,mem_mouse_multi_led_powon2s_timer_init
+	store 1,mem_mouse_multi_led_powon2s_timer
+	fetch 1,mem_mouse_multi_led_poweron2s_flag_init
+	store 1,mem_mouse_multi_led_poweron2s_flag
+	rtn
+mouse_multi_led_blink_enable:
+	jam 1,mem_mouse_multi_led_blink_enable
+	jam MULTI_LED_BLINK,mem_mouse_multi_led_type
+	fetch 1,mem_mouse_multi_led_blink_timer_init
+	store 1,mem_mouse_multi_led_blink_timer
+	rtn
+mouse_multi_led_on_enable:	
+	jam 1,mem_mouse_multi_led_blink_enable	//disable flag 
+	jam 0,mem_mouse_multi_led_blink_timer
+	jam MULTI_LED_ON,mem_mouse_multi_led_type
+	rtn
+
+mouse_led_multi_timer:
+	fetch 1,mem_mouse_multi_led_blink_enable
+	rtn blank
+	fetch 1,mem_mouse_multi_led_type
+	beq MULTI_LED_BLINK,mouse_multi_led_type_blink
+mouse_multi_led_type_on:
+	fetch 1,mem_mouse_multi_led_poweron2s_flag
+	nbranch mouse_device_multi_led_poweron2s,blank
+	jam 0,mem_mouse_multi_led_blink_enable
+	rtn
+mouse_device_multi_led_poweron2s:
+	fetch 1,mem_mouse_multi_led_powon2s_timer
+	branch mouse_multi_led_poweron2s_and_flag_off,blank
+	increase -1
+	store 1,mem_mouse_multi_led_powon2s_timer
+	branch mouse_device_multi_led_on
+mouse_multi_led_poweron2s_and_flag_off:
+	jam 0,mem_mouse_multi_led_poweron2s_flag
+	jam 0,mem_mouse_multi_led_blink_enable
+	branch mouse_device_multi_led_off
+
+mouse_multi_led_type_blink:
+	arg mem_mouse_multi_led_blink_timer,regc
+	arg mouse_multi_led_type_blink_timeout,regb
+	branch timer_single_step
+
+mouse_multi_led_type_blink_timeout:
+	fetch 1,mem_mouse_multi_led_blink_timer_init
+	store 1,mem_mouse_multi_led_blink_timer
+	fetch 1,mem_mouse_multi_led_state
+	beq ON,mouse_device_multi_led_off	
+mouse_device_multi_led_on:
+	jam ON,mem_mouse_multi_led_state
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_device_24g_multi_led_on
+	beq MODE_BT_DEVICE1,mouse_device_bt1_multi_led_on
+	beq MODE_BT_DEVICE2,mouse_device_bt2_multi_led_on
+	rtn
+mouse_device_24g_multi_led_on:
+	fetcht 1,mem_mouse_1io2led_multi_24g_gpio
+	branch gpio_out_active
+mouse_device_bt1_multi_led_on:
+	fetcht 1,mem_mouse_1io2led_multi_bt1_gpio
+	branch gpio_out_active
+mouse_device_bt2_multi_led_on:
+	fetcht 1,mem_mouse_1io2led_multi_bt2_gpio
+	branch gpio_out_active
+
+mouse_device_multi_led_off:
+	jam OFF,mem_mouse_multi_led_state
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,mouse_device_24g_multi_led_off
+	beq MODE_BT_DEVICE1,mouse_device_bt1_multi_led_off
+	beq MODE_BT_DEVICE2,mouse_device_bt2_multi_led_off
+	rtn
+
+mouse_device_24g_multi_led_off:
+	fetcht 1,mem_mouse_1io2led_multi_24g_gpio
+	branch gpio_set_high_impedance
+mouse_device_bt1_multi_led_off:
+	fetcht 1,mem_mouse_1io2led_multi_bt1_gpio
+	branch gpio_set_high_impedance
+mouse_device_bt2_multi_led_off:
+	fetcht 1,mem_mouse_1io2led_multi_bt2_gpio
+	branch gpio_set_high_impedance
+
+mouse_1io2led_all_off:
+	call mouse_device_24g_multi_led_off
+	call mouse_device_bt1_multi_led_off
+	branch mouse_device_bt2_multi_led_off
+
+
+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 mouse_logo_led_on,positive
+mouse_logo_led_off:
+	fetcht 1,mem_mouse_logo_led_gpio
+	fetch 1,mem_mouse_1io2led_led_enable
+	beq 1,gpio_set_high_impedance
+	branch gpio_out_inactive
+mouse_logo_led_on:
+	fetcht 1,mem_mouse_logo_led_gpio
+	branch gpio_out_active
+
+
+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 patch09_7,mem_patch09
+	fetch 2,mem_ui_state_map
+	isolate1 UI_STATE_BLE_ADV,pdata
+	call mouse_stop_le_adv,true		//reconnect adv
+	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_mouse_discovery_timeout
+	store 2,mem_mouse_discovery_timer
+	setarg 0
+	store 2,mem_mouse_no_data_timer
+	store 2,mem_le_battery_level_updata_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
+	call mouse_check_51cmd_adv
+	call mouse_low_voltage_led_blink_disable
+	branch mouse_device_discover_led_config
+
+
+mouse_stop_discovery:
+	bpatch patch0a_0,mem_patch0a
+	arg MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG,queue
+	call mouse_disable_function_flag
+	jam 0,mem_mouse_bluetooth_reconnect_timeout
+	call mouse_stop_le_adv
+	branch mouse_device_led_off
+mouse_stop_le_adv:
+	setarg 0
+	store 1,mem_mouse_direct_timer
+	store 2,mem_mouse_discovery_timer
+	branch check_51cmd_stop_adv
+
+mouse_store_remote_bdaddr:
+	bpatch patch0a_1,mem_patch0a
+	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
+	rtn
+mouse_check_le_device_addr:
+	store 1,mem_device_addr_temp
+	fetch 6,mem_le_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
+	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_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_4_MODE,mouse_load_le_device
+	rtn
+
+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 patch0a_2,mem_patch0a
+	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 patch0a_3,mem_patch0a
+	call mouse_low_voltage_led_no_enter_lpm
+	call ui_check_paring_button
+	call mouse_dpi_check
+	call mouse_dpi_another_gpio_check
+	call mouse_select_device_check
+	call mouse_check_select_device_by_switch
+	call mouse_bt_button_check
+	branch mouse_wheel_check
+	
+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:
+	bpatch patch0a_4,mem_patch0a
+	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
+	branch enable_user
+	
+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 patch0a_5,mem_patch0a
+	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
+	branch mouse_select_device_by_pb_button
+	
+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 patch0a_6,mem_patch0a
+	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
+	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:
+	bpatch patch0a_7,mem_patch0a
+	fetch 1,mem_config_sensor_type
+	rtneq P3212
+	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
+	bpatch patch0b_0,mem_patch0b
+	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:
+	fetch 1,mem_24g_long_sleep_set_level
+	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:
+	bpatch patch0b_1,mem_patch0b
+	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 mouse_24g_long_sleep
+
+mouse_wakeup_24g:
+	fetch 1,mem_sensor_shutdown_flag
+	ncall mouse_wakeup_24g_from_long_sleep,blank
+	jam 0,mem_sensor_shutdown_flag
+	rtn
+
+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
+mouse_wheel_gpio_init:
+	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	
+
+mouse_24g_transmit_start:
+	call mouse_24g_fast_conn_mode_check
+	fetch 1,mem_sensor_shutdown_flag
+	nbranch mouse_24g_short_sleep,blank
+	branch g24_transmit_start_next
+
+mouse_24g_fast_conn_mode_check:
+	fetch 4,mem_24g_receiver_addr
+	fetcht 4,mem_24g_fast_conn_addr
+	isub temp,null
+	branch mouse_soft_agc_enable,zero
+	branch mouse_soft_agc_disable
+
+mouse_soft_agc_enable:
+	jam 0,mem_gain_fix
+	jam TX_POWER_FACTORY,mem_tx_power
+	rtn
+mouse_soft_agc_disable:
+	jam 0xff,mem_gain_fix
+	rtn
+
+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 rega,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_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:
+	fetch 1,mem_mouse_1io2led_led_enable
+	ncall mouse_multi_led_blink_enable,blank
+	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_device_discover_led_config
+	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
+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:
+	jam 0,mem_24g_reconn_type
+	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_device_discover_led_config
+	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:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL,mouse_24g_hibernate_set
+mouse_24g_attempt_fail_enter_hibernate_next:
+	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
+	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 mouse_24g_start_pair_mode,zero
+mouse_24g_reconn_dongle_start:
+	fetch 1,mem_mouse_1io2led_led_enable
+	ncall mouse_multi_led_blink_enable,blank
+	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_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:
+	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_led_config
+	call mouse_no_data_timer_init
+	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_device_poweron_led_config:
+	fetch 1,mem_mouse_1io2led_led_enable
+	branch mouse_device_poweron_timer_init,blank
+	branch mouse_multi_led_on_enable
+
+mouse_device_discover_led_config:
+	fetch 1,mem_mouse_1io2led_led_enable
+	branch mouse_discover_setting_led_gpio,blank
+	branch mouse_multi_led_blink_enable
+
+mouse_24g_pairing_complete:
+	call mouse_no_data_timer_init
+	arg MOUSE_24G_PAIRING_FLAG,queue
+	call mouse_disable_function_flag
+	call mouse_device_poweron_led_config
+	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:
+	bpatch patch0b_2,mem_patch0b
+	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 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:
+	bpatch patch0b_3,mem_patch0b
+	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_g24_ackpayload_parse
+	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
+
+mouse_g24_ackpayload_parse:
+	call g24_ackpayload_parse
+	fetch 1,mem_24g_rxbuf+1
+	compare 0x08,pdata,0xf8
+	nrtn true
+	fetch 1,mem_24g_rxbuf+2		// pc sleep mouse ackpayload: 01 08 ff
+	beq 0xff,mouse_24g_hibernate_set
+	rtn
+
+/**************************************g24 search receiver*****************************************/
+
+
+/**************************************g24 new process start********************************************/
+mouse_24g_before_lpm_sleep:
+	fetch 1,mem_device_flag
+	bne MODE_24G_DEVICE,lpm_sleep_skip_cb_function
+	fetch 1,mem_24g_disable_fec1
+	rtn blank
+mouse_peripheral_clock_off:
+	jam 2,core_clksel			//use rc clock
+	fetch 1,core_lpm_ctrl		//close xtal en reg
+	and pdata,0xfc,pdata
+	store 1,core_lpm_reg
+	branch lpm_write_ctrl
+
+/**************************************g24 new process end********************************************/
+
+
+/*******************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
+	fetch 1,mem_config_sensor_type
+	beq P3212,mouse_dpi_led_blink_init1	//result:    level3: 1  2  3     level4: 2  3  4  1
+	beq KA8G2,mouse_dpi_led_blink_init1	//result:    level3: 1  2  3     level4: 2  3  4  1
+	arg 0,rega
+	fetcht 1,mem_mouse_dpi
+	increase 2,temp	// 2 3 4 (5)
+	sub temp,3,null
+	call mouse_dpi_led_blink_init_level_4,positive
+	branch mouse_dpi_led_blink_init_end,positive
+	increase -3,temp		// 4-->1  5-->2
+	branch mouse_dpi_led_blink_init_end
+
+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
+
+mouse_dpi_led_blink_init1:
+	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
+	branch mouse_dpi_led_blink_init_end,positive
+	arg 1,temp	// 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_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
+	branch enable_user
+
+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 patch0b_4,mem_patch0b
+	copy temp,pdata
+	rtneq GPIO_DISABLE
+	copy pdata,temp
+	storet 1,mem_mouse_struct_led_gpio
+	arg 0,rega
+	branch ui_led_off_global
+mouse_led_on:
+	bpatch patch0b_5,mem_patch0b
+	copy temp,pdata
+	rtneq GPIO_DISABLE
+	copy pdata,temp
+	storet 1,mem_mouse_struct_led_gpio
+	arg 0,rega
+	branch ui_led_on_global
+
+mouse_ui_led_off_static:
+	bpatch patch0b_6,mem_patch0b
+	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:
+	bpatch patch0b_7,mem_patch0b
+	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_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_set_lpm_mult:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,mouse_le_set_lpm_mult
+	rtn
+
+mouse_24g_long_sleep:
+	call g24_lpm_wait
+	nrtn user
+	fetch 1,mem_24g_device_led_status
+	nrtn blank	
+	call g24_setgpio_lpm_before
+	jam 0,mem_mouse_24g_sleep_miss
+	call mouse_24g_send_time_long_wake
+	fetch 1,mem_sensor_shutdown_flag
+	ncall mouse_setgpio_hibernate,blank
+	fetch 4,mem_24g_enter_hibernate
+	branch g24_long_seep2	
+
+mouse_24g_short_sleep:
+	fetch 1,mem_mouse_sleep_deal_type
+	branch g24_short_sleep,blank
+	call g24_lpm_wait
+	nrtn user
+	fetch 1,mem_24g_device_led_status
+	nrtn blank
+	fetch 1,mem_mouse_24g_sleep_miss
+	jam 0,mem_mouse_24g_sleep_miss
+	sub pdata,0,null
+	nbranch mouse_24g_short_sleep_last_miss,zero
+	fetcht 2,mem_24g_retransmit
+	sub temp,0,null
+	branch mouse_24g_short_sleep_default,zero
+
+	fetch 4,mem_mouse_24g_tx_time_last_delt
+	branch mouse_24g_short_sleep_default,blank
+mouse_24g_short_sleep_notify:
+	fetcht 4,mem_mouse_24g_tsniff
+	isub temp,temp
+	storet 4,mem_mouse_24g_sleep_miss_temp
+	nbranch mouse_24g_short_sleep_long,positive
+	fetch 3,mem_24g_short_sleep_set
+	isub temp,pdata
+	nbranch mouse_24g_short_sleep_2,positive
+	arg 0x600,temp
+	isub temp,null
+	nbranch mouse_24g_short_sleep_2,positive
+mouse_24g_short_sleep2:
+	store 4,mem_mouse_24g_sleep_time_temp
+	call mouse_24g_miss_temp_clear
+	fetch 4,mem_mouse_24g_sleep_time_temp
+mouse_24g_short_sleep3:	
+	call clk2lpo
+	storet 4,mem_sleep_counter
+	branch lpm_sleep
+
+mouse_24g_short_sleep_default:
+	call mouse_24g_miss_temp_clear
+	fetch 3,mem_24g_short_sleep_set
+	branch mouse_24g_short_sleep2
+
+mouse_24g_short_sleep_long:
+	sub temp,0,temp
+	fetch 3,mem_24g_short_sleep_set
+	iadd temp,pdata
+	branch mouse_24g_short_sleep2
+
+mouse_24g_miss_temp_clear:
+	setarg 0
+	store 4,mem_mouse_24g_sleep_miss_temp
+	rtn
+	
+mouse_24g_short_sleep_last_miss:
+	fetch 4,mem_mouse_24g_tx_time_last_delt
+	fetcht 4,mem_mouse_24g_sleep_miss_temp
+	iadd temp,pdata
+	branch mouse_24g_short_sleep_notify
+	
+mouse_24g_short_sleep_2:
+	jam 1,mem_mouse_24g_sleep_miss
+	rtn
+
+
+mouse_24g_transmit_callback:
+	call mouse_24g_send_time_check
+	branch mouse_wakeup_24g
+
+mouse_24g_send_time_check:
+	fetch 1,mem_mouse_sleep_deal_type
+	rtn blank
+	fetch 1,mem_24g_transmit_by_interrupt
+	beq G24_TX_TIMER_INT_ENABLE,mouse_24g_send_timer_first
+	fetch 1,mem_mouse_24g_tx_count
+	branch mouse_24g_send_timer_first,blank
+	copy clkn,pdata
+	fetcht 6,mem_mouse_24g_tx_time_last
+	store 6,mem_mouse_24g_tx_time_last
+	call clk_diff_rt
+	store 4,mem_mouse_24g_tx_time_last_delt
+
+	fetch 1,mem_mouse_24g_sleep_miss
+	nrtn blank
+	fetch 2,mem_24g_retransmit
+	nrtn blank
+	fetch 4,mem_mouse_24g_tx_time_last_delt
+mouse_24g_send_time_check_1:
+	fetcht 5,mem_mouse_24g_tx_time_sum
+	iadd temp,pdata
+	store 5,mem_mouse_24g_tx_time_sum	
+	fetcht 1,mem_mouse_24g_tx_count
+	fetch 1,mem_mouse_24g_tx_time_sum_count
+	isub temp,null
+	branch mouse_24g_send_time_check_average,zero
+	increase 1,temp
+	storet 1,mem_mouse_24g_tx_count
+	rtn
+
+mouse_24g_send_time_check_average:
+	jam 1,mem_mouse_24g_tx_count
+	arg 0,temp
+	fetch 5,mem_mouse_24g_tx_time_sum
+	storet 5,mem_mouse_24g_tx_time_sum
+	fetcht 1,mem_mouse_24g_tx_time_sum_count
+	idiv temp
+	call wait_div_end
+  	quotient rega
+
+	fetch 4,mem_mouse_24g_tsniff
+	fetcht 1,mem_mouse_24g_tx_time_offset
+	isub temp,temp
+	increase -40,temp
+
+	copy rega,pdata
+	isub temp,pdata
+	branch mouse_24g_send_time_check_average_late,positive
+	sub pdata,0,pdata
+	
+	rshift2 pdata,pdata
+	fetcht 3,mem_24g_short_sleep_set
+	iadd temp,temp
+	bpatch patch0c_0,mem_patch0c
+	fetch 3,mem_mouse_24g_short_sleep_set_init
+	arg 0x1800,rega
+	iadd rega,pdata
+	isub temp,null
+	nbranch mouse_24g_send_time_check_average_min,positive
+	storet 3,mem_24g_short_sleep_set
+	rtn
+
+mouse_24g_send_time_check_average_late:
+	rshift2 pdata,temp
+	fetch 3,mem_24g_short_sleep_set
+	isub temp,temp
+	bpatch patch0c_1,mem_patch0c
+	fetch 3,mem_mouse_24g_short_sleep_set_init
+	arg 0x1800,rega
+	isub rega,pdata
+	isub temp,null
+	branch mouse_24g_send_time_check_average_min,positive
+	storet 3,mem_24g_short_sleep_set
+	rtn
+
+mouse_24g_send_time_check_average_min:
+	store 3,mem_24g_short_sleep_set
+	rtn
+
+mouse_24g_send_timer_first:
+	jam 1,mem_mouse_24g_tx_count
+	copy clkn,pdata
+	store 6,mem_mouse_24g_tx_time_last
+	rtn
+
+mouse_24g_send_time_long_wake:
+	setarg 0
+	store 1,mem_mouse_24g_tx_count
+	store 5,mem_mouse_24g_tx_time_sum
+	rtn
+	
+
+/*****************close define  COMPILE_MOUSE**********/
+else
+
+endif
+
+
+
Index: program/app_shutter.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_shutter.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_shutter.prog	(working copy)
@@ -0,0 +1,654 @@
+
+ifdef COMPILE_SHUTTER
+
+shutter_init:
+	call enable_authrom
+	rtn wake
+	
+	setarg shutter_process_idle
+	store 2,mem_cb_idle_process
+		
+	setarg shutter_process_bb_event 
+	store 2,mem_cb_bb_event_process
+	
+	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
+
+	call shutter_common_init
+	
+	bpatch patch0c_2,mem_patch0c
+	call shutter_load_buffer_config_form_DataRom
+
+shutter_power_switch:
+	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_common_init:
+	setarg shutter_le_before_hibernate
+	store 2,mem_cb_before_hibernate
+
+	setarg shutter_process_lpm_before
+	store 2,mem_cb_before_lpm
+
+	setarg shutter_start_reconnect
+	store 2,mem_shutter_soft_switch_poweron_callback_function
+	
+	setarg shutter_soft_swtich_power_off
+	store 2,mem_shutter_soft_switch_poweroff_callback_function
+
+	jam 7,mem_version
+	call le_modified_name_adv
+	call shutter_init_param	
+	call keyscan_key_init
+	call queue_init
+	branch ui_led_init_global
+
+
+/**************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
+	
+/**************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,ui_soft_switch_botton_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
+/****************************/
+
+
+/******************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_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
+/************************************/
+
+/**************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
+	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
+/************************************/
+
+/**************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
+//	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
+	
+
+shutter_start_bluetooth_discovery:
+	fetch 1,mem_shutter_soft_switch_power_state
+	rtnne SS_STATE_POWER_ON
+//	fetch 1,mem_shutter_bluetooth_type
+//	bbit1 BLE_SHUTTER,ble_shutter_start_discovery
+//	rtn
+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
+//	bbit1 BLE_SHUTTER,ble_shutter_start_reconnect
+//	rtn
+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
+	branch shutter_stop_bluetooth_discovery
+/**************************************/
+/////////////////////////////////////////////////////////////////////////
+//output:if user is enable,mean,can send data
+shutter_check_data_enable:
+	call disable_user
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,shutter_check_ble_data_enable
+	rtn
+
+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_BLE_CONNECTED
+	branch enable_user
+/////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////
+shutter_change_bluetooth_status_bt_disconn:
+//	fetch 1,mem_shutter_bluetooth_type
+//	bbit1 BLE_SHUTTER,ble_shutter_change_bluetooth_status_bt_disconn
+//	rtn
+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
+	branch enable_user2
+
+//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
+	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
+
+///////////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:
+	jam 0x02,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
+	branch le_set_fixed_ltk_justwork
+///////////////////////////////////////
+
+shutter_load_buffer_config_form_DataRom:
+///////load data Rom/////////
+	arg BLE_KEY_VALUE_LIST_SIZE,loopcnt
+	arg mem_ble_data_buffer1,contw
+	arg mem_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_ADDR,contr
+//	branch memcpy_fast
+
+shutter_load_dy_keyvalue_buffer_config_form_DataRom:
+/////load data Rom/////////
+	arg BT_DY_KEY_VALUE_LIST_SIZE,loopcnt
+	arg mem_shutter_mousekey_value_list,contw
+	arg BLE_SHUTTER_DY_MOUSEKEY_VALUE_LIST_ADDR,contr
+	branch memcpy_fast
+
+
+/////////////////////////////////////////////////////////////////
+//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
+ui_soft_switch_first_power_on:
+	fetch 1,mem_shutter_soft_switch_first_power_on
+	branch ui_soft_swtich_init_next, blank
+	fetch 1,mem_wakup_from_power_flag	
+	bbit0 2,ui_soft_switch_power_on	
+ui_soft_swtich_init_next:		
+	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_le_uuid_table_conf:
+	setarg mem_shutter_le_uuid_sup
+	store 2,mem_ui_le_uuid_table	//BLE ATT LIST END
+	rtn
+shutter_dy_le_uuid_table_conf:
+	setarg BLE_SHUTTER_DY_GATT_LIST_ADDR	//BLE ATT LIST 
+	store 2,mem_ui_le_uuid_table	//BLE ATT LIST END
+	rtn
+/*************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 0x0002
+	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 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,0x0bb8
+	setsect 1,0x02ee
+	store 4,mem_ble_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
+	setarg mem_shutter_nv_data
+	store 2,mem_nv_data_ptr
+	jam 0x05,mem_nv_data_number
+	fetch 1,mem_shutter_dy_conf
+	beq SHUTTER_TYPE,shutter_le_uuid_table_conf
+	beq SHUTTER_DY_TYPE,shutter_dy_le_uuid_table_conf
+	rtn	
+	
+
+/*************shutter default_init ending*********************/
+
+
+
+
+
+else
+	branch assert
+	
+endif
Index: program/app_shutter_dy.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_shutter_dy.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/app_shutter_dy.prog	(working copy)
@@ -0,0 +1,1306 @@
+
+ifdef COMPILE_SHUTTER
+
+/*************dy config*********************/
+shutter_dy_6_key_conf:
+	//6key
+	fetch SHUTTER_SIX_KEY,mem_shutter_dy_key_conf
+	store SHUTTER_SIX_KEY,mem_shutter_key_conf0
+	jam SHUTTER_SIX_KEY,mem_shutter_key_num
+	setarg mem_shutter_key_num
+	store 2,mem_keyscan_ptr
+	rtn
+
+shutter_dy_7_key_conf:
+	//7key
+	fetch SHUTTER_SEVEN_KEY,mem_shutter_dy_key_conf
+	store SHUTTER_SEVEN_KEY,mem_shutter_key_conf0
+	jam SHUTTER_SEVEN_KEY,mem_shutter_key_num
+	setarg mem_shutter_key_num
+	store 2,mem_keyscan_ptr
+	rtn
+
+shutter_dy_key_conf:
+	fetch 1,mem_shutter_key_num_conf
+	beq SHUTTER_SIX_KEY,shutter_dy_6_key_conf
+	beq SHUTTER_SEVEN_KEY,shutter_dy_7_key_conf
+	rtn
+	
+shutter_dy_adv_conf:
+	bpatch patch0c_3,mem_patch0c
+	//adv data
+	fetch 8,mem_shutter_ble_discovery_time_conf
+	store 8,mem_ble_shutter_discovery_timeout
+	setarg 0x0096
+	store 2,mem_ble_shutter_reconn_timeout
+
+	fetch 7,mem_shutter_led_on_light_dark_led_conf
+	store 7,mem_shutter_led_struct_app_led
+	fetch 7,mem_shutter_led_off_light_dark_led_conf
+	store 7,mem_shutter_power_off_led_style
+	
+	fetch 4,mem_shutter_reconn_blink_on_time_conf
+	store 4,mem_ble_shutter_reconn_blink_on_time
+	fetch 4,mem_shutter_discovery_blink_on_time_conf
+	store 4,mem_ble_shutter_discovery_blink_on_time
+	/*
+	fetch 8,mem_le_dy_adv_data
+	store 8,mem_le_adv_data
+	fetch 3,mem_le_dy_adv_data+8
+	store 3,mem_le_adv_data+8
+	
+	fetch 8,mem_le_dy_scan_data
+	store 8,mem_le_scan_data
+	fetch 4,mem_le_dy_scan_data+8
+	store 4,mem_le_scan_data+8
+	*/
+	
+	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 BLE_SHUTTER_DY_GATT_LIST_ADDR	//BLE ATT LIST 
+	store 2,mem_ui_le_uuid_table
+
+	call shutter_load_dy_keyvalue_buffer_config_form_DataRom
+
+	fetch 8,mem_ble_shutter_dy_interval_min_new
+	store 8,mem_ble_shutter_interval_min_new
+	rtn
+
+
+
+shutter_dy_init:
+	call enable_authrom
+	rtn wake
+
+	call shutter_dy_key_conf
+	call shutter_dy_adv_conf
+
+	setarg shutter_le_parse_l2cap
+	store 2,mem_le_l2cap_parse_cb
+
+	setarg shutter_dy_process_idle
+	store 2,mem_cb_idle_process
+		
+	setarg shutter_dy_process_bb_event
+	store 2,mem_cb_bb_event_process
+
+	setarg ble_shutter_dy_receive_data
+	store 2,mem_cb_att_write
+
+	setarg shutter_dy_le_bb_event_timer
+	store 2,mem_cb_event_timer
+
+	setarg shutter_dy_key_change
+	store 2,mem_cb_shutter_keycan
+
+	call shutter_common_init
+	setarg 0x27
+ 	store 2,mem_le_pairing_handle
+	fetch 8,mem_ble_shutter_interval_min_new
+	store 8,mem_ble_shutter_interval_min
+	call shutter_dy_iphone_every_move_max_set
+	bpatch patch0c_4,mem_patch0c
+	branch shutter_power_switch
+
+
+shutter_dy_process_idle:
+	call shutter_dy_shutter_send_data_to_master
+	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
+	branch shutter_dy_keyscan_key_process
+
+shutter_dy_iphone_every_move_max_set:	
+	setarg 0x1f
+	mul32 pdata,EVERY_PAYLOAD_LEN,pdata
+	arg mem_shutter_mousekey_value_list,temp
+	iadd temp,rega
+	increase 3,rega
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,temp
+	istoret 1,rega
+	increase 11,rega
+	arg 0xfff,pdata
+	isub temp,pdata
+	lshift4 pdata,pdata
+	istore 2,rega
+	rtn
+	
+shutter_dy_shutter_send_data_to_master:	
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,shutter_dy_pop_queue_to_ble_data
+	arg mem_queue_curr_num,contw
+	arg 35,loopcnt
+	branch clear_mem
+
+shutter_dy_pop_queue_to_ble_data:
+	call le_fifo_check_nearly_full
+	nrtn blank
+	call queue_empty
+	rtn blank
+	fetcht 4,mem_key_send_clk
+	copy clkn_bt,pdata
+	isub temp,temp
+	rtn zero
+	nbranch shutter_dy_pop_queue_to_ble_data2, positive
+	fetch 1,mem_send_data_delay
+	isub temp,null
+	rtn positive
+shutter_dy_pop_queue_to_ble_data2:
+	copy clkn_bt,pdata
+	store 4,mem_key_send_clk	
+	call queue_pop_one_byte
+	nrtn user
+	pincrease -1
+	mul32 pdata,10,pdata
+	arg mem_shutter_mousekey_value_list,temp
+	iadd temp,contr
+	branch le_send_notify_from_list
+
+
+shutter_dy_le_bb_event_timer:
+	call shutter_dy_shutter_1s_timer
+	call shutter_dy_iphone_move_mid_timer
+	call shutter_dy_clear_key_state_timer
+	call shutter_check_sleep_timer
+	branch shutter_dy_check_power_off_timer
+	
+shutter_dy_iphone_move_mid_timer:
+	arg mem_shutter_move_mid_timer,regc
+	arg shutter_dy_iphone_move_mid_timeout,regb
+	branch timer_single_step
+
+shutter_dy_iphone_move_mid_timeout:
+	call queue_empty
+	nrtn blank
+	fetch 2,mem_key_value_xmem
+	nrtn blank
+shutter_dy_iphone_move_mid:
+	call shutter_dy_check_iphone
+	branch shutter_dy_android_like_loaction_mid,blank
+	copy queue,pdata
+	compare 0x04,pdata,0x07 //SHUTTER_UP_KEY_NUM
+	branch shutter_dy_iphone_up_mid,true
+
+	copy queue,pdata
+	compare 0x01,pdata,0x07 //SHUTTER_LIKE_KEY_NUM
+	branch shutter_dy_iphone_like_mid,true
+	arg mem_shutter_iphone_move_mid,regc
+	branch push_buffer_in_queue
+
+shutter_dy_android_like_loaction_mid:
+	arg mem_shutter_android_move_mid,regc
+	branch push_buffer_in_queue
+
+shutter_dy_iphone_up_mid:
+	arg mem_shutter_iphone_up_mid,regc
+	branch push_buffer_in_queue
+
+shutter_dy_iphone_like_mid:
+	arg mem_shutter_iphone_like_mid,regc
+	branch push_buffer_in_queue
+
+shutter_dy_clear_key_state_timer:
+	arg mem_shutter_like_timeout,regc
+	arg shutter_dy_clear_key_state_timeout,regb
+	branch timer_single_step
+
+shutter_dy_clear_key_state_timeout:
+	arg SHUTTER_KEY_CONF_SATE_BYTES,loopcnt
+	arg mem_shutter_key_state1,contw
+	branch clear_mem
+
+
+shutter_dy_check_power_off_timer:
+	arg mem_shutter_power_off_timer,regc
+	arg shutter_dy_check_power_off_timeout,regb
+	branch timer_single_step
+shutter_dy_check_power_off_timeout:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BLE_CONNECTED,shutter_wait_power_off
+	branch app_enter_hibernate
+
+shutter_dy_process_bb_event:
+	copy regc,pdata
+	beq BT_EVT_LE_CONNECTED,ble_shutter_dy_process_baseband_connect
+	beq BT_EVT_LE_DISCONNECTED,ble_shutter_dy_process_baseband_disconnect
+	beq BT_EVT_LE_PAIRING_SUCCESS,ble_shutter_dy_pairing_success
+	rtneq BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP
+	beq BT_EVT_LE_START_ENC,shutter_dy_le_find_service_hand_by_uuid
+	branch shutter_process_bb_event
+
+ble_shutter_dy_pairing_success:
+	jam 1,mem_shutter_pairing_success
+	call shutter_dy_clear_move_config
+//	setarg ANDROID_INITIAL_MOVE_X
+	fetch 2,mem_android_initial_move_x
+	store 2, mem_shutter_move_data_x
+//	arg ANDROID_INITIAL_MOVE_Y,temp
+	fetcht 2,mem_android_initial_move_y
+	setarg 0xfff
+	isub temp,pdata
+	store 2, mem_shutter_move_data_y
+	rtn
+
+ble_shutter_dy_process_baseband_disconnect:
+	jam 0,mem_shutter_le_conned
+	jam 0,mem_shutter_pairing_success
+	call shutter_dy_move_mode_disable
+	branch ble_shutter_process_baseband_disconnect
+	
+ble_shutter_dy_process_baseband_connect:
+	copy clkn_bt,pdata
+	store 4,mem_key_send_clk
+	call shutter_dy_remote_not_iphone
+	branch ble_shutter_process_baseband_connect
+	
+
+shutter_dy_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
+	branch enable_user2
+
+shutter_dy_key_change:
+	call shutter_dy_check_send_data
+	nrtn user2 
+	deposit rega
+	branch shutter_dy_shutter_key_release,blank//no data release
+shutter_dy_key_press:
+	jam 1,mem_shutter_key_pressed
+	call app_led_on
+	call shutter_dy_key_press_clk
+	call shutter_dy_jude_queue_size
+	rtn positive
+	copy queue,pdata
+	fetcht 1,mem_last_press_key_value
+	isub temp,null
+	ncall shutter_dy_iphone_check_move_mid,zero
+	copy queue,pdata
+	store 1,mem_last_press_key_value
+	fetcht 1,mem_move_mode_key_index
+	isub temp,null
+	branch shutter_dy_key_move_to_specify_location,zero
+	fetch 1,mem_move_mode_trigger_enable
+	nbranch shutter_dy_move_set,blank
+shutter_dy_page_set:
+	call shutter_dy_le_get_press_ptr
+	arg MAX_QUEUE_NEW_PRESS,pdata
+	branch shutter_dy_push_queue_press_or_release
+
+shutter_dy_move_set:
+	call shutter_dy_jude_clear_move_config
+	copy queue,pdata
+	beq SHUTTER_LIKE_KEY_NUM,shutter_dy_page_set
+	call shutter_dy_check_move_data
+	branch shutter_dy_move_to_specify_location
+
+shutter_dy_key_move_to_specify_location:
+	jam 1,mem_shutter_first_move
+	branch shutter_dy_move_to_specify_location
+
+shutter_dy_iphone_check_move_mid:
+	bpatch patch0c_5,mem_patch0c
+	fetch 1,mem_move_mode_trigger_enable
+	branch shutter_dy_iphone_move_mid,blank
+	copy queue,pdata
+	beq SHUTTER_LIKE_KEY_NUM,shutter_dy_iphone_move_mid
+	rtn
+shutter_dy_key_press_clk:
+	arg SHUTTER_KEY_CONF_SATE_BYTES,pdata
+	imul32 queue,pdata
+	arg mem_shutter_key_state0,regc
+	iadd regc,regc
+	copy clkn_bt,pdata
+	istore KEY_STATE_PRESS_CLK_LENGTH,regc
+	increase KEY_STATE_PRESS_COUNT_OFFSET,regc
+	ifetch 1,regc
+	increase 1,pdata
+	istore 1,regc
+	rtn
+shutter_dy_shutter_key_release:
+	bpatch patch0c_6,mem_patch0c
+	fetch 1,mem_move_mode_trigger_enable
+	call app_led_off,blank
+shutter_dy_shutter_key_release_time:
+	arg SHUTTER_KEY_CONF_SATE_BYTES,pdata
+	imul32 queue,pdata
+	arg mem_shutter_key_state0,regc
+	iadd regc,regc
+	ifetcht  4,regc
+	sub temp,0,null
+	rtn zero //already release
+	copy clkn_bt,pdata
+	isub temp,temp
+	ncall ui_timer_timeout,positive
+	add regc,KEY_STATE_LONGPRESS_OFFSET,contr
+	ifetch 1,contr
+	nbranch shutter_dy_push_queue_long_release, blank
+	increase KEY_STATE_RELEASE_CLK_OFFSET,regc
+	copy clkn_bt,pdata
+	istore KEY_STATE_RELEASE_CLK_LENGTH,regc
+	rtn
+
+shutter_dy_push_queue_release:
+	add regc,4,contr
+	ifetch 1,contr
+	branch shutter_dy_push_queue_release1
+
+shutter_dy_push_queue_release1:
+	call shutter_clear_dy_key_state
+	fetch 1,mem_move_mode_trigger_enable
+	nbranch shutter_dy_move_mode_queue_release,blank
+shutter_dy_push_queue_release1_next:
+	call shutter_dy_jude_queue_size
+	rtn positive
+	call shutter_dy_le_get_release_ptr
+	copy queue,pdata
+	beq SHUTTER_PHOTO_KEY_NUM,shutter_dy_le_get_release_ptr_volume
+	arg MAX_QUEUE_NUM_RELEASE,pdata
+shutter_dy_push_queue_press_or_release:
+	imul32 queue,pdata
+	iadd regc,regc
+	branch push_buffer_in_queue
+
+shutter_dy_move_mode_queue_release:
+	copy queue,pdata
+	beq SHUTTER_LIKE_KEY_NUM,shutter_dy_push_queue_release1_next
+	beq SHUTTER_PHOTO_KEY_NUM,shutter_dy_push_queue_release1_next
+	rtn
+	
+shutter_dy_jude_queue_size:
+	call queue_get_size
+	ifetcht 1,contr
+	isub temp,pdata
+	sub pdata,MAX_QUEUE_NEW_PRESS,null
+	rtn
+	
+shutter_dy_push_queue_long_release:
+	jam 1,mem_shutter_long_key_released_flag
+	call shutter_clear_dy_key_state
+	arg mem_key0_long_release,regc
+	arg MAX_QUEUE_NUM_LONG_RELEASE,pdata
+	branch shutter_dy_push_queue_press_or_release
+	
+shutter_clear_dy_key_state:
+	arg SHUTTER_KEY_CONF_SATE_BYTES,loopcnt
+	copy regc,contw
+	branch clear_mem
+
+shutter_dy_keyscan_key_process:
+	fetch 2,mem_key_value_xmem
+	store 2,mem_key_value_retention
+	call shutter_dy_keyscan_key_process_next
+	fetch 2,mem_key_value_retention
+	store 2,mem_key_value_xmem
+	
+	arg 0,queue
+	fetch 1,mem_shutter_key_num
+	copy pdata,loopcnt
+	arg mem_shutter_key_state0,regc
+shutter_dy_keyscan_key_check_release_loop:	
+	copy loopcnt,pdata
+	store 2,mem_temp
+	copy regc,pdata
+	store 2,mem_regc
+	copy queue,pdata
+	store 2,mem_temp+2
+	call shutter_dy_keyscan_key_check_release
+	
+	fetch 2,mem_regc
+	copy pdata,regc
+	fetch 2,mem_temp+2	
+	copy pdata,queue
+	call shutter_dy_keyscan_key_check_long_press
+	
+	fetch 2,mem_temp+2
+	add pdata,1,queue
+	fetch 2,mem_regc
+	add pdata,SHUTTER_KEY_CONF_SATE_BYTES,regc
+	fetch 2,mem_temp
+	copy pdata,loopcnt
+	loop shutter_dy_keyscan_key_check_release_loop
+	rtn
+	
+shutter_dy_keyscan_key_check_long_press:
+	ifetch KEY_STATE_PRESS_CLK_LENGTH,regc
+	rtn blank
+	copy pdata,temp
+	copy clkn_bt,pdata
+	isub temp,temp	
+	nrtn positive
+	setarg 2500 //1000ms 3200
+	isub temp,null
+	rtn positive
+	copy clkn_bt,pdata
+	istore 4,regc
+	increase KEY_STATE_LONGPRESS_OFFSET,regc
+	setarg 1  //long press flag
+	istore KEY_STATE_LONGPRESS_LENGTH,regc
+	fetch 1,mem_shutter_long_key_released_flag
+	rtn blank
+	jam 0,mem_shutter_long_key_released_flag
+	bpatch patch0c_7,mem_patch0c
+	fetch 1,mem_move_mode_set
+	beq MOVE_COMBINE_KEY,shutter_dy_key_long_press_set_key_normal
+	beq MOVE_SINGLE_KEY,shutter_dy_key_long_press_set_move_trigger
+	rtn
+	
+shutter_dy_key_long_press_set_key_normal:
+	arg mem_key0_long_press,regc
+	arg MAX_QUEUE_NUM_LONG_RELEASE,pdata
+	branch shutter_dy_push_queue_press_or_release
+
+shutter_dy_key_long_press_set_move_trigger:
+	copy queue,pdata
+	fetcht 1,mem_move_mode_key_index
+	isub temp,null
+	nbranch shutter_dy_key_long_press_set_key_normal,zero	
+	fetch 1,mem_move_mode_trigger_enable
+	setflip 0,pdata
+	store 1,mem_move_mode_trigger_enable
+	nrtn blank
+shutter_dy_move_mode_disable:
+	jam 0,mem_move_mode_trigger_enable
+	branch app_led_off
+
+shutter_dy_keyscan_key_check_release:
+	add regc,KEY_STATE_RELEASE_CLK_OFFSET,regb
+	ifetch KEY_STATE_RELEASE_CLK_LENGTH,regb
+	rtn blank
+	copy pdata,temp
+	copy clkn_bt,pdata
+	isub temp,temp
+	ncall ui_timer_timeout,positive
+	setarg 1000 //100ms 320
+	isub temp,null
+	branch shutter_dy_push_queue_release
+shutter_dy_keyscan_key_process_next:
+	fetch 2,mem_key_num_ptr
+	ifetch 1,pdata
+	rtn blank
+	
+	setarg 0
+	store 2,mem_key_value_temp
+	call keyscan_scan_key
+	nbranch lpm_button_clean_wake_lock,user
+	call lpm_button_get_wake_lock
+	disable user
+	bpatch patch0d_0,mem_patch0d
+	fetch 1,mem_move_mode_set
+	beq MOVE_SINGLE_KEY,shutter_dy_skip_check_combine_key
+	call shutter_dy_check_combine_key_release
+	call shutter_dy_check_combine_key	
+	rtn user
+shutter_dy_skip_check_combine_key:	
+	fetch 2,mem_key_value_temp
+	store 2,mem_key_value_temp4
+	jam 0,mem_key_value_temp6
+	force 0,queue
+	branch keyscan_key_lp1
+
+shutter_dy_check_combine_key:
+	arg 0,queue
+shutter_dy_check_combine_key_loop:
+	arg mem_combine_key0,regb
+	arg 2,pdata
+	imul32 queue,pdata
+	iadd regb,regb
+	ifetch 2,regb
+	
+	rtn blank
+	fetcht 2,mem_key_value_temp
+	ixor temp,null
+	branch shutter_dy_check_combine_key_parse,zero
+	increase 1,queue
+	branch shutter_dy_check_combine_key_loop
+	
+shutter_dy_check_combine_key_parse:
+	store 2,mem_combine_key_state0	
+	call app_led_on
+	arg mem_combine_key0_press,regc
+	arg MAX_QUEUE_NUM_COMBINEKEY,pdata
+	imul32 queue,pdata
+	iadd regc,regc
+	call shutter_dy_push_buffer_in_queue
+	branch shutter_dy_combine_key_enableuser
+	
+shutter_dy_push_buffer_in_queue:
+	call shutter_dy_jude_clear_move_config
+	ifetch 1,regc
+	rtn blank
+	call shutter_dy_check_move_data
+shutter_dy_move_to_specify_location:
+	call shutter_dy_jude_clear_move_config
+	call shutter_dy_move_down_left_corner
+	call shutter_dy_move_x_max
+	call shutter_dy_move_y_max
+	arg 0x05,pdata
+	call queue_push_one_byte
+	call shutter_dy_check_iphone
+	rtn blank
+	jam 120,mem_send_data_delay
+	arg 0x06,pdata
+	branch queue_push_one_byte
+
+shutter_dy_move_down_left_corner_count_set:
+	fetcht 1,mem_shutter_back_count
+	call shutter_dy_check_iphone
+	rtn blank
+	fetcht 1,mem_shutter_iphone_beyond_y_count
+	increase 1,temp
+	fetch 1,mem_shutter_first_move
+	rtn blank
+	fetcht 1,mem_shutter_back_count
+	jam 0,mem_shutter_first_move
+	rtn
+
+shutter_dy_move_down_left_corner:
+	call shutter_dy_move_down_left_corner_count_set
+	copy temp,pdata
+	rtn blank
+	store 1,mem_shutter_back_count_cache
+shutter_dy_move_down_left_corner_loop:
+	arg 0x13,pdata
+	call queue_push_one_byte
+	fetch 1,mem_shutter_back_count_cache
+	increase -1,pdata
+	store 1,mem_shutter_back_count_cache
+	rtn blank
+	branch shutter_dy_move_down_left_corner_loop
+
+shutter_dy_move_x_max:
+	fetch 1,mem_shutter_iphone_beyond_x_count
+	rtn blank
+	store 1,mem_shutter_iphone_beyond_x_cache
+shutter_dy_move_x_max_number:
+	arg 0x20,pdata
+	call queue_push_one_byte
+	fetch 1,mem_shutter_iphone_beyond_x_cache
+	increase -1,pdata
+	store 1,mem_shutter_iphone_beyond_x_cache
+	rtn blank
+	branch shutter_dy_move_x_max_number
+
+shutter_dy_move_y_max:
+	fetch 1,mem_shutter_iphone_beyond_y_count
+	rtn blank
+	store 1,mem_shutter_iphone_beyond_y_cache
+shutter_dy_move_y_max_number:
+	arg 0x21,pdata
+	call queue_push_one_byte
+	fetch 1,mem_shutter_iphone_beyond_y_cache
+	increase -1,pdata
+	store 1,mem_shutter_iphone_beyond_y_cache
+	rtn blank
+	branch shutter_dy_move_y_max_number
+
+shutter_dy_check_combine_key_release:
+	fetch 2,mem_combine_key_state0
+	rtn blank
+	fetcht 2,mem_key_value_temp
+	sub temp,0,null
+	branch shutter_dy_check_combine_key_release_all,zero
+	isub temp,null
+	rtn zero
+	storet 2,mem_combine_key_state0
+	fetch 2,mem_combine_key_release_value
+	isub temp,null
+	call app_led_off,zero
+shutter_dy_combine_key_enableuser:
+	fetch 2,mem_key_value_temp
+	store 2, mem_key_value_retention
+	branch enable_user
+shutter_dy_check_combine_key_release_all:
+	call app_led_off
+	arg mem_combine_key_release,regc
+	call shutter_dy_push_buffer_in_queue
+	setarg 0
+	store 2,mem_combine_key_state0
+	jam 50,mem_shutter_1s_timer
+	call shutter_dy_combine_key_enableuser
+	fetch 1,mem_shutter_key_num
+	mul32 pdata,SHUTTER_KEY_CONF_SATE_BYTES,loopcnt
+	arg mem_shutter_key_state0,contw
+	branch clear_mem
+shutter_dy_check_move_data:
+	bpatch patch0d_1,mem_patch0d
+	fetch 1,mem_move_mode_set
+	beq MOVE_SINGLE_KEY,shutter_dy_check_move_data_single_key
+	beq MOVE_COMBINE_KEY,shutter_dy_check_move_data_combine_key
+	rtn
+shutter_dy_check_move_data_single_key:
+	copy queue,pdata
+	beq SHUTTER_LEFT_KEY_NUM,shutter_dy_move_left
+	beq SHUTTER_RIGHT_KEY_NUM,shutter_dy_move_right
+	beq SHUTTER_UP_KEY_NUM,shutter_dy_move_up
+	beq SHUTTER_DOWN_KEY_NUM,shutter_dy_move_down
+	rtn
+shutter_dy_check_move_data_combine_key:
+	ifetch 1,regc
+	beq 0x01,shutter_dy_move_left
+	beq 0x02,shutter_dy_move_right
+	beq 0x03,shutter_dy_move_up
+	beq 0x04,shutter_dy_move_down
+	beq 0x05,shutter_dy_get_move_data
+	rtn
+shutter_dy_get_move_data:
+	call shutter_dy_check_iphone
+	nbranch shutter_dy_get_move_data_iphone,blank
+	setarg 4
+	mul32 pdata,EVERY_PAYLOAD_LEN,pdata
+	arg mem_shutter_mousekey_value_list,temp
+	iadd temp,contw
+	increase 3,contw
+	fetch 3,mem_shutter_move_data
+	istore 3,contw
+	rtn
+shutter_dy_get_move_data_iphone:
+	setarg 4
+	mul32 pdata,EVERY_PAYLOAD_LEN,pdata
+	arg mem_shutter_mousekey_value_list,temp
+	iadd temp,contw
+	increase 3,contw
+	fetch 2,mem_shutter_move_data_x
+	istore 3,contw
+	increase 7,contw
+	fetch 2,mem_shutter_move_data_y
+	lshift4 pdata,pdata
+	lshift8 pdata,pdata
+	istore 3,contw
+	rtn
+	//branch p_store_move_config_info
+shutter_dy_move_x_empty_check:
+	fetch 1,mem_shutter_iphone_beyond_x_count
+	rtn blank
+	increase -1,pdata
+	store 1,mem_shutter_iphone_beyond_x_count
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,pdata
+	rtn
+shutter_dy_every_move_size_set:
+	arg ANDROID_EVERY_MOVE_SIZE,temp
+	call shutter_dy_check_iphone
+	rtn blank
+	arg IPHONE_EVERY_MOVE_SIZE,temp
+	rtn
+shutter_dy_move_left:
+	call shutter_dy_every_move_size_set
+	fetch 2,mem_shutter_move_data_x
+	isub temp,null
+	ncall shutter_dy_move_x_empty_check,positive
+	nrtn positive//if move_x to zero,rtn
+	isub temp,pdata
+shutter_dy_move_store_x:
+	store 2,mem_shutter_move_data_x
+shutter_dy_move_data_store:
+	bpatch patch0d_2,mem_patch0d
+	fetch 2,mem_shutter_move_data_x
+	fetcht 2,mem_shutter_move_data_y
+	lshift8 temp,temp
+	lshift4 temp,temp
+	iadd temp,pdata
+	store 3,mem_shutter_move_data
+	branch shutter_dy_get_move_data
+shutter_dy_move_x_check_max:
+	fetch 2,mem_shutter_move_data_x
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,temp
+	isub temp,temp
+	nrtn positive
+	copy temp,pdata
+	fetcht 1,mem_shutter_iphone_beyond_x_count
+	sub temp,0x03,null
+	branch shutter_dy_clear_move_x,zero
+	increase 1,temp
+	storet 1,mem_shutter_iphone_beyond_x_count
+	branch shutter_dy_move_store_x
+shutter_dy_clear_move_x:
+	jam 0,mem_shutter_iphone_beyond_x_count
+	arg 0,pdata
+	branch shutter_dy_move_store_x
+shutter_dy_move_right:
+	call shutter_dy_check_iphone
+	ncall shutter_dy_move_x_check_max,blank
+	call shutter_dy_every_move_size_set
+	fetch 2,mem_shutter_move_data_x
+shutter_dy_move_right_next:
+	iadd temp,pdata
+	arg 0xfff,temp
+	call ceiling
+	branch shutter_dy_move_store_x
+	
+shutter_dy_move_up:
+	call shutter_dy_every_move_size_set
+	fetch 2,mem_shutter_move_data_y
+	isub temp,pdata
+	store 2,mem_shutter_move_data_y
+shutter_dy_move_y_check_max:
+	fetcht 2,mem_shutter_move_data_y
+	call shutter_dy_check_iphone
+	branch shutter_dy_move_data_store,blank
+	setarg 0xfff
+	isub temp,pdata
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,temp
+	isub temp,temp
+	nbranch shutter_dy_move_data_store, positive
+	setarg 0xfff
+	isub temp,pdata
+	fetcht 1,mem_shutter_iphone_beyond_y_count
+	sub temp,0x05,null
+	branch shutter_dy_clear_move_y,zero
+	increase 1,temp
+	storet 1,mem_shutter_iphone_beyond_y_count
+	branch shutter_dy_move_store_y
+shutter_dy_clear_move_y:
+	jam 0,mem_shutter_iphone_beyond_y_count
+shutter_dy_android_move_y_empty_check:
+	setarg 0xfff
+	branch shutter_dy_move_store_y
+	
+shutter_dy_move_y_empty_check:
+	call shutter_dy_check_iphone
+	branch shutter_dy_android_move_y_empty_check,blank
+	fetch 1,mem_shutter_iphone_beyond_y_count
+	branch shutter_dy_android_move_y_empty_check, blank
+	increase -1,pdata
+	store 1,mem_shutter_iphone_beyond_y_count
+	setarg 0xfff
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,temp
+	isub temp,pdata
+	iadd rega,pdata
+shutter_dy_move_store_y:	
+	store 2,mem_shutter_move_data_y
+	branch shutter_dy_move_data_store
+shutter_dy_move_down:
+	call shutter_dy_every_move_size_set
+	fetch 2,mem_shutter_move_data_y
+shutter_dy_move_down_next:
+	iadd temp,pdata
+	arg 0xfff,temp
+	isub temp,rega
+	branch shutter_dy_move_y_empty_check,positive
+	branch shutter_dy_move_store_y
+	
+
+ble_shutter_dy_receive_data:
+	fetch 2,mem_le_att_handle
+	beq GATT_KEYBOARD_WRITE_HANDLE_NEW,ble_shutter_process_reconnect_complete
+	rtn
+
+shutter_dy_le_find_service_hand_by_uuid: 
+	arg 23,rega
+	arg LE_L2CAP_CID_ATT,regb
+	call le_fifo_malloc_tx_l2cap
+	setarg ATTOP_FIND_BY_TYPE_VALUE_REQUEST
+	istore 1,contw
+	setarg 0x0001		//start handle
+	istore 2,contw
+	setarg 0xffff		//end handle
+	istore 2,contw
+	setarg 0x2800		//uuid type
+	istore 2,contw
+	arg mem_le_search_service_uuid,contr
+	branch memcpy16
+
+shutter_le_parse_l2cap:
+	fetch 2,mem_le_payload_ptr
+	add pdata,2,contr	//l2cap length
+	ifetch 2,contr
+	beq LE_L2CAP_CID_ATT,shutter_dy_le_parse_att
+	beq LE_L2CAP_CID_SMP,le_parse_smp
+	beq LE_L2CAP_CID_SIGNAL,le_parse_signaling
+	rtn
+
+shutter_dy_le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+	beq ATTOP_FIND_BY_TYPE_VALUE_RESPONSE,shutter_dy_le_parse_att_find_by_type_value_rsp
+	beq ATTOP_ERROR_RESPONSE,shutter_dy_le_parse_error_rsp
+	beq ATTOP_READ_REQUEST,shutter_dy_le_parse_att_read_request
+	beq ATTOP_READ_BLOB_REQUEST,shutter_dy_le_parse_att_read_blob_request
+	branch le_parse_att2
+
+shutter_dy_le_parse_att_read_blob_request:
+	ifetch 2,contr
+	store 2,mem_le_att_offset
+	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
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_read_blob_response+7,zero
+	call shutter_dy_check_iphone
+	nbranch shutter_dy_le_parse_att_read_blob_request_ios,blank
+	fetch 2,mem_shutter_le_map_len_android
+	branch shutter_dy_le_parse_att_read_blob_request2
+	
+shutter_dy_le_parse_att_read_blob_request_ios:
+	fetch 2,mem_shutter_le_map_len_ios
+shutter_dy_le_parse_att_read_blob_request2:
+	arg mem_shutter_le_hid_map,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
+	branch le_send_att_read_blob_response_less
+
+shutter_dy_le_parse_att_read_request:
+	fetcht 2,mem_le_att_handle
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_READ_AUTH,shutter_dy_le_send_att_read_response_check_auth
+	branch le_send_att_read_response
+shutter_dy_le_send_att_read_response_check_auth:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_read_response,zero
+	call le_check_encrypt_state
+	nbranch shutter_dy_le_send_att_read_response,user
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+shutter_dy_le_send_att_read_response:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_read_response,zero
+	arg mem_shutter_le_hid_map,contr
+	force 22,pdata
+	branch le_send_att_read_response_less
+shutter_dy_le_parse_att_find_by_type_value_rsp:
+shutter_dy_le_remote_iphone:
+	bpatch patch0d_3,mem_patch0d
+	jam 5,mem_shutter_back_count
+	jam 1,mem_iphone_flag
+	jam 1,mem_last_shutter_le_iphone_flag
+	jam 240,mem_send_data_delay
+	jam 10,mem_shutter_move_mid_timer
+	jam 1,mem_shutter_first_move
+	call shutter_dy_load_move_config_info
+	fetch 1,mem_shutter_pairing_success
+	rtn blank
+	call shutter_dy_clear_move_config
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,temp
+//	setarg IPHONE_INITIAL_MOVE_X
+	fetch 2,mem_iphone_initial_move_x
+	arg mem_shutter_move_data_x,rega
+	arg mem_shutter_iphone_beyond_x_count,regb
+	call shutter_dy_iphone_move_initial_set
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,temp
+//	setarg IPHONE_INITIAL_MOVE_Y
+	fetch 2,mem_iphone_initial_move_y
+	arg mem_shutter_move_data_y,rega
+	arg mem_shutter_iphone_beyond_y_count,regb
+	call shutter_dy_iphone_move_initial_set
+	setarg 0xfff
+	fetcht 2,mem_shutter_move_data_y
+	isub temp,pdata
+	store 2,mem_shutter_move_data_y
+	rtn
+shutter_dy_iphone_move_initial_set:
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	remainder temp
+	istore 1,regb
+	istoret 2,rega
+	rtn
+shutter_dy_le_parse_error_rsp:
+	increase -2,contr
+	ifetch 1,contr
+	beq ATTOP_FIND_BY_TYPE_VALUE_REQUEST,shutter_dy_not_iphone_read_conf
+	rtn
+shutter_dy_remote_not_iphone:
+	jam 1,mem_shutter_back_count
+	jam 0,mem_iphone_flag
+	jam 0,mem_last_shutter_le_iphone_flag
+	jam 10,mem_send_data_delay
+	rtn
+
+shutter_dy_not_iphone_read_conf:
+	call shutter_dy_remote_not_iphone
+	branch shutter_dy_load_move_config_info
+	
+shutter_dy_check_iphone:
+	fetch 1,mem_iphone_flag
+	rtn
+
+
+shutter_dy_le_get_press_ptr:	
+	arg mem_dy_key0_press,regc
+	call shutter_dy_check_iphone
+	rtn blank
+	jam 120,mem_send_data_delay
+	arg mem_key0_press_i,regc
+	rtn
+shutter_dy_le_get_release_ptr:	
+shutter_dy_le_get_release_ptr_set:
+	arg mem_key0_release_new,regc
+	call shutter_dy_check_iphone
+	rtn blank
+	arg mem_key0_release_new_i,regc
+	jam 12,mem_send_data_delay
+	copy queue,pdata
+	rtneq SHUTTER_LIKE_KEY_NUM
+	rtn
+shutter_dy_le_get_release_ptr_volume:
+	bpatch patch0d_4,mem_patch0d
+	fetch 1,mem_key3_press_count
+	setflip 0,pdata
+	store 1,mem_key3_press_count
+	beq 0,shutter_dy_le_get_release_ptr_set_volume_inc
+	beq 1,shutter_dy_le_get_release_ptr_set_volume_dec
+	rtn
+shutter_dy_le_get_release_ptr_set_volume_dec:
+	call shutter_dy_le_get_vol_dec_ptr
+	branch push_buffer_in_queue
+shutter_dy_le_get_release_ptr_set_volume_inc:
+	call shutter_dy_le_get_vol_inc_ptr
+	branch push_buffer_in_queue
+shutter_dy_le_get_vol_inc_ptr:
+	arg mem_key3_release_new,regc
+	call shutter_dy_check_iphone
+	rtn blank
+	arg mem_key3_release_new_i,regc
+	rtn
+shutter_dy_le_get_vol_dec_ptr:
+	arg mem_key3_release_new_t,regc
+	call shutter_dy_check_iphone
+	rtn blank
+	arg mem_key3_release_new_i_t,regc
+	rtn	
+shutter_dy_jude_clear_move_config:
+	fetch 1,mem_shutter_le_conned
+	nrtn blank
+	jam 1,mem_shutter_le_conned
+	branch shutter_dy_move_data_store
+shutter_dy_clear_move_config:
+	setarg 0
+	store 7,mem_move_config
+	rtn
+
+
+shutter_dy_write_otp_convert_data:
+	call shutter_dy_check_iphone
+	beq 0x01,shutter_dy_store_ios_config_data
+	beq 0x00,shutter_dy_store_android_config
+	rtn
+
+shutter_dy_read_otp_convert_data:
+	fetch 1,mem_otp_last_shutter_le_iphone_flag	//鍒ゆ柇鏄惁鏄疘OS
+	beq 0x01,shutter_dy_get_ios_config
+	beq 0x00,shutter_dy_get_android_config
+	rtn
+
+shutter_dy_store_ios_config_data:
+	fetch 1,mem_shutter_iphone_beyond_x_count
+	mul32 pdata,IPHONE_ONCE_MAX_MOVE_VALUE,pdata
+	copy pdata,temp
+	fetch 2,mem_shutter_move_data_x
+	iadd temp,pdata	//pdata = pdata+temp
+	store 2,mem_otp_shutter_move_data_x
+
+	fetch 1,mem_shutter_iphone_beyond_y_count
+	mul32 pdata,IPHONE_ONCE_MAX_MOVE_VALUE,pdata
+	copy pdata,temp
+	fetch 2,mem_shutter_move_data_y
+	copy pdata,rega
+	setarg 0xfff
+	isub rega,pdata	//pdata = pdata-rega
+	iadd temp,pdata	//pdata = pdata+temp
+	store 2,mem_otp_shutter_move_data_y
+
+	call shutter_dy_check_iphone
+//	fetch 1,mem_last_shutter_le_iphone_flag
+	store 1,mem_otp_last_shutter_le_iphone_flag
+	rtn
+
+shutter_dy_store_android_config:
+	fetch 2,mem_shutter_move_data_x
+	store 2,mem_otp_shutter_move_data_x
+	fetch 2,mem_shutter_move_data_y
+	store 2,mem_otp_shutter_move_data_y
+	call shutter_dy_check_iphone
+	store 1,mem_otp_last_shutter_le_iphone_flag
+	rtn
+shutter_dy_get_ios_config:
+	fetch 2,mem_otp_shutter_move_data_x
+	div pdata,IPHONE_ONCE_MAX_MOVE_VALUE
+	call wait_div_end
+	quotient pdata
+	remainder temp
+	store 1,mem_shutter_iphone_beyond_x_count
+	copy temp,pdata
+	store 2,mem_shutter_move_data_x
+	fetch 2,mem_otp_shutter_move_data_y
+	div pdata,IPHONE_ONCE_MAX_MOVE_VALUE
+	call wait_div_end
+	quotient pdata
+	remainder temp
+	store 1,mem_shutter_iphone_beyond_y_count
+	//copy temp,pdata
+	setarg 0xfff
+	isub temp,pdata	//pdata = pdata-temp
+	store 2,mem_shutter_move_data_y
+//	fetch 1,mem_otp_last_shutter_le_iphone_flag
+//	store 1,mem_last_shutter_le_iphone_flag
+	rtn
+shutter_dy_get_android_config:
+	fetch 2,mem_otp_shutter_move_data_x
+	store 2,mem_shutter_move_data_x
+	fetch 2,mem_otp_shutter_move_data_y
+	store 2,mem_shutter_move_data_y
+//	fetch 1,mem_otp_last_shutter_le_iphone_flag
+//	store 1,mem_last_shutter_le_iphone_flag
+	rtn
+	
+shutter_dy_store_move_config_info:
+	branch shutter_dy_campare_effective_addr_write_otp
+
+shutter_dy_load_move_config_info:
+	branch shutter_dy_campare_effective_addr_read_otp
+
+//寰幆鎵炬暟鎹紝鍒ゆ柇鏄惁涓虹┖鏁版嵁
+shutter_dy_shutter_uart_config_loop:
+	call shutter_dy_update_read_check_addr
+	fetch 2,mem_otp_read_offset_addr
+	call shutter_dy_shutter_read_move_config_from_otp_addr
+	jam 0,mem_shutter_first_read_flag
+	fetch 5,mem_otp_move_config
+	jam 0,mem_shutter_valid_data_flag
+	jam 0,mem_shutter_temp_count
+	call shutter_dy_campare_otp_data
+	fetch 1,mem_shutter_temp_count
+	rtneq 0
+	branch shutter_dy_shutter_uart_config_loop
+
+//绗竴娆′粠0x1fe0澶勫線鍓嶈
+shutter_dy_shutter_get_first_read_addr:
+//	setarg SHUTTER_EFUSE_START_OFFECT
+	fetch 2,mem_shutter_efuse_start_offset
+	increase -5,pdata
+	store 2,mem_otp_read_offset_addr
+	rtn
+
+//涓嬫璇伙紝鏇存柊mem_otp_read_offset_addr 鍦板潃
+shutter_dy_shutter_next_read_addr:
+	fetch 2,mem_otp_read_offset_addr
+	increase -5,pdata
+	store 2,mem_otp_read_offset_addr
+	rtn
+
+//涓婃璇伙紝鏇存柊mem_otp_read_offset_addr 鍦板潃
+shutter_dy_shutter_last_read_addr:
+	fetch 2,mem_otp_read_offset_addr
+	pincrease 5
+	store 2,mem_otp_read_offset_addr
+	rtn
+
+shutter_dy_shutter_read_ios_android_addr:
+	fetch 2,mem_otp_read_ios_android_addr
+	pincrease 5
+	store 2,mem_otp_read_ios_android_addr
+	//妫鏌ュ湪鍖洪棿鍐
+	fetch 2,mem_otp_read_ios_android_addr
+	copy pdata, temp
+//	setarg SHUTTER_EFUSE_START_OFFECT
+	fetch 2,mem_shutter_efuse_start_offset
+	isub temp,pdata	//pdata = pdata-temp
+	arg SHUTTER_PARA_TOTAL_NUM,temp	//temp = 5
+	isub temp,null	//pdata = pdata-temp, 澶т簬绛変簬0锛宲ositive缃1
+//	nrtn positive
+	nbranch shutter_dy_shutter_not_find_ios_or_android,positive
+	rtn
+
+shutter_dy_update_read_check_addr:
+	fetch 1,mem_shutter_first_read_flag	//绗1娆¤鏍囪瘑
+	beq 0x01,shutter_dy_shutter_get_first_read_addr
+	beq 0x00,shutter_dy_shutter_next_read_addr
+	rtn
+	
+//姣旇緝鏁版嵁锛屽垽鏂槸鍚︿负0
+shutter_dy_campare_otp_data:
+	arg 0x0,regb
+	copy regb, temp
+	fetch 2,mem_otp_shutter_move_data_x
+	icompare 0xffff,temp
+//	isub temp,pdata	//pdata = pdata-temp
+	ncall shutter_dy_set_shutter_valid_data_flag,true
+	arg 0x0,regb
+	copy regb, temp
+	fetch 2,mem_otp_shutter_move_data_y
+	icompare 0xffff,temp
+	ncall shutter_dy_set_shutter_valid_data_flag,true
+	arg 0x0,regb
+	copy regb, temp
+	fetch 1,mem_otp_last_shutter_le_iphone_flag
+	icompare 0xff,temp
+	ncall shutter_dy_set_shutter_valid_data_flag,true
+	rtn
+
+//mem_shutter_temp_count +1 鎿嶄綔
+shutter_dy_set_shutter_valid_data_flag:
+	fetch 1,mem_shutter_temp_count
+	pincrease 1
+	store 1,mem_shutter_temp_count
+	rtn
+shutter_dy_shutter_judge_ios_or_android:
+	jam 1,mem_shutter_temp_count
+	call shutter_dy_shutter_read_ios_android_addr
+	fetch 2,mem_otp_read_ios_android_addr
+	call shutter_dy_shutter_read_move_config_from_otp_addr
+	call shutter_dy_check_iphone
+	copy pdata, temp
+	fetch 1,mem_otp_last_shutter_le_iphone_flag
+	icompare 0xff,temp
+	call shutter_dy_clear_temp_count,true
+	
+	fetch 1,mem_shutter_temp_count
+	rtneq 0
+	branch shutter_dy_shutter_judge_ios_or_android
+
+
+shutter_dy_shutter_not_find_ios_or_android:
+	bpatch patch0d_5,mem_patch0d
+	call shutter_dy_clear_temp_count
+	call shutter_dy_check_iphone
+	branch shutter_dy_shutter_android_save_init_loaction,blank
+	branch shutter_dy_shutter_ios_save_init_loaction
+shutter_dy_shutter_android_save_init_loaction:
+//	setarg ANDROID_INITIAL_MOVE_X
+	fetch 2,mem_android_initial_move_x
+	store 2, mem_shutter_move_data_x
+//	arg ANDROID_INITIAL_MOVE_Y,temp
+	fetcht 2,mem_android_initial_move_y
+	setarg 0xfff
+	isub temp,pdata
+	store 2, mem_shutter_move_data_y
+	branch shutter_dy_store_move_config_info
+	
+shutter_dy_shutter_ios_save_init_loaction:
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,temp
+//	setarg IPHONE_INITIAL_MOVE_X
+	fetch 2,mem_iphone_initial_move_x
+	arg mem_shutter_move_data_x,rega
+	arg  mem_shutter_iphone_beyond_x_count,regb
+	call shutter_dy_iphone_move_initial_set
+	arg IPHONE_ONCE_MAX_MOVE_VALUE,temp
+//	setarg IPHONE_INITIAL_MOVE_Y
+	fetch 2,mem_iphone_initial_move_y
+	arg mem_shutter_move_data_y,rega
+	arg  mem_shutter_iphone_beyond_y_count,regb
+	call shutter_dy_iphone_move_initial_set
+	setarg 0xfff
+	fetcht 2,mem_shutter_move_data_y
+	isub temp,pdata
+	store 2,mem_shutter_move_data_y
+	branch shutter_dy_store_move_config_info
+	
+shutter_dy_clear_temp_count:
+	jam 0,mem_shutter_temp_count
+	rtn
+//鍙栨湁鏁堝湴鍧缁檓em_otp_write_offset_addr
+shutter_dy_campare_effective_addr_read_otp:
+	bpatch patch0d_6,mem_patch0d
+	jam 1,mem_shutter_first_read_flag
+	call shutter_dy_shutter_uart_config_loop
+	//鑾峰緱浜嗗湴鍧
+	//鏍￠獙鏄惁鏄秺鐣
+//	setarg SHUTTER_EFUSE_END_OFFECT
+	fetch 2,mem_shutter_efuse_end_offset
+	copy pdata, temp
+	fetch 2,mem_otp_read_offset_addr
+	isub temp,pdata	//pdata = pdata-temp
+	arg 0x0,temp	//temp = 0
+	isub temp,null	//null = pdata-temp, 澶т簬绛変簬0锛宲ositive缃1
+	nrtn positive
+	fetch 2,mem_otp_read_offset_addr
+	copy pdata, temp
+//	setarg SHUTTER_EFUSE_START_OFFECT
+	fetch 2,mem_shutter_efuse_start_offset
+	increase -5,pdata
+	isub temp,pdata	//pdata = pdata-temp
+	//璇讳笂涓娆″湴鍧
+//	ncall p_shutter_last_read_addr,zero
+	fetch 2,mem_otp_read_offset_addr
+	store 2,mem_otp_read_ios_android_addr
+	call shutter_dy_shutter_judge_ios_or_android
+	fetch 2,mem_otp_read_ios_android_addr
+	ncall shutter_dy_shutter_read_move_config_from_otp_addr,zero
+	
+	//妫鏌ヤ负0鍒欎笉璧嬪
+	jam 0,mem_shutter_temp_count
+	call shutter_dy_campare_otp_data
+	fetch 1,mem_shutter_temp_count
+	rtneq 0
+	branch shutter_dy_read_otp_convert_data
+	
+//鍙栨湁鏁堝湴鍧缁檓em_otp_write_offset_addr
+shutter_dy_campare_effective_addr_write_otp:
+	bpatch patch0d_7,mem_patch0d
+	jam 1,mem_shutter_first_read_flag
+	call shutter_dy_shutter_uart_config_loop
+	//鑾峰緱浜嗗湴鍧
+	//鏍￠獙鏄惁鏄秺鐣
+//	setarg SHUTTER_EFUSE_END_OFFECT
+	fetcht 2,mem_shutter_efuse_end_offset
+//	copy pdata, temp
+	fetch 2,mem_otp_read_offset_addr
+	isub temp,pdata	//pdata = pdata-temp
+	arg 0x0,temp	//temp = 0
+	isub temp,null	//pdata = pdata-temp, 澶т簬绛変簬0锛宲ositive缃1
+	nrtn positive
+	//妫鏌ュ湪鍖洪棿鍐
+	fetcht 2,mem_otp_read_offset_addr
+//	setarg SHUTTER_EFUSE_START_OFFECT
+	fetch 2,mem_shutter_efuse_start_offset
+	isub temp,pdata	//pdata = pdata-temp
+	arg 0x0,temp	//temp = 0
+	isub temp,null	//pdata = pdata-temp, 澶т簬绛変簬0锛宲ositive缃1
+	nrtn positive
+	fetch 2,mem_otp_read_offset_addr
+	store 2,mem_otp_write_offset_addr
+	call shutter_dy_write_otp_convert_data
+
+	branch shutter_dy_shutter_write_move_config_to_otp_addr
+	
+
+/* pdata=otp address, rega points to data, temp is count */
+shutter_dy_shutter_read_move_config_from_otp_addr:
+	arg SHUTTER_PARA_TOTAL_NUM,temp
+//	fetch 2,mem_otp_read_offset_addr
+	arg mem_otp_move_config,rega
+	branch otpd_read_data
+
+/* temp = otp address, rega pointers data, loopcnt is count */
+shutter_dy_shutter_write_move_config_to_otp_addr:
+	arg SHUTTER_PARA_TOTAL_NUM,loopcnt
+	arg mem_otp_move_config,rega
+	fetch 2, mem_otp_write_offset_addr
+	copy pdata,temp
+	branch otp_write
+
+shutter_dy_shutter_1s_timer:
+	arg mem_shutter_1s_timer,regc
+	arg shutter_dy_store_move_config_info,regb
+	branch timer_single_step
+
+
+
+/*************shutter dy ending*********************/
+	
+endif
+
Index: program/ble_protocol_stack/le.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le.prog	(working copy)
@@ -0,0 +1,2009 @@
+ifdef COMPILE_LE
+//******************************************//
+//*************LE INIT ****************//
+//******************************************//
+
+le_init_conn:
+	bpatch patch1a_6,mem_patch1a
+	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:
+	bpatch patch1a_7,mem_patch1a
+	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:
+	bpatch patch1b_0,mem_patch1b
+	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:
+	bpatch patch1b_1,mem_patch1b
+	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:
+	bpatch patch1b_2,mem_patch1b
+	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:
+	bpatch patch1b_3,mem_patch1b
+	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:
+	bpatch patch1b_4,mem_patch1b
+	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
+	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:
+	bpatch patch1b_5,mem_patch1b
+	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:
+	bpatch patch1b_6,mem_patch1b
+	call end_of_packet
+	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:
+	bpatch patch1b_7,mem_patch1b
+	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:
+	bpatch patch1c_0,mem_patch1c
+	call le_clear_connection_info
+	call app_disconn_reason_collect_ble
+	call le_clear_pairing_state
+ifdef SECURE_CONNECTION
+	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:
+	bpatch patch1c_1,mem_patch1c
+	jam FLAG_LE_ENC_NULL,mem_le_enc_state
+	jam FLAG_LE_PAIRING_NULL,mem_le_pairing_state 
+ifdef SECURE_CONNECTION
+	call sp_clear_flags
+endif
+	rtn
+	
+le_got_first_packet:
+	bpatch patch1c_2,mem_patch1c
+	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
+	bpatch patch1c_3,mem_patch1c
+	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
+	rtn
+
+le_enable_coded_s8:
+	call le_enable_coded
+	set1 mark_ble_lr_s8,mark
+	rtn
+
+le_enable:
+	bpatch patch1c_4,mem_patch1c
+	set0 mark_ble_2M,mark
+	set0 mark_ble_lr,mark
+	jam 0x01,0x8901
+	jam 0x80,0x8920
+	jam 0x03,0x8930
+	rtn
+
+
+le_disable:
+	bpatch patch1c_5,mem_patch1c
+	set0 mark_ble_encryption,mark
+	jam 0x01,0x8901
+	jam 0x80,0x8920
+	jam 0x03,0x8930
+	rtn
+	
+le_prep:
+	bpatch patch1c_6,mem_patch1c
+	disable enable_crc
+	disable enable_white
+	fetch 3,mem_le_crcinit
+	iforce crc24_init
+	fetch 1,mem_le_ch_mapped
+le_prep_next:
+	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:
+	bpatch patch1c_7,mem_patch1c
+	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:
+	bpatch patch1d_0,mem_patch1d
+	enable swfine
+	fetch 4,mem_le_access
+	iforce access
+	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:
+	bpatch patch1d_1,mem_patch1d
+	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:
+	bpatch patch1d_2,mem_patch1d
+	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:
+	bpatch patch1d_3,mem_patch1d
+ 	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:
+	bpatch patch1d_4,mem_patch1d
+	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
+	enable swfine
+	fetch 1,mem_le_tx_ifs_defference
+	arg PARAM_20MS_INIT,temp
+	iadd temp,temp
+	fetch 1,mem_system_clk
+	imul32 temp,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
+	bpatch patch1d_5,mem_patch1d
+	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:
+	bpatch patch1d_6,mem_patch1d
+	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:
+	bpatch patch1d_7,mem_patch1d
+	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
+	call le_match_set_sync_on
+	
+le_match_set_txfreq:
+	bpatch patch1e_0,mem_patch1e
+	fetcht 1,mem_last_freq
+	add temp,2,rega
+//	bmark1 mark_ble_2M,rf_tx_write_freq
+//	add temp,1,rega
+	branch  rf_tx_write_freq	// set frequency to tx mode freq
+
+le_match_set_sync_on:	
+	disable decode_fec0
+	branch set_sync_on
+
+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:
+	bpatch patch1e_1,mem_patch1e
+	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:
+	bpatch patch1e_2,mem_patch1e
+	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:
+	bpatch patch1e_3,mem_patch1e
+	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:
+	bpatch patch1e_4,mem_patch1e
+	call le_transmit
+	branch end_of_packet
+	
+le_transmit:
+	bpatch patch1e_5,mem_patch1e
+	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
+	bpatch patch1e_6,mem_patch1e
+	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 */
+	bpatch patch1e_7,mem_patch1e
+	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	
+	fetcht 1,mem_le_tx2m_delay
+	iadd temp,pdata
+	call sleep				//2M ?°??·￠?í±è1M?ì
+	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 2,contr
+	add rega,coffset_le_slave_latency,contw
+	istore 2,contw
+	ifetch 2,contr
+	store 2,mem_le_init_superto
+	branch le_receive_window_size
+
+le_update_param_cb:
+	ifetch 1,rega
+	set0 lestate_got_first_packet,pdata
+	istore 1,rega
+	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
+	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:
+	bpatch patch1f_0,mem_patch1f
+	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:
+	bpatch patch1f_1,mem_patch1f
+	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
+	bpatch patch1f_2,mem_patch1f
+	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:
+	bpatch patch1f_3,mem_patch1f
+	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:
+	bpatch patch1f_4,mem_patch1f
+	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:
+	bpatch patch1f_5,mem_patch1f
+	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
+	bpatch patch1f_6,mem_patch1f
+	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:
+	bpatch patch1f_7,mem_patch1f
+	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 patch20_0,mem_patch20
+	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 patch20_1,mem_patch20
+	fetch 1,mem_le_packet_llid
+	beq LLID_LE_LL,le_parse_ll
+	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_l2cap_parse_cb
+	nbranch callback_func,blank
+le_parse_l2cap:
+	fetch 2,mem_le_payload_ptr
+	add pdata,2,contr	//l2cap length
+	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:
+	bpatchx patch20_2,mem_patch20
+	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 patch20_3,mem_patch20
+	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 patch20_4,mem_patch20
+	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
+	branch enable_user
+
+	/* 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 patch20_5,mem_patch20
+	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 patch20_6,mem_patch20
+	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 patch20_7,mem_patch20
+	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 patch21_0,mem_patch21
+	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 patch21_1,mem_patch21
+	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 patch21_2,mem_patch21
+	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
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_SHORT_MULT,lpm_mult_short	//check flag,if flag is 1,always short mult
+	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_state
+	bbit1 lestate_update_param,lpm_mult_short
+	bbit1 lestate_update_phy,lpm_mult_short
+	bbit1 lestate_update_map,lpm_mult_short
+	branch lpm_mult_wait_timeout
+	
+le_lpm_lost:
+	fetch 1,mem_sniff_unint_lost
+	sub pdata,30,null
+	nbranch lpm_lost,positive
+	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:
+	bpatchx patch21_3,mem_patch21
+	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:
+	bpatchx patch21_4,mem_patch21
+	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:
+	bpatchx patch21_5,mem_patch21
+	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:
+	bpatchx patch21_6,mem_patch21
+	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_rx_phy:
+	storer rega,1,mem_le_rx_phys
+	branch le_set_phy_common
+
+le_set_tx_phy:
+	storer rega,1,mem_le_tx_phys
+le_set_phy_common:	
+	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_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
+
+le_set_fixed_ltk_justwork:
+	call le_set_config_fixed_ltk
+	call le_set_justwork
+	call le_set_fixed_ltk
+	branch le_set_config_read_authentication
+	
+
Index: program/ble_protocol_stack/le_advertising.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le_advertising.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le_advertising.prog	(working copy)
@@ -0,0 +1,392 @@
+
+/*
+ble core spec advertising
+*/
+
+le_advertising_dispatch:
+	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 patch21_7,mem_patch21
+	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 patch22_0,mem_patch22
+	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_temp_block0
+	rtn
+
+
+le_wait_adv:
+	bpatchx patch22_1,mem_patch22
+	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 patch22_2,mem_patch22
+	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 patch22_3,mem_patch22
+	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 patch22_4,mem_patch22
+	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 patch22_5,mem_patch22
+	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
+	call le_send_adv_protect_txbuf
+	call le_adv_loop
+	branch le_send_adv_recover_txbuf
+	
+le_adv_loop:
+	bpatchx patch22_6,mem_patch22
+	fetch 1,mem_le_adv_enable
+	rtn blank
+	arg le_adv_interval_timer,queue
+	call timer_check
+	nrtn blank
+	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 patch22_7,mem_patch22
+	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_send_adv_protect_txbuf:
+	arg mem_le_tx_buf_temp,contw
+	arg mem_le_txheader,contr	
+	branch memcpy48
+	
+le_send_adv_recover_txbuf:
+	arg mem_le_tx_buf_temp,contr
+	arg mem_le_txheader,contw
+	branch memcpy48
+
+le_init_adv:
+	bpatchx patch23_0,mem_patch23
+	disable master
+le_adv_access:
+	setarg 0x8e89be
+	lshift8 pdata,pdata
+	or_into 0xd6,pdata
+	iforce access
+	setarg 0x555555
+	store 3,mem_le_crcinit
+	rtn
+
+
+
+le_send_adv_ind:
+	bpatchx patch23_1,mem_patch23
+	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 patch23_2,mem_patch23
+	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 patch23_3,mem_patch23
+	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 patch23_4,mem_patch23
+	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 patch23_5,mem_patch23
+	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 patch23_6,mem_patch23
+	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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le_l2cap_att.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le_l2cap_att.prog	(working copy)
@@ -0,0 +1,885 @@
+
+
+le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+le_parse_att2:
+	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:
+	bpatchx patch23_7,mem_patch23
+	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:
+	bpatchx patch24_0,mem_patch24
+	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:	
+	bpatchx patch24_1,mem_patch24
+	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:
+	bpatchx patch24_2,mem_patch24
+	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:
+	bpatchx patch24_3,mem_patch24
+	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:
+	bpatchx patch24_4,mem_patch24
+	fetch 1,mem_le_curr_att_len
+	store 1, mem_temp_block0
+	copy pdata,loopcnt
+	call get_contr
+	branch memcpy_fast
+
+
+le_write_att_record:
+	bpatchx patch24_5,mem_patch24
+	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_temp_block0
+	copy pdata,loopcnt
+	call memcpy_fast
+	branch store_contw
+
+
+
+le_send_auto_len_by_mem:
+	bpatchx patch24_6,mem_patch24
+	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:
+	bpatchx patch24_7,mem_patch24
+	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:
+	bpatchx patch25_0,mem_patch25
+	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:
+	bpatchx patch25_1,mem_patch25
+	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_signalling.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le_l2cap_signalling.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le_l2cap_smp.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le_l2cap_smp.prog	(working copy)
@@ -0,0 +1,603 @@
+
+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
+
+ifdef SECURE_CONNECTION			
+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
+endif
+
+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
+ifdef 	SECURE_CONNECTION
+	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
+endif	
+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:
+	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_LAGACY_PASSKEY_RES_INPUT,le_parse_smp_pairing_confirm_passkey_res_input
+ifdef SECURE_CONNECTION				
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_parse_smp_pairing_confirm_secure_passkey
+	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
+
+	
+le_parse_smp_pairing_confirm_passkey_res_input:
+	jam BT_EVT_LE_GET_PASSKEY,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+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
+
+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
+endif
+
+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:	
+	copy contr,rega
+ifdef SECURE_CONNECTION				
+	fetch 1,mem_le_pairing_mode
+	bbit1 LE_PAIRING_MODE_SECURE_CONNECT_BIT,le_parse_smp_pairing_random_sc
+endif
+	copy rega,contr
+	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:
+	bpatchx patch25_2,mem_patch25
+	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
+	rtn
+
+//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 patch25_3,mem_patch25
+	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
+	branch ui_ipc_send_event
+
+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:
+	bpatchx patch25_4,mem_patch25
+	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 patch25_5,mem_patch25
+	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:
+	bpatchx patch25_6,mem_patch25
+	force LE_L2CAP_CID_SMP,regb
+	branch le_fifo_malloc_tx_l2cap
+
+
Index: program/ble_protocol_stack/le_ll.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ble_protocol_stack/le_ll.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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 patch25_7,mem_patch25
+	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:
+	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_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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/bt.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/bt.prog	(working copy)
@@ -0,0 +1,1584 @@
+//define CLK24M
+//define SECURE_CONNECTION
+
+define COMPILE_SHUTTER
+define COMPILE_MOUSE
+define COMPILE_USB
+define COMPILE_DONGLE
+define COMPILE_LE
+define COMPILE_24G
+define COMPILE_CAR
+define COMPILE_REMOTE_CAR
+define COMPILE_FCC_AUTH
+//define COMPILE_NEC
+//define COMPILE_UART
+define FUNC_FAN_MODULE
+
+INCLUDE "bt_format"
+
+org 0x0000		// start from patch ram address start
+ifdef SIM
+include sim.prog
+else
+include patch.prog
+endif
+
+/******************************************/
+/***********   ROM Start   ***************/
+/******************************************/
+
+org 0x3800		// 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 ui_init
+	call ldo_abb_en_init
+	call app_init
+ifdef SECURE_CONNECTION
+	call publickey_init
+//	call sp_wait_pubkey_calc_done
+endif
+	call lpm_recover_clk,wake
+main_loop:	
+	bpatch patch00_2,mem_patch00
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256
+	call sp_calc_sequence_256_check
+endif
+	call le_advertising_dispatch
+	call idle_dispatch
+	call app_process_idle
+	call connection_dispatch
+	call g24_dispatch
+	call lpm_dispatch
+	branch main_loop
+
+connection_dispatch:
+	call connection_incontext
+	rtnmark0 mark_context
+	set0 mark_context,mark
+	call context_save
+	branch le_disable
+	
+connection_incontext:
+	bpatch patch00_3,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
+	rtn
+	
+connection_nosniff:
+	jam 0,mem_current_context
+	call context_get_next
+	copy loopcnt,null
+	rtn zero
+	branch assert
+
+
+/**************************************/
+/**************idle dispatch*********/
+/**************************************/
+	
+idle_dispatch:
+	fetch 1,mem_hci_cmd
+	rtn blank
+	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
+
+
+
+context_load:
+	bpatch patch00_4,mem_patch00
+	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
+	rtn
+	
+context_save:
+	bpatch patch00_5,mem_patch00
+	fetch 2,mem_context_ptr
+	iforce contw
+	force context_size,loopcnt
+	arg mem_le_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
+context_get_next_sniff:
+	loop context_get_next_loop
+	rtn
+	
+context_new:
+	bpatch patch00_6,mem_patch00
+	arg context_search_empty,regc
+	call context_search
+	nrtn zero					// all occupied
+	deposit rega
+	store 2,mem_context_ptr
+	force 0,null
+	rtn
+	
+
+	
+	//rtn nzero if idle(no conn)
+context_check_idle:
+	arg context_check_inconn,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 patch00_7,mem_patch00
+	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 patch01_0,mem_patch01
+	arg mem_context,rega
+	arg context_num,loopcnt
+context_search_loop:
+	ifetch 1,rega
+	copy regc,pc
+context_search_next:
+	bpatch patch01_1,mem_patch01
+	increase context_size,rega
+	loop context_search_loop
+	force 1,null
+	rtn
+
+context_search_empty:
+	bbit1 state_inconn,context_search_next
+	force 0,null
+	rtn
+	
+context_search_lap:
+	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
+	bpatch patch01_2,mem_patch01
+ifdef SECURE_CONNECTION
+	fetch 1,mem_sc_calc
+	nbranch context_search_sniff_sc,blank
+endif	
+	fetch 9,mem_temp
+	copy regb,contr
+	increase 5,pdata  
+	branch context_search_meet1
+	
+ifdef SECURE_CONNECTION
+context_search_sniff_sc:
+	fetch 9,mem_temp
+	copy regb,contr	
+	increase 20,pdata  
+endif	
+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
+	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
+
+
+
+end_of_packet:
+	bpatch patch01_3,mem_patch01
+	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
+
+
+
+	/* enable user if sniff window vialation, queue is extra overhead */
+sniff_check_window:
+	bpatch patch01_4,mem_patch01
+	disable swfine
+	copy temp,stop_watch
+	call context_search_sniff_window
+	disable user
+	nrtn zero
+	force 0,stop_watch
+	branch enable_user
+
+
+
+calc_slot_offset:
+	bpatch patch01_5,mem_patch01
+	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 patch01_6,mem_patch01
+	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
+
+calc_clke:
+	disable clknt
+	fetch 6,mem_le_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 ***********/
+/******************************************/
+
+
+shutdown_radio:
+	bpatch patch01_7,mem_patch01
+	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 0x80,core_rf_ldo_en0
+	fetch 1,core_clkpll_cfg6
+	set0 7,pdata
+	store 1,core_clkpll_cfg6
+	jam 0,core_rf_ldo_en1
+	rtn
+
+
+
+set_sync_on:
+	bpatch patch02_0,mem_patch02
+	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 0x29,core_syn_afc_cfg1
+	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 patch02_1,mem_patch02
+	
+	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:
+	branch rf_rx_write_freq
+
+
+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 patch02_2,mem_patch02
+	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 patch02_3,mem_patch02
+	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 patch02_4,mem_patch02
+	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 patch02_5,mem_patch02
+
+	jam 0x12,core_syn_top_ctrl
+	storet 1,mem_last_freq
+	add temp,2,rega
+	call rf_tx_write_freq
+	nop 0x3c0
+
+txon:
+	bpatch patch02_6,mem_patch02
+	
+	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 patch02_7,mem_patch02
+	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
+	beq TX_POWER_FACTORY,set_tx_power_factory
+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
+
+set_tx_power_factory:
+	fetch 2,mem_tx_power_factory_param
+	store 2,core_tx_pwr_ctrl0
+	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 patch03_0,mem_patch03
+	fetch 1,mem_wdt_always_work
+	call wdt_set_disable,blank
+
+	jam 0x05,core_clkpll_cfg0
+	jam 0x94,core_rx_iqadc_cfg
+	call initialize_rc_cal
+	call initialize_rf_ldo_cfg1
+	call initialize_syn_afc_cfg1
+	jam 0xe6,core_syn_aac_cfg1
+
+	//optimize RX SX pn
+	jam 0x90,core_syn_pfd_lkd_cfg
+	jam 0x0b,core_rf_ldo_cfg2
+	jam 0x05,core_rf_ldo_cfg3
+
+	//Improve auto agc
+	jam 0x76,core_agc_wb_sat_th
+	jam 0x76,core_agc_nb_sat_th
+
+	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
+initialize_radio_cont_next_2:
+	call init_lpm_ctrl
+	nop 100
+	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
+	nbranch initialize_syn_afc_cfg1_set,blank
+	setarg 0x29
+initialize_syn_afc_cfg1_set:	
+	store 1,core_syn_afc_cfg1
+	rtn
+
+initialize_rf_ldo_cfg1:
+	fetch 1,mem_rf_ldo_cfg1
+	nbranch initialize_rf_ldo_cfg1_set,blank
+	setarg 0x00
+initialize_rf_ldo_cfg1_set:
+	store 1,core_rf_ldo_cfg1
+	rtn
+
+initialize_rc_cal:
+	fetch 1,mem_rc_cal
+	branch initialize_rc_cal_set,blank
+	setarg 0xd3
+initialize_rc_cal_set:	
+	store 1,core_rx_bq_bw_cal
+	rtn
+	
+	
+save_rssi:
+	bpatch patch03_1,mem_patch03
+	 // bit6 is signed bit.
+	fetch 1,modem_nb_pow
+	isolate1 6,pdata
+	setflag true,7,pdata
+	store 1,mem_modem_rssi
+
+	fetch 1,modem_gain
+	and pdata,0x0f,temp
+	lshift temp,temp
+	rshift4 pdata,pdata
+	iadd temp,temp
+	mul32 temp,3,rega // (abb_gain + lna_gain*2)*3
+
+	fetch 1,mem_modem_rssi
+	call byte_sign_extern
+	sub pdata,0,pdata //-modem_nb_pow
+	iadd rega,pdata // (abb_gain + lna_gain*2)*3 + (-modem_nb_pow)
+	increase -9,pdata // (abb_gain + lna_gain*2)*3 + (-modem_nb_pow) - 9
+	and pdata,0x1ff,pdata
+	isolate1 8,pdata
+	nbranch save_rssi_store,true
+	setarg 0	 
+save_rssi_store:
+	store 1,mem_rssi_hex
+	branch rssi_hex2dec
+ 
+byte_sign_extern:
+	isolate1 7,pdata
+	nrtn true
+	arg 0xff00,temp
+	ior temp,pdata
+	rtn
+ 
+rssi_hex2dec:
+	fetch 1,mem_rssi_hex
+	call bcd
+	store 1,mem_rssi
+	rtn
+
+bcd:
+	and_into 0xff,pdata
+	div pdata,10
+	call get_div_result
+	lshift4 pdata,pdata
+	remainder temp
+	ior temp,pdata
+	rtn
+
+	
+xtal_fast_wake:
+	setarg 0xf0f
+	branch lpm_write_config
+
+init_lpm_ctrl:
+	setarg 0x80f
+	branch lpm_write_config
+
+
+
+	/* pdata = clks ahead of bt_clk */
+ahead_window:
+	copy pdata,temp
+	bpatch patch03_2,mem_patch03
+	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
+
+
+get_clk:
+	copy clkn,temp
+	rtn master
+	copy clke,temp
+	rtn
+
+get_clkbt:
+	deposit clkn_bt
+	rtn master
+	deposit clke_bt
+	rtn
+
+
+assert:
+	bpatch patch03_3,mem_patch03
+	branch assert
+	
+
+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 
+	setarg 0 
+	store 6,mem_le_adv_transmit
+	arg mem_le_state,contw
+	arg 10,loopcnt
+	call memset0
+	jam 0,mem_fifo_temp
+	jam 0,mem_le_testtype
+
+	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
+	
+//	call init_memp	
+ifdef SECURE_CONNECTION 
+	setarg mem_sp_state_end
+	arg mem_sp_state_start,contw
+	isub contw,loopcnt
+	call clear_mem
+endif
+
+	bpatch patch03_4,mem_patch03
+	rtn wake
+	jam PARAM_T_IFS_150US+PARAM_SYNC_TIME_DIFFERENCE,mem_le_tx_ifs_defference
+	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	
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn
+	rtn
+
+
+/*
+这是1308/7/6芯片设计需要绕过的一个问题,如果芯片同事确认修复后，可以删除。
+修复的问题是，解决在lpm模式下，芯片会随机出现几十微安的异常电流。
+*/
+ldo_abb_en_init:
+	rtn wake
+	bpatch patch03_5,mem_patch03
+	fetch 1, core_rf_ldo_en0
+	set1 3, pdata
+	store 1, core_rf_ldo_en0
+	nop 1200
+	set0 3, pdata
+	store 1, core_rf_ldo_en0
+	rtn
+
+/*
+clk24m_init:
+	jam 6,core_clksel
+	jam 1,core_clksel
+	nop 10
+	setarg 7498
+	store 2,core_halfslot
+	rtn
+*/
+
+/*****************************************LPO************************************************/
+
+lpmstate:
+	setarg 0xee21
+	store 2,core_clkoff			// disable unused peripherals
+	fetch 4,core_gpio_in
+	store 4,mem_saved_gpio_in
+	store 4,mem_saved_gpio_in	//gpio bug
+	jam 0x83,core_otp_ctrl		/* otp ceb rstn high before power on */
+	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
+	storet 4,core_lpm_reg
+	jam lpmreg_sel_counter,core_lpm_wr
+	until null,never
+
+lpmwake:
+	until null,lpo_edge
+	jam lpmreg_sel_ctrl3,core_lpm_wr
+	until null,lpo_edge
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	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
+	until null,lpo_edge
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	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
+	until null,lpo_edge
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	fetch 1,core_lpm_isogate
+	set1 enable_retmem,pdata
+	store 1,core_lpm_isogate
+	until null,lpo_edge
+	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 load_ucode,wake
+	nbranch loadcode,wake		// wakeup from hibernate
+	rtnmark0 mark_otp_encrypt
+	jam lock_otp,core_misc_ctrl	// disable further read/write of key
+	rtn 
+
+
+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_aon_vsel
+	and_into 0xe0,pdata
+lpm_ctrl3_cfg_vsel_store:	
+	store 1,mem_lpm_ctrl3_aon_vsel
+	rtn
+lpm_ctrl3_cfg_vsel_108:
+	fetch 1,mem_lpm_ctrl3_aon_vsel
+	and_into 0xe0,pdata
+	or_into 0x1d,pdata
+	branch lpm_ctrl3_cfg_vsel_store
+lpm_ctrl3_cfg_vsel_096:
+	fetch 1,mem_lpm_ctrl3_aon_vsel
+	and_into 0xe0,pdata
+	or_into 0x1b,pdata
+	branch lpm_ctrl3_cfg_vsel_store
+lpm_ctrl3_cfg_vsel_084:
+	fetch 1,mem_lpm_ctrl3_aon_vsel
+	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
+	fetch 8,mem_saved_gpio
+	store 8,core_gpio_conf
+	ifetch 5,contr
+	istore 5,contw
+	fetchr mark,8,mem_saved_mark
+	rtn
+
+lpm_save_context:
+	storer mark,8,mem_saved_mark
+	fetch 8,core_gpio_conf
+	store 8,mem_saved_gpio
+	ifetch 5,contr
+	istore 5,contw
+	fetch 1,core_spid_ctrl
+	store 1,mem_saved_spidctrl
+	rtn
+
+lpo_calibration:
+	fetch 1,core_aes_en
+	rshift2 pdata,pdata
+	and pdata,0xf,pdata
+	nbranch lpo_cal_inited,blank
+	fetch 3,mem_clks_per_lpo
+	nrtn blank
+	fetch 1,core_aes_en
+	or_into 0x30,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 patch03_6,mem_patch03
+	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:
+	bpatch patch03_7,mem_patch03
+	arg param_hibernate_clks,temp
+	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 patch04_0,mem_patch04
+	fetch 2,mem_cb_before_lpm_sleep
+	call callback_func
+	until null,lpo_edge
+	jam lpmreg_sel_ctrl,core_lpm_wr
+	call lpm_ctrl3_cfg_dig_vsel
+	until null,lpo_edge
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	setarg 0xf0f
+	call lpm_write_config_reg
+lpm_sleep_skip_cb_function:
+	fetch 4,mem_sleep_counter_all
+	iadd temp,pdata
+	store 4,mem_sleep_counter_all
+	call lpm_save_context
+	until null,lpo_edge
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	fetchr regb,4,mem_lpm_ctrl3
+	fetch 5,mem_lpm_xtalcnt
+	store 4,core_lpm_reg
+	storer clkn,6,mem_sleep_clkn 
+	until null,lpo_edge 
+	jam lpmreg_sel_ctrl3,core_lpm_wr 
+	rshift32 pdata,pdata	
+	store 1,core_lpm_isogate
+	until null,lpo_edge
+	storer regb,4,core_lpm_reg
+	jam lpmreg_sel_counter,core_lpm_wr
+	until null,lpo_edge
+	storet 4,core_lpm_reg
+	until null,never
+
+
+
+
+lpm_recover_clk:
+	bpatch patch04_1,mem_patch04
+	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 param_lpo_extra,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
+	until null,lpo_edge	
+	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 patch04_2,mem_patch04
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	rtn blank
+	fetch 1,mem_lpm_mode
+	rtn blank
+ifdef 	SECURE_CONNECTION
+	fetch 1,mem_secure_connections_enable
+	branch lpm_dispatch_next,blank
+	fetch 1,mem_sc_local_key_invalid 	// simple pairing is not ready
+	rtn blank
+lpm_dispatch_next:
+	fetch 1,mem_sc_calc
+	nrtn blank	
+endif
+	arg context_check_a_wack,regc
+	call context_search
+	rtn zero
+	call lpm_check_wake_lock
+	nrtn blank
+	call context_check_idle						
+	nbranch lpm_dispatch_unconn,zero
+	rtn wake
+	bpatch patch04_3,mem_patch04
+	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
+	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 patch04_4,mem_patch04
+	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 patch04_5,mem_patch04
+	fetch 1,mem_le_adv_enable
+	nbranch lpm_unconn_cont,blank
+	rtn
+	
+lpm_unconn_cont:
+	fetch 2,mem_lpm_interval
+	rtn blank
+lpm_sleep_btclk:
+	fetcht 1,mem_lpm_overhead
+	isub temp,pdata
+	arg 7500,temp				
+	imul32 temp,pdata
+	branch lpm_dispatch_sleep
+
+	
+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
+
+
+
+
+lpm_match:
+	jam 0,mem_sniff_unint_lost
+	fetch 3,mem_sniff_rcv
+	increase 1,pdata
+	store 3,mem_sniff_rcv
+	rtn
+
+
+lpm_lost:
+	bpatch patch04_6,mem_patch04
+	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:
+	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
+
+lpm_write_config_reg:
+	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
+	rtn
+
+
+	/* pdata is lpm_reg[11:0] */
+lpm_write_config:
+	call lpm_write_config_reg
+
+lpm_write_ctrl:
+	bpatch patch04_7,mem_patch04
+	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_vdd:
+	bpatch patch05_0,mem_patch05
+	fetch 4,core_lpm_ctrl2
+	store 4,core_lpm_reg
+	fetch 1,core_lpm_ctrl2
+	and_into 0x41,pdata
+	fetcht 1,mem_lpm_ctrl3_app_vsel
+	ior temp,pdata
+	store 1,core_lpm_reg
+lpm_write_ctrl3:
+	setarg lpmreg_sel_ctrl3
+	branch lpm_write
+
+
+lpm_write_gpio_wakeup:
+	bpatch patch05_1,mem_patch05
+	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 patch05_2,mem_patch05
+	call app_check_wake_lock
+	fetch 2,mem_lpm_wake_lock
+	copy pdata,rega
+	fetch 3,mem_tx_fifo3
+	nsetflag blank,wake_lock_ble_tx,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
+	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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/debug.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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/fcc_auth.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/fcc_auth.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/fcc_auth.prog	(working copy)
@@ -0,0 +1,264 @@
+
+
+
+ifdef COMPILE_FCC_AUTH
+/*
+input:
+mem_fcc_ch     //选择频点:frequence = 2402MHz + mem_fcc_ch
+mem_fcc_txrx   //选择收发模式:发射模式(FCC_TX); 接收模式(FCC_RX)
+mem_fcc_data   //选择测试模式:发射载波(FCC_CARRIER); 发射数据/调制波(FCC_DATA)
+mem_fcc_tx_power   //选择发射功率
+mem_fcc_config_cb   //函数指针，可以把认证中的实现切换逻辑的函数地址赋值给它
+*/
+fcc_auth_config:
+	call pn9
+	branch fcc_auth_procedures
+
+
+
+fcc_auth_procedures:
+	bpatch patch0e_3,mem_patch0e
+//以下变量保持默认值
+	jam FCC_DATA_RATE_1Mbps, mem_fcc_mod
+	jam FCC_BT_MODE, mem_fcc_btble
+	jam FCC_LEN_DH1, mem_fcc_data_length
+	jam FCC_FIXED_FREQ, mem_fcc_hop
+	
+	fetch 2, mem_fcc_config_cb
+	call callback_func
+	
+	fetch FCC_PARA_LEN,mem_fcc_param
+	store FCC_PARA_LEN,mem_fcc_param_new
+	fetch 1, mem_fcc_tx_power
+	store 1, mem_tx_power
+	
+	fetch 1, mem_fcc_txrx
+	beq FCC_TX, fcc_auth_tx_start
+	beq FCC_RX, fcc_auth_rx_start
+fcc_auth_tx_start:
+	fetcht 1,mem_fcc_ch
+	fetch 1,mem_fcc_btble
+	beq FCC_BLE_MODE,fcc_auth_ble_tx_on
+	beq FCC_BT_MODE,fcc_auth_bt_tx_on
+fcc_auth_ble_tx_on:
+	bpatch patch0e_4,mem_patch0e
+	call fcc_set_sync_on
+	call set_freq_tx
+	//disable enable_white
+	call fcc_le_enable
+	set1 TXGFSK,radio_ctrl
+	enable encode_fec0
+	enable is_tx
+	disable is_rx
+	call le_wait_tx
+	fetch 1,mem_fcc_data
+	store 1,core_tx_test_mode
+	branch fcc_auth_tx_data
+fcc_auth_tx_data:
+	bpatch patch0e_5,mem_patch0e
+	fetch 1,mem_fcc_mod
+	beq FCC_DATA_RATE_1Mbps,calculate_GFSK_modulation_length
+calculate_GFSK_modulation_length:	
+	fetch 1,mem_fcc_data_length
+	beq FCC_LEN_DH1,calculate_gfsk_modulation_length_dh1
+	beq FCC_LEN_DH3,calculate_gfsk_modulation_length_dh3
+	beq FCC_LEN_DH5,calculate_gfsk_modulation_length_dh5
+calculate_gfsk_modulation_length_dh1:
+	arg 53,loopcnt
+	arg mem_pn9,contr
+	branch pnloop_stable
+calculate_gfsk_modulation_length_dh3:
+	arg 203,loopcnt
+	arg mem_pn9,contr
+	branch pnloop_stable
+calculate_gfsk_modulation_length_dh5:
+	arg 354,loopcnt
+	arg mem_pn9,contr
+	branch pnloop_stable
+
+
+fcc_auth_bt_tx_on:
+	bpatch patch0e_6,mem_patch0e
+	//call p_test_ble_bt_rx_off	//close rx
+	call fcc_set_sync_on
+	call set_freq_tx
+	disable enable_white
+	enable encode_fec0
+	enable is_tx
+//call ice_break
+	fetcht 1,mem_fcc_mod
+	copy temp,radio_ctrl
+	fetch 1,mem_fcc_data
+	store 1,core_tx_test_mode
+	beq 0,fcc_auth_tx_data	
+test_tx_carrier_loop:
+	bpatch patch0e_7,mem_patch0e
+	fetch 1,mem_fcc_data_length
+	copy pdata,loopcnt
+	arg mem_pn9,contr
+pnloop_carrier:
+	ifetch 1,contr
+	inject mod,8
+	loop pnloop_carrier
+	
+	fetch 2, mem_fcc_config_cb
+	call callback_func
+	fetch FCC_PARA_LEN,mem_fcc_param
+	fetcht FCC_PARA_LEN,mem_fcc_param_new
+	isub temp,null
+	branch test_tx_carrier_loop,zero
+	branch fcc_auth_procedures
+
+pn9:
+	arg mem_pn9_size,loopcnt
+ 	arg mem_pn9,contw
+  	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
+	//copy temp,pdata
+	istoret 1,contw
+	 //   inject mod,8
+	loop pn9_loop
+	rtn
+
+
+
+
+fcc_le_enable:
+	bpatch patch0f_0,mem_patch0f
+	set0 mark_ble_lr,mark
+	jam 0x03,0x8901
+	jam 0x84,0x8920
+	jam 0xa7,0x8925
+	jam 0x03,0x8930
+	//jam 0x58,0x8933
+	//jam 0x0a,0x8934
+	jam 0x40,0x8937
+	jam 0x85,0x8a6d
+	jam 0x89,core_rx_bq_cfg0
+	fetch 1,mem_le_mode
+	rtnbit1 mark_ble_2M
+	jam 0x01,0x8901
+	jam 0x80,0x8920
+	jam 0x05,0x8a6d
+	jam 0x09,core_rx_bq_cfg0
+//	rtnbit0 mode_lr
+	set1 mark_ble_lr,mark
+	jam 0x05,0x8901
+	jam 0x24,0x8930
+	jam 0x0a,0x8934
+    	rtn
+
+fcc_shutdown_radio:
+	bpatch patch0f_1,mem_patch0f
+	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 fcc_set_sync_on
+	jam 0,core_syn_en
+	jam 0x10,core_rf_ldo_en0
+	jam 0,core_rf_ldo_en1	
+	rtn		
+fcc_test_ble_bt_tx_off:
+	branch fcc_shutdown_radio
+	
+pnloop_stable:
+	ifetch 1,contr
+	inject mod,8
+	loop pnloop_stable
+	call fcc_test_ble_bt_tx_off
+	enable swfine
+	arg 0x350,stop_watch
+stable_stop:
+	branch fcc_auth_procedures,timeout
+
+	fetch 2, mem_fcc_config_cb
+	call callback_func
+	fetch FCC_PARA_LEN,mem_fcc_param
+	fetcht FCC_PARA_LEN,mem_fcc_param_new
+	isub temp,null
+	branch stable_stop,zero
+	call fcc_test_ble_bt_tx_off
+	branch fcc_auth_procedures
+
+fcc_set_sync_on:
+	bpatch patch0f_2,mem_patch0f
+	jam 0x5,modem_en
+	nop 2
+	jam 0x0,modem_en					/* if called from tx or rx */
+	jam 0xaa,core_rf_ldo_cfg4
+	jam 0xaa,core_rf_ldo_cfg5
+	jam 0x15,core_rf_ldo_cfg6
+	jam 0xf8,core_rf_ldo_en0    //rom 0x78------ldo en
+
+	//rom
+//	fetch 1,core_clkpll_cfg6
+//	set1 7,pdata
+//	store 1,core_clkpll_cfg6
+	
+	jam 4,core_rf_ldo_en1
+	nop 120
+	jam 0x7a,core_syn_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
+	jam 0x78,core_rf_ldo_en0
+	//rom
+//	fetch 1,core_clkpll_cfg6
+//	set0 7,pdata
+//	store 1,core_clkpll_cfg6	
+	jam 0,core_syn_cal_ctrl
+	rtn
+
+
+fcc_auth_rx_start:
+	call fcc_test_ble_rx_on
+fcc_test_rx_loop:
+	bpatch patch0f_3,mem_patch0f
+//	call hci_rx_packet
+//	call p_interface_for_usb_cmd
+	fetch 2, mem_fcc_config_cb
+	call callback_func
+	fetch FCC_PARA_LEN,mem_fcc_param
+	fetcht FCC_PARA_LEN,mem_fcc_param_new
+	isub temp,null
+	branch fcc_test_rx_loop,zero
+	branch fcc_auth_procedures
+fcc_test_ble_rx_on:
+	bpatch patch0f_4,mem_patch0f
+	call fcc_test_ble_bt_tx_off	//close tx
+	call set_freq_rx
+	setarg param_pll_setup
+	call sleep
+	branch rf_rx_enable
+endif
+
+
+
+
+
+
+
+
+
+
+
Index: program/g24_protocol_stack/24g.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g.prog	(working copy)
@@ -0,0 +1,566 @@
+
+
+g24_dispatch:
+	bpatchx patch26_0,mem_patch26
+	bmark1 mark_24g_rxmode,g24_receive_dispatch
+	branch g24_transmit_dispatch
+
+
+/****************************g24 base transceiver start********************************/
+
+g24_prep:
+	bpatchx patch26_1,mem_patch26
+	disable enable_crc
+	disable enable_white
+	setarg 0x555555
+	iforce crc24_init
+	fetch 1,mem_24g_ch
+	branch le_prep_next
+
+g24_receive_packet:
+	bpatchx patch26_2,mem_patch26
+	fetch 1,mem_24g_rx_phy
+	call le_enable_phy_by_pdata
+	fetch 4,mem_24g_addr
+	iforce access
+	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
+	fetch 1,mem_24g_disable_fec1
+	nbranch g24_receive_skip_fec1,blank
+	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_hec_error,zero
+	bpatchx patch26_3,mem_patch26
+	disable user7
+	isolate1 mark_ble_lr,mark
+	call g24_lr_receive_pdu_len,true
+	branch g24_lr_len_error,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_type_error,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_len_over_error,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
+	fetch 1,mem_24g_disable_fec1
+	nbranch g24_receive_skip_disable_fec1,blank
+	disable decode_fec1
+g24_receive_skip_next:
+	isolate1 mark_24g_rxmode,mark
+	call save_rssi_dec,true
+	branch g24_crc_error,crc_failed
+	call rf_debug_rx_crc_line	//L
+	bpatchx patch26_4,mem_patch26
+	enable user3
+	call le_match_set_txfreq
+	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_receive_skip_disable_fec1:
+	disable decode_fec0
+	branch g24_receive_skip_next
+	
+
+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:
+	jam ERR_SYNC_TO,mem_24g_off_type
+	isolate1 mark_24g_rxmode,mark
+	call rssi_noise,true
+g24_end_of_packet:
+	bpatchx patch26_5,mem_patch26
+	call le_disable
+	disable encode_fec1
+	disable decode_fec1
+	branch end_of_packet
+
+g24_hec_error:
+	jam ERR_HEC,mem_24g_off_type
+	branch g24_end_of_packet
+
+g24_lr_len_error:
+	jam ERR_LR_LEN,mem_24g_off_type
+	branch g24_end_of_packet
+
+g24_type_error:
+	jam ERR_TYPE,mem_24g_off_type
+	branch g24_end_of_packet
+
+g24_len_over_error:
+	jam ERR_LEN_OVER,mem_24g_off_type
+	branch g24_end_of_packet
+
+g24_crc_error:
+	jam ERR_CRC,mem_24g_off_type
+	branch g24_end_of_packet
+
+g24_set_freq_tx:
+	call set_sync_on
+	fetcht 1,mem_24g_ch
+	branch set_freq_tx
+
+g24_transmit:
+	bpatchx patch26_6,mem_patch26
+	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:
+	bpatchx patch26_7,mem_patch26
+	bmark1 mark_ble_lr,g24_transmit_nolr
+	fetch 1,mem_24g_disable_fec1
+	nbranch g24_transmit_nolr,blank
+	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
+	fetch 1,mem_24g_disable_fec1
+	nbranch g24_transmit_skip_disable_fec1,blank
+	disable encode_fec1
+g24_transmit_skip_disable_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:
+	bpatchx patch27_0,mem_patch27
+	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
+	bpatchx patch27_1,mem_patch27
+//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:
+	bpatchx patch27_2,mem_patch27
+//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:
+	bpatchx patch27_3,mem_patch27
+	fetcht 1,mem_24g_current_ch_number
+	call g24_ch_map_size
+	storet 1,mem_24g_current_ch_number
+	rtn
+
+g24_ch_map_size:
+	bpatchx patch27_4,mem_patch27
+	call g24_ch_calc
+	increase 1,temp
+	and_into 3,temp //map size =4
+	rtn
+	
+g24_ch_calc:
+	bpatchx patch27_5,mem_patch27
+	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
+	bpatchx patch27_6,mem_patch27
+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:
+	bpatchx patch27_7,mem_patch27
+	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:
+	bpatchx patch28_0,mem_patch28
+	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:
+	bpatchx patch28_1,mem_patch28
+	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:
+	bpatchx patch28_2,mem_patch28
+	arg 0x6978,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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_pair.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_pair.prog	(working copy)
@@ -0,0 +1,423 @@
+
+
+g24_pair_param_init:
+	bpatchx patch28_3,mem_patch28
+	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 patch28_4,mem_patch28
+	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
+	nrtn blank
+	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 patch28_5,mem_patch28
+	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 1,mem_24g_device1_bind_disable
+	store 1,mem_24g_device2_bind_disable
+	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:
+	bpatchx patch28_6,mem_patch28
+	call g24_rx_interrupt_clear
+	call g24_receive_packet
+	nbranch g24_rx_interrupt_clear,user3
+	call g24_bind_data_parse
+	call g24_transmit_ack
+	call g24_bind_device_status_check
+	call dongle_kb_bind_soft_reset
+	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
+	arg mem_24g_rxbuf,contr
+	arg mem_24g_rxdata_temp,contw
+	call memcpy8
+	bpatchx patch28_7,mem_patch28
+	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
+	rtn
+
+
+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:
+	fetch 1,mem_24g_device1_bind_disable
+	nrtn blank
+	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_24g_lap
+	store 6,mem_24g_bind_payload+2
+	rtn
+
+g24_bind_first_step_device2:
+	fetch 1,mem_24g_device2_bind_disable
+	nrtn blank
+	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_24g_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_disable
+	nrtn blank
+	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_disable
+	nrtn blank
+	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_disable
+	nrtn blank
+	fetch 1,mem_24g_device1_bind_step
+	beq 2,g24_bind_dvc1_step_success
+	rtn
+g24_bind_dvc1_step_success:
+	jam 1,mem_24g_device1_bind_disable
+	call g24_binding_dvc1_living	//works on auto pair only
+	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_disable
+	nrtn blank
+	fetch 1,mem_24g_device2_bind_step
+	bne 0,g24_bind_dvc2_step_success
+	rtn
+g24_bind_dvc2_step_success:
+	jam 1,mem_24g_device2_bind_disable
+	call g24_binding_dvc2_living	//works on auto pair only
+	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
+	branch dongle_g24_store_dvc2_bind_flag
+
+g24_binding_device_check:	//works on auto pair
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_BIND
+	fetch 1,mem_24g_pair_mode
+	nrtn blank
+	fetch 1,mem_24g_rxbuf+3
+	beq DATATYPE_DEVICE1,g24_binding_dvc1_status	//bit0
+	beq DATATYPE_DEVICE2,g24_binding_dvc2_status	//bit1
+	rtn
+g24_binding_dvc1_status:
+	fetch 1,mem_24g_bind_device_living
+	rtnbit0 0
+disable_user3:
+	disable user3
+	rtn 
+g24_binding_dvc2_status:
+	fetch 1,mem_24g_bind_device_living
+	rtnbit0 1
+	branch disable_user3
+
+g24_binding_dvc1_living:
+	fetch 1,mem_24g_pair_mode
+	nrtn blank
+	fetch 1,mem_24g_bind_device_living
+	or_into 0x01,pdata
+	store 1,mem_24g_bind_device_living
+	rtn
+
+g24_binding_dvc2_living:
+	fetch 1,mem_24g_pair_mode
+	nrtn blank
+	fetch 1,mem_24g_bind_device_living
+	or_into 0x02,pdata
+	store 1,mem_24g_bind_device_living
+	rtn
+
+
+g24_bind_device_status_check:
+	fetch 1,mem_24g_bind_device_status
+	rtn blank
+g24_bind_device_status:
+	fetch 1,mem_24g_rxdata_temp+3
+	beq DATATYPE_DEVICE1,g24_binding_dvc1_living
+	beq DATATYPE_DEVICE2,g24_binding_dvc2_living
+	rtn
+
+
+
+/****************************g24 pair receiver end********************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: program/g24_protocol_stack/24g_receiver.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_receiver.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_receiver.prog	(working copy)
@@ -0,0 +1,563 @@
+
+g24_receive_init:
+	set1 mark_24g_rxmode,mark
+	fetch 1,mem_tx_power
+	store 1,mem_tx_power_temp
+	branch rssi_receiver_buff_init
+
+g24_receive_dispatch:
+	fetch 2,mem_cb_24g_receive_process
+	branch callback_func
+
+g24_ackpayload_prep:
+	bpatchx patch29_0,mem_patch29
+	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
+	bpatchx patch29_1,mem_patch29
+	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_receive_attemp	//reconn packet
+g24_rx_interrupt_clear:
+	bpatchx patch29_2,mem_patch29
+	arg mem_24g_rxbuf,contw
+	arg 66,loopcnt
+	branch clear_mem
+
+g24_data_receive_attemp:
+	call g24_bind_device_status		//works on auto pair only
+	branch g24_data_attemp
+
+g24_data_device1:
+	call g24_binding_dvc1_living	//works on auto pair only
+	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:
+	call g24_binding_dvc2_living	//works on auto pair only
+	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 G24_TIMER_NODATA,queue
+	branch timer_init
+
+
+
+/****************************g24 receiver mode switch start********************************/
+
+g24_mode_switch_init:
+	bpatchx patch29_3,mem_patch29
+	jam 1,mem_24g_mode_switch
+	jam 0,mem_24g_time_slice
+	jam 0xff,mem_24g_interval
+	branch g24_timer_init
+	
+g24_mode_switch_bind_work:
+	bpatchx patch29_4,mem_patch29
+	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_mode_B_S_switch_init:	//bind and search
+	fetch 1,mem_24g_B_S_mode_switch_disable
+	nrtn blank
+	fetch 1,mem_24g_mode_B_S_switch_exit
+	call g24_mode_B_S_switch_start,blank
+	fetch 1,mem_24g_mode_B_S_switch_init
+	rtnbit1 0
+	set1 0,pdata
+	store 1,mem_24g_mode_B_S_switch_init
+	jam 1,mem_24g_mode_B_S_switch
+	jam 0,mem_24g_B_S_time_slice
+	setarg 0
+	store 2,mem_24g_mode_B_S_switch_cnt
+	jam 0x60,mem_24g_interval	//30ms
+	branch g24_timer_init
+
+g24_mode_switch_bind_search:
+	bpatchx patch29_5,mem_patch29
+	fetch 1,mem_24g_work_mode
+	rtneq DONGLE_WORK
+	fetch 1,mem_24g_B_S_mode_switch_disable
+	nrtn blank
+	fetch 1,mem_24g_mode_B_S_switch_exit
+	nrtn blank
+	fetch 1,mem_24g_mode_B_S_switch
+	rtn blank
+	call g24_timer_check
+	nrtn user
+	fetch 2,mem_24g_mode_B_S_switch_cnt
+	increase 1,pdata
+	store 2,mem_24g_mode_B_S_switch_cnt
+	arg 0x7d0,temp	//1min
+	isub temp,null
+	branch g24_mode_B_S_switch_exit,positive
+	call g24_bind_mode_continue
+	fetch 1,mem_24g_B_S_time_slice
+	increase 1,pdata
+	and_into 1,pdata
+	store 1,mem_24g_B_S_time_slice
+	beq 0,g24_mode_switch_search
+	beq 1,g24_bind_mode_enable
+	rtn
+
+g24_mode_switch_search:
+	fetch 1,mem_24g_bind_mode_continue
+	nbranch g24_bind_mode_enable,blank
+	branch g24_search_mode_enable
+
+g24_mode_B_S_switch_exit:
+	jam 1,mem_24g_mode_B_S_switch_exit
+	branch g24_search_mode_enable
+
+g24_mode_B_S_switch_stop:
+	jam 0,mem_24g_mode_B_S_switch
+	rtn
+g24_mode_B_S_switch_start:
+	jam 1,mem_24g_mode_B_S_switch
+	rtn
+
+
+
+/****************************g24 receiver mode switch end********************************/
+
+
+
+
+/****************************g24 receiver work mode start********************************/
+
+g24_work_init:
+	bpatchx patch29_6,mem_patch29
+	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_24g_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 patch29_7,mem_patch29
+	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 patch2a_0,mem_patch2a
+	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
+
+	fetch 1,mem_24g_abort_packet
+	call g24_mode_B_S_switch_stop,blank	//works on auto pair only
+	
+	//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:
+	bpatchx patch2a_1,mem_patch2a
+	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_24g_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_24g_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 G24_TIMER_NODATA,queue
+	call timer_check
+	nrtn blank
+	jam 0,mem_24g_nodata_timer_enable
+	jam 0,mem_24g_bind_mode_continue
+	call g24_mode_B_S_switch_init	//works on auto pair only	
+	//no data for more than 100ms,then go to search
+g24_search_mode_enable:	
+	bpatchx patch2a_2,mem_patch2a
+	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:
+	bpatchx patch2a_3,mem_patch2a
+	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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_reconn.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_reconn.prog	(working copy)
@@ -0,0 +1,171 @@
+
+/****************************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 patch2a_4,mem_patch2a
+	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
+	rtn blank
+	store 4,mem_24g_receiver_addr	
+g24_ch_syncword_crc8_init:	
+	call g24_update_addr_and_synccrc8
+	branch g24_ch
+
+
+g24_reconn_dispatch:
+	bpatchx patch2a_5,mem_patch2a
+	fetch 2,mem_24g_reconn_count
+	arg 0x01f8,temp
+	iand temp,pdata
+	branch g24_reconn_dispatch_next,blank
+	fetch 2,mem_24g_reconn_count
+	increase 1,pdata
+	store 2,mem_24g_reconn_count
+	rtn
+
+g24_reconn_dispatch_next:
+	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
+	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
+	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
+	jam BT_EVT_24G_ATTEMPT_SUCCESS,mem_fifo_temp
+	call ui_ipc_send_event
+g24_txbuf_clear:
+	bpatchx patch2a_6,mem_patch2a
+	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 9,pdata
+	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_reconn_device_3_0_addr,true
+	branch g24_pair_init_param
+
+/****************************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:
+	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:
+	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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_rssi.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_rssi.prog	(working copy)
@@ -0,0 +1,112 @@
+
+/****************************g24 rssi general start********************************/
+
+rssi_store:
+	bpatchx patch2a_7,mem_patch2a
+	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:
+	bpatchx patch2b_0,mem_patch2b
+	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:
+	branch 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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_transmitter.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_transmitter.prog	(working copy)
@@ -0,0 +1,381 @@
+
+
+g24_transmit_init:
+	fetch 4,mem_24g_lap		//need to roll this address
+	store 4,mem_24g_device_addr
+	branch rssi_transmitter_buff_init
+
+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 patch2b_1,mem_patch2b
+	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
+	fetch 2,mem_cb_24g_transmit_short_sleep
+	branch callback_func
+
+g24_short_sleep:
+	bpatchx patch2b_2,mem_patch2b
+	call g24_lpm_wait
+	nrtn user
+	call g24_setgpio_lpm_before
+	call clear_wake
+	fetch 3,mem_24g_short_sleep_set
+	branch g24_long_seep2
+
+g24_long_sleep:
+	bpatchx patch2b_3,mem_patch2b
+	call g24_lpm_wait
+	nrtn user
+	call g24_setgpio_lpm_before
+	fetch 8,mem_24g_enter_hibernate
+g24_long_seep2:
+	call clk2lpo
+	storet 4,mem_sleep_counter
+	branch lpm_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:
+	setarg 0
+	store 1,mem_24g_retry
+	store 2,mem_24g_retransmit
+g24_transmit_loop:
+	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
+	sub pdata,dvc_op_mouse,null
+	call mouse_24g_transmit_callback,zero
+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:
+	bpatchx patch2b_4,mem_patch2b
+	setarg 0
+	store 1,mem_24g_ensure
+	store 2,mem_24g_txfail_cnt
+	rtn
+
+g24_transmit_receive_ack:
+	bpatchx patch2b_5,mem_patch2b
+	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
+	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_device_option
+	bne dvc_op_mouse,g24_retransmit0
+	fetch 1,mem_mouse_need_soft_reset
+	nrtn blank
+	call mouse_select_device_by_pb_button
+g24_retransmit0:	
+	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
+	fetch 2,mem_24g_retransmit
+	increase 1,pdata
+	store 2,mem_24g_retransmit	
+	branch g24_transmit_loop
+
+
+g24_ackpayload_parse:
+	bpatchx patch2b_6,mem_patch2b
+	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:
+	bpatchx patch2b_7,mem_patch2b
+	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 patch2c_0,mem_patch2c
+	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
+	fetch 2,mem_cb_24g_transmit_long_sleep
+	branch callback_func
+
+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_lpm_wait:
+	bpatchx patch2c_1,mem_patch2c
+	enable user
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	branch disable_user,blank
+	fetch 1,mem_lpm_mode
+	branch disable_user,blank
+g24_lpm_wait_next:
+	fetch 1,mem_24g_transmit_by_interrupt
+	beq G24_TX_TIMER_INT_ENABLE,disable_user
+	rtn
+
+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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_txpower_ctrl.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/g24_protocol_stack/24g_txpower_ctrl.prog	(working copy)
@@ -0,0 +1,95 @@
+
+/****************************g24 transmitter tx power start********************************/
+
+power_ctrl_start:
+	bpatchx patch2c_2,mem_patch2c
+	fetch 1,mem_power_ctrl_disable
+	nrtn blank
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_ADV
+	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/l2cap.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/l2cap.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/l2cap.prog	(working copy)
@@ -0,0 +1,376 @@
+/************************************/
+/*initialize L2CAP related variables*/
+/************************************/
+l2cap_init:
+	branch l2cap_init_wake,wake
+	setarg mem_l2cap_xmem_end
+	arg mem_l2cap_xmem_start,contw
+	isub contw,loopcnt
+	call clear_mem
+l2cap_init_wake:	
+//	branch l2cap_lpm_load_txbuf
+	rtn
+	
+
+
+l2cap_check_map:
+//	call l2cap_malloc_is_fifo_full
+//	nrtn blank
+	bpatch patch0f_5,mem_patch0f
+	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
+
+
+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
+
+
+
+/*********************************************************/
+//char* malloc(short len)
+//input: rega -> len
+//rtn: regb -> pbuff;return from pdata
+//val: queue -> i
+//val: timeup -> buff_cnt
+/*********************************************************/
+
+
+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:
+	bpatch patch0f_6,mem_patch0f
+	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:
+	bpatch patch0f_7,mem_patch0f
+	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:
+	bpatch patch10_0,mem_patch10
+	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:
+	bpatch patch10_1,mem_patch10
+	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:
+	bpatch patch10_2,mem_patch10
+	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:
+	bpatch patch10_3,mem_patch10
+	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:
+	bpatch patch10_4,mem_patch10
+	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:
+	bpatch patch10_5,mem_patch10
+	fetch 3,mem_tx_fifo1
+	rtn
+
+
+/*********************************************************/
+//bool fifo_is_empty(void)
+//blank == 1: empty
+//blank == 0: not empty
+/*********************************************************/
+l2cap_malloc_is_fifo_empty:
+	bpatch patch10_6,mem_patch10
+	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:
+	bpatch patch10_7,mem_patch10
+	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_util_pdata_to_contw:
+	branch assert,blank
+	copy pdata,contw
+	rtn
+	
+
+l2cap_lpm_save_calc_len:
+	bpatch patch11_0,mem_patch11
+	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:
+	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
+	fetch 2,mem_l2cap_lpm_txbuf_ptr
+	copy contr,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:
+	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
+	copy contr,contw
+	fetch 2,mem_l2cap_lpm_txbuf_ptr
+	copy contw,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/patch.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/patch.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/patch.prog	(working copy)
@@ -0,0 +1,564 @@
+
+define SENSOR_ANGLE_ICE_SDIO
+//define DPI_LOAD_AND_STORE
+//define ADC_ENABLE
+
+	bbit1 8,pf_patch_ext
+ifdef SENSOR_ANGLE_ICE_SDIO
+	beq patch06_7,p_mouse_sensor_set_angle
+endif
+ifdef ADC_ENABLE
+	beq patch14_0,p_enable_adc
+	beq patch07_7,p_mouse_adc_gpio_check_output
+endif
+	beq patch02_7,p_tx_on_next
+	beq patch03_0,p_initialize_radio_cont
+	beq patch04_0,p_lpm_sleep
+	beq patch07_5,p_mouse_setgpio_hibernate
+	beq patch08_6,p_mouse_3io6key_check
+	beq patch09_4,p_mouse_priority_bb_event
+//	beq patch09_6,p_mouse_bb_event_timer
+	beq patch0a_2,p_mouse_store_device_info
+	beq patch0b_2,p_mouse_24g_package_data
+	beq patch0b_6,p_mouse_ui_led_off_static
+	beq patch0b_7,p_mouse_ui_led_on_static
+	beq patch0e_0,p_app_init
+	beq patch1c_3,p_le_enable_phy_by_pdata
+	branch assert
+	
+pf_patch_ext:
+	beq patch2c_1,p_g24_lpm_wait
+	rtneq patch3f_7
+	branch assert
+
+p_tx_on_next:
+	fetch 1,mem_tx_power
+	beq TX_POWER_3DB,p_set_tx_power_3db
+	beq TX_POWER_6DB,p_set_tx_power_6db
+	beq TX_POWER_10DB,set_tx_power_10db
+	beq TX_POWER_F20DB,p_set_tx_power_f20db
+	beq TX_POWER_F30DB,p_set_tx_power_f30db
+	beq TX_POWER_FACTORY,set_tx_power_factory
+p_set_tx_power_0db:
+	jam 0x2c,0x8a3b
+	jam 0x17,0x8a3c
+	jam 0x8a,core_tx_pwr_ctrl0
+	jam 0x0f,core_tx_pwr_ctrl1
+	branch set_rf_ldo_cfg89_2
+
+p_set_tx_power_3db:
+	jam 0x48,0x8a3b
+	branch p_set_tx_power_0db+1
+
+p_set_tx_power_6db:
+	jam 0x70,0x8a3b
+	jam 0x1f,0x8a3c
+	jam 0xc9,core_tx_pwr_ctrl0
+	branch p_set_tx_power_0db+3
+
+p_set_tx_power_f20db:
+	jam 0x85,core_tx_pwr_ctrl0
+	jam 0x04,core_tx_pwr_ctrl1
+	jam 0xa3,core_rf_ldo_cfg8	
+	jam 0x0a,core_rf_ldo_cfg9
+	jam 0x18,0x8a3b
+	jam 0x0f,0x8a3c
+	rtn
+p_set_tx_power_f30db:
+	jam 0x83,core_tx_pwr_ctrl0
+	jam 0x02,core_tx_pwr_ctrl1
+	branch p_set_tx_power_f20db+2
+	
+p_initialize_radio_cont:
+	jam 0x03,core_rx_lna_cfg3
+	jam 0,core_syn_loopdiv_dsm_cfg
+	jam 0x10,0x896f
+
+	//branch initialize_radio_cont+1
+	fetch 1,mem_wdt_always_work
+	call wdt_set_disable,blank
+
+	jam 0x05,core_clkpll_cfg0
+	jam 0x94,core_rx_iqadc_cfg
+	call initialize_rc_cal
+	call initialize_rf_ldo_cfg1
+	call initialize_syn_afc_cfg1
+	jam 0xe6,core_syn_aac_cfg1
+
+	//optimize RX SX pn
+	jam 0x90,core_syn_pfd_lkd_cfg
+	jam 0x0b,core_rf_ldo_cfg2
+	jam 0x05,core_rf_ldo_cfg3
+
+	//Improve auto agc
+	jam 0x76,core_agc_wb_sat_th
+	jam 0x76,core_agc_nb_sat_th
+
+	fetch 1,mem_fcomp_div
+	bne XTAL_16M,p_initialize_radio_cont_next
+	jam 0x34,core_clkpll_cfg5		//16M XTAL
+p_initialize_radio_cont_next:
+	jam 0xff,core_clkpll_ctrl1
+	nop 100
+	jam 0x0e,core_clkpll_ctrl2
+	jam 0x03,core_clkpll_ctrl0
+	
+	call p_set_tx_power_0db
+	jam 0x28,core_tx_mixer_cfg1
+	jam 0x3f,core_tx_mixer_cfg2
+	branch initialize_radio_cont_next_2
+
+p_lpm_sleep:
+	call lpm_write_gpio_wakeup
+	branch lpm_sleep+1
+
+p_app_init:
+p_mouse_init:
+	jam 0x73,core_spid_ctrl
+	
+	call enable_authrom
+	call p_mouse_setting_config
+	call mouse_init_sunt
+	rtn wake
+	call mouse_le_name_load		//config tool
+	call mouse_dpi_config
+	call mouse_drawing_optima_init
+	call p_mouse_cb_fuction
+	branch mouse_init+8
+
+
+p_mouse_setting_config:
+	rtn wake
+ifdef ADC_ENABLE
+	call p_mouse_adc_vol_init
+endif
+	call mouse_setting_config
+	rtnbit0 MOUSE_ENABLE_OTP
+p_mouse_load_otp_info_check:
+ifdef DPI_LOAD_AND_STORE
+	call p_mouse_read_otp_dpi
+endif
+	call p_mouse_read_otp_24g_addr
+p_mouse_otp_load_app_initflag:
+	arg 2,temp
+	arg OTP_OFFSET_APP_INITLAG,pdata
+	arg mem_store_flag,rega
+	call otpd_read_data_with_pwr_operation
+
+	fetch 2,mem_store_flag
+	arg EEPROM_INIT_FLAG,temp
+	isub temp,null
+	branch p_mouse_load_device_info,zero
+	call mouse_app_initflag_check+4
+p_mouse_otp_store_app_initflag:
+	arg 2,loopcnt
+	arg mem_store_flag,rega
+	arg OTP_OFFSET_APP_INITLAG,pdata
+	branch otp_write
+
+p_mouse_load_device_info:
+ifdef DPI_LOAD_AND_STORE
+	arg OTP_OFFSET_DPI,pdata
+	call p_mouse_read_otp_dpi_common			
+	fetch 1,mem_mouse_dpi_temp
+	call p_mouse_load_default_dpi,blank
+else
+	call p_mouse_load_default_dpi
+endif	
+	jam MODE_24G_DEVICE,mem_device_flag
+	branch mouse_load_device_info+1
+
+p_mouse_load_default_dpi:
+	fetch 1,mem_config_sensor_dpi
+	store 1,mem_mouse_dpi
+	rtn
+
+
+
+p_mouse_ui_led_off_static:
+	copy temp,pdata
+	rtn blank
+	rtneq GPIO_DISABLE
+	branch mouse_ui_led_off_static+1
+
+p_mouse_ui_led_on_static:
+	copy temp,pdata
+	rtn blank
+	rtneq GPIO_DISABLE
+	branch mouse_ui_led_on_static+1
+
+ifdef SENSOR_ANGLE_ICE_SDIO
+p_mouse_sensor_set_angle:
+	fetch 1,mem_mouse_ice_sdio_for_sensor_angle
+	branch mouse_sensor_set_angle+1,blank
+	fetch 1,mem_sensor_angle_default
+	store 1,mem_config_sensor_angle
+	fetch 1,mem_select_sensor_angle_gpio
+	rtneq GPIO_DISABLE
+	call lpm_write_ice_disable
+	fetch 1,mem_select_sensor_angle_gpio
+	arg gpcfg_output_low,temp
+ 	call gpio_config_function_int
+	fetch 1,mem_mouse_reuse_2ice_gpio
+	arg gpcfg_output_low,temp
+ 	call gpio_config_function_int
+ 	fetcht 1,mem_mouse_sensor_sdio_gpio
+	call mouse_gpio_config_input_pu
+	fetcht 1,mem_mouse_sensor_sdio_gpio
+	call gpio_get_bit
+	call mouse_sensor_switch_angle,true
+	call mouse_gpio_config_input_pd
+	fetcht 1,mem_mouse_sensor_sdio_gpio
+	call gpio_config_input
+	call lpm_write_ice_enable
+p_ice_gpio_set_float:
+ 	fetcht 1,mem_select_sensor_angle_gpio
+	call gpio_set_high_impedance
+	fetcht 1,mem_mouse_reuse_2ice_gpio
+	branch gpio_set_high_impedance
+endif
+	
+p_mouse_cb_fuction:
+	setarg mouse_24g_short_sleep
+	store 2,mem_cb_24g_transmit_short_sleep
+	setarg p_mouse_24g_long_sleep
+	store 2,mem_cb_24g_transmit_long_sleep
+	branch mouse_cb_fuction+4
+
+p_mouse_24g_long_sleep:
+	call g24_lpm_wait
+	nrtn user
+//	fetch 1,mem_24g_device_led_status
+//	nrtn blank
+	call clear_wake
+	jam 1,mem_mouse_24g_long_sleep_flag
+	branch mouse_24g_long_sleep+4
+
+p_mouse_24g_short_sleep_clear_wake:
+	call clear_wake
+	branch lpm_write_gpio_wakeup
+
+p_mouse_24g_package_data:
+	call mouse_motion
+	nrtn user
+	fetch 1,mem_mouse_24g_long_sleep_flag
+	jam 0,mem_mouse_24g_long_sleep_flag
+	ncall p_mouse_24g_short_sleep_clear_wake,blank	
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_KEYBOARD,mouse_24g_mouse_package_data
+	call p_remote_24g_key_process
+	fetch 1,mem_customer_key
+	nbranch p_mouse_24g_keyboard_package_data,blank
+	branch mouse_24g_package_data+8
+p_remote_24g_key_process:
+	fetch 1,mem_mouse_key
+	and pdata,0x18,pdata		//
+	nbranch mouse_customerkey_press,blank
+	call mouse_customerkey_release
+	branch mouse_check_customerkey_gpio_exit
+p_mouse_24g_keyboard_package_data:
+	call p_mouse_customer_key_press_setup
+	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
+p_mouse_customer_key_press_setup:
+	fetch 1,mem_mouse_key	
+	bbit1 3,p_mouse_customer_key_F23	
+	bbit1 4,p_mouse_customer_key_F20
+	rtn	
+p_mouse_customer_key_F20: 
+	setarg 0 
+	store 1,mem_customer_key_press
+	store 1,mem_customer_key_release
+	setarg 0x6F0000 
+	branch mouse_customer_standrad_key_set	
+p_mouse_customer_key_F23: 
+	setarg 0 
+	store 1,mem_customer_key_press
+	store 1,mem_customer_key_release
+	setarg 0x720000 
+	branch mouse_customer_standrad_key_set	
+
+p_le_enable_phy_by_pdata:
+	copy temp,pdata
+	bbit1 BIT_LE_2M_PHY,p_le_enable_2M
+	branch le_enable_phy_by_pdata+3
+p_le_enable_2M:
+	jam 0x89,core_rx_bq_cfg0	//bit7 set1,improve 2M rx sensitivity
+	branch le_enable_2M
+	
+p_mouse_setgpio_hibernate:
+	call mouse_setgpio_hibernate+1
+	fetch 1,mem_mouse_logo_enable_gpio0
+	beq 1,p_mouse_setgpio_hibernate_next
+	jam 0x80,0x8070
+p_mouse_setgpio_hibernate_next:
+	fetch 1,mem_gpio_wakeup_low+1	//enable ice wakeup
+	set1 5,pdata
+	store 1,mem_gpio_wakeup_low+1
+	call lpm_write_gpio_wakeup
+	branch mouse_1io2led_all_off
+
+
+p_g24_lpm_wait:
+	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_sensor_shutdown_flag
+	nrtn blank
+	branch g24_lpm_wait_next
+
+
+p_mouse_3io6key_check:
+	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_1
+	
+p_mouse_priority_bb_event:
+	copy regc,pdata
+	beq BT_EVT_24G_ATTEMPT_SUCCESS,p_mouse_24g_attempt_success
+	beq BT_EVT_24G_ATTEMPT_FAIL,p_mouse_24g_attempt_fail
+	branch mouse_priority_bb_event+2
+
+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_led_config
+	call mouse_no_data_timer_init
+	call mouse_init_sensor_reset
+	jam 0,mem_mouse_long_mult_flag
+	jam 0,mem_24g_conn_sm
+	jam 0,mem_24g_reconn_type
+	fetcht 4,mem_24g_receiver_addr
+	branch mouse_24g_attempt_success+11
+	
+p_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,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_next
+	
+p_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_next
+	fetch 1,mem_device_number
+	beq 1,mouse_24g_attempt_fail_enter_hibernate_next		//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,mouse_24g_attempt_fail_enter_hibernate_next
+	bbit1 MOUSE_ENABLE_EEPROM,mouse_24g_attempt_fail_enter_hibernate_next
+	bbit1 MOUSE_ENABLE_FLASH,mouse_24g_attempt_fail_enter_hibernate_next
+	branch mouse_24g_start_auto_pair+1
+
+p_mouse_store_device_info:
+	call mouse_store_device_info+1
+	rtnbit0 MOUSE_ENABLE_OTP 
+p_mouse_store_otp_device_info:
+ifdef DPI_LOAD_AND_STORE
+	call p_mouse_otp_store_dpi
+endif
+p_mouse_otp_store_24g_addr:
+	arg OTP_OFFSET_24G_ADDR,pdata
+	copy pdata,regb
+p_mouse_otp_store_24g_addr_loop:
+	call p_mouse_read_otp_24g_addr_common
+	fetch 4,mem_mouse_24g_addr_temp
+	branch p_mouse_24g_addr_store,blank	
+	store 4,mem_mouse_24g_addr_last
+	increase 4,regb
+	arg OTP_OFFSET_24G_ADDR_END,pdata
+	isub regb,null
+	nrtn positive	//if read end,retention last value
+	copy regb,pdata
+	branch p_mouse_otp_store_24g_addr_loop
+
+p_mouse_24g_addr_store:
+	fetch 4,mem_mouse_24g_addr_last
+	fetcht 4,mem_mouse_24g_addr
+	isub temp,null
+	rtn zero
+	arg 4,loopcnt
+	arg mem_mouse_24g_addr,rega
+	copy regb,pdata
+	branch otp_write
+
+ifdef DPI_LOAD_AND_STORE
+p_mouse_otp_store_dpi:
+	arg OTP_OFFSET_DPI,pdata
+	copy pdata,regb
+p_mouse_otp_store_dpi_loop:
+	call p_mouse_read_otp_dpi_common
+	fetch 1,mem_mouse_dpi_temp
+	branch p_mouse_dpi_store,blank
+	store 1,mem_mouse_dpi_last
+	increase 1,regb
+	arg OTP_OFFSET_DPI_END,pdata
+	isub regb,null
+	nrtn positive
+	copy regb,pdata
+	branch p_mouse_otp_store_dpi_loop
+	
+p_mouse_dpi_store:
+	fetch 1,mem_mouse_dpi_last
+	and pdata,0xf0,pdata
+	branch p_mouse_dpi_store_next,blank
+	fetch 1,mem_mouse_dpi
+	store 1,mem_mouse_otp_dpi_value
+p_mouse_dpi_store_end:	
+	arg 1,loopcnt
+	copy regb,pdata
+	arg mem_mouse_otp_dpi_value,rega
+	branch otp_write
+
+p_mouse_dpi_store_next:
+	fetch 1,mem_mouse_dpi_last
+	fetcht 1,mem_mouse_dpi
+	isub temp,null
+	rtn zero
+	lshift4 temp,temp
+	iadd temp,pdata
+	store 1,mem_mouse_otp_dpi_value
+	
+	copy regb,pdata
+	arg OTP_OFFSET_DPI,temp
+	isub temp,null
+	branch p_mouse_dpi_store_end,zero
+	
+	increase -1,regb
+	branch p_mouse_dpi_store_end
+
+
+p_mouse_read_otp_dpi:
+	arg OTP_OFFSET_DPI,pdata
+	copy pdata,regb
+p_mouse_read_otp_dpi_loop:
+	call p_mouse_read_otp_dpi_common	
+	fetch 1,mem_mouse_dpi_temp
+	branch p_mouse_dpi_load,blank	
+	store 1,mem_mouse_dpi_last
+	increase 1,regb
+	arg OTP_OFFSET_DPI_END,pdata
+	isub regb,null
+	nbranch p_mouse_dpi_load,positive	//if read end,retention last value
+	copy regb,pdata
+	branch p_mouse_read_otp_dpi_loop
+
+p_mouse_read_otp_dpi_common:
+	arg 1,temp
+	arg mem_mouse_dpi_temp,rega
+	branch otpd_read_data_with_pwr_operation
+
+p_mouse_dpi_load:
+	fetch 1,mem_mouse_dpi_last
+	copy pdata,regc
+	and pdata,0xf0,pdata
+	branch p_mouse_dpi_load_next,blank
+	rshift4 pdata,pdata
+	branch p_mouse_dpi_load_end
+
+p_mouse_dpi_load_next:
+	copy regc,pdata
+p_mouse_dpi_load_end:
+	store 1,mem_mouse_dpi
+	rtn	
+endif
+
+p_mouse_read_otp_24g_addr:
+	arg OTP_OFFSET_24G_ADDR,pdata
+	copy pdata,regb
+p_mouse_read_otp_24g_addr_loop:
+	call p_mouse_read_otp_24g_addr_common
+	fetch 4,mem_mouse_24g_addr_temp
+	branch p_mouse_24g_addr_load,blank	
+	store 4,mem_mouse_24g_addr_last
+	increase 4,regb
+	arg OTP_OFFSET_24G_ADDR_END,pdata
+	isub regb,null
+	nbranch p_mouse_24g_addr_load,positive	//if read end,retention last value
+	copy regb,pdata
+	branch p_mouse_read_otp_24g_addr_loop
+
+p_mouse_read_otp_24g_addr_common:
+	arg 4,temp
+	arg mem_mouse_24g_addr_temp,rega
+	branch otpd_read_data_with_pwr_operation
+	
+
+p_mouse_24g_addr_load:
+	fetch 4,mem_mouse_24g_addr_last
+	store 4,mem_mouse_24g_addr
+	rtn 
+
+ifdef ADC_ENABLE
+
+p_mouse_adc_vol_init:
+	setarg 0x0a44
+	store 2,mem_mouse_vdd_full_vol	//1.5v:0x0a44	1.1v:0x076b	1.0v:0x06af	0.9v:0x05f6	0.8v:0x0544
+	setarg 0x076b
+	store 2,mem_mouse_vdd_low_vol	//3.7v:0x0e74	3.3v:0x0ce4	3.2v:0x0c08	3.0v:0bbb
+	setarg 0x05f6
+	store 2,mem_mouse_vdd_empty_vol
+	rtn
+
+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 0x03,core_sum_ctrl
+	nop 60
+	fetch 1,core_sum_en
+	set1 7,pdata
+	store 1,core_sum_en
+	nop 1000  // 1/24ms
+	
+	fetch 2,mem_adc_delay
+	call sleep
+//	fetcht 1,mem_adc_config_flag
+//	sub temp,ADC_CONFIG_HVIN,null
+//	call sleep,zero
+	branch enable_adc_next
+
+p_mouse_adc_gpio_check_output:
+	fetcht 1,mem_adc_channel
+	sub temp,3,null
+	branch p_mouse_adc_gpio_3_6_set,positive
+	increase 4,temp
+	branch mouse_adc_gpio_check_output+5
+
+p_mouse_adc_gpio_3_6_set:
+	increase 3,temp
+	branch mouse_adc_gpio_4_7_set+1
+
+endif
+
Index: program/peripherals.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/peripherals.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/peripherals.prog	(working copy)
@@ -0,0 +1,2821 @@
+
+
+
+/* ===================== two wire SPI gpio ======================= */
+
+//pdata:gpio number
+twspi_reset:
+	bpatch patch11_1,mem_patch11
+	copy temp,pdata
+	and_into 0xff,pdata
+	sub pdata,GPIO_NUMBER+-1,null
+	nbranch assert,positive
+	arg core_gpio_conf,contw
+twspi_reset_next:
+	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_spid_delay
+	and_into 0x7f,pdata
+	store 1,core_spid_delay
+	rtn
+
+twspi_enable:
+	fetch 1,core_spid_delay
+	or_into 0x80,pdata
+	store 1,core_spid_delay
+	rtn
+
+twspi_write:
+	branch spid_write_reg
+
+twspi_read:
+	branch spid_read_reg
+
+
+/* ===================== 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 //length
+	branch read_fuction_zero,zero
+	copy regc,pc  //branch pc
+	
+read_fuction_zero:
+	isolate0 0,null  // always true
+	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:
+	call load_aes_reinit,user
+	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
+set_iv:
+	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_aes_reinit:
+	jam 0x0, core_ucode_ctrl
+	call aes_disable
+	branch aes_clear_data
+
+load_storage:
+	setarg 0
+	store 2,mem_queue	//data checksum
+	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
+	fetch 1,mem_ucode_status
+	rtnbit0 0           //rtn if load code fail
+load_storage_loop:
+	arg 6,temp
+	call get_block_header0
+	nbranch load_data_checksum_compare,zero
+	ifetch 2,contr
+	iforce rega
+	call read_function
+	call load_data_checksum_calc
+	branch load_storage_loop
+
+
+load_data_checksum_calc:
+	fetch 2,mem_queue
+	arg 6,loopcnt
+	arg mem_ucode_buf,contr
+	call cal_sum
+	fetchr loopcnt,2,mem_ucode_len
+	copy rega,contr
+	call cal_sum
+	store 2,mem_queue
+	rtn
+
+load_data_checksum_compare:
+	fetch 1,mem_load_check_sum
+	beq 0x5a,load_data_checksum_ok //skip check sum 
+	arg 0xaa55,rega
+	fetch 2,mem_ucode_buf
+	isub rega,null
+	nbranch load_data_checksum_compare_fail, zero
+	arg 0x55aa,rega
+	fetch 2,mem_ucode_len
+	isub rega,null
+	nbranch load_data_checksum_compare_fail, zero
+	fetch 2,mem_sched_addr
+	fetcht 2,mem_queue	//calc  sum
+	isub temp,null
+	nbranch load_data_checksum_compare_fail, zero
+load_data_checksum_ok:	
+	set1 15,rega
+	branch read_fuction_zero
+
+load_data_checksum_compare_fail:
+	jam 0,mem_ucode_status
+	rtn
+
+
+loadcode_lock:
+	fetch 2,core_ucode_flag
+	store 2,mem_ucode_device_flag
+	set0 lpmreg_ice_mode_bit,pdata
+	nrtn blank 	
+	
+	setarg OTP_OFFSET_DEVICE_FLAG 
+	arg mem_ucode_device_flag,rega
+	arg 2,temp
+	call otpd_read_data
+	
+	fetch 1,mem_ucode_ptr
+	rshift4 pdata,temp
+	fetch 1,mem_ucode_device_flag
+	lshift4 pdata,pdata
+	ior temp,pdata
+	store 1,mem_ucode_device_flag
+	branch app_lpm_peripheral_lock_check
+
+
+loadcode:
+	jam 0x25,core_clkoff			// disable debug uart
+	call clean_mem
+	disable user
+	jam 0,mem_ucode_status
+	call otp_read_pwr_on
+	call app_read_efuse_app_vsel	
+	setarg OTP_OFFSET_UCODE_FLAG 
+	arg mem_ucode_ptr,rega
+	arg 2,temp
+	call otpd_read_data
+	call loadcode_lock
+	setarg OTP_OFFSET_LOADCODE_DELAY
+	arg mem_load_delay ,rega
+	arg 2,temp
+	call otpd_read_data	
+
+	fetch 1,mem_ucode_device_flag
+	bbit0 OTP_UFLAG_AES, loadcode_otp
+	setarg OTP_OFFSET_UCODE_KEY
+	arg mem_ucode_keybuf,rega
+	arg 16,temp
+	call otpd_read_data
+	jam LOCK_OTP,core_misc_ctrl	// disable further read/write of key
+	set1 mark_otp_encrypt,mark	
+	arg mem_ucode_keybuf,contr
+	call load_key
+	enable user			// set user for aes
+
+loadcode_otp:
+	jam 0,mem_loadcode_times
+loadcode_otp_loop:
+	call loadcode_timeout
+	nbranch loadcode_error,positive	
+	call load_aes_reinit,user
+	fetch 2,mem_ucode_ptr
+	byteswap pdata,pdata
+	arg 0x7ff,temp
+	iand temp,pdata
+	branch loadcode_iic, zero  //no otp 
+	call otp_set_addr
+	arg otpd_read_code,regc
+	call get_iv,user
+	call load_storage
+	nbranch loadcode_iic,match
+	fetch 1,mem_ucode_status
+	compare 3,pdata,3
+	nbranch loadcode_otp_loop,true	// crc error, try again
+	call run_otp_code
+	
+loadcode_iic:
+	call otp_pwr_off
+	jam 0,mem_loadcode_times
+loadcode_iic_loop:	
+	call loadcode_timeout
+	nbranch loadcode_error,positive	
+	call iicd_load_gpio_init
+	call clear_eeprom_size_2k
+	fetch 1,mem_ucode_device_flag
+	bbit1 OTP_UFLAG_SKIP_EEP,loadcode_spi
+	call loadcode_iic_by_eeprom
+	nbranch loadcode_iic_eeprom_2k,match
+	fetch 1,mem_ucode_status
+	compare 3,pdata,3
+	nbranch loadcode_iic_loop,true		// crc error, try again
+	branch loadcode_spi
+	
+run_otp_code:
+	setarg 0x1ff //patch3f_7
+	arg 0,pc
+	rtn
+	
+loadcode_iic_eeprom_2k:
+	call set_eeprom_size_2k
+	fetch 1,mem_ucode_device_flag
+	bbit1 OTP_UFLAG_SKIP_EEP,loadcode_spi
+	call loadcode_iic_by_eeprom
+	nbranch loadcode_spi,match
+	fetch 1,mem_ucode_status
+	compare 3,pdata,3
+	nbranch loadcode_iic_loop,true		// crc error, try again
+	branch clear_key_buf
+	
+loadcode_spi:
+	jam 0,mem_loadcode_times
+loadcode_spi_loop:
+	call loadcode_timeout
+	nbranch loadcode_error,positive	
+	fetch 1,mem_ucode_device_flag
+	bbit1 OTP_UFLAG_SKIP_FLASH,clear_key_buf
+	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 clear_key_buf,match
+	fetch 1,mem_ucode_status
+	compare 3,pdata,3
+	nbranch loadcode_spi_loop,true		// crc error, try again	
+clear_key_buf:
+	setarg 0
+	store 8,mem_ucode_keybuf
+	store 8,mem_ucode_keybuf+8
+	force regidx_key,regext_index
+	call aes_clear
+	jam 0x21,core_clkoff		// enable debug uart
+	rtn
+
+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_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
+
+
+
+//output: positive 1:continue load ;0:load timeout
+loadcode_timeout:
+	call loadcode_error_delay
+	fetch 1,mem_loadcode_times
+	increase 1,pdata
+	sub pdata,3,null
+	store 1,mem_loadcode_times	 
+	rtn
+	
+loadcode_error_delay:
+	fetch 1,mem_loadcode_times
+	rtn blank
+	fetch 1,mem_load_delay
+	rtn blank
+	copy pdata,loopcnt
+	branch delay_ms_wait
+	
+/*
+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
+//	call ice_break_disable_wdt
+	call ice_break
+	rtn
+	
+
+
+/* true flag is set into status,rega pointers to buf, */
+set_ucode_status:
+	fetch 1,mem_ucode_status
+	lshift pdata,pdata
+	setflag true,0,pdata
+	isolate0 15,rega  // load code if rega.15 = 1
+	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
+
+/* ===================== OTP ======================= */
+
+
+otp_prog_pwr_on:
+	jam 0x4,rfen_chgpump
+	jam 0x31,rfen_chgpump_ctrl1
+	jam 0x1,rfen_chgpump_ctrl2
+	branch otp_pwr_on
+
+otp_read_pwr_on:
+	jam 0xc,rfen_chgpump    
+	jam 0xfb,rfen_chgpump_ctrl1
+	jam 0x3,rfen_chgpump_ctrl2   
+
+otp_pwr_on:
+	store 2,mem_timeup
+	bpatch patch11_2,mem_patch11
+	jam 0xff,core_clkpll_ctrl1
+
+	fetch 1,core_rf_ldo_en1
+	store 1,mem_timeup+2
+	or_into 0x4,pdata
+	store 1,core_rf_ldo_en1
+
+	fetch 1,core_rf_ldo_cfg7
+	store 1,mem_timeup+3
+	
+	jam 0x11,core_rf_ldo_cfg7
+	
+	nop 1000
+	fetch 1,core_clkpll_ctrl2
+	or_into 0x1,pdata
+	store 1,core_clkpll_ctrl2
+	jam 0x03,core_clkpll_ctrl0
+	bpatch patch11_3,mem_patch11
+	fetch 1,rfen_chgpump
+	or_into 0xd0,pdata
+	store 1,rfen_chgpump
+	nop 6000  //delay 500us
+	fetch 1,rfen_chgpump
+	or_into 0x20,pdata
+	store 1,rfen_chgpump
+	nop 12000   //delay 1ms
+	fetch 2,mem_timeup
+	rtn
+	
+otp_pwr_off:
+	bpatch patch11_4,mem_patch11
+	jam 0x4,rfen_chgpump
+	jam 0x43,rfen_chgpump_ctrl1
+	jam 0x1,rfen_chgpump_ctrl2
+	fetch 1,core_clkpll_ctrl2
+	and_into 0xfe,pdata
+	store 1,core_clkpll_ctrl2
+	fetch 1,mem_timeup+2
+	store 1,core_rf_ldo_en1
+	fetch 1,mem_timeup+3
+	store 1,core_rf_ldo_cfg7
+	rtn
+
+
+otp_set_addr:
+	lshift3 pdata,pdata
+	store 2,core_otp_addr
+	jam 0,core_otpd_ctrl
+	rtn	
+
+/* pdata = otp address, rega pointers data, loopcnt is count */
+otp_write:
+	call otp_prog_pwr_on
+	call otp_set_addr
+	call otp_ce
+otp_program:
+	ifetcht 1,rega
+	increase 1,rega
+	force 0,queue
+otp_program_bit:
+	qisolate0 temp
+	branch otp_skip_0,true
+	fetch 1,core_otp_din
+	set1 6,pdata				/* din */
+	set1 7,pdata				/* dle */
+	store 1,core_otp_din
+	jam 0x02,core_otp_ctrl	/* web */
+	jam 0x82,core_otp_ctrl
+	set0 7,pdata				/* dle */
+	store 1,core_otp_din
+	jam 0x8a,core_otp_ctrl	/* pgmen */
+	nop 11
+	jam 0xca,core_otp_ctrl	/* vppen */
+	nop 33
+	jam 0x4a,core_otp_ctrl	/* web 2nd */
+	nop 200
+	jam 0xca,core_otp_ctrl	/* release web */
+	nop 22
+	jam 0x8a,core_otp_ctrl	/* release vppen */
+	nop 33
+	jam 0x82,core_otp_ctrl	/* release pgmen */
+	nop 1
+	jam 0x92,core_otp_ctrl	/* pgmvfy */
+	nop 10
+	jam 0xb2,core_otp_ctrl	/* readen */
+	fetch 1,core_otp_rdata
+	jam 0x92,core_otp_ctrl	/* release readen */
+	nop 1
+	jam 0x82,core_otp_ctrl	/* release pgmvfy */
+	qisolate0 pdata
+	branch otp_program_bit,true	/* program error */
+otp_skip_0:
+	fetch 2,core_otp_addr
+	increase 1,pdata
+	store 2,core_otp_addr
+	increase 1,queue
+	compare 8,queue,0xf
+	nbranch otp_program_bit,true
+	loop otp_program
+	jam 0x83,core_otp_ctrl	/* release ceb */
+	branch otp_pwr_off
+
+otp_ce:
+	jam 0x82,core_otp_ctrl	/* ceb */
+	nop 12
+	jam 0x80,core_otp_ctrl	/* rstn */
+	jam 0x82,core_otp_ctrl	/* release rstn */
+	nop 150					/* waiting for vdd25 stable */
+	rtn
+
+	/* rega points to data, temp is count */
+otpd_read_init:
+	call otp_ce
+	jam 0xa2,core_otp_ctrl	/* readen */
+	deposit rega
+	store 2,core_otpd_addr
+	set1 11,temp
+	isolate0 15,pdata
+	setflag true,15,temp
+	storet 2,core_otpd_len
+	jam otpd_start,core_otp_rdata
+	rtn
+
+otpd_wait_end:
+	fetch 1,core_dma_status
+	bbit0 otpd_done,otpd_wait_end
+	jam 0x83,core_otp_ctrl	/* release ceb */
+	rtn
+
+/* pdata=otp address, rega points to data, temp is count */
+otpd_read_data_with_pwr_operation:
+	bpatch patch11_5,mem_patch11
+	call otp_read_pwr_on
+	call otpd_read_data
+	branch otp_pwr_off
+
+	/* pdata=otp address, rega points to data, temp is count */
+otpd_read_data:
+	call otp_set_addr
+	call otpd_read_init
+	branch otpd_wait_end
+	
+
+
+/* rega pointers to buf, temp is length */
+otpd_read_code:	
+	call otp_read_pwr_on
+	fetch 2,core_current_otp_addr
+	store 2,core_otp_addr
+	call otpd_read_init
+	arg otpd_done,queue
+	call decrypt_code
+	call otpd_wait_end
+	isolate1 otpd_crcok,pdata	
+	call set_ucode_status
+	branch otp_pwr_off
+
+/* ===================== LOCK ======================= */
+
+//0x04: 3V3; 0x3A: 5V
+app_read_efuse_app_vsel:
+	setarg OTP_OFFSET_APP_VDD_SEL 
+	arg mem_lpm_ctrl3_app_vsel,rega
+	arg 1,temp
+	call otpd_read_data
+	fetch 1,mem_lpm_ctrl3_app_vsel
+	nbranch app_set_app_vsel,blank
+	jam 0x04,mem_lpm_ctrl3_app_vsel	//3V3
+app_set_app_vsel:
+	branch lpm_write_sel_vdd
+
+app_lpm_peripheral_lock_check:
+	fetch 2,mem_ucode_device_flag
+	rshift4 pdata,pdata
+	rtn blank
+	fetch 1,mem_ucode_device_flag
+	rshift4 pdata,pdata
+	beq dvc_op_dongle,app_lpm_peripheral_lock_dongle
+	beq dvc_op_light,app_lpm_peripheral_lock_light
+	beq dvc_op_mouse,app_lpm_peripheral_lock_mouse
+	beq dvc_op_mouse_24g,app_lpm_peripheral_lock_mouse_24g
+	beq dvc_op_shutter,app_lpm_peripheral_lock_shutter
+	beq dvc_op_shutter_dy,app_lpm_peripheral_lock_shutter
+//	beq dvc_op_remote_car,app_lpm_peripheral_lock_remote_car
+	beq dvc_op_car,app_lpm_peripheral_car_lock_application
+	beq dvc_op_car_lock_app_and_ble,app_lpm_peripheral_car_lock_application_and_ble
+	branch app_lpm_mpu_lock_24g_ble
+	
+app_lpm_peripheral_lock_dongle:
+	arg mouse_init,pdata //mouse
+	arg shutter_dy_shutter_1s_timer,temp  //shutter dy
+	call app_mpu_s0_lock
+	branch app_lpm_peripheral_lock_frmt_common
+
+app_lpm_peripheral_lock_light:
+	arg car_hard_switch_power_on_signal,pdata //car
+	arg shutter_dy_shutter_1s_timer,temp  //shutter dy
+	call app_mpu_s0_lock    
+	branch lpm_write_lock
+
+app_lpm_peripheral_lock_mouse:
+	arg shutter_init,pdata //shutter
+	arg shutter_dy_shutter_1s_timer,temp  //shutter dy
+	call app_mpu_s0_lock
+	branch app_lpm_peripheral_lock_frmt_common
+	
+app_lpm_peripheral_lock_mouse_24g:
+	arg le_init_adv,pdata   // le
+	arg le_send_ll_one_lenth,temp
+	call app_mpu_s0_lock
+	branch app_lpm_peripheral_lock_frmt_common
+	
+app_lpm_peripheral_lock_shutter:
+	arg car_hard_switch_power_on_signal,pdata  //car
+	arg mouse_24g_send_time_long_wake,temp //mouse
+	call app_mpu_s0_lock
+	branch app_lpm_peripheral_lock_frmt_common
+
+
+app_lpm_peripheral_lock_remote_car:
+app_lpm_peripheral_car_lock_application:
+	arg dongle_init,pdata  //dongle
+	arg shutter_dy_shutter_1s_timer,temp  //shutter dy
+	call app_mpu_s0_lock
+app_lpm_peripheral_lock_frmt_common:
+	arg frmt_gem_adv_pdu_common,pdata
+	arg frmt_ble_data_set,temp
+	call app_mpu_s1_lock
+	branch lpm_write_lock
+
+app_lpm_peripheral_car_lock_application_and_ble:
+	arg dongle_init,pdata  //dongle 
+	arg shutter_dy_shutter_1s_timer,temp  //shutter dy
+	call app_mpu_s0_lock 
+	
+	arg le_init_adv,pdata 
+	arg le_send_ll_one_lenth,temp
+	call app_mpu_s1_lock
+	branch lpm_write_lock
+	
+//app_lpm_mpu_lock_app:	
+//	arg car_init,pdata  //car
+//	arg ui_soft_switch_power_off,temp //shutter
+app_mpu_s0_lock:
+	lshift16 temp,temp
+	ior temp,pdata
+	store 4,core_lpm_reg
+	branch lpm_write2_mpu_s0
+
+app_lpm_mpu_lock_ble:	
+	arg le_parse_att,pdata
+	arg le_send_ll_one_lenth,temp
+app_mpu_s1_lock:
+	lshift16 temp,temp
+	ior temp,pdata
+	store 4,core_lpm_reg
+	branch lpm_write2_mpu_s1
+	
+app_lpm_mpu_lock_24g:	
+	arg g24_prep,pdata
+	arg g24_enable_1M,temp
+	branch app_mpu_s1_lock
+	
+app_lpm_mpu_lock_24g_ble:
+	call app_lpm_mpu_lock_24g
+	arg le_parse_att,pdata
+	arg le_send_ll_one_lenth,temp
+	call app_mpu_s0_lock
+	branch lpm_write_lock
+
+
+lpm_write_lock:
+	fetch 2,mem_ucode_device_flag
+	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_write2_ctrl_option:
+	setarg lpmreg2_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
+
+lpm_write_ice_enable:
+	fetch 2,core_ucode_flag
+	set1 lpmreg_ice_mode_bit,pdata
+	store 4,core_lpm_reg
+	branch lpm_write2_ctrl_option
+	
+	
+lpm_write2_mpu_s0:
+	setarg lpmreg2_sel_mpu_s0
+	branch lpm_write2
+
+lpm_write2_mpu_s1:
+	setarg lpmreg2_sel_mpu_s1
+	branch lpm_write2
+
+
+
+/* ===================== SPI dma ======================= */
+
+spid_init:
+	bpatch patch11_6,mem_patch11
+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
+	bpatch patch11_7,mem_patch11
+	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
+	bpatch patch12_0,mem_patch12
+	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
+	nop 5
+	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:
+	bpatch patch12_1,mem_patch12
+	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:
+	bpatch patch12_2,mem_patch12
+	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
+
+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 1,mem_spi_cs_gpio
+	jam 3,mem_spi_si_gpio
+	jam 0,mem_spi_so_gpio
+	jam 2,mem_spi_sclk_gpio
+	jam 11,mem_spi_wp_gpio
+	jam 10,mem_spi_hold_gpio
+	rtn
+
+
+/*****************************************************************************
+*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:
+	bpatch patch12_3,mem_patch12
+	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:
+	bpatch patch12_4,mem_patch12
+	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
+	bpatch patch12_5,mem_patch12
+	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:
+	bpatch patch12_6,mem_patch12
+	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
+	bpatch patch12_7,mem_patch12
+	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:
+	bpatch patch13_0,mem_patch13
+	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
+
+ifdef COMPILE_UART
+
+/* ===================== uart dma ======================= */
+uarta_init_dma_mem:
+	call enable_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
+	rshift32 pdata,pdata
+	rshift16 pdata,temp
+	call uarta_init_tx,user
+	fetch 2,core_clkoff
+	set0 CLOCK_OFF_UART,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: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: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: 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
+
+uarta_prepare_tx:
+	fetchr contus,2,core_uart_tsaddr
+	fetchr contue,2,core_uart_teaddr
+	fetchr contu,2,core_uart_twptr
+	rtn
+
+uarta_prepare_rx:
+	fetchr contus,2,core_uart_rsaddr
+	fetchr contue,2,core_uart_readdr
+	fetchr contu,2,core_uart_rrptr
+	rtn
+
+uarta_send:
+	storer contu,2,core_uart_twptr
+	rtn
+
+uarta_rxdone:
+	storer contu,2,core_uart_rrptr
+	rtn
+
+uarta_clear_current_rx:
+	call uarta_prepare_rx
+	fetch 2,core_uart_rxitems
+	iadd contu,contu
+	branch uarta_rxdone
+
+uarta_prepare_tx_register_push:
+	call uart_register_push
+	branch uarta_prepare_tx
+
+uarta_send_register_pop:
+	call uarta_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_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_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
+
+wait_uarttx:
+	fetch 2,core_uart_txitems
+	nbranch wait_uarttx,blank
+	rtn
+
+	
+endif
+
+//enable user2 reconnect
+//disable user2 pairing
+nvram_find_addr_from_bd_list:
+	bpatch patch13_1,mem_patch13
+	call disable_user
+	fetch 1,mem_nv_data_number
+	rtn blank		// not nv data
+
+	fetch 2,mem_ui_state_map
+	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	
+find_addr_from_bd_list_common:
+	bpatch patch13_2,mem_patch13
+	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
+	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
+
+
+load_device_list_mode_4:
+	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
+eeprom_store_reconn_info:
+	fetch 1,mem_device_option
+	beq dvc_op_mouse,mouse_store_remote_bdaddr
+	rtn
+	
+
+
+/* =============== GPIO CONTROL ================= */
+
+
+//temp [4:0]=GPIO number, 0-31, 
+gpio_set_wake_by_current_state:
+	bpatch patch13_3,mem_patch13
+	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:
+	bpatch patch13_4,mem_patch13
+	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:
+	bpatch patch13_5,mem_patch13
+	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:
+	bpatch patch13_6,mem_patch13
+	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:
+	sub temp,UI_BUTTON_GPIO_DISABLE,null
+	branch disable_true,zero
+	call gpio_addr
+	ifetch 1,contw
+	bbit1 0,gpio_check_active_high
+	isolate0 gpio_active_bit,temp
+	rtn
+gpio_check_active_high:
+	isolate1 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:
+	sub temp,GPIO_DISABLE,null
+	rtn zero
+	call gpio_addr
+	setarg gpcfg_high_impedance
+	branch gpio_write
+
+gpio_addr:
+	and temp,0x3f,pdata
+	sub pdata,GPIO_NUMBER+-1,null
+	nbranch assert,positive
+	arg core_gpio_conf,contw
+gpio_addr_next:
+	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
+	sub pdata,GPIO_NUMBER+-1,null
+	nbranch assert,positive
+	arg core_gpio_conf,contw
+gpio_config_function_int_next:
+	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
+
+
+//The default as shutter and remote
+gpio_set_before_lpm:
+	arg GPIO_NUMBER,loopcnt
+	arg core_gpio_conf,contr
+setgpio_loop:
+	copy contr,contw
+	ifetch 1,contr
+	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:
+	bpatch patch13_7,mem_patch13
+	setarg OTP_OFFSET_ADC_PARAM
+	arg mem_gpio_h_k19_b13,rega
+	arg 12,temp
+	branch otpd_read_data_with_pwr_operation
+
+	
+enable_adc:
+	bpatch patch14_0,mem_patch14
+	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 0x03,core_sum_ctrl
+	nop 60
+	fetch 1,core_sum_en
+	set1 7,pdata
+	store 1,core_sum_en
+	nop 1000  // 1/24ms
+	fetch 2,mem_adc_delay
+	fetcht 1,mem_adc_config_flag
+	sub temp,ADC_CONFIG_HVIN,null
+	call sleep,zero
+enable_adc_next:
+	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
+
+	
+read_adc_mode:	
+	bpatch patch14_1,mem_patch14
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_GPIO_L,adc_check_gpio_l
+	beq ADC_CONFIG_GPIO_h,adc_check_gpio_h
+	beq ADC_CONFIG_HVIN,adc_adc_mode_vbat
+adc_adc_mode_vbat:
+	setarg 0x4f
+	rtn
+	
+adc_check_gpio_l:
+	arg 2,rega
+	branch adc_check_gpio
+	
+adc_check_gpio_h:
+	arg 6,rega
+adc_check_gpio:
+	fetch 1,mem_adc_channel
+	lshift3 pdata,pdata
+	or pdata,1,pdata
+	ior rega,pdata
+	rtn
+
+
+adc_calculate:
+	bpatch patch14_2,mem_patch14
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_GPIO_L,adc_calculate_gpio_l
+	beq ADC_CONFIG_GPIO_h,adc_calculate_gpio_h
+//	beq ADC_CONFIG_HVIN,p_adc_calculate_gpio_bat
+adc_calculate_gpio_bat:
+	fetch 4,mem_hvin_k19_b13
+	branch adc_calculate2
+	
+adc_calculate_gpio_h:
+	fetch 4,mem_gpio_h_k19_b13
+	branch adc_calculate2
+	
+adc_calculate_gpio_l:
+	fetch 4,mem_gpio_l_k19_b13
+	
+adc_calculate2:
+	store 4,mem_temp
+	call adc_19k_13b_32bit_cal_k
+	fetcht 2 ,mem_adc_current_value
+	imul32 temp,pdata
+	rshift16 pdata,pdata
+	rshift4 pdata,temp
+//	rshift4 pdata,pdata
+//	copy pdata,regext
+//	copy regext,temp
+	fetch  4,mem_temp
+	call adc_19k_13b_32bit_cal_b
+	
+//	fetch 4,mem_adc_update_b
+	isub temp,pdata   // y = b  - xk
+//	store 4,mem_adc_update_xleft20
+//	fetch 4,mem_adc_update_xleft20
+	arg  1000,temp
+	imul32 temp,pdata
+//	arg 0x1000,temp
+//	lshift8 temp,temp
+//	idiv temp
+//	call wait_div_end
+//	quotient pdata
+//	store 4,mem_adc_update_xleft20
+	rshift16 pdata,pdata
+	rshift4 pdata,pdata
+	rtn
+
+//input data k19_b13; output k 
+adc_19k_13b_32bit_cal_k:
+	arg 0xffffe000,rega
+	iand rega ,pdata
+	rshift3 pdata,pdata
+//	store 4,mem_adc_update_k
+	rtn
+
+//input data k19_b13; output b 	
+adc_19k_13b_32bit_cal_b:
+	arg 0x00001fff,rega
+	iand rega ,pdata
+	lshift8 pdata,pdata
+	lshift2 pdata,pdata
+//	store 4,mem_adc_update_b
+	rtn 
+
+
+/*	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
+	bpatch patch14_3,mem_patch14
+	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
+	branch enable_user
+
+
+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
+	bpatch patch14_4,mem_patch14
+	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:
+	bpatch patch14_5,mem_patch14
+	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
+
+
+/*
+input:
+mem_pdatatemp:
+byte[0]: pwm gpio selected
+byte[1]: pwm channel selected
+byte[2-4]: pwm frequency, little-endian
+byte[5]: duty cycle, percentage
+*/
+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
+	quotient rega
+	copy temp,pdata
+	isub rega,regb
+
+	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
+
+/*
+input:
+rega:pcnt ;
+regb:ncnt;
+pdata:pwm channel select.
+*/
+pwm_duty_cycle_set:
+	iforce queue
+	call pwm_duty_cycle_set_without_autoload
+	branch pwm_autoload_set
+
+/*
+input:
+queue: pwm channel
+*/
+pwm_autoload_set:	
+	fetch 1, core_pwm_autoload
+	qset1 pdata
+	store 1, core_pwm_autoload
+	fetcht 1, core_clksel
+	isolate1 7, temp
+	call delay_1clk_of_33k, true
+	qset0 pdata
+	store 1, core_pwm_autoload
+	rtn	
+
+
+delay_1clk_of_33k:
+	nop 480
+	rtn
+
+/*
+input:
+rega:pcnt ;
+regb:ncnt;
+pdata:pwm channel select.
+*/	
+pwm_duty_cycle_set_without_autoload:
+	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
+
+
+
+
+/*
+rega: even pwm channel select & gpio select 
+regb: odd pwm channel select & gpio select 
+
+note:
+byte of even pwm channel:
+bit[7]: force to set even sync bit to 1;
+bit[6]: for even bit, reserved
+
+byte of odd pwm channel:
+bit[7]: 1: set odd sync bit to 1; 0: set odd sync bit to 0; 
+bit[6]: 1: set odd pwm init to 1; 0: set odd pwm init to 0;
+
+setarg 0x0008, rega
+0x00:pwm0 selected
+0x08:gpio select
+
+arg 0x4109, regb
+0x41:pwm1 selected and set pwm1 init bit to 1
+0x09:gpio select
+*/
+pwm_enable_in_syncmode:
+	rshift8 regb, queue
+	call pwm_init_bit_set
+	rshift8 regb, queue
+	call pwm_syncmode_set
+	rshift8 rega, queue
+	enable true
+	call pwm_syncmode_set_process
+
+	deposit rega
+	call pwm_gpio_select
+	deposit regb
+	branch pwm_enable
+
+pwm_disable_in_syncmode:
+	deposit rega
+	call pwm_disable
+	deposit regb
+	call pwm_disable
+
+	rshift8 rega, queue
+	disable true
+	call pwm_syncmode_set_process
+	rshift8 regb, queue
+	disable true
+	call pwm_init_bit_set_process
+	rshift8 regb, queue
+	disable true
+	branch pwm_syncmode_set_process
+	
+
+/*
+input:
+queue: pwm channel
+
+note:
+for even bit, 
+0: PWM0/1 work independent
+1: PWM0 output is synchronized to PWM1
+for odd bit,
+Only used when pwm0_syn_to_pwm1 =1, PWM0/1 out inverse
+*/
+pwm_syncmode_set:
+	isolate1 7, queue
+pwm_syncmode_set_process:	
+	and queue, 0x0f,queue
+	fetch 1,core_pwm_sync
+   	qsetflag true,pdata
+   	store 1,core_pwm_sync
+   	rtn
+
+/*
+input:
+queue: pwm channel
+
+note:
+for even bit, reserved
+for odd bit,only used when pwm0_syn_to_pwm1 =1, 
+0: PWM0 out high first
+1: PWM1 out high first
+*/
+pwm_init_bit_set:
+	isolate1 6, queue
+pwm_init_bit_set_process:	
+	and queue, 0x0f,queue
+	fetch 1, core_pwm_init
+	qsetflag true, pdata
+	store 1, core_pwm_init
+	rtn
+/*
+input:
+pdata: pwm channel select & gpio select 
+
+note:
+setarg 0x0108
+0x01:pwm channel select
+0x08:gpio select
+*/
+pwm_gpio_select:
+	call pwm_select_channel
+pwm_gpio_select_process:
+	lshift8 pdata,pdata
+	add queue,gpcfg_pwm_out0,temp
+	ior temp,pdata
+	branch gpio_config_param 
+
+/*
+input:
+pdata: pwm channel select & gpio select 
+
+note:
+setarg 0x0108
+0x01:pwm channel select
+0x08:gpio select
+*/
+pwm_enable:
+	enable user
+	call pwm_gpio_select
+	branch pwm_set_select
+	
+pwm_disable:
+	disable user
+	call pwm_select_channel
+	branch pwm_set_select
+
+pwm_set_select:
+	and queue, 0x0f,queue
+	fetch 1,core_pwm_en
+   	qsetflag user,pdata
+   	store 1,core_pwm_en
+	rtn
+pwm_select_channel:
+	rshift8 pdata,queue
+	and queue, 0x0f,queue
+	rtn
+
+
+/*************WATCH DOG API*************************/
+/*
+	function name:wdt_init_config 
+   input:kick dog time (pdata*7.8125ms) (7.8125ms~16s) (16s = 0x800)
+*/
+wdt_init_config:
+	copy pdata,temp
+	bpatch patch14_6,mem_patch14
+	call wdt_set_enable	//enable
+	setarg 2048
+	isub temp,pdata
+	copy pdata,temp
+	rshift4 temp,temp
+	storet 1,core_write_wdt
+	nop 1400
+	copy pdata,temp
+	and_into 0x0f,temp
+	storet 1,core_write_wdt2
+	rtn
+ 
+
+wdt_set_enable:
+	enable user2
+	branch wdt_init_set
+
+	
+wdt_set_disable:
+	bpatch patch14_7,mem_patch14
+	disable user2
+wdt_init_set:
+	fetch 1,core_config
+   	setflag user2,3,pdata
+	store 1,core_config
+	rtn
+
+
+wdt_kick_128ms:
+	//about 128ms
+	setarg 125
+	branch wdt_init_config
+
+
+ifdef COMPILE_NEC
+
+/*************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:
+	fetchr regb,1,mem_nec_decode_error_value
+
+//????????,????
+//??: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
+
+endif
+
+/*
+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-12]
+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
+
+*/
+/*
+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 
+*/
+
+
Index: program/security.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/security.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/security.prog	(working copy)
@@ -0,0 +1,1109 @@
+
+
+ifdef SECURE_CONNECTION
+	
+function_g2:
+	bpatch patch15_0,mem_patch15
+	jam 80,mem_AES_CMAC_data_length
+	arg mem_dat,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 mem_dat,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:
+	bpatch patch15_1,mem_patch15
+	jam 65,mem_AES_CMAC_data_length
+	arg mem_dat,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 mem_dat,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:
+	bpatch patch15_2,mem_patch15
+	jam 53,mem_AES_CMAC_data_length
+	setarg 0x100
+	store 2,mem_dat
+	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,mem_dat
+	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,mem_dat
+	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:
+	bpatch patch15_3,mem_patch15
+	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 mem_dat,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 mem_dat,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 mem_dat,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 mem_dat,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:
+	bpatch patch15_4,mem_patch15
+	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:
+	bpatch patch15_5,mem_patch15
+	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
+
+	
+
+	
+concatenate_temp24:
+	lshift8 temp,temp
+concatenate_temp16:
+	lshift16 temp,temp
+	ior temp,temp
+	rtn
+
+endif
+
+/* ==================== LE security ================= */
+
+generate_stk:
+	bpatch patch15_6,mem_patch15
+	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
+
+
+/*
+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
+*/
+
+
+ 	
+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
+	bpatch patch15_7,mem_patch15
+	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:
+	bpatch patch16_0,mem_patch16
+	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
+
+
+wait_keyinit_done:
+	fetch 1,core_aes_decode_key_init
+	bbit0 5,wait_keyinit_done
+	rtn
+
+
+/*
+input:pdata,dec key buffer addr
+output:initial dec key
+瀵嗛挜涓嶆敼锛屽彧鍋氫竴娆
+*/
+dec_key_initial:
+	store 2,core_keybuf_saddr
+	force 0xc0,aes_ctrl
+	force 0x80,aes_ctrl	//dec key initial
+	branch wait_keyinit_done
+
+/*
+input:regb,user enc payload buffer ptr
+	regc,user dec payload buffer ptr
+output:user dec payload buffer ptr
+*/
+do_aes_ecb_dec:
+	force regidx_data,regext_index
+	copy regb,contr
+   	force 4,loopcnt
+	call aes_ecb_dec_loop
+
+	force 0x180,aes_ctrl	//dec load data
+	force 0x80,aes_ctrl
+	call wait_aes
+ecb_dec_generate: 
+	force regidx_result,regext_index
+	copy regc,contw
+   	force 4,loopcnt
+ecb_dec_generate_loop:
+    copy regext,pdata
+	istore 4,contw
+	increase 1,regext_index
+	loop ecb_dec_generate_loop
+	rtn
+
+aes_ecb_dec_loop:
+	ifetch 2,contr
+	ifetcht 2,contr
+	lshift16 temp,temp
+	ior temp,regext
+	increase 1,regext_index
+	loop aes_ecb_dec_loop
+	rtn
+
+
+/*
+input:rega,xor data buffer ptr
+	regb,user enc payload buffer ptr	
+	regc,user dec payload buffer ptr
+output:user dec payload buffer ptr
+*/
+do_aes_cbc_dec:
+	force regidx_xor,regext_index
+	copy rega,contr
+	force 4,loopcnt
+	call aes_ecb_dec_loop
+
+	force regidx_data,regext_index
+	copy regb,contr
+	force 4,loopcnt
+	call aes_ecb_dec_loop
+	force 0x182,aes_ctrl
+	force 0x82,aes_ctrl
+	call wait_aes
+	branch ecb_dec_generate
+
+	
+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:
+	bpatch patch16_1,mem_patch16
+	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
+
+regext_clear:
+	force 0,regext_index
+	force 16,loopcnt
+	branch clear_loop
+
+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
+
+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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/sim.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/sim.prog	(working copy)
@@ -0,0 +1,644 @@
+simstart:
+	force 8,radio_ctrl
+	force 0,radio_ctrl
+    //dpll enable
+	jam 0x3,0x8a00
+	jam 0x7f,0x8a01
+	jam 0xf,0x8a02
+	jam 5,core_clksel
+	jam 0,core_clkoff
+	jam 0,core_clkoff+1
+	force 0,clkn
+	jam SYSTEM_CLK_12M,mem_system_clk
+//	branch sim_c1
+    //jam 8,0x8011 //efuse lock
+    //call sim_wdt
+    //call sim_iic
+    //call sim_uart
+	//call sim_spi
+    //call sim_pwm
+    //call sim_gpio
+    //call sim_nec
+    //call sim_nec
+    //call sim_ac
+    //call sim_ac
+    //call sim_ccm
+    //call sim_adc
+    //call sim_efuse
+    //call sim_efuse_lock
+//	branch sim_lpm
+//	branch sim_lr
+//	branch sim_otp
+//	call sim_snooze
+//    call sim_lpm_sleep
+//	branch sim_otp
+//	branch sim_usb
+//	branch sim_iic
+//	call sim_cal
+//	call sim_uart
+//	call sim_spi
+//	branch sim_le
+//    branch assert
+//	branch sim_main
+
+sim_le:
+	jam lemode_2m,mem_le_mode
+	fetch 3,0x9002
+	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_lpm:
+	fetch 1,0x9ffd
+	beq 1,assert
+	setarg 0
+	store 8,mem_gpio_wakeup_low
+	arg 30,temp
+	branch lpm_sleep
+
+
+sim_lr:
+	jam 3,mem_le_ch_mapped
+	setarg 0xfedcba
+	store 3,mem_le_crcinit
+	call le_enable
+	setarg 0x1234567
+	iforce access
+	set1 mark_ble_lr,mark
+//	set1 mark_ble_lr_s8,mark
+	setarg 0x2e0403
+	store 3,mem_le_txheader
+	setarg 0x123456
+	istore 3,contw
+	call le_transmit
+	branch assert
+
+
+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
+	jam 0,mem_le_conn_peer_addr_type
+	jam 1,mem_le_adv_own_addr_type
+	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
+
+sim_otp:
+	fetch 1,mem_sim_slave
+	beq 1,assert
+	call otp_enable_chgpump
+	setarg 0x1234567
+	store 4,mem_tmp_buffer
+	setarg 0x123
+	arg mem_tmp_buffer,rega
+	arg 4,loopcnt
+	call otp_write
+	setarg 0x123
+	arg mem_tmp_buffer+4,rega
+	arg 4,temp
+	call otpd_read_data
+	fetch 4,mem_tmp_buffer
+	ifetcht 4,contr
+	isub temp,null
+	nbranch assert,zero
+loop:
+	branch loop
+
+
+
+ifdef TEST
+
+sim_wdt:
+    jam 8,0x8043
+    jam 0x7e,0x8004
+    nop 1000
+    jam 0xf,0x800b
+    rtn
+
+sim_nec:
+    jam 0x18,0x8083 //gpio3
+    jam 0x1,0x80cb
+    jam 0x89,0x80cc
+    jam 0x1,0x80cd
+    jam 0x1,0x80cf
+    jam 0x31,0x80d0
+    nop 10000
+    jam 0x0,0x80d0
+    rtn
+
+sim_ac:
+    jam 0x19,0x8082 //gpio18
+    jam 6,0x80d9
+    jam 0x10,0x804b
+    jam 0x3c,0x8049
+    jam 0x31,0x8048
+    nop 10000
+    jam 0x0,0x8048
+    rtn
+
+
+sim_pwm:
+    jam 0x0,0x80a0
+    jam 0x1,0x80a2
+    jam 0x2,0x80a4
+    jam 0x3,0x80a6
+    jam 0x4,0x80a8
+    jam 0x5,0x80aa
+    jam 0x6,0x80ac
+    jam 0x7,0x80ae
+    jam 0x8,0x80b0
+    jam 0x9,0x80b2
+    jam 0xa,0x80b4
+    jam 0xb,0x80b6
+    jam 0xc,0x80b8
+    jam 0xd,0x80ba
+    jam 0xe,0x80bc
+    jam 0xf,0x80be
+    jam 0xaa,0x80d8 //pwm init
+    jam 0x10,0x8074 //pwm0 -> gpio4
+    jam 0x11,0x8075 //pwm1 -> gpio5
+    jam 0x12,0x8076 //pwm2 -> gpio6
+    jam 0x13,0x8077 //pwm3 -> gpio7
+    jam 0x14,0x8078 //pwm4 -> gpio8
+    jam 0x15,0x8079 //pwm5 -> gpio9
+    jam 0x16,0x807a //pwm6 -> gpio10
+    jam 0x17,0x807b //pwm7 -> gpio11
+    jam 0x3,0x8084 //pwm0/1 enable
+    nop 100
+    jam 0x3,0x80dd //pwm0/1 soft rst
+    nop 100
+    jam 0xc,0x8084 //pwm2/3 enable
+    nop 100
+    jam 0xc,0x80dd //pwm2/3 soft rst
+    nop 100
+    jam 0x30,0x8084 //pwm4/5 enable
+    nop 100
+    jam 0x30,0x80dd //pwm4/5 soft rst
+    nop 100
+    jam 0xc0,0x8084 //pwm6/7 enable
+    nop 100
+    jam 0xc0,0x80dd //pwm6/7 soft rst
+    nop 100
+    jam 0,0x8084
+    rtn
+
+sim_ccm:
+    //call sim_aes_key_config_case1
+    //call sim_aes_dec_dma_case1
+    //call sim_aes_enc_dma_case1
+    call sim_aes_key_config_case4
+    call sim_aes_dec_dma_case4
+    call sim_aes_enc_dma_case4
+    rtn
+
+sim_aes_key_config_case1:
+    //key
+    force 4,regext_index
+    arg 0x6789,pdata
+    lshift16 pdata,pdata
+    arg 0x6789,temp
+    ior temp,regext
+    force 5,regext_index
+    arg 0x6789,pdata
+    lshift16 pdata,pdata
+    arg 0x6789,temp
+    ior temp,regext
+    force 6,regext_index
+    arg 0x2345,pdata
+    lshift16 pdata,pdata
+    arg 0x2345,temp
+    ior temp,regext
+    force 7,regext_index
+    arg 0x2345,pdata
+    lshift16 pdata,pdata
+    arg 0x2345,temp
+    ior temp,regext
+    //nonce
+    force 8,regext_index
+    arg 0xbc61,pdata
+    lshift16 pdata,pdata
+    arg 0x4e49,temp
+    ior temp,regext
+    force 9,regext_index
+    arg 0xccdd,pdata
+    lshift16 pdata,pdata
+    arg 0x0000,temp
+    ior temp,regext
+    force 0xa,regext_index
+    arg 0x8899,pdata
+    lshift16 pdata,pdata
+    arg 0xaabb,temp
+    ior temp,regext
+    force 0xb,regext_index
+    arg 0x0000,pdata
+    lshift16 pdata,pdata
+    arg 0x6677,temp
+    ior temp,regext
+    //aad
+    jam 0x00,0x80d5
+    jam 0x19,0x80d6
+    jam 0x02,0x80d7
+    rtn
+
+sim_aes_dec_dma_case1:
+    //mic golden
+    force 0,regext_index
+    arg 0xc5dd,pdata
+    lshift16 pdata,pdata
+    arg 0xa210,temp
+    ior temp,regext
+    
+    //payload
+
+    //dma config
+    jam 0x00,0x80d1
+    jam 0x10,0x80d2
+    jam 0x00,0x80d3
+    jam 0x10,0x80d4
+    jam 0x6,0x800a 
+    jam 0x7,0x800a 
+    nop 1000
+    rtn
+
+sim_aes_enc_dma_case1:
+    //payload
+
+    //dma config
+    jam 0x00,0x80d1
+    jam 0x10,0x80d2
+    jam 0x00,0x80d3
+    jam 0x11,0x80d4
+    jam 0x2,0x800a 
+    jam 0x3,0x800a 
+    nop 1000
+    rtn
+
+sim_aes_key_config_case4:
+    //key
+    force 4,regext_index
+    arg 0x1bd1,pdata
+    lshift16 pdata,pdata
+    arg 0x2ace,temp
+    ior temp,regext
+    force 5,regext_index
+    arg 0xbd56,pdata
+    lshift16 pdata,pdata
+    arg 0x14a1,temp
+    ior temp,regext
+    force 6,regext_index
+    arg 0x1f8b,pdata
+    lshift16 pdata,pdata
+    arg 0x9dbd,temp
+    ior temp,regext
+    force 7,regext_index
+    arg 0xfc22,pdata
+    lshift16 pdata,pdata
+    arg 0x8384,temp
+    ior temp,regext
+    //nonce
+    force 8,regext_index
+    arg 0xb3be,pdata
+    lshift16 pdata,pdata
+    arg 0x9549,temp
+    ior temp,regext
+    force 9,regext_index
+    arg 0x2769,pdata
+    lshift16 pdata,pdata
+    arg 0x00bd,temp
+    ior temp,regext
+    force 0xa,regext_index
+    arg 0xb727,pdata
+    lshift16 pdata,pdata
+    arg 0x5bf9,temp
+    ior temp,regext
+    force 0xb,regext_index
+    arg 0x1100,pdata
+    lshift16 pdata,pdata
+    arg 0x82b8,temp
+    ior temp,regext
+    //aad
+    jam 0x00,0x80d5
+    jam 0x19,0x80d6
+    jam 0x02,0x80d7
+    rtn
+
+sim_aes_dec_dma_case4:
+    //mic golden
+    force 0,regext_index
+    arg 0x7c32,pdata
+    lshift16 pdata,pdata
+    arg 0x2cc6,temp
+    ior temp,regext
+    
+    //payload
+    arg 0x1001,contw
+    arg 0xb839, pdata
+    istore 2,contw
+    arg 0xc85f, pdata
+    istore 2,contw
+    arg 0x3756, pdata
+    istore 2,contw
+    arg 0x9249, pdata
+    istore 2,contw
+    arg 0xf07f, pdata
+    istore 2,contw
+    arg 0xd647, pdata
+    istore 2,contw
+    arg 0x2b40, pdata
+    istore 2,contw
+    arg 0x7ccc, pdata
+    istore 2,contw
+    arg 0xfff9, pdata
+    istore 2,contw
+    arg 0xffff, pdata
+    istore 2,contw
+    jam 0x11,0x80da //ccm_inptr
+
+    //dma config
+    jam 0x01,0x80d1
+    jam 0x10,0x80d2
+    jam 0x02,0x80d3
+    jam 0x40,0x80d4
+    jam 0x6,0x800a 
+    jam 0x7,0x800a 
+    call wait_ccm_done
+    fetch 1,0x4012
+    bne 0x05,assert
+    rtn
+
+sim_aes_enc_dma_case4:
+    //payload
+    arg 0x4002,contw
+    arg 0x1286, pdata
+    istore 2,contw
+    arg 0xa56d, pdata
+    istore 2,contw
+    arg 0xb3db, pdata
+    istore 2,contw
+    arg 0x6491, pdata
+    istore 2,contw
+    arg 0xa19b, pdata
+    istore 2,contw
+    arg 0xc4ca, pdata
+    istore 2,contw
+    arg 0x9160, pdata
+    istore 2,contw
+    arg 0x3372, pdata
+    istore 2,contw
+    arg 0xff05, pdata
+    istore 2,contw
+    arg 0xffff, pdata
+    istore 2,contw
+    jam 0x11,0x80da //ccm_inptr
+
+    //dma config
+    jam 0x02,0x80d1
+    jam 0x40,0x80d2
+    jam 0x01,0x80d3
+    jam 0x11,0x80d4
+    jam 0x2,0x800a 
+    jam 0x3,0x800a 
+    call wait_ccm_done
+    fetch 1,0x1111
+    bne 0xf9,assert
+    rtn
+
+//wait_ccm_done:
+//    fetch 1,0x8108
+//    bbit0 6,wait_ccm_done
+//    rtn
+
+sim_lpm_sleep:
+	jam 1,mem_context
+	branch sim_lpm_cont,wake
+	jam 0x80,core_aes_en
+	jam ccnt_start,core_misc_ctrl
+sim_lpm_wait:
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	branch sim_lpm_wait,blank
+	lshift4 pdata,pdata
+	store 3,mem_clks_per_lpo
+sim_lpm_cont:
+	setarg param_rt_rthalfslot
+	store 2,mem_param_rt_rthalfslot
+	call lpm_recover_clk,wake
+	setarg 10000
+	call sleep,wake
+	arg 10000,temp
+	storet 4,mem_sleep_counter
+	branch lpm_sleep
+
+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
+	jam gpcfg_uart_txd,core_gpio_conf + 16
+	jam 0x81,core_uart_ctrl
+	setarg 0x30
+	store 2,core_uart_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:
+	nop 247
+	fetch 1,mem_h5tx_buf
+	bne 0x67,assert
+	branch sim_uart_slave
+	fetch 1,core_uart_status
+	bbit1 uart_status_rx_fifo_empty,sim_uart_slave
+	fetch 1,core_uart_rxitems
+	bne 9,sim_uart_slave
+	fetcht 8,mem_h5tx_buf
+	call uarta_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
+	
+
+sim_iic:
+	call iic_init_600khz
+    call iicd_init_pin
+iic_write:
+	setarg 6
+	store 2,core_iicd_txlen
+	setarg 0x10a0
+	store 2,0x1000
+    setarg 0x5a00
+	store 2,0x1002
+    setarg 0xa5a5
+	store 2,0x1004
+	setarg 0x1000
+	store 2,core_iicd_txaddr
+	setarg 0
+	store 2,core_iicd_rxlen
+	jam 3,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	call wait_iicd_done
+	nop 300
+iic_dummy_write:
+	setarg 3
+	store 2,core_iicd_txlen
+	setarg 0x10a0
+	store 2,0x1000
+    setarg 0x00
+	store 1,0x1002
+	setarg 0x1000
+	store 2,core_iicd_txaddr
+	setarg 0
+	store 2,core_iicd_rxlen
+	jam 3,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	call wait_iicd_done
+	nop 300
+iic_read:
+    setarg 1
+	store 2,core_iicd_txlen
+    setarg 0xa1
+	store 1,0x1000
+	setarg 0x1000
+	store 2,core_iicd_txaddr
+    setarg 0x1100
+	store 2,core_iicd_rxaddr
+	setarg 3
+	store 2,core_iicd_rxlen
+	jam 1,core_iicd_ctrl
+	jam iicd_start,core_misc_ctrl
+	call wait_iicd_done
+    fetch 1, 0x1100
+    bne 0x5a, assert
+    rtn
+
+sim_spi:
+    //jam gpcfg_spid_miso ,core_gpio_conf + 12 
+    //jam gpcfg_spid_ncs ,core_gpio_conf + 13 
+    //jam gpcfg_spid_sck ,core_gpio_conf + 14 
+    //jam gpcfg_spid_mosi ,core_gpio_conf + 15
+    call spi_gpio_init
+
+    setarg 3 
+    store 2 ,core_spid_rxlen 
+    setarg 4 
+    store 2 ,core_spid_txlen 
+    setarg 0x1200 
+    store 2 ,core_spid_txaddr 
+    setarg 0x1300 
+    store 2 ,core_spid_rxaddr
+    setarg 0x0003
+	store 2,0x1200
+    setarg 0x0000
+	store 2,0x1202
+    jam spid_start ,core_misc_ctrl 
+    call wait_spid_done
+    fetch 1, 0x1302
+    bne 0xaa, assert
+    rtn
+
+
+sim_adc:
+    jam 0xc,0x8a0a
+    jam 0x2,0x8a17
+    jam 0x1,0x8a97
+    jam 0x0,0x80dc
+    jam 0x80,0x8053
+    nop 10000
+    jam 0x5,0x80dc
+    jam 0x80,0x8053
+    nop 10000
+    jam 0xa,0x80dc
+    jam 0x80,0x8053
+    nop 10000
+    jam 0xf,0x80dc
+    jam 0x80,0x8053
+    nop 10000
+    jam 0x0,0x8053
+    rtn
+
+ endif
Index: program/simple_pairing.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/simple_pairing.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/simple_pairing.prog	(working copy)
@@ -0,0 +1,1068 @@
+
+
+ifdef SECURE_CONNECTION
+
+
+publickey_init:
+//	fetch 1,mem_ssp_enable
+//	nbranch sp_initialize,blank
+	branch sp_initialize_256
+
+sp_calc_sequence_256_check:
+	bpatch patch16_2,mem_patch16
+//	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_clear_flags:
+	bpatch patch16_3,mem_patch16
+	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_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	
+
+
+
+
+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:
+	branch disable_true
+
+compare4_success:
+	branch enable_true
+
+
+
+
+bn_testbit:
+	and pdata,7,queue
+	rshift3 pdata,pdata
+	iadd contr,contr
+	ifetch 1,contr
+	qisolate0 pdata
+	rtn
+
+
+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_load:
+	force 6,loopcnt
+bn_load_0:	
+	ifetch 4,contr
+	iforce regext
+	increase 1,regext_index
+	loop bn_load_0
+	rtn
+
+
+
+sp_initialize_256:	
+	bpatch patch16_4,mem_patch16
+	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:    
+	bpatch patch16_5,mem_patch16
+	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:
+	bpatch patch16_6,mem_patch16
+	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:
+	bpatch patch16_7,mem_patch16
+	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		
+
+endif
+
Index: program/ui.prog
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ui.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/ui.prog	(working copy)
@@ -0,0 +1,650 @@
+ui_init:
+	rtn wake
+	call lpm_disable_exen_output
+	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:
+	bpatch patch17_0,mem_patch17
+	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:
+	bpatch patch17_1,mem_patch17
+	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 ui_led_init_set
+	increase LED_OFFSET_LENGTH,regb
+	loop ui_led_init_loop
+	rtn
+
+//mem_ui_led_init_state_set =0,set init off else set init on
+ui_led_init_set:
+	fetch 1,mem_ui_led_init_state_set
+	branch gpio_out_inactive,blank
+	branch gpio_out_active
+	
+//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:
+	bpatch patch17_2,mem_patch17
+	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:
+	bpatch patch17_3,mem_patch17
+	call ui_ipc_get_lock
+	copy rega,pdata
+	store 4,mem_rega
+	arg mem_ipc_fifo_bt2c51,rega
+	call fifo_in
+	fetch 4,mem_rega
+	copy pdata,rega
+	branch ui_ipc_put_lock
+
+ui_ipc_send_cmd:
+	bpatch patch17_4,mem_patch17
+	call ui_ipc_get_lock
+	copy rega,pdata
+	store 4,mem_rega	
+	arg mem_ipc_fifo_c512bt,rega
+	call fifo_in
+	fetch 4,mem_rega
+	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:
+	bpatch patch17_5,mem_patch17
+	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
+	bpatch patch17_6,mem_patch17
+	copy temp,pdata
+	rtn blank
+	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
+	//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
+	bpatch patch17_7,mem_patch17
+	fetch 1,mem_fifo_temp
+	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_STORE_RECONN_INFO_LE,eeprom_store_le_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 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:
+
+//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 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 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
+
+
+
+
+ui_check_paring_button:
+	fetch 1,mem_ui_state_map
+	rtnbit0 UI_STATE_BTN_DOWN
+	rtn
+
+
+
+///////////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:
+	bpatch patch18_0,mem_patch18
+	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:
+	bpatch patch18_1,mem_patch18
+	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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/usb.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/usb.prog	(working copy)
@@ -0,0 +1,1161 @@
+ ifdef COMPILE_USB
+
+usb_isr:
+	bpatch patch18_2,mem_patch18
+	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:
+	bpatch patch18_3,mem_patch18
+	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	
+	call usb_confdesc_config
+usb_config_cb:
+	fetch 2,mem_cb_usb_config
+	branch callback_func
+
+usb_confdesc_config:
+	fetch 1,mem_usb_ep3_enable
+	nrtn blank
+usb_confdesc_config_without_ep3:
+	arg 60,loopcnt
+	arg mem_confdesc,contw
+	arg USB_CONFDATA_ADDR,contr	
+	branch memcpy
+
+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 USB_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 USB_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_rx:
+	bpatch patch18_4,mem_patch18
+	fetch 1,mem_usb_status
+	rtnbit0 USB_STATUS_RXREADY
+	arg mem_usb_rxbuf_temp,contw
+	call usb_rx_data
+	fetchr loopcnt,2,mem_usb_read_len
+	storer loopcnt,1,mem_usb_ep3_out_data_len
+	arg mem_usb_rxbuf_temp,contr
+	copy temp,pdata
+	beq 0,usb0_rx
+	beq 3,usb_data_rx_ep3
+usb_data_rx:
+	rtn
+
+usb_data_rx_ep3:
+	arg mem_usb_ep3_out_data,contw
+	call memcpy
+	jam 1,mem_usb_ep3_out_data_flag
+	rtn
+
+
+usb0_rx:
+	arg mem_usb_setup,contw
+	call memcpy
+	fetch 1,mem_usb_read_len
+	beq 0x00,usb_rx_no_data
+	beq 0x01,usb_out_one_byte	// HUAWEI pad led status	
+	sub pdata,7,null
+	rtn positive
+usb_class_type:
+	bpatch patch18_5,mem_patch18
+	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_out_one_byte:
+	fetch 1,mem_usb_setup
+	rtnbit1 7	// OUT_DEVICE
+	call usb_get_led_status
+	branch usb0_reply_zerolen
+
+
+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:
+	bpatch patch18_6,mem_patch18
+	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:
+	bpatch patch18_7,mem_patch18
+	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:
+	bpatch patch19_0,mem_patch19
+	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:
+	bpatch patch19_1,mem_patch19
+	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:
+	bpatch patch19_2,mem_patch19
+	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:
+	bpatch patch19_3,mem_patch19
+//	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
+	beq 2,dsc_hid_info_interface2
+	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_hid_info_interface2:
+	fetchr regb,1,mem_confdesc+69
+	arg mem_confdesc+69,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 0,dsc_hid_report_info0
+	beq 1,dsc_hid_report_info1
+	beq 2,dsc_hid_report_info2
+	branch usb0_force_stall
+
+dsc_hid_report_info0:
+	fetchr rega,2,mem_hidreportdesc_kb
+	branch usb0_respond_length
+
+dsc_hid_report_info1:
+	fetch 1,mem_usb_ep3_enable
+	call dsc_hid_enumerate_success,blank
+	fetchr rega,2,mem_hidreportdesc_m
+	branch usb0_respond_length
+
+dsc_hid_report_info2:
+	fetch 1,mem_usb_ep3_enable
+	ncall dsc_hid_enumerate_success,blank
+	fetchr rega,2,mem_hidreportdesc_ep3
+	branch usb0_respond_length
+
+dsc_hid_enumerate_success:	
+	jam 1,mem_usb_device_enumeration_endflag
+	jam USB_GOT_REPORT_REQ,mem_usb_state
+	rtn
+
+
+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_usb_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_usb_sdsystem_wakeup_flag
+	branch usb0_reply_zerolen,blank
+	jam 0,mem_usb_sdsystem_wakeup_flag
+	fetch 1,mem_usb_sdsystem_wakeup_flag_judge
+	branch usb0_reply_zerolen,blank
+	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
+	call dongle_set_pc_sleep_flag
+	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 USB_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:
+	bpatch patch19_4,mem_patch19
+	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:
+	nop 15000		//delay 1ms
+	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
+usb_get_led_status:	
+	store 1,mem_24g_led_status
+	jam 0,mem_usb_tx_win_enable
+	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:
+	bpatch patch19_5,mem_patch19
+	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:
+	bpatch patch19_6,mem_patch19
+	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:
+	bpatch patch19_7,mem_patch19
+	fetch 1,mem_usb_tx_enable
+	rtn blank
+	fetch 1,core_usb_txbusy
+	and_into 0x0f,pdata
+	nbranch usb_inwake_state_tx_dispose,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
+	call usb_tx_data_ep2
+	branch usb_tx_data_ep3
+
+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_data_ep3:
+	fetch 1,mem_usb_ep3_enable
+	rtn blank
+	fetch 1,core_usb_txbusy
+	rtnbit1 3
+	fetch 1,mem_usb_tx_enable
+	rtnbit0 3
+	fetch 1,mem_usb_tx_enable
+	set0 3,pdata
+	store 1,mem_usb_tx_enable
+	fetchr loopcnt,1,mem_usb_ep3_in_data_len
+	arg 32,loopcnt
+	arg mem_usb_ep3_in_data,contr
+usb_tx_ep3:
+	arg 3,queue
+	arg mem_usb_txbuf3,rega
+	storer rega,2,core_usb_tx_saddr3
+	branch usb_tx_buf
+
+usb_tx_enable_ep3:
+	fetch 1,mem_usb_tx_enable
+	set1 3,pdata
+	store 1,mem_usb_tx_enable
+	rtn
+
+usb_tx_fifo_release:
+	//clear mem_usb_mouse_data/mem_usb_kb_data/mem_usb_kb_multikey/mem_usb_kb_system/mem_usb_ep3_in_data
+	arg mem_usb_mouse_data,contw
+	arg 8,loopcnt
+	call memset0
+	arg mem_usb_ep3_in_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 USB_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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/utility.prog	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/program/utility.prog	(working copy)
@@ -0,0 +1,584 @@
+
+
+	
+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:
+	bpatch patch1a_0,mem_patch1a
+	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	
+	
+
+
+memcpy96:
+	call memcpy32
+memcpy64:
+	call memcpy32
+	branch memcpy32
+	
+
+memcpy12:
+	call memcpy8
+memcpy4:
+	ifetch 1,contr
+	istore 1,contw
+memcpy3:
+	ifetch 3,contr
+	istore 3,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:
+	bpatch patch1a_1,mem_patch1a
+	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
+
+
+
+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
+	store 2,mem_pdatatemp
+	bpatch patch1a_2,mem_patch1a
+	call timer_check
+	fetcht 2,mem_pdatatemp
+	arg mem_timers,contw
+//	iforce temp
+	lshift queue,pdata
+	iadd contw,contw
+	istoret 2,contw
+	rtn
+
+timer_check_timeout:
+	arg 0x800,timeup
+	lshift16 timeup,timeup
+	iadd timeup,pdata
+	rtn
+
+
+timer_reinit:
+	arg 0,queue
+timer_check:
+	bpatch patch1a_3,mem_patch1a
+	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
+
+
+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
+	
+
+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
+
+
+ice_break_disable_wdt:
+	call wdt_set_disable
+
+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
+	
+
+	//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:
+	bpatch patch1a_4,mem_patch1a
+	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:
+	bpatch patch1a_5,mem_patch1a
+	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_true:
+	disable  true
+	rtn
+
+enable_true:
+	enable  true
+	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
+
+
+/*	
+savelist:		
+	store 8,mem_pdatatemp
+savelist_1:
+	fetch 1,mem_seqi
+	rtneq 0x7f
+	lshift3 pdata,pdata
+	arg mem_savelist,contw
+	iadd contw,contw
+	fetch 8,mem_pdatatemp
+	istore 8,contw
+	fetch 1,mem_seqi
+	increase 1,pdata
+	and_into 0x7f,pdata
+	store 1,mem_seqi
+	fetch 8,mem_pdatatemp
+	rtn	
+
+le_savelist:
+	fetch 5,mem_sync_clke
+	store 5,mem_pdatatemp
+	fetch 1,mem_le_ch_mapped
+	istore 1,contw
+	fetch 2,mem_le_event_count
+	arg 0x0fff,contr
+	iand contr,pdata
+	setflag match,15,pdata
+	setflag wake,14,pdata
+	setflag sync,13,pdata
+	setflag attempt,12,pdata
+	istore 2,contw
+	branch savelist_1
+*/
+
+clear_wake:
+	setarg 0
+	store 8,mem_gpio_wakeup_low
+	rtn
+
+
+generate_random:
+	arg 16,loopcnt
+generate_random_loop:
+	random pdata
+	istore 1,contw
+	loop generate_random_loop
+	rtn
+
Index: sched/1306.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/1306.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/1306.dat	(working copy)
@@ -0,0 +1,33 @@
+
+mem_lpm_config:88 0b ce	#4khz
+mem_lpm_xtalcnt:35 3f 0c 33 03
+mem_lpm_hibernate_switch:00
+mem_lpm_ctrl3_aon_vsel:9d 10 22
+mem_dig_aon_vsel:01	#bit5-4;00:1.2V;01:1.08V;02:0.96V;03:0.84V
+mem_rc_cal:d3
+mem_rf_ldo_cfg1:20
+
+mem_gain_fix:ff	#00:soft agc; ff:hw agc
+mem_gain_table:04 00 00
+mem_gain_second_agc_en:08	#hw agc: 0:second agc disable
+
+mem_adc_delay:a0 0f
+
+mem_rf_init_data:
+ff
+mem_rf_init_ptr:mem_rf_init_data
+
+mem_lpm_mode:01
+
+mem_load_check_sum:5a
+mem_mouse_no_data_timeout:70 17   #10mins
+mem_mouse_enable_flag:20	#20:win+d	60:ctrl+alt+a	a0:ac home	d0:key_play
+
+#mem_flash_base:00 50 00
+#mem_eeprom_base:80 1f
+
+#bit7:0 means disable rf debug function
+#mem_rf_debug_rx_gpio:06
+#mem_rf_debug_tx_gpio:07
+
+
Index: sched/authrom/ble_shutter_dy_gatt_list.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/ble_shutter_dy_gatt_list.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/ble_shutter_dy_gatt_list.dat	(working copy)
@@ -0,0 +1,373 @@
+01
+00
+02
+00
+28
+02
+01
+18
+02
+00
+02
+03
+28
+01
+20
+03
+00
+02
+05
+2a
+01
+00
+04
+00
+02
+02
+29
+02
+00
+00
+05
+00
+02
+00
+28
+02
+00
+18
+06
+00
+02
+03
+28
+01
+02
+07
+00
+02
+00
+2a
+13
+43
+68
+69
+70
+73
+65
+61
+2d
+42
+4c
+45
+20
+20
+20
+20
+20
+20
+20
+20
+08
+00
+02
+03
+28
+01
+02
+09
+00
+02
+01
+2a
+02
+c1
+03
+0a
+00
+02
+03
+28
+01
+02
+0b
+00
+02
+04
+2a
+08
+06
+00
+06
+00
+64
+00
+2c
+01
+0c
+00
+02
+00
+28
+02
+0a
+18
+0d
+00
+02
+03
+28
+01
+02
+0e
+00
+02
+50
+2a
+07
+01
+05
+0e
+00
+0a
+02
+40
+0f
+00
+02
+00
+28
+02
+12
+18
+10
+00
+02
+03
+28
+01
+06
+11
+00
+02
+4e
+2a
+01
+01
+12
+00
+02
+03
+28
+01
+10
+13
+00
+02
+4d
+2a
+07
+00
+00
+00
+00
+00
+00
+00
+14
+00
+02
+02
+29
+02
+00
+00
+15
+00
+02
+08
+29
+02
+01
+01
+16
+00
+02
+03
+28
+01
+10
+17
+00
+02
+4d
+2a
+03
+00
+00
+00
+18
+00
+02
+02
+29
+02
+00
+00
+19
+00
+02
+08
+29
+02
+04
+01
+1a
+00
+02
+03
+28
+01
+10
+1b
+00
+02
+4d
+2a
+02
+00
+00
+1c
+00
+02
+02
+29
+02
+00
+00
+1d
+00
+02
+08
+29
+02
+03
+01
+1e
+00
+02
+03
+28
+01
+10
+1f
+00
+02
+4d
+2a
+03
+00
+00
+00
+20
+00
+02
+02
+29
+02
+00
+00
+21
+00
+02
+08
+29
+02
+05
+01
+22
+00
+02
+03
+28
+01
+12
+23
+00
+02
+4d
+2a
+02
+00
+00
+24
+00
+02
+02
+29
+02
+00
+00
+25
+00
+02
+08
+29
+02
+02
+01
+26
+00
+02
+03
+28
+01
+02
+27
+00
+02
+4b
+2a
+01
+00
+28
+00
+02
+03
+28
+01
+02
+29
+00
+02
+4a
+2a
+04
+11
+01
+00
+01
+2a
+00
+02
+03
+28
+01
+04
+2b
+00
+02
+4c
+2a
+01
+00
+2c
+00
+02
+00
+28
+02
+0f
+18
+00
+00
\ No newline at end of file
Index: sched/authrom/ble_shutter_dy_mousekey_value_list.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/ble_shutter_dy_mousekey_value_list.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/ble_shutter_dy_mousekey_value_list.dat	(working copy)
@@ -0,0 +1,640 @@
+03
+1f
+00
+ec
+0f
+00
+00
+00
+00
+00
+03
+1f
+00
+14
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+00
+c0
+fe
+00
+00
+00
+00
+03
+1f
+00
+00
+40
+01
+00
+00
+00
+00
+03
+1f
+00
+00
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+00
+00
+00
+00
+00
+00
+00
+02
+1b
+00
+e9
+00
+00
+00
+00
+00
+00
+02
+1b
+00
+ea
+00
+00
+00
+00
+00
+00
+02
+1b
+00
+00
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+28
+80
+11
+00
+00
+00
+00
+03
+1f
+00
+ae
+8f
+11
+00
+00
+00
+00
+03
+1f
+00
+00
+e0
+fc
+00
+00
+00
+00
+03
+1f
+00
+00
+00
+05
+00
+00
+00
+00
+03
+17
+00
+01
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+3c
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+ff
+17
+80
+00
+00
+00
+00
+03
+1f
+00
+d8
+0f
+00
+00
+00
+00
+00
+03
+17
+00
+00
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+01
+f8
+7f
+00
+00
+00
+00
+03
+1f
+00
+00
+40
+fc
+00
+00
+00
+00
+03
+1f
+00
+01
+18
+80
+00
+00
+00
+00
+03
+1f
+00
+3c
+40
+0b
+00
+00
+00
+00
+03
+1f
+00
+00
+c0
+03
+00
+00
+00
+00
+03
+1f
+00
+3c
+40
+ec
+00
+00
+00
+00
+03
+1f
+00
+3c
+80
+0c
+00
+00
+00
+00
+03
+1f
+00
+00
+10
+80
+00
+00
+00
+00
+03
+1f
+00
+3c
+80
+07
+00
+00
+00
+00
+03
+1f
+00
+96
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+6a
+0f
+00
+00
+00
+00
+00
+03
+1f
+00
+02
+d0
+ff
+00
+00
+00
+00
+03
+1f
+00
+02
+30
+00
+00
+00
+00
+00
+03
+1f
+00
+64
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+00
+b0
+f9
+00
+00
+00
+00
+07
+13
+00
+07
+06
+70
+07
+ac
+0d
+01
+07
+13
+00
+07
+06
+70
+07
+80
+0c
+01
+07
+13
+00
+07
+06
+70
+07
+54
+0b
+01
+07
+13
+00
+07
+06
+70
+07
+28
+0a
+01
+07
+13
+00
+07
+06
+70
+07
+fc
+08
+01
+07
+13
+00
+00
+06
+70
+07
+78
+05
+00
+07
+13
+00
+07
+07
+70
+07
+70
+07
+01
+07
+13
+00
+00
+07
+70
+07
+70
+07
+00
+07
+13
+00
+07
+05
+10
+0c
+70
+04
+01
+07
+13
+00
+07
+05
+48
+0b
+70
+04
+01
+07
+13
+00
+07
+05
+F0
+0A
+70
+04
+01
+07
+13
+00
+07
+05
+C4
+09
+70
+04
+01
+07
+13
+00
+07
+05
+6C
+07
+70
+04
+01
+07
+13
+00
+07
+05
+40
+04
+70
+04
+01
+07
+13
+00
+07
+05
+E8
+02
+70
+04
+01
+07
+13
+00
+00
+05
+00
+02
+70
+04
+00
+07
+13
+00
+00
+06
+70
+07
+ac
+0e
+00
+07
+13
+00
+00
+05
+10
+0d
+70
+04
+00
+03
+17
+00
+00
+fa
+00
+00
+00
+00
+00
+03
+17
+00
+00
+28
+00
+00
+00
+00
+00
+03
+17
+00
+00
+d2
+00
+00
+00
+00
+00
+03
+17
+00
+00
+32
+00
+00
+00
+00
+00
+03
+17
+00
+00
+00
+fa
+00
+00
+00
+00
+03
+17
+00
+00
+00
+05
+00
+00
+00
+00
+03
+17
+00
+00
+00
+f0
+00
+00
+00
+00
+03
+17
+00
+00
+00
+0f
+00
+00
+00
+00
+02
+23
+00
+30
+00
+00
+00
+00
+00
+00
+02
+23
+00
+00
+00
+00
+00
+00
+00
+00
+03
+1f
+00
+a0
+30
+e8
+00
+00
+00
+00
+03
+1f
+00
+3c
+40
+07
+00
+00
+00
+00
+03
+1f
+00
+41
+40
+0b
+00
+00
+00
+00
\ No newline at end of file
Index: sched/authrom/frmt_xbox.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/frmt_xbox.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/frmt_xbox.dat	(working copy)
@@ -0,0 +1,64 @@
+b7
+fd
+93
+26
+36
+3f
+f7
+cc
+34
+a5
+e5
+f1
+71
+d8
+31
+15
+04
+c7
+23
+c3
+18
+96
+05
+9a
+07
+12
+80
+e2
+eb
+27
+b2
+75
+8c
+a1
+89
+0d
+bf
+e6
+42
+68
+41
+99
+2d
+0f
+b0
+54
+bb
+16
+9b
+c2
+51
+2f
+53
+1a
+6a
+83
+b5
+02
+6e
+10
+16
+ab
+a3
+42
\ No newline at end of file
Index: sched/authrom/mouse_ble_att_list.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/mouse_ble_att_list.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/mouse_ble_att_list.dat	(working copy)
@@ -0,0 +1,626 @@
+01
+00
+02
+00
+28
+02
+00
+18
+02
+00
+02
+03
+28
+01
+0a
+03
+00
+02
+00
+2a
+14
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+04
+00
+02
+03
+28
+01
+02
+05
+00
+02
+01
+2a
+02
+c2
+03
+06
+00
+02
+03
+28
+01
+02
+07
+00
+02
+04
+2a
+08
+06
+00
+06
+00
+64
+00
+2c
+01
+08
+00
+02
+00
+28
+02
+01
+18
+09
+00
+02
+03
+28
+01
+20
+0a
+00
+02
+05
+2a
+00
+0b
+00
+02
+02
+29
+02
+00
+00
+0c
+00
+02
+00
+28
+02
+0a
+18
+0d
+00
+02
+03
+28
+01
+02
+0e
+00
+02
+29
+2a
+06
+59
+69
+43
+68
+69
+70
+0f
+00
+02
+03
+28
+01
+02
+10
+00
+02
+50
+2a
+07
+02
+35
+12
+22
+aa
+01
+00
+11
+00
+02
+00
+28
+02
+12
+18
+12
+00
+02
+03
+28
+01
+06
+13
+00
+02
+4e
+2a
+01
+01
+14
+00
+02
+03
+28
+01
+12
+15
+00
+02
+4d
+2a
+08
+00
+00
+00
+00
+00
+00
+00
+00
+16
+00
+02
+02
+29
+02
+00
+00
+17
+00
+02
+08
+29
+02
+02
+01
+18
+00
+02
+03
+28
+01
+1a
+19
+00
+02
+4d
+2a
+07
+00
+00
+00
+00
+00
+00
+00
+1a
+00
+02
+02
+29
+02
+00
+00
+1b
+00
+02
+08
+29
+02
+01
+01
+1c
+00
+02
+03
+28
+01
+12
+1d
+00
+02
+4d
+2a
+02
+00
+00
+1e
+00
+02
+02
+29
+02
+00
+00
+1f
+00
+02
+08
+29
+02
+03
+01
+20
+00
+02
+03
+28
+01
+12
+21
+00
+02
+4d
+2a
+02
+00
+00
+22
+00
+02
+02
+29
+02
+00
+00
+23
+00
+02
+08
+29
+02
+04
+01
+24
+00
+02
+03
+28
+01
+0e
+25
+00
+02
+4d
+2a
+02
+00
+00
+26
+00
+02
+08
+29
+02
+02
+02
+27
+00
+02
+03
+28
+01
+02
+28
+00
+02
+4b
+2a
+bd
+05
+01
+09
+02
+a1
+01
+85
+01
+09
+01
+a1
+00
+05
+09
+19
+01
+29
+08
+15
+00
+25
+01
+75
+01
+95
+08
+81
+02
+05
+01
+09
+30
+09
+31
+16
+01
+f8
+26
+ff
+07
+75
+10
+95
+02
+81
+06
+09
+38
+15
+81
+25
+7f
+75
+08
+95
+01
+81
+06
+05
+0c
+0a
+38
+02
+95
+01
+81
+06
+c0
+c0
+05
+01
+09
+06
+a1
+01
+85
+02
+75
+01
+95
+08
+05
+07
+19
+e0
+29
+e7
+15
+00
+25
+01
+81
+02
+95
+01
+75
+08
+81
+03
+95
+05
+75
+01
+05
+08
+19
+01
+29
+05
+91
+02
+95
+01
+75
+03
+91
+03
+95
+06
+75
+08
+15
+00
+26
+ff
+00
+05
+07
+19
+00
+29
+ff
+81
+00
+c0
+05
+0c
+09
+01
+a1
+01
+85
+03
+19
+00
+2a
+ff
+03
+15
+00
+26
+ff
+03
+95
+01
+75
+10
+81
+00
+c0
+05
+01
+09
+80
+A1
+01
+85
+04
+15
+00
+25
+01
+75
+01
+95
+03
+19
+81
+29
+83
+81
+02
+95
+01
+75
+05
+81
+03
+C0
+29
+00
+02
+03
+28
+01
+1a
+2a
+00
+02
+33
+2a
+08
+00
+00
+00
+00
+00
+00
+00
+00
+2b
+00
+02
+02
+29
+02
+01
+00
+2c
+00
+02
+03
+28
+01
+02
+2d
+00
+02
+4a
+2a
+04
+01
+01
+00
+03
+2e
+00
+02
+00
+28
+02
+0f
+18
+2f
+00
+02
+03
+28
+01
+12
+30
+00
+02
+19
+2a
+01
+64
+31
+00
+02
+02
+29
+02
+00
+00
+32
+00
+02
+03
+28
+01
+04
+33
+00
+02
+4c
+2a
+00
+00
+00
Index: sched/authrom/usb_confdata.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_confdata.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_confdata.dat	(working copy)
@@ -0,0 +1,60 @@
+3b
+09
+02
+3b
+00
+02
+01
+00
+a0
+32
+09
+04
+00
+00
+01
+03
+01
+01
+00
+09
+21
+00
+02
+00
+01
+22
+1a
+00
+07
+05
+81
+03
+40
+00
+02
+09
+04
+01
+00
+01
+03
+01
+02
+00
+09
+21
+00
+02
+00
+01
+22
+a3
+00
+07
+05
+82
+03
+40
+00
+02
\ No newline at end of file
Index: sched/authrom/usb_devicedata.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_devicedata.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_devicedata.dat	(working copy)
@@ -0,0 +1,19 @@
+12
+12
+01
+00
+02
+00
+00
+00
+40
+51
+31
+20
+10
+02
+00
+01
+02
+00
+01
\ No newline at end of file
Index: sched/authrom/usb_kbdata.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_kbdata.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_kbdata.dat	(working copy)
@@ -0,0 +1,64 @@
+3f
+05
+01
+09
+06
+a1
+01
+75
+01 
+95
+08
+05
+07
+19
+e0 
+29
+e7
+15
+00
+25
+01
+81
+02
+95
+01 
+75
+08
+81
+03
+95
+05
+75
+01
+05
+08
+19
+01
+29
+05  
+91
+02 
+95
+01  
+75
+03  
+91
+03
+95
+06 
+75
+08 
+15
+00 
+25
+ff
+05
+07
+19
+00
+29
+ff 
+81
+00
+c0
Index: sched/authrom/usb_kbdata_vendor_define.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_kbdata_vendor_define.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_kbdata_vendor_define.dat	(working copy)
@@ -0,0 +1,27 @@
+1a
+06
+bc
+ff
+09
+88
+a1
+01
+85
+04
+19
+00
+2a
+ff
+00
+15
+00
+26
+ff
+00
+75
+08
+95
+01
+81
+00
+c0
\ No newline at end of file
Index: sched/authrom/usb_msdata.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_msdata.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/authrom/usb_msdata.dat	(working copy)
@@ -0,0 +1,164 @@
+a3
+05
+01
+09
+02
+a1
+01
+85
+01
+09
+01
+a1
+00
+05
+09
+19
+01
+29
+05
+15
+00
+25
+01
+95
+05
+75
+01
+81
+02
+95
+01
+75
+03
+81
+01
+05
+01
+09
+30
+09
+31
+16
+01
+F8
+26
+FF
+07
+75
+10
+95
+02
+81
+06
+09
+38
+15
+81
+25
+7f
+75
+08
+95
+01
+81
+06
+05
+0c
+0a
+38
+02
+95
+01
+81
+06
+c0
+c0
+05
+01
+09
+80
+a1
+01
+85
+02
+05
+01
+19
+81
+29
+88
+15
+00
+25
+01
+95
+08
+75
+01
+81
+06
+c0
+05
+0c
+09
+01
+a1
+01
+85
+03
+15
+00
+26
+80
+03
+19
+00
+2a
+80
+03
+75
+10
+95
+01
+81
+00
+c0
+06
+00
+ff
+09
+0e
+a1
+01
+85
+BA
+95
+1f
+75
+08
+26
+ff
+00
+15
+00
+09
+01
+91
+02
+85
+BA
+95
+1f
+75
+08
+26
+ff
+00
+15
+00
+09
+01
+81
+02
+C0
\ No newline at end of file
Index: sched/ble.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/ble.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/ble.dat	(working copy)
@@ -0,0 +1,62 @@
+#ble
+mem_version:09 0e 05 05 00
+mem_rx_window_sniff:00 0c
+
+mem_lpm_mult:20
+mem_lpm_mult_init:20
+
+mem_device1_type:34
+mem_device1_locall_addr:71 81 91 a1 b1 c1
+
+mem_le_lap:71 81 91 a1 b1 c1
+mem_le_adv_channel_map:07
+mem_mouse_direct_timeout:32  #05s
+mem_mouse_discovery_timeout:b0 04	#2min
+mem_mouse_fast_direct_timeout:0a #1s
+mem_local_rx_max_octets:fb 00 48 08 fb 00 48 08  # 1b
+mem_le_battery_level_updata_timer_init:96 00
+mem_mouse_commbination_key_bt:07 #03--LR  05--LM  06--RM  07---LMR
+
+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_pairing_handle:2d 00
+mem_le_battery_level_handle:30 00
+
+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
+
+#max 20bytes, att list data rom limits
+mem_le_name_len:
+'BT5.2 Mouse
+
+mem_le_name_len_temp:	#max 18bytes
+'BT5.2 Mouse
+
+mem_le_interval_min:
+06 00 #min interval
+09 00 #max interval
+20 00 #latency
+2c 01 #timeout
+
+mem_le_adv_ind:03 12 18
+mem_le_adv_direct_ind:ff 00 00
+
Index: sched/mouse_basic.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/mouse_basic.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/mouse_basic.dat	(working copy)
@@ -0,0 +1,342 @@
+mem_patch02:80
+mem_patch03:01
+mem_patch04:01
+mem_patch06:80
+mem_patch07:20	#a0 adc
+mem_patch08:40
+mem_patch09:10	#50 bb event time
+mem_patch0a:04
+mem_patch0b:c4
+mem_patch0e:01
+#mem_patch14:01	#adc
+mem_patch1c:08
+mem_patch2c:02
+
+
+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
+00
+
+#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
+#bit7 MOUSE_ENABLE_OTP
+e2
+
+#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
+00
+
+#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
+00
+
+#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
+03
+
+#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_24G_2M_PHY
+#bit6 MOUSE_ENABLE_DOUBLE_DPI_KEY
+#bit7 MOUSE_ENABLE_24G_NEW_REVISION
+1b
+
+
+mem_mouse_param_config:
+01  #mem_lbutton_gpio
+03  #mem_mbutton_gpio
+06  #mem_rbutton_gpio
+06  #mem_bk_button_gpio
+03  #mem_fw_button_gpio
+01  #mem_dpi_button_gpio
+05  #mem_whee_a_data_gpio
+0a  #mem_whee_b_data_gpio
+08  #mem_mouse_sensor_sclk_gpio
+09  #mem_mouse_sensor_sdio_gpio
+0d  #mem_select_sensor_angle_gpio
+01  #mem_sensor_angle_default
+02  #mem_sensor_angle_switch
+00  #mem_config_sensor_dpi	#power on default dpi 00--1200  01--1600
+ff  #mem_whee_ta_data_gpio
+ff  #mem_whee_tb_data_gpio
+07  #mem_matrix_public_gpio
+ff  #mem_config_select_device_button_gpio
+ff  #mem_customer_key_gpio
+ff  #mem_sensor_motion_gpio
+ff  #mem_device_switch_gpio
+0c  #mem_mouse_reuse_2ice_gpio
+ff  #mem_config_low_voltage_alarm_gpio
+ff  #mem_config_device_24g_led_gpio
+ff  #mem_config_device_bt1_led_gpio
+ff  #mem_config_device_bt2_led_gpio	
+ff  #mem_dpi_led_gpio 
+ff  #mem_dpi_another_button_gpio
+ff  #mem_firebutton_gpio
+ff  #mem_mouse_1io2led_multi_24g_gpio
+ff  #mem_mouse_1io2led_multi_bt1_gpio
+ff  #mem_mouse_1io2led_multi_bt2_gpio
+ff  #mem_mouse_logo_led_gpio
+
+
+#mouse sensor angle
+#0x00 MOUSE_6CLK_ANGLE
+#0X01 MOUSE_9CLK_ANGLE
+#0X02 MOUSE_12CLK_ANGLE
+#0X03 MOUSE_3CLK_ANGLE
+
+mem_mouse_ice_sdio_for_sensor_angle:01	#00 disable, 01 enable
+mem_mouse_logo_enable_gpio0:00	#00:disable logo	01:enable,gpio=0
+
+mem_device_option:08
+mem_device_flag:00	#00--24g 01--bt
+mem_device_number:01   #01--only 2.4g   10--2.4g+ble
+
+#ui
+mem_ui_button_gpio:ff
+mem_ui_button_timeout:1e
+mem_ui_led_struct_num:00
+mem_ui_led_struct_ptr:mem_mouse_led_type
+
+#rf
+mem_tx_power:00	#00--0db 01--3db  02--5db  03--f3db  04--f5db
+mem_rssi_buff_index:07
+mem_rssi_signal_buf_ptr:mem_mouse_rssi_signal_buf
+mem_rssi_dis_min_24g_init:85
+mem_rssi_dis_max_24g_init:90
+mem_rssi_dis_min_ble_init:75
+mem_rssi_dis_max_ble_init:80
+mem_rssi_hex_received_max_value_init:63
+mem_power_ctrl_pac_succ_cnt_init:7d
+mem_power_ctrl_disable:00	#01,disable   00,enable
+mem_tx_power_factory_param:5b 01		#f17dbm
+
+
+#led
+mem_mouse_low_v_led_blink_time:90 01		#200ms on,200ms off
+mem_mouse_dpi_led_blink_time:90 01			#200ms on,200ms off
+mem_mouse_disconvey_led_blink_time:e8 03
+mem_mouse_device_poweron_timer_count_init:14
+
+#1io2led multi start
+mem_mouse_1io2led_led_enable:00			#00:close 	01:open
+mem_mouse_bt_led_recon_effect_flag:00		#00:close 	01:open
+mem_mouse_multi_led_poweron2s_flag_init:00	#00:close 01:open
+mem_mouse_multi_led_powon2s_timer_init:14	#2s
+mem_mouse_multi_led_blink_timer_init:03
+
+#log led
+mem_mouse_logo_led_on_time_init:58 02	#1min
+
+
+#adc
+mem_adc_read_time_init:0a
+mem_adc_config_flag_init:04   #03-gpiol:0-1.8v   04-gpioh:0-3.6v   01-hvin:0-5v
+
+mem_adc_low_volatage_led_blink_timer:64 00
+mem_adc_channel:03      
+#00-gpio3 
+#01-gpio4   
+#02-gpio5  
+#03-gpio6
+#04-gpio8  
+#05-gpio9  
+#06-gpio10  
+#07-gpio11
+
+#2.4g
+mem_24g_lap:14 27 32 41 51 61
+mem_24g_data_type:01	#01--mouse  02--keyboard
+mem_24g_fast_conn_enable:01
+mem_24g_fast_conn_addr:0f 0f 0f 0f
+mem_mouse_commbination_key_24g:05 #03--LR  05--LM  06--RM  07---LMR
+mem_24g_ch_map_update:00   #00--disable   01--enable
+mem_24g_long_sleep_set_level:02    #00--30ms   01--50ms  02--80ms  03--100ms
+mem_24g_disable_fec1:00	 #00--default mode  01--new process
+
+mem_24g_rx_window:c0 12     #400us  ## e0 2e#1ms #transmitter long range min:520us
+
+mem_mouse_24g_short_sleep_set_4ms:18 6a 00
+mem_mouse_24g_long_sleep_set_4ms:80 bb 00
+mem_mouse_24g_fast_hop_count_4ms:05
+mem_mouse_24g_tsniff_4ms:80 bb 00 00
+
+mem_mouse_24g_short_sleep_set_8ms:40 19 01
+mem_mouse_24g_long_sleep_set_8ms:00 77 01
+mem_mouse_24g_fast_hop_count_8ms:0b
+mem_mouse_24g_tsniff_8ms:00 77 01 00
+
+mem_mouse_sleep_deal_type:00
+
+
+mem_mouse_24g_pair_tx_power:9e #94:-20dbm	9e:-30dbm
+mem_mouse_24g_pair_timeout_init:58 02  #1min	    24g reconn timer&pair timer
+
+mem_24g_enter_hibernate:00 48 60
+mem_24g_long_sleep_param_update_timer_init:2c 01	#30s
+mem_24g_transmit_by_interrupt_exit_count_init:50 00
+mem_mouse_24g_reconn_timeout_init:64 #10s
+mem_mouse_24g_power_on_fast_conn_timer:02 00	#500ms
+mem_mouse_24g_search_dongle_time_init:64 00	#10s
+mem_store_information_delay_timer_init:05
+
+
+mem_mouse_dpi_seting:
+03	#mem_320x_dpi_0
+04	#mem_320x_dpi_1
+01	#mem_320x_dpi_2
+02	#mem_320x_dpi_3
+
+20	#mem_3212_dpi_0
+2a	#mem_3212_dpi_1
+3f	#mem_3212_dpi_2
+15	#mem_3212_dpi_3
+
+14	#mem_ka8g2_dpi_0
+1b	#mem_ka8g2_dpi_1
+11	#mem_ka8g2_dpi_2
+0e	#mem_ka8g2_dpi_3
+
+mem_sensor_3212_init:
+09 5a
+26 34
+19 04
+09 00
+ff ff
+
+mem_sensor_3205_init:
+09 5a
+0d 10
+1d ed
+7d 80
+ff ff
+
+mem_sensor_8650_init:
+09 5a
+ff 27
+ab 40
+b3 56
+9b e6
+a8 12
+a9 c0
+be e6
+a5 af
+a0 21
+a1 02
+b8 10
+b9 0b
+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_sensor_ka8g2_poweron_init:
+09 a5
+0b f3
+09 00
+ff ff
+
+
+
Index: sched/mouse_enhanced.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/mouse_enhanced.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/sched/mouse_enhanced.dat	(working copy)
@@ -0,0 +1,341 @@
+
+#mem_patch06:80
+mem_patch07:20
+mem_patch08:40
+mem_patch09:50
+mem_patch0a:04
+mem_patch0b:c4
+mem_patch0e:01
+mem_patch1c:08
+mem_patch2b:02
+
+
+
+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
+00
+
+#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
+#bit7 MOUSE_ENABLE_OTP
+c2
+
+#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
+01
+
+#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
+00
+
+#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
+00
+
+#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
+03
+
+#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_24G_2M_PHY
+#bit6 MOUSE_ENABLE_DOUBLE_DPI_KEY
+#bit7 MOUSE_ENABLE_24G_NEW_REVISION
+bb
+
+
+mem_mouse_param_config:
+01  #mem_lbutton_gpio
+06  #mem_mbutton_gpio
+03  #mem_rbutton_gpio
+01  #mem_bk_button_gpio
+03  #mem_fw_button_gpio
+06  #mem_dpi_button_gpio
+0a  #mem_whee_a_data_gpio
+05  #mem_whee_b_data_gpio
+08  #mem_mouse_sensor_sclk_gpio
+09  #mem_mouse_sensor_sdio_gpio
+ff  #mem_select_sensor_angle_gpio
+00  #mem_sensor_angle_default
+00  #mem_sensor_angle_switch
+00  #mem_config_sensor_dpi	#power on default dpi 00--1200  01--1600
+ff  #mem_whee_ta_data_gpio
+ff  #mem_whee_tb_data_gpio
+ff  #mem_matrix_public_gpio
+ff  #mem_config_select_device_button_gpio
+ff  #mem_customer_key_gpio
+ff  #mem_sensor_motion_gpio
+ff  #mem_device_switch_gpio
+0c  #mem_mouse_reuse_2ice_gpio
+ff  #mem_config_low_voltage_alarm_gpio
+ff  #mem_config_device_24g_led_gpio
+ff  #mem_config_device_bt1_led_gpio
+ff  #mem_config_device_bt2_led_gpio	
+ff  #mem_dpi_led_gpio 
+ff  #mem_dpi_another_button_gpio
+ff  #mem_firebutton_gpio
+ff  #mem_mouse_1io2led_multi_24g_gpio
+ff  #mem_mouse_1io2led_multi_bt1_gpio
+ff  #mem_mouse_1io2led_multi_bt2_gpio
+ff  #mem_mouse_logo_led_gpio
+
+
+#mouse sensor angle
+#0x00 MOUSE_6CLK_ANGLE
+#0X01 MOUSE_9CLK_ANGLE
+#0X02 MOUSE_12CLK_ANGLE
+#0X03 MOUSE_3CLK_ANGLE
+
+mem_mouse_ice_sdio_for_sensor_angle:00	#00 disable, 01 enable
+
+mem_device_option:08
+mem_device_flag:00	#00--24g 01--bt
+mem_device_number:01   #01--only 2.4g   10--2.4g+ble
+
+#ui
+mem_ui_button_gpio:ff
+mem_ui_button_timeout:1e
+mem_ui_led_struct_num:00
+mem_ui_led_struct_ptr:mem_mouse_led_type
+
+#rf
+mem_tx_power:0a	#00--0db 01--3db  02--5db  03--f3db  04--f5db
+#mem_rssi_buff_index:07
+#mem_rssi_signal_buf_ptr:mem_mouse_rssi_signal_buf
+#mem_rssi_dis_min_24g_init:85
+#mem_rssi_dis_max_24g_init:90
+#mem_rssi_dis_min_ble_init:75
+#mem_rssi_dis_max_ble_init:80
+#mem_rssi_hex_received_max_value_init:63
+#mem_power_ctrl_pac_succ_cnt_init:7d
+mem_power_ctrl_disable:01	#01,disable   00,enable
+mem_tx_power_factory_param:42 00		#f50dbm
+
+
+#led
+mem_mouse_low_v_led_blink_time:90 01		#200ms on,200ms off
+mem_mouse_dpi_led_blink_time:90 01			#200ms on,200ms off
+mem_mouse_disconvey_led_blink_time:e8 03
+mem_mouse_device_poweron_timer_count_init:14
+
+#1io2led multi start
+mem_mouse_1io2led_led_enable:00			#00:close 	01:open
+mem_mouse_bt_led_recon_effect_flag:00		#00:close 	01:open
+mem_mouse_multi_led_poweron2s_flag_init:00	#00:close 01:open
+mem_mouse_multi_led_powon2s_timer_init:14	#2s
+mem_mouse_multi_led_blink_timer_init:03
+
+#log led
+mem_mouse_logo_led_on_time_init:58 02	#1min
+
+
+#adc
+mem_adc_read_time_init:0a
+mem_adc_config_flag_init:02   #00-vinlpm   01-hvin   02-gpio
+mem_adc_low_volatage_led_blink_timer:64 00
+mem_adc_channel:04       
+#00-gpio4   
+#01-gpio5   
+#02-gpio6  
+#03-gpio7
+#04-gpio9  
+#05-gpio10  
+#06-gpio11  
+#07-gpio12
+
+
+#2.4g
+mem_24g_lap:11 21 31 41 51 61
+mem_24g_data_type:01	#01--mouse  02--keyboard
+mem_24g_fast_conn_enable:01
+mem_24g_fast_conn_addr:0f 0f 0f 0f
+mem_mouse_commbination_key_24g:03 #03--LR  05--LM  06--RM  07---LMR
+mem_24g_ch_map_update:00   #00--disable   01--enable
+mem_24g_long_sleep_set_level:02    #00--30ms   01--50ms  02--80ms  03--100ms
+mem_24g_disable_fec1:01	 #00--default mode  01--new process
+
+mem_24g_rx_window:c0 12     #400us  ## e0 2e#1ms #transmitter long range min:520us
+
+mem_mouse_24g_short_sleep_set_4ms:78 7e 00
+mem_mouse_24g_long_sleep_set_4ms:80 bb 00
+mem_mouse_24g_fast_hop_count_4ms:0f
+mem_mouse_24g_tsniff_4ms:80 bb 00 00
+
+mem_mouse_24g_short_sleep_set_8ms:50 39 01
+mem_mouse_24g_long_sleep_set_8ms:00 77 01
+mem_mouse_24g_fast_hop_count_8ms:1e
+mem_mouse_24g_tsniff_8ms:00 77 01 00
+
+mem_mouse_sleep_deal_type:01
+
+
+mem_mouse_24g_pair_tx_power:94 #-20dBm
+mem_mouse_24g_pair_timeout_init:08 00  #800ms	    24g reconn timer&pair timer
+
+mem_24g_enter_hibernate:00 48 60
+mem_24g_long_sleep_param_update_timer_init:2c 01	#30s
+mem_24g_transmit_by_interrupt_exit_count_init:50 00
+mem_mouse_24g_reconn_timeout_init:05 #500ms
+mem_mouse_24g_power_on_fast_conn_timer:05 00	#500ms
+mem_mouse_24g_search_dongle_time_init:64 00	#10s
+mem_store_information_delay_timer_init:05
+
+
+mem_mouse_dpi_seting:
+03	#mem_320x_dpi_0
+04	#mem_320x_dpi_1
+01	#mem_320x_dpi_2
+02	#mem_320x_dpi_3
+
+20	#mem_3212_dpi_0
+2a	#mem_3212_dpi_1
+3f	#mem_3212_dpi_2
+15	#mem_3212_dpi_3
+
+14	#mem_ka8g2_dpi_0
+1b	#mem_ka8g2_dpi_1
+11	#mem_ka8g2_dpi_2
+0e	#mem_ka8g2_dpi_3
+
+mem_sensor_3212_init:
+09 5a
+26 34
+19 04
+09 00
+ff ff
+
+mem_sensor_3205_init:
+09 5a
+0d 10
+1d ed
+7d 80
+ff ff
+
+mem_sensor_8650_init:
+09 5a
+ff 27
+ab 40
+b3 56
+9b e6
+a8 12
+a9 c0
+be e6
+a5 af
+a0 21
+a1 02
+b8 10
+b9 0b
+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_sensor_ka8g2_poweron_init:
+09 a5
+0b f3
+09 00
+ff ff
+
+
+
+
+
Index: test_1011-N_mouse_public_Only2.4G.dat
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/test_1011-N_mouse_public_Only2.4G.dat	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/test_1011-N_mouse_public_Only2.4G.dat	(working copy)
@@ -0,0 +1,1747 @@
+00
+02
+aa
+55
+aa
+04
+c2
+84
+00
+0f
+c0
+1b
+80
+74
+c0
+0b
+80
+12
+c0
+0c
+00
+2e
+c0
+10
+00
+49
+c0
+1e
+80
+c4
+c0
+23
+00
+d6
+c0
+26
+00
+e1
+c0
+29
+01
+02
+c0
+2d
+00
+9a
+c0
+2f
+00
+6c
+c0
+2f
+80
+70
+c0
+38
+00
+4b
+c0
+71
+80
+bf
+20
+20
+3a
+8a
+c0
+30
+80
+cd
+c1
+7f
+80
+00
+20
+20
+3a
+8a
+6f
+e0
+c1
+16
+c0
+01
+80
+1e
+c0
+03
+00
+20
+c0
+05
+3a
+00
+c0
+4a
+00
+24
+c0
+4f
+00
+2b
+c0
+55
+3a
+0f
+70
+8a
+3b
+2c
+70
+8a
+3c
+17
+70
+8a
+39
+8a
+70
+8a
+3a
+0f
+20
+20
+39
+f4
+70
+8a
+3b
+48
+20
+20
+00
+1a
+70
+8a
+3b
+70
+70
+8a
+3c
+1f
+70
+8a
+39
+c9
+20
+20
+00
+1c
+70
+8a
+39
+85
+70
+8a
+3a
+04
+70
+8a
+14
+a3
+70
+8a
+15
+0a
+70
+8a
+3b
+18
+70
+8a
+3c
+0f
+20
+60
+00
+00
+70
+8a
+39
+83
+70
+8a
+3a
+02
+20
+20
+00
+26
+70
+8a
+75
+03
+70
+8a
+85
+00
+70
+89
+6f
+10
+6f
+e0
+c3
+ef
+20
+5a
+6d
+31
+70
+8a
+03
+05
+70
+8a
+7a
+94
+20
+40
+3a
+44
+20
+40
+3a
+3f
+20
+40
+3a
+3a
+70
+8a
+8b
+e6
+70
+8a
+83
+90
+70
+8a
+0e
+0b
+70
+8a
+0f
+05
+70
+89
+68
+76
+70
+89
+69
+76
+6f
+e0
+c0
+9a
+c0
+84
+00
+41
+70
+8a
+08
+34
+70
+8a
+01
+ff
+20
+00
+00
+64
+70
+8a
+02
+0e
+70
+8a
+00
+03
+20
+40
+00
+19
+70
+8a
+9a
+28
+70
+8a
+9b
+3f
+20
+20
+3a
+35
+20
+40
+3c
+18
+20
+20
+3b
+48
+70
+80
+80
+73
+20
+40
+6e
+b3
+20
+40
+00
+55
+20
+40
+57
+a0
+20
+75
+80
+00
+20
+40
+59
+bd
+20
+40
+56
+2e
+20
+40
+5c
+c5
+20
+40
+00
+8e
+20
+20
+52
+34
+20
+75
+80
+00
+20
+40
+52
+5e
+c4
+0b
+80
+00
+20
+40
+01
+18
+d8
+40
+00
+02
+df
+e0
+07
+ee
+da
+20
+46
+3d
+20
+40
+68
+c5
+6f
+e1
+46
+3d
+d8
+40
+aa
+55
+98
+46
+7c
+00
+20
+22
+80
+66
+20
+40
+5b
+76
+df
+20
+00
+02
+da
+20
+46
+3d
+df
+e0
+07
+ee
+20
+20
+68
+83
+20
+40
+00
+69
+70
+45
+e5
+00
+20
+20
+5b
+81
+6f
+e0
+c5
+c0
+67
+e0
+c6
+3f
+20
+60
+00
+00
+18
+42
+7e
+00
+20
+7a
+00
+00
+c1
+7f
+80
+00
+20
+20
+5f
+23
+18
+42
+7e
+00
+20
+7a
+00
+00
+c1
+7f
+80
+00
+20
+20
+5f
+30
+6f
+e0
+c9
+11
+20
+3a
+52
+c8
+6f
+e0
+c5
+be
+67
+e0
+c5
+d5
+6f
+e0
+c5
+bd
+c1
+7f
+80
+00
+20
+40
+69
+2d
+6f
+e0
+c5
+bd
+d8
+40
+00
+3e
+20
+40
+6b
+bd
+6f
+e0
+c5
+c8
+d8
+40
+00
+3e
+20
+40
+6b
+bd
+68
+48
+c5
+bc
+20
+40
+54
+7f
+68
+48
+c5
+bc
+20
+40
+6b
+85
+20
+40
+d2
+d2
+20
+40
+54
+7b
+68
+48
+c5
+bc
+20
+40
+6b
+7c
+20
+40
+69
+31
+68
+48
+c5
+bd
+20
+40
+6b
+ae
+68
+48
+c5
+c8
+20
+20
+6b
+ae
+58
+00
+5f
+ad
+67
+e1
+45
+43
+58
+00
+00
+93
+67
+e1
+45
+45
+20
+20
+52
+3d
+20
+40
+4d
+15
+24
+74
+00
+00
+20
+40
+74
+e0
+70
+49
+05
+01
+20
+20
+5f
+a6
+20
+40
+74
+e0
+20
+20
+3c
+18
+20
+40
+54
+9b
+24
+74
+00
+00
+6f
+e0
+c9
+05
+70
+49
+05
+00
+24
+5a
+00
+98
+6f
+e4
+48
+64
+c3
+0a
+de
+39
+20
+40
+00
+a5
+6f
+e0
+c8
+44
+24
+3a
+00
+aa
+20
+20
+5e
+39
+6f
+e0
+c5
+78
+1f
+e1
+7e
+18
+24
+3a
+57
+2d
+20
+40
+57
+30
+20
+20
+57
+2a
+20
+40
+00
+b1
+70
+44
+d4
+02
+da
+20
+00
+09
+6f
+e0
+c8
+45
+24
+3a
+5e
+54
+da
+40
+48
+8d
+20
+60
+00
+00
+6f
+e0
+c5
+78
+c2
+81
+80
+ba
+c2
+82
+00
+b5
+20
+60
+00
+00
+58
+00
+00
+00
+67
+e0
+c8
+84
+67
+e0
+c8
+8d
+58
+6f
+00
+00
+20
+20
+5c
+9e
+58
+00
+00
+00
+67
+e0
+c8
+84
+67
+e0
+c8
+8d
+58
+72
+00
+00
+20
+20
+5c
+9e
+18
+42
+7e
+00
+c2
+80
+80
+c2
+20
+20
+3c
+e3
+70
+8a
+6d
+89
+20
+20
+3c
+e9
+20
+40
+53
+39
+6f
+e0
+c9
+12
+c0
+00
+80
+c8
+70
+80
+70
+80
+6f
+e0
+80
+17
+79
+20
+7e
+05
+67
+e0
+80
+17
+20
+40
+3c
+18
+20
+20
+5a
+f0
+78
+34
+7c
+00
+20
+40
+3b
+1b
+6f
+e1
+c0
+be
+20
+3a
+74
+ca
+6f
+e0
+c0
+94
+20
+3a
+74
+ca
+6f
+e0
+c8
+99
+24
+7a
+00
+00
+20
+20
+4d
+1c
+1a
+62
+7e
+00
+67
+e0
+c8
+50
+1f
+e3
+fe
+00
+1f
+e2
+24
+00
+18
+42
+26
+00
+20
+40
+54
+7b
+1a
+62
+04
+00
+20
+40
+6b
+85
+7d
+20
+a4
+00
+20
+40
+57
+53
+20
+20
+57
+3f
+1a
+62
+7e
+00
+c0
+1e
+00
+e5
+c0
+1d
+00
+f1
+20
+20
+59
+14
+6f
+e2
+44
+da
+67
+e2
+45
+33
+67
+e2
+46
+40
+20
+40
+4b
+ce
+20
+40
+5e
+1b
+20
+40
+5a
+a9
+20
+40
+58
+c4
+70
+47
+68
+00
+70
+45
+47
+00
+70
+45
+2d
+00
+68
+4a
+45
+33
+20
+20
+5e
+17
+6f
+e0
+c5
+4b
+24
+3a
+5d
+80
+6f
+e0
+c5
+2d
+c0
+01
+5d
+f4
+c0
+02
+00
+f8
+c0
+01
+80
+fd
+20
+20
+5d
+ed
+6f
+e4
+48
+64
+c3
+17
+dd
+ed
+6f
+e0
+c8
+6c
+c0
+00
+dd
+ed
+20
+20
+5d
+cb
+6f
+e4
+48
+64
+c3
+17
+dd
+ed
+c2
+89
+dd
+ed
+c2
+89
+5d
+ed
+20
+20
+5d
+c4
+20
+40
+5b
+90
+c4
+0b
+80
+00
+df
+e0
+07
+90
+1f
+e2
+24
+00
+20
+40
+01
+24
+6f
+e2
+49
+0d
+20
+3a
+01
+10
+67
+e2
+49
+09
+1a
+40
+a4
+04
+df
+e0
+07
+cf
+9a
+46
+7c
+00
+24
+61
+00
+00
+1a
+42
+7e
+00
+20
+20
+01
+06
+6f
+e2
+49
+09
+68
+4a
+46
+40
+98
+46
+7c
+00
+20
+62
+80
+00
+df
+20
+00
+04
+da
+20
+46
+40
+1a
+42
+7e
+00
+20
+20
+68
+83
+df
+e0
+07
+90
+1f
+e2
+24
+00
+20
+40
+01
+24
+6f
+e2
+49
+0d
+20
+3a
+01
+27
+67
+e2
+49
+09
+1a
+40
+a4
+04
+df
+e0
+07
+cf
+9a
+46
+7c
+00
+24
+21
+01
+27
+1a
+42
+7e
+00
+20
+20
+01
+1a
+d8
+40
+00
+04
+da
+20
+49
+0d
+20
+20
+68
+c5
+6f
+e2
+49
+09
+67
+e2
+46
+40
+20
+60
+00
+00
+4a
+97
+aa
+55
+06
+00
+3c
+44
+14
+27
+32
+41
+51
+61
+aa
+55
+01
+00
+de
+01
+5a
+aa
+55
+0d
+00
+02
+40
+80
+01
+01
+00
+80
+20
+40
+10
+04
+c4
+00
+00
+01
+aa
+55
+01
+00
+1c
+40
+08
+aa
+55
+01
+00
+2c
+40
+02
+aa
+55
+02
+00
+94
+40
+01
+08
+aa
+55
+02
+00
+9d
+40
+1e
+41
+aa
+55
+08
+00
+c4
+40
+88
+0b
+ce
+35
+3f
+0c
+33
+03
+aa
+55
+03
+00
+cd
+40
+9d
+10
+22
+aa
+55
+07
+00
+18
+41
+ff
+04
+00
+00
+08
+00
+ff
+aa
+55
+04
+00
+c4
+43
+a0
+0f
+00
+03
+aa
+55
+04
+00
+ea
+43
+01
+00
+20
+d3
+aa
+55
+06
+00
+36
+44
+1e
+ff
+00
+00
+da
+45
+aa
+55
+04
+00
+d4
+44
+01
+00
+c0
+12
+aa
+55
+03
+00
+fa
+44
+00
+48
+60
+aa
+55
+01
+00
+1d
+45
+07
+aa
+55
+05
+00
+2e
+45
+01
+0f
+0f
+0f
+0f
+aa
+55
+02
+00
+3b
+45
+6f
+47
+aa
+55
+04
+00
+66
+45
+50
+00
+2c
+01
+aa
+55
+01
+00
+72
+45
+7d
+aa
+55
+01
+00
+9f
+45
+0a
+aa
+55
+2f
+00
+a5
+45
+04
+00
+00
+58
+02
+00
+64
+9e
+85
+90
+63
+75
+80
+20
+01
+03
+06
+06
+03
+01
+05
+0a
+08
+09
+0d
+01
+02
+00
+ff
+ff
+07
+ff
+ff
+ff
+ff
+0c
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+ff
+aa
+55
+01
+00
+6d
+46
+05
+aa
+55
+0c
+00
+7d
+46
+03
+04
+01
+02
+20
+2a
+3f
+15
+14
+1b
+11
+0e
+aa
+55
+0a
+00
+8c
+46
+09
+5a
+26
+34
+19
+04
+09
+00
+ff
+ff
+aa
+55
+0a
+00
+a0
+46
+09
+5a
+0d
+10
+1d
+ed
+7d
+80
+ff
+ff
+aa
+55
+64
+00
+e6
+46
+09
+5a
+ff
+27
+ab
+40
+b3
+56
+9b
+e6
+a8
+12
+a9
+c0
+be
+e6
+a5
+af
+a0
+21
+a1
+02
+b8
+10
+b9
+0b
+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
+10
+00
+56
+47
+09
+5a
+0b
+f3
+09
+00
+ff
+ff
+09
+a5
+0b
+f3
+09
+00
+ff
+ff
+aa
+55
+09
+00
+64
+48
+00
+09
+e2
+00
+00
+00
+03
+1b
+01
+aa
+55
+12
+00
+72
+48
+02
+00
+64
+00
+70
+17
+14
+00
+90
+01
+e8
+03
+90
+01
+64
+00
+00
+05
+aa
+55
+03
+00
+9a
+48
+02
+5b
+01
+aa
+55
+23
+00
+c3
+48
+14
+00
+03
+00
+00
+58
+02
+00
+00
+18
+6a
+00
+80
+bb
+00
+05
+40
+19
+01
+00
+77
+01
+0b
+00
+00
+00
+00
+80
+bb
+00
+00
+00
+77
+01
+00
+aa
+55
+01
+00
+11
+49
+01
+55
+aa
+aa
+55
+44
+a1
+d7
+e7
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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/crc16.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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/deletenote.pl
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/deletenote.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/deletenote.pl	(working copy)
@@ -0,0 +1,27 @@
+
+#print "输入注释的标志:";
+
+#chomp ($text = <STDIN>);
+
+#print $text;
+
+###########################
+#该脚本的功能为删除，#为注释的注释代码。
+
+$Sched_path=$ARGV[0];
+
+open(Sched,$Sched_path)||die("Cannot open files\n");
+@sched=<Sched>;
+close(Sched);
+
+foreach $sched(@sched)
+{
+	$sched_begin = $sched;
+	@Sched = split(/[#]+/, $sched);
+	chomp @Sched[0];
+	$sched = @Sched[0]."\n";
+}
+
+open(Sched,">$Sched_path")||die("Cannot open files\n");
+print Sched @sched;
+close(Sched);
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
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/eeprom2fulleeprom.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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/eeprom2otp.pl
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/eeprom2otp.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/eeprom2otp.pl	(working copy)
@@ -0,0 +1,24 @@
+
+#鏀瑰墠涓変釜瀛楄妭涓0200锛
+#杈撳叆涓涓枃浠讹紝杈撳嚭涓涓枃浠讹紱
+
+if(@ARGV < 2) {
+	printf "less files\n";
+	exit;
+}
+else{
+	open(file, $ARGV[0]) or die "Can't open  file  : $!"; 
+	open(file_out, ">$ARGV[1]")or die "Can't open out file  : $!"; 
+	@lines = <file>;
+	$length = @lines;
+	
+	my $j=2;
+	print file_out "00\n01\n";
+	while($j<$length){
+			print file_out "$lines[$j]";
+			$j++;
+	}
+#	print "----- reverse end -----";
+	close(file);
+	close(file_out);
+}
Index: util/mergepatch.pl
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/mergepatch.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/mergepatch.pl	(working copy)
@@ -0,0 +1,335 @@
+#!/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 getdefs {
+	my($def) = @_;
+	my(@ifdefs) = split(/\s*\|\s*/, $def);
+	my $v = 0;
+	foreach (@ifdefs) {
+		s/\s//g;
+		$v = 1 if($defs =~ /(^|\s)$_(\s|$)/);
+	}
+	return $v;
+}
+
+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;
+		}
+		if(/^\s*ifdef\s+(.+)$/) {
+			$v = getdefs($1) ? 1 : 0;
+			push @valid, $v & $valid[$#valid];
+		} elsif(/^\s*ifndef\s+(.+)$/) {
+			$v = getdefs($1) ? 0 : 1;
+			push @valid, $v & $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 {
+			if(/^define\s+(\w+)\s*/) {
+				$defs .= $1 . " " 
+			}
+				print file $_;
+			}
+		}
+	}
+	close file;
+}
+
+sub genpatch
+{
+	print "genpatch\n";
+	$patched = 0;
+	open file,"output/bt_program23.meta";
+	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] = 0, $z = 1;$i < @f;$i++) {
+		$_ = $f[$i];
+		$line[0] = $i - 1 if(/^org\s+0x([23]000|800)/ && $line[0] == 0);
+		if(/^org z\s*$/) {
+			$line[$z/0x10000 + 1] = $i - 1;
+			$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);
+	$line[$z/0x10000 + 1] = $i - 1;
+	for($i = 0;$i < @f;$i++) {
+		$_ = $f[$i];
+		$label = "";
+		if(/^\s*(branch|nbranch|call|ncall|setarg)\s+(\w+)\s*$/ || /^\s*(branch|nbranch|call|ncall|arg)\s+(\w+)\s*,\s*(\w+)\s*$/) {
+			$label = $2;
+		}
+		if(/^\s*(bmark|beq|bne|bbit[01])\s+(\w+)\s*,\s*(\w+)\s*$/) {
+			$label = $3;
+		}
+		$branch = /^\s+branch\s+$label\s*$/ ? 1 : 0;
+		if(exists($lab{$label})) {
+			$nlabel = "jmpz_" . $label;
+			$f[$i] =~ s/$label/eval "$nlabel"/e;
+			if($lab{$label} > 100) {
+				$z = int($lab{$label}/0x1000);
+				$l = $i < $line[1] ? $line[0] : $line[$z/10 - 1];
+				if($branch && $i >= $line[1]) {
+					$f[$i] = sprintf("\tsetarg 0x%x\n\tbranch p_zcode_entrance_2Bytes_common\n\n", $z);
+				} else {
+					$f[$l] .= sprintf("%s:\n\tsetarg 0x%x\n\tbranch p_zcode_entrance_2Bytes_common\n\n", $nlabel, $z);
+				}
+				$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;
+}
+
+sub authrom {
+	$addr = 0x9000;
+	foreach $s (@ARGV) {
+		open f, "../sched/authrom/" . $s . ".dat" or die "cannot open dat file $s";
+		@ff = <f>;
+		close f;
+		foreach (@ff) { $_ =~ s/\s//g;push @auth, $_ . "\n"; }
+		printf "0x%x %s_ADDR\n", $addr, uc($s);
+		$addr += $#ff + 1;
+	}
+	open f,">auth.rom";
+	print f @auth;
+	close f;
+	open f,"romcode.rom" or return;
+	@rom = <f>;
+	close f;
+	for($i = 0, $j = $#rom - 0x1ff;$i < 0x200;$i++,$j++) {
+		for($k = 0, $l = "";$k < 4;$k++) {
+			$_ = $auth[$i*4 + $k];
+			s/\s//g;
+			$_ = "00" if(/^$/);
+			$l =  $_ . $l;
+		}
+		$rom[$j] = $l . "\n";
+	}
+	open f,">romcode.rom";
+	print f @rom;
+	close f;
+}
+
+if(@ARGV > 0) {
+	authrom();
+	exit;
+}
+
+parseif("output/bt_program23.meta");
+parseif("output/bt_format.meta");
+genpatch() if($defs !~ / SIM /);
+malloc();
+zcode();
Index: util/patch.pl
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/patch.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/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;
Index: util/romcrc.pl
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/romcrc.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/romcrc.pl	(working copy)
@@ -0,0 +1,54 @@
+#!/bin/perl
+sub crc16_ccitt2
+{
+	my($crc, $c) = @_;
+
+  $crc  = ($crc >> 8) | ($crc << 8);
+  $crc ^= $c;
+  $crc ^= ($crc & 0xff) >> 4;
+  $crc ^= $crc << 12;
+  $crc ^= ($crc & 0xff) << 5;
+  $crc &= 0xffff;
+ return $crc;
+}
+
+sub gencrc
+{
+  my($crc, $c) = @_;
+  my($i);
+	$c =~ s/\s//g;
+  for($i = 0;$i < length($c);$i+=2) {
+  	$crc = crc16_ccitt2($crc, hex(substr($c, $i, 2)));
+  }
+  return $crc;
+}
+
+open f,"$ARGV[0]" or die "open romfile fail";
+@txt = <f>;
+close f;
+$len = $len0 = $#txt;
+$len = hex($ARGV[1]) if(@ARGV > 1);
+for($i = 0, $crc = 0xffff;$i < $len;$i++) {
+	if($i <= $len) {
+		$_ = $txt[$i];
+		s/\s//g;
+		$wid = length($_) if($i == 0);
+		$crc = gencrc($crc, $_);
+		$txt[$i] = $_ . "\n";
+	} else {
+		$txt[$i] = join('', map('0', 1..$wid)) . "\n";
+		$crc = gencrc($crc, $txt[$i]);
+	}
+}
+if($wid > 4) {
+	$txt[$len] = join('', map('0', 1..($wid - 4)));
+	$crc = gencrc($crc, $txt[$i]);
+	$txt[$len] .= sprintf("%04x", $crc);
+} else {
+	$txt[$len] .= sprintf("%02x\n%02x\n", $crc >> 8, $crc & 0xff);
+}
+
+printf "%02x\n%02x\n", $crc >> 8, $crc & 0xff;
+open f,">$ARGV[0]";
+print f @txt;
+close f;
Index: util/sortsched.pl
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/sortsched.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/sortsched.pl	(working copy)
@@ -0,0 +1,163 @@
+
+
+$Sched_path=$ARGV[0];
+$Sched_test_path=$ARGV[1];
+
+open(Sched,"$Sched_path")||die("Cannot open files1\n");
+@sched=<Sched>;
+@sched[-1] = "";
+close(Sched);
+#open(Sched_test,">ResultsFile.rom")||die("Cannot open files2\n");
+#print Sched_test ("");
+#close (Sched_test);
+#open(Sched_test,">ResultsFile.rom")||die("Cannot open file3s\n");
+open(Sched_test1,">$Sched_test_path")||die("Cannot open files4\n");
+#@Sched_test=<Sched_test>;
+@Data[0]="";
+$Data_num=0;
+@Address_num;
+@OriginalRecord;
+foreach $sched (@sched)
+{
+	if($sched=~/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:/)
+	{
+		$lap_flag = 0;
+		$le_lap_flag = 0;
+		if($sched=~/443c:/)
+		{
+			$lap_data = $sched;
+			$lap_flag = 1;
+		}
+		elsif($sched =~ /42b0:/)
+		{
+			$le_lap_data = $sched;
+			$le_lap_flag = 1;
+		}
+		else
+		{
+			$Data_num++;
+			@OriginalRecord[$Data_num]=$sched;
+			@snap_variable=split(/[#\n]/,$sched);
+			@Data[$Data_num]=@snap_variable[0]."\n";
+		}
+	}
+	else
+	{
+		if($lap_flag == 1)
+		{
+			$lap_data .= $sched;
+		}
+		elsif($le_lap_flag == 1)
+		{
+			$le_lap_data .= $sched;
+		}
+		else
+		{
+			@OriginalRecord[$Data_num].=$sched;
+			@snap_variable=split(/[#\n]/,$sched);
+			@Data[$Data_num].=@snap_variable[0]."\n";
+		}
+	}
+}
+@sort_Data = sort(@Data);
+@OriginalRecord=sort(@OriginalRecord);
+$PreviousADDR=0;
+$CurrentADDR=0;
+$PreviousData="";
+$CurrentData="";
+$I=0;
+$len_sort_Data=@sort_Data;
+$NextADDR="";
+for($i=0;$i<$len_sort_Data;$i++)
+{
+	$sort_Data=@sort_Data[$i];
+	@snap_variable=split(/:/,$sort_Data);
+	$WData=@snap_variable[1];
+	
+	if($WData =~ /[1-9a-fA-F]/ && hex(@snap_variable[0]) >= 16384){
+	$WADDR=@snap_variable[0];
+	@sort_Data[$i]=@OriginalRecord[$i];
+	@LLL[$i]=0;
+	if($NextADDR eq $WADDR){
+		@snap_variable=split(/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:/,@OriginalRecord[$i]);
+		@sort_Data[$i]=@snap_variable[1];
+		@LLL[$i]=1;
+	}
+	if(@LLL[$i]==0 && hex($PreviousADDR)+6>hex($WADDR)){
+		$LEN=hex($WADDR) - hex($NextADDR);
+		#print $LEN;
+		for($j=0;$j<$LEN;$j++)
+		{
+			@sort_Data[$i-1].="00 "
+		}
+		@sort_Data[$i-1].="\n";
+		@snap_variable=split(/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:/,@OriginalRecord[$i]);
+		@sort_Data[$i]=@snap_variable[1];
+		@LLL[$i]=1;
+	}
+	if($PreviousADDR eq $WADDR){
+		@sort_Data[$i-1]="";
+		if(@LLL[$i-1]==1){
+			@snap_variable=split(/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:/,@OriginalRecord[$i]);
+			@sort_Data[$i]=@snap_variable[1];
+			@LLL[$i]=1;
+		}
+	}
+	else{
+		@DataNum=split(/[0-9a-fA-F][0-9a-fA-F]/,$WData);
+		$DataNum=@DataNum;
+		$PreviousADDR=$WADDR;
+		#@sort_Data[$i].="      ".$DataNum."\n";
+		$NextADDR = &hex_add($WADDR,$DataNum);
+	}
+	}
+	else{
+		if(hex(@snap_variable[0]) >= 16384)
+		{
+			@sort_Data[$i]="";
+		}
+	}
+	#@sort_Data[$i].="      ".$NextADDR."\n";
+	#$sort_Data =~ s/\n//;
+	#$sort_Data.="\n";
+}
+#print Sched_test @OriginalRecord;
+print Sched_test1 $lap_data;
+print Sched_test1 $le_lap_data;
+print Sched_test1 @sort_Data;
+print  $lap_data;
+print  $le_lap_data;
+#for($i=0;$i<$len_sort_Data;$i++)
+#foreach $sort_Data (@sort_Data)
+#{	
+	#$sort_Data=@sort_Data[$i];
+	#print Sched_test $PreviousData;
+	#@snap_variable=split(/:/,$sort_Data);
+	#$CurrentADDR=@snap_variable[0];
+	#$CurrentData=$sort_Data;
+	#print ($CurrentADDR);
+	#if($CurrentADDR-$PreviousADDR==1)
+	#{
+	#	$CurrentVal=@snap_variable[1];
+	#	@snap_variable=split(/\n/,$PreviousData);
+		
+	#	$PreviousData.=" ".$CurrentVal;
+	#	$CurrentData=$PreviousData;
+	#	@sort_Data[$i]="";
+	#	@sort_Data[$i-1]=$CurrentData;
+		#print ($CurrentData."\n");
+	#}
+	#$PreviousADDR=$CurrentADDR;
+	#$PreviousData=$CurrentData;
+	#print Sched_test $CurrentData;
+#}
+#print Sched_test @sort_Data;
+#close(Sched_test);
+close(Sched_test1);
+
+sub hex_add{
+	my($ADDR,$Len)=@_;
+	$data=hex($ADDR);
+	$data=$data+$Len-1;
+	return(sprintf("%04x",$data));
+}
\ No newline at end of file
Index: util/transform_name2addr.pl
===================================================================
--- /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/transform_name2addr.pl	(nonexistent)
+++ /1306ac/branch/mouse/branch/YJX_Project/Only_2.4G_YJX_1214/util/transform_name2addr.pl	(working copy)
@@ -0,0 +1,107 @@
+###########################
+#该脚本的功能为：将文件中的寄存器名字改成寄存器地址
+#两者之间的映射关系为$Memmap_path文件中的映射表
+
+$Sched_path=$ARGV[0];
+$Sched_test_path=$ARGV[1];
+$Memmap_path=$ARGV[2];
+open(Sched,$Sched_path)||die("Cannot open files\n");
+@sched=<Sched>;
+close(Sched);
+open(Sched_test,">$Sched_test_path");
+print Sched_test ("");
+close(Sched_test);
+open(Sched_test,">$Sched_test_path");
+open(Memmap,$Memmap_path)||die("Cannot open files\n");
+@memmap=<Memmap>;
+close(Memmap);
+$type_add=0;
+$type_exchange=0;
+foreach $sched(@sched)
+{
+	$sched_begin = $sched;
+	@Sched = split(/[#]+/, $sched);
+	$sched = @Sched[0];
+	@Sched[0] = "";
+	if($sched =~ /mem[\w]+/)
+	{
+		@memmap_name = split(/[\W]+/, $sched);
+		foreach $memmap_name(@memmap_name)
+		{
+			if($memmap_name =~ /mem[\w]+/)
+			{
+				$Memmap_name=$memmap_name;
+				$type_add = 0;
+				$type_exchange = 0;
+				if($sched =~ /$Memmap_name[+]/)
+				{
+					$type_add = 1;#修改的类型第一种，加
+					@ADD_Num=split(/[^0-9\+xa-fA-F]/,$sched);
+					foreach $ADD_Num(@ADD_Num)
+					{
+						if($ADD_Num =~ /\+/)
+						{
+							if($ADD_Num =~ /0x/)
+							{
+								@add_num = split(/\+0x/,$ADD_Num);
+								$add_num1 =@add_num[1];
+								$add_num_begin = "0x".$add_num1;
+								$add_num = hex($add_num1);
+							}
+							else
+							{
+								@add_num = split(/\+/,$ADD_Num);
+								$add_num1 =@add_num[1];
+								$add_num_begin = $add_num1;
+								$add_num = int($add_num1);
+							}
+						}#$add_num是匹配出的需要加的数值，字符串形式
+					}
+				}
+				if($sched =~ /[:] *\t*$Memmap_name/)
+				{
+					$type_exchange = 1;#修改的类型第二种，高低位交换
+				}
+				foreach $memmap(@memmap)
+				{
+					if($memmap =~ /$Memmap_name/ && $memmap !~ /$Memmap_name[\w]+/)
+					{
+						@Memmap=split(/[ \t\n]/,$memmap);
+						$memmap_address=@Memmap[0];
+						$memmap_address =~ s/0x//;
+						if($type_add==1)
+						{
+							$memmap_address_D = hex($memmap_address);
+							$memmap_address_D = $memmap_address_D+$add_num;
+							$memmap_address_H = sprintf("%x", $memmap_address_D);
+							$memmap_address = $memmap_address_H;
+							$memmap_address_add_finish = $memmap_address;
+							$sched_begin =~ s/$Memmap_name\+$add_num_begin/$memmap_address/;
+						}
+						if($type_exchange==1)
+						{
+							$memmap_address_High = substr($memmap_address,0,2);
+							$memmap_address_Low = substr($memmap_address,2,2);
+							$memmap_address = $memmap_address_Low." ".$memmap_address_High;
+							if($type_add==0)
+							{
+								$sched_begin =~ s/$Memmap_name/$memmap_address/;
+							}
+							else
+							{
+								$sched_begin =~ s/$memmap_address_add_finish/$memmap_address/;
+							}
+						}
+					}
+				}
+				$sched_begin =~ s/$Memmap_name/$memmap_address/;
+			}
+		}
+		printf Sched_test ("%s",$sched_begin);
+	}
+	else
+	{
+		printf Sched_test ("%s",$sched_begin);
+	}	
+}
+close(Sched_test);
