Project

General

Profile

Revision 88

bye ret

View differences:

lab4.c
36 36
}
37 37

  
38 38
int (mouse_test_packet)(uint32_t cnt) {
39
    int ret = 0;
40 39
    /// loop stuff
41 40
    int ipc_status, r;
42 41
    message msg;
......
47 46

  
48 47
    if (subscribe_mouse_interrupt(mouse_irq_bit, &mouse_id)) return 1; // subscribes mouse interrupts in exclusive mode
49 48
    if (sys_irqdisable(&mouse_id)) return 1; // temporarily disables our interrupts notifications
50
    if ((ret = mouse_set_data_report(true))) return ret; // enables mouse data reporting
49
    if (mouse_set_data_report(true)) return 1; // enables mouse data reporting
51 50
    if (sys_irqenable(&mouse_id)) return 1; // re-enables our interrupts notifications
52 51

  
53 52
    /// cycle
......
87 86
}
88 87

  
89 88
int (mouse_test_remote)(uint16_t period, uint8_t cnt) {
90
    int ret;
91
    //if ((ret = mouse_issue_cmd(SET_REMOTE_MD))) return ret;
92
    //if ((ret = mouse_set_data_report(true))) return ret;
89
    //if (mouse_issue_cmd(SET_REMOTE_MD)) return 1;
90
    //if (mouse_set_data_report(true)) return 1;
93 91

  
94 92
    struct packet pp;
95 93
    while(cnt--){
......
98 96
        tickdelay(micros_to_ticks(period*1000));
99 97
    }
100 98
    // Set Stream mode
101
    if ((ret = mouse_issue_cmd(SET_STREAM_MD))) return ret;
99
    if (mouse_issue_cmd(SET_STREAM_MD)) return 1;
102 100
    // Disable data reporting
103
    if ((ret = mouse_set_data_report(false))) return ret;
101
    if (mouse_set_data_report(false)) return 1;
104 102
    uint8_t cmd_byte = minix_get_dflt_kbc_cmd_byte();
105
    if ((ret = kbc_change_cmd(cmd_byte))) return ret;
103
    if (kbc_change_cmd(cmd_byte)) return 1;
106 104

  
107 105
    return SUCCESS;
108 106
}
......
175 173
}
176 174

  
177 175
int (mouse_test_gesture)(uint8_t x_len, uint8_t tolerance) {
178
    int ret;
179 176
    /// loop stuff
180 177
    int ipc_status, r;
181 178
    message msg;
......
186 183

  
187 184
    if (subscribe_mouse_interrupt(mouse_irq_bit, &mouse_id)) return 1; // subscribes mouse interrupts in exclusive mode
188 185
    if (sys_irqdisable(&mouse_id)) return 1; // temporarily disables our interrupts notifications
189
    if ((ret = mouse_set_data_report(true))) return ret; // enables mouse data reporting
186
    if (mouse_set_data_report(true)) return 1; // enables mouse data reporting
190 187
    if (sys_irqenable(&mouse_id)) return 1; // re-enables our interrupts notifications
191 188

  
192 189
    /// cycle

Also available in: Unified diff