| 32 | #define debug(x...) if (verbose) printf(x) |
| 33 | |
| 34 | int send_ec_command(uint8_t command) |
| 35 | { |
| 36 | int timeout; |
| 37 | |
| 38 | timeout = 0x7ff; |
| 39 | while ((inb(ec_sc) & EC_IBF) && --timeout) { |
| 40 | usleep(10); |
| 41 | if ((timeout & 0xff) == 0) |
| 42 | debug("."); |
| 43 | } |
| 44 | if (!timeout) { |
| 45 | debug("Timeout while sending command 0x%02x to EC!\n", |
| 46 | command); |
| 47 | // return -1; |
| 48 | } |
| 49 | |
| 50 | outb(command, ec_sc); |
| 51 | return 0; |
| 52 | } |
| 53 | |
| 54 | int send_ec_data(uint8_t data) |
| 55 | { |
no test coverage detected