This commit is contained in:
fancy 2023-11-20 06:48:53 -08:00
parent a9cc7abe6b
commit 99004e8a6f
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,11 @@
#include "ILog.h" #include "ILog.h"
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
StatusCode HalInit(IHal *hal)
{
LogInfo("Hal init.\n");
return CreateStatusCode(STATUS_CODE_OK);
}
static void HalFree(void *object) static void HalFree(void *object)
{ {
LogInfo("hal instance free.\n"); LogInfo("hal instance free.\n");
@ -27,6 +32,7 @@ void HalImplInit(Hal *hal)
{ {
LogInfo("HalImplInit\n"); LogInfo("HalImplInit\n");
NewIHal((IHal **)&hal); NewIHal((IHal **)&hal);
((IHal *)hal)->init = HalInit;
((IHal *)hal)->free = HalFree; ((IHal *)hal)->free = HalFree;
} }
StatusCode NewHal(Hal **hal) StatusCode NewHal(Hal **hal)

View File

@ -26,6 +26,7 @@ typedef struct hal
} Hal; } Hal;
StatusCode NewHal(Hal **hal); StatusCode NewHal(Hal **hal);
void HalImplInit(Hal *hal); void HalImplInit(Hal *hal);
StatusCode HalInit(IHal *hal);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif