forked from TeamTofuShop/segatools
LED board improvements and cleanup
This commit is contained in:
@ -121,7 +121,7 @@ static const struct hook_symbol reg_syms[] = {
|
||||
static HANDLE ftdi_fd;
|
||||
static char port_name[8];
|
||||
|
||||
HRESULT ftdi_hook_init(const struct ftdi_config *cfg) {
|
||||
HRESULT ftdi_hook_init(const struct ftdi_config *cfg, unsigned int port_no) {
|
||||
HRESULT hr;
|
||||
|
||||
assert(cfg != NULL);
|
||||
@ -130,6 +130,10 @@ HRESULT ftdi_hook_init(const struct ftdi_config *cfg) {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
if (cfg->port_no != 0) {
|
||||
port_no = cfg->port_no;
|
||||
}
|
||||
|
||||
hook_table_apply(
|
||||
NULL,
|
||||
"setupapi.dll",
|
||||
@ -156,7 +160,7 @@ HRESULT ftdi_hook_init(const struct ftdi_config *cfg) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
sprintf(port_name, "COM%d", cfg->port_no);
|
||||
sprintf(port_name, "COM%d", port_no);
|
||||
|
||||
dprintf("FTDI: Hook enabled.\n");
|
||||
return S_OK;
|
||||
|
Reference in New Issue
Block a user