tied resource initialization into the main control flow

This commit is contained in:
Amy G. Bowersox 2021-08-29 18:21:51 -06:00
parent 751c0674d1
commit 9348673adb
3 changed files with 8 additions and 5 deletions

View File

@ -1,12 +1,12 @@
/*
* UPIWIN - Micro Pi Windowing Framework Kernel
* Copyright (C) 2019 Amy Bowersox/Erbosoft Metaverse Design Solutions
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -25,6 +25,7 @@
#include "config.h"
#include "gpio.h"
#include "fbinit.h"
#include "resources.h"
#include "fontengine.h"
#include "time_func.h"
#include "ep_init.h"
@ -41,6 +42,8 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
else if (hr != S_OK)
return EXIT_SUCCESS;
if (FAILED(Rsrc_setup()))
return EXIT_FAILURE;
if (FAILED(Fb_setup()))
return EXIT_FAILURE;
if (FAILED(FontEng_setup()))
@ -57,7 +60,7 @@ int main(int argc, char *argv[])
Fb_clear();
if (FAILED(Epython_run()))
return EXIT_FAILURE;
Log(LINFO, "Script returned with exit code %d", Sys_Exit_Code);
return Sys_Exit_Code;
}

View File

@ -61,7 +61,7 @@ static void rsrc_cleanup(void)
sysresource = NULL;
}
HRESULT Rsrc_init(void)
HRESULT Rsrc_setup(void)
{
HRESULT hr = S_OK;
zip_source_t *syssource;

View File

@ -27,6 +27,6 @@ typedef HANDLE HRSRC; /* handle to resource */
extern HRESULT Rsrc_init(void);
extern HRESULT Rsrc_setup(void);
#endif /* __RESOURCES_H_INCLUDED */