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.
Fork of Sean_AdiSense1000_V21 by
Diff: main.cpp
- Revision:
- 36:4aded4b4f060
- Parent:
- 35:853be4d80ff3
--- a/main.cpp Thu Sep 27 12:14:22 2018 +0000
+++ b/main.cpp Thu Oct 25 08:59:30 2018 +0000
@@ -100,7 +100,7 @@
extern ADI_SENSE_CONNECTION connectionInfo;
-/*
+
//normal routine for debugging
int main()
{
@@ -212,8 +212,7 @@
}
- //Kick off the measurement cycle here
-
+ //Kick off the measurement cycle here
ADI_SENSE_LOG_INFO("Configuration completed, starting measurement cycles");
utils_runMeasurement(hDevice, eMeasurementMode);
@@ -228,94 +227,4 @@
}
return 0;
-}
-*/
-
-
-int main( void )
-{
- int ret = 1;
- bool bleActive;
-
- // Indicate device is booting
- Led_Boot();
-
- // Check if device needs to enter bootloader function, this is set via a PC command
- // Flag is stored in RTC registers that persist while vbat is powered
- bool_t bBootLoader = Rcc_ReadBackupReg( BOOTLOADER_FLAG_BACKUP_REG ) == 1 ? true : false;
-
- if( bBootLoader ) {
-
- // Let user know device is entering bootloader mode
- Pc_ResetSuccess( bBootLoader );
-
- // Jump to bootloader
- Bootloader_Init();
- }
-
- // Otherwise, boot main program
-
- // Boot the adisense1000 to a known state
- ret = Adisense1000_Boot();
- bool adiSense1000Active = !ret;
-
-#ifdef BL652
- //boot BLE device
- ret = Bl652_Boot();
- if (ret == 0) {
- ADI_SENSE_LOG_INFO("BLE Boot success..");
- } else {
- ADI_SENSE_LOG_INFO("BLE Boot unsuccessful..");
- }
-#endif
-
- // Set if ble is present or not
- // If not, the PC interface can still be initialised
- bleActive = !ret;
-
- // Check adisense has booted correctly
- if( adiSense1000Active ) {
- Pc_ResetSuccess( bBootLoader );
- ADI_SENSE_LOG_INFO("ADIsense boot successful 25/09/2018");
- ADI_SENSE_LOG_INFO("Firmware Version 2.1");
- ADI_SENSE_LOG_INFO("\t Available BLE COMMANDS:");
- ADI_SENSE_LOG_INFO("REQ_REG_PACKET_COUNT = 0x21, //'!'");
- ADI_SENSE_LOG_INFO("REQ_REG_PACKETS = 0x40, //'@'");
- ADI_SENSE_LOG_INFO("REQ_FIELD_NAMES = 0x23 0x0, //'#'");
- ADI_SENSE_LOG_INFO("START_STREAM = 0x24, //'$'");
- ADI_SENSE_LOG_INFO("STOP_STREAM = 0x25, //'percentage symbol'");
- ADI_SENSE_LOG_INFO(" ");
- ADI_SENSE_LOG_INFO("\t Available PC COMMANDS:");
- ADI_SENSE_LOG_INFO("DEVICE_INFO = 'i'");
- ADI_SENSE_LOG_INFO("FLASH_LED = 'f'");
- ADI_SENSE_LOG_INFO("RESET = 'r'");
- ADI_SENSE_LOG_INFO("CONFIGURE = 'c'");
- ADI_SENSE_LOG_INFO("APPLY = 'u'");
- ADI_SENSE_LOG_INFO("SAMPLE = 's'");
- ADI_SENSE_LOG_INFO("START_STREAM = 'd'");
- ADI_SENSE_LOG_INFO("STOP_STREAM = 'h'");
- ADI_SENSE_LOG_INFO("UPDATE_FW_VERSION = 'v'");
- }
- else {
- // Cannot continue without adi_sense module
- exit( 1 );
- }
-
- // Set led on to indicate boot has completed
-
- ADI_SENSE_LOG_INFO("Set LED Idle...");
- Led_Idle();
-
- // Begin main program
- ADI_SENSE_LOG_INFO("Begin main program...");
- while(1) {
- // Read in a command and handle appropriately
- ret = MyProSwift_Command( bleActive );
- if( ret != 0 ) {
- // Errors should be handled at lower levels, using reponse codes
- // to the appropriate active interface
- // exit(1);
- }
- }
-}
-
+}
\ No newline at end of file
