swdc: minor improvements

This commit is contained in:
Dniel97 2024-09-30 23:17:37 +02:00
parent 259b763a13
commit 5f817c8a36
Signed by untrusted user: Dniel97
GPG Key ID: 6180B3C768FB2E08
3 changed files with 17 additions and 13 deletions

View File

@ -30,7 +30,7 @@ void led15070_config_load(struct led15070_config *cfg, const wchar_t *filename)
GetPrivateProfileStringW( GetPrivateProfileStringW(
L"led15070", L"led15070",
L"boardNumber", L"boardNumber",
L"15070-02", L"15070-04",
tmpstr, tmpstr,
_countof(tmpstr), _countof(tmpstr),
filename); filename);
@ -66,6 +66,14 @@ void swdc_dll_config_load(
filename); filename);
} }
void zinput_config_load(struct zinput_config *cfg, const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
cfg->enable = GetPrivateProfileIntW(L"zinput", L"enable", 1, filename);
}
void swdc_hook_config_load( void swdc_hook_config_load(
struct swdc_hook_config *cfg, struct swdc_hook_config *cfg,
const wchar_t *filename) const wchar_t *filename)
@ -79,14 +87,7 @@ void swdc_hook_config_load(
zinput_config_load(&cfg->zinput, filename); zinput_config_load(&cfg->zinput, filename);
dvd_config_load(&cfg->dvd, filename); dvd_config_load(&cfg->dvd, filename);
io4_config_load(&cfg->io4, filename); io4_config_load(&cfg->io4, filename);
vfd_config_load(&cfg->vfd, filename); ffb_config_load(&cfg->ffb, filename);
led15070_config_load(&cfg->led15070, filename); led15070_config_load(&cfg->led15070, filename);
} vfd_config_load(&cfg->vfd, filename);
void zinput_config_load(struct zinput_config *cfg, const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
cfg->enable = GetPrivateProfileIntW(L"zinput", L"enable", 1, filename);
} }

View File

@ -8,8 +8,8 @@
WITH WITH
838-15416 Indicator BD LED Board 838-15416 Indicator BD LED Board
COM1: 838-15069 MOTOR DRIVE BD RS232/422 board COM1: 838-15069 MOTOR DRIVE BD RS232/422 board
COM2: 837-15396 "Gen 3" Aime reader COM2: 837-15070-04 IC BD LED controller board
COM3: 837-15070-04 IC BD LED controller board COM3: 837-15396 "Gen 3" Aime reader
COM4: 200-6275 VFD GP1232A02A FUTABA board COM4: 200-6275 VFD GP1232A02A FUTABA board
*/ */
@ -97,7 +97,8 @@ static DWORD CALLBACK swdc_pre_startup(void)
if (FAILED(hr)) { if (FAILED(hr)) {
goto fail; goto fail;
} }
/* Not working, different board -04 instead of -02? */
hr = led15070_hook_init(&swdc_hook_cfg.led15070, swdc_dll.led_init, hr = led15070_hook_init(&swdc_hook_cfg.led15070, swdc_dll.led_init,
swdc_dll.led_set_fet_output, NULL, swdc_dll.led_gs_update, 2, 1); swdc_dll.led_set_fet_output, NULL, swdc_dll.led_gs_update, 2, 1);

View File

@ -177,6 +177,8 @@ static HRESULT swdc_io4_poll(void *ctx, struct io4_state *state) {
static HRESULT swdc_io4_write_gpio(uint8_t* payload, size_t len) static HRESULT swdc_io4_write_gpio(uint8_t* payload, size_t len)
{ {
assert(swdc_dll.led_set_leds != NULL);
// Just fast fail if there aren't enough bytes in the payload // Just fast fail if there aren't enough bytes in the payload
if (len < 3) if (len < 3)
return S_OK; return S_OK;