Skip to content

Commit 41cf3cb

Browse files
committed
example change
1 parent e9766f8 commit 41cf3cb

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

examples/arduino32/picoAdafruitDashboard/picoAdafruitDashboard.emf

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"eepromAddress": -1,
2020
"readOnly": false,
2121
"localOnly": false,
22-
"visible": true
22+
"visible": true,
23+
"staticDataInRAM": false
2324
}
2425
},
2526
{
@@ -34,7 +35,8 @@
3435
"eepromAddress": -1,
3536
"readOnly": false,
3637
"localOnly": false,
37-
"visible": true
38+
"visible": true,
39+
"staticDataInRAM": false
3840
}
3941
},
4042
{
@@ -52,7 +54,8 @@
5254
"eepromAddress": -1,
5355
"readOnly": false,
5456
"localOnly": false,
55-
"visible": true
57+
"visible": true,
58+
"staticDataInRAM": false
5659
}
5760
},
5861
{
@@ -67,7 +70,8 @@
6770
"eepromAddress": -1,
6871
"readOnly": false,
6972
"localOnly": false,
70-
"visible": true
73+
"visible": true,
74+
"staticDataInRAM": false
7175
}
7276
},
7377
{
@@ -81,7 +85,8 @@
8185
"eepromAddress": -1,
8286
"readOnly": false,
8387
"localOnly": false,
84-
"visible": true
88+
"visible": true,
89+
"staticDataInRAM": false
8590
}
8691
},
8792
{
@@ -95,7 +100,8 @@
95100
"functionName": "onSettingsAction",
96101
"readOnly": false,
97102
"localOnly": false,
98-
"visible": true
103+
"visible": true,
104+
"staticDataInRAM": false
99105
}
100106
},
101107
{
@@ -110,7 +116,8 @@
110116
"eepromAddress": -1,
111117
"readOnly": false,
112118
"localOnly": false,
113-
"visible": true
119+
"visible": true,
120+
"staticDataInRAM": false
114121
}
115122
}
116123
],
@@ -238,7 +245,7 @@
238245
},
239246
{
240247
"name": "ITEM_FONT",
241-
"latestValue": "ada:OpenSansCyrillicLatin18,0",
248+
"latestValue": "ada:RobotoMedium24,1",
242249
"subsystem": "THEME"
243250
},
244251
{
@@ -258,7 +265,7 @@
258265
},
259266
{
260267
"name": "USE_TC_UNICODE",
261-
"latestValue": "true",
268+
"latestValue": "false",
262269
"subsystem": "THEME"
263270
},
264271
{
@@ -275,6 +282,7 @@
275282
"namingRecursive": true,
276283
"saveToSrc": false,
277284
"useCppMain": false,
285+
"usingSizedEEPROMStorage": false,
278286
"eepromDefinition": "",
279287
"authenticatorDefinition": "",
280288
"projectIoExpanders": [

examples/arduino32/picoAdafruitDashboard/picoAdafruitDashboard_menu.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <tcMenu.h>
1212
#include "picoAdafruitDashboard_menu.h"
1313
#include "ThemeCoolBlueModern.h"
14-
#include <Fonts/OpenSansCyrillicLatin18.h>
1514
#include <Fonts/RobotoMedium24.h>
1615

1716
// Global variable declarations
@@ -25,26 +24,25 @@ GraphicsDeviceRenderer renderer(30, applicationInfo.name, &gfxDrawable);
2524
RENDERING_CALLBACK_NAME_INVOKE(fnSettingsRGBRtCall, rgbAlphaItemRenderFn, "RGB", -1, NO_CALLBACK)
2625
Rgb32MenuItem menuSettingsRGB(fnSettingsRGBRtCall, RgbColor32(0, 0, 0), 7, false, NULL);
2726
const PROGMEM AnyMenuInfo minfoSettingsAction = { "Action", 6, 0xffff, 0, onSettingsAction };
28-
ActionMenuItem menuSettingsAction(&minfoSettingsAction, &menuSettingsRGB);
29-
RENDERING_CALLBACK_NAME_INVOKE(fnSettingsRtCall, backSubItemRenderFn, "Settings", -1, NO_CALLBACK)
27+
ActionMenuItem menuSettingsAction(&minfoSettingsAction, &menuSettingsRGB, INFO_LOCATION_PGM);
3028
const PROGMEM SubMenuInfo minfoSettings = { "Settings", 5, 0xffff, 0, NO_CALLBACK };
31-
BackMenuItem menuBackSettings(fnSettingsRtCall, &menuSettingsAction);
32-
SubMenuItem menuSettings(&minfoSettings, &menuBackSettings, NULL);
29+
BackMenuItem menuBackSettings(&minfoSettings, &menuSettingsAction, INFO_LOCATION_PGM);
30+
SubMenuItem menuSettings(&minfoSettings, &menuBackSettings, NULL, INFO_LOCATION_PGM);
3331
const PROGMEM BooleanMenuInfo minfoPower = { "Power", 4, 0xffff, 1, NO_CALLBACK, NAMING_ON_OFF };
34-
BooleanMenuItem menuPower(&minfoPower, false, &menuSettings);
32+
BooleanMenuItem menuPower(&minfoPower, false, &menuSettings, INFO_LOCATION_PGM);
3533
const char enumStrEnum_0[] PROGMEM = "Item1";
3634
const char enumStrEnum_1[] PROGMEM = "Item2";
3735
const char* const enumStrEnum[] PROGMEM = { enumStrEnum_0, enumStrEnum_1 };
3836
const PROGMEM EnumMenuInfo minfoEnum = { "Enum", 3, 0xffff, 1, NO_CALLBACK, enumStrEnum };
39-
EnumMenuItem menuEnum(&minfoEnum, 0, &menuPower);
37+
EnumMenuItem menuEnum(&minfoEnum, 0, &menuPower, INFO_LOCATION_PGM);
4038
const PROGMEM FloatMenuInfo minfoFloat = { "Float", 2, 0xffff, 3, NO_CALLBACK };
41-
FloatMenuItem menuFloat(&minfoFloat, 33.123, &menuEnum);
39+
FloatMenuItem menuFloat(&minfoFloat, 33.123, &menuEnum, INFO_LOCATION_PGM);
4240
const PROGMEM AnalogMenuInfo minfoAnalog = { "Analog", 1, 0xffff, 1000, NO_CALLBACK, 0, 10, "V" };
43-
AnalogMenuItem menuAnalog(&minfoAnalog, 222, &menuFloat);
41+
AnalogMenuItem menuAnalog(&minfoAnalog, 222, &menuFloat, INFO_LOCATION_PGM);
4442

4543
void setupMenu() {
4644
// First we set up eeprom and authentication (if needed).
47-
45+
setSizeBasedEEPROMStorageEnabled(false);
4846
// Code generated by plugins.
4947
gfx.begin();
5048
gfx.setRotation(1);
@@ -53,7 +51,6 @@ void setupMenu() {
5351
menuMgr.initForEncoder(&renderer, &menuAnalog, 16, 17, 21);
5452
renderer.setTitleMode(BaseGraphicalRenderer::TITLE_FIRST_ROW);
5553
renderer.setUseSliderForAnalog(true);
56-
renderer.enableTcUnicode();
57-
installCoolBlueModernTheme(renderer, MenuFontDef(&OpenSansCyrillicLatin18, 0), MenuFontDef(&RobotoMedium24, 1), false);
54+
installCoolBlueModernTheme(renderer, MenuFontDef(&RobotoMedium24, 1), MenuFontDef(&RobotoMedium24, 1), false);
5855
}
5956

examples/arduino32/picoAdafruitDashboard/picoAdafruitDashboard_menu.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313

1414
#include <Arduino.h>
1515
#include <tcMenu.h>
16-
#include <tcUnicodeHelper.h>
1716
#include "tcMenuAdaFruitGfx.h"
1817
#include <ScrollChoiceMenuItem.h>
1918
#include <IoAbstraction.h>
19+
#include <EepromItemStorage.h>
2020

2121
// variables we declare that you may need to access
2222
extern const PROGMEM ConnectorLocalInfo applicationInfo;
2323
extern Adafruit_ILI9341 gfx;
2424
extern AdafruitDrawable gfxDrawable;
2525
extern GraphicsDeviceRenderer renderer;
26-
extern const UnicodeFont OpenSansCyrillicLatin18[];
2726
extern const GFXfont RobotoMedium24;
2827

2928
// Any externals needed by IO expanders, EEPROMs etc

examples/arduino32/picoAdafruitDashboard/tcMenuAdaFruitGfx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Coord AdafruitDrawable::internalTextExtents(const void *f, int mag, const char *
121121
auto allGlyphs = (GFXglyph*)pgm_read_ptr(&font->glyph);
122122
unsigned char glyphHeight = pgm_read_byte(&allGlyphs[glIdx].height);
123123
if (glyphHeight > height) height = glyphHeight;
124-
bl = glyphHeight + pgm_read_byte(&allGlyphs[glIdx].yOffset);
124+
bl = glyphHeight + (signed char)pgm_read_byte(&allGlyphs[glIdx].yOffset);
125125
current++;
126126
}
127127
if(baseline) *baseline = bl;

0 commit comments

Comments
 (0)