Skip to content

Commit

Permalink
Update wifi_setup.cpp
Browse files Browse the repository at this point in the history
3.5" optimization
  • Loading branch information
OperatorB authored Jan 21, 2024
1 parent 75afcac commit 8e069eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CYD-Klipper/src/ui/wifi_setup.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "lvgl.h"
#include "wifi_setup.h"
#include "../conf/global_config.h"

#include "WiFi.h"

static lv_style_t wifi_text_style;

void wifi_init_inner();

static void reset_btn_event_handler(lv_event_t * e) {
Expand Down Expand Up @@ -46,6 +48,8 @@ static void ta_event_cb(lv_event_t * e) {

void wifi_pass_entry(const char* ssid){
lv_obj_clean(lv_scr_act());
lv_style_set_text_font(&wifi_text_style, &lv_font_montserrat_16);
lv_obj_add_style(lv_scr_act(), &wifi_text_style, 0);

lv_obj_t * label = lv_label_create(lv_scr_act());
lv_label_set_text(label, "Enter WiFi Password");
Expand Down Expand Up @@ -78,6 +82,8 @@ static void wifi_btn_event_handler(lv_event_t * e){
void wifi_init_inner(){
WiFi.disconnect();
lv_obj_clean(lv_scr_act());
lv_style_set_text_font(&wifi_text_style, &lv_font_montserrat_16);
lv_obj_add_style(lv_scr_act(), &wifi_text_style, 0);

if (global_config.wifiConfigured){
WiFi.begin(global_config.wifiSSID, global_config.wifiPassword);
Expand Down Expand Up @@ -176,4 +182,4 @@ void wifi_ok(){
if (WiFi.status() != WL_CONNECTED){
ESP.restart();
}
}
}

0 comments on commit 8e069eb

Please sign in to comment.