projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move appconfig to cfg dir.
[bertos.git]
/
bertos
/
drv
/
pwm.c
diff --git
a/bertos/drv/pwm.c
b/bertos/drv/pwm.c
index 3946188262263c0f406062adef2fac522a19d77b..ef18612e7541d028c5d31da0680b0ca74f2241bd 100644
(file)
--- a/
bertos/drv/pwm.c
+++ b/
bertos/drv/pwm.c
@@
-38,14
+38,15
@@
* \author Daniele Basile <asterix@develer.com>
*/
* \author Daniele Basile <asterix@develer.com>
*/
-#include <c
pu/type
s.h>
-#include <c
pu/irq
.h>
+#include <c
fg/macro
s.h>
+#include <c
fg/debug
.h>
#include <drv/pwm.h>
#include <drv/pwm.h>
-#include <drv/pwm_at91.h>
-#include <cfg/macros.h>
-#include <cfg/debug.h>
+#include CPU_HEADER(pwm)
+
+#include <cpu/types.h>
+#include <cpu/irq.h>
/**
/**
@@
-62,7
+63,7
@@
void pwm_setDuty(PwmDev dev, pwm_duty_t duty)
real_duty = (uint64_t)(duty * period) >> (uint64_t)PWM_MAX_PERIOD_LOG2;
real_duty = (uint64_t)(duty * period) >> (uint64_t)PWM_MAX_PERIOD_LOG2;
-//
kprintf("real_duty[%d] duty[%d], period[%d]\n
", real_duty, duty, period);
+//
TRACEMSG("real_duty[%d] duty[%d], period[%d]
", real_duty, duty, period);
pwm_hw_setDutyUnlock(dev, real_duty);
}
pwm_hw_setDutyUnlock(dev, real_duty);
}
@@
-95,12
+96,12
@@
void pwm_init(void)
IRQ_SAVE_DISABLE(flags);
IRQ_SAVE_DISABLE(flags);
+ pwm_hw_init();
+
/* set all pwm to 0 */
for (dev = 0; dev < PWM_CNT; dev++)
pwm_setDuty(dev, 0);
/* set all pwm to 0 */
for (dev = 0; dev < PWM_CNT; dev++)
pwm_setDuty(dev, 0);
- pwm_hw_init();
-
IRQ_RESTORE(flags);
}
IRQ_RESTORE(flags);
}