From ee77553fad33ba351358639bdb23738f837020f0 Mon Sep 17 00:00:00 2001 From: Guillaume Chevillot Date: Mon, 11 Feb 2008 11:41:31 +0100 Subject: Found the good regv macro and use it. --- analog/motor-power-avr/src/mp_pwm_LR_.h | 6 ++--- analog/motor-power-avr/src/pwm.avr.c | 2 +- analog/motor-power-avr/src/timer.avr.c | 2 +- analog/motor-power-avr/src/utils.h | 45 --------------------------------- 4 files changed, 5 insertions(+), 50 deletions(-) delete mode 100644 analog/motor-power-avr/src/utils.h (limited to 'analog/motor-power-avr') diff --git a/analog/motor-power-avr/src/mp_pwm_LR_.h b/analog/motor-power-avr/src/mp_pwm_LR_.h index 09fafb38..83e0d584 100644 --- a/analog/motor-power-avr/src/mp_pwm_LR_.h +++ b/analog/motor-power-avr/src/mp_pwm_LR_.h @@ -28,7 +28,7 @@ #include "common.h" #include "io.h" -#include "utils.h" +#include "modules/utils/utils.h" // Control outputs of H-bridges // _L_/_R_ : Left or Right bridge @@ -77,8 +77,8 @@ 0, 0, 0, 0, 0, 0, 1, 0)) // timer interrupts configuration -#define TIMSK_LR_CFG (regv (OCIE2, TOIE2, TICIE1, OCIE1A, OCIE1B, OCIE0, TOIE0, 0, \ - 1, 1, 0, 0, 0, 1, 1, 0)) +#define TIMSK_LR_CFG (regv (OCIE2, TOIE2, TICIE1, OCIE1A, OCIE1B, TOIE0, OCIE0, TOIE0, \ + 1, 1, 0, 0, 0, 0, 1, 1)) // PWM max, min, and offset values #define PWM_MIN_LR_ 0x10 diff --git a/analog/motor-power-avr/src/pwm.avr.c b/analog/motor-power-avr/src/pwm.avr.c index 90115768..01195a8e 100644 --- a/analog/motor-power-avr/src/pwm.avr.c +++ b/analog/motor-power-avr/src/pwm.avr.c @@ -23,7 +23,7 @@ * * }}} */ -#include "utils.h" +#include "modules/utils/utils.avr.h" /** Define the PWM output used for left motor. */ #define PWM_LEFT_OCR OCR1C diff --git a/analog/motor-power-avr/src/timer.avr.c b/analog/motor-power-avr/src/timer.avr.c index 0532bd28..b824efc8 100644 --- a/analog/motor-power-avr/src/timer.avr.c +++ b/analog/motor-power-avr/src/timer.avr.c @@ -25,7 +25,7 @@ /* +AutoDec */ -#include "utils.h" +#include "modules/utils/utils.avr.h" /** Initialise the timer. */ static inline void diff --git a/analog/motor-power-avr/src/utils.h b/analog/motor-power-avr/src/utils.h deleted file mode 100644 index 54cb978e..00000000 --- a/analog/motor-power-avr/src/utils.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef utils_h -#define utils_h -/* utils.h */ -/* {{{ - * - * Copyright (C) 2008 Pierre Prot - * - * APBTeam: - * Web: http://apbteam.org/ - * Email: team AT apbteam DOT org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * }}} */ - - -/* Concatenate 8 bits values. - * vx: bit value - * bx: bit shift - */ -#define regv(b0, b1, b2, b3, b4, b5, b6, b7, v0, v1, v2, v3, v4, v5, v6, v7) \ - ( \ - ((v0 && 1) << b0) | \ - ((v1 && 1) << b1) | \ - ((v2 && 1) << b2) | \ - ((v3 && 1) << b3) | \ - ((v4 && 1) << b4) | \ - ((v5 && 1) << b5) | \ - ((v6 && 1) << b6) | \ - ((v7 && 1) << b7) \ - ) - -#endif -- cgit v1.2.3