From 4d1bbfbad04a9af0436fc1709ac301f19fea9260 Mon Sep 17 00:00:00 2001 From: dufourj Date: Tue, 23 May 2006 08:47:34 +0000 Subject: ES : * LCD : - création de fonctions et découpage dans un autre fichier ; - interfacage fonctionnel. TODO : gestion de nombres de caractères différent de 32 + grub. * Barrillet : - correction d'un warning de link. * RVB : - correction d'un bug en mode ou on ne regarde pas tous les capteurs ; - meilleur détection du bleue. * Servo moteur : - bonnes valeurs et fonction de gestion du servo poubelle. * Sharp : - fonctions de lecture des sharps, sans seuil pour le moment. --- n/es-2006/src/others.h | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'n/es-2006/src/others.h') diff --git a/n/es-2006/src/others.h b/n/es-2006/src/others.h index dd88722..0e25348 100644 --- a/n/es-2006/src/others.h +++ b/n/es-2006/src/others.h @@ -3,7 +3,7 @@ // others.h // es - Input/Output general purpose board. {{{ // -// Copyright (C) 2006 Dufour Jérémy +// Copyright (C) 2006 Patrick Goncalves - (Dufour Jérémy) // // Robot APB Team/Efrei 2004. // Web: http://assos.efrei.fr/robot/ @@ -40,31 +40,31 @@ /* access to value of pins of PORTA */ #define GET_PIN_OF_PORTA(n) ( PINA & _BV(n) ) -// /* SET DDRA */ -// /* set bit of DDR to 0 in order to set the pin n of PORTA in mode in */ -// #define SET_PIN_IN_MODE_IN_OF_PORTA(n) ( DDRA &= ~_BV(n) ) -// /* set bit of DDR to 1 in order to set the pin n of PORTA in mode out */ -// #define SET_PIN_IN_MODE_OUT_OF_PORTA(n) ( DDRA |= ~_BV(n) ) - /** return the value of pin select color */ -inline uint8_t others_selectcoul(void) +inline uint8_t others_selectcoul (void) { - return GET_PIN_OF_PORTA(SELECT_COLOR_PIN); -}; + return GET_PIN_OF_PORTA (SELECT_COLOR_PIN); +} /** return the value of pin jack */ -inline uint8_t others_jack(void) +inline uint8_t others_jack (void) { - return GET_PIN_OF_PORTA(JACK_PIN); -}; + return GET_PIN_OF_PORTA (JACK_PIN); +} /** return the value of pin contact */ -inline uint8_t others_contact(void) +inline uint8_t others_contact (void) { - return GET_PIN_OF_PORTA(CONTACT_PIN); -}; + return GET_PIN_OF_PORTA (CONTACT_PIN); +} + +/** Return the jack and the select_colour at the same time */ +inline uint8_t other_jack_color (void) +{ + return (PINA & 0x03); +} -/** initialisation of color button (put select color pin in mode 'IN') */ +/** Initialisation of color button (put select color pin in mode 'IN') */ inline void others_init(void) { /* init DDRA (0 default) */ @@ -74,9 +74,7 @@ inline void others_init(void) /* DDRA &= ~_BV(SELECT_COLOR_PIN); */ /* pull up in mode in */ - PORTA = PORTA | _BV(SELECT_COLOR_PIN) | _BV(JACK_PIN) | _BV(CONTACT_PIN); -}; - - + PORTA |= _BV(SELECT_COLOR_PIN) | _BV(JACK_PIN) | _BV(CONTACT_PIN); +} #endif // others_h -- cgit v1.2.3