X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fpwm.c;h=3062802032c0730d3f4ea22533fdcc7d12b0935d;hb=d63d14e5bcf9973047715fe87bf6aaeecb65dd4a;hp=11c4e04bbb845563b17e2c15e9aad9dc85a7ef8e;hpb=e62ca0b357f09804d7d894949df44224c9d74bb7;p=bertos.git diff --git a/bertos/drv/pwm.c b/bertos/drv/pwm.c index 11c4e04b..30628020 100644 --- a/bertos/drv/pwm.c +++ b/bertos/drv/pwm.c @@ -38,7 +38,16 @@ * \author Daniele Basile */ +#include "cfg/cfg_pwm.h" + #include +#include + +// Define logging setting (for cfg/log.h module). +#define LOG_LEVEL PWM_LOG_LEVEL +#define LOG_VERBOSITY PWM_LOG_FORMAT + +#include #include #include @@ -63,7 +72,7 @@ void pwm_setDuty(PwmDev dev, pwm_duty_t duty) 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]", real_duty, duty, period); pwm_hw_setDutyUnlock(dev, real_duty); } @@ -86,6 +95,8 @@ void pwm_enable(PwmDev dev, bool state) pwm_hw_disable(dev); } +MOD_DEFINE(pwm); + /** * Initialize PWM hw. */ @@ -103,6 +114,7 @@ void pwm_init(void) pwm_setDuty(dev, 0); IRQ_RESTORE(flags); + MOD_INIT(pwm); }