From acf4617c9f264dc5813abb4b305d8c1d76ad19b0 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Tue, 3 Apr 2012 18:35:01 +0200 Subject: digital/beacon: file restructuration (license header) --- digital/beacon/src/sensors.c | 153 ++++++++++++++----------------------------- 1 file changed, 50 insertions(+), 103 deletions(-) (limited to 'digital/beacon/src/sensors.c') diff --git a/digital/beacon/src/sensors.c b/digital/beacon/src/sensors.c index 150da7fa..6b7a11bb 100644 --- a/digital/beacon/src/sensors.c +++ b/digital/beacon/src/sensors.c @@ -1,127 +1,74 @@ +/* sensors.c */ +/* Beacon sensors management. {{{ + * + * Copyright (C) 2012 Florent Duchon + * + * 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. + * + * }}} */ + #include -// #include -// #include #include #include "sensors.h" -// #include -// #include -// #include -// #include - -/* External variables */ -// extern APS_DataReq_t test; -// extern HAL_UsartDescriptor_t appUsartDescriptor; -// extern uint8_t usartTxBuffer[APP_USART_TX_BUFFER_SIZE]; -// extern unsigned int top_tour; -// extern unsigned int last_tour_time; -// extern int activation_asserv; -// extern int nb_top; -// extern long last_seen_laser; - -int consigne_motor_ms = 100; -int security_ils = 1; -int old_top_tour = 0; -long angle = 0; -unsigned int status_temps_tour = 0; -unsigned int top_laser; -unsigned int counter_top_tour; /********************************************************/ -void init_sensors(void) -{ -// HAL_RegisterIrq(IRQ_7,IRQ_RISING_EDGE,irq_laser); -} - -void init_ILS(void) -{ - PORTE = (1< 0xd5) - { - OCR3A = 0xd5; - } - else - { - OCR3A = correction; - } + /* Define the compare value */ + OCR3A = CODEWHEEL_CPR; + + /* Enable Interrupts */ + sei(); } -void init_ic(void) +/* This function returns the wheel position */ +int sensors_codewheel_get_value(void) { - TCCR3A|=(1<