From 633c646ab36368caf6eaeedd326d9f1835196afd Mon Sep 17 00:00:00 2001 From: henryk Date: Tue, 6 Nov 2007 20:26:48 +0000 Subject: Initial import of FreeRTOS code for OpenPICC git-svn-id: https://svn.openpcd.org:2342/trunk@311 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/led.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 openpicc/application/led.c (limited to 'openpicc/application/led.c') diff --git a/openpicc/application/led.c b/openpicc/application/led.c new file mode 100644 index 0000000..c414e92 --- /dev/null +++ b/openpicc/application/led.c @@ -0,0 +1,90 @@ +/*************************************************************** + * + * OpenBeacon.org - LED support + * + * Copyright 2007 Milosch Meriac + * + *************************************************************** + + 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; version 2. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +*/ +#include +#include +#include +#include +#include +#include +#include "led.h" +/**********************************************************************/ + +void vLedSetRed(bool_t on) +{ + if(on) + AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, LED_RED ); + else + AT91F_PIO_SetOutput( AT91C_BASE_PIOA, LED_RED ); +} +/**********************************************************************/ + +extern void vLedSetGreen(bool_t on) +{ + if(on) + AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, LED_GREEN ); + else + AT91F_PIO_SetOutput( AT91C_BASE_PIOA, LED_GREEN ); +} +/**********************************************************************/ + +void vLedHaltBlinking(int reason) +{ + volatile u_int32_t i=0; + while(1) + { + AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, LED_MASK ); + for(i=0; i