Checking for unnecessary added libraries.

Dependencies:   battery-charger-bq24295 gnss ublox-cellular-base ublox-cellular-driver-gen

Fork of example-C030-out-of-box-demo by Mudassar Hussain

Files at this revision

API Documentation at this revision

Comitter:
euygun
Date:
Wed Jan 10 17:03:44 2018 +0000
Parent:
2:c95852ac6953
Child:
4:d9c8f1687bfc
Commit message:
Added GNSS support and initialisation

Changed in this revision

gnss.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnss.lib	Wed Jan 10 17:03:44 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/ublox/code/gnss/#56eda66d585b
--- a/main.cpp	Tue Sep 26 15:41:17 2017 +0000
+++ b/main.cpp	Wed Jan 10 17:03:44 2018 +0000
@@ -15,6 +15,7 @@
  */
 
 #include "mbed.h"
+#include "gnss.h"
 #include "battery_charger_bq24295.h"
 #include "UbloxCellularDriverGen.h"
 #include "onboard_modem_api.h"
@@ -27,6 +28,9 @@
 DigitalOut ledGreen(LED2, 1);
 DigitalOut ledBlue(LED3, 1);
 
+//GNSS 1V8_MAX IO power
+DigitalOut GNSSOn(GNSSEN, 1);
+
 // Ethernet socket LED 
 DigitalOut ledYellow(LED4,1);
 
@@ -38,6 +42,9 @@
     InterruptIn userButton(SW0);
 #endif
 
+// GNSS
+GnssSerial gnss;
+
 // i2c3 Bus
 I2C i2c3(I2C_SDA_B, I2C_SCL_B);
     
@@ -74,6 +81,16 @@
 
 int main()
 {
+    printf("u-blox C030 Out-of-the-Box Demo\n\r");
+
+    // GNSS initialisation
+    if(gnss.init()) {
+        printf("GNSS initialised.\n\r");
+    }
+    else {
+        printf("GNSS initialisation failure.\n\r");
+    }
+   
     // The battery charger initialisation
     charger.init(&i2c3);   
     charger.setInputVoltageLimit(MIN_INPUT_VOLTAGE_LIMIT_MV); 
@@ -89,12 +106,16 @@
     // Create threadUserButtonCheck thread
     Thread threadUserButtonCheck(threadBodyUserButtonCheck);
 
+    
+    //Set GNSS IO On
+    GNSSOn = 1;
+    
     // Set the LED states
     ledRed = 0;
     ledGreen = 1;
     ledBlue = 1;
     
-    printf("u-blox C030 Out-of-the-Box Demo\n\r");
+    printf("u-blox C030 Out-of-the-Box Demo: LED loop\n\r");
     
     //Main loop
     while(1) {
--- a/mbed-os.lib	Tue Sep 26 15:41:17 2017 +0000
+++ b/mbed-os.lib	Wed Jan 10 17:03:44 2018 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#ca661f9d28526ca8f874b05432493a489c9671ea
+https://github.com/ARMmbed/mbed-os/#eca67ca7dafab4ef70c21e2463b541132d0dd691