2019-05-04 17:12:20 +00:00
|
|
|
#include <windows.h>
|
|
|
|
|
2019-05-04 16:04:38 +00:00
|
|
|
#include "amex/amex.h"
|
|
|
|
#include "amex/ds.h"
|
|
|
|
#include "amex/eeprom.h"
|
|
|
|
#include "amex/gpio.h"
|
|
|
|
#include "amex/jvs.h"
|
|
|
|
#include "amex/sram.h"
|
|
|
|
|
2019-09-01 15:40:25 +00:00
|
|
|
#include <assert.h>
|
|
|
|
|
2019-11-03 18:01:03 +00:00
|
|
|
HRESULT amex_hook_init(const struct amex_config *cfg, jvs_provider_t jvs)
|
2019-05-04 16:04:38 +00:00
|
|
|
{
|
2019-05-04 17:12:20 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2019-11-03 18:01:03 +00:00
|
|
|
hr = jvs_hook_init(&cfg->jvs, jvs);
|
2019-05-04 17:12:20 +00:00
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = sram_hook_init(&cfg->sram);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2019-05-04 16:04:38 +00:00
|
|
|
}
|