LED board improvements and cleanup

This commit is contained in:
2023-11-25 23:00:05 +01:00
parent d86baab852
commit 8b1d0cfefa
30 changed files with 1610 additions and 1379 deletions

View File

@ -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;