70 lines
1.5 KiB
C
70 lines
1.5 KiB
C
|
|
/*
|
||
|
|
* Copyright (c) Quaming Intelligent Technology Co., Ltd.
|
||
|
|
* (C) Copyright All Rights Reserved.
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
/**
|
||
|
|
* @file demoapp.c
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
|
||
|
|
/*********************
|
||
|
|
* INCLUDES
|
||
|
|
*********************/
|
||
|
|
#include "xos_app_conf.h"
|
||
|
|
|
||
|
|
#ifdef CONFIG_XOS_USE_APP_DEMOAPP
|
||
|
|
|
||
|
|
#include <stdio.h>
|
||
|
|
#include <string.h>
|
||
|
|
#include <stdlib.h>
|
||
|
|
#include "back_button.h"
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
extern void demo_app_launcher_init(void);
|
||
|
|
extern void demo_app_demo_init(void);
|
||
|
|
|
||
|
|
#ifdef CONFIG_XOS_FWK_APPMANAGER
|
||
|
|
#include "appcommon.h"
|
||
|
|
#include "appmanager.h"
|
||
|
|
|
||
|
|
static void* demo_app_main_create(void* intent) {
|
||
|
|
(void)intent;
|
||
|
|
LV_LOG_USER("%s e", __func__);
|
||
|
|
// xos_demo_app_entry();
|
||
|
|
app_manager_start("demoapplauncher", NULL);
|
||
|
|
LV_LOG_USER("%s x", __func__);
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
|
||
|
|
static void* demo_app_main_destroy(void* param) {
|
||
|
|
LV_LOG_USER("%s e", __func__);
|
||
|
|
// xos_demo_app_exit();
|
||
|
|
LV_LOG_USER("%s x", __func__);
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
|
||
|
|
static void demo_app_main_init(void) {
|
||
|
|
LV_LOG_USER("%s e", __func__);
|
||
|
|
qua_app_ops *ops = malloc(sizeof(qua_app_ops));
|
||
|
|
if (ops) {
|
||
|
|
memset(ops, 0x0, sizeof(qua_app_ops));
|
||
|
|
ops->on_create = demo_app_main_create;
|
||
|
|
ops->on_destory= demo_app_main_destroy;
|
||
|
|
app_manager_register("demoapp", ops);
|
||
|
|
free(ops);
|
||
|
|
}
|
||
|
|
LV_LOG_USER("%s x", __func__);
|
||
|
|
}
|
||
|
|
|
||
|
|
void demoapp_init(void) {
|
||
|
|
demo_app_main_init();
|
||
|
|
demo_app_launcher_init();
|
||
|
|
demo_app_demo_init();
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif /*CONFIG_XOS_FWK_APPMANAGER*/
|
||
|
|
|
||
|
|
#endif /*CONFIG_XOS_USE_APP_DEMOAPP*/
|