[tuxdroid-svn] r502 - firmware/tuxaudio/branches/audio_cleanup
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-09-07 15:24:25
|
Author: Paul_R Date: 2007-09-07 17:24:24 +0200 (Fri, 07 Sep 2007) New Revision: 502 Added: firmware/tuxaudio/branches/audio_cleanup/hardware.h Modified: firmware/tuxaudio/branches/audio_cleanup/AT26F004.h firmware/tuxaudio/branches/audio_cleanup/Makefile firmware/tuxaudio/branches/audio_cleanup/PC_communication.c firmware/tuxaudio/branches/audio_cleanup/flash.h Log: * Added hardware.h to define tuxaudio hardware spec. * Corrected a bug in the Makefile ... Modified: firmware/tuxaudio/branches/audio_cleanup/AT26F004.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/AT26F004.h 2007-09-07 15:02:33 UTC (rev 501) +++ firmware/tuxaudio/branches/audio_cleanup/AT26F004.h 2007-09-07 15:24:24 UTC (rev 502) @@ -20,6 +20,8 @@ #ifndef AT26F004_H #define AT26F004_H +#include "hardware.h" + /* Flash (AT26F004) OP CODE */ #define READ_ARRAY 0x0B #define READ_ARRAY_LOW_F 0x03 @@ -73,6 +75,10 @@ #define TOP_A0 0xFF /*! @} */ +#define FLASH_CS_ON FLASH_PORT &= ~FLASH_CS_PIN +#define FLASH_CS_OFF FLASH_PORT |= FLASH_CS_PIN +#define HOLD_ON FLASH_PORT &= ~FLASH_HOLD_PIN +#define HOLD_OFF FLASH_PORT |= FLASH_HOLD_PIN extern uint8_t read_status(void); extern void write_enable(void); Modified: firmware/tuxaudio/branches/audio_cleanup/Makefile =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-07 15:02:33 UTC (rev 501) +++ firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-07 15:24:24 UTC (rev 502) @@ -103,7 +103,7 @@ communication.o: communication.c $(CC) $(INCLUDES) $(CFLAGS) -c $< -communication.o: PC_communication.c +PC_communication.o: PC_communication.c $(CC) $(INCLUDES) $(CFLAGS) -c $< i2c.o: i2c.c @@ -151,8 +151,9 @@ endif ## Generate SVN info -.PHONY: svnrev.h -svnrev.h: +# We need to change the status each time a file changes, thus so many +# dependencies +svnrev.h: $(CSOURCE) $(HEADERS) ifdef windir SubWCRev . svnrev.tmpl.h svnrev.h else Modified: firmware/tuxaudio/branches/audio_cleanup/PC_communication.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/PC_communication.c 2007-09-07 15:02:33 UTC (rev 501) +++ firmware/tuxaudio/branches/audio_cleanup/PC_communication.c 2007-09-07 15:24:24 UTC (rev 502) @@ -24,8 +24,10 @@ #include "varis.h" #include "fifo.h" +#include "PC_communication.h" #include "communication.h" #include "spi.h" +#include "AT26F004.h" void spiTransaction(void) { @@ -37,7 +39,7 @@ spi_slave = HEADERS; // Set state machine spi_master = HEADERM; if (programmingFlash) - PORTB &= ~0x01; + HOLD_ON; // Reset SPI to fix strange bug on the spi SPCR = 0x50; SPSR = 0x00; Modified: firmware/tuxaudio/branches/audio_cleanup/flash.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-07 15:02:33 UTC (rev 501) +++ firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-07 15:24:24 UTC (rev 502) @@ -34,13 +34,6 @@ #ifndef FLASH_H #define FLASH_H - - - -#define FLASH_CS_ON PORTB &= ~0x02 -#define FLASH_CS_OFF PORTB |= 0x02 - - /* Flash programming states */ #define ERASE_STATE 0 #define FIRST_PROG_STATE 1 Added: firmware/tuxaudio/branches/audio_cleanup/hardware.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/hardware.h (rev 0) +++ firmware/tuxaudio/branches/audio_cleanup/hardware.h 2007-09-07 15:24:24 UTC (rev 502) @@ -0,0 +1,32 @@ +/* + * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * 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 <avr/io.h> + +#ifndef HARDWARE_H +#define HARDWARE_H + +#define FLASH_PORT PORTB +#define FLASH_CS_PIN _BV(PB1) +#define FLASH_HOLD_PIN _BV(PB0) + +#endif + + + |