driver: pwm: use new logger

move PWM driver to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2018-09-22 20:02:55 -05:00
commit ff9c20826c
9 changed files with 40 additions and 51 deletions

View file

@ -8,9 +8,9 @@
#include "pwm.h"
#define SYS_LOG_DOMAIN "pwm/nrf5_sw"
#define SYS_LOG_LEVEL CONFIG_SYS_LOG_PWM_LEVEL
#include <logging/sys_log.h>
#define LOG_LEVEL CONFIG_PWM_LOG_LEVEL
#include <logging/log.h>
LOG_MODULE_REGISTER(pwm_nrf5_sw);
struct pwm_config {
NRF_TIMER_Type *timer;
@ -97,18 +97,18 @@ static int pwm_nrf5_sw_pin_set(struct device *dev, u32_t pwm,
ret = pwm_period_check(data, config->map_size, pwm, period_cycles,
pulse_cycles);
if (ret) {
SYS_LOG_ERR("Incompatible period");
LOG_ERR("Incompatible period");
return ret;
}
/* map pwm pin to GPIOTE config/channel */
channel = pwm_channel_map(data, config->map_size, pwm);
if (channel >= config->map_size) {
SYS_LOG_ERR("No more channels available");
LOG_ERR("No more channels available");
return -ENOMEM;
}
SYS_LOG_DBG("PWM %d, period %u, pulse %u", pwm,
LOG_DBG("PWM %d, period %u, pulse %u", pwm,
period_cycles, pulse_cycles);
/* clear GPIOTE config */