* Fixed some of the weirdly changed define names.
* A few more style cleanups. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28429 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8d41d0ee72
commit
802b633082
@ -60,7 +60,8 @@ status_t ps2_wait_write(void);
|
||||
|
||||
void ps2_flush(void);
|
||||
|
||||
extern status_t ps2_command(uint8 cmd, const uint8 *out, int out_count, uint8 *in, int in_count);
|
||||
extern status_t ps2_command(uint8 cmd, const uint8 *out, int out_count,
|
||||
uint8 *in, int in_count);
|
||||
|
||||
// prototypes from keyboard.c & mouse.c
|
||||
extern status_t probe_keyboard(void);
|
||||
|
@ -16,15 +16,13 @@ typedef struct ps2_dev ps2_dev;
|
||||
#include "ps2_common.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
bigtime_t time;
|
||||
uint8 data;
|
||||
bool error;
|
||||
} data_history;
|
||||
|
||||
struct ps2_dev
|
||||
{
|
||||
struct ps2_dev {
|
||||
const char * name;
|
||||
bool active;
|
||||
uint8 idx;
|
||||
|
@ -107,13 +107,13 @@ ps2_packet_to_movement(standard_mouse_cookie *cookie, uint8 packet[],
|
||||
|
||||
cookie->buttons_state = buttons;
|
||||
|
||||
if (cookie->flags & F_pointing_dev_TYPE_INTELLIMOUSE) {
|
||||
if (cookie->flags & F_MOUSE_TYPE_INTELLIMOUSE) {
|
||||
yDeltaWheel = packet[3] & 0x07;
|
||||
if (packet[3] & 0x08)
|
||||
yDeltaWheel |= ~0x07;
|
||||
}
|
||||
/*
|
||||
if (cookie->flags & F_standard_mouse_TYPE_2WHEELS) {
|
||||
if (cookie->flags & F_MOUSE_TYPE_2WHEELS) {
|
||||
switch (packet[3] & 0x0F) {
|
||||
case 0x01: yDeltaWheel = +1; break; // wheel 1 down
|
||||
case 0x0F: yDeltaWheel = -1; break; // wheel 1 up
|
||||
@ -358,13 +358,13 @@ standard_mouse_open(const char *name, uint32 flags, void **_cookie)
|
||||
dev->handle_int = &standard_mouse_handle_int;
|
||||
|
||||
if (strstr(dev->name, "standard_mouse") != NULL)
|
||||
cookie->flags = F_pointing_dev_TYPE_STANDARD;
|
||||
cookie->flags = F_MOUSE_TYPE_STANDARD;
|
||||
|
||||
if (strstr(dev->name, "intelli_mouse") != NULL)
|
||||
cookie->flags = F_pointing_dev_TYPE_INTELLIMOUSE;
|
||||
cookie->flags = F_MOUSE_TYPE_INTELLIMOUSE;
|
||||
|
||||
cookie->standard_mouse_buffer
|
||||
= create_packet_buffer(standard_mouse_HISTORY_SIZE * dev->packet_size);
|
||||
= create_packet_buffer(MOUSE_HISTORY_SIZE * dev->packet_size);
|
||||
if (cookie->standard_mouse_buffer == NULL) {
|
||||
TRACE("ps2: can't allocate mouse actions buffer\n");
|
||||
goto err2;
|
||||
|
@ -12,18 +12,18 @@
|
||||
* Clemens Zeidler <czeidler@gmx.de>
|
||||
*/
|
||||
|
||||
#ifndef __PS2_STANDARD_standard_mouse_H
|
||||
#define __PS2_STANDARD_standard_mouse_H
|
||||
#ifndef __PS2_STANDARD_MOUSE_H
|
||||
#define __PS2_STANDARD_MOUSE_H
|
||||
|
||||
#include <Drivers.h>
|
||||
|
||||
#include "packet_buffer.h"
|
||||
|
||||
#define standard_mouse_HISTORY_SIZE 256
|
||||
#define MOUSE_HISTORY_SIZE 256
|
||||
// we record that many mouse packets before we start to drop them
|
||||
|
||||
#define F_pointing_dev_TYPE_STANDARD 0x1
|
||||
#define F_pointing_dev_TYPE_INTELLIMOUSE 0x2
|
||||
#define F_MOUSE_TYPE_STANDARD 0x1
|
||||
#define F_MOUSE_TYPE_INTELLIMOUSE 0x2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -56,5 +56,5 @@ void standard_mouse_disconnect(ps2_dev *dev);
|
||||
device_hooks gStandardMouseDeviceHooks;
|
||||
|
||||
|
||||
#endif /* __PS2_STANDARD_standard_mouse_H */
|
||||
#endif /* __PS2_STANDARD_MOUSE_H */
|
||||
|
||||
|
@ -539,7 +539,7 @@ synaptics_open(const char *name, uint32 flags, void **_cookie)
|
||||
dev->packet_size = PS2_PACKET_SYNAPTICS;
|
||||
|
||||
cookie->synaptics_ring_buffer
|
||||
= create_packet_buffer(synaptics_HISTORY_SIZE * dev->packet_size);
|
||||
= create_packet_buffer(SYNAPTICS_HISTORY_SIZE * dev->packet_size);
|
||||
if (cookie->synaptics_ring_buffer == NULL) {
|
||||
TRACE("ps2: can't allocate mouse actions buffer\n");
|
||||
goto err2;
|
||||
|
@ -38,14 +38,14 @@
|
||||
#define MIN_PRESSURE 30
|
||||
#define MAX_PRESSURE 200
|
||||
|
||||
#define synaptics_HISTORY_SIZE 256
|
||||
#define SYNAPTICS_HISTORY_SIZE 256
|
||||
|
||||
// no touchpad / left / right button pressed
|
||||
#define IS_SYN_PT_PACKAGE(val) ((val[0] & 0xFC) == 0x84 && (val[3] & 0xCC) == 0xc4)
|
||||
#define IS_SYN_PT_PACKAGE(val) ((val[0] & 0xFC) == 0x84 \
|
||||
&& (val[3] & 0xCC) == 0xc4)
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
uint8 majorVersion;
|
||||
uint8 minorVersion;
|
||||
|
||||
@ -59,8 +59,7 @@ typedef struct
|
||||
} touchpad_info;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
uint8 buttons;
|
||||
uint32 xPosition;
|
||||
uint32 yPosition;
|
||||
@ -105,11 +104,14 @@ status_t synaptics_pt_set_packagesize(ps2_dev *dev, uint8 size);
|
||||
status_t send_touchpad_arg(ps2_dev *dev, uint8 arg);
|
||||
status_t send_touchpad_arg_timeout(ps2_dev *dev, uint8 arg, bigtime_t timeout);
|
||||
status_t set_touchpad_mode(ps2_dev *dev, uint8 mode);
|
||||
status_t passthrough_command(ps2_dev *dev, uint8 cmd, const uint8 *out, int out_count, uint8 *in, int in_count, bigtime_t timeout);
|
||||
status_t passthrough_command(ps2_dev *dev, uint8 cmd, const uint8 *out,
|
||||
int out_count, uint8 *in, int in_count, bigtime_t timeout);
|
||||
|
||||
bool edge_motion(mouse_movement *movement, touch_event *event, bool validStart);
|
||||
status_t touchevent_to_movement(synaptics_cookie* cookie, touch_event *event, mouse_movement *movement);
|
||||
status_t get_synaptics_movment(synaptics_cookie* cookie, mouse_movement *movement);
|
||||
status_t touchevent_to_movement(synaptics_cookie* cookie, touch_event *event,
|
||||
mouse_movement *movement);
|
||||
status_t get_synaptics_movment(synaptics_cookie* cookie,
|
||||
mouse_movement *movement);
|
||||
void query_capability(ps2_dev *dev);
|
||||
status_t probe_synaptics(ps2_dev *dev);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user