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.
Diff: main.cpp
- Revision:
- 23:bb685f35b08b
- Parent:
- 22:2835e9e9f59f
- Child:
- 28:8a7a908a8fdb
--- a/main.cpp Thu Sep 26 05:56:58 2019 +0000
+++ b/main.cpp Thu Sep 26 06:15:39 2019 +0000
@@ -71,24 +71,22 @@
ADMW_DEVICE_HANDLE hDevice;
ADMW_MEASUREMENT_MODE eMeasurementMode = ADMW_MEASUREMENT_MODE_NORMAL;
bool bDeviceReady;
-
+
/*
* Open an ADMW1001 device instance.
*/
res = admw_Open(0, &connectionInfo, &hDevice);
- if (res != ADMW_SUCCESS)
- {
+ if (res != ADMW_SUCCESS) {
ADMW_LOG_ERROR("Failed to open device instance");
return res;
}
-
+
/*
* Reset the given ADMW1001 device....
*/
ADMW_LOG_INFO("Resetting ADMW1001 device, please wait...");
res = admw_Reset(hDevice);
- if (res != ADMW_SUCCESS)
- {
+ if (res != ADMW_SUCCESS) {
ADMW_LOG_ERROR("Failed to reset device");
return res;
}
@@ -98,8 +96,7 @@
do {
wait_ms(100);
res = admw_GetDeviceReadyState(hDevice, &bDeviceReady);
- if (res != ADMW_SUCCESS)
- {
+ if (res != ADMW_SUCCESS) {
ADMW_LOG_ERROR("Failed to get device ready-state");
return res;
}
@@ -111,14 +108,12 @@
*/
ADMW_LOG_INFO("Setting device configuration");
res = admw_SetConfig(hDevice, pSelectedConfig);
- if (res != ADMW_SUCCESS)
- {
+ if (res != ADMW_SUCCESS) {
ADMW_LOG_ERROR("Failed to set device configuration");
return res;
}
res = admw_ApplyConfigUpdates(hDevice);
- if (res != ADMW_SUCCESS)
- {
+ if (res != ADMW_SUCCESS) {
ADMW_LOG_ERROR("Failed to apply device configuration");
return res;
}
@@ -127,14 +122,12 @@
*/
res = admw_GetStatus(hDevice, &status);
deviceInformation(hDevice);
- if (res != ADMW_SUCCESS)
- {
+ if (res != ADMW_SUCCESS) {
ADMW_LOG_ERROR("Failed to retrieve device status");
return res;
}
if (status.deviceStatus &
- (ADMW_DEVICE_STATUS_ERROR | ADMW_DEVICE_STATUS_ALERT))
- {
+ (ADMW_DEVICE_STATUS_ERROR | ADMW_DEVICE_STATUS_ALERT)) {
utils_printStatus(&status);
}
@@ -148,8 +141,7 @@
* Clean up and exit
*/
res = admw_Close(hDevice);
- if (res != ADMW_SUCCESS)
- {
+ if (res != ADMW_SUCCESS) {
ADMW_LOG_ERROR("Failed to close device instance");
return res;
}