Skip to content

Commit 3802283

Browse files
author
dave
committed
Prepare release 2.2
1 parent 2c67c65 commit 3802283

File tree

9 files changed

+37
-11
lines changed

9 files changed

+37
-11
lines changed

examples/nano33ble/nano33ble.emf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
},
267267
{
268268
"name": "SWITCH_IODEVICE",
269-
"latestValue": "",
269+
"latestValue": "devicePins",
270270
"subsystem": "INPUT"
271271
},
272272
{
@@ -329,6 +329,9 @@
329329
"saveToSrc": false,
330330
"useCppMain": false,
331331
"eepromDefinition": "",
332-
"authenticatorDefinition": ""
332+
"authenticatorDefinition": "",
333+
"projectIoExpanders": [
334+
"deviceIO:"
335+
]
333336
}
334337
}

examples/nano33ble/nano33ble.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "SensorManager.h"
1212
#include "MotionDetection.h"
1313
#include <AnalogDeviceAbstraction.h>
14+
#include <tcMenuVersion.h>
1415

1516
// on the analog menu, we both have an analog input and an analog output (PWM). You can configure those pins here.
1617
const int analogInputPin = A0;
@@ -44,6 +45,16 @@ void setup() {
4445
taskManager.registerEvent(&motionDetection);
4546
taskManager.scheduleFixedRate(1, &sensorManager, TIME_SECONDS);
4647

48+
setTitlePressedCallback([](int id) {
49+
withMenuDialogIfAvailable([](MenuBasedDialog* dlg) {
50+
dlg->setButtons(BTNTYPE_CLOSE, BTNTYPE_NONE);
51+
dlg->showRam("Nano BLE Example", false);
52+
char szVer[10];
53+
tccore::copyTcMenuVersion(szVer, sizeof szVer);
54+
dlg->copyIntoBuffer(szVer);
55+
});
56+
});
57+
4758
// lastly we set up something simple to read from analog in
4859
taskManager.scheduleFixedRate(100, [] {
4960
menuAnalogReadingsInA0.setFloatValue(analogDevice.getCurrentFloat(analogInputPin));

examples/nano33ble/nano33ble_menu.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414
#include <Arduino.h>
1515
#include <tcMenu.h>
1616
#include "tcMenuU8g2.h"
17+
#include <IoAbstraction.h>
1718

1819
// variables we declare that you may need to access
1920
extern const PROGMEM ConnectorLocalInfo applicationInfo;
2021
extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C gfx;
2122
extern GraphicsDeviceRenderer renderer;
2223

24+
// Any externals needed by IO expanders, EEPROMs etc
25+
26+
2327
// Global Menu Item exports
2428
extern AnalogMenuItem menuAnalogReadingsOutputPWM;
2529
extern FloatMenuItem menuAnalogReadingsInA0;

examples/stm32f4mbed/MBedEthernetTransport.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ void MBedEthernetTransport::flush() {
2828
if(written == NSAPI_ERROR_WOULD_BLOCK) continue;
2929
if(written <=0) {
3030
serdebugF2("socket error ", written);
31-
socket->close();
32-
socket = nullptr;
31+
close();
3332
return;
3433
}
3534
if(written < sizeToGo) {
@@ -67,7 +66,6 @@ int MBedEthernetTransport::fillReadBuffer(uint8_t* dataBuffer, int maxData) {
6766

6867
bool MBedEthernetTransport::available() {
6968
return (socket != nullptr && isOpen);
70-
7169
}
7270

7371
void MBedEthernetTransport::close() {

examples/stm32f4mbed/MBedEthernetTransport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace tcremote {
3131
InternetSocket* socket;
3232
bool isOpen;
3333
public:
34-
MBedEthernetTransport() : BaseBufferedRemoteTransport(BUFFER_MESSAGES_TILL_FULL, 64, 250) {
34+
MBedEthernetTransport() : BaseBufferedRemoteTransport(BUFFER_MESSAGES_TILL_FULL, 96, 128) {
3535
this->socket = nullptr;
3636
isOpen = false;
3737
}

examples/stm32f4mbed/stm32f4mbed.emf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
},
361361
{
362362
"name": "SWITCH_IODEVICE",
363-
"latestValue": "",
363+
"latestValue": "devicePins",
364364
"subsystem": "INPUT"
365365
},
366366
{
@@ -443,6 +443,9 @@
443443
"saveToSrc": false,
444444
"useCppMain": true,
445445
"eepromDefinition": "bsp:0",
446-
"authenticatorDefinition": "rom:100:6"
446+
"authenticatorDefinition": "rom:100:6",
447+
"projectIoExpanders": [
448+
"deviceIO:"
449+
]
447450
}
448451
}

examples/stm32f4mbed/stm32f4mbed_menu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ void setupMenu() {
8383
authManager.initialise(menuMgr.getEepromAbstraction(), 100);
8484
menuMgr.setAuthenticator(&authManager);
8585
// Now add any readonly, non-remote and visible flags.
86-
menuIP.setReadOnly(true);
8786
menuCommits.setReadOnly(true);
8887
menuEdit.setReadOnly(true);
89-
menuIoTMonitor.setLocalOnly(true);
88+
menuIP.setReadOnly(true);
9089
menuAuthenticator.setLocalOnly(true);
90+
menuIoTMonitor.setLocalOnly(true);
9191

9292
// Code generated by plugins.
9393
gfx.setRotation(0);

examples/stm32f4mbed/stm32f4mbed_menu.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <RemoteMenuItem.h>
2323
#include <ScrollChoiceMenuItem.h>
2424
#include <EditableLargeNumberMenuItem.h>
25+
#include <IoAbstraction.h>
2526
#include <mbed/HalStm32EepromAbstraction.h>
2627
#include <RemoteAuthentication.h>
2728

@@ -34,6 +35,9 @@ extern AdafruitDrawable gfxDrawable;
3435
extern GraphicsDeviceRenderer renderer;
3536
extern MbedEthernetInitialiser mbedEthInitialisation;
3637

38+
// Any externals needed by IO expanders, EEPROMs etc
39+
40+
3741
// Global Menu Item exports
3842
extern TextMenuItem menuEdit;
3943
extern AnalogMenuItem menuCommits;

examples/stm32f4mbed/tcmenu_main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "mbed/HalStm32EepromAbstraction.h"
1414
#include <stockIcons/wifiAndConnectionIcons16x12.h>
1515
#include <RemoteMenuItem.h>
16+
#include <tcMenuVersion.h>
1617

1718
#ifdef BUILD_FOR_MBED_6
1819
BufferedSerial serPort(USBTX, USBRX);
@@ -88,7 +89,9 @@ void setup() {
8889
if(dlg && !dlg->isInUse()) {
8990
dlg->setButtons(BTNTYPE_NONE, BTNTYPE_OK);
9091
dlg->show("Mbed demo", false);
91-
dlg->copyIntoBuffer("//TheCodersCorner");
92+
char szVer[10];
93+
tccore::copyTcMenuVersion(szVer, sizeof szVer);
94+
dlg->copyIntoBuffer(szVer);
9295
}
9396
});
9497

0 commit comments

Comments
 (0)