From 673384b11b5f5d6b806d60eaa2dadda330c57644 Mon Sep 17 00:00:00 2001 From: Michal Horn Date: Wed, 28 Aug 2013 21:21:51 +0200 Subject: [PATCH] H-bridge bug with checking period limit repair. --- rpp/include/rpp/hbr.h | 4 +--- rpp/src/drv/hbridge.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/rpp/include/rpp/hbr.h b/rpp/include/rpp/hbr.h index 3bbd15a..8d9d997 100644 --- a/rpp/include/rpp/hbr.h +++ b/rpp/include/rpp/hbr.h @@ -43,9 +43,7 @@ int8_t rpp_hbr_init(); * required): * @par * - Minimum value is [1us]: - * - 1us = 0.001 ms => - * - 1000000 Hz = 1 MHz - * - A pulse of 1% of the duty cycle -> 100 MHz (X) + * - 50us => 20 kHz * - System clock is 80MHz. * @par * - Maximum value is [2147483647us] (full 32bit signed integer): diff --git a/rpp/src/drv/hbridge.c b/rpp/src/drv/hbridge.c index c6bafe0..e0a17e2 100644 --- a/rpp/src/drv/hbridge.c +++ b/rpp/src/drv/hbridge.c @@ -187,7 +187,7 @@ int8_t drv_hbr_wdg_stop() * Set period and dutycycle to HBR_PWM pin. * Period is expected to be in us, duty cycle in percent of the period, * - * If period is lower than 1 or duty greater than 100, function returns without having effect. + * If period is lower than 50us or duty greater than 100, function returns without having effect. * * @param[in] period Period of PWM in us * @param[in] duty Width of duty in % @@ -200,7 +200,7 @@ int8_t drv_hbr_pwm_set_signal(double period, uint32_t duty) return FAILURE; } - if(period < 1) { + if(period < 50) { return FAILURE; } -- 2.39.2