Skip to content

Commit

Permalink
firmware: Fixing MISRA-C violations and updating the static analysis …
Browse files Browse the repository at this point in the history
…workflow
  • Loading branch information
mgm8 committed Feb 25, 2024
1 parent c1fc115 commit b804d50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# static-analysis-workflow.yml
#
# Copyright (C) 2021, SpaceLab.
# Copyright The OBDH 2.0 Contributors.
#
# This file is part of OBDH 2.0.
#
Expand Down Expand Up @@ -49,7 +49,13 @@ jobs:
run: sudo apt install -y cppcheck

- name: Execute CppCheck on tasks files
run: cppcheck --std=c99 --force --error-exitcode=-1 --addon=misra.py firmware/app/tasks/
run: cppcheck --std=c99 --force --error-exitcode=-1 --inline-suppr --addon=misra.py firmware/app/tasks/

- name: Execute CppCheck on utils files
run: cppcheck --std=c99 --force --error-exitcode=-1 --addon=misra.py firmware/app/utils/

- name: Execute CppCheck on structs files
run: cppcheck --std=c99 --force --error-exitcode=-1 --addon=misra.py firmware/app/structs/

- name: Execute CppCheck on devices files
run: cppcheck --std=c99 --error-exitcode=-1 --addon=misra.py firmware/devices/
Expand Down
5 changes: 3 additions & 2 deletions firmware/app/utils/mem_mng.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ void mem_mng_load_obdh_data_from_default_values(obdh_telemetry_t *tel)
uint8_t tle_line1[70] = OBDH_PARAM_POSITION_TLE_LINE1_DEFAULT_VAL;
uint8_t tle_line2[70] = OBDH_PARAM_POSITION_TLE_LINE2_DEFAULT_VAL;

memcpy(&tel->data.position.tle_line1, &tle_line1[0], 70U);
memcpy(&tel->data.position.tle_line2, &tle_line2[0], 70U);
void *null_ptr;
null_ptr = memcpy(&tel->data.position.tle_line1, &tle_line1[0], 70U);
null_ptr = memcpy(&tel->data.position.tle_line2, &tle_line2[0], 70U);

tel->data.position.latitude = OBDH_PARAM_POSITION_LATITUDE_DEFAULT_VAL;
tel->data.position.longitude = OBDH_PARAM_POSITION_LONGITUDE_DEFAULT_VAL;
Expand Down

0 comments on commit b804d50

Please sign in to comment.