Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CharlesGuo11
Heart-Rate Esp32s3-Box_AED
提交
eb1035a1
H
Heart-Rate Esp32s3-Box_AED
项目概览
CharlesGuo11
/
Heart-Rate Esp32s3-Box_AED
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
代码片段
项目成员
Pages
H
Heart-Rate Esp32s3-Box_AED
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
eb1035a1
编写于
7月 25, 2022
作者:
CharlesGuo11
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决了看门狗报错问题,点击reset wii即可重新连接
上级
d1e933f6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
5 deletion
+33
-5
main/gui/ui_net_config.c
main/gui/ui_net_config.c
+31
-3
main/main.c
main/main.c
+2
-2
未找到文件。
main/gui/ui_net_config.c
浏览文件 @
eb1035a1
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
#include "app_rmaker.h"
#include "app_rmaker.h"
#include "ui_main.h"
#include "ui_main.h"
#include "ui_net_config.h"
#include "ui_net_config.h"
#include "nvs_flash.h"
#include "nvs.h"
static
const
char
*
TAG
=
"ui_net_config"
;
static
const
char
*
TAG
=
"ui_net_config"
;
...
@@ -21,9 +23,16 @@ static lv_obj_t *g_qr = NULL;
...
@@ -21,9 +23,16 @@ static lv_obj_t *g_qr = NULL;
static
lv_obj_t
*
g_img
=
NULL
;
static
lv_obj_t
*
g_img
=
NULL
;
static
lv_obj_t
*
g_page
=
NULL
;
static
lv_obj_t
*
g_page
=
NULL
;
static
ui_net_state_t
g_net_state
=
UI_NET_EVT_LOARDING
;
static
ui_net_state_t
g_net_state
=
UI_NET_EVT_LOARDING
;
static
void
nvs_erase
(
void
);
static
void
(
*
g_net_config_end_cb
)(
void
)
=
NULL
;
static
void
(
*
g_net_config_end_cb
)(
void
)
=
NULL
;
static
void
nvs_erase
(
void
){
nvs_flash_erase
();
// ESP_LOGI("Wifi is reset, please scan the QR to reconnect the wifi again");
printf
(
"Wifi is reset, please scan the QR to reconnect the wifi again
\n
"
);
}
static
void
ui_app_page_return_click_cb
(
lv_event_t
*
e
)
static
void
ui_app_page_return_click_cb
(
lv_event_t
*
e
)
{
{
lv_obj_t
*
obj
=
lv_event_get_user_data
(
e
);
lv_obj_t
*
obj
=
lv_event_get_user_data
(
e
);
...
@@ -183,9 +192,25 @@ void ui_net_config_update_cb(ui_net_state_t state, void *args)
...
@@ -183,9 +192,25 @@ void ui_net_config_update_cb(ui_net_state_t state, void *args)
lv_img_set_src
(
g_img
,
&
icon_rmaker
);
lv_img_set_src
(
g_img
,
&
icon_rmaker
);
lv_obj_align
(
g_img
,
LV_ALIGN_CENTER
,
0
,
-
10
);
lv_obj_align
(
g_img
,
LV_ALIGN_CENTER
,
0
,
-
10
);
lv_obj_clear_flag
(
g_hint_lab
,
LV_OBJ_FLAG_HIDDEN
);
lv_obj_clear_flag
(
g_hint_lab
,
LV_OBJ_FLAG_HIDDEN
);
lv_label_set_text_fmt
(
g_hint_lab
,
"Device already connected to cloud
\n
"
// lv_label_set_text_fmt(g_hint_lab, "Device already connected to cloud\n"
"Wi-Fi is connected to #000000 %s#"
,
ssid
);
// "Wi-Fi is connected to #000000 %s#", ssid);
lv_obj_align_to
(
g_hint_lab
,
g_img
,
LV_ALIGN_OUT_BOTTOM_MID
,
0
,
0
);
// lv_obj_align_to(g_hint_lab, g_img, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
//Create a button to erase the nvs space where the wifi ssid and its password are located
lv_obj_t
*
wifi_reset
=
lv_btn_create
(
g_page
);
lv_obj_set_size
(
wifi_reset
,
LV_SIZE_CONTENT
,
LV_SIZE_CONTENT
);
lv_obj_add_style
(
wifi_reset
,
&
ui_button_styles
()
->
style
,
0
);
lv_obj_add_style
(
wifi_reset
,
&
ui_button_styles
()
->
style_pr
,
LV_STATE_PRESSED
);
lv_obj_add_style
(
wifi_reset
,
&
ui_button_styles
()
->
style_focus
,
LV_STATE_FOCUS_KEY
);
lv_obj_add_style
(
wifi_reset
,
&
ui_button_styles
()
->
style_focus
,
LV_STATE_FOCUSED
);
lv_obj_align_to
(
wifi_reset
,
g_img
,
LV_ALIGN_OUT_BOTTOM_MID
,
-
30
,
10
);
lv_obj_t
*
reset_label
=
lv_label_create
(
wifi_reset
);
lv_label_set_text_static
(
reset_label
,
"Reset WiFi"
);
lv_obj_set_style_text_color
(
reset_label
,
lv_color_make
(
18
,
18
,
18
),
LV_STATE_DEFAULT
);
lv_obj_align
(
reset_label
,
LV_ALIGN_CENTER
,
0
,
0
);
lv_obj_add_event_cb
(
wifi_reset
,
nvs_erase
,
LV_EVENT_CLICKED
,
NULL
);
}
}
break
;
break
;
default:
default:
...
@@ -232,6 +257,8 @@ void ui_net_config_start(void (*fn)(void))
...
@@ -232,6 +257,8 @@ void ui_net_config_start(void (*fn)(void))
lv_indev_set_button_points
(
ui_get_button_indev
(),
points_array
);
lv_indev_set_button_points
(
ui_get_button_indev
(),
points_array
);
}
}
/* **************** APP NOT INSTALLED **************** */
/* **************** APP NOT INSTALLED **************** */
g_btn_app_hint
=
lv_btn_create
(
ui_main_get_status_bar
());
g_btn_app_hint
=
lv_btn_create
(
ui_main_get_status_bar
());
lv_obj_set_size
(
g_btn_app_hint
,
LV_SIZE_CONTENT
,
LV_SIZE_CONTENT
);
lv_obj_set_size
(
g_btn_app_hint
,
LV_SIZE_CONTENT
,
LV_SIZE_CONTENT
);
...
@@ -240,6 +267,7 @@ void ui_net_config_start(void (*fn)(void))
...
@@ -240,6 +267,7 @@ void ui_net_config_start(void (*fn)(void))
lv_obj_add_style
(
g_btn_app_hint
,
&
ui_button_styles
()
->
style_focus
,
LV_STATE_FOCUS_KEY
);
lv_obj_add_style
(
g_btn_app_hint
,
&
ui_button_styles
()
->
style_focus
,
LV_STATE_FOCUS_KEY
);
lv_obj_add_style
(
g_btn_app_hint
,
&
ui_button_styles
()
->
style_focus
,
LV_STATE_FOCUSED
);
lv_obj_add_style
(
g_btn_app_hint
,
&
ui_button_styles
()
->
style_focus
,
LV_STATE_FOCUSED
);
lv_obj_align
(
g_btn_app_hint
,
LV_ALIGN_RIGHT_MID
,
0
,
0
);
lv_obj_align
(
g_btn_app_hint
,
LV_ALIGN_RIGHT_MID
,
0
,
0
);
lv_obj_t
*
lab_app_inst
=
lv_label_create
(
g_btn_app_hint
);
lv_obj_t
*
lab_app_inst
=
lv_label_create
(
g_btn_app_hint
);
lv_label_set_text_static
(
lab_app_inst
,
"To install APP"
);
lv_label_set_text_static
(
lab_app_inst
,
"To install APP"
);
lv_obj_set_style_text_color
(
lab_app_inst
,
lv_color_make
(
18
,
18
,
18
),
LV_STATE_DEFAULT
);
lv_obj_set_style_text_color
(
lab_app_inst
,
lv_color_make
(
18
,
18
,
18
),
LV_STATE_DEFAULT
);
...
...
main/main.c
浏览文件 @
eb1035a1
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include <string.h>
#include <string.h>
#include <sys/unistd.h>
#include <sys/unistd.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include"app_wifi.h"
extern
bool
s_connected
;
extern
bool
s_connected
;
void
*
play_sound
(
const
char
*
path
);
void
*
play_sound
(
const
char
*
path
);
...
@@ -62,7 +63,6 @@ bool recv_warning_flag=0;
...
@@ -62,7 +63,6 @@ bool recv_warning_flag=0;
//AED socket
//AED socket
void
*
aedSocketMonitorFunc
(
void
*
args
){
void
*
aedSocketMonitorFunc
(
void
*
args
){
while
(
!
s_connected
)
sleep
(
60
);
while
(
1
){
while
(
1
){
int
emergencyReponseSocket
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
/*建立socket*/
int
emergencyReponseSocket
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
/*建立socket*/
if
(
emergencyReponseSocket
==-
1
){
if
(
emergencyReponseSocket
==-
1
){
...
@@ -367,8 +367,8 @@ void app_main(void)
...
@@ -367,8 +367,8 @@ void app_main(void)
app_sr_start
(
false
);
app_sr_start
(
false
);
app_rmaker_start
();
app_rmaker_start
();
while
(
!
s_connected
){
sleep
(
5
);};
pthread_t
aedMontorThread
;
pthread_t
aedMontorThread
;
pthread_create
(
&
aedMontorThread
,
NULL
,
aedSocketMonitorFunc
,
NULL
);
pthread_create
(
&
aedMontorThread
,
NULL
,
aedSocketMonitorFunc
,
NULL
);
pthread_join
(
aedMontorThread
,
NULL
);
pthread_join
(
aedMontorThread
,
NULL
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录