mirror of
https://github.com/thelsing/knx.git
synced 2025-01-16 00:08:16 +01:00
fix dpt9 for small values
This commit is contained in:
parent
b3f6a0e3fa
commit
13b1cff315
@ -7,9 +7,9 @@
|
|||||||
<PathStyle>RemoteUnix</PathStyle>
|
<PathStyle>RemoteUnix</PathStyle>
|
||||||
</CustomSourceDirectories>
|
</CustomSourceDirectories>
|
||||||
<BuildHost>
|
<BuildHost>
|
||||||
<HostName>localhost</HostName>
|
<HostName>Suzail</HostName>
|
||||||
<Transport>LinuxSubsystem</Transport>
|
<Transport>SSH</Transport>
|
||||||
<UserName>Linux</UserName>
|
<UserName>tkunze</UserName>
|
||||||
</BuildHost>
|
</BuildHost>
|
||||||
<MainSourceTransferCommand>
|
<MainSourceTransferCommand>
|
||||||
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
|
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
|
||||||
@ -34,15 +34,14 @@
|
|||||||
<string>CMakeLists.txt</string>
|
<string>CMakeLists.txt</string>
|
||||||
<string>*.cmake</string>
|
<string>*.cmake</string>
|
||||||
</FileMasks>
|
</FileMasks>
|
||||||
<TransferNewFilesOnly>true</TransferNewFilesOnly>
|
<TransferNewFilesOnly>false</TransferNewFilesOnly>
|
||||||
<IncludeSubdirectories>true</IncludeSubdirectories>
|
<IncludeSubdirectories>true</IncludeSubdirectories>
|
||||||
<SelectedDirectories />
|
|
||||||
<DeleteDisappearedFiles>true</DeleteDisappearedFiles>
|
<DeleteDisappearedFiles>true</DeleteDisappearedFiles>
|
||||||
<ApplyGlobalExclusionList>true</ApplyGlobalExclusionList>
|
<ApplyGlobalExclusionList>true</ApplyGlobalExclusionList>
|
||||||
<Extension>
|
<Extension>
|
||||||
<Direction>Outgoing</Direction>
|
<Direction>Outgoing</Direction>
|
||||||
<SkipMountPoints>false</SkipMountPoints>
|
<SkipMountPoints>false</SkipMountPoints>
|
||||||
<OverwriteTrigger>LocalCache</OverwriteTrigger>
|
<OverwriteTrigger>Always</OverwriteTrigger>
|
||||||
</Extension>
|
</Extension>
|
||||||
</MainSourceTransferCommand>
|
</MainSourceTransferCommand>
|
||||||
<AllowChangingHostForMainCommands>false</AllowChangingHostForMainCommands>
|
<AllowChangingHostForMainCommands>false</AllowChangingHostForMainCommands>
|
||||||
|
@ -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>
|
|
@ -112,7 +112,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="CMakeLists.txt" />
|
<None Include="CMakeLists.txt" />
|
||||||
<None Include="knx-linux-Debug.vgdbsettings" />
|
<None Include="knx-linux-Debug.vgdbsettings" />
|
||||||
<None Include="knx-linux-Release.vgdbsettings" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\src\knx\address_table_object.cpp" />
|
<ClCompile Include="..\src\knx\address_table_object.cpp" />
|
||||||
|
@ -30,9 +30,6 @@
|
|||||||
<None Include="knx-linux-Debug.vgdbsettings">
|
<None Include="knx-linux-Debug.vgdbsettings">
|
||||||
<Filter>VisualGDB settings</Filter>
|
<Filter>VisualGDB settings</Filter>
|
||||||
</None>
|
</None>
|
||||||
<None Include="knx-linux-Release.vgdbsettings">
|
|
||||||
<Filter>VisualGDB settings</Filter>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\src\linux_platform.h">
|
<ClInclude Include="..\src\linux_platform.h">
|
||||||
|
@ -1794,7 +1794,11 @@ void float16ToPayload(uint8_t* payload, int payload_length, int index, double va
|
|||||||
}
|
}
|
||||||
|
|
||||||
value *= 100.0;
|
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));
|
short mantissa = roundf(value / (1 << exponent));
|
||||||
|
|
||||||
if (wasNegative)
|
if (wasNegative)
|
||||||
|
Loading…
Reference in New Issue
Block a user