Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 495 → Rev 497

/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>25-May-2009 20:23:26</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><SOURCEFILE>osd_ncmode_default.c</SOURCEFILE><SOURCEFILE>osd_fcmode_default.c</SOURCEFILE><SOURCEFILE>config.c</SOURCEFILE><SOURCEFILE>spi.c</SOURCEFILE><SOURCEFILE>buttons.c</SOURCEFILE><SOURCEFILE>ppm.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><HEADERFILE>config.h</HEADERFILE><HEADERFILE>spi.h</HEADERFILE><HEADERFILE>buttons.h</HEADERFILE><HEADERFILE>ppm.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><File00010><FileId>00010</FileId><FileName>osd_ncmode_default.c</FileName><Status>1</Status></File00010><File00011><FileId>00011</FileId><FileName>osd_fcmode_default.c</FileName><Status>1</Status></File00011><File00012><FileId>00012</FileId><FileName>config.c</FileName><Status>1</Status></File00012><File00013><FileId>00013</FileId><FileName>config.h</FileName><Status>1</Status></File00013><File00014><FileId>00014</FileId><FileName>spi.c</FileName><Status>1</Status></File00014><File00015><FileId>00015</FileId><FileName>spi.h</FileName><Status>1</Status></File00015><File00016><FileId>00016</FileId><FileName>buttons.c</FileName><Status>1</Status></File00016><File00017><FileId>00017</FileId><FileName>buttons.h</FileName><Status>1</Status></File00017><File00018><FileId>00018</FileId><FileName>ppm.c</FileName><Status>1</Status></File00018><File00019><FileId>00019</FileId><FileName>ppm.h</FileName><Status>1</Status></File00019></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>04-Jun-2009 13:28:13</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><SOURCEFILE>osd_ncmode_default.c</SOURCEFILE><SOURCEFILE>osd_fcmode_default.c</SOURCEFILE><SOURCEFILE>config.c</SOURCEFILE><SOURCEFILE>spi.c</SOURCEFILE><SOURCEFILE>buttons.c</SOURCEFILE><SOURCEFILE>ppm.c</SOURCEFILE><SOURCEFILE>osd_ncmode_minimal.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><HEADERFILE>config.h</HEADERFILE><HEADERFILE>spi.h</HEADERFILE><HEADERFILE>buttons.h</HEADERFILE><HEADERFILE>ppm.h</HEADERFILE><HEADERFILE>osd_ncmode_default.h</HEADERFILE><HEADERFILE>osd_ncmode_minimal.h</HEADERFILE><HEADERFILE>osd_fcmode_default.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><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><File00010><FileId>00010</FileId><FileName>osd_ncmode_default.c</FileName><Status>1</Status></File00010><File00011><FileId>00011</FileId><FileName>osd_fcmode_default.c</FileName><Status>1</Status></File00011><File00012><FileId>00012</FileId><FileName>config.c</FileName><Status>1</Status></File00012><File00013><FileId>00013</FileId><FileName>config.h</FileName><Status>1</Status></File00013><File00014><FileId>00014</FileId><FileName>spi.c</FileName><Status>1</Status></File00014><File00015><FileId>00015</FileId><FileName>spi.h</FileName><Status>1</Status></File00015><File00016><FileId>00016</FileId><FileName>buttons.c</FileName><Status>1</Status></File00016><File00017><FileId>00017</FileId><FileName>buttons.h</FileName><Status>1</Status></File00017><File00018><FileId>00018</FileId><FileName>ppm.c</FileName><Status>1</Status></File00018><File00019><FileId>00019</FileId><FileName>ppm.h</FileName><Status>1</Status></File00019><File00020><FileId>00020</FileId><FileName>osd_ncmode_minimal.c</FileName><Status>1</Status></File00020><File00021><FileId>00021</FileId><FileName>osd_ncmode_default.h</FileName><Status>1</Status></File00021><File00022><FileId>00022</FileId><FileName>osd_ncmode_minimal.h</FileName><Status>1</Status></File00022><File00023><FileId>00023</FileId><FileName>osd_fcmode_default.h</FileName><Status>1</Status></File00023></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
/C-OSD/trunk/CHANGE.LOG
17,6 → 17,13
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
20090604-1330
*possible to choose between different osd-layouts (via menu)
20090604-0700
+(shaddi)osd_ncmode_minimal for less symbols during FPV
 
20090601-2233
*(woggle) changed timer init an interupt to be more precise
*(woggle) remove all warning during compile
/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="694 146 1766 926" LineCol="224 12" State="Maximized"/><File00001 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\mk-data-structs.h" Position="720 191 1538 698" LineCol="0 0" State="Maximized"/><File00002 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\max7456_software_spi.h" Position="742 213 1560 720" LineCol="0 0" State="Maximized"/><File00003 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\max7456_software_spi.c" Position="764 235 1582 742" LineCol="23 0" State="Maximized"/><File00004 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\usart1.c" Position="786 257 1604 764" LineCol="0 0" State="Maximized"/><File00005 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\usart1.h" Position="808 279 1626 786" LineCol="23 27" State="Maximized"/><File00006 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\characters.c" Position="830 301 1648 808" LineCol="0 0" State="Maximized"/><File00007 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\main.h" Position="852 323 1670 830" LineCol="28 0" State="Maximized"/><File00008 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_helpers.c" Position="874 345 1692 852" LineCol="0 0" State="Maximized"/><File00009 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_helpers.h" Position="896 367 1714 874" LineCol="0 0" State="Maximized"/><File00010 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_ncmode_default.c" Position="918 389 1736 896" LineCol="42 124" State="Maximized"/><File00011 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_fcmode_default.c" Position="940 411 1758 918" LineCol="0 0" State="Maximized"/><File00012 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\config.c" Position="698 169 1516 676" LineCol="261 20" State="Maximized"/><File00013 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\config.h" Position="720 191 1538 698" LineCol="0 0" State="Maximized"/><File00014 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\spi.c" Position="742 213 1560 720" LineCol="0 0" State="Maximized"/><File00015 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\spi.h" Position="764 235 1582 742" LineCol="0 0" State="Maximized"/><File00016 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\buttons.c" Position="786 257 1604 764" LineCol="0 0" State="Maximized"/><File00017 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\buttons.h" Position="808 279 1626 786" LineCol="0 0" State="Maximized"/><File00018 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\ppm.c" Position="830 301 1648 808" LineCol="24 45" State="Maximized"/><File00019 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\ppm.h" Position="852 323 1670 830" LineCol="18 78" State="Maximized"/></Files></AVRWorkspace>
<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="212 116 1038 653" LineCol="142 61" State="Maximized"/><File00001 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\mk-data-structs.h" Position="234 138 1052 645" LineCol="38 0" State="Maximized"/><File00002 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\max7456_software_spi.h" Position="256 160 1074 667" LineCol="40 0" State="Maximized"/><File00003 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\max7456_software_spi.c" Position="278 182 1096 689" LineCol="23 0" State="Maximized"/><File00004 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\usart1.c" Position="300 204 1118 711" LineCol="0 0" State="Maximized"/><File00005 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\usart1.h" Position="322 226 1140 733" LineCol="23 0" State="Maximized"/><File00006 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\characters.c" Position="344 248 1162 755" LineCol="27 21" State="Maximized"/><File00007 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\main.h" Position="208 93 1922 972" LineCol="29 0" State="Maximized"/><File00008 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_helpers.c" Position="388 292 1206 799" LineCol="178 84" State="Maximized"/><File00009 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_helpers.h" Position="410 314 1228 821" LineCol="18 78" State="Maximized"/><File00010 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_ncmode_default.c" Position="432 336 1250 843" LineCol="11 24" State="Maximized"/><File00011 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_fcmode_default.c" Position="454 358 1272 865" LineCol="8 17" State="Maximized"/><File00012 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\config.c" Position="212 116 1030 623" LineCol="87 4" State="Maximized"/><File00013 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\config.h" Position="234 138 1052 645" LineCol="23 38" State="Maximized"/><File00014 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\spi.c" Position="256 160 1074 667" LineCol="0 0" State="Maximized"/><File00015 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\spi.h" Position="278 182 1096 689" LineCol="0 0" State="Maximized"/><File00016 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\buttons.c" Position="300 204 1118 711" LineCol="0 0" State="Maximized"/><File00017 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\buttons.h" Position="322 226 1140 733" LineCol="0 0" State="Maximized"/><File00018 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\ppm.c" Position="344 248 1162 755" LineCol="24 0" State="Maximized"/><File00019 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\ppm.h" Position="366 270 1184 777" LineCol="18 0" State="Maximized"/><File00020 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_ncmode_minimal.c" Position="366 270 1808 858" LineCol="25 0" State="Maximized"/><File00021 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_ncmode_default.h" Position="388 292 1830 880" LineCol="20 3" State="Maximized"/><File00022 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_ncmode_minimal.h" Position="410 314 1852 902" LineCol="20 3" State="Maximized"/><File00023 Name="G:\Eigene Dateien\C-Projects\C-OSD\trunk\osd_fcmode_default.h" Position="432 336 1874 924" LineCol="20 3" State="Maximized"/></Files></AVRWorkspace>
/C-OSD/trunk/config.c
40,6 → 40,7
uint16_t EEMEM ee_cal_ampere = 512;
uint8_t EEMEM ee_sensor = 50;
uint8_t EEMEM ee_COSD_FLAGS;
uint8_t EEMEM ee_COSD_DISPLAYMODE = 0;
 
// store init strings in progmem
const char init_0[] PROGMEM = "C-OSD Initialisation";
68,12 → 69,14
const char menu_item5[] PROGMEM = "Warnings"; // TODO: do it!
const char menu_item6[] PROGMEM = "Reset uptime";
const char menu_item7[] PROGMEM = "Request OSD-data";
const char menu_item8[] PROGMEM = "Disable Debug-data";
const char menu_item8[] PROGMEM = "Display Mode";
const char menu_item9[] PROGMEM = "Save config";
const char menu_item10[] PROGMEM = "EXIT";
const char* menu[] = {menu_item0, menu_item1, menu_item2, menu_item3, menu_item4,
menu_item5, menu_item6, menu_item7, menu_item8, menu_item9, menu_item10};
 
const displaymode_t * mode;
 
/**
* read data saved in eeprom, print out message if <verbose> is set
*/
81,6 → 84,8
if (eeprom_read_byte(&ee_checkbyte1) == CHECKBYTE1 && eeprom_read_byte(&ee_checkbyte2) == CHECKBYTE2) {
if (verbose) write_ascii_string_pgm(2, 9, ee_msg[0]); // Loading data
COSD_FLAGS = eeprom_read_byte(&ee_COSD_FLAGS);
COSD_DISPLAYMODE = eeprom_read_byte(&ee_COSD_DISPLAYMODE);
//if (verbose) write_ndigit_number_u(23, 11, COSD_DISPLAYMODE, 10, 0);
} else {
if (verbose) write_ascii_string_pgm(2, 9, ee_msg[1]); // No data found
}
93,6 → 98,7
eeprom_write_byte(&ee_checkbyte1, CHECKBYTE1);
eeprom_write_byte(&ee_checkbyte2, CHECKBYTE2);
eeprom_write_byte(&ee_COSD_FLAGS, COSD_FLAGS);
eeprom_write_byte(&ee_COSD_DISPLAYMODE, COSD_DISPLAYMODE);
}
 
/**
142,6 → 148,19
write_ascii_string_pgm(23, 2, VM_PAL);
}
 
 
#if FCONLY
COSD_DISPLAYMODE %= (sizeof(fcdisplaymodes) / sizeof(displaymode_t));
mode = fcdisplaymodes;
mode += COSD_DISPLAYMODE;
osd_fcmode = (int(*)(void)) pgm_read_word(&mode->dfun);
#else
COSD_DISPLAYMODE %= (sizeof(ncdisplaymodes) / sizeof(displaymode_t));
mode = ncdisplaymodes;
mode += COSD_DISPLAYMODE;
osd_ncmode = (int(*)(void)) pgm_read_word(&mode->dfun);
#endif
 
_delay_ms(200);
clear();
// update flags to paint display again because of clear
192,6 → 211,9
} else {
write_ascii_string_pgm(23, 7, OFF);
}
//write_ndigit_number_u(23, 10, COSD_DISPLAYMODE, 10, 0);
write_ascii_string_pgm(18, 10, (const char *) (pgm_read_word(&(mode->desc))));
}
 
/**
295,11 → 317,19
#endif
config_menu_doclick(chosen, menu);
break;
case 8: // disable debug data
// disable sending of debug data
// may result in smoother ddata display
usart1_request_mk_data(0, 'd', 0);
config_menu_doclick(chosen, menu);
case 8: // change mode
#if FCONLY
COSD_DISPLAYMODE = (COSD_DISPLAYMODE + 1) % (sizeof(fcdisplaymodes) / sizeof(displaymode_t));
mode = fcdisplaymodes;
mode += COSD_DISPLAYMODE;
osd_fcmode = (int(*)(void)) pgm_read_word(&mode->dfun);
#else
COSD_DISPLAYMODE = (COSD_DISPLAYMODE + 1) % (sizeof(ncdisplaymodes) / sizeof(displaymode_t));
mode = ncdisplaymodes;
mode += COSD_DISPLAYMODE;
osd_ncmode = (int(*)(void)) pgm_read_word(&mode->dfun);
#endif
config_menu_drawings(chosen);
break;
case 9: // save
save_eeprom();
/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 config.o spi.o buttons.o ppm.o
OBJECTS = main.o usart1.o max7456_software_spi.o osd_helpers.o config.o spi.o buttons.o ppm.o osd_ncmode_default.o osd_ncmode_minimal.o osd_fcmode_default.o
 
## Objects explicitly added by the user
LINKONLYOBJECTS =
67,7 → 67,16
 
ppm.o: ../ppm.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
osd_ncmode_default.o: ../osd_ncmode_default.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
osd_ncmode_minimal.o: ../osd_ncmode_minimal.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
 
osd_fcmode_default.o: ../osd_fcmode_default.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
 
##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
/C-OSD/trunk/main.c
37,6 → 37,11
#include "spi.h"
#include "buttons.h"
#include "ppm.h"
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
#include "osd_ncmode_default.h"
#include "osd_ncmode_minimal.h"
#include "osd_fcmode_default.h"
#endif
 
/* TODO:
* - verifiy correctness of values
43,9 → 48,6
* - clean up code :)
*/
 
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
// data structs not needed for character flashing
#include "mk-data-structs.h"
 
/* ##########################################################################
* global definitions and global vars
68,6 → 70,27
// remember last time data was received
volatile uint8_t seconds_since_last_data = 0;
 
// general PAL|NTSC distingiusch stuff
uint8_t top_line = 1;
uint8_t bottom_line = 14;
 
// battery voltages
uint8_t min_voltage = 0;
uint8_t max_voltage = 0;
 
// Flags
uint8_t COSD_FLAGS = 0, COSD_FLAGS2 = 0;
 
// stats for after flight
int16_t max_Altimeter = 0;
uint8_t min_UBat = 255;
uint16_t max_GroundSpeed = 0;
int16_t max_Distance = 0;
uint16_t max_FlyingTime = 0;
 
// flags from last round to check for changes
uint8_t old_MKFlags = 0;
 
// store stats description in progmem to save space
const char stats_item_0[] PROGMEM = "max Altitude:";
const char stats_item_1[] PROGMEM = "max Speed :";
77,10 → 100,9
const char stats_item_5[] PROGMEM = "longitude :";
const char stats_item_6[] PROGMEM = "latitude :";
const char stats_item_7[] PROGMEM = "max current :";
const char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
const char* stats_item_pointers[8] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
stats_item_3, stats_item_4, stats_item_5, stats_item_6, stats_item_7};
 
#if !(FCONLY)
//char* directions[8] = {"NE", "E ", "SE", "S ", "SW", "W ", "NW", "N "};
//char arrowdir[8] = {218, 217, 224, 223, 222, 221, 220, 219};
const char str_NE[] PROGMEM = "NE";
100,20 → 122,26
str_W,
str_NW,
str_N};
#endif
 
#endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1))
/* ##########################################################################
* Different display mode function pointers
* ##########################################################################*/
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
const char str_1[] PROGMEM = "default";
const char str_2[] PROGMEM = "minimal";
 
// general PAL|NTSC distingiusch stuff
uint8_t top_line = 1;
uint8_t bottom_line = 14;
const displaymode_t ncdisplaymodes[] PROGMEM = {
{ osd_ncmode_default, (char *)str_1 },
{ osd_ncmode_minimal, (char *)str_2 }
};
 
// battery voltages
uint8_t min_voltage = 0;
uint8_t max_voltage = 0;
const displaymode_t fcdisplaymodes[] PROGMEM = {
{ osd_fcmode_default, (char *)str_1 },
};
 
// Flags
uint8_t COSD_FLAGS = 0, COSD_FLAGS2 = 0;
int (*osd_ncmode)(void) = (int(*)(void)) &osd_ncmode_default;
int (*osd_fcmode)(void) = (int(*)(void)) &osd_ncmode_default;
#endif
 
/* ##########################################################################
* Interrupt handler
283,18 → 311,6
usart1_request_mk_data(0, 'd', 0);
#endif
 
// stats for after flight
int16_t max_Altimeter = 0;
uint8_t min_UBat = 255;
#if !(FCONLY)
uint16_t max_GroundSpeed = 0;
int16_t max_Distance = 0;
uint16_t max_FlyingTime = 0;
 
// flags from last round to check for changes
uint8_t old_MKFlags = 0;
#endif
 
while (1) {
// in case SPI is ready and there is nothing to send right now
if (!icnt && spi_ready) {
344,8 → 360,8
// fix for min_UBat
min_UBat = debugData.Analog[9];
init_cosd(debugData.Analog[9]);
}
#include OSD_FCMODE
}
osd_fcmode();
}
#else
if (rxd_buffer[2] == 'O') { // NC OSD Data
358,7 → 374,7
min_UBat = naviData.UBat;
init_cosd(naviData.UBat);
}
#include OSD_NCMODE
osd_ncmode();
}
#endif
rxd_buffer_locked = 0;
/C-OSD/trunk/main.h
18,6 → 18,9
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
#include <avr/pgmspace.h>
#include "mk-data-structs.h"
 
/* ##########################################################################
* Debugging and general purpose definitions
* ##########################################################################*/
42,16 → 45,8
#ifndef FCONLY
#define FCONLY 0 // set to 1 if you do NOT have a NaviCtrl and the OSD is
#endif // connected to the FC directly
 
#ifndef OSD_FCMODE // set up which FCMODE to display if doing batch generating
#define OSD_FCMODE "osd_fcmode_default.c" // default is a nice standard
#endif
 
#ifndef OSD_NCMODE // set up which NCMODE to display if doing batch generating
#define OSD_NCMODE "osd_ncmode_default.c" // default is a nice standard
#endif
 
#define HUD 1 // set to 0 to disable HUD by default
#define HUD 1 // set to 0 to disable HUD by default
#define ARTHORIZON 0 // set to 1 to enable roll&nick artificial horizon by default
#define BIGVARIO 0 // set to 1 to enable the big vario bar on right side
#define STATS 1 // set to 1 to enable statistics during motor off by default
112,3 → 107,61
extern int16_t ampere, max_ampere;
extern int32_t ampere_wasted;
 
/* ##########################################################################
* struct for displaymodes
* ##########################################################################*/
typedef struct {
int (*dfun)(void); // function pointer
char *desc; // description text
} displaymode_t;
 
const displaymode_t ncdisplaymodes[2];
const displaymode_t fcdisplaymodes[1];
 
int (*osd_ncmode)(void);
int (*osd_fcmode)(void);
 
/* ##########################################################################
* vars used by other parts as well
* ##########################################################################*/
volatile uint16_t setsReceived;
 
volatile NaviData_t naviData;
volatile DebugOut_t debugData;
 
// cache old vars for blinking attribute, checkup is faster than full
// attribute write each time
volatile uint8_t last_UBat;
volatile uint8_t last_RC_Quality;
 
// 16bit should be enough, normal LiPos don't last that long
volatile uint16_t uptime;
volatile uint16_t timer;
 
// remember last time data was received
volatile uint8_t seconds_since_last_data;
 
// general PAL|NTSC distingiusch stuff
uint8_t top_line;
uint8_t bottom_line;
 
// battery voltages
uint8_t min_voltage;
uint8_t max_voltage;
 
// Flags
uint8_t COSD_FLAGS, COSD_FLAGS2, COSD_DISPLAYMODE;
 
// stats for after flight
int16_t max_Altimeter;
uint8_t min_UBat;
 
uint16_t max_GroundSpeed;
int16_t max_Distance;
uint16_t max_FlyingTime;
 
// flags from last round to check for changes
uint8_t old_MKFlags;
 
const char *directions[8];
const char* stats_item_pointers[8];
/C-OSD/trunk/osd_fcmode_default.c
17,68 → 17,82
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
if (COSD_FLAGS & COSD_FLAG_HUD) {
// write icons at init or after menu/mode-switch
if (!(COSD_FLAGS2 & COSD_ICONS_WRITTEN)) {
write_char_xy(10, top_line, 0xCA); // RC-transmitter
write_char_xy(27, top_line, 0xCC); // small meters m height
write_char_xy(7, bottom_line, 0x9E); // small v
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_char_xy(7, bottom_line - 1, 0x9F); // small A
write_char_xy(14, bottom_line - 1, 0xB5); // mah
 
#include "main.h"
#include "max7456_software_spi.h"
#include "osd_helpers.h"
#include "osd_fcmode_default.h"
 
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
 
int osd_fcmode_default() {
if (COSD_FLAGS & COSD_FLAG_HUD) {
// write icons at init or after menu/mode-switch
if (!(COSD_FLAGS2 & COSD_ICONS_WRITTEN)) {
write_char_xy(10, top_line, 0xCA); // RC-transmitter
write_char_xy(27, top_line, 0xCC); // small meters m height
write_char_xy(7, bottom_line, 0x9E); // small v
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_char_xy(7, bottom_line - 1, 0x9F); // small A
write_char_xy(14, bottom_line - 1, 0xB5); // mah
}
COSD_FLAGS2 |= COSD_ICONS_WRITTEN;
}
COSD_FLAGS2 |= COSD_ICONS_WRITTEN;
}
 
write_ndigit_number_u(7, top_line, debugData.Analog[10], 100, 0);
if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, BLINK);
} else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, 0);
}
write_ndigit_number_u(7, top_line, debugData.Analog[10], 100, 0);
if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, BLINK);
} else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, 0);
}
if (debugData.Analog[5] > 300 || debugData.Analog[5] < -300) {
// above 10m only write full meters
write_ndigit_number_s(23, top_line, debugData.Analog[5] / 30, 1000, 0);
} else {
// up to 10m write meters.dm
write_ndigit_number_s_10th(23, top_line, debugData.Analog[5] / 3, 100, 0);
}
if (debugData.Analog[5] > max_Altimeter) max_Altimeter = debugData.Analog[5];
if (debugData.Analog[5] > 300 || debugData.Analog[5] < -300) {
// above 10m only write full meters
write_ndigit_number_s(23, top_line, debugData.Analog[5] / 30, 1000, 0);
} else {
// up to 10m write meters.dm
write_ndigit_number_s_10th(23, top_line, debugData.Analog[5] / 3, 100, 0);
}
if (debugData.Analog[5] > max_Altimeter) max_Altimeter = debugData.Analog[5];
 
if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) {
draw_artificial_horizon(top_line + 2, bottom_line - 1, debugData.Analog[0], debugData.Analog[1]);
}
if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) {
draw_artificial_horizon(top_line + 2, bottom_line - 1, debugData.Analog[0], debugData.Analog[1]);
}
 
// pre-bottom line
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
//write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0);
write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0);
write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 1000, 0);
// pre-bottom line
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
//write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0);
write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0);
write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 1000, 0);
}
 
draw_battery(2, bottom_line, min_voltage, debugData.Analog[9], max_voltage);
write_ndigit_number_u_10th(3, bottom_line, debugData.Analog[9], 100, 0);
if (debugData.Analog[9] <= min_voltage && last_UBat > min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, BLINK);
} else if (debugData.Analog[9] > min_voltage && last_UBat < min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, 0);
}
}
// remember last values
last_UBat = debugData.Analog[9];
last_RC_Quality = debugData.Analog[10];
 
draw_battery(2, bottom_line, min_voltage, debugData.Analog[9], max_voltage);
write_ndigit_number_u_10th(3, bottom_line, debugData.Analog[9], 100, 0);
if (debugData.Analog[9] <= min_voltage && last_UBat > min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, BLINK);
} else if (debugData.Analog[9] > min_voltage && last_UBat < min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, 0);
}
/*
debugData.Analog[0]); // AngleNick
debugData.Analog[1]); // AngleRoll
debugData.Analog[5]); // Height
debugData.Analog[9]); // Voltage
debugData.Analog[10]);// RC Signal
debugData.Analog[11]);// Gyro compass
*/
seconds_since_last_data = 0;
 
return 0;
}
// remember last values
last_UBat = debugData.Analog[9];
last_RC_Quality = debugData.Analog[10];
 
/*
debugData.Analog[0]); // AngleNick
debugData.Analog[1]); // AngleRoll
debugData.Analog[5]); // Height
debugData.Analog[9]); // Voltage
debugData.Analog[10]);// RC Signal
debugData.Analog[11]);// Gyro compass
*/
seconds_since_last_data = 0;
#endif
/C-OSD/trunk/osd_fcmode_default.h
0,0 → 1,21
/****************************************************************************
* Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje *
* admiralcascade@gmail.com *
* Project-URL: http://www.mylifesucks.de/oss/c-osd/ *
* *
* 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. *
* *
* 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. *
****************************************************************************/
 
int osd_fcmode_default(void);
/C-OSD/trunk/osd_helpers.c
19,6 → 19,7
****************************************************************************/
 
#include <avr/pgmspace.h>
#include "main.h"
#include "osd_helpers.h"
#include "max7456_software_spi.h"
 
/C-OSD/trunk/osd_helpers.h
18,8 → 18,6
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
#include "main.h"
 
#ifndef ALLCHARSDEBUG
#define ALLCHARSDEBUG = 0
#endif
/C-OSD/trunk/osd_ncmode_default.c
17,185 → 17,199
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
if (COSD_FLAGS & COSD_FLAG_HUD) {
// write icons at init or after menu/mode-switch
if (!(COSD_FLAGS2 & COSD_ICONS_WRITTEN)) {
write_char_xy(5, top_line, 0xCB); // km/h
write_char_xy(10, top_line, 0xCA); // RC-transmitter
write_char_xy(16, top_line, 0xD0); // degree symbol
write_char_xy(27, top_line, 0xCC); // small meters m height
write_char_xy(20, top_line + 1, 0xB0); // left circle
write_char_xy(22, top_line + 1, 0xB2); // right circle
write_char_xy(27, top_line + 1, 0xCC); // small meters m home
write_char_xy(7, bottom_line, 0x9E); // small V
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_char_xy(7, bottom_line - 1, 0x9F); // small A
write_char_xy(14, bottom_line - 1, 0xB5); // mah
 
#include "main.h"
#include "max7456_software_spi.h"
#include "osd_helpers.h"
#include "osd_ncmode_default.h"
 
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
 
int osd_ncmode_default() {
if (COSD_FLAGS & COSD_FLAG_HUD) {
// write icons at init or after menu/mode-switch
if (!(COSD_FLAGS2 & COSD_ICONS_WRITTEN)) {
write_char_xy(5, top_line, 0xCB); // km/h
write_char_xy(10, top_line, 0xCA); // RC-transmitter
write_char_xy(16, top_line, 0xD0); // degree symbol
write_char_xy(27, top_line, 0xCC); // small meters m height
write_char_xy(20, top_line + 1, 0xB0); // left circle
write_char_xy(22, top_line + 1, 0xB2); // right circle
write_char_xy(27, top_line + 1, 0xCC); // small meters m home
write_char_xy(7, bottom_line, 0x9E); // small V
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_char_xy(7, bottom_line - 1, 0x9F); // small A
write_char_xy(14, bottom_line - 1, 0xB5); // mah
}
write_char_xy(14, bottom_line, 0xD1); // on clock
write_char_xy(21, bottom_line, 0xD2); // fly clock
write_char_xy(26, bottom_line, 0xC8); // sat1
write_char_xy(27, bottom_line, 0xC9); // sat2
COSD_FLAGS2 |= COSD_ICONS_WRITTEN;
}
write_char_xy(14, bottom_line, 0xD1); // on clock
write_char_xy(21, bottom_line, 0xD2); // fly clock
write_char_xy(26, bottom_line, 0xC8); // sat1
write_char_xy(27, bottom_line, 0xC9); // sat2
COSD_FLAGS2 |= COSD_ICONS_WRITTEN;
}
 
// first line
write_ndigit_number_u(2, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
// first line
write_ndigit_number_u(2, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
 
write_ndigit_number_u(7, top_line, naviData.RC_Quality, 100, 0);
if (naviData.RC_Quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, BLINK);
} else if (naviData.RC_Quality > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, 0);
}
write_ndigit_number_u(7, top_line, naviData.RC_Quality, 100, 0);
if (naviData.RC_Quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, BLINK);
} else if (naviData.RC_Quality > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, 0);
}
 
if (naviData.NCFlags & NC_FLAG_NOSERIALLINK) {
write_char_xy(11, top_line, 0); // clear
} else {
write_char_xy(11, top_line, 0xC6); // PC icon
}
if (naviData.NCFlags & NC_FLAG_NOSERIALLINK) {
write_char_xy(11, top_line, 0); // clear
} else {
write_char_xy(11, top_line, 0xC6); // PC icon
}
 
write_ndigit_number_u(13, top_line, naviData.CompassHeading, 100, 0);
write_ndigit_number_u(13, top_line, naviData.CompassHeading, 100, 0);
 
write_ascii_string_pgm(17, top_line, (const char *) (pgm_read_word ( &(directions[heading_conv(naviData.CompassHeading)]))));
write_ascii_string_pgm(17, top_line, (const char *) (pgm_read_word ( &(directions[heading_conv(naviData.CompassHeading)]))));
 
draw_variometer(21, top_line, naviData.Variometer);
draw_variometer(21, top_line, naviData.Variometer);
 
//note:lephisto:according to several sources it's /30
if (naviData.Altimeter > 300 || naviData.Altimeter < -300) {
// above 10m only write full meters
write_ndigit_number_s(23, top_line, naviData.Altimeter / 30, 1000, 0);
} else {
// up to 10m write meters.dm
//write_number_u_10th(21, top_line, naviData.Altimeter / 3);
write_ndigit_number_s_10th(23, top_line, naviData.Altimeter / 3, 100, 0);
}
//note:lephisto:according to several sources it's /30
if (naviData.Altimeter > 300 || naviData.Altimeter < -300) {
// above 10m only write full meters
write_ndigit_number_s(23, top_line, naviData.Altimeter / 30, 1000, 0);
} else {
// up to 10m write meters.dm
//write_number_u_10th(21, top_line, naviData.Altimeter / 3);
write_ndigit_number_s_10th(23, top_line, naviData.Altimeter / 3, 100, 0);
}
 
// seccond line
draw_compass(11, top_line + 1, naviData.CompassHeading);
// seccond line
draw_compass(11, top_line + 1, naviData.CompassHeading);
 
// TODO: verify correctness
uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360;
//write_char_xy(21, top_line + 1, arrowdir[heading_conv(heading_home)]);
// finer resolution, 0xa0 is first character and we add the index 0 <= index < 16
write_char_xy(21, top_line + 1, 0xa0 + heading_fine_conv(heading_home));
// TODO: verify correctness
uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360;
//write_char_xy(21, top_line + 1, arrowdir[heading_conv(heading_home)]);
// finer resolution, 0xa0 is first character and we add the index 0 <= index < 16
write_char_xy(21, top_line + 1, 0xa0 + heading_fine_conv(heading_home));
 
write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 100, 0);
write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 100, 0);
 
// center
if (naviData.MKFlags & FLAG_MOTOR_RUN) { // should be engines running
if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle
clear();
// update flags to paint display again if needed
COSD_FLAGS2 &= ~COSD_ICONS_WRITTEN;
}
if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) {
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
} else {
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
}
// motors are on, assume we were/are flying
COSD_FLAGS2 |= COSD_WASFLYING;
} else {
// stats
if ((COSD_FLAGS2 & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) {
uint8_t line = 3;
write_ascii_string_pgm(2, line, stats_item_pointers[0]); // max Altitude
write_ndigit_number_s(18, line, max_Altimeter / 30, 1000, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[1]); // max Speed
write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
write_char_xy(22, line, 203); // km/h
write_ascii_string_pgm(2, ++line, stats_item_pointers[2]); // max Distance
write_ndigit_number_u(19, line, max_Distance / 10, 100, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[3]); // min voltage
write_ndigit_number_u_10th(18, line, min_UBat, 100, 0);
write_char_xy(22, line, 0x9E); // small V
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_ascii_string_pgm(2, ++line, stats_item_pointers[7]); // ampere
write_ndigit_number_u_10th(18, line, max_ampere / 10, 100, 0);
write_char_xy(22, line, 0x9F); // small A
}
write_ascii_string_pgm(2, ++line, stats_item_pointers[4]); // max time
write_time(16, line, max_FlyingTime);
write_char_xy(22, line, 210); // fly clock
write_ascii_string_pgm(2, ++line, stats_item_pointers[5]); // longitude
write_gps_pos(15, line, naviData.CurrentPosition.Longitude);
write_ascii_string_pgm(2, ++line, stats_item_pointers[6]); // latitude
write_gps_pos(15, line, naviData.CurrentPosition.Latitude);
} else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
} else {
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
}
}
if (COSD_FLAGS & COSD_FLAG_BIGVARIO) {
draw_big_variometer(27, 8, naviData.Variometer);
}
// center
if (naviData.MKFlags & FLAG_MOTOR_RUN) { // should be engines running
if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle
clear();
// update flags to paint display again if needed
COSD_FLAGS2 &= ~COSD_ICONS_WRITTEN;
}
if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) {
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
} else {
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
}
// motors are on, assume we were/are flying
COSD_FLAGS2 |= COSD_WASFLYING;
} else {
// stats
if ((COSD_FLAGS2 & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) {
uint8_t line = 3;
write_ascii_string_pgm(2, line, stats_item_pointers[0]); // max Altitude
write_ndigit_number_s(18, line, max_Altimeter / 30, 1000, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[1]); // max Speed
write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
write_char_xy(22, line, 203); // km/h
write_ascii_string_pgm(2, ++line, stats_item_pointers[2]); // max Distance
write_ndigit_number_u(19, line, max_Distance / 10, 100, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[3]); // min voltage
write_ndigit_number_u_10th(18, line, min_UBat, 100, 0);
write_char_xy(22, line, 0x9E); // small V
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_ascii_string_pgm(2, ++line, stats_item_pointers[7]); // ampere
write_ndigit_number_u_10th(18, line, max_ampere / 10, 100, 0);
write_char_xy(22, line, 0x9F); // small A
}
write_ascii_string_pgm(2, ++line, stats_item_pointers[4]); // max time
write_time(16, line, max_FlyingTime);
write_char_xy(22, line, 210); // fly clock
write_ascii_string_pgm(2, ++line, stats_item_pointers[5]); // longitude
write_gps_pos(15, line, naviData.CurrentPosition.Longitude);
write_ascii_string_pgm(2, ++line, stats_item_pointers[6]); // latitude
write_gps_pos(15, line, naviData.CurrentPosition.Latitude);
} else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
} else {
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
}
}
if (COSD_FLAGS & COSD_FLAG_BIGVARIO) {
draw_big_variometer(27, 8, naviData.Variometer);
}
 
// pre-bottom line
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
//write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0);
write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0);
write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 1000, 0);
}
// pre-bottom line
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
//write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0);
write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0);
write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 1000, 0);
}
 
// bottom line
draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage);
write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 100, 0);
if (naviData.UBat <= min_voltage && last_UBat > min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, BLINK);
} else if (naviData.UBat > min_voltage && last_UBat < min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, 0);
}
// bottom line
draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage);
write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 100, 0);
if (naviData.UBat <= min_voltage && last_UBat > min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, BLINK);
} else if (naviData.UBat > min_voltage && last_UBat < min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, 0);
}
 
write_time(8, bottom_line, uptime);
write_time(15, bottom_line, naviData.FlyingTime);
write_time(8, bottom_line, uptime);
write_time(15, bottom_line, naviData.FlyingTime);
 
write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 10, 0);
write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 10, 0);
 
if (naviData.NCFlags & NC_FLAG_MANUAL_CONTROL) {
write_char_xy(23, bottom_line, 0xB3); // rc transmitter
} else {
write_char_xy(23, bottom_line, 0); // clear
if (naviData.NCFlags & NC_FLAG_MANUAL_CONTROL) {
write_char_xy(23, bottom_line, 0xB3); // rc transmitter
} else {
write_char_xy(23, bottom_line, 0); // clear
}
 
if (naviData.NCFlags & NC_FLAG_CH) {
write_char_xy(27, bottom_line, 231); // gps ch
} else if (naviData.NCFlags & NC_FLAG_PH) {
write_char_xy(27, bottom_line, 230); // gps ph
} else { // (naviData.NCFlags & NC_FLAG_FREE)
write_char_xy(27, bottom_line, 201); // sat2 (free)
}
}
 
if (naviData.NCFlags & NC_FLAG_CH) {
write_char_xy(27, bottom_line, 231); // gps ch
} else if (naviData.NCFlags & NC_FLAG_PH) {
write_char_xy(27, bottom_line, 230); // gps ph
} else { // (naviData.NCFlags & NC_FLAG_FREE)
write_char_xy(27, bottom_line, 201); // sat2 (free)
//write_number_s(8, 5, RxDataLen);
//write_number_s(16, 5, setsReceived++);
 
// remember statistics (only when engines running)
if (naviData.MKFlags & FLAG_MOTOR_RUN) {
if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter;
if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed;
if (naviData.HomePositionDeviation.Distance > max_Distance) {
max_Distance = naviData.HomePositionDeviation.Distance;
}
if (naviData.UBat < min_UBat) min_UBat = naviData.UBat;
if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime;
if (ampere > max_ampere) max_ampere = ampere;
}
}
 
//write_number_s(8, 5, RxDataLen);
//write_number_s(16, 5, setsReceived++);
// remember last values
last_RC_Quality = naviData.RC_Quality;
last_UBat = naviData.UBat;
old_MKFlags = naviData.MKFlags;
seconds_since_last_data = 0;
 
// remember statistics (only when engines running)
if (naviData.MKFlags & FLAG_MOTOR_RUN) {
if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter;
if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed;
if (naviData.HomePositionDeviation.Distance > max_Distance) {
max_Distance = naviData.HomePositionDeviation.Distance;
}
if (naviData.UBat < min_UBat) min_UBat = naviData.UBat;
if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime;
if (ampere > max_ampere) max_ampere = ampere;
return 0;
}
 
// remember last values
last_RC_Quality = naviData.RC_Quality;
last_UBat = naviData.UBat;
old_MKFlags = naviData.MKFlags;
seconds_since_last_data = 0;
#endif
/C-OSD/trunk/osd_ncmode_default.h
0,0 → 1,21
/****************************************************************************
* Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje *
* admiralcascade@gmail.com *
* Project-URL: http://www.mylifesucks.de/oss/c-osd/ *
* *
* 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. *
* *
* 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. *
****************************************************************************/
 
int osd_ncmode_default(void);
/C-OSD/trunk/osd_ncmode_minimal.c
1,157 → 1,171
/****************************************************************************
* Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje *
* admiralcascade@gmail.com *
* Project-URL: http://www.mylifesucks.de/oss/c-osd/ *
* *
* 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. *
* *
* 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. *
****************************************************************************/
if (COSD_FLAGS & COSD_FLAG_HUD) {
// write icons at init or after menu/mode-switch
if (!(COSD_FLAGS2 & COSD_ICONS_WRITTEN)) {
write_char_xy(4, top_line, 0xCB); // km/h
write_char_xy(15, top_line, 0xCC); // small meters m height
write_char_xy(26, top_line, 0xCC); // small meters m height
write_char_xy(16, top_line, 0xB0); // left circle
write_char_xy(18, top_line, 0xB2); // right circle
write_char_xy(7, bottom_line, 0x9E); // small V
write_char_xy(17, bottom_line, 0xD2); // fly clock
write_char_xy(26, bottom_line, 0xC8); // sat1
write_char_xy(27, bottom_line, 0xC9); // sat2
COSD_FLAGS2 |= COSD_ICONS_WRITTEN;
}
/****************************************************************************
* Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje *
* admiralcascade@gmail.com *
* Project-URL: http://www.mylifesucks.de/oss/c-osd/ *
* *
* 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. *
* *
* 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 "main.h"
#include "max7456_software_spi.h"
#include "osd_helpers.h"
#include "osd_ncmode_default.h"
 
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
 
int osd_ncmode_minimal() {
if (COSD_FLAGS & COSD_FLAG_HUD) {
// write icons at init or after menu/mode-switch
if (!(COSD_FLAGS2 & COSD_ICONS_WRITTEN)) {
write_char_xy(4, top_line, 0xCB); // km/h
write_char_xy(15, top_line, 0xCC); // small meters m height
write_char_xy(26, top_line, 0xCC); // small meters m height
write_char_xy(16, top_line, 0xB0); // left circle
write_char_xy(18, top_line, 0xB2); // right circle
write_char_xy(7, bottom_line, 0x9E); // small V
write_char_xy(17, bottom_line, 0xD2); // fly clock
write_char_xy(26, bottom_line, 0xC8); // sat1
write_char_xy(27, bottom_line, 0xC9); // sat2
COSD_FLAGS2 |= COSD_ICONS_WRITTEN;
}
 
// first line
write_ndigit_number_u(1, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
// first line
write_ndigit_number_u(1, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
 
write_ndigit_number_u(12, top_line, naviData.HomePositionDeviation.Distance / 10, 100, 0);
write_ndigit_number_u(12, top_line, naviData.HomePositionDeviation.Distance / 10, 100, 0);
 
uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360;
write_char_xy(17, top_line, 0xa0 + heading_fine_conv(heading_home));
uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360;
write_char_xy(17, top_line, 0xa0 + heading_fine_conv(heading_home));
 
if (naviData.Altimeter > 300 || naviData.Altimeter < -300) {
// above 10m only write full meters
write_ndigit_number_s(22, top_line, naviData.Altimeter / 30, 1000, 0);
} else {
// up to 10m write meters.dm
write_ndigit_number_s_10th(22, top_line, naviData.Altimeter / 3, 100, 0);
}
if (naviData.Altimeter > 300 || naviData.Altimeter < -300) {
// above 10m only write full meters
write_ndigit_number_s(22, top_line, naviData.Altimeter / 30, 1000, 0);
} else {
// up to 10m write meters.dm
write_ndigit_number_s_10th(22, top_line, naviData.Altimeter / 3, 100, 0);
}
 
draw_variometer(27, top_line, naviData.Variometer);
draw_variometer(27, top_line, naviData.Variometer);
 
 
// center
if (naviData.MKFlags & FLAG_MOTOR_RUN) { // should be engines running
if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle
clear();
// update flags to paint display again if needed
COSD_FLAGS2 &= ~COSD_ICONS_WRITTEN;
}
if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) {
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
} else {
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
}
// motors are on, assume we were/are flying
COSD_FLAGS2 |= COSD_WASFLYING;
} else {
// stats
if ((COSD_FLAGS2 & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) {
uint8_t line = 3;
write_ascii_string_pgm(2, line, stats_item_pointers[0]); // max Altitude
write_ndigit_number_s(18, line, max_Altimeter / 30, 1000, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[1]); // max Speed
write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
write_char_xy(22, line, 203); // km/h
write_ascii_string_pgm(2, ++line, stats_item_pointers[2]); // max Distance
write_ndigit_number_u(19, line, max_Distance / 10, 100, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[3]); // min voltage
write_ndigit_number_u_10th(18, line, min_UBat, 100, 0);
write_char_xy(22, line, 0x9E); // small V
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_ascii_string_pgm(2, ++line, stats_item_pointers[7]); // ampere
write_ndigit_number_u_10th(18, line, max_ampere / 10, 100, 0);
write_char_xy(22, line, 0x9F); // small A
}
write_ascii_string_pgm(2, ++line, stats_item_pointers[4]); // max time
write_time(16, line, max_FlyingTime);
write_char_xy(22, line, 210); // fly clock
write_ascii_string_pgm(2, ++line, stats_item_pointers[5]); // longitude
write_gps_pos(15, line, naviData.CurrentPosition.Longitude);
write_ascii_string_pgm(2, ++line, stats_item_pointers[6]); // latitude
write_gps_pos(15, line, naviData.CurrentPosition.Latitude);
} else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
} else {
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
}
}
if (COSD_FLAGS & COSD_FLAG_BIGVARIO) {
draw_big_variometer(27, 8, naviData.Variometer);
}
// center
if (naviData.MKFlags & FLAG_MOTOR_RUN) { // should be engines running
if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle
clear();
// update flags to paint display again if needed
COSD_FLAGS2 &= ~COSD_ICONS_WRITTEN;
}
if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) {
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
} else {
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
}
// motors are on, assume we were/are flying
COSD_FLAGS2 |= COSD_WASFLYING;
} else {
// stats
if ((COSD_FLAGS2 & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) {
uint8_t line = 3;
write_ascii_string_pgm(2, line, stats_item_pointers[0]); // max Altitude
write_ndigit_number_s(18, line, max_Altimeter / 30, 1000, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[1]); // max Speed
write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 100, 0);
write_char_xy(22, line, 203); // km/h
write_ascii_string_pgm(2, ++line, stats_item_pointers[2]); // max Distance
write_ndigit_number_u(19, line, max_Distance / 10, 100, 0);
write_char_xy(22, line, 204); // small meters m
write_ascii_string_pgm(2, ++line, stats_item_pointers[3]); // min voltage
write_ndigit_number_u_10th(18, line, min_UBat, 100, 0);
write_char_xy(22, line, 0x9E); // small V
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
write_ascii_string_pgm(2, ++line, stats_item_pointers[7]); // ampere
write_ndigit_number_u_10th(18, line, max_ampere / 10, 100, 0);
write_char_xy(22, line, 0x9F); // small A
}
write_ascii_string_pgm(2, ++line, stats_item_pointers[4]); // max time
write_time(16, line, max_FlyingTime);
write_char_xy(22, line, 210); // fly clock
write_ascii_string_pgm(2, ++line, stats_item_pointers[5]); // longitude
write_gps_pos(15, line, naviData.CurrentPosition.Longitude);
write_ascii_string_pgm(2, ++line, stats_item_pointers[6]); // latitude
write_gps_pos(15, line, naviData.CurrentPosition.Latitude);
} else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll);
} else {
draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll);
}
}
}
if (COSD_FLAGS & COSD_FLAG_BIGVARIO) {
draw_big_variometer(27, 8, naviData.Variometer);
}
 
// pre-bottom line
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
//write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0);
write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0);
write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 1000, 0);
}
// pre-bottom line
if (COSD_FLAGS2 & COSD_FLAG_STROMREC) {
//write_ndigit_number_s(3, bottom_line - 1, ampere, 1000, 0);
write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 100, 0);
write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 1000, 0);
}
 
// bottom line
draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage);
write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 100, 0);
if (naviData.UBat <= min_voltage && last_UBat > min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, BLINK);
} else if (naviData.UBat > min_voltage && last_UBat < min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, 0);
}
// bottom line
draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage);
write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 100, 0);
if (naviData.UBat <= min_voltage && last_UBat > min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, BLINK);
} else if (naviData.UBat > min_voltage && last_UBat < min_voltage) {
for (uint8_t x = 2; x < 8; x++)
write_char_att_xy(x, bottom_line, 0);
}
 
write_time(11, bottom_line, naviData.FlyingTime);
write_time(11, bottom_line, naviData.FlyingTime);
 
write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 10, 0);
write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 10, 0);
 
if (naviData.NCFlags & NC_FLAG_CH) {
write_char_xy(27, bottom_line, 231); // gps ch
} else if (naviData.NCFlags & NC_FLAG_PH) {
write_char_xy(27, bottom_line, 230); // gps ph
} else { // (naviData.NCFlags & NC_FLAG_FREE)
write_char_xy(27, bottom_line, 201); // sat2 (free)
if (naviData.NCFlags & NC_FLAG_CH) {
write_char_xy(27, bottom_line, 231); // gps ch
} else if (naviData.NCFlags & NC_FLAG_PH) {
write_char_xy(27, bottom_line, 230); // gps ph
} else { // (naviData.NCFlags & NC_FLAG_FREE)
write_char_xy(27, bottom_line, 201); // sat2 (free)
}
}
}
 
// remember statistics (only when engines running)
if (naviData.MKFlags & FLAG_MOTOR_RUN) {
if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter;
if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed;
if (naviData.HomePositionDeviation.Distance > max_Distance) {
max_Distance = naviData.HomePositionDeviation.Distance;
}
if (naviData.UBat < min_UBat) min_UBat = naviData.UBat;
if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime;
if (ampere > max_ampere) max_ampere = ampere;
}
// remember statistics (only when engines running)
if (naviData.MKFlags & FLAG_MOTOR_RUN) {
if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter;
if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed;
if (naviData.HomePositionDeviation.Distance > max_Distance) {
max_Distance = naviData.HomePositionDeviation.Distance;
}
if (naviData.UBat < min_UBat) min_UBat = naviData.UBat;
if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime;
if (ampere > max_ampere) max_ampere = ampere;
}
 
// remember last values
last_RC_Quality = naviData.RC_Quality;
last_UBat = naviData.UBat;
old_MKFlags = naviData.MKFlags;
seconds_since_last_data = 0;
// remember last values
last_RC_Quality = naviData.RC_Quality;
last_UBat = naviData.UBat;
old_MKFlags = naviData.MKFlags;
seconds_since_last_data = 0;
 
return 0;
}
 
#endif
/C-OSD/trunk/osd_ncmode_minimal.h
0,0 → 1,21
/****************************************************************************
* Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje *
* admiralcascade@gmail.com *
* Project-URL: http://www.mylifesucks.de/oss/c-osd/ *
* *
* 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. *
* *
* 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. *
****************************************************************************/
 
int osd_ncmode_minimal(void);