Pages: [1]   Go Down
  Print  
Author Topic: IXUS950/SD850 1.00C fixed touchwheel overwriting OSD  (Read 1112 times)
0 Members and 1 Guest are viewing this topic.
whoever
Sr. Member
****
Offline Offline

Posts: 259

IXUS950


« on: 28 / July / 2008, 11:44:00 »

I sort of grew used to unsteady OSD menus, taking their flickering as natural. But is it natural? Of course not, as mil22 reminded us recently. Inspired by mil22 and cail, here's a quick fix to tame the touchwheel task TouchW and get perfectly steady menus and smooth navigation. The necessary tools, taskNameToId(), taskSuspend(), and taskResume(), are provided by VxWorks. The last two have been known since long; the first has to be identified by hand in stubs_entry_2.S:
Code:
NHSTUB(taskNameToId, 0xFF935A64)

Then, in platform\ixus950_sd850\kbd.c:
Code:
void my_kbd_read_keys()
{
    kbd_prev_state[0] = kbd_new_state[0];
    kbd_prev_state[1] = kbd_new_state[1];
    kbd_prev_state[2] = kbd_new_state[2];
    _kbd_pwr_on();
    kbd_fetch_data(kbd_new_state);

///////////// ADD THIS: /////////////
    static int handle_taskTouchW = 0, isRunning_taskTouchW = 1;
    extern int _taskNameToId(void*);
    extern void _taskSuspend(int), _taskResume(int);
    if (handle_taskTouchW == 0) { handle_taskTouchW = _taskNameToId("tTouchW"); }
////////////////////////////////////////

    if (kbd_process() == 0){
// leave it alone...
physw_status[0] = kbd_new_state[0];
physw_status[1] = kbd_new_state[1];
physw_status[2] = kbd_new_state[2];
//physw_status[1] |= alt_mode_key_mask;

///////////// ADD THIS: /////////////
if (!isRunning_taskTouchW) { _taskResume(handle_taskTouchW); isRunning_taskTouchW = 1; }
////////////////////////////////////////

    } else {
      // override keys
        physw_status[0] = (kbd_new_state[0] & (~KEYS_MASK0)) |
              (kbd_mod_state[0] & KEYS_MASK0);
        physw_status[1] = (kbd_new_state[1] & (~KEYS_MASK1)) |
              (kbd_mod_state[1] & KEYS_MASK1);
        physw_status[2] = (kbd_new_state[2] & (~KEYS_MASK2)) |
              (kbd_mod_state[2] & KEYS_MASK2);

///////////// ADD THIS: /////////////
if (isRunning_taskTouchW && !state_kbd_script_run)
{ _taskSuspend(handle_taskTouchW); isRunning_taskTouchW = 0; }
else if (!isRunning_taskTouchW && state_kbd_script_run)
{ _taskResume(handle_taskTouchW); isRunning_taskTouchW = 1; }
////////////////////////////////////////

    }

    _kbd_read_keys_r2(physw_status);

if (conf.remote_enable) {
remote_key = (physw_status[USB_REG] & USB_MASK)==USB_MASK;
if (remote_key)
remote_count += 1;
else if (remote_count) {
usb_power = remote_count;
remote_count = 0;
}
physw_status[USB_REG] = physw_status[USB_REG] & ~USB_MASK;
}

    physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG;

    _kbd_pwr_off();
}

This suspends the wheel task in ALT-mode unless a script is running that might need to emulate navigation keys.

Attached are precompiled binaries, should anybody wish to try it out.

* DISKBOOT.BIN (146.18 KB - downloaded 8 times.)
* ixus950_sd850-100c.FIR (146.91 KB - downloaded 8 times.)
Logged
PhyrePhoX
Global Moderator
Guru Member
*****
Offline Offline

Posts: 2265


make RAW not WAR


« Reply #1 on: 01 / August / 2008, 22:13:38 »

added into beta branch "collaborative chdk" as of now. Changeset 461 - chdk - Trac
can and probably will be added to trunk if no reports of crashes, bugs & the likes occur Wink
Logged

ewavr
Developers
Hero Member
****
Offline Offline

Posts: 1053

A710IS


« Reply #2 on: 01 / August / 2008, 23:31:08 »

I believe that it works  Smiley
Changeset 462 - chdk - Trac

BTW, similar code for IXUS65 don't contain code for resuming touchwheel task while script is running. Maybe this is bug?
« Last Edit: 01 / August / 2008, 23:40:42 by ewavr » Logged
Pages: [1]   Go Up
  Print  
 
Jump to: