1818#include < EepromAbstraction.h>
1919#include < Ethernet.h>
2020#include < IoLogging.h>
21- #include < stockIcons/wifiAndConnectionIconsLCD.h>
2221
2322using namespace tcremote ;
2423
@@ -34,12 +33,6 @@ const char pgmListPressed[] PROGMEM = "List Item Pressed";
3433const char pgmHeaderSavedItem[] PROGMEM = " Saved Item" ;
3534const char * romSpaceNames = " item 01item 02item 03item 04item 05item 06item 07item 08item 09item 10 " ;
3635
37- // We add a title widget that shows when a user is connected to the device. Connection icons
38- // are in the standard icon set we included at the top.
39- // Yes even on LCD we now support title widgets, but they eat up a few of your custom chars.
40- // The width must always be 1, and the height is the first custom character that is used.
41- TitleWidget connectedWidget (iconsConnection, 2 , 1 , 0 );
42-
4336// used by the take over display logic.
4437int counter = 0 ;
4538
@@ -61,15 +54,6 @@ void prepareLayout() {
6154 GridPosition (GridPosition::DRAW_TEXTUAL_ITEM, GridPosition::JUSTIFY_RIGHT_WITH_VALUE, 2 , 2 , 2 , 1 ));
6255}
6356
64- // when there's a change in communication status (client connects for example) this gets called.
65- void onCommsChange (CommunicationInfo info) {
66- if (info.remoteNo == 0 ) {
67- connectedWidget.setCurrentState (info.connected ? 1 : 0 );
68- }
69- // this relies on logging in IoAbstraction's ioLogging.h, to turn it on visit the file for instructions.
70- serdebugF4 (" Comms notify (rNo, con, enum)" , info.remoteNo , info.connected , info.errorMode );
71- }
72-
7357void setup () {
7458 //
7559 // If you are using serial (connectivity or logging) and wire they must be initialised
@@ -88,11 +72,6 @@ void setup() {
8872 // Here we set the character to be used for back, next and editing for the "cursor".
8973 renderer.setEditorChars (0b01111111 , 0b01111110 , ' =' );
9074
91- // You can also have title widgets on LCDs, maximum of 7 states. They use up the custom chars 0..7. How it works
92- // is that you define a custom character for each icon, and treat them just as you would a regular icon. The height
93- // of the widget is fixed, and the height field instead indicates the first custom character for the first icon.
94- renderer.setFirstWidget (&connectedWidget);
95-
9675 // we can choose which way RGB items should present, either has HEX_HTML or DECIMAL
9776 Rgb32MenuItem::setRgbPrintMode (HEX_HTML);
9877
@@ -132,10 +111,6 @@ void setup() {
132111 // here we customize the LCD layout for one menu, to have two items per line.
133112 prepareLayout ();
134113
135- // and lastly we register a communication listener, it updates the title widget
136- // that shows connectivity state on the right corner.
137- menuConnectivityIoTMonitor.registerCommsNotification (onCommsChange);
138-
139114 // and finally, when the display times out, take over and draw a custom screen
140115 renderer.setResetCallback ([] {
141116 onTakeOverDisplay (-1 );
@@ -357,6 +332,6 @@ int CALLBACK_FUNCTION customHexEditorRtCall(RuntimeMenuItem* item, uint8_t row,
357332 }
358333 return true ;
359334 }
335+ default : return textItemRenderFn (item, row, mode, buffer, bufferSize);
360336 }
361- return textItemRenderFn (item, row, mode, buffer, bufferSize);
362337}
0 commit comments