Senet-ized LMIC for MOTE_L152RC
Fork of lmic_MOTE_L152RC by
Revision 4:1a9a62cf220f, committed 2015-07-07
- Comitter:
- dudmuck
- Date:
- Tue Jul 07 18:25:05 2015 +0000
- Parent:
- 3:d87012f45bf6
- Child:
- 5:e4ba433f0ac1
- Commit message:
- correct the value of MAP_DIO2_LORA_NOP
Changed in this revision
| TARGET_MOTE_L152RC/hal.cpp | Show annotated file Show diff for this revision Revisions of this file |
| radio.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/TARGET_MOTE_L152RC/hal.cpp Thu Jun 18 23:22:43 2015 +0000
+++ b/TARGET_MOTE_L152RC/hal.cpp Tue Jul 07 18:25:05 2015 +0000
@@ -18,12 +18,10 @@
static DigitalInOut rst(RESET_PIN);
-//DigitalOut RFSwitch_CNTR_2(PC_13);
-//static DigitalOut rxtx(PC_4); // RFSwitch_CNTR_1
DigitalOut rfsw1(RFSW1);
DigitalOut rfsw2(RFSW2);
-static DigitalOut hdr_fem_ctx(PC_7);
+DigitalOut hdr_fem_ctx(PC_1);
static InterruptIn dio0(PC_6);
static InterruptIn dio1(PC_10);
@@ -245,7 +243,7 @@
#ifdef SLEEP_DEBUG
start_tick = hal_ticks();
#endif /* SLEEP_DEBUG */
- hdr_fem_ctx = 1;
+ //hdr_fem_ctx = 1;
if (deep_sleep) {
#ifndef USE_DEBUGGER
@@ -262,7 +260,7 @@
} else
sleep(); // blocks until waking
- hdr_fem_ctx = 0;
+ //hdr_fem_ctx = 0;
#ifdef SLEEP_DEBUG
end_tick = hal_ticks();
time_asleep = end_tick - start_tick;
@@ -307,12 +305,15 @@
rfsw2 = 1;
rfsw1 = 0;
}
+ //hdr_fem_ctx = 0; // debug
} else if (mode == OPMODE_RX || mode == OPMODE_RX_SINGLE || mode == OPMODE_CAD) { // start of reception
rfsw2 = 1;
- rfsw1 = 1;
+ rfsw1 = 1;
+ //hdr_fem_ctx = 1; // debug
} else { // RF switch shutdown
rfsw2 = 0;
rfsw1 = 0;
+ //hdr_fem_ctx = 0; // debug
}
}
--- a/radio.cpp Thu Jun 18 23:22:43 2015 +0000
+++ b/radio.cpp Tue Jul 07 18:25:05 2015 +0000
@@ -228,7 +228,7 @@
#define MAP_DIO0_LORA_TXDONE 0x40 // 01------
#define MAP_DIO1_LORA_RXTOUT 0x00 // --00----
#define MAP_DIO1_LORA_NOP 0x30 // --11----
-#define MAP_DIO2_LORA_NOP 0xC0 // ----11--
+#define MAP_DIO2_LORA_NOP 0x0c // ----11--
#define MAP_DIO0_FSK_READY 0x00 // 00------ (packet sent / payload ready)
#define MAP_DIO1_FSK_NOP 0x30 // --11----
@@ -295,7 +295,7 @@
hal_pin_nss(1);
}
-static void opmode (u1_t mode) {
+static void opmode (u1_t mode) {
hal_opmode(mode, PaSelect);
writeReg(RegOpMode, (readReg(RegOpMode) & ~OPMODE_MASK) | mode);
}


