Wire up libamex config

This commit is contained in:
Tau
2019-05-04 13:12:20 -04:00
parent 68ec23e3c8
commit c19d140589
18 changed files with 186 additions and 64 deletions

View File

@ -1,3 +1,5 @@
#include <windows.h>
#include "amex/amex.h"
#include "amex/ds.h"
#include "amex/eeprom.h"
@ -5,11 +7,41 @@
#include "amex/jvs.h"
#include "amex/sram.h"
void amex_hook_init(void)
HRESULT amex_hook_init(const struct amex_config *cfg)
{
ds_hook_init();
eeprom_hook_init();
gpio_hook_init();
jvs_hook_init();
sram_hook_init();
HRESULT hr;
assert(cfg != NULL);
hr = ds_hook_init(&cfg->ds);
if (FAILED(hr)) {
return hr;
}
hr = eeprom_hook_init(&cfg->eeprom);
if (FAILED(hr)) {
return hr;
}
hr = gpio_hook_init(&cfg->gpio);
if (FAILED(hr)) {
return hr;
}
hr = jvs_hook_init(&cfg->jvs);
if (FAILED(hr)) {
return hr;
}
hr = sram_hook_init(&cfg->sram);
if (FAILED(hr)) {
return hr;
}
return S_OK;
}