Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
golwalkars committed Dec 18, 2023
1 parent 16f16e1 commit f17c4c6
Showing 7 changed files with 1,237 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeCache.txt
Original file line number Diff line number Diff line change
@@ -209,6 +209,9 @@ CMAKE_STRIP:FILEPATH=/usr/bin/strip
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE

//No help, variable specified on the command line.
EXPORT_COMPILE_COMMANDs:UNINITIALIZED=ON

//Value Computed by CMake
dbc_example_BINARY_DIR:STATIC=/home/coventry/Documents/7166CEM

Binary file added bin/main
Binary file not shown.
Binary file added bin/main_test
Binary file not shown.
2 changes: 2 additions & 0 deletions include/signal.h
Original file line number Diff line number Diff line change
@@ -19,6 +19,8 @@ struct candata_motor_current_t Curr_value;
uint16_t Max_Front_RPM;
uint16_t Max_Rear_RPM;



bool RPM_FRAME_FLAG;
bool TRQ_FRAME_FLAG;
bool VOLT_FRAME_FLAG;
439 changes: 439 additions & 0 deletions src_autogen/candata.c

Large diffs are not rendered by default.

609 changes: 609 additions & 0 deletions src_autogen/candata.h

Large diffs are not rendered by default.

184 changes: 184 additions & 0 deletions tidy-output.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
/home/coventry/Documents/7166CEM/src/main.c:1:1: warning: system include math.h not allowed [llvmlibc-restrict-system-libc-headers]
#include <math.h>
^~~~~~~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:2:1: warning: system include stdio.h not allowed [llvmlibc-restrict-system-libc-headers]
#include <stdio.h>
^~~~~~~~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:3:1: warning: system include stdlib.h not allowed [llvmlibc-restrict-system-libc-headers]
#include <stdlib.h>
^~~~~~~~~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:4:1: warning: system include string.h not allowed [llvmlibc-restrict-system-libc-headers]
#include <string.h>
^~~~~~~~~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:5:1: warning: system include unistd.h not allowed [llvmlibc-restrict-system-libc-headers]
#include <unistd.h>
^~~~~~~~~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:7:1: warning: system include linux/can.h not allowed [llvmlibc-restrict-system-libc-headers]
#include <linux/can.h>
^~~~~~~~~~~~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:8:1: warning: system include linux/can/raw.h not allowed [llvmlibc-restrict-system-libc-headers]
#include <linux/can/raw.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:10:10: error: 'can_wrap.h' file not found [clang-diagnostic-error]
#include "can_wrap.h"
^~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:12:1: warning: system include signal.h not allowed [llvmlibc-restrict-system-libc-headers]
#include "signal.h"
^~~~~~~~~~~~~~~~~~~
/home/coventry/Documents/7166CEM/src/main.c:17:3: warning: if with identical then and else branches [bugprone-branch-clone]
if (rpm.fl_wheel_speed > rpm.fr_wheel_speed) {
^
/home/coventry/Documents/7166CEM/src/main.c:24:3: note: else branch starts here
else {
^
/home/coventry/Documents/7166CEM/src/main.c:30:3: warning: if with identical then and else branches [bugprone-branch-clone]
if (rpm.rl_wheel_speed > rpm.rr_wheel_speed) {
^
/home/coventry/Documents/7166CEM/src/main.c:37:3: note: else branch starts here
else {
^
/home/coventry/Documents/7166CEM/src/main.c:56:16: warning: variable 'Front_Req' is not initialized [cppcoreguidelines-init-variables]
const float Front_Req = Initilize;
^
= NAN
/home/coventry/Documents/7166CEM/src/main.c:57:16: warning: variable 'Steer_Req' is not initialized [cppcoreguidelines-init-variables]
const float Steer_Req = Initilize;
^
= NAN
/home/coventry/Documents/7166CEM/src/main.c:58:17: warning: variable 'Rear_req' is not initialized [cppcoreguidelines-init-variables]
const float Rear_req = Initilize;
^
= NAN
/home/coventry/Documents/7166CEM/src/main.c:82:16: warning: variable 'Bat_Value' is not initialized [cppcoreguidelines-init-variables]
const double Bat_Value =
^
= NAN
/home/coventry/Documents/7166CEM/src/main.c:95:6: warning: function 'RPM_Battery_LIMITER' has cognitive complexity of 68 (threshold 25) [readability-function-cognitive-complexity]
void RPM_Battery_LIMITER() {
^
/home/coventry/Documents/7166CEM/src/main.c:98:3: note: +1, including nesting penalty of 0, nesting level increased to 1
if (Vol_value.voltage >= 2.8) {
^
/home/coventry/Documents/7166CEM/src/main.c:100:5: note: +2, including nesting penalty of 1, nesting level increased to 2
if (Trq_Req.front_trq_request > 0) {
^
/home/coventry/Documents/7166CEM/src/main.c:101:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM > 700) && (Trq_Req.front_trq_request > 50)) {
^
/home/coventry/Documents/7166CEM/src/main.c:104:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM <= 700) && (Max_Front_RPM > 600) &&
^
/home/coventry/Documents/7166CEM/src/main.c:108:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM <= 600) && (Max_Front_RPM > 500) &&
^
/home/coventry/Documents/7166CEM/src/main.c:113:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM <= 500) && (Max_Front_RPM > 400) &&
^
/home/coventry/Documents/7166CEM/src/main.c:117:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM <= 400) && (Max_Front_RPM > 300) &&
^
/home/coventry/Documents/7166CEM/src/main.c:124:5: note: +1, nesting level increased to 2
else {
^
/home/coventry/Documents/7166CEM/src/main.c:126:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM > 700) && (abs(Trq_Req.front_trq_request) > 50)) {
^
/home/coventry/Documents/7166CEM/src/main.c:129:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM <= 700) && (Max_Front_RPM > 600) &&
^
/home/coventry/Documents/7166CEM/src/main.c:133:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM <= 600) && (Max_Front_RPM > 500) &&
^
/home/coventry/Documents/7166CEM/src/main.c:138:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM <= 500) && (Max_Front_RPM > 400) &&
^
/home/coventry/Documents/7166CEM/src/main.c:142:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Front_RPM <= 400) && (Max_Front_RPM > 300) &&
^
/home/coventry/Documents/7166CEM/src/main.c:150:5: note: +2, including nesting penalty of 1, nesting level increased to 2
if (Trq_Req.rear_trq_request > 0) {
^
/home/coventry/Documents/7166CEM/src/main.c:151:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM > 700) && (Trq_Req.rear_trq_request > 50)) {
^
/home/coventry/Documents/7166CEM/src/main.c:154:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM <= 700) && (Max_Rear_RPM > 600) &&
^
/home/coventry/Documents/7166CEM/src/main.c:158:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM <= 600) && (Max_Rear_RPM > 500) &&
^
/home/coventry/Documents/7166CEM/src/main.c:163:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM <= 500) && (Max_Rear_RPM > 400) &&
^
/home/coventry/Documents/7166CEM/src/main.c:167:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM <= 400) && (Max_Rear_RPM > 300) &&
^
/home/coventry/Documents/7166CEM/src/main.c:174:5: note: +1, nesting level increased to 2
else {
^
/home/coventry/Documents/7166CEM/src/main.c:176:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM > 700) && (abs(Trq_Req.rear_trq_request) > 50)) {
^
/home/coventry/Documents/7166CEM/src/main.c:179:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM <= 700) && (Max_Rear_RPM > 600) &&
^
/home/coventry/Documents/7166CEM/src/main.c:183:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM <= 600) && (Max_Rear_RPM > 500) &&
^
/home/coventry/Documents/7166CEM/src/main.c:188:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM <= 500) && (Max_Rear_RPM > 400) &&
^
/home/coventry/Documents/7166CEM/src/main.c:192:7: note: +3, including nesting penalty of 2, nesting level increased to 3
if ((Max_Rear_RPM <= 400) && (Max_Rear_RPM > 300) &&
^
/home/coventry/Documents/7166CEM/src/main.c:197:5: note: +1, nesting level increased to 1
} else {
^
/home/coventry/Documents/7166CEM/src/main.c:100:5: warning: if with identical then and else branches [bugprone-branch-clone]
if (Trq_Req.front_trq_request > 0) {
^
/home/coventry/Documents/7166CEM/src/main.c:124:5: note: else branch starts here
else {
^
/home/coventry/Documents/7166CEM/src/main.c:150:5: warning: if with identical then and else branches [bugprone-branch-clone]
if (Trq_Req.rear_trq_request > 0) {
^
/home/coventry/Documents/7166CEM/src/main.c:174:5: note: else branch starts here
else {
^
/home/coventry/Documents/7166CEM/src/main.c:210:16: warning: variable 'Front_Motor' is not initialized [cppcoreguidelines-init-variables]
const double Front_Motor =
^
= NAN
/home/coventry/Documents/7166CEM/src/main.c:215:16: warning: variable 'Rear_Motor' is not initialized [cppcoreguidelines-init-variables]
const double Rear_Motor =
^
= NAN
/home/coventry/Documents/7166CEM/src/main.c:226:13: warning: variable 'canSocket' is not initialized [cppcoreguidelines-init-variables]
const int canSocket = can_connect(canChannel, false);
^
= 0
/home/coventry/Documents/7166CEM/src/main.c:241:3: warning: kernel performance could be improved by unrolling this loop with a '#pragma unroll' directive [altera-unroll-loops]
for (int i = 0; i < frame0.can_dlc; ++i)
^
/home/coventry/Documents/7166CEM/src/main.c:241:43: warning: statement should be inside braces [google-readability-braces-around-statements,hicpp-braces-around-statements,readability-braces-around-statements]
for (int i = 0; i < frame0.can_dlc; ++i)
^
{
/home/coventry/Documents/7166CEM/src/main.c:245:38: warning: statement should be inside braces [google-readability-braces-around-statements,hicpp-braces-around-statements,readability-braces-around-statements]
if (!can_write(canSocket, &frame0))
^
{
/home/coventry/Documents/7166CEM/src/main.c:247:3: warning: function is not thread safe [concurrency-mt-unsafe]
sleep(1);
^
/home/coventry/Documents/7166CEM/src/main.c:272:14: warning: parameter 'argc' is unused [misc-unused-parameters]
int main(int argc, char *argv[]) {
^
/home/coventry/Documents/7166CEM/src/main.c:272:26: warning: parameter 'argv' is unused [misc-unused-parameters]
int main(int argc, char *argv[]) {
^
/home/coventry/Documents/7166CEM/src/main.c:275:13: warning: variable 'canSocket' is not initialized [cppcoreguidelines-init-variables]
const int canSocket = can_connect(canChannel, false);
^
= 0

0 comments on commit f17c4c6

Please sign in to comment.