10 changed files with 304 additions and 19 deletions
-
6.cproject
-
3.settings/com.st.stm32cube.ide.mcu.sfr.prefs
-
4.settings/language.settings.xml
-
76.settings/org.eclipse.cdt.codan.core.prefs
-
2Core/Src/usart.c
-
3high_power_ctrl_prj.ioc
-
12high_power_ctrl_prj.launch
-
154usrc/h2o2_sensor.cpp
-
45usrc/h2o2_sensor.hpp
-
18usrc/main.cpp
@ -0,0 +1,3 @@ |
|||
eclipse.preferences.version=1 |
|||
svd_custom_file_path= |
|||
svd_file_path=platform\:/plugin/com.st.stm32cube.ide.mcu.productdb.debug/resources/cmsis/STMicroelectronics_CMSIS_SVD/STM32F407.svd |
@ -0,0 +1,76 @@ |
|||
com.st.stm32cube.ide.mcu.ide.oss.source.checker.libnano.problem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Float formatting support\\")"} |
|||
eclipse.preferences.version=1 |
|||
org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false} |
|||
org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"} |
|||
org.eclipse.cdt.codan.checkers.localvarreturn=-Warning |
|||
org.eclipse.cdt.codan.checkers.localvarreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Returning the address of a local variable\\")"} |
|||
org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"} |
|||
org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"} |
|||
org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false} |
|||
org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.BlacklistProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.BlacklistProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function or method is blacklisted\\")",blacklist\=>()} |
|||
org.eclipse.cdt.codan.internal.checkers.CStyleCastProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.CStyleCastProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"C-Style cast instead of C++ cast\\")",checkMacro\=>true} |
|||
org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false} |
|||
org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()} |
|||
org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true} |
|||
org.eclipse.cdt.codan.internal.checkers.CopyrightProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.CopyrightProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Lack of copyright information\\")",regex\=>".*Copyright.*"} |
|||
org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid 'decltype(auto)' specifier\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.FloatCompareProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.FloatCompareProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Direct float comparison\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.GotoStatementProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.GotoStatementProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Goto statement used\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.MagicNumberProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.MagicNumberProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Avoid magic numbers\\")",checkArray\=>true,checkOperatorParen\=>true,exceptions\=>(1,0,-1,2,1.0,0.0,-1.0)} |
|||
org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.MissCaseProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.MissCaseProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing cases in switch\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.MissDefaultProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.MissDefaultProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing default in switch\\")",defaultWithAllEnums\=>false} |
|||
org.eclipse.cdt.codan.internal.checkers.MissReferenceProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.MissReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing reference return value in assignment operator\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.MissSelfCheckProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.MissSelfCheckProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Missing self check in assignment operator\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.MultipleDeclarationsProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.MultipleDeclarationsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Multiple variable declaration\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} |
|||
org.eclipse.cdt.codan.internal.checkers.NoDiscardProblem=Warning |
|||
org.eclipse.cdt.codan.internal.checkers.NoDiscardProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return value not evaluated\\")",macro\=>true} |
|||
org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.ShallowCopyProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.ShallowCopyProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Miss copy constructor or assignment operator\\")",onlynew\=>false} |
|||
org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()} |
|||
org.eclipse.cdt.codan.internal.checkers.StaticVariableInHeaderProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.StaticVariableInHeaderProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Static variable in header file\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.StructuredBindingDeclarationProblem=Error |
|||
org.eclipse.cdt.codan.internal.checkers.StructuredBindingDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid structured binding declaration\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false} |
|||
org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false} |
|||
org.eclipse.cdt.codan.internal.checkers.SymbolShadowingProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.SymbolShadowingProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol shadowing\\")",paramFuncParameters\=>true} |
|||
org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true} |
|||
org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true} |
|||
org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")} |
|||
org.eclipse.cdt.codan.internal.checkers.UsingInHeaderProblem=-Warning |
|||
org.eclipse.cdt.codan.internal.checkers.UsingInHeaderProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Using directive in header\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"} |
|||
org.eclipse.cdt.codan.internal.checkers.VirtualMethodCallProblem=-Error |
|||
org.eclipse.cdt.codan.internal.checkers.VirtualMethodCallProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Virtual method call in constructor/destructor\\")"} |
@ -0,0 +1,154 @@ |
|||
#include "h2o2_sensor.hpp"
|
|||
|
|||
#include <stdio.h>
|
|||
#include <string.h>
|
|||
|
|||
#include "adc.h"
|
|||
|
|||
#ifdef HAL_CAN_MODULE_ENABLED
|
|||
|
|||
using namespace iflytop; |
|||
using namespace zcr; |
|||
#define TAG "H2O2Sensor"
|
|||
|
|||
void H2O2Sensor::initialize(ZCanReceiver* zcanReceiver) { |
|||
zcanReceiver->registerListener(this); |
|||
m_zcanReceiver = zcanReceiver; |
|||
} |
|||
|
|||
void H2O2Sensor::regSubmodule(int id, UART_HandleTypeDef* huart, uint8_t modbusid) { |
|||
ZASSERT(huart != NULL); |
|||
m_sensorId = id; |
|||
m_modbusid = modbusid; |
|||
modbusBlockHost.initialize(huart); |
|||
|
|||
readSensorData(); |
|||
} |
|||
|
|||
uint32_t H2O2Sensor::readAvgAdcVal() { |
|||
// 读取15次,取中间十个数取平均值
|
|||
|
|||
uint32_t adcv[15] = {0}; // 15次采样
|
|||
for (int i = 0; i < 15; i++) { |
|||
adcv[i] = readAdcVal(); |
|||
} |
|||
|
|||
// 冒泡排序
|
|||
for (int i = 0; i < 15; i++) { |
|||
for (int j = 0; j < 15 - i - 1; j++) { |
|||
if (adcv[j] > adcv[j + 1]) { |
|||
uint32_t temp = adcv[j]; |
|||
adcv[j] = adcv[j + 1]; |
|||
adcv[j + 1] = temp; |
|||
} |
|||
} |
|||
} |
|||
|
|||
uint32_t sum = 0; |
|||
for (int i = 2; i < 12; i++) { |
|||
sum += adcv[i]; |
|||
} |
|||
return sum / 10; |
|||
} |
|||
|
|||
uint32_t H2O2Sensor::readAdcVal() { |
|||
ADC_ChannelConfTypeDef sConfig; // 通道初始化
|
|||
|
|||
uint8_t id; |
|||
|
|||
sConfig.Channel = ADC_CHANNEL_9; |
|||
sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES; // 采用周期239.5周期
|
|||
sConfig.Rank = 1; |
|||
HAL_ADC_ConfigChannel(&hadc1, &sConfig); |
|||
|
|||
uint32_t adcv = 0; //
|
|||
HAL_ADC_Start(&hadc1); // 启动转换
|
|||
HAL_ADC_PollForConversion(&hadc1, 30); // 等待转化结束
|
|||
adcv = HAL_ADC_GetValue(&hadc1); // 求和
|
|||
HAL_ADC_Stop(&hadc1); // 停止转换
|
|||
return adcv; // 返回平均值
|
|||
} |
|||
|
|||
typedef struct { |
|||
int16_t rh; // Relative humidity %RH * 10
|
|||
int16_t temp; // Temperature °C * 10
|
|||
int16_t df_ptemp; // Dew/frost point temperature °C * 10
|
|||
int16_t ah; // Absolute humidity g/m3 * 10
|
|||
int16_t mr; // Mixing ratio g/kg * 10
|
|||
int16_t wet_bulb_temp; // Wet-bulb temperature °C * 10
|
|||
int16_t enthalpy; // Enthalpy kJ/kg * 10
|
|||
} hmp110_sensordata_t; |
|||
|
|||
hpp272_data_t* H2O2Sensor::readSensorData() { |
|||
sensordatacache.hydrogen_peroxide_volume = 0; |
|||
sensordatacache.h2o_h2o2_rs = 1 * 100; |
|||
sensordatacache.temperature1 = 20 * 100; |
|||
sensordatacache.relative_humidity = 31 * 100; |
|||
|
|||
static uint16_t rxbuf[128]; |
|||
static hmp110_sensordata_t sensordata; |
|||
|
|||
memset(rxbuf, 0, sizeof(rxbuf)); |
|||
bool suc = modbusBlockHost.readReg03Muti(1, 0x0100, rxbuf, 7, 300); |
|||
if (suc) { |
|||
sensordata.rh = rxbuf[0]; |
|||
sensordata.temp = rxbuf[1]; |
|||
sensordata.df_ptemp = rxbuf[2]; |
|||
sensordata.ah = rxbuf[3]; |
|||
sensordata.mr = rxbuf[4]; |
|||
sensordata.wet_bulb_temp = rxbuf[5]; |
|||
sensordata.enthalpy = rxbuf[6]; |
|||
|
|||
sensordatacache.temperature1 = sensordata.temp * 10; |
|||
sensordatacache.relative_humidity = sensordata.rh * 10; |
|||
} else { |
|||
ZLOGI(TAG, "readSensorData fail"); |
|||
sensordatacache.temperature1 = 0; |
|||
sensordatacache.relative_humidity = 0; |
|||
} |
|||
|
|||
uint32_t adcv = readAvgAdcVal(); |
|||
float mv = adcv / 4095.0 * 3.3 * 1000; |
|||
float ma = mv / 150.0; |
|||
float ppm = (ma - 4) / (20 - 4) * 2000; |
|||
if (ppm < 0) ppm = 0; |
|||
|
|||
ZLOGI(TAG, " i:%f ppm:%f temp:%d rh:%d", ma, ppm, sensordatacache.temperature1, sensordatacache.relative_humidity); |
|||
|
|||
sensordatacache.hydrogen_peroxide_volume = ppm; |
|||
if (sensordatacache.hydrogen_peroxide_volume < 10) { |
|||
sensordatacache.hydrogen_peroxide_volume = 0; |
|||
} |
|||
// sensordatacache.hydrogen_peroxide_volume = 9973;
|
|||
|
|||
return &sensordatacache; |
|||
} |
|||
|
|||
void H2O2Sensor::onRceivePacket(Cmdheader_t* cmdheader, int sensorId) { |
|||
if (sensorId != m_sensorId) { |
|||
return; |
|||
} |
|||
|
|||
hpp272_data_t* sensordata = readSensorData(); |
|||
if (sensordata) { |
|||
txbuff[0] = sensorId; |
|||
txbuff[1] = 0; |
|||
memcpy(txbuff + 2, sensordata, sizeof(hpp272_data_t)); |
|||
m_zcanReceiver->sendAck(cmdheader, txbuff, sizeof(hpp272_data_t) + 2); |
|||
} else { |
|||
ZLOGE(TAG, "hpp272 is null"); |
|||
int16_t errcode = 1002; // 设备不在线
|
|||
m_zcanReceiver->sendErrorAck(cmdheader, errcode); |
|||
} |
|||
return; |
|||
} |
|||
|
|||
void H2O2Sensor::onRceivePacket(CanPacketRxBuffer* rxbuf, uint8_t* packet, size_t len) { |
|||
Cmdheader_t* cmdheader = (Cmdheader_t*)packet; |
|||
if (cmdheader->cmdid == kcmd_m211887_operation && cmdheader->subcmdid == 0) { |
|||
uint8_t id = cmdheader->data[0]; |
|||
onRceivePacket(cmdheader, id); |
|||
} |
|||
} |
|||
|
|||
#endif
|
@ -0,0 +1,45 @@ |
|||
//
|
|||
// Created by zwsd
|
|||
//
|
|||
|
|||
#pragma once
|
|||
#include "sdk/hal/zhal.hpp"
|
|||
//
|
|||
#include "sdk\components\vaisala_sensor\hpp272.hpp"
|
|||
#include "sdk\components\zcanreceiver\zcanreceiver.hpp"
|
|||
|
|||
#ifdef HAL_CAN_MODULE_ENABLED
|
|||
namespace iflytop { |
|||
|
|||
class H2O2Sensor : public ZCanRceiverListener { |
|||
private: |
|||
ZCanReceiver* m_zcanReceiver; |
|||
uint8_t txbuff[sizeof(hpp272_data_t) + 10]; |
|||
int32_t m_sensorId = -1; |
|||
int32_t m_modbusid = -1; |
|||
|
|||
hpp272_data_t sensordatacache; |
|||
|
|||
ModbusBlockHost modbusBlockHost; |
|||
|
|||
public: |
|||
H2O2Sensor(/* args */) {} |
|||
~H2O2Sensor() {} |
|||
|
|||
public: |
|||
void initialize(ZCanReceiver* zcanReceiver); |
|||
void regSubmodule(int id, UART_HandleTypeDef* huart, uint8_t modbusid); |
|||
virtual hpp272_data_t* readSensorData(); |
|||
|
|||
public: |
|||
virtual void onRceivePacket(CanPacketRxBuffer* rxbuf, uint8_t* packet, size_t len); |
|||
virtual void onRceivePacket(Cmdheader_t* cmdheader, int sensorId); |
|||
|
|||
private: |
|||
void loop(); |
|||
uint32_t readAdcVal(); |
|||
uint32_t readAvgAdcVal(); |
|||
}; |
|||
} // namespace iflytop
|
|||
|
|||
#endif
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue