projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
USB: coding style fixes (structure naming)
[bertos.git]
/
bertos
/
drv
/
pwm.c
diff --git
a/bertos/drv/pwm.c
b/bertos/drv/pwm.c
index 021d2437c79e4f7f1e9b44cc74f7de1ff628e77a..d09d9627caa16a0d9da491ee06409ac376203d94 100644
(file)
--- a/
bertos/drv/pwm.c
+++ b/
bertos/drv/pwm.c
@@
-32,13
+32,21
@@
*
* \brief PWM driver (implementation)
*
*
* \brief PWM driver (implementation)
*
- * \version $Id$
*
* \author Francesco Sacchi <batt@develer.com>
* \author Daniele Basile <asterix@develer.com>
*/
*
* \author Francesco Sacchi <batt@develer.com>
* \author Daniele Basile <asterix@develer.com>
*/
+#include "cfg/cfg_pwm.h"
+
#include <cfg/macros.h>
#include <cfg/macros.h>
+#include <cfg/module.h>
+
+// Define logging setting (for cfg/log.h module).
+#define LOG_LEVEL PWM_LOG_LEVEL
+#define LOG_VERBOSITY PWM_LOG_FORMAT
+
+#include <cfg/log.h>
#include <cfg/debug.h>
#include <drv/pwm.h>
#include <cfg/debug.h>
#include <drv/pwm.h>
@@
-63,7
+71,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;
-
// TRACEMSG("real_duty[%d] duty[%d], period[%d]
", real_duty, duty, period);
+
LOG_INFO("real_duty[%d] duty[%d], period[%d]\n
", real_duty, duty, period);
pwm_hw_setDutyUnlock(dev, real_duty);
}
pwm_hw_setDutyUnlock(dev, real_duty);
}
@@
-86,12
+94,14
@@
void pwm_enable(PwmDev dev, bool state)
pwm_hw_disable(dev);
}
pwm_hw_disable(dev);
}
+MOD_DEFINE(pwm);
+
/**
* Initialize PWM hw.
*/
void pwm_init(void)
{
/**
* Initialize PWM hw.
*/
void pwm_init(void)
{
- cpuflags_t flags;
+ cpu
_
flags_t flags;
PwmDev dev;
IRQ_SAVE_DISABLE(flags);
PwmDev dev;
IRQ_SAVE_DISABLE(flags);
@@
-103,6
+113,7
@@
void pwm_init(void)
pwm_setDuty(dev, 0);
IRQ_RESTORE(flags);
pwm_setDuty(dev, 0);
IRQ_RESTORE(flags);
+ MOD_INIT(pwm);
}
}