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: mbed QEI DmTftLibrary
Diff: main.cpp
- Revision:
- 15:ed7ed20b7114
- Parent:
- 14:ebd89dacc807
- Child:
- 17:a0bbfc228415
--- a/main.cpp Thu Aug 17 10:22:32 2017 +0000
+++ b/main.cpp Fri Aug 18 08:26:13 2017 +0000
@@ -19,6 +19,7 @@
#include "GpsMax7.h"
#include "SX9306.h"
#include "sx1280-hal.h"
+#include "main.h"
/*!
@@ -26,6 +27,8 @@
*/
DigitalOut F_CS( D6 ); // MBED description of pin
DigitalOut SD_CS( D8 ); // MBED description of pin
+DigitalIn userButton( USER_BUTTON );
+
/*!
* \brief Specify serial datarate for UART debug output
@@ -51,6 +54,12 @@
printf( "Starting SX1280DevKit : %s\n\r", FIRMWARE_VERSION );
EepromInit( );
+
+ if( userButton == 0 )
+ {
+ FactoryReset( );
+ }
+
InitDemoApplication( );
MenuInit( );
TimersInit( );
@@ -112,3 +121,9 @@
}
}
}
+
+void FactoryReset( void )
+{
+ EepromFactoryReset( );
+ HAL_NVIC_SystemReset( );
+}