Skip to content

Commit

Permalink
Merge pull request #3 from OSVR/hdk2-video-fixes
Browse files Browse the repository at this point in the history
Hdk2 video fixes, plus contents of #2
  • Loading branch information
rpavlik authored Aug 20, 2016
2 parents 39bcc90 + e48f5d5 commit 44be1f4
Show file tree
Hide file tree
Showing 16 changed files with 359 additions and 92 deletions.
151 changes: 147 additions & 4 deletions Source code/Embedded/HMD-MCU.cproj
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,142 @@
<OutputFileExtension>.elf</OutputFileExtension>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'HDK_20' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atxmega256a3bu -B "%24(PackRepoDir)\atmel\XMEGAA_DFP\1.0.39\gcc\dev\atxmega256a3bu"</avrgcc.common.Device>
<avrgcc.common.optimization.RelaxBranches>True</avrgcc.common.optimization.RelaxBranches>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>False</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>True</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>CONFIG_NVM_IGNORE_XMEGA_A3_D3_REVB_ERRATA</Value>
<Value>IOPORT_XMEGA_COMPAT</Value>
<Value>DEBUG</Value>
<Value>BOARD=USER_BOARD</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>../src/Variants/HDK_20</Value>
<Value>../src/ASF/xmega/boards/xmega_a3bu_xplained</Value>
<Value>../src</Value>
<Value>../src/config</Value>
<Value>../src/ASF/xmega/boards</Value>
<Value>../src/ASF/common/boards</Value>
<Value>../src/ASF/xmega/drivers/cpu</Value>
<Value>../src/ASF/xmega/drivers/nvm</Value>
<Value>../src/ASF/xmega/drivers/pmic</Value>
<Value>../src/ASF/xmega/drivers/sleep</Value>
<Value>../src/ASF/xmega/drivers/spi</Value>
<Value>../src/ASF/common/services/clock</Value>
<Value>../src/ASF/common/services/delay</Value>
<Value>../src/ASF/common/services/gpio</Value>
<Value>../src/ASF/common/services/ioport</Value>
<Value>../src/ASF/common/services/sleepmgr</Value>
<Value>../src/ASF/common/services/spi/xmega_spi</Value>
<Value>../src/ASF/common/services/spi</Value>
<Value>../src/ASF/common/services/twi</Value>
<Value>../src/ASF/common/services/usb</Value>
<Value>../src/ASF/common/services/usb/class/cdc</Value>
<Value>../src/ASF/common/services/usb/class/cdc/device</Value>
<Value>../src/ASF/common/services/usb/udc</Value>
<Value>../src/ASF/common/utils</Value>
<Value>../src/ASF/xmega/drivers/twi</Value>
<Value>../src/ASF/xmega/drivers/usart</Value>
<Value>../src/ASF/xmega/drivers/usb</Value>
<Value>../src/ASF/xmega/utils/preprocessor</Value>
<Value>../src/ASF/xmega/utils</Value>
<Value>../src/ASF/common/services/serial/xmega_usart</Value>
<Value>../src/ASF/common/services/serial</Value>
<Value>../src/ASF/xmega/drivers/rtc</Value>
<Value>../src/ASF/xmega/drivers/tc</Value>
<Value>../src/ASF/xmega/services/pwm</Value>
<Value>../src/ASF/xmega/drivers/rtc32</Value>
<Value>../src/ASF/xmega/services/timeout</Value>
<Value>../src/ASF/common/services/usb/class/composite/device</Value>
<Value>../src/ASF/common/services/usb/class/hid</Value>
<Value>../src/ASF/common/services/usb/class/hid/device</Value>
<Value>../src/ASF/common/services/usb/class/hid/device/generic</Value>
<Value>../src/DeviceDrivers/bno-hostif/src</Value>
<Value>../vendor/libhdk20</Value>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.0.39\include</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize most (-O3)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.optimization.DebugLevel>Maximum (-g3)</avrgcc.compiler.optimization.DebugLevel>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -fno-strict-aliasing -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -mrelax</avrgcc.compiler.miscellaneous.OtherFlags>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
<Value>libhdk20.1.01</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.linker.libraries.LibrarySearchPaths>
<ListValues>
<Value>../vendor/libhdk20</Value>
</ListValues>
</avrgcc.linker.libraries.LibrarySearchPaths>
<avrgcc.linker.miscellaneous.LinkerFlags>-Wl,--relax -Wl,--section-start=.BOOT=0x40000</avrgcc.linker.miscellaneous.LinkerFlags>
<avrgcc.assembler.general.AssemblerFlags>-mrelax -DBOARD=USER_BOARD -DCONFIG_NVM_IGNORE_XMEGA_A3_D3_REVB_ERRATA -DIOPORT_XMEGA_COMPAT</avrgcc.assembler.general.AssemblerFlags>
<avrgcc.assembler.general.IncludePaths>
<ListValues>
<Value>../src/Variants/HDK_OLED</Value>
<Value>../src/ASF/xmega/boards/xmega_a3bu_xplained</Value>
<Value>../src</Value>
<Value>../src/config</Value>
<Value>../src/ASF/xmega/boards</Value>
<Value>../src/ASF/common/boards</Value>
<Value>../src/ASF/xmega/drivers/cpu</Value>
<Value>../src/ASF/xmega/drivers/nvm</Value>
<Value>../src/ASF/xmega/drivers/pmic</Value>
<Value>../src/ASF/xmega/drivers/sleep</Value>
<Value>../src/ASF/xmega/drivers/spi</Value>
<Value>../src/ASF/common/services/clock</Value>
<Value>../src/ASF/common/services/delay</Value>
<Value>../src/ASF/common/services/gpio</Value>
<Value>../src/ASF/common/services/ioport</Value>
<Value>../src/ASF/common/services/sleepmgr</Value>
<Value>../src/ASF/common/services/spi/xmega_spi</Value>
<Value>../src/ASF/common/services/spi</Value>
<Value>../src/ASF/common/services/twi</Value>
<Value>../src/ASF/common/services/usb</Value>
<Value>../src/ASF/common/services/usb/class/cdc</Value>
<Value>../src/ASF/common/services/usb/class/cdc/device</Value>
<Value>../src/ASF/common/services/usb/udc</Value>
<Value>../src/ASF/common/utils</Value>
<Value>../src/ASF/xmega/drivers/twi</Value>
<Value>../src/ASF/xmega/drivers/usart</Value>
<Value>../src/ASF/xmega/drivers/usb</Value>
<Value>../src/ASF/xmega/utils/preprocessor</Value>
<Value>../src/ASF/xmega/utils</Value>
<Value>../src/ASF/common/services/serial/xmega_usart</Value>
<Value>../src/ASF/common/services/serial</Value>
<Value>../src/ASF/xmega/drivers/rtc</Value>
<Value>../src/ASF/xmega/drivers/tc</Value>
<Value>../src/ASF/xmega/services/pwm</Value>
<Value>../src/ASF/xmega/drivers/rtc32</Value>
<Value>../src/ASF/xmega/services/timeout</Value>
<Value>../src/ASF/common/services/usb/class/composite/device</Value>
<Value>../src/ASF/common/services/usb/class/hid</Value>
<Value>../src/ASF/common/services/usb/class/hid/device</Value>
<Value>../src/ASF/common/services/usb/class/hid/device/generic</Value>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.0.39\include</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
<OutputFileName>HDK-20-HMD-MCU</OutputFileName>
<OutputFileExtension>.elf</OutputFileExtension>
<OutputPath>bin\HDK_20\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'HDK_20_SVR' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atxmega256a3bu -B "%24(PackRepoDir)\atmel\XMEGAA_DFP\1.0.39\gcc\dev\atxmega256a3bu"</avrgcc.common.Device>
Expand All @@ -727,7 +863,7 @@
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>../src/Variants/HDK_20</Value>
<Value>../src/Variants/HDK_20_SVR</Value>
<Value>../src/ASF/xmega/boards/xmega_a3bu_xplained</Value>
<Value>../src</Value>
<Value>../src/config</Value>
Expand Down Expand Up @@ -781,7 +917,7 @@
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
<Value>libhdk20.1.01</Value>
<Value>libhdk20.1.01.svr1020</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.linker.libraries.LibrarySearchPaths>
Expand Down Expand Up @@ -839,9 +975,9 @@
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
<OutputFileName>HDK-20-HMD-MCU</OutputFileName>
<OutputFileName>HDK-20-SVR-HMD-MCU</OutputFileName>
<OutputFileExtension>.elf</OutputFileExtension>
<OutputPath>bin\HDK_20\</OutputPath>
<OutputPath>bin\HDK_20_SVR\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Folder Include="src\" />
Expand Down Expand Up @@ -912,6 +1048,7 @@
<Folder Include="src\Variants\HDK_Sharp_LCD" />
<Folder Include="src\Variants\dSight_Sharp_LCD" />
<Folder Include="src\Variants\HDK_20" />
<Folder Include="src\Variants\HDK_20_SVR" />
</ItemGroup>
<ItemGroup>
<None Include="src\ASF\common\services\usb\class\composite\device\udi_composite_conf.h">
Expand Down Expand Up @@ -1084,6 +1221,12 @@
<Compile Include="src\Variants\HDK_20\VariantOptions.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="src\Variants\HDK_20_SVR\svr1020.edid_info.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="src\Variants\HDK_20_SVR\VariantOptions.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="_StackInstrument.c">
<SubType>compile</SubType>
</Compile>
Expand Down
6 changes: 6 additions & 0 deletions Source code/Embedded/src/Console.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include "Console.h"
#include "USB.h"

// asf headers
#include <udi_cdc.h>
Expand All @@ -21,6 +22,11 @@ uint8_t DebugLevel = 0xff; // start by opening all debug messages
int MaxTimerCounter = 0;
void Write(const char *const Data)
{
if (!usb_cdc_is_active())
{
// Early out if no USB CDC.
return;
}
if (!Data)
{
// Given a null pointer - that's not very polite.
Expand Down
Loading

0 comments on commit 44be1f4

Please sign in to comment.