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: FXAS21002 FXOS8700Q
Revision 13:ec1c3a64ee39, committed 2019-07-24
- Comitter:
- Daniel_Lee
- Date:
- Wed Jul 24 16:20:11 2019 +0000
- Parent:
- 12:0c8a04b59cef
- Commit message:
- Update;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 0c8a04b59cef -r ec1c3a64ee39 main.cpp
--- a/main.cpp Wed Jul 24 16:08:43 2019 +0000
+++ b/main.cpp Wed Jul 24 16:20:11 2019 +0000
@@ -83,6 +83,23 @@
#endif /* TARGET_K66F */
#endif /* SEND_ALL_SENSORS */
+void BG96_Modem_PowerON(void)
+{
+ DigitalOut BG96_RESET(D7);
+ DigitalOut BG96_PWRKEY(D9);
+
+ BG96_RESET = 1;
+ BG96_PWRKEY = 1;
+ wait_ms(200);
+
+ BG96_RESET = 0;
+ BG96_PWRKEY = 0;
+ wait_ms(300);
+
+ BG96_RESET = 1;
+ wait_ms(5000);
+}
+
// An event queue is a very useful structure to debounce information between contexts (e.g. ISR and normal threads)
// This is great because things such as network operations are illegal in ISR, so updating a resource in a button's fall() function is not allowed
EventQueue eventQueue;
@@ -234,6 +251,9 @@
printf("You can hold the user button during boot to format the storage and change the device identity.\n");
}
+ BG96_Modem_PowerON();
+ printf("M2Mnet(BG96) Power ON\n");
+
sensors_init();
// Connect to the Internet (DHCP is expected to be on)