Skip to content

Commit 1f71745

Browse files
author
dave
committed
All examples compile on 2.2
1 parent 99cd80a commit 1f71745

File tree

7 files changed

+27
-16
lines changed

7 files changed

+27
-16
lines changed

examples/nano33ble/nano33ble.emf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@
327327
],
328328
"namingRecursive": true,
329329
"saveToSrc": false,
330-
"useCppMain": false
330+
"useCppMain": false,
331+
"eepromDefinition": "",
332+
"authenticatorDefinition": ""
331333
}
332334
}

examples/nano33ble/nano33ble_menu.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
// Global variable declarations
1616
const ConnectorLocalInfo applicationInfo = { "Nano 33 BLE Sense", "e95fcf8a-8a03-4043-9313-01fd8b8e8707" };
17+
1718
U8G2_SSD1306_128X64_NONAME_F_HW_I2C gfx(U8G2_R0, U8X8_PIN_NONE, U8X8_PIN_NONE, U8X8_PIN_NONE);
1819
U8g2Drawable gfxDrawable(&gfx, &Wire);
1920
GraphicsDeviceRenderer renderer(30, applicationInfo.name, &gfxDrawable);
@@ -51,10 +52,14 @@ const AnalogMenuInfo minfoTemp = { "Temp", 1, 0xffff, 2000, NO_CALLBACK, 0, 10,
5152
AnalogMenuItem menuTemp(&minfoTemp, 0, &menuHumidity);
5253

5354
void setupMenu() {
55+
// First we set up eeprom and authentication (if needed).
56+
57+
// Now add any readonly, non-remote and visible flags.
5458
menuTemp.setReadOnly(true);
5559
menuHumidity.setReadOnly(true);
5660
menuBPressure.setReadOnly(true);
5761

62+
// Code generated by plugins.
5863
gfx.begin();
5964
renderer.setUpdatesPerSecond(10);
6065
switches.initialise(internalDigitalIo(), true);

examples/nano33ble/tcMenuBLERemoteConnector.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
using namespace tcremote;
1414

15-
BLETagValTransport::BLETagValTransport() : fromApiCharacteristic(), readBuffer{}, readBufferPos(0), writeBuffer{}, writeBufferPos(0) {
15+
BLETagValTransport::BLETagValTransport() : TagValueTransport(TVAL_BUFFERED), fromApiCharacteristic(), readBuffer{},
16+
readBufferPos(0), writeBuffer{}, writeBufferPos(0) {
1617
}
1718

1819
int BLETagValTransport::writeChar(char data) {
@@ -94,7 +95,7 @@ bool BLEDeviceInitialisation::attemptInitialisation() {
9495
return true;
9596
}
9697

97-
bool BLEDeviceInitialisation::attemptNewConnection(TagValueTransport *transport) {
98+
bool BLEDeviceInitialisation::attemptNewConnection(BaseRemoteServerConnection *transport) {
9899
BLE.poll();
99100
if(BLE.connected()) {
100101
auto central = BLE.central();

examples/nano33ble/tcMenuBLERemoteConnector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace tcremote {
3535

3636
bool attemptInitialisation() override;
3737

38-
bool attemptNewConnection(TagValueTransport *transport) override;
38+
bool attemptNewConnection(BaseRemoteServerConnection *connection) override;
3939
};
4040

4141
class BLETagValTransport : public TagValueTransport {

examples/stm32f429FrameBuffer/stm32f429FrameBuffer.emf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@
167167
"lastDisplayUuid": "fc7b8f22-6553-43d6-9968-df4ee2562aaf",
168168
"lastInputUuid": "89cd7f70-0457-4884-97c2-0db904ccb0ba",
169169
"lastRemoteUuid": "2c101fec-1f7d-4ff3-8d2b-992ad41e7fcb",
170+
"lastRemoteUuids": [
171+
"2c101fec-1f7d-4ff3-8d2b-992ad41e7fcb"
172+
],
170173
"lastThemeUuid": "850dc0a3-f534-47c2-94d8-1e64ff368a54",
171174
"applicationUUID": "4df3d784-674a-4a3d-bcee-54a49693788e",
172175
"applicationName": "Factory",
@@ -229,6 +232,8 @@
229232
],
230233
"namingRecursive": true,
231234
"saveToSrc": false,
232-
"useCppMain": true
235+
"useCppMain": true,
236+
"eepromDefinition": "",
237+
"authenticatorDefinition": ""
233238
}
234239
}

examples/stm32f429FrameBuffer/stm32f429FrameBuffer_menu.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
#include "Fonts/FreeSans12pt7b.h"
1515

1616
// Global variable declarations
17-
1817
const ConnectorLocalInfo applicationInfo = { "Factory", "4df3d784-674a-4a3d-bcee-54a49693788e" };
18+
1919
StChromaArtDrawable Drawable;
2020
GraphicsDeviceRenderer renderer(30, applicationInfo.name, &Drawable);
2121
StBspTouchInterrogator touchInterrogator(240, 320);
2222
MenuTouchScreenManager touchScreen(&touchInterrogator, &renderer, iotouch::TouchInterrogator::PORTRAIT);
2323

2424
// Global Menu Item declarations
25-
2625
const BooleanMenuInfo minfoConnectivityEnableUSB = { "Enable USB", 10, 8, 1, NO_CALLBACK, NAMING_TRUE_FALSE };
2726
BooleanMenuItem menuConnectivityEnableUSB(&minfoConnectivityEnableUSB, false, NULL);
2827
RENDERING_CALLBACK_NAME_INVOKE(fnConnectivityRtCall, backSubItemRenderFn, "Connectivity", -1, NO_CALLBACK)
@@ -52,12 +51,14 @@ EnumMenuItem menuBeltStatus(&minfoBeltStatus, 0, &menuBeltSpeed);
5251
const BooleanMenuInfo minfoPower = { "Power", 6, 0xffff, 1, NO_CALLBACK, NAMING_ON_OFF };
5352
BooleanMenuItem menuPower(&minfoPower, false, &menuBeltStatus);
5453

55-
// Set up code
56-
5754
void setupMenu() {
55+
// First we set up eeprom and authentication (if needed).
56+
57+
// Now add any readonly, non-remote and visible flags.
5858
menuBeltSpeed.setReadOnly(true);
5959
menuBeltStatus.setReadOnly(true);
6060

61+
// Code generated by plugins.
6162
renderer.setUpdatesPerSecond(10);
6263
touchScreen.start();
6364
menuMgr.initWithoutInput(&renderer, &menuPower);

examples/stm32f429FrameBuffer/stm32f429FrameBuffer_menu.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,15 @@
1919
#include <graphics/MenuTouchScreenEncoder.h>
2020
#include <RuntimeMenuItem.h>
2121

22-
void setupMenu(); // forward reference of the menu setup function.
23-
extern const PROGMEM ConnectorLocalInfo applicationInfo; // contains app name and ID
24-
25-
// Global variables that need exporting
26-
22+
// variables we declare that you may need to access
23+
extern const PROGMEM ConnectorLocalInfo applicationInfo;
2724
extern StChromaArtDrawable Drawable;
2825
extern GraphicsDeviceRenderer renderer;
2926
extern StBspTouchInterrogator touchInterrogator;
3027
extern MenuTouchScreenManager touchScreen;
3128
extern const GFXfont FreeSans12pt7b;
3229

3330
// Global Menu Item exports
34-
3531
extern BooleanMenuItem menuConnectivityEnableUSB;
3632
extern BackMenuItem menuBackConnectivity;
3733
extern SubMenuItem menuConnectivity;
@@ -45,8 +41,9 @@ extern AnalogMenuItem menuBeltSpeed;
4541
extern EnumMenuItem menuBeltStatus;
4642
extern BooleanMenuItem menuPower;
4743

48-
// Provide a wrapper to get hold of the root menu item
44+
// Provide a wrapper to get hold of the root menu item and export setupMenu
4945
inline MenuItem& rootMenuItem() { return menuPower; }
46+
void setupMenu();
5047

5148
// Callback functions must always include CALLBACK_FUNCTION after the return type
5249
#define CALLBACK_FUNCTION

0 commit comments

Comments
 (0)