fix dpt9 for small values

This commit is contained in:
Thomas Kunze 2019-07-15 22:53:21 +02:00
parent b3f6a0e3fa
commit 13b1cff315
5 changed files with 10 additions and 171 deletions

View File

@ -7,9 +7,9 @@
<PathStyle>RemoteUnix</PathStyle>
</CustomSourceDirectories>
<BuildHost>
<HostName>localhost</HostName>
<Transport>LinuxSubsystem</Transport>
<UserName>Linux</UserName>
<HostName>Suzail</HostName>
<Transport>SSH</Transport>
<UserName>tkunze</UserName>
</BuildHost>
<MainSourceTransferCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
@ -34,15 +34,14 @@
<string>CMakeLists.txt</string>
<string>*.cmake</string>
</FileMasks>
<TransferNewFilesOnly>true</TransferNewFilesOnly>
<TransferNewFilesOnly>false</TransferNewFilesOnly>
<IncludeSubdirectories>true</IncludeSubdirectories>
<SelectedDirectories />
<DeleteDisappearedFiles>true</DeleteDisappearedFiles>
<ApplyGlobalExclusionList>true</ApplyGlobalExclusionList>
<Extension>
<Direction>Outgoing</Direction>
<SkipMountPoints>false</SkipMountPoints>
<OverwriteTrigger>LocalCache</OverwriteTrigger>
<OverwriteTrigger>Always</OverwriteTrigger>
</Extension>
</MainSourceTransferCommand>
<AllowChangingHostForMainCommands>false</AllowChangingHostForMainCommands>

View File

@ -1,160 +0,0 @@
<?xml version="1.0"?>
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConfigurationName>Release</ConfigurationName>
<Project xsi:type="com.visualgdb.project.linux">
<CustomSourceDirectories>
<Directories />
<PathStyle>RemoteUnix</PathStyle>
</CustomSourceDirectories>
<BuildHost>
<HostName>Suzail</HostName>
<Transport>SSH</Transport>
<UserName>tkunze</UserName>
</BuildHost>
<MainSourceTransferCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<RemoteHost>
<HostName>Suzail</HostName>
<Transport>SSH</Transport>
<UserName>tkunze</UserName>
</RemoteHost>
<LocalDirectory>$(ProjectDir)</LocalDirectory>
<RemoteDirectory>/home/tkunze/vgdb</RemoteDirectory>
<FileMasks>
<string>*.cpp</string>
<string>*.h</string>
<string>*.hpp</string>
<string>*.c</string>
<string>*.cc</string>
<string>*.cxx</string>
<string>*.mak</string>
<string>Makefile</string>
<string>*.txt</string>
<string>*.cmake</string>
<string>CMakeLists.txt</string>
<string>*.cmake</string>
</FileMasks>
<TransferNewFilesOnly>true</TransferNewFilesOnly>
<IncludeSubdirectories>true</IncludeSubdirectories>
<DeleteDisappearedFiles>true</DeleteDisappearedFiles>
<ApplyGlobalExclusionList>true</ApplyGlobalExclusionList>
</MainSourceTransferCommand>
<AllowChangingHostForMainCommands>false</AllowChangingHostForMainCommands>
<SkipBuildIfNoSourceFilesChanged>false</SkipBuildIfNoSourceFilesChanged>
<IgnoreFileTransferErrors>false</IgnoreFileTransferErrors>
<RemoveRemoteDirectoryOnClean>false</RemoveRemoteDirectoryOnClean>
<SkipDeploymentTests>false</SkipDeploymentTests>
<MainSourceDirectoryForLocalBuilds>$(ProjectDir)</MainSourceDirectoryForLocalBuilds>
</Project>
<Build xsi:type="com.visualgdb.build.cmake">
<ToolchainID>
<ID>com.sysprogs.toolchain.default-gcc</ID>
<Version>
<Revision>0</Revision>
</Version>
</ToolchainID>
<RelativeSourceDirectory />
<ConfigurationType>RELWITHDEBINFO</ConfigurationType>
<BinaryDirectory>Release</BinaryDirectory>
<MakeCommandTemplate>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<RemoteHost>
<HostName>BuildMachine</HostName>
<Transport>BuiltinShortcut</Transport>
</RemoteHost>
<Command>$(ToolchainMake)</Command>
<Arguments>$(ToolchainMakeArgs)</Arguments>
<WorkingDirectory>$(BuildDir)</WorkingDirectory>
<BackgroundMode xsi:nil="true" />
</MakeCommandTemplate>
<CMakeCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<RemoteHost>
<HostName>BuildMachine</HostName>
<Transport>BuiltinShortcut</Transport>
</RemoteHost>
<Command>$(ToolchainCMake)</Command>
<BackgroundMode xsi:nil="true" />
</CMakeCommand>
<UpdateSourcesInCMakeFile>true</UpdateSourcesInCMakeFile>
<ExportCompileCommands>false</ExportCompileCommands>
<DisableToolchainFile>false</DisableToolchainFile>
<DeployAsRoot>false</DeployAsRoot>
<CleanMode>b</CleanMode>
</Build>
<CustomBuild>
<PreSyncActions />
<PreBuildActions />
<PostBuildActions />
<PreCleanActions />
<PostCleanActions />
</CustomBuild>
<CustomDebug>
<PreDebugActions />
<PostDebugActions />
<DebugStopActions />
<BreakMode>Default</BreakMode>
</CustomDebug>
<CustomShortcuts>
<Shortcuts />
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
</CustomShortcuts>
<UserDefinedVariables />
<CodeSense>
<Enabled>Unknown</Enabled>
<ExtraSettings>
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
<FormattingEngine xsi:nil="true" />
</ExtraSettings>
<CodeAnalyzerSettings>
<Enabled>false</Enabled>
</CodeAnalyzerSettings>
</CodeSense>
<Debug xsi:type="com.visualgdb.debug.remote">
<AdditionalStartupCommands />
<AdditionalGDBSettings>
<Features>
<DisableAutoDetection>false</DisableAutoDetection>
<UseFrameParameter>false</UseFrameParameter>
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
<ListLocalsSupported>false</ListLocalsSupported>
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
<ThreadInfoSupported>false</ThreadInfoSupported>
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
<SupportTargetCommand>false</SupportTargetCommand>
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
</Features>
<EnableSmartStepping>false</EnableSmartStepping>
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
<UseAppleExtensions>false</UseAppleExtensions>
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
<MakeLogFile>false</MakeLogFile>
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
<UseRelativePathsOnly>false</UseRelativePathsOnly>
<ExitAction>None</ExitAction>
<DisableDisassembly>false</DisableDisassembly>
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry>
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
<DisableSignals>false</DisableSignals>
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
<EnableNonStopMode>false</EnableNonStopMode>
<MaxBreakpointLimit>0</MaxBreakpointLimit>
</AdditionalGDBSettings>
<LaunchGDBSettings xsi:type="GDBLaunchParametersNewInstance">
<DebuggedProgram>$(TargetPath)</DebuggedProgram>
<GDBServerPort>2000</GDBServerPort>
<ProgramArguments />
</LaunchGDBSettings>
<GenerateCtrlBreakInsteadOfCtrlC>false</GenerateCtrlBreakInsteadOfCtrlC>
<X11WindowMode>Local</X11WindowMode>
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
<RunGDBUnderSudo>false</RunGDBUnderSudo>
<DeploymentMode>Auto</DeploymentMode>
<DeployWhenLaunchedWithoutDebugging>true</DeployWhenLaunchedWithoutDebugging>
<SuppressTTYCreation>false</SuppressTTYCreation>
</Debug>
</VisualGDBProjectSettings2>

View File

@ -112,7 +112,6 @@
<ItemGroup>
<None Include="CMakeLists.txt" />
<None Include="knx-linux-Debug.vgdbsettings" />
<None Include="knx-linux-Release.vgdbsettings" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\knx\address_table_object.cpp" />

View File

@ -30,9 +30,6 @@
<None Include="knx-linux-Debug.vgdbsettings">
<Filter>VisualGDB settings</Filter>
</None>
<None Include="knx-linux-Release.vgdbsettings">
<Filter>VisualGDB settings</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\linux_platform.h">

View File

@ -1794,7 +1794,11 @@ void float16ToPayload(uint8_t* payload, int payload_length, int index, double va
}
value *= 100.0;
unsigned short exponent = ceil(log2(value) - 11.0);
unsigned short exponent = 0;
if(value > 2048)
exponent = ceil(log2(value) - 11.0);
short mantissa = roundf(value / (1 << exponent));
if (wasNegative)