diff -urN rcu_20060811\cdctiny\MakeFile firmware\cdctiny\MakeFile --- rcu_20060811\cdctiny\MakeFile Thu Jan 01 01:00:00 1970 +++ firmware\cdctiny\MakeFile Thu Feb 15 13:14:58 2007 @@ -0,0 +1,101 @@ +############################################################################### +# Makefile for the project cdctiny +############################################################################### + +## General Flags +PROJECT = cdctiny +MCU = attiny84 +TARGET = $(PROJECT).elf +CC = avr-gcc.exe + +## Options common to compile, link and assembly rules +COMMON = -mmcu=$(MCU) + +## Compile options common for all C compilation units. +CFLAGS = $(COMMON) +#CFLAGS += -Wall -DF_CPU=12000000UL -O2 -fsigned-char +CFLAGS += -Wall -DF_CPU=12000000UL -O2 -g -fsigned-char + +## Assembly specific flags +ASMFLAGS = $(COMMON) +ASMFLAGS += -x assembler-with-cpp -Wa + +## Linker flags +LDFLAGS = $(COMMON) +LDFLAGS += -Wl,-Map=$(PROJECT).map + + +## Intel Hex file production flags +HEX_FLASH_FLAGS = -R .eeprom + + +## Include Directories +INCLUDES = -I"." -I"..\usbdrv" -I".." + +## Objects that must be built in order to link +#OBJECTS = usbdrv.o usbdrvasm.o main.o edgetrig.o edgetrig-asm.o console.o +#edgetrig-asm.o + +OBJECTS = test.o edgetrig.o edgetrig-asm.o + +## Objects explicitly added by the user +LINKONLYOBJECTS = + +## Build +all: $(TARGET) $(PROJECT).hex $(PROJECT).lss size + +## Compile +usbdrv.o: ../usbdrv/usbdrv.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +usbdrvasm.o: ../usbdrv/usbdrvasm.S + $(CC) $(INCLUDES) $(ASMFLAGS) -c $< + +oddebug.o: ../usbdrv/oddebug.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +uart.o: ../uart.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +sw-uart-asm.o: ../sw-uart-asm.S + $(CC) $(INCLUDES) $(ASMFLAGS) -c $< + +sw-uart.o: ../sw-uart.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +main.o: ../main.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +test.o: ../test.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +edgetrig.o: ../edgetrig.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +console.o: ../console.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +edgetrig-asm.o: ../edgetrig-asm.S + $(CC) $(INCLUDES) $(ASMFLAGS) -c $< + +##Link +$(TARGET): $(OBJECTS) + $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET) + +%.hex: $(TARGET) + avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@ + +%.lss: $(TARGET) + avr-objdump -h -S $< > $@ + +size: ${TARGET} + @echo + @avr-size -C --mcu=${MCU} ${TARGET} + +## Clean target +.PHONY: clean +clean: + -rm -rf $(OBJECTS) $(PROJECT).* + +program: + c:/Program\ Files/Atmel/Avr\ Tools/JTAGICEmkII/jtagiceii.exe -d $(MCU) -e -pf -vf -if $(PROJECT).hex diff -urN rcu_20060811\cdctiny\MakeFile-joy firmware\cdctiny\MakeFile-joy --- rcu_20060811\cdctiny\MakeFile-joy Thu Jan 01 01:00:00 1970 +++ firmware\cdctiny\MakeFile-joy Mon Jan 29 23:14:04 2007 @@ -0,0 +1,89 @@ +############################################################################### +# Makefile for the project cdctiny +############################################################################### + +## General Flags +PROJECT = cdctiny +MCU = attiny84 +TARGET = $(PROJECT).elf +CC = avr-gcc.exe + +## Options common to compile, link and assembly rules +COMMON = -mmcu=$(MCU) + +## Compile options common for all C compilation units. +CFLAGS = $(COMMON) +CFLAGS += -Wall -DF_CPU=12000000UL -O2 -g -fsigned-char + +## Assembly specific flags +ASMFLAGS = $(COMMON) +ASMFLAGS += -x assembler-with-cpp -Wa + +## Linker flags +LDFLAGS = $(COMMON) +LDFLAGS += -Wl,-Map=$(PROJECT).map + + +## Intel Hex file production flags +HEX_FLASH_FLAGS = -R .eeprom + + +## Include Directories +INCLUDES = -I"." -I"..\usbdrv" -I".." + +## Objects that must be built in order to link +OBJECTS = usbdrv.o usbdrvasm.o oddebug.o main.o out_joystick.o +#sw-uart-asm.o sw-uart.o main.o + +## Objects explicitly added by the user +LINKONLYOBJECTS = edgetrig.o edgetrig-asm.o + +## Build +all: $(TARGET) $(PROJECT).hex $(PROJECT).lss size + +## Compile +usbdrv.o: ../usbdrv/usbdrv.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +out_joystick.o: ../out_joystick.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +usbdrvasm.o: ../usbdrv/usbdrvasm.S + $(CC) $(INCLUDES) $(ASMFLAGS) -c $< + +oddebug.o: ../usbdrv/oddebug.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +uart.o: ../uart.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +sw-uart-asm.o: ../sw-uart-asm.S + $(CC) $(INCLUDES) $(ASMFLAGS) -c $< + +sw-uart.o: ../sw-uart.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +main.o: ../main.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +##Link +$(TARGET): $(OBJECTS) + $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET) + +%.hex: $(TARGET) + avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@ + +%.lss: $(TARGET) + avr-objdump -h -S $< > $@ + +size: ${TARGET} + @echo + @avr-size -C --mcu=${MCU} ${TARGET} + +## Clean target +.PHONY: clean +clean: + -rm -rf $(OBJECTS) $(PROJECT).* + +program: + c:/Program\ Files/Atmel/Avr\ Tools/JTAGICEmkII/jtagiceii.exe -d $(MCU) -e -pf -vf -if $(PROJECT).hex diff -urN rcu_20060811\common.h firmware\common.h --- rcu_20060811\common.h Thu Aug 10 19:04:30 2006 +++ firmware\common.h Mon Jan 29 23:15:32 2007 @@ -1,7 +1,7 @@ //============================================================================= // Common and hardware-dependant definitions. // -// $Id: common.h,v 1.8.2.3 2006/08/10 16:04:29 SOY Exp $ +// $Id: common.h,v 1.1 2007-01-29 22:15:32 tyridal Exp $ //============================================================================= #ifndef __COMMON_H_INCLUDED__ @@ -9,8 +9,12 @@ //============================================================================= // System-specific headers for IAR compiler -#include // for AVR bit definitions -#include // for intrinsic functions such like __enable_interrupt() +//#include // for AVR bit definitions +//#include // for intrinsic functions such like __enable_interrupt() +#include +#include + +#define PROGMEM __flash // Some compatibility defines for porting to other compilers //#define __C_task @@ -32,6 +36,5 @@ #include "options.h" // user-defined compilation options #include "usbdrv.h" // USB driver interface #include "watchdog.h" // watchdog operation -#include "boot.h" // boot loader interface #endif // __COMMON_H_INCLUDED__ diff -urN rcu_20060811\edgetrig-asm.S firmware\edgetrig-asm.S --- rcu_20060811\edgetrig-asm.S Thu Jan 01 01:00:00 1970 +++ firmware\edgetrig-asm.S Thu Feb 15 13:12:54 2007 @@ -0,0 +1,184 @@ +; #include "iarcompat.h" +#ifndef __IAR_SYSTEMS_ASM__ + /* configs for io.h */ +# define __SFR_OFFSET 0 +# define _VECTOR(N) __vector_ ## N /* io.h does not define this for asm */ +# include /* for CPU I/O register definitions and vectors */ +#endif /* __IAR_SYSTEMS_ASM__ */ +; #include "usbdrv.h" /* for common defs */ +#include "edgetrig.h" + + + +/* register names */ +#define x1 r16 +#define x2 r17 +#define x3 r20 +#define x4 r21 + +/* Some assembler dependent definitions and declarations: */ + +#ifdef __IAR_SYSTEMS_ASM__ + +# define nop2 rjmp $+2 /* jump to next instruction */ +# define XL r26 +# define XH r27 +# define YL r28 +# define YH r29 +# define ZL r30 +# define ZH r31 +# define lo8(x) LOW(x) +# define hi8(x) ((x)>>8) /* not HIGH to allow XLINK to make a proper range check */ + + public bit_reverse + +# ifndef IVT_BASE_ADDRESS +# define IVT_BASE_ADDRESS 0 +# endif + + ASEG + ORG TIMER1_CAPT_vect + IVT_BASE_ADDRESS + rjmp SIG_PIN_CHANGE + ORG TIMER1_OVF_vect + IVT_BASE_ADDRESS + rjmp SIG_TIM1OVF + RSEG CODE + +#else /* __IAR_SYSTEMS_ASM__ */ + + .text + + .global SIG_INPUT_CAPTURE1 + .type SIG_INPUT_CAPTURE1, @function +; .global SIG_OVERFLOW1 +; .type SIG_OVERFLOW1, @function + + +#endif /* __IAR_SYSTEMS_ASM__ */ + +; .comm atEdge 1 +; .comm edges 40, 16; align to 16bit + + +; ######################## RS-232C functions ######################## + +#ifndef GPIOR0 +#define GPIOR0 PORTE +#define GPIOR1 DDRE +#define GPIOR2 PORTA +#endif + +#ifndef TIFR1 +#define TIFR1 TIFR +#endif + +timer_failed: + ldi ZL,0 + out TCCR1B,ZL + in ZL, GPIOR0 + reti + +SIG_INPUT_CAPTURE1: + push r30 + push r31 + push r24 + push r25 + in r25,SREG + push r25 + + lds r30, atEdge + sbrc r30, 7 + rjmp clearCountandQuit + + in r24, TCCR1B ; TCCR1B // if (TCCR1B & (1< limits from 0x106 to 3c58 -> two msb can be ignored + ; reduce to 8 bit resolution: + subi r25, 0x16 + rol r24 ; move two msbs from low to high. + rol r25 + rol r24 + rol r25 + std Z+0, r25 + in r25, GPIOR0 + inc r25 + sts atEdge, r25 + + quitSig: + + pop r25 + out SREG,r25 + pop r25 + pop r24 + pop r31 + pop r30 + reti + +clearCountandQuit: + clr r24 + out TCNT1H, r24 + out TCNT1L, r24 + rjmp quitSig + + + +;SIG_OVERFLOW1: +; out GPIOR0, x1 +; ldi x1,0 +; sts atEdge, x1 +; in x1, GPIOR0 +; reti ;4 {13,13} + + + + + diff -urN rcu_20060811\edgetrig.c firmware\edgetrig.c --- rcu_20060811\edgetrig.c Thu Jan 01 01:00:00 1970 +++ firmware\edgetrig.c Thu Feb 15 13:12:54 2007 @@ -0,0 +1,115 @@ + +#include +#include +#include "edgetrig.h" +#include + +unsigned char edges[numEdges*numEdgeSamples]; +unsigned char filtered[numEdges-1]; +volatile unsigned char atEdge=0xff; + +volatile uchar edgeAction=0; +uchar lastEdge=0; +uchar globcnt=0; +// #ifndef ICIE1 +// #define ICIE1 TICIE1 +// #endif + +// #ifndef TIMSK1 +// #define TIMSK1 TIMSK +// #endif + +#define PRESCALE 1 // prescale /1 +#define NOISECANCEL (1<>2; +// filtered[i-1]=(edges[i]/8 + edges[numEdges+i]/8 /*+ edges[numEdges*2+i]/4*/)>>4; +// filtered[i-1]=(filtered[i-1]/4 + edges[i]/4 + edges[numEdges+i]/4 + edges[numEdges*2+i]/4)>>2; + filtered[i-1]=(unsigned char) edges[i]+axisOfs[i-1]; + } +// wdt_reset(); + filtered[1] = (filtered[0]/2 - filtered[5]/2) + filtered[1]; // <- tilt + filtered[0] = filtered[0]/2 + filtered[5]/2; //<- roll + /* this is the values before gain adjustment: + * cb fc + * + * 20 eb 1b df + * + * 2f 1b + * + * prioritize power gain.. + * */ + const signed char axisGain[numEdges-1] = {0,0,0,0,0,0}; + if (filtered[2]>0x80) + filtered[2] = filtered[2] + (filtered[2]-0x80)/2; + else + filtered[2] = filtered[2] - (0x80-filtered[2])/2; + +// axisGain[1] = filtered[1]-0xa00; +// if (axisGain[1]>0) axisGain[1]-= axisGain[1]/4; +// else axisGain[1]-= axisGain[1]/16; +// axisGain[1]+=0xa00; +// axisGain[2] = filtered[2]-0xa00; +// axisGain[2]+=axisGain[2]/2 + 0xa00; +// axisGain[3] = filtered[3];//-0xa00; + if(globcnt++ == 0x50) + { + globcnt=0; + wdt_reset(); + } + + // trottle hold when [2]>b9d.. + //filtered[6] = (filtered[0]+filtered[1]/2) - filtered[5]; // <- tried for pitch.. failed badly :) + edgeAction = edgeAction_None; +} + +ISR(SIG_OVERFLOW1) +{ + if (edgeAction != edgeAction_None) return; + + sei(); + if (atEdge>4 && atEdge<0xf0) + { + edgeAction = edgeAction_DoFilter; + atEdge=0xff; + } + else + { +/* if (lastEdge==0) + { + atEdge=numEdges; + lastEdge=1; + }*/ + /* else if(lastEdge==1) + { + atEdge=numEdges*2; + lastEdge=2; + }*/ +// else + { + atEdge=0; + lastEdge=0; + } + } +} diff -urN rcu_20060811\edgetrig.h firmware\edgetrig.h --- rcu_20060811\edgetrig.h Thu Jan 01 01:00:00 1970 +++ firmware\edgetrig.h Thu Feb 15 13:12:54 2007 @@ -0,0 +1,27 @@ +#ifndef __edgetrig_h_included__ +#define __edgetrig_h_included__ + +#include /* for TXEN or TXEN0 resp., if available */ + +#ifndef uchar +#define uchar unsigned char +#endif + +#ifndef __ASSEMBLER__ + +#define numEdges 7 +#define numEdgeSamples 1 +extern unsigned char edges[numEdges*numEdgeSamples]; +extern unsigned char filtered[numEdges-1]; +extern short int axisGain[numEdges-1]; +extern volatile uchar atEdge; +extern volatile uchar edgeAction; + +#define edgeAction_None 0 +#define edgeAction_DoFilter 1 + +extern void edgeInit(); +extern void edgeFilter(); + +#endif +#endif diff -urN rcu_20060811\main.c firmware\main.c --- rcu_20060811\main.c Thu Aug 10 19:04:30 2006 +++ firmware\main.c Thu Feb 15 13:12:54 2007 @@ -6,37 +6,33 @@ // Evaluation version is available at www.iar.com or via direct link // http://supp.iar.com/FilesPublic/EWMIRROR/002491/EWAVR-EV-420A.exe // -// $Id: main.c,v 1.8.2.4 2006/08/10 16:04:29 SOY Exp $ +// $Id: main.c,v 1.3 2007-01-29 22:15:32 tyridal Exp $ //============================================================================= #include "common.h" +#include "edgetrig.h" +#include // // Execution starts here // -__C_task void main(void) +main(void) { - wdInit(); // initialize watchdog timer + wdt_enable(WDTO_1S); +// wdInit(); // initialize watchdog timer usbInit(); // initialize USB driver - bootInit(); // initialize boot loader interface - inDecoderInit(); // initialize input decoder - usbDeviceConnect(); // connect USB device to USB bus +// usbDeviceConnect(); // connect USB device to USB bus + edgeInit(); + sei(); // required by USB driver and some interfaces while (1) { - wdReset(); // reset watchdog timer - inDecoderPoll(); // poll for input data + wdt_reset(); +// wdReset(); // reset watchdog timer outSendData(); // prepare data for USB Interrupt In endpoint usbPoll(); // process USB requests -#if BOOT_SUPPORT_ENABLED - if (bootRequest()) // jump to boot loader if switch is pressed - { - usbDeviceDisconnect(); // disconnect USB device from USB bus - inDecoderStop(); // stop input decoder interrupts - bootJump(); // jump to boot loader - } -#endif } + } diff -urN rcu_20060811\options.h firmware\options.h --- rcu_20060811\options.h Tue Aug 15 12:38:16 2006 +++ firmware\options.h Mon Jan 29 23:15:32 2007 @@ -1,7 +1,7 @@ //============================================================================= // User-defined compilation options. // -// $Id: options.h,v 1.1.2.6 2006/08/10 20:58:23 SOY Exp $ +// $Id: options.h,v 1.1 2007-01-29 22:15:32 tyridal Exp $ //============================================================================= #ifndef __OPTIONS_H_INCLUDED__ @@ -10,7 +10,7 @@ //============================================================================= // Set this to non-zero for schematic from RCDESIGN.RU web site, // http://www.rcdesign.ru/articles/electronics/rcusb -#define RC_DESIGN 1 +#define RC_DESIGN 0 //============================================================================= // INPUT and OUTPUT interface options. @@ -21,7 +21,7 @@ // Input interfaces (select one) #define IN_PPM 0 // standard RC PPM decoder -#define IN_PPM_ADV 1 // advanced RC PPM decoder +#define IN_PPM_ADV 0 // advanced RC PPM decoder #define IN_ADC 0 // internal ADC interface // Output interfaces (select one) @@ -73,17 +73,17 @@ //============================================================================= // USB interface port and bits #if RC_DESIGN -#define USB_CFG_IOPORTNAME D +#define USB_CFG_IOPORTNAME A #define USB_CFG_DMINUS_BIT 0 -#define USB_CFG_DPLUS_BIT 1 +#define USB_CFG_DPLUS_BIT 4 #define usbDeviceConnect() #define usbDeviceDisconnect() #else -#define USB_CFG_IOPORTNAME B +#define USB_CFG_IOPORTNAME A #define USB_CFG_DMINUS_BIT 0 -#define USB_CFG_DPLUS_BIT 1 -#define USB_CFG_PULLUP_IOPORTNAME B -#define USB_CFG_PULLUP_BIT 4 +#define USB_CFG_DPLUS_BIT 4 +//#define USB_CFG_PULLUP_IOPORTNAME B +//#define USB_CFG_PULLUP_BIT 4 #endif //============================================================================= @@ -102,13 +102,15 @@ //============================================================================= // Interface-specific options (must be processed before usbconfig.h) + #ifndef __ASSEMBLER__ -#include "in_ppm.h" // standard RC PPM decoder -#include "in_ppm_adv.h" // advanced RC PPM decoder -#include "in_adc.h" // internal ADC interface +//include "in_ppm.h" // standard RC PPM decoder +//include "in_ppm_adv.h" // advanced RC PPM decoder +//include "in_adc.h" // internal ADC interface #include "out_joystick.h" // standard USB HID-compatible game controller (joystick) -#include "out_joystick_btn.h" // standard USB HID-compatible game controller (joystick) -#include "out_reflex.h" // Reflex RC USB device +//include "out_joystick_btn.h" // standard USB HID-compatible game controller (joystick) +//include "out_reflex.h" // Reflex RC USB device #endif + #endif // __OPTIONS_H_INCLUDED__ diff -urN rcu_20060811\out_joystick.c firmware\out_joystick.c --- rcu_20060811\out_joystick.c Thu Aug 10 17:14:20 2006 +++ firmware\out_joystick.c Mon Jan 29 23:15:32 2007 @@ -1,18 +1,19 @@ //============================================================================= // Standard USB HID-compatible game controller (joystick). // -// $Id: out_joystick.c,v 1.5.2.4 2006/08/10 13:20:51 SOY Exp $ +// $Id: out_joystick.c,v 1.1 2007-01-29 22:15:32 tyridal Exp $ //============================================================================= #include "common.h" #if OUT_JOYSTICK +#include "edgetrig.h" //============================================================================= // Local variables // USB report buffer -static uchar usbReport[MAX_CHANNELS]; // no Report ID used +//static uchar usbReport[MAX_CHANNELS]; // no Report ID used //----------------------------------------------------------------------------- // Standard 8-axes joystick HID report descriptor @@ -59,9 +60,11 @@ // Calculates each report byte using the following: // - source data should be 732..2268 uS // - it should result in 0..255 byte values -// +// +/* static uchar *usbBuildReport(void) { + // rebuild the report only if new data was captured if (newDataFound) { @@ -92,12 +95,13 @@ // return the address of buffer return &usbReport[0]; } - +*/ //----------------------------------------------------------------------------- // // USB setup request processing // + uchar usbFunctionSetup(uchar data[8]) { usbRequest_t *rq = (void *)data; @@ -109,8 +113,8 @@ { // wValue: ReportType (highbyte), ReportID (lowbyte) // we only have one report type, so don't look at wValue - usbMsgPtr = usbBuildReport(); - return sizeof(usbReport); + usbMsgPtr = filtered; + return 8; } } return 0; @@ -128,7 +132,9 @@ { // fill in the report buffer and return the // data pointer (Report ID is not used) - usbSetInterrupt(usbBuildReport(), sizeof(usbReport)); +// usbSetInterrupt(usbBuildReport(), sizeof(usbReport)); + edgeFilter(); + usbSetInterrupt(filtered, 8); } } diff -urN rcu_20060811\out_joystick.h firmware\out_joystick.h --- rcu_20060811\out_joystick.h Thu Jul 20 23:08:42 2006 +++ firmware\out_joystick.h Mon Jan 29 23:15:32 2007 @@ -1,7 +1,7 @@ //============================================================================= // Standard USB HID-compatible game controller (joystick). // -// $Id: out_joystick.h,v 1.6.2.3 2006/07/20 20:08:42 SOY Exp $ +// $Id: out_joystick.h,v 1.1 2007-01-29 22:15:32 tyridal Exp $ //============================================================================= #ifndef __OUT_JOYSTICK_H_INCLUDED__ diff -urN rcu_20060811\test.c firmware\test.c --- rcu_20060811\test.c Thu Jan 01 01:00:00 1970 +++ firmware\test.c Thu Feb 15 13:16:02 2007 @@ -0,0 +1,30 @@ + +#include +#include +#include +#include + +#include "edgetrig.h" + +int main(void) +{ + unsigned char x=0; + + edgeInit(); + sei(); + for (;;) + { + if (edgeAction==edgeAction_DoFilter) + edgeFilter(); + + x++; + if (x==50) + { +// x=0; +// // asm("push r1\n\tclr r1\n\tloopme:\n\tinc r1\n\tsbrs r1,7\n\trjmp loopme\n\tpop r1"); +// if (edgeAction) +// edgeFilter(); + } + } + +} diff -urN rcu_20060811\usbconfig.h firmware\usbconfig.h --- rcu_20060811\usbconfig.h Thu Aug 10 19:04:30 2006 +++ firmware\usbconfig.h Mon Jan 29 23:15:32 2007 @@ -5,7 +5,7 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: Proprietary, free under certain conditions. See Documentation. - * This Revision: $Id: usbconfig.h,v 1.4.2.3 2006/08/10 16:04:29 SOY Exp $ + * This Revision: $Id: usbconfig.h,v 1.1 2007-01-29 22:15:32 tyridal Exp $ */ #ifndef __usbconfig_h_included__ diff -urN rcu_20060811\usbdrv\iarcompat.h firmware\usbdrv\iarcompat.h --- rcu_20060811\usbdrv\iarcompat.h Sun Mar 26 22:07:56 2006 +++ firmware\usbdrv\iarcompat.h Thu Feb 15 13:12:55 2007 @@ -5,7 +5,7 @@ * Tabsize: 4 * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH * License: Proprietary, free under certain conditions. See Documentation. - * This Revision: $Id: iarcompat.h 174 2006-03-23 10:09:01Z cs $ + * This Revision: $Id: iarcompat.h,v 1.2 2007-01-29 22:14:58 tyridal Exp $ */ /* @@ -43,11 +43,12 @@ # define __ASSEMBLER__ #endif -#ifdef __HAS_ELPM__ -# define PROGMEM __farflash -#else -# define PROGMEM __flash -#endif +//#ifdef __HAS_ELPM__ +//# define PROGMEM __farflash +//#else +//# define PROGMEM __flash +//#endif +#define PROGMEM const #define PRG_RDB(addr) (*(PROGMEM char *)(addr)) diff -urN rcu_20060811\usbdrv\usbdrv.h firmware\usbdrv\usbdrv.h --- rcu_20060811\usbdrv\usbdrv.h Thu Aug 10 17:14:20 2006 +++ firmware\usbdrv\usbdrv.h Thu Feb 15 13:12:55 2007 @@ -5,7 +5,7 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: Proprietary, free under certain conditions. See Documentation. - * This Revision: $Id: usbdrv.h 230 2006-07-18 11:29:00Z cs $ + * This Revision: $Id: usbdrv.h,v 1.3 2007-01-29 22:14:58 tyridal Exp $ */ #ifndef __usbdrv_h_included__ @@ -13,6 +13,7 @@ #include "usbconfig.h" #include "iarcompat.h" + /* Hardware Prerequisites: ======================= @@ -397,43 +398,43 @@ #ifndef __ASSEMBLER__ extern #if !(USB_CFG_DESCR_PROPS_DEVICE & USB_PROP_IS_RAM) -PROGMEM +// PROGMEM #endif char usbDescriptorDevice[]; extern #if !(USB_CFG_DESCR_PROPS_CONFIGURATION & USB_PROP_IS_RAM) -PROGMEM +//PROGMEM #endif char usbDescriptorConfiguration[]; extern #if !(USB_CFG_DESCR_PROPS_HID_REPORT & USB_PROP_IS_RAM) -PROGMEM +//PROGMEM #endif char usbDescriptorHidReport[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_0 & USB_PROP_IS_RAM) -PROGMEM +//PROGMEM #endif char usbDescriptorString0[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_VENDOR & USB_PROP_IS_RAM) -PROGMEM +//PROGMEM #endif int usbDescriptorStringVendor[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_PRODUCT & USB_PROP_IS_RAM) -PROGMEM +//PROGMEM #endif int usbDescriptorStringDevice[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER & USB_PROP_IS_RAM) -PROGMEM +//PROGMEM #endif int usbDescriptorStringSerialNumber[]; diff -urN rcu_20060811\watchdog.h firmware\watchdog.h --- rcu_20060811\watchdog.h Thu Jul 20 23:08:42 2006 +++ firmware\watchdog.h Mon Jan 29 23:15:32 2007 @@ -1,7 +1,7 @@ //============================================================================= // Watchdog operation. // -// $Id: watchdog.h,v 1.4.2.2 2006/07/20 20:08:42 SOY Exp $ +// $Id: watchdog.h,v 1.1 2007-01-29 22:15:32 tyridal Exp $ //============================================================================= #ifndef __WATCHDOG_H_INCLUDED__ @@ -9,18 +9,17 @@ //============================================================================= // Inline function prototypes - +#include +#include +#include +#include +/* // // Initialize watchdog timer // inline void wdInit(void) { -#if defined(__IOM16_H) || defined(__IOM32_H) - WDTCR = (7 << WDP0) | (1 << WDE); -#else - WDTCR = (1 << WDCE) | (1 << WDE); -#endif - WDTCR = (7 << WDP0) | (1 << WDE); + wdt_enable(WDTO_1S); } // @@ -30,5 +29,5 @@ { wdt_reset(); } - +*/ #endif // __WATCHDOG_H_INCLUDED__