Add common api file of lvgl.
This commit is contained in:
parent
ad18b96aa0
commit
177734f48f
|
@ -302,8 +302,7 @@ SRC += \
|
||||||
./SrcCode/lv_drivers/display/fbindex.c \
|
./SrcCode/lv_drivers/display/fbindex.c \
|
||||||
./SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPassword/UIFlowPassword.c \
|
./SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPassword/UIFlowPassword.c \
|
||||||
./SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPassword/UIFlowPasswordEventCallback.c \
|
./SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPassword/UIFlowPasswordEventCallback.c \
|
||||||
# ./SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPassword/UIFlowPasswordFuncs.c \
|
./SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowCommon/UIFlowCommon.c \
|
||||||
# ./SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPassword/UIFlowPasswordParams.c \
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
#include "UIFlowCommon.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
static unsigned short sf_4g_net_level_get(unsigned short simSignal)
|
||||||
|
{
|
||||||
|
if(simSignal <= 105)
|
||||||
|
{
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
else if(simSignal <= 115)
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned short sf_3g_net_level_get(unsigned short simSignal)
|
||||||
|
{
|
||||||
|
if (simSignal < 8)
|
||||||
|
return 2;
|
||||||
|
else if (simSignal < 14)
|
||||||
|
return 3;
|
||||||
|
else
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
int network_signal_level_get(short net,short signal,unsigned short* value)
|
||||||
|
{
|
||||||
|
if (NULL == value)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if(net == 4)
|
||||||
|
*value = sf_4g_net_level_get(signal);
|
||||||
|
else
|
||||||
|
*value = sf_3g_net_level_get(signal);
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
#ifndef UIFLOW_COMMON_H
|
||||||
|
#define UIFLOW_COMMON_H
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
int network_signal_level_get(short net, short signal, unsigned short *value);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif // !UIFLOW_COMMON_H
|
|
@ -216,7 +216,7 @@ void show_qr_picture_page(lv_obj_t* obj)
|
||||||
// const char *data = "https://github.com/topics/littlevgl";
|
// const char *data = "https://github.com/topics/littlevgl";
|
||||||
#define QR_DATA_LENGTH 1024
|
#define QR_DATA_LENGTH 1024
|
||||||
char qr_date[QR_DATA_LENGTH] = {0};
|
char qr_date[QR_DATA_LENGTH] = {0};
|
||||||
snprintf(qr_date, QR_DATA_LENGTH, qr_code_str, puiPara->ModuleImei, "89011703322284703435", "89011703322284703435", "true");
|
snprintf(qr_date, QR_DATA_LENGTH, qr_code_str, puiPara->ModuleImei, puiPara->SimIccidA, puiPara->SimIccidA, "true");
|
||||||
|
|
||||||
if(obj){
|
if(obj){
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "UIFlowLVGL/UIFlowLVGL.h"
|
#include "UIFlowLVGL/UIFlowLVGL.h"
|
||||||
#include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h"
|
#include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h"
|
||||||
#include "UIFlowLVGL/UIFlowPassword/UIFlowPasswordEventCallback.h"
|
#include "UIFlowLVGL/UIFlowPassword/UIFlowPasswordEventCallback.h"
|
||||||
|
#include "UIFlowLVGL/UIFlowCommon/UIFlowCommon.h"
|
||||||
#include <kwrap/debug.h>
|
#include <kwrap/debug.h>
|
||||||
#include "SysMain.h"
|
#include "SysMain.h"
|
||||||
#if (USE_DCF == ENABLE)
|
#if (USE_DCF == ENABLE)
|
||||||
|
@ -251,10 +252,13 @@ static void signal_icon_show(const short signal)
|
||||||
}
|
}
|
||||||
static void update_4g_module_icon(void)
|
static void update_4g_module_icon(void)
|
||||||
{
|
{
|
||||||
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
static short signal = SIGNAL_NOT_YET_GET;
|
static short signal = SIGNAL_NOT_YET_GET;
|
||||||
static short searching_index = -1;
|
static short searching_index = -1;
|
||||||
short signal_new = sf_cardv_get_cq_signal();
|
short signal_new = sf_cardv_get_cq_signal();
|
||||||
// printf("wwwwwwwwwwwwwwwwwww new signal = %d, old signal = %d\n", signal_new, signal);
|
unsigned short signal_level = 0;
|
||||||
|
network_signal_level_get(puiPara->NetGeneration, signal_new, &signal_level);
|
||||||
|
// printf("new signal = %d, old signal = %d\n", signal_new, signal);
|
||||||
if(SIGNAL_NOT_YET_GET == signal_new)
|
if(SIGNAL_NOT_YET_GET == signal_new)
|
||||||
{
|
{
|
||||||
signal_icon_hidden(searching_index);
|
signal_icon_hidden(searching_index);
|
||||||
|
@ -270,7 +274,7 @@ static void update_4g_module_icon(void)
|
||||||
lv_obj_set_hidden(label_sim_scr_uiflowmovie, true);
|
lv_obj_set_hidden(label_sim_scr_uiflowmovie, true);
|
||||||
signal_icon_hidden(searching_index);
|
signal_icon_hidden(searching_index);
|
||||||
signal_icon_hidden(signal);
|
signal_icon_hidden(signal);
|
||||||
signal_icon_show(signal_new);
|
signal_icon_show(signal_level);
|
||||||
signal = signal_new;
|
signal = signal_new;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -278,6 +282,30 @@ static void update_4g_module_icon(void)
|
||||||
// Nothing changed.
|
// Nothing changed.
|
||||||
// printf(" nothing changed.\n");
|
// printf(" nothing changed.\n");
|
||||||
}
|
}
|
||||||
|
// const int EMPTY_IMAGE = 0;
|
||||||
|
// lv_plugin_res_id res[] = {
|
||||||
|
// EMPTY_IMAGE,
|
||||||
|
// EMPTY_IMAGE,
|
||||||
|
// LV_PLUGIN_IMG_ID_SF_NET2G,
|
||||||
|
// LV_PLUGIN_IMG_ID_SF_NET3G,
|
||||||
|
// LV_PLUGIN_IMG_ID_SF_NET4G
|
||||||
|
// };
|
||||||
|
// // printf("NetGeneration:%d\n", puiPara->NetGeneration);
|
||||||
|
// const int SIM_CARD_NOT_INIT = 0;
|
||||||
|
// const int NET_GENERATION_2G = 2;
|
||||||
|
// // const int NET_GENERATION_3G = 3;
|
||||||
|
// const int NET_GENERATION_4G = 4;
|
||||||
|
// // puiPara->NetGeneration = NET_GENERATION_4G; // Test
|
||||||
|
// if (SIM_CARD_NOT_INIT == puiPara->NetGeneration
|
||||||
|
// || puiPara->NetGeneration < NET_GENERATION_2G
|
||||||
|
// || puiPara->NetGeneration > NET_GENERATION_4G)
|
||||||
|
// {
|
||||||
|
// lv_obj_set_hidden(image_4g_scr_uiflowmovie, true);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// int index = puiPara->NetGeneration;
|
||||||
|
// lv_obj_set_hidden(image_4g_scr_uiflowmovie, false);
|
||||||
|
// lv_plugin_img_set_src(image_4g_scr_uiflowmovie, res[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_camera_message(void)
|
static void update_camera_message(void)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "UIFlowPhotoParams.h"
|
#include "UIFlowPhotoParams.h"
|
||||||
#include "UIFlowPhotoFuncs.h"
|
#include "UIFlowPhotoFuncs.h"
|
||||||
#include "ImageApp/ImageApp_Photo.h"
|
#include "ImageApp/ImageApp_Photo.h"
|
||||||
|
#include "UIFlowLVGL/UIFlowCommon/UIFlowCommon.h"
|
||||||
#include "comm/timer.h"
|
#include "comm/timer.h"
|
||||||
#if (CALIBRATION_FUNC == ENABLE)
|
#if (CALIBRATION_FUNC == ENABLE)
|
||||||
#include "EngineerMode.h"
|
#include "EngineerMode.h"
|
||||||
|
@ -348,9 +349,12 @@ static void signal_icon_show(const short signal)
|
||||||
}
|
}
|
||||||
static void update_4g_module_icon(void)
|
static void update_4g_module_icon(void)
|
||||||
{
|
{
|
||||||
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
static short signal = SIGNAL_NOT_YET_GET;
|
static short signal = SIGNAL_NOT_YET_GET;
|
||||||
static short searching_index = -1;
|
static short searching_index = -1;
|
||||||
short signal_new = sf_cardv_get_cq_signal();
|
short signal_new = sf_cardv_get_cq_signal();
|
||||||
|
unsigned short signal_level = 0;
|
||||||
|
network_signal_level_get(puiPara->NetGeneration, signal_new, &signal_level);
|
||||||
// printf("new signal = %d, old signal = %d\n", signal_new, signal);
|
// printf("new signal = %d, old signal = %d\n", signal_new, signal);
|
||||||
if(SIGNAL_NOT_YET_GET == signal_new)
|
if(SIGNAL_NOT_YET_GET == signal_new)
|
||||||
{
|
{
|
||||||
|
@ -367,7 +371,7 @@ static void update_4g_module_icon(void)
|
||||||
lv_obj_set_hidden(label_sim_scr_uiflowphoto, true);
|
lv_obj_set_hidden(label_sim_scr_uiflowphoto, true);
|
||||||
signal_icon_hidden(searching_index);
|
signal_icon_hidden(searching_index);
|
||||||
signal_icon_hidden(signal);
|
signal_icon_hidden(signal);
|
||||||
signal_icon_show(signal_new);
|
signal_icon_show(signal_level);
|
||||||
signal = signal_new;
|
signal = signal_new;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -376,7 +380,6 @@ static void update_4g_module_icon(void)
|
||||||
// printf(" nothing changed.\n");
|
// printf(" nothing changed.\n");
|
||||||
}
|
}
|
||||||
const int EMPTY_IMAGE = 0;
|
const int EMPTY_IMAGE = 0;
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
|
||||||
lv_plugin_res_id res[] = {
|
lv_plugin_res_id res[] = {
|
||||||
EMPTY_IMAGE,
|
EMPTY_IMAGE,
|
||||||
EMPTY_IMAGE,
|
EMPTY_IMAGE,
|
||||||
|
@ -1583,13 +1586,13 @@ void UIFlowPhotoEventCallback(lv_obj_t* obj, lv_event_t event)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LV_USER_EVENT_KEY_LONG_PRESS:
|
// case LV_USER_EVENT_KEY_LONG_PRESS:
|
||||||
{
|
// {
|
||||||
uint32_t* key = (uint32_t*)lv_event_get_data();
|
// uint32_t* key = (uint32_t*)lv_event_get_data();
|
||||||
UIFlowPhoto_KeyRelease(obj, *key);
|
// UIFlowPhoto_KeyRelease(obj, *key);
|
||||||
|
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/* handle nvt event except key event */
|
/* handle nvt event except key event */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user