Senet-ized LMIC for MOTE_L152RC
Fork of lmic_MOTE_L152RC by
Revision 1:04fd63382b03, committed 2015-06-03
- Comitter:
- dudmuck
- Date:
- Wed Jun 03 23:17:59 2015 +0000
- Parent:
- 0:f2716e543d97
- Child:
- 2:edb5d1f3deeb
- Commit message:
- fix hal_ticks()
Changed in this revision
| TARGET_MOTE_L152RC/hal.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/TARGET_MOTE_L152RC/hal.cpp Tue Jun 02 19:04:29 2015 +0000
+++ b/TARGET_MOTE_L152RC/hal.cpp Wed Jun 03 23:17:59 2015 +0000
@@ -163,9 +163,9 @@
// Convert to timestamp
time_t t = mktime(&timeinfo);
- t &= 0xffff;
// 14: SSR is driven at 16384Hz
- return (t << 14) | sub_seconds;
+ t <<= 14;
+ return t | sub_seconds;
}
void hal_waitUntil (u4_t time)
@@ -234,6 +234,9 @@
for (;;) asm("nop");
#endif /* USE_DEBUGGER */
+ //printf("%x cr:%06x isr:%04x %d\r\n", RtcHandle.Instance->WUTR, RtcHandle.Instance->CR, RtcHandle.Instance->ISR, deep_sleep);
+ //debug_done();
+
if (deep_sleep)
debug_done(); // wait here if debug still printing
@@ -263,7 +266,7 @@
#ifdef SLEEP_DEBUG
end_tick = hal_ticks();
time_asleep = end_tick - start_tick;
- printf("%d\r\n", time_asleep);
+ printf("%u = %u - %u\r\n", time_asleep, end_tick, start_tick);
#endif /* SLEEP_DEBUG */
// restore gpio from sleep
}


