wayne roberts / Mbed OS LoRaWAN_singlechannel_gateway

Dependencies:   SX127x sx12xx_hal

Revision:
10:6783623cc886
Parent:
9:a0ce66c18ec0
Child:
11:50d0558a4e37
--- a/main.cpp	Wed Jul 05 18:55:01 2017 +0000
+++ b/main.cpp	Wed Jul 12 00:12:41 2017 +0000
@@ -2,11 +2,12 @@
 #include "tim.h"
 #include "commands.h"
 
-
+#define TYPE_ABZ
 RawSerial pc(USBTX, USBRX);
 Timer timer;
 
-#if defined(TARGET_DISCO_L072CZ_LRWAN1)
+//#if defined(TARGET_DISCO_L072CZ_LRWAN1)
+#if defined(TARGET_NUCLEO_L073RZ) && defined(TYPE_ABZ)
     SPI spi(PA_7, PA_6, PB_3); // mosi, miso, sclk
     //           dio0, dio1,  nss,  spi,  rst
     SX127x radio(PB_4, PB_1, PA_15, spi, PC_0); // sx1276 arduino shield
@@ -186,7 +187,7 @@
         a_3 += buf[3];
         lum = buf[4] << 8;
         lum += buf[5];
-        printf("SENSOR gpi:%u, gpo:%u, a1:%u, a3:%u lum:%u\r\n", (buf[GPO_IDX] & 2) >> 1,  buf[GPO_IDX] & 1, a_1, a_3, lum);
+        printf("SENSOR gpi:%u, gpo:%u, a1:%u, a3:%u, lum:%u\r\n", (buf[GPO_IDX] & 2) >> 1,  buf[GPO_IDX] & 1, a_1, a_3, lum);
     } else if (port == TEXT_PORT) {
         buf[buflen] = 0;
         printf("TEXT %s\r\n", buf);
@@ -234,7 +235,7 @@
         case SERVICE_READ_FIFO:
             LoRaWan::rx_slot = tim_get_current_slot();
             LoRaWan::rx_ms = timer.read_ms();
-            printf("%.1fdB %ddBm ", lora.RegPktSnrValue / 4.0, lora.get_pkt_rssi());
+            printf("%.1fdB, %ddBm, ", lora.RegPktSnrValue / 4.0, lora.get_pkt_rssi());
             if (LoRaWan::parse_receive()) {
                 radio.set_opmode(RF_OPMODE_STANDBY);
                 wait(0.05);
@@ -629,7 +630,8 @@
 
     radio.hw_reset();
 
-#ifndef TARGET_DISCO_L072CZ_LRWAN1
+//#ifndef TARGET_DISCO_L072CZ_LRWAN1
+#ifndef TYPE_ABZ
     rfsw.input();
     if (rfsw.read()) {
         printf("LAS\r\n");