-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from spacelab-ufsc/dev_firmware
Merge pull request from #141 spacelab-ufsc/dev_firmware
- Loading branch information
Showing
227 changed files
with
4,433 additions
and
21,063 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# unit-test-ngham.yml | ||
# | ||
# Copyright The TTC 2.0 Contributors. | ||
# | ||
# This file is part of TTC 2.0. | ||
# | ||
# TTC 2.0 is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# TTC 2.0 is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with TTC 2.0. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# | ||
|
||
name: NGHam unit tests | ||
|
||
on: | ||
push: | ||
branches: [dev_firmware] | ||
pull_request: | ||
branches: [master, dev, dev_firmware] | ||
|
||
# 'workflow_dispatch' allows manual execution of this workflow under the repository's 'Actions' tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
unit-tests: | ||
name: NGHam unit tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt install -y cmake libcmocka0 libcmocka-dev | ||
git clone https://github.com/mgm8/rsclib.git | ||
cd rsclib | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
sudo make install | ||
- name: Compile the test | ||
run: | | ||
cd firmware/app/libs/ngham-0.1/tests | ||
make | ||
- name: Execute the test | ||
run: ./firmware/app/libs/ngham-0.1/tests/ngham_unit_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# | ||
# unit-test-rsclib.yml | ||
# | ||
# Copyright The TTC 2.0 Contributors. | ||
# | ||
# This file is part of TTC 2.0. | ||
# | ||
# TTC 2.0 is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# TTC 2.0 is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with TTC 2.0. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# | ||
|
||
name: RSCLib unit tests | ||
|
||
on: | ||
push: | ||
branches: [dev_firmware] | ||
pull_request: | ||
branches: [master, dev, dev_firmware] | ||
|
||
# 'workflow_dispatch' allows manual execution of this workflow under the repository's 'Actions' tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
unit-tests: | ||
name: RSCLib unit tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: sudo apt install -y cmake libcmocka0 libcmocka-dev | ||
|
||
- name: Compile the test | ||
run: | | ||
cd firmware/app/libs/rsclib-0.1/tests | ||
cmake . | ||
make | ||
- name: Execute the test | ||
run: ./firmware/app/libs/rsclib-0.1/tests/rsc_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# test.yml | ||
# | ||
# Copyright The RSCLib Contributors. | ||
# | ||
# This file is part of RSCLib. | ||
# | ||
# RSCLib is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# RSCLib is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with RSCLib. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# | ||
|
||
name: Unit tests | ||
|
||
on: | ||
push: | ||
branches: [dev] | ||
pull_request: | ||
branches: [main, dev] | ||
|
||
# 'workflow_dispatch' allows manual execution of this workflow under the repository's 'Actions' tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
unit-tests: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt install -y cmake libcmocka0 libcmocka-dev | ||
git clone https://github.com/mgm8/rsclib.git | ||
cd rsclib | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
sudo make install | ||
- name: Compile the test | ||
run: | | ||
cd tests | ||
make | ||
- name: Execute the test | ||
run: ./tests/ngham_unit_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Linker output | ||
*.ilk | ||
*.map | ||
*.exp | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
*.dSYM/ | ||
*.su | ||
*.idb | ||
*.pdb | ||
|
||
# Kernel Module Compile Results | ||
*.mod* | ||
*.cmd | ||
.tmp_versions/ | ||
modules.order | ||
Module.symvers | ||
Mkfile.old | ||
dkms.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Disable in-source builds to prevent source tree corruption. | ||
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}") | ||
message(FATAL_ERROR "FATAL: In-source builds are not allowed. You should create a separate directory for build files.") | ||
endif() | ||
|
||
project(ngham C) | ||
|
||
include_directories(${CMAKE_SOURCE_DIR}/include) | ||
|
||
add_library(ngham STATIC ${CMAKE_SOURCE_DIR}/src/ngham.c) | ||
add_library(crc_ccitt STATIC ${CMAKE_SOURCE_DIR}/src/crc_ccitt.c) | ||
|
||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include) | ||
install(TARGETS ngham DESTINATION lib) |
File renamed without changes.
File renamed without changes.
62 changes: 62 additions & 0 deletions
62
firmware/app/libs/ngham-0.1/include/ngham/ccsds_scrambler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* ccsds_scrambler.h | ||
* | ||
* Copyright The NGHam Contributors. | ||
* | ||
* This file is part of NGHam. | ||
* | ||
* NGHam is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* NGHam is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with NGHam. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* \brief CCSDS scrambler definition. | ||
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.0.0 | ||
* | ||
* \date 2023/03/12 | ||
* | ||
* \defgroup ccsds-scrambler CCSDS Scrambler | ||
* \ingroup ngham | ||
* \{ | ||
*/ | ||
|
||
#ifndef CCSDS_SCRAMBLER_H_ | ||
#define CCSDS_SCRAMBLER_H_ | ||
|
||
#include <stdint.h> | ||
|
||
extern const uint8_t ccsds_poly[255]; | ||
|
||
/** | ||
* \brief . | ||
* | ||
* \return . | ||
*/ | ||
void ccsds_scrambler_init(void); | ||
|
||
/** | ||
* \brief . | ||
* | ||
* \param[in] data . | ||
* | ||
* \return . | ||
*/ | ||
uint8_t ccsds_scrambler_xor(uint8_t data); | ||
|
||
#endif /* CCSDS_SCRAMBLER_H_ */ | ||
|
||
/**< \} End of ccsds-scrambler group */ |
Oops, something went wrong.