connect usb OTG and your PC ,turn on the USB connect of Setting . On PC Terminal clint "adb shell" .detail can see that webhttp://www.londatiga.net/it/how-to-use- ... line-tool/
under terminal
1.root@firefly:/ #adb shell [be into board shell]
2.root@firefly:/ # echo 1 > /sys/module/rk_pwm_remotectl/parameters/dbg_level" [open IR Code debug]
3.then you use your IR remote . press random key one time. then ,
root@firefly:/ # dmesg | grep "USERCODE="
find the "GET USERCODE=" and its tail is look like
"[ 772.156403] GET USERCODE=0xFF00" this is your IR usercode, mark down
4.after you mark down your usercode , begin to modify your Source Code .
you can read WIKI about how to configure IR Firefly-WIKI/IR_Configuration modify file kernel/drivers/input/remotectl/rk_pwm_remotectl.c
find out the location of this line "static struct rkxx_remotectl_button remotectl_button[] ="
add your IR usercode . look like under
Example: - static struct rkxx_remotectl_button remotectl_button[] =
- {
- + {
- + .usercode = 0xff00, /* need to get the usercode in next step */
- + .nbuttons = 12, /* number of buttons */
- + .key_table = &remote_key_table_myIR[0],
- + },
- #ifdef R66_REMOTE
Copy the code
5.when you done above step , save this code file and begin to make your SDK Kernel.img and burn kernel.img into your board.
repeat adb shell and open IR Code debug again. then begin to mark your keycode one by one .
Example:
press KEY_up ,then
root@firefly:/ # dmesg | grep "RMC_GETDATA="
"[ 772.156403] RMC_GETDATA="0xFCA2" /*this is your keycode , you can set this key function*/
one by one to press your key and mark down the keycode , and set function of the key below
- static struct rkxx_remote_key_table remote_key_table_myIR[12] = {
- {0xeb, KEY_POWER}, // Power
- // Control
- {0xa3, 250}, // Settings
- {0xec, KEY_MENU}, // Menu
- {0xfc, KEY_UP}, // Up --keycode above print
- {0xfd, KEY_DOWN}, // Down
- {0xf1, KEY_LEFT}, // Left
- {0xe5, KEY_RIGHT}, // Right
- {0xf8, KEY_REPLY}, // Ok
- {0xb7, KEY_HOME}, // Home
- {0xfe, KEY_BACK}, // Back
- // Vol
- {0xa7, KEY_VOLUMEDOWN}, // Vol-
- {0xf4, KEY_VOLUMEUP}, // Vol+
- };
Copy the code
make your kernel.img and burn into your board.
after you done this job , you will complate your IR Configuration .
Firefly_WIKI many thing you can use on this web.
happy to use your own IR.
|