Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_53L1A1_mbed
Revision 4:b3346923eb1e, committed 2021-05-11
- Comitter:
- johnAlexander
- Date:
- Tue May 11 09:37:42 2021 +0000
- Parent:
- 3:e30428692405
- Commit message:
- Add support for MbedOS v6.x.; Override serial port default of 9600 baud, for printfs. Now set at 115200 baud, to match header comment.
Changed in this revision
--- a/X_NUCLEO_53L1A1_mbed.lib Tue May 11 09:20:19 2021 +0000 +++ b/X_NUCLEO_53L1A1_mbed.lib Tue May 11 09:37:42 2021 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/ST-Expansion-SW-Team/code/X_NUCLEO_53L1A1_mbed/#24a73ef7469f +https://os.mbed.com/teams/ST-Expansion-SW-Team/code/X_NUCLEO_53L1A1_mbed/#ee29a8ce93d5
--- a/main.cpp Tue May 11 09:20:19 2021 +0000
+++ b/main.cpp Tue May 11 09:37:42 2021 +0000
@@ -37,7 +37,12 @@
#define VL53L1_I2C_SCL D15
static XNucleo53L1A1 *board=NULL;
+#if (MBED_VERSION > 60300)
+UnbufferedSerial pc(USBTX, USBRX);
+extern "C" void wait_ms(int ms);
+#else
Serial pc(SERIAL_TX, SERIAL_RX);
+#endif
/* flags that handle interrupt request for sensor and user blue button*/
volatile bool int_sensor = false;
@@ -124,9 +129,18 @@
int main()
{
#if USER_BUTTON==PC_13 // we are cross compiling for Nucleo-f401
- InterruptIn stop_button(USER_BUTTON);
- stop_button.rise(&measuring_stop_irq);
+// InterruptIn stop_button(USER_BUTTON);
+// stop_button.rise(&measuring_stop_irq);
#endif
+ pc.baud(115200); // baud rate is important as printf statements take a lot of time
+
vl53L1X_DevI2C *device_i2c = new vl53L1X_DevI2C(VL53L1_I2C_SDA, VL53L1_I2C_SCL);
range_measure(device_i2c); // start continuous measures
}
+
+#if (MBED_VERSION > 60300)
+extern "C" void wait_ms(int ms)
+{
+ thread_sleep_for(ms);
+}
+#endif
--- a/mbed-os.lib Tue May 11 09:20:19 2021 +0000 +++ b/mbed-os.lib Tue May 11 09:37:42 2021 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#0be7685a27f28c02737f42055f4a9c182a7b483c +https://github.com/ARMmbed/mbed-os/#9738b27c7df897c29e9769911d6794ba3e5b3f19