@@ -108,21 +108,21 @@ void Wippersnapper_V2::provision() {
108
108
// Initialize the display
109
109
displayConfig config;
110
110
WsV2._fileSystemV2 ->parseDisplayConfig (config);
111
- WsV2._display = new ws_display_driver (config);
111
+ WsV2._displayV2 = new ws_display_driver (config);
112
112
// Begin display
113
- if (!WsV2._display ->begin ()) {
113
+ if (!WsV2._displayV2 ->begin ()) {
114
114
WS_DEBUG_PRINTLN (" Unable to enable display driver and LVGL" );
115
115
haltErrorV2 (" Unable to enable display driver, please check the json "
116
116
" configuration!" );
117
117
}
118
118
119
- WsV2._display ->enableLogging ();
119
+ WsV2._displayV2 ->enableLogging ();
120
120
ReleaseStatusPixel (); // don't use status LED if we are using the display
121
121
// UI Setup
122
- WsV2._ui_helper = new ws_display_ui_helper (WsV2._display );
123
- WsV2._ui_helper ->set_bg_black ();
124
- WsV2._ui_helper ->show_scr_load ();
125
- WsV2._ui_helper ->set_label_status (" Validating Credentials..." );
122
+ WsV2._ui_helperV2 = new ws_display_ui_helper (WsV2._displayV2 );
123
+ WsV2._ui_helperV2 ->set_bg_black ();
124
+ WsV2._ui_helperV2 ->show_scr_load ();
125
+ WsV2._ui_helperV2 ->set_label_status (" Validating Credentials..." );
126
126
#endif
127
127
128
128
#ifdef USE_TINYUSB
@@ -139,8 +139,8 @@ void Wippersnapper_V2::provision() {
139
139
set_ssid_pass ();
140
140
141
141
#ifdef USE_DISPLAY
142
- WsV2._ui_helper ->set_label_status (" " );
143
- WsV2._ui_helper ->set_load_bar_icon_complete (loadBarIconFile);
142
+ WsV2._ui_helperV2 ->set_label_status (" " );
143
+ WsV2._ui_helperV2 ->set_load_bar_icon_complete (loadBarIconFile);
144
144
#endif
145
145
}
146
146
@@ -515,7 +515,7 @@ void cbErrorTopicV2(char *errorData, uint16_t len) {
515
515
}
516
516
517
517
#ifdef USE_DISPLAY
518
- WsV2._ui_helper ->show_scr_error (" IO Ban Error" , errorData);
518
+ WsV2._ui_helperV2 ->show_scr_error (" IO Ban Error" , errorData);
519
519
#endif
520
520
521
521
// WDT reset
@@ -554,7 +554,7 @@ void cbThrottleTopicV2(char *throttleData, uint16_t len) {
554
554
buffer, 100 ,
555
555
" [IO ERROR] Device is throttled for %d mS and blocking execution..\n ." ,
556
556
throttleDuration);
557
- WsV2._ui_helper ->add_text_to_terminal (buffer);
557
+ WsV2._ui_helperV2 ->add_text_to_terminal (buffer);
558
558
#endif
559
559
560
560
// If throttle duration is less than the keepalive interval, delay for the
@@ -574,7 +574,7 @@ void cbThrottleTopicV2(char *throttleData, uint16_t len) {
574
574
}
575
575
WS_DEBUG_PRINTLN (" Device is un-throttled, resumed command execution" );
576
576
#ifdef USE_DISPLAY
577
- WsV2._ui_helper ->add_text_to_terminal (
577
+ WsV2._ui_helperV2 ->add_text_to_terminal (
578
578
" [IO] Device is un-throttled, resuming...\n " );
579
579
#endif
580
580
}
@@ -784,8 +784,8 @@ void Wippersnapper_V2::runNetFSMV2() {
784
784
if (networkStatus () == WS_NET_CONNECTED) {
785
785
WS_DEBUG_PRINTLN (" Connected to WiFi!" );
786
786
#ifdef USE_DISPLAY
787
- if (WsV2._ui_helper ->getLoadingState ())
788
- WsV2._ui_helper ->set_load_bar_icon_complete (loadBarIconWifi);
787
+ if (WsV2._ui_helperV2 ->getLoadingState ())
788
+ WsV2._ui_helperV2 ->set_load_bar_icon_complete (loadBarIconWifi);
789
789
#endif
790
790
fsmNetwork = FSM_NET_ESTABLISH_MQTT;
791
791
break ;
@@ -796,15 +796,15 @@ void Wippersnapper_V2::runNetFSMV2() {
796
796
WS_DEBUG_PRINTLN (" Establishing network connection..." );
797
797
WS_PRINTER.flush ();
798
798
#ifdef USE_DISPLAY
799
- if (WsV2._ui_helper ->getLoadingState ())
800
- WsV2._ui_helper ->set_label_status (" Connecting to WiFi..." );
799
+ if (WsV2._ui_helperV2 ->getLoadingState ())
800
+ WsV2._ui_helperV2 ->set_label_status (" Connecting to WiFi..." );
801
801
#endif
802
802
// Perform a WiFi scan and check if SSID within
803
803
// secrets.json is within the scanned SSIDs
804
804
WS_DEBUG_PRINT (" Performing a WiFi scan for SSID..." );
805
805
if (!check_valid_ssid ()) {
806
806
#ifdef USE_DISPLAY
807
- WsV2._ui_helper ->show_scr_error (" ERROR" ,
807
+ WsV2._ui_helperV2 ->show_scr_error (" ERROR" ,
808
808
" Unable to find WiFi network listed in "
809
809
" the secrets file. Rebooting soon..." );
810
810
#endif
@@ -834,7 +834,7 @@ void Wippersnapper_V2::runNetFSMV2() {
834
834
if (networkStatus () != WS_NET_CONNECTED) {
835
835
WS_DEBUG_PRINTLN (" ERROR: Unable to connect to WiFi!" );
836
836
#ifdef USE_DISPLAY
837
- WsV2._ui_helper ->show_scr_error (
837
+ WsV2._ui_helperV2 ->show_scr_error (
838
838
" CONNECTION ERROR" ,
839
839
" Unable to connect to WiFi Network. Please check that you entered "
840
840
" the WiFi credentials correctly. Rebooting in 5 seconds..." );
@@ -847,8 +847,8 @@ void Wippersnapper_V2::runNetFSMV2() {
847
847
break ;
848
848
case FSM_NET_ESTABLISH_MQTT:
849
849
#ifdef USE_DISPLAY
850
- if (WsV2._ui_helper ->getLoadingState ())
851
- WsV2._ui_helper ->set_label_status (" Connecting to IO..." );
850
+ if (WsV2._ui_helperV2 ->getLoadingState ())
851
+ WsV2._ui_helperV2 ->set_label_status (" Connecting to IO..." );
852
852
#endif
853
853
WsV2._mqttV2 ->setKeepAliveInterval (WS_KEEPALIVE_INTERVAL_MS / 1000 );
854
854
// Attempt to connect
@@ -880,7 +880,7 @@ void Wippersnapper_V2::runNetFSMV2() {
880
880
}
881
881
if (fsmNetwork != FSM_NET_CHECK_MQTT) {
882
882
#ifdef USE_DISPLAY
883
- WsV2._ui_helper ->show_scr_error (
883
+ WsV2._ui_helperV2 ->show_scr_error (
884
884
" CONNECTION ERROR" ,
885
885
" Unable to connect to Adafruit.io. If you are repeatedly having "
886
886
" this issue, please check that your IO Username and IO Key are set "
@@ -1126,12 +1126,12 @@ void Wippersnapper_V2::pingBrokerV2() {
1126
1126
if (WsV2._mqttV2 ->ping ()) {
1127
1127
WS_DEBUG_PRINTLN (" SUCCESS!" );
1128
1128
#ifdef USE_DISPLAY
1129
- WsV2._ui_helper ->add_text_to_terminal (" [NET] Sent KeepAlive ping!\n " );
1129
+ WsV2._ui_helperV2 ->add_text_to_terminal (" [NET] Sent KeepAlive ping!\n " );
1130
1130
#endif
1131
1131
} else {
1132
1132
WS_DEBUG_PRINTLN (" FAILURE! Running network FSM..." );
1133
1133
#ifdef USE_DISPLAY
1134
- WsV2._ui_helper ->add_text_to_terminal (
1134
+ WsV2._ui_helperV2 ->add_text_to_terminal (
1135
1135
" [NET] EROR: Failed to send KeepAlive ping!\n " );
1136
1136
#endif
1137
1137
WsV2._mqttV2 ->disconnect ();
@@ -1304,8 +1304,8 @@ void Wippersnapper_V2::connect() {
1304
1304
WsV2.feedWDTV2 ();
1305
1305
1306
1306
#ifdef USE_DISPLAY
1307
- WsV2._ui_helper ->set_load_bar_icon_complete (loadBarIconCloud);
1308
- WsV2._ui_helper ->set_label_status (" Sending device info..." );
1307
+ WsV2._ui_helperV2 ->set_load_bar_icon_complete (loadBarIconCloud);
1308
+ WsV2._ui_helperV2 ->set_label_status (" Sending device info..." );
1309
1309
#endif
1310
1310
1311
1311
WS_DEBUG_PRINTLN (" Performing checkin handshake..." );
@@ -1325,9 +1325,9 @@ void Wippersnapper_V2::connect() {
1325
1325
// switch to monitor screen
1326
1326
#ifdef USE_DISPLAY
1327
1327
WS_DEBUG_PRINTLN (" Clearing loading screen..." );
1328
- WsV2._ui_helper ->clear_scr_load ();
1328
+ WsV2._ui_helperV2 ->clear_scr_load ();
1329
1329
WS_DEBUG_PRINTLN (" building monitor screen..." );
1330
- WsV2._ui_helper ->build_scr_monitor ();
1330
+ WsV2._ui_helperV2 ->build_scr_monitor ();
1331
1331
#endif
1332
1332
WS_DEBUG_PRINTLN (" Running app loop..." );
1333
1333
}
0 commit comments