timer_delayTicks(): Re-enable check for interrupts to be enabled wheen sleeping.
[bertos.git] / bertos / drv / pwm_test.c
index d088072bb96f184532f0bbb238ac495ebf2054c5..f66fe660e558cb4f9958d91553709e31870bb655 100644 (file)
  * and so the delay is do with a for cycle.
  *
  * \version $Id$
- *
  * \author Daniele Basile <asterix@develer.com>
  */
 
 #include "hw/pwm_map.h" // For PwmDev and channel avaible on thi target
 #include "cfg/cfg_pwm.h"
-
-#include <cfg/log.h>   // for logging system
 #include <cfg/macros.h>
 #include <cfg/debug.h>
 
+// Define logging setting (for cfg/log.h module).
+#define LOG_LEVEL         PWM_LOG_LEVEL
+#define LOG_FORMAT        PWM_LOG_FORMAT
+#include <cfg/log.h>   // for logging system
+
 #include <cpu/types.h>
 #include <cpu/irq.h>
 
@@ -116,7 +118,7 @@ static PwmTest pwm_test_cfg[PWM_CNT] =
  * Setup all needed to test PWM on AT91
  *
  */
-int pwm_testSetup(void)
+int pwm_testSetUp(void)
 {
        LOG_INFO("Init pwm..");
        pwm_init();
@@ -132,10 +134,10 @@ int pwm_testSetup(void)
  */
 int pwm_testRun(void)
 {
-        int duty = 0;
+        pwm_duty_t duty = 0;
         int delay = 0;
 
-        pwm_testSetup();
+        pwm_testSetUp();
 
         LOG_INFO("\n\n===== BeRTOS PWM test =====\n\n");
 
@@ -184,7 +186,7 @@ int pwm_testRun(void)
                 }
 
                 //Reset duty cycle overflow
-                if (duty >= 0xFFFF)
+                if (duty >= (pwm_duty_t)0xFFFF)
                 {
                         duty = 0;
                         for (int i = 0; i < PWM_CNT; i++)
@@ -202,7 +204,7 @@ int pwm_testRun(void)
                 delay++;
         }
 
-        return 0;
+               return 0;
 }
 
 /**