Apply clang-format
This commit is contained in:
@@ -34,8 +34,7 @@
|
|||||||
#include <86box/fifo.h>
|
#include <86box/fifo.h>
|
||||||
#include <86box/video.h> /* Needed to account for overscan. */
|
#include <86box/video.h> /* Needed to account for overscan. */
|
||||||
|
|
||||||
enum mtouch_modes
|
enum mtouch_modes {
|
||||||
{
|
|
||||||
MODE_TABLET = 1,
|
MODE_TABLET = 1,
|
||||||
MODE_RAW = 2
|
MODE_RAW = 2
|
||||||
};
|
};
|
||||||
@@ -58,7 +57,8 @@ typedef struct mouse_microtouch_t {
|
|||||||
|
|
||||||
static mouse_microtouch_t *mtouch_inst = NULL;
|
static mouse_microtouch_t *mtouch_inst = NULL;
|
||||||
|
|
||||||
void microtouch_reset_complete(void *priv)
|
void
|
||||||
|
microtouch_reset_complete(void *priv)
|
||||||
{
|
{
|
||||||
mouse_microtouch_t *mtouch = (mouse_microtouch_t *) priv;
|
mouse_microtouch_t *mtouch = (mouse_microtouch_t *) priv;
|
||||||
|
|
||||||
@@ -67,7 +67,8 @@ void microtouch_reset_complete(void *priv)
|
|||||||
fifo8_push_all(&mtouch->resp, (uint8_t *) "0\r", 2);
|
fifo8_push_all(&mtouch->resp, (uint8_t *) "0\r", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void microtouch_calibrate_timer(void *priv)
|
void
|
||||||
|
microtouch_calibrate_timer(void *priv)
|
||||||
{
|
{
|
||||||
mouse_microtouch_t *mtouch = (mouse_microtouch_t *) priv;
|
mouse_microtouch_t *mtouch = (mouse_microtouch_t *) priv;
|
||||||
|
|
||||||
@@ -78,7 +79,8 @@ void microtouch_calibrate_timer(void *priv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void microtouch_process_commands(mouse_microtouch_t* mtouch)
|
void
|
||||||
|
microtouch_process_commands(mouse_microtouch_t *mtouch)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
mtouch->cmd[strcspn(mtouch->cmd, "\r")] = '\0';
|
mtouch->cmd[strcspn(mtouch->cmd, "\r")] = '\0';
|
||||||
@@ -147,7 +149,8 @@ void microtouch_process_commands(mouse_microtouch_t* mtouch)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mtouch_write_to_host(void *priv)
|
void
|
||||||
|
mtouch_write_to_host(void *priv)
|
||||||
{
|
{
|
||||||
mouse_microtouch_t *dev = (mouse_microtouch_t *) priv;
|
mouse_microtouch_t *dev = (mouse_microtouch_t *) priv;
|
||||||
if ((dev->serial->type >= SERIAL_16550) && dev->serial->fifo_enabled) {
|
if ((dev->serial->type >= SERIAL_16550) && dev->serial->fifo_enabled) {
|
||||||
@@ -171,7 +174,8 @@ no_write_to_machine:
|
|||||||
timer_on_auto(&dev->host_to_serial_timer, (1000000.0 / (double) 9600.0) * (double) (1 + 8 + 1));
|
timer_on_auto(&dev->host_to_serial_timer, (1000000.0 / (double) 9600.0) * (double) (1 + 8 + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void mtouch_write(serial_t* serial, void* priv, uint8_t data)
|
void
|
||||||
|
mtouch_write(serial_t *serial, void *priv, uint8_t data)
|
||||||
{
|
{
|
||||||
mouse_microtouch_t *dev = (mouse_microtouch_t *) priv;
|
mouse_microtouch_t *dev = (mouse_microtouch_t *) priv;
|
||||||
if (data == '\x1') {
|
if (data == '\x1') {
|
||||||
@@ -270,12 +274,14 @@ mtouch_poll(void *priv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mtouch_poll_global(void)
|
static void
|
||||||
|
mtouch_poll_global(void)
|
||||||
{
|
{
|
||||||
mtouch_poll(mtouch_inst);
|
mtouch_poll(mtouch_inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* mtouch_init(const device_t* info)
|
void *
|
||||||
|
mtouch_init(const device_t *info)
|
||||||
{
|
{
|
||||||
mouse_microtouch_t *dev = calloc(1, sizeof(mouse_microtouch_t));
|
mouse_microtouch_t *dev = calloc(1, sizeof(mouse_microtouch_t));
|
||||||
|
|
||||||
@@ -294,7 +300,8 @@ void* mtouch_init(const device_t* info)
|
|||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mtouch_close(void* priv)
|
void
|
||||||
|
mtouch_close(void *priv)
|
||||||
{
|
{
|
||||||
mouse_microtouch_t *dev = (mouse_microtouch_t *) priv;
|
mouse_microtouch_t *dev = (mouse_microtouch_t *) priv;
|
||||||
|
|
||||||
@@ -342,4 +349,3 @@ const device_t mouse_mtouch_device = {
|
|||||||
.force_redraw = NULL,
|
.force_redraw = NULL,
|
||||||
.config = mtouch_config
|
.config = mtouch_config
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user