projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update checksum value.
[bertos.git]
/
bertos
/
cpu
/
cortex-m3
/
drv
/
timer_lm3s.c
diff --git
a/bertos/cpu/cortex-m3/drv/timer_lm3s.c
b/bertos/cpu/cortex-m3/drv/timer_lm3s.c
index 2d6ee89ac554519d29e6a5455a6da83548ee0235..096bff92cbb6c6bc98d6e7c375a1db87b9f14e11 100644
(file)
--- a/
bertos/cpu/cortex-m3/drv/timer_lm3s.c
+++ b/
bertos/cpu/cortex-m3/drv/timer_lm3s.c
@@
-37,22
+37,14
@@
#include <cfg/debug.h>
#include <cpu/irq.h>
#include <cfg/debug.h>
#include <cpu/irq.h>
-#include "io/lm3s.h"
-
-#include "irq_lm3s.h"
+#include <io/lm3s.h>
+#include <drv/irq_lm3s.h>
#include "timer_lm3s.h"
#include "timer_lm3s.h"
-unsigned long ticks;
-
INLINE void timer_hw_setPeriod(unsigned long period)
{
ASSERT(period < (1 << 24));
INLINE void timer_hw_setPeriod(unsigned long period)
{
ASSERT(period < (1 << 24));
- HWREG(NVIC_ST_RELOAD) = period;
-}
-
-static void timer_hw_handler(void)
-{
- ticks++;
+ HWREG(NVIC_ST_RELOAD) = period - 1;
}
static void timer_hw_enable(void)
}
static void timer_hw_enable(void)
@@
-68,8
+60,8
@@
static void timer_hw_disable(void)
void timer_hw_init(void)
{
void timer_hw_init(void)
{
- timer_hw_setPeriod(
1000000
);
- sysirq_setHandler(FAULT_SYSTICK, timer_h
w_h
andler);
+ timer_hw_setPeriod(
CPU_FREQ / TIMER_TICKS_PER_SEC
);
+ sysirq_setHandler(FAULT_SYSTICK, timer_handler);
timer_hw_enable();
}
timer_hw_enable();
}