Subversion Repositories Projects

Compare Revisions

Regard whitespace Rev 389 → Rev 388

/C-OSD/trunk/osd_helpers.c
File deleted
/C-OSD/trunk/osd_helpers.h
File deleted
/C-OSD/trunk/default/Makefile
35,7 → 35,7
 
 
## Objects that must be built in order to link
OBJECTS = main.o usart1.o max7456_software_spi.o osd_helpers.o
OBJECTS = main.o usart1.o max7456_software_spi.o
 
## Objects explicitly added by the user
LINKONLYOBJECTS =
53,9 → 53,6
max7456_software_spi.o: ../max7456_software_spi.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
 
osd_helpers.o: ../osd_helpers.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
 
##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
/C-OSD/trunk/C-OSD.aps
1,0 → 0,0
<AVRStudio><MANAGEMENT><ProjectName>C-OSD</ProjectName><Created>24-Mar-2009 01:26:47</Created><LastEdit>20-Apr-2009 02:02:15</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>24-Mar-2009 01:26:47</Created><Version>4</Version><Build>4, 16, 0, 626</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\C-OSD.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>G:\Eigene Dateien\C-Projects\C-OSD\trunk\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega162.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><modules><module></module></modules><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>max7456_software_spi.c</SOURCEFILE><SOURCEFILE>usart1.c</SOURCEFILE><SOURCEFILE>characters.c</SOURCEFILE><SOURCEFILE>osd_helpers.c</SOURCEFILE><HEADERFILE>mk-data-structs.h</HEADERFILE><HEADERFILE>max7456_software_spi.h</HEADERFILE><HEADERFILE>usart1.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>osd_helpers.h</HEADERFILE><OTHERFILE>default\C-OSD.lss</OTHERFILE><OTHERFILE>default\C-OSD.map</OTHERFILE><OTHERFILE>default\Makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>default\Makefile</EXTERNALMAKEFILE><PART>atmega162</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>C-OSD.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>D:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>D:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="1" orderaddress="1" ordergroup="1"/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>257</Status></File00000><File00001><FileId>00001</FileId><FileName>mk-data-structs.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>max7456_software_spi.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>max7456_software_spi.c</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>usart1.c</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>usart1.h</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>characters.c</FileName><Status>1</Status></File00006><File00007><FileId>00007</FileId><FileName>main.h</FileName><Status>1</Status></File00007><File00008><FileId>00008</FileId><FileName>osd_helpers.c</FileName><Status>1</Status></File00008><File00009><FileId>00009</FileId><FileName>osd_helpers.h</FileName><Status>1</Status></File00009></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
<AVRStudio><MANAGEMENT><ProjectName>C-OSD</ProjectName><Created>24-Mar-2009 01:26:47</Created><LastEdit>07-Apr-2009 20:59:46</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>24-Mar-2009 01:26:47</Created><Version>4</Version><Build>4, 16, 0, 626</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\C-OSD.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>G:\Eigene Dateien\C-Projects\C-OSD\trunk\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega162.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><modules><module></module></modules><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>max7456_software_spi.c</SOURCEFILE><SOURCEFILE>usart1.c</SOURCEFILE><SOURCEFILE>characters.c</SOURCEFILE><HEADERFILE>mk-data-structs.h</HEADERFILE><HEADERFILE>max7456_software_spi.h</HEADERFILE><HEADERFILE>usart1.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><OTHERFILE>default\C-OSD.lss</OTHERFILE><OTHERFILE>default\C-OSD.map</OTHERFILE><OTHERFILE>default\Makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>default\Makefile</EXTERNALMAKEFILE><PART>atmega162</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>C-OSD.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -std=gnu99 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>D:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>D:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="1" ordergroup="0"/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>257</Status></File00000><File00001><FileId>00001</FileId><FileName>mk-data-structs.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>max7456_software_spi.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>max7456_software_spi.c</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>usart1.c</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>usart1.h</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>characters.c</FileName><Status>1</Status></File00006><File00007><FileId>00007</FileId><FileName>main.h</FileName><Status>1</Status></File00007></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
/C-OSD/trunk/CHANGE.LOG
17,11 → 17,6
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
20090420-0205
*reset-bug fixed
*moved code a bit
20090419-2145
*reset-bug workaround in usart1.c: usart1_DisableTXD and usart1_EnableTXD
 
/C-OSD/trunk/c-osd.aws
1,0 → 0,0
<AVRWorkspace><IOSettings><CurrentRegisters><USART1><register register="UBRR1L" group="USART1" display="1" locked="0"/></USART1><USART1><register register="UCSR1B" group="USART1" display="1" locked="0"/></USART1><USART1><register register="UCSR1A" group="USART1" display="1" locked="0"/></USART1><USART1><register register="UDR" group="USART1" display="1" locked="0"/></USART1><CPU><register register="OSCCAL" group="CPU" display="1" locked="0"/></CPU><JTAG><register register="OCDR" group="JTAG" display="1" locked="0"/></JTAG><PORTE><register register="PINE" group="PORTE" display="1" locked="0"/></PORTE><PORTE><register register="DDRE" group="PORTE" display="1" locked="0"/></PORTE><PORTE><register register="PORTE" group="PORTE" display="1" locked="0"/></PORTE><ANALOG_COMPARATOR><register register="ACSR" group="ANALOG_COMPARATOR" display="1" locked="0"/></ANALOG_COMPARATOR><USART0><register register="UBRR0L" group="USART0" display="1" locked="0"/></USART0><USART0><register register="UCSR0B" group="USART0" display="1" locked="0"/></USART0><USART0><register register="UCSR0A" group="USART0" display="1" locked="0"/></USART0><USART0><register register="UDR0" group="USART0" display="1" locked="0"/></USART0><SPI><register register="SPCR" group="SPI" display="1" locked="0"/></SPI><SPI><register register="SPSR" group="SPI" display="1" locked="0"/></SPI><SPI><register register="SPDR" group="SPI" display="1" locked="0"/></SPI><PORTD><register register="PIND" group="PORTD" display="1" locked="0"/></PORTD><PORTD><register register="DDRD" group="PORTD" display="1" locked="0"/></PORTD><PORTD><register register="PORTD" group="PORTD" display="1" locked="0"/></PORTD><PORTC><register register="PINC" group="PORTC" display="1" locked="0"/></PORTC><PORTC><register register="DDRC" group="PORTC" display="1" locked="0"/></PORTC><PORTC><register register="PORTC" group="PORTC" display="1" locked="0"/></PORTC><PORTB><register register="PINB" group="PORTB" display="1" locked="0"/></PORTB><PORTB><register register="DDRB" group="PORTB" display="1" locked="0"/></PORTB><PORTB><register register="PORTB" group="PORTB" display="1" locked="0"/></PORTB><PORTA><register register="PINA" group="PORTA" display="1" locked="0"/></PORTA><PORTA><register register="DDRA" group="PORTA" display="1" locked="0"/></PORTA><PORTA><register register="PORTA" group="PORTA" display="1" locked="0"/></PORTA><EEPROM><register register="EECR" group="EEPROM" display="1" locked="0"/></EEPROM><EEPROM><register register="EEDR" group="EEPROM" display="1" locked="0"/></EEPROM><EEPROM><register register="EEAR" group="EEPROM" display="1" locked="0"/></EEPROM><USART0><register register="UBRR0H" group="USART0" display="1" locked="0"/></USART0><USART0><register register="UCSR0C" group="USART0" display="1" locked="0"/></USART0><WATCHDOG><register register="WDTCR" group="WATCHDOG" display="1" locked="0"/></WATCHDOG><TIMER_COUNTER_2><register register="OCR2" group="TIMER_COUNTER_2" display="1" locked="0"/></TIMER_COUNTER_2><TIMER_COUNTER_2><register register="TCNT2" group="TIMER_COUNTER_2" display="1" locked="0"/></TIMER_COUNTER_2><TIMER_COUNTER_1><register register="ICR1" group="TIMER_COUNTER_1" display="1" locked="0"/></TIMER_COUNTER_1><TIMER_COUNTER_2><register register="ASSR" group="TIMER_COUNTER_2" display="1" locked="0"/></TIMER_COUNTER_2><TIMER_COUNTER_2><register register="TCCR2" group="TIMER_COUNTER_2" display="1" locked="0"/></TIMER_COUNTER_2><TIMER_COUNTER_1><register register="OCR1B" group="TIMER_COUNTER_1" display="1" locked="0"/></TIMER_COUNTER_1><TIMER_COUNTER_1><register register="OCR1A" group="TIMER_COUNTER_1" display="1" locked="0"/></TIMER_COUNTER_1><TIMER_COUNTER_1><register register="TCNT1" group="TIMER_COUNTER_1" display="1" locked="0"/></TIMER_COUNTER_1><TIMER_COUNTER_1><register register="TCCR1B" group="TIMER_COUNTER_1" display="1" locked="0"/></TIMER_COUNTER_1><TIMER_COUNTER_1><register register="TCCR1A" group="TIMER_COUNTER_1" display="1" locked="0"/></TIMER_COUNTER_1><CPU><register register="SFIOR" group="CPU" display="1" locked="0"/></CPU><TIMER_COUNTER_0><register register="OCR0" group="TIMER_COUNTER_0" display="1" locked="0"/></TIMER_COUNTER_0><TIMER_COUNTER_0><register register="TCNT0" group="TIMER_COUNTER_0" display="1" locked="0"/></TIMER_COUNTER_0><TIMER_COUNTER_0><register register="TCCR0" group="TIMER_COUNTER_0" display="1" locked="0"/></TIMER_COUNTER_0><CPU><register register="MCUCSR" group="CPU" display="1" locked="0"/></CPU><JTAG><register register="MCUCSR" group="JTAG" display="1" locked="0"/></JTAG><CPU><register register="MCUCR" group="CPU" display="1" locked="0"/></CPU><EXTERNAL_INTERRUPT><register register="MCUCR" group="EXTERNAL_INTERRUPT" display="1" locked="0"/></EXTERNAL_INTERRUPT><CPU><register register="EMCUCR" group="CPU" display="1" locked="0"/></CPU><EXTERNAL_INTERRUPT><register register="EMCUCR" group="EXTERNAL_INTERRUPT" display="1" locked="0"/></EXTERNAL_INTERRUPT><BOOT_LOAD><register register="SPMCR" group="BOOT_LOAD" display="1" locked="0"/></BOOT_LOAD><TIMER_COUNTER_0><register register="TIFR" group="TIMER_COUNTER_0" display="1" locked="0"/></TIMER_COUNTER_0><TIMER_COUNTER_1><register register="TIFR" group="TIMER_COUNTER_1" display="1" locked="0"/></TIMER_COUNTER_1><TIMER_COUNTER_2><register register="TIFR" group="TIMER_COUNTER_2" display="1" locked="0"/></TIMER_COUNTER_2><TIMER_COUNTER_0><register register="TIMSK" group="TIMER_COUNTER_0" display="1" locked="0"/></TIMER_COUNTER_0><TIMER_COUNTER_1><register register="TIMSK" group="TIMER_COUNTER_1" display="1" locked="0"/></TIMER_COUNTER_1><TIMER_COUNTER_2><register register="TIMSK" group="TIMER_COUNTER_2" display="1" locked="0"/></TIMER_COUNTER_2><EXTERNAL_INTERRUPT><register register="GIFR" group="EXTERNAL_INTERRUPT" display="1" locked="0"/></EXTERNAL_INTERRUPT><EXTERNAL_INTERRUPT><register register="GICR" group="EXTERNAL_INTERRUPT" display="1" locked="0"/></EXTERNAL_INTERRUPT><USART1><register register="UBRR1H" group="USART1" display="1" locked="0"/></USART1><USART1><register register="UCSR1C" group="USART1" display="1" locked="0"/></USART1><CPU><register register="SP" group="CPU" display="1" locked="0"/></CPU><CPU><register register="SREG" group="CPU" display="1" locked="0"/></CPU><CPU><register register="CLKPR" group="CPU" display="1" locked="0"/></CPU><EXTERNAL_INTERRUPT><register register="PCMSK0" group="EXTERNAL_INTERRUPT" display="1" locked="0"/></EXTERNAL_INTERRUPT><EXTERNAL_INTERRUPT><register register="PCMSK1" group="EXTERNAL_INTERRUPT" display="1" locked="0"/></EXTERNAL_INTERRUPT><TIMER_COUNTER_3><register register="ETIFR" group="TIMER_COUNTER_3" display="1" locked="0"/></TIMER_COUNTER_3><TIMER_COUNTER_3><register register="ETIMSK" group="TIMER_COUNTER_3" display="1" locked="0"/></TIMER_COUNTER_3><TIMER_COUNTER_3><register register="ICR3" group="TIMER_COUNTER_3" display="1" locked="0"/></TIMER_COUNTER_3><TIMER_COUNTER_3><register register="OCR3B" group="TIMER_COUNTER_3" display="1" locked="0"/></TIMER_COUNTER_3><TIMER_COUNTER_3><register register="OCR3A" group="TIMER_COUNTER_3" display="1" locked="0"/></TIMER_COUNTER_3><TIMER_COUNTER_3><register register="TCNT3" group="TIMER_COUNTER_3" display="1" locked="0"/></TIMER_COUNTER_3><TIMER_COUNTER_3><register register="TCCR3B" group="TIMER_COUNTER_3" display="1" locked="0"/></TIMER_COUNTER_3><TIMER_COUNTER_3><register register="TCCR3A" group="TIMER_COUNTER_3" display="1" locked="0"/></TIMER_COUNTER_3></CurrentRegisters></IOSettings><part name="ATMEGA162"/><Files><File00000 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\main.c" Position="644 157 1282 670" LineCol="12 73" State="Maximized"/><File00001 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\mk-data-structs.h" Position="666 179 1318 684" LineCol="0 0" State="Maximized"/><File00002 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\max7456_software_spi.h" Position="688 201 1340 706" LineCol="0 0" State="Maximized"/><File00003 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\max7456_software_spi.c" Position="710 223 1362 728" LineCol="22 0" State="Maximized"/><File00004 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\usart1.c" Position="732 245 1384 750" LineCol="22 23" State="Maximized"/><File00005 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\usart1.h" Position="754 267 1406 772" LineCol="42 3" State="Maximized"/><File00006 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\characters.c" Position="776 289 1428 794" LineCol="19 0" State="Maximized"/><File00007 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\main.h" Position="640 134 1524 890" LineCol="34 14" State="Maximized"/><File00008 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_helpers.c" Position="864 377 1498 864" LineCol="21 24" State="Maximized"/><File00009 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_helpers.h" Position="886 399 1520 886" LineCol="14 31" State="Maximized"/></Files></AVRWorkspace>
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA162"/><Files><File00000 Name="d:\Hobby\bl-UFO\Mikrocopter\15_SVN_Projekte\C-OSD\trunk\main.c" Position="145 172 1062 785" LineCol="598 0" State="Maximized"/><File00001 Name="d:\Hobby\bl-UFO\Mikrocopter\15_SVN_Projekte\C-OSD\trunk\mk-data-structs.h" Position="167 201 1076 784" LineCol="102 0" State="Maximized"/><File00002 Name="d:\Hobby\bl-UFO\Mikrocopter\15_SVN_Projekte\C-OSD\trunk\max7456_software_spi.h" Position="189 230 1098 813" LineCol="134 0" State="Maximized"/><File00003 Name="d:\Hobby\bl-UFO\Mikrocopter\15_SVN_Projekte\C-OSD\trunk\max7456_software_spi.c" Position="211 259 1120 842" LineCol="343 0" State="Maximized"/><File00004 Name="d:\Hobby\bl-UFO\Mikrocopter\15_SVN_Projekte\C-OSD\trunk\usart1.c" Position="233 288 1142 871" LineCol="245 0" State="Maximized"/><File00005 Name="d:\Hobby\bl-UFO\Mikrocopter\15_SVN_Projekte\C-OSD\trunk\usart1.h" Position="255 317 1164 900" LineCol="82 0" State="Maximized"/><File00006 Name="d:\Hobby\bl-UFO\Mikrocopter\15_SVN_Projekte\C-OSD\trunk\characters.c" Position="141 142 1282 1053" LineCol="402 0" State="Maximized"/><File00007 Name="d:\Hobby\bl-UFO\Mikrocopter\15_SVN_Projekte\C-OSD\trunk\main.h" Position="299 375 1208 958" LineCol="73 0" State="Maximized"/></Files></AVRWorkspace>
/C-OSD/trunk/main.c
32,7 → 32,6
#include "main.h"
#include "max7456_software_spi.h"
#include "usart1.h"
#include "osd_helpers.h"
 
/* TODO:
* - verifiy correctness of values
77,6 → 76,27
char ON[] PROGMEM = "ON ";
char OFF[] PROGMEM = "OFF";
 
// big vario arrays
char vario_00[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xff};
char vario_01[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xc0};
char vario_02[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xc1};
char vario_03[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0x00};
char vario_04[5] PROGMEM = {0x00, 0x00, 0xc2, 0xc0, 0x00};
char vario_05[5] PROGMEM = {0x00, 0x00, 0xc2, 0xc1, 0x00};
char vario_06[5] PROGMEM = {0x00, 0x00, 0xc2, 0x00, 0x00};
char vario_07[5] PROGMEM = {0x00, 0x00, 0xbb, 0x00, 0x00};
char vario_08[5] PROGMEM = {0x00, 0x00, 0xc3, 0x00, 0x00};
char vario_09[5] PROGMEM = {0x00, 0xc4, 0xc3, 0x00, 0x00};
char vario_10[5] PROGMEM = {0x00, 0xc5, 0xc3, 0x00, 0x00};
char vario_11[5] PROGMEM = {0x00, 0xff, 0xc3, 0x00, 0x00};
char vario_12[5] PROGMEM = {0xc4, 0xff, 0xc3, 0x00, 0x00};
char vario_13[5] PROGMEM = {0xc5, 0xff, 0xc3, 0x00, 0x00};
char vario_14[5] PROGMEM = {0xff, 0xff, 0xc3, 0x00, 0x00};
char* vario_pnt[15] PROGMEM = {vario_00, vario_01, vario_02, vario_03, vario_04,
vario_05, vario_06, vario_07, vario_08,
vario_09, vario_10, vario_11, vario_12,
vario_13, vario_14};
 
#endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1))
 
// general PAL|NTSC distingiusch stuff
105,21 → 125,19
return 0;
}
 
/* ##########################################################################
* Interrupt handler
* ##########################################################################*/
 
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
 
/**
* handler for undefined Interrupts
* if not defined AVR will reset in case any unhandled interrupts occur
* serial support
*/
ISR(__vector_default) {
asm("nop");
}
//#include "usart1.c"
 
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
 
/* ##########################################################################
* timer stuff
* ##########################################################################*/
 
/**
* timer kicks in every 1000uS ^= 1ms
*/
132,8 → 150,240
}
}
 
/* ##########################################################################
* compass stuff
* ##########################################################################*/
 
/**
* convert the <heading> gotton from NC into an index
*/
uint8_t heading_conv(uint16_t heading) {
if (heading > 23 && heading < 68) {
//direction = "NE";
return 0;
} else if (heading > 67 && heading < 113) {
//direction = "E ";
return 1;
} else if (heading > 112 && heading < 158) {
//direction = "SE";
return 2;
} else if (heading > 157 && heading < 203) {
//direction = "S ";
return 3;
} else if (heading > 202 && heading < 248) {
//direction = "SW";
return 4;
} else if (heading > 247 && heading < 293) {
//direction = "W ";
return 5;
} else if (heading > 292 && heading < 338) {
//direction = "NW";
return 6;
}
//direction = "N ";
return 7;
}
 
/**
* convert the <heading> gotton from NC into a more
* precise index
*/
uint8_t heading_fine_conv(uint16_t heading) {
heading = ((heading * 10) + 113) % 3600;
return (heading / 225);
}
 
/**
* draw a compass rose at <x>/<y> for <heading>
*/
void draw_compass(uint8_t x, uint8_t y, uint16_t heading) {
//char* rose = "---N---O---S---W---N---O---S---W---N---O---S---W";
char rose[48] = {216, 215, 216, 211, 216, 215, 216, 213, 216, 215, 216, 212,
216, 215, 216, 214, 216, 215, 216, 211, 216, 215, 216, 213,
216, 215, 216, 212, 216, 215, 216, 214, 216, 215, 216, 211,
216, 215, 216, 213, 216, 215, 216, 212, 216, 215, 216, 214};
// the center is char 19 (north), we add the current heading in 8th
// which would be 22.5 degrees, but float would bloat up the code
// and *10 / 225 would take ages... so we take the uncorrect way
uint8_t front = 19 + (heading / 22);
for (uint8_t i = 0; i < 9; i++) {
write_char_xy(x++, y, rose[front - 4 + i]);
}
}
 
/* ##########################################################################
* battery index
* ##########################################################################*/
/**
* draw a battery symbol at <x>/<y> according to <voltage>
*/
void draw_battery(uint8_t x, uint8_t y, uint16_t voltage) {
uint8_t percent = (100* (voltage - UBAT_WRN) / (UBAT_MAX - UBAT_WRN));
if (percent > 100) percent = 100;
if (voltage < UBAT_WRN) percent = 0;
write_char_xy(x, y, 0x9d - (percent * 13 / 100));
//write_ndigit_number_u(x, y-1, percent * 13 / 100, 100, 0);
}
 
/* ##########################################################################
* variometer
* ##########################################################################*/
/**
* draw variometer arrows at <x>/<y> according to <variometer>
*/
void draw_variometer(uint8_t x, uint8_t y, int16_t variometer) {
if (variometer == 0) {
write_char_xy(x, y, 0xbb); // plain line
} else if (variometer > 0) { // gain height
switch (variometer / 5){
case 0:
//write_char_xy(x, y, 0xba); // smallest arrow up
write_char_xy(x, y, 0x70); // one arrow up
break;
case 1:
//write_char_xy(x, y, 0xb9); // small arrow up
write_char_xy(x, y, 0x71); // two arrows up
break;
case 2:
//write_char_xy(x, y, 0xb8); // large arrow up
write_char_xy(x, y, 0x72); // three arrows up
break;
default:
//write_char_xy(x, y, 0xb7); // largest arrow up
write_char_xy(x, y, 0x73); // three black arrows up
}
} else { // sink
switch (variometer / -5){
case 0:
//write_char_xy(x, y, 0xbc); // smallest arrow down
write_char_xy(x, y, 0x77); // one arrow down
break;
case 1:
//write_char_xy(x, y, 0xbd); // small arrow down
write_char_xy(x, y, 0x76); // two arrows down
break;
case 2:
//write_char_xy(x, y, 0xbe); // large arrow down
write_char_xy(x, y, 0x75); // three arrows down
break;
default:
//write_char_xy(x, y, 0xbf); // largest arrow down
write_char_xy(x, y, 0x74); // three black arrows down
}
}
}
 
/**
* draw a bigger vario with middle at <x>/<y> acording to <variometer>
*/
void draw_big_variometer(uint8_t x, uint8_t y, int16_t variometer) {
int16_t index = 7 + variometer;
if (index > 14) index = 14;
else if (index < 0) index = 0;
// TODO: why does write_string_pgm_down(x, y-2, vario_pnt[index], 5);
// not work??? WTF?!
switch (index) {
case 0: write_string_pgm_down(x, y-2, vario_pnt[0], 5);
break;
case 1: write_string_pgm_down(x, y-2, vario_pnt[1], 5);
break;
case 2: write_string_pgm_down(x, y-2, vario_pnt[2], 5);
break;
case 3: write_string_pgm_down(x, y-2, vario_pnt[3], 5);
break;
case 4: write_string_pgm_down(x, y-2, vario_pnt[4], 5);
break;
case 5: write_string_pgm_down(x, y-2, vario_pnt[5], 5);
break;
case 6: write_string_pgm_down(x, y-2, vario_pnt[6], 5);
break;
case 7: write_string_pgm_down(x, y-2, vario_pnt[7], 5);
break;
case 8: write_string_pgm_down(x, y-2, vario_pnt[8], 5);
break;
case 9: write_string_pgm_down(x, y-2, vario_pnt[9], 5);
break;
case 10: write_string_pgm_down(x, y-2, vario_pnt[10], 5);
break;
case 11: write_string_pgm_down(x, y-2, vario_pnt[11], 5);
break;
case 12: write_string_pgm_down(x, y-2, vario_pnt[12], 5);
break;
case 13: write_string_pgm_down(x, y-2, vario_pnt[13], 5);
break;
default: write_string_pgm_down(x, y-2, vario_pnt[14], 5);
}
}
 
/* ##########################################################################
* artificial horizon
* ##########################################################################*/
// remember last time displayed values
int8_t old_af_x = -1, old_af_y = -1;
 
/**
* draw roll und nick indicators (could be enhanced to full artificial horizon)
* from line <firstline> to <listlines> for given <nick> and <roll> values
*/
void draw_artificial_horizon(uint8_t firstline, uint8_t lastline, int16_t nick, int16_t roll) {
char noodle[5] = {225, 225, 226, 227, 227};
uint8_t center_x = 15;
uint8_t center_y = lastline - firstline;
center_y = 7;
write_char_xy(center_x,center_y,228);
uint8_t cpos, nicky, rollx;
// which line
int8_t ypos = nick / 20;
// which character from the array?
if (nick < 0) {
cpos = -1*((nick - (ypos * 20))/4);
ypos--;
} else cpos = 4-((nick - (ypos * 20))/4);
if (cpos > 4) cpos = 4;
 
nicky = center_y - ypos;
if (nicky > lastline) nicky = lastline;
else if (nicky < firstline) nicky = firstline;
 
// ensure roll-borders
rollx = (roll / 8)+15;
if (rollx < 2) rollx = 2;
else if (rollx > 28) rollx = 28;
 
 
// clear roll
if (old_af_x != rollx && old_af_x >= 0) {
write_char_xy(old_af_x,13,0);
}
 
// clear nick
if (old_af_y != nicky && old_af_y >= 0) {
write_char_xy(center_x-1,old_af_y,0);
write_char_xy(center_x+1,old_af_y,0);
}
 
 
// draw nick
write_char_xy(center_x-1,nicky,noodle[cpos]);
write_char_xy(center_x+1,nicky,noodle[cpos]);
 
// draw roll
write_char_xy(rollx,lastline,229);
 
// update old vars
old_af_x = rollx;
old_af_y = nicky;
 
// debug numbers
//write_3digit_number_u(20,6,cpos);
//write_number_s(20,7,ypos);
//write_number_s(0,7,nick);
//write_number_s(18,11,roll);
}
 
/* ##########################################################################
* A simple config menu for the flags
* ##########################################################################*/
 
382,9 → 632,29
//write_ascii_string(2, 8, "is TESTING his open source");
//write_ascii_string(2, 9, " EPi OSD Firmware");
 
// custom char preview
/*write_char_xy( 2, 7, 200);
write_char_xy( 3, 7, 201);
write_char_xy( 4, 7, 202);
write_char_xy( 5, 7, 203);
write_char_xy( 6, 7, 204);
write_char_xy( 7, 7, 205);
write_char_xy( 8, 7, 206);
write_char_xy( 9, 7, 207);
write_char_xy(10, 7, 208);
write_char_xy(11, 7, 209);
write_char_xy(12, 7, 210);
write_char_xy(13, 7, 211);
write_char_xy(14, 7, 212);
write_char_xy(15, 7, 213);
write_char_xy(16, 7, 214);
write_char_xy(17, 7, 215);*/
 
// we are ready
LED3_ON
 
 
 
#if ALLCHARSDEBUG | (WRITECHARS != -1)
clear();
write_all_chars();
403,6 → 673,9
// and disable debug...
usart1_request_mk_data(0, 'd', 0);
 
// disable TXD-pin
//usart1_DisableTXD();
 
// stats for after flight
int16_t max_Altimeter = 0;
uint16_t max_GroundSpeed = 0;
416,6 → 689,13
char* directions[8] = {"NE", "E ", "SE", "S ", "SW", "W ", "NW", "N "};
//char arrowdir[8] = {218, 217, 224, 223, 222, 221, 220, 219};
 
/*write_ndigit_number_s_10th(5, 10, 1, 100, 0);
write_ndigit_number_s_10th(5, 11, -1, 100, 0);
write_ndigit_number_s_10th(5, 12, -11, 100, 0);*/
 
//write_ndigit_number_u(2,2, heading_fine_conv(34), 100, 0);
//write_char_xy(1, 2, 0xa0 + heading_fine_conv(34));
 
while (1) {
// write icons at init or after menu/mode-switch
if (!(COSD_FLAGS & COSD_ICONS_WRITTEN) && (COSD_FLAGS & COSD_FLAG_HUD)) {
575,9 → 855,14
config_menu();
}
if (seconds_since_last_data > 2) {
/*if (COSD_FLAGS & COSD_FLAG_HUD) {
write_ascii_string(2, 3, "ERROR: NO DATA for");
write_time(21, 3, seconds_since_last_data);
}*/
// request OSD Data from NC every 100ms
usart1_request_mk_data(1, 'o', 100);
seconds_since_last_data = 0;
_delay_ms(200);
//seconds_since_last_data = 0;
}
}
#endif
/C-OSD/trunk/usart1.c
53,10 → 53,10
* disable the txd pin of usart1
*/
void usart1_DisableTXD(void) {
UCSR1B &= ~(1 << TXCIE1); // disable TX-Interrupt
//UCSR1B &= ~(1 << TXCIE1); // disable TX-Interrupt
UCSR1B &= ~(1 << TXEN1); // disable TX in USART
DDRB &= ~(1<<DDB3); // set TXD pin as input
PORTB &= ~(1 << PORTB3); // disable pullup on TXD pin
PORTB &= ~(1 << PORTB3);
}
 
/**
64,11 → 64,12
*/
void usart1_EnableTXD(void) {
DDRB |= (1<<DDB3); // set TXD pin as output
PORTB &= ~(1 << PORTB3); // disable pullup on TXD pin
PORTB &= ~(1 << PORTB3);
UCSR1B |= (1 << TXEN1); // enable TX in USART
UCSR1B |= (1 << TXCIE1); // enable TX-Interrupt
//UCSR1B |= (1 << TXCIE1); // enable TX-Interrupt
}
 
 
/**
* send a single <character> through usart1
*/
92,7 → 93,7
* transmit interrupt handler
* unused
*/
ISR(SIG_USART1_DATA) {
SIGNAL(SIG_USART1_DATA) {
}
 
/**
245,8 → 246,7
 
unsigned char mstenth = ms/10;
sendMKData(label, address, &mstenth, 1);
// wait until UDR ready
while (!(UCSR1A & (1 << UDRE1)));
// disable TXD pin again
usart1_DisableTXD();
}
/C-OSD/trunk/usart1.h
30,6 → 30,8
extern volatile uint8_t *pRxData;
extern volatile uint8_t RxDataLen;
 
extern
 
/**
* init usart1
*/
54,7 → 56,7
* transmit interrupt handler
* unused
*/
ISR(SIG_USART1_DATA);
SIGNAL(SIG_USART1_DATA);
 
/**
* receive data through usart1