Skip to content

Commit 977e132

Browse files
authored
Add zephyr.cfg (#5201)
1 parent 63b7e6a commit 977e132

3 files changed

Lines changed: 159 additions & 11 deletions

File tree

cfg/zephyr.cfg

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?xml version="1.0"?>
2+
<def format="2">
3+
4+
<function name="device_is_ready">
5+
<returnValue type="bool"/>
6+
<use-retval/>
7+
<pure/>
8+
<noreturn>false</noreturn>
9+
<leak-ignore/>
10+
<arg nr="1" direction="in">
11+
<not-uninit/>
12+
<not-null/>
13+
<not-bool/>
14+
</arg>
15+
</function>
16+
17+
<function name="gpio_init_callback">
18+
<returnValue type="void"/>
19+
<noreturn>false</noreturn>
20+
<leak-ignore/>
21+
<arg nr="1" direction="in">
22+
<not-uninit/>
23+
<not-null/>
24+
<not-bool/>
25+
</arg>
26+
<arg nr="2" direction="in">
27+
<not-uninit/>
28+
<not-null/>
29+
<not-bool/>
30+
</arg>
31+
<arg nr="3" direction="in">
32+
<not-uninit/>
33+
<not-bool/>
34+
</arg>
35+
</function>
36+
37+
<function name="gpio_add_callback">
38+
<returnValue type="int"/>
39+
<noreturn>false</noreturn>
40+
<leak-ignore/>
41+
<arg nr="1" direction="in">
42+
<not-uninit/>
43+
<not-null/>
44+
<not-bool/>
45+
</arg>
46+
<arg nr="2" direction="in">
47+
<not-uninit/>
48+
<not-null/>
49+
<not-bool/>
50+
</arg>
51+
</function>
52+
53+
<function name="gpio_pin_configure_dt,gpio_pin_interrupt_configure_dt">
54+
<returnValue type="int"/>
55+
<noreturn>false</noreturn>
56+
<leak-ignore/>
57+
<arg nr="1" direction="in">
58+
<not-uninit/>
59+
<not-null/>
60+
<not-bool/>
61+
</arg>
62+
<arg nr="2" direction="in">
63+
<not-uninit/>
64+
<not-bool/>
65+
</arg>
66+
</function>
67+
68+
<function name="gpio_pin_toggle_dt">
69+
<returnValue type="int"/>
70+
<noreturn>false</noreturn>
71+
<leak-ignore/>
72+
<arg nr="1" direction="in">
73+
<not-uninit/>
74+
<not-null/>
75+
<not-bool/>
76+
</arg>
77+
</function>
78+
79+
<function name="k_msleep">
80+
<returnValue type="int32_t"/>
81+
<noreturn>false</noreturn>
82+
<arg nr="1" direction="in">
83+
<not-uninit/>
84+
<valid>0:2147483647</valid>
85+
</arg>
86+
</function>
87+
88+
<function name="printk">
89+
<noreturn>false</noreturn>
90+
<leak-ignore/>
91+
<formatstr/>
92+
<arg nr="1" direction="in">
93+
<formatstr/>
94+
<not-uninit/>
95+
<strz/>
96+
</arg>
97+
</function>
98+
99+
<define name="KERN_EMERG" value="&quot;0&quot;"/>
100+
<define name="KERN_ALERT" value="&quot;1&quot;"/>
101+
<define name="KERN_CRIT" value="&quot;2&quot;"/>
102+
<define name="KERN_ERR" value="&quot;3&quot;"/>
103+
<define name="KERN_WARNING" value="&quot;4&quot;"/>
104+
<define name="KERN_NOTICE" value="&quot;5&quot;"/>
105+
<define name="KERN_INFO" value="&quot;6&quot;"/>
106+
<define name="KERN_DEBUG" value="&quot;7&quot;"/>
107+
<define name="KERN_DEFAULT" value="&quot;&quot;"/>
108+
<define name="KERN_CONT" value="&quot;c&quot;"/>
109+
110+
<define name="ARRAY_SIZE(array)" value="(sizeof(array) / sizeof((array)[0]))"/>
111+
<define name="BIT(x)" value="(1UL&lt;&lt;x)"/>
112+
<define name="IS_ENABLED(flag)" value="flag"/>
113+
</def>

gui/compliancereportdialog.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ void ComplianceReportDialog::buttonClicked(QAbstractButton* button)
9797

9898
void ComplianceReportDialog::save()
9999
{
100+
const QString std(mUI->mCodingStandard->currentText().toLower().replace(" ", "-"));
101+
100102
const QString outFile = QFileDialog::getSaveFileName(this,
101103
tr("Compliance report"),
102-
QDir::homePath() + "/misra-c-2012-compliance-report.html",
104+
QDir::homePath() + "/" + std + "-compliance-report.html",
103105
tr("HTML files (*.html)"));
104106
if (outFile.isEmpty())
105107
return;
@@ -166,11 +168,18 @@ void ComplianceReportDialog::save()
166168
tempFiles.close();
167169
}
168170

169-
QStringList args{"--compliant=misra-c2012-1.1",
170-
"--compliant=misra-c2012-1.2",
171-
"--project-name=" + projectName,
171+
QStringList args{"--project-name=" + projectName,
172172
"--project-version=" + projectVersion,
173173
"--output-file=" + outFile};
174+
175+
if (std.startsWith("misra-c-")) {
176+
args << "--misra-c"
177+
<< "--compliant=misra-c2012-1.1"
178+
<< "--compliant=misra-c2012-1.2";
179+
} else {
180+
args << ("--" + std);
181+
}
182+
174183
if (files)
175184
args << "--files=" + tempFiles.fileName();
176185
args << mResultsFile;

gui/compliancereportdialog.ui

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,51 @@
1616
<layout class="QVBoxLayout" name="verticalLayout">
1717
<item>
1818
<layout class="QGridLayout" name="gridLayout">
19-
<item row="0" column="0">
19+
<item row="2" column="0">
20+
<widget class="QLabel" name="label_2">
21+
<property name="text">
22+
<string>Project version</string>
23+
</property>
24+
</widget>
25+
</item>
26+
<item row="1" column="0">
2027
<widget class="QLabel" name="label">
2128
<property name="text">
2229
<string>Project name</string>
2330
</property>
2431
</widget>
2532
</item>
26-
<item row="0" column="1">
33+
<item row="1" column="1">
2734
<widget class="QLineEdit" name="mEditProjectName"/>
2835
</item>
29-
<item row="1" column="0">
30-
<widget class="QLabel" name="label_2">
36+
<item row="2" column="1">
37+
<widget class="QLineEdit" name="mEditProjectVersion"/>
38+
</item>
39+
<item row="0" column="0">
40+
<widget class="QLabel" name="label_3">
3141
<property name="text">
32-
<string>Project version</string>
42+
<string>Coding Standard</string>
3343
</property>
3444
</widget>
3545
</item>
36-
<item row="1" column="1">
37-
<widget class="QLineEdit" name="mEditProjectVersion"/>
46+
<item row="0" column="1">
47+
<widget class="QComboBox" name="mCodingStandard">
48+
<item>
49+
<property name="text">
50+
<string>Misra C 2023</string>
51+
</property>
52+
</item>
53+
<item>
54+
<property name="text">
55+
<string>Cert C</string>
56+
</property>
57+
</item>
58+
<item>
59+
<property name="text">
60+
<string>Cert C++</string>
61+
</property>
62+
</item>
63+
</widget>
3864
</item>
3965
</layout>
4066
</item>

0 commit comments

Comments
 (0)