nrf52 nrf51 with same code

Dependencies:   CCS811

Fork of MtConnect04S_MtSense02 by MtM+

Revision:
2:f3768a226561
Parent:
0:4d76c0bc0f78
--- a/source/main.cpp	Tue Jun 27 07:32:43 2017 +0000
+++ b/source/main.cpp	Fri Apr 27 09:52:19 2018 +0000
@@ -22,15 +22,20 @@
 #include "AirQualityService.h"
 
 //initial function pin
+#ifdef NRF52
+Serial pc(p20, p24);
+#else
 Serial pc(p5, p4);
+#endif
+
 I2C i2c(p3, p2);
 DigitalOut ledR(p16, 1);
-CCS811 ccs811(i2c);
+CCS811 ccs811(i2c, pc);
 
 static AirQualityService *AQSPtr;
 static uint16_t eco2, tvoc;
 
-const static char     DEVICE_NAME[] = "MtConnect04sMtSense02";
+const static char     DEVICE_NAME[] = "Mt5MtSense02";
 static const uint16_t uuid16_list[] = {GattService::UUID_BATTERY_SERVICE};
 
 
@@ -143,11 +148,10 @@
     pc.printf("Welcome MTM Node !\r\n");
     
     eventQueue.call_every(500, blinkCallback);
- 
-    
+
     ccs811.init();
 //    ccs811.softRest();
-    eventQueue.call_every(1000, CCS811Callback);
+    eventQueue.call_every(2000, CCS811Callback);
 
     BLE &ble = BLE::Instance();
     ble.onEventsToProcess(scheduleBleEventsProcessing);