forked from LuckfoxTECH/luckfox-pico
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
alistairjordan
committed
Jan 3, 2024
1 parent
1662e64
commit 437062c
Showing
10 changed files
with
1,877 additions
and
708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,455 changes: 1,765 additions & 690 deletions
2,455
sysdrv/tools/board/lorawan-bridge/LoraMac/region/Region.c
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "timer.h" | ||
#include "rtc-board.h" | ||
|
||
void RtcProcess( void ) | ||
{ | ||
// Not used on this platform. | ||
} | ||
|
||
|
||
uint32_t GettimeToTicks(struct timespec *ts) { | ||
uint32_t time; | ||
time += ts->tv_sec * 1000000000; | ||
time += ts->tv_nsec; | ||
return time; | ||
} | ||
|
||
struct timespec TicksToGettime(uint32_t time) { | ||
struct timespec ts; | ||
ts.tv_sec += time / 1000000000; | ||
ts.tv_nsec += time % 1000000000; | ||
return ts; | ||
} | ||
|
||
TimerTime_t RtcTempCompensation( TimerTime_t period, float temperature ) | ||
{ | ||
//aka, not implemented on this board. | ||
TimerTime_t time = 0; | ||
return time; | ||
} | ||
|
||
uint32_t RtcGetMinimumTimeout( void ) | ||
{ | ||
return 0; //( MIN_ALARM_DELAY ); | ||
} | ||
|
||
uint32_t RtcGetTimerValue(void) { | ||
uint32_t time; | ||
struct timespec ts; | ||
clock_gettime(CLOCK_MONOTONIC, &ts); | ||
time = GettimeToTicks(&ts); | ||
} | ||
|
||
uint32_t RtcTick2Ms(uint32_t clock) { | ||
return clock / 1000000; | ||
} | ||
|
||
uint32_t RtcMs2Tick(uint32_t clock) { | ||
return clock * 1000000; | ||
} | ||
|
||
void RtcSetAlarm( uint32_t timeout ) { | ||
struct timespec ts = TicksToGettime(timeout); | ||
nanosleep(&ts, NULL); | ||
} | ||
|
||
void RtcStopAlarm(void) { | ||
//not needed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.