2019-11-29 02:05:30 -07:00
|
|
|
#include <stdlib.h>
|
2019-12-01 19:39:14 -07:00
|
|
|
#include <string.h>
|
2019-12-06 20:57:44 -07:00
|
|
|
#include <unistd.h>
|
2019-12-05 18:21:37 -07:00
|
|
|
#include "scode.h"
|
2019-12-06 22:06:05 -07:00
|
|
|
#include "config.h"
|
2019-11-29 02:05:30 -07:00
|
|
|
#include "gpio.h"
|
|
|
|
#include "log.h"
|
2019-12-01 18:53:54 -07:00
|
|
|
#include "fbinit.h"
|
2019-12-06 23:26:13 -07:00
|
|
|
#include "fbprimitive.h"
|
2019-12-07 23:37:21 -07:00
|
|
|
#include "fontengine.h"
|
2019-12-01 01:02:08 -07:00
|
|
|
#include "time_func.h"
|
2019-12-07 19:43:45 -07:00
|
|
|
#include "ep_init.h"
|
2019-12-01 01:02:08 -07:00
|
|
|
#include "sysinput.h"
|
2019-11-29 02:05:30 -07:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2019-12-06 22:37:20 -07:00
|
|
|
HRESULT hr;
|
2019-12-01 01:40:28 -07:00
|
|
|
int running = 1;
|
2019-12-01 01:02:08 -07:00
|
|
|
MSG msg;
|
2019-12-06 22:06:05 -07:00
|
|
|
|
2019-12-07 13:07:59 -07:00
|
|
|
/* initialization sequence */
|
2019-12-01 15:43:05 -07:00
|
|
|
Time_init();
|
2019-12-06 22:37:20 -07:00
|
|
|
hr = Config_setup(argc, argv);
|
|
|
|
if (FAILED(hr))
|
2019-12-06 22:06:05 -07:00
|
|
|
return EXIT_FAILURE;
|
2019-12-06 22:37:20 -07:00
|
|
|
else if (hr != S_OK)
|
|
|
|
return EXIT_SUCCESS;
|
2019-12-05 18:21:37 -07:00
|
|
|
if (FAILED(Fb_setup()))
|
2019-12-01 18:53:54 -07:00
|
|
|
return EXIT_FAILURE;
|
2019-12-07 23:30:05 -07:00
|
|
|
if (FAILED(FontEng_setup()))
|
|
|
|
return EXIT_FAILURE;
|
2019-12-05 18:21:37 -07:00
|
|
|
if (FAILED(Gpio_setup()))
|
2019-11-29 02:05:30 -07:00
|
|
|
return EXIT_FAILURE;
|
2019-12-07 19:43:45 -07:00
|
|
|
if (FAILED(Epython_setup()))
|
|
|
|
return EXIT_FAILURE;
|
2019-12-05 18:21:37 -07:00
|
|
|
if (FAILED(Sys_enable_input()))
|
2019-12-01 01:02:08 -07:00
|
|
|
return EXIT_FAILURE;
|
2019-12-06 20:57:44 -07:00
|
|
|
Log(LINFO, "Pausing at startup.");
|
2019-12-07 19:43:45 -07:00
|
|
|
sleep(2); /* wait to show off splash screen */
|
2019-11-29 02:05:30 -07:00
|
|
|
|
2019-12-06 20:57:44 -07:00
|
|
|
Fb_clear();
|
2019-12-07 22:05:31 -07:00
|
|
|
if (FAILED(Epython_run()))
|
|
|
|
return EXIT_FAILURE;
|
2019-12-01 20:57:36 -07:00
|
|
|
|
2019-12-09 13:29:37 -07:00
|
|
|
Log(LINFO, "Script returned with exit code %d", Sys_Exit_Code);
|
|
|
|
return Sys_Exit_Code;
|
2019-11-29 02:05:30 -07:00
|
|
|
}
|