bbcr compiling now
This commit is contained in:
parent
37c23e1b62
commit
9dfba70c89
12 changed files with 261 additions and 211 deletions
87
main.c
87
main.c
|
|
@ -5,76 +5,15 @@
|
|||
#include "output_dev.h"
|
||||
#include "dev_in.h"
|
||||
#include "dev_out.h"
|
||||
#include "logic.h"
|
||||
#include "rog_ally.h"
|
||||
|
||||
/*
|
||||
logic_t global_logic;
|
||||
|
||||
static output_dev_t out_gamepadd_dev = {
|
||||
.logic = &global_logic,
|
||||
};
|
||||
|
||||
static input_dev_t in_iio_dev = {
|
||||
.dev_type = input_dev_type_iio,
|
||||
.filters = {
|
||||
.iio = {
|
||||
.name = "bmi323",
|
||||
}
|
||||
},
|
||||
//.logic = &global_logic,
|
||||
//.input_filter_fn = input_filter_imu_identity,
|
||||
};
|
||||
|
||||
static input_dev_t in_asus_kb_1_dev = {
|
||||
.dev_type = input_dev_type_uinput,
|
||||
.filters = {
|
||||
.ev = {
|
||||
.name = "Asus Keyboard"
|
||||
}
|
||||
},
|
||||
//.logic = &global_logic,
|
||||
//.ev_input_filter_fn = input_filter_asus_kb,
|
||||
};
|
||||
|
||||
static input_dev_t in_asus_kb_2_dev = {
|
||||
.dev_type = input_dev_type_uinput,
|
||||
.filters = {
|
||||
.ev = {
|
||||
.name = "Asus Keyboard"
|
||||
}
|
||||
},
|
||||
//.logic = &global_logic,
|
||||
//.ev_input_filter_fn = input_filter_asus_kb,
|
||||
};
|
||||
|
||||
static input_dev_t in_asus_kb_3_dev = {
|
||||
.dev_type = input_dev_type_uinput,
|
||||
.filters = {
|
||||
.ev = {
|
||||
.name = "Asus Keyboard"
|
||||
}
|
||||
},
|
||||
//.logic = &global_logic,
|
||||
//.ev_input_filter_fn = input_filter_asus_kb,
|
||||
};
|
||||
|
||||
static uinput_filters_t in_xbox_filters = {
|
||||
.name = "Microsoft X-Box 360 pad",
|
||||
};
|
||||
|
||||
static input_dev_t in_xbox_dev = {
|
||||
.dev_type = input_dev_type_uinput,
|
||||
.filters = {
|
||||
.ev = {
|
||||
.name = "Microsoft X-Box 360 pad"
|
||||
}
|
||||
},
|
||||
//.logic = &global_logic,
|
||||
//.ev_input_filter_fn = input_filter_asus_kb,
|
||||
};
|
||||
|
||||
dev_in_data_t dev_in_thread_data;
|
||||
dev_out_data_t dev_out_thread_data;
|
||||
|
||||
void sig_handler(int signo)
|
||||
{
|
||||
if (signo == SIGINT) {
|
||||
|
|
@ -82,23 +21,23 @@ void sig_handler(int signo)
|
|||
printf("Received SIGINT\n");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
dev_in_data_t dev_in_thread_data;
|
||||
dev_out_data_t dev_out_thread_data;
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
int ret = 0;
|
||||
|
||||
/*
|
||||
const int logic_creation_res = logic_create(&global_logic);
|
||||
if (logic_creation_res < 0) {
|
||||
fprintf(stderr, "Unable to create logic: %d", logic_creation_res);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
input_dev_t *in_devs[] = {
|
||||
&in_xbox_dev,
|
||||
&in_iio_dev,
|
||||
&in_asus_kb_1_dev,
|
||||
&in_asus_kb_2_dev,
|
||||
&in_asus_kb_3_dev,
|
||||
};
|
||||
*/
|
||||
input_dev_t **in_devs = rog_ally_device_def();
|
||||
const size_t in_devs_sz = rog_ally_device_def_count();
|
||||
|
||||
int out_message_pipes[2];
|
||||
pipe(out_message_pipes);
|
||||
|
|
@ -111,7 +50,7 @@ int main(int argc, char ** argv) {
|
|||
dev_in_thread_data.in_message_pipe_fd = in_message_pipes[1];
|
||||
dev_in_thread_data.out_message_pipe_fd = out_message_pipes[0];
|
||||
dev_in_thread_data.input_dev_decl = *in_devs;
|
||||
dev_in_thread_data.input_dev_cnt = sizeof(in_devs) / sizeof(input_dev_t *);
|
||||
dev_in_thread_data.input_dev_cnt = in_devs_sz;
|
||||
|
||||
// populate the output device thread data
|
||||
//dev_out_thread_data.timeout_ms = 400;
|
||||
|
|
@ -123,7 +62,7 @@ int main(int argc, char ** argv) {
|
|||
if (dev_in_thread_creation != 0) {
|
||||
fprintf(stderr, "Error creating dev_in thread: %d\n", dev_in_thread_creation);
|
||||
ret = -1;
|
||||
logic_request_termination(&global_logic);
|
||||
//logic_request_termination(&global_logic);
|
||||
goto main_err;
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +71,7 @@ int main(int argc, char ** argv) {
|
|||
if (dev_out_thread_creation != 0) {
|
||||
fprintf(stderr, "Error creating dev_out thread: %d\n", dev_out_thread_creation);
|
||||
ret = -1;
|
||||
logic_request_termination(&global_logic);
|
||||
//logic_request_termination(&global_logic);
|
||||
goto main_err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue