From 9ee250e40709565b5d18656f146880574c71e4cf Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Mon, 14 Apr 2008 00:55:57 +0200 Subject: * digital/asserv/src/asserv: - when the maximum PWM value is sent over SPI to motor-power-avr, it is shifted, left, then right... This introduces a bug when the value is negative as it is truncated to the value below which can not be represented as a positive integer. --- digital/asserv/src/asserv/pwm.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'digital/asserv') diff --git a/digital/asserv/src/asserv/pwm.h b/digital/asserv/src/asserv/pwm.h index 3d738538..d980a6a6 100644 --- a/digital/asserv/src/asserv/pwm.h +++ b/digital/asserv/src/asserv/pwm.h @@ -25,8 +25,10 @@ * * }}} */ -/** Define the absolute maximum PWM value. */ -#define PWM_MAX 0x3ff +/** Define the absolute maximum PWM value. + * This value is lowered until the bug relatives to maximum value is fixed + * (rounding after shifting bug). */ +#define PWM_MAX 0x3f0 extern int16_t pwm_left, pwm_right, pwm_aux0; extern uint8_t pwm_reverse; -- cgit v1.2.3